]> git.saurik.com Git - cycript.git/blob - android.sh
The inside of a template span protects us from in.
[cycript.git] / android.sh
1 #!/bin/bash
2 ndk=~/bin/android-ndk
3 abi=armeabi
4 ver=4.9
5 bin=${ndk}/toolchains/arm-linux-androideabi-${ver}/prebuilt/darwin-x86_64/bin
6 #export PATH=${bin}:$PATH
7 flg=()
8 flg+=(--sysroot=${ndk}/platforms/android-9/arch-arm)
9 flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/include)
10 flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/libs/${abi}/include)
11 ldf=()
12 ldf+=(-L${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/libs/${abi})
13 ldf+=(-lgnustl_static)
14 tgt=arm-linux-androideabi
15 cc=${bin}/${tgt}-gcc
16 cxx=${bin}/${tgt}-g++
17 function cfg() {
18 cfg=$1
19 shift
20 CC="${cc} ${flg[*]}" CXX="${cxx} ${flg[*]}" OBJCXX="${cxx} ${flg[*]}" "${cfg}" --host="${tgt}" LDFLAGS="${ldf[*]}" "$@"
21 }