From 601498ae73e654c2de997ea75075613a694d604d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Nov 2010 13:30:22 +0000 Subject: scons: Revamp how to specify targets to build. Use scons target and dependency system instead of ad-hoc options. Now is simply a matter of naming what to build. For example: scons libgl-xlib scons libgl-gdi scons graw-progs scons llvmpipe and so on. And there is also the possibility of scepcified subdirs, e.g. scons src/gallium/drivers If nothing is specified then everything will be build. There might be some rough corners over the next days. Please bare with me. --- src/gallium/SConscript | 98 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 8 deletions(-) (limited to 'src/gallium/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 3c171552bed..76f9ffb58ab 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -1,30 +1,112 @@ -import os +Import('env') -Import('*') +# +# Auxiliary modules +# SConscript('auxiliary/SConscript') -for driver in env['drivers']: - SConscript(os.path.join('drivers', driver, 'SConscript')) +# +# Drivers +# + +SConscript([ + 'drivers/failover/SConscript', + 'drivers/galahad/SConscript', + 'drivers/i915/SConscript', + 'drivers/i965/SConscript', + 'drivers/identity/SConscript', + 'drivers/llvmpipe/SConscript', + 'drivers/rbug/SConscript', + 'drivers/r300/SConscript', + 'drivers/softpipe/SConscript', + 'drivers/svga/SConscript', + 'drivers/trace/SConscript', +]) + +if env['dri']: + # These drivers depend on drm headers + SConscript([ + # XXX: nouveau drivers have a tight dependency on libdrm, so to enable + # we need some version logic before we enable them. Also, ATM there is + # no nouveau target in scons + #'drivers/nouveau/SConscript', + #'drivers/nv50/SConscript', + #'drivers/nvfx/SConscript', + 'drivers/r600/SConscript', + ]) + +# +# State trackers +# # Needed by some state trackers SConscript('winsys/sw/null/SConscript') SConscript('state_trackers/python/SConscript') -if platform != 'embedded': +if env['platform'] != 'embedded': SConscript('state_trackers/glx/xlib/SConscript') SConscript('state_trackers/dri/SConscript') SConscript('state_trackers/xorg/SConscript') SConscript('state_trackers/egl/SConscript') SConscript('state_trackers/vega/SConscript') -if platform == 'windows': +if env['platform'] == 'windows': SConscript('state_trackers/wgl/SConscript') +# +# Winsys +# + SConscript('winsys/SConscript') -SConscript('targets/SConscript') +# +# Targets +# + +SConscript([ + 'targets/graw-null/SConscript', +]) + +if env['x11']: + SConscript([ + 'targets/graw-xlib/SConscript', + 'targets/libgl-xlib/SConscript', + ]) -if platform != 'embedded': +if env['platform'] == 'windows': + SConscript([ + 'targets/libgl-gdi/SConscript', + #'egl-gdi/SConscript', + ]) + +if env['dri']: + SConscript([ + 'targets/SConscript.dri', + 'targets/dri-i915/SConscript', + 'targets/dri-i965/SConscript', + #'targets/dri-nouveau/SConscript', + 'targets/dri-r300/SConscript', + 'targets/dri-r600/SConscript', + 'targets/dri-swrast/SConscript', + 'targets/dri-vmwgfx/SConscript', + ]) + +if env['xorg']: + SConscript([ + #'targets/xorg-i915/SConscript', + #'targets/xorg-i965/SConscript', + #'targets/xorg-nouveau/SConscript', + #'targets/xorg-radeon/SConscript', + 'targets/xorg-vmwgfx/SConscript', + ]) + + +# +# Unit tests & tools +# + +if env['platform'] != 'embedded': SConscript('tests/unit/SConscript') SConscript('tests/graw/SConscript') + -- cgit v1.2.3 From ab9ca6caa8e8b0c886317fce694460ea23bcf8b9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Nov 2010 14:24:08 +0000 Subject: scons: Some pipe drivers are not portable for MSVC --- src/gallium/SConscript | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gallium/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 76f9ffb58ab..1b41c39a460 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -14,16 +14,21 @@ SConscript([ 'drivers/failover/SConscript', 'drivers/galahad/SConscript', 'drivers/i915/SConscript', - 'drivers/i965/SConscript', 'drivers/identity/SConscript', 'drivers/llvmpipe/SConscript', 'drivers/rbug/SConscript', - 'drivers/r300/SConscript', 'drivers/softpipe/SConscript', 'drivers/svga/SConscript', 'drivers/trace/SConscript', ]) +if not env['msvc']: + # These drivers do not build on MSVC compilers + SConscript([ + 'drivers/i965/SConscript', + 'drivers/r300/SConscript', + ]) + if env['dri']: # These drivers depend on drm headers SConscript([ -- cgit v1.2.3 From 45f4b85d58ad94222e13f521b115e44dc7dd7d6d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Nov 2010 13:49:35 +0000 Subject: scons: i915 can't build on MSVC either. I thought I had singled it out before, but apparently not. --- src/gallium/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 1b41c39a460..eb4f49f06b0 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -13,7 +13,6 @@ SConscript('auxiliary/SConscript') SConscript([ 'drivers/failover/SConscript', 'drivers/galahad/SConscript', - 'drivers/i915/SConscript', 'drivers/identity/SConscript', 'drivers/llvmpipe/SConscript', 'drivers/rbug/SConscript', @@ -25,6 +24,7 @@ SConscript([ if not env['msvc']: # These drivers do not build on MSVC compilers SConscript([ + 'drivers/i915/SConscript', 'drivers/i965/SConscript', 'drivers/r300/SConscript', ]) -- cgit v1.2.3 From c69979f243fe7ac15d638f9b2b5cf35b30b07939 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 4 Nov 2010 14:33:31 +0100 Subject: scons: Hook-up graw-gdi target. --- src/gallium/SConscript | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gallium/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index eb4f49f06b0..b5bc9ecfd9e 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -81,6 +81,7 @@ if env['x11']: if env['platform'] == 'windows': SConscript([ + 'targets/graw-gdi/SConscript', 'targets/libgl-gdi/SConscript', #'egl-gdi/SConscript', ]) -- cgit v1.2.3 From b4ac0adb75bddc1c17c57eb19c7e6dde52e4b7e7 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 4 Nov 2010 21:12:30 +0000 Subject: scons: Detabify Drivers scons files for a later time --- src/gallium/SConscript | 29 +++++----- src/gallium/state_trackers/dri/SConscript | 4 +- src/gallium/state_trackers/dri/drm/SConscript | 16 +++--- src/gallium/state_trackers/dri/sw/SConscript | 16 +++--- src/gallium/state_trackers/vega/SConscript | 54 +++++++++---------- src/gallium/state_trackers/wgl/SConscript | 6 +-- src/gallium/targets/SConscript.dri | 76 +++++++++++++-------------- src/gallium/targets/xorg-vmwgfx/SConscript | 2 +- src/gallium/winsys/svga/drm/SConscript | 42 +++++++-------- 9 files changed, 122 insertions(+), 123 deletions(-) (limited to 'src/gallium/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index b5bc9ecfd9e..63435a30658 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -50,14 +50,14 @@ SConscript('winsys/sw/null/SConscript') SConscript('state_trackers/python/SConscript') if env['platform'] != 'embedded': - SConscript('state_trackers/glx/xlib/SConscript') - SConscript('state_trackers/dri/SConscript') - SConscript('state_trackers/xorg/SConscript') - SConscript('state_trackers/egl/SConscript') - SConscript('state_trackers/vega/SConscript') + SConscript('state_trackers/glx/xlib/SConscript') + SConscript('state_trackers/dri/SConscript') + SConscript('state_trackers/xorg/SConscript') + SConscript('state_trackers/egl/SConscript') + SConscript('state_trackers/vega/SConscript') if env['platform'] == 'windows': - SConscript('state_trackers/wgl/SConscript') + SConscript('state_trackers/wgl/SConscript') # # Winsys @@ -89,13 +89,13 @@ if env['platform'] == 'windows': if env['dri']: SConscript([ 'targets/SConscript.dri', - 'targets/dri-i915/SConscript', - 'targets/dri-i965/SConscript', - #'targets/dri-nouveau/SConscript', - 'targets/dri-r300/SConscript', + 'targets/dri-i915/SConscript', + 'targets/dri-i965/SConscript', + #'targets/dri-nouveau/SConscript', + 'targets/dri-r300/SConscript', 'targets/dri-r600/SConscript', - 'targets/dri-swrast/SConscript', - 'targets/dri-vmwgfx/SConscript', + 'targets/dri-swrast/SConscript', + 'targets/dri-vmwgfx/SConscript', ]) if env['xorg']: @@ -113,6 +113,5 @@ if env['xorg']: # if env['platform'] != 'embedded': - SConscript('tests/unit/SConscript') - SConscript('tests/graw/SConscript') - + SConscript('tests/unit/SConscript') + SConscript('tests/graw/SConscript') diff --git a/src/gallium/state_trackers/dri/SConscript b/src/gallium/state_trackers/dri/SConscript index aba60fb8c5b..7702d8e6323 100644 --- a/src/gallium/state_trackers/dri/SConscript +++ b/src/gallium/state_trackers/dri/SConscript @@ -1,6 +1,6 @@ Import('*') SConscript([ - 'sw/SConscript', - 'drm/SConscript', + 'sw/SConscript', + 'drm/SConscript', ]) diff --git a/src/gallium/state_trackers/dri/drm/SConscript b/src/gallium/state_trackers/dri/drm/SConscript index 2a0af65f9bd..7e3a264d1c1 100644 --- a/src/gallium/state_trackers/dri/drm/SConscript +++ b/src/gallium/state_trackers/dri/drm/SConscript @@ -12,16 +12,16 @@ if env['dri']: env.Append(CPPPATH = [ '#/src/mapi', '#/src/mesa', - '#/src/gallium/state_trackers/dri/common', - '#/src/mesa/drivers/dri/common', + '#/src/gallium/state_trackers/dri/common', + '#/src/mesa/drivers/dri/common', ]) st_dri = env.ConvenienceLibrary( - target = 'st_dri', - source = [ 'dri_context.c', - 'dri_drawable.c', - 'dri_screen.c', - 'dri2.c', - ] + target = 'st_dri', + source = [ 'dri_context.c', + 'dri_drawable.c', + 'dri_screen.c', + 'dri2.c', + ] ) Export('st_dri') diff --git a/src/gallium/state_trackers/dri/sw/SConscript b/src/gallium/state_trackers/dri/sw/SConscript index d2eb66668e0..03c2ef6ab1d 100644 --- a/src/gallium/state_trackers/dri/sw/SConscript +++ b/src/gallium/state_trackers/dri/sw/SConscript @@ -10,18 +10,18 @@ if env['dri']: env.Append(CPPPATH = [ '#/src/mapi', '#/src/mesa', - '#/src/gallium/state_trackers/dri/common', - '#/src/mesa/drivers/dri/common', + '#/src/gallium/state_trackers/dri/common', + '#/src/mesa/drivers/dri/common', ]) env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')]) st_drisw = env.ConvenienceLibrary( - target = 'st_drisw', - source = [ 'dri_context.c', - 'dri_drawable.c', - 'dri_screen.c', - 'drisw.c', - ] + target = 'st_drisw', + source = [ 'dri_context.c', + 'dri_drawable.c', + 'dri_screen.c', + 'drisw.c', + ] ) Export('st_drisw') diff --git a/src/gallium/state_trackers/vega/SConscript b/src/gallium/state_trackers/vega/SConscript index 4c6e18f42b2..a25b8474e4d 100644 --- a/src/gallium/state_trackers/vega/SConscript +++ b/src/gallium/state_trackers/vega/SConscript @@ -10,33 +10,33 @@ env.Append(CPPPATH = [ ]) vega_sources = [ - 'api.c', - 'api_context.c', - 'api_filters.c', - 'api_images.c', - 'api_masks.c', - 'api_misc.c', - 'api_paint.c', - 'api_params.c', - 'api_path.c', - 'api_text.c', - 'api_transform.c', - 'vgu.c', - 'vg_context.c', - 'vg_manager.c', - 'vg_state.c', - 'vg_translate.c', - 'polygon.c', - 'bezier.c', - 'path.c', - 'paint.c', - 'arc.c', - 'image.c', - 'renderer.c', - 'stroker.c', - 'mask.c', - 'shader.c', - 'shaders_cache.c', + 'api.c', + 'api_context.c', + 'api_filters.c', + 'api_images.c', + 'api_masks.c', + 'api_misc.c', + 'api_paint.c', + 'api_params.c', + 'api_path.c', + 'api_text.c', + 'api_transform.c', + 'vgu.c', + 'vg_context.c', + 'vg_manager.c', + 'vg_state.c', + 'vg_translate.c', + 'polygon.c', + 'bezier.c', + 'path.c', + 'paint.c', + 'arc.c', + 'image.c', + 'renderer.c', + 'stroker.c', + 'mask.c', + 'shader.c', + 'shaders_cache.c', ] # vgapi_header must be generated first diff --git a/src/gallium/state_trackers/wgl/SConscript b/src/gallium/state_trackers/wgl/SConscript index 0f580b859c6..994b0c86143 100644 --- a/src/gallium/state_trackers/wgl/SConscript +++ b/src/gallium/state_trackers/wgl/SConscript @@ -7,9 +7,9 @@ if env['platform'] in ['windows']: env = env.Clone() env.Append(CPPPATH = [ - '#src/mapi', - '#src/mesa', - '.', + '#src/mapi', + '#src/mesa', + '.', ]) env.AppendUnique(CPPDEFINES = [ diff --git a/src/gallium/targets/SConscript.dri b/src/gallium/targets/SConscript.dri index 092223b3690..bc3671a256b 100644 --- a/src/gallium/targets/SConscript.dri +++ b/src/gallium/targets/SConscript.dri @@ -9,65 +9,65 @@ if not env['dri']: drienv = env.Clone() drienv.Replace(CPPPATH = [ - '#src/mesa/drivers/dri/common', - '#include', - '#include/GL/internal', - '#src/mapi', - '#src/gallium/include', - '#src/gallium/auxiliary', - '#src/gallium/drivers', - '#src/gallium/winsys', - '#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', + '#src/mesa/drivers/dri/common', + '#include', + '#include/GL/internal', + '#src/mapi', + '#src/gallium/include', + '#src/gallium/auxiliary', + '#src/gallium/drivers', + '#src/gallium/winsys', + '#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' + 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' + 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' + 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' + target = 'dri_util.o', + source = '#src/mesa/drivers/dri/common/dri_util.c' ) dri_common_drisw_util = drienv.SharedObject( - target = 'drisw_util.o', - source = '#src/mesa/drivers/dri/common/drisw_util.c' + target = 'drisw_util.o', + source = '#src/mesa/drivers/dri/common/drisw_util.c' ) COMMON_DRI_SW_OBJECTS = [ - dri_common_utils, - dri_common_xmlconfig, - dri_common_drisw_util, + dri_common_utils, + dri_common_xmlconfig, + dri_common_drisw_util, ] COMMON_DRI_DRM_OBJECTS = [ - dri_common_utils, - dri_common_xmlconfig, - dri_common_vblank, - dri_common_dri_util, + dri_common_utils, + dri_common_xmlconfig, + dri_common_vblank, + dri_common_dri_util, ] drienv.AppendUnique(LIBS = [ @@ -76,7 +76,7 @@ drienv.AppendUnique(LIBS = [ ]) Export([ - 'drienv', - 'COMMON_DRI_SW_OBJECTS', - 'COMMON_DRI_DRM_OBJECTS', + 'drienv', + 'COMMON_DRI_SW_OBJECTS', + 'COMMON_DRI_DRM_OBJECTS', ]) diff --git a/src/gallium/targets/xorg-vmwgfx/SConscript b/src/gallium/targets/xorg-vmwgfx/SConscript index f9172aae684..099d49cf1b7 100644 --- a/src/gallium/targets/xorg-vmwgfx/SConscript +++ b/src/gallium/targets/xorg-vmwgfx/SConscript @@ -40,7 +40,7 @@ env.Prepend(LIBS = [ st_xorg, svgadrm, svga, - gallium, + gallium, ]) sources = [ diff --git a/src/gallium/winsys/svga/drm/SConscript b/src/gallium/winsys/svga/drm/SConscript index 3ad4c725727..b049ea60aa8 100644 --- a/src/gallium/winsys/svga/drm/SConscript +++ b/src/gallium/winsys/svga/drm/SConscript @@ -5,37 +5,37 @@ env = env.Clone() env.ParseConfig('pkg-config --cflags libdrm') if env['gcc']: - env.Append(CCFLAGS = ['-fvisibility=hidden']) - env.Append(CPPDEFINES = [ - 'HAVE_STDINT_H', - 'HAVE_SYS_TYPES_H', - '-D_FILE_OFFSET_BITS=64', - ]) - + env.Append(CCFLAGS = ['-fvisibility=hidden']) + env.Append(CPPDEFINES = [ + 'HAVE_STDINT_H', + 'HAVE_SYS_TYPES_H', + '-D_FILE_OFFSET_BITS=64', + ]) + env.Prepend(CPPPATH = [ - 'include', - '#/src/gallium/drivers/svga', - '#/src/gallium/drivers/svga/include', + 'include', + '#/src/gallium/drivers/svga', + '#/src/gallium/drivers/svga/include', ]) env.Append(CPPDEFINES = [ ]) sources = [ - 'vmw_buffer.c', - 'vmw_context.c', - 'vmw_fence.c', - 'vmw_screen.c', - 'vmw_screen_dri.c', - 'vmw_screen_ioctl.c', - 'vmw_screen_pools.c', - 'vmw_screen_svga.c', - 'vmw_surface.c', + 'vmw_buffer.c', + 'vmw_context.c', + 'vmw_fence.c', + 'vmw_screen.c', + 'vmw_screen_dri.c', + 'vmw_screen_ioctl.c', + 'vmw_screen_pools.c', + 'vmw_screen_svga.c', + 'vmw_surface.c', ] svgadrm = env.ConvenienceLibrary( - target = 'svgadrm', - source = sources, + target = 'svgadrm', + source = sources, ) Export('svgadrm') -- cgit v1.2.3 From c0db7854d502d0b24110cbe8560967794d7938cb Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 5 Nov 2010 16:55:46 +0000 Subject: scons: Check for libdrm_[intel|radeon] as well And run SConscripts if they are present. Also make dri depend on both drm and x11. --- scons/gallium.py | 6 +++++- src/gallium/SConscript | 40 +++++++++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 16 deletions(-) (limited to 'src/gallium/SConscript') diff --git a/scons/gallium.py b/scons/gallium.py index 36f1831af89..75e9b9e7fc3 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -560,10 +560,14 @@ def generate(env): env.Tool('udis86') pkg_config_modules(env, 'x11', ['x11', 'xext']) - pkg_config_modules(env, 'dri', ['libdrm']) + pkg_config_modules(env, 'drm', ['libdrm']) + pkg_config_modules(env, 'drm_intel', ['libdrm_intel']) + pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon']) pkg_config_modules(env, 'xorg', ['xorg-server']) pkg_config_modules(env, 'kms', ['libkms']) + env['dri'] = env['x11'] and env['drm'] + # Custom builders and methods env.Tool('custom') createInstallMethods(env) diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 63435a30658..9436b684e4e 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -29,17 +29,21 @@ if not env['msvc']: 'drivers/r300/SConscript', ]) -if env['dri']: +if env['drm']: # These drivers depend on drm headers - SConscript([ - # XXX: nouveau drivers have a tight dependency on libdrm, so to enable - # we need some version logic before we enable them. Also, ATM there is - # no nouveau target in scons - #'drivers/nouveau/SConscript', - #'drivers/nv50/SConscript', - #'drivers/nvfx/SConscript', - 'drivers/r600/SConscript', - ]) + if env['drm_radeon']: + SConscript([ + 'drivers/r600/SConscript', + ]) + # XXX: nouveau drivers have a tight dependency on libdrm, so to enable + # we need some version logic before we enable them. Also, ATM there is + # no nouveau target in scons + # if env['drm_nouveau']: + # SConscript([ + # 'drivers/nouveau/SConscript', + # 'drivers/nv50/SConscript', + # 'drivers/nvfx/SConscript', + # ]) # # State trackers @@ -89,14 +93,20 @@ if env['platform'] == 'windows': if env['dri']: SConscript([ 'targets/SConscript.dri', - 'targets/dri-i915/SConscript', - 'targets/dri-i965/SConscript', - #'targets/dri-nouveau/SConscript', - 'targets/dri-r300/SConscript', - 'targets/dri-r600/SConscript', 'targets/dri-swrast/SConscript', 'targets/dri-vmwgfx/SConscript', + #'targets/dri-nouveau/SConscript', ]) + if env['drm_intel']: + SConscript([ + 'targets/dri-i915/SConscript', + 'targets/dri-i965/SConscript', + ]) + if env['drm_radeon']: + SConscript([ + 'targets/dri-r300/SConscript', + 'targets/dri-r600/SConscript', + ]) if env['xorg']: SConscript([ -- cgit v1.2.3 From 7e9f5eab4e18e0b661fc9b65a0f409d10e041b24 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 5 Nov 2010 18:18:09 +0000 Subject: scons: Move dependancy checks to the main gallium scons file --- src/gallium/SConscript | 18 +++++-- src/gallium/state_trackers/dri/drm/SConscript | 23 ++++----- src/gallium/state_trackers/dri/sw/SConscript | 23 ++++----- src/gallium/state_trackers/egl/SConscript | 3 -- src/gallium/state_trackers/glx/xlib/SConscript | 3 -- src/gallium/state_trackers/wgl/SConscript | 71 ++++++++++++-------------- src/gallium/state_trackers/xorg/SConscript | 3 -- 7 files changed, 69 insertions(+), 75 deletions(-) (limited to 'src/gallium/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 9436b684e4e..207987bedc5 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -54,14 +54,22 @@ SConscript('winsys/sw/null/SConscript') SConscript('state_trackers/python/SConscript') if env['platform'] != 'embedded': - SConscript('state_trackers/glx/xlib/SConscript') - SConscript('state_trackers/dri/SConscript') - SConscript('state_trackers/xorg/SConscript') - SConscript('state_trackers/egl/SConscript') SConscript('state_trackers/vega/SConscript') + if env['x11']: + SConscript('state_trackers/glx/xlib/SConscript') + + if env['dri']: + SConscript('state_trackers/dri/SConscript') + + if env['dri'] and env['xorg']: + SConscript('state_trackers/xorg/SConscript') + if env['platform'] == 'windows': - SConscript('state_trackers/wgl/SConscript') + SConscript([ + 'state_trackers/egl/SConscript', + 'state_trackers/wgl/SConscript', + ]) # # Winsys diff --git a/src/gallium/state_trackers/dri/drm/SConscript b/src/gallium/state_trackers/dri/drm/SConscript index 7e3a264d1c1..90082ffb6ae 100644 --- a/src/gallium/state_trackers/dri/drm/SConscript +++ b/src/gallium/state_trackers/dri/drm/SConscript @@ -3,20 +3,18 @@ Import('*') -if env['dri']: +env = env.Clone() - env = env.Clone() +env.ParseConfig('pkg-config --cflags --libs libdrm') - env.ParseConfig('pkg-config --cflags --libs libdrm') +env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + '#/src/gallium/state_trackers/dri/common', + '#/src/mesa/drivers/dri/common', +]) - env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/gallium/state_trackers/dri/common', - '#/src/mesa/drivers/dri/common', - ]) - - st_dri = env.ConvenienceLibrary( +st_dri = env.ConvenienceLibrary( target = 'st_dri', source = [ 'dri_context.c', 'dri_drawable.c', @@ -24,4 +22,5 @@ if env['dri']: 'dri2.c', ] ) - Export('st_dri') + +Export('st_dri') diff --git a/src/gallium/state_trackers/dri/sw/SConscript b/src/gallium/state_trackers/dri/sw/SConscript index 03c2ef6ab1d..8646d276c8d 100644 --- a/src/gallium/state_trackers/dri/sw/SConscript +++ b/src/gallium/state_trackers/dri/sw/SConscript @@ -3,20 +3,18 @@ Import('*') -if env['dri']: +env = env.Clone() - env = env.Clone() +env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/mesa', + '#/src/gallium/state_trackers/dri/common', + '#/src/mesa/drivers/dri/common', +]) - env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/gallium/state_trackers/dri/common', - '#/src/mesa/drivers/dri/common', - ]) +env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')]) - env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')]) - - st_drisw = env.ConvenienceLibrary( +st_drisw = env.ConvenienceLibrary( target = 'st_drisw', source = [ 'dri_context.c', 'dri_drawable.c', @@ -24,4 +22,5 @@ if env['dri']: 'drisw.c', ] ) - Export('st_drisw') + +Export('st_drisw') diff --git a/src/gallium/state_trackers/egl/SConscript b/src/gallium/state_trackers/egl/SConscript index 8d34e47df0e..50c76819954 100644 --- a/src/gallium/state_trackers/egl/SConscript +++ b/src/gallium/state_trackers/egl/SConscript @@ -3,9 +3,6 @@ Import('*') -if env['platform'] != 'windows': - Return() - env = env.Clone() env.Append(CPPPATH = [ diff --git a/src/gallium/state_trackers/glx/xlib/SConscript b/src/gallium/state_trackers/glx/xlib/SConscript index 775000eacce..0542a5fc89b 100644 --- a/src/gallium/state_trackers/glx/xlib/SConscript +++ b/src/gallium/state_trackers/glx/xlib/SConscript @@ -3,9 +3,6 @@ Import('*') -if not env['x11']: - Return() - env = env.Clone() env.Append(CPPPATH = [ diff --git a/src/gallium/state_trackers/wgl/SConscript b/src/gallium/state_trackers/wgl/SConscript index 994b0c86143..ec55f042f90 100644 --- a/src/gallium/state_trackers/wgl/SConscript +++ b/src/gallium/state_trackers/wgl/SConscript @@ -2,41 +2,38 @@ import os Import('*') -if env['platform'] in ['windows']: - - env = env.Clone() - - env.Append(CPPPATH = [ - '#src/mapi', - '#src/mesa', - '.', - ]) - - env.AppendUnique(CPPDEFINES = [ - '_GDI32_', # prevent wgl* being declared __declspec(dllimport) - 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers - 'WIN32_THREADS', # use Win32 thread API - 'WIN32_LEAN_AND_MEAN', # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx - ]) - - sources = [ - 'stw_context.c', - 'stw_device.c', - 'stw_ext_extensionsstring.c', - 'stw_ext_gallium.c', - 'stw_ext_pixelformat.c', - 'stw_ext_swapinterval.c', - 'stw_framebuffer.c', - 'stw_getprocaddress.c', - 'stw_pixelformat.c', - 'stw_st.c', - 'stw_tls.c', - 'stw_wgl.c', - ] +env = env.Clone() - wgl = env.ConvenienceLibrary( - target ='wgl', - source = sources, - ) - - Export('wgl') +env.Append(CPPPATH = [ + '#src/mapi', + '#src/mesa', + '.', +]) + +env.AppendUnique(CPPDEFINES = [ + '_GDI32_', # prevent wgl* being declared __declspec(dllimport) + 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers + 'WIN32_THREADS', # use Win32 thread API + 'WIN32_LEAN_AND_MEAN', # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx +]) + +sources = [ + 'stw_context.c', + 'stw_device.c', + 'stw_ext_extensionsstring.c', + 'stw_ext_gallium.c', + 'stw_ext_pixelformat.c', + 'stw_ext_swapinterval.c', + 'stw_framebuffer.c', + 'stw_getprocaddress.c', + 'stw_pixelformat.c', + 'stw_st.c', + 'stw_tls.c', + 'stw_wgl.c', +] + +wgl = env.ConvenienceLibrary( + target ='wgl', + source = sources, +) +Export('wgl') diff --git a/src/gallium/state_trackers/xorg/SConscript b/src/gallium/state_trackers/xorg/SConscript index bc7821f8a8d..1022954ca09 100644 --- a/src/gallium/state_trackers/xorg/SConscript +++ b/src/gallium/state_trackers/xorg/SConscript @@ -3,9 +3,6 @@ Import('*') -if not env['x11'] or not env['dri'] or not env['xorg']: - Return() - env = env.Clone() env.Append(CPPPATH = [ -- cgit v1.2.3 From 9d9df964c4db320d64a481ed97f187300d41c527 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 9 Nov 2010 00:28:05 -0500 Subject: scons: build the xorg state trackers only when env includes drm --- src/gallium/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index 207987bedc5..0efab834f66 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -116,7 +116,7 @@ if env['dri']: 'targets/dri-r600/SConscript', ]) -if env['xorg']: +if env['xorg'] and env['drm']: SConscript([ #'targets/xorg-i915/SConscript', #'targets/xorg-i965/SConscript', -- cgit v1.2.3