summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-06-04 23:23:19 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-06-09 13:25:45 +0200
commit4a0b7a10442eec3747d5f95ef186a79bb0648754 (patch)
tree5a0184fa7e7275cddce75e4a03247a55e79faaf6 /boot
parent3445947ae380967b4032233273fdb54d41bce157 (diff)
downloadhaskell-4a0b7a10442eec3747d5f95ef186a79bb0648754.tar.gz
Build: run autoreconf jobs in parallel
Running ./boot takes ~20 seconds on my laptop with 2 cores. With this change, that goes down to a little over 10 seconds. There are 8 configure.ac files in total, so max 8 parallel jobs. Differential Revision: https://phabricator.haskell.org/D962
Diffstat (limited to 'boot')
-rwxr-xr-xboot15
1 files changed, 12 insertions, 3 deletions
diff --git a/boot b/boot
index 8977eaf9a3..af5ccc2853 100755
--- a/boot
+++ b/boot
@@ -155,16 +155,25 @@ sub boot_pkgs {
# autoreconf everything that needs it.
sub autoreconf {
my $dir;
+ my $fail;
foreach $dir (".", glob("libraries/*/")) {
if (-f "$dir/configure.ac") {
+ next if (my $pid = fork);
+ die "fork failed: $!" if (! defined $pid);
print "Booting $dir\n";
chdir $dir or die "can't change to $dir: $!";
- system("autoreconf") == 0
- or die "Running autoreconf failed with exitcode $?";
- chdir $curdir or die "can't change to $curdir: $!";
+ exec("autoreconf");
+ exit 1;
}
}
+
+ # Wait for all child processes to finish.
+ while (wait() != -1) {
+ $fail = 1 if $?;
+ }
+
+ die "Running autoreconf failed" if $fail;
}
sub checkBuildMk {