summaryrefslogtreecommitdiff
path: root/win32/config_sh.PL
diff options
context:
space:
mode:
Diffstat (limited to 'win32/config_sh.PL')
-rw-r--r--win32/config_sh.PL15
1 files changed, 15 insertions, 0 deletions
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index 59e64f9675..1d4b2fb5c3 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_]+)=(.*)$/)
{
@@ -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;