[PATCH xserver 07/10] meson: Check if SYSV IPC is available
Laurent Carlier
lordheavym at gmail.com
Sun Feb 18 09:58:38 UTC 2018
Signed-off-by: Laurent Carlier <lordheavym at gmail.com>
---
include/meson.build | 2 +-
meson.build | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/meson.build b/include/meson.build
index 3bb3b72..4949174 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -53,7 +53,7 @@ conf_data.set('HAS_APERTURE_DRV', host_machine.system() == 'openbsd')
# XXX: BUNDLE_ID_PREFIX
# XXX: HAVE_LIBDISPATCH
conf_data.set_quoted('OSNAME', 'Linux') # XXX
-conf_data.set('HAVE_SYSV_IPC', '1') # XXX
+conf_data.set('HAVE_SYSV_IPC', sysvipc_found)
conf_data.set('HAVE_INPUTTHREAD', '1') # XXX
conf_data.set('HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID', '1') # XXX
conf_data.set('HAVE_LIBBSD', libbsd_dep.found())
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
+
# Resolve default values of some options
xkb_dir = get_option('xkb_dir')
if xkb_dir == ''
--
2.16.2
More information about the xorg-devel
mailing list