]>
Commit | Line | Data |
---|---|---|
9918a0fa JF |
1 | #!/bin/bash |
2 | ndk=~/bin/android-ndk | |
3 | abi=armeabi | |
4 | ver=4.9 | |
e2ce853b JF |
5 | api=9 |
6 | bld=darwin-x86_64 | |
7 | bin=${ndk}/toolchains/arm-linux-androideabi-${ver}/prebuilt/${bld}/bin | |
9918a0fa JF |
8 | #export PATH=${bin}:$PATH |
9 | flg=() | |
e2ce853b | 10 | flg+=(--sysroot=${ndk}/platforms/android-${api}/arch-arm) |
9918a0fa JF |
11 | flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/include) |
12 | flg+=(-I${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/libs/${abi}/include) | |
13 | ldf=() | |
14 | ldf+=(-L${ndk}/sources/cxx-stl/gnu-libstdc++/${ver}/libs/${abi}) | |
15 | ldf+=(-lgnustl_static) | |
16 | tgt=arm-linux-androideabi | |
17 | cc=${bin}/${tgt}-gcc | |
18 | cxx=${bin}/${tgt}-g++ | |
e2ce853b JF |
19 | cpp=() |
20 | cpp+=(-fPIE) | |
21 | ldf+=(-rdynamic -fPIE -pie) | |
9918a0fa JF |
22 | function cfg() { |
23 | cfg=$1 | |
24 | shift | |
e2ce853b | 25 | CC="${cc} ${flg[*]}" CXX="${cxx} ${flg[*]}" OBJCXX="${cxx} ${flg[*]}" "${cfg}" --host="${tgt}" CPPFLAGS="${cpp[*]}" LDFLAGS="${ldf[*]}" "$@" |
9918a0fa | 26 | } |