Index: build/android/envsetup_functions.sh |
diff --git a/build/android/envsetup_functions.sh b/build/android/envsetup_functions.sh |
index abc2edc86b8a80b501b20c7f4e4e583f7af59cb0..008160eace64d884372425ada7bc879696596451 100755 |
--- a/build/android/envsetup_functions.sh |
+++ b/build/android/envsetup_functions.sh |
@@ -172,9 +172,12 @@ sdk_build_init() { |
export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" |
fi |
- # If ANDROID_SDK_ROOT is set when envsetup is run, use the sdk pointed to by |
- # the environment variable. Otherwise, use the default sdk from the tree. |
- if [ ! -d "${ANDROID_SDK_ROOT}" ]; then |
+ # If ANDROID_SDK_ROOT is set when envsetup is run, and if it has the |
+ # right SDK-compatible directory layout, use the sdk pointed to by the |
+ # environment variable. Otherwise, use the default sdk from the tree. |
+ local sdk_suffix=platforms/android-${ANDROID_SDK_VERSION} |
+ if [ ! -d "${ANDROID_SDK_ROOT}" -o \ |
+ ! -d "${ANDROID_SDK_ROOT}/${sdk_suffix}" ]; then |
Isaac (away)
2012/09/05 16:47:36
can we simplify this to just check the latter dire
digit1
2012/09/05 17:04:39
Done, also changed the test to verify that the var
|
export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" |
fi |
@@ -206,8 +209,7 @@ sdk_build_init() { |
DEFINES+=" android_product_out=${CHROME_SRC}/out/android" |
DEFINES+=" android_lib='NOT_SDK_COMPLIANT'" |
DEFINES+=" android_static_lib='NOT_SDK_COMPLIANT'" |
- DEFINES+=\ |
-" android_sdk=${ANDROID_SDK_ROOT}/platforms/android-${ANDROID_SDK_VERSION}" |
+ DEFINES+=" android_sdk=${ANDROID_SDK_ROOT}/${sdk_suffix}" |
DEFINES+=" android_sdk_root=${ANDROID_SDK_ROOT}" |
DEFINES+=" android_sdk_tools=${ANDROID_SDK_ROOT}/platform-tools" |
DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" |