perl 5.0 alpha 9
[p5sagit/p5-mst-13.2.git] / configpm
1 #!./miniperl
2
3 @ARGV = "./config.sh";
4
5 open STDOUT, ">lib/Config.pm"
6     or die "Can't open lib/Config.pm: $!\n";
7 $myver = sprintf("%.3f", $]);
8 print <<"ENDOFBEG";
9 package Config;
10 require Exporter;
11 \@ISA = (Exporter);
12 \@EXPORT = qw(%Config);
13
14 \$] == $myver or die sprintf
15     "Perl lib version ($myver) doesn't match executable version (%.3f)\\n", \$];
16
17 ENDOFBEG
18
19 while (<>) {
20     s:^#!/bin/sh::;
21     s/'undef'/undef/;   # So we can say "if $Config{'foo'}".
22     s/=true$/='true'/;  # Catch CONFIG=true line from Configure.
23     s/^(\w+)=/\$Config{'$1'} = /;
24     s/$/;/ unless (/^#/ || /^$/);
25     print $_;
26 }
27 print "1;\n";
28 exit 0;