]> git.saurik.com Git - cycript.git/blobdiff - cycript.in
Also use CXType walker to for function prototypes.
[cycript.git] / cycript.in
index b20b733a7b467d40e178f5e5b618ea76e7cb00a6..077458e4baf19b62c3d8c61f9b26728def589bea 100644 (file)
@@ -1,7 +1,5 @@
-#!/usr/bin/env bash
-
-# Cycript - Optimizing JavaScript Compiler/Runtime
-# Copyright (C) 2009-2015  Jay Freeman (saurik)
+# Cycript - The Truly Universal Scripting Language
+# Copyright (C) 2009-2016  Jay Freeman (saurik)
 
 # GNU Affero General Public License, Version 3 {{{
 #
 
 # GNU Affero General Public License, Version 3 {{{
 #
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # }}}
 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # }}}
 
-dir=$(dirname "${BASH_SOURCE[0]}")
-DYLD_LIBRARY_PATH="${dir}"/Cycript.lib exec "${dir}"/Cycript.lib/cycript "$@"
+dir=${0%/*}/Cycript.lib
+if [[ ${dir} != /* ]]; then
+    dir=$(pwd)/${dir}
+fi
+
+if [[ -n $ANDROID_ROOT ]]; then
+    export LD_LIBRARY_PATH="${dir}"
+    export TERMINFO="${dir}"
+    export TERM=linux
+    suffix=-a32
+else
+    export DYLD_LIBRARY_PATH=${dir}
+    suffix=-apl
+fi
+
+exec "${dir}"/cycript"${suffix}" "$@"