From c538c9593e4c4d8185c3131eab2d14c383fafe8f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 8 Aug 2020 11:24:05 +0000 Subject: favor `getconf _NPROCESSORS_ONLN` over GNU nproc getconf(1) itself is POSIX, while `_NPROCESSORS_ONLN' is not. However, FreeBSD (tested 11.4 and 12.1) and glibc (tested CentOS 7.x and Debian 10.x) both support `getconf _NPROCESSORS_ONLN'. GNU coreutils (and thus `nproc' or `gnproc') are not installed by default on the *BSDs, so we'll try the option most likely to exist on both glibc and *BSDs out-of-the-box. --- Makefile.PL | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Makefile.PL') diff --git a/Makefile.PL b/Makefile.PL index 8d90ad46..831649f9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -156,12 +156,14 @@ WriteMakefile( ); sub MY::postamble { - </dev/null` || 1); + $N += 1; # account for sleeps in some tests (and makes an IV) + </dev/null || gnproc 2>/dev/null || echo 2) + 1 )) +N = $N -include config.mak $VARS -include Documentation/include.mk -- cgit v1.2.3-24-ge0c7