summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEric Lambert <eric.lambert@seagate.com>2014-10-09 07:15:16 -0700
committerEric Lambert <eric.lambert@seagate.com>2014-10-09 07:15:16 -0700
commite22f3807e203fd16f113cc8fa1a8c9b8efe80ec0 (patch)
tree478582ff2a087c59678e64f0a968271fb532523b /configure.ac
parentf552b70f711e34d33abf855a5aed3550c37a457c (diff)
downloadliberasurecode-e22f3807e203fd16f113cc8fa1a8c9b8efe80ec0.tar.gz
provide a configure flag to disable -Werror at compile time
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 15 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 5312850..8ab230e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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],