gallium: Make scons build dri/xorg drivers again
authorJakob Bornecrantz <jakob@vmware.com>
Wed, 24 Mar 2010 17:42:35 +0000 (18:42 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Wed, 24 Mar 2010 17:42:35 +0000 (18:42 +0100)
src/gallium/targets/SConscript
src/gallium/targets/dri-vmwgfx/SConscript
src/gallium/winsys/SConscript
src/gallium/winsys/i915/drm/SConscript
src/gallium/winsys/i965/drm/SConscript
src/gallium/winsys/radeon/drm/SConscript

index df62fc65fb77bac4e1cfe07e4eb8acbe71afb475..3864564688308ff633811fde3acbe64f7d29748f 100644 (file)
@@ -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',
+               ])
index d26d0cd74835ee8de05f1b905eab4f096eca47ae..4437916c2938691ab88b829880d69c4e2333f63e 100644 (file)
@@ -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 = '',
+)
index 97ea82ea76111cbe93dfe9bbded2a0e06ab41869..90ca693eb68ea2dfe4a42b3809b73fb5dcd2329b 100644 (file)
@@ -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',
+               ])
index 26717f391fafc3d55ed51aedc8502d5c87c76773..b47b8add83759588037bf4039c6be2085270d18e 100644 (file)
@@ -1,6 +1,6 @@
 Import('*')
 
-env = drienv.Clone()
+env = env.Clone()
 
 inteldrm_sources = [
     'intel_drm_api.c',
index 6256ec6eaf09a38436fb14cd612764da96faa151..150ab19a33e3390334e5f83a1570d9cfb452bade 100644 (file)
@@ -1,6 +1,6 @@
 Import('*')
 
-env = drienv.Clone()
+env = env.Clone()
 
 i965drm_sources = [
     'i965_drm_api.c',
index 19e895f10b9fb7ef1597f5f2bd8eaac316d0bdb3..fab42929514a08c2b23cc37ae49f0b5b39bcab4d 100644 (file)
@@ -1,6 +1,6 @@
 Import('*')
 
-env = drienv.Clone()
+env = env.Clone()
 
 radeon_sources = [
     'radeon_drm_buffer.c',