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

Peter Hutterer peter.hutterer at who-t.net
Fri Aug 10 00:38:29 UTC 2018


On Thu, Aug 09, 2018 at 01:02:41PM -0700, Eric Anholt wrote:
> Dependencies are ported from the automake build.
> 
> v2: Make it a tristate defaulting to 'auto'.  Use pkg-config for libaudit.
> 
> Signed-off-by: Eric Anholt <eric at anholt.net>
> ---
>  meson.build       | 20 +++++++++++++++++---
>  meson_options.txt |  2 ++
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index e7ce68a502c3..53cdbe2beb3d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -442,9 +442,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)
>  
> @@ -506,6 +503,23 @@ inc = include_directories(
>      'xfixes',
>  )
>  
> +build_xselinux = false
> +if get_option('xselinux') != 'false'
> +    dep_selinux = dependency('libselinux', version: '>= 2.0.86',
> +			     required: get_option('xselinux') == 'true')
> +    dep_audit = dependency('audit', required: get_option('xselinux') == 'true')
> +    if get_option('xselinux') == 'true'
> +        build_xselinux = true
> +    else

you don't need the if here, if option(xselinux) is true, both deps will
are required and cannot be anything but found() == true.

but either way, Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
   Peter

> +        build_xselinux = dep_selinux.found() and dep_audit.found()
> +    endif
> +
> +    if build_xselinux
> +        common_dep += dep_selinux
> +        common_dep += dep_audit
> +    endif
> +endif
> +
>  glx_inc = include_directories('glx')
>  
>  top_srcdir_inc = include_directories('.')
> diff --git a/meson_options.txt b/meson_options.txt
> index 8c600f3986d8..3f02d5066448 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -80,6 +80,8 @@ option('xres', type: 'boolean', value: true,
>         description: 'XRes extension')
>  option('xace', type: 'boolean', value: true,
>         description: 'X-ACE extension')
> +option('xselinux', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
> +       description: 'XSELINUX extension')
>  option('xinerama', type: 'boolean', value: true,
>         description: 'Xinerama extension')
>  option('xcsecurity', type: 'boolean', value: false,
> -- 
> 2.18.0
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list