]>
Commit | Line | Data |
---|---|---|
05733577 JF |
1 | #!/usr/bin/env bash |
2 | ||
3 | set -e | |
4 | ||
5 | rm -rf sysroot.sim | |
6 | mkdir -p sysroot.sim | |
7 | ||
84152e4b | 8 | xsp=$(xcode-select --print-path) |
05733577 | 9 | plt=iPhoneSimulator |
84152e4b JF |
10 | dev=${xsp}/Platforms/${plt}.platform/Developer |
11 | sdk=${dev}/SDKs/${plt}6.1.sdk | |
12 | mac=${xsp}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk | |
05733577 JF |
13 | |
14 | mkdir -p sysroot.sim/usr/include | |
84152e4b | 15 | cp -a "${mac}"/usr/include/ffi sysroot.sim/usr/include |
05733577 JF |
16 | |
17 | mkdir -p sysroot.sim/usr/lib | |
18 | cp -a /usr/lib/libffi.dylib sysroot.sim/usr/lib | |
19 | cp -a /usr/lib/libapr-1.* sysroot.sim/usr/lib | |
20 | ||
21 | ln -s /System/Library/Frameworks/WebKit.framework/Versions/A/Headers sysroot.sim/usr/include/WebKit | |
22 | ||
23 | mkdir -p sysroot.sim/Library/Frameworks/JavaScriptCore.framework | |
24 | ln -s "${sdk}"/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore sysroot.sim/Library/Frameworks/JavaScriptCore.framework | |
25 | ln -s /System/Library/Frameworks/JavaScriptCore.framework/Headers sysroot.sim/Library/Frameworks/JavaScriptCore.framework | |
26 | ||
84152e4b JF |
27 | export CC=/usr/bin/clang |
28 | export CXX=/usr/bin/clang++ | |
29 | export OBJCXX=/usr/bin/clang++ | |
05733577 | 30 | |
84152e4b JF |
31 | flags=(-arch i386) |
32 | flags+=(-isysroot "${sdk}") | |
33 | flags+=(-Fsysroot.sim/Library/Frameworks) | |
05733577 | 34 | |
84152e4b JF |
35 | cflags=("${flags[@]}") |
36 | cflags+=(-Isysroot.sim/usr/include) | |
37 | cflags+=(-fobjc-abi-version=2) | |
38 | cflags+=(-Wno-overloaded-virtual) | |
39 | cflags+=(-Wno-unneeded-internal-declaration) | |
05733577 | 40 | |
84152e4b JF |
41 | lflags=("${flags[@]}") |
42 | lflags+=(-Lsysroot.sim/usr/lib) | |
43 | lflags+=(-F"${sdk}"/System/Library/PrivateFrameworks) | |
44 | lflags+=(-framework WebCore) | |
05733577 | 45 | |
84152e4b | 46 | cflags=${cflags[*]} |
05733577 JF |
47 | export CFLAGS=${cflags} |
48 | export CXXFLAGS=${cflags} | |
49 | export OBJCXXFLAGS=${cflags} | |
50 | ||
84152e4b | 51 | export OBJCXXFLAGS="${OBJCXXFLAGS} -fobjc-legacy-dispatch" |
05733577 | 52 | |
84152e4b JF |
53 | lflags=${lflags[*]} |
54 | export LDFLAGS=${lflags} | |
55 | ||
56 | tflags=() | |
05733577 | 57 | for flag in "${flags[@]}"; do |
84152e4b | 58 | tflags+=("-Xcompiler ${flag}") |
05733577 JF |
59 | done |
60 | ||
84152e4b JF |
61 | tflags=${tflags[*]} |
62 | export LTFLAGS=${tflags} | |
63 | ||
64 | export DYLD_ROOT_PATH=${sdk} | |
65 | export DYLD_FALLBACK_LIBRARY_PATH=/usr/lib | |
66 | export DYLD_FALLBACK_FRAMEWORK_PATH=/System/Library/Frameworks | |
05733577 | 67 | |
0fa0e7f0 | 68 | ./configure "$@" |