[xserver 05/10] meson: Make APM support optional

Laurent Carlier lordheavym at gmail.com
Thu Mar 1 11:55:11 UTC 2018


v2: Define HAVE_APM in dix-config.h

Signed-off-by: Laurent Carlier <lordheavym at gmail.com>
---
 include/meson.build | 3 +++
 meson.build         | 9 ++++++++-
 meson_options.txt   | 2 ++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/meson.build b/include/meson.build
index 83778c6..45d2777 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -198,6 +198,8 @@ conf_data.set('XvMCExtension', build_xvmc)
 
 conf_data.set('HAVE_SHA1_IN_LIBNETTLE', '1') # XXX
 
+conf_data.set('HAVE_APM', build_apm or build_acpi)
+
 enable_debugging = get_option('buildtype') == 'debug'
 conf_data.set('DEBUG', enable_debugging)
 
@@ -255,6 +257,7 @@ xorg_data.set('XSERVER_LIBPCIACCESS', get_option('pciaccess'))
 xorg_data.set_quoted('PCI_TXT_IDS_PATH', '')
 xorg_data.set('XSERVER_PLATFORM_BUS', build_udev)
 xorg_data.set('WSCONS_SUPPORT', host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd')
+xorg_data.set('XF86PM', build_apm)
 
 if host_machine.system() == 'freebsd' or host_machine.system() == 'dragonflybsd'
     if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
diff --git a/meson.build b/meson.build
index 492d8cd..c7d9228 100644
--- a/meson.build
+++ b/meson.build
@@ -369,8 +369,15 @@ elif get_option('dga') == 'true'
     build_dga = true
 endif
 
-# XXX: Allow configuration of these.
 build_apm = false
+if (get_option('linux_apm') == true and
+   host_machine.system() == 'linux')
+    if cc.has_header('linux/apm_bios.h')
+        build_apm = true
+    endif
+endif
+
+# XXX: Allow configuration of these.
 build_acpi = false
 build_mitshm = true
 build_xselinux = false
diff --git a/meson_options.txt b/meson_options.txt
index 52d02ab..54cf61d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -77,6 +77,8 @@ option('xvmc', type: 'boolean', value: true,
        description: 'XvMC extension')
 option('dga', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
        description: 'DGA extension')
+option('linux_apm', type: 'boolean', value: true,
+       description: 'APM support on Linux')
 
 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