qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] capstone: Support capstone/capstone.h
@ 2019-04-01 22:07 Stephen Checkoway
  2019-04-02  1:28 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Checkoway @ 2019-04-01 22:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stephen Checkoway

Starting with version 4 of capstone, the header files live in the
`$prefix/include/capstone` directory.

This modifies the configure script to check for <capstone/capstone.h> if
<capstone.h> cannot be found.

Signed-off-by: Stephen Checkoway <stephen.checkoway@oberlin.edu>
---
 configure                | 9 +++++++++
 include/disas/capstone.h | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/configure b/configure
index 1c563a7027..da87c18f14 100755
--- a/configure
+++ b/configure
@@ -5039,6 +5039,12 @@ case "$capstone" in
     ;;
 esac
 
+if test "$capstone" != no; then
+  if ! check_include "capstone.h" && check_include "capstone/capstone.h"; then
+    have_capstone_capstone_h=yes
+  fi
+fi
+
 ##########################################
 # check if we have fdatasync
 
@@ -7199,6 +7205,9 @@ if test "$ivshmem" = "yes" ; then
 fi
 if test "$capstone" != "no" ; then
   echo "CONFIG_CAPSTONE=y" >> $config_host_mak
+  if test "$have_capstone_capstone_h" = "yes" ; then
+    echo "HAVE_CAPSTONE_CAPSTONE_H=y" >> $config_host_mak
+  fi
 fi
 if test "$debug_mutex" = "yes" ; then
   echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
diff --git a/include/disas/capstone.h b/include/disas/capstone.h
index 84e214956d..e1477bf6a2 100644
--- a/include/disas/capstone.h
+++ b/include/disas/capstone.h
@@ -3,7 +3,11 @@
 
 #ifdef CONFIG_CAPSTONE
 
+#ifdef HAVE_CAPSTONE_CAPSTONE_H
+#include <capstone/capstone.h>
+#else
 #include <capstone.h>
+#endif
 
 #else
 
-- 
2.20.1 (Apple Git-117)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] capstone: Support capstone/capstone.h
  2019-04-01 22:07 [Qemu-devel] [PATCH] capstone: Support capstone/capstone.h Stephen Checkoway
@ 2019-04-02  1:28 ` Richard Henderson
  2019-04-02  4:52   ` Stephen Checkoway
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2019-04-02  1:28 UTC (permalink / raw)
  To: Stephen Checkoway, qemu-devel

On 4/2/19 5:07 AM, Stephen Checkoway wrote:
> Starting with version 4 of capstone, the header files live in the
> `$prefix/include/capstone` directory.
> 
> This modifies the configure script to check for <capstone/capstone.h> if
> <capstone.h> cannot be found.
> 
> Signed-off-by: Stephen Checkoway <stephen.checkoway@oberlin.edu>
> ---
>  configure                | 9 +++++++++
>  include/disas/capstone.h | 4 ++++
>  2 files changed, 13 insertions(+)

Thanks.  We should probably update our submodule to the v4 release as well.


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] capstone: Support capstone/capstone.h
  2019-04-02  1:28 ` Richard Henderson
@ 2019-04-02  4:52   ` Stephen Checkoway
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Checkoway @ 2019-04-02  4:52 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel



On Apr 1, 2019, at 21:28, Richard Henderson <richard.henderson@linaro.org> wrote:

> Thanks.  We should probably update our submodule to the v4 release as well.

Is that something that you want with this patch?

-- 
Stephen Checkoway

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-02  4:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-01 22:07 [Qemu-devel] [PATCH] capstone: Support capstone/capstone.h Stephen Checkoway
2019-04-02  1:28 ` Richard Henderson
2019-04-02  4:52   ` Stephen Checkoway

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).