Just add the @WERR_CFLAGS@ to all directories that need it, because libltdl gets
overwritten everytime libtool is upgraded.
| ... | ... |
@@ -40,12 +40,12 @@ clamav_milter_SOURCES = \ |
| 40 | 40 |
clamfi.h \ |
| 41 | 41 |
clamav-milter.c |
| 42 | 42 |
man_MANS = $(top_builddir)/docs/man/clamav-milter.8 |
| 43 |
+AM_CFLAGS=@WERR_CFLAGS_MILTER@ |
|
| 43 | 44 |
|
| 44 | 45 |
endif |
| 45 | 46 |
endif |
| 46 | 47 |
|
| 47 | 48 |
DEFS = @DEFS@ -DCL_NOLIBCLAMAV |
| 48 |
-CFLAGS=`echo "@CFLAGS@" | sed -e 's/-Wwrite-strings//' -e 's/-Werror /-Werror -Wno-error=format-nonliteral /'` |
|
| 49 | 49 |
LIBS = $(top_builddir)/libclamav/libclamav_internal_utils.la @CLAMAV_MILTER_LIBS@ @THREAD_LIBS@ |
| 50 | 50 |
AM_CPPFLAGS = -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_srcdir)/shared -I$(top_srcdir) |
| 51 | 51 |
CLEANFILES=*.gcda *.gcno |
| ... | ... |
@@ -8,6 +8,7 @@ clambc_SOURCES = \ |
| 8 | 8 |
$(top_srcdir)/shared/misc.h \ |
| 9 | 9 |
bcrun.c |
| 10 | 10 |
|
| 11 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 11 | 12 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav |
| 12 | 13 |
LIBS = $(top_builddir)/libclamav/libclamav.la @THREAD_LIBS@ |
| 13 | 14 |
CLEANFILES=*.gcda *.gcno |
| ... | ... |
@@ -27,6 +27,8 @@ clamconf_SOURCES = \ |
| 27 | 27 |
$(top_srcdir)/shared/misc.h \ |
| 28 | 28 |
clamconf.c |
| 29 | 29 |
|
| 30 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 31 |
+ |
|
| 30 | 32 |
DEFS = @DEFS@ -DCL_NOTHREADS |
| 31 | 33 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav\ |
| 32 | 34 |
-DBUILD_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILD_CFLAGS="\"$(CFLAGS)\""\ |
| ... | ... |
@@ -10,6 +10,7 @@ clamdtop_SOURCES = \ |
| 10 | 10 |
$(top_srcdir)/shared/misc.h \ |
| 11 | 11 |
clamdtop.c |
| 12 | 12 |
|
| 13 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 13 | 14 |
AM_CPPFLAGS = -I$(top_srcdir) @CURSES_CPPFLAGS@ |
| 14 | 15 |
clamdtop_LDADD = @CURSES_LIBS@ $(top_builddir)/libclamav/libclamav_internal_utils_nothreads.la |
| 15 | 16 |
endif |
| ... | ... |
@@ -35,6 +35,7 @@ clamscan_SOURCES = \ |
| 35 | 35 |
manager.c \ |
| 36 | 36 |
manager.h |
| 37 | 37 |
|
| 38 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 38 | 39 |
DEFS = @DEFS@ -DCL_NOTHREADS |
| 39 | 40 |
LIBS = $(top_builddir)/libclamav/libclamav.la @THREAD_LIBS@ |
| 40 | 41 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav |
| ... | ... |
@@ -1588,11 +1588,17 @@ AC_ARG_ENABLE([distcheck-werror], |
| 1588 | 1588 |
# Some configure tests fail (like checking for cos in -lm) if we enable these |
| 1589 | 1589 |
# Werror flags for configure too (for example -Wstrict-prototypes makes |
| 1590 | 1590 |
# configure think that -lm doesn't have cos, hence its in libc). |
| 1591 |
+WERR_CFLAGS= |
|
| 1592 |
+WERR_CFLAGS_MILTER= |
|
| 1591 | 1593 |
if test "x$enable_distcheckwerror" = "xyes"; then |
| 1592 | 1594 |
if test "$distcheck_enable_flags" = "1"; then |
| 1593 |
- CFLAGS="$CFLAGS -Wno-pointer-sign -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wno-error=bad-function-cast -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wno-error=type-limits -Wno-error=unused-function -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=aggregate-return" |
|
| 1595 |
+ WERR_COMMON="-Wno-pointer-sign -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wno-error=bad-function-cast -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wno-error=type-limits -Wno-error=unused-function -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=aggregate-return" |
|
| 1596 |
+ WERR_CFLAGS="$WERR_COMMON -Wwrite-strings" |
|
| 1597 |
+ WERR_CFLAGS_MILTER="$WERR_COMMON -Wno-error=format-nonliteral" |
|
| 1594 | 1598 |
fi |
| 1595 | 1599 |
fi |
| 1600 |
+AC_SUBST([WERR_CFLAGS]) |
|
| 1601 |
+AC_SUBST([WERR_CFLAGS_MILTER]) |
|
| 1596 | 1602 |
|
| 1597 | 1603 |
AC_ARG_ENABLE([llvm],AC_HELP_STRING([--enable-llvm], |
| 1598 | 1604 |
[Enable 'llvm' JIT/verifier support @<:@default=auto@:>@]), |
| ... | ... |
@@ -48,6 +48,7 @@ freshclam_SOURCES = \ |
| 48 | 48 |
mirman.c \ |
| 49 | 49 |
mirman.h |
| 50 | 50 |
|
| 51 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 51 | 52 |
DEFS = @DEFS@ -DCL_NOTHREADS |
| 52 | 53 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav |
| 53 | 54 |
LIBS = $(top_builddir)/libclamav/libclamav.la @FRESHCLAM_LIBS@ @THREAD_LIBS@ |
| ... | ... |
@@ -17,6 +17,7 @@ |
| 17 | 17 |
# MA 02110-1301, USA. |
| 18 | 18 |
|
| 19 | 19 |
AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis $(LTDLINCL) |
| 20 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 20 | 21 |
lib_LTLIBRARIES = |
| 21 | 22 |
EXTRA_DIST = c++/Makefile.nollvm.in |
| 22 | 23 |
if ENABLE_UNRAR |
| ... | ... |
@@ -88,7 +89,7 @@ libclamav_internal_utils_la_SOURCES=str.c\ |
| 88 | 88 |
regex/utils.h |
| 89 | 89 |
|
| 90 | 90 |
libclamav_internal_utils_la_LDFLAGS=-static |
| 91 |
-libclamav_internal_utils_la_CFLAGS= -fPIC -DPIC |
|
| 91 |
+libclamav_internal_utils_la_CFLAGS=$(AM_CFLAGS) -fPIC -DPIC |
|
| 92 | 92 |
|
| 93 | 93 |
libclamav_internal_utils_nothreads_la_SOURCES=str.c\ |
| 94 | 94 |
str.h\ |
| ... | ... |
@@ -109,7 +110,7 @@ libclamav_internal_utils_nothreads_la_SOURCES=str.c\ |
| 109 | 109 |
regex/utils.h |
| 110 | 110 |
|
| 111 | 111 |
libclamav_internal_utils_nothreads_la_LDFLAGS=-static |
| 112 |
-libclamav_internal_utils_nothreads_la_CFLAGS=-DCL_NOTHREADS |
|
| 112 |
+libclamav_internal_utils_nothreads_la_CFLAGS=$(AM_CFLAGS) -DCL_NOTHREADS |
|
| 113 | 113 |
|
| 114 | 114 |
if ENABLE_LLVM |
| 115 | 115 |
LLVMLIBADD=c++/libclamavcxx.la -lstdc++ -lm |
| ... | ... |
@@ -127,7 +128,7 @@ libclamav_nocxx_la_SOURCES = bytecode_nojit.c |
| 127 | 127 |
|
| 128 | 128 |
libclamav_la_LIBADD = @LIBLTDL@ $(IFACELIBADD) $(LLVMLIBADD) libclamav_internal_utils.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@ @LIBM@ |
| 129 | 129 |
libclamav_la_DEPENDENCIES = @LTDLDEPS@ $(IFACEDEP) $(LLVMDEP) libclamav_internal_utils.la |
| 130 |
-libclamav_la_CFLAGS = -DSEARCH_LIBDIR=\"$(libdir)\" |
|
| 130 |
+libclamav_la_CFLAGS =$(AM_CFLAGS) -DSEARCH_LIBDIR=\"$(libdir)\" |
|
| 131 | 131 |
libclamav_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined |
| 132 | 132 |
|
| 133 | 133 |
if VERSIONSCRIPT |
| ... | ... |
@@ -35,6 +35,7 @@ sigtool_SOURCES = \ |
| 35 | 35 |
vba.h \ |
| 36 | 36 |
sigtool.c |
| 37 | 37 |
|
| 38 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 38 | 39 |
DEFS = @DEFS@ -DCL_NOTHREADS |
| 39 | 40 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav |
| 40 | 41 |
LIBS = $(top_builddir)/libclamav/libclamav.la @FRESHCLAM_LIBS@ @THREAD_LIBS@ |
| ... | ... |
@@ -27,6 +27,7 @@ TESTS = $(programs) $(scripts) |
| 27 | 27 |
check_PROGRAMS = $(programs) check_clamd |
| 28 | 28 |
check_SCRIPTS = $(scripts) |
| 29 | 29 |
|
| 30 |
+AM_CFLAGS=@WERR_CFLAGS@ |
|
| 30 | 31 |
if HAVE_LIBCHECK |
| 31 | 32 |
check_clamav_SOURCES = check_clamav.c checks.h checks_common.h $(top_builddir)/libclamav/clamav.h\ |
| 32 | 33 |
check_jsnorm.c check_str.c check_regex.c\ |