This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid pointer churn in study_chunk recursion bitmap allocation
[perl5.git] / write_buildcustomize.pl
index 709923b..73bf8f0 100644 (file)
@@ -7,9 +7,6 @@ if (@ARGV) {
     unshift @INC, 'lib';
 }
 
-unshift @INC, ('dist/Cwd', 'dist/Cwd/lib');
-require File::Spec::Functions;
-
 my $file = 'lib/buildcustomize.pl';
 
 # To clarify, this isn't the entire suite of modules considered "toolchain"
@@ -31,10 +28,18 @@ my @toolchain = qw(cpan/AutoLoader/lib
                   cpan/File-Path/lib
                   ext/re
                   dist/Term-ReadLine/lib
+                   dist/Exporter/lib
+                   ext/File-Find/lib
+                   cpan/Text-Tabs/lib
+                  dist/constant/lib
                   );
 
 # Used only in ExtUtils::Liblist::Kid::_win32_ext()
 push @toolchain, 'cpan/Text-ParseWords/lib' if $^O eq 'MSWin32';
+push @toolchain, 'ext/VMS-Filespec/lib' if $^O eq 'VMS';
+
+unshift @INC, @toolchain;
+require File::Spec::Functions;
 
 # lib must be last, as the toolchain modules write themselves into it
 # as they build, and it's important that @INC order ensures that the partially
@@ -65,8 +70,12 @@ if ($error) {
     close $fh
         or warn "Can't unlink $file after error: $!";
 } else {
-    close $fh and exit;
-    $error = "Can't close $file: $!";
+    if (close $fh) {
+        do $file and exit;
+        $error = "Can't load generated $file: $@";
+    } else {
+        $error = "Can't close $file: $!";
+    }
 }
 
 # It's going very wrong, so try to remove the botched file.