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

Laurent Carlier lordheavym at gmail.com
Sun Feb 18 09:58:36 UTC 2018


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

diff --git a/hw/xfree86/os-support/meson.build b/hw/xfree86/os-support/meson.build
index dfb613e..683aca0 100644
--- a/hw/xfree86/os-support/meson.build
+++ b/hw/xfree86/os-support/meson.build
@@ -35,6 +35,9 @@ if host_machine.system() == 'linux'
     # this is ugly because the code is also
     if build_apm or build_acpi
         srcs_xorg_os_support += 'linux/lnx_apm.c'
+        if build_apm
+            xorg_c_args += '-DHAVE_APM'
+        endif
         if build_acpi
             srcs_xorg_os_support += 'linux/lnx_acpi.c'
         endif
diff --git a/include/meson.build b/include/meson.build
index 83778c6..2c365c0 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -255,6 +255,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