scons: add 'targets' variable, for specifying ... targets
authorKeith Whitwell <keithw@vmware.com>
Fri, 14 May 2010 09:55:07 +0000 (10:55 +0100)
committerKeith Whitwell <keithw@vmware.com>
Fri, 14 May 2010 11:19:57 +0000 (12:19 +0100)
Ideally scons should be able to work backwards from the list of
targets to figure out which drivers, state trackers and other
convenience libraries need to be built.

SConstruct
src/gallium/targets/SConscript

index 28ed6ea78c0db95d1ed09cde3a1e47331b8c3d63..c843b41b0dc933c6f7562a13108d29933a053612 100644 (file)
@@ -31,6 +31,7 @@ import common
 # Configuration options
 
 default_statetrackers = 'mesa'
+default_targets = 'none'
 
 if common.default_platform in ('linux', 'freebsd', 'darwin'):
        default_drivers = 'softpipe,failover,svga,i915,i965,trace,identity,llvmpipe'
@@ -54,6 +55,28 @@ opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
 opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
                      ['xlib', 'vmware', 'i915', 'i965', 'gdi', 'radeon', 'graw-xlib']))
 
+opts.Add(ListVariable('targets', 'driver targets to build', default_targets,
+                     ['dri-i915',
+                      'dri-i965',
+                      'dri-nouveau',
+                      'dri-radeong',
+                      'dri-swrast',
+                      'dri-vmwgfx',
+                      'egl-i915',
+                      'egl-i965',
+                      'egl-nouveau',
+                      'egl-radeon',
+                      'egl-swrast',
+                      'egl-vmwgfx',
+                      'graw-xlib',
+                      'libgl-gdi',
+                      'libgl-xlib',
+                      'xorg-i915',
+                      'xorg-i965',
+                      'xorg-nouveau',
+                      'xorg-radeon',
+                      'xorg-vmwgfx']))
+
 opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
 
 env = Environment(
index ca3e1ec1327051fc6e3cadd797832c4c7a307d62..9077cbf6a45b5400b083c303cd120e5c8b038a3a 100644 (file)
@@ -1,5 +1,8 @@
+import os
 Import('*')
        
+# Compatibility with old build scripts:
+#
 if 'xlib' in env['winsys']:
        SConscript([
                'libgl-xlib/SConscript',
@@ -10,12 +13,7 @@ if 'gdi' in env['winsys']:
                'libgl-gdi/SConscript',
        ])
 
-if env['platform'] == 'linux' and 'xlib' in env['winsys'] and 'graw-xlib' in env['winsys']:
-       SConscript([
-               'graw-xlib/SConscript',
-       ])
-else:
-    if not env['msvc']:
+if not 'graw-xlib' in env['targets'] and not env['msvc']:
         # XXX: disable until MSVC can link correctly
         SConscript('graw-null/SConscript')
 
@@ -30,3 +28,13 @@ if 'xorg' in env['statetrackers']:
                SConscript([
                        'xorg-vmwgfx/SConscript',
                ])
+
+# Ideally all non-target directories would produce convenience
+# libraries, and the actual shared libraries and other installables
+# would be finally assembled in the targets subtree:
+#
+for target in env['targets']:
+    SConscript(os.path.join(target, 'SConscript'))
+
+
+