autoconf-patches
[Top][All Lists]
Advanced

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

AC_DECL_YYTEXT exits if no [f]lex in PATH (fwd)


From: Pavel Roskin
Subject: AC_DECL_YYTEXT exits if no [f]lex in PATH (fwd)
Date: Thu, 28 Sep 2000 07:46:57 -0400 (EDT)

Hello, Akim!

I'm forwarding the message to you.

I don't want to make backdoors for Automake because:
1) This is out of scope of this patch.
2) The backdoor already exists, as Alexandre has noticed.

The main point of this patch is to prevent a failure when lex is missing.
There are also positive side effects, as noted below.

_AC_DECL_YYTEXT is absolutely irrelevant if [f]lex is missing. LEXLIB
_should_ be irrelevant as well, but I don't want to (further) break
packages that provide the processed code but don't provide yywrap().

One thing still worries me - it's YYTEXT_POINTER. The problem is that if a
package ships with the code processed by lex the test should have been
done on the machine that ran lex, not on the user's machine.

Anyway, testing for YYTEXT_POINTER is impossible without lex, and relying
on it is only correct if lex is present.

Maybe we should assume the packager is a good guy and uses GNU flex. I
don't know.

Regards,
Pavel Roskin

---------- Forwarded message ----------
Date: Fri, 22 Sep 2000 15:36:10 -0400 (EDT)
From: Pavel Roskin <address@hidden>
To: address@hidden
Subject: AC_DECL_YYTEXT exits if no [f]lex in PATH

Hello!

The testsuite on HP-UX passes with one exception - AC_DECL_YYTEXT.
It appears that if neither flex nor lex are in PATH configure exits.

I don't think this is the right behaviour, especially considering the fact
that Automake distributes files produced by lex to avoid requiring every
user to install it.

Since I had to touch and test that code anyway, I decided to get rid of
hacks. We no longer assume that lex exists - LEX is set to ":" if it
doesn't. In any case we are testing for both libfl and libl - they might
be present, although good programs should provide a fallback if they
don't.

Another positive effect of my patch is that specifying flex with the full
path now works. With the current code LEXLIB wouldn't be set when one runs

LEX=/opt/flex/bin/flex ./configure

Checking names is ugly and not worth the trouble in this case.

ChangeLog:
        * acspecific.m4 (AC_PROG_LEX): Don't assume that lex exists.
        Don't run _AC_DECL_YYTEXT if it doesn't. Always check libl and
        libfl regardless of the $LEX value.

P.S. It's a very intersting question why AC_DECL_YYTEXT, and not
AC_PROG_LEX appears in macros.m4. Expect a separate fix.

Regards,
Pavel Roskin

__________________________
Index: acspecific.m4
--- acspecific.m4       Wed Sep 20 09:00:11 2000
+++ acspecific.m4       Fri Sep 22 15:05:44 2000
@@ -129,19 +129,16 @@
 # Look for flex or lex.  Set its associated library to LEXLIB.
 # Check if lex declares yytext as a char * by default, not a char[].
 AC_DEFUN([AC_PROG_LEX],
-[AH_CHECK_LIB(fl)dnl
-AH_CHECK_LIB(l)dnl
-AC_CHECK_PROG(LEX, flex, flex, lex)
+[AC_CHECK_PROGS(LEX, flex lex, :)
 if test -z "$LEXLIB"
 then
-  case $LEX in
-  flex*) ac_lib=fl ;;
-  *) ac_lib=l ;;
-  esac
-  AC_CHECK_LIB($ac_lib, yywrap, LEXLIB="-l$ac_lib")
+  AC_CHECK_LIB(fl, yywrap, LEXLIB="-lfl",
+    [AC_CHECK_LIB(l, yywrap, LEXLIB="-ll")])
 fi
 AC_SUBST(LEXLIB)
-_AC_DECL_YYTEXT])
+if test "x$LEX" != "x:"; then
+  _AC_DECL_YYTEXT
+fi])
 
 
 # _AC_DECL_YYTEXT
__________________________




reply via email to

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