diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2021-11-14 15:52:22 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-11-15 11:42:41 +0100 |
commit | 6056f33fd46e5964ff9fd82cb88de213b4174642 (patch) | |
tree | 1aee78f1dbe8dbb661466afd4509918a794d9480 | |
parent | 820438083eb04abf8efc722fbbe0fdab7c88163d (diff) |
build: add Make_global.am for common flags
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | Make_global.am | 2 | ||||
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | filter/Makefile.am | 5 | ||||
-rw-r--r-- | filter/raw2packet/Makefile.am | 4 | ||||
-rw-r--r-- | input/flow/Makefile.am | 4 | ||||
-rw-r--r-- | input/packet/Makefile.am | 4 | ||||
-rw-r--r-- | input/sum/Makefile.am | 6 | ||||
-rw-r--r-- | libipulog/Makefile.am | 4 | ||||
-rw-r--r-- | output/Makefile.am | 8 | ||||
-rw-r--r-- | output/dbi/Makefile.am | 4 | ||||
-rw-r--r-- | output/ipfix/Makefile.am | 3 | ||||
-rw-r--r-- | output/mysql/Makefile.am | 5 | ||||
-rw-r--r-- | output/pcap/Makefile.am | 4 | ||||
-rw-r--r-- | output/pgsql/Makefile.am | 4 | ||||
-rw-r--r-- | output/sqlite3/Makefile.am | 5 | ||||
-rw-r--r-- | src/Makefile.am | 9 |
17 files changed, 36 insertions, 39 deletions
diff --git a/Make_global.am b/Make_global.am new file mode 100644 index 0000000..4ce896d --- /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 5600f8c..0e57214 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 1d795ba..f7d6b50 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 c2755ec..f1d2c81 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 7498f9a..90768ef 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 0e07a7d..004e532 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 1c3151d..daf374a 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 b6ddb4d..e0c42f7 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 111cd48..708975a 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 7ba8217..879c317 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 f413cab..38db0a2 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 cacda26..7354f6b 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 c24208c..3839a13 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 c1723a6..a022bf0 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 bdaf1d2..fbc0d04 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 62af267..e00e1d6 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 e1d45ae..7a12a72 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 |