summaryrefslogtreecommitdiff
path: root/dist-build/android-build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dist-build/android-build.sh')
-rwxr-xr-xdist-build/android-build.sh59
1 files changed, 0 insertions, 59 deletions
diff --git a/dist-build/android-build.sh b/dist-build/android-build.sh
deleted file mode 100755
index fb0dabe7..00000000
--- a/dist-build/android-build.sh
+++ /dev/null
@@ -1,59 +0,0 @@
1#!/bin/sh
2
3if [ -z "$ANDROID_NDK_HOME" ]; then
4 echo "You should probably set ANDROID_NDK_HOME to the directory containing"
5 echo "the Android NDK"
6 exit
7fi
8
9if [ -z "$SODIUM_HOME" ]; then
10 echo "You should probably set SODIUM_HOME to the directory containing root sodium sources"
11 exit
12fi
13
14if [[ -z $TARGET_ARCH ]] || [[ -z $HOST_COMPILER ]]; then
15 echo "You shouldn't use android-build.sh directly, use android-[arch].sh instead"
16 exit 1
17fi
18
19if [ ! -f ./configure ]; then
20 echo "Can't find ./configure. Wrong directory or haven't run autogen.sh?"
21 exit 1
22fi
23
24if [ -z "$TOOLCHAIN_DIR" ]; then
25 export TOOLCHAIN_DIR="$(pwd)/android-toolchain-${TARGET_ARCH}"
26 export MAKE_TOOLCHAIN="${ANDROID_NDK_HOME}/build/tools/make-standalone-toolchain.sh"
27
28 if [ -z "$MAKE_TOOLCHAIN" ]; then
29 echo "Cannot find a make-standalone-toolchain.sh in ndk dir, interrupt..."
30 exit 1
31 fi
32
33 $MAKE_TOOLCHAIN --platform="${NDK_PLATFORM:-android-14}" \
34 --arch="${TARGET_ARCH}" \
35 --toolchain="${TOOLCHAIN_NAME:-arm-linux-androideabi-4.8}" \
36 --install-dir="${TOOLCHAIN_DIR}"
37fi
38
39export PREFIX="$(pwd)/toxcore-android-${TARGET_ARCH}"
40export SYSROOT="${TOOLCHAIN_DIR}/sysroot"
41export PATH="${PATH}:${TOOLCHAIN_DIR}/bin"
42
43# Clean up before build
44rm -rf "${PREFIX}"
45
46export CFLAGS="${CFLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/usr/include"
47export CPPFLAGS="${CFLAGS}"
48export LDFLAGS="${LDFLAGS} -L${SYSROOT}/usr/lib"
49
50./configure --host="${HOST_COMPILER}" \
51 --with-sysroot="${SYSROOT}" \
52 --with-libsodium-headers="${SODIUM_HOME}/libsodium-android-${TARGET_ARCH}/include" \
53 --with-libsodium-libs="${SODIUM_HOME}/libsodium-android-${TARGET_ARCH}/lib" \
54 --disable-av \
55 --prefix="${PREFIX}" && \
56
57make clean && \
58make -j3 install && \
59echo "libtoxcore has been installed into ${PREFIX}"