]> git.saurik.com Git - cycript.git/commitdiff
Upgrade simulator compilation for Xcode 4.6 clang.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 12 Jun 2013 07:01:55 +0000 (00:01 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 12 Jun 2013 07:01:55 +0000 (00:01 -0700)
GNUmakefile.in
simulate.sh
simulator.sh

index 11addbebac4874dca7990a0604d986381e2a5d50..ef723351dd3292ac0a80fe5ae277be643dfd63d4 100644 (file)
@@ -109,7 +109,7 @@ filters += C
 header += JavaScript.hpp
 endif
 
-cflags += -Wall -Werror -Wno-parentheses #-Wno-unused
+cflags := -Wall -Werror -Wno-parentheses $(cflags)
 cflags += -fno-common
 ifneq ($(srcdir),.)
 cflags += -I.
index ca81215a5e106c163634d25a90c2e7f9d8194997..4b6c3eeec96c1d70cecec6a23be3dc7f723086c8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-export DYLD_ROOT_PATH=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
+export DYLD_ROOT_PATH=$(xcode-select --print-path)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk
 export DYLD_FALLBACK_LIBRARY_PATH=/usr/lib
 export DYLD_FALLBACK_FRAMEWORK_PATH=/System/Library/Frameworks
 
index 634d38bc2ea636e90a9aa07ddae913589ed460ac..c1358a795f05d2d5c8088ccf79666d815dcc544b 100755 (executable)
@@ -5,12 +5,14 @@ set -e
 rm -rf sysroot.sim
 mkdir -p sysroot.sim
 
+xsp=$(xcode-select --print-path)
 plt=iPhoneSimulator
-dev=/Developer/Platforms/${plt}.platform/Developer
-sdk=${dev}/SDKs/${plt}5.0.sdk
+dev=${xsp}/Platforms/${plt}.platform/Developer
+sdk=${dev}/SDKs/${plt}6.1.sdk
+mac=${xsp}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
 
 mkdir -p sysroot.sim/usr/include
-cp -a /usr/include/ffi sysroot.sim/usr/include
+cp -a "${mac}"/usr/include/ffi sysroot.sim/usr/include
 
 mkdir -p sysroot.sim/usr/lib
 cp -a /usr/lib/libffi.dylib sysroot.sim/usr/lib
@@ -22,40 +24,45 @@ mkdir -p sysroot.sim/Library/Frameworks/JavaScriptCore.framework
 ln -s "${sdk}"/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore sysroot.sim/Library/Frameworks/JavaScriptCore.framework
 ln -s /System/Library/Frameworks/JavaScriptCore.framework/Headers sysroot.sim/Library/Frameworks/JavaScriptCore.framework
 
-export CC=${dev}/usr/bin/gcc
-export CXX=${dev}/usr/bin/g++
-export OBJCXX=${dev}/usr/bin/g++
+export CC=/usr/bin/clang
+export CXX=/usr/bin/clang++
+export OBJCXX=/usr/bin/clang++
 
-flags_i386=()
-flags_i386+=(-isysroot "${sdk}")
+flags=(-arch i386)
+flags+=(-isysroot "${sdk}")
+flags+=(-Fsysroot.sim/Library/Frameworks)
 
-flags_i386+=(-Fsysroot.sim/Library/Frameworks)
-flags_i386+=(-Isysroot.sim/usr/include)
-flags_i386+=(-Lsysroot.sim/usr/lib)
+cflags=("${flags[@]}")
+cflags+=(-Isysroot.sim/usr/include)
+cflags+=(-fobjc-abi-version=2)
+cflags+=(-Wno-overloaded-virtual)
+cflags+=(-Wno-unneeded-internal-declaration)
 
-flags_i386+=(-F"${sdk}"/System/Library/PrivateFrameworks)
-flags_i386+=(-framework WebCore)
+lflags=("${flags[@]}")
+lflags+=(-Lsysroot.sim/usr/lib)
+lflags+=(-F"${sdk}"/System/Library/PrivateFrameworks)
+lflags+=(-framework WebCore)
 
-flags=()
-for flag in "${flags_i386[@]}"; do
-    flags+=(-Xarch_i386 "${flag}")
-done
-
-flags+=(-fobjc-abi-version=2)
-
-cflags=${flags[*]}
+cflags=${cflags[*]}
 export CFLAGS=${cflags}
 export CXXFLAGS=${cflags}
 export OBJCXXFLAGS=${cflags}
 
-export OBJCXXFLAGS="${OBJCXXFLAGS} -Xarch_i386 -fobjc-legacy-dispatch"
+export OBJCXXFLAGS="${OBJCXXFLAGS} -fobjc-legacy-dispatch"
 
-lflags=()
+lflags=${lflags[*]}
+export LDFLAGS=${lflags}
+
+tflags=()
 for flag in "${flags[@]}"; do
-    lflags+=("-Xcompiler ${flag}")
+    tflags+=("-Xcompiler ${flag}")
 done
 
-lflags=${lflags[*]}
-export LTFLAGS=${lflags}
+tflags=${tflags[*]}
+export LTFLAGS=${tflags}
+
+export DYLD_ROOT_PATH=${sdk}
+export DYLD_FALLBACK_LIBRARY_PATH=/usr/lib
+export DYLD_FALLBACK_FRAMEWORK_PATH=/System/Library/Frameworks
 
 ./configure "$@"