]> git.saurik.com Git - cycript.git/blobdiff - simulator.sh
Remove XXX as cur_term is not part of readline.
[cycript.git] / simulator.sh
index 37ff1537e6ea0479864d9d4f4259a5d463a321bd..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 --prefix=/usr "$@"
+./configure "$@"