Skip to content

Instantly share code, notes, and snippets.

@splhack
Created December 24, 2010 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splhack/753825 to your computer and use it in GitHub Desktop.
Save splhack/753825 to your computer and use it in GitHub Desktop.
#!/bin/sh
IOSSDKVERSION=4.3
GCCVERSION=4.2.1
DEPLOYMENTTARGET=4.0
case $0 in
*iphonesim*)
IOSTARGET=iPhoneSimulator
HOSTARCH=i686-apple-darwin10
ARCH=i386
;;
*)
IOSTARGET=iPhoneOS
HOSTARCH=arm-apple-darwin10
ARCH=armv6
;;
esac
IOSROOT=/Developer/Platforms/$IOSTARGET.platform/Developer
IOSSDK=$IOSROOT/SDKs/$IOSTARGET$IOSSDKVERSION.sdk
GCCPATH=$IOSROOT/usr/bin
BUILDARCH=i386-apple-darwin10
COMPILER="$GCCPATH/$HOSTARCH-gcc-$GCCVERSION -march=$ARCH -miphoneos-version-min=$DEPLOYMENTTARGET -isysroot $IOSSDK"
#COMPILER="$GCCPATH/clang -arch $ARCH -miphoneos-version-min=$DEPLOYMENTTARGET -isysroot $IOSSDK"
export CPP="$COMPILER -E"
export CC="$COMPILER"
export CXX="$COMPILER"
export AR="$GCCPATH/ar"
export LD="$GCCPATH/ld"
export CFLAGS="-gdwarf-2 -Os -pipe $LDFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-march=$ARCH -gdwarf-2"
./configure --build=$BUILDARCH --host=$HOSTARCH --disable-shared $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment