1 # take a semicolon separated path list and turn it into a quoted
2 # list of paths that Text::Parsewords will grok
5 # remove leading/trailing semis/spaces
9 my @p = map { $_ = "\"$_\"" if /\s/ and !/^".*"$/; $_ } split /;/, $p;
14 while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
20 my $pl_h = '../patchlevel.h';
23 $opt{INST_VER} =~ s|~VERSION~|$]|g;
25 open PL, "<$pl_h" or die "Can't open $pl_h: $!";
27 if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) {
33 elsif ($] =~ /^(\d+)\.(\d\d\d)?(\d\d)?$/) { # should always be true
34 $opt{PERL_REVISION} = $1;
35 $opt{PERL_VERSION} = int($2 || 0);
36 $opt{PERL_SUBVERSION} = $3;
37 $opt{PERL_APIVERSION} = $];
40 die "Can't parse perl version ($])";
43 $opt{PERL_SUBVERSION} ||= '00';
45 $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
46 $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
47 unless $opt{'cf_email'};
48 $opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define';
50 $opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};
51 $opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath};
55 s/~([\w_]+)~/$opt{$1}/g;
56 if (/^([\w_]+)=(.*)$/) {
58 # this depends on cf_time being empty in the template (or we'll get a loop)
59 if ($k eq 'cf_time') {
60 $_ = "$k='" . localtime(time) . "'\n" if $v =~ /^\s*'\s*'/;
62 elsif (exists $opt{$k}) {
63 $_ = "$k='$opt{$k}'\n";