Skip to content

Commit

Permalink
get correct number of cores info in MacOSX
Browse files Browse the repository at this point in the history
no /proc file system in MacOSX. use sysctl to return correct number of
cores to speed up building.

Change-Id: Ic813521c5867fd3c5ac1f565894dcb89aa1a3579
  • Loading branch information
yenliangl committed Oct 1, 2014
1 parent 24eaa04 commit efb7430
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efb7430

Please sign in to comment.