| 1 | # This file was created by configpm when Perl was built. Any changes | ||
| 2 | # made to this file will be lost the next time perl is built. | ||
| 3 | |||
| 4 | package Config; | ||
| 5 | use strict; | ||
| 6 | # use warnings; Pulls in Carp | ||
| 7 | # use vars pulls in Carp | ||
| 8 | @Config::EXPORT = qw(%Config); | ||
| 9 | @Config::EXPORT_OK = qw(myconfig config_sh config_vars config_re); | ||
| 10 | |||
| 11 | # Need to stub all the functions to make code such as print Config::config_sh | ||
| 12 | # keep working | ||
| 13 | |||
| 14 | sub myconfig; | ||
| 15 | sub config_sh; | ||
| 16 | sub config_vars; | ||
| 17 | sub config_re; | ||
| 18 | |||
| 19 | my %Export_Cache = map {($_ => 1)} (@Config::EXPORT, @Config::EXPORT_OK); | ||
| 20 | |||
| 21 | our %Config; | ||
| 22 | |||
| 23 | # Define our own import method to avoid pulling in the full Exporter: | ||
| 24 | sub import { | ||
| 25 | my $pkg = shift; | ||
| 26 | @_ = @Config::EXPORT unless @_; | ||
| 27 | |||
| 28 | my @funcs = grep $_ ne '%Config', @_; | ||
| 29 | my $export_Config = @funcs < @_ ? 1 : 0; | ||
| 30 | |||
| 31 | no strict 'refs'; | ||
| 32 | my $callpkg = caller(0); | ||
| 33 | foreach my $func (@funcs) { | ||
| 34 | die sprintf qq{"%s" is not exported by the %s module\n}, | ||
| 35 | $func, __PACKAGE__ unless $Export_Cache{$func}; | ||
| 36 | *{$callpkg.'::'.$func} = \&{$func}; | ||
| 37 | } | ||
| 38 | |||
| 39 | *{"$callpkg\::Config"} = \%Config if $export_Config; | ||
| 40 | return; | ||
| 41 | } | ||
| 42 | |||
| 43 | die "Perl lib version (5.10.0) doesn't match executable version ($])" | ||
| 44 | unless $^V; | ||
| 45 | |||
| 46 | $^V eq 5.10.0 | ||
| 47 | or die "Perl lib version (5.10.0) doesn't match executable version (" . | ||
| 48 | sprintf("v%vd",$^V) . ")"; | ||
| 49 | |||
| 50 | |||
| 51 | sub FETCH { | ||
| 52 | my($self, $key) = @_; | ||
| 53 | |||
| 54 | # check for cached value (which may be undef so we use exists not defined) | ||
| 55 | return $self->{$key} if exists $self->{$key}; | ||
| 56 | |||
| 57 | return $self->fetch_string($key); | ||
| 58 | } | ||
| 59 | sub TIEHASH { | ||
| 60 | bless $_[1], $_[0]; | ||
| 61 | } | ||
| 62 | |||
| 63 | sub DESTROY { } | ||
| 64 | |||
| 65 | sub AUTOLOAD { | ||
| 66 | require 'Config_heavy.pl'; | ||
| 67 | goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/; | ||
| 68 | die "&Config::AUTOLOAD failed on $Config::AUTOLOAD"; | ||
| 69 | } | ||
| 70 | |||
| 71 | # Locate $Config{perlpath} directly | ||
| 72 | our $perlpath = $^X; | ||
| 73 | unless ( -e $perlpath ) { | ||
| 74 | die('Failed to auto-discover $Config{perlpath}'); | ||
| 75 | } | ||
| 76 | |||
| 77 | # Derive $Config{bin} from $Config{perlpath} | ||
| 78 | our $bin = $perlpath; | ||
| 79 | $bin =~ s/(?:\\\\?|\/)perl\.exe$//; | ||
| 80 | unless ( $bin ne $perlpath and -d $bin ) { | ||
| 81 | die('Failed to auto-discover $Config{bin}'); | ||
| 82 | } | ||
| 83 | |||
| 84 | # Derive $Config{prefix} from $Config{bin} | ||
| 85 | our $prefix = $bin; | ||
| 86 | $prefix =~ s/(?:\\\\?|\/)bin$//; | ||
| 87 | unless ( $prefix ne $bin and -d $prefix ) { | ||
| 88 | die('Failed to auto-discover $Config{prefix}'); | ||
| 89 | } | ||
| 90 | |||
| 91 | # Derive the root from $Config{prefix} | ||
| 92 | our $root = $prefix; | ||
| 93 | $root =~ s/(?:\\\\?|\/)perl$//; | ||
| 94 | unless ( $root ne $prefix and -d $root ) { | ||
| 95 | die('Failed to auto-discover the distribution root'); | ||
| 96 | } | ||
| 97 | |||
| 98 | # tie returns the object, so the value returned to require will be true. | ||
| 99 | tie %Config, 'Config', { | ||
| 100 | archlibexp => $prefix . '\\lib', | ||
| 101 | archname => 'MSWin32-x86-multi-thread', | ||
| 102 | cc => 'gcc', | ||
| 103 | d_readlink => undef, | ||
| 104 | d_symlink => undef, | ||
| 105 | dlsrc => 'dl_win32.xs', | ||
| 106 | dont_use_nlink => undef, | ||
| 107 | exe_ext => '.exe', | ||
| 108 | inc_version_list => '', | ||
| 109 | intsize => '4', | ||
| 110 | ldlibpthname => '', | ||
| 111 | libpth => $root . '\\c\\lib', | ||
| 112 | osname => 'MSWin32', | ||
| 113 | osvers => '5.1', | ||
| 114 | path_sep => ';', | ||
| 115 | privlibexp => $prefix . '\\lib', | ||
| 116 | scriptdir => $prefix . '\\bin', | ||
| 117 | sitearchexp => $prefix . '\\site\\lib', | ||
| 118 | sitelibexp => $prefix . '\\site\\lib', | ||
| 119 | useithreads => 'define', | ||
| 120 | usevendorprefix => undef, | ||
| 121 | version => '5.10.0', | ||
| 122 | }; |