summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh4
-rwxr-xr-xtests/runtest.sh4
2 files changed, 6 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index d5a35d20f7..97a11c2b15 100755
--- a/build.sh
+++ b/build.sh
@@ -643,8 +643,10 @@ if [ `uname` = "FreeBSD" ]; then
__NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
elif [ `uname` = "NetBSD" ]; then
__NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
-else
+elif [ `uname` = "Darwin" ]; then
__NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
+else
+ __NumProc=$(nproc --all)
fi
while :; do
diff --git a/tests/runtest.sh b/tests/runtest.sh
index fdc067eb2d..e238723743 100755
--- a/tests/runtest.sh
+++ b/tests/runtest.sh
@@ -733,8 +733,10 @@ function run_test {
# Variables for running tests in the background
if [ `uname` = "NetBSD" ]; then
NumProc=$(getconf NPROCESSORS_ONLN)
-else
+elif [ `uname` = "Darwin" ]; then
NumProc=$(getconf _NPROCESSORS_ONLN)
+else
+ NumProc=$(nproc --all)
fi
((maxProcesses = $NumProc * 3 / 2)) # long tests delay process creation, use a few more processors