Shortnote

The tools in this section are based on iOS4, the SDK being the iPhoneOS4.2 SDK. We use OSX, potentially running under a Virtual Machine.

Requirements

  • OSX Snow Leopard (server-edition for use with Parallels and VMware) with the minimal configuration.
  • XCode 3.2.5 (xcode_3.2.5_and_ios_sdk_4.2_final.dmg) from which we extract just the iPhoneOS4.2 SDK folder.
  • XCode 3.2.6 (xcode_3.2.6_and_ios_sdk_4.3.dmg) for the rest of the required tools.

Cross-Compile Script

The cross-compile script used to create bundles for iOS is the following:

#!/bin/sh
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS4.2.sdk
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 AS=$DEVROOT/usr/bin/as
export NM=$DEVROOT/usr/bin/nm
export CXXCPP=$DEVROOT/usr/bin/cpp
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -L$SDKROOT/usr/lib -L/Users/cross/Development/iOS/usr/lib"
export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -isysroot $SDKROOT -I$SDKROOT/usr/include -I/Users/cross/Development/iOS/include"
export CXXFLAGS="-arch armv6 -pipe -no-cpp-precomp -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -isysroot $SDKROOT -I$SDKROOT/usr/include -I/Users/cross/Development/iOS/include/"
export PKG_CONFIG_PATH=/Users/cross/Development/iOS/usr/lib/:$PKG_CONFIG_PATH
export PATH=$DEVROOT/usr/bin:/Users/cross/Development/iOS/usr/bin:$PATH

where cross is the OSX user and the path to the development directory is /Users/cross/Development/iOS.

Using automake and autoconf build systems, we always cross-compile to the ARM platform by using the –host=arm-apple-darwin9. As an example, for compiling APC (as we did on apc) we use the following additions to the compile script above:

./configure --prefix=/usr \
            --sysconfdir=/etc \
            --localstatedir=/var \
            --host=arm-apple-darwin9 \
            --with-php-config=/Users/frank/Development/iOS/usr/bin/php-config \
            --with-libdir=/Users/frank/Development/iOS/usr/lib \
            --disable-apc-pthreadmutex \
            --disable-apc-pthreadrwlocks \
            --enable-apc-spinlocks

ios/cross_compile.txt · Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.