[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: |
Peter Lieven |
Subject: |
Re: configure does not detect librados or librbd since the switch to meson |
Date: |
Mon, 25 Jan 2021 23:20:19 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Am 25.01.21 um 22:57 schrieb Paolo Bonzini:
> 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).
Yes, it does.
Please CC me, when you submit a complete patch. I will build my V2 of the rbd
driver rewrite on top of this then.
Thanks,
Peter