diff --git a/meson.build b/meson.build index 08874940f31..015bc974573 100644 --- a/meson.build +++ b/meson.build @@ -478,6 +478,7 @@ if with_glx != 'disabled' endif with_glvnd = get_option('glvnd') +glvnd_vendor_name = get_option('glvnd-vendor-name') if with_glvnd if with_platform_windows error('glvnd cannot be used on Windows') diff --git a/meson_options.txt b/meson_options.txt index fd9958f87a8..67fabb9473b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -289,6 +289,12 @@ option( value : 'auto', description : 'Build support for the Microsoft CLC to DXIL compiler' ) +option( + 'glvnd-vendor-name', + type : 'string', + value : 'mesa', + description : 'Vendor name string to use for glvnd libraries' +) option( 'glx-read-only-text', type : 'boolean', diff --git a/src/egl/main/50_mesa.json b/src/egl/main/50_mesa.json index 8aaaa100ffa..5f9c18aad6e 100644 --- a/src/egl/main/50_mesa.json +++ b/src/egl/main/50_mesa.json @@ -1,6 +1,6 @@ { "file_format_version" : "1.0.0", "ICD" : { - "library_path" : "libEGL_mesa.so.0" + "library_path" : "libEGL_@glvnd_vendor_name@.so.0" } } diff --git a/src/egl/meson.build b/src/egl/meson.build index 7a3fcdca157..599a66706b7 100644 --- a/src/egl/meson.build +++ b/src/egl/meson.build @@ -144,13 +144,18 @@ if not with_glvnd egl_lib_name = 'EGL' + get_option('egl-lib-suffix') egl_lib_version = '1.0.0' else - egl_lib_name = 'EGL_mesa' + egl_lib_name = 'EGL_@0@'.format(glvnd_vendor_name) egl_lib_version = '0.0.0' deps_for_egl += dep_glvnd files_egl += [g_egldispatchstubs_h, g_egldispatchstubs_c] files_egl += files('main/eglglvnd.c', 'main/egldispatchstubs.c') - install_data( - 'main/50_mesa.json', + glvnd_config = configuration_data() + glvnd_config.set('glvnd_vendor_name', get_option('glvnd-vendor-name')) + configure_file( + configuration: glvnd_config, + input : 'main/50_mesa.json', + output: '50_@0@.json'.format(glvnd_vendor_name), + install : true, install_dir : join_paths(get_option('datadir'), 'glvnd', 'egl_vendor.d') ) endif diff --git a/src/glx/meson.build b/src/glx/meson.build index a7ccd98357f..8ee0d009b4f 100644 --- a/src/glx/meson.build +++ b/src/glx/meson.build @@ -111,7 +111,7 @@ if not with_glvnd gl_lib_name = 'GL' gl_lib_version = '1.2.0' else - gl_lib_name = 'GLX_mesa' + gl_lib_name = 'GLX_@0@'.format(glvnd_vendor_name) gl_lib_version = '0.0.0' files_libglx += files( 'g_glxglvnddispatchfuncs.c',