diff --git a/configure b/configure index d3620386cb..7688082051 100755 --- a/configure +++ b/configure @@ -30268,13 +30268,54 @@ _ACEOF fi if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace() in " >&5 -$as_echo_n "checking for backtrace() in ... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace()" >&5 +$as_echo_n "checking for backtrace()... " >&6; } if ${wx_cv_func_backtrace+:} false; then : $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace" >&5 + ac_ext=cpp +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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + void *trace[1]; + char **messages; + backtrace(trace, 1); + messages = backtrace_symbols(trace, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + wx_cv_func_backtrace=yes +else + wx_cv_func_backtrace=no + +fi +rm -f core 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 + + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_backtrace" >&5 +$as_echo "$wx_cv_func_backtrace" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace" >&5 $as_echo_n "checking for library containing backtrace... " >&6; } if ${ac_cv_search_backtrace+:} false; then : $as_echo_n "(cached) " >&6 @@ -30328,54 +30369,11 @@ ac_res=$ac_cv_search_backtrace if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - ac_ext=cpp -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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - void *trace[1]; - char **messages; - backtrace(trace, 1); - messages = backtrace_symbols(trace, 1); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - wx_cv_func_backtrace=yes else wx_cv_func_backtrace=no - -fi -rm -f core 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 - - -else - wx_cv_func_backtrace=no - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_backtrace" >&5 -$as_echo "$wx_cv_func_backtrace" >&6; } - if test "$wx_cv_func_backtrace" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: backtrace() is not available, wxStackWalker will not be available" >&5 $as_echo "$as_me: WARNING: backtrace() is not available, wxStackWalker will not be available" >&2;} diff --git a/configure.in b/configure.in index 941f885e3c..39e944d93f 100644 --- a/configure.in +++ b/configure.in @@ -4157,28 +4157,26 @@ fi dnl backtrace() and backtrace_symbols() for wxStackWalker if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then - AC_CACHE_CHECK([for backtrace() in ], wx_cv_func_backtrace, + AC_CACHE_CHECK([for backtrace()], wx_cv_func_backtrace, [ - AC_SEARCH_LIBS(backtrace, execinfo, + AC_LANG_PUSH(C++) + AC_TRY_COMPILE([#include ], [ - AC_LANG_PUSH(C++) - AC_TRY_LINK([#include ], - [ - 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() + 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() ] ) + dnl Under BSD it can require linking with libexecinfo. + AC_SEARCH_LIBS(backtrace, execinfo, , [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