-case $target_cpu in
- i386) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
- i486) ARCHTYPE="x86";;
- i586) ARCHTYPE="x86";;
- i686) ARCHTYPE="x86";;
- x86_64) ARCHTYPE="x86";;
- powerpc) ARCHTYPE="ppc" ;;
- ppc64) ARCHTYPE="ppc" ;;
- powerpc64) ARCHTYPE="ppc" ;;
- ppc) ARCHTYPE="ppc" ;;
- s390) ARCHTYPE="s390" ;;
- s390x) ARCHTYPE="s390" ;;
- *) ARCHTYPE="unknown";;
-esac
-
-if test "$ARCHTYPE" = "unknown"; then
- AC_MSG_ERROR([Unable to detect the architecture.])
-fi
+AS_CASE([$host_cpu],
+ [i386], [ARCHTYPE="x86" && SUBARCHTYPE="x86compat"],
+ [i486], [ARCHTYPE="x86"],
+ [i586], [ARCHTYPE="x86"],
+ [i686], [ARCHTYPE="x86"],
+ [amd64], [ARCHTYPE="x86"],
+ [x86_64], [ARCHTYPE="x86"],
+ [powerpc], [ARCHTYPE="ppc"],
+ [ppc64], [ARCHTYPE="ppc"],
+ [powerpc64], [ARCHTYPE="ppc"],
+ [powerpc64le], [ARCHTYPE="gcc"],
+ [ppc], [ARCHTYPE="ppc"],
+ [s390], [ARCHTYPE="s390"],
+ [s390x], [ARCHTYPE="s390"],
+ [sparc], [ARCHTYPE="sparc64"],
+ [sparc64], [ARCHTYPE="sparc64"],
+ [alpha*], [ARCHTYPE="alpha"],
+ [ia64], [ARCHTYPE="gcc"],
+ [arm*], [ARCHTYPE="arm"],
+ [aarch64], [ARCHTYPE="gcc"],
+ [mips*], [ARCHTYPE="mips"],
+ [tile*], [ARCHTYPE="gcc"],
+ [hppa*], [ARCHTYPE="hppa"],
+ [ARCHTYPE="unknown"]
+)
+
+AS_CASE([$host],[*-*-linux-androideabi],
+ [AM_CONDITIONAL(TARGET_IS_ANDROID, true)],
+ [AM_CONDITIONAL(TARGET_IS_ANDROID, false)]
+)
+