For the simplest possible configure.ac:
AC_INIT
AC_PROG_LEX
if test -z "$LEXLIB"; then
AC_MSG_ERROR(no lexlib)
fi
We get:
checking for gcc... no
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... none needed
checking whether yytext is a pointer... no
configure: error: no lexlib
Because (from config.log):
cc-1042 cc: ERROR File = conftest.l, Line = 6
The types of operands "char *" and "int" are incompatible.
{ yyless (input () != 0); }
^
1 error detected in the compilation of "conftest.c".
configure:2670: $? = 2
configure: failed program was:
I think we need to patch programs.m4 to change thusly:
--- programs.m4 2007-12-23 22:41:23.662814876 +0000
+++ programs.m4.orig 2007-12-23 22:40:57.274441233 +0000
@@ -734,7 +734,7 @@
b { REJECT; }
c { yymore (); }
d { yyless (1); }
-e { yyless (input () != 0); }
+e { yyless ((input () != 0)); }
f { unput (yytext[0]); }
. { BEGIN INITIAL; }
%%
Peter
--
Peter O'Gorman
http://pogma.com