This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Date: Tue, 01 Dec 1998 00:07:33 +0100
[perl5.git] / win32 / config_sh.PL
CommitLineData
137443ea 1my %opt;
2while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
3 {
4 $opt{$1}=$2;
5 shift(@ARGV);
6 }
7bac28a0 7
10609e9a
GS
8$opt{VERSION} = $];
9$opt{INST_VER} =~ s|~VERSION~|$]|g;
c90c0ff4 10if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
11 $opt{PATCHLEVEL} = int($1 || 0);
12 $opt{SUBVERSION} = $2 || '00';
13}
14
d484a829
GS
15$opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
16$opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
17 unless $opt{'cf_email'};
852c2e52 18$opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define';
d484a829 19
0c005962
JD
20$opt{libpth} =~ s/'/"/g if exists $opt{libpth};
21$opt{incpth} =~ s/'/"/g if exists $opt{incpth};
22
137443ea 23while (<>)
24 {
25 s/~([\w_]+)~/$opt{$1}/g;
dc050285
GS
26 if (/^([\w_]+)=(.*)$/) {
27 # this depends on cf_time being empty in the template (or we'll get a loop)
28 if ($1 eq 'cf_time') {
29 $_ = "$1='" . localtime(time) . "'\n" if $2 =~ /^\s*'\s*'/;
30 }
31 elsif (exists $opt{$1}) {
32 $_ = "$1='$opt{$1}'\n";
33 }
34 }
137443ea 35 print;
36 }
37