Commit e3dc51fb authored by Konstantin Pavlov's avatar Konstantin Pavlov

Simplify and improve the detection of the number of CPU cores.

parent d58a6450
......@@ -16,7 +16,7 @@ OSX_KERNELVERSION=`uname -r | cut -d. -f1`
SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
VLCBUILDDIR=""
CORE_COUNT=`sysctl -n machdep.cpu.core_count`
CORE_COUNT=`getconf NPROCESSORS_ONLN 2>&1`
let JOBS=$CORE_COUNT+1
usage()
......
......@@ -78,7 +78,7 @@ esac
#####
JOBS=`nproc --all`
JOBS=`getconf _NPROCESSORS_ONLN 2>&1`
TRIPLET=$ARCH-w64-mingw32
info "Building extra tools"
......
......@@ -91,13 +91,16 @@ check flex
CPUS=
case `uname` in
Linux|MINGW32*|MINGW64*)
CPUS=`grep -c ^processor /proc/cpuinfo`
CPUS=`getconf _NPROCESSORS_ONLN 2>&1`
;;
Darwin)
CPUS=`sysctl hw.ncpu|cut -d" " -f2`
Darwin|FreeBSD|NetBSD)
CPUS=`getconf NPROCESSORS_ONLN 2>&1`
;;
OpenBSD)
CPUS=`sysctl -n hw.ncpu 2>&1`
;;
SunOS)
CPUS=`/usr/bin/kstat -p :::state | grep 'on-line$' | wc -l | sed 's/ //g'`
CPUS=`psrinfo | wc -l 2>&1`
;;
*)
CPUS=1 # default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment