aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-09-17 12:25:09 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-30 19:11:36 +0200
commit43b43a4027aefceff3bf7df86a109dd945ac6d49 (patch)
tree93da48c511fd902d6a9e8f5fbeada96f7c1f7bad /meson.build
parent6ec0e15d95da4e80bc890933e3e5bc11f6b54118 (diff)
meson: extend libmpathpersist test for static linking
libmultipath has a dependency on libdevmapper, so include it as well when static linking. It seems that the rabbit hole ends there. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build27
1 files changed, 19 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index 8e9cd67235..5dd7728cc9 100644
--- a/meson.build
+++ b/meson.build
@@ -302,14 +302,25 @@ if targetos == 'linux' and have_tools and not get_option('mpath').disabled()
mpath_lib_init(udev);
return 0;
}'''
- libmultipath = cc.find_library('multipath',
- required: get_option('mpath'),
- static: enable_static)
- libmpathpersist = cc.find_library('mpathpersist',
- required: get_option('mpath'),
- static: enable_static)
- if libmultipath.found() and libmpathpersist.found() and libudev.found()
- mpathlibs = [libmultipath, libmpathpersist, libudev]
+ mpathlibs = [libudev]
+ if enable_static
+ mpathlibs += cc.find_library('devmapper',
+ required: get_option('mpath'),
+ static: enable_static)
+ endif
+ mpathlibs += cc.find_library('multipath',
+ required: get_option('mpath'),
+ static: enable_static)
+ mpathlibs += cc.find_library('mpathpersist',
+ required: get_option('mpath'),
+ static: enable_static)
+ foreach lib: mpathlibs
+ if not lib.found()
+ mpathlibs = []
+ break
+ endif
+ endforeach
+ if mpathlibs.length() > 0
if cc.links(mpath_test_source_new, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs)
mpathpersist_new_api = true