qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] meson: honor --enable-rbd if cc.links test fails
Date: Tue, 26 Jan 2021 11:42:05 +0100	[thread overview]
Message-ID: <c3ef3dfe-1fd2-c68f-d921-bfa433f20153@kamp.de> (raw)
In-Reply-To: <20210126102748.341403-2-pbonzini@redhat.com>

Am 26.01.21 um 11:27 schrieb Paolo Bonzini:
> If the link test failed, compilation proceeded with RBD disabled,
> even if --enable-rbd was used on the configure command line.
> Fix that.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  meson.build | 24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index f991d4274d..5943aa8a51 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -690,15 +690,21 @@ if not get_option('rbd').auto() or have_block
>    librbd = cc.find_library('rbd', has_headers: ['rbd/librbd.h'],
>                             required: get_option('rbd'),
>                             kwargs: static_kwargs)
> -  if librados.found() and librbd.found() and cc.links('''
> -    #include <stdio.h>
> -    #include <rbd/librbd.h>
> -    int main(void) {
> -      rados_t cluster;
> -      rados_create(&cluster, NULL);
> -      return 0;
> -    }''', dependencies: [librbd, librados])
> -    rbd = declare_dependency(dependencies: [librbd, librados])
> +  if librados.found() and librbd.found()
> +    if cc.links('''
> +      #include <stdio.h>
> +      #include <rbd/librbd.h>
> +      int main(void) {
> +        rados_t cluster;
> +        rados_create(&cluster, NULL);
> +        return 0;
> +      }''', dependencies: [librbd, librados])
> +      rbd = declare_dependency(dependencies: [librbd, librados])
> +    elif get_option('rbd').enabled()
> +      error('could not link librados')
> +    else
> +      warning('could not link librados, disabling')
> +    endif
>    endif
>  endif
>  


That was fast, tank you.


Tested-by: Peter Lieven <pl@kamp.de>


Peter




      reply	other threads:[~2021-01-26 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 10:27 [PATCH] meson: honor --enable-rbd if cc.links test fails Paolo Bonzini
2021-01-26 10:42 ` Peter Lieven [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3ef3dfe-1fd2-c68f-d921-bfa433f20153@kamp.de \
    --to=pl@kamp.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).