]> git.saurik.com Git - cycript.git/commitdiff
Support both armv7s and armv6 at the same time.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 10 Sep 2013 07:51:48 +0000 (00:51 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 10 Sep 2013 08:28:18 +0000 (01:28 -0700)
libffi.sh
xcode.mk
xcode.sh

index 96e93f498218eaabe7c4cdb3045dbc3596c1d2dd..145668c5161bd7870c485e3e246bf9c8a7afc7c8 100755 (executable)
--- a/libffi.sh
+++ b/libffi.sh
@@ -45,6 +45,7 @@ function arch() {
 
 arch armv6 arm-apple-darwin10 iphoneos5.1 iphoneos
 arch armv7 arm-apple-darwin10 iphoneos iphoneos
+arch armv7s arm-apple-darwin10 iphoneos iphoneos
 arch i386 i386-apple-darwin10 iphonesimulator ios-simulator
 
 libffi=()
index a112e9bbe81eb9f401e1a580fee28b445678e71b..63b3412d32a5cfa29ebf7fd535b90859097cc00f 100644 (file)
--- a/xcode.mk
+++ b/xcode.mk
@@ -20,6 +20,8 @@
 .DELETE_ON_ERROR:
 SHELL := /bin/bash
 
+lipo := $(shell xcrun --sdk iphoneos -f lipo)
+
 libs := 
 libs += .libs/cycript
 libs += .libs/libcycript.dylib
@@ -64,7 +66,7 @@ build.ios-$(1)/.libs/libcycript.a: build-ios-$(1)
        @
 endef
 
-$(foreach arch,armv6 armv7,$(eval $(call build_ios,$(arch))))
+$(foreach arch,armv6 armv7 armv7s,$(eval $(call build_ios,$(arch))))
 
 define build_sim
 .PHONY: build-sim-$(1)
@@ -80,11 +82,7 @@ $(foreach arch,i386,$(eval $(call build_sim,$(arch))))
 
 .libs/%: build.mac-i386/.libs/% build.mac-x86_64/.libs/% build.ios-armv6/.libs/%
        @mkdir -p .libs
-       lipo -create -output $@ $^
-
-.libs/%-ios.a: build.ios-armv6/.libs/%.a build.ios-armv7/.libs/%.a build.sim/.libs/%.a
-       @mkdir -p .libs
-       lipo -create -output $@ $^
+       $(lipo) -create -output $@ $^
 
 .libs/libcycript-sys.dylib:
        @mkdir -p .libs
@@ -96,10 +94,10 @@ $(foreach arch,i386,$(eval $(call build_sim,$(arch))))
 
 .libs/libcycript-%.o: build.%/.libs/libcycript.a
        @mkdir -p .libs
-       ld -r -arch $$(lipo -detailed_info $< | sed -e '/^Non-fat file: / ! d; s/.*: //') -o $@ -all_load $< libffi.a
+       ld -r -arch $$($(lipo) -detailed_info $< | sed -e '/^Non-fat file: / ! d; s/.*: //') -o $@ -all_load $< libffi.a
 
-.libs/libcycript.o: .libs/libcycript-ios-armv6.o .libs/libcycript-ios-armv7.o .libs/libcycript-sim-i386.o
-       lipo -create -output $@ $^
+.libs/libcycript.o: .libs/libcycript-ios-armv6.o .libs/libcycript-ios-armv7.o .libs/libcycript-ios-armv7s.o .libs/libcycript-sim-i386.o
+       $(lipo) -create -output $@ $^
 
 cycript: cycript.in
        cp -af $< $@
index 3144218f8c8a2a5932d65dc615bb7a944e05b78a..c04d8a7366a50d626240690411e7b682ab8a1ac9 100755 (executable)
--- a/xcode.sh
+++ b/xcode.sh
@@ -73,13 +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
 }
 
 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; do
-    build "ios-${arch}" iphoneos5.1 "-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"
+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