Index: xserver/xorg/configure.ac =================================================================== RCS file: /cvs/xorg/xserver/xorg/configure.ac,v retrieving revision 1.70 diff -u -p -r1.70 configure.ac --- xserver/xorg/configure.ac 3 Sep 2005 03:27:55 -0000 1.70 +++ xserver/xorg/configure.ac 8 Sep 2005 02:11:16 -0000 @@ -124,6 +124,13 @@ if test "x$ac_cv_sysv_ipc" = xyes; then AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available]) fi +dnl backtrace support (hw/xfree86/common/xf86Events.c) +AC_CHECK_HEADER([execinfo.h],[ + AC_CHECK_LIB(c, backtrace, [ + AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support]) + ]) +]) + dnl --------------------------------------------------------------------------- dnl Bus options and CPU capabilities. Replaces logic in dnl hw/xfree86/os-support/bus/Makefile.am, among others. Index: ./xc/programs/Xserver/hw/xfree86/common/xf86Events.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v retrieving revision 1.18 diff -u -p -r1.18 xf86Events.c --- xc/programs/Xserver/hw/xfree86/common/xf86Events.c 26 Aug 2005 07:35:55 -0000 1.18 +++ xc/programs/Xserver/hw/xfree86/common/xf86Events.c 8 Sep 2005 02:11:40 -0000 @@ -1277,15 +1277,11 @@ xf86InterceptSigIll(void (*sigillhandler xf86SigIllHandler = sigillhandler; } -#if defined(__GLIBC__) -# if __GLIBC_PREREQ(2, 1) -# define HAVE_BACKTRACE -# endif +#ifdef HAVE_EXECINFO_H +# include #endif #ifdef HAVE_BACKTRACE -#include - static __inline__ void xorg_backtrace(void) { void *array[32]; /* deeper nesting than this means something's wrong */ @@ -1299,7 +1295,7 @@ static __inline__ void xorg_backtrace(vo free(strings); } -#else /* not glibc or glibc < 2.1 */ +#else /* no backtrace support found in libc */ # if defined(HAVE_WALKCONTEXT) /* Solaris 9 & later */ @@ -1372,8 +1368,9 @@ static __inline__ void xorg_backtrace(vo /* Default fallback if we can't find any way to get a backtrace */ static __inline__ void xorg_backtrace(void) { return; } -# endif -#endif +# endif /* defined(HAVE_WALKCONTEXT) */ + +#endif /* HAVE_BACKTRACE */ /* * xf86SigHandler --