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*$/);
39 my $optref = loadopts();
40 while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) {
45 FindExt::scan_ext("../ext");
46 FindExt::scan_ext("ext") if -d 'ext'; # also look in win32/ext/ if it exists
47 FindExt::set_static_extensions(split ' ', $opt{'static_ext'});
49 my @dynamic_ext = grep(!/Thread/,FindExt::dynamic_ext());
50 my @extensions = grep(!/Thread/,FindExt::extensions());
51 $opt{'nonxs_ext'} = join(' ',FindExt::nonxs_ext()) || ' ';
52 $opt{'static_ext'} = join(' ',FindExt::static_ext()) || ' ';
53 $opt{'dynamic_ext'} = join(' ',@dynamic_ext) || ' ';
54 $opt{'extensions'} = join(' ',@extensions) || ' ';
55 $opt{'known_extensions'} = join(' ',FindExt::known_extensions()) || ' ';
57 my $pl_h = '../patchlevel.h';
60 open PL, "<$pl_h" or die "Can't open $pl_h: $!";
62 if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) {
69 die "Can't find $pl_h: $!";
71 $opt{VERSION} = "$opt{PERL_REVISION}.$opt{PERL_VERSION}.$opt{PERL_SUBVERSION}";
72 $opt{INST_VER} =~ s|~VERSION~|$opt{VERSION}|g;
73 $opt{'version_patchlevel_string'} = "version $opt{PERL_VERSION} subversion $opt{PERL_SUBVERSION}";
74 $opt{'version_patchlevel_string'} .= " patchlevel $opt{PERL_PATCHLEVEL}" if exists $opt{PERL_PATCHLEVEL};
76 my $ver = `ver 2>nul`;
77 if ($ver =~ /Version (\d+\.\d+)/) {
81 $opt{'osvers'} = '4.0';
84 if (exists $opt{cc}) {
85 # cl and bcc32 version detection borrowed from Test::Smoke's configsmoke.pl
86 if ($opt{cc} eq 'cl') {
87 my $output = `cl --version 2>&1`;
88 $opt{ccversion} = $output =~ /^.*Version\s+([\d.]+)/ ? $1 : '?';
90 elsif ($opt{cc} eq 'bcc32') {
91 my $output = `bcc32 --version 2>&1`;
92 $opt{ccversion} = $output =~ /([\d.]+)/ ? $1 : '?';
94 elsif ($opt{cc} eq 'gcc') {
95 chomp($opt{gccversion} = `gcc -dumpversion`);
99 $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
100 $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
101 unless $opt{'cf_email'};
102 $opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define';
104 $opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};
105 $opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath};
107 # some functions are not available on Win9x
108 unless (defined $ENV{SYSTEMROOT}) { # SystemRoot has been introduced by WinNT
109 $opt{d_flock} = 'undef';
110 $opt{d_link} = 'undef';
113 if ($opt{uselargefiles} ne 'define') {
115 $opt{lseektype} = 'off_t';
118 if ($opt{useithreads} eq 'define' && $opt{ccflags} =~ /-DPERL_IMPLICIT_SYS\b/) {
119 $opt{d_pseudofork} = 'define';
123 s/~([\w_]+)~/$opt{$1}/g;
124 if (/^([\w_]+)=(.*)$/) {
126 # this depends on cf_time being empty in the template (or we'll
128 if ($k eq 'cf_time') {
129 $_ = "$k='" . localtime(time) . "'\n" if $v =~ /^\s*'\s*'/;
131 elsif (exists $opt{$k}) {
132 $_ = "$k='$opt{$k}'\n";