mesa: check that flex/bison are installed

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=36651

NOTE: This is a candidate for the 7.10 branch.
diff --git a/configure.ac b/configure.ac
index a95012c..b55473f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,12 @@
     AC_MSG_ERROR([makedepend is required to build Mesa])
 fi
 
+AC_PATH_PROG([FLEX], [flex])
+test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
+
+AC_PATH_PROG([BISON], [bison])
+test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
+
 dnl Our fallback install-sh is a symlink to minstall. Use the existing
 dnl configuration in that case.
 AC_PROG_INSTALL