make everything compile for iphonesimulator/i386
This commit is contained in:
parent
cdd79ab77c
commit
60b3c202ec
5 changed files with 33 additions and 27 deletions
|
@ -21,8 +21,7 @@ fi
|
|||
pushd $TMPROOT/libffi-$FFI_VERSION
|
||||
try patch -p1 < $KIVYIOSROOT/src/ffi_files/ffi-$FFI_VERSION-sysv.S.patch
|
||||
|
||||
try xcodebuild -project libffi.xcodeproj -target "libffi iOS" -configuration Release -sdk iphoneos$SDKVER OTHER_CFLAGS="-no-integrated-as"
|
||||
|
||||
try cp build/Release-iphoneos/libffi.a $BUILDROOT/lib/libffi.a
|
||||
try cp -a build/Release-iphoneos/usr/local/include $BUILDROOT/include/ffi
|
||||
try xcodebuild $XCODEBUILD_FLAGS OTHER_CFLAGS="-no-integrated-as" -project libffi.xcodeproj -target "libffi iOS"
|
||||
try cp build/Release-${TARGET_SDK}/libffi.a $BUILDROOT/lib/libffi.a
|
||||
try cp -a build/Release-${TARGET_SDK}/usr/local/include $BUILDROOT/include/ffi
|
||||
popd
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/bash
|
||||
. $(dirname $0)/environment.sh
|
||||
pushd $KIVYIOSROOT/src/SDL/Xcode-iOS/SDL
|
||||
xcodebuild -project SDL.xcodeproj -target libSDL -configuration Release -sdk iphoneos$SDKVER
|
||||
xcodebuild $XCODEBUILD_FLAGS -project SDL.xcodeproj -target libSDL
|
||||
popd
|
||||
|
||||
cp $KIVYIOSROOT/src/SDL/Xcode-iOS/SDL/build/Release-iphoneos/libSDL2.a $BUILDROOT/lib
|
||||
cp $KIVYIOSROOT/src/SDL/Xcode-iOS/SDL/build/Release-${TARGET_SDK}//libSDL2.a $BUILDROOT/lib
|
||||
cp -a $KIVYIOSROOT/src/SDL/include $BUILDROOT/include/SDL
|
||||
|
||||
cat>$BUILDROOT/pkgconfig/sdl.pc<<EOF
|
||||
|
|
|
@ -63,17 +63,17 @@ popd
|
|||
try cp $TMPROOT/libogg/src/.libs/libogg.a $BUILDROOT/lib
|
||||
try cp $TMPROOT/libtremor/tremor/.libs/libvorbisidec.a $BUILDROOT/lib
|
||||
|
||||
if [ -f $TMPROOT/SDL_mixer/libSDL_mixer-arm7.a ]; then
|
||||
exit 0;
|
||||
fi
|
||||
#if [ -f $TMPROOT/SDL_mixer/libSDL_mixer-arm7.a ]; then
|
||||
# exit 0;
|
||||
#fi
|
||||
|
||||
if [ ! -f $TMPROOT/libtremor/ogg ]; then
|
||||
ln -s $TMPROOT/libogg/include/ogg $TMPROOT/libtremor
|
||||
fi
|
||||
|
||||
pushd $TMPROOT/SDL_mixer/Xcode-iOS
|
||||
try xcodebuild -project SDL_mixer.xcodeproj -configuration Release
|
||||
try xcodebuild $XCODEBUILD_FLAGS -project SDL_mixer.xcodeproj
|
||||
popd
|
||||
|
||||
try cp $TMPROOT/SDL_mixer/Xcode-iOS/build/Release-iphoneos/libSDL_mixer.a $BUILDROOT/lib
|
||||
try cp $TMPROOT/SDL_mixer/Xcode-iOS/build/Release-$TARGET_SDK/libSDL_mixer.a $BUILDROOT/lib
|
||||
try cp -a $TMPROOT/SDL_mixer/SDL_mixer.h $BUILDROOT/include
|
||||
|
|
|
@ -8,21 +8,26 @@ try () {
|
|||
"$@" || exit -1
|
||||
}
|
||||
|
||||
#KIVY_IOS_SDK=iphoneos
|
||||
export TARGET_SDK="iphonesimulator"
|
||||
export CPU_ARCHITECHTURE="i386"
|
||||
export XCODEBUILD_FLAGS="ONLY_ACTIVE_ARCH=NO ARCHS=$CPU_ARCHITECHTURE -configuration Release -sdk ${TARGET_SDK} --arch=$CPU_ARCHITECHTURE"
|
||||
|
||||
|
||||
|
||||
# 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 IOSSDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk
|
||||
#export SDKVER=`xcodebuild -showsdks | fgrep "$KIVY_IOS_SDK" | tail -n 1 | awk '{print $2}'`
|
||||
#export DEVROOT=`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer
|
||||
export SDKVER=`xcrun --sdk $TARGET_SDK --show-sdk-version`
|
||||
export IOSSDKROOT=`xcrun --sdk $TARGET_SDK --show-sdk-path`
|
||||
|
||||
# Xcode doesn't include /usr/local/bin
|
||||
export PATH="$PATH":/usr/local/bin
|
||||
|
||||
if [ ! -d $DEVROOT ]; then
|
||||
echo "Unable to found the Xcode iPhoneOS.platform"
|
||||
if [ ! -d $IOSSDKROOT ]; then
|
||||
echo "Unable to found the target $TARGET_SDK SDK "
|
||||
echo
|
||||
echo "The path is automatically set from 'xcode-select -print-path'"
|
||||
echo " + /Platforms/iPhoneOS.platform/Developer"
|
||||
echo
|
||||
echo "Ensure 'xcode-select -print-path' is set."
|
||||
echo "The path is automatically set from 'xcrun --sdk $TARGET_SDK --show-sdk-path'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -78,19 +83,21 @@ if [ $CONFIGURATION_OK -eq 0 ]; then
|
|||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
# flags for arm compilation
|
||||
#export ARM_CC="$CCACHE $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_CC=$(xcrun -find -sdk iphoneos clang)
|
||||
export ARM_AR=$(xcrun -find -sdk iphoneos ar)
|
||||
export ARM_LD=$(xcrun -find -sdk iphoneos ld)
|
||||
export ARM_CC=$(xcrun -find -sdk $TARGET_SDK clang)
|
||||
export ARM_AR=$(xcrun -find -sdk $TARGET_SDK ar)
|
||||
export ARM_LD=$(xcrun -find -sdk $TARGET_SDK ld)
|
||||
|
||||
export ARM_CFLAGS="-arch armv7"
|
||||
export ARM_CFLAGS="-arch $CPU_ARCHITECHTURE"
|
||||
export ARM_CFLAGS="$ARM_CFLAGS -pipe -no-cpp-precomp"
|
||||
export ARM_CFLAGS="$ARM_CFLAGS -isysroot $IOSSDKROOT"
|
||||
export ARM_CFLAGS="$ARM_CFLAGS -miphoneos-version-min=$SDKVER"
|
||||
export ARM_LDFLAGS="-arch armv7 -isysroot $IOSSDKROOT"
|
||||
export ARM_LDFLAGS="-arch $CPU_ARCHITECHTURE -isysroot $IOSSDKROOT"
|
||||
export ARM_LDFLAGS="$ARM_LDFLAGS -miphoneos-version-min=$SDKVER"
|
||||
|
||||
# uncomment this line if you want debugging stuff
|
||||
|
|
|
@ -51,7 +51,7 @@ while i < len(sys.argv):
|
|||
|
||||
if opt.startswith('-arch'):
|
||||
continue
|
||||
|
||||
|
||||
if opt.startswith("-"):
|
||||
print sys.argv
|
||||
print "Unknown option: ", opt
|
||||
|
@ -73,4 +73,4 @@ f.close()
|
|||
print 'Liblink redirect linking with', objects
|
||||
subprocess.call([
|
||||
environ.get('ARM_LD'), '-r',
|
||||
'-o', output + '.o', '-arch', 'armv7'] + objects)
|
||||
'-o', output + '.o', '-arch', environ.get('CPU_ARCHITECHTURE')] + objects)
|
||||
|
|
Loading…
Add table
Reference in a new issue