kivy-ios/environment.sh

67 lines
1.6 KiB
Bash
Raw Normal View History

#!/bin/bash
try () {
"$@" || exit -1
}
# iOS SDK Environmnent
2011-12-06 11:42:37 +01:00
export SDKVER=5.0
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk
2011-12-06 10:49:14 +01:00
# version of packages
2011-12-06 11:42:37 +01:00
export PYTHON_VERSION=2.7.1
export SDLTTF_VERSION=2.0.10
export FT_VERSION=2.4.8
2011-12-06 10:49:14 +01:00
# where the build will be located
2011-12-06 11:42:37 +01:00
export KIVYIOSROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export BUILDROOT="$KIVYIOSROOT/build"
export CACHEROOT="$KIVYIOSROOT/.cache"
2011-12-06 10:49:14 +01:00
# some tools
CCACHE=$(which ccache)
if [ "$(which ccache)" != '' ]; then
export CCACHE=$(which ccache)
echo "CCACHE detecté in '$CCACHE'"
else
echo "CCACHE not used"
fi
2011-12-06 10:49:14 +01:00
# flags for arm compilation
export ARM_CC="$DEVROOT/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
export ARM_AR="$DEVROOT/usr/bin/ar"
export ARM_LD="$DEVROOT/usr/bin/ld"
export ARM_CFLAGS="-march=armv7 -mcpu=arm176jzf -mcpu=cortex-a8"
export ARM_CFLAGS="$ARM_CFLAGS -pipe -no-cpp-precomp"
export ARM_CFLAGS="$ARM_CFLAGS -isysroot $SDKROOT"
export ARM_CFLAGS="$ARM_CFLAGS -miphoneos-version-min=$SDKVER"
export ARM_LDFLAGS="-isysroot $SDKROOT"
export ARM_LDFLAGS="$ARM_LDFLAGS -miphoneos-version-min=$SDKVER"
# comment this line if you want debugging stuff
export ARM_CFLAGS="$ARM_CFLAGS -O0 -g"
# create build directory if not found
try mkdir -p $BUILDROOT
try mkdir -p $BUILDROOT/include
try mkdir -p $BUILDROOT/lib
try mkdir -p $CACHEROOT
# one method to deduplicate some symbol in libraries
function deduplicate() {
fn=$(basename $1)
echo "== Trying to remove duplicate symbol in $1"
try mkdir ddp
try cd ddp
try ar x $1
try ar rc $fn *.o
try ranlib $fn
try mv -f $fn $1
try cd ..
try rm -rf ddp
}