provide a configure flag to disable -Werror at compile time

This commit is contained in:
Eric Lambert 2014-10-09 07:15:16 -07:00
parent f552b70f71
commit e22f3807e2
1 changed files with 15 additions and 2 deletions

View File

@ -42,6 +42,19 @@ AC_CHECK_FUNCS(malloc calloc realloc free openlog)
#################################################################################
# Debug/coverage Options
#################################################################################
AC_ARG_ENABLE([werror],
[ --disable-werror Dont treat compilation warnings as failures],
[case "${enableval}" in
yes) werror=true ;;
no) werror=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-werror]) ;;
esac],[werror=true])
if test x$werror = xtrue ; then
werror_flag="-Werror"
else
werror_flag=""
fi
AC_ARG_ENABLE([debug],
[ --enable-debug Turn on debugging],
[case "${enableval}" in
@ -52,11 +65,11 @@ esac],[debug=false])
if test x$debug = xtrue ; then
DEBUG=1
CXXFLAGS=""
CFLAGS="-O0 -ggdb -g3 -Werror -D_GNU_SOURCE=1 -Wall -pedantic -std=c99"
CFLAGS="-O0 -ggdb -g3 ${werror_flag} -D_GNU_SOURCE=1 -Wall -pedantic -std=c99"
else
DEBUG=0
CXXFLAGS=""
CFLAGS="-O2 -g -Werror -D_GNU_SOURCE=1 -Wall -pedantic -std=c99"
CFLAGS="-O2 -g ${werror_flag} -D_GNU_SOURCE=1 -Wall -pedantic -std=c99"
fi
AC_ARG_ENABLE([gcov],