From: Jakob Bornecrantz Date: Fri, 5 Nov 2010 18:18:09 +0000 (+0000) Subject: scons: Move dependancy checks to the main gallium scons file X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e9f5eab4e18e0b661fc9b65a0f409d10e041b24;p=mesa.git scons: Move dependancy checks to the main gallium scons file --- 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 = [