buildmacuniversal.sh
author Ryan C. Gordon <icculus@icculus.org>
Fri, 27 Jan 2006 19:40:20 +0000
changeset 101 98288e66c2e1
child 107 dbffd9a2b4a8
permissions -rwxr-xr-x
Hacks for building Universal Binaries on Mac.
icculus@101
     1
#!/bin/sh
icculus@101
     2
icculus@101
     3
# Build a Universal binary, gcc 3.3 on PowerPC and gcc 4 on Intel...
icculus@101
     4
make BINDIR=bin-ppc CC=gcc-3.3 LD=gcc-3.3 EXTRACFLAGS="-arch ppc" EXTRALDFLAGS="-arch ppc" $* || exit 1
icculus@101
     5
make BINDIR=bin-i386 CC=gcc-4.0 LD=gcc-4.0 EXTRACFLAGS="-arch i386" EXTRALDFLAGS="-arch i386" $* || exit 1
icculus@101
     6
icculus@101
     7
mkdir -p bin
icculus@101
     8
for feh in `ls bin-ppc` ; do
icculus@101
     9
    echo "Gluing bin-ppc/$feh and bin-i386/$feh into bin/$feh ..."
icculus@101
    10
    lipo -create -o bin/$feh bin-ppc/$feh bin-i386/$feh
icculus@101
    11
done
icculus@101
    12
icculus@101
    13
rm -rf bin-ppc bin-i386
icculus@101
    14
exit 0
icculus@101
    15