look for backtrace() in -lexecinfo, fixes #9783

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2009-11-15 04:02:27 +00:00
parent dcb7b2a6f3
commit 1a3afea6ee
2 changed files with 159 additions and 53 deletions

192
configure vendored
View File

@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in 60294 2009-04-24 04:23:31Z RD .
# From configure.in Id: configure.in 62501 2009-10-25 17:48:32Z PC .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for wxWidgets 2.8.10.
#
@@ -36738,42 +36738,44 @@ _ACEOF
fi
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
echo "$as_me:$LINENO: checking for backtrace() in <execinfo.h>" >&5
echo $ECHO_N "checking for backtrace() in <execinfo.h>... $ECHO_C" >&6
if test "${wx_cv_func_backtrace+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_ext=cc
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
echo "$as_me:$LINENO: checking for library containing backtrace" >&5
echo $ECHO_N "checking for library containing backtrace... $ECHO_C" >&6
if test "${ac_cv_search_backtrace+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_backtrace=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <execinfo.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char backtrace ();
int
main ()
{
void *trace[1];
char **messages;
backtrace(trace, 1);
messages = backtrace_symbols(trace, 1);
backtrace ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
@@ -36786,7 +36788,124 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_backtrace="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_backtrace" = no; then
for ac_lib in execinfo; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char backtrace ();
int
main ()
{
backtrace ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_backtrace="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_backtrace" >&5
echo "${ECHO_T}$ac_cv_search_backtrace" >&6
if test "$ac_cv_search_backtrace" != no; then
test "$ac_cv_search_backtrace" = "none required" || LIBS="$ac_cv_search_backtrace $LIBS"
echo "$as_me:$LINENO: checking for backtrace() in <execinfo.h>" >&5
echo $ECHO_N "checking for backtrace() in <execinfo.h>... $ECHO_C" >&6
if test "${wx_cv_func_backtrace+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <execinfo.h>
int
main ()
{
void *trace[1];
char **messages;
backtrace(trace, 1);
messages = backtrace_symbols(trace, 1);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -36800,18 +36919,15 @@ sed 's/^/| /' conftest.$ac_ext >&5
wx_cv_func_backtrace=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $wx_cv_func_backtrace" >&5
echo "${ECHO_T}$wx_cv_func_backtrace" >&6
else
wx_cv_func_backtrace=no
fi
if test "$wx_cv_func_backtrace" = "no"; then
@@ -36825,12 +36941,6 @@ if test "${wx_cv_func_cxa_demangle+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -36880,12 +36990,6 @@ wx_cv_func_cxa_demangle=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
@@ -36899,6 +37003,12 @@ _ACEOF
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != "1" -a "$USE_UNIX" != "1"; then

View File

@@ -5034,24 +5034,21 @@ fi
dnl backtrace() and backtrace_symbols() for wxStackWalker
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
[
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([#include <execinfo.h>],
AC_LANG_PUSH(C++)
AC_SEARCH_LIBS(backtrace, execinfo,
[AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
[AC_TRY_LINK([#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
)
AC_LANG_POP()
]
)
)]
)],
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])
@@ -5059,7 +5056,6 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
else
AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
[
AC_LANG_PUSH(C++)
AC_TRY_LINK([#include <cxxabi.h>],
[
int rc;
@@ -5068,7 +5064,6 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
wx_cv_func_cxa_demangle=yes,
wx_cv_func_cxa_demangle=no
)
AC_LANG_POP()
]
)
@@ -5076,6 +5071,7 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
AC_DEFINE(HAVE_CXA_DEMANGLE)
fi
fi
AC_LANG_POP()
fi
if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != "1" -a "$USE_UNIX" != "1"; then