Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2149)

Unified Diff: build/android/envsetup.sh

Issue 11366243: android: Print error when trying to build on 32-bit host. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use uname -m instead of uname -p Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/envsetup_functions.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | build/android/envsetup_functions.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698