-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathconfig
48 lines (37 loc) · 1.2 KB
/
config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROOT_V='0.15_release'
TALLOC_V='2.1.14'
# `pre5' is for Android API < 21 where we can't _FILE_OFFSET_BITS=64 at least
ARCHS='aarch64 armv7a armv7a-pre5 x86_64 i686 i686-pre5'
BASE_DIR="$PWD"
BUILD_DIR="$BASE_DIR/build"
mkdir -p "$BUILD_DIR"
PKG_DIR="$BASE_DIR/packages"
mkdir -p "$PKG_DIR"
NDK="$HOME/Android/Sdk/ndk/23.2.8568313"
TOOLCHAIN="$NDK/toolchains/llvm/prebuilt/linux-$(uname -m)"
set-arch() {
MARCH="${1%%-*}"
if [ "$MARCH" != "$1" ]
then SUBARCH="${1#*-}"
else SUBARCH=''
fi
if [ "$SUBARCH" == 'pre5' ]
then API=16
else API=21
fi
INSTALL_ROOT="$BUILD_DIR/root-$ARCH/root"
STATIC_ROOT="$BUILD_DIR/static-$ARCH/root"
case "$MARCH" in
arm*) MARCH_T='arm' ;;
*) MARCH_T="$MARCH" ;;
esac
export AR="$(echo $TOOLCHAIN/bin/llvm-ar)"
export AS="$(echo $TOOLCHAIN/bin/$MARCH_T-linux-android*$API-clang)"
export CC="$(echo $TOOLCHAIN/bin/$MARCH-linux-android*$API-clang)"
export CXX="$(echo $TOOLCHAIN/bin/$MARCH-linux-android*$API-clang++)"
export LD="$(echo $TOOLCHAIN/bin/llvm-ld)"
export RANLIB="$(echo $TOOLCHAIN/bin/llvm-ranlib)"
export STRIP="$(echo $TOOLCHAIN/bin/llvm-strip)"
export OBJCOPY="$(echo $TOOLCHAIN/bin/llvm-objcopy)"
export OBJDUMP="$(echo $TOOLCHAIN/bin/llvm-objdump)"
}