[PATCH xserver 07/10] meson: Check if SYSV IPC is available

Adam Jackson ajax at nwnk.net
Mon Feb 19 18:48:54 UTC 2018


On Sun, 2018-02-18 at 10:58 +0100, Laurent Carlier wrote:

> diff --git a/meson.build b/meson.build
> index 107c055..983604a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -96,6 +96,21 @@ nettle_dep = dependency('nettle')
>  dbus_required = get_option('systemd_logind') == 'true'
>  dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required)
>  
> +sysvipc_found = cc.run('''
> +    #include <sys/types.h>
> +    #include <sys/ipc.h>
> +    #include <sys/shm.h>
> +    #include <sys/stat.h>
> +
> +    int main ()
> +    {
> +        int id;
> +        id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
> +        if (id < 0) return -1;
> +        return shmctl(id, IPC_RMID, 0);
> +    }''',
> +    name: 'SYSV IPC').returncode() == 0

If we're going to make this optional based on anything it should be the
presence of <sys/shm.h>. If you don't have that there's certainly no
point building the support, and if you do you might as well see if it
works at runtime.

- ajax


More information about the xorg-devel mailing list