buildmacuniversal.sh
author Ryan C. Gordon <icculus@icculus.org>
Fri, 28 Mar 2008 06:57:04 +0000
changeset 109 9fae2fac7b94
parent 107 dbffd9a2b4a8
permissions -rwxr-xr-x
Updated copyright info.
icculus@101
     1
#!/bin/sh
icculus@101
     2
icculus@107
     3
CPUCOUNT=`sysctl -n hw.ncpu`
icculus@107
     4
icculus@101
     5
# Build a Universal binary, gcc 3.3 on PowerPC and gcc 4 on Intel...
icculus@107
     6
make -j$CPUCOUNT BINDIR=bin-ppc CC=gcc-3.3 LD=gcc-3.3 EXTRACFLAGS="-arch ppc" EXTRALDFLAGS="-arch ppc" $* || exit 1
icculus@107
     7
make -j$CPUCOUNT BINDIR=bin-i386 CC=gcc-4.0 LD=gcc-4.0 EXTRACFLAGS="-arch i386" EXTRALDFLAGS="-arch i386" $* || exit 1
icculus@101
     8
icculus@101
     9
mkdir -p bin
icculus@101
    10
for feh in `ls bin-ppc` ; do
icculus@101
    11
    echo "Gluing bin-ppc/$feh and bin-i386/$feh into bin/$feh ..."
icculus@101
    12
    lipo -create -o bin/$feh bin-ppc/$feh bin-i386/$feh
icculus@101
    13
done
icculus@101
    14
icculus@101
    15
rm -rf bin-ppc bin-i386
icculus@101
    16
exit 0
icculus@101
    17