From: Steve Hay Date: Wed, 6 Aug 2003 10:56:44 +0000 (+0100) Subject: Re: [PATCH] Re: MakeMaker doesn't pasthru DEFINE command-line args to subdirs on... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=73afeaec30b8a4bfb8d1427477e988b22d3af187;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] Re: MakeMaker doesn't pasthru DEFINE command-line args to subdirs on Win32 Message-ID: <3F30D0DC.20700@uk.radan.com> p4raw-id: //depot/perl@20520 --- diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 423c3e9..f49c707 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -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)\""; }