]> git.saurik.com Git - cycript.git/blobdiff - android.sh
Also use CXType walker to for function prototypes.
[cycript.git] / android.sh
index 8cac85329a2608e26366aeab4ef4f236c49c93eb..da2bd6ae6aa6da82470ac8c667c29dcd39d5089c 100755 (executable)
@@ -2,10 +2,12 @@
 ndk=~/bin/android-ndk
 abi=armeabi
 ver=4.9
-bin=${ndk}/toolchains/arm-linux-androideabi-${ver}/prebuilt/darwin-x86_64/bin
+api=9
+bld=darwin-x86_64
+bin=${ndk}/toolchains/arm-linux-androideabi-${ver}/prebuilt/${bld}/bin
 #export PATH=${bin}:$PATH
 flg=()
-flg+=(--sysroot=${ndk}/platforms/android-9/arch-arm)
+flg+=(--sysroot=${ndk}/platforms/android-${api}/arch-arm)
 flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/include)
 flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/libs/${abi}/include)
 ldf=()
@@ -14,8 +16,14 @@ ldf+=(-lgnustl_static)
 tgt=arm-linux-androideabi
 cc=${bin}/${tgt}-gcc
 cxx=${bin}/${tgt}-g++
+cpp=()
+ccf=()
+ccf+=(-g0 -O3)
 function cfg() {
     cfg=$1
     shift
-    CC="${cc} ${flg[*]}" CXX="${cxx} ${flg[*]}" OBJCXX="${cxx} ${flg[*]}" "${cfg}" --host="${tgt}" LDFLAGS="${ldf[*]}" "$@"
+    "${cfg}" \
+        CC="${cc} ${flg[*]}" CXX="${cxx} ${flg[*]}" OBJCXX="${cxx} ${flg[*]}" \
+        CFLAGS="${ccf[*]}" CXXFLAGS="${ccf[*]}" OBJCXXFLAGS="${ccf[*]}" \
+        --host="${tgt}" CPPFLAGS="${cpp[*]}" LDFLAGS="${ldf[*]}" "$@"
 }