]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: accept libunwind without pkg-config
authorDavid Lamparter <equinox@diac24.net>
Fri, 17 Jan 2020 12:57:15 +0000 (13:57 +0100)
committerDavid Lamparter <equinox@diac24.net>
Fri, 17 Jan 2020 14:50:50 +0000 (15:50 +0100)
NetBSD installs LLVM's libunwind without a pkg-config file, but it
works perfectly fine.

Signed-off-by: David Lamparter <equinox@diac24.net>
configure.ac

index 1e79c3c2e89fffd888958cc09fd620fb158ad3ef..c8371f304e5177a1a475e56ec3508cb7f69f55aa 100755 (executable)
@@ -2113,6 +2113,19 @@ if test x"${enable_backtrace}" != x"no" ; then
     AC_DEFINE([HAVE_LIBUNWIND], [1], [libunwind])
     backtrace_ok=yes
   ], [
+    true
+  ])
+
+  if test "$backtrace_ok" = "no"; then
+    AC_CHECK_HEADER([unwind.h], [
+      AC_SEARCH_LIBS([unw_getcontext], [unwind], [
+        AC_DEFINE([HAVE_LIBUNWIND], [1], [libunwind])
+        backtrace_ok=yes
+      ])
+    ])
+  fi
+
+  if test "$backtrace_ok" = "no"; then
     case "$host_os" in
     sunos* | solaris2*)
       AC_CHECK_FUNCS([printstack], [
@@ -2129,7 +2142,7 @@ if test x"${enable_backtrace}" != x"no" ; then
         ],, [-lm])
       ])
     fi
-  ])
+  fi
 
   if test x"${enable_backtrace}" = x"yes" -a x"${backtrace_ok}" = x"no"; then
     dnl user explicitly requested backtrace but we failed to find support