From 1ecdc551518e4373cfd76181b17f2ead4d9ebd30 Mon Sep 17 00:00:00 2001 From: François Revol Date: Fri, 27 Dec 2013 02:43:01 +0100 Subject: 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 ...and shall soon be available on Haiku as well. --- Docs/env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Docs/env.sh') diff --git a/Docs/env.sh b/Docs/env.sh index db2729c0c..7dc9fcaf0 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) NCPUS="${NCPUS:-1}" NCPUS=$((NCPUS * 2)) USE_CPUS="-j${NCPUS}" -- cgit v1.2.3