Prettify configure output when checking for backtrace().

The output of "checking for backtrace()" was interspersed with the output of
"checking for library containing backtrace", which was ugly and potentially
confusing, so move AC_SEARCH_LIBS() out of AC_CACHE_CHECK() to fix it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2015-02-01 11:33:13 +00:00
parent 1127820164
commit eeead5ff6d
2 changed files with 56 additions and 60 deletions

90
configure vendored
View File

@@ -30268,13 +30268,54 @@ _ACEOF
fi fi
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace() in <execinfo.h>" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace()" >&5
$as_echo_n "checking for backtrace() in <execinfo.h>... " >&6; } $as_echo_n "checking for backtrace()... " >&6; }
if ${wx_cv_func_backtrace+:} false; then : if ${wx_cv_func_backtrace+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else 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 <execinfo.h>
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; } $as_echo_n "checking for library containing backtrace... " >&6; }
if ${ac_cv_search_backtrace+:} false; then : if ${ac_cv_search_backtrace+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
@@ -30328,54 +30369,11 @@ ac_res=$ac_cv_search_backtrace
if test "$ac_res" != no; then : if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 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 <execinfo.h>
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 else
wx_cv_func_backtrace=no 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
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 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:${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;} $as_echo "$as_me: WARNING: backtrace() is not available, wxStackWalker will not be available" >&2;}

View File

@@ -4157,28 +4157,26 @@ fi
dnl backtrace() and backtrace_symbols() for wxStackWalker dnl backtrace() and backtrace_symbols() for wxStackWalker
if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
AC_CACHE_CHECK([for backtrace() in <execinfo.h>], 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 <execinfo.h>],
[ [
AC_LANG_PUSH(C++) void *trace[1];
AC_TRY_LINK([#include <execinfo.h>], char **messages;
[ backtrace(trace, 1);
void *trace[1]; messages = backtrace_symbols(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=yes,
wx_cv_func_backtrace=no 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 if test "$wx_cv_func_backtrace" = "no"; then
AC_MSG_WARN([backtrace() is not available, wxStackWalker will not be available]) AC_MSG_WARN([backtrace() is not available, wxStackWalker will not be available])
wxUSE_STACKWALKER=no wxUSE_STACKWALKER=no