AC_DEFINE(HAVE_RUSAGE,,rusage)],
AC_MSG_RESULT(no))
+dnl ---------------------------
+dnl check for glibc 'backtrace'
+dnl ---------------------------
+if test "${glibc}" = "yes"; then
+ AC_CHECK_HEADER(execinfo.h)
+fi
+if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
+ AC_CHECK_FUNC(backtrace,
+ [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
+ )
+fi
+
dnl -------------
dnl check version
dnl -------------
AC_DEFINE(HAVE_RUSAGE,,rusage)],
AC_MSG_RESULT(no))
+dnl ---------------------------
+dnl check for glibc 'backtrace'
+dnl ---------------------------
+if test "${glibc}" = "yes"; then
+ AC_CHECK_HEADER(execinfo.h)
+fi
+if test x"${ac_cv_header_execinfo_h}" = x"yes"; then
+ AC_CHECK_FUNC(backtrace,
+ [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)]
+ )
+fi
+
dnl -------------
dnl check version
dnl -------------
--- /dev/null
+#include <zebra.h>
+#include "log.h"
+
+void
+debug_print_trace (int signal)
+{
+ void *array[10];
+ size_t size;
+ char **strings;
+ size_t i;
+
+ size = backtrace (array, 10);
+ strings = backtrace_symbols (array, size);
+
+ printf ("Obtained %zd stack frames.\n", size);
+
+ for (i = 0; i < size; i++)
+ printf ("%s\n", strings[i]);
+
+ free (strings);
+
+ exit(1);
+}
--- /dev/null
+
+void debug_print_trace (int);
+
#include <libutil.h>
#endif /* HAVE_LIBUTIL_H */
+#ifdef HAVE_GLIBC_BACKTRACE
+#include <execinfo.h>
+#endif /* HAVE_GLIBC_BACKTRACE */
+
#ifdef BSDI_NRL
#ifdef HAVE_NETINET6_IN6_H