mbox

nftables: use automake & pkgconfig

Message ID 1382280491-9921-1-git-send-email-jengelh@inai.de
State Deferred
Headers show

Pull-request

git://git.inai.de/nftables master

Message

Jan Engelhardt Oct. 20, 2013, 2:48 p.m. UTC
The following changes since commit 2855909e46f4646f137a96892bd5c465fa1193f8:

  src: fix return code (2013-10-17 11:08:40 +0200)

are available in the git repository at:

  git://git.inai.de/nftables master

for you to fetch changes up to af2a890f6fa39d09240b85811a430b51b88a866e:

  build: use automake and pkgconfig (2013-10-20 16:36:53 +0200)

----------------------------------------------------------------
Jan Engelhardt (3):
      build: remove unused checks
      build: rename conflicting parser.h instances
      build: use automake and pkgconfig

 .gitignore                      |  17 +--
 Makefile.am                     |   7 ++
 Makefile.defs.in                |  40 ------
 Makefile.in                     |   5 -
 Makefile.rules.in               |  89 -------------
 configure.ac                    |  70 ++++-------
 doc/Makefile.am                 |  14 +++
 doc/Makefile.in                 |  20 ---
 files/Makefile.am               |   6 +
 files/Makefile.in               |   4 -
 install-sh                      | 269 ----------------------------------------
 src/.gitignore                  |   4 +-
 src/Makefile.am                 |  24 ++++
 src/Makefile.in                 |  30 -----
 src/cli.c                       |   1 +
 src/erec.c                      |   1 +
 src/main.c                      |   1 +
 src/{parser.y => parser_impl.y} |   2 +-
 src/scanner.l                   |   2 +-
 19 files changed, 90 insertions(+), 516 deletions(-)
 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 doc/Makefile.am
 delete mode 100644 doc/Makefile.in
 create mode 100644 files/Makefile.am
 delete mode 100644 files/Makefile.in
 delete mode 100755 install-sh
 create mode 100644 src/Makefile.am
 delete mode 100644 src/Makefile.in
 rename src/{parser.y => parser_impl.y} (99%)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jan Engelhardt Nov. 17, 2013, 8:39 p.m. UTC | #1
On Sunday 2013-10-20 16:48, Jan Engelhardt wrote:
>are available in the git repository at:
>
>  git://git.inai.de/nftables master
>
>for you to fetch changes up to af2a890f6fa39d09240b85811a430b51b88a866e:
>Jan Engelhardt (3):
>      build: remove unused checks
>      build: rename conflicting parser.h instances
>      build: use automake and pkgconfig

Any verdict on these?
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso Nov. 19, 2013, 8:28 p.m. UTC | #2
On Sun, Oct 20, 2013 at 04:48:11PM +0200, Jan Engelhardt wrote:
> This now also honors the cflags as obtained from pkgconfig, otherwise
> one gets a compile error if the headers are in a location other than
> /usr/include.

I don't want to consider changing the build system at this stage.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Engelhardt Nov. 20, 2013, 10:54 a.m. UTC | #3
On Tuesday 2013-11-19 21:28, Pablo Neira Ayuso wrote:

>On Sun, Oct 20, 2013 at 04:48:11PM +0200, Jan Engelhardt wrote:
>> This now also honors the cflags as obtained from pkgconfig, otherwise
>> one gets a compile error if the headers are in a location other than
>> /usr/include.
>
>I don't want to consider changing the build system at this stage.

At this stage, the build is rather broken, for cases that are not
even far-fetched.



10:08 ares07:../nftables/obj > ../configure
[...]
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile.defs
config.status: creating Makefile.rules
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating files/Makefile
config.status: creating config.h
10:08 ares07:../nftables/obj > make -j8
  SUBDIR        src/
  SUBDIR        doc/
  SUBDIR        files/
make[1]: *** No rule to make target `src/main.o', needed by `src/nft'.  Stop.
make: *** [src] Error 2
make: *** Waiting for unfinished jobs....

	^ builddir!=srcdir not handled


10:09 ares07:../nftables/nftables > configure
[...]
10:09 ares07:../nftables/nftables > make -j8
  SUBDIR        src/
  SUBDIR        files/
  SUBDIR        doc/
  LEX           src/scanner.l
  YACC          src/parser.y
  DEP           src/mnl.c
  DEP           src/erec.c
src/mnl.c:11:27: fatal error: libmnl/libmnl.h: No such file or directory
 #include <libmnl/libmnl.h>

	^ pkgconfig files ignored


10:17 ares07:../nftables/nftables > make CPPFLAGS=/usr/include/pkg/libnftables
  SUBDIR        src/
  CC            src/main.c
In file included from src/main.c:25:0:
include/netlink.h:4:31: fatal error: libnftables/table.h: No such file or directory

	^ CPPFLAGS ignored


10:17 ares07:../nftables/nftables > make CPPFLAGS+=/usr/include/pkg/libnftables
  SUBDIR        src/
  CC            src/main.c
In file included from src/main.c:25:0:
include/netlink.h:4:31: fatal error: libnftables/table.h: No such file or directory

	^ so is the (unusual) approach of working around with +=


10:13 ares07:../nftables/nftables > make CFLAGS=-I/usr/include/pkg/libnftables
  SUBDIR        src/
  CC            src/main.c
src/main.c:21:22: fatal error: nftables.h: No such file or directory
 #include <nftables.h>

	^ CFLAGS ignored as well


10:15 ares07:../nftables/nftables > ./configure CFLAGS=-I/usr/include/pkg/libnftables
[...]
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile.defs
config.status: creating Makefile.rules
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating files/Makefile
config.status: creating config.h
config.status: config.h is unchanged
10:15 ares07:../nftables/nftables > make
  SUBDIR        src/
  LEX           src/scanner.l
  DEP           src/scanner.c
In file included from src/scanner.l:21:0:
/usr/include/pkg/libnftables/rule.h:9:32: fatal error: libnftables/common.h: No such file or directory

	^ CFLAGS/CPPFLAGS specified at configure time are ignored as well


11:42 ares07:../nftables/nftables > make install DESTDIR=/tmp/foo
  SUBDIR        src/
  INSTALL       nft
/usr/bin/install: cannot change ownership of ‘/tmp/foo//usr/x86_64-suse-linux/sys-root/sbin/nft’: Operation not permitted
make[1]: *** [nft-install] Error 1
make: *** [src] Error 2

	^ install uses -o root -g root, which fails if you are not
	already root (in which case -o/-g is pointless, because install
	defaults to using root anyway)

	* There is no way to get a verbose build

	* Makefile runs a separate "DEPS" stage even though there is
	absolutely no need to

  CC            src/scanner.c
<stdout>: In function ‘nft_lex’:
<stdout>:1738:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

I'll overlook -Werror for now…


	* Remake is oddly broken (compiler throws errors).
	(Patch 2 would probably fix that in the same go too.)
	This is especially nasty, because despite the gcc error given,
	the build completes.


$ make clean
  SUBDIR	src/
  CLEAN		nft
  SUBDIR	files/
  SUBDIR	doc/
  CLEAN		doc
$ make -j8
  SUBDIR	src/
  SUBDIR	doc/
  SUBDIR	files/
  LEX		src/scanner.l
  YACC		src/parser.y
  DEP		src/mnl.c
  DEP		src/erec.c
  DEP		src/utils.c
  DEP		src/gmputil.c
  DEP		src/rbtree.c
  DEP		src/segtree.c
  DEP		src/netlink_delinearize.c
  DEP		src/netlink_linearize.c
  DEP		src/netlink.c
  DEP		src/ct.c
  DEP		src/meta.c
  DEP		src/exthdr.c
  DEP		src/payload.c
  DEP		src/evaluate.c
  DEP		src/expression.c
  DEP		src/datatype.c
  DEP		src/statement.c
  DEP		src/rule.c
  DEP		src/cli.c
  DEP		src/main.c
  DEP		src/scanner.c
  DEP		src/parser.c
  LEX		src/scanner.l
  YACC		src/parser.y
  DEP		src/scanner.c
  DEP		src/parser.c
  CC		src/main.c
  CC		src/cli.c
  CC		src/rule.c
  CC		src/statement.c
  CC		src/datatype.c
  CC		src/expression.c
  CC		src/evaluate.c
  CC		src/payload.c
  CC		src/exthdr.c
  CC		src/meta.c
  CC		src/ct.c
  CC		src/netlink.c
  CC		src/netlink_linearize.c
  CC		src/netlink_delinearize.c
  CC		src/segtree.c
  CC		src/rbtree.c
  CC		src/gmputil.c
  CC		src/utils.c
  CC		src/erec.c
  CC		src/mnl.c
  CC		src/parser.c
  CC		src/scanner.c
<stdout>: In function ‘nft_lex’:
<stdout>:1738:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
<stdout>: In function ‘nft__scan_bytes’:
<stdout>:3583:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  LD		src/nft
$ touch Makefile.rules
$ make -j1
  SUBDIR	src/
  LEX		src/scanner.l
  YACC		src/parser.y
src/parser.y: warning: conflicting outputs to file ‘src/parser.h’
  DEP		src/scanner.c
In file included from src/parser.y:28:0,
                 from src/parser.y:28,
                 from src/parser.y:28,
                 from src/parser.y:28, [repeated over 20 times]
                 from src/parser.y:28,
                 from src/scanner.l:23:
src/parser.y:13:20: error: #include nested too deeply
 #include <stddef.h>
                    ^
src/parser.y:14:19: error: #include nested too deeply
 #include <stdio.h>
                   ^
src/parser.y:15:22: error: #include nested too deeply
 #include <inttypes.h>
                      ^
src/parser.y:16:24: error: #include nested too deeply
 #include <netinet/ip.h>
                        ^
src/parser.y:17:29: error: #include nested too deeply
 #include <linux/netfilter.h>
                             ^
src/parser.y:18:39: error: #include nested too deeply
 #include <linux/netfilter/nf_tables.h>
                                       ^
src/parser.y:19:55: error: #include nested too deeply
 #include <linux/netfilter/nf_conntrack_tuple_common.h>
                                                       ^
src/parser.y:21:18: error: #include nested too deeply
 #include <rule.h>
                  ^
src/parser.y:22:23: error: #include nested too deeply
 #include <statement.h>
                       ^
src/parser.y:23:24: error: #include nested too deeply
 #include <expression.h>
                        ^
src/parser.y:24:19: error: #include nested too deeply
 #include <utils.h>
                   ^
src/parser.y:25:20: error: #include nested too deeply
 #include <parser.h>
                    ^
src/parser.y:26:18: error: #include nested too deeply
 #include <erec.h>
                  ^
src/parser.y:28:20: error: #include nested too deeply
 #include "parser.h"
                    ^
src/parser.y:29:21: error: #include nested too deeply
 #include "scanner.h"
                     ^
In file included from src/parser.y:28:0,
                 from src/parser.y:28,
                 from src/scanner.l:23:
src/parser.h:1673:56: error: #include nested too deeply
 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
                                                        ^
In file included from src/parser.y:29:0,
                 from src/parser.y:28,
                 from src/scanner.l:23:
src/scanner.h:36:19: error: #include nested too deeply
 #include <stdio.h>
                   ^
src/scanner.h:37:20: error: #include nested too deeply
 #include <string.h>
                    ^
src/scanner.h:38:19: error: #include nested too deeply
 #include <errno.h>
                   ^
src/scanner.h:39:20: error: #include nested too deeply
 #include <stdlib.h>
                    ^
src/scanner.h:299:20: error: #include nested too deeply
 #include <unistd.h>
                    ^
  DEP		src/parser.c
In file included from src/parser.y:28:0,
                 from src/parser.y:28,
                 from src/parser.y:28:
src/parser.y:13:20: error: #include nested too deeply
 #include <stddef.h>
                    ^
src/parser.y:14:19: error: #include nested too deeply
 #include <stdio.h>
                   ^
src/parser.y:15:22: error: #include nested too deeply
 #include <inttypes.h>
                      ^
src/parser.y:16:24: error: #include nested too deeply
 #include <netinet/ip.h>
                        ^
src/parser.y:17:29: error: #include nested too deeply
 #include <linux/netfilter.h>
                             ^
src/parser.y:18:39: error: #include nested too deeply
 #include <linux/netfilter/nf_tables.h>
                                       ^
src/parser.y:19:55: error: #include nested too deeply
 #include <linux/netfilter/nf_conntrack_tuple_common.h>
                                                       ^
src/parser.y:21:18: error: #include nested too deeply
 #include <rule.h>
                  ^
src/parser.y:22:23: error: #include nested too deeply
 #include <statement.h>
                       ^
src/parser.y:23:24: error: #include nested too deeply
 #include <expression.h>
                        ^
src/parser.y:24:19: error: #include nested too deeply
 #include <utils.h>
                   ^
src/parser.y:25:20: error: #include nested too deeply
 #include <parser.h>
                    ^
src/parser.y:26:18: error: #include nested too deeply
 #include <erec.h>
                  ^
src/parser.y:28:20: error: #include nested too deeply
 #include "parser.h"
                    ^
src/parser.y:29:21: error: #include nested too deeply
 #include "scanner.h"
                     ^
In file included from src/parser.y:28:0,
                 from src/parser.y:28,
                 from src/parser.y:28:
src/parser.h:1673:56: error: #include nested too deeply
 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
                                                        ^
In file included from src/parser.y:29:0,
                 from src/parser.y:28,
                 from src/parser.y:28:
src/scanner.h:36:19: error: #include nested too deeply
 #include <stdio.h>
                   ^
src/scanner.h:37:20: error: #include nested too deeply
 #include <string.h>
                    ^
src/scanner.h:38:19: error: #include nested too deeply
 #include <errno.h>
                   ^
src/scanner.h:39:20: error: #include nested too deeply
 #include <stdlib.h>
                    ^
src/scanner.h:299:20: error: #include nested too deeply
 #include <unistd.h>
                    ^
  DEP		src/mnl.c
  DEP		src/erec.c
  DEP		src/utils.c
  DEP		src/gmputil.c
  DEP		src/rbtree.c
  DEP		src/segtree.c
  DEP		src/netlink_delinearize.c
  DEP		src/netlink_linearize.c
  DEP		src/netlink.c
  DEP		src/ct.c
  DEP		src/meta.c
  DEP		src/exthdr.c
  DEP		src/payload.c
  DEP		src/evaluate.c
  DEP		src/expression.c
  DEP		src/datatype.c
  DEP		src/statement.c
  DEP		src/rule.c
  DEP		src/cli.c
  DEP		src/main.c
  YACC		src/parser.y
  DEP		src/parser.c
  CC		src/main.c
  CC		src/cli.c
  CC		src/rule.c
  CC		src/statement.c
  CC		src/datatype.c
  CC		src/expression.c
  CC		src/evaluate.c
  CC		src/payload.c
  CC		src/exthdr.c
  CC		src/meta.c
  CC		src/ct.c
  CC		src/netlink.c
  CC		src/netlink_linearize.c
  CC		src/netlink_delinearize.c
  CC		src/segtree.c
  CC		src/rbtree.c
  CC		src/gmputil.c
  CC		src/utils.c
  CC		src/erec.c
  CC		src/mnl.c
  CC		src/parser.c
  CC		src/scanner.c
<stdout>: In function ‘nft_lex’:
<stdout>:1738:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
<stdout>: In function ‘nft__scan_bytes’:
<stdout>:3583:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  LD		src/nft
  SUBDIR	files/
  SUBDIR	doc/
ares07:../nftables/nftables > echo $?
0
ares07:../nftables/nftables >
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomasz Bursztyka Nov. 20, 2013, 11:11 a.m. UTC | #4
Hi Jan and Pablo,

I prefer this automake approach against current one, for instance:

>    CC            src/scanner.c
> <stdout>: In function ‘nft_lex’:
> <stdout>:1738:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>
> I'll overlook -Werror for now…

This error could be better fixed with a Makefile.am as proposed in this 
patchset, as found in 
http://git.netfilter.org/conntrack-tools/tree/src/Makefile.am
Let's keep -Werror on all files but the crappy auto-generated bison/flex 
ones.

It's better breaking and fixing the built files now rather than after 
linux 3.13 release.

Tomasz


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso Nov. 20, 2013, 1:54 p.m. UTC | #5
On Wed, Nov 20, 2013 at 01:11:14PM +0200, Tomasz Bursztyka wrote:
> Hi Jan and Pablo,
> 
> I prefer this automake approach against current one, for instance:
> 
> >   CC            src/scanner.c
> ><stdout>: In function ‘nft_lex’:
> ><stdout>:1738:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> >
> >I'll overlook -Werror for now…
> 
> This error could be better fixed with a Makefile.am as proposed in
> this patchset, as found in
> http://git.netfilter.org/conntrack-tools/tree/src/Makefile.am
> Let's keep -Werror on all files but the crappy auto-generated
> bison/flex ones.

I used to have -Werror in conntrack-tools for long time, it was
breaking easily with stupid warnings with different gcc compiler
versions and platforms. People were manually removing it to get things
working.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso Nov. 20, 2013, 2:06 p.m. UTC | #6
On Wed, Nov 20, 2013 at 11:54:21AM +0100, Jan Engelhardt wrote:
> On Tuesday 2013-11-19 21:28, Pablo Neira Ayuso wrote:
> 
> >On Sun, Oct 20, 2013 at 04:48:11PM +0200, Jan Engelhardt wrote:
> >> This now also honors the cflags as obtained from pkgconfig, otherwise
> >> one gets a compile error if the headers are in a location other than
> >> /usr/include.
> >
> >I don't want to consider changing the build system at this stage.
> 
> At this stage, the build is rather broken, for cases that are not
> even far-fetched.

Then fix what we already have.

If you convince me in that it is way too complex to make it, then I'll
consider this move to automake.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Engelhardt Nov. 20, 2013, 2:14 p.m. UTC | #7
On Wednesday 2013-11-20 15:06, Pablo Neira Ayuso wrote:
>On Wed, Nov 20, 2013 at 11:54:21AM +0100, Jan Engelhardt wrote:
>> On Tuesday 2013-11-19 21:28, Pablo Neira Ayuso wrote:
>> 
>> >On Sun, Oct 20, 2013 at 04:48:11PM +0200, Jan Engelhardt wrote:
>> >> This now also honors the cflags as obtained from pkgconfig, otherwise
>> >> one gets a compile error if the headers are in a location other than
>> >> /usr/include.
>> >
>> >I don't want to consider changing the build system at this stage.
>> 
>> At this stage, the build is rather broken, for cases that are not
>> even far-fetched.
>
>Then fix what we already have.
>
>If you convince me in that it is way too complex to make it, then
>I'll consider this move to automake.

Was the diffstat not convincing enough that the automake way (which
fixes many of the reported issues) is preferable to the manual way
(which is yet unfixed and would need more lines)?

 16 files changed, 87 insertions(+), 482 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Engelhardt Dec. 6, 2013, 5:47 p.m. UTC | #8
On Wednesday 2013-11-20 15:14, Jan Engelhardt wrote:
>>
>>If you convince me in that it is way too complex to make it, then
>>I'll consider this move to automake.
>
> 16 files changed, 87 insertions(+), 482 deletions(-)

Is this ever going to be merged or not? Shelving 400 lines should speak 
for the simplicity of this proposal.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html