Skip to content

Commit

Permalink
android envsetup: Stop exporting ANDROID_TOOLCHAIN.
Browse files Browse the repository at this point in the history
build/common.gypi already sets <(android_toolchain) independently of this
env var, and nothing seems to really depend on the env var.
(tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py uses it
to print a better error message if it's available, but that doesn't seem
important.)

BUG=330631
R=torne@chromium.org

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

git-svn-id: http://src.chromium.org/svn/trunk/src/build@250141 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
  • Loading branch information
thakis@chromium.org committed Feb 10, 2014
1 parent d9bb842 commit 89105d9
Showing 1 changed file with 2 additions and 47 deletions.
49 changes: 2 additions & 47 deletions android/envsetup_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,11 @@
# android source tree. Each has a unique init function which calls functions
# prefixed with "common_" that is common for both environment setups.

################################################################################
# Check to make sure the toolchain exists for the NDK version.
################################################################################
common_check_toolchain() {
if [[ ! -d "${ANDROID_TOOLCHAIN}" ]]; then
echo "Can not find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2
echo "The NDK version might be wrong." >& 2
return 1
fi
}

################################################################################
# Exports environment variables common to both sdk and non-sdk build (e.g. PATH)
# based on CHROME_SRC and ANDROID_TOOLCHAIN, along with DEFINES for GYP_DEFINES.
# based on CHROME_SRC, along with DEFINES for GYP_DEFINES.
################################################################################
common_vars_defines() {
# Set toolchain path according to product architecture.
case "${TARGET_ARCH}" in
"arm")
toolchain_arch="arm-linux-androideabi"
;;
"x86")
toolchain_arch="x86"
;;
"mips")
toolchain_arch="mipsel-linux-android"
;;
*)
echo "TARGET_ARCH: ${TARGET_ARCH} is not supported." >& 2
print_usage
return 1
;;
esac

toolchain_version="4.6"
toolchain_target=$(basename \
${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}-${toolchain_version})
toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_target}"\
"/prebuilt/${toolchain_dir}/bin/"

# Set only if not already set.
# Don't override ANDROID_TOOLCHAIN if set by Android configuration env.
export ANDROID_TOOLCHAIN=${ANDROID_TOOLCHAIN:-${toolchain_path}}

common_check_toolchain

# Add Android SDK tools to system path.
export PATH=$PATH:${ANDROID_SDK_ROOT}/tools
export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
Expand Down Expand Up @@ -172,9 +131,6 @@ sdk_build_init() {
export ANDROID_SDK_BUILD_TOOLS_VERSION=19.0.0
fi

# Unset toolchain. This makes it easy to switch between architectures.
unset ANDROID_TOOLCHAIN

common_vars_defines

DEFINES+="${sdk_defines}"
Expand Down Expand Up @@ -203,8 +159,7 @@ webview_build_init() {
# Use the latest API in the AOSP prebuilts directory (change with AOSP roll).
export ANDROID_SDK_VERSION=18

# For the WebView build we always use the NDK and SDK in the Android tree,
# and we don't touch ANDROID_TOOLCHAIN which is already set by Android.
# For the WebView build we always use the NDK and SDK in the Android tree.
export ANDROID_NDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/ndk/8
export ANDROID_SDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/sdk/\
${ANDROID_SDK_VERSION}
Expand Down

0 comments on commit 89105d9

Please sign in to comment.