xfree86: add per major-version driver/module subdirectories

Modules are now placed into a sub-directory by major Xserver release,
so we have less hassle with trying to load drivers w/ incompatible ABI.

The legacy directories are still searched (after the versioned ones)
for backwards compat with badly maintained proprietary drivers (Nvidia).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-06-02 15:54:38 +02:00
parent a58dba71bd
commit 49c6431695
12 changed files with 22 additions and 12 deletions

View File

@ -9,7 +9,7 @@ shared_module(
link_with: e, link_with: e,
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
) )
shared_module( shared_module(
@ -23,7 +23,7 @@ shared_module(
link_with: e, link_with: e,
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
) )
if build_glx if build_glx
@ -38,6 +38,6 @@ if build_glx
link_with: e, link_with: e,
install: true, install: true,
install_dir: join_paths(module_dir, 'extensions') install_dir: join_paths(module_abi_dir, 'extensions')
) )
endif endif

View File

@ -12,7 +12,7 @@ shared_module(
dependencies: [common_dep], dependencies: [common_dep],
install: true, install: true,
install_dir: join_paths(module_dir, 'input'), install_dir: join_paths(module_abi_dir, 'input'),
link_with: e, link_with: e,
) )

View File

@ -23,7 +23,7 @@ shared_module(
], ],
install: true, install: true,
install_dir: join_paths(module_dir, 'drivers'), install_dir: join_paths(module_abi_dir, 'drivers'),
) )
# Test that we don't have any unresolved symbols from our module to Xorg. # Test that we don't have any unresolved symbols from our module to Xorg.

View File

@ -5,7 +5,7 @@ xorg_exa = shared_module('exa',
link_with: [libxserver_exa, e], link_with: [libxserver_exa, e],
c_args: xorg_c_args, c_args: xorg_c_args,
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
) )
install_man(configure_file( install_man(configure_file(

View File

@ -10,7 +10,7 @@ shared_module('fbdevhw',
dependencies: common_dep, dependencies: common_dep,
c_args: xorg_c_args, c_args: xorg_c_args,
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
link_with: e, link_with: e,
) )

View File

@ -18,5 +18,5 @@ shared_module(
link_with: [glamor, libxserver_glx], link_with: [glamor, libxserver_glx],
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
) )

View File

@ -56,7 +56,7 @@ xorg_int10 = shared_module('int10',
c_args: int10_c_args, c_args: int10_c_args,
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
) )
install_data('xf86int10.h', install_dir: xorgsdkdir) install_data('xf86int10.h', install_dir: xorgsdkdir)

View File

@ -175,6 +175,12 @@ LoaderSetPath(const char *path)
/* Standard set of module subdirectories to search, in order of preference */ /* Standard set of module subdirectories to search, in order of preference */
static const char *stdSubdirs[] = { static const char *stdSubdirs[] = {
// first try loading from per-ABI subdir
XORG_MODULE_ABI_TAG "/",
XORG_MODULE_ABI_TAG "/input/",
XORG_MODULE_ABI_TAG "/drivers/",
XORG_MODULE_ABI_TAG "/extensions/",
// now try loading from legacy / unversioned directories
"", "",
"input/", "input/",
"drivers/", "drivers/",

View File

@ -1,3 +1,6 @@
module_abi_tag = 'xlibre-25.0'
module_abi_dir = join_paths(module_dir, module_abi_tag)
xorg_inc = include_directories( xorg_inc = include_directories(
'common', 'common',
'ddc', 'ddc',
@ -16,6 +19,7 @@ xorg_inc = include_directories(
xorg_c_args = [] xorg_c_args = []
xorg_c_args += '-DHAVE_XORG_CONFIG_H' xorg_c_args += '-DHAVE_XORG_CONFIG_H'
xorg_c_args += '-DXORG_NO_SDKSYMS' xorg_c_args += '-DXORG_NO_SDKSYMS'
xorg_c_args += ('-DXORG_MODULE_ABI_TAG="'+module_abi_tag+'"')
pciaccess_dep = [] pciaccess_dep = []
if get_option('pciaccess') if get_option('pciaccess')

View File

@ -4,7 +4,7 @@ shared_module('shadowfb',
dependencies: common_dep, dependencies: common_dep,
c_args: xorg_c_args, c_args: xorg_c_args,
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
link_with: e, link_with: e,
) )

View File

@ -4,7 +4,7 @@ shared_module('vgahw',
dependencies: common_dep, dependencies: common_dep,
c_args: xorg_c_args, c_args: xorg_c_args,
install: true, install: true,
install_dir: module_dir, install_dir: module_abi_dir,
) )
install_data('vgaHW.h', install_dir: xorgsdkdir) install_data('vgaHW.h', install_dir: xorgsdkdir)

View File

@ -834,7 +834,7 @@ if build_xorg
sdkconfig.set('libdir', join_paths('${exec_prefix}', get_option('libdir'))) sdkconfig.set('libdir', join_paths('${exec_prefix}', get_option('libdir')))
sdkconfig.set('includedir', join_paths('${prefix}', get_option('includedir'))) sdkconfig.set('includedir', join_paths('${prefix}', get_option('includedir')))
sdkconfig.set('datarootdir', join_paths('${prefix}', get_option('datadir'))) sdkconfig.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
sdkconfig.set('moduledir', join_paths('${exec_prefix}', module_dir)) sdkconfig.set('moduledir', join_paths(join_paths('${exec_prefix}', module_dir), module_abi_tag))
sdkconfig.set('sdkdir', join_paths('${prefix}', get_option('includedir'), 'xorg')) sdkconfig.set('sdkdir', join_paths('${prefix}', get_option('includedir'), 'xorg'))
sdkconfig.set('sysconfigdir', join_paths('${datarootdir}', 'X11/xorg.conf.d')) sdkconfig.set('sysconfigdir', join_paths('${datarootdir}', 'X11/xorg.conf.d'))