Index: build/android/envsetup.sh |
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh |
index 9d1b7e6fef8857b5d47afb3dd8288031ba1e1226..af7a6366e668cf7c788e26619a453fbc69fd836a 100755 |
--- a/build/android/envsetup.sh |
+++ b/build/android/envsetup.sh |
@@ -27,14 +27,38 @@ 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 -p) |
+case "${host_arch}" in |
+ "x86_64") # pass |
Isaac (away)
2012/11/15 01:07:54
nit: quotes unneeded here
digit1
2012/11/15 09:30:24
Sure, will remove.
|
+ ;; |
+ i?86) |
Isaac (away)
2012/11/15 01:07:54
Assuming you made sure '?' works as intended
digit1
2012/11/15 09:30:24
I've been using this for the NDK for a long time n
|
+ if [[ -z "${try_32bit_build}" ]]; then |
+ echo "ERROR: Android build requires a 64-bit host." |
+ echo "If you really want to try it on this machine, use the --try-32" |
+ echo "flag. Be warned that this may fail horribly at link time, due" |
+ echo "to some of the final binaries being too large." |
+ 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 |