qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configure does not detect librados or librbd since the switch to mes


From: Paolo Bonzini
Subject: Re: configure does not detect librados or librbd since the switch to meson
Date: Mon, 25 Jan 2021 22:57:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 25/01/21 20:47, Peter Lieven wrote:
Can you include the meson-logs/meson-log.txt output?

Sure:https://pastebin.com/u3XtbDvQ

Does this work for you?

diff --git a/meson.build b/meson.build
index 690d48a6fd..a662772c4a 100644
--- a/meson.build
+++ b/meson.build
@@ -14,6 +14,9 @@ config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
 enable_modules = 'CONFIG_MODULES' in config_host
 enable_static = 'CONFIG_STATIC' in config_host

+# Allow both shared and static libraries unless --enable-static
+static_kwargs = enable_static ? {'static': true} : {}
+
 # Temporary directory used for files created while
 # configure runs. Since it is in the build directory
 # we can safely blow away any previous version of it
@@ -679,10 +682,10 @@ endif
 rbd = not_found
 if not get_option('rbd').auto() or have_block
   librados = cc.find_library('rados', required: get_option('rbd'),
-                             static: enable_static)
+                             kwargs: static_kwargs)
   librbd = cc.find_library('rbd', has_headers: ['rbd/librbd.h'],
                            required: get_option('rbd'),
-                           static: enable_static)
+                           kwargs: static_kwargs)
   if librados.found() and librbd.found() and cc.links('''
     #include <stdio.h>
     #include <rbd/librbd.h>
@@ -693,6 +696,9 @@ if not get_option('rbd').auto() or have_block
     }''', dependencies: [librbd, librados])
     rbd = declare_dependency(dependencies: [librbd, librados])
   endif
+  if not rbd.found() and get_option('rbd').enabled()
+    error('could not link librbd')
+  endif
 endif

 glusterfs = not_found

(It's not a complete patch, all instances of "static: enable_static" would need to be changed because other libraries could have the same issue).

Thanks,

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]