summaryrefslogtreecommitdiff
path: root/buildscripts/setup-android-toolchain.sh
blob: 4557aa693b2b6114712e42dd043df04ce7b376a4 (plain)
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
#!/bin/sh

set -o verbose
set -o errexit

_SystemImageArch=$1
shift
_ToolchainArch=$1
shift

if [ -z "$PYTHON" ] ; then
    PYTHON=`which python`
fi

SDK_ROOT=$PWD/android_sdk
mkdir $SDK_ROOT

TOOLCHAIN=$PWD/android_toolchain
mkdir $TOOLCHAIN

API_VERSION=24

(
    cd $SDK_ROOT
    SDK_PACKAGE=sdk-tools-linux-3859397.zip
    curl -O https://dl.google.com/android/repository/$SDK_PACKAGE
    unzip $SDK_PACKAGE
    echo y | ./tools/bin/sdkmanager "platforms;android-24" "emulator" "ndk-bundle" "platform-tools" "build-tools;23.0.3" "system-images;android-24;google_apis;$_SystemImageArch"
)

$PYTHON $SDK_ROOT/ndk-bundle/build/tools/make_standalone_toolchain.py --arch $_ToolchainArch --api $API_VERSION  --stl=libc++ --force  --install-dir $TOOLCHAIN

echo SDK_ROOT=${SDK_ROOT}
echo TOOLCHAIN=${TOOLCHAIN}
echo API_VERSION=${API_VERSION}