build: Use AX_PROG_FLEX

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47248
diff --git a/configure.ac b/configure.ac
index 70599e1..e769eda 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,9 @@
 AX_PROG_BISON([],
               AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"]
                     [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
-AC_PROG_LEX
+AX_PROG_FLEX([],
+             AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"]
+                   [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
 
 AC_PATH_PROG([PERL], [perl])