Build Improvements
v2 cover Build Improvements
Some tidying and autotools updates and fixes.
Changes since v1:
* ignore .dirstamp anywhere;
* fix --disable-static;
* drop AC_PREREQ bump.
Jeremy Sowden (12):
gitignore: add Emacs artefacts
gitignore: ignore .dirstamp
build: remove unused Makefile fragment
build: remove empty filter sub-directory
build: move cpp flag to the only Makefile.am file where it's needed
build: add Make_global.am for common flags and include it where
necessary
build: use dist_man_MANS
build: only conditionally enter sub-directories containing optional
code
build: move library dependencies from LDFLAGS to LIBADD
build: update obsolete autoconf macros
build: quote and reformat some autoconf macro arguments
build: reformat autoconf AC_ARG_WITH, AC_ARG_ENABLE and related macros
.gitignore | 5 +- Make_global.am | 2 + Makefile.am | 11 +- Rules.make.in | 43 ------- configure.ac | 226 ++++++++++++++------------------- 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 | 41 +++++- 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 +- 23 files changed, 189 insertions(+), 260 deletions(-) create mode 100644 Make_global.am delete mode 100644 Rules.make.in delete mode 100644 filter/packet2flow/Makefile.am
Signature · 1 line
2.33.0
PATCH v2 1/12 gitignore: add Emacs artefacts
--- .gitignore | 3 +++ 1 file changed, 3 insertions(+)
.gitignore +3 -0
@@ -1,3 +1,6 @@ +*~ +.\#* +\#*\# # global *.la *.lo
Signature · 1 line
2.33.0
PATCH v2 2/12 gitignore: ignore .dirstamp
In reply to Jeremy Sowden--- .gitignore | 1 + 1 file changed, 1 insertion(+)
.gitignore +1 -0
@@ -6,6 +6,7 @@ *.lo *.o .deps/ +.dirstamp .libs/ Makefile Makefile.in
Signature · 1 line
2.33.0
PATCH v2 3/12 build: remove unused Makefile fragment
In reply to Jeremy Sowden--- .gitignore | 1 - Rules.make.in | 43 ------------------------------------------- configure.ac | 2 +- 3 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 Rules.make.in
.gitignore +0 -1
@@ -12,7 +12,6 @@ Makefile Makefile.in # this dir -/Rules.make /ulogd.conf # build system
Rules.make.in deleted +0 -43
43 lines not on this page · raw message
configure.ac +1 -1
@@ -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],
Signature · 1 line
2.33.0
PATCH v2 4/12 build: remove empty filter sub-directory
In reply to Jeremy SowdenThe only file in filter/packet2flow is an empty Makefile.am. Remove it.
--- 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
configure.ac +1 -1
@@ -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)
filter/Makefile.am +1 -1
@@ -1,4 +1,4 @@ -SUBDIRS = raw2packet packet2flow +SUBDIRS = raw2packet AM_CPPFLAGS = -I$(top_srcdir)/include ${LIBNFNETLINK_CFLAGS} AM_CFLAGS = ${regular_CFLAGS}
filter/packet2flow/Makefile.am deleted +0 -0
Signature · 1 line
2.33.0
PATCH v2 5/12 build: move cpp flag to the only Makefile.am file where it's needed
In reply to Jeremy Sowden--- configure.ac | 2 +- src/Makefile.am | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
configure.ac +1 -1
@@ -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)
src/Makefile.am +3 -2
@@ -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
Signature · 1 line
2.33.0
PATCH v2 6/12 build: add Make_global.am for common flags and include it where necessary
In reply to Jeremy Sowden--- 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
Make_global.am new file +2 -0
@@ -0,0 +1,2 @@ +AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CFLAGS = -Wall -Wextra -Wno-unused-parameter
Makefile.am +2 -5
@@ -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 -
configure.ac +0 -3
@@ -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)
filter/Makefile.am +3 -2
@@ -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 \
filter/raw2packet/Makefile.am +1 -3
@@ -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
include/libipulog/Makefile.am +0 -1
@@ -1,2 +1 @@ - noinst_HEADERS = libipulog.h
include/ulogd/Makefile.am +0 -1
@@ -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
input/Makefile.am +0 -1
@@ -1,2 +1 @@ - SUBDIRS = packet flow sum
input/flow/Makefile.am +2 -2
@@ -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
input/packet/Makefile.am +2 -2
@@ -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
input/sum/Makefile.am +4 -2
@@ -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
libipulog/Makefile.am +1 -3
@@ -1,6 +1,4 @@ - -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = ${regular_CFLAGS} +include $(top_srcdir)/Make_global.am noinst_LTLIBRARIES = libipulog.la
output/Makefile.am +6 -4
@@ -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 \
output/dbi/Makefile.am +2 -2
@@ -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
output/ipfix/Makefile.am +1 -2
@@ -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
output/mysql/Makefile.am +3 -2
@@ -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
output/pcap/Makefile.am +1 -3
@@ -1,6 +1,4 @@ - -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = ${regular_CFLAGS} +include $(top_srcdir)/Make_global.am if HAVE_PCAP
output/pgsql/Makefile.am +2 -2
@@ -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
output/sqlite3/Makefile.am +3 -2
@@ -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
src/Makefile.am +4 -5
@@ -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
Signature · 1 line
2.33.0
PATCH v2 7/12 build: use `dist_man_MANS`
In reply to Jeremy Sowden--- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile.am +2 -2
@@ -2,9 +2,9 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = include libipulog src input filter output -man_MANS = ulogd.8 +dist_man_MANS = ulogd.8 -EXTRA_DIST = $(man_MANS) ulogd.conf.in doc +EXTRA_DIST = ulogd.conf.in doc noinst_DATA = ulogd.conf
Signature · 1 line
2.33.0
PATCH v2 8/12 build: only conditionally enter sub-directories containing optional code
In reply to Jeremy SowdenCurrently, 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.
--- input/Makefile.am | 10 +++++++++- input/flow/Makefile.am | 2 -- input/sum/Makefile.am | 3 +-- output/Makefile.am | 33 +++++++++++++++++++++++++++++---- 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 ---- 9 files changed, 39 insertions(+), 29 deletions(-)
input/Makefile.am +9 -1
@@ -1 +1,9 @@ -SUBDIRS = packet flow sum +if BUILD_NFCT + OPT_SUBDIR_FLOW = flow +endif + +if BUILD_NFACCT + OPT_SUBDIR_SUM = sum +endif + +SUBDIRS = packet $(OPT_SUBDIR_FLOW) $(OPT_SUBDIR_SUM)
input/flow/Makefile.am +0 -2
@@ -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
input/sum/Makefile.am +1 -2
@@ -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
output/Makefile.am +29 -4
@@ -1,4 +1,29 @@ -SUBDIRS= pcap mysql pgsql sqlite3 dbi ipfix +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
@@ -7,9 +32,9 @@ AM_CPPFLAGS += ${LIBNETFILTER_ACCT_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 \ - ulogd_output_GRAPHITE.la + ulogd_output_OPRINT.la ulogd_output_GPRINT.la \ + ulogd_output_NACCT.la ulogd_output_XML.la \ + ulogd_output_GRAPHITE.la if HAVE_JANSSON pkglib_LTLIBRARIES += ulogd_output_JSON.la
output/dbi/Makefile.am +0 -4
@@ -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
output/mysql/Makefile.am +0 -4
@@ -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
output/pcap/Makefile.am +0 -4
@@ -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
output/pgsql/Makefile.am +0 -4
@@ -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
output/sqlite3/Makefile.am +0 -4
@@ -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
Signature · 1 line
2.33.0
PATCH v2 9/12 build: move library dependencies from LDFLAGS to LIBADD
In reply to Jeremy SowdenDelete some commented out variables.
Move definitions of some variables related to conditionally built libraries into the related conditionals.
--- input/flow/Makefile.am | 8 +++----- input/packet/Makefile.am | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-)
input/flow/Makefile.am +3 -5
@@ -2,10 +2,8 @@ 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 +ulogd_inpflow_NFCT_la_LDFLAGS = -avoid-version -module +ulogd_inpflow_NFCT_la_LIBADD = $(LIBNETFILTER_CONNTRACK_LIBS)
input/packet/Makefile.am +10 -9
@@ -4,20 +4,21 @@ 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 +ulogd_inppkt_NFLOG_la_LDFLAGS = -avoid-version -module +ulogd_inppkt_NFLOG_la_LIBADD = $(LIBNETFILTER_LOG_LIBS) +endif
Signature · 1 line
2.33.0
PATCH v2 10/12 build: update obsolete autoconf macros
In reply to Jeremy SowdenAC_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.
--- configure.ac | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
configure.ac +2 -4
@@ -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.
Signature · 1 line
2.33.0
PATCH v2 11/12 build: quote and reformat some autoconf macro arguments
In reply to Jeremy Sowden--- configure.ac | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-)
configure.ac +25 -23
@@ -22,7 +22,7 @@ AC_SUBST([libdl_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
@@ -32,7 +32,7 @@ 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_SUBST([libpthread_LIBS])
@@ -155,27 +155,29 @@ 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 \ - 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) +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]) + AC_OUTPUT define([EXPAND_VARIABLE],
Signature · 1 line
2.33.0
PATCH v2 12/12 build: reformat autoconf AC_ARG_WITH, AC_ARG_ENABLE and related macros
In reply to Jeremy Sowden--- configure.ac | 169 +++++++++++++++++++++------------------------------ 1 file changed, 68 insertions(+), 101 deletions(-)
configure.ac +68 -101
@@ -37,122 +37,89 @@ 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]) +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" -fi +AS_IF([test "x$enable_ulog" != "xyes"], [enable_ulog=no]) 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]) -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]) -]) -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]) -]) +AC_ARG_ENABLE([nflog], + [AS_HELP_STRING([--enable-nflog], [Enable nflog module [default=yes]])], + [enable_nflog=$enableval], + [enable_nflog=yes]) +AM_CONDITIONAL([BUILD_NFLOG], [test "x$enable_nflog" = "xyes"]) +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]) + +AC_ARG_ENABLE([nfct], + [AS_HELP_STRING([--enable-nfct],[Enable nfct module [default=yes]])], + [enable_nfct=$enableval], + [enable_nfct=yes]) 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_nfct" = "xyes"], + [PKG_CHECK_MODULES([LIBNETFILTER_CONNTRACK], [libnetfilter_conntrack >= 1.0.2]) + AC_DEFINE([BUILD_NFCT], [1], [Building nfct module])], + [enable_nfct=no]) + +AC_ARG_ENABLE([nfacct], + [AS_HELP_STRING([--enable-nfacct], [Enable nfacct module [default=yes]])], + [enable_nfacct=$enableval], + [enable_nfacct=yes]) 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() -]) -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$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]) + +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"]) +AS_IF([test "x$PQLIBPATH" != "x"], [enable_pgsql=yes], [enable_pgsql=no]) + +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") -if test "x$MYSQL_LIB" != "x"; then - enable_mysql="yes" -else - enable_mysql="no" -fi - +AS_IF([test "x$MYSQL_LIB" != "x"], [enable_mysql=yes], [enable_mysql=no]) -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 +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 "x$libsqlite3_LIBS" != "x"]) +AS_IF([test "x$libsqlite3_LIBS" != "x"], [enable_sqlite3=yes], [enable_sqlite3=no]) -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() -]) +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$DBI_LIB" != "x"], [enable_dbi=yes], [enable_dbi=no]) -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 - enable_pcap="yes" -else - enable_pcap="no" -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 "x$libpcap_LIBS" != "x"]) +AS_IF([test "x$libpcap_LIBS" != "x"], [enable_pcap=yes], [enable_pcap=no]) -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 +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 "x$libjansson_LIBS" != "x"]) +AS_IF([test "x$libjansson_LIBS" != "x"], [enable_jansson=yes], [enable_jansson=no]) AC_ARG_WITH([ulogd2libdir], - AS_HELP_STRING([--with-ulogd2libdir=PATH], - [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]]), - [ulogd2libdir="$withval"], - [ulogd2libdir="${libdir}/ulogd"]) + [AS_HELP_STRING([--with-ulogd2libdir=PATH], + [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]])], + [ulogd2libdir="$withval"], + [ulogd2libdir="${libdir}/ulogd"]) AC_SUBST([ulogd2libdir]) AC_CONFIG_FILES([include/Makefile
Signature · 1 line
2.33.0
Pablo Neira Ayuso
maintainerQuoted 1 line · Jeremy Sowden
Some tidying and autotools updates and fixes.
Same thing, please add a description.
Sorry for dumping this series for this "silly reason", I think this helps dig out in the future if the natural language description (expressed in the commit description) matches with update as a way to spot for bugs.
It does not need to be long, I understand some little update are quite obvious to the reader, so a concise description should be fine.
Thanks
Quoted 5 lines · Pablo Neira Ayuso
Quoted 1 line · Jeremy Sowden
Some tidying and autotools updates and fixes.
Same thing, please add a description.
Quoted 7 lines
Sorry for dumping this series for this "silly reason", I think this helps dig out in the future if the natural language description (expressed in the commit description) matches with update as a way to spot for bugs.
It does not need to be long, I understand some little update are quite obvious to the reader, so a concise description should be fine.
No problem.
J.