bug 877937 - build the js engine in c++11 mode when we do that for the rest of the tree r=ted

This commit is contained in:
Trevor Saunders 2013-05-30 21:21:18 -04:00
parent 2616658199
commit c23adc3563

View File

@ -2332,6 +2332,35 @@ else
AC_MSG_RESULT(no)
fi
dnl Check whether we can use gcc's c++0x mode
AC_LANG_CPLUSPLUS
if test "$GNU_CXX"; then
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
AC_CACHE_CHECK(for gcc c++0x headers bug without rtti,
ac_cv_cxx0x_headers_bug,
[AC_TRY_COMPILE([#include <memory>], [],
ac_cv_cxx0x_headers_bug="no",
ac_cv_cxx0x_headers_bug="yes")])
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
AC_LANG_C
dnl Check for .hidden assembler directive and visibility attribute.