diff --git a/tools/build-kivy.sh b/tools/build-kivy.sh index e303ea1..2fd6440 100755 --- a/tools/build-kivy.sh +++ b/tools/build-kivy.sh @@ -34,13 +34,13 @@ $HOSTPYTHON setup.py build_ext -g echo "cythoning ==========================================" find . -name *.pyx -exec $KIVYIOSROOT/tools/cythonize.py {} \; echo "Second build =======================================" -$HOSTPYTHON setup.py build_ext -g -$HOSTPYTHON setup.py install -O2 --root iosbuild +try $HOSTPYTHON setup.py build_ext -g +try $HOSTPYTHON setup.py install -O2 --root iosbuild # Strip away the large stuff find iosbuild/ | grep -E '.*\.(py|pyc|so\.o|so\.a|so\.libs)$$' | xargs rm rm -rdf "$BUILDROOT/python/lib/python2.7/site-packages/kivy" # Copy to python for iOS installation -cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$BUILDROOT/python/lib/python2.7/site-packages" +try cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$BUILDROOT/python/lib/python2.7/site-packages" export LDSHARED="$OLD_LDSHARED" export CFLAGS="$OLD_CFLAGS" diff --git a/tools/build-python.sh b/tools/build-python.sh index f1291c7..f444377 100755 --- a/tools/build-python.sh +++ b/tools/build-python.sh @@ -42,13 +42,13 @@ echo "Building for iOS =======================================================" try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-xcompile.patch # set up environment variables for cross compilation -export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I$SDKROOT/usr/include/" +export CPPFLAGS="-I$IOSSDKROOT/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I$IOSSDKROOT/usr/include/" export CPP="$CCACHE /usr/bin/cpp $CPPFLAGS" export MACOSX_DEPLOYMENT_TARGET= # make a link to a differently named library for who knows what reason mkdir extralibs||echo "foo" -ln -s "$SDKROOT/usr/lib/libgcc_s.1.dylib" extralibs/libgcc_s.10.4.dylib || echo "sdf" +ln -s "$IOSSDKROOT/usr/lib/libgcc_s.1.dylib" extralibs/libgcc_s.10.4.dylib || echo "sdf" # Copy our setup for modules try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local diff --git a/tools/environment.sh b/tools/environment.sh index 172ae6a..97561e4 100755 --- a/tools/environment.sh +++ b/tools/environment.sh @@ -8,10 +8,10 @@ try () { "$@" || exit -1 } -# iOS SDK Environmnent +# iOS SDK Environmnent (don't use name "SDKROOT"!!! it will break the compilation) export SDKVER=`xcodebuild -showsdks | fgrep "iphoneos" | tail -n 1 | awk '{print $2}'` export DEVROOT=`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer -export SDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk +export IOSSDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk if [ ! -d $DEVROOT ]; then echo "Unable to found the Xcode iPhoneOS.platform" @@ -51,9 +51,9 @@ 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 -isysroot $IOSSDKROOT" export ARM_CFLAGS="$ARM_CFLAGS -miphoneos-version-min=$SDKVER" -export ARM_LDFLAGS="-isysroot $SDKROOT" +export ARM_LDFLAGS="-isysroot $IOSSDKROOT" export ARM_LDFLAGS="$ARM_LDFLAGS -miphoneos-version-min=$SDKVER" # uncomment this line if you want debugging stuff diff --git a/tools/liblink b/tools/liblink index 7531ea9..be994f4 100755 --- a/tools/liblink +++ b/tools/liblink @@ -74,7 +74,7 @@ subprocess.call([ ''' subprocess.call([ "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2", -"-isysroot", environ.get('SDKROOT'), +"-isysroot", environ.get('IOSSDKROOT'), "-r", "-march=armv7", "-mcpu=arm176jzf", "-mcpu=cortex-a8", "-o", output + ".o" ] + objects) '''