Merge "Fixed standalone emulator when ANDROID_BUILD_TOP is present"
diff --git a/android-configure.sh b/android-configure.sh
index beb7427..01fc2c4 100755
--- a/android-configure.sh
+++ b/android-configure.sh
@@ -196,15 +196,9 @@
     # use ccache if USE_CCACHE is defined and the corresponding
     # binary is available.
     #
-    # note: located in PREBUILT/ccache/ccache in the new tree layout
-    #       located in PREBUILT/ccache in the old one
-    #
     if [ -n "$USE_CCACHE" ] ; then
         CCACHE="$ANDROID_PREBUILT/ccache/ccache$EXE"
         if [ ! -f $CCACHE ] ; then
-            CCACHE="$ANDROID_PREBUILT/ccache$EXE"
-        fi
-        if [ ! -f $CCACHE ] ; then
             CCACHE="$ANDROID_PREBUILTS/ccache/ccache$EXE"
         fi
         if [ -f $CCACHE ] ; then
diff --git a/android/build/common.sh b/android/build/common.sh
index c7235ae..e3e190b 100644
--- a/android/build/common.sh
+++ b/android/build/common.sh
@@ -499,10 +499,10 @@
 {
     # locate prebuilt directory
     ANDROID_PREBUILT_HOST_TAG=$OS
-    ANDROID_PREBUILT=$ANDROID_TOP/prebuilt/$ANDROID_PREBUILT_HOST_TAG
-    ANDROID_PREBUILTS=$ANDROID_TOP/prebuilts/misc/$ANDROID_PREBUILT_HOST_TAG
+    ANDROID_PREBUILT=$ANDROID_TOP/prebuilt/$ANDROID_PREBUILT_HOST_TAG  # AOSP still has it
+    ANDROID_PREBUILTS=$ANDROID_TOP/prebuilts/misc/$ANDROID_PREBUILT_HOST_TAG # AOSP does't have it yet
     if [ ! -d $ANDROID_PREBUILT ] ; then
-        # this can happen when building on x86_64
+        # this can happen when building on x86_64, or in AOSP
         case $OS in
             linux-x86_64)
                 ANDROID_PREBUILT_HOST_TAG=linux-x86
@@ -511,8 +511,7 @@
             *)
         esac
         if [ ! -d $ANDROID_PREBUILT ] ; then
-            echo "Can't find the prebuilt directory $ANDROID_PREBUILT in Android build"
-            exit 1
+            ANDROID_PREBUILT=
         fi
     fi
     if [ ! -d $ANDROID_PREBUILTS ] ; then
@@ -525,8 +524,7 @@
             *)
         esac
         if [ ! -d $ANDROID_PREBUILTS ] ; then
-            echo "Can't find the prebuilts directory $ANDROID_PREBUILTS in Android build"
-            exit 1
+            ANDROID_PREBUILTS=
         fi
     fi
     log "Prebuilt   : ANDROID_PREBUILT=$ANDROID_PREBUILT"