]> git.saurik.com Git - cycript.git/blame - ios.sh
Add plt abstraction for ios.sh.
[cycript.git] / ios.sh
CommitLineData
9d13f949
JF
1#!/usr/bin/env bash
2
8ad1528b 3rm -rf sysroot.ios
9d13f949
JF
4mkdir -p sysroot.ios
5
8ad1528b 6for deb in apr-lib_1.3.3-2 libffi_130618-4 readline_6.0-7; do
9d13f949 7 deb=${deb}_iphoneos-arm.deb
8ad1528b 8 [[ -f "${deb}" ]] || wget http://apt.saurik.com/debs/"${deb}"
9d13f949
JF
9 tar=data.tar.lzma
10 ar -x "${deb}" "${tar}"
11 tar -C sysroot.ios -xf "${tar}"
12 rm -f "${tar}"
13done
14
8ad1528b
JF
15mkdir -p sysroot.ios/usr/include/ffi
16mv -v sysroot.ios/usr/include/{,ffi/}ffi.h
17
6927ece0
JF
18plt=iPhoneOS
19dev=/Developer/Platforms/$plt.platform/Developer
20sdk=${dev}/SDKs/$plt4.3.sdk
8ad1528b
JF
21
22ln -s /System/Library/Frameworks/WebKit.framework/Versions/A/Headers sysroot.ios/usr/include/WebKit
23
24mkdir -p sysroot.ios/Library/Frameworks/JavaScriptCore.framework
25ln -s "${sdk}"/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore sysroot.ios/Library/Frameworks/JavaScriptCore.framework
26ln -s /System/Library/Frameworks/JavaScriptCore.framework/Headers sysroot.ios/Library/Frameworks/JavaScriptCore.framework
27
9d13f949
JF
28export CC=${dev}/usr/bin/gcc
29export CXX=${dev}/usr/bin/g++
8ad1528b 30export OBJCXX=${dev}/usr/bin/g++
9d13f949
JF
31
32flags_armv6=()
8ad1528b 33flags_armv6+=(-isysroot "${sdk}")
9d13f949 34
8ad1528b 35flags_armv6+=(-Fsysroot.ios/Library/Frameworks)
9d13f949
JF
36flags_armv6+=(-Isysroot.ios/usr/include)
37flags_armv6+=(-Lsysroot.ios/usr/lib)
38
8ad1528b
JF
39flags_armv6+=(-F"${sdk}"/System/Library/PrivateFrameworks)
40flags_armv6+=(-framework WebCore)
41
42
9d13f949
JF
43flags=()
44for flag in "${flags_armv6[@]}"; do
45 flags+=(-Xarch_armv6 "${flag}")
46done
47
48cflags=${flags[*]}
49export CFLAGS=${cflags}
50export CXXFLAGS=${cflags}
8ad1528b 51export OBJCXXFLAGS=${cflags}
9d13f949
JF
52
53lflags=()
54for flag in "${flags[@]}"; do
55 lflags+=("-Xcompiler ${flag}")
56done
57
58lflags=${lflags[*]}
59export LTFLAGS=${lflags}
60
61./configure --prefix=/usr "$@"
8ad1528b
JF
62
63make clean
64make -j ldid=ldid all
65make arch=iphoneos-arm version=432 dll=dylib depends='apr-lib readline libffi mobilesubstrate' package