2002-03-05 Kevin Ryde <user42@zip.com.au>
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 5 Mar 2002 13:27:06 +0000 (13:27 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 5 Mar 2002 13:27:06 +0000 (13:27 +0000)
For PR automake/297:
* lex.m4 (AM_PROG_LEX): Don't set LEX=${am_missing_run}flex until
after AC_PROG_LEX, since it will try to run it and fail (in autoconf
2.52 at least).

ChangeLog
m4/lex.m4

index 6d351eb..516cd33 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-03-05  Kevin Ryde  <user42@zip.com.au>
+
+       For PR automake/297:
+       * lex.m4 (AM_PROG_LEX): Don't set LEX=${am_missing_run}flex until
+       after AC_PROG_LEX, since it will try to run it and fail (in autoconf
+       2.52 at least).
+
 2002-02-25  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        * automake.in (scan_one_autoconf_file): Declare
index d4cc381..9bde894 100644 (file)
--- a/m4/lex.m4
+++ b/m4/lex.m4
@@ -1,7 +1,7 @@
 ## Replacement for AC_PROG_LEX.                       -*-  Autoconf -*-
 ## by Alexandre Oliva <oliva@dcc.unicamp.br>
 
-# Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
-# serial 2
+# serial 3
 
 AC_PREREQ(2.50)
 
 # AM_PROG_LEX
 # -----------
-# Look for flex, lex or missing, then run AC_PROG_LEX.
+# Autoconf leaves LEX=: if lex or flex can't be found.  Change that to a
+# "missing" invocation, for better error output.
 AC_DEFUN([AM_PROG_LEX],
 [AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
-AC_CHECK_PROGS(LEX, flex lex, [${am_missing_run}flex])
-AC_PROG_LEX])
+AC_REQUIRE([AC_PROG_LEX])dnl
+if test "$LEX" = :; then
+  LEX=${am_missing_run}flex
+fi])