Update `build_ios.sh` for building luajit

This commit is contained in:
samuele3hu 2014-04-01 11:28:27 +08:00
parent 7804fdf0a1
commit 22720fa1b7
1 changed files with 16 additions and 1 deletions

View File

@ -7,20 +7,35 @@ SRCDIR=$DIR/src
DESTDIR=$DIR/prebuilt/ios DESTDIR=$DIR/prebuilt/ios
IXCODE=`xcode-select -print-path` IXCODE=`xcode-select -print-path`
ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer
ISDKVER=iPhoneOS6.1.sdk INFOPLIST_PATH=$IXCODE/Platforms/iPhoneOS.platform/version.plist
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${INFOPLIST_PATH}")
ISDKVER=iPhoneOS${BUNDLE_ID}.sdk
if [ "${ISDKVER}" = "iPhoneOS7.0.sdk" ] || [ "${ISDKVER}" = "iPhoneOS7.1.sdk" ]; then
ISDKP=$IXCODE/usr/bin/
else
ISDKP=$ISDK/usr/bin/ ISDKP=$ISDK/usr/bin/
fi
rm "$DESTDIR"/*.a rm "$DESTDIR"/*.a
cd $SRCDIR cd $SRCDIR
make clean make clean
ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER" ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER"
if [ ${ISDKVER} = "iPhoneOS7.0.sdk" ] || [ ${ISDKVER} = "iPhoneOS7.1.sdk" ]; then
make HOST_CC="gcc -m32 -arch i386" TARGET_FLAGS="$ISDKF" TARGET=arm TARGET_SYS=iOS
else
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
fi
mv "$SRCDIR"/src/libluajit.a "$DESTDIR"/libluajit-armv7.a mv "$SRCDIR"/src/libluajit.a "$DESTDIR"/libluajit-armv7.a
make clean make clean
ISDKF="-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER" ISDKF="-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER"
if [ ${ISDKVER} = "iPhoneOS7.0.sdk" ] || [ ${ISDKVER} = "iPhoneOS7.1.sdk" ]; then
make HOST_CC="gcc -m32 -arch i386" TARGET_FLAGS="$ISDKF" TARGET=arm TARGET_SYS=iOS
else
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
fi
mv "$SRCDIR"/src/libluajit.a "$DESTDIR"/libluajit-armv7s.a mv "$SRCDIR"/src/libluajit.a "$DESTDIR"/libluajit-armv7s.a
make clean make clean