[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 08/17] configure: avoid using a shell function
From: |
Cody P Schafer |
Subject: |
[Libunwind-devel] [PATCH 08/17] configure: avoid using a shell function in autoconf |
Date: |
Fri, 14 Sep 2012 17:11:53 -0700 |
AC_DEFUN exsists for the purpose of creating functions in autoconf
scripts, use it instead of a shell function.
---
configure.in | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/configure.in b/configure.in
index 592f4f3..3d5d6b9 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]),
--
1.7.11.3
- [Libunwind-devel] [PATCH v3 00/17] Fixup the PowerPC (64 & 32 bit) builds & clean up configure, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 01/17] ppc32: ppc64: use AC_COMPILE_IFELSE to test __powerpc64__ macro for ppc64, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 02/17] ppc32: remove unused dmy_vrregset, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 05/17] build: make libunwind-coredump build optional, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 04/17] ppc32: ppc64: test altivec support by running the compiler., Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 06/17] configure: use AS_HELP_STRING for configure args instead of manual formating, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 07/17] ppc64: remove tests/ppc64-test-wchar, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 08/17] configure: avoid using a shell function in autoconf,
Cody P Schafer <=
- [Libunwind-devel] [PATCH 16/17] ptrace: check for NULL arg., Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 14/17] configure: rename configure.in to configure.ac, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 11/17] UPT: Add reg offsets for ppc32/64, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 12/17] ppc64: be explicit in access_reg range check, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 17/17] ptrace: add more Debug to access_reg, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 13/17] ppc64: add FRAME_POINTER & NIP to regname., Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 15/17] ptrace/access_reg: print out register name on "bad register", Cody P Schafer, 2012/09/14