X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Makefile.PL;h=57d8b81816c4242d993eeef3a867d2180b1a4173;hb=06f02edd22171ea5cdb1afca36e74ec65b772609;hp=644bb90b051aee2da50b66e2bfaa0c09c088ed1e;hpb=8d4ae54e13365dd788ce6f40826980252726c235;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/Makefile.PL b/Makefile.PL index 644bb90..57d8b81 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,46 +11,54 @@ BEGIN { } my @DEFINES; +my %macro; -my $pl = $Config{perl_patchlevel}; -print "Checking perl patchlevel... "; -if (defined $pl && length $pl) { - $pl = int $pl; - push @DEFINES, '-DVMG_PERL_PATCHLEVEL=' . $pl; - print $pl, "\n"; -} else { - print "none\n"; -} +my $as_perl = eval { + require ActivePerl; + defined &ActivePerl::BUILD ? ActivePerl::BUILD() : undef +}; -my $is_as = 0; +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_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 +113,5 @@ WriteMakefile( clean => { FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt" }, + %macro, );