From 42ced6d5e2380a965fd2257770cfe11381f8f381 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Tue, 17 Jul 2012 21:40:01 -0700 Subject: [PATCH] x86: cleanups for toolchain The 4.4.3 TC was still being specified in one spot. Also, no need to cross-set x86/ARM variables when buliding for ARM/x86. Change-Id: Icbb0f772a983a24dc10ccab0800d4b7bbd60a099 Signed-off-by: Bruce Beare --- core/dumpvar.mk | 17 ++++++++++------- envsetup.sh | 19 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/core/dumpvar.mk b/core/dumpvar.mk index 4a44f77167..d481742dee 100644 --- a/core/dumpvar.mk +++ b/core/dumpvar.mk @@ -10,15 +10,18 @@ ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) endif # Add the ARM toolchain bin dir if it actually exists -ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6/bin),) - # this should be copied to HOST_OUT_EXECUTABLES instead - ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6/bin -endif +ifeq ($(TARGET_ARCH),arm) + ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6/bin),) + # this should be copied to HOST_OUT_EXECUTABLES instead + ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6/bin + endif +else ifeq ($(TARGET_ARCH),x86) # Add the x86 toolchain bin dir if it actually exists -ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-4.6/bin),) - # this should be copied to HOST_OUT_EXECUTABLES instead - ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-4.6/bin + ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-4.6/bin),) + # this should be copied to HOST_OUT_EXECUTABLES instead + ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-4.6/bin + endif endif ANDROID_BUILD_PATHS := $(ABP) ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) diff --git a/envsetup.sh b/envsetup.sh index 84ec3e538c..8f311b69f0 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -131,25 +131,24 @@ function setpaths() export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir fi - export ARM_EABI_TOOLCHAIN= + unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH case $ARCH in - x86) toolchaindir=x86/i686-eabi-4.4.3/bin - ;; - arm) toolchaindir=arm/arm-eabi-4.6/bin + arm) + toolchaindir=arm/arm-eabi-4.6/bin + if [ -d "$gccprebuiltdir/$toolchaindir" ]; then + export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir" + ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir" + fi ;; *) - echo "Can't find toolchain for unknown architecture: $ARCH" - toolchaindir=xxxxxxxxx + # No need to set ARM_EABI_TOOLCHAIN for other ARCHs ;; esac - if [ -d "$gccprebuiltdir/$toolchaindir" ]; then - export ARM_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir - fi export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN export ANDROID_QTOOLS=$T/development/emulator/qtools export ANDROID_DEV_SCRIPTS=$T/development/scripts - export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ARM_EABI_TOOLCHAIN$CODE_REVIEWS:$ANDROID_DEV_SCRIPTS + export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN$ARM_EABI_TOOLCHAIN_PATH$CODE_REVIEWS:$ANDROID_DEV_SCRIPTS export PATH=$PATH$ANDROID_BUILD_PATHS unset ANDROID_JAVA_TOOLCHAIN