with_dri = true
endif
-if not (with_dri or with_gallium)
- with_gles1 = false
- with_gles2 = false
- with_opengl = false
- with_any_opengl = false
- with_shared_glapi = false
-endif
-
if with_dri_swrast and with_gallium_softpipe
error('Only one swrast provider can be built')
endif
egl_native_platform = _split[0]
endif
+with_glx = get_option('glx')
+if with_glx == 'auto'
+ if with_dri
+ with_glx = 'dri'
+ elif with_gallium
+ with_glx = 'gallium-xlib'
+ elif with_platform_x11 and with_any_opengl and not with_any_vk
+ # The automatic behavior should not be to turn on xlib based glx when
+ # building only vulkan drivers
+ with_glx = 'xlib'
+ else
+ with_glx = 'disabled'
+ endif
+endif
+
+if not (with_dri or with_gallium or with_glx == 'xlib')
+ with_gles1 = false
+ with_gles2 = false
+ with_opengl = false
+ with_any_opengl = false
+ with_shared_glapi = false
+endif
+
with_gbm = get_option('gbm')
if with_gbm == 'auto' and with_dri # TODO: or gallium
with_gbm = host_machine.system() == 'linux'
endif
pre_args += '-DGLX_USE_TLS'
-with_glx = get_option('glx')
if with_glx != 'disabled'
if not (with_platform_x11 and with_any_opengl)
if with_glx == 'auto'
elif with_dri
error('gallium-xlib conflicts with any dri driver')
endif
- elif with_glx == 'dri' and not with_dri
- error('dri based GLX requires at least one DRI driver')
- elif with_glx == 'auto'
+ elif with_glx == 'xlib'
if with_dri
- with_glx = 'dri'
- elif with_gallium
- with_glx = 'gallium-xlib'
- elif with_platform_x11 and with_any_opengl
- with_glx = 'xlib'
- else
- with_glx = 'disabled'
+ error('xlib conflicts with any dri driver')
endif
+ elif with_glx == 'dri' and not with_dri
+ error('dri based GLX requires at least one DRI driver')
endif
endif
pre_args += '-DHAVE_X11_PLATFORM'
endif
if with_glx == 'xlib'
- # TODO
- error('TODO')
+ pre_args += '-DUSE_XSHM'
elif with_glx == 'gallium-xlib'
# TODO
error('TODO')
dep_xcb_xfixes = []
dep_xshmfence = []
if with_platform_x11
- if with_glx == 'dri' and with_dri_platform == 'drm'
+ if with_glx == 'xlib'
+ dep_x11 = dependency('x11')
+ dep_xext = dependency('xext')
+ dep_xcb = dependency('xcb')
+ elif with_glx == 'dri' and with_dri_platform == 'drm'
dep_x11 = dependency('x11')
dep_xext = dependency('xext')
dep_xdamage = dependency('xdamage', version : '>= 1.1')
dep_xshmfence = dependency('xshmfence', version : '>= 1.1')
endif
endif
- if with_glx != 'disabled'
+ if with_glx == 'dri'
dep_dri2proto = dependency('dri2proto', version : '>= 2.8')
dep_glproto = dependency('glproto', version : '>= 1.4.14')
endif
--- /dev/null
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+gl_link_with = []
+if with_shared_glapi
+ gl_link_with += libglapi
+endif
+
+libgl = shared_library(
+ 'GL',
+ files(
+ 'fakeglx.c', 'glxapi.c', 'xfonts.c', 'xm_api.c', 'xm_buffer.c', 'xm_dd.c',
+ 'xm_line.c', 'xm_tri.c',
+ ),
+ include_directories : [
+ inc_include, inc_src, inc_mesa, inc_mapi, inc_gallium, inc_gallium_aux
+ ],
+ link_with : [libmesa_classic, libglapi_static, gl_link_with],
+ dependencies : [dep_x11, dep_xext, dep_xcb, dep_thread],
+ version : '1.6.0',
+ install : true,
+)