X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/9918a0fa2cc10734d8a0a6f49748f5d511823034..1e8d80477a3e058a30c477955f1e0c56deb6e956:/android.sh diff --git a/android.sh b/android.sh index 8cac853..da2bd6a 100755 --- a/android.sh +++ b/android.sh @@ -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[*]}" "$@" }