Index: build/android/envsetup.sh |
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh |
index 9d1b7e6fef8857b5d47afb3dd8288031ba1e1226..cdde0ced23fba0564ca3d4838cd3fb175aa0dc64 100755 |
--- a/build/android/envsetup.sh |
+++ b/build/android/envsetup.sh |
@@ -27,14 +27,39 @@ if [[ "${ANDROID_SDK_BUILD}" -eq 1 ]]; then |
echo "Using SDK build" |
fi |
+# Get host architecture, and abort if it is 32-bit, unless --try-32 |
+# is also used. |
+host_arch=$(uname -m) |
+case "${host_arch}" in |
+ x86_64) # pass |
+ ;; |
+ i?86) |
+ if [[ -z "${try_32bit_host_build}" ]]; then |
+ echo "ERROR: Android build requires a 64-bit host build machine." |
+ echo "If you really want to try it on this machine, use the \ |
+--try-32bit-host flag." |
+ echo "Be warned that this may fail horribly at link time, due \ |
+very large binaries." |
+ return 1 |
+ else |
+ echo "WARNING: 32-bit host build enabled. Here be dragons!" |
+ host_arch=x86 |
+ fi |
+ ;; |
+ *) |
+ echo "ERROR: Unsupported host architecture (${host_arch})." |
+ echo "Try running this script on a Linux/x86_64 machine instead." |
+ return 1 |
+esac |
+ |
host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') |
case "${host_os}" in |
"linux") |
- toolchain_dir="linux-x86_64" |
+ toolchain_dir="linux-${host_arch}" |
;; |
"mac") |
- toolchain_dir="darwin-x86" |
+ toolchain_dir="darwin-${host_arch}" |
;; |
*) |
echo "Host platform ${host_os} is not supported" >& 2 |