From 711529153c797b4169fd5bbba79b370a2f38a0e9 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 26 Mar 2010 14:19:48 +0100 Subject: gallium: Fix DRI driver build warnings under scons 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 | 66 +------------------------ src/gallium/targets/SConscript.dri | 79 ++++++++++++++++++++++++++++++ src/gallium/targets/dri-i915/SConscript | 7 +-- src/gallium/targets/dri-i915/dummy.c | 0 src/gallium/targets/dri-i965/SConscript | 13 +++-- src/gallium/targets/dri-i965/dummy.c | 0 src/gallium/targets/dri-radeong/SConscript | 15 ++++-- src/gallium/targets/dri-radeong/dummy.c | 0 src/gallium/targets/dri-vmwgfx/SConscript | 24 ++++----- src/gallium/targets/dri-vmwgfx/dummy.c | 0 10 files changed, 117 insertions(+), 87 deletions(-) create mode 100644 src/gallium/targets/SConscript.dri create mode 100644 src/gallium/targets/dri-i915/dummy.c create mode 100644 src/gallium/targets/dri-i965/dummy.c create mode 100644 src/gallium/targets/dri-radeong/dummy.c create mode 100644 src/gallium/targets/dri-vmwgfx/dummy.c (limited to 'src') diff --git a/src/gallium/targets/SConscript b/src/gallium/targets/SConscript index a41496a5dd9..747e64508f7 100644 --- a/src/gallium/targets/SConscript +++ b/src/gallium/targets/SConscript @@ -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 index 00000000000..62192405807 --- /dev/null +++ b/src/gallium/targets/SConscript.dri @@ -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', + ]) diff --git a/src/gallium/targets/dri-i915/SConscript b/src/gallium/targets/dri-i915/SConscript index f6d1f934783..2fcc8028f12 100644 --- a/src/gallium/targets/dri-i915/SConscript +++ b/src/gallium/targets/dri-i915/SConscript @@ -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 index 00000000000..e69de29bb2d diff --git a/src/gallium/targets/dri-i965/SConscript b/src/gallium/targets/dri-i965/SConscript index 3b37d8e1af4..eb9e6cd172a 100644 --- a/src/gallium/targets/dri-i965/SConscript +++ b/src/gallium/targets/dri-i965/SConscript @@ -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 index 00000000000..e69de29bb2d diff --git a/src/gallium/targets/dri-radeong/SConscript b/src/gallium/targets/dri-radeong/SConscript index 239d29ace18..d926c272889 100644 --- a/src/gallium/targets/dri-radeong/SConscript +++ b/src/gallium/targets/dri-radeong/SConscript @@ -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 index 00000000000..e69de29bb2d diff --git a/src/gallium/targets/dri-vmwgfx/SConscript b/src/gallium/targets/dri-vmwgfx/SConscript index 7d248e8a9ce..6a1f8827bc3 100644 --- a/src/gallium/targets/dri-vmwgfx/SConscript +++ b/src/gallium/targets/dri-vmwgfx/SConscript @@ -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 index 00000000000..e69de29bb2d -- cgit v1.2.3