aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-08-06 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-08-06 08:00:00 +0000
commita420b271bcea6f1d5bba9b94220bc821824527b9 (patch)
tree8272f2e0d76d244808d1698d041fedeeec6e0dbf /configure.ac
parent183f9e2a1b4d56fdf0035337f0665880c4ef0812 (diff)
downloadpam-a420b271bcea6f1d5bba9b94220bc821824527b9.tar.gz
pam-a420b271bcea6f1d5bba9b94220bc821824527b9.tar.bz2
pam-a420b271bcea6f1d5bba9b94220bc821824527b9.zip
configure.ac: rewrite WARN_CFLAGS initialization
As the old machinery was not prepared for adding compiler options conditionally when the compiler supports them, replace it with a new machinery that implements this. * m4/warnings.m4: New file. * m4/warn_lang_flags.m4: Likewise. * m4/.gitignore: Add exclusions for them. * m4/japhar_grep_cflags.m4 (JAPHAR_GREP_CFLAGS): Remove. * configure.ac: Call pam_WARN_LANG_FLAGS. Remove all uses of JAPHAR_GREP_CFLAGS.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac52
1 files changed, 1 insertions, 51 deletions
diff --git a/configure.ac b/configure.ac
index 69e2f302..a01cca9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,57 +79,7 @@ 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 \
- -W \
- -Wall \
- -Wbad-function-cast \
- -Wcast-align \
- -Wcast-qual \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wpointer-arith \
- -Wreturn-type \
- -Wstrict-prototypes \
- -Wwrite-strings \
- -Winline \
- -Wshadow \
- $Werror_option
- do
- JAPHAR_GREP_CFLAGS($flag, [ WARN_CFLAGS="$WARN_CFLAGS $flag" ])
- done
-fi
-dnl icc has special warning flags
-if eval 'test "x$CC" = "xicc"'; then
- for flag in \
- -Wall \
- -Wmissing-prototypes \
- -Wpointer-arith \
- -Wreturn-type \
- -Wstrict-prototypes \
- -Wwrite-strings \
- -Wshadow \
- -Wp64 \
- -Wdeprecated \
- -Wuninitialized \
- -Wmain
- do
- JAPHAR_GREP_CFLAGS($flag, [ WARN_CFLAGS="$WARN_CFLAGS $flag" ])
- done
-fi
-
-AC_SUBST(WARN_CFLAGS)
+pam_WARN_LANG_FLAGS
if test "x${CC_FOR_BUILD+set}" != "xset" ; then
if test "x$cross_compiling" = "xyes" ; then