[PATCH xserver] meson: Fix module_dir configuration

Aaron Plattner aplattner at nvidia.com
Mon Apr 2 21:31:20 UTC 2018


meson.build has code to set the module_dir variable to
${libdir}/xorg/modules if the module_dir option string is empty.
However, this has several problems:

1. The variable is only used for an unused @moduledir@ substitution in
   the man page. The rule for xorg-server.pc uses option('module_dir')
   directly instead.
2. The 'module_dir' option has a default value of 'xorg/modules' so the
   above rule doesn't do anything by default.
3. The xorg-server.pc rule uses ${exec_prefix}/option('module_dir'), so
   the effect of #2 is that the default moduledir is different between
   autoconf and meson. E.g. if ${prefix} is /X, then you get

     autoconf: moduledir=/X/lib/xorg/modules
     meson:    moduledir=/X/xorg/modules

Fix this by using the module_dir variable when generating
xorg-server.pc, and by removing the default value for the module_dir
option.

Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
---
 meson.build       | 2 +-
 meson_options.txt | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 277534093b94..3e3f808b2d7a 100644
--- a/meson.build
+++ b/meson.build
@@ -595,7 +595,7 @@ if build_xorg
     sdkconfig.set('libdir', join_paths('${exec_prefix}', get_option('libdir')))
     sdkconfig.set('includedir', join_paths('${prefix}', get_option('includedir')))
     sdkconfig.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
-    sdkconfig.set('moduledir', join_paths('${exec_prefix}', get_option('module_dir')))
+    sdkconfig.set('moduledir', join_paths('${exec_prefix}', module_dir))
     sdkconfig.set('sdkdir', join_paths('${prefix}', get_option('includedir'), 'xorg'))
     sdkconfig.set('sysconfigdir', join_paths('${datarootdir}', 'X11/xorg.conf.d'))
 
diff --git a/meson_options.txt b/meson_options.txt
index 5c7be0e26ce5..4cf8349ba9e5 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -19,8 +19,7 @@ option('builder_addr', type: 'string', description: 'Builder address', value: 'x
 option('builder_string', type: 'string', description: 'Additional builder string')
 
 option('log_dir', type: 'string')
-option('module_dir', type: 'string', value: 'xorg/modules',
-       description: 'X.Org modules directory')
+option('module_dir', type: 'string', description: 'X.Org modules directory')
 option('default_font_path', type: 'string')
 
 option('glx', type: 'boolean', value: true)
-- 
2.16.3



More information about the xorg-devel mailing list