-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.PL
65 lines (57 loc) · 2.4 KB
/
Makefile.PL
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
use 5.008009;
use ExtUtils::MakeMaker;
use Config;
#use blib "../Alien-SFML/blib/";
use Alien::SFML;
my $alien = Alien::SFML->new;
my $suppressedwarnings = "-Wno-unused-variable -Wno-duplicate-decl-specifier";
my $clang = `clang -v 2>&1` =~ /clang version [^ ]{2,}/;
my $gpp = `g++ -v 2>&1` =~ /^gcc version [^ ]{3,}/m;
my $fallback = $Config{cc} . " -x c++ -Wall -ggdb $suppressedwarnings";
if ($clang) {
print "Using clang compiler\n";
} elsif ($gpp) {
print "Using g++ to compile\n";
} else {
print "Using fallback compiler (" . $Config{cc} . ")\n";
}
my $compiler = WriteMakefile(
NAME => 'SFML',
BUILD_REQUIRES => {
'ExtUtils::CBuilder' => 0,
'Alien::SFML' => 0.02,
},
CONFIGURE_REQUIRES => {
'Alien::SFML' => 0.02,
},
PREREQ_PM => {
'Alien::SFML' => 0.02,
},
LICENSE => 'zlib',
VERSION_FROM => 'lib/SFML.pm', # finds $VERSION
ABSTRACT_FROM => 'lib/SFML.pm', # retrieve abstract from module
AUTHOR => 'Jake Bott <[email protected]>, Georgiy Tugai <[email protected]>',
CC => (
$clang ? "clang -x c++ -Wall -ggdb $suppressedwarnings"
: (
$gpp ? "g++ -Wall -ggdb $suppressedwarnings"
: $fallback
)
),
LD => $Config{ld} . ' -Wall -ggdb ',
XSOPT => '-C++',
CCFLAGS => $alien->cflags(),
TYPEMAPS => [ 'perlobject.map', 'string.map', 'typemaps/Window.map', 'typemaps/Graphics.map' ],
LIBS => [ $alien->libs() ], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => '-I.', # e.g., '-I. -I/usr/include/other'
# Un-comment this if you add C files to link with later:
# OBJECT => '$(O_FILES)', # link all the C files too
);
=head1 COPYRIGHT
############################################
# Copyright 2013 Jake Bott, Georgiy Tugai. #
#=>--------------------------------------<=#
# All Rights Reserved. Part of perl-sfml #
############################################
=cut