Skip to content

Instantly share code, notes, and snippets.

@planbnet
Created July 14, 2010 17:59
Show Gist options
  • Select an option

  • Save planbnet/475766 to your computer and use it in GitHub Desktop.

Select an option

Save planbnet/475766 to your computer and use it in GitHub Desktop.

Revisions

  1. planbnet revised this gist Dec 2, 2011. No changes.
  2. planbnet created this gist Jul 14, 2010.
    35 changes: 35 additions & 0 deletions iphone_toolchain.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    export IPHONELIBS=/opt/iphone
    export COMP_VERSION=4.0.1
    export SDK_VERSION=3.0

    export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
    export SDKROOT=${DEVROOT}/SDKs/iPhoneOS${SDK_VERSION}.sdk

    export BIN=${DEV}/usr/bin
    export PATH=${BIN}:${PATH}

    export LIBXML_CFLAGS=" -I${SDKROOT}/usr/include/libxml2"

    export CC=$DEVROOT/usr/bin/gcc
    export LD=$DEVROOT/usr/bin/ld
    export CPP=$DEVROOT/usr/bin/cpp
    export CXX=$DEVROOT/usr/bin/g++
    export AR=$DEVROOT/usr/bin/ar
    #export AR="${IPHONELIBS}/bin/gas-preprocessor.pl"
    export AS=$DEVROOT/usr/bin/as
    export NM=$DEVROOT/usr/bin/nm
    export CXXCPP=$DEVROOT/usr/bin/cpp
    export RANLIB=$DEVROOT/usr/bin/ranlib
    #export RANLIB="${AR} -s"
    export LDFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -L${IPHONELIBS}/arm/lib"
    export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I${IPHONELIBS}/arm/include"
    export CXXFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I${IPHONELIBS}/arm/include/"


    #export CC="${BIN}/arm-apple-darwin9-gcc-${COMP_VERSION}"
    #export CXX="${BIN}/arm-apple-darwin9-g++-${COMP_VERSION}"

    #export CPPFLAGS=$CFLAGS
    #export CPP="$BIN/cpp $CPPFLAGS"

    alias conf="./configure --prefix=${IPHONELIBS} --host=arm-apple-darwin9 --enable-shared=no"