summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm19
1 files changed, 10 insertions, 9 deletions
diff --git a/configpm b/configpm
index 31585c4398..95fa9491af 100755
--- a/configpm
+++ b/configpm
@@ -2,13 +2,6 @@
@ARGV = "./config.sh";
-undef $/;
-$_ = <>;
-s:^#!/bin/sh\n::;
-s/'undef'/undef/g;
-s/\n(\w+)=/;\n\$Config{'$1'} = /g;
-s/;\n\$Config/\n\$Config/;
-
open STDOUT, ">lib/Config.pm"
or die "Can't open lib/Config.pm: $!\n";
$myver = sprintf("%.3f", $]);
@@ -23,5 +16,13 @@ require Exporter;
ENDOFBEG
-print $_;
-
+while (<>) {
+ s:^#!/bin/sh::;
+ s/'undef'/undef/; # So we can say "if $Config{'foo'}".
+ s/=true$/='true'/; # Catch CONFIG=true line from Configure.
+ s/^(\w+)=/\$Config{'$1'} = /;
+ s/$/;/ unless (/^#/ || /^$/);
+ print $_;
+}
+print "1;\n";
+exit 0;