Bug 894242 - Make C++0x/C++11 mode of gcc/clang mandatory. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 17 Jul 2013 16:19:25 +0900
changeset 152971 dc014201581d4cec5e70acb911e9b8ad9c649179
parent 152970 8e9dea03011762471b1fbd8b81b8cdec4f774d93
child 152972 71b1da3303e523ef200220642bba11a5d7e0d528
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs894242
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 894242 - Make C++0x/C++11 mode of gcc/clang mandatory. r=ted
configure.in
js/src/Makefile.in
js/src/configure.in
js/src/js-config.in
--- a/configure.in
+++ b/configure.in
@@ -2730,21 +2730,20 @@ AC_CACHE_VAL(ac_cv_have_uname_us_domainn
 
 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
     AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
     AC_MSG_RESULT(yes)
 else
     AC_MSG_RESULT(no)
 fi
 
-dnl Check whether we can use gcc's c++0x mode
+dnl Check whether gcc's c++0x mode works
 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")])
 
@@ -2752,20 +2751,20 @@ if test "$GNU_CXX"; 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"
+            AC_MSG_ERROR([Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
         fi
     elif test "$ac_cv_cxx0x_headers_bug" = "yes"; then
-        CXXFLAGS="$_SAVE_CXXFLAGS"
+        AC_MSG_ERROR([Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
     fi
 fi
 
 dnl Check for usable char16_t (2 bytes, unsigned)
 dnl (we might not need the unsignedness check anymore)
 AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
     ac_cv_have_usable_char16_t,
     [AC_TRY_COMPILE([$configure_static_assert_macros],
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -505,17 +505,17 @@ JS_CONFIG_SUBSTITUTIONS=\
 	-DJS_CONFIG_LIBS="$(JS_CONFIG_LIBS)" \
 	-DJS_CONFIG_MOZ_JS_LIBS="$(JS_CONFIG_MOZ_JS_LIBS)" \
 	-DMOZJS_MAJOR_VERSION="$(MOZJS_MAJOR_VERSION)" \
 	-DMOZJS_MINOR_VERSION="$(MOZJS_MINOR_VERSION)" \
 	-DMOZJS_PATCH_VERSION="$(MOZJS_PATCH_VERSION)" \
 	-DMOZJS_ALPHA="$(MOZJS_ALPHA)" \
 	-DNSPR_CFLAGS="$(NSPR_CFLAGS)" \
 	-DNSPR_PKGCONF_CHECK="$(NSPR_PKGCONF_CHECK)" \
-	-DUSE_CXX11="$(USE_CXX11)"
+	$(NULL)
 
 $(JS_CONFIG_NAME): js-config.in Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk $(topsrcdir)/config/rules.mk
 	$(RM) $@.tmp
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py --marker % $(JS_CONFIG_SUBSTITUTIONS) $< > $@.tmp \
 	&& mv $@.tmp $@ && chmod +x $@
 
 SCRIPTS = $(JS_CONFIG_NAME)
 SDK_BINARY = $(JS_CONFIG_NAME)
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2342,45 +2342,41 @@ AC_CACHE_VAL(ac_cv_have_uname_us_domainn
 
 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
     AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
     AC_MSG_RESULT(yes)
 else
     AC_MSG_RESULT(no)
 fi
 
-dnl Check whether we can use gcc's c++0x mode
+dnl Check whether gcc's c++0x mode works
 AC_LANG_CPLUSPLUS
 
 if test "$GNU_CXX"; then
-    _SAVE_CXXFLAGS=$CXXFLAGS
     CXXFLAGS="$CXXFLAGS -std=gnu++0x"
-    USE_CXX11=1
 
     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"
-            USE_CXX11=
+            AC_MSG_ERROR([Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
         fi
     elif test "$ac_cv_cxx0x_headers_bug" = "yes"; then
-        CXXFLAGS="$_SAVE_CXXFLAGS"
-            USE_CXX11=
+        AC_MSG_ERROR([Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain])
     fi
 fi
 
 AC_LANG_C
 
 dnl Check for .hidden assembler directive and visibility attribute.
 dnl Borrowed from glibc configure.in
 dnl ===============================================================
@@ -4269,17 +4265,16 @@ AC_SUBST(TARGET_MD_ARCH)
 AC_SUBST(TARGET_XPCOM_ABI)
 AC_SUBST(OS_TARGET)
 AC_SUBST(OS_ARCH)
 AC_SUBST(OS_RELEASE)
 AC_SUBST(OS_TEST)
 AC_SUBST(CPU_ARCH)
 AC_SUBST(INTEL_ARCHITECTURE)
 
-AC_SUBST(USE_CXX11)
 AC_SUBST(WRAP_LDFLAGS)
 AC_SUBST(MKSHLIB)
 AC_SUBST(MKCSHLIB)
 AC_SUBST(MKSHLIB_FORCE_ALL)
 AC_SUBST(MKSHLIB_UNFORCE_ALL)
 AC_SUBST(DSO_CFLAGS)
 AC_SUBST(DSO_PIC_CFLAGS)
 AC_SUBST(DSO_LDOPTS)
--- a/js/src/js-config.in
+++ b/js/src/js-config.in
@@ -104,18 +104,14 @@ if test "$echo_includedir" = "yes"; then
     echo $includedir
 fi
 
 if test "$echo_libdir" = "yes"; then
     echo $libdir
 fi
 
 if test "$echo_cflags" = "yes"; then
-    cflags="-include $includedir/$LIBRARY_NAME/js/RequiredDefines.h -I$includedir/$LIBRARY_NAME $NSPR_CFLAGS"
-    if test '@USE_CXX11@' = "1"; then
-        cflags="$cflags -std=gnu++0x"
-    fi
-    echo $cflags
+    echo "-std=gnu++0x -include $includedir/$LIBRARY_NAME/js/RequiredDefines.h -I$includedir/$LIBRARY_NAME $NSPR_CFLAGS"
 fi
 
 if test "$echo_libs" = "yes"; then
     echo "$MOZ_JS_LIBS $JS_CONFIG_LIBS"
 fi