+with_gallium_xvmc = false
+with_gallium_vdpau = false
+with_gallium_omx = false # this is bellagio
+with_gallium_va = false
+with_gallium_media = false
+dep_va = []
+_drivers = get_option('gallium-media')
+if _drivers != ''
+ _split = _drivers.split(',')
+ with_gallium_xvmc = _split.contains('xvmc')
+ with_gallium_vdpau = _split.contains('vdpau')
+ with_gallium_omx = _split.contains('omx')
+ with_gallium_va = _split.contains('va')
+ with_gallium_media = (with_gallium_xvmc or with_gallium_vdpau or
+ with_gallium_omx or with_gallium_va)
+endif
+
+gl_pkgconfig_c_flags = []
+if with_platform_x11
+ if with_any_vk or (with_glx == 'dri' and with_dri_platform == 'drm')
+ pre_args += '-DHAVE_X11_PLATFORM'
+ endif
+ if with_glx == 'xlib'
+ # TODO
+ error('TODO')
+ elif with_glx == 'gallium-xlib'
+ # TODO
+ error('TODO')
+ else
+ pre_args += '-DGLX_INDIRECT_RENDERING'
+ if with_glx_direct
+ pre_args += '-DGLX_DIRECT_RENDERING'
+ endif
+ if with_dri_platform == 'drm'
+ pre_args += '-DGLX_USE_DRM'
+ endif
+ endif
+else
+ pre_args += '-DMESA_EGL_NO_X11_HEADERS'
+ gl_pkgconfig_c_flags += '-DMESA_EGL_NO_X11_HEADERS'
+endif
+if with_platform_drm
+ if with_egl and not with_gbm
+ error('EGL drm platform requires gbm')
+ endif
+ pre_args += '-DHAVE_DRM_PLATFORM'
+endif
+if with_platform_surfaceless
+ pre_args += '-DHAVE_SURFACELESS_PLATFORM'
+endif
+