summaryrefslogtreecommitdiff
path: root/configpm
blob: 31585c43987bc041556cefe6cb55ed617033a088 (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
#!./miniperl

@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", $]);
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

print $_;