2021-01-25 10:34:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
V=r21d
|
2021-12-16 17:24:35 +00:00
|
|
|
# V=r9 # kitkat
|
2021-01-25 10:34:08 +00:00
|
|
|
O=""
|
|
|
|
case `uname` in
|
|
|
|
Linux)
|
|
|
|
O=linux
|
|
|
|
;;
|
|
|
|
Darwin)
|
|
|
|
O=darwin
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported platform"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2021-12-16 17:24:35 +00:00
|
|
|
|
|
|
|
API=28
|
2021-12-16 22:26:19 +00:00
|
|
|
[ -n "$1" ] && API="$1"
|
2021-12-16 17:24:35 +00:00
|
|
|
|
2021-12-16 23:15:38 +00:00
|
|
|
ARCH=arm64
|
|
|
|
[ -n "$2" ] && ARCH="$2"
|
|
|
|
|
2021-01-25 10:34:08 +00:00
|
|
|
echo Downloading NDK $V...
|
|
|
|
wget -c -q https://dl.google.com/android/repository/android-ndk-$V-$O-x86_64.zip
|
|
|
|
echo Unzipping in /tmp/ndkzip
|
|
|
|
unzip -q *.zip -d /tmp/ndkzip
|
2021-01-25 11:30:57 +00:00
|
|
|
export NDK=$(ls -d /tmp/ndkzip/* | head -n1)
|
|
|
|
echo NDK=${NDK}
|
|
|
|
echo NDK=${NDK} > $HOME/.r2androidrc
|
2021-01-25 10:34:08 +00:00
|
|
|
python $NDK/build/tools/make_standalone_toolchain.py \
|
2021-12-16 23:15:38 +00:00
|
|
|
--arch ${ARCH} --api ${API} --install-dir toolchain
|