summaryrefslogtreecommitdiff
path: root/write_buildcustomize.pl
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-03-01 06:20:16 -0500
committerSteve Hay <steve.m.hay@googlemail.com>2014-04-08 13:03:47 +0100
commit8ce7a7e8b08f04e70601dd7b8717af879a4ea397 (patch)
tree82b95b847b6c8b9ddafe2deb5a7e4c2ab2b1d2be /write_buildcustomize.pl
parent4a70680af1019e8cdeaf52bb506d9fbda1dd4f05 (diff)
downloadperl-8ce7a7e8b08f04e70601dd7b8717af879a4ea397.tar.gz
speed up miniperl require on Win32
These 3 optimizations reduce the number of, usually failing, I/O calls for each "require" for miniperl only. None are appropriate except for Win32. See #121119 for details.
Diffstat (limited to 'write_buildcustomize.pl')
-rw-r--r--write_buildcustomize.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/write_buildcustomize.pl b/write_buildcustomize.pl
index 64bf4ce6cb..cf429a906c 100644
--- a/write_buildcustomize.pl
+++ b/write_buildcustomize.pl
@@ -54,7 +54,10 @@ require File::Spec::Functions;
my $inc = join ",\n ",
map { "q\0$_\0" }
- (map {File::Spec::Functions::rel2abs($_)} @toolchain, 'lib');
+ (map {File::Spec::Functions::rel2abs($_)} (
+# faster build on the non-parallel Win32 build process
+ $^O eq 'MSWin32' ? ('lib', @toolchain ) : (@toolchain, 'lib')
+ ));
open my $fh, '>', $file
or die "Can't open $file: $!";
@@ -74,6 +77,7 @@ print $fh <<"EOT" or $error = "Can't print to $file: $!";
# We are miniperl, building extensions
# Replace the first entry of \@INC ("lib") with the list of
# directories we need.
+${\($^O eq 'MSWin32' ? '${^WIN32_SLOPPY_STAT} = 1;':'')}
splice(\@INC, 0, 1, $inc);
\$^O = '$osname';
EOT