aboutsummaryrefslogtreecommitdiffstats
path: root/dist-tools/makerelease.pl
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2020-09-04 10:00:49 +0200
committerMatthias Andree <matthias.andree@gmx.de>2020-09-04 10:03:28 +0200
commit35a11ac5ea4abf23015e9c220087ad240e7ee5a7 (patch)
tree4c3dd3a413c606a2e77841c78725dfef0f63191e /dist-tools/makerelease.pl
parent45db183304e9d3145d039d8c0f5f169465fc1ac4 (diff)
downloadfetchmail-35a11ac5ea4abf23015e9c220087ad240e7ee5a7.tar.gz
fetchmail-35a11ac5ea4abf23015e9c220087ad240e7ee5a7.tar.bz2
fetchmail-35a11ac5ea4abf23015e9c220087ad240e7ee5a7.zip
makerelease.pl: use make -j for parallel build.
Diffstat (limited to 'dist-tools/makerelease.pl')
-rwxr-xr-xdist-tools/makerelease.pl13
1 files changed, 11 insertions, 2 deletions
diff --git a/dist-tools/makerelease.pl b/dist-tools/makerelease.pl
index b0183888..6523d595 100755
--- a/dist-tools/makerelease.pl
+++ b/dist-tools/makerelease.pl
@@ -17,6 +17,7 @@ my $lzsufx = '.tar.lz';
use POSIX qw(strftime);
use Getopt::Long;
use strict vars;
+use warnings;
# check environment
(-r "NEWS" and -r "fetchmail.c" and -r "configure.ac") or die "Please cd to the top-level source directory!";
@@ -116,8 +117,16 @@ if (system("mkdir -p autobuild && cd autobuild "
. " && ../configure -C --silent --with-ssl")) { die("Configuration failure\n"); }
print "### Test-building the software...\n";
-if (system("cd autobuild && make -s clean"
- . " && make " . ($verbose ? '' : '-s') . " check distcheck")) {
+my $ncpu;
+open(my $p, "-|", "nproc 2>/dev/null || gnproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_CONF 2>/dev/null || echo 2") or die "cannot find number of CPUs";
+if (not defined ($ncpu = <$p>)) { die "cannot read number of CPUs"; }
+close $p or die "could not find number of CPUs";
+
+print "### CPUs for make: $ncpu\n";
+
+if ($ncpu < 1) { warn "ncpus unplausible, assuming 2"; $ncpu = 2; }
+
+if (system("cd autobuild && make -j$ncpu " . ($verbose ? '' : '-s') . " check distcheck")) {
die("Compilation failure\n");
}