[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AC_DECL_YYTEXT exits if no [f]lex in PATH
From: |
Pavel Roskin |
Subject: |
AC_DECL_YYTEXT exits if no [f]lex in PATH |
Date: |
Fri, 22 Sep 2000 15:36:10 -0400 (EDT) |
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
__________________________
- AC_DECL_YYTEXT exits if no [f]lex in PATH,
Pavel Roskin <=