[PATCH xserver 09/10] meson: Make SELinux extension optional

Laurent Carlier lordheavym at gmail.com
Sun Feb 18 09:58:40 UTC 2018


Signed-off-by: Laurent Carlier <lordheavym at gmail.com>
---
 Xext/meson.build  |  6 +++++-
 meson.build       | 11 ++++++++++-
 meson_options.txt |  2 ++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/Xext/meson.build b/Xext/meson.build
index 9968f2a..7116aa0 100644
--- a/Xext/meson.build
+++ b/Xext/meson.build
@@ -8,6 +8,8 @@ srcs_xext = [
     'xtest.c',
 ]
 
+xext_dep = [ common_dep ]
+
 if build_dpms
     srcs_xext += 'dpms.c'
 endif
@@ -42,6 +44,8 @@ endif
 
 if build_xselinux
     srcs_xext += ['xselinux_ext.c', 'xselinux_hooks.c', 'xselinux_label.c']
+    xext_dep += audit_dep
+    xext_dep += selinux_dep
 endif
 
 if build_xv
@@ -51,7 +55,7 @@ endif
 libxserver_xext = static_library('libxserver_xext',
     srcs_xext,
     include_directories: inc,
-    dependencies: common_dep,
+    dependencies: xext_dep,
 )
 
 libxserver_xext_vidmode = static_library('libxserver_xext_vidmode',
diff --git a/meson.build b/meson.build
index 5ad432f..ef32d92 100644
--- a/meson.build
+++ b/meson.build
@@ -409,8 +409,17 @@ elif get_option('mitshm') == 'true'
     build_mitshm = true
 endif
 
-# XXX: Allow configuration of these.
 build_xselinux = false
+if (get_option('xselinux') == true and
+   host_machine.system() != 'cygwin') ## mingw ??
+    if build_xace == false
+        error('cannot build SELinux extension without X-ACE')
+    endif
+    audit_dep = dependency('audit', required: true)
+    selinux_dep = dependency('libselinux', version: '>= 2.0.86', required: true)
+endif
+
+# XXX: Allow configuration of these.
 build_xf86vidmode = xf86vidmodeproto_dep.found()
 
 m_dep = cc.find_library('m', required : false)
diff --git a/meson_options.txt b/meson_options.txt
index d7af87d..4d62da2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -83,6 +83,8 @@ option('linux_acpi', type: 'boolean', value: true,
        description: 'ACPI support on Linux')
 option('mitshm', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
        description: 'SHM extension')
+option('xselinux', type: 'boolean', value: false,
+       description: 'SELinux extension')
 
 option('dri1', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)')
 option('dri2', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)')
-- 
2.16.2



More information about the xorg-devel mailing list