diff options
-rw-r--r-- | configure.ac | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 7a64f52..1b2f87c 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,18 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Overwrite the build in defaults -CFLAGS="-Wall -Os -Wextra -Werror -fPIC -ffunction-sections" +CFLAGS="-Wall -Os -Wextra -fPIC -ffunction-sections" + +WERROR_CFLAGS="-Werror" + +AC_ARG_ENABLE(werror, + [AS_HELP_STRING([--enable-werror], [Enable -Werror])], + ENABLE_WERROR=$enableval, + ENABLE_WERROR=yes) + +if test "${ENABLE_WERROR}" = "yes" ; then + CFLAGS="$CFLAGS $WERROR_CFLAGS" +fi # Checks for programs. AC_PROG_CC |