summaryrefslogtreecommitdiff
path: root/configpm
blob: 8900d86b5f674d4c9e4084ac65a95509d2c4b57a (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
#!./perl

@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 $_;