2 # take a semicolon separated path list and turn it into a quoted
3 # list of paths that Text::Parsewords will grok
6 # remove leading/trailing semis/spaces
10 my @p = map { $_ = "\"$_\"" if /\s/ and !/^".*"$/; $_ } split /;/, $p;
14 # generate an array of option strings from command-line args
16 # -- added by BKS, 10-17-1999 to fix command-line overflow problems
18 if ($ARGV[0] =~ /--cfgsh-option-file/) {
20 my $optfile = shift @ARGV;
22 open OPTF, $optfile or die "Can't open $optfile: $!\n";
24 chomp(my $line = <OPTF>);
25 my @vars = split(/\t+~\t+/, $line);
27 push(@opts, $_) unless (/^\s*$/);
37 FindExt::scan_ext("../ext");
41 my $optref = loadopts();
42 while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) {
47 my @dynamic = FindExt::dynamic_extensions();
48 my @noxs = FindExt::noxs_extensions();
49 my @known = sort(@dynamic,split(/\s+/,$opt{'staticext'}),@noxs);
50 $opt{'known_extensions'} = join(' ',@known);
52 @dynamic = grep(!/Thread/,@dynamic);
53 @known = grep(!/Thread/,@dynamic);
55 $opt{'dynamic_ext'} = join(' ',@dynamic);
56 $opt{'nonxs_ext'} = join(' ',@noxs);
58 $opt{'extensions'} = join(' ',@known);
60 my $pl_h = '../patchlevel.h';
63 open PL, "<$pl_h" or die "Can't open $pl_h: $!";
65 if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) {
72 die "Can't find $pl_h: $!";
74 $opt{VERSION} = "$opt{PERL_REVISION}.$opt{PERL_VERSION}.$opt{PERL_SUBVERSION}";
75 $opt{INST_VER} =~ s|~VERSION~|$opt{VERSION}|g;
77 $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
78 $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
79 unless $opt{'cf_email'};
80 $opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define';
82 $opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};
83 $opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath};
86 s/~([\w_]+)~/$opt{$1}/g;
87 if (/^([\w_]+)=(.*)$/) {
89 # this depends on cf_time being empty in the template (or we'll
91 if ($k eq 'cf_time') {
92 $_ = "$k='" . localtime(time) . "'\n" if $v =~ /^\s*'\s*'/;
94 elsif (exists $opt{$k}) {
95 $_ = "$k='$opt{$k}'\n";