automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

22-fyi-lex-yytext.patch


From: Akim Demaille
Subject: 22-fyi-lex-yytext.patch
Date: Sun, 21 Oct 2001 14:01:27 +0200

The code and the documentation aren't very clear: Is AM_PROG_LEX a
_requirement_ over AC_PROG_LEX, or just a bonus.  If it's a
requirement, then the code is too kind with the user, and makes it
work anyway, and it's just better, then the doc doesn't say it very
clearly.

The patch below maintains this ambiguity.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * 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.

Index: automake.in
--- automake.in Sun, 21 Oct 2001 11:07:09 +0200 akim
+++ automake.in Sun, 21 Oct 2001 11:15:37 +0200 akim
@@ -390,8 +390,8 @@ sub target_hook ($$$$)
 # 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)
Index: automake.texi
--- automake.texi Sat, 20 Oct 2001 10:24:24 +0200 akim
+++ automake.texi Sun, 21 Oct 2001 11:10:36 +0200 akim
@@ -1204,12 +1204,6 @@ FIXME: give complete list of things look
 @cvindex AC_PROG_YACC
 @cvindex YACC

address@hidden AC_DECL_YYTEXT
-This macro is required if there is Lex source in the package.
address@hidden Programs, , Particular Program Checks, autoconf, The
-Autoconf Manual}.
address@hidden 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 @@ @node Macros, Extending aclocal, Invokin
 @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
address@hidden  @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
address@hidden script on systems that do not have @code{lex}.
address@hidden 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 @@ @node Yacc and Lex, C++ Support, Program
 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
address@hidden 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
Index: m4/lex.m4
--- m4/lex.m4 Sun, 23 Sep 2001 08:36:36 +0200 akim
+++ m4/lex.m4 Sun, 21 Oct 2001 11:09:10 +0200 akim
@@ -1,4 +1,4 @@
-## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT
+## Replacement for AC_PROG_LEX.                       -*-  Autoconf -*-
 ## by Alexandre Oliva <address@hidden>

 # 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])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]