[MSCHWERN - Thu Dec 9 17:57:55 2004]:
Show quoted text> Is this bug still a problem with 5.8.6 and MakeMaker 6.24?
Yes.
With a fresh 5.8.6 + MM 6.24, the original example that I gave is still
valid: Trying to build XML-Parser I want to have "DEFINE=-DXML_STATIC"
as a Makefile.PL argument and have that passed-thru to the Expat/
sub-directory, but it doesn't happen.
You may recall there was some work done by Jarkko and myself to fix this
in the lead up to 5.8.1, but it was removed from 5.8.1-to-be just before
release due to concerns over the regression risk.
You can see the (long) p5p thread discussing this here:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-08/thrd4.html#00272
Perl change #20561 is the one that pulled it out of 5.8.1-to-be.
Attached is that change reformulated as a patch to put it back into MM 6.24.
If I apply the attached patch then my XML-Parser example now works, and
MM's own test suite still passes too.
I'm not saying it's right, though. There are still worrying regression
risks, and the issue seems to have cropped up several other times on
p5p, e.g.
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-07/msg00150.html
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-07/msg01571.html
- Steve
diff -ru ExtUtils-MakeMaker-6.24.orig/lib/ExtUtils/MM_Unix.pm ExtUtils-MakeMaker-6.24/lib/ExtUtils/MM_Unix.pm
--- ExtUtils-MakeMaker-6.24.orig/lib/ExtUtils/MM_Unix.pm 2004-11-16 13:04:08.000000000 +0000
+++ ExtUtils-MakeMaker-6.24/lib/ExtUtils/MM_Unix.pm 2004-12-10 09:20:01.797487500 +0000
@@ -9,6 +9,7 @@
use Config qw(%Config);
use File::Basename qw(basename dirname);
use DirHandle;
+use Text::ParseWords;
use vars qw($VERSION @ISA
$Is_OS2 $Is_VMS $Is_Win32 $Is_Win95 $Is_Dos $Is_VOS
@@ -20,7 +21,7 @@
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '1.45';
+$VERSION = '1.45_01';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
@@ -126,30 +127,30 @@
$cpp_cmd =~ s/^CCCMD\s*=\s*\$\(CC\)/$cpp/;
push @m, '
.c.i:
- '. $cpp_cmd . ' $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i
+ '. $cpp_cmd . ' $(CCCDLFLAGS) "-I$(PERL_INC)" $(DEFINE) $(PASTHRU_DEFINE) $*.c > $*.i
';
}
push @m, '
.c.s:
- $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c
+ $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(DEFINE) $(PASTHRU_DEFINE) $*.c
';
push @m, '
.c$(OBJ_EXT):
- $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c
+ $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(DEFINE) $(PASTHRU_DEFINE) $*.c
';
push @m, '
.C$(OBJ_EXT):
- $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C
+ $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(DEFINE) $(PASTHRU_DEFINE) $*.C
' if !$Is_OS2 and !$Is_Win32 and !$Is_Dos; #Case-specific
push @m, '
.cpp$(OBJ_EXT):
- $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp
+ $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(DEFINE) $(PASTHRU_DEFINE) $*.cpp
.cxx$(OBJ_EXT):
- $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx
+ $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(DEFINE) $(PASTHRU_DEFINE) $*.cxx
.cc$(OBJ_EXT):
- $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc
+ $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(DEFINE) $(PASTHRU_DEFINE) $*.cc
';
join "", @m;
}
@@ -363,8 +364,10 @@
my($self,$libperl)=@_;
return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
return '' unless $self->needs_linking();
+ # PASTHRU_INC is defined explicitly by extensions
+ # wanting to do complex things.
return $self->{CONST_CCCMD} =
- q{CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \\
+ q{CCCMD = $(CC) -c $(INC) $(PASTHRU_INC) \\
$(CCFLAGS) $(OPTIMIZE) \\
$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \\
$(XS_DEFINE_VERSION)};
@@ -3063,11 +3066,27 @@
my($sep) = $Is_VMS ? ',' : '';
$sep .= "\\\n\t";
- foreach $key (qw(LIB LIBPERL_A LINKTYPE PREFIX OPTIMIZE)) {
+ foreach $key (qw(LIB LIBPERL_A LINKTYPE PREFIX OPTIMIZE INC DEFINE)) {
next unless defined $self->{$key};
- push @pasthru, "$key=\"\$($key)\"";
+ if ($key eq 'INC') {
+ # For INC we need to prepend parent directory but
+ # only if the parent directory is not absolute.
+ my ($o, $i) = $Is_VMS ? ('/Include=', 'i') : ('-I', '');
+ my $inc = '';
+ foreach (grep { /\S/ } parse_line(qr/\s*(?$i)$o/, 1, $self->{INC})) {
+ s/^"(.+)"\s*$/$1/o;
+ my $dir = File::Spec->file_name_is_absolute($_) ? $_ : File::Spec->catdir(File::Spec->updir, $_);
+ $dir = qq["$dir"] if $dir =~ / /;
+ $inc .= " $o$dir";
+ }
+ push @pasthru, "INC=\"$inc\"";
+ } else {
+ push @pasthru, "$key=\"\$($key)\"";
+ }
}
+ # PASTHRU_DEFINE and PASTHRU_INC are defined explicitly
+ # by extensions wanting to do really complex things.
foreach $key (qw(DEFINE INC)) {
next unless defined $self->{$key};
push @pasthru, "PASTHRU_$key=\"\$(PASTHRU_$key)\"";
diff -ru ExtUtils-MakeMaker-6.24.orig/lib/ExtUtils/MM_Win32.pm ExtUtils-MakeMaker-6.24/lib/ExtUtils/MM_Win32.pm
--- ExtUtils-MakeMaker-6.24.orig/lib/ExtUtils/MM_Win32.pm 2004-11-16 13:04:08.000000000 +0000
+++ ExtUtils-MakeMaker-6.24/lib/ExtUtils/MM_Win32.pm 2004-12-10 09:20:11.219121300 +0000
@@ -29,7 +29,7 @@
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = '1.10';
+$VERSION = '1.10_01';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
@@ -427,7 +427,9 @@
sub pasthru {
my($self) = shift;
- return "PASTHRU = " . ($NMAKE ? "-nologo" : "");
+ my $pasthru = $self->SUPER::pasthru();
+ $pasthru =~ s/PASTHRU\s*=\s*/PASTHRU = -nologo / if $NMAKE;
+ return $pasthru;
}
diff -ru ExtUtils-MakeMaker-6.24.orig/t/MM_Win32.t ExtUtils-MakeMaker-6.24/t/MM_Win32.t
--- ExtUtils-MakeMaker-6.24.orig/t/MM_Win32.t 2004-11-23 05:19:02.000000000 +0000
+++ ExtUtils-MakeMaker-6.24/t/MM_Win32.t 2004-12-10 09:19:11.033162100 +0000
@@ -254,8 +254,8 @@
# pasthru()
{
- my $pastru = "PASTHRU = " . ($Config{make} =~ /^nmake/i ? "-nologo" : "");
- is( $MM->pasthru(), $pastru, 'pasthru()' );
+ my $pasthru = ($Config{make} =~ /^nmake/i ? "/-nologo/" : "");
+ like( $MM->pasthru(), $pasthru, 'pasthru()' );
}
package FakeOut;