forked from dagolden/extutils-makemaker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.PL
76 lines (59 loc) · 2.06 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
# A template for Makefile.PL.
# - Set the $PACKAGE variable to the name of your module.
# - Set $LAST_API_CHANGE to reflect the last version you changed the API
# of your module.
# - Fill in your dependencies in PREREQ_PM
# Alternatively, you can say the hell with this and use h2xs.
use 5.006;
use lib qw(lib); # build ourself with ourself
use ExtUtils::MakeMaker;
$PACKAGE = 'ExtUtils::MakeMaker';
($PACKAGE_FILE = $PACKAGE) =~ s|::|/|g;
$LAST_API_CHANGE = 5.50;
eval "require $PACKAGE";
unless ($@) { # Make sure we did find the module.
print <<"CHANGE_WARN" if ${$PACKAGE.'::VERSION'} < $LAST_API_CHANGE;
NOTE: There have been API changes between this version and any older
than version $LAST_API_CHANGE! Please read the Changes file if you
are upgrading from a version older than $LAST_API_CHANGE.
CHANGE_WARN
}
WriteMakefile(
NAME => $PACKAGE,
VERSION_FROM => "lib/$PACKAGE_FILE.pm", # finds $VERSION
PREREQ_PM => { File::Spec => 0.8,
File::Basename => 0,
DirHandle => 0,
},
INSTALLDIRS => 'perl',
EXE_FILES => [qw(bin/instmodsh)],
);
{
package MY;
use File::Spec;
my $lib;
BEGIN { $lib = File::Spec->rel2abs('lib'); }
# Make sure PERLRUN uses the MakeMaker about to be installed
# and not the currently installed one.
sub init_PERL {
my($self) = shift;
$self->SUPER::init_PERL;
$self->{PERLRUN} .= qq{ "-I$lib"};
$self->{FULLPERLRUN} .= qq{ "-I$lib"};
}
sub test_via_harness {
my($self, $orig_perl, $tests) = @_;
my @perls = ($orig_perl);
push @perls, map "PERL5LIB=$lib /usr/local/bin/$_",
qw(bleadperl-optimized
perl5.6.1
perl5.6.0
)
if $ENV{PERL_TEST_ALL};
my $out;
foreach my $perl (@perls) {
$out .= $self->SUPER::test_via_harness($perl, $tests);
}
return $out;
}
}