summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac20
-rw-r--r--src/Makefile.am4
2 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 05d98f6..de7bf95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,26 @@ AC_ARG_ENABLE(
)
AM_CONDITIONAL(ENABLE_GPROF, test x$enable_gprof = xyes)
+AC_ARG_ENABLE(
+ [werror],
+ AC_HELP_STRING(
+ [--enable-werror],
+ [
+ Fail build if warning present]
+ ]
+ ),
+ [
+ enable_werror="$enableval"
+ case $enableval in
+ "no");;
+ "yes");;
+ *) AC_MSG_ERROR([[invalid argument --enable-werror=$disableval... stopping]]);;
+ esac
+ ],
+ [enable_werror="no"]
+)
+AM_CONDITIONAL(ENABLE_WERROR, test x$enable_werror = xyes)
+
AC_DEFUN([AC_CHECK_COMPILER_WFLAG],
[
AC_MSG_CHECKING([whether $CC supports -W$1])
diff --git a/src/Makefile.am b/src/Makefile.am
index afd8435..56c6887 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -142,6 +142,10 @@ if ENABLE_GPROF
SHARED_CFLAGS += "-pg"
endif
+if ENABLE_WERROR
+SHARED_CFLAGS += "-Werror"
+endif
+
lib_LTLIBRARIES = libevol_char.la libevol_login.la libevol_map.la
libevol_char_la_SOURCES = ${CHAR_SRC}
libevol_char_la_LDFLAGS = ${SHARED_LDFLAGS}