Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-11 12:47:07 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-11 12:47:07 +0400
commitc5c128f26372ee7383cb6a30a60b3d9e21bd1e6e (patch)
tree65848c93c441eecd83ede8b44fea9bb380fab394 /regenerate-makefiles.sh
parent0d8ec8bbd2c256b36eadcf1696593ee653a38a21 (diff)
Add retrieving the number of cores on Mac OS X.
Diffstat (limited to 'regenerate-makefiles.sh')
-rwxr-xr-xregenerate-makefiles.sh15
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"