summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrançois Revol <revol@free.fr>2013-12-27 02:43:01 +0100
committerVincent Sanders <vince@netsurf-browser.org>2014-01-29 09:51:03 +0000
commitab2f5ccb4bf4670f9e943ae739a9afcafca9b108 (patch)
tree5243c2a9666f27e549222a07c489fd7dac66f373
parent7cb0619fe8c39d189dbcfa4ecbd0db573ff250e6 (diff)
downloadnetsurf-ab2f5ccb4bf4670f9e943ae739a9afcafca9b108.tar.gz
netsurf-ab2f5ccb4bf4670f9e943ae739a9afcafca9b108.tar.bz2
env.sh: Use a more portable way of counting online processors
getconf _NPROCESSORS_ONLN should be available on Linux, FreeBSD and OSX at least: http://linux.die.net/man/1/getconf https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/getconf.1.html getconf NPROCESSORS_ONLN is BSD variant which Haiku provides. One might want to handle Solaris too some day... cf. https://gist.github.com/jj1bdx/5746298
-rw-r--r--Docs/env.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/Docs/env.sh b/Docs/env.sh
index 7b5aedd1d..734bc34f9 100644
--- a/Docs/env.sh
+++ b/Docs/env.sh
@@ -22,7 +22,7 @@ if [ "x${TARGET_WORKSPACE}" = "x" ]; then
fi
if [ "x${USE_CPUS}" = "x" ]; then
- NCPUS=$(grep -c "^processor" /proc/cpuinfo 2>/dev/null)
+ NCPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null)
NCPUS="${NCPUS:-1}"
NCPUS=$((NCPUS * 2))
USE_CPUS="-j${NCPUS}"