android envsetup: Remove --host-os flag.

Clients should set the host_os gyp variable instead. (As far as I can tell,
this flag was added for the webview build, and this CL updates gyp_webview
to use the gyp define instead. I haven't found other clients.)

Since several gyp targets check the value of host_os in a
target_conditions block and most of the build/common.gypi variables
aren't available during target_conditions processing time, use the same
trick that chromium_code uses to make host_os available at target_conditions
time.

BUG=330631
NOTRY=true

Review URL: https://codereview.chromium.org/153623011

git-svn-id: http://src.chromium.org/svn/trunk/src/build@251138 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
thakis@chromium.org 2014-02-13 21:48:25 +00:00
Родитель 0daf59a33e
Коммит 00d6c27f28
2 изменённых файлов: 11 добавлений и 20 удалений

Просмотреть файл

@ -26,7 +26,6 @@ ${ANDROID_SDK_BUILD_TOOLS_VERSION}
# The set of GYP_DEFINES to pass to gyp.
DEFINES="OS=android"
DEFINES+=" host_os=${host_os}"
if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then
# These defines are used by various chrome build scripts to tag the binary's
@ -69,7 +68,6 @@ ${ANDROID_SDK_BUILD_TOOLS_VERSION}
print_usage() {
echo "usage: ${0##*/} [--target-arch=value] [--help]" >& 2
echo "--target-arch=value target CPU architecture (arm=default, x86)" >& 2
echo "--host-os=value override host OS detection (linux, mac)" >&2
echo "--help this help" >& 2
}
@ -77,15 +75,11 @@ print_usage() {
# Process command line options.
################################################################################
process_options() {
host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
while [[ -n $1 ]]; do
case "$1" in
--target-arch=*)
target_arch="$(echo "$1" | sed 's/^[^=]*=//')"
;;
--host-os=*)
host_os="$(echo "$1" | sed 's/^[^=]*=//')"
;;
--help)
print_usage
return 1
@ -169,20 +163,11 @@ ${ANDROID_SDK_VERSION}
ANDROID_SDK=$(python -c \
"import os.path; print os.path.relpath('${ANDROID_SDK_ROOT}', \
'${ANDROID_BUILD_TOP}')")
case "${host_os}" in
"linux")
ANDROID_SDK_TOOLS=$(python -c \
"import os.path; \
print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/linux', \
'${ANDROID_BUILD_TOP}')")
;;
"mac")
ANDROID_SDK_TOOLS=$(python -c \
"import os.path; \
print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/darwin', \
'${ANDROID_BUILD_TOP}')")
;;
esac
ANDROID_SDK_TOOLS=$(python -c \
"import os.path, sys; \
print os.path.relpath( \
'${ANDROID_SDK_ROOT}/../tools/' + sys.platform.rstrip('23'), \
'${ANDROID_BUILD_TOP}')")
DEFINES+=" android_webview_build=1"
DEFINES+=" android_src=\$(PWD)"
DEFINES+=" android_sdk=\$(PWD)/${ANDROID_SDK}"

Просмотреть файл

@ -1397,6 +1397,7 @@
'android_sdk_version%': '<!(/bin/echo -n ${ANDROID_SDK_VERSION})',
# Android SDK build tools (e.g. dx, aapt, aidl)
'android_sdk_tools%': '<!(/bin/echo -n ${ANDROID_SDK_TOOLS})',
'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
},
# Copy conditionally-set variables out one scope.
'android_ndk_root%': '<(android_ndk_root)',
@ -1404,6 +1405,7 @@
'android_sdk_version%': '<(android_sdk_version)',
'android_sdk_tools%': '<(android_sdk_tools)',
'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport',
'host_os%': '<(host_os)',
'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
@ -1455,6 +1457,7 @@
'android_stlport_root': '<(android_stlport_root)',
'android_stlport_include': '<(android_stlport_root)/stlport',
'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)',
'host_os%': '<(host_os)',
# Location of the "strip" binary, used by both gyp and scripts.
'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
@ -2104,6 +2107,9 @@
'mac_release_optimization%': '3', # Use -O3 unless overridden
'mac_debug_optimization%': '0', # Use -O0 unless overridden
}],
['OS=="android"', {
'host_os%': '<(host_os)', # See comment above chromium_code.
}],
],
},
'defines': [