Re: [PATCH xserver 06/10] meson: Add an option to build XSELINUX.

2018-08-09 Thread Adam Jackson
On Tue, 2018-08-07 at 16:23 -0700, Eric Anholt wrote:
> Dependencies are ported from the automake build.  The only part I
> skipped was making sure we can find libaudit.h.

Fair enough, but then:

> +build_xselinux = get_option('xselinux')
> +if build_xselinux
> +if not build_xace
> +error('cannot build XSELINUX extension without X-ACE')
> +endif
> +common_dep += dependency('libselinux', version: '>= 2.0.86')
> +common_dep += cc.find_library('audit')
> +endif

This can be dependency('audit'), there's a pkgconfig file. I think this
might want to be automatic based on linux && dependency() though,
because...

> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -78,6 +78,8 @@ option('xres', type: 'boolean', value: true,
> description: 'XRes extension')
>  option('xace', type: 'boolean', value: true,
> description: 'X-ACE extension')
> +option('xselinux', type: 'boolean', value: true,
> +   description: 'XSELINUX extension')

(... until/unless we require a newer meson with better 'auto' support,)
non-Linux (and non-SELinux-using Linux) systems will have to explicitly
disable something they can't possibly use just to build. This happened
to me, even:

https://ci.appveyor.com/project/nwnk/xserver/build/job/hf8rxt84upie2wpq

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 06/10] meson: Add an option to build XSELINUX.

2018-08-07 Thread Eric Anholt
Dependencies are ported from the automake build.  The only part I
skipped was making sure we can find libaudit.h.

Signed-off-by: Eric Anholt 
---
 meson.build   | 12 +---
 meson_options.txt |  2 ++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index ec79479d901b..8c21c646ab89 100644
--- a/meson.build
+++ b/meson.build
@@ -436,9 +436,6 @@ elif get_option('mitshm') == 'true'
 build_mitshm = true
 endif
 
-# XXX: Allow configuration of these.
-build_xselinux = false
-
 m_dep = cc.find_library('m', required : false)
 dl_dep = cc.find_library('dl', required : false)
 
@@ -499,6 +496,15 @@ inc = include_directories(
 'xfixes',
 )
 
+build_xselinux = get_option('xselinux')
+if build_xselinux
+if not build_xace
+error('cannot build XSELINUX extension without X-ACE')
+endif
+common_dep += dependency('libselinux', version: '>= 2.0.86')
+common_dep += cc.find_library('audit')
+endif
+
 glx_inc = include_directories('glx')
 
 top_srcdir_inc = include_directories('.')
diff --git a/meson_options.txt b/meson_options.txt
index 3453b8df5a2e..5560dd55e952 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -78,6 +78,8 @@ option('xres', type: 'boolean', value: true,
description: 'XRes extension')
 option('xace', type: 'boolean', value: true,
description: 'X-ACE extension')
+option('xselinux', type: 'boolean', value: true,
+   description: 'XSELINUX extension')
 option('xinerama', type: 'boolean', value: true,
description: 'Xinerama extension')
 option('xcsecurity', type: 'boolean', value: false,
-- 
2.18.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel