summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-20 18:44:06 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-20 18:44:06 +0000
commitcf32380ef85f6b6cab55d674d0084962605d315f (patch)
tree47c7e715e41b454e6dd1a9b966d994eb87f38e99 /build
parent8a8255438d86a8009dc718fc16ad1ca2a65eebaf (diff)
downloadchromium_src-cf32380ef85f6b6cab55d674d0084962605d315f.zip
chromium_src-cf32380ef85f6b6cab55d674d0084962605d315f.tar.gz
chromium_src-cf32380ef85f6b6cab55d674d0084962605d315f.tar.bz2
android envsetup: Remove envsetup_functions.sh.
* inline common_vars_defines into its only caller * then inline sdk_build_init into its only caller * stop exporting ANDROID_SDK_BUILD since nothing reads it any more * stop processing options; --target-arch has been a hard error for a while and nothing blew up * remove a check for CHROME_ANDROID_BUILD_WEBVIEW as that's now never set when this script is sourced BUG=330631 Review URL: https://codereview.chromium.org/171713010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/envsetup.sh45
-rwxr-xr-xbuild/android/envsetup_functions.sh90
2 files changed, 37 insertions, 98 deletions
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh
index 9d4d3f5..1581c8c 100755
--- a/build/android/envsetup.sh
+++ b/build/android/envsetup.sh
@@ -14,13 +14,6 @@ fi
# Source functions script. The file is in the same directory as this script.
SCRIPT_DIR="$(dirname "${BASH_SOURCE:-$0}")"
-. "${SCRIPT_DIR}"/envsetup_functions.sh
-
-export ANDROID_SDK_BUILD=1 # Default to SDK build.
-
-if ! process_options "$@" ; then
- return 1
-fi
# Get host architecture, and abort if it is 32-bit.
host_arch=$(uname -m)
@@ -53,7 +46,43 @@ the one you want."
echo "${CHROME_SRC}"
fi
-sdk_build_init
+# Allow the caller to override a few environment variables. If any of them is
+# unset, we default to a sane value that's known to work. This allows for
+# experimentation with a custom SDK.
+if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then
+ export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/"
+fi
+if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then
+ export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/"
+fi
+
+# Add Android SDK tools to system path.
+export PATH=$PATH:${ANDROID_SDK_ROOT}/tools
+export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
+
+# Add Chromium Android development scripts to system path.
+# Must be after CHROME_SRC is set.
+export PATH=$PATH:${CHROME_SRC}/build/android
+
+# The set of GYP_DEFINES to pass to gyp.
+DEFINES="OS=android"
+
+if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then
+ # These defines are used by various chrome build scripts to tag the binary's
+ # version string as 'official' in linux builds (e.g. in
+ # chrome/trunk/src/chrome/tools/build/version.py).
+ export OFFICIAL_BUILD=1
+ export CHROMIUM_BUILD="_google_chrome"
+ export CHROME_BUILD_TYPE="_official"
+fi
+
+# TODO(thakis), Jan 18 2014: Remove this after two weeks or so, after telling
+# everyone to set use_goma in GYP_DEFINES instead of a GOMA_DIR env var.
+if [[ -d $GOMA_DIR ]]; then
+ DEFINES+=" use_goma=1 gomadir=$GOMA_DIR"
+fi
+
+export GYP_DEFINES="${DEFINES}"
# Source a bunch of helper functions
. ${CHROME_SRC}/build/android/adb_device_functions.sh
diff --git a/build/android/envsetup_functions.sh b/build/android/envsetup_functions.sh
deleted file mode 100755
index dbfdb91..0000000
--- a/build/android/envsetup_functions.sh
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Defines functions for envsetup.sh which sets up environment for building
-# Chromium for Android using the Android NDK/SDK.
-
-################################################################################
-# Exports environment variables common to both sdk and non-sdk build (e.g. PATH)
-# based on CHROME_SRC, along with DEFINES for GYP_DEFINES.
-################################################################################
-common_vars_defines() {
- # Add Android SDK tools to system path.
- export PATH=$PATH:${ANDROID_SDK_ROOT}/tools
- export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
-
- # Add Chromium Android development scripts to system path.
- # Must be after CHROME_SRC is set.
- export PATH=$PATH:${CHROME_SRC}/build/android
-
- # The set of GYP_DEFINES to pass to gyp.
- DEFINES="OS=android"
-
- if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then
- # These defines are used by various chrome build scripts to tag the binary's
- # version string as 'official' in linux builds (e.g. in
- # chrome/trunk/src/chrome/tools/build/version.py).
- export OFFICIAL_BUILD=1
- export CHROMIUM_BUILD="_google_chrome"
- export CHROME_BUILD_TYPE="_official"
- fi
-
- # TODO(thakis), Jan 18 2014: Remove this after two weeks or so, after telling
- # everyone to set use_goma in GYP_DEFINES instead of a GOMA_DIR env var.
- if [[ -d $GOMA_DIR ]]; then
- DEFINES+=" use_goma=1 gomadir=$GOMA_DIR"
- fi
-}
-
-
-################################################################################
-# Process command line options.
-################################################################################
-process_options() {
- while [[ -n $1 ]]; do
- case "$1" in
- --target-arch=*)
- echo "ERROR: --target-arch is ignored."
- echo "Pass -Dtarget_arch=foo to gyp instead."
- echo "(x86 is spelled ia32 in gyp, mips becomes mipsel, arm stays arm)"
- return 1
- ;;
- *)
- # Ignore other command line options
- echo "Unknown option: $1"
- ;;
- esac
- shift
- done
-}
-
-################################################################################
-# Initializes environment variables for NDK/SDK build.
-################################################################################
-sdk_build_init() {
- # Allow the caller to override a few environment variables. If any of them is
- # unset, we default to a sane value that's known to work. This allows for
- # experimentation with a custom SDK.
- if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then
- export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/"
- fi
- if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then
- export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/"
- fi
-
- common_vars_defines
-
- export GYP_DEFINES="${DEFINES}"
-
- if [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then
- # Can not build WebView with NDK/SDK because it needs the Android build
- # system and build inside an Android source tree.
- echo "Can not build WebView with NDK/SDK. Requires android source tree." \
- >& 2
- echo "Try . build/android/envsetup.sh instead." >& 2
- return 1
- fi
-}