summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-05-18 07:50:21 -0600
committerBrian Paul <brianp@vmware.com>2011-05-18 07:51:33 -0600
commitde1df26b5c11a45f2b1ff2ddc7b8ec764356aa94 (patch)
tree3ad505018f3628b917cd45998c5edf966640d15c
parent3e0bb02358d627e784a2b7041d6e2e23e3dfd2c5 (diff)
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.
-rw-r--r--configs/autoconf.in4
-rw-r--r--configs/default2
-rw-r--r--configure.ac6
-rw-r--r--src/glsl/Makefile8
-rw-r--r--src/mesa/Makefile4
5 files changed, 18 insertions, 6 deletions
diff --git a/configs/autoconf.in b/configs/autoconf.in
index 4e931a3a9c..a484bcff99 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -58,6 +58,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 0582a0210a..b7acfd2f1a 100644
--- a/configs/default
+++ b/configs/default
@@ -38,6 +38,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 a95012c242..b55473ffec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,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 e4b992dbc1..4100414a37 100644
--- a/src/glsl/Makefile
+++ b/src/glsl/Makefile
@@ -192,16 +192,16 @@ $(DRICORE_OBJ_DIR)/%.o : %.c
$(CC) -c $(INCLUDES) $(DRI_CFLAGS) $(DEFINES) $< -o $@
glsl_lexer.cpp: glsl_lexer.ll
- flex --nounistd -o$@ $<
+ $(FLEX) --nounistd -o$@ $<
glsl_parser.cpp: glsl_parser.yy
- 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 $<
builtin_compiler: $(GLSL2_OBJECTS) $(OBJECTS) builtin_stubs.o
$(APP_CXX) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(GLSL2_OBJECTS) builtin_stubs.o -o $@
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 03962e9c19..a903a260ac 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -75,10 +75,10 @@ main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py m
$(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@
program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
- bison -v -d --output=program/program_parse.tab.c $<
+ $(BISON) -v -d --output=program/program_parse.tab.c $<
program/lex.yy.c: program/program_lexer.l
- flex --never-interactive --outfile=$@ $<
+ $(FLEX) --never-interactive --outfile=$@ $<
######################################################################
# Helper libraries used by many drivers: