]> git.saurik.com Git - cycript.git/commitdiff
Finish new libffi and readline compilation scripts.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 7 Sep 2013 10:45:00 +0000 (03:45 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 7 Sep 2013 10:45:00 +0000 (03:45 -0700)
.gitignore
.gitmodules
libffi.sh
readline [new submodule]
readline.sh

index 85e4c3c81d1b33a42cd8d3fa4e905c8f062b2b9d..4592ae92a72b5e7eb6e7b07eec039ce1874c7463 100644 (file)
@@ -32,4 +32,4 @@ aclocal.m4
 stamp-h1
 readline-6.2
 readline-6.2.tar.gz
-libffi.arm*
+libffi.*
index 206b1cbaf98780bc6ebf7f789cb3ee7833a37e18..09636a081a18bfe4e59d7ab90925d1aa00e3d942 100644 (file)
@@ -1,3 +1,6 @@
 [submodule "libffi"]
        path = libffi
        url = git://github.com/atgreen/libffi.git
+[submodule "readline"]
+       path = readline
+       url = git://git.savannah.gnu.org/readline.git
index b67bc7198e2d360c8a8a394e95d2a877dcc9bf9a..96e93f498218eaabe7c4cdb3045dbc3596c1d2dd 100755 (executable)
--- a/libffi.sh
+++ b/libffi.sh
@@ -1,12 +1,55 @@
 #!/bin/bash
 
+# Cycript - Optimizing JavaScript Compiler/Runtime
+# Copyright (C) 2009-2013  Jay Freeman (saurik)
+
+# GNU General Public License, Version 3 {{{
+#
+# Cycript is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation, either version 3 of the License,
+# or (at your option) any later version.
+#
+# Cycript is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Cycript.  If not, see <http://www.gnu.org/licenses/>.
+# }}}
+
 set -e
 
-for arch in armv6 armv7; do
+archs=()
+function arch() {
+    local arch=$1
+    local host=$2
+    local sdk=$3
+    local os=$4
+    shift 4
+
     rm -rf "libffi.${arch}"
+    if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then
+        return
+    fi
+
+    archs+=("${arch}")
     mkdir "libffi.${arch}"
+
     cd "libffi.${arch}"
-    CC="clang -arch ${arch}" CFLAGS="-no-integrated-as -isysroot $(xcodebuild -sdk iphoneos5.1 -version Path) -miphoneos-version-min=2.0" ../libffi/configure --host=arm-apple-darwin10
+    CC="clang -arch ${arch}" CFLAGS="-no-integrated-as -isysroot ${isysroot} -m${os}-version-min=2.0" ../libffi/configure --host="${host}"
     make
     cd ..
+}
+
+arch armv6 arm-apple-darwin10 iphoneos5.1 iphoneos
+arch armv7 arm-apple-darwin10 iphoneos iphoneos
+arch i386 i386-apple-darwin10 iphonesimulator ios-simulator
+
+libffi=()
+for arch in "${archs[@]}"; do
+    libffi+=(libffi."${arch}"/.libs/libffi.a)
 done
+
+lipo -create -output libffi.a "${libffi[@]}"
diff --git a/readline b/readline
new file mode 160000 (submodule)
index 0000000..9922d2d
--- /dev/null
+++ b/readline
@@ -0,0 +1 @@
+Subproject commit 9922d2d7608ea86ff9e42aca0d3342a92748873f
index d71ead32a044e9d5d59dd32d98640de5943d6be3..74480039263c5f5f89442cab7c9f8e0cd301c42e 100755 (executable)
 
 set -e
 
-version=$1
-# XXX: verify version
-
-readline=readline-${version}
 arch="-arch i386 -arch x86_64"
 
-rm -f "${readline}".tar.gz
-rm -rf "${readline}"
-
-curl -O ftp://ftp.cwru.edu/pub/bash/"${readline}".tar.gz
-tar -zxf "${readline}".tar.gz
-
-cd "${readline}"
-
+cd readline
 CFLAGS="-g -O2 ${arch}" ./configure --disable-shared --enable-static
 make
 ln -s . readline