configure: provide a cli flag instead of forcing -Werror
authorMichael Wallner <mike@php.net>
Wed, 8 Jan 2020 17:30:06 +0000 (18:30 +0100)
committerMichael Wallner <mike@php.net>
Wed, 8 Jan 2020 17:30:06 +0000 (18:30 +0100)
configure.ac

index 86f986a7d658aa5f187c0dfb0ca98b8c355c80ea..98de0a3e4e25af50cde6b0aadcb21003acd96cb7 100644 (file)
@@ -83,7 +83,6 @@ AX_COMPILER_VENDOR
 AX_COMPILER_VERSION
 AC_LANG_POP([C++])
 
-
 AX_ASSERT
 
 AX_PLATFORM
@@ -342,6 +341,16 @@ AX_ENDIAN
 AX_ASSERT
 AX_HARDEN_COMPILER_FLAGS
 
+AC_ARG_ENABLE([warnings-as-errors], AS_HELP_STRING([--enable-warnings-as-errors], 
+  [Build with -Werror enabled]), , [enable_warnings_as_errors=no])
+AC_CACHE_CHECK([if all warnings should produce an error], [ac_cv_warnings_as_errors], [
+  AS_IF([test "x$enable_warnings_as_errors" = "xyes"], [
+    ac_cv_warnings_as_errors=yes
+  ], [
+    ac_cv_warnings_as_errors=no
+  ])
+])
+
 AX_AM_JOBSERVER([yes])
 
 AC_CONFIG_FILES([Makefile