Bug 650304 - Use gcc C++0x mode by default, when it works as expected. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 03 May 2011 10:35:21 +0200
changeset 68899 7528b2718827d83082b7ceea33df49df4d97bf38
parent 68898 316b764ae6c01ed1b91dc9f1690572b6d5364658
child 68900 83b30b8ad22c3a2aad1fb93766c6175e4de8548c
child 69191 ef6b2700e9513943009e379656bb4ce12836f3ad
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs650304
milestone6.0a1
first release with
nightly win64
7528b2718827 / 6.0a1 / 20110503030212 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 650304 - Use gcc C++0x mode by default, when it works as expected. r=bsmedberg
configure.in
--- a/configure.in
+++ b/configure.in
@@ -2958,31 +2958,38 @@ if test "$ac_cv_have_uname_us_domainname
     AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
     AC_MSG_RESULT(yes)
 else
     AC_MSG_RESULT(no)
 fi
 
 AC_LANG_CPLUSPLUS
 
+if test "$GNU_CXX"; then
+    _SAVE_CXXFLAGS=$CXXFLAGS
+    CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+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],
                     [CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
                      CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
                      CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
                      CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
                      CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
                     ac_cv_have_usable_char16_t="yes",
                     ac_cv_have_usable_char16_t="no")])
 if test "$ac_cv_have_usable_char16_t" = "yes"; then
     AC_DEFINE(HAVE_CPP_CHAR16_T)
     HAVE_CPP_CHAR16_T=1
+else
+    CXXFLAGS="$_SAVE_CXXFLAGS"
 fi
 
 dnl Check for usable wchar_t (2 bytes, unsigned)
 dnl (we really don't need the unsignedness check anymore)
 dnl ========================================================
 
 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
     ac_cv_have_usable_wchar_v2,