[xserver 08/10] meson: Make SHM extension optional
Laurent Carlier
lordheavym at gmail.com
Thu Mar 1 11:58:16 UTC 2018
v2: check for header 'sys/shm.h'
Signed-off-by: Laurent Carlier <lordheavym at gmail.com>
---
include/meson.build | 2 +-
meson.build | 8 +++++++-
meson_options.txt | 2 ++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/meson.build b/include/meson.build
index 188b835..25239ad 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -167,7 +167,7 @@ conf_data.set('DPMSExtension', build_dpms)
conf_data.set('DRI2', build_dri2)
conf_data.set('DRI3', build_dri3)
conf_data.set_quoted('DRI_DRIVER_PATH', dri_dep.get_pkgconfig_variable('dridriverdir'))
-conf_data.set('HAS_SHM', '1')
+conf_data.set('HAS_SHM', build_mitshm)
conf_data.set('MITSHM', build_mitshm)
conf_data.set('PANORAMIX', build_xinerama)
conf_data.set('PRESENT', '1')
diff --git a/meson.build b/meson.build
index 107c055..b920eba 100644
--- a/meson.build
+++ b/meson.build
@@ -387,8 +387,14 @@ if (get_option('linux_acpi') == true and
endif
endif
+build_mitshm = false
+if get_option('mitshm') == 'auto'
+ build_mitshm = cc.has_header('sys/shm.h')
+elif get_option('mitshm') == 'true'
+ build_mitshm = true
+endif
+
# XXX: Allow configuration of these.
-build_mitshm = true
build_xselinux = false
build_xf86vidmode = xf86vidmodeproto_dep.found()
diff --git a/meson_options.txt b/meson_options.txt
index c674d75..d7af87d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -81,6 +81,8 @@ option('linux_apm', type: 'boolean', value: true,
description: 'APM support on Linux')
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('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