* 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 <akim@epita.fr>
+
+ * 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 <akim@epita.fr>
* automake.in (&scan_autoconf_traces): Add support for
# 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.
'AC_CONFIG_FILES',
'AC_LIBSOURCE',
'AC_PROG_LIBTOOL', 'AM_PROG_LIBTOOL',
+ 'AC_PROG_LEX',
'AC_SUBST',
'AM_CONDITIONAL',
'AM_CONFIG_HEADER',
# _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;
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)/)
$configure_vars{$1} = $filename . ':' . $.;
}
- $seen_decl_yytext = 1 if /AC_DECL_YYTEXT/;
if (/AM_MAINTAINER_MODE/)
{
$seen_maint_mode = 1;
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)
@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
@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
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
-## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT
+## Replacement for AC_PROG_LEX. -*- Autoconf -*-
## by Alexandre Oliva <oliva@dcc.unicamp.br>
# Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
# 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])
-@set UPDATED 20 October 2001
+@set UPDATED 21 October 2001
@set UPDATED-MONTH October 2001
@set EDITION 1.5a
@set VERSION 1.5a
-@set UPDATED 20 October 2001
+@set UPDATED 21 October 2001
@set UPDATED-MONTH October 2001
@set EDITION 1.5a
@set VERSION 1.5a