summaryrefslogtreecommitdiff
path: root/configpm
blob: 95fa9491afc66da0e26a71b6a4e01244377f83d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!./miniperl

@ARGV = "./config.sh";

open STDOUT, ">lib/Config.pm"
    or die "Can't open lib/Config.pm: $!\n";
$myver = sprintf("%.3f", $]);
print <<"ENDOFBEG";
package Config;
require Exporter;
\@ISA = (Exporter);
\@EXPORT = qw(%Config);

\$] == $myver or die sprintf
    "Perl lib version ($myver) doesn't match executable version (%.3f)\\n", \$];

ENDOFBEG

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;