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:
-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"