mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-12 22:09:19 +03:00
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
This commit is contained in:
parent
7cb0619fe8
commit
ab2f5ccb4b
@ -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}"
|
||||
|
Loading…
Reference in New Issue
Block a user