[ulogd2 PATCH v2 06/12] build: add Make_global.am for common flags and include it where necessary

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

 



Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx>
---
 Make_global.am                |  2 ++
 Makefile.am                   |  7 ++-----
 configure.ac                  |  3 ---
 filter/Makefile.am            |  5 +++--
 filter/raw2packet/Makefile.am |  4 +---
 include/libipulog/Makefile.am |  1 -
 include/ulogd/Makefile.am     |  1 -
 input/Makefile.am             |  1 -
 input/flow/Makefile.am        |  4 ++--
 input/packet/Makefile.am      |  4 ++--
 input/sum/Makefile.am         |  6 ++++--
 libipulog/Makefile.am         |  4 +---
 output/Makefile.am            | 10 ++++++----
 output/dbi/Makefile.am        |  4 ++--
 output/ipfix/Makefile.am      |  3 +--
 output/mysql/Makefile.am      |  5 +++--
 output/pcap/Makefile.am       |  4 +---
 output/pgsql/Makefile.am      |  4 ++--
 output/sqlite3/Makefile.am    |  5 +++--
 src/Makefile.am               |  9 ++++-----
 20 files changed, 39 insertions(+), 47 deletions(-)
 create mode 100644 Make_global.am

diff --git a/Make_global.am b/Make_global.am
new file mode 100644
index 000000000000..4ce896d06d70
--- /dev/null
+++ b/Make_global.am
@@ -0,0 +1,2 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CFLAGS   = -Wall -Wextra -Wno-unused-parameter
diff --git a/Makefile.am b/Makefile.am
index 5600f8c6f552..838d6ec29156 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,13 +1,11 @@
+ACLOCAL_AMFLAGS = -I m4
 
-ACLOCAL_AMFLAGS  = -I m4
+SUBDIRS = include libipulog src input filter output
 
 man_MANS = ulogd.8
 
 EXTRA_DIST = $(man_MANS) ulogd.conf.in doc
 
-AM_CPPFLAGS = -I$(top_srcdir)/include
-SUBDIRS = include libipulog src input filter output
-
 noinst_DATA = ulogd.conf
 
 edit = sed \
@@ -18,4 +16,3 @@ ulogd.conf: Makefile $(srcdir)/ulogd.conf.in
 
 dist-hook:
 	rm -f ulogd.conf
-
diff --git a/configure.ac b/configure.ac
index 1d795bad325d..f7d6b50c47f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,9 +157,6 @@ AC_ARG_WITH([ulogd2libdir],
         [ulogd2libdir="${libdir}/ulogd"])
 AC_SUBST([ulogd2libdir])
 
-regular_CFLAGS="-Wall -Wextra -Wno-unused-parameter";
-AC_SUBST([regular_CFLAGS])
-
 dnl AC_SUBST(DATABASE_DIR)
 dnl AC_SUBST(DATABASE_LIB)
 dnl AC_SUBST(DATABASE_LIB_DIR)
diff --git a/filter/Makefile.am b/filter/Makefile.am
index c2755ecb7c49..f1d2c81f48d4 100644
--- a/filter/Makefile.am
+++ b/filter/Makefile.am
@@ -1,7 +1,8 @@
 SUBDIRS = raw2packet
 
-AM_CPPFLAGS = -I$(top_srcdir)/include ${LIBNFNETLINK_CFLAGS}
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
+
+AM_CPPFLAGS += ${LIBNFNETLINK_CFLAGS}
 
 pkglib_LTLIBRARIES = ulogd_filter_IFINDEX.la ulogd_filter_PWSNIFF.la \
 			 ulogd_filter_PRINTPKT.la ulogd_filter_PRINTFLOW.la \
diff --git a/filter/raw2packet/Makefile.am b/filter/raw2packet/Makefile.am
index 7498f9aa3c55..90768ef6ca0e 100644
--- a/filter/raw2packet/Makefile.am
+++ b/filter/raw2packet/Makefile.am
@@ -1,6 +1,4 @@
-
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
 
 pkglib_LTLIBRARIES = ulogd_raw2packet_BASE.la
 
diff --git a/include/libipulog/Makefile.am b/include/libipulog/Makefile.am
index a98f941a781d..80d16b1b22a0 100644
--- a/include/libipulog/Makefile.am
+++ b/include/libipulog/Makefile.am
@@ -1,2 +1 @@
-
 noinst_HEADERS = libipulog.h
diff --git a/include/ulogd/Makefile.am b/include/ulogd/Makefile.am
index 5e6aa75606f9..e4b41c4f3d19 100644
--- a/include/ulogd/Makefile.am
+++ b/include/ulogd/Makefile.am
@@ -1,2 +1 @@
-
 noinst_HEADERS = conffile.h db.h ipfix_protocol.h linuxlist.h ulogd.h printpkt.h printflow.h common.h linux_rbtree.h timer.h slist.h hash.h jhash.h addr.h
diff --git a/input/Makefile.am b/input/Makefile.am
index 5ffef1b4e711..8f2e934fcdfa 100644
--- a/input/Makefile.am
+++ b/input/Makefile.am
@@ -1,2 +1 @@
-
 SUBDIRS = packet flow sum
diff --git a/input/flow/Makefile.am b/input/flow/Makefile.am
index 0e07a7dc1ccc..004e532981a4 100644
--- a/input/flow/Makefile.am
+++ b/input/flow/Makefile.am
@@ -1,6 +1,6 @@
+include $(top_srcdir)/Make_global.am
 
-AM_CPPFLAGS = -I$(top_srcdir)/include ${LIBNETFILTER_CONNTRACK_CFLAGS}
-AM_CFLAGS = ${regular_CFLAGS}
+AM_CPPFLAGS += ${LIBNETFILTER_CONNTRACK_CFLAGS}
 
 if BUILD_NFCT
 pkglib_LTLIBRARIES = ulogd_inpflow_NFCT.la # ulogd_inpflow_IPFIX.la
diff --git a/input/packet/Makefile.am b/input/packet/Makefile.am
index 1c3151d52f13..daf374a65917 100644
--- a/input/packet/Makefile.am
+++ b/input/packet/Makefile.am
@@ -1,6 +1,6 @@
+include $(top_srcdir)/Make_global.am
 
-AM_CPPFLAGS = -I$(top_srcdir)/include ${LIBNETFILTER_LOG_CFLAGS}
-AM_CFLAGS = ${regular_CFLAGS}
+AM_CPPFLAGS += ${LIBNETFILTER_LOG_CFLAGS}
 
 pkglib_LTLIBRARIES = ulogd_inppkt_UNIXSOCK.la
 
diff --git a/input/sum/Makefile.am b/input/sum/Makefile.am
index b6ddb4d29b93..e0c42f7de376 100644
--- a/input/sum/Makefile.am
+++ b/input/sum/Makefile.am
@@ -1,5 +1,7 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include $(LIBNETFILTER_ACCT_CFLAGS) $(LIBMNL_CFLAGS)
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
+
+AM_CPPFLAGS += $(LIBNETFILTER_ACCT_CFLAGS) $(LIBMNL_CFLAGS)
+
 if BUILD_NFACCT
 pkglib_LTLIBRARIES = ulogd_inpflow_NFACCT.la
 ulogd_inpflow_NFACCT_la_SOURCES = ulogd_inpflow_NFACCT.c
diff --git a/libipulog/Makefile.am b/libipulog/Makefile.am
index 111cd4889ed6..708975a5fb99 100644
--- a/libipulog/Makefile.am
+++ b/libipulog/Makefile.am
@@ -1,6 +1,4 @@
-
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
 
 noinst_LTLIBRARIES = libipulog.la
 
diff --git a/output/Makefile.am b/output/Makefile.am
index 7ba821764afe..2b7d12b12be3 100644
--- a/output/Makefile.am
+++ b/output/Makefile.am
@@ -1,9 +1,11 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include ${LIBNETFILTER_ACCT_CFLAGS} \
-              ${LIBNETFILTER_CONNTRACK_CFLAGS} ${LIBNETFILTER_LOG_CFLAGS}
-AM_CFLAGS = ${regular_CFLAGS}
-
 SUBDIRS= pcap mysql pgsql sqlite3 dbi ipfix
 
+include $(top_srcdir)/Make_global.am
+
+AM_CPPFLAGS += ${LIBNETFILTER_ACCT_CFLAGS} \
+	       ${LIBNETFILTER_CONNTRACK_CFLAGS} \
+	       ${LIBNETFILTER_LOG_CFLAGS}
+
 pkglib_LTLIBRARIES = ulogd_output_LOGEMU.la ulogd_output_SYSLOG.la \
 			 ulogd_output_OPRINT.la ulogd_output_GPRINT.la \
 			 ulogd_output_NACCT.la ulogd_output_XML.la \
diff --git a/output/dbi/Makefile.am b/output/dbi/Makefile.am
index f413cab4a340..38db0a26fd84 100644
--- a/output/dbi/Makefile.am
+++ b/output/dbi/Makefile.am
@@ -1,6 +1,6 @@
+include $(top_srcdir)/Make_global.am
 
-AM_CPPFLAGS = -I$(top_srcdir)/include $(DBI_INC)
-AM_CFLAGS = ${regular_CFLAGS}
+AM_CPPFLAGS += $(DBI_INC)
 
 if HAVE_DBI
 
diff --git a/output/ipfix/Makefile.am b/output/ipfix/Makefile.am
index cacda265c1f5..7354f6be6d51 100644
--- a/output/ipfix/Makefile.am
+++ b/output/ipfix/Makefile.am
@@ -1,5 +1,4 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CFLAGS = $(regular_CFLAGS)
+include $(top_srcdir)/Make_global.am
 
 pkglib_LTLIBRARIES = ulogd_output_IPFIX.la
 
diff --git a/output/mysql/Makefile.am b/output/mysql/Makefile.am
index c24208c3e302..3839a135c926 100644
--- a/output/mysql/Makefile.am
+++ b/output/mysql/Makefile.am
@@ -1,5 +1,6 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include $(MYSQL_INC)
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
+
+AM_CPPFLAGS += $(MYSQL_INC)
 
 if HAVE_MYSQL
 
diff --git a/output/pcap/Makefile.am b/output/pcap/Makefile.am
index c1723a642a63..a022bf0cc15c 100644
--- a/output/pcap/Makefile.am
+++ b/output/pcap/Makefile.am
@@ -1,6 +1,4 @@
-
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
 
 if HAVE_PCAP
 
diff --git a/output/pgsql/Makefile.am b/output/pgsql/Makefile.am
index bdaf1d249dce..fbc0d04c9f11 100644
--- a/output/pgsql/Makefile.am
+++ b/output/pgsql/Makefile.am
@@ -1,6 +1,6 @@
+include $(top_srcdir)/Make_global.am
 
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(PQINCPATH)
-AM_CFLAGS = ${regular_CFLAGS}
+AM_CPPFLAGS += -I$(PQINCPATH)
 
 if HAVE_PGSQL
 
diff --git a/output/sqlite3/Makefile.am b/output/sqlite3/Makefile.am
index 62af267c4108..e00e1d6cf11c 100644
--- a/output/sqlite3/Makefile.am
+++ b/output/sqlite3/Makefile.am
@@ -1,5 +1,6 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include ${libsqlite3_CFLAGS}
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
+
+AM_CPPFLAGS += ${libsqlite3_CFLAGS}
 
 if HAVE_SQLITE3
 
diff --git a/src/Makefile.am b/src/Makefile.am
index e1d45aee4b6c..7a12a72da9a3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,8 @@
+include $(top_srcdir)/Make_global.am
 
-AM_CPPFLAGS = -I$(top_srcdir)/include \
-	      -DULOGD_CONFIGFILE='"$(sysconfdir)/ulogd.conf"' \
-	      -DULOGD_LOGFILE_DEFAULT='"$(localstatedir)/log/ulogd.log"' \
-	      -DULOGD2_LIBDIR='"$(ulogd2libdir)"'
-AM_CFLAGS = ${regular_CFLAGS}
+AM_CPPFLAGS += -DULOGD_CONFIGFILE='"$(sysconfdir)/ulogd.conf"' \
+	       -DULOGD_LOGFILE_DEFAULT='"$(localstatedir)/log/ulogd.log"' \
+	       -DULOGD2_LIBDIR='"$(ulogd2libdir)"'
 
 sbin_PROGRAMS = ulogd
 
-- 
2.33.0




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

  Powered by Linux