-
Notifications
You must be signed in to change notification settings - Fork 8
/
luajit-iOS6.1.sh
executable file
·33 lines (26 loc) · 1.01 KB
/
luajit-iOS6.1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
LUAJIT=luajit-2.0
ISDK=`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer
ISDKVER=iPhoneOS6.1.sdk
ISDKP=$ISDK/usr/bin/
CC=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
cd $LUAJIT
rm -rf iOS
mkdir iOS
#make for iP3/4
make HOST_CC="$CC -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER" TARGET=arm TARGET_SYS=iOS clean all
cp -p src/libluajit.a iOS/libluajit-armv7.a
#make for iP5
make HOST_CC="$CC -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER" TARGET=arm TARGET_SYS=iOS clean all
cp -p src/libluajit.a iOS/libluajit-armv7s.a
#make for Simulator
make CC="$CC -m32" clean all
cp -p src/libluajit.a iOS/libluajit-i386.a
#combine files
make clean
mkdir LuaJIT.framework
mkdir LuaJIT.framework/Headers
lipo -create iOS/libluajit-*.a -output ./LuaJIT.framework/LuaJIT
rm iOS/libluajit-*.a
#copy headers
cp src/luajit.h src/luaconf.h src/lua.h src/lua.hpp src/lauxlib.h src/lualib.h ./LuaJIT.framework/Headers
cd ..