Mesa (master): autoconf: use AC_PROG_YACC/LEX

Matt Turner mattst88 at kemper.freedesktop.org
Tue Jan 31 02:10:44 UTC 2012


Module: Mesa
Branch: master
Commit: dfb6142548df0dccbe6eed2c57986e208eb0d437
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dfb6142548df0dccbe6eed2c57986e208eb0d437

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Jan 13 14:31:39 2012 -0500

autoconf: use AC_PROG_YACC/LEX

Needed for automake. Using AC_PROG_PATH(bison/flex) causes automake to
fail to build .y and .l files.

It is up to the builder to use bison/flex instead of yacc/lex.

Reviewed-by: Eric Anholt <eric at anholt.net>
Tested-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Matt Turner <mattst88 at gmail.com>

---

 bin/.gitignore      |    1 +
 configs/autoconf.in |    4 ++--
 configure.ac        |   13 ++++++++-----
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/bin/.gitignore b/bin/.gitignore
index 3b3f168..5cf62d9 100644
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1,2 +1,3 @@
 /depcomp
 /missing
+ylwrap
diff --git a/configs/autoconf.in b/configs/autoconf.in
index a8aa42d..bb8f2c3 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -63,8 +63,8 @@ PYTHON2 = @PYTHON2@
 PYTHON_FLAGS = -t -O -O
 
 # Flex and Bison for GLSL compiler
-FLEX = @FLEX@
-BISON = @BISON@
+FLEX = @LEX@
+BISON = @YACC@
 
 # Library names (base name)
 GL_LIB = @GL_LIB@
diff --git a/configure.ac b/configure.ac
index 9481798..1700058 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,11 +54,14 @@ if test "x$MKDEP" = "x"; then
     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])
+AC_PROG_YACC
+AC_PATH_PROG([YACC_INST], $YACC)
+if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.y"; then
+    if test -z "$YACC_INST"; then
+        AC_MSG_ERROR([yacc not found - unable to compile glcpp-parse.y])
+    fi
+fi
+AC_PROG_LEX
 
 dnl Our fallback install-sh is a symlink to minstall. Use the existing
 dnl configuration in that case.




More information about the mesa-commit mailing list