[Mesa-dev] Mesa (master): automake: Add a prefix variable for libglsl sources.

Jose Fonseca jfonseca at vmware.com
Mon Jun 11 10:34:07 PDT 2012


----- Original Message -----
> This breaks the SCons build, which parses src/glsl/Makefile.sources,
> and can't understand "$(GLSL_SRCDIR)/" as it only supports a simple
> subset of Make syntax.
> 
> Is there some other way to achieve this effect, without changing
> src/glsl/Makefile.sources?

Actually, the scons' makefile parser handles "$(GLSL_SRCDIR)/" just fine. The problem is merely that GLSL_SRCDIR is not defined.

The patch below would fix it, and should (hopefully) not affect automake, but I'm not sure.

Would this be ok?


Jose


diff --git a/scons/source_list.py b/scons/source_list.py
index 1d5166b..8111f43 100644
--- a/scons/source_list.py
+++ b/scons/source_list.py
@@ -63,7 +63,7 @@ class SourceListParser(object):
             self._error('not a variable definition')
 
         if op_pos > 0:
-            if line[op_pos - 1] in [':', '+']:
+            if line[op_pos - 1] in [':', '+', '?']:
                 op_pos -= 1
         else:
             self._error('only =, :=, and += are supported')
@@ -77,6 +77,9 @@ class SourceListParser(object):
             self.symbol_table[sym] = val
         elif op == '+=':
             self.symbol_table[sym] += ' ' + val
+        elif op == '?=':
+            if sym not in self.symbol_table:
+                self.symbol_table[sym] = val
 
     def _parse_line(self, line):
         """Parse a source list line."""
diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources
index b58de17..0425fa3 100644
--- a/src/glsl/Makefile.sources
+++ b/src/glsl/Makefile.sources
@@ -1,5 +1,7 @@
 # shared source lists for Makefile, SConscript, and Android.mk
 
+GLSL_SRCDIR ?= .
+
 # libglcpp
 
 LIBGLCPP_FILES = \
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index 63fbf58..608aa79 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -1,5 +1,7 @@
 ### Lists of source files, included by Makefiles
 
+SRCDIR ?= .
+
 # this is part of MAIN_FILES
 MAIN_ES_FILES = \
        $(SRCDIR)/main/api_exec_es1.c \


More information about the mesa-dev mailing list