[ovs-dev,v2] configure: Properly handle case where libunwind.h is not available.
diff mbox series

Message ID 1571286955-7419-1-git-send-email-yihung.wei@gmail.com
State New
Headers show
Series
  • [ovs-dev,v2] configure: Properly handle case where libunwind.h is not available.
Related show

Commit Message

Yi-Hung Wei Oct. 17, 2019, 4:35 a.m. UTC
It is possible that user install libunwind but not libunwind-devel,
and it will run into a compilation error.  So we need to check the
existence of the library and the header file.

Fixes: e2ed6fbeb18c ("fatal-signal: Catch SIGSEGV and print backtrace.")
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
---
 m4/openvswitch.m4 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

William Tu Oct. 17, 2019, 3:47 p.m. UTC | #1
On Wed, Oct 16, 2019 at 09:35:55PM -0700, Yi-Hung Wei wrote:
> It is possible that user install libunwind but not libunwind-devel,
> and it will run into a compilation error.  So we need to check the
> existence of the library and the header file.
> 
> Fixes: e2ed6fbeb18c ("fatal-signal: Catch SIGSEGV and print backtrace.")
> Suggested-by: Ben Pfaff <blp@ovn.org>
> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
> ---
Thank you! Applied to master.

Patch
diff mbox series

diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 79e0be5a33dd..fe323a020b9d 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -640,7 +640,9 @@  AC_DEFUN([OVS_CHECK_UNBOUND],
 
 dnl Checks for libunwind.
 AC_DEFUN([OVS_CHECK_UNWIND],
-  [AC_CHECK_LIB(unwind, unw_backtrace, [HAVE_UNWIND=yes], [HAVE_UNWIND=no])
+  [AC_CHECK_LIB([unwind], [unw_backtrace],
+   [AC_CHECK_HEADERS([libunwind.h], [HAVE_UNWIND=yes], [HAVE_UNWIND=no])],
+   [HAVE_UNWIND=no])
    if test "$HAVE_UNWIND" = yes; then
      AC_DEFINE([HAVE_UNWIND], [1], [Define to 1 if unwind is detected.])
      LIBS="$LIBS -lunwind"