aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-12-21 12:38:27 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2022-02-21 10:35:53 +0100
commit488a8c73fbd72cbf4387ff3150271fe414b0dd4a (patch)
treed5ae5af1db21e46d6b2fffbc2727c9fcb5e792e2 /meson.build
parent34b52615a09a061bc03bbc5aa35a998ba79d9f22 (diff)
configure, meson: move libnuma detection to meson
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build25
1 files changed, 20 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 9e1acb98aa..f8b83f64db 100644
--- a/meson.build
+++ b/meson.build
@@ -1164,14 +1164,28 @@ if lzo.found() and not cc.links('''
endif
endif
+numa = not_found
+if not get_option('numa').auto() or have_system or have_tools
+ numa = cc.find_library('numa', has_headers: ['numa.h'],
+ required: get_option('numa'),
+ kwargs: static_kwargs)
+endif
+if numa.found() and not cc.links('''
+ #include <numa.h>
+ int main(void) { return numa_available(); }
+ ''', dependencies: numa)
+ numa = not_found
+ if get_option('numa').enabled()
+ error('could not link numa')
+ else
+ warning('could not link numa, disabling')
+ endif
+endif
+
rdma = not_found
if 'CONFIG_RDMA' in config_host
rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
endif
-numa = not_found
-if 'CONFIG_NUMA' in config_host
- numa = declare_dependency(link_args: config_host['NUMA_LIBS'].split())
-endif
xen = not_found
if 'CONFIG_XEN_BACKEND' in config_host
xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
@@ -1472,6 +1486,7 @@ config_host_data.set('CONFIG_LIBSSH', libssh.found())
config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
+config_host_data.set('CONFIG_NUMA', numa.found())
config_host_data.set('CONFIG_RBD', rbd.found())
config_host_data.set('CONFIG_SDL', sdl.found())
config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
@@ -3548,7 +3563,7 @@ summary_info += {'snappy support': snappy}
summary_info += {'bzip2 support': libbzip2}
summary_info += {'lzfse support': liblzfse}
summary_info += {'zstd support': zstd}
-summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
+summary_info += {'NUMA host support': numa}
summary_info += {'capstone': capstone_opt == 'internal' ? capstone_opt : capstone}
summary_info += {'libpmem support': libpmem}
summary_info += {'libdaxctl support': libdaxctl}