From 14509ba408e4c3bab0b3d5b01d18fbbe8144dffe Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 21 Oct 2001 18:04:16 +0000 Subject: [PATCH] * m4/lex.m4: Don't run AC_DECL_YYTEXT, Autoconf does. * automake.texi (Macros, Yacc and Lex): Adjust. * automake.in ($seen_decl_yytext): Rename as... ($seen_prog_lex): this. (&scan_autoconf_traces): Add AC_PROG_LEX support. (&scan_one_autoconf_file, &lang_lex_finish): Adjust. --- ChangeLog | 9 +++++++++ automake.in | 33 ++++++++++++++++++--------------- automake.texi | 30 ++++++------------------------ m4/lex.m4 | 14 +++++++++----- stamp-vti | 2 +- version.texi | 2 +- 6 files changed, 44 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21ac792..4cf63fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2001-10-21 Akim Demaille + * m4/lex.m4: Don't run AC_DECL_YYTEXT, Autoconf does. + * automake.texi (Macros, Yacc and Lex): Adjust. + * automake.in ($seen_decl_yytext): Rename as... + ($seen_prog_lex): this. + (&scan_autoconf_traces): Add AC_PROG_LEX support. + (&scan_one_autoconf_file, &lang_lex_finish): Adjust. + +2001-10-21 Akim Demaille + * automake.in (&scan_autoconf_traces): Add support for AM_PATH_LISPDIR and AM_PATH_PYTHON. diff --git a/automake.in b/automake.in index b2bd3d8..7c68444 100755 --- a/automake.in +++ b/automake.in @@ -390,8 +390,8 @@ my $seen_gettext = 0; # Line number at which AM_GNU_GETTEXT seen. my $ac_gettext_line = 0; -# TRUE if AC_DECL_YYTEXT was seen. -my $seen_decl_yytext = 0; +# TRUE if AC_PROG_LEX or AM_PROG_LEX were seen. +my $seen_prog_lex = 0; # TRUE if we've seen AC_CANONICAL_(HOST|SYSTEM). The presence of # AC_CHECK_TOOL also sets this. @@ -4451,6 +4451,7 @@ sub scan_autoconf_traces ($) 'AC_CONFIG_FILES', 'AC_LIBSOURCE', 'AC_PROG_LIBTOOL', 'AM_PROG_LIBTOOL', + 'AC_PROG_LEX', 'AC_SUBST', 'AM_CONDITIONAL', 'AM_CONFIG_HEADER', @@ -4508,15 +4509,19 @@ sub scan_autoconf_traces ($) # _AC_LIBOBJ_DECL and use it the in various macros. $libsources{$args[1]} = $here; } - elsif ($macro eq 'AC_SUBST') - { - $configure_vars{$args[1]} = $here; - } elsif ($macro =~ /A(C|M)_PROG_LIBTOOL/) { $seen_libtool = $here; $libtool_line = $line; } + elsif ($macro =~ /AC_PROG_LEX/) + { + $seen_prog_lex = $here; + } + elsif ($macro eq 'AC_SUBST') + { + $configure_vars{$args[1]} = $here; + } elsif ($macro eq 'AM_CONDITIONAL') { $configure_cond{$args[1]} = $here; @@ -4795,15 +4800,14 @@ sub scan_one_autoconf_file if (/AM_PROG_LEX/) { $configure_vars{'LEX'} = $filename . ':' . $.; - $seen_decl_yytext = 1; - } - if (/AC_DECL_YYTEXT/ && $filename =~ /configure\.(ac|in)$/) - { - &am_conf_line_warning ($filename, $., "`AC_DECL_YYTEXT' is covered by `AM_PROG_LEX'"); + $seen_prog_lex = 1; } if (/AC_PROG_LEX/ && $filename =~ /configure\.(ac|in)$/) { - &am_conf_line_warning ($filename, $., "automake requires `AM_PROG_LEX', not `AC_PROG_LEX'"); + $configure_vars{'LEX'} = $filename . ':' . $.; + $seen_prog_lex = 1; + &am_conf_line_warning ($filename, $., + "automake requires `AM_PROG_LEX', not `AC_PROG_LEX'"); } if (/AC_PROG_(F77|YACC|RANLIB|CC|CXXCPP|CXX|LEX|AWK|CPP|LN_S)/) @@ -4841,7 +4845,6 @@ sub scan_one_autoconf_file $configure_vars{$1} = $filename . ':' . $.; } - $seen_decl_yytext = 1 if /AC_DECL_YYTEXT/; if (/AM_MAINTAINER_MODE/) { $seen_maint_mode = 1; @@ -5279,9 +5282,9 @@ sub lang_lex_finish return if defined $language_scratch{'lex-done'}; $language_scratch{'lex-done'} = 1; - if (! $seen_decl_yytext) + if (! $seen_prog_lex) { - &am_error ("lex source seen but `AC_DECL_YYTEXT' not in `$configure_ac'"); + &am_error ("lex source seen but `AM_PROG_LEX' not in `$configure_ac'"); } if (count_files_for_language ('lex') > 1) diff --git a/automake.texi b/automake.texi index 6e9a4ff..583ef7f 100644 --- a/automake.texi +++ b/automake.texi @@ -1204,12 +1204,6 @@ autoconf, The Autoconf Manual}). @cvindex AC_PROG_YACC @cvindex YACC -@item AC_DECL_YYTEXT -This macro is required if there is Lex source in the package. -@xref{Particular Programs, , Particular Program Checks, autoconf, The -Autoconf Manual}. -@cvindex AC_DECL_YYTEXT - @item AC_PROG_LEX If a Lex source file is seen, then this macro must be used. @xref{Particular Programs, , Particular Program Checks, autoconf, The @@ -1412,19 +1406,10 @@ code in ANSI C, you can make an un-ANSIfied copy of it by using the @item AM_PROG_LEX @cindex HP-UX 10, lex problems @cindex lex problems with HP-UX 10 -Like @code{AC_PROG_LEX} with @code{AC_DECL_YYTEXT} (@pxref{Particular -Programs, , Particular Program Checks, autoconf, The Autoconf Manual}), -but uses the @code{missing} script on systems that do not have -@code{lex}. @samp{HP-UX 10} is one such system. - -Autoconf 2.50 and higher, in order to simplify the interface, includes -the body of @code{AC_DECL_YYTEXT} in @code{AC_PROG_LEX}. To ensure -backward compatibility, @code{AC_DECL_YYTEXT} is nevertheless defined as -an invocation of @code{AC_PROG_LEX}. Since @code{AM_PROG_LEX} invokes -both, it causes an annoying but benign warning (@code{AC_PROG_LEX} -invoked multiple times) which you should just ignore. In the future, -once Automake requires Autoconf 2.50, this issue will be fixed, but the -current compatibility with Autoconf 2.13 prevents this. +Like @code{AC_PROG_LEX} (@pxref{Particular Programs, , Particular +Program Checks, autoconf, The Autoconf Manual}), but uses the +@code{missing} script on systems that do not have @code{lex}. +@samp{HP-UX 10} is one such system. @item AM_PROG_GCJ This macro finds the @code{gcj} program or causes an error. It sets @@ -2265,11 +2250,8 @@ intended for the @file{Makefile.am} author. Similarly, if a @code{lex} source file is seen, then your @file{configure.in} must define the variable @samp{LEX}. You can use @samp{AC_PROG_LEX} to do this (@pxref{Particular Programs, , Particular -Program Checks, autoconf, The Autoconf Manual}). Automake's @code{lex} -support also requires that you use the @samp{AC_DECL_YYTEXT} -macro---automake needs to know the value of @samp{LEX_OUTPUT_ROOT}. -This is all handled for you if you use the @code{AM_PROG_LEX} macro -(@pxref{Macros}). +Program Checks, autoconf, The Autoconf Manual}), but using +@code{AM_PROG_LEX} macro (@pxref{Macros}) is recommended. When @code{lex} is invoked, it is passed @samp{LFLAGS} and @samp{AM_LFLAGS}. The former is a user variable and the latter is diff --git a/m4/lex.m4 b/m4/lex.m4 index b2c41f8..d4cc381 100644 --- a/m4/lex.m4 +++ b/m4/lex.m4 @@ -1,4 +1,4 @@ -## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT +## Replacement for AC_PROG_LEX. -*- Autoconf -*- ## by Alexandre Oliva # Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. @@ -18,10 +18,14 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. +# serial 2 + +AC_PREREQ(2.50) + # AM_PROG_LEX -# Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +# ----------- +# Look for flex, lex or missing, then run AC_PROG_LEX. AC_DEFUN([AM_PROG_LEX], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) +[AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex]) -AC_PROG_LEX -AC_DECL_YYTEXT]) +AC_PROG_LEX]) diff --git a/stamp-vti b/stamp-vti index 0b1c08e..5e7b156 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 20 October 2001 +@set UPDATED 21 October 2001 @set UPDATED-MONTH October 2001 @set EDITION 1.5a @set VERSION 1.5a diff --git a/version.texi b/version.texi index 0b1c08e..5e7b156 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 20 October 2001 +@set UPDATED 21 October 2001 @set UPDATED-MONTH October 2001 @set EDITION 1.5a @set VERSION 1.5a -- 2.7.4