diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build index 8fc53e4cf..c2a26d6a7 100644 --- a/hw/xfree86/meson.build +++ b/hw/xfree86/meson.build @@ -92,6 +92,12 @@ xorg_deps = [ libdrm_dep, ] +if get_option('suid_wrapper') + xorg_install_dir = get_option('libexecdir') +else + xorg_install_dir = get_option('bindir') +endif + e = executable( 'Xorg', srcs_xorg, @@ -101,6 +107,7 @@ e = executable( link_args: linker_export_flags, c_args: xorg_c_args, install: true, + install_dir: xorg_install_dir, implib: true, ) @@ -128,6 +135,24 @@ if build_modesetting subdir('drivers/modesetting') endif +if get_option('suid_wrapper') + executable('Xorg.wrap', + 'xorg-wrapper.c', + include_directories: [inc, xorg_inc], + dependencies: xorg_deps, + c_args: xorg_c_args, + install: true, + install_dir: get_option('libexecdir'), + # install_mode: ['r-sr-xr-x', 0, 0], + ) + configure_file( + input: 'Xorg.sh.in', + output: 'Xorg', + configuration: conf_data, + install_dir: join_paths(get_option('prefix'), get_option('bindir')), + ) +endif + # For symbol presence testing only xorgserver_lib = shared_library( 'xorgserver', diff --git a/include/meson.build b/include/meson.build index 10c7d2556..69aea8095 100644 --- a/include/meson.build +++ b/include/meson.build @@ -86,6 +86,7 @@ conf_data.set('GBM_BO_WITH_MODIFIERS', conf_data.set_quoted('SERVER_MISC_CONFIG_PATH', serverconfigdir) conf_data.set_quoted('PROJECTROOT', get_option('prefix')) conf_data.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir'))) +conf_data.set_quoted('SUID_WRAPPER_DIR', join_paths(get_option('prefix'), get_option('libexecdir'))) # XXX: Stopped enumerating at COMPILEDEFAULTFONTPATH conf_data.set('XORG_VERSION_CURRENT', release) diff --git a/meson_options.txt b/meson_options.txt index d7af87d73..dede8562a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -45,7 +45,8 @@ option('os_vendor', type: 'string', value: '') option('int10', type: 'combo', choices: ['stub', 'x86emu', 'vm86', 'auto', 'false'], value: 'auto', description: 'Xorg int10 backend (default: usually x86emu)') - +option('suid_wrapper', type: 'boolean', value: 'false', + description: 'SUID wrapper for legacy driver support') option('pciaccess', type: 'boolean', value: 'true', description: 'Xorg pciaccess support') option('udev', type: 'boolean', value: 'true')