From 16bd0f1e656d440790d77ce6be61f81b0c542728 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Thu, 20 Feb 2014 17:34:47 +0000 Subject: android webview build: Stop using envsetup. By now, envsetup only sets OS=android and converts GOMA_DIR to the corresponding gyp defines. It also sets GYP_CROSSCOMPILE. Nothing but the OS=android bit is used by the webview build, so let android_webview/tools/gyp_webview set what it needs directly instead of going through envsetup. (envsetup also does a few envvar chanes to PATH etc, but gyp_webview calls envsetup in a subshell, so it doesn't see these changes anyways.) As a side effect, android_webview/tools/gyp_webview no longer ignores GYP_DEFINES from the environment. BUG=330631 R=torne@chromium.org Review URL: https://codereview.chromium.org/170533004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252293 0039d316-1c4b-4281-b951-d872f2087c98 --- android_webview/tools/gyp_webview | 62 +++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 15 deletions(-) (limited to 'android_webview') diff --git a/android_webview/tools/gyp_webview b/android_webview/tools/gyp_webview index e28a6e3..778fbe4 100755 --- a/android_webview/tools/gyp_webview +++ b/android_webview/tools/gyp_webview @@ -13,34 +13,66 @@ set -e PLATFORM=${1:-linux-arm} echo "Generating makefiles for $PLATFORM" -export CHROME_ANDROID_BUILD_WEBVIEW=1 -export CHROME_SRC="$(readlink -f "$(dirname "$0")/../..")" export PYTHONDONTWRITEBYTECODE=1 +CHROME_SRC="$(readlink -f "$(dirname "$0")/../..")" +GYP="${CHROME_SRC}/build/gyp_chromium" + +# Use the latest API in the AOSP prebuilts directory (change with AOSP roll). +android_sdk_version=18 + +# For the WebView build we always use the SDK in the Android tree. +export ANDROID_SDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/sdk/\ +${android_sdk_version} + +DEFINES="OS=android" +DEFINES+=" android_webview_build=1" + +# We need to supply SDK paths relative to the top of the Android tree to make +# sure the generated Android makefiles are portable, as they will be checked +# into the Android tree. +android_sdk=$(python -c \ + "import os.path; print os.path.relpath('${ANDROID_SDK_ROOT}', \ + '${ANDROID_BUILD_TOP}')") +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_src=\$(PWD)" +DEFINES+=" android_ndk_root=ndk_root_unused_in_webview_build" +DEFINES+=" android_sdk=\$(PWD)/${android_sdk}" +DEFINES+=" android_sdk_root=\$(PWD)/${android_sdk}" +DEFINES+=" android_sdk_tools=\$(PWD)/${android_sdk_tools}" +DEFINES+=" android_sdk_version=sdk_version_unused_in_webview_build" +DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" + +# TODO: Get rid of this block, crbug.com/334021 +if [[ -n "$CHROME_ANDROID_WEBVIEW_OFFICIAL_BUILD" ]]; then + DEFINES+=" logging_like_official_build=1" + DEFINES+=" tracing_like_official_build=1" +fi + +export GYP_DEFINES="${GYP_DEFINES} ${DEFINES}" + FLAGS="-f android -Gdefault_target=All -Glimit_to_target_all=1 "\ -"${CHROME_SRC}/android_webview/all_webview.gyp" +"--depth=${CHROME_SRC} ${CHROME_SRC}/android_webview/all_webview.gyp" if [ "$PLATFORM" == "linux-arm" -o "$PLATFORM" == "all" ]; then - ( . $CHROME_SRC/build/android/envsetup.sh \ - && android_gyp --suffix .linux-arm ${FLAGS} -Dtarget_arch=arm -Dhost_os=linux ) + ${GYP} --suffix .linux-arm ${FLAGS} -Dtarget_arch=arm -Dhost_os=linux fi if [ "$PLATFORM" == "linux-x86" -o "$PLATFORM" == "all" ]; then - ( . $CHROME_SRC/build/android/envsetup.sh \ - && android_gyp --suffix .linux-x86 ${FLAGS} -Dtarget_arch=ia32 -Dhost_os=linux ) + ${GYP} --suffix .linux-x86 ${FLAGS} -Dtarget_arch=ia32 -Dhost_os=linux fi if [ "$PLATFORM" == "linux-mips" -o "$PLATFORM" == "all" ]; then - ( . $CHROME_SRC/build/android/envsetup.sh \ - && android_gyp --suffix .linux-mips ${FLAGS} -Dtarget_arch=mipsel -Dhost_os=linux ) + ${GYP} --suffix .linux-mips ${FLAGS} -Dtarget_arch=mipsel -Dhost_os=linux fi if [ "$PLATFORM" == "darwin-arm" -o "$PLATFORM" == "all" ]; then - ( . $CHROME_SRC/build/android/envsetup.sh --target-arch=arm \ - && android_gyp --suffix .darwin-arm ${FLAGS} -Dtarget_arch=arm -Dhost_os=mac ) + ${GYP} --suffix .darwin-arm ${FLAGS} -Dtarget_arch=arm -Dhost_os=mac fi if [ "$PLATFORM" == "darwin-x86" -o "$PLATFORM" == "all" ]; then - ( . $CHROME_SRC/build/android/envsetup.sh \ - && android_gyp --suffix .darwin-x86 ${FLAGS} -Dtarget_arch=ia32 -Dhost_os=mac ) + ${GYP} --suffix .darwin-x86 ${FLAGS} -Dtarget_arch=ia32 -Dhost_os=mac fi if [ "$PLATFORM" == "darwin-mips" -o "$PLATFORM" == "all" ]; then - ( . $CHROME_SRC/build/android/envsetup.sh \ - && android_gyp --suffix .darwin-mips ${FLAGS} -Dtarget_arch=mipsel -Dhost_os=mac ) + ${GYP} --suffix .darwin-mips ${FLAGS} -Dtarget_arch=mipsel -Dhost_os=mac fi -- cgit v1.1