Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuaxo/380086139c13c062a698 to your computer and use it in GitHub Desktop.
Save stuaxo/380086139c13c062a698 to your computer and use it in GitHub Desktop.
Create android standalone toolchains
#!/bin/bash
# Either pass in the dest directory, or will install to current dir
# from
# https://gist.github.com/bongole/304a006a5386220246aa
for arch in armv7-a x86 x86_64; do
echo "Create standalone for $arch"
case $arch in
arm*)
ANDROID_ARCH=arm-linux-androideabi
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=arm-linux-androideabi-4.9 --install-dir=$DEST/toolchain/$arch
INSTALL_PATH=$PWD/build
HOST=arm-linux-androidabi
GCC_ARCH=$arch
EXTRA_CFLAGS="-mfloat-abi=softfp"
EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
;;
x86)
ANDROID_ARCH=i686-linux-android
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=x86-4.9 --install-dir=$DEST/toolchain/$arch
INSTALL_PATH=$PWD/build
HOST=i686-linux-android
GCC_ARCH=atom
EXTRA_CFLAGS=""
EXTRA_LDFLAGS=""
;;
x86_64)
ANDROID_ARCH=x86_64-linux-android
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=x86_64-4.9 --install-dir=$DEST/toolchain/$arch
INSTALL_PATH=$PWD/build
HOST=x86_64-linux-android
GCC_ARCH=atom
EXTRA_CFLAGS=""
EXTRA_LDFLAGS=""
;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment