From: Jeremy Sowden <jeremy@azazel.net>
To: Netfilter Devel <netfilter-devel@vger.kernel.org>
Subject: [ulogd2 PATCH 06/13] build: add Make_global.am for common flags and include it where necessary
Date: Sat, 30 Oct 2021 17:01:34 +0100 [thread overview]
Message-ID: <20211030160141.1132819-7-jeremy@azazel.net> (raw)
In-Reply-To: <20211030160141.1132819-1-jeremy@azazel.net>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
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
next prev parent reply other threads:[~2021-10-30 16:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-30 16:01 [ulogd2 PATCH 00/13] Build Improvements Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 01/13] gitignore: Add Emacs artefacts Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 02/13] gitignore: ignore util/.dirstamp Jeremy Sowden
2021-10-30 17:05 ` Jan Engelhardt
2021-11-06 11:06 ` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 03/13] build: remove unused Makefile fragment Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 04/13] build: remove empty filter sub-directory Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 05/13] build: move cpp flag to the only Makefile.am file where it's needed Jeremy Sowden
2021-10-30 16:01 ` Jeremy Sowden [this message]
2021-10-30 16:01 ` [ulogd2 PATCH 07/13] build: use `dist_man_MANS` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 08/13] build: only conditionally enter sub-directories containing optional code Jeremy Sowden
2021-10-30 17:15 ` Jan Engelhardt
2021-11-06 11:06 ` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 09/13] build: move library dependencies from LDFLAGS to LIBADD Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 10/13] build: update obsolete autoconf macros Jeremy Sowden
2021-10-30 17:16 ` Jan Engelhardt
2021-11-06 11:07 ` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 11/13] build: quote and reformat some autoconf macro arguments Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 12/13] build: reformat autoconf AC_ARG_WITH, AC_ARG_ENABLE and related macros Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 13/13] build: bump autoconf version to 2.71 Jeremy Sowden
2021-10-30 17:21 ` Jan Engelhardt
2021-11-06 11:07 ` Jeremy Sowden
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211030160141.1132819-7-jeremy@azazel.net \
--to=jeremy@azazel.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).