From 8d0f9c8819f0b6fa8b2801909ba343f5407d8b67 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 29 Aug 2005 20:40:07 +0000 Subject: [PATCH] Check for execinfo.h and use it only if it exists. 2005-08-29 Christian Persch * configure.ac: * lib/ev-debug.c: (trap_handler): Check for execinfo.h and use it only if it exists. --- ChangeLog | 8 ++++++++ configure.ac | 5 +++++ lib/ev-debug.c | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9e6d3a9d..237cc6f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-08-29 Christian Persch + + * configure.ac: + * lib/ev-debug.c: (trap_handler): + + Check for execinfo.h and use it only if it exists. + Ported from Epiphany (bug #314776). + 2005-08-29 Duarte Loreto * configure.ac: Added Portuguese (pt) to ALL_LINGUAS. diff --git a/configure.ac b/configure.ac index c76946aa..2050b1ce 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,11 @@ if test "x$GCONFTOOL" = "xno"; then AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf]) fi +dnl ================== portability checks =========================================== + +dnl for backtrace() +AC_CHECK_HEADERS([execinfo.h]) + dnl ================== ggv checks =================================================== AC_ARG_WITH(gs-pkg, [ --with-gs=dir Directory Where GhostScript package is installed.]) diff --git a/lib/ev-debug.c b/lib/ev-debug.c index 8648e2d5..0173a7da 100644 --- a/lib/ev-debug.c +++ b/lib/ev-debug.c @@ -29,7 +29,9 @@ #include #include #include +#ifdef HAVE_EXECINFO_H #include +#endif static GHashTable *ev_profilers_hash = NULL; static const char *ev_profile_modules = NULL; @@ -98,11 +100,15 @@ trap_handler (const char *log_domain, { if (strcmp (ev_debug_break, "stack") == 0) { +#ifdef HAVE_EXECINFO_H void *array[MAX_DEPTH]; size_t size; size = backtrace (array, MAX_DEPTH); backtrace_symbols_fd (array, size, 2); +#else + g_on_error_stack_trace (g_get_prgname ()); +#endif } else if (strcmp (ev_debug_break, "trap") == 0) { -- 2.43.5