This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH] Re: MakeMaker doesn't pasthru DEFINE command-line args to subdirs on...
authorSteve Hay <SteveHay@planit.com>
Wed, 6 Aug 2003 10:56:44 +0000 (11:56 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 6 Aug 2003 11:38:46 +0000 (11:38 +0000)
Message-ID: <3F30D0DC.20700@uk.radan.com>

p4raw-id: //depot/perl@20520

lib/ExtUtils/MM_Unix.pm

index 423c3e9..f49c707 100644 (file)
@@ -9,6 +9,7 @@ use Carp;
 use Config         qw(%Config);
 use File::Basename qw(basename dirname fileparse);
 use DirHandle;
+use Text::ParseWords;
 
 use vars qw($VERSION @ISA
             $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Win95  $Is_Dos $Is_VOS
@@ -3115,8 +3116,14 @@ sub pasthru {
            # For INC we need to prepend parent directory but
            # only iff the parent directory is not absolute.
            my ($o, $i) = $Is_VMS ? ('/Include=', 'i') : ('-I', '');
-           $inc =~ s!(?$i)$o(.+?)!$o.($self->file_name_is_absolute($1)?$1:$self->catdir($self->updir,$1))!eg;
-           push @pasthru, "INC=\"$inc\"";
+           my $newinc = '';
+           foreach (grep { /\S/ } parse_line(qr/\s*(?$i)$o/, 1, $inc)) {
+               s/^"(.+)"$/$1/o;
+               my $dir = File::Spec->file_name_is_absolute($_) ? $_ : File::Spec->catdir(File::Spec->updir, $_);
+               $dir = qq["$dir"] if $dir =~ / /;
+               $newinc .= " $o$dir";
+           }
+           push @pasthru, "INC=\"$newinc\"";
        } else {
            push @pasthru, "$key=\"\$($key)\"";
        }