-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile.PL
executable file
·47 lines (39 loc) · 1.42 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
use ExtUtils::MakeMaker;
use Config;
my $core = grep { $_ eq 'PERL_CORE=1' } @ARGV;
my $ccflags = $Config{ccflags};
my $lddlflags = $Config{lddlflags};
if ( -d '.svn' or -d '.git' ) {
$ccflags .= ' -ansi -Wall -Wextra' if $Config{cc} =~ /gcc/;
}
if ($] < 5.007) {
# We are not called by ../Makefile.PL, but be sure about that for now.
print "perl 5.6 does still use the builtin Bytecode compiler and ByteLoader\n";
ExtUtils::MakeMaker::WriteEmptyMakefile;
exit;
}
WriteMakefile(
NAME => 'ByteLoader',
VERSION_FROM => 'ByteLoader.pm',
XSPROTOARG => '-noprototypes',
OBJECT => 'byterun$(OBJ_EXT) ByteLoader$(OBJ_EXT)',
LDDLFLAGS => $lddlflags,
CCFLAGS => $ccflags,
clean => { FILES =>
"byterun.* *.core *.stackdump a.out *.c *.o *~ dll.base dll.exp"},
);
sub MY::depend {
my $up = File::Spec->updir;
my $bytecode_pl = File::Spec->catdir( '..', 'bytecode.pl' );
return "
\$(INST_LIB)/ByteLoader.pm : ByteLoader.pm
\$(NOECHO) \$(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' -- \
ByteLoader.pm \$(INST_LIB)/ByteLoader.pm
byterun.c : $bytecode_pl Makefile bytecode.h
cd $up && \$(PERL) bytecode.pl && cd ByteLoader
byterun.h : $bytecode_pl Makefile
cd $up && \$(PERL) bytecode.pl && cd ByteLoader
ByteLoader.c: byterun.h Makefile
ByteLoader\$(OBJ_EXT) : byterun.h byterun.c bytecode.h Makefile
"
}