X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/e9abea04a58861934edfb19032be2c0dd92f84ec..13c7f2fb8fc0619c8da1b5c8a697f7894479b070:/libffi.sh diff --git a/libffi.sh b/libffi.sh index 145668c..fa01534 100755 --- a/libffi.sh +++ b/libffi.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Cycript - Optimizing JavaScript Compiler/Runtime # Copyright (C) 2009-2013 Jay Freeman (saurik) @@ -27,7 +27,8 @@ function arch() { local host=$2 local sdk=$3 local os=$4 - shift 4 + local min=$5 + shift 5 rm -rf "libffi.${arch}" if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then @@ -37,16 +38,30 @@ function arch() { archs+=("${arch}") mkdir "libffi.${arch}" + flags=() + flags+=(-isysroot "${isysroot}") + flags+=(-m${os}-version-min="${min}") + flags+=(-no-integrated-as) + flags+=(-fno-stack-protector) + flags+=(-O3 -g3) + + if [[ ${arch} == arm* && ${arch} != arm64 ]]; then + flags+=(-mthumb) + fi + cd "libffi.${arch}" - CC="clang -arch ${arch}" CFLAGS="-no-integrated-as -isysroot ${isysroot} -m${os}-version-min=2.0" ../libffi/configure --host="${host}" + CC="clang -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} $*" ../libffi/configure --host="${host}" make cd .. } -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 +arch armv6 arm-apple-darwin10 iphoneos iphoneos 2.0 -mllvm -arm-reserve-r9 +arch armv7 arm-apple-darwin10 iphoneos iphoneos 2.0 +arch armv7s arm-apple-darwin10 iphoneos iphoneos 2.0 +arch arm64 aarch64-apple-darwin11 iphoneos iphoneos 2.0 + +arch i386 i386-apple-darwin10 iphonesimulator ios-simulator 4.0 +arch x86_64 x86_64-apple-darwin11 iphonesimulator ios-simulator 4.0 libffi=() for arch in "${archs[@]}"; do