Bug 854914 - Allow clang to build in C++11 mode by working around http://llvm.org/bugs/show_bug.cgi?id=13530. r=ted

This commit is contained in:
Mike Hommey 2013-03-27 07:51:14 +01:00
parent fd8c2d8349
commit e8b6da04db
2 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,2 @@
#include_next <bits/c++config.h>
#undef _GLIBCXX_USE_FLOAT128

View File

@ -2715,9 +2715,20 @@ if test "$GNU_CXX"; then
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_cxx0x_headers_bug="no",
ac_cv_cxx0x_headers_bug="yes")])
CXXFLAGS="$_SAVE_CXXFLAGS"
if test "$ac_cv_cxx0x_headers_bug" = "no"; then
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
if test "$CLANG_CXX" -a "$ac_cv_cxx0x_headers_bug" = "yes"; then
CXXFLAGS="$CXXFLAGS -I$_topsrcdir/build/unix/headers"
AC_CACHE_CHECK(whether workaround for gcc c++0x headers conflict with clang works,
ac_cv_cxx0x_clang_workaround,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_cxx0x_clang_workaround="yes",
ac_cv_cxx0x_clang_workaround="no")])
if test "ac_cv_cxx0x_clang_workaround" = "no"; then
CXXFLAGS="$_SAVE_CXXFLAGS"
fi
elif test "$ac_cv_cxx0x_headers_bug" = "yes"; then
CXXFLAGS="$_SAVE_CXXFLAGS"
fi
fi