]> git.saurik.com Git - cycript.git/blame - android.sh
Allow users to tab complete struct and enum names.
[cycript.git] / android.sh
CommitLineData
9918a0fa
JF
1#!/bin/bash
2ndk=~/bin/android-ndk
3abi=armeabi
4ver=4.9
e2ce853b
JF
5api=9
6bld=darwin-x86_64
7bin=${ndk}/toolchains/arm-linux-androideabi-${ver}/prebuilt/${bld}/bin
9918a0fa
JF
8#export PATH=${bin}:$PATH
9flg=()
e2ce853b 10flg+=(--sysroot=${ndk}/platforms/android-${api}/arch-arm)
9918a0fa
JF
11flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/include)
12flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/libs/${abi}/include)
13ldf=()
14ldf+=(-L${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/libs/${abi})
15ldf+=(-lgnustl_static)
16tgt=arm-linux-androideabi
17cc=${bin}/${tgt}-gcc
18cxx=${bin}/${tgt}-g++
e2ce853b
JF
19cpp=()
20cpp+=(-fPIE)
21ldf+=(-rdynamic -fPIE -pie)
b76dcdd7
JF
22ccf=()
23ccf+=(-g0 -O3)
9918a0fa
JF
24function cfg() {
25 cfg=$1
26 shift
b76dcdd7
JF
27 "${cfg}" \
28 CC="${cc} ${flg[*]}" CXX="${cxx} ${flg[*]}" OBJCXX="${cxx} ${flg[*]}" \
29 CFLAGS="${ccf[*]}" CXXFLAGS="${ccf[*]}" OBJCXXFLAGS="${ccf[*]}" \
30 --host="${tgt}" CPPFLAGS="${cpp[*]}" LDFLAGS="${ldf[*]}" "$@"
9918a0fa 31}