summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-09-15 19:14:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:49 -0500
commitf82eb0fef609e6f24f4d60142292c557cd1fe5fd (patch)
tree4bfc5eb25a822c4e8d3d297c5c1fc0ca8e8a44d2
parent6e4bf4c18897640f0ec795fba75526a4e0892f25 (diff)
downloadsamba-f82eb0fef609e6f24f4d60142292c557cd1fe5fd.tar.gz
samba-f82eb0fef609e6f24f4d60142292c557cd1fe5fd.tar.bz2
samba-f82eb0fef609e6f24f4d60142292c557cd1fe5fd.zip
r25179: fix libunwind detection on x86 based hosts
we need -lunwind-x86 not -lunwind-i686 metze (This used to be commit 2e5f4781652961d6369a64c48b92697c11262c51)
-rw-r--r--source3/configure.in36
1 files changed, 29 insertions, 7 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 67cec38109..ce3a430f15 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -702,6 +702,10 @@ UNAME_P=`(uname -p) 2>/dev/null` || UNAME_P="unknown"
AC_MSG_CHECKING(uname -p)
AC_MSG_RESULT(${UNAME_P})
+UNAME_I=`(uname -i) 2>/dev/null` || UNAME_I="unknown"
+AC_MSG_CHECKING(uname -i)
+AC_MSG_RESULT(${UNAME_I})
+
dnl Add #include for broken IRIX header files
case "$host_os" in
*irix6*)
@@ -1401,15 +1405,33 @@ LIBS="$save_LIBS"
# any of them.
AC_MSG_CHECKING([for libunwind])
save_LIBS=$LIBS
-if test x"$UNAME_P" = xunknown ; then
- # This probably won't link without the platform-specific libunwind.
- LIBS="$LIBS -lunwind"
-else
- # Add the platform-specific libunwind module. uname -p seems the most
- # plausible option and works for ia64, where libunwind is most useful.
- LIBS="$LIBS -lunwind -lunwind-$UNAME_P"
+
+UNWIND_ARCH="unknown"
+if test x"$UNAME_I" != x"unknown"; then
+ UNWIND_ARCH="$UNAME_I"
+elif test x"$UNAME_M" != x"unknown"; then
+ UNWIND_ARCH="$UNAME_M"
+elif test x"$UNAME_P" != x"unknown"; then
+ UNWIND_ARCH="$UNAME_P"
fi
+case "$UNWIND_ARCH" in
+ unknown)
+ # This probably won't link without
+ # the platform-specific libunwind.
+ LIBS="$LIBS -lunwind"
+ ;;
+ i386|i586|i686)
+ # Add the platform-specific libunwind module.
+ LIBS="$LIBS -lunwind -lunwind-x86"
+ ;;
+ *)
+ # Add the platform-specific libunwind module.
+ # based on uname -i, uname -m or uname -p
+ LIBS="$LIBS -lunwind -lunwind-$UNWIND_ARCH"
+ ;;
+esac
+
AC_TRY_LINK(
[
#ifdef HAVE_LIBUNWIND_H