X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FExtUtils%2FMM_Unix.pm;h=da844612395f5e888450169d695e7409021dc4d4;hb=c855ea654ae57bed1bd131cde5ed309f4b90c1ea;hp=e6c676607f359915182c143d0e73b71cefa4a2b9;hpb=141b0a1ff3150d6cbb33c5496dbdb4c4963cd274;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index e6c6766..da84461 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -220,6 +220,7 @@ sub ExtUtils::MM_Unix::postamble ; sub ExtUtils::MM_Unix::ppd ; sub ExtUtils::MM_Unix::prefixify ; sub ExtUtils::MM_Unix::processPL ; +sub ExtUtils::MM_Unix::quote_paren ; sub ExtUtils::MM_Unix::realclean ; sub ExtUtils::MM_Unix::replace_manpage_separator ; sub ExtUtils::MM_Unix::static ; @@ -397,6 +398,9 @@ sub cflags { $pollute = '$(PERL_MALLOC_DEF)'; } + $self->{CCFLAGS} = quote_paren($self->{CCFLAGS}); + $self->{OPTIMIZE} = quote_paren($self->{CCFLAGS}); + return $self->{CFLAGS} = qq{ CCFLAGS = $self->{CCFLAGS} OPTIMIZE = $self->{OPTIMIZE} @@ -455,7 +459,7 @@ EOT *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def lib$(BASEEXT).def - $(BASEEXT).exp + $(BASEEXT).exp $(BASEEXT).x ]); push @m, "\t-$self->{RM_RF} @otherfiles\n"; # See realclean and ext/utils/make_ext for usage of Makefile.old @@ -502,7 +506,8 @@ sub const_config { foreach $m (@{$self->{CONFIG}}){ # SITE*EXP macros are defined in &constants; avoid duplicates here next if $once_only{$m} or $m eq 'sitelibexp' or $m eq 'sitearchexp'; - push @m, "\U$m\E = ".$self->{uc $m}."\n"; + $self->{uc $m} = quote_paren($self->{uc $m}); + push @m, uc($m) , ' = ' , $self->{uc $m}, "\n"; $once_only{$m} = 1; } join('', @m); @@ -1796,7 +1801,7 @@ usually solves this kind of problem. $self->{INST_SCRIPT} ||= $self->catdir($self->curdir,'blib','script'); # The user who requests an installation directory explicitly - # should not have to tell us a architecture installation directory + # should not have to tell us an architecture installation directory # as well. We look if a directory exists that is named after the # architecture. If not we take it as a sign that it should be the # same as the requested installation directory. Otherwise we take @@ -3064,15 +3069,36 @@ destination and autosplits them. See L =cut +sub _pm_to_blib_flush { + my ($self, $autodir, $rr, $ra, $rl) = @_; + $$rr .= +q{ }.$self->{NOECHO}.q[$(PERLRUNINST) -MExtUtils::Install \ + -e "pm_to_blib({qw{].qq[@$ra].q[}},'].$autodir.q{','$(PM_FILTER)')" +}; + @$ra = (); + $$rl = 0; +} + sub pm_to_blib { my $self = shift; my($autodir) = $self->catdir('$(INST_LIB)','auto'); - return q{ + my $r = q{ pm_to_blib: $(TO_INST_PM) - }.$self->{NOECHO}.q{$(PERLRUNINST) -MExtUtils::Install \ - -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'}.$autodir.q{','$(PM_FILTER)')" - }.$self->{NOECHO}.q{$(TOUCH) $@ }; + my %pm_to_blib = %{$self->{PM}}; + my @a; + my $l; + while (my ($pm, $blib) = each %pm_to_blib) { + my $la = length $pm; + my $lb = length $blib; + if ($l + $la + $lb + @a / 2 > 200) { # limit line length + _pm_to_blib_flush($self, $autodir, \$r, \@a, \$l); + } + push @a, $pm, $blib; + $l += $la + $lb; + } + _pm_to_blib_flush($self, $autodir, \$r, \@a, \$l); + return $r.q{ }.$self->{NOECHO}.q{$(TOUCH) $@}; } =item post_constants (o) @@ -3156,6 +3182,22 @@ $target :: $plfile join "", @m; } +=item quote_paren + +Backslashes parentheses C<()> in command line arguments. +Doesn't handle recursive Makefile C<$(...)> constructs, +but handles simple ones. + +=cut + +sub quote_paren { + local $_ = shift; + s/\$\((.+?)\)/\$\\\\($1\\\\)/g; # protect $(...) + s/(?