xref: /netbsd-src/external/bsd/am-utils/dist/m4/macros/prog_lex.m4 (revision a53f50b9b44dc9467ccc9c464999b1d1c509cb0c)
1*a53f50b9Schristosdnl find f/lex, but error if none found
2*a53f50b9SchristosAC_DEFUN_ONCE([AMU_PROG_LEX],
3*a53f50b9Schristos[AC_CHECK_PROGS(LEX, flex lex, :)
4*a53f50b9Schristosif test -z "$LEXLIB"
5*a53f50b9Schristosthen
6*a53f50b9Schristos  AC_CHECK_LIB(fl, yywrap, LEXLIB="-lfl",
7*a53f50b9Schristos    [AC_CHECK_LIB(l, yywrap, LEXLIB="-ll")])
8*a53f50b9Schristosfi
9*a53f50b9SchristosAC_SUBST(LEXLIB)
10*a53f50b9Schristosif test "x$LEX" != "x:"; then
11*a53f50b9Schristos  _AC_PROG_LEX_YYTEXT_DECL
12*a53f50b9Schristoselse
13*a53f50b9Schristos  AC_MSG_ERROR([cannot find flex/lex -- needed for am-utils])
14*a53f50b9Schristosfi])
15