]> git.saurik.com Git - cycript.git/blobdiff - cycript.in
Also use CXType walker to for function prototypes.
[cycript.git] / cycript.in
index f3b3a82b678f6ebd4a97953c939453be234c88a1..077458e4baf19b62c3d8c61f9b26728def589bea 100644 (file)
@@ -1,7 +1,5 @@
-#!/usr/bin/env bash
-
-# Cycript - Optimizing JavaScript Compiler/Runtime
-# Copyright (C) 2009-2014  Jay Freeman (saurik)
+# Cycript - The Truly Universal Scripting Language
+# Copyright (C) 2009-2016  Jay Freeman (saurik)
 
 # GNU Affero General Public License, Version 3 {{{
 #
 # 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}" "$@"