Browse Source

build: add support for gcc's "c++0x" mode
* required for building with Mozilla 6.0 code base

toddw 13 years ago
parent
commit
1c2158590b
1 changed files with 19 additions and 0 deletions
  1. 19 0
      configure.in

+ 19 - 0
configure.in

@@ -2618,8 +2618,27 @@ 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"
+
+    if test -z "$_MOZ_USE_RTTI"; then
+        CXXFLAGS="$CXXFLAGS $_MOZ_RTTI_FLAGS"
+        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")])
+        CXXFLAGS="$_SAVE_CXXFLAGS"
+        if test "$ac_cv_cxx0x_headers_bug" = "no"; then
+            CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+        fi
+    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),