aboutsummaryrefslogtreecommitdiff
path: root/m4/macros/prog_lex.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/macros/prog_lex.m4')
-rw-r--r--m4/macros/prog_lex.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/m4/macros/prog_lex.m4 b/m4/macros/prog_lex.m4
new file mode 100644
index 000000000000..43da78a86cdd
--- /dev/null
+++ b/m4/macros/prog_lex.m4
@@ -0,0 +1,14 @@
+dnl find f/lex, but error if none found
+AC_DEFUN_ONCE([AMU_PROG_LEX],
+[AC_CHECK_PROGS(LEX, flex lex, :)
+if test -z "$LEXLIB"
+then
+ AC_CHECK_LIB(fl, yywrap, LEXLIB="-lfl",
+ [AC_CHECK_LIB(l, yywrap, LEXLIB="-ll")])
+fi
+AC_SUBST(LEXLIB)
+if test "x$LEX" != "x:"; then
+ _AC_PROG_LEX_YYTEXT_DECL
+else
+ AC_MSG_ERROR([cannot find flex/lex -- needed for am-utils])
+fi])