From 0f1f27b13238fa76621a1081cabaf56af37277d5 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 4 Jul 2011 16:17:12 +1000 Subject: [PATCH] Temporarily add fallback null path for backtrace --- Makefile.am | 3 ++- backtrace_null.cpp | 17 +++++++++++++++++ configure.ac | 6 ++++-- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 backtrace_null.cpp diff --git a/Makefile.am b/Makefile.am index 2ad46df5..3d6057cc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,9 +51,10 @@ UTIL_FILES = \ if HAVE_EXECINFO UTIL_FILES += backtrace_execinfo.cpp +else +UTIL_FILES += backtrace_null.cpp endif - CLEANFILES = json.cpp version.cpp ip.cpp EXTRA_DIST = json.cpp.rl version.cpp.rl ip.cpp.rl diff --git a/backtrace_null.cpp b/backtrace_null.cpp new file mode 100644 index 00000000..8b18330d --- /dev/null +++ b/backtrace_null.cpp @@ -0,0 +1,17 @@ +#include "backtrace.hpp" + +#include + +using namespace std; + + +debug::backtrace::backtrace (void): + m_frames (DEFAULT_DEPTH) +{ ; } + + +ostream& +operator <<(ostream &os, const debug::backtrace &rhs) { + os << "null backtrace"; + return os; +} diff --git a/configure.ac b/configure.ac index e04b0f88..2fc0f547 100644 --- a/configure.ac +++ b/configure.ac @@ -85,12 +85,14 @@ AC_C_BIGENDIAN ## ## platform features +COMMON_CFLAGS="$COMMON_CFLAGS -D_GNU_SOURCE" + AC_FUNC_MMAP -AC_CHECK_HEADER([execinfo.h], [break], [AC_MSG_ERROR([Missing backtrace support])]) - +AC_CHECK_HEADER([execinfo.h], [break]) AM_CONDITIONAL([HAVE_EXECINFO], [test x$ac_cv_header_execinfo_h = "xyes"]) + ## ## Debug features if test "x$cv_debugging" = "xyes"; then