+dnl backtrace() and backtrace_symbols() for wxStackWalker
+if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
+ [
+ AC_TRY_COMPILE([#include <execinfo.h>],
+ [
+ void *trace[1];
+ char **messages;
+
+ backtrace(trace, 1);
+ messages = backtrace_symbols(trace, 1);
+ ],
+ wx_cv_func_backtrace=yes,
+ wx_cv_func_backtrace=no
+ )
+ ]
+ )
+
+
+ if test "$wx_cv_func_backtrace" = "no"; then
+ AC_MSG_WARN([backtrace() is not available, wxStackWalker will not be available])
+ wxUSE_STACKWALKER=no
+ else
+ AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
+ [
+ AC_TRY_COMPILE([#include <cxxabi.h>],
+ [
+ int rc;
+ __cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
+ ],
+ wx_cv_func_cxa_demangle=yes,
+ wx_cv_func_cxa_demangle=no
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_cxa_demangle" = "yes"; then
+ AC_DEFINE(HAVE_CXA_DEMANGLE)
+ fi
+ fi
+
+ AC_LANG_RESTORE
+fi
+