Bug 476800 - kill variadic macro warnings r=ted
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 10 Feb 2009 08:33:58 -0500
changeset 24826 2a10c8f1fa11e84bf99aaa7b02ff7baad648274a
parent 24825 060afee65a8e865fc55a4ddc2034e636d1897c53
child 24827 46ee46c2c52a80f19f17826f6e6cb7c85dde52f3
push idunknown
push userunknown
push dateunknown
reviewersted
bugs476800
milestone1.9.2a1pre
Bug 476800 - kill variadic macro warnings r=ted
js/src/configure.in
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1368,16 +1368,34 @@ if test "$GNU_CXX"; then
                            ac_has_wno_invalid_offsetof="yes",
                            ac_has_wno_invalid_offsetof="no")
             CXXFLAGS="$_SAVE_CXXFLAGS"
             AC_LANG_RESTORE
         ])
     if test "$ac_has_wno_invalid_offsetof" = "yes"; then
         _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
     fi
+
+    AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
+                   ac_has_wno_variadic_macros,
+        [
+            AC_LANG_SAVE
+            AC_LANG_CPLUSPLUS
+            _SAVE_CXXFLAGS="$CXXFLAGS"
+            CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
+            AC_TRY_COMPILE([],
+                           [return(0);],
+                           ac_has_wno_variadic_macros="yes",
+                           ac_has_wno_variadic_macros="no")
+            CXXFLAGS="$_SAVE_CXXFLAGS"
+            AC_LANG_RESTORE
+        ])
+    if test "$ac_has_wno_variadic_macros" = "yes"; then
+        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
+    fi
 else
     _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
 fi
 
 dnl gcc can come with its own linker so it is better to use the pass-thru calls
 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
 dnl normal behavior.