All of lore.kernel.org
 help / color / mirror / Atom feed
* [conntrack-tools 0/6] Build fixes
@ 2021-09-25 15:10 Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 1/6] build: remove commented-out macros from configure.ac Jeremy Sowden
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 15:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

The first three patches contain changes suggested by autoupdate.  Four
and five bring the handling of the yacc- and lex-generated sources more
in line with the automake doc's.  The last one fixes a race in parallel
builds.

Jeremy Sowden (6):
  build: remove commented-out macros from configure.ac
  build: quote AC_INIT arguments
  build: replace `AM_PROG_LIBTOOL` and `AC_DISABLE_STATIC` with
    `LT_INIT`
  build: remove yacc-generated header from EXTRA_DIST
  build: clean yacc- and lex-generated files with maintainer-clean
  build: fix dependency-tracking of yacc-generated header

 configure.ac    | 30 ++----------------------------
 src/Makefile.am |  5 ++---
 2 files changed, 4 insertions(+), 31 deletions(-)

-- 
2.33.0


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

* [conntrack-tools 1/6] build: remove commented-out macros from configure.ac
  2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
@ 2021-09-25 15:10 ` Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 2/6] build: quote AC_INIT arguments Jeremy Sowden
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 15:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

This code has been commented out since at least 2007.

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

diff --git a/configure.ac b/configure.ac
index d0565bed3532..5ff8921b6fc8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,37 +75,12 @@ AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
 
 AC_CHECK_HEADERS([linux/capability.h],, [AC_MSG_ERROR([Cannot find linux/capabibility.h])])
 
-# Checks for libraries.
-# FIXME: Replace `main' with a function in `-lc':
-dnl AC_CHECK_LIB([c], [main])
-# FIXME: Replace `main' with a function in `-ldl':
-
 AC_CHECK_HEADERS(arpa/inet.h)
-dnl check for inet_pton
 AC_CHECK_FUNCS(inet_pton)
 
-# Checks for header files.
-dnl AC_HEADER_STDC
-dnl AC_CHECK_HEADERS([netinet/in.h stdlib.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-dnl AC_C_CONST
-dnl AC_C_INLINE
-
 # Let nfct use dlopen() on helper libraries without resolving all symbols.
 AX_CHECK_LINK_FLAG([-Wl,-z,lazy], [AC_SUBST([LAZY_LDFLAGS], [-Wl,-z,lazy])])
 
-# Checks for library functions.
-dnl AC_FUNC_MALLOC
-dnl AC_FUNC_VPRINTF
-dnl AC_CHECK_FUNCS([memset])
-
-dnl AC_CONFIG_FILES([Makefile
-dnl                  debug/Makefile
-dnl                  debug/src/Makefile
-dnl                  extensions/Makefile
-dnl                  src/Makefile])
-
 if test ! -z "$libdir"; then
 	MODULE_DIR="\\\"$libdir/conntrack-tools/\\\""
 	CFLAGS="$CFLAGS -DCONNTRACKD_LIB_DIR=$MODULE_DIR"
-- 
2.33.0


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

* [conntrack-tools 2/6] build: quote AC_INIT arguments
  2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 1/6] build: remove commented-out macros from configure.ac Jeremy Sowden
@ 2021-09-25 15:10 ` Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 3/6] build: replace `AM_PROG_LIBTOOL` and `AC_DISABLE_STATIC` with `LT_INIT` Jeremy Sowden
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 15:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

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

diff --git a/configure.ac b/configure.ac
index 5ff8921b6fc8..c690a92be5fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(conntrack-tools, 1.4.6, pablo@netfilter.org)
+AC_INIT([conntrack-tools],[1.4.6],[pablo@netfilter.org])
 AC_CONFIG_AUX_DIR([build-aux])
 
 AC_CANONICAL_HOST
-- 
2.33.0


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

* [conntrack-tools 3/6] build: replace `AM_PROG_LIBTOOL` and `AC_DISABLE_STATIC` with `LT_INIT`
  2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 1/6] build: remove commented-out macros from configure.ac Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 2/6] build: quote AC_INIT arguments Jeremy Sowden
@ 2021-09-25 15:10 ` Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 4/6] build: remove yacc-generated header from EXTRA_DIST Jeremy Sowden
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 15:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

`AM_PROG_LIBTOOL` is superseded by `LT_INIT`, which also accepts options
to control the defaults for creating shared or static libraries.

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

diff --git a/configure.ac b/configure.ac
index c690a92be5fd..3a3af4549162 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,9 +13,8 @@ AC_SEARCH_LIBS([dlopen], [dl], [libdl_LIBS="$LIBS"; LIBS=""])
 AC_SUBST([libdl_LIBS])
 
 AC_PROG_CC
-AC_DISABLE_STATIC
 AM_PROG_AR
-AM_PROG_LIBTOOL
+LT_INIT([disable-static])
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AM_PROG_LEX
-- 
2.33.0


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

* [conntrack-tools 4/6] build: remove yacc-generated header from EXTRA_DIST
  2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
                   ` (2 preceding siblings ...)
  2021-09-25 15:10 ` [conntrack-tools 3/6] build: replace `AM_PROG_LIBTOOL` and `AC_DISABLE_STATIC` with `LT_INIT` Jeremy Sowden
@ 2021-09-25 15:10 ` Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 5/6] build: clean yacc- and lex-generated files with maintainer-clean Jeremy Sowden
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 15:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Automake generates yacc and lex output files and includes them in
distributions as a matter of course.

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

diff --git a/src/Makefile.am b/src/Makefile.am
index 2e66ee96b709..75b16a7b6f35 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,5 +77,3 @@ conntrackd_LDADD += ${LIBSYSTEMD_LIBS}
 endif
 
 conntrackd_LDFLAGS = -export-dynamic
-
-EXTRA_DIST = read_config_yy.h
-- 
2.33.0


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

* [conntrack-tools 5/6] build: clean yacc- and lex-generated files with maintainer-clean
  2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
                   ` (3 preceding siblings ...)
  2021-09-25 15:10 ` [conntrack-tools 4/6] build: remove yacc-generated header from EXTRA_DIST Jeremy Sowden
@ 2021-09-25 15:10 ` Jeremy Sowden
  2021-09-25 15:10 ` [conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header Jeremy Sowden
  2021-09-27  8:33 ` [conntrack-tools 0/6] Build fixes Pablo Neira Ayuso
  6 siblings, 0 replies; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 15:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Automake expects to distribute yacc- and lex-generated sources, so that
the user doesn't need to regenerate them.  Therefore, the appropriate
target to clean them is `maintainer-clean`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 src/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 75b16a7b6f35..85ea18888e97 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,7 +6,7 @@ endif
 
 AM_YFLAGS = -d
 
-CLEANFILES = read_config_yy.c read_config_lex.c
+MAINTAINERCLEANFILES = read_config_yy.c read_config_yy.h read_config_lex.c
 
 sbin_PROGRAMS = conntrack conntrackd nfct
 
-- 
2.33.0


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

* [conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header
  2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
                   ` (4 preceding siblings ...)
  2021-09-25 15:10 ` [conntrack-tools 5/6] build: clean yacc- and lex-generated files with maintainer-clean Jeremy Sowden
@ 2021-09-25 15:10 ` Jeremy Sowden
  2021-09-25 15:49   ` Jan Engelhardt
  2021-09-27  8:33 ` [conntrack-tools 0/6] Build fixes Pablo Neira Ayuso
  6 siblings, 1 reply; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 15:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

List it as a built source in order to force make to create it before
compilation.  Otherwise, a parallel make can end up attempting to
compile the output of lex before yacc has finished generating its own
output:

  $ make -j17
  [...]
  YACC     read_config_yy.c
  LEX      read_config_lex.c
  CC       stack.o
  CC       resync.o
  CC       cthelper.o
  CC       helpers.o
  CC       utils.o
  CC       expect.o
  CC       systemd.o
  CC       nfct.o
  CC       nfct-extensions/helper.o
  CC       nfct-extensions/timeout.o
  CC       read_config_lex.o
  read_config_lex.l:25:10: fatal error: read_config_yy.h: No such file or directory
  25 | #include "read_config_yy.h"
  |          ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[2]: *** [Makefile:701: read_config_lex.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  updating read_config_yy.h
  make[2]: Leaving directory '/space/azazel/work/git/netfilter/conntrack-tools/src'
  make[1]: *** [Makefile:743: all-recursive] Error 1
  make[1]: Leaving directory '/space/azazel/work/git/netfilter/conntrack-tools/src'
  make: *** [Makefile:541: all-recursive] Error 1

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

diff --git a/src/Makefile.am b/src/Makefile.am
index 85ea18888e97..1f234749d35d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ endif
 
 AM_YFLAGS = -d
 
+BUILT_SOURCES = read_config_yy.h
 MAINTAINERCLEANFILES = read_config_yy.c read_config_yy.h read_config_lex.c
 
 sbin_PROGRAMS = conntrack conntrackd nfct
-- 
2.33.0


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

* Re: [conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header
  2021-09-25 15:10 ` [conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header Jeremy Sowden
@ 2021-09-25 15:49   ` Jan Engelhardt
  2021-09-25 17:29     ` Jeremy Sowden
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Engelhardt @ 2021-09-25 15:49 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Pablo Neira Ayuso, Netfilter Devel


On Saturday 2021-09-25 17:10, Jeremy Sowden wrote:
>List it as a built source in order to force make to create it before
>compilation.  Otherwise, a parallel make can end up attempting to
>compile the output of lex before yacc has finished generating its own
>output:
>
>--- a/src/Makefile.am
>+++ b/src/Makefile.am
>@@ -6,6 +6,7 @@ endif
> 
> AM_YFLAGS = -d
> 
>+BUILT_SOURCES = read_config_yy.h
> MAINTAINERCLEANFILES = read_config_yy.c read_config_yy.h read_config_lex.c

I have a strong reason to believe that you could just 
write

 read_config_yy.h: read_config_yy.y

(detail https://lists.gnu.org/archive/html/automake/2021-09/msg00011.html )

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

* Re: [conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header
  2021-09-25 15:49   ` Jan Engelhardt
@ 2021-09-25 17:29     ` Jeremy Sowden
  0 siblings, 0 replies; 10+ messages in thread
From: Jeremy Sowden @ 2021-09-25 17:29 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Pablo Neira Ayuso, Netfilter Devel

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

On 2021-09-25, at 17:49:27 +0200, Jan Engelhardt wrote:
> On Saturday 2021-09-25 17:10, Jeremy Sowden wrote:
> > List it as a built source in order to force make to create it before
> > compilation.  Otherwise, a parallel make can end up attempting to
> > compile the output of lex before yacc has finished generating its
> > own output:
> >
> > --- a/src/Makefile.am
> > +++ b/src/Makefile.am
> > @@ -6,6 +6,7 @@ endif
> >
> >  AM_YFLAGS = -d
> >
> > +BUILT_SOURCES = read_config_yy.h
> >  MAINTAINERCLEANFILES = read_config_yy.c read_config_yy.h read_config_lex.c
>
> I have a strong reason to believe that you could just write
>
>  read_config_yy.h: read_config_yy.y
>
> (detail https://lists.gnu.org/archive/html/automake/2021-09/msg00011.html )

Automake complains:

  src/Makefile.am:65: warning: user target 'read_config_yy.h' defined here ...
  automake: ... overrides Automake target 'read_config_yy.h' defined here

From the documentation (https://www.gnu.org/software/automake/manual/automake.html#Extending):

  Note that Automake does not make any distinction between rules with
  commands and rules that only specify dependencies. So it is not
  possible to append new dependencies to an automake-defined target
  without redefining the entire rule.

In this case, adding the rule you suggest to Makefile.am suppresses the
rule that automake would normally generate:

  read_config_yy.h: read_config_yy.c
          @if test ! -f $@; then rm -f read_config_yy.c; else :; fi
          @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) read_config_yy.c; else :; fi

J.

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

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

* Re: [conntrack-tools 0/6] Build fixes
  2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
                   ` (5 preceding siblings ...)
  2021-09-25 15:10 ` [conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header Jeremy Sowden
@ 2021-09-27  8:33 ` Pablo Neira Ayuso
  6 siblings, 0 replies; 10+ messages in thread
From: Pablo Neira Ayuso @ 2021-09-27  8:33 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Netfilter Devel

On Sat, Sep 25, 2021 at 04:10:29PM +0100, Jeremy Sowden wrote:
> The first three patches contain changes suggested by autoupdate.  Four
> and five bring the handling of the yacc- and lex-generated sources more
> in line with the automake doc's.  The last one fixes a race in parallel
> builds.

Series applied, thanks.

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

end of thread, other threads:[~2021-09-27  8:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-25 15:10 [conntrack-tools 0/6] Build fixes Jeremy Sowden
2021-09-25 15:10 ` [conntrack-tools 1/6] build: remove commented-out macros from configure.ac Jeremy Sowden
2021-09-25 15:10 ` [conntrack-tools 2/6] build: quote AC_INIT arguments Jeremy Sowden
2021-09-25 15:10 ` [conntrack-tools 3/6] build: replace `AM_PROG_LIBTOOL` and `AC_DISABLE_STATIC` with `LT_INIT` Jeremy Sowden
2021-09-25 15:10 ` [conntrack-tools 4/6] build: remove yacc-generated header from EXTRA_DIST Jeremy Sowden
2021-09-25 15:10 ` [conntrack-tools 5/6] build: clean yacc- and lex-generated files with maintainer-clean Jeremy Sowden
2021-09-25 15:10 ` [conntrack-tools 6/6] build: fix dependency-tracking of yacc-generated header Jeremy Sowden
2021-09-25 15:49   ` Jan Engelhardt
2021-09-25 17:29     ` Jeremy Sowden
2021-09-27  8:33 ` [conntrack-tools 0/6] Build fixes Pablo Neira Ayuso

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.