]> git.saurik.com Git - cycript.git/blobdiff - xcode.sh
Change all /bin/bash shebangs to use env bash.
[cycript.git] / xcode.sh
index de4e5ab0012784c63d69c0201845ca031c640106..b92a67deaf2d27ced9408b5c97f43a1d48419b8d 100755 (executable)
--- a/xcode.sh
+++ b/xcode.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Cycript - Optimizing JavaScript Compiler/Runtime
 # Copyright (C) 2009-2013  Jay Freeman (saurik)
@@ -63,7 +63,9 @@ function configure() {
     cd ..
 }
 
-configure mac "${mac}" "-arch i386 -arch x86_64 -mmacosx-version-min=10.6" CPPFLAGS="-I../readline" LDFLAGS="-L../readline"
+for arch in i386 x86_64; do
+    configure "mac-${arch}" "${mac}" "-arch ${arch} -mmacosx-version-min=10.6" CPPFLAGS="-I../readline" LDFLAGS="-L../readline"
+done
 
 function build() {
     local dir=$1
@@ -71,8 +73,21 @@ function build() {
     local flg=$3
     shift 3
 
-    configure "${dir}" "${sdk}" "${flg}" "$@" --enable-static --with-pic #CPPFLAGS="-idirafter ${mac}/usr/include"
+    configure "${dir}" "${sdk}" "${flg}" "$@" --enable-static --with-pic
 }
 
-build sim iphonesimulator "-arch i386 -mios-simulator-version-min=2.0" OBJCXXFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch" CPPFLAGS="-I../libffi.i386/include" LDFLAGS="-L.." --disable-console
-build ios iphoneos5.1 "-arch armv6 -miphoneos-version-min=2.0" --host=arm-apple-darwin10 CPPFLAGS="-I../libffi.armv6/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib" LDFLAGS="-L.. -L../sysroot.ios/usr/lib"
+for arch in i386; do
+    build "sim-${arch}" iphonesimulator "-arch ${arch} -mios-simulator-version-min=2.0" OBJCXXFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch" CPPFLAGS="-I../libffi.${arch}/include" LDFLAGS="-L.." --disable-console
+done
+
+for arch in armv6 armv7 armv7s; do
+    if [[ ${arch} == armv6 ]]; then
+        sdk=iphoneos5.1
+        flg=()
+    else
+        sdk=iphoneos
+        flg=(--disable-console)
+    fi
+
+    build "ios-${arch}" "${sdk}" "-arch ${arch} -miphoneos-version-min=2.0" --host=arm-apple-darwin10 CPPFLAGS="-I../libffi.${arch}/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" LTLIBAPR="../sysroot.ios/usr/lib/libapr-1.dylib" LDFLAGS="-L.. -L../sysroot.ios/usr/lib" "${flg[@]}"
+done