Skip to content

Instantly share code, notes, and snippets.

@jmingov
Forked from nethunteros/setupenv
Created August 18, 2017 21:18
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 jmingov/7ade172776afdf97ea7a363453219f9e to your computer and use it in GitHub Desktop.
Save jmingov/7ade172776afdf97ea7a363453219f9e to your computer and use it in GitHub Desktop.
Easily select toolchain between 64bit and 32 bit kernel builds for Android
#/bin/bash
#
# Download toolschains:
# git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7 toolchain
# git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b marshmallow-release toolchain64
#
# Instructions to set toolchain for build:
# source setupenv 64
case "$1" in
"32")
echo "Setting build architecture to 32 bit (arm)"
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=`pwd`/toolchain/bin/arm-eabi-
;;
"64")
echo "Setting build architecture to 64 bit (arm64)"
export ARCH=arm64
export SUBARCH=arm64
export CROSS_COMPILE=`pwd`/toolchain64/bin/aarch64-linux-android-
;;
*)
echo "Pass either 32 or 64 bit"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment