-case $host_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" ;;
- sparc64) ARCHTYPE="sparc64" ;;
- alpha*) ARCHTYPE="alpha" ;;
- *) ARCHTYPE="unknown";;
-esac
-
-if test "$ARCHTYPE" != "unknown"; then
- UATOMICSRC=urcu/uatomic_arch_$ARCHTYPE.h
- ARCHSRC=urcu/arch_$ARCHTYPE.h
-else
- UATOMICSRC=urcu/uatomic_generic.h
- ARCHSRC=urcu/arch_generic.h
-fi
-if test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc; then
- APISRC=tests/api_gcc.h
-else
- APISRC=tests/api_$ARCHTYPE.h
-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"],
+ [ARCHTYPE="unknown"]
+)