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 ;
$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}
*$(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
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);
$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
=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)
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/(?<!\\)([()])/\\$1/g; # quote unprotected
+ s/\$\\\\\((.+?)\\\\\)/\$($1)/g; # unprotect $(...)
+ return $_;
+}
+
=item realclean (o)
Defines the realclean target.