This is an automated email from Gerrit. "Marc Schink <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9540
-- gerrit commit 30a316a584f6442861f5b56e9edd8fc2451a0ed7 Author: Marc Schink <[email protected]> Date: Wed Mar 11 12:55:25 2026 +0100 configure: Rework HAVE_CAPSTONE #define Autotools and the current build system define HAVE_* macros only when the corresponding feature is available, leaving them undefined otherwise. HAVE_CAPSTONE is an exception, align it with this convention to make the build system more consistent and slightly simpler. Change-Id: I0b71743a687802b905e3fe1e17cad815a7febb14 Signed-off-by: Marc Schink <[email protected]> diff --git a/configure.ac b/configure.ac index 1763f1beb8..70a14d4792 100644 --- a/configure.ac +++ b/configure.ac @@ -447,10 +447,6 @@ AS_IF([test "x$enable_capstone" != xno], [ ]) ]) -AS_IF([test "x$enable_capstone" == xno], [ - AC_DEFINE([HAVE_CAPSTONE], [0], [0 if you don't have Capstone disassembly framework.]) -]) - for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do PKG_CHECK_MODULES([HIDAPI],[$hidapi_lib],[ use_hidapi=yes diff --git a/src/target/a64_disassembler.c b/src/target/a64_disassembler.c index ca3d3ea7a9..3ae5d9c27b 100644 --- a/src/target/a64_disassembler.c +++ b/src/target/a64_disassembler.c @@ -13,7 +13,7 @@ #include "target.h" #include "a64_disassembler.h" -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE #include <capstone.h> diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c index 6dea19f935..e07843afd7 100644 --- a/src/target/arm_disassembler.c +++ b/src/target/arm_disassembler.c @@ -15,7 +15,7 @@ #include "arm_disassembler.h" #include <helper/log.h> -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE #include <capstone.h> #endif @@ -3019,7 +3019,7 @@ int arm_access_size(struct arm_instruction *instruction) } } -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE static void print_opcode(struct command_invocation *cmd, const cs_insn *insn) { uint32_t opcode = 0; diff --git a/src/target/arm_disassembler.h b/src/target/arm_disassembler.h index 8317da997b..34df0f1f0f 100644 --- a/src/target/arm_disassembler.h +++ b/src/target/arm_disassembler.h @@ -187,7 +187,7 @@ int arm_evaluate_opcode(uint32_t opcode, uint32_t address, int thumb_evaluate_opcode(uint16_t opcode, uint32_t address, struct arm_instruction *instruction); int arm_access_size(struct arm_instruction *instruction); -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE int arm_disassemble(struct command_invocation *cmd, struct target *target, target_addr_t address, size_t count, bool thumb_mode); #endif diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 4f61c58e2d..d9816d0331 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -952,7 +952,7 @@ COMMAND_HANDLER(handle_arm_core_state_command) COMMAND_HANDLER(handle_arm_disassemble_command) { -#if HAVE_CAPSTONE +#ifdef HAVE_CAPSTONE struct target *target = get_current_target(CMD_CTX); if (!target) { --
