X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Makefile.PL;h=93598a12ae03c4039ae9da44604663be90be4e92;hb=14f8af239bcc9baaf072b0eb42422f684906953d;hp=644bb90b051aee2da50b66e2bfaa0c09c088ed1e;hpb=8d4ae54e13365dd788ce6f40826980252726c235;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/Makefile.PL b/Makefile.PL index 644bb90..93598a1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,6 +11,7 @@ BEGIN { } my @DEFINES; +my %macro; my $pl = $Config{perl_patchlevel}; print "Checking perl patchlevel... "; @@ -19,38 +20,68 @@ if (defined $pl && length $pl) { push @DEFINES, '-DVMG_PERL_PATCHLEVEL=' . $pl; print $pl, "\n"; } else { + $pl = undef; print "none\n"; } -my $is_as = 0; +my $as_perl = eval { + require ActivePerl; + defined &ActivePerl::BUILD ? ActivePerl::BUILD() : undef +}; + +my $is_as_822 = 0; print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... "; -if ($^V eq v5.8.8) { - eval { - require ActivePerl; - 1; - } and do { - if (defined &ActivePerl::BUILD) { - my $build = int ActivePerl::BUILD(); - if ($build >= 822) { - $is_as = 1; - push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1'; - } - } +if ($^V eq v5.8.8 and defined $as_perl and $as_perl >= 822) { + $is_as_822 = 1; + push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1'; +} +print $is_as_822 ? "yes\n" : "no\n"; + +my $is_5110rel = 0; +print "Checking if this is a released perl 5.11.0 or higher... "; +if ($^V ge v5.11.0 and not defined $pl) { + my $describe = $Config{git_describe}; + # An empty 'describe' is fine + if (defined $describe and $describe !~ /^GitLive-/) { + $is_5110rel = 1; + push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=0'; + } +} +print $is_5110rel ? "yes\n" : "no\n"; + +my $is_gcc_34 = 0; +print "Checking if this is gcc 3.4 on Windows trying to link against an import library... "; +if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) { + my ($libperl, $gccversion) = map $_ || '', @Config{qw/libperl gccversion/}; + if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) { + $is_gcc_34 = 1; + my ($lddlflags, $ldflags) = @Config{qw/lddlflags ldflags/}; + $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags; + $libperl = "-l$libperl"; + my $libdirs = join ' ', + map { s/(? join ' ', @DEFINES) if @DEFINES; +%macro = (macro => { %macro }) if %macro; # Beware of the circle my $dist = 'Variable-Magic'; @@ -105,4 +136,5 @@ WriteMakefile( clean => { FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt" }, + %macro, );