From: Jarkko Hietaniemi Date: Sat, 9 Feb 2002 17:26:06 +0000 (+0000) Subject: Protect possible parentheses in ccflags, ccdlflags, and X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f0595bddcd55d11eb52060e182956e0777cf33aa;p=p5sagit%2Fp5-mst-13.2.git Protect possible parentheses in ccflags, ccdlflags, and ldflags. (In OS/390 there are parentheses in ccflags.) p4raw-id: //depot/perl@14611 --- diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm index 1aae288..ab85a13 100644 --- a/lib/ExtUtils/Embed.pm +++ b/lib/ExtUtils/Embed.pm @@ -139,6 +139,24 @@ sub static_ext { @Extensions; } +sub _ldflags { + my $ldflags = $Config{ldflags}; + $ldflags =~ s/([\(\)])/\\$1/g; + return $ldflags; +} + +sub _ccflags { + my $ccflags = $Config{ccflags}; + $ccflags =~ s/([\(\)])/\\$1/g; + return $ccflags; +} + +sub _ccdlflags { + my $ccdlflags = $Config{ccdlflags}; + $ccdlflags =~ s/([\(\)])/\\$1/g; + return $ccdlflags; +} + sub ldopts { require ExtUtils::MakeMaker; require ExtUtils::Liblist; @@ -213,7 +231,9 @@ sub ldopts { my $ld_or_bs = $bsloadlibs || $ldloadlibs; print STDERR "bs: $bsloadlibs ** ld: $ldloadlibs" if $Verbose; - my $linkage = "$Config{ccdlflags} $Config{ldflags} @archives $ld_or_bs"; + my $ccdlflags = _ccdlflags(); + my $ldflags = _ldflags(); + my $linkage = "$ccdlflags $ldflags @archives $ld_or_bs"; print STDERR "ldopts: '$linkage'\n" if $Verbose; return $linkage if scalar @_; @@ -221,11 +241,13 @@ sub ldopts { } sub ccflags { - my_return(" $Config{ccflags} "); + my $ccflags = _ccflags(); + my_return(" $ccflags "); } sub ccdlflags { - my_return(" $Config{ccdlflags} "); + my $ccdlflags = _ccdlflags(); + my_return(" $ccdlflags "); } sub perl_inc {