X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Makefile.PL;fp=Makefile.PL;h=93598a12ae03c4039ae9da44604663be90be4e92;hb=14f8af239bcc9baaf072b0eb42422f684906953d;hp=cef05b243960677eb4be4031f21aff54c6cd4086;hpb=5ee81319ae7bca761e7fa6f33df2794a1cb5be76;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/Makefile.PL b/Makefile.PL index cef05b2..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... "; @@ -48,6 +49,25 @@ if ($^V ge v5.11.0 and not defined $pl) { } 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'; @@ -115,4 +136,5 @@ WriteMakefile( clean => { FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt" }, + %macro, );