aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-11-17 13:02:17 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-01-02 21:03:37 +0100
commit8c6d4ff404ba387a36ebf5f6f66364a3c5b4ef2e (patch)
tree251f9c77984aa1c3ed1c4314de7346830075fc1e /meson.build
parentddfcb8c43c65c7d350cb31dd7ee007adb2d1817f (diff)
brlapi: convert to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build20
1 files changed, 17 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index d114a0137b..2bc667721d 100644
--- a/meson.build
+++ b/meson.build
@@ -574,8 +574,21 @@ if have_system and not get_option('curses').disabled()
endif
brlapi = not_found
-if 'CONFIG_BRLAPI' in config_host
- brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
+if not get_option('brlapi').auto() or have_system
+ brlapi = cc.find_library('brlapi', has_headers: ['brlapi.h'],
+ required: get_option('brlapi'),
+ static: enable_static)
+ if brlapi.found() and not cc.links('''
+ #include <brlapi.h>
+ #include <stddef.h>
+ int main(void) { return brlapi__openConnection (NULL, NULL, NULL); }''', dependencies: brlapi)
+ brlapi = not_found
+ if get_option('brlapi').enabled()
+ error('could not link brlapi')
+ else
+ warning('could not link brlapi, disabling')
+ endif
+ endif
endif
sdl = not_found
@@ -858,6 +871,7 @@ config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') /
config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir)
config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir'))
+config_host_data.set('CONFIG_BRLAPI', brlapi.found())
config_host_data.set('CONFIG_COCOA', cocoa.found())
config_host_data.set('CONFIG_LIBUDEV', libudev.found())
config_host_data.set('CONFIG_MPATH', mpathpersist.found())
@@ -2169,7 +2183,7 @@ summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
if config_host.has_key('CONFIG_XEN_BACKEND')
summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}
endif
-summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')}
+summary_info += {'brlapi support': brlapi.found()}
summary_info += {'Documentation': build_docs}
summary_info += {'PIE': get_option('b_pie')}
summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}