From: Jakob Bornecrantz Date: Wed, 24 Mar 2010 17:42:35 +0000 (+0100) Subject: gallium: Make scons build dri/xorg drivers again X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=738850e52260a76ffee57e22193b21126d6d39a1;p=mesa.git gallium: Make scons build dri/xorg drivers again --- diff --git a/src/gallium/targets/SConscript b/src/gallium/targets/SConscript index df62fc65fb7..38645646883 100644 --- a/src/gallium/targets/SConscript +++ b/src/gallium/targets/SConscript @@ -14,3 +14,71 @@ if 'gdi' in env['winsys']: SConscript([ 'libgl-gdi/SConscript', ]) + +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', + ]) + + if 'vmware' in env['winsys']: + SConscript([ + 'dri-vmwgfx/SConscript', + ]) + + if 'intel' 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([ + 'xorg-vmwgfx/SConscript', + ]) diff --git a/src/gallium/targets/dri-vmwgfx/SConscript b/src/gallium/targets/dri-vmwgfx/SConscript index d26d0cd7483..4437916c293 100644 --- a/src/gallium/targets/dri-vmwgfx/SConscript +++ b/src/gallium/targets/dri-vmwgfx/SConscript @@ -1,63 +1,20 @@ -import os -import os.path - Import('*') -if env['platform'] == 'linux': - - if env['dri']: - env = env.Clone() - - 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', - ] - - - env.ParseConfig('pkg-config --cflags --libs libdrm') - - env.Prepend(CPPPATH = [ - '#/src/mesa/state_tracker', - '#/src/mesa/drivers/dri/common', - '#/src/mesa/main', - '#/src/mesa/glapi', - '#/src/mesa', - '#/include', - '#/src/gallium/drivers/svga', - '#/src/gallium/drivers/svga/include', - ]) - - env.Append(CPPDEFINES = [ - 'HAVE_STDINT_H', - 'HAVE_SYS_TYPES_H', - ]) +env = drienv.Clone() - env.Append(CFLAGS = [ - '-std=gnu99', - '-D_FILE_OFFSET_BITS=64', - ]) - - env.Prepend(LIBPATH = [ - ]) - - env.Prepend(LIBS = [ - trace, - st_dri, - svgadrm, - svga, - mesa, - glsl, - gallium, - ]) - - # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions - env.LoadableModule( - target ='vmwgfx_dri.so', - source = sources, - LIBS = env['LIBS'], - SHLIBPREFIX = '', - ) - +drivers = [ + trace, + st_dri, + svgadrm, + svga, + mesa, + glsl, + gallium, +] +env.LoadableModule( + target ='vmwgfx_dri.so', + source = COMMON_GALLIUM_SOURCES, + LIBS = drivers + mesa + gallium + env['LIBS'], + SHLIBPREFIX = '', +) diff --git a/src/gallium/winsys/SConscript b/src/gallium/winsys/SConscript index 97ea82ea761..90ca693eb68 100644 --- a/src/gallium/winsys/SConscript +++ b/src/gallium/winsys/SConscript @@ -9,3 +9,24 @@ if 'gdi' in env['winsys']: SConscript([ 'sw/gdi/SConscript', ]) + +if env['dri']: + if 'vmware' in env['winsys']: + SConscript([ + 'svga/drm/SConscript', + ]) + + if 'intel' in env['winsys']: + SConscript([ + 'i915/drm/SConscript', + ]) + + if 'i965' in env['winsys']: + SConscript([ + 'i965/drm/SConscript', + ]) + + if 'radeon' in env['winsys']: + SConscript([ + 'radeon/drm/SConscript', + ]) diff --git a/src/gallium/winsys/i915/drm/SConscript b/src/gallium/winsys/i915/drm/SConscript index 26717f391fa..b47b8add837 100644 --- a/src/gallium/winsys/i915/drm/SConscript +++ b/src/gallium/winsys/i915/drm/SConscript @@ -1,6 +1,6 @@ Import('*') -env = drienv.Clone() +env = env.Clone() inteldrm_sources = [ 'intel_drm_api.c', diff --git a/src/gallium/winsys/i965/drm/SConscript b/src/gallium/winsys/i965/drm/SConscript index 6256ec6eaf0..150ab19a33e 100644 --- a/src/gallium/winsys/i965/drm/SConscript +++ b/src/gallium/winsys/i965/drm/SConscript @@ -1,6 +1,6 @@ Import('*') -env = drienv.Clone() +env = env.Clone() i965drm_sources = [ 'i965_drm_api.c', diff --git a/src/gallium/winsys/radeon/drm/SConscript b/src/gallium/winsys/radeon/drm/SConscript index 19e895f10b9..fab42929514 100644 --- a/src/gallium/winsys/radeon/drm/SConscript +++ b/src/gallium/winsys/radeon/drm/SConscript @@ -1,6 +1,6 @@ Import('*') -env = drienv.Clone() +env = env.Clone() radeon_sources = [ 'radeon_drm_buffer.c',