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;
13 # generate an array of option strings from command-line args
15 # -- added by BKS, 10-17-1999 to fix command-line overflow problems
17 if ($ARGV[0] =~ /--cfgsh-option-file/) {
19 my $optfile = shift @ARGV;
21 open OPTF, $optfile or die "Can't open $optfile: $!\n";
23 chomp(my $line = <OPTF>);
24 my @vars = split(/\t+~\t+/, $line);
26 push(@opts, $_) unless (/^\s*$/);
37 my $optref = loadopts();
38 while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) {
43 my $pl_h = '../patchlevel.h';
46 $opt{INST_VER} =~ s|~VERSION~|$]|g;
48 open PL, "<$pl_h" or die "Can't open $pl_h: $!";
50 if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) {
56 elsif ($] =~ /^(\d+)\.(\d\d\d)?(\d\d)?$/) { # should always be true
57 $opt{PERL_REVISION} = $1;
58 $opt{PERL_VERSION} = int($2 || 0);
59 $opt{PERL_SUBVERSION} = $3;
60 $opt{PERL_APIVERSION} = $];
63 die "Can't parse perl version ($])";
66 $opt{PERL_SUBVERSION} ||= '00';
68 $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
69 $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
70 unless $opt{'cf_email'};
71 $opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define';
73 $opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};
74 $opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath};
77 s/~([\w_]+)~/$opt{$1}/g;
78 if (/^([\w_]+)=(.*)$/) {
80 # this depends on cf_time being empty in the template (or we'll
82 if ($k eq 'cf_time') {
83 $_ = "$k='" . localtime(time) . "'\n" if $v =~ /^\s*'\s*'/;
85 elsif (exists $opt{$k}) {
86 $_ = "$k='$opt{$k}'\n";