GNU bug report logs - #65730
[PATCH v2] m4: Update invocation of AC_PROG_LEX

Previous Next

Package: automake-patches;

Reported by: Łukasz Stelmach <stlman <at> poczta.fm>

Date: Mon, 4 Sep 2023 11:48:02 UTC

Severity: normal

Tags: patch

Merged with 65600

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65730 in the body.
You can then email your comments to 65730 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to automake-patches <at> gnu.org:
bug#65730; Package automake-patches. (Mon, 04 Sep 2023 11:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Łukasz Stelmach <stlman <at> poczta.fm>:
New bug report received and forwarded. Copy sent to automake-patches <at> gnu.org. (Mon, 04 Sep 2023 11:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Łukasz Stelmach <stlman <at> poczta.fm>
To: automake-patches <at> gnu.org
Cc: zack <at> owlfolio.org, Łukasz Stelmach <stlman <at> poczta.fm>
Subject: [PATCH v2] m4: Update invocation of AC_PROG_LEX
Date: Mon,  4 Sep 2023 13:40:09 +0200
Commit 73f1be5e42e3 to autoconf has introduced an argument
to AC_PROG_LEX. Invocation without the argument has been treated
as obsolete since then.

* m4/lex.m4: pass the required argument to AC_PROG_LEX

* doc/automake.texi: Describe it.

* NEWS: Mention it
---
 NEWS              | 2 ++
 doc/automake.texi | 5 +++--
 m4/lex.m4         | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)

I sent v1[1] by mistake to autoconf-patches <at> gnu.org where Zack Weinberg
sent[2] some suggestions.

[1] https://lists.gnu.org/archive/html/autoconf-patches/2023-08/msg00002.html
[2] https://lists.gnu.org/archive/html/autoconf-patches/2023-08/msg00003.html

diff --git a/NEWS b/NEWS
index ced0fd640..78162b746 100644
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,8 @@ New in 1.17:
 
   - tests: avoid some declaration conflicts for lex et al. on SunOS.
 
+  - Pass options AC_PROG_LEX requires
+
 * Obsolescent features:
 
   - py-compile no longer supports Python 0.x or 1.x versions.  Python 2.0,
diff --git a/doc/automake.texi b/doc/automake.texi
index d14b769fd..61b7fd095 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -4130,7 +4130,7 @@ Automake 1.14, the @code{AC_PROG_CC} is rewritten to implement such
 checks itself, and thus the explicit use of @code{AM_PROG_CC_C_O}
 should no longer be required.
 
-@item AM_PROG_LEX
+@item AM_PROG_LEX(@var{options})
 @acindex AM_PROG_LEX
 @acindex AC_PROG_LEX
 @cindex HP-UX 10, @command{lex} problems
@@ -4138,7 +4138,8 @@ should no longer be required.
 Like @code{AC_PROG_LEX} (@pxref{Particular Programs, , Particular
 Program Checks, autoconf, The Autoconf Manual}), but uses the
 @command{missing} script on systems that do not have @command{lex}.
-HP-UX 10 is one such system.
+HP-UX 10 is one such system. @var{options} are passed directly to
+@code{AC_PROG_LEX}.
 
 @item AM_PROG_GCJ
 @acindex AM_PROG_GCJ
diff --git a/m4/lex.m4 b/m4/lex.m4
index 7b0511526..e9a8485d6 100644
--- a/m4/lex.m4
+++ b/m4/lex.m4
@@ -6,14 +6,14 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# AM_PROG_LEX
-# -----------
+# AM_PROG_LEX(OPTIONS)
+# --------------------
 # Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
 # "missing" invocation, for better error output.
 AC_DEFUN([AM_PROG_LEX],
 [AC_PREREQ([2.50])dnl
 AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
-AC_REQUIRE([AC_PROG_LEX])dnl
+AC_PROVIDE_IFELSE([AC_PROG_LEX], [], [AC_PROG_LEX($@)])dnl
 if test "$LEX" = :; then
   LEX=${am_missing_run}flex
 fi])
-- 
2.30.2





Information forwarded to automake-patches <at> gnu.org:
bug#65730; Package automake-patches. (Tue, 05 Sep 2023 19:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 65730 <at> debbugs.gnu.org (full text, mbox):

From: "Zack Weinberg" <zack <at> owlfolio.org>
To: "Karl Berry" <karl <at> freefriends.org>
Cc: 65730 <at> debbugs.gnu.org, Bogdan <bogdro_rep <at> gmx.us>,
 Łukasz Stelmach <stlman <at> poczta.fm>, 65600 <at> debbugs.gnu.org,
 Nick Bowler <nbowler <at> draconx.ca>
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Tue, 05 Sep 2023 15:49:45 -0400
> Karl Berry <karl <at> freefriends.org>, Fri Sep 01 2023 00:28:04 GMT+0200
> (Central European Summer Time)
>> Bogdan: I will adjust the patch, one way or another. Nothing more for
>> you to do here after all :). --thanks, karl.

Karl: The same problem was also reported as bug 65730, with a patch
supplied by Łukasz Stelmach.  That patch is preferable to Bogdan's
patch, for two reasons.  First, Łukasz's patch uses $@ to forward *all*
arguments to AC_PROG_LEX, regardless of what they are, making it robust
to the possibility of *more* arguments being added to AC_PROG_LEX in the
future (for example, we might decide to add an option to specify that
you need Flex specifically).  Second, Łukasz's patch checks whether
AC_PROG_LEX has already been invoked, and if so does not run it again.
That makes the updated AM_PROG_LEX continue to be compatible with the
workaround we (Autoconf) have been suggesting for this issue, namely
to write

AC_PROG_LEX([noyywrap])
AM_PROG_LEX

It looks like Bogdan's patch does include a new set of tests that are
worth preserving, but please use Łukasz's actual code change.  (I regret
I cannot volunteer to merge the two patches as I am in the middle of
reinstalling the operating system on my workstation, and that's already
taken a week and a half with no end in sight.  You know how these things
go, I'm sure.)

zw




Information forwarded to automake-patches <at> gnu.org:
bug#65730; Package automake-patches. (Tue, 05 Sep 2023 21:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 65730 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: zack <at> owlfolio.org
Cc: 65730 <at> debbugs.gnu.org, bogdro_rep <at> gmx.us, stlman <at> poczta.fm,
 65600 <at> debbugs.gnu.org, nbowler <at> draconx.ca
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Tue, 5 Sep 2023 15:15:16 -0600
    Karl: The same problem was also reported as bug 65730, with a patch

Thanks Zack. I had just composed a reply saying just about exactly the
same thing as you wrote :).

I will merge the patches and try Bogdan's test, no problem. -k

P.S. Bogdan, sorry that I wasn't thinking more clearly when I asked you
to write the more complicated version.




Information forwarded to automake-patches <at> gnu.org:
bug#65730; Package automake-patches. (Wed, 06 Sep 2023 09:08:01 GMT) Full text and rfc822 format available.

Message #14 received at 65730 <at> debbugs.gnu.org (full text, mbox):

From: Bogdan <bogdro_rep <at> gmx.us>
To: Karl Berry <karl <at> freefriends.org>, zack <at> owlfolio.org
Cc: 65730 <at> debbugs.gnu.org, nbowler <at> draconx.ca, 65600 <at> debbugs.gnu.org,
 stlman <at> poczta.fm
Subject: Re: [bug#65600] [PATCH] Allow parameters AM_PROG_LEX
Date: Wed, 6 Sep 2023 11:06:56 +0200
Karl Berry <karl <at> freefriends.org>, Tue Sep 05 2023 23:15:16 GMT+0200
(Central European Summer Time)
>      Karl: The same problem was also reported as bug 65730, with a patch
>
> Thanks Zack. I had just composed a reply saying just about exactly the
> same thing as you wrote :).
>
> I will merge the patches and try Bogdan's test, no problem. -k
>
> P.S. Bogdan, sorry that I wasn't thinking more clearly when I asked you
> to write the more complicated version.


 No problem, new "experience points" earned :). M4 and all Autoconf
macros (knowledge about their existence) are still a bit out of my
range. Especially AC_PROVIDE_IFELSE, which I don't even have in my
Autoconf manual (it *is* found in the code, but not in the manual)...

Bogdan





Merged 65600 65730. Request was from Karl Berry <karl <at> freefriends.org> to control <at> debbugs.gnu.org. (Wed, 06 Sep 2023 20:46:02 GMT) Full text and rfc822 format available.

Information forwarded to automake-patches <at> gnu.org:
bug#65730; Package automake-patches. (Wed, 01 Nov 2023 16:24:02 GMT) Full text and rfc822 format available.

Message #19 received at 65730 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: stlman <at> poczta.fm
Cc: 65730 <at> debbugs.gnu.org
Subject: Re: [bug#65730] [PATCH v2] m4: Update invocation of AC_PROG_LEX
Date: Wed, 1 Nov 2023 10:23:14 -0600
    * m4/lex.m4: pass the required argument to AC_PROG_LEX

Łukasz, I finally committed your patch for this.
Bogdan, I also committed your test.

Thanks much. Closing these out (#65730, #65600). --karl





Information forwarded to automake-patches <at> gnu.org:
bug#65730; Package automake-patches. (Wed, 01 Nov 2023 16:24:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 Nov 2023 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.