summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody P Schafer <cody@linux.vnet.ibm.com>2012-09-14 17:11:53 -0700
committerArun Sharma <asharma@fb.com>2012-09-15 10:47:42 -0700
commit09ecaf3e59e68423195d9222f39f2081bdbe940f (patch)
tree20047964ec0263e20d755dfcd372f1d2bd1fd703
parentb45c27b6ee5803e25f397bb068e1137ecb7d3c55 (diff)
downloadlibunwind-09ecaf3e59e68423195d9222f39f2081bdbe940f.tar.gz
configure: avoid using a shell function in autoconf
AC_DEFUN exsists for the purpose of creating functions in autoconf scripts, use it instead of a shell function.
-rw-r--r--configure.in29
1 files changed, 14 insertions, 15 deletions
diff --git a/configure.in b/configure.in
index 592f4f30..3d5d6b9b 100644
--- a/configure.in
+++ b/configure.in
@@ -86,21 +86,20 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#endif
]])], [ppc_bits=64], [ppc_bits=32])
-get_arch() {
- case "$1" in
- arm*) echo arm;;
- i?86) echo x86;;
- hppa*) echo hppa;;
- mips*) echo mips;;
- powerpc*) echo ppc$ppc_bits;;
- amd64) echo x86_64;;
- *) echo $1;;
- esac
-}
-
-build_arch=`get_arch $build_cpu`
-host_arch=`get_arch $host_cpu`
-target_arch=`get_arch $target_cpu`
+AC_DEFUN([SET_ARCH],[
+ AS_CASE([$1],
+ [arm*],[$2=arm],
+ [i?86],[$2=x86],
+ [hppa*],[$2=hppa],
+ [mips*],[$2=mips],
+ [powerpc*],[$2=ppc$ppc_bits],
+ [amd64],[$2=x86_64],
+ [$2=$1])
+]) dnl SET_ARCH
+
+SET_ARCH([$build_cpu],[build_arch])
+SET_ARCH([$host_cpu],[host_arch])
+SET_ARCH([$target_cpu],[target_arch])
AC_ARG_ENABLE(coredump,
AS_HELP_STRING([--enable-coredump],[building libunwind-coredump library]),