identity: consolidate C sources list into Makefile.sources
[mesa.git] / src / gallium / state_trackers / xorg / SConscript
index 5d0b6613ac75e02f3180f76a5004416a105adf2f..1768f701e480c1d95d3e6e06f6bf5850e5692012 100644 (file)
@@ -3,32 +3,40 @@
 
 Import('*')
 
-if 'xorg' in env['statetrackers']:
-
-    env = env.Clone()
-
-    env.Append(CPPPATH = [
-       '#/src/mesa',
-    ])
-
-    env.ParseConfig('pkg-config --cflags --libs xorg-server')
-
-    conf = env.Configure()
-
-    if conf.CheckHeader('X11/extensions/dpmsconst.h'):
-        env.Append(CPPDEFINES = [('HAVE_XEXTPROTO_71', '1')])
-
-    st_xorg = env.ConvenienceLibrary(
-       target = 'st_xorg',
-       source = [ 'xorg_composite.c',
-               'xorg_crtc.c',
-               'xorg_dri2.c',
-               'xorg_driver.c',
-               'xorg_exa.c',
-               'xorg_exa_tgsi.c',
-               'xorg_output.c',
-               'xorg_renderer.c',
-               'xorg_xv.c',
-               ]
-    )
-    Export('st_xorg')
+env = env.Clone()
+
+env.Append(CPPPATH = [
+    '#/src/mesa',
+])
+
+env.PkgUseModules(['DRM', 'XORG'])
+
+if env['HAVE_KMS']:
+    env.Append(CPPDEFINES = ['HAVE_LIBKMS'])
+    env.PkgUseModules(['KMS'])
+
+conf = env.Configure()
+
+if conf.CheckHeader('X11/extensions/dpmsconst.h'):
+    env.Append(CPPDEFINES = [('HAVE_XEXTPROTO_71', '1')])
+
+conf.Finish()
+
+sources = [
+    'xorg_composite.c',
+    'xorg_crtc.c',
+    'xorg_dri2.c',
+    'xorg_driver.c',
+    'xorg_exa.c',
+    'xorg_exa_tgsi.c',
+    'xorg_output.c',
+    'xorg_renderer.c',
+    'xorg_xv.c',
+    'xorg_xvmc.c',
+]
+
+st_xorg = env.ConvenienceLibrary(
+    target = 'st_xorg',
+    source = sources,
+)
+Export('st_xorg')