summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-09-14 20:07:11 +0200
committerPatrick McHardy <kaber@trash.net>2010-09-14 22:07:09 +0200
commitf8bf6942abd120640464b80f6a6b1b3f71a8900f (patch)
tree80edb1501e18fe8a60600ecd37c296fe38b0ab3b /configure.ac
parent073d8f66175ee6f8ebab86a339611e386ddad204 (diff)
debug: add libdect-specific assert-macro with optional backtrace support
Make assertions more useful by printing a backtrace on failed assertions. Requires libbfd. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8a7d814..d17dda0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,16 @@ AC_CHECK_LIB([ev], [event_init],
EVENT_LDFLAGS=$EVENTLIB
AC_SUBST(EVENT_LDFLAGS)
+if test "$CONFIG_DEBUG" = "y";
+then
+ AC_CHECK_LIB([bfd], [bfd_init],
+ [CONFIG_BACKTRACE="y"],
+ [CONFIG_BACKTRACE="n";
+ AC_MSG_NOTICE([libbfd not found, backtrace support disabled])])
+else
+ CONFIG_BACKTRACE="n"
+fi
+
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_ASSERT
@@ -66,6 +76,14 @@ AC_CHECK_HEADER([event.h],
EVENT_CFLAGS=$EVENTINC
AC_SUBST(EVENT_CFLAGS)
+if test "$CONFIG_BACKTRACE" = "y";
+then
+ AC_CHECK_HEADER([bfd.h], ,
+ [CONFIG_BACKTRACE="";
+ AC_MSG_NOTICE([bfd.h not found, backtrace support disabled])])
+fi
+AC_SUBST(CONFIG_BACKTRACE)
+
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST