Skip to contentSkip to conversation

capstone: Support capstone/capstone.h

PATCH In review Stephen Checkoway 2 participants 3 messages Apr 1, 2019 – Apr 2, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 capstone: Support capstone/capstone.h

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.

---
 configure                | 9 +++++++++
 include/disas/capstone.h | 4 ++++
 2 files changed, 13 insertions(+)
configure +9 -0
index 1c563a7027..da87c18f14 100755
@@ -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
include/disas/capstone.h +4 -0
index 84e214956d..e1477bf6a2 100644
@@ -3,7 +3,11 @@
 
 #ifdef CONFIG_CAPSTONE
 
+#ifdef HAVE_CAPSTONE_CAPSTONE_H
+#include <capstone/capstone.h>
+#else
 #include <capstone.h>
+#endif
 
 #else
 
Signature · 1 line
2.20.1 (Apple Git-117)
#1 lore raw
Quoted 11 lines · 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.

---
 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~

#2 lore raw
Quoted 1 line · Richard Henderson

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

Is that something that you want with this patch?

Signature · 1 line
Stephen Checkoway