]> git.saurik.com Git - cycript.git/commitdiff
Link readline to provide Kevin his 64-bit console.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 1 Aug 2016 04:17:58 +0000 (21:17 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 1 Aug 2016 04:17:58 +0000 (21:17 -0700)
apple-configure.sh
apple-lib.sh
apple-libffi.sh [deleted file]
apple-libuv.sh [deleted file]
build.mk
extra.arm64/ncurses_dll.h [new symlink]
extra.arm64/readline [new symlink]
extra.arm64/term.h [new symlink]

index 103b11ddb9d7f627e6a27391e60b79ea0f39c698..aa67a94b45833e4b26dfb102a6de48f1bff5050c 100755 (executable)
@@ -93,7 +93,11 @@ for arch in armv6 armv7 armv7s arm64; do
     ldf=""
 
     flg=()
-    if [[ ${arch} != armv6 ]]; then
+    if [[ ${arch} == arm64 ]]; then
+        cpf+=" -I../extra.${arch}"
+        cpf+=" -I../readline.${arch}"
+        ldf+=" -L../readline.${arch}"
+    elif [[ ${arch} != armv6 ]]; then
         flg+=(--disable-console)
     else
         flg+=(LTLIBGCC="-lgcc_s.1")
index 7816a8bfecc3f8afbaaa309c15d6d1fc7ac189ff..3114af160b304edb6f7397f36bc14d50c6b8c6a6 100755 (executable)
 
 set -e
 
-lib=$1
-shift
 extra=("$@")
 
 archs=()
 function arch() {
+    local lib=$1
+    shift
+
     local arch=$1
     local host=$2
     local sdk=$3
@@ -34,15 +35,15 @@ function arch() {
     local min=$5
     shift 5
 
-    rm -rf "lib${lib}.${arch}"
+    rm -rvf "${lib}.${arch}"
     if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then
         return
     fi
 
     archs+=("${arch}")
-    mkdir "lib${lib}.${arch}"
+    mkdir "${lib}.${arch}"
 
-    flags=("${extra[@]}")
+    flags=()
     flags+=(-isysroot "${isysroot}")
     flags+=(-m${os}-version-min="${min}")
     flags+=(-O3 -g3)
@@ -51,16 +52,38 @@ function arch() {
         flags+=(-mthumb)
     fi
 
-    cd "lib${lib}.${arch}"
-    CC="clang -arch ${arch}" CXX="clang++ -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} $*" ../lib"${lib}"/configure --host="${host}" --enable-static --disable-shared
+    cd "${lib}.${arch}"
+    CC="clang -arch ${arch}" CXX="clang++ -arch ${arch}" LDFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} $*" ../"${lib}"/configure --host="${host}" --enable-static --disable-shared \
+        ac_cv_func_strcoll_works=yes bash_cv_func_sigsetjmp=present bash_cv_func_ctype_nonascii=no bash_cv_must_reinstall_sighandlers=no bash_cv_func_strcoll_broken=yes bash_cv_wcwidth_broken=no
     make -j5
     cd ..
 }
 
-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
+function arch64() {
+    local lib=$1
+    shift
+
+    arch "${lib}" arm64 aarch64-apple-darwin11 iphoneos iphoneos 2.0 "$@"
+}
+
+function archs() {
+    local lib=$1
+    shift
+
+    arch "${lib}" armv6 arm-apple-darwin10 iphoneos iphoneos 2.0 "$@" -mllvm -arm-reserve-r9
+    arch "${lib}" armv7 arm-apple-darwin10 iphoneos iphoneos 2.0 "$@"
+    arch "${lib}" armv7s arm-apple-darwin10 iphoneos iphoneos 2.0 "$@"
+
+    arch64 "${lib}" "$@"
+
+    arch "${lib}" i386 i386-apple-darwin10 iphonesimulator ios-simulator 4.0 "$@"
+    arch "${lib}" x86_64 x86_64-apple-darwin11 iphonesimulator ios-simulator 4.0 "$@"
+}
+
+archs libffi -DPAGE_MAX_SIZE=16384 -DPAGE_MAX_SHIFT=14 -fno-stack-protector
+archs libuv
+arch64 readline -include sys/ioctl.h
 
-arch i386 i386-apple-darwin10 iphonesimulator ios-simulator 4.0
-arch x86_64 x86_64-apple-darwin11 iphonesimulator ios-simulator 4.0
+for arch in arm64; do
+    ln -sf . "readline.${arch}/readline"
+done
diff --git a/apple-libffi.sh b/apple-libffi.sh
deleted file mode 100755 (executable)
index 7982b0a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-
-# Cycript - The Truly Universal Scripting Language
-# Copyright (C) 2009-2016  Jay Freeman (saurik)
-
-# GNU Affero General Public License, Version 3 {{{
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-# }}}
-
-exec ./apple-lib.sh ffi -DPAGE_MAX_SIZE=16384 -DPAGE_MAX_SHIFT=14 -fno-stack-protector
diff --git a/apple-libuv.sh b/apple-libuv.sh
deleted file mode 100755 (executable)
index 1bdc787..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-
-# Cycript - The Truly Universal Scripting Language
-# Copyright (C) 2009-2016  Jay Freeman (saurik)
-
-# GNU Affero General Public License, Version 3 {{{
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-# }}}
-
-exec ./apple-lib.sh uv
index 4e43fb3b7d95cfcd65e844f2002fd69cc18ae498..6c1dc05fab31be0e4ed1f6e73f2cab1b799919d4 100644 (file)
--- a/build.mk
+++ b/build.mk
@@ -94,7 +94,7 @@ $(deb): Cycript.lib/cycript-apl Cycript.lib/libcycript.dylib Cycript.lib/libcycr
        sed -e 's/#/$(version)/' control.in >package/DEBIAN/control
        mkdir -p package/usr/{bin,lib}
        cp -a cycript0.9 package/usr/lib/cycript0.9
-       $(lipo) -extract armv6 -output package/usr/bin/cycript Cycript.lib/cycript-apl
+       $(lipo) -extract armv6 -extract arm64 -output package/usr/bin/cycript Cycript.lib/cycript-apl
        $(lipo) -extract armv6 -extract arm64 -output package/usr/lib/libcycript.dylib Cycript.lib/libcycript.dylib
        ln -s libcycript.dylib package/usr/lib/libcycript.0.dylib
        cp -a libcycript.cy package/usr/lib/libcycript.cy
@@ -172,7 +172,7 @@ build.ios-$(1)/.libs/cycript: build-ios-$(1)
        @
 endef
 
-$(foreach arch,armv6,$(eval $(call build_arm,$(arch))))
+$(foreach arch,armv6 arm64,$(eval $(call build_arm,$(arch))))
 
 define build_arm
 $(call build_lib,ios,$(1))
@@ -235,7 +235,7 @@ Cycript.lib/cycript-pie: build.and-armeabi/cycript-pie
        install_name_tool -change /System/Library/{,Private}Frameworks/JavaScriptCore.framework/JavaScriptCore $@
        codesign -s $(codesign) --entitlement cycript-$(word 2,$(subst ., ,$(subst -, ,$*))).xml $@
 
-Cycript.lib/cycript-apl: build.osx-i386/.libs/cycript_ build.osx-x86_64/.libs/cycript_ build.ios-armv6/.libs/cycript_
+Cycript.lib/cycript-apl: build.osx-i386/.libs/cycript_ build.osx-x86_64/.libs/cycript_ build.ios-armv6/.libs/cycript_ build.ios-arm64/.libs/cycript_
        @mkdir -p $(dir $@)
        $(lipo) -create -output $@ $^
 
diff --git a/extra.arm64/ncurses_dll.h b/extra.arm64/ncurses_dll.h
new file mode 120000 (symlink)
index 0000000..c81139f
--- /dev/null
@@ -0,0 +1 @@
+/usr/include/ncurses_dll.h
\ No newline at end of file
diff --git a/extra.arm64/readline b/extra.arm64/readline
new file mode 120000 (symlink)
index 0000000..be37715
--- /dev/null
@@ -0,0 +1 @@
+../readline
\ No newline at end of file
diff --git a/extra.arm64/term.h b/extra.arm64/term.h
new file mode 120000 (symlink)
index 0000000..3059255
--- /dev/null
@@ -0,0 +1 @@
+/usr/include/term.h
\ No newline at end of file