]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libatomic/configure.ac
make `-Werror` optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer
[thirdparty/gcc.git] / libatomic / configure.ac
index f350b9b3509a21eee9c3cbee95051a2825c4fff1..5563551aaae9fbcf7141f3617170db1f9ede84e4 100644 (file)
@@ -251,10 +251,13 @@ LIBAT_ENABLE_SYMVERS
 CFLAGS="$save_CFLAGS"
 AC_CACHE_SAVE
 
+AC_ARG_ENABLE([werror],
+  [AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
 # Add -Wall -Werror if we are using GCC.
-if test "x$GCC" = "xyes"; then
-  XCFLAGS="$XCFLAGS -Wall -Werror"
-fi
+AS_IF([test "x$GCC" = "xyes"],
+  [XCFLAGS="$XCFLAGS -Wall"])
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"],
+  [XCFLAGS="$XCFLAGS -Werror"])
 
 # Add CET specific flags if CET is enabled
 GCC_CET_FLAGS(CET_FLAGS)