diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-30 21:04:28 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-30 21:16:02 +0100 |
commit | 5f27719e4e501506b82bf095aa1b2b1aac5eb390 (patch) | |
tree | d91c8551e89d7f45e0033a0bc74da0be031c1e99 /configure.ac | |
parent | b0cc48440dc410d283525c0577a1175476b447a9 (diff) |
configure: better libstdc++ ABI breakage check
The old code expected that gcc -dumpversion outputs x.y.z, but just x.y
is also a valid output. Use the preprocessor defines instead, this way
SUSE 4.7.2 gcc will use -std=gnu++0x as well.
Change-Id: I9871b05953ab255c66dd152c0befd29037522902
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index eb0a4343f24a..e49cc3814313 100644 --- a/configure.ac +++ b/configure.ac @@ -5558,10 +5558,17 @@ if test "$GCC" = "yes"; then AC_MSG_RESULT([no]) fi + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if __GNUC__ == 4 && __GNUC_MINOR__ == 7 && (__GNUC_PATCHLEVEL__ == 0 || __GNUC_PATCHLEVEL__ == 1) +#else +abi ok +#endif +]])],[HAVE_BROKEN_ABI=TRUE],[HAVE_BROKEN_ABI=FALSE]) + AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757]) # This should check libstdc++ version, not gcc, but clang has incidentally C++11 support # disabled in this case by the __float128 case below. - if test "$GCCVER" -ge 040700 -a "$GCCVER" -lt 040702; then + if test "$HAVE_BROKEN_ABI" = "TRUE"; then AC_MSG_NOTICE([Not using -std=gnu++0x on $CXX version 4.7.0/4.7.1 due to libstdc++ ABI breakage.]) else save_CXXFLAGS=$CXXFLAGS |