CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<`
-private = preplibrary lib/Config.pm lib/ExtUtils/Miniperl.pm
+CONFIGPM = lib/Config.pm lib/Config_heavy.pl
+private = preplibrary $(CONFIGPM) lib/ExtUtils/Miniperl.pm
# Files to be built with variable substitution before miniperl
# is available.
cd x2p; $(MAKE) compile;
cd pod; $(MAKE) compile;
-translators: miniperl$(EXE_EXT) lib/Config.pm FORCE
+translators: miniperl$(EXE_EXT) $(CONFIGPM) FORCE
@echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
-utilities: miniperl$(EXE_EXT) lib/Config.pm $(plextract) lib/lib.pm FORCE
+utilities: miniperl$(EXE_EXT) $(CONFIGPM) $(plextract) lib/lib.pm FORCE
@echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
# We need to autosplit in two steps because VOS can't handle so many args
#
.PHONY: preplibrary
-preplibrary: miniperl$(EXE_EXT) lib/Config.pm lib/lib.pm $(PREPLIBRARY_LIBPERL)
+preplibrary: miniperl$(EXE_EXT) $(CONFIGPM) lib/lib.pm $(PREPLIBRARY_LIBPERL)
@sh ./makedir lib/auto
@echo " AutoSplitting perl library"
$(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
# Take care to avoid modifying lib/Config.pm without reason
# (If trying to create a new port and having problems with the configpm script,
# try 'make minitest' and/or commenting out the tests at the end of configpm.)
-lib/Config.pm: config.sh miniperl$(EXE_EXT) configpm Porting/Glossary
- $(LDLIBPTH) ./miniperl -Ilib configpm configpm.tmp
- sh mv-if-diff configpm.tmp $@
+$(CONFIGPM): config.sh miniperl$(EXE_EXT) configpm Porting/Glossary
+ $(LDLIBPTH) ./miniperl -Ilib configpm --heavy=lib/Config_heavy.pl configpm.tmp
+ sh mv-if-diff configpm.tmp lib/Config.pm
-lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl$(EXE_EXT) minimod.pl lib/Config.pm
+lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl$(EXE_EXT) minimod.pl $(CONFIGPM)
$(LDLIBPTH) ./miniperl minimod.pl > minimod.tmp
sh mv-if-diff minimod.tmp $@
-touch lib/ExtUtils/Miniperl.pm
lib/re.pm: ext/re/re.pm
cp ext/re/re.pm ext/re/re.tmp && sh mv-if-diff ext/re/re.tmp lib/re.pm
-$(plextract): miniperl$(EXE_EXT) lib/Config.pm x2p/s2p
+$(plextract): miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p
@-rm -f $@
$(LDLIBPTH) ./miniperl -Ilib $@.PL
-x2p/s2p: miniperl$(EXE_EXT) lib/Config.pm x2p/s2p.PL
+x2p/s2p: miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p.PL
cd x2p; $(LDLIBPTH) $(MAKE) s2p
-lib/lib.pm: miniperl$(EXE_EXT) lib/Config.pm
+lib/lib.pm: miniperl$(EXE_EXT) $(CONFIGPM)
@-rm -f $@
$(LDLIBPTH) ./miniperl -Ilib lib/lib_pm.PL
-$(unidatafiles): miniperl$(EXE_EXT) lib/Config.pm lib/unicore/mktables
+$(unidatafiles): miniperl$(EXE_EXT) $(CONFIGPM) lib/unicore/mktables
cd lib/unicore && $(LDLIBPTH) ../../miniperl -I../../lib mktables -w
extra.pods: miniperl$(EXE_EXT)
# allowed opts as well as specifies default and initial values
my %Allowed_Opts = (
- 'cross' => '', # --cross=PALTFORM - crosscompiling for PLATFORM
- 'glossary' => 1, # --no-glossary - no glossary file inclusion,
+ 'cross' => '', # --cross=PLATFORM - crosscompiling for PLATFORM
+ 'glossary' => 1, # --no-glossary - no glossary file inclusion,
# for compactness
+ 'heavy' => '', # pathname of the Config_heavy.pl file
);
sub opts {
my %Opts = opts();
-my $Config_PM;
+my ($Config_PM, $Config_heavy);
my $Glossary = $ARGV[1] || 'Porting/Glossary';
if ($Opts{cross}) {
else {
$Config_PM = $ARGV[0] || 'lib/Config.pm';
}
-
+if ($Opts{heavy}) {
+ $Config_heavy = $Opts{heavy};
+}
+else {
+ ($Config_heavy = $Config_PM) =~ s!\.pm$!_heavy.pl!;
+ die "Can't automatically determine name for Config_heavy.pl from '$Config_PM'"
+ if $Config_heavy eq $Config_PM;
+}
open CONFIG, ">$Config_PM" or die "Can't open $Config_PM: $!\n";
+open CONFIG_HEAVY, ">$Config_heavy" or die "Can't open $Config_heavy: $!\n";
+
+print CONFIG_HEAVY <<'ENDOFBEG';
+# 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.
+
+package Config;
+use strict;
+# use warnings; Pulls in Carp
+# use vars pulls in Carp
+ENDOFBEG
my $myver = sprintf "v%vd", $^V;
my \$i = 0;
foreach my \$c ($list) { \$i |= ord(\$c); \$i <<= 8 }
\$i |= ord(1);
-my \$byteorder = join('', unpack('$format', pack('$f', \$i)));
+our \$byteorder = join('', unpack('$format', pack('$f', \$i)));
EOT
} else {
- $byteorder_code = "my \$byteorder = '?'x$s;\n";
+ $byteorder_code = "our \$byteorder = '?'x$s;\n";
}
+print CONFIG $byteorder_code;
-print CONFIG @non_v, "\n";
+print CONFIG_HEAVY @non_v, "\n";
# copy config summary format from the myconfig.SH script
-print CONFIG "our \$summary : unique = <<'!END!';\n";
+print CONFIG_HEAVY "our \$summary : unique = <<'!END!';\n";
open(MYCONFIG,"<myconfig.SH") || die "open myconfig.SH failed: $!";
1 while defined($_ = <MYCONFIG>) && !/^Summary of/;
-do { print CONFIG $_ } until !defined($_ = <MYCONFIG>) || /^\s*$/;
+do { print CONFIG_HEAVY $_ } until !defined($_ = <MYCONFIG>) || /^\s*$/;
close(MYCONFIG);
# 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", $byteorder_code, <<'EOT';
+print CONFIG_HEAVY "\n!END!\n", <<'EOT';
my $summary_expanded;
sub myconfig {
return $summary_expanded if $summary_expanded;
($summary_expanded = $summary) =~ s{\$(\w+)}
- { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge;
+ { my $c = $Config::Config{$1}; defined($c) ? $c : 'undef' }ge;
$summary_expanded;
}
$_ = <<'!END!';
EOT
-print CONFIG join("", @v_fast, sort @v_others);
+print CONFIG_HEAVY join("", @v_fast, sort @v_others);
-print CONFIG <<'EOT';
+print CONFIG_HEAVY <<'EOT';
!END!
-s/(byteorder=)(['"]).*?\2/$1$2$byteorder$2/m;
+s/(byteorder=)(['"]).*?\2/$1$2$Config::byteorder$2/m;
our $Config_SH : unique = $_;
our $Config_SH_expanded : unique = "\n$_" . << 'EOVIRTUAL';
my $value = fetch_string ({}, $prefix);
my $withlargefiles = fetch_string ({}, $prefix . "_uselargefiles");
$value =~ s/\Q$withlargefiles\E\b//;
- print CONFIG "${prefix}_nolargefiles='$value'\n";
+ print CONFIG_HEAVY "${prefix}_nolargefiles='$value'\n";
}
foreach my $prefix (qw(libs libswanted)) {
$value = join(' ', @libswanted);
}
}
- print CONFIG "${prefix}_nolargefiles='$value'\n";
+ print CONFIG_HEAVY "${prefix}_nolargefiles='$value'\n";
}
-print CONFIG "EOVIRTUAL\n";
+print CONFIG_HEAVY "EOVIRTUAL\n";
-print CONFIG $fetch_string;
+print CONFIG_HEAVY $fetch_string;
print CONFIG <<'ENDOFEND';
-sub FETCH {
+sub FETCH {
my($self, $key) = @_;
# check for cached value (which may be undef so we use exists not defined)
return $self->fetch_string($key);
}
-
+ENDOFEND
+
+print CONFIG_HEAVY <<'ENDOFEND';
my $prevpos = 0;
sub FIRSTKEY {
print map "$_$lnend", @matches ? @matches : "$qry: not found" if !$notag;
print map { s/\w+=//; "$_$lnend" } @matches ? @matches : "$qry: not found" if $notag;
} else {
- my $v = (exists $Config{$qry}) ? $Config{$qry} : 'UNKNOWN';
+ my $v = (exists $Config::Config{$qry}) ? $Config::Config{$qry}
+ : 'UNKNOWN';
$v = 'undef' unless defined $v;
print "${prfx}'${v}'$lnend";
}
}
}
+# Called by the real AUTOLOAD
+sub launcher {
+ undef &AUTOLOAD;
+ goto \&$Config::AUTOLOAD;
+}
+
+1;
ENDOFEND
if ($^O eq 'os2') {
print CONFIG sprintf <<'ENDOFTIE', $fast_config;
-# avoid Config..Exporter..UNIVERSAL search for DESTROY then AUTOLOAD
sub DESTROY { }
+sub AUTOLOAD {
+ require 'config_heavy.pl';
+ goto \&launcher;
+ die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
+}
+
tie %%Config, 'Config', {
%s
};
ENDOFTAIL
+close(CONFIG_HEAVY);
close(CONFIG);
close(GLOS);
close(CONFIG_POD);
Create/Directory $(ARCHDIR)
Copy/NoConfirm/Log $(MMS$SOURCE) $(ARCHDIR)
+$(ARCHDIR)Config_heavy.pl : [.lib]Config_heavy.pl
+ Create/Directory $(ARCHDIR)
+ Copy/NoConfirm/Log $(MMS$SOURCE) $(ARCHDIR)
+
[.lib]Config.pm : config.h $(MINIPERL_EXE)
$(MINIPERL) ConfigPM.
Backup/Log/Verify [.lib.auto...]*.*;/Exclude=(*.al,*.ix) 'archroot'/New_Version
Delete/Log/NoConfirm [.lib.auto...]*.*;*/exclude=(*.al,*.ix,*.dir)
Delete/Log/NoConfirm [.lib]Config.pm;*
+ Delete/Log/NoConfirm [.lib]Config_heavy.pl;*
Copy/Log/NoConfirm *$(E);,[.x2p]$(DBG)a2p$(E); $(ARCHDIR)
Delete/Log/NoConfirm Perl*$(E);*,[.x2p]$(DBG)a2p$(E);*
@ QUALIFIERS := $(MMSQUALIFIERS)
- If F$Search("[.Lib]XSLoader.pm;-1").nes."" Then Purge/NoConfirm/Log [.Lib]XSLoader.pm
- If F$Search("[.Lib]Config.pm;-1").nes."" Then Purge/NoConfirm/Log [.Lib]Config.pm
- If F$Search("$(ARCHDIR)Config.pm;-1").nes."" Then Purge/NoConfirm/Log $(ARCHDIR)Config.pm
+ - If F$Search("[.Lib]Config_heavy.pl;-1").nes."" Then Purge/NoConfirm/Log [.Lib]Config_heavy.pl
+ - If F$Search("$(ARCHDIR)Config_heavy.pl;-1").nes."" Then Purge/NoConfirm/Log $(ARCHDIR)Config_heavy.pl
- If F$Search("[.lib.ExtUtils]Miniperl.pm").nes."" Then Purge/NoConfirm/Log [.lib.ExtUtils]Miniperl.pm
- If F$Search("[.lib.ExtUtils]XSSymSet.pm").nes."" Then Purge/NoConfirm/Log [.lib.ExtUtils]XSSymSet.pm
- If F$Search("[.Lib.VMS]*.*;-1").nes."" Then Purge/NoConfirm/Log [.Lib.VMS]*.*
- If F$Search("[.Lib]DynaLoader.pm").nes."" Then Delete/NoConfirm/Log [.Lib]DynaLoader.pm;*
- If F$Search("[.Lib]XSLoader.pm").nes."" Then Delete/NoConfirm/Log [.Lib]XSLoader.pm;*
- If F$Search("[.Lib]Config.pm").nes."" Then Delete/NoConfirm/Log [.Lib]Config.pm;*
+ - If F$Search("[.Lib]Config_heavy.pl").nes."" Then Delete/NoConfirm/Log [.Lib]Config_heavy.pl;*
- If F$Search("[.Lib]*.com").nes."" Then Delete/NoConfirm/Log [.Lib]*.com;*
- If F$Search("[.pod]*.com").nes."" Then Delete/NoConfirm/Log [.pod]*.com;*
- If F$Search("[.utils]*.com").nes."" Then Delete/NoConfirm/Log [.utils]*.com;*
- If F$Search("[.x2p]*.com").nes."" Then Delete/NoConfirm/Log [.x2p]*.com;*
- If F$Search("$(ARCHDIR)Config.pm").nes."" Then Delete/NoConfirm/Log $(ARCHDIR)Config.pm;*
+ - If F$Search("$(ARCHDIR)Config_heavy.pl").nes."" Then Delete/NoConfirm/Log $(ARCHDIR)Config_heavy.pl;*
- If F$Search("[.lib.ExtUtils]Miniperl.pm").nes."" Then Delete/NoConfirm/Log [.lib.ExtUtils]Miniperl.pm;*
- If F$Search("[.lib.ExtUtils]XSSymSet.pm").nes."" Then Delete/NoConfirm/Log [.lib.ExtUtils]XSSymSet.pm;*
- If F$Search("[.lib.pod]*.pod").nes."" Then Delete/NoConfirm/Log [.lib.pod]*.pod;*