+
+$heavy_txt .= join('', @non_v) . "\n";
+
+# copy config summary format from the myconfig.SH script
+$heavy_txt .= "our \$summary = <<'!END!';\n";
+open(MYCONFIG,"<myconfig.SH") || die "open myconfig.SH failed: $!";
+1 while defined($_ = <MYCONFIG>) && !/^Summary of/;
+do { $heavy_txt .= $_ } until !defined($_ = <MYCONFIG>) || /^\s*$/;
+close(MYCONFIG);
+
+$heavy_txt .= "\n!END!\n" . <<'EOT';
+my $summary_expanded;
+
+sub myconfig {
+ return $summary_expanded if $summary_expanded;
+ ($summary_expanded = $summary) =~ s{\$(\w+)}
+ { my $c = $Config::Config{$1}; defined($c) ? $c : 'undef' }ge;
+ $summary_expanded;
+}
+
+local *_ = \my $a;
+$_ = <<'!END!';
+EOT
+
+$heavy_txt .= join('', sort @v_others) . "!END!\n";
+
+# Only need the dynamic byteorder code in Config.pm if 'byteorder' is one of
+# the precached keys
+if ($Common{byteorder}) {
+ $config_txt .= $byteorder_code;
+} else {
+ $heavy_txt .= $byteorder_code;
+}
+
+if (@need_relocation) {
+$heavy_txt .= 'foreach my $what (qw(' . join (' ', @need_relocation) .
+ ")) {\n" . <<'EOT';
+ s/^($what=)(['"])(.*?)\2/$1 . $2 . relocate_inc($3) . $2/me;
+}
+EOT
+# Currently it only makes sense to do the ... relocation on Unix, so there's
+# no need to emulate the "which separator for this platform" logic in perl.c -
+# ':' will always be applicable
+if ($need_relocation{otherlibdirs}) {
+$heavy_txt .= << 'EOT';
+s{^(otherlibdirs=)(['"])(.*?)\2}
+ {$1 . $2 . join ':', map {relocate_inc($_)} split ':', $3 . $2}me;
+EOT
+}
+}
+
+$heavy_txt .= <<'EOT';
+s/(byteorder=)(['"]).*?\2/$1$2$Config::byteorder$2/m;
+
+my $config_sh_len = length $_;
+
+our $Config_SH_expanded = "\n$_" . << 'EOVIRTUAL';
+EOT
+
+foreach my $prefix (qw(ccflags ldflags)) {
+ my $value = fetch_string ({}, $prefix);
+ my $withlargefiles = fetch_string ({}, $prefix . "_uselargefiles");
+ if (defined $withlargefiles) {
+ $value =~ s/\Q$withlargefiles\E\b//;
+ $heavy_txt .= "${prefix}_nolargefiles='$value'\n";
+ }
+}
+
+foreach my $prefix (qw(libs libswanted)) {
+ my $value = fetch_string ({}, $prefix);
+ my $withlf = fetch_string ({}, 'libswanted_uselargefiles');
+ next unless defined $withlf;
+ my @lflibswanted
+ = split(' ', fetch_string ({}, 'libswanted_uselargefiles'));
+ if (@lflibswanted) {
+ my %lflibswanted;
+ @lflibswanted{@lflibswanted} = ();
+ if ($prefix eq 'libs') {
+ my @libs = grep { /^-l(.+)/ &&
+ not exists $lflibswanted{$1} }
+ split(' ', fetch_string ({}, 'libs'));
+ $value = join(' ', @libs);
+ } else {
+ my @libswanted = grep { not exists $lflibswanted{$_} }
+ split(' ', fetch_string ({}, 'libswanted'));
+ $value = join(' ', @libswanted);
+ }
+ }
+ $heavy_txt .= "${prefix}_nolargefiles='$value'\n";
+}
+
+$heavy_txt .= "EOVIRTUAL\n";
+
+$heavy_txt .= $fetch_string;
+
+$config_txt .= <<'ENDOFEND';
+
+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);
+}
+ENDOFEND
+
+$heavy_txt .= <<'ENDOFEND';
+