From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH v2] capstone: use <capstone/capstone.h> instead of <capstone.h>
Date: Mon, 14 Nov 2022 08:58:06 +0000 [thread overview]
Message-ID: <Y3IDCbr/ZgsSuzkh@redhat.com> (raw)
In-Reply-To: <20221113200942.18882-1-mjt@msgid.tls.msk.ru>
On Sun, Nov 13, 2022 at 11:09:42PM +0300, Michael Tokarev wrote:
> The upcoming capstone 5.0 drops support for the old way
> of including its header, due to this change:
> https://github.com/capstone-engine/capstone/commit/6656bcb63ab4e87dc6079bd6b6b12cc8dd9b2ad8
> The official way is to use <capstone/capstone.h>
>
> This change has already been proposed before, see
> https://patchwork.kernel.org/project/qemu-devel/patch/20180215173539.11033-1-f4bug@amsat.org/
> but it didn't find its way into qemu at that time.
>
> On current systems, using <capstone/capstone.h> works
> now (despite the pkg-config-supplied -I/usr/include/capstone) -
> since on all systems capstone headers are put into capstone/
> subdirectory of a system include dir. So this change is
> compatible with both the obsolete way of including it
> and the only future way.
AFAIR, macOS HomeBrew does not put anything into the system
include dir, and always requires -I flags to be correct.
> diff --git a/meson.build b/meson.build
> index cf3e517e56..6f34c963f7 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2680,12 +2680,7 @@ if not get_option('capstone').auto() or have_system or have_user
> capstone = dependency('capstone', version: '>=3.0.5',
> kwargs: static_kwargs, method: 'pkg-config',
> required: get_option('capstone'))
> -
> - # Some versions of capstone have broken pkg-config file
> - # that reports a wrong -I path, causing the #include to
> - # fail later. If the system has such a broken version
> - # do not use it.
> - if capstone.found() and not cc.compiles('#include <capstone.h>',
> + if capstone.found() and not cc.compiles('#include <capstone/capstone.h>',
> dependencies: [capstone])
To retain back compat this could probe for both ways
if capstone.found()
if cc.compiles('#include <capstone/capstone.h>',
dependencies: [capstone])
...
else if cc.compiles('#include <capstone.h>',
dependencies: [capstone])
...
then, the source file can try the correct #include based on what
we detect works here.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2022-11-15 1:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-13 20:09 [PATCH v2] capstone: use <capstone/capstone.h> instead of <capstone.h> Michael Tokarev
2022-11-14 8:58 ` Daniel P. Berrangé [this message]
2022-11-14 9:13 ` Michael Tokarev
2022-11-14 11:14 ` Daniel P. Berrangé
2022-11-14 11:59 ` Peter Maydell
2022-11-14 12:01 ` Daniel P. Berrangé
2022-11-15 9:25 ` Michael Tokarev
2022-11-15 11:00 ` Peter Maydell
2022-11-15 11:02 ` Peter Maydell
2022-11-15 11:03 ` Michael Tokarev
2022-11-14 13:49 ` Paolo Bonzini
2022-11-15 8:11 ` Daniel P. Berrangé
2022-11-17 14:43 ` Paolo Bonzini
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=Y3IDCbr/ZgsSuzkh@redhat.com \
--to=berrange@redhat.com \
--cc=f4bug@amsat.org \
--cc=mjt@tls.msk.ru \
--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).