build: New configure option --enable-werror
authorWerner Koch <wk@gnupg.org>
Tue, 24 Oct 2017 16:42:37 +0000 (18:42 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 24 Oct 2017 16:44:49 +0000 (18:44 +0200)
* configure.ac: Implement that option.
--

This can be used as a workaround in case of bogus autoconf tests.

GnuPG-bug-id: 2423
Signed-off-by: Werner Koch <wk@gnupg.org>
configure.ac

index 1f933a7..551c970 100644 (file)
@@ -1666,6 +1666,17 @@ AC_ARG_ENABLE(optimization,
                    fi])
 
 #
+# Add -Werror to CFLAGS.  This hack can be used to avoid problems with
+# misbehaving autoconf tests in case the user supplied -Werror.
+#
+AC_ARG_ENABLE(werror,
+   AC_HELP_STRING([--enable-werror],
+                  [append -Werror to CFLAGS]),
+                  [if test $enableval = yes ; then
+                      CFLAGS="$CFLAGS -Werror"
+                   fi])
+
+#
 # Configure option --enable-all-tests
 #
 AC_MSG_CHECKING([whether "make check" shall run all tests])