]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
Makefile.PL: check `getconf NPROCESSORS_ONLN', too
authorEric Wong <e@80x24.org>
Sat, 9 Sep 2023 12:01:35 +0000 (12:01 +0000)
committerEric Wong <e@80x24.org>
Sat, 9 Sep 2023 21:31:53 +0000 (21:31 +0000)
NetBSD and OpenBSD getconf(1) don't accept a leading underscore,
while glibc getconf(1) only accepts the leading underscore
(`_NPROCESSORS_ONLN').  FreeBSD getconf(1) accepts both variants.

Makefile.PL

index 5a5628badc3eb5e4eb4dfb3fc617b2b8e9ec7582..d065241041fd4c7cc44e428dea8c07e9bfe095da 100644 (file)
@@ -196,7 +196,8 @@ WriteMakefile(
 );
 
 sub MY::postamble {
-       my $N = (`{ getconf _NPROCESSORS_ONLN || nproc; } 2>/dev/null` || 1);
+       my $N = (`{ getconf _NPROCESSORS_ONLN || getconf NPROCESSORS_ONLN ||
+               gnproc || nproc; } 2>/dev/null` || 1);
        $N += 1; # account for sleeps in some tests (and makes an IV)
        <<EOF;
 PROVE = prove