Fix wrong configure test for abi::__forced_unwind in previous commit.

The previous commit was accidental and contained an initial version of the
patch which didn't test for NPTL abi::__forced_unwind correctly and just
tested whether cxxabi.h header was available.

Tighten the check to work on the other systems and check for __forced_unwind
existence itself.

Also check for cxxabi.h before testing for __cxa_demangle as there is no need
to try to compile another test program if we already know that this entire
header is unavailable anyhow.

See #14626.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-09-20 23:12:28 +00:00
parent e02ea2030c
commit 89b3361ec2
4 changed files with 109 additions and 25 deletions

69
configure vendored
View File

@@ -30474,27 +30474,28 @@ $as_echo "$wx_cv_func_backtrace" >&6; }
$as_echo "$as_me: WARNING: backtrace() is not available, wxStackWalker will not be available" >&2;}
wxUSE_STACKWALKER=no
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cxa_demangle() in <cxxabi.h>" >&5
if test "$ac_cv_header_cxxabi_h" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cxa_demangle() in <cxxabi.h>" >&5
$as_echo_n "checking for __cxa_demangle() in <cxxabi.h>... " >&6; }
if ${wx_cv_func_cxa_demangle+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_ext=cpp
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
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <cxxabi.h>
int
main ()
{
int rc;
__cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
int rc;
__cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
;
return 0;
@@ -30508,7 +30509,7 @@ else
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_ext=c
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'
@@ -30519,6 +30520,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_cxa_demangle" >&5
$as_echo "$wx_cv_func_cxa_demangle" >&6; }
else
wx_cv_func_cxa_demangle=no
fi
if test "$wx_cv_func_cxa_demangle" = "yes"; then
$as_echo "#define HAVE_CXA_DEMANGLE 1" >>confdefs.h
@@ -32385,6 +32389,59 @@ $as_echo "yes, it works" >&6; }
fi
fi
if test "$ac_cv_header_cxxabi_h" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for abi::__forced_unwind() in <cxxabi.h>" >&5
$as_echo_n "checking for abi::__forced_unwind() in <cxxabi.h>... " >&6; }
if ${wx_cv_type_abi_forced_unwind+:} false; then :
$as_echo_n "(cached) " >&6
else
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 <cxxabi.h>
int
main ()
{
void foo(abi::__forced_unwind&);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
wx_cv_type_abi_forced_unwind=yes
else
wx_cv_type_abi_forced_unwind=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_type_abi_forced_unwind" >&5
$as_echo "$wx_cv_type_abi_forced_unwind" >&6; }
else
wx_cv_type_abi_forced_unwind=no
fi
if test "$wx_cv_type_abi_forced_unwind" = "yes"; then
$as_echo "#define HAVE_ABI_FORCEDUNWIND 1" >>confdefs.h
fi
fi
else