[Mesa-dev] [PATCH 2/9] automake: convert libglsl

Matt Turner mattst88 at gmail.com
Thu Jul 12 12:03:57 PDT 2012


On Wed, Jul 11, 2012 at 11:58 AM, Jon TURNEY
<jon.turney at dronecode.org.uk> wrote:
> v2: Use AM_V_GEN to silence generated code rules. Add BUILT_SOURCES to CLEANFILES
> v3:
> - Fix an accidental // in a path
> - Use automake make rules for lex/yacc rather than writing our own
> - Update .gitignore appropriately
> - Build a libglcpp convenience library rather than awkwardly including
> the files in libglsl and delegating the generation
> - Remove libglsl.a compatibility link on clean
>
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

I'm now getting:

make: *** No rule to make target `../../glsl/glsl_lexer.cpp', needed
by `glsl_lexer.lo'.  Stop.

which is that obnoxious problem where we renamed .lpp -> .ll and .ypp
-> .yy since... scons.

automake creates .cc files from .ll and .yy, and .cpp from .lpp and
.ypp, so we're generating .cc files.

Solutions:
 - We can apply a patch like what I've attached
 - We can make links from .ll -> .lpp and .yy -> .ypp and make
automake use the .?pp files
 - Fix scons and rename the files back to .?pp

Also in the patch I've attached is a fix where libdricore$VERSION.a
needs to be libdricore$(VERSION).a, or else dri drivers try to link
with libdricoreERSION.a.

Please squash those in (or let's find another solution to the .ll
problem) and slap a Tested-by: Matt Turner <mattst88 at gmail.com> on the
series.
-------------- next part --------------
diff --git a/Makefile.am b/Makefile.am
index 8210fcc..b2c810a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,9 +58,9 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
 EXTRA_FILES = \
 	aclocal.m4					\
 	configure					\
-	src/glsl/glsl_parser.cpp			\
+	src/glsl/glsl_parser.cc				\
 	src/glsl/glsl_parser.h				\
-	src/glsl/glsl_lexer.cpp				\
+	src/glsl/glsl_lexer.cc				\
 	src/glsl/glcpp/glcpp-lex.c			\
 	src/glsl/glcpp/glcpp-parse.c			\
 	src/glsl/glcpp/glcpp-parse.h			\
@@ -80,7 +80,7 @@ IGNORE_FILES = \
 
 parsers: configure
 	- at touch $(top_builddir)/configs/current
-	$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
+	$(MAKE) -C src/glsl glsl_parser.cc glsl_parser.h glsl_lexer.cc
 	$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
 	$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
 
diff --git a/configure.ac b/configure.ac
index 7e55907..e62ff2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1085,8 +1085,8 @@ GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
 
 dnl ... or dricore?
 if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then
-    DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$VERSION.la'
-    GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$VERSION.a'
+    DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$(VERSION).la'
+    GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libdricore/libdricore$(VERSION).a'
     HAVE_DRICORE=yes
 fi
 AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes)
diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources
index 0425fa3..f2743f7 100644
--- a/src/glsl/Makefile.sources
+++ b/src/glsl/Makefile.sources
@@ -101,8 +101,8 @@ BUILTIN_COMPILER_CXX_FILES = \
 	$(GLSL_SRCDIR)/builtin_stubs.cpp
 
 BUILTIN_COMPILER_GENERATED_CXX_FILES = \
-	$(GLSL_SRCDIR)/glsl_lexer.cpp \
-	$(GLSL_SRCDIR)/glsl_parser.cpp
+	$(GLSL_SRCDIR)/glsl_lexer.cc \
+	$(GLSL_SRCDIR)/glsl_parser.cc
 
 # libglsl generated sources
 LIBGLSL_GENERATED_CXX_FILES = \


More information about the mesa-dev mailing list