394N/A# commonly used names to put first (and hence lookup fastest) 394N/A# names of things which may need to have slashes changed to double-colons 394N/A# allowed opts as well as specifies default and initial values 394N/A 'cross' => '', # --cross=PALTFORM - crosscompiling for PLATFORM 394N/A 'glossary' => 1, # --no-glossary - no glossary file inclusion, 394N/A # --opt --no-opt --noopt 394N/A # creating cross-platform config file # This file was created by configpm when Perl was built. Any changes # made to this file will be lost the next time perl is built. # Define our own import method to avoid pulling in the full Exporter: die "Perl lib version (%s) doesn't match executable version ($])" or die "Perl lib version (%s) doesn't match executable version (" .
# This is somewhat grim, but I want the code for parsing config.sh here and # now so that I can expand $Config{ivsize} and $Config{ivtype} # Search for it in the big string # Check for the common case, ' delimited # If that failed, check for " delimited return undef if ( ($start == -1) && # in case it's first # It's the very first thing we found. Skip $start forward # and figure out the quote mark after the =. # If we had a double-quote, we'd better eval it so escape # sequences and such can be interpolated. Since the incoming # value is supposed to follow shell rules and not perl rules, # we escape any perl variable markers # So we can say "if $Config{'foo'}". # Catch PERL_CONFIG_SH=true and PERL_VERSION=n line from Configure. s/^(\w+)=(true|\d+)\s*$/$1='$2'\n/ or m/^(\w+)='(.*)'$/; # grandfather PATCHLEVEL and SUBVERSION and CONFIG if ($k eq 'PERL_VERSION') { elsif ($k eq 'PERL_SUBVERSION') { elsif ($k eq 'PERL_CONFIG_SH') { # We can delimit things in config.sh with either ' or ". push(@non_v, "#$_"); # not a name='value' line $in_v = $val !~ /$quote\n/; s,/,::,g if $Extensions{$name}; my $line = "$name=$quote$val$quote\n"; $v_fast{$name} = "'$name' => $quote$val$quote"; print CONFIG @non_v, "\n"; # copy config summary format from the myconfig.SH script print CONFIG "our \$summary : unique = <<'!END!';\n"; 1 while defined($_ = <MYCONFIG>) && !/^Summary of/; do { print CONFIG $_ } until !defined($_ = <MYCONFIG>) || /^\s*$/; # NB. as $summary is unique, we need to copy it in a lexical variable # before expanding it, because may have been made readonly if a perl # interpreter has been cloned. print CONFIG "\n!END!\n", <<'EOT'; return $summary_expanded if $summary_expanded; ($summary_expanded = $summary) =~ s{\$(\w+)} { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge; our $Config_SH : unique = <<'!END!'; print CONFIG join("", @v_fast, sort @v_others); print CONFIG "!END!\n", $fetch_string; if ($key =~ /^((?:cc|ld)flags|libs(?:wanted)?)_nolargefiles/) { # These are purely virtual, they do not exist, but need to # be computed on demand for largefile-incapable extensions. my $new_key = "${1}_uselargefiles"; my $withlargefiles = $Config{$new_key}; if ($new_key =~ /^(?:cc|ld)flags_/) { $value =~ s/\Q$withlargefiles\E\b//; } elsif ($new_key =~ /^libs/) { my @lflibswanted = split(' ', $Config{libswanted_uselargefiles}); @lflibswanted{@lflibswanted} = (); if ($new_key =~ /^libs_/) { my @libs = grep { /^-l(.+)/ && not exists $lflibswanted{$1} } split(' ', $Config{libs}); $Config{libs} = join(' ', @libs); } elsif ($new_key =~ /^libswanted_/) { my @libswanted = grep { not exists $lflibswanted{$_} } split(' ', $Config{libswanted}); $Config{libswanted} = join(' ', @libswanted); # check for cached value (which may be undef so we use exists not defined) return $self->{$key} if exists $self->{$key}; $self->fetch_string($key); return $self->{$key} if exists $self->{$key}; $self->fetch_virtual($key); # Might not exist, in which undef is correct. substr($Config_SH, 0, index($Config_SH, '=') ); return 1 if exists($_[0]->{$_[1]}); sub STORE { die "\%Config::Config is read-only\n" } # Extract the name of the DLL from the makefile to avoid duplication print CONFIG <<ENDOFSET if $dll; \$preconfig{dll_name} = '$dll'; # Calculation for the keys for byteorder # This is somewhat grim, but I need to run fetch_string here. # byteorder does exist on its own but we overlay a virtual # dynamically recomputed value. # However, ivtype and ivsize will not vary for sane fat binaries my $f = $t eq 'long' ? 'L!' : $s == 8 ? 'Q': 'I'; if ($s == 4 || $s == 8) { foreach my \$c ($list) { \$i |= ord(\$c); \$i <<= 8 } =item config_vars(@names) Prints to STDOUT the values of the named configuration variable. Each is printed on a separate line in the form: Names which are unknown are output as C<name='UNKNOWN';>. consequences. (The slashes will end up escaped and the C<$> or C<@> will trigger variable interpolation) Most C<Config> variables are determined by the C<Configure> script on platforms supported by it (which is most UNIX platforms). Some platforms have custom-made C<Config> variables, and may thus not have some of the variables described below, or may have extraneous variables specific to that particular port. See the port specific documentation if (s/\A(\w*)\s+\(([\w.]+)\):\s*\n(\t?)/=item C<$1>\n\nFrom F<$2>:\n\n/m) { print CONFIG_POD <<EOF if $text; elsif (!$text || !/\A\t/) { s/n't/n\00t/g; # leave can't, won't etc untouched s/^\t\s+(.*)/\n$1/gm; # Indented lines ===> new paragraph s/^(?<!\n\n)\t(.*)/$1/gm; # Not indented lines ===> text s{([\'\"])(?=[^\'\"\s]*[./][^\'\"\s]*\1)([^\'\"\s]+)\1}(F<$2>)g; # '.o' s{([\'\"])([^\'\"\s]+)\1}(C<$2>)g; # "date" command s{\'([A-Za-z_\- *=/]+)\'}(C<$1>)g; # 'ln -s' (?<! [\w./<\'\"] ) # Only standalone file names (?! e \. g \. ) # Not e.g. [\w./]* [./] [\w./]* # Require . or / inside (?<! \. (?= [\s)] ) ) # Do not include trailing dot (?! [\w/] ) # Include all of it s/((?<=\s)~\w*)/F<$1>/g; # ~name s/(?<![.<\'\"])\b([A-Z_]{2,})\b(?![\'\"])/C<$1>/g; # UNISTD s/(?<![.<\'\"])\b(?!the\b)(\w+)\s+macro\b/C<$1> macro/g; # FILE_cnt macro s/n[\0]t/n't/g; # undo can't, won't damage <GLOS>; # Skip the preamble print CONFIG_POD <<'ENDOFTAIL'; This module contains a good example of how to use tie to implement a cache and an example of how to make a tied variable readonly to those # perl -MCross=wince -V:cc # if $platform is not specified, then use last one when # 'configpm; was invoked with --cross option @INC = map {/\blib\b/?(do{local $_=$_;s/\blib\b/xlib\/$platform/;$_},$_):($_)} @INC; # Now do some simple tests on the Config.pm file we have created unless $Config{'PERL_CONFIG_SH'} eq 'true'; if defined($Config{'an impossible name'}) or $Config{'PERL_CONFIG_SH'} ne 'true' # test cache