-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.PL
More file actions
69 lines (61 loc) · 1.73 KB
/
Makefile.PL
File metadata and controls
69 lines (61 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package MY;
use strict;
use ExtUtils::MakeMaker;
use Config;
use Prima::Config;
my @libs;
my @obj = ('OpenGL.o');
if (
$^O eq 'MSWin32' or
( $^O eq 'cygwin' and $Prima::Config::Config{platform} eq 'win32')
) {
push @libs, '-L/lib/w32api' if $^O eq 'cygwin';
push @libs, '-lopengl32 -lmsimg32';
push @libs, map { "-l$_" } @{$Prima::Config::Config{ldlibs} };
push @obj, 'win32.o';
} elsif ( $^O eq 'darwin') {
push @libs, map { "-L$_" } @{$Prima::Config::Config{ldpaths} };
push @obj, 'x11.o';
push @libs, '-lglut';
my ($metal, $x11) = (0,0);
for my $inc (@INC) {
my $n = "$inc/auto/OpenGL/Modern/Modern.bundle";
next unless -f $n;
$n = `otool -L $n 2>/dev/null`;
$metal = 1 if $n =~ /OpenGL.framework/;
$x11 = 1 if $n =~ m[/opt/X11/lib/libglut];
last;
}
warn <<WARN if $metal + $x11 < 2;
** Warning: OpenGL::Modern is built without XQuartz/GLX support.
The module will compile but most probably won't work.
See more in README.md
WARN
} else {
push @obj, 'x11.o';
push @libs, '-lGL';
}
push @libs, qq{"$Prima::Config::Config{libs}"} if $Prima::Config::Config{libs};
WriteMakefile(
NAME => 'Prima::OpenGL',
VERSION_FROM => 'lib/Prima/OpenGL.pm',
MIN_PERL_VERSION => '5.012',
PREREQ_PM => {
'Prima' => 1.74,
'OpenGL::Modern' => 0.04,
},
CONFIGURE_REQUIRES => {
'Prima' => 0,
},
ABSTRACT_FROM => 'lib/Prima/OpenGL.pm',
AUTHOR => 'Dmitry Karasik <dmitry@karasik.eu.org>',
LIBS => [qq{:nosearch @libs}],
DEFINE => $Prima::Config::Config{define},
INC => "$Prima::Config::Config{inc} -Iinclude",
OBJECT => "@obj",
META_MERGE => {
resources => {
repository => 'http://github.com/dk/Prima-OpenGL',
},
},
);