blob: ecb3bee0a5695e7e19dafe08e72a59febfe0989d [file] [log] [blame]
#!/bin/bash
set -e -o pipefail
# This script builds the go cross compilers for Android targets.
#
# Usage: build_go
#
# It assumes that the "arm-linux-androideabi" toolchain is already installed.
# It assumes that the "aarch64-linux-android" toolchain is already installed.
if [[ ! -e "make.bash" && -e "src/make.bash" ]]
then
cd src
fi
# Build the Go toolchain for arm devices.
GOOS="android" GOARCH="arm" CGO_ENABLED="1" \
CC_FOR_TARGET="arm-linux-androideabi-clang" \
CXX_FOR_TARGET="arm-linux-androideabi-clang++" \
./make.bash --no-clean
# Build the Go toolchain for arm64 devices.
GOOS="android" GOARCH="arm64" CGO_ENABLED="1" \
CC_FOR_TARGET="aarch64-linux-android-clang" \
CXX_FOR_TARGET="aarch64-linux-android-clang++" \
./make.bash --no-clean