aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-03-19 18:40:16 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-03-19 18:40:16 +0000
commitd94d1362581bacc4c2aa4d4f7927fa3ac1df672e (patch)
treec7ab1026010b623d783c75eb90a50bd6371a1d98 /configure.ac
parent466e1de674b42b2afe13d2edd998acbf656a9c76 (diff)
downloadpam-d94d1362581bacc4c2aa4d4f7927fa3ac1df672e.tar.gz
pam-d94d1362581bacc4c2aa4d4f7927fa3ac1df672e.tar.bz2
pam-d94d1362581bacc4c2aa4d4f7927fa3ac1df672e.zip
configure: implement --enable-Werror option
When configure is invoked with --enable-Werror option, -Werror compiler option is added to WARN_CFLAGS. This new configure option is intended primarily for CI purposes. * configure.ac (AC_ARG_ENABLE): Add Werror. Forward -Werror to JAPHAR_GREP_CFLAGS.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 40eaa5aa..57886415 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,16 @@ PAM_LD_O1
dnl Largefile support
AC_SYS_LARGEFILE
+Werror_option=
+AC_ARG_ENABLE([Werror],
+ [AS_HELP_STRING([--enable-Werror],
+ [turn on -Werror compiler option])],
+ [case $enableval in
+ yes) Werror_option=-Werror ;;
+ no) ;;
+ *) AC_MSG_ERROR([bad value $enableval for Werror option]) ;;
+ esac])
+
dnl icc claims to be GCC compatible, but use other flags for warnings
if eval 'test "x$GCC" = "xyes" -a "$CC" != "icc"'; then
for flag in \
@@ -94,7 +104,8 @@ if eval 'test "x$GCC" = "xyes" -a "$CC" != "icc"'; then
-Wstrict-prototypes \
-Wwrite-strings \
-Winline \
- -Wshadow
+ -Wshadow \
+ $Werror_option
do
JAPHAR_GREP_CFLAGS($flag, [ WARN_CFLAGS="$WARN_CFLAGS $flag" ])
done