-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.PL
76 lines (71 loc) · 1.83 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
66
67
68
69
70
71
72
73
74
75
76
use 5.014;
use strict;
use warnings;
use ExtUtils::MakeMaker;
use Getopt::Long qw(GetOptions);
# --no-jit disables JIT even if available, otherwise when enabled,
# falls through to non-JIT, standard Lua if "Alien::LuaJIT" isn't
# available.
GetOptions(
'jit!' => \(my $use_jit = 1),
);
my $OPTIMIZE;
my $DEFINE = '';
if ($ENV{DEBUG}) {
# gccism but all known people who've tried to debug PLua use gcc
$OPTIMIZE = '-DDEBUG -O0 -g -Wall -Wextra -Wno-unused-function';
}
else {
$OPTIMIZE = '-DNDEBUG';
}
use Alien::Lua;
my $alien = Alien::Lua->new(luajit => $use_jit);
my $libs = $alien->libs;
my $cflags = $alien->cflags;
if ($alien->luajit) {
$DEFINE .= " -DPLU_LUAJIT";
say "Using Alien::LuaJIT-configured luajit";
}
elsif (!$use_jit) {
say "Explicitly disabled use of luajit";
}
else {
say "Alien::LuaJIT not available, using standard Alien::Lua";
}
WriteMakefile(
NAME => 'PLua',
AUTHOR => q{Steffen Mueller <[email protected]>},
VERSION_FROM => 'lib/PLua.pm',
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '6.56',
'Alien::Lua' => '5.1.0', # min 5.1.0
},
LICENSE => 'perl',
PL_FILES => {},
BUILD_REQUIRES => {
'Test::More' => 0,
},
PREREQ_PM => {
'XSLoader' => 0,
'Carp' => 0,
},
MIN_PERL_VERSION => '5.14.0',
META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
repository => {
url => 'git://github.com/tsee/p5-PLua.git',
web => 'https://github.com/tsee/p5-PLua',
type => 'git',
},
},
},
depend => { Makefile => '$(VERSION_FROM)' },
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'PLua-*' },
DEFINE => $DEFINE,
LIBS => $libs,
INC => "-I. $cflags",
OPTIMIZE => $OPTIMIZE,
OBJECT => '$(O_FILES)',
);