X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fconfig_sh.PL;h=fc0daf05bc0f51184780b07c27f81cb0f0d11278;hb=9cc6feabb930fb7cac992ab0a2febf2fb1986667;hp=59e64f967581ece11df3da351c5381b1350b3e13;hpb=10609e9a342de3bae37d4ac9f8d8bc93c0a4e896;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/config_sh.PL b/win32/config_sh.PL index 59e64f9..fc0daf0 100644 --- a/win32/config_sh.PL +++ b/win32/config_sh.PL @@ -1,3 +1,15 @@ +# take a semicolon separated path list and turn it into a quoted +# list of paths that Text::Parsewords will grok +sub mungepath { + my $p = shift; + # remove leading/trailing semis/spaces + $p =~ s/^[ ;]+//; + $p =~ s/[ ;]+$//; + $p =~ s/'/"/g; + my @p = map { $_ = "\"$_\"" if /\s/ and !/^".*"$/; $_ } split /;/, $p; + return join(' ', @p); +} + my %opt; while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) { @@ -8,8 +20,8 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) $opt{VERSION} = $]; $opt{INST_VER} =~ s|~VERSION~|$]|g; if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true - $opt{PATCHLEVEL} = int($1 || 0); - $opt{SUBVERSION} = $2 || '00'; + $opt{PERL_VERSION} = int($1 || 0); + $opt{PERL_SUBVERSION} = $2 || '00'; } $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'}; @@ -17,6 +29,9 @@ $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0] unless $opt{'cf_email'}; $opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define'; +$opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth}; +$opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath}; + while (<>) { s/~([\w_]+)~/$opt{$1}/g;