gallium: Fix DRI driver build warnings under scons
authorJakob Bornecrantz <wallbraker@gmail.com>
Fri, 26 Mar 2010 13:19:48 +0000 (14:19 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Fri, 26 Mar 2010 13:48:35 +0000 (14:48 +0100)
When building more then one dri driver we would get warnings because
we where defining the same build target multiple times.

Also move all the dri scons targets related code into its own file.

src/gallium/targets/SConscript
src/gallium/targets/SConscript.dri [new file with mode: 0644]
src/gallium/targets/dri-i915/SConscript
src/gallium/targets/dri-i915/dummy.c [new file with mode: 0644]
src/gallium/targets/dri-i965/SConscript
src/gallium/targets/dri-i965/dummy.c [new file with mode: 0644]
src/gallium/targets/dri-radeong/SConscript
src/gallium/targets/dri-radeong/dummy.c [new file with mode: 0644]
src/gallium/targets/dri-vmwgfx/SConscript
src/gallium/targets/dri-vmwgfx/dummy.c [new file with mode: 0644]

index a41496a5dd96a5bea0206d6d397ba07107553ae3..747e64508f74a733b24e51fd5a1dd1a5f28204fb 100644 (file)
@@ -1,9 +1,4 @@
 Import('*')
-
-#if env['dri']:
-#      SConscript([
-#              'drm/SConscript',
-#      ])
        
 if 'xlib' in env['winsys']:
        SConscript([
@@ -16,67 +11,10 @@ if 'gdi' in env['winsys']:
        ])
 
 if env['dri']:
-       drienv = env.Clone()
-
-       drienv.Replace(CPPPATH = [
-               '#src/mesa/drivers/dri/common',
-               '#include',
-               '#include/GL/internal',
-               '#src/gallium/include',
-               '#src/gallium/auxiliary',
-               '#src/gallium/drivers',
-               '#src/mesa',
-               '#src/mesa/main',
-               '#src/mesa/glapi',
-               '#src/mesa/math',
-               '#src/mesa/transform',
-               '#src/mesa/shader',
-               '#src/mesa/swrast',
-               '#src/mesa/swrast_setup',
-               '#src/egl/main',
-               '#src/egl/drivers/dri',
-       ])
-
-       drienv.ParseConfig('pkg-config --cflags --libs libdrm')
-
-       COMMON_GALLIUM_SOURCES = [
-               '#src/mesa/drivers/dri/common/utils.c',
-               '#src/mesa/drivers/dri/common/vblank.c',
-               '#src/mesa/drivers/dri/common/dri_util.c',
-               '#src/mesa/drivers/dri/common/xmlconfig.c',
-       ]
-
-       COMMON_BM_SOURCES = [
-               '#src/mesa/drivers/dri/common/dri_bufmgr.c',
-               '#src/mesa/drivers/dri/common/dri_drmpool.c',
-       ]
-
-       Export([
-               'drienv',
-               'COMMON_GALLIUM_SOURCES',
-               'COMMON_BM_SOURCES',
+       SConscript([
+               'SConscript.dri'
        ])
 
-       if 'vmware' in env['winsys']:
-               SConscript([
-                       'dri-vmwgfx/SConscript',
-               ])
-
-       if 'i915' in env['winsys']:
-               SConscript([
-                       'dri-i915/SConscript',
-               ])
-
-       if 'i965' in env['winsys']:
-               SConscript([
-                       'dri-i965/SConscript',
-               ])
-
-       if 'radeon' in env['winsys']:
-               SConscript([
-                       'dri-radeong/SConscript',
-               ])
-
 if 'xorg' in env['statetrackers']:
        if 'vmware' in env['winsys']:
                SConscript([
diff --git a/src/gallium/targets/SConscript.dri b/src/gallium/targets/SConscript.dri
new file mode 100644 (file)
index 0000000..6219240
--- /dev/null
@@ -0,0 +1,79 @@
+###################################
+# SConcscript file for dri targets
+
+Import('*')
+
+drienv = env.Clone()
+
+drienv.Replace(CPPPATH = [
+       '#src/mesa/drivers/dri/common',
+       '#include',
+       '#include/GL/internal',
+       '#src/gallium/include',
+       '#src/gallium/auxiliary',
+       '#src/gallium/drivers',
+       '#src/mesa',
+       '#src/mesa/main',
+       '#src/mesa/glapi',
+       '#src/mesa/math',
+       '#src/mesa/transform',
+       '#src/mesa/shader',
+       '#src/mesa/swrast',
+       '#src/mesa/swrast_setup',
+       '#src/egl/main',
+       '#src/egl/drivers/dri',
+])
+
+drienv.ParseConfig('pkg-config --cflags --libs libdrm')
+
+dri_common_utils = drienv.SharedObject(
+       target = 'utils.o',
+       source = '#src/mesa/drivers/dri/common/utils.c'
+)
+
+dri_common_xmlconfig = drienv.SharedObject(
+       target = 'xmlconfig.o',
+       source = '#src/mesa/drivers/dri/common/xmlconfig.c'
+)
+
+dri_common_vblank = drienv.SharedObject(
+       target = 'vblank.o',
+       source = '#src/mesa/drivers/dri/common/vblank.c'
+)
+
+dri_common_dri_util = drienv.SharedObject(
+       target = 'dri_util.o',
+       source = '#src/mesa/drivers/dri/common/dri_util.c'
+)
+
+COMMON_DRI_DRM_OBJECTS = [
+       dri_common_utils,
+       dri_common_xmlconfig,
+       dri_common_vblank,
+       dri_common_dri_util,
+]
+
+Export([
+       'drienv',
+       'COMMON_DRI_DRM_OBJECTS',
+])
+
+if 'vmware' in env['winsys']:
+       SConscript([
+               'dri-vmwgfx/SConscript',
+       ])
+
+if 'i915' in env['winsys']:
+       SConscript([
+               'dri-i915/SConscript',
+       ])
+
+if 'i965' in env['winsys']:
+       SConscript([
+               'dri-i965/SConscript',
+       ])
+
+if 'radeon' in env['winsys']:
+       SConscript([
+               'dri-radeong/SConscript',
+       ])
index f6d1f93478388dbff9f510de874762fc35e9c5e1..2fcc8028f12e7542d597e546dbad41add9a23bae 100644 (file)
@@ -15,11 +15,12 @@ env.Prepend(LIBS = [
     trace,
     mesa,
     glsl,
-    gallium
+    gallium,
+    COMMON_DRI_DRM_OBJECTS
 ])
 
 env.LoadableModule(
-    target ='i915_dri.so',
-    source = COMMON_GALLIUM_SOURCES,
+    target = 'i915_dri.so',
+    source = 'dummy.c',
     SHLIBPREFIX = '',
 )
diff --git a/src/gallium/targets/dri-i915/dummy.c b/src/gallium/targets/dri-i915/dummy.c
new file mode 100644 (file)
index 0000000..e69de29
index 3b37d8e1af40ab9c43c54568ade7abe18636ca18..eb9e6cd172ab15e86eef439fa710c59c95c64935 100644 (file)
@@ -8,16 +8,19 @@ env = drienv.Clone()
 
 env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
 
-drivers = [
+env.Prepend(LIBS = [
     st_dri,
     i965drm,
     i965,
     trace,
-]
+    mesa,
+    glsl,
+    gallium,
+    COMMON_DRI_DRM_OBJECTS
+])
 
 env.LoadableModule(
-    target ='i965_dri.so',
-    source = COMMON_GALLIUM_SOURCES,
-    LIBS = drivers + mesa + gallium + env['LIBS'],
+    target = 'i965_dri.so',
+    source = 'dummy.c',
     SHLIBPREFIX = '',
 )
diff --git a/src/gallium/targets/dri-i965/dummy.c b/src/gallium/targets/dri-i965/dummy.c
new file mode 100644 (file)
index 0000000..e69de29
index 239d29ace189378e2dc4843b39d048261f9d32d3..d926c2728897e9f99e2b6fcd809966cf41ae884d 100644 (file)
@@ -8,10 +8,19 @@ env = drienv.Clone()
 
 env.ParseConfig('pkg-config --cflags --libs libdrm_radeon')
 
-drivers = r300 + trace + softpipe
+env.Prepend(LIBS = [
+    st_dri,
+    radeonwinsys,
+    r300,
+    trace,
+    mesa,
+    glsl,
+    gallium,
+    COMMON_DRI_DRM_OBJECTS
+])
 
 env.SharedLibrary(
     target ='radeon_dri.so',
-    source = COMMON_GALLIUM_SOURCES,
-    LIBS = st_dri + radeonwinsys + mesa + glsl + drivers + gallium + env['LIBS'],
+    source = 'dummy.c',
+    SHLIBPREFIX = '',
 )
diff --git a/src/gallium/targets/dri-radeong/dummy.c b/src/gallium/targets/dri-radeong/dummy.c
new file mode 100644 (file)
index 0000000..e69de29
index 7d248e8a9ce24ff82d88aaacca225e559a6f4178..6a1f8827bc38f323810f0a5b5b2f6dd3a5b7b1f0 100644 (file)
@@ -6,19 +6,19 @@ if not 'svga' in env['drivers']:
 
 env = drienv.Clone()
 
-drivers = [
-       trace,
-       st_dri,
-       svgadrm,
-       svga,
-       mesa,
-       glsl,
-       gallium,
-]
+env.Prepend(LIBS = [
+    st_dri,
+    svgadrm,
+    svga,
+    trace,
+    mesa,
+    glsl,
+    gallium,
+    COMMON_DRI_DRM_OBJECTS
+])
 
 env.LoadableModule(
-    target ='vmwgfx_dri.so',
-    source = COMMON_GALLIUM_SOURCES,
-    LIBS = drivers + mesa + gallium + env['LIBS'],
+    target = 'vmwgfx_dri.so',
+    source = 'dummy.c',
     SHLIBPREFIX = '',
 )
diff --git a/src/gallium/targets/dri-vmwgfx/dummy.c b/src/gallium/targets/dri-vmwgfx/dummy.c
new file mode 100644 (file)
index 0000000..e69de29