Skip to contentSkip to conversation

autotools conversion

PATCH In review Pablo Neira Ayuso 3 participants 10 messages Nov 6, 2014 – Nov 12, 2014

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

cover autotools conversion

Hi,

I found some time to work on the autotools support. Initial patches were posted by Jan dal Molin here:

http://marc.info/?l=netfilter-devel&m=140632527026257&w=2

Those were a good start to address this, but I wanted to introduce these changes incrementally by avoiding bisectability breakage between patches. Moreover, this changeset included quite a lot of changes in configure.ac among other things that this patchset avoids.

Note that doc/ and files/ were not converted yet, so those are currently disabled. Feel free to send patches to complete that or I'll finish it once I find time to work on this again.

I have pushed this to this branch:

http://git.netfilter.org/nftables/log/?h=autotools

Please, review and test. Thanks.

Pablo Neira Ayuso (5):
build: use PKG_CHECK_MODULES to check for libmnl and libnftnl
build: use AC_PROG_YACC and AM_PROG_LEX
rename parser.y to parser_bison.y
include: add cli.h
build: autotools conversion

 .gitignore                       |   10 +-
 Make_global.am                   |   10 ++
 Makefile.am                      |    5 +
 Makefile.defs.in                 |   42 ------
 Makefile.in                      |    5 -
 Makefile.rules.in                |   96 --------------
 configure.ac                     |   49 ++++---
 include/cli.h                    |   18 +++
 include/nftables.h               |   14 +-
 install-sh                       |  269 --------------------------------------
 m4/.gitignore                    |    2 +
 src/Makefile.am                  |   41 ++++++
 src/Makefile.in                  |   33 -----
 src/cli.c                        |    2 +
 src/erec.c                       |    1 +
 src/main.c                       |    1 +
 src/{parser.y => parser_bison.y} |    3 +-
 src/scanner.l                    |    3 +-
 18 files changed, 122 insertions(+), 482 deletions(-)
 create mode 100644 Make_global.am
 create mode 100644 Makefile.am
 delete mode 100644 Makefile.defs.in
 delete mode 100644 Makefile.in
 delete mode 100644 Makefile.rules.in
 create mode 100644 include/cli.h
 delete mode 100755 install-sh
 create mode 100644 m4/.gitignore
 create mode 100644 src/Makefile.am
 delete mode 100644 src/Makefile.in
 rename src/{parser.y => parser_bison.y} (99%)
Signature · 1 line
1.7.10.4
author maintainer
#1 lore raw

PATCH 1/5 build: use PKG_CHECK_MODULES to check for libmnl and libnftnl

Also check for required library versions.

---
 Makefile.defs.in |    2 +-
 configure.ac     |    7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)
Makefile.defs.in +1 -1
index 915d3d8..b9b115f 100644
@@ -19,7 +19,7 @@ docdir		= @docdir@
 pdfdir		= @pdfdir@
 confdir		= @sysconfdir@/nftables
 
-LDFLAGS		+= @LDFLAGS@
+LDFLAGS		+= -lmnl -lnftnl
 LDFLAGS		+= @LIBS@
 
 CPPFLAGS	+= @CPPFLAGS@
configure.ac +2 -5
index 4aa14e3..e68d59f 100644
@@ -62,11 +62,8 @@ then
 fi
 
 # Checks for libraries.
-AC_CHECK_LIB([mnl], [mnl_socket_open], ,
-	     AC_MSG_ERROR([No suitable version of libmnl found]))
-
-AC_CHECK_LIB([nftnl], [nft_rule_alloc], ,
-	     AC_MSG_ERROR([No suitable version of libnftnl found]))
+PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
+PKG_CHECK_MODULES([LIBNFTNL], [libnftnl >= 1.0.2])
 
 AC_CHECK_LIB([gmp], [__gmpz_init], ,
 	     AC_MSG_ERROR([No suitable version of libgmp found]))
Signature · 1 line
1.7.10.4
author maintainer
#2 lore raw

PATCH 2/5 build: use AC_PROG_YACC and AM_PROG_LEX

In reply to Pablo Neira Ayuso

To check for bison and flex installed on the system.

---
 configure.ac |   27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)
configure.ac +15 -12
index e68d59f..ee9cf6c 100644
@@ -24,6 +24,21 @@ AC_PROG_CC
 AC_PROG_MKDIR_P
 AC_PROG_INSTALL
 AC_PROG_SED
+AM_PROG_LEX
+AC_PROG_YACC
+
+if test -z "$ac_cv_prog_YACC"
+then
+        echo "*** Error: No suitable bison/yacc found. ***"
+        echo "    Please install the 'bison' package."
+        exit 1
+fi
+if test -z "$ac_cv_prog_LEX"
+then
+        echo "*** Error: No suitable flex/lex found. ***"
+        echo "    Please install the 'flex' package."
+        exit 1
+fi
 
 AC_CHECK_PROG(CONFIG_MAN1, [docbook2x-man], [y], [n])
 if test "$CONFIG_MAN1" == "y"
@@ -49,18 +64,6 @@ then
 	AC_MSG_WARN([dblatex not found, no PDF manpages will be built])
 fi
 
-AC_PATH_PROG(LEX, [flex])
-if test -z "$LEX"
-then
-	AC_MSG_ERROR([No suitable version of flex found])
-fi
-
-AC_PATH_PROG(YACC, [bison])
-if test -z "$YACC"
-then
-	AC_MSG_ERROR([No suitable version of bison found])
-fi
-
 # Checks for libraries.
 PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
 PKG_CHECK_MODULES([LIBNFTNL], [libnftnl >= 1.0.2])
Signature · 1 line
1.7.10.4
author maintainer
#3 lore raw

PATCH 3/5 rename parser.y to parser_bison.y

In reply to Pablo Neira Ayuso

The conversion to the autotools need this.

Make sure you remove the autogenerated parser.c and parser.h from your tree.

---
 src/Makefile.in                  |    4 ++--
 src/{parser.y => parser_bison.y} |    2 +-
 src/scanner.l                    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
 rename src/{parser.y => parser_bison.y} (99%)
src/Makefile.in +2 -2
index 7ecc5f2..0c080f6 100644
@@ -26,8 +26,8 @@ nft-obj			+= utils.o
 nft-obj			+= erec.o
 nft-obj			+= mnl.o
 
-nft-obj			+= parser.o
-nft-extra-clean-files	+= parser.c parser.h
+nft-obj			+= parser_bison.o
+nft-extra-clean-files	+= parser_bison.c parser_bison.h
 
 nft-obj			+= scanner.o
 nft-extra-clean-files	+= scanner.c scanner.h
src/parser_bison.y renamed from src/parser.y +1 -1
similarity index 99%
rename from src/parser.y
rename to src/parser_bison.y
index 6209e9e..1c4046b 100644
@@ -32,7 +32,7 @@
 #include <parser.h>
 #include <erec.h>
 
-#include "parser.h"
+#include "parser_bison.h"
 #include "scanner.h"
 
 void parser_init(struct parser_state *state, struct list_head *msgs)
src/scanner.l +1 -1
index e36c3b1..e5f3a99 100644
@@ -20,7 +20,7 @@
 #include <erec.h>
 #include <rule.h>
 #include <parser.h>
-#include "parser.h"
+#include "parser_bison.h"
 
 #define YY_NO_INPUT
 
Signature · 1 line
1.7.10.4
author maintainer
#4 lore raw

PATCH 4/5 include: add cli.h

In reply to Pablo Neira Ayuso

Needed by follow up patches to use autotools.

---
 include/cli.h      |   18 ++++++++++++++++++
 include/nftables.h |   14 ++------------
 src/cli.c          |    1 +
 src/main.c         |    1 +
 4 files changed, 22 insertions(+), 12 deletions(-)
 create mode 100644 include/cli.h
include/cli.h new file +18 -0
new file mode 100644
index 0000000..89cb976
@@ -0,0 +1,18 @@
+#ifndef _NFT_CLI_H_
+#define _NFT_CLI_H_
+
+#include <config.h>
+
+struct parser_state;
+#ifdef HAVE_LIBREADLINE
+extern int cli_init(struct parser_state *state);
+#else
+static inline int cli_init(struct parser_state *state)
+{
+        return -1;
+}
+#endif
+extern void cli_exit(void);
+extern void cli_display(const char *fmt, va_list ap) __fmtstring(1, 0);
+
+#endif
include/nftables.h +2 -12
index 4c33ec6..cf19de8 100644
@@ -31,18 +31,6 @@ extern unsigned int handle_output;
 extern unsigned int debug_level;
 extern const char *include_paths[INCLUDE_PATHS_MAX];
 
-struct parser_state;
-#ifdef HAVE_LIBREADLINE
-extern int cli_init(struct parser_state *state);
-#else
-static inline int cli_init(struct parser_state *state)
-{
-	return -1;
-}
-#endif
-extern void cli_exit(void);
-extern void cli_display(const char *fmt, va_list ap) __fmtstring(1, 0);
-
 enum nftables_exit_codes {
 	NFT_EXIT_SUCCESS	= 0,
 	NFT_EXIT_FAILURE	= 1,
@@ -116,6 +104,8 @@ struct input_descriptor {
 	off_t				line_offset;
 };
 
+struct parser_state;
+
 int nft_run(void *scanner, struct parser_state *state, struct list_head *msgs);
 
 #endif /* NFTABLES_NFTABLES_H */
src/cli.c +1 -0
index f748a0e..6f2847b 100644
@@ -27,6 +27,7 @@
 #include <parser.h>
 #include <erec.h>
 #include <utils.h>
+#include <cli.h>
 
 #define CMDLINE_HISTFILE	".nft.history"
 
src/main.c +1 -0
index 1625914..b447aad 100644
@@ -25,6 +25,7 @@
 #include <netlink.h>
 #include <erec.h>
 #include <mnl.h>
+#include <cli.h>
 
 unsigned int max_errors = 10;
 unsigned int numeric_output;
Signature · 1 line
1.7.10.4
author maintainer
#5 lore raw

PATCH 5/5 build: autotools conversion

In reply to Pablo Neira Ayuso

1) This removes former Makefiles and install-sh (which is now automagically imported via autoreconf).

Makefile.defs.in
Makefile.in
Makefile.rules.in
src/Makefile.in
install-sh (now automagically imported via autoreconf).

2) CFLAGS are left the same, they are integrated into Make_global.am.

3) Add m4 directory to the tree which only contains the .gitignore file.

4) include <config.h> whenever required.

5) Minor adjustments to scanner.l and parser_bison.y to compile cleanly with autotools.

The doc/ and files/ conversion to automake will come in follow up patches.

---
 .gitignore         |   10 +-
 Make_global.am     |   10 ++
 Makefile.am        |    5 +
 Makefile.defs.in   |   42 --------
 Makefile.in        |    5 -
 Makefile.rules.in  |   96 -------------------
 configure.ac       |   15 ++-
 install-sh         |  269 ----------------------------------------------------
 m4/.gitignore      |    2 +
 src/Makefile.am    |   41 ++++++++
 src/Makefile.in    |   33 -------
 src/cli.c          |    1 +
 src/erec.c         |    1 +
 src/parser_bison.y |    1 -
 src/scanner.l      |    1 +
 15 files changed, 81 insertions(+), 451 deletions(-)
 create mode 100644 Make_global.am
 create mode 100644 Makefile.am
 delete mode 100644 Makefile.defs.in
 delete mode 100644 Makefile.in
 delete mode 100644 Makefile.rules.in
 delete mode 100755 install-sh
 create mode 100644 m4/.gitignore
 create mode 100644 src/Makefile.am
 delete mode 100644 src/Makefile.in
.gitignore +7 -3
index d26b395..7247daf 100644
@@ -2,10 +2,13 @@
 .*.d
 *.o
 
-# Generated by autoconf/configure
+# Generated by autoconf/configure/automake
+*.m4
 Makefile
-Makefile.defs
-Makefile.rules
+Makefile.in
+src/Makefile.in
+src/.deps/
+stamp-h1
 config.h
 config.h.in
 config.h.in~
@@ -13,6 +16,7 @@ config.log
 config.status
 configure
 autom4te.cache
+build-aux/
 
 # Debian package build temporary files
 build-stamp
Make_global.am new file +10 -0
new file mode 100644
index 0000000..8ad0eb0
@@ -0,0 +1,10 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" -D__USE_GNU
+
+AM_CFLAGS = -Wall	\
+	    -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations	\
+	    -Wdeclaration-after-statement -Wsign-compare -Winit-self		\
+	    -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute	\
+	    -Wcast-align -Wundef -Wbad-function-cast # -Wshadow			\
+	    -Waggregate-return -Wunused -Wwrite-strings				\
+	    ${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}
Makefile.am new file +5 -0
new file mode 100644
index 0000000..f48b08c
@@ -0,0 +1,5 @@
+include Make_global.am
+
+ACLOCAL_AMFLAGS	= -I m4
+
+SUBDIRS		= src
Makefile.defs.in deleted +0 -42

42 lines not on this page · raw message

Makefile.in deleted +0 -5
deleted file mode 100644
index 5d42541..0000000
@@ -1,5 +0,0 @@
-SUBDIRS		+= src
-SUBDIRS		+= files
-SUBDIRS		+= doc
-
-include Makefile.rules
Makefile.rules.in deleted +0 -96

96 lines not on this page · raw message

configure.ac +13 -2
index ee9cf6c..15bb3e9 100644
@@ -7,6 +7,15 @@ AC_COPYRIGHT([Copyright (c) 2008 Patrick McHardy <[email protected]>])
 AC_INIT([nftables], [0.3], [[email protected]])
 AC_DEFINE([RELEASE_NAME], ["Support Edward Snowden"], [Release name])
 
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CANONICAL_HOST
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
+        tar-pax no-dist-gzip dist-bzip2 1.6])
+
+dnl kernel style compile messages
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
 AC_CONFIG_SRCDIR([src/rule.c])
 AC_CONFIG_HEADER([config.h])
 
@@ -77,8 +86,10 @@ AC_ARG_WITH([cli], [AS_HELP_STRING([--without-cli],
 AS_IF([test "x$with_cli" != xno], [
 AC_CHECK_LIB([readline], [readline], ,
 	     AC_MSG_ERROR([No suitable version of libreadline found]))
+AC_DEFINE([HAVE_LIBREADLINE], [1], [])
 ])
 AC_SUBST(with_cli)
+AM_CONDITIONAL([BUILD_CLI], [test "x$with_cli" != xno])
 
 # Checks for header files.
 AC_HEADER_STDC
@@ -108,6 +119,6 @@ AC_TYPE_UINT64_T
 # Checks for library functions.
 AC_CHECK_FUNCS([memmove memset strchr strdup strerror strtoull])
 
-AC_CONFIG_FILES([Makefile Makefile.defs Makefile.rules])
-AC_CONFIG_FILES([src/Makefile doc/Makefile files/Makefile])
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([src/Makefile])
 AC_OUTPUT
install-sh deleted +0 -269

269 lines not on this page · raw message

m4/.gitignore new file +2 -0
new file mode 100644
index 0000000..d6b7ef3
@@ -0,0 +1,2 @@
+*
+!.gitignore
src/Makefile.am new file +41 -0

41 lines not on this page · raw message

src/Makefile.in deleted +0 -33
deleted file mode 100644
index 0c080f6..0000000
@@ -1,33 +0,0 @@
-PROGRAMS		+= nft
-
-nft-destdir		:= @sbindir@
-
-nft-obj			+= main.o
-ifeq (@with_cli@,yes)
-nft-obj			+= cli.o
-endif
-nft-obj			+= rule.o
-nft-obj			+= statement.o
-nft-obj			+= datatype.o
-nft-obj			+= expression.o
-nft-obj			+= evaluate.o
-nft-obj			+= proto.o
-nft-obj			+= payload.o
-nft-obj			+= exthdr.o
-nft-obj			+= meta.o
-nft-obj			+= ct.o
-nft-obj			+= netlink.o
-nft-obj			+= netlink_linearize.o
-nft-obj			+= netlink_delinearize.o
-nft-obj			+= segtree.o
-nft-obj			+= rbtree.o
-nft-obj			+= gmputil.o
-nft-obj			+= utils.o
-nft-obj			+= erec.o
-nft-obj			+= mnl.o
-
-nft-obj			+= parser_bison.o
-nft-extra-clean-files	+= parser_bison.c parser_bison.h
-
-nft-obj			+= scanner.o
-nft-extra-clean-files	+= scanner.c scanner.h
src/cli.c +1 -0
index 6f2847b..f3827b8 100644
@@ -12,6 +12,7 @@
  * Development of this code funded by Astaro AG (http://www.astaro.com/)
  */
 
+#include <config.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
src/erec.c +1 -0
index 4930085..82543e6 100644
@@ -8,6 +8,7 @@
  * Development of this code funded by Astaro AG (http://www.astaro.com/)
  */
 
+#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
src/parser_bison.y +0 -1
index 1c4046b..6099aca 100644
@@ -33,7 +33,6 @@
 #include <erec.h>
 
 #include "parser_bison.h"
-#include "scanner.h"
 
 void parser_init(struct parser_state *state, struct list_head *msgs)
 {
src/scanner.l +1 -0
index e5f3a99..12af2d8 100644
@@ -169,6 +169,7 @@ ip6addr		({v680}|{v67}|{v66}|{v65}|{v64}|{v63}|{v62}|{v61}|{v60})
 addrstring	({macaddr}|{ip4addr}|{ip6addr})
 
 %option prefix="nft_"
+%option outfile="lex.yy.c"
 %option reentrant
 %option noyywrap
 %option nounput
Signature · 1 line
1.7.10.4
#6 lore raw

Re: [PATCH nft 5/5] build: autotools conversion

Quoted 1 line · Pablo Neira Ayuso

+AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" -D__USE_GNU

feature_test_macros(7) specifies _GNU_SOURCE rather than __USE_GNU.

Make_global.am line 10

Quoted 7 lines
Make_global.am new file +7 -0
+AM_CFLAGS = -Wall	\
+	    -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations	\
+	    -Wdeclaration-after-statement -Wsign-compare -Winit-self		\
+	    -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute	\
+	    -Wcast-align -Wundef -Wbad-function-cast # -Wshadow			\
+	    -Waggregate-return -Wunused -Wwrite-strings				\
+	    ${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}

You have a # in there, which causes the remaining -W and -I from LIBMNL_CFLAGS to be absent from the compilation line.

LIBMNL_CFLAGS and LIBNFTNL_CFLAGS should be in AM_CPPFLAGS because they are, well, cppflags. (It's a pkgconfig "bug"). This was properly done in the original autotools submissions.

m4/.gitignore line 2

Quoted 5 lines
m4/.gitignore new file +2 -0
@@ -0,0 +1,2 @@
+*
+!.gitignore

The last entry is not needed, because .gitignore would already be unignored because it is tracked.

/lt*.m4
/libtool.m4

as in the original submission would ensure that no more files are ignored than absolutely necessary, so as to be aware of potential additional files popping up.

Quoted 10 lines
src/scanner.l +0 -0
@@ -169,6 +169,7 @@ ip6addr		({v680}|{v67}|{v66}|{v65}|{v64}|{v63}|{v62}|{v61}|{v60})
 addrstring	({macaddr}|{ip4addr}|{ip6addr})
 

%option prefix="nft_"
+%option outfile="lex.yy.c"
%option reentrant
%option noyywrap
%option nounput

Why is this needed? The default output filename is already lex.yy.c (and ylwrap will rename it anyway).

#7 lore raw

Re: [PATCH nft 5/5] build: autotools conversion

In reply to Pablo Neira Ayuso
Quoted 6 lines · Pablo Neira Ayuso
Make_global.am new file +0 -0
new file mode 100644
index 0000000..8ad0eb0

Make_global.am line 10

Quoted 10 lines
Make_global.am new file +10 -0
@@ -0,0 +1,10 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" -D__USE_GNU
+
+AM_CFLAGS = -Wall	\
+	    -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations	\
+	    -Wdeclaration-after-statement -Wsign-compare -Winit-self		\
+	    -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute	\
+	    -Wcast-align -Wundef -Wbad-function-cast # -Wshadow			\
+	    -Waggregate-return -Wunused -Wwrite-strings				\
+	    ${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}

why do you need this new file? The #include in the main Makefile.am is useless because you do not build anything there; the only right place to have these definitions is under src/Makefile.am.

giorgio

#8 lore raw

PATCH 1/1 autotools conversion fixups

In reply to Pablo Neira Ayuso

From: root <root@lord_casco.spaceball>

Add some missing Makefile.am's under the include directory.

Now it is possible to build 'nftables' from a separate build directory and produce a release tar archive with a 'make distcheck'.

---
 Make_global.am                      | 10 ----------
 Makefile.am                         |  5 ++---
 autogen.sh                          |  9 ++++++++-
 configure.ac                        |  9 +++++++--
 include/Makefile.am                 | 22 ++++++++++++++++++++++
 include/linux/Makefile.am           |  7 +++++++
 include/linux/netfilter/Makefile.am |  5 +++++
 src/Makefile.am                     | 14 ++++++++++++--
 8 files changed, 63 insertions(+), 18 deletions(-)
 delete mode 100644 Make_global.am
 create mode 100644 include/Makefile.am
 create mode 100644 include/linux/Makefile.am
 create mode 100644 include/linux/netfilter/Makefile.am
Make_global.am deleted +0 -10
deleted file mode 100644
index fbad2a6..0000000
@@ -1,10 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\""
-		${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}
-
-AM_CFLAGS = -Wall								\
-	    -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations	\
-	    -Wdeclaration-after-statement -Wsign-compare -Winit-self		\
-	    -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute	\
-	    -Wcast-align -Wundef -Wbad-function-cast
-	    -Waggregate-return -Wunused -Wwrite-strings
Makefile.am +2 -3
index f48b08c..8d301f6 100644
@@ -1,5 +1,4 @@
-include Make_global.am
-
 ACLOCAL_AMFLAGS	= -I m4
 
-SUBDIRS		= src
+SUBDIRS = 	src	\
+		include
autogen.sh +8 -1
index a62e737..4b6b92d 100755
@@ -1,4 +1,11 @@
 #!/bin/bash
 
-autoreconf -fi;
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -vfi || exit 1
 rm -Rf autom4te*.cache config.h.in~
+cd $ORIGDIR || exit $?
configure.ac +7 -2
index 15bb3e9..ddba5e2 100644
@@ -119,6 +119,11 @@ AC_TYPE_UINT64_T
 # Checks for library functions.
 AC_CHECK_FUNCS([memmove memset strchr strdup strerror strtoull])
 
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([src/Makefile])
+AC_CONFIG_FILES([					\
+		Makefile				\
+		src/Makefile				\
+		include/Makefile			\
+		include/linux/Makefile			\
+		include/linux/netfilter/Makefile	\
+		])
 AC_OUTPUT
include/Makefile.am new file +22 -0
new file mode 100644
index 0000000..f22561b
@@ -0,0 +1,22 @@
+SUBDIRS = linux
+
+noinst_HEADERS = 	cli.h		\
+			datatype.h	\
+			expression.h	\
+			gmputil.h	\
+			mnl.h		\
+			nftables.h	\
+			payload.h	\
+			rbtree.h	\
+			statement.h	\
+			ct.h		\
+			erec.h		\
+			exthdr.h	\
+			headers.h	\
+			list.h		\
+			meta.h		\
+			netlink.h	\
+			parser.h	\
+			proto.h		\
+			rule.h		\
+			utils.h
include/linux/Makefile.am new file +7 -0
new file mode 100644
index 0000000..9fb010b
@@ -0,0 +1,7 @@
+SUBDIRS = netfilter
+noinst_HEADERS =	netfilter_arp.h		\
+			netfilter_bridge.h	\
+			netfilter_decnet.h	\
+			netfilter.h		\
+			netfilter_ipv4.h	\
+			netfilter_ipv6.h
include/linux/netfilter/Makefile.am new file +5 -0
new file mode 100644
index 0000000..54b59b5
@@ -0,0 +1,5 @@
+noinst_HEADERS = 	nf_conntrack_common.h		\
+			nf_conntrack_tuple_common.h	\
+			nf_nat.h			\
+			nf_tables.h			\
+			nfnetlink.h
src/Makefile.am +12 -2
index 8a6471a..0a67810 100644
@@ -1,9 +1,19 @@
-include $(top_srcdir)/Make_global.am
-
 sbin_PROGRAMS = nft
 
 CLEANFILES = scanner.c parser_bison.c
 
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\""
+		${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS}
+
+AM_CFLAGS = -Wall								\
+	    -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations	\
+	    -Wdeclaration-after-statement -Wsign-compare -Winit-self		\
+	    -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute	\
+	    -Wcast-align -Wundef -Wbad-function-cast
+	    -Waggregate-return -Wunused -Wwrite-strings
+
+
 AM_YFLAGS = -d
 
 # yacc and lex generate dirty code
Signature · 1 line
2.1.3
author maintainer
#9 lore raw

Re: [PATCH 1/1] autotools conversion fixups

Quoted 6 lines · On Sun, Nov 09, 2014 at 09:26:12PM +0100, [email protected] wrote:

From: root <root@lord_casco.spaceball>

Add some missing Makefile.am's under the include directory.

Now it is possible to build 'nftables' from a separate build directory and produce a release tar archive with a 'make distcheck'.

Thanks. I have merged this update to nftables/autotools branch:

git.netfilter.org/nftables/commit/?h=autotools&id=85035b6c6a1618e7ba726fe6306c804fc1b6c4e8

Quoted 7 lines
autogen.sh +0 -0
index a62e737..4b6b92d 100755
@@ -1,4 +1,11 @@
 #!/bin/bash
 

autogen.sh line 11

Quoted 10 lines
autogen.sh +8 -1
-autoreconf -fi;
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -vfi || exit 1
 rm -Rf autom4te*.cache config.h.in~
+cd $ORIGDIR || exit $?

The need for this chunk was not justified, I kept this back.