satyr/0008-configure-don-t-link-against-libunwind-needlessly.patch

49 lines
1.5 KiB
Diff
Raw Normal View History

2014-11-07 09:59:30 +00:00
From 3cf1a5c1da350369ea27a7f6b45eeb2e10ce3bbe Mon Sep 17 00:00:00 2001
From: Martin Milata <mmilata@redhat.com>
Date: Thu, 6 Nov 2014 15:48:24 +0100
Subject: [PATCH] configure: don't link against libunwind needlessly
Previously we linked against libunwind even if we detected usable
elfutils unwinder. Not a problem for elfutils from mock/koji but can
cause confusion during development.
Closes #162.
Signed-off-by: Martin Milata <mmilata@redhat.com>
---
configure.ac | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index aff4419..ba18759 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,13 +104,19 @@ AC_CHECK_LIB([elf], [main])
AC_CHECK_LIB([dw], [main])
AC_CHECK_LIB([dwfl], [main])
AC_CHECK_LIB([dl], [main])
-AC_CHECK_FUNC(dwfl_getthreads, AC_DEFINE(HAVE_DWFL_NEXT_THREAD, [], [Have function dwfl_getthreads for coredump unwinding]))
+elfutils_unwinder=0
+AC_CHECK_FUNC(dwfl_getthreads,
+ AC_DEFINE(HAVE_DWFL_NEXT_THREAD, [], [Have function dwfl_getthreads for coredump unwinding])
+ elfutils_unwinder=1
+)
# libunwind
-AC_CHECK_HEADERS([libunwind-coredump.h])
-AC_CHECK_LIB([unwind], [main])
-AC_CHECK_LIB([unwind-generic], [main])
-AC_CHECK_LIB([unwind-coredump], [main])
+if test "$elfutils_unwinder" != "1"; then
+ AC_CHECK_HEADERS([libunwind-coredump.h])
+ AC_CHECK_LIB([unwind], [main])
+ AC_CHECK_LIB([unwind-generic], [main])
+ AC_CHECK_LIB([unwind-coredump], [main])
+fi
# rpm
AC_CHECK_LIB([rpm], [main])
--
2.1.0