]> www.fi.muni.cz Git - evince.git/commitdiff
Check for execinfo.h and use it only if it exists.
authorChristian Persch <chpe@cvs.gnome.org>
Mon, 29 Aug 2005 20:40:07 +0000 (20:40 +0000)
committerChristian Persch <chpe@src.gnome.org>
Mon, 29 Aug 2005 20:40:07 +0000 (20:40 +0000)
2005-08-29  Christian Persch  <chpe@cvs.gnome.org>

* configure.ac:
* lib/ev-debug.c: (trap_handler):

Check for execinfo.h and use it only if it exists.

ChangeLog
configure.ac
lib/ev-debug.c

index 9e6d3a9dc2b6b74ba4327cf07e92c44f3a19c94b..237cc6f5bb11f4c6fa0a2daf77e6731b14febd46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-08-29  Christian Persch  <chpe@cvs.gnome.org>
+
+       * 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 <happyguy_pt@hotmail.com>
 
        * configure.ac: Added Portuguese (pt) to ALL_LINGUAS.
index c76946aa80557c1d1ad67990817751e9e239b2a6..2050b1ce0143e59df0053e3410b6dcabbc29fb35 100644 (file)
@@ -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.])
index 8648e2d59c6401cd81b3f6149c372158e7877063..0173a7da388090023a6f6f7ce160f6e0dec5ebf2 100644 (file)
@@ -29,7 +29,9 @@
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+#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)
                {