[ovs-dev] [PATCH] configure: Properly handle case where libunwind.h is not available.

Ben Pfaff blp at ovn.org
Tue Oct 15 18:53:30 UTC 2019


On Tue, Oct 15, 2019 at 02:30:48PM -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 check the existence
> of the header file instead of the library.
> 
> Fixes: e2ed6fbeb18c ("fatal-signal: Catch SIGSEGV and print backtrace.")
> Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
> ---
>  m4/openvswitch.m4 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
> index 79e0be5a33dd..da7119951484 100644
> --- a/m4/openvswitch.m4
> +++ b/m4/openvswitch.m4
> @@ -640,7 +640,7 @@ 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_HEADERS([libunwind.h], [HAVE_UNWIND=yes], [HAVE_UNWIND=no])

It might be wise to check for both, e.g.:

AC_CHECK_LIB([unwind], [unw_backtrace],
  [AC_CHECK_HEADERS([libunwind.h], [HAVE_UNWIND=yes], [HAVE_UNWIND=no])],
  [HAVE_UNWIND=no])



More information about the dev mailing list