+# See if -Wunknown-warning-option is supported
+AC_MSG_CHECKING(
+ [whether -Wunknown-warning-option is supported])
+AC_CACHE_VAL([folly_cv_cxx_unknown_warning_option_support], [
+ folly_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [
+ # The compiler didn't completely error out on -Werror=unknown-warning-option
+ CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option -Wthis-is-an-unknown-option-that-should-error"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [folly_cv_cxx_unknown_warning_option_support=no],
+ [folly_cv_cxx_unknown_warning_option_support=yes])
+ ],
+ [folly_cv_cxx_unknown_warning_option_support=no])
+ CXXFLAGS="$folly_save_CXXFLAGS"])
+AC_MSG_RESULT([$folly_cv_cxx_unknown_warning_option_support])
+