Re: [PATCH] m4: Update invocation of AC_PROG_LEX

Łukasz Stelmach <[email protected]> Wed, 16 Aug 2023 22:01:42 +0200
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <871qg2eoyh.fsf%[email protected]>
"Zack Weinberg" <[email protected]> writes:

> On Wed, Aug 16, 2023, at 2:38 AM, Łukasz Stelmach wrote:
>> Commit 73f1be5e42e3 to autoconf has introduced an argument to
>> AC_PROG_LEX. Invocation without the argument has been treated as
>> obsolete since then.
>
> This should go to automake-patches, not autoconf-patches.  

Indeed.

> Also, you should update the manual (automake.texi) to document that
> AM_PROG_LEX now takes an argument and what that argument is.  Finally,
> I'd like to suggest a small improvement to the code: instead of
>
>> -AC_REQUIRE([AC_PROG_LEX])dnl
>> +AC_PROG_LEX([$1])dnl
>
> you should have
>
> -AC_REQUIRE([AC_PROG_LEX])dnl
> +AC_PROVIDE_IFELSE([AC_PROG_LEX], [], [AC_PROG_LEX([$@])])dnl
>
> This change ensures that AC_PROG_LEX will not be invoked a second time
> if it has already been used directly, which is important both because
> that's the way it has always worked, and because we (autoconf maintainers)
> have been telling people to work around the problem you're fixing by using
> AC_PROG_LEX _as well as_ AM_PROG_LEX.  It also makes AM_PROG_LEX oblivious
> to how many arguments AC_PROG_LEX actually takes, which could be important
> future-proofing.

Thanks for help. I'll send v2 soon.

-- 
Miłego dnia,
Łukasz Stelmach
signature.asc (application/pgp-signature, 617 B)
-----BEGIN PGP SIGNATURE-----

iQGTBAEBCgB9FiEEkPlMeih05HaDBMFPALaXbGOR03EFAmTdKypfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDkw
Rjk0QzdBMjg3NEU0NzY4MzA0QzE0RjAwQjY5NzZDNjM5MUQzNzEACgkQALaXbGOR
03GqgQf/RDSk2lh8Sbv4H+aTqNBQADxh9jptrJbOjHaSZ4XHKKvzmWH1w8a1uou7
1vq3c0OGsihYdFkRzm0aaPNA9I7gtNrOznNcWTJveV9tnXSLfv9TBtjTpC5Qnznl
TjWM8Jxny1R25BzTAZlXNSogMKf5iKCGEcZB0MM1Gvib94zdz1aEvgNV7BbWIBkD
/vebL8Rfdttft/ZfBOqXIZDfuYQQSGhiLyFHeIv9vH1fySC/Y3yxtmdR3pD6Fpbs
5tfzJ7BwHanmkC3X1EwQvbvieDvhT9LoLO0LK5A/esEe6vQ42VriOyuIqrcWjlG9
kJQIetmLtAr/N58afV5wyBIZvJ9T7g==
=4s+u
-----END PGP SIGNATURE-----