X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Makefile.PL;h=1c5c428370cef5598b9dd3158304139b31be1bae;hb=58c8376249ad7e2cceaad99801c370c3d1d412a6;hp=3c510a82b90fc9325639337739b662a6c6eefba6;hpb=e966f929bc46470f039c5d5a79d3a3463891ded7;p=perl%2Fmodules%2Fautovivification.git diff --git a/Makefile.PL b/Makefile.PL index 3c510a8..1c5c428 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,10 +1,37 @@ -use 5.008001; +use 5.008003; use strict; use warnings; use ExtUtils::MakeMaker; +BEGIN { + local $@; + eval { require Config }; + die 'OS unsupported' if $@; + Config->import(qw<%Config>); +} + my @DEFINES; +my %macro; + +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}; + if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) { + $is_gcc_34 = 1; + my ($lddlflags, $ldflags) = @Config{qw}; + $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags; + $libperl = "-l$libperl"; + my $libdirs = join ' ', + map { s/(?}; + $macro{LDDLFLAGS} = "$lddlflags $libdirs $libperl"; + $macro{LDFLAGS} = "$ldflags $libdirs $libperl"; + $macro{PERL_ARCHIVE} = '', + } +} +print $is_gcc_34 ? "yes\n" : "no\n"; # Threads, Windows and 5.8.x don't seem to be best friends if ($^O eq 'MSWin32' && $^V lt v5.9.0) { @@ -17,6 +44,7 @@ if ($^O eq 'MSWin32' && $^V lt v5.10.1) { } @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES; +%macro = (macro => { %macro }) if %macro; # Beware of the circle my $dist = 'autovivification'; @@ -56,7 +84,7 @@ WriteMakefile( PL_FILES => {}, @DEFINES, PREREQ_PM => \%PREREQ_PM, - MIN_PERL_VERSION => 5.008001, + MIN_PERL_VERSION => 5.008003, META_MERGE => \%META, dist => { PREOP => "pod2text $file > \$(DISTVNAME)/README", @@ -65,4 +93,5 @@ WriteMakefile( clean => { FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt" }, + %macro, );