]>
Commit | Line | Data |
---|---|---|
9d13f949 JF |
1 | #!/usr/bin/env bash |
2 | ||
8ad1528b | 3 | rm -rf sysroot.ios |
9d13f949 JF |
4 | mkdir -p sysroot.ios |
5 | ||
8ad1528b | 6 | for 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}" | |
13 | done | |
14 | ||
8ad1528b JF |
15 | mkdir -p sysroot.ios/usr/include/ffi |
16 | mv -v sysroot.ios/usr/include/{,ffi/}ffi.h | |
17 | ||
9d13f949 | 18 | dev=/Developer/Platforms/iPhoneOS.platform/Developer |
8ad1528b JF |
19 | sdk=${dev}/SDKs/iPhoneOS4.3.sdk |
20 | ||
21 | ln -s /System/Library/Frameworks/WebKit.framework/Versions/A/Headers sysroot.ios/usr/include/WebKit | |
22 | ||
23 | mkdir -p sysroot.ios/Library/Frameworks/JavaScriptCore.framework | |
24 | ln -s "${sdk}"/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore sysroot.ios/Library/Frameworks/JavaScriptCore.framework | |
25 | ln -s /System/Library/Frameworks/JavaScriptCore.framework/Headers sysroot.ios/Library/Frameworks/JavaScriptCore.framework | |
26 | ||
9d13f949 JF |
27 | export CC=${dev}/usr/bin/gcc |
28 | export CXX=${dev}/usr/bin/g++ | |
8ad1528b | 29 | export OBJCXX=${dev}/usr/bin/g++ |
9d13f949 JF |
30 | |
31 | flags_armv6=() | |
8ad1528b | 32 | flags_armv6+=(-isysroot "${sdk}") |
9d13f949 | 33 | |
8ad1528b | 34 | flags_armv6+=(-Fsysroot.ios/Library/Frameworks) |
9d13f949 JF |
35 | flags_armv6+=(-Isysroot.ios/usr/include) |
36 | flags_armv6+=(-Lsysroot.ios/usr/lib) | |
37 | ||
8ad1528b JF |
38 | flags_armv6+=(-F"${sdk}"/System/Library/PrivateFrameworks) |
39 | flags_armv6+=(-framework WebCore) | |
40 | ||
41 | ||
9d13f949 JF |
42 | flags=() |
43 | for flag in "${flags_armv6[@]}"; do | |
44 | flags+=(-Xarch_armv6 "${flag}") | |
45 | done | |
46 | ||
47 | cflags=${flags[*]} | |
48 | export CFLAGS=${cflags} | |
49 | export CXXFLAGS=${cflags} | |
8ad1528b | 50 | export OBJCXXFLAGS=${cflags} |
9d13f949 JF |
51 | |
52 | lflags=() | |
53 | for flag in "${flags[@]}"; do | |
54 | lflags+=("-Xcompiler ${flag}") | |
55 | done | |
56 | ||
57 | lflags=${lflags[*]} | |
58 | export LTFLAGS=${lflags} | |
59 | ||
60 | ./configure --prefix=/usr "$@" | |
8ad1528b JF |
61 | |
62 | make clean | |
63 | make -j ldid=ldid all | |
64 | make arch=iphoneos-arm version=432 dll=dylib depends='apr-lib readline libffi mobilesubstrate' package |