8 xsp
=$(xcode-select --print-path)
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
14 mkdir -p sysroot.sim
/usr
/include
15 cp -a "${mac}"/usr
/include
/ffi sysroot.sim
/usr
/include
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
21 ln -s /System
/Library
/Frameworks
/WebKit.framework
/Versions
/A
/Headers sysroot.sim
/usr
/include
/WebKit
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
27 export CC
=/usr
/bin
/clang
28 export CXX
=/usr
/bin
/clang
++
29 export OBJCXX
=/usr
/bin
/clang
++
32 flags
+=(-isysroot "${sdk}")
33 flags
+=(-Fsysroot.sim
/Library
/Frameworks
)
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)
41 lflags
=("${flags[@]}")
42 lflags
+=(-Lsysroot.sim
/usr
/lib
)
43 lflags
+=(-F"${sdk}"/System
/Library
/PrivateFrameworks
)
44 lflags
+=(-framework WebCore
)
47 export CFLAGS
=${cflags}
48 export CXXFLAGS
=${cflags}
49 export OBJCXXFLAGS
=${cflags}
51 export OBJCXXFLAGS
="${OBJCXXFLAGS} -fobjc-legacy-dispatch"
54 export LDFLAGS
=${lflags}
57 for flag
in "${flags[@]}"; do
58 tflags
+=("-Xcompiler ${flag}")
62 export LTFLAGS
=${tflags}
64 export DYLD_ROOT_PATH
=${sdk}
65 export DYLD_FALLBACK_LIBRARY_PATH
=/usr
/lib
66 export DYLD_FALLBACK_FRAMEWORK_PATH
=/System
/Library
/Frameworks