Mesa (7.10): mesa: check that flex/bison are installed
Brian Paul
brianp at kemper.freedesktop.org
Fri Jun 10 21:26:27 UTC 2011
Module: Mesa
Branch: 7.10
Commit: 5ec931eb7de639682abc992be56d533997c656e0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5ec931eb7de639682abc992be56d533997c656e0
Author: Brian Paul <brianp at vmware.com>
Date: Thu Jun 2 12:42:28 2011 -0600
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.
(cherry picked from commit de1df26b5c11a45f2b1ff2ddc7b8ec764356aa94)
---
configs/autoconf.in | 4 ++++
configs/default | 2 ++
configure.ac | 6 ++++++
src/glsl/Makefile | 8 ++++----
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/configs/autoconf.in b/configs/autoconf.in
index 1538d9a..1bebd25 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -53,6 +53,10 @@ INSTALL = @INSTALL@
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
+# Flex and Bison for GLSL compiler
+FLEX = @FLEX@
+BISON = @BISON@
+
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
diff --git a/configs/default b/configs/default
index 2301a68..0e04502 100644
--- a/configs/default
+++ b/configs/default
@@ -37,6 +37,8 @@ MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
+FLEX = flex
+BISON = bison
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
diff --git a/configure.ac b/configure.ac
index ad9eb01..931c6e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,12 @@ 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])
+
dnl Our fallback install-sh is a symlink to minstall. Use the existing
dnl configuration in that case.
AC_PROG_INSTALL
diff --git a/src/glsl/Makefile b/src/glsl/Makefile
index 7e9471e..84c7f97 100644
--- a/src/glsl/Makefile
+++ b/src/glsl/Makefile
@@ -162,16 +162,16 @@ glcpp/glcpp: $(GLCPP_OBJECTS) libglsl.a
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
glsl_lexer.cpp: glsl_lexer.lpp
- flex --nounistd -o$@ $<
+ $(FLEX) --nounistd -o$@ $<
glsl_parser.cpp: glsl_parser.ypp
- bison -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $<
+ $(BISON) -v -o "$@" -p "_mesa_glsl_" --defines=glsl_parser.h $<
glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
- flex --nounistd -o$@ $<
+ $(FLEX) --nounistd -o$@ $<
glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
- bison -v -o "$@" --defines=glcpp/glcpp-parse.h $<
+ $(BISON) -v -o "$@" --defines=glcpp/glcpp-parse.h $<
builtins: builtin_function.cpp builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py
@echo Bootstrapping the compiler...
More information about the mesa-commit
mailing list