X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fconfig_h.PL;h=a0ee22d3055277f4457d4835d618310492e385bb;hb=8bdaa535e831907095d85cca82627c485c5244c6;hp=26a2430fb09edb4a76530b206e678c76d1f7db98;hpb=e5a95ffba7bb8798f8211d43c45c423a80fd0fa5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/config_h.PL b/win32/config_h.PL index 26a2430..a0ee22d 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -11,9 +11,13 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) $opt{$1}=$2; shift(@ARGV); } + +$opt{CONFIG_H} ||= 'config.h'; + my $patchlevel = $opt{INST_VER}; -$patchlevel = s|^[\\/]||; -$patchlevel ||= $]; +$patchlevel =~ s|^[\\/]||; +$patchlevel =~ s|~VERSION~|$Config{version}|g; +$patchlevel ||= $Config{version}; $patchlevel = qq["$patchlevel"]; open(SH,"<$name") || die "Cannot open $name:$!"; @@ -23,6 +27,8 @@ while () } ($term,$file,$pat) = /^sed\s+<<(\S+)\s+>(\S+)\s+(.*)$/; +$file =~ s/^\$(\w+)$/$opt{$1}/g; + my $str = "sub munge\n{\n"; while ($pat =~ s/-e\s+'([^']*)'\s*//) @@ -39,7 +45,7 @@ eval $str; die "$str:$@" if $@; open(H,">$file.new") || die "Cannot open $file.new:$!"; -binmode H; # no CRs (which cause a spurious rebuild) +#binmode H; # no CRs (which cause a spurious rebuild) while () { last if /^$term$/o; @@ -48,18 +54,17 @@ while () munge(); s/\\\$/\$/g; s#/[ *\*]*\*/#/**/#; - if (/^\s*#define\s+(PRIVLIB|SITELIB)_EXP/) + if (/^\s*#define\s+(PRIVLIB|SITELIB|VENDORLIB)_EXP/) { $_ = "#define ". $1 . "_EXP (win32_get_". lc($1) . "($patchlevel))\t/**/\n"; } # incpush() handles archlibs, so disable them - elsif (/^\s*#define\s+(ARCHLIB|SITEARCH)_EXP/) + elsif (/^\s*#define\s+(ARCHLIB|SITEARCH|VENDORARCH)_EXP/) { $_ = "/*#define ". $1 . "_EXP \"\"\t/**/\n"; } print H; } -print H "#include \n"; close(H); close(SH);