Lunch: don't use a toolchain that doesn't exist.
"lunch sdk-eng" on cygwin tries to use a gcc.exe from the
prebuild arm toolchain, but it doesn't exist. This prevents
from setting variables to point on a gcc toolchain if there
is none for the given arch.
Change-Id: I3b72220663687f9fdaacc050899aef00632f2c3c
diff --git a/envsetup.sh b/envsetup.sh
index fe262f6..8f9479a 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -95,18 +95,27 @@
# #
##################################################################
+ # Note: on windows/cygwin, ANDROID_BUILD_PATHS will contain spaces
+ # due to "C:\Program Files" being in the path.
+
# out with the old
- if [ -n $ANDROID_BUILD_PATHS ] ; then
+ if [ -n "$ANDROID_BUILD_PATHS" ] ; then
export PATH=${PATH/$ANDROID_BUILD_PATHS/}
fi
- if [ -n $ANDROID_PRE_BUILD_PATHS ] ; then
+ if [ -n "$ANDROID_PRE_BUILD_PATHS" ] ; then
export PATH=${PATH/$ANDROID_PRE_BUILD_PATHS/}
fi
# and in with the new
CODE_REVIEWS=
prebuiltdir=$(getprebuilt)
- export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.3/bin
+ toolchaindir=toolchain/arm-eabi-4.4.3/bin
+ # The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
+ if [ -d "$prebuiltdir/$toolchaindir" ]; then
+ export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/$toolchaindir
+ else
+ export ANDROID_EABI_TOOLCHAIN=
+ fi
export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
export ANDROID_QTOOLS=$T/development/emulator/qtools
export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS