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

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: 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') | build/android/envsetup_functions.sh » ('J')
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..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
« no previous file with comments | « no previous file | build/android/envsetup_functions.sh » ('j') | build/android/envsetup_functions.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698