All of lore.kernel.org
 help / color / mirror / Atom feed
* [ulogd2 PATCH v3 00/16] Build Improvements
@ 2021-11-14 14:00 Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 01/16] gitignore: add Emacs artefacts Jeremy Sowden
                   ` (15 more replies)
  0 siblings, 16 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

Some tidying and autotools updates and fixes.

Changes since v2:

  * more detailed commit-messages for most patches;
  * a number of the patches have been broken up or restructured
    for easier review;
  * patch 14, which removes a number of `AC_SUBST` calls, is new.

Changes since v1:

  * ignore `.dirstamp` anywhere;
  * fix `--disable-static`;
  * drop `AC_PREREQ` bump.

Jeremy Sowden (16):
  gitignore: add Emacs artefacts
  gitignore: ignore .dirstamp
  build: remove unused Makefile fragment
  build: remove empty filter sub-directory
  build: move CPP `-D` flag.
  build: add Make_global.am for common flags
  build: use `dist_man_MANS` to declare man-pages
  build: skip sub-directories containing disabled plugins
  build: group `*_la_*` variables with their libraries
  build: delete commented-out code
  build: use correct automake variable for library dependencies
  build: update obsolete autoconf macros
  build: remove commented-out code
  build: remove unnecessary `AC_SUBST` calls
  build: quote autoconf macro arguments
  build: use `AS_IF` consistently in configure.ac

 .gitignore                     |   5 +-
 Make_global.am                 |   2 +
 Makefile.am                    |  11 +-
 Rules.make.in                  |  43 ------
 acinclude.m4                   |  13 --
 configure.ac                   | 241 ++++++++++++++-------------------
 filter/Makefile.am             |   7 +-
 filter/packet2flow/Makefile.am |   0
 filter/raw2packet/Makefile.am  |   4 +-
 include/libipulog/Makefile.am  |   1 -
 include/ulogd/Makefile.am      |   1 -
 input/Makefile.am              |   9 +-
 input/flow/Makefile.am         |  14 +-
 input/packet/Makefile.am       |  23 ++--
 input/sum/Makefile.am          |   9 +-
 libipulog/Makefile.am          |   4 +-
 output/Makefile.am             |  35 ++++-
 output/dbi/Makefile.am         |   8 +-
 output/ipfix/Makefile.am       |   3 +-
 output/mysql/Makefile.am       |   7 +-
 output/pcap/Makefile.am        |   8 +-
 output/pgsql/Makefile.am       |   8 +-
 output/sqlite3/Makefile.am     |   7 +-
 src/Makefile.am                |   8 +-
 24 files changed, 194 insertions(+), 277 deletions(-)
 create mode 100644 Make_global.am
 delete mode 100644 Rules.make.in
 delete mode 100644 filter/packet2flow/Makefile.am

-- 
2.33.0


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 01/16] gitignore: add Emacs artefacts
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 02/16] gitignore: ignore .dirstamp Jeremy Sowden
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .gitignore | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.gitignore b/.gitignore
index 0ff56cfe0423..3f218218dfc9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+*~
+.\#*
+\#*\#
 # global
 *.la
 *.lo
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 02/16] gitignore: ignore .dirstamp
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 01/16] gitignore: add Emacs artefacts Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 03/16] build: remove unused Makefile fragment Jeremy Sowden
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

It's created by automake while making sure that build directories (utils/
and utils/.deps/, in this case) exist if the `subdir-objects` option is
enabled.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 3f218218dfc9..3eb592245c0d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
 *.lo
 *.o
 .deps/
+.dirstamp
 .libs/
 Makefile
 Makefile.in
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 03/16] build: remove unused Makefile fragment
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 01/16] gitignore: add Emacs artefacts Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 02/16] gitignore: ignore .dirstamp Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 04/16] build: remove empty filter sub-directory Jeremy Sowden
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

Rules.make.in contains a number of variables defined by configure.  It
is left-over from the pre-Automake build-system, in which it used to
fill a similar role to Make_global.am.  It is no longer used anywhere.
Remove it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 .gitignore    |  1 -
 Rules.make.in | 43 -------------------------------------------
 configure.ac  |  2 +-
 3 files changed, 1 insertion(+), 45 deletions(-)
 delete mode 100644 Rules.make.in

diff --git a/.gitignore b/.gitignore
index 3eb592245c0d..5c06684db5fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,6 @@ Makefile
 Makefile.in
 
 # this dir
-/Rules.make
 /ulogd.conf
 
 # build system
diff --git a/Rules.make.in b/Rules.make.in
deleted file mode 100644
index 21b05d9ca6ff..000000000000
--- a/Rules.make.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-
-PREFIX=@prefix@
-exec_prefix=@exec_prefix@
-ETCDIR=@sysconfdir@
-BINDIR=@sbindir@
-
-ULOGD_CONFIGFILE=@sysconfdir@/ulogd.conf
-
-ULOGD_LIB_PATH=@libdir@/ulogd
-
-# Path of libipulog (from iptables)
-LIBIPULOG=@top_srcdir@/libipulog
-INCIPULOG=-I@top_srcdir@/libipulog/include
-INCCONFFILE=-I@top_srcdir@/conffile
-
-CC=@CC@
-LD=@LD@
-INSTALL=@INSTALL@
-
-CFLAGS=@CFLAGS@ @CPPFLAGS@ -Wall
-CFLAGS+=-DULOGD_CONFIGFILE=\"$(ULOGD_CONFIGFILE)\"
-# doesn't work for subdirs
-#CFLAGS+=$(INCIPULOG) $(INCCONFFILE)
-CFLAGS+=-I/lib/modules/`uname -r`/build/include
-#CFLAGS+=@DEFS@
-#CFLAGS+=-g -DDEBUG -DDEBUG_MYSQL -DDEBUG_PGSQL
-
-LIBS=@LIBS@
-
-
-# Names of the plugins to be compiled
-ULOGD_SL:=BASE OPRINT PWSNIFF LOGEMU LOCAL SYSLOG
-
-# mysql output support
-#ULOGD_SL+=MYSQL
-MYSQL_CFLAGS=-I@MYSQLINCLUDES@ @EXTRA_MYSQL_DEF@
-MYSQL_LDFLAGS=@DATABASE_LIB_DIR@ @MYSQL_LIB@
-
-# postgreSQL output support
-#ULOGD_SL+=PGSQL
-PGSQL_CFLAGS=-I@PGSQLINCLUDES@ @EXTRA_PGSQL_DEF@
-PGSQL_LDFLAGS=@DATABASE_LIB_DIR@ @PGSQL_LIB@
diff --git a/configure.ac b/configure.ac
index 48b4995f148c..e341ad12a159 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,7 +180,7 @@ AC_CONFIG_FILES(include/Makefile include/ulogd/Makefile include/libipulog/Makefi
 	  filter/Makefile filter/raw2packet/Makefile filter/packet2flow/Makefile \
 	  output/Makefile output/pcap/Makefile output/mysql/Makefile output/pgsql/Makefile output/sqlite3/Makefile \
 	  output/dbi/Makefile output/ipfix/Makefile \
-	  src/Makefile Makefile Rules.make)
+	  src/Makefile Makefile)
 AC_OUTPUT
 
 define([EXPAND_VARIABLE],
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 04/16] build: remove empty filter sub-directory
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (2 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 03/16] build: remove unused Makefile fragment Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 05/16] build: move CPP `-D` flag Jeremy Sowden
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

The only file in filter/packet2flow is an empty Makefile.am.  Remove it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 configure.ac                   | 2 +-
 filter/Makefile.am             | 2 +-
 filter/packet2flow/Makefile.am | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 delete mode 100644 filter/packet2flow/Makefile.am

diff --git a/configure.ac b/configure.ac
index e341ad12a159..4e502171292e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,7 +177,7 @@ AC_CONFIG_FILES(include/Makefile include/ulogd/Makefile include/libipulog/Makefi
 	  include/linux/netfilter_ipv4/Makefile libipulog/Makefile \
 	  input/Makefile input/packet/Makefile input/flow/Makefile \
 	  input/sum/Makefile \
-	  filter/Makefile filter/raw2packet/Makefile filter/packet2flow/Makefile \
+	  filter/Makefile filter/raw2packet/Makefile \
 	  output/Makefile output/pcap/Makefile output/mysql/Makefile output/pgsql/Makefile output/sqlite3/Makefile \
 	  output/dbi/Makefile output/ipfix/Makefile \
 	  src/Makefile Makefile)
diff --git a/filter/Makefile.am b/filter/Makefile.am
index 875850b8ae90..c2755ecb7c49 100644
--- a/filter/Makefile.am
+++ b/filter/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = raw2packet packet2flow
+SUBDIRS = raw2packet
 
 AM_CPPFLAGS = -I$(top_srcdir)/include ${LIBNFNETLINK_CFLAGS}
 AM_CFLAGS = ${regular_CFLAGS}
diff --git a/filter/packet2flow/Makefile.am b/filter/packet2flow/Makefile.am
deleted file mode 100644
index e69de29bb2d1..000000000000
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 05/16] build: move CPP `-D` flag.
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (3 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 04/16] build: remove empty filter sub-directory Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 06/16] build: add Make_global.am for common flags Jeremy Sowden
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

The `ULOGD2_LIBDIR` macro is only used in one place, so move the flag
defining it out of the common `regular_CFLAGS` variable to the
`AM_CPPFLAGS` variable in the Makefile where it is needed.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 configure.ac    | 2 +-
 src/Makefile.am | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4e502171292e..1d795bad325d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,7 +157,7 @@ AC_ARG_WITH([ulogd2libdir],
         [ulogd2libdir="${libdir}/ulogd"])
 AC_SUBST([ulogd2libdir])
 
-regular_CFLAGS="-Wall -Wextra -Wno-unused-parameter -DULOGD2_LIBDIR=\\\"\${ulogd2libdir}\\\"";
+regular_CFLAGS="-Wall -Wextra -Wno-unused-parameter";
 AC_SUBST([regular_CFLAGS])
 
 dnl AC_SUBST(DATABASE_DIR)
diff --git a/src/Makefile.am b/src/Makefile.am
index 998e776a8079..e1d45aee4b6c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,8 @@
 
 AM_CPPFLAGS = -I$(top_srcdir)/include \
-	      -DULOGD_CONFIGFILE="\"$(sysconfdir)/ulogd.conf\"" \
-	      -DULOGD_LOGFILE_DEFAULT="\"$(localstatedir)/log/ulogd.log\""
+	      -DULOGD_CONFIGFILE='"$(sysconfdir)/ulogd.conf"' \
+	      -DULOGD_LOGFILE_DEFAULT='"$(localstatedir)/log/ulogd.log"' \
+	      -DULOGD2_LIBDIR='"$(ulogd2libdir)"'
 AM_CFLAGS = ${regular_CFLAGS}
 
 sbin_PROGRAMS = ulogd
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 06/16] build: add Make_global.am for common flags
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (4 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 05/16] build: move CPP `-D` flag Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 07/16] build: use `dist_man_MANS` to declare man-pages Jeremy Sowden
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

Move `${regular_CFLAGS}` from configure.ac to Make_global.am, renaming
it to `AM_CFLAGS`.  Add `AM_CPPFGLAGS` to include
`$(top_srcdir)/include`.  Include the new file in the Makefiles that
require it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 Make_global.am                | 2 ++
 Makefile.am                   | 1 -
 configure.ac                  | 3 ---
 filter/Makefile.am            | 5 +++--
 filter/raw2packet/Makefile.am | 4 +---
 input/flow/Makefile.am        | 4 ++--
 input/packet/Makefile.am      | 4 ++--
 input/sum/Makefile.am         | 6 ++++--
 libipulog/Makefile.am         | 4 +---
 output/Makefile.am            | 8 +++++---
 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 ++++-----
 17 files changed, 36 insertions(+), 39 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..0e5721472cb2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,6 @@ 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
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/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..879c317d03ff 100644
--- a/output/Makefile.am
+++ b/output/Makefile.am
@@ -1,6 +1,8 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include ${LIBNETFILTER_ACCT_CFLAGS} \
-              ${LIBNETFILTER_CONNTRACK_CFLAGS} ${LIBNETFILTER_LOG_CFLAGS}
-AM_CFLAGS = ${regular_CFLAGS}
+include $(top_srcdir)/Make_global.am
+
+AM_CPPFLAGS += ${LIBNETFILTER_ACCT_CFLAGS} \
+	       ${LIBNETFILTER_CONNTRACK_CFLAGS} \
+	       ${LIBNETFILTER_LOG_CFLAGS}
 
 SUBDIRS= pcap mysql pgsql sqlite3 dbi ipfix
 
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


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 07/16] build: use `dist_man_MANS` to declare man-pages
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (5 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 06/16] build: add Make_global.am for common flags Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 08/16] build: skip sub-directories containing disabled plugins Jeremy Sowden
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

By using `dist_man_MANS`, instead of `man_MANS`, we no longer need to
include the man-pages in `EXTRA_DIST`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 0e5721472cb2..7ea5db55a2cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,9 @@
 
 ACLOCAL_AMFLAGS  = -I m4
 
-man_MANS = ulogd.8
+dist_man_MANS = ulogd.8
 
-EXTRA_DIST = $(man_MANS) ulogd.conf.in doc
+EXTRA_DIST = ulogd.conf.in doc
 
 SUBDIRS = include libipulog src input filter output
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 08/16] build: skip sub-directories containing disabled plugins
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (6 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 07/16] build: use `dist_man_MANS` to declare man-pages Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 09/16] build: group `*_la_*` variables with their libraries Jeremy Sowden
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

Currently, make enters all sub-directories containing source-code, even
if they only contain optional targets which are not configured to be
built.  Instead, change the Makefiles so that the sub-directories are
optional, rather than the targets.

Group sub-directory definitions consistently at the top of the Makefiles
that contain them.

Trim a few leading and trailing blank lines.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 Makefile.am                   |  6 ++----
 include/libipulog/Makefile.am |  1 -
 include/ulogd/Makefile.am     |  1 -
 input/Makefile.am             |  9 ++++++++-
 input/flow/Makefile.am        |  2 --
 input/sum/Makefile.am         |  3 +--
 output/Makefile.am            | 29 +++++++++++++++++++++++++++--
 output/dbi/Makefile.am        |  4 ----
 output/mysql/Makefile.am      |  4 ----
 output/pcap/Makefile.am       |  4 ----
 output/pgsql/Makefile.am      |  4 ----
 output/sqlite3/Makefile.am    |  4 ----
 12 files changed, 38 insertions(+), 33 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 7ea5db55a2cc..bf390a4faad7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,12 +1,11 @@
+SUBDIRS = include libipulog src input filter output
 
-ACLOCAL_AMFLAGS  = -I m4
+ACLOCAL_AMFLAGS = -I m4
 
 dist_man_MANS = ulogd.8
 
 EXTRA_DIST = ulogd.conf.in doc
 
-SUBDIRS = include libipulog src input filter output
-
 noinst_DATA = ulogd.conf
 
 edit = sed \
@@ -17,4 +16,3 @@ ulogd.conf: Makefile $(srcdir)/ulogd.conf.in
 
 dist-hook:
 	rm -f ulogd.conf
-
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..668fc2b1444a 100644
--- a/input/Makefile.am
+++ b/input/Makefile.am
@@ -1,2 +1,9 @@
+if BUILD_NFCT
+    OPT_SUBDIR_FLOW = flow
+endif
 
-SUBDIRS = packet flow sum
+if BUILD_NFACCT
+    OPT_SUBDIR_SUM = sum
+endif
+
+SUBDIRS = packet $(OPT_SUBDIR_FLOW) $(OPT_SUBDIR_SUM)
diff --git a/input/flow/Makefile.am b/input/flow/Makefile.am
index 004e532981a4..2171a0cd80c8 100644
--- a/input/flow/Makefile.am
+++ b/input/flow/Makefile.am
@@ -2,12 +2,10 @@ include $(top_srcdir)/Make_global.am
 
 AM_CPPFLAGS += ${LIBNETFILTER_CONNTRACK_CFLAGS}
 
-if BUILD_NFCT
 pkglib_LTLIBRARIES = ulogd_inpflow_NFCT.la # ulogd_inpflow_IPFIX.la
 
 ulogd_inpflow_NFCT_la_SOURCES = ulogd_inpflow_NFCT.c
 ulogd_inpflow_NFCT_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_CONNTRACK_LIBS)
-endif
 
 #ulogd_inpflow_IPFIX_la_SOURCES = ulogd_inpflow_IPFIX.c
 #ulogd_inpflow_IPFIX_la_LDFLAGS = -avoid-version -module
diff --git a/input/sum/Makefile.am b/input/sum/Makefile.am
index e0c42f7de376..b24af7b5606c 100644
--- a/input/sum/Makefile.am
+++ b/input/sum/Makefile.am
@@ -2,9 +2,8 @@ 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
 ulogd_inpflow_NFACCT_la_LDFLAGS = -avoid-version -module
 ulogd_inpflow_NFACCT_la_LIBADD  = $(LIBMNL_LIBS) $(LIBNETFILTER_ACCT_LIBS)
-endif
diff --git a/output/Makefile.am b/output/Makefile.am
index 879c317d03ff..cdb49df157e5 100644
--- a/output/Makefile.am
+++ b/output/Makefile.am
@@ -1,11 +1,36 @@
+if HAVE_PCAP
+  OPT_SUBDIR_PCAP = pcap
+endif
+
+if HAVE_MYSQL
+  OPT_SUBDIR_MYSQL = mysql
+endif
+
+if HAVE_PGSQL
+  OPT_SUBDIR_PGSQL = pgsql
+endif
+
+if HAVE_SQLITE3
+  OPT_SUBDIR_SQLITE3 = sqlite3
+endif
+
+if HAVE_DBI
+  OPT_SUBDIR_DBI = dbi
+endif
+
+SUBDIRS = $(OPT_SUBDIR_PCAP) \
+	  $(OPT_SUBDIR_MYSQL) \
+	  $(OPT_SUBDIR_PGSQL) \
+	  $(OPT_SUBDIR_SQLITE3) \
+	  $(OPT_SUBDIR_DBI) \
+	  ipfix
+
 include $(top_srcdir)/Make_global.am
 
 AM_CPPFLAGS += ${LIBNETFILTER_ACCT_CFLAGS} \
 	       ${LIBNETFILTER_CONNTRACK_CFLAGS} \
 	       ${LIBNETFILTER_LOG_CFLAGS}
 
-SUBDIRS= pcap mysql pgsql sqlite3 dbi ipfix
-
 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 38db0a26fd84..f8b0a9c68c78 100644
--- a/output/dbi/Makefile.am
+++ b/output/dbi/Makefile.am
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
 
 AM_CPPFLAGS += $(DBI_INC)
 
-if HAVE_DBI
-
 pkglib_LTLIBRARIES = ulogd_output_DBI.la
 
 ulogd_output_DBI_la_SOURCES = ulogd_output_DBI.c ../../util/db.c
 ulogd_output_DBI_la_LIBADD  = ${DBI_LIB}
 ulogd_output_DBI_la_LDFLAGS = -avoid-version -module
-
-endif
diff --git a/output/mysql/Makefile.am b/output/mysql/Makefile.am
index 3839a135c926..54abb9654eb7 100644
--- a/output/mysql/Makefile.am
+++ b/output/mysql/Makefile.am
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
 
 AM_CPPFLAGS += $(MYSQL_INC)
 
-if HAVE_MYSQL
-
 pkglib_LTLIBRARIES = ulogd_output_MYSQL.la
 
 ulogd_output_MYSQL_la_SOURCES = ulogd_output_MYSQL.c ../../util/db.c
 ulogd_output_MYSQL_la_LIBADD  = ${MYSQL_LIB}
 ulogd_output_MYSQL_la_LDFLAGS = -avoid-version -module
-
-endif
diff --git a/output/pcap/Makefile.am b/output/pcap/Makefile.am
index a022bf0cc15c..9b4b3dde3a9c 100644
--- a/output/pcap/Makefile.am
+++ b/output/pcap/Makefile.am
@@ -1,11 +1,7 @@
 include $(top_srcdir)/Make_global.am
 
-if HAVE_PCAP
-
 pkglib_LTLIBRARIES = ulogd_output_PCAP.la
 
 ulogd_output_PCAP_la_SOURCES = ulogd_output_PCAP.c
 ulogd_output_PCAP_la_LIBADD  = ${libpcap_LIBS}
 ulogd_output_PCAP_la_LDFLAGS = -avoid-version -module
-
-endif
diff --git a/output/pgsql/Makefile.am b/output/pgsql/Makefile.am
index fbc0d04c9f11..9cdf22d7f765 100644
--- a/output/pgsql/Makefile.am
+++ b/output/pgsql/Makefile.am
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
 
 AM_CPPFLAGS += -I$(PQINCPATH)
 
-if HAVE_PGSQL
-
 pkglib_LTLIBRARIES = ulogd_output_PGSQL.la
 
 ulogd_output_PGSQL_la_SOURCES = ulogd_output_PGSQL.c ../../util/db.c
 ulogd_output_PGSQL_la_LIBADD  = ${PQLIBS}
 ulogd_output_PGSQL_la_LDFLAGS = -avoid-version -module
-
-endif
diff --git a/output/sqlite3/Makefile.am b/output/sqlite3/Makefile.am
index e00e1d6cf11c..72fd1a6a8db4 100644
--- a/output/sqlite3/Makefile.am
+++ b/output/sqlite3/Makefile.am
@@ -2,12 +2,8 @@ include $(top_srcdir)/Make_global.am
 
 AM_CPPFLAGS += ${libsqlite3_CFLAGS}
 
-if HAVE_SQLITE3
-
 pkglib_LTLIBRARIES = ulogd_output_SQLITE3.la
 
 ulogd_output_SQLITE3_la_SOURCES = ulogd_output_SQLITE3.c ../../util/db.c
 ulogd_output_SQLITE3_la_LIBADD  = ${libsqlite3_LIBS}
 ulogd_output_SQLITE3_la_LDFLAGS = -avoid-version -module
-
-endif
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 09/16] build: group `*_la_*` variables with their libraries
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (7 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 08/16] build: skip sub-directories containing disabled plugins Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 10/16] build: delete commented-out code Jeremy Sowden
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

Move the `_SOURCES`, `_LIBADD` and `_LDFLAGS` variables for each
input-packet library alongside the matching `.la` definition.  In
particular, move the `NFLOG` and `ULOG` variables inside the
conditionals controlling whether the libraries get built.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 input/packet/Makefile.am | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/input/packet/Makefile.am b/input/packet/Makefile.am
index daf374a65917..5c95e0576e00 100644
--- a/input/packet/Makefile.am
+++ b/input/packet/Makefile.am
@@ -4,20 +4,20 @@ AM_CPPFLAGS += ${LIBNETFILTER_LOG_CFLAGS}
 
 pkglib_LTLIBRARIES = ulogd_inppkt_UNIXSOCK.la
 
+ulogd_inppkt_UNIXSOCK_la_SOURCES = ulogd_inppkt_UNIXSOCK.c
+ulogd_inppkt_UNIXSOCK_la_LDFLAGS = -avoid-version -module
+
 if BUILD_ULOG
 pkglib_LTLIBRARIES += ulogd_inppkt_ULOG.la
+
+ulogd_inppkt_ULOG_la_SOURCES = ulogd_inppkt_ULOG.c
+ulogd_inppkt_ULOG_la_LDFLAGS = -avoid-version -module
+ulogd_inppkt_ULOG_la_LIBADD = ../../libipulog/libipulog.la
 endif
 
 if BUILD_NFLOG
 pkglib_LTLIBRARIES += ulogd_inppkt_NFLOG.la
-endif
 
 ulogd_inppkt_NFLOG_la_SOURCES = ulogd_inppkt_NFLOG.c
 ulogd_inppkt_NFLOG_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_LOG_LIBS)
-
-ulogd_inppkt_ULOG_la_SOURCES = ulogd_inppkt_ULOG.c
-ulogd_inppkt_ULOG_la_LDFLAGS = -avoid-version -module
-ulogd_inppkt_ULOG_la_LIBADD = ../../libipulog/libipulog.la
-
-ulogd_inppkt_UNIXSOCK_la_SOURCES = ulogd_inppkt_UNIXSOCK.c
-ulogd_inppkt_UNIXSOCK_la_LDFLAGS = -avoid-version -module
+endif
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 10/16] build: delete commented-out code
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (8 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 09/16] build: group `*_la_*` variables with their libraries Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 11/16] build: use correct automake variable for library dependencies Jeremy Sowden
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

There are a few of commented-out variable definitions left over from
the introduction of Automake.  Remove them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 input/flow/Makefile.am | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/input/flow/Makefile.am b/input/flow/Makefile.am
index 2171a0cd80c8..fc95bdb85af8 100644
--- a/input/flow/Makefile.am
+++ b/input/flow/Makefile.am
@@ -2,10 +2,7 @@ include $(top_srcdir)/Make_global.am
 
 AM_CPPFLAGS += ${LIBNETFILTER_CONNTRACK_CFLAGS}
 
-pkglib_LTLIBRARIES = ulogd_inpflow_NFCT.la # ulogd_inpflow_IPFIX.la
+pkglib_LTLIBRARIES = ulogd_inpflow_NFCT.la
 
 ulogd_inpflow_NFCT_la_SOURCES = ulogd_inpflow_NFCT.c
 ulogd_inpflow_NFCT_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_CONNTRACK_LIBS)
-
-#ulogd_inpflow_IPFIX_la_SOURCES = ulogd_inpflow_IPFIX.c
-#ulogd_inpflow_IPFIX_la_LDFLAGS = -avoid-version -module
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 11/16] build: use correct automake variable for library dependencies
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (9 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 10/16] build: delete commented-out code Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 12/16] build: update obsolete autoconf macros Jeremy Sowden
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

A couple of library dependencies are specified in `_LDFLAGS` variables.
They are supposed to be specified in `_LIBADD` variables.  Move them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 input/flow/Makefile.am   | 3 ++-
 input/packet/Makefile.am | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/input/flow/Makefile.am b/input/flow/Makefile.am
index fc95bdb85af8..a556b4e4cb90 100644
--- a/input/flow/Makefile.am
+++ b/input/flow/Makefile.am
@@ -5,4 +5,5 @@ AM_CPPFLAGS += ${LIBNETFILTER_CONNTRACK_CFLAGS}
 pkglib_LTLIBRARIES = ulogd_inpflow_NFCT.la
 
 ulogd_inpflow_NFCT_la_SOURCES = ulogd_inpflow_NFCT.c
-ulogd_inpflow_NFCT_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_CONNTRACK_LIBS)
+ulogd_inpflow_NFCT_la_LDFLAGS = -avoid-version -module
+ulogd_inpflow_NFCT_la_LIBADD  = $(LIBNETFILTER_CONNTRACK_LIBS)
diff --git a/input/packet/Makefile.am b/input/packet/Makefile.am
index 5c95e0576e00..3aa01112084e 100644
--- a/input/packet/Makefile.am
+++ b/input/packet/Makefile.am
@@ -19,5 +19,6 @@ if BUILD_NFLOG
 pkglib_LTLIBRARIES += ulogd_inppkt_NFLOG.la
 
 ulogd_inppkt_NFLOG_la_SOURCES = ulogd_inppkt_NFLOG.c
-ulogd_inppkt_NFLOG_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_LOG_LIBS)
+ulogd_inppkt_NFLOG_la_LDFLAGS = -avoid-version -module
+ulogd_inppkt_NFLOG_la_LIBADD  = $(LIBNETFILTER_LOG_LIBS)
 endif
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 12/16] build: update obsolete autoconf macros
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (10 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 11/16] build: use correct automake variable for library dependencies Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 13/16] build: remove commented-out code Jeremy Sowden
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

`AC_CONFIG_HEADER` has been superseded by `AC_CONFIG_HEADERS`.

`AC_PROG_LIBTOOL` has been superseded by `LT_INIT`.

`AC_DISABLE_STATIC` can be replaced by an argument to `LT_INIT`.

`AC_HEADER_STDC` is obsolete.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 configure.ac | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index f7d6b50c47f5..b88c7a6d7708 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_INIT([ulogd], [2.0.7])
 AC_PREREQ([2.50])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([-Wall foreign tar-pax no-dist-gzip dist-bzip2 1.10b subdir-objects])
-AC_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
@@ -14,8 +14,7 @@ dnl Checks for programs.
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_PROG_INSTALL
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
+LT_INIT([disable-static])
 
 dnl Checks for libraries.
 AC_SEARCH_LIBS([dlopen], [dl], [libdl_LIBS="$LIBS"; LIBS=""])
@@ -23,7 +22,6 @@ AC_SUBST([libdl_LIBS])
 
 dnl Checks for header files.
 AC_HEADER_DIRENT
-AC_HEADER_STDC
 AC_CHECK_HEADERS(fcntl.h unistd.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 13/16] build: remove commented-out code
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (11 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 12/16] build: update obsolete autoconf macros Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 14/16] build: remove unnecessary `AC_SUBST` calls Jeremy Sowden
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

There are a couple of blocks of macros in configure.ac which were
commented out in 2006.  Remove them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 configure.ac | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index b88c7a6d7708..268cd10de2da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,18 +155,6 @@ AC_ARG_WITH([ulogd2libdir],
         [ulogd2libdir="${libdir}/ulogd"])
 AC_SUBST([ulogd2libdir])
 
-dnl AC_SUBST(DATABASE_DIR)
-dnl AC_SUBST(DATABASE_LIB)
-dnl AC_SUBST(DATABASE_LIB_DIR)
-dnl AC_SUBST(DB_DEF)
-dnl AC_SUBST(EXTRA_MYSQL_DEF)
-dnl AC_SUBST(EXTRA_PGSQL_DEF)
-
-dnl AC_SUBST(DATABASE_DRIVERS)
-
-dnl AM_CONDITIONAL(HAVE_MYSQL, test x$mysqldir != x)
-dnl AM_CONDITIONAL(HAVE_PGSQL, test x$pgsqldir != x)
-
 AC_CONFIG_FILES(include/Makefile include/ulogd/Makefile include/libipulog/Makefile \
 	  include/linux/Makefile include/linux/netfilter/Makefile \
 	  include/linux/netfilter_ipv4/Makefile libipulog/Makefile \
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 14/16] build: remove unnecessary `AC_SUBST` calls
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (12 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 13/16] build: remove commented-out code Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:58   ` Jan Engelhardt
  2021-11-14 14:00 ` [ulogd2 PATCH v3 15/16] build: quote autoconf macro arguments Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 16/16] build: use `AS_IF` consistently in configure.ac Jeremy Sowden
  15 siblings, 1 reply; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

We don't use the variables being passed to `AC_SUBST` in these calls as
output variables, so remove them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 acinclude.m4 | 13 -------------
 configure.ac |  4 ----
 2 files changed, 17 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 8388c452aade..16434f4fdf0d 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -25,9 +25,6 @@ AC_ARG_WITH(pgsql-lib,
 	[pg_lib=$withval], [pg_lib=])
 
 
-AC_SUBST(PQINCPATH)
-AC_SUBST(PQLIBPATH)
-AC_SUBST(PQLIBS)
 PQLIBS=-lpq
 
 if test "$pg_prefix" != "no"; then
@@ -120,9 +117,6 @@ AC_ARG_WITH(mysql-lib,
 	[my_lib=$withval], [my_lib=])
 
 
-AC_SUBST(MYSQL_INC)
-AC_SUBST(MYSQL_LIB)
-
 if test "$my_prefix" != "no"; then
 
 AC_MSG_CHECKING([for MySQL mysql_config program])
@@ -212,10 +206,6 @@ AC_ARG_WITH(pcap-lib,
 	[pcap_lib=$withval], [pcap_lib=/usr/lib])
 
 
-AC_SUBST(PCAP_INC)
-AC_SUBST(PCAP_LIB)
-AC_SUBST(HAVE_PCAP_LIB)
-
 if test "$pcap_prefix" != "no"; then
 
 if test "$pcap_prefix" != ""; then
@@ -291,9 +281,6 @@ AC_ARG_WITH(dbi-lib,
 	[dbi_lib=$withval], [dbi_lib=/usr/lib])
 
 
-AC_SUBST(DBI_INC)
-AC_SUBST(DBI_LIB)
-
 if test "$dbi_prefix" != "no"; then
 
 if test "$dbi_prefix" != ""; then
diff --git a/configure.ac b/configure.ac
index 268cd10de2da..154650000fb1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,6 @@ LT_INIT([disable-static])
 
 dnl Checks for libraries.
 AC_SEARCH_LIBS([dlopen], [dl], [libdl_LIBS="$LIBS"; LIBS=""])
-AC_SUBST([libdl_LIBS])
 
 dnl Checks for header files.
 AC_HEADER_DIRENT
@@ -35,7 +34,6 @@ AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(socket strerror)
 
 AC_SEARCH_LIBS([pthread_create], [pthread], [libpthread_LIBS="$LIBS"; LIBS=""])
-AC_SUBST([libpthread_LIBS])
 
 AC_ARG_ENABLE(ulog,
        AS_HELP_STRING([--enable-ulog], [Enable ulog module [default=yes]]),[enable_ulog=$enableval],[enable_ulog=yes])
@@ -128,7 +126,6 @@ fi
 AC_ARG_WITH([pcap], AS_HELP_STRING([--without-pcap], [Build without PCAP output plugin [default=test]]))
 AS_IF([test "x$with_pcap" != "xno"], [
     AC_SEARCH_LIBS([pcap_close], [pcap], [libpcap_LIBS="-lpcap"; LIBS=""])
-    AC_SUBST([libpcap_LIBS])
 ])
 AM_CONDITIONAL([HAVE_PCAP], [test -n "$libpcap_LIBS"])
 if test "x$libpcap_LIBS" != "x"; then
@@ -153,7 +150,6 @@ AC_ARG_WITH([ulogd2libdir],
         [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]]),
         [ulogd2libdir="$withval"],
         [ulogd2libdir="${libdir}/ulogd"])
-AC_SUBST([ulogd2libdir])
 
 AC_CONFIG_FILES(include/Makefile include/ulogd/Makefile include/libipulog/Makefile \
 	  include/linux/Makefile include/linux/netfilter/Makefile \
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 15/16] build: quote autoconf macro arguments
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (13 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 14/16] build: remove unnecessary `AC_SUBST` calls Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  2021-11-14 14:00 ` [ulogd2 PATCH v3 16/16] build: use `AS_IF` consistently in configure.ac Jeremy Sowden
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

Arguments are supposed to be quoted in square brackets.  Fix several that
weren't.

Sort and reformat the `AC_OUTPUT_FILES` argument list while we're at it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 configure.ac | 94 ++++++++++++++++++++++++++++++++++------------------
 1 file changed, 61 insertions(+), 33 deletions(-)

diff --git a/configure.ac b/configure.ac
index 154650000fb1..1e321e6ff0a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ AC_SEARCH_LIBS([dlopen], [dl], [libdl_LIBS="$LIBS"; LIBS=""])
 
 dnl Checks for header files.
 AC_HEADER_DIRENT
-AC_CHECK_HEADERS(fcntl.h unistd.h)
+AC_CHECK_HEADERS([fcntl.h unistd.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -31,12 +31,14 @@ AC_SYS_LARGEFILE
 
 dnl Checks for library functions.
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(socket strerror)
+AC_CHECK_FUNCS([socket strerror])
 
 AC_SEARCH_LIBS([pthread_create], [pthread], [libpthread_LIBS="$LIBS"; LIBS=""])
 
-AC_ARG_ENABLE(ulog,
-       AS_HELP_STRING([--enable-ulog], [Enable ulog module [default=yes]]),[enable_ulog=$enableval],[enable_ulog=yes])
+AC_ARG_ENABLE([ulog],
+              [AS_HELP_STRING([--enable-ulog], [Enable ulog module [default=yes]])],
+              [enable_ulog=$enableval],
+              [enable_ulog=yes])
 AM_CONDITIONAL([BUILD_ULOG], [test "x$enable_ulog" = "xyes"])
 if [! test "x$enable_ulog" = "xyes"]; then
 	enable_ulog="no"
@@ -44,8 +46,11 @@ fi
 
 dnl Check for the right nfnetlink version
 PKG_CHECK_MODULES([LIBNFNETLINK], [libnfnetlink >= 1.0.1])
-AC_ARG_ENABLE(nflog,
-       AS_HELP_STRING([--enable-nflog], [Enable nflog module [default=yes]]),[enable_nflog=$enableval],[enable_nflog=yes])
+
+AC_ARG_ENABLE([nflog],
+              [AS_HELP_STRING([--enable-nflog], [Enable nflog module [default=yes]])],
+              [enable_nflog=$enableval],
+              [enable_nflog=yes])
 AS_IF([test "x$enable_nflog" = "xyes"], [
     PKG_CHECK_MODULES([LIBNETFILTER_LOG], [libnetfilter_log >= 1.0.0])
     AC_DEFINE([BUILD_NFLOG], [1], [Building nflog module])
@@ -55,8 +60,10 @@ if [! test "x$enable_nflog" = "xyes"]; then
 	enable_nflog="no"
 fi
 
-AC_ARG_ENABLE(nfct,
-       AS_HELP_STRING([--enable-nfct], [Enable nfct module [default=yes]]),[enable_nfct=$enableval],[enable_nfct=yes])
+AC_ARG_ENABLE([nfct],
+              [AS_HELP_STRING([--enable-nfct], [Enable nfct module [default=yes]])],
+              [enable_nfct=$enableval],
+              [enable_nfct=yes])
 AS_IF([test "x$enable_nfct" = "xyes"], [
     PKG_CHECK_MODULES([LIBNETFILTER_CONNTRACK], [libnetfilter_conntrack >= 1.0.2])
     AC_DEFINE([BUILD_NFCT], [1], [Building nfct module])
@@ -66,8 +73,10 @@ if [! test "x$enable_nfct" = "xyes"]; then
 	enable_nfct="no"
 fi
 
-AC_ARG_ENABLE(nfacct,
-       AS_HELP_STRING([--enable-nfacct], [Enable nfacct module [default=yes]]),[enable_nfacct=$enableval],[enable_nfacct=yes])
+AC_ARG_ENABLE([nfacct],
+              [AS_HELP_STRING([--enable-nfacct], [Enable nfacct module [default=yes]])],
+              [enable_nfacct=$enableval],
+              [enable_nfacct=yes])
 AS_IF([test "x$enable_nfacct" = "xyes"], [
     PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
     PKG_CHECK_MODULES([LIBNETFILTER_ACCT], [libnetfilter_acct >= 1.0.1])
@@ -78,22 +87,24 @@ if [! test "x$enable_nfacct" = "xyes"]; then
 	enable_nfacct="no"
 fi
 
-AC_ARG_WITH([pgsql], AS_HELP_STRING([--without-pgsql], [Build without postgresql output plugin [default=test]]))
+AC_ARG_WITH([pgsql],
+            [AS_HELP_STRING([--without-pgsql], [Build without postgresql output plugin [default=test]])])
 AS_IF([test "x$with_pgsql" != "xno"], [
 	CT_CHECK_POSTGRES_DB()
 ])
-AM_CONDITIONAL(HAVE_PGSQL, test "x$PQLIBPATH" != "x")
+AM_CONDITIONAL([HAVE_PGSQL], [test "x$PQLIBPATH" != "x"])
 if test "x$PQLIBPATH" != "x"; then
 	enable_pgsql="yes"
 else
 	enable_pgsql="no"
 fi
 
-AC_ARG_WITH([mysql], AS_HELP_STRING([--without-mysql], [Build without mysql output plugin [default=test]]))
+AC_ARG_WITH([mysql],
+            [AS_HELP_STRING([--without-mysql], [Build without mysql output plugin [default=test]])])
 AS_IF([test "x$with_mysql" != "xno"], [
 	CT_CHECK_MYSQL_DB()
 ])
-AM_CONDITIONAL(HAVE_MYSQL, test "x$MYSQL_LIB" != "x")
+AM_CONDITIONAL([HAVE_MYSQL], [test "x$MYSQL_LIB" != "x"])
 if test "x$MYSQL_LIB" != "x"; then
 	enable_mysql="yes"
 else
@@ -101,7 +112,8 @@ else
 fi
 
 
-AC_ARG_WITH([sqlite], AS_HELP_STRING([--without-sqlite], [Build without SQLITE3 output plugin [default=test]]))
+AC_ARG_WITH([sqlite],
+            [AS_HELP_STRING([--without-sqlite], [Build without SQLITE3 output plugin [default=test]])])
 AS_IF([test "x$with_sqlite" != "xno"], [
     PKG_CHECK_MODULES([libsqlite3], [sqlite3], [], [:])
 ])
@@ -112,18 +124,20 @@ else
 	enable_sqlite3="no"
 fi
 
-AC_ARG_WITH([dbi], AS_HELP_STRING([--without-dbi], [Build without DBI output plugin [default=test]]))
+AC_ARG_WITH([dbi],
+            [AS_HELP_STRING([--without-dbi], [Build without DBI output plugin [default=test]])])
 AS_IF([test "x$with_dbi" != "xno"], [
     CT_CHECK_DBI()
 ])
-AM_CONDITIONAL(HAVE_DBI, test "x$DBI_LIB" != "x")
+AM_CONDITIONAL([HAVE_DBI], [test "x$DBI_LIB" != "x"])
 if test "x$DBI_LIB" != "x"; then
 	enable_dbi="yes"
 else
 	enable_dbi="no"
 fi
 
-AC_ARG_WITH([pcap], AS_HELP_STRING([--without-pcap], [Build without PCAP output plugin [default=test]]))
+AC_ARG_WITH([pcap],
+            [AS_HELP_STRING([--without-pcap], [Build without PCAP output plugin [default=test]])])
 AS_IF([test "x$with_pcap" != "xno"], [
     AC_SEARCH_LIBS([pcap_close], [pcap], [libpcap_LIBS="-lpcap"; LIBS=""])
 ])
@@ -134,7 +148,8 @@ else
 	enable_pcap="no"
 fi
 
-AC_ARG_WITH([jansson], AS_HELP_STRING([--without-jansson], [Build without JSON output plugin [default=test]]))
+AC_ARG_WITH([jansson],
+            [AS_HELP_STRING([--without-jansson], [Build without JSON output plugin [default=test]])])
 AS_IF([test "x$with_jansson" != "xno"], [
     PKG_CHECK_MODULES([libjansson], [jansson], [], [:])
 ])
@@ -146,20 +161,33 @@ else
 fi
 
 AC_ARG_WITH([ulogd2libdir],
-	AS_HELP_STRING([--with-ulogd2libdir=PATH],
-        [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]]),
-        [ulogd2libdir="$withval"],
-        [ulogd2libdir="${libdir}/ulogd"])
-
-AC_CONFIG_FILES(include/Makefile include/ulogd/Makefile include/libipulog/Makefile \
-	  include/linux/Makefile include/linux/netfilter/Makefile \
-	  include/linux/netfilter_ipv4/Makefile libipulog/Makefile \
-	  input/Makefile input/packet/Makefile input/flow/Makefile \
-	  input/sum/Makefile \
-	  filter/Makefile filter/raw2packet/Makefile \
-	  output/Makefile output/pcap/Makefile output/mysql/Makefile output/pgsql/Makefile output/sqlite3/Makefile \
-	  output/dbi/Makefile output/ipfix/Makefile \
-	  src/Makefile Makefile)
+            [AS_HELP_STRING([--with-ulogd2libdir=PATH], [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]])],
+            [ulogd2libdir="$withval"],
+            [ulogd2libdir="${libdir}/ulogd"])
+
+AC_CONFIG_FILES([Makefile
+		 filter/Makefile
+		 filter/raw2packet/Makefile
+		 include/Makefile
+		 include/libipulog/Makefile
+		 include/linux/Makefile
+		 include/linux/netfilter/Makefile
+		 include/linux/netfilter_ipv4/Makefile
+		 include/ulogd/Makefile
+		 input/Makefile
+		 input/flow/Makefile
+		 input/packet/Makefile
+		 input/sum/Makefile
+		 libipulog/Makefile
+		 output/Makefile
+		 output/dbi/Makefile
+		 output/ipfix/Makefile
+		 output/mysql/Makefile
+		 output/pcap/Makefile
+		 output/pgsql/Makefile
+		 output/sqlite3/Makefile
+		 src/Makefile])
+
 AC_OUTPUT
 
 define([EXPAND_VARIABLE],
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [ulogd2 PATCH v3 16/16] build: use `AS_IF` consistently in configure.ac
  2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
                   ` (14 preceding siblings ...)
  2021-11-14 14:00 ` [ulogd2 PATCH v3 15/16] build: quote autoconf macro arguments Jeremy Sowden
@ 2021-11-14 14:00 ` Jeremy Sowden
  15 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 14:00 UTC (permalink / raw)
  To: Netfilter Devel

configure.ac contains a mix of `AS_IF` and `if` conditionals.  Prefer
the portable M4sh `AS_IF` macro.  In some cases, where there are both
`AS_IF` and `if` conditionals evaluating the same predicates, the latter
are merged into the former.

Replace three instance of `test -n "$var"` with the usual, more portable,
autoconf idiom: `test "x$var" != "x"`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 configure.ac | 114 ++++++++++++++++-----------------------------------
 1 file changed, 36 insertions(+), 78 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1e321e6ff0a5..af7447eae8ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,10 +39,8 @@ AC_ARG_ENABLE([ulog],
               [AS_HELP_STRING([--enable-ulog], [Enable ulog module [default=yes]])],
               [enable_ulog=$enableval],
               [enable_ulog=yes])
+AS_IF([test "x$enable_ulog" != "xyes"], [enable_ulog=no])
 AM_CONDITIONAL([BUILD_ULOG], [test "x$enable_ulog" = "xyes"])
-if [! test "x$enable_ulog" = "xyes"]; then
-	enable_ulog="no"
-fi
 
 dnl Check for the right nfnetlink version
 PKG_CHECK_MODULES([LIBNFNETLINK], [libnfnetlink >= 1.0.1])
@@ -51,114 +49,74 @@ AC_ARG_ENABLE([nflog],
               [AS_HELP_STRING([--enable-nflog], [Enable nflog module [default=yes]])],
               [enable_nflog=$enableval],
               [enable_nflog=yes])
-AS_IF([test "x$enable_nflog" = "xyes"], [
-    PKG_CHECK_MODULES([LIBNETFILTER_LOG], [libnetfilter_log >= 1.0.0])
-    AC_DEFINE([BUILD_NFLOG], [1], [Building nflog module])
-])
+AS_IF([test "x$enable_nflog" = "xyes"],
+      [PKG_CHECK_MODULES([LIBNETFILTER_LOG], [libnetfilter_log >= 1.0.0])
+       AC_DEFINE([BUILD_NFLOG], [1], [Building nflog module])],
+      [enable_nflog=no])
 AM_CONDITIONAL([BUILD_NFLOG], [test "x$enable_nflog" = "xyes"])
-if [! test "x$enable_nflog" = "xyes"]; then
-	enable_nflog="no"
-fi
 
 AC_ARG_ENABLE([nfct],
               [AS_HELP_STRING([--enable-nfct], [Enable nfct module [default=yes]])],
               [enable_nfct=$enableval],
               [enable_nfct=yes])
-AS_IF([test "x$enable_nfct" = "xyes"], [
-    PKG_CHECK_MODULES([LIBNETFILTER_CONNTRACK], [libnetfilter_conntrack >= 1.0.2])
-    AC_DEFINE([BUILD_NFCT], [1], [Building nfct module])
-])
+AS_IF([test "x$enable_nfct" = "xyes"],
+      [PKG_CHECK_MODULES([LIBNETFILTER_CONNTRACK], [libnetfilter_conntrack >= 1.0.2])
+       AC_DEFINE([BUILD_NFCT], [1], [Building nfct module])],
+      [enable_nfct=no])
 AM_CONDITIONAL([BUILD_NFCT], [test "x$enable_nfct" = "xyes"])
-if [! test "x$enable_nfct" = "xyes"]; then
-	enable_nfct="no"
-fi
 
 AC_ARG_ENABLE([nfacct],
               [AS_HELP_STRING([--enable-nfacct], [Enable nfacct module [default=yes]])],
               [enable_nfacct=$enableval],
               [enable_nfacct=yes])
-AS_IF([test "x$enable_nfacct" = "xyes"], [
-    PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
-    PKG_CHECK_MODULES([LIBNETFILTER_ACCT], [libnetfilter_acct >= 1.0.1])
-    AC_DEFINE([BUILD_NFACCT], [1], [Building nfacct module])
-])
+AS_IF([test "x$enable_nfacct" = "xyes"],
+      [PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
+       PKG_CHECK_MODULES([LIBNETFILTER_ACCT], [libnetfilter_acct >= 1.0.1])
+       AC_DEFINE([BUILD_NFACCT], [1], [Building nfacct module])],
+      [enable_nfacct=no])
 AM_CONDITIONAL([BUILD_NFACCT], [test "x$enable_nfacct" = "xyes"])
-if [! test "x$enable_nfacct" = "xyes"]; then
-	enable_nfacct="no"
-fi
 
 AC_ARG_WITH([pgsql],
             [AS_HELP_STRING([--without-pgsql], [Build without postgresql output plugin [default=test]])])
-AS_IF([test "x$with_pgsql" != "xno"], [
-	CT_CHECK_POSTGRES_DB()
-])
+AS_IF([test "x$with_pgsql" != "xno"],
+      [CT_CHECK_POSTGRES_DB()])
+AS_IF([test "x$PQLIBPATH" != "x"], [enable_pgsql=yes], [enable_pgsql=no])
 AM_CONDITIONAL([HAVE_PGSQL], [test "x$PQLIBPATH" != "x"])
-if test "x$PQLIBPATH" != "x"; then
-	enable_pgsql="yes"
-else
-	enable_pgsql="no"
-fi
 
 AC_ARG_WITH([mysql],
             [AS_HELP_STRING([--without-mysql], [Build without mysql output plugin [default=test]])])
-AS_IF([test "x$with_mysql" != "xno"], [
-	CT_CHECK_MYSQL_DB()
-])
+AS_IF([test "x$with_mysql" != "xno"],
+      [CT_CHECK_MYSQL_DB()])
+AS_IF([test "x$MYSQL_LIB" != "x"], [enable_mysql=yes], [enable_mysql=no])
 AM_CONDITIONAL([HAVE_MYSQL], [test "x$MYSQL_LIB" != "x"])
-if test "x$MYSQL_LIB" != "x"; then
-	enable_mysql="yes"
-else
-	enable_mysql="no"
-fi
-
 
 AC_ARG_WITH([sqlite],
             [AS_HELP_STRING([--without-sqlite], [Build without SQLITE3 output plugin [default=test]])])
-AS_IF([test "x$with_sqlite" != "xno"], [
-    PKG_CHECK_MODULES([libsqlite3], [sqlite3], [], [:])
-])
-AM_CONDITIONAL([HAVE_SQLITE3], [test -n "$libsqlite3_LIBS"])
-if test "x$libsqlite3_LIBS" != "x"; then
-	enable_sqlite3="yes"
-else
-	enable_sqlite3="no"
-fi
+AS_IF([test "x$with_sqlite" != "xno"],
+      [PKG_CHECK_MODULES([libsqlite3], [sqlite3], [], [:])])
+AS_IF([test "x$libsqlite3_LIBS" != "x"], [enable_sqlite3=yes], [enable_sqlite3=no])
+AM_CONDITIONAL([HAVE_SQLITE3], [test "x$libsqlite3_LIBS" != "x"])
 
 AC_ARG_WITH([dbi],
             [AS_HELP_STRING([--without-dbi], [Build without DBI output plugin [default=test]])])
-AS_IF([test "x$with_dbi" != "xno"], [
-    CT_CHECK_DBI()
-])
-AM_CONDITIONAL([HAVE_DBI], [test "x$DBI_LIB" != "x"])
-if test "x$DBI_LIB" != "x"; then
-	enable_dbi="yes"
-else
-	enable_dbi="no"
-fi
+AS_IF([test "x$with_dbi" != "xno"],
+      [CT_CHECK_DBI()])
+AS_IF([test "x$DBI_LIB" != "x"], [enable_dbi=yes], [enable_dbi=no])
+AM_CONDITIONAL(HAVE_DBI, [test "x$DBI_LIB" != "x"])
 
 AC_ARG_WITH([pcap],
             [AS_HELP_STRING([--without-pcap], [Build without PCAP output plugin [default=test]])])
-AS_IF([test "x$with_pcap" != "xno"], [
-    AC_SEARCH_LIBS([pcap_close], [pcap], [libpcap_LIBS="-lpcap"; LIBS=""])
-])
-AM_CONDITIONAL([HAVE_PCAP], [test -n "$libpcap_LIBS"])
-if test "x$libpcap_LIBS" != "x"; then
-	enable_pcap="yes"
-else
-	enable_pcap="no"
-fi
+AS_IF([test "x$with_pcap" != "xno"],
+      [AC_SEARCH_LIBS([pcap_close], [pcap], [libpcap_LIBS="-lpcap"; LIBS=""])])
+AS_IF([test "x$libpcap_LIBS" != "x"], [enable_pcap=yes], [enable_pcap=no])
+AM_CONDITIONAL([HAVE_PCAP], [test "x$libpcap_LIBS" != "x"])
 
 AC_ARG_WITH([jansson],
             [AS_HELP_STRING([--without-jansson], [Build without JSON output plugin [default=test]])])
-AS_IF([test "x$with_jansson" != "xno"], [
-    PKG_CHECK_MODULES([libjansson], [jansson], [], [:])
-])
-AM_CONDITIONAL([HAVE_JANSSON], [test -n "$libjansson_LIBS"])
-if test "x$libjansson_LIBS" != "x"; then
-	enable_jansson="yes"
-else
-	enable_jansson="no"
-fi
+AS_IF([test "x$with_jansson" != "xno"],
+      [PKG_CHECK_MODULES([libjansson], [jansson], [], [:])])
+AS_IF([test "x$libjansson_LIBS" != "x"], [enable_jansson=yes], [enable_jansson=no])
+AM_CONDITIONAL([HAVE_JANSSON], [test "x$libjansson_LIBS" != "x"])
 
 AC_ARG_WITH([ulogd2libdir],
             [AS_HELP_STRING([--with-ulogd2libdir=PATH], [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]])],
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [ulogd2 PATCH v3 14/16] build: remove unnecessary `AC_SUBST` calls
  2021-11-14 14:00 ` [ulogd2 PATCH v3 14/16] build: remove unnecessary `AC_SUBST` calls Jeremy Sowden
@ 2021-11-14 14:58   ` Jan Engelhardt
  2021-11-14 15:31     ` Jeremy Sowden
  0 siblings, 1 reply; 19+ messages in thread
From: Jan Engelhardt @ 2021-11-14 14:58 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Netfilter Devel


On Sunday 2021-11-14 15:00, Jeremy Sowden wrote:

>We don't use the variables being passed to `AC_SUBST` in these calls as
>output variables, so remove them.

>-AC_SUBST(PQINCPATH)
>-AC_SUBST(PQLIBPATH)
>-AC_SUBST(PQLIBS)

Eh, but why? These are all still used.

output/pgsql/Makefile.am:AM_CPPFLAGS = -I$(top_srcdir)/include -I$(PQINCPATH)

>-AC_SUBST(MYSQL_INC)
>-AC_SUBST([libdl_LIBS])
>-AC_SUBST([libpthread_LIBS])

src/Makefile.am:ulogd_LDADD   = ${libdl_LIBS} ${libpthread_LIBS}


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [ulogd2 PATCH v3 14/16] build: remove unnecessary `AC_SUBST` calls
  2021-11-14 14:58   ` Jan Engelhardt
@ 2021-11-14 15:31     ` Jeremy Sowden
  0 siblings, 0 replies; 19+ messages in thread
From: Jeremy Sowden @ 2021-11-14 15:31 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Netfilter Devel

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

On 2021-11-14, at 15:58:48 +0100, Jan Engelhardt wrote:
> On Sunday 2021-11-14 15:00, Jeremy Sowden wrote:
> >We don't use the variables being passed to `AC_SUBST` in these calls
> as
> >output variables, so remove them.
>
> >-AC_SUBST(PQINCPATH)
> >-AC_SUBST(PQLIBPATH)
> >-AC_SUBST(PQLIBS)
>
> Eh, but why? These are all still used.

You're quite right.  Fit of idiocy on my part.

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-11-14 15:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-14 14:00 [ulogd2 PATCH v3 00/16] Build Improvements Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 01/16] gitignore: add Emacs artefacts Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 02/16] gitignore: ignore .dirstamp Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 03/16] build: remove unused Makefile fragment Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 04/16] build: remove empty filter sub-directory Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 05/16] build: move CPP `-D` flag Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 06/16] build: add Make_global.am for common flags Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 07/16] build: use `dist_man_MANS` to declare man-pages Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 08/16] build: skip sub-directories containing disabled plugins Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 09/16] build: group `*_la_*` variables with their libraries Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 10/16] build: delete commented-out code Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 11/16] build: use correct automake variable for library dependencies Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 12/16] build: update obsolete autoconf macros Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 13/16] build: remove commented-out code Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 14/16] build: remove unnecessary `AC_SUBST` calls Jeremy Sowden
2021-11-14 14:58   ` Jan Engelhardt
2021-11-14 15:31     ` Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 15/16] build: quote autoconf macro arguments Jeremy Sowden
2021-11-14 14:00 ` [ulogd2 PATCH v3 16/16] build: use `AS_IF` consistently in configure.ac Jeremy Sowden

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.