mirror of
git://git.sv.gnu.org/autoconf
synced 2025-04-12 15:20:26 +08:00
AC_PROG_LEX has three different operating modes (“yywrap”, “noyywrap”, and 2.69 compatibility mode) which were all tangled together and hard to understand. In addition, the way we were handling yywrap, in all three modes, was imprecise to the point where I am unsure we were actually testing the property people want to test. Refactor AC_PROG_LEX into a set of smaller macros: - AC_PROG_LEX and _AC_PROG_LEX_1 perform argument validation and normalization. _AC_PROG_LEX_1 also ensures that repeated invocation of AC_PROG_LEX is harmless. - _AC_PROG_LEX_2 is invoked with exactly one argument which is the name of one of the three _AC_PROG_LEX_LIBL_* macros (described below). It invokes, in sequence, AC_CHECK_PROGS([LEX]), _AC_PROG_LEX_OUTPUT_ROOT, the _AC_PROG_LEX_LIBL_ macro it was given as an argument, and finally _AC_PROG_LEX_YYTEXT_DECL. If any of these sets LEX to ‘:’, further tests are skipped. _AC_PROG_LEX_2 is also responsible for cleaning up conftest.l and lex.yy.c afterward. - _AC_PROG_LEX_YYTEXT_DECL now *only* tests whether yytext is a pointer. It reuses the conftest.l from previous tests. - _AC_PROG_LEX_OUTPUT_ROOT just does the test for the name of the file produced by running ‘lex conftest.l’ with no further arguments. - _AC_PROG_LEX_LIBL_YYWRAP, _AC_PROG_LEX_LIBL_NOYYWRAP, and _AC_PROG_LEX_LIBL_COMPAT determine whether a generated lexer needs to be linked with -ll or -lfl. Each is dedicated to one of the three operating modes, and uses a conftest.l specialized for that mode. In compat mode we do *not* look for ‘yywrap’ using AC_SEARCH_LIBS; instead we actually try to link a generated lexer that uses yywrap. - _AC_PROG_LEX_SEARCH_LIBL, _AC_PROG_LEX_TEST_COMMON, _AC_PROG_LEX_TEST_YYWRAP, and _AC_PROG_LEX_TEST_NOYYWRAP are subroutines of the _AC_PROG_LEX_LIBL_* macros. TODO: - Shrink and sharpen the test program used by _AC_PROG_LEX_YYTEXT_DECL and make it independent of previous operations. Possibly smush it back together with _AC_PROG_LEX_OUTPUT_ROOT. - Re-audit the “noyywrap” program, it might be better to declare “_static_ int yywrap(void)” in the %{ %} block instead of not declaring it at all. - Re-audit the “yywrap” program, it might be better to rely on the skeleton to declare yywrap. * lib/autoconf/programs.m4 (AC_PROG_LEX): Extensive refactor. Test for yywrap is now done by linking a generated lexer, not with AC_SEARCH_LIBS. (_AC_PROG_LEX_YYTEXT_DECL): Just test whether yytext is a pointer. (_AC_PROG_LEX): Removed. (_AC_PROG_LEX_1, _AC_PROG_LEX_2): New macros dividing up the labor formerly performed by _AC_PROG_LEX and the order of operations in the old _AC_PROG_LEX_YYTEXT_DECL. (_AC_PROG_LEX_OUTPUT_ROOT, _AC_PROG_LEX_SEARCH_LIBL) (_AC_PROG_LEX_LIBL_YYWRAP, _AC_PROG_LEX_LIBL_NOYYWRAP) (_AC_PROG_LEX_LIBL_COMPAT, _AC_PROG_LEX_TEST_COMMON) (_AC_PROG_LEX_TEST_YYWRAP, _AC_PROG_LEX_TEST_NOYYWRAP): New macros dividing up the rest of the labor formerly performed by _AC_PROG_LEX_YYTEXT_DECL. * tests/semantics.at (AC_PROG_LEX with noyywrap): Rename “AC_PROG_LEX: noyywrap”. (AC_PROG_LEX with yywrap): Rename “AC_PROG_LEX: yywrap”. No longer necessary to skip this test on OSes where there is no -ll nor -lfl. (AC_PROG_LEX in legacy mode): Rename “AC_PROG_LEX: compat mode.” Convert to AT_CHECK_MACRO test using -Wno-obsolete. (Invalid arguments to AC_PROG_LEX): Rename “AC_PROG_LEX: invalid arguments and warnings.” Move the test for the warning “AC_PROG_LEX without either yywrap or noyywrap is obsolete” here. Adjust expected stack traces.
-*- text -*- Autoconf Autoconf is an extensible package of M4 macros that produce shell scripts to automatically configure software source code packages. These scripts can adapt the packages to many kinds of UNIX-like systems without manual user intervention. Autoconf creates a configuration script for a package from a template file that lists the operating system features that the package can use, in the form of M4 macro calls. Producing configuration scripts using Autoconf requires GNU M4 and Perl. You should install GNU M4 (version 1.4.8 or later is required; 1.4.16 or later is recommended) and Perl (5.006 or later) before configuring Autoconf, so that Autoconf's configure script can find them. The configuration scripts produced by Autoconf are self-contained, so their users do not need to have Autoconf (or GNU M4, Perl, etc.). You can get GNU M4 here: https://ftp.gnu.org/gnu/m4/ The file INSTALL should be distributed with packages that use Autoconf-generated configure scripts and Makefiles that conform to the GNU coding standards. The package's README can just give an overview of the package, where to report bugs, and a pointer to INSTALL for instructions on compilation and installation. This removes the need to maintain many similar sets of installation instructions. Be sure to read BUGS and INSTALL. Mail suggestions to autoconf@gnu.org, report bugs to bug-autoconf@gnu.org, and submit patches to autoconf-patches@gnu.org. All changes can be tracked at the read-only autoconf-commit@gnu.org. Always include the Autoconf version number, which you can get by running 'autoconf --version'. Archives of bug-autoconf@gnu.org can be found in <https://lists.gnu.org/archive/html/bug-autoconf/>, and similarly for the other mailing lists. Licensing ========= Autoconf is released under the General Public License version 3 (GPLv3+). Additionally, Autoconf includes a licensing exception in some of its source files; see the respective copyright notices for how your project is impacted by including scripts generated by Autoconf, and the COPYING.EXCEPTION file for the exception in terms of the Additional Permissions as described in section 7 of GPLv3. For more licensing information, see <https://www.gnu.org/licenses/gpl-faq.html> and <https://www.gnu.org/licenses/exceptions.html>. For any copyright year range specified as YYYY-ZZZZ in this package note that the range specifies every single year in that closed interval. GNU Project notice ================== Autoconf is part of the GNU Operating System, developed by the GNU Project. If you are the author of an awesome program and want to join us in writing Free (libre) Software, please consider making it an official GNU program and become a GNU Maintainer. Instructions on how to do this are here: https://www.gnu.org/help/evaluation Don't have a program to contribute? Look at all the other ways to help: https://www.gnu.org/help/help.html And to learn more about Free (libre) Software in general, please read and share this page: https://gnu.org/philosophy/free-sw.html We are looking forward to hacking with you! ----- Copyright (C) 1992-1994, 1998, 2000-2017, 2020-2023 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind.
Description
Languages
Roff
42.7%
M4
29.7%
TeX
12%
Perl
9.3%
Makefile
3.5%
Other
2.7%