On Fri, Mar 21, 2008 at 10:29:05AM -0400, Stefan Seefeld wrote: > I'm trying to use AC_PROG_LEX to discover whether flex (or lex) is > available. During testing I found out that, even when neither is > available, the LEX variable is set to ':' instead of being empty. > And sure enough, I subsequently found this in the programs.m4 code: > > > AC_DEFUN_ONCE([AC_PROG_LEX], > [AC_CHECK_PROGS(LEX, flex lex, :) > if test "x$LEX" != "x:"; then > _AC_PROG_LEX_YYTEXT_DECL > fi]) > > Is this intentional ? Is it documented somewhere ? In other words, is it > ok for me to check for "test $LEX != ':'" to discover success ? While here, I just hit the following problem: User has old flex in /usr/bin/flex, and new flex in /usr/local/bin, so calls "./configure LEX=/usr/local/bin/flex" to configure the program which needs new flex. The problem is that AC_PROG_FLEX's description is If `flex' is found, set output variable `LEX' to `flex'... so the program's configure.ac tests if test "$LEX" != flex; then as a way of testing flex vs lex, and decides that there is no flex. So, essentially, $LEX is being used for two things: "this is where my lexer lives" and "this is real flex". Not sure on what is best here - thoughts? Cheers, Patrick _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf