scons: Updates for targets/egl-static.
[mesa.git] / src / gallium / state_trackers / egl / SConscript
index e71aec35b7351911433b8831fbbe17f8a21f971c..9ade76ecbb20fa6e3f2288d32997a02163652fb9 100644 (file)
@@ -3,33 +3,48 @@
 
 Import('*')
 
-if 'egl' in env['statetrackers']:
+env = env.Clone()
 
-    env = env.Clone()
+env.Append(CPPPATH = [
+    '#/src/egl/main',
+    '#/src/gallium/winsys/sw',
+    '.',
+])
 
-    env.Append(CPPPATH = [
-       '#/src/egl/main',
-       '#/src/gallium/winsys/sw',
-       '.',
-    ])
-    env.Append(CPPDEFINES = [
-       'HAVE_GDI_BACKEND',
-    ])
+sources = [
+    'common/egl_g3d.c',
+    'common/egl_g3d_api.c',
+    'common/egl_g3d_image.c',
+    'common/egl_g3d_st.c',
+    'common/egl_g3d_sync.c',
+    'common/native_helper.c',
+]
 
-    common_sources = [
-        'common/egl_g3d.c',
-        'common/egl_g3d_api.c',
-        'common/egl_g3d_image.c',
-        'common/egl_g3d_st.c',
-        'common/native_helper.c',
-    ]
+if env['platform'] == 'windows':
+    env.Append(CPPDEFINES = ['HAVE_GDI_BACKEND'])
+    sources.append('gdi/native_gdi.c')
+else:
+    if env['x11']:
+        env.Append(CPPDEFINES = ['HAVE_X11_BACKEND'])
+        env.Prepend(CPPPATH = [
+            '#/src/glx',
+            '#/src/mapi',
+        ])
+        sources.append([
+            'x11/native_x11.c',
+            'x11/native_dri2.c',
+            'x11/native_ximage.c',
+            'x11/x11_screen.c',
+            'x11/glxinit.c'])
+        if env['dri']:
+            env.Append(CPPDEFINES = ['GLX_DIRECT_RENDERING'])
+            sources.append(['#/src/glx/dri2.c'])
+    if env['drm']:
+        env.Append(CPPDEFINES = ['HAVE_DRM_BACKEND'])
+        sources.append(['drm/native_drm.c', 'drm/modeset.c'])
 
-    gdi_sources = common_sources + [
-        'gdi/native_gdi.c',
-    ]
-
-    st_egl_gdi = env.ConvenienceLibrary(
-       target = 'st_egl_gdi',
-       source = gdi_sources,
-    )
-    Export('st_egl_gdi')
+st_egl = env.ConvenienceLibrary(
+    target = 'st_egl',
+    source = sources,
+)
+Export('st_egl')