diff --git a/configure.ac b/configure.ac index 1f933a729..551c970b3 100644 --- a/configure.ac +++ b/configure.ac @@ -1665,6 +1665,17 @@ AC_ARG_ENABLE(optimization, CFLAGS=`echo $CFLAGS | sed s/-O[[1-9]]\ /-O0\ /g` 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 #