All of lore.kernel.org
 help / color / mirror / Atom feed
* [conntrack-tools PATCH 0/3] bison & flex autotools updates
@ 2021-12-16 17:05 Jeremy Sowden
  2021-12-16 17:05 ` [conntrack-tools PATCH 1/3] build: only require bison and flex if the generated files do not exist Jeremy Sowden
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jeremy Sowden @ 2021-12-16 17:05 UTC (permalink / raw)
  To: Netfilter Devel

The first two patches bring the use of bison and flex and their
generated files more into line with the recommendations of automake.
The third fixes an autoconf deprecation warning.

Jeremy Sowden (3):
  build: only require bison and flex if the generated files do not exist
  build: remove MAINTAINERCLEANFILES
  build: replace `AM_PROG_LEX` with `AC_PROG_LEX`

 configure.ac    | 6 +++---
 src/Makefile.am | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.34.1


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

* [conntrack-tools PATCH 1/3] build: only require bison and flex if the generated files do not exist
  2021-12-16 17:05 [conntrack-tools PATCH 0/3] bison & flex autotools updates Jeremy Sowden
@ 2021-12-16 17:05 ` Jeremy Sowden
  2021-12-16 17:05 ` [conntrack-tools PATCH 2/3] build: remove MAINTAINERCLEANFILES Jeremy Sowden
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jeremy Sowden @ 2021-12-16 17:05 UTC (permalink / raw)
  To: Netfilter Devel

automake recommends including the files generated by bison and flex in
distribution tar-balls and runs bison and flex during `make dist` to
generate them.  Thus, in the normal case where the software is being
compiled by an end-user, the generated files already exist and bison and
flex are not required.  Therefore, amend the configure script only to
require them if the generated files do not exist.

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

diff --git a/configure.ac b/configure.ac
index 3a3af4549162..a20c6bb4ca1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,13 +26,13 @@ case "$host" in
 esac
 
 dnl Dependencies
-if test -z "$ac_cv_prog_YACC"
+if test -z "$ac_cv_prog_YACC" -a ! -f "${srcdir}/src/read_config_yy.c"
 then
 	echo "*** Error: No suitable bison/yacc found. ***"
 	echo "    Please install the 'bison' package."
 	exit 1
 fi
-if test -z "$ac_cv_prog_LEX"
+if test -z "$ac_cv_prog_LEX" -a ! -f "${srcdir}/src/read_config_lex.c"
 then
 	echo "*** Error: No suitable flex/lex found. ***"
 	echo "    Please install the 'flex' package."
-- 
2.34.1


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

* [conntrack-tools PATCH 2/3] build: remove MAINTAINERCLEANFILES
  2021-12-16 17:05 [conntrack-tools PATCH 0/3] bison & flex autotools updates Jeremy Sowden
  2021-12-16 17:05 ` [conntrack-tools PATCH 1/3] build: only require bison and flex if the generated files do not exist Jeremy Sowden
@ 2021-12-16 17:05 ` Jeremy Sowden
  2021-12-16 17:05 ` [conntrack-tools PATCH 3/3] build: replace `AM_PROG_LEX` with `AC_PROG_LEX` Jeremy Sowden
  2021-12-17 11:59 ` [conntrack-tools PATCH 0/3] bison & flex autotools updates Pablo Neira Ayuso
  3 siblings, 0 replies; 5+ messages in thread
From: Jeremy Sowden @ 2021-12-16 17:05 UTC (permalink / raw)
  To: Netfilter Devel

automake generates rules to remove the files generated by bison
and flex by default, so there is no need to add them explicitly to
MAINTAINERCLEANFILES.

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

diff --git a/src/Makefile.am b/src/Makefile.am
index 1f234749d35d..1d56394698a6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,7 +7,6 @@ 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.34.1


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

* [conntrack-tools PATCH 3/3] build: replace `AM_PROG_LEX` with `AC_PROG_LEX`
  2021-12-16 17:05 [conntrack-tools PATCH 0/3] bison & flex autotools updates Jeremy Sowden
  2021-12-16 17:05 ` [conntrack-tools PATCH 1/3] build: only require bison and flex if the generated files do not exist Jeremy Sowden
  2021-12-16 17:05 ` [conntrack-tools PATCH 2/3] build: remove MAINTAINERCLEANFILES Jeremy Sowden
@ 2021-12-16 17:05 ` Jeremy Sowden
  2021-12-17 11:59 ` [conntrack-tools PATCH 0/3] bison & flex autotools updates Pablo Neira Ayuso
  3 siblings, 0 replies; 5+ messages in thread
From: Jeremy Sowden @ 2021-12-16 17:05 UTC (permalink / raw)
  To: Netfilter Devel

`AM_PROG_LEX` calls `AC_PROG_LEX` with no arguments, but this usage is
deprecated.  The only difference between `AM_PROG_LEX` and `AC_PROG_LEX`
is that the former defines `$LEX` as "./build-aux/missing lex" if no lex
is found to ensure a useful error is reported when make is run.  How-
ever, the configure script checks that we have a working lex and exits
with an error if none is available, so `$LEX` will never be called and
we can replace `AM_PROG_LEX` with `AC_PROG_LEX`.

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 a20c6bb4ca1c..b12b722a3396 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@ AM_PROG_AR
 LT_INIT([disable-static])
 AC_PROG_INSTALL
 AC_PROG_LN_S
-AM_PROG_LEX
+AC_PROG_LEX([noyywrap])
 AC_PROG_YACC
 
 case "$host" in
-- 
2.34.1


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

* Re: [conntrack-tools PATCH 0/3] bison & flex autotools updates
  2021-12-16 17:05 [conntrack-tools PATCH 0/3] bison & flex autotools updates Jeremy Sowden
                   ` (2 preceding siblings ...)
  2021-12-16 17:05 ` [conntrack-tools PATCH 3/3] build: replace `AM_PROG_LEX` with `AC_PROG_LEX` Jeremy Sowden
@ 2021-12-17 11:59 ` Pablo Neira Ayuso
  3 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2021-12-17 11:59 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Netfilter Devel

On Thu, Dec 16, 2021 at 05:05:10PM +0000, Jeremy Sowden wrote:
> The first two patches bring the use of bison and flex and their
> generated files more into line with the recommendations of automake.
> The third fixes an autoconf deprecation warning.

Series applied, thanks

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

end of thread, other threads:[~2021-12-17 11:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 17:05 [conntrack-tools PATCH 0/3] bison & flex autotools updates Jeremy Sowden
2021-12-16 17:05 ` [conntrack-tools PATCH 1/3] build: only require bison and flex if the generated files do not exist Jeremy Sowden
2021-12-16 17:05 ` [conntrack-tools PATCH 2/3] build: remove MAINTAINERCLEANFILES Jeremy Sowden
2021-12-16 17:05 ` [conntrack-tools PATCH 3/3] build: replace `AM_PROG_LEX` with `AC_PROG_LEX` Jeremy Sowden
2021-12-17 11:59 ` [conntrack-tools PATCH 0/3] bison & flex autotools updates 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.