diff --git a/Makefile.PL b/Makefile.PL index 5482067a..0962b8ce 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -23,6 +23,7 @@ use File::Find; use File::Path; use File::Basename; use File::Copy; +use Text::ParseWords qw(shellwords); use vars qw( $ARGV_STR @@ -1363,9 +1364,7 @@ sub pkgconfig $MODVERSIONS{$package} = $modversion; printlog "$modversion\n"; - my %h; - - %h = map { $_ => 1 } @INCPATH; + my %h = map { $_ => 1 } @INCPATH; my $inc = `$PKGCONFIG --cflags-only-I $package`; if ( $? != 0 ) { # package has error? printlog "misconfigured\n"; @@ -1373,7 +1372,7 @@ sub pkgconfig } chomp $inc; $inc =~ s/\-I//g; - for ( split " ", $inc ) { + for ( shellwords $inc ) { push @INCPATH, $_ unless $h{$_}; } @@ -1385,7 +1384,7 @@ sub pkgconfig } chomp $libs; $libs =~ s/\-l//g; - for ( split " ", $libs ) { + for ( shellwords $libs ) { push @LIBS, $_ unless $h{$_}; } @@ -1397,7 +1396,7 @@ sub pkgconfig } chomp $libpath; $libpath =~ s/\-[LR]//g; - for ( split " ", $libpath ) { + for ( shellwords $libpath ) { push @LIBPATH, $_ unless $h{$_}; } @@ -2265,7 +2264,7 @@ sub create_codecs_c print $fh <", "Prima/Config.pm" or die "cannot open Prima/Config.pm:$!\n"; print $fh < \%PREREQ, OBJECT => "@o_files", INC => - join(' ', map { "-I$_" } @INCPATH ). + join(' ', map qq{"-I$_"}, @INCPATH ). ' ' . $cmd_options{EXTRA_CCFLAGS}, LIBS => [ $cmd_options{EXTRA_LDFLAGS} . ' ' . $LDFLAGS . ' ' . ':nosearch ' . - join(' ', map { "-L$_" } @LIBPATH) . ' ' . - join(' ', map { "-l$_" } @LIBS), + join(' ', map qq{"-L$_"}, @LIBPATH) . ' ' . + join(' ', map "-l$_", @LIBS), ], LICENSE => 'FREEBSD', EXE_FILES => \@exe_files, diff --git a/utils/prima-tmlink.pl b/utils/prima-tmlink.pl index 81c4ebc9..82e74307 100644 --- a/utils/prima-tmlink.pl +++ b/utils/prima-tmlink.pl @@ -96,7 +96,7 @@ sub load_file print $f <