get correct number of cores info in MacOSX
no /proc file system in MacOSX. use sysctl to return correct number of cores to speed up building. Change-Id: Ic813521c5867fd3c5ac1f565894dcb89aa1a3579
This commit is contained in:
parent
24eaa04526
commit
efb7430eb1
4
build.sh
4
build.sh
|
@ -25,7 +25,11 @@ txtrst=$(tput sgr0) # Reset
|
|||
|
||||
# Local defaults, can be overriden by environment
|
||||
: ${PREFS_FROM_SOURCE:="false"}
|
||||
if [ `uname -s` == "Darwin" ]; then
|
||||
: ${THREADS:="$(sysctl -n machdep.cpu.core_count)"}
|
||||
else
|
||||
: ${THREADS:="$(cat /proc/cpuinfo | grep "^processor" | wc -l)"}
|
||||
fi
|
||||
|
||||
# If there is more than one jdk installed, use latest 6.x
|
||||
if [ "`update-alternatives --list javac | wc -l`" -gt 1 ]; then
|
||||
|
|
Loading…
Reference in New Issue