Bug 747311 - autodetect android_toolchain on Android/x86. r=glandium
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 27 Apr 2012 14:45:38 +0900
changeset 96645 8eaab92b32206d90f2056fc7b19c77893b27419e
parent 96644 add831dc812ed83f807f6950765f434311f68d54
child 96646 d871849ac3a36d0586e3c5ee0fedee89c0ab1a47
child 96664 21dcf77f7b1887acca45efff213cd546dc593202
push idunknown
push userunknown
push dateunknown
reviewersglandium
bugs747311
milestone15.0a1
Bug 747311 - autodetect android_toolchain on Android/x86. r=glandium
configure.in
js/src/configure.in
--- a/configure.in
+++ b/configure.in
@@ -395,17 +395,25 @@ case "$target" in
         AC_MSG_CHECKING([for android toolchain directory])
 
         kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
 
         android_toolchain="$android_ndk"/build/prebuilt/$kernel_name-x86/arm-eabi-4.4.0
 
         # With newer NDK, the toolchain path has changed.
         if ! test -d "$android_toolchain" ; then
-            android_toolchain="$android_ndk"/toolchains/arm-$kernel_name-androideabi-4.4.3/prebuilt/$kernel_name-x86
+            case "$target_cpu" in
+            arm)
+                target_name=arm-linux-androideabi-4.4.3
+                ;;
+            i?86)
+                target_name=x86-4.4.3
+                ;;
+            esac
+            android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
         fi
 
         if test -d "$android_toolchain" ; then
             AC_MSG_RESULT([$android_toolchain])
         else
             AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
         fi
     fi
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -386,17 +386,25 @@ case "$target" in
         AC_MSG_CHECKING([for android toolchain directory])
 
         kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
 
         android_toolchain="$android_ndk"/build/prebuilt/$kernel_name-x86/arm-eabi-4.4.0
 
         # With newer NDK, the toolchain path has changed.
         if ! test -d "$android_toolchain" ; then
-            android_toolchain="$android_ndk"/toolchains/arm-$kernel_name-androideabi-4.4.3/prebuilt/$kernel_name-x86
+            case "$target_cpu" in
+            arm)
+                target_name=arm-linux-androideabi-4.4.3
+                ;;
+            i?86)
+                target_name=x86-4.4.3
+                ;;
+            esac
+            android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
         fi
 
         if test -d "$android_toolchain" ; then
             AC_MSG_RESULT([$android_toolchain])
         else
             AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
         fi
     fi