Mesa (gallium-0.2): xlib: Get conditional compilation of drivers working again.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Feb 2 15:38:05 UTC 2009


Module: Mesa
Branch: gallium-0.2
Commit: df73c964d85d2f44d8c62558b5752b2f4443763f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=df73c964d85d2f44d8c62558b5752b2f4443763f

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Feb  2 15:37:58 2009 +0000

xlib: Get conditional compilation of drivers working again.

---

 src/gallium/winsys/xlib/Makefile   |   10 ++++++++--
 src/gallium/winsys/xlib/SConscript |   27 +++++++++++++++++++++------
 src/gallium/winsys/xlib/xlib.c     |    8 ++++++++
 3 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile
index 14d3849..5b71e6d 100644
--- a/src/gallium/winsys/xlib/Makefile
+++ b/src/gallium/winsys/xlib/Makefile
@@ -22,6 +22,12 @@ INCLUDE_DIRS = \
 	-I$(TOP)/src/gallium/state_trackers/glx/xlib \
 	-I$(TOP)/src/gallium/auxiliary
 
+DEFINES = \
+	-DGALLIUM_SOFTPIPE \
+	-DGALLIUM_CELL \
+	-DGALLIUM_TRACE \
+	-DGALLIUM_BRW
+
 XLIB_WINSYS_SOURCES = \
 	xlib.c \
 	xlib_cell.c \
@@ -49,10 +55,10 @@ LIBS = \
 .SUFFIXES : .cpp
 
 .c.o:
-	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
+	$(CC) -c $(INCLUDE_DIRS) $(DEFINES) $(CFLAGS) $< -o $@
 
 .cpp.o:
-	$(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
+	$(CXX) -c $(INCLUDE_DIRS) $(DEFINES) $(CXXFLAGS) $< -o $@
 
 
 
diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript
index 434572f..0fb4b50 100644
--- a/src/gallium/winsys/xlib/SConscript
+++ b/src/gallium/winsys/xlib/SConscript
@@ -13,24 +13,39 @@ if env['platform'] == 'linux' \
     env.Append(CPPPATH = [
         '#/src/mesa',
         '#/src/mesa/main',
+        '#src/gallium/state_trackers/glx/xlib',
     ])
 
-    sources = [];
+    env.Append(CPPDEFINES = ['USE_XSHM'])
 
-    drivers = [];
+    sources = [
+        'xlib.c',
+    ]
+
+    drivers = []
         
     if 'softpipe' in env['drivers']:
+        env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE')
+        sources += ['xlib_softpipe.c']
         drivers += [softpipe]
 
     if 'i965simple' in env['drivers']:
-        drivers += [i965simple]
+        env.Append(CPPDEFINES = 'GALLIUM_I965SIMPLE')
         sources += [
-            'brw_aub.c',
-            'xm_winsys_aub.c',
-            ]
+            'xlib_brw_aub.c',
+            'xlib_brw_context.c',
+            'xlib_brw_screen.c',
+        ]
+        drivers += [i965simple]
         
+    if 'cell' in env['drivers']:
+        env.Append(CPPDEFINES = 'GALLIUM_CELL')
+        sources += ['xlib_cell.c']
+        drivers += [cell]
+
     if 'trace' in env['drivers']:
         env.Append(CPPDEFINES = 'GALLIUM_TRACE')
+        sources += ['xlib_trace.c']
         drivers += [trace]
 
     # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c
index 4982230..da72228 100644
--- a/src/gallium/winsys/xlib/xlib.c
+++ b/src/gallium/winsys/xlib/xlib.c
@@ -73,16 +73,24 @@ static void _init( void )
 
    switch (xlib_mode) {
    case MODE_TRACE:
+#if defined(GALLIUM_TRACE) && defined(GALLIUM_SOFTPIPE)
       xmesa_set_driver( &xlib_trace_driver );
+#endif
       break;
    case MODE_BRW:
+#if defined(GALLIUM_BRW)
       xmesa_set_driver( &xlib_brw_driver );
+#endif
       break;
    case MODE_CELL:
+#if defined(GALLIUM_CELL)
       xmesa_set_driver( &xlib_cell_driver );
+#endif
       break;
    case MODE_SOFTPIPE:
+#if defined(GALLIUM_SOFTPIPE)
       xmesa_set_driver( &xlib_softpipe_driver );
+#endif
       break;
    default:
       assert(0);




More information about the mesa-commit mailing list