From 238219e7312e2b5d972a8620b02379009686a005 Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Thu, 1 Mar 2018 12:55:11 +0100 Subject: [PATCH] meson: Make APM support optional v2: Define HAVE_APM in dix-config.h Signed-off-by: Laurent Carlier Reviewed-by: Adam Jackson --- 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 83778c69b..45d27774a 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 4748724e3..6a671587e 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 52d02ab4e..54cf61d78 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)')