This will work iff AM_PROG_LEX uses AC_REQUIRE to invoke AC_PROG_LEX.
Evidently so. From automake's m4/lex.m4: AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi])