Use all cores/CPUs when building universal binaries.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 30 Oct 2006 00:01:43 +0000
changeset 107 dbffd9a2b4a8
parent 106 e53e987f6ce3
child 108 0b8bcaef83e7
Use all cores/CPUs when building universal binaries.
buildmacuniversal.sh
--- a/buildmacuniversal.sh	Sun Oct 29 23:56:01 2006 +0000
+++ b/buildmacuniversal.sh	Mon Oct 30 00:01:43 2006 +0000
@@ -1,8 +1,10 @@
 #!/bin/sh
 
+CPUCOUNT=`sysctl -n hw.ncpu`
+
 # Build a Universal binary, gcc 3.3 on PowerPC and gcc 4 on Intel...
-make BINDIR=bin-ppc CC=gcc-3.3 LD=gcc-3.3 EXTRACFLAGS="-arch ppc" EXTRALDFLAGS="-arch ppc" $* || exit 1
-make BINDIR=bin-i386 CC=gcc-4.0 LD=gcc-4.0 EXTRACFLAGS="-arch i386" EXTRALDFLAGS="-arch i386" $* || exit 1
+make -j$CPUCOUNT BINDIR=bin-ppc CC=gcc-3.3 LD=gcc-3.3 EXTRACFLAGS="-arch ppc" EXTRALDFLAGS="-arch ppc" $* || exit 1
+make -j$CPUCOUNT BINDIR=bin-i386 CC=gcc-4.0 LD=gcc-4.0 EXTRACFLAGS="-arch i386" EXTRALDFLAGS="-arch i386" $* || exit 1
 
 mkdir -p bin
 for feh in `ls bin-ppc` ; do