[vlc-devel] [PATCH] configure.ac: fix AC_PROG_LEX warning

Alexandre Janniaux ajanni at videolabs.io
Sat Jan 30 17:43:44 UTC 2021


With autoconf 2.70, the following warnings are emitted:

configure.ac:56: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete
./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from...
./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from...
configure.ac:56: the top level

The documentation[1] of autoconf now states:

> Prior to Autoconf 2.70, AC_PROG_LEX did not take any arguments, and
> its behavior was different from either of the above possibilities: it
> would search for a library that defines yywrap, and would set LEXLIB
> to that library if it finds one. However, if a library that defines
> this function could not be found, LEXLIB would be left empty and LEX
> would not be reset. This behavior was due to a bug, but several
> packages came to depend on it, so AC_PROG_LEX still does this if
> neither the yywrap nor the noyywrap option is given.
>
> Usage of AC_PROG_LEX without choosing one of the yywrap or noyywrap
> options is deprecated. It is usually better to use noyywrap and define
> the yywrap function yourself, as this almost always renders the LEXLIB
> unnecessary.

The behaviour of the argument on autoconf < 2.70 is to ignore the
argument, so there are no issues with adding the option.

[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/html_node/Particular-Programs.html#Particular-Programs
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 9959f94fd6..ac479f5088 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,7 @@ AC_PROG_EGREP
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AM_PROG_AS
-AC_PROG_LEX
+AC_PROG_LEX([noyywrap])
 AC_PROG_YACC
 
 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
-- 
2.30.0



More information about the vlc-devel mailing list