r407 - trunk/examples/duke3d

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Jan 13 06:14:36 EST 2008


Author: icculus
Date: 2008-01-13 06:14:32 -0500 (Sun, 13 Jan 2008)
New Revision: 407

Modified:
   trunk/examples/duke3d/make.sh
Log:
Try to do the right thing with different CPU counts.


Modified: trunk/examples/duke3d/make.sh
===================================================================
--- trunk/examples/duke3d/make.sh	2008-01-13 06:49:48 UTC (rev 406)
+++ trunk/examples/duke3d/make.sh	2008-01-13 11:14:32 UTC (rev 407)
@@ -13,6 +13,18 @@
     DEBUG=1
 fi
 
+OSTYPE=`uname -s`
+if [ "$OSTYPE" = "Linux" ]; then
+    NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
+    let NCPU=$NCPU+1
+elif [ "$OSTYPE" = "Darwin" ]; then
+    NCPU=`sysctl -n hw.ncpu`
+else
+    NCPU=1
+fi
+
+echo "Will use make -j$NCPU. If this is wrong, check NCPU at top of script."
+
 # Show everything that we do here on stdout.
 set -x
 
@@ -55,7 +67,7 @@
     -DMOJOSETUP_IMAGE_PNG=FALSE \
     -DMOJOSETUP_URL_FTP=FALSE \
     .
-make -j5
+make -j$NCPU
 
 # Strip the binaries and GUI plugins, put them somewhere useful.
 if [ "$DEBUG" != "1" ]; then




More information about the mojosetup-commits mailing list