[Libreoffice-commits] .: configure.ac

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 10 07:50:55 PST 2012


 configure.ac |   37 ++-----------------------------------
 1 file changed, 2 insertions(+), 35 deletions(-)

New commits:
commit 02e2202894652751f59a0709e1b767e8ed2ab30c
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Dec 10 16:15:39 2012 +0100

    do not try to use -std=c++11 after all
    
    The very same libstdc++ that breaks with clang and -std=gnu++0x
    has also the ABI breakage that prevents using C++11 anyway.
    Moreover, there's still the idea that we should preferably use
    the gnu variant, just like the default is -std=gnu++98, rather
    than strict C++11 (the gcc manpage for -ansi e.g. says that
    some builtins are disabled in this case).
    
    Change-Id: I4dac01374ee7a34796161f6e0e76eb962953e709

diff --git a/configure.ac b/configure.ac
index 696f975..caac659 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5658,6 +5658,8 @@ if test "$GCC" = "yes"; then
     fi
 
     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
         AC_MSG_NOTICE([Not using -std=gnu++0x on $CXX version 4.7.0/4.7.1 due to libstdc++ ABI breakage.])
     else
@@ -5697,41 +5699,6 @@ return !(i != 0 && j != 0);
 
         AC_LANG_POP([C++])
         CXXFLAGS=$save_CXXFLAGS
-
-        if test "$HAVE_CXX0X" != "TRUE"; then
-            save_CXXFLAGS=$CXXFLAGS
-            CXXFLAGS="$CXXFLAGS -std=c++11"
-            AC_LANG_PUSH([C++])
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-                #include <stddef.h>
-                #include <vector>
-                    // some Clang fail when compiling against GCC 4.7 headers
-                    // with -std=gnu++0x (__float128)
-                template <typename T, size_t S> char
-                    (&sal_n_array_size( T(&)[S] ))[S];
-                namespace
-                {
-                    struct b
-                    {
-                        int i;
-                        int j;
-                    };
-                }
-            ]], [[
-                struct a
-                {
-                    int i;
-                    int j;
-                };
-                a thinga[]={{0,0}, {1,1}};
-                b thingb[]={{0,0}, {1,1}};
-                size_t i = sizeof(sal_n_array_size(thinga));
-                size_t j = sizeof(sal_n_array_size(thingb));
-                return !(i != 0 && j != 0);
-            ]])],[HAVE_CXX0X=TRUE CXXFLAGS_CXX11=-std=c++11],[])
-            AC_LANG_POP([C++])
-            CXXFLAGS=$save_CXXFLAGS
-        fi
     fi
     if test "$HAVE_CXX0X" = "TRUE"; then
         AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])


More information about the Libreoffice-commits mailing list