diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Config.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Config.pm | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/Master/tlpkg/tlperl/lib/Config.pm b/Master/tlpkg/tlperl/lib/Config.pm index 0720bac59ba..2c05af8a161 100644 --- a/Master/tlpkg/tlperl/lib/Config.pm +++ b/Master/tlpkg/tlperl/lib/Config.pm @@ -7,26 +7,36 @@ package Config; use strict; -# use warnings; Pulls in Carp -# use vars pulls in Carp +use warnings; +use vars '%Config'; + +# Skip @Config::EXPORT because it only contains %Config, which we special +# case below as it's not a function. @Config::EXPORT won't change in the +# lifetime of Perl 5. +my %Export_Cache = (myconfig => 1, config_sh => 1, config_vars => 1, + config_re => 1, compile_date => 1, local_patches => 1, + bincompat_options => 1, non_bincompat_options => 1, + header_files => 1); + @Config::EXPORT = qw(%Config); -@Config::EXPORT_OK = qw(myconfig config_sh config_vars config_re); +@Config::EXPORT_OK = keys %Export_Cache; # Need to stub all the functions to make code such as print Config::config_sh # keep working -sub myconfig; +sub bincompat_options; +sub compile_date; +sub config_re; sub config_sh; sub config_vars; -sub config_re; - -my %Export_Cache = map {($_ => 1)} (@Config::EXPORT, @Config::EXPORT_OK); - -our %Config; +sub header_files; +sub local_patches; +sub myconfig; +sub non_bincompat_options; # Define our own import method to avoid pulling in the full Exporter: sub import { - my $pkg = shift; + shift; @_ = @Config::EXPORT unless @_; my @funcs = grep $_ ne '%Config', @_; @@ -35,8 +45,8 @@ sub import { no strict 'refs'; my $callpkg = caller(0); foreach my $func (@funcs) { - die sprintf qq{"%s" is not exported by the %s module\n}, - $func, __PACKAGE__ unless $Export_Cache{$func}; + die qq{"$func" is not exported by the Config module\n} + unless $Export_Cache{$func}; *{$callpkg.'::'.$func} = \&{$func}; } @@ -44,11 +54,11 @@ sub import { return; } -die "Perl lib version (5.12.3) doesn't match executable version ($])" +die "Perl lib version (5.14.2) doesn't match executable '$0' version ($])" unless $^V; -$^V eq 5.12.3 - or die "Perl lib version (5.12.3) doesn't match executable version (" . +$^V eq 5.14.2 + or die "Perl lib version (5.14.2) doesn't match executable '$0' version (" . sprintf("v%vd",$^V) . ")"; @@ -56,10 +66,9 @@ sub FETCH { my($self, $key) = @_; # check for cached value (which may be undef so we use exists not defined) - return $self->{$key} if exists $self->{$key}; - - return $self->fetch_string($key); + return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key); } + sub TIEHASH { bless $_[1], $_[0]; } @@ -75,6 +84,7 @@ sub AUTOLOAD { my $rootdir = __FILE__; $rootdir =~ s![\\/][^\\/]*[\\/][^\\/]*$!!; $rootdir =~ s!/!\\!g; +my $mingdir = "x:\\mingw"; # tie returns the object, so the value returned to require will be true. tie %Config, 'Config', { @@ -83,13 +93,14 @@ tie %Config, 'Config', { cc => 'gcc', d_readlink => undef, d_symlink => undef, + dlext => 'dll', dlsrc => 'dl_win32.xs', dont_use_nlink => undef, exe_ext => '.exe', inc_version_list => '', intsize => '4', ldlibpthname => '', - libpth => 'X:\\mingw32\\lib', + libpth => "$mingdir\\lib", osname => 'MSWin32', osvers => '5.1', path_sep => ';', @@ -97,7 +108,8 @@ tie %Config, 'Config', { scriptdir => "$rootdir\\bin", sitearchexp => "$rootdir\\site\\lib", sitelibexp => "$rootdir\\site\\lib", + so => 'dll', useithreads => 'define', usevendorprefix => undef, - version => '5.12.3', + version => '5.14.2', }; |