From f21b1a61e37a057525029e96ed6e16d6b72ee530 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Thu, 1 Dec 2011 17:41:27 +0100 Subject: [PATCH] add environment.sh to create initial build directory, and set common env var KIVYIOSROOT represent the root of this project. It can be used in external project to refer of this project (like using build/lib directory, or build/include) + change current build_* to copy include and lib in a common build/ directory --- build_freetype.sh | 11 +++++------ build_python.sh | 5 ++++- build_sdl.sh | 5 +++++ build_sdlttf.sh | 14 +++++++------- environment.sh | 25 +++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 14 deletions(-) create mode 100755 environment.sh diff --git a/build_freetype.sh b/build_freetype.sh index b081900..3ab8bba 100755 --- a/build_freetype.sh +++ b/build_freetype.sh @@ -1,11 +1,8 @@ #!/bin/bash -set -x +. environment.sh FT_VERSION=2.4.8 -SDKVER=5.0 -DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer -SDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk if [ ! -d freetype-$FT_VERSION ]; then curl -L http://download.savannah.gnu.org/releases/freetype/freetype-$FT_VERSION.tar.bz2 > freetype-$FT_VERSION.tar.bz2 @@ -19,8 +16,10 @@ fi # lib not found, compile it pushd . cd freetype-$FT_VERSION -./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=$DEVROOT/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 AR=$DEVROOT/usr/bin/ar LDFLAGS="-isysroot $SDKROOT -miphoneos-version-min=$SDKVER" CFLAGS="-O2 -miphoneos-version-min=$SDKVER -isysroot $SDKROOT" +./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=$DEVROOT/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 AR=$DEVROOT/usr/bin/ar LDFLAGS="-isysroot $SDKROOT -miphoneos-version-min=$SDKVER" CFLAGS="-O0 -g -miphoneos-version-min=$SDKVER -isysroot $SDKROOT" make clean make -cp objs/.libs/libfreetype.a libfreetype-arm7.a +# copy to buildroot +cp objs/.libs/libfreetype.a $BUILDROOT/lib/libfreetype.a +cp -a include $BUILDROOT/include/freetype diff --git a/build_python.sh b/build_python.sh index 52a5230..ab46907 100755 --- a/build_python.sh +++ b/build_python.sh @@ -1,4 +1,7 @@ #!/bin/zsh + +. ./environment.sh + set -o errexit set -x @@ -164,4 +167,4 @@ lipo $PATH_DEV/lib/libpython2.7-arm.a $PATH_SIMU/lib/libpython2.7-i386.a -create find python2.7 | grep -E '*\.(py|pyc|so\.o|so\.a|so\.libs)$' | xargs rm find python2.7 | grep -E '*test*' | xargs rm -rdf - +cp $PATH_DEV/libpython2.7-arm.a $BUILDROOT/build/lib/ diff --git a/build_sdl.sh b/build_sdl.sh index 3ae93a8..8f7de61 100755 --- a/build_sdl.sh +++ b/build_sdl.sh @@ -1,3 +1,8 @@ +#!/bin/bash +. ./environmnent.sh pushd sdl/sdl1.3/Xcode-iPhoneOS/SDL xcodebuild -project SDLiPhoneOS.xcodeproj -alltargets +popd #the binarie is under sdl/sdl1.3/Xcode-iPhoneOS/SDL/build/Release-Universal/ +cp sdl/sdl1.3/Xcode-iPhoneOS/SDL/build/Release-iPhoneOS/libSDL.a $BUILDROOT/lib +cp -a sdl/sdl1.3/include $BUILDROOT/include/SDL diff --git a/build_sdlttf.sh b/build_sdlttf.sh index 202fa8b..47058b5 100755 --- a/build_sdlttf.sh +++ b/build_sdlttf.sh @@ -1,11 +1,8 @@ #!/bin/bash -set -x +. environment.sh SDLTTF_VERSION=2.0.10 -SDKVER=5.0 -DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer -SDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk if [ ! -d SDL_ttf-$SDLTTF_VERSION ]; then curl -L http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-$SDLTTF_VERSION.tar.gz > SDL_ttf-$SDLTTF_VERSION.tar.gz @@ -17,12 +14,15 @@ if [ -f SDL_ttf-$SDLTTF_VERSION/libSDL_ttf-arm7.a ]; then fi -cd SDL_ttf-2.0.10 +cd SDL_ttf-$SDLTTF_VERSION rm libSDL_ttf.la ./configure --prefix=/usr/local/iphone --host=arm-apple-darwin \ --enable-static=yes --enable-shared=no \ --without-x \ - CC=$DEVROOT/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 AR=$DEVROOT/usr/bin/ar LDFLAGS="-isysroot $SDKROOT -miphoneos-version-min=$SDKVER" CFLAGS="-O2 -miphoneos-version-min=$SDKVER -isysroot $SDKROOT" + CC=$DEVROOT/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 AR=$DEVROOT/usr/bin/ar LDFLAGS="-isysroot $SDKROOT -miphoneos-version-min=$SDKVER" CFLAGS="-O0 -g -miphoneos-version-min=$SDKVER -isysroot $SDKROOT" make clean make libSDL_ttf.la -cp .libs/libSDL_ttf.a libSDL_ttf-arm7.a + +# copy to buildroot +cp .libs/libSDL_ttf.a $BUILDROOT/lib/libSDL_ttf.a +cp -a SDL_ttf.h $BUILDROOT/include diff --git a/environment.sh b/environment.sh new file mode 100755 index 0000000..414f6fc --- /dev/null +++ b/environment.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +try () { + "$@" || exit -1 +} + +# iOS SDK Environmnent +SDKVER=5.0 +DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer +SDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk + +# where the build will be located +ROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +BUILDROOT="$ROOT/build" + +# for external project +export KIVYIOSROOT="$ROOT" + +# create build directory if not found +set -x +if [ ! -d $BUILDROOT ]; then + try mkdir $BUILDROOT + try mkdir $BUILDROOT/include + try mkdir $BUILDROOT/lib +fi