[libnetfilter_log PATCH 4/9] build: move dependency CFLAGS variables out of `AM_CPPFLAGS`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



`${LIBNFNETLINK_CFLAGS}` and `${LIBMNL_CFLAGS}` are not required for all
libraries and executables: include them only where necessary.

Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx>
---
 Make_global.am    |  2 +-
 src/Makefile.am   | 18 ++++++++++--------
 utils/Makefile.am | 11 ++++++-----
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/Make_global.am b/Make_global.am
index 9bc8ea1d7f67..4d5bec913af2 100644
--- a/Make_global.am
+++ b/Make_global.am
@@ -1,2 +1,2 @@
-AM_CPPFLAGS = -I${top_srcdir}/include ${LIBNFNETLINK_CFLAGS} ${LIBMNL_CFLAGS}
+AM_CPPFLAGS = -I${top_srcdir}/include
 AM_CFLAGS = -Wall
diff --git a/src/Makefile.am b/src/Makefile.am
index 815d9d31cfc0..203ca0c3cdc6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,16 +25,18 @@ include ${top_srcdir}/Make_global.am
 
 lib_LTLIBRARIES = libnetfilter_log.la
 
-libnetfilter_log_la_LDFLAGS = -Wc,-nostartfiles \
-			      -version-info $(LIBVERSION)
-libnetfilter_log_la_SOURCES = libnetfilter_log.c nlmsg.c
-libnetfilter_log_la_LIBADD  = ${LIBNFNETLINK_LIBS} ${LIBMNL_LIBS}
+libnetfilter_log_la_CPPFLAGS = ${AM_CPPFLAGS} ${LIBNFNETLINK_CFLAGS} ${LIBMNL_CFLAGS}
+libnetfilter_log_la_LDFLAGS  = -Wc,-nostartfiles \
+			       -version-info $(LIBVERSION)
+libnetfilter_log_la_SOURCES  = libnetfilter_log.c nlmsg.c
+libnetfilter_log_la_LIBADD   = ${LIBNFNETLINK_LIBS} ${LIBMNL_LIBS}
 
 if BUILD_IPULOG
 lib_LTLIBRARIES += libnetfilter_log_libipulog.la
 
-libnetfilter_log_libipulog_la_LDFLAGS = -Wc,-nostartfiles \
-					-version-info $(IPULOG_LIBVERSION)
-libnetfilter_log_libipulog_la_LIBADD  = libnetfilter_log.la ${LIBNFNETLINK_LIBS}
-libnetfilter_log_libipulog_la_SOURCES = libipulog_compat.c
+libnetfilter_log_libipulog_la_CPPFLAGS = ${AM_CPPFLAGS} ${LIBNFNETLINK_CFLAGS}
+libnetfilter_log_libipulog_la_LDFLAGS  = -Wc,-nostartfiles \
+					 -version-info $(IPULOG_LIBVERSION)
+libnetfilter_log_libipulog_la_LIBADD   = libnetfilter_log.la ${LIBNFNETLINK_LIBS}
+libnetfilter_log_libipulog_la_SOURCES  = libipulog_compat.c
 endif
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 39abb3e00af9..133b6ec550cf 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -6,12 +6,13 @@ nfulnl_test_SOURCES = nfulnl_test.c
 nfulnl_test_LDADD = ../src/libnetfilter_log.la
 nfulnl_test_LDFLAGS = -dynamic
 
-nf_log_SOURCES = nf-log.c
-nf_log_LDADD   = ../src/libnetfilter_log.la $(LIBMNL_LIBS)
-nf_log_LDFLAGS = -dynamic
+nf_log_SOURCES  = nf-log.c
+nf_log_LDADD    = ../src/libnetfilter_log.la $(LIBMNL_LIBS)
+nf_log_LDFLAGS  = -dynamic
+nf_log_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMNL_CFLAGS)
 if BUILD_NFCT
-nf_log_LDADD += $(LIBNETFILTER_CONNTRACK_LIBS)
-nf_log_CPPFLAGS = ${AM_CPPFLAGS} ${LIBNETFILTER_CONNTRACK_CFLAGS} -DBUILD_NFCT
+nf_log_LDADD    += $(LIBNETFILTER_CONNTRACK_LIBS)
+nf_log_CPPFLAGS += $(LIBNETFILTER_CONNTRACK_CFLAGS) -DBUILD_NFCT
 endif
 
 if BUILD_IPULOG
-- 
2.33.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux