Filter out mips64 for unknown arch, misc fixes

1. Show all NDK_APP_ABI for cygwin file converter script
2. missing quote
3. Only build libgccunwind as side product of linux host toolchain

Change-Id: Ia5560daaf62abb5bd575af101acf2f94930e36b4
diff --git a/build/core/build-all.mk b/build/core/build-all.mk
index 0f6c861..b684e51 100644
--- a/build/core/build-all.mk
+++ b/build/core/build-all.mk
@@ -107,7 +107,7 @@
     $(info ------ end of script -----)
   endif
 $(NDK_DEPENDENCIES_CONVERTER):
-	$(call host-echo-build-step,$(TARGET_ARCH_ABI),Cygwin) Generating dependency file converter script
+	$(call host-echo-build-step,$(NDK_APP_ABI),Cygwin) Generating dependency file converter script
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(GEN_CYGWIN_DEPS_CONVERTER) > $@ && chmod +x $@
 
diff --git a/build/tools/build-cxx-stl.sh b/build/tools/build-cxx-stl.sh
index 0faca26..4ed182d 100755
--- a/build/tools/build-cxx-stl.sh
+++ b/build/tools/build-cxx-stl.sh
@@ -380,7 +380,7 @@
 SHARED_CXXFLAGS=
 
 UNKNOWN_ABIS="$(filter_out "$PREBUILT_ABIS" "$ABIS")"
-if [ -n "$UNKNOWN_ABIS" ] && [ -n $(find_ndk_unknown_archs) ]; then
+if [ -n "$UNKNOWN_ABIS" ] && [ -n "$(find_ndk_unknown_archs)" ]; then
   ABIS="$(filter_out "$UNKNOWN_ABIS" "$ABIS")"
   ABIS="$ABIS $(find_ndk_unknown_archs)"
 fi
diff --git a/build/tools/build-gcc.sh b/build/tools/build-gcc.sh
index 4639050..5d32964 100755
--- a/build/tools/build-gcc.sh
+++ b/build/tools/build-gcc.sh
@@ -464,7 +464,7 @@
 }
 
 # Only create libgccunwind.a when building default version of gcc
-if [ "$GCC_VERSION" = "$DEFAULT_GCC_VERSION" ]; then
+if [ "$HOST_OS" = "linux" -a "$GCC_VERSION" = "$DEFAULT_GCC_VERSION" ]; then # or latest gcc ie 4.8?
     run create_unwind_library $ARCH $NDK_DIR
 fi
 
@@ -602,7 +602,7 @@
     fi
     pack_archive "$PACKAGE_DIR/$ARCHIVE" "$NDK_DIR" "$SUBDIR" $EXCLUSIONS
     # package libgccunwind.a
-    if [ "$GCC_VERSION" = "$DEFAULT_GCC_VERSION" ]; then
+    if [ "$HOST_OS" = "linux" -a "$GCC_VERSION" = "$DEFAULT_GCC_VERSION" ]; then
         ABIS=$(commas_to_spaces $(convert_archs_to_abis $ARCH))
         for ABI in $ABIS; do
             FILES="$GCCUNWIND_SUBDIR/libs/$ABI/libgccunwind.a"
diff --git a/build/tools/prebuilt-common.sh b/build/tools/prebuilt-common.sh
index 79e9409..f72bca4 100644
--- a/build/tools/prebuilt-common.sh
+++ b/build/tools/prebuilt-common.sh
@@ -1185,7 +1185,7 @@
     local FOUND_ARCHS=$(find_ndk_archs)
     # TODO: aarch64, x86_64 is here just to be found as known arch.
     # It can be removed as soon as it is added into $DEFAULT_ARCHS
-    echo "$(filter_out "$DEFAULT_ARCHS aarch64 x86_64" "$FOUND_ARCHS")"
+    echo "$(filter_out "$DEFAULT_ARCHS aarch64 x86_64 mips64" "$FOUND_ARCHS")"
 }
 
 # Determine whether given arch is in unknown archs list