diff --git a/Makefile.am b/Makefile.am index 99250803b7..e4c6d3c1c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1825,16 +1825,17 @@ endif # sources only. sieve_libcyrus_sieve_lex_la_SOURCES = \ sieve/addr-lex.l \ - sieve/sieve-lex.l + sieve/sieve-lex.l \ + sieve/addr.y \ + sieve/sieve.y sieve_libcyrus_sieve_lex_la_LIBADD = -sieve_libcyrus_sieve_lex_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY) $(NOWARN_SIGN_COMPARE) +sieve_libcyrus_sieve_lex_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY) $(NOWARN_SIGN_COMPARE) $(NOWARN_UNUSED_BUT_SET) nodist_sieve_libcyrus_sieve_la_SOURCES = \ sieve/sieve_err.c \ sieve/sieve_err.h sieve_libcyrus_sieve_la_SOURCES = \ sieve/bytecode.h \ - sieve/addr.y \ sieve/bc_emit.c \ sieve/bc_eval.c \ sieve/bc_generate.c \ @@ -1852,7 +1853,6 @@ sieve_libcyrus_sieve_la_SOURCES = \ sieve/message.h \ sieve/script.c \ sieve/script.h \ - sieve/sieve.y \ sieve/tree.c \ sieve/tree.h \ sieve/variables.c \ diff --git a/configure.ac b/configure.ac index dc6f998983..7ddf497a65 100644 --- a/configure.ac +++ b/configure.ac @@ -873,6 +873,21 @@ AC_COMPILE_IFELSE( CFLAGS="$saved_CFLAGS" AC_SUBST([NOWARN_SIGN_COMPARE]) +dnl look for an option to disable sign-comparison warnings (needed for +dnl flex-generated sieve sources when building with -Werror) +saved_CFLAGS="$CFLAGS" +NOWARN_UNUSED_BUT_SET="-Wno-unused-but-set-variable" +CFLAGS="$NOWARN_UNUSED_BUT_SET" +AC_MSG_CHECKING([whether the C compiler supports -Wno-unused-but-set-variable]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([], [])], + [AC_MSG_RESULT([yes])], + [NOWARN_UNUSED_BUT_SET=] + [AC_MSG_RESULT([no])] +) +CFLAGS="$saved_CFLAGS" +AC_SUBST([NOWARN_UNUSED_BUT_SET]) + dnl for et routines AC_FUNC_CHECK(strerror,AC_DEFINE(HAS_STRERROR,[],[Do we have strerror()?]), AC_DEFINE(NEED_SYS_ERRLIST,[],[Do we have a sys_errlist?]))