diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-11 12:47:07 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-11 12:47:07 +0400 |
commit | c5c128f26372ee7383cb6a30a60b3d9e21bd1e6e (patch) | |
tree | 65848c93c441eecd83ede8b44fea9bb380fab394 /regenerate-makefiles.sh | |
parent | 0d8ec8bbd2c256b36eadcf1696593ee653a38a21 (diff) |
Add retrieving the number of cores on Mac OS X.
Diffstat (limited to 'regenerate-makefiles.sh')
-rwxr-xr-x | regenerate-makefiles.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/regenerate-makefiles.sh b/regenerate-makefiles.sh index 23adf9899..f34cacfa8 100755 --- a/regenerate-makefiles.sh +++ b/regenerate-makefiles.sh @@ -46,7 +46,7 @@ fi if [ -z "$LIBTOOLIZE" ]; then LIBTOOLIZE=`which libtoolize` - + if [ -z "$LIBTOOLIZE" ]; then LIBTOOLIZE=`which glibtoolize` fi @@ -70,8 +70,19 @@ $AUTOMAKE || die "automake failed" echo "Calling $LIBTOOLIZE" $LIBTOOLIZE || die "libtoolize failed" +case `uname -s` in + Darwin) + cores=$(sysctl -n hw.ncpu) + ;; + Linux) + cores=$(cat /proc/cpuinfo | fgrep -c processor) + ;; + *) + echo "Unknown platform." + cores= + ;; +esac -cores=$(cat /proc/cpuinfo | fgrep -c processor) if [ -z "$cores" ]; then cores=2 # assume 2 cores if we can't figure it out echo >&2 "Assuming 2 cores" |