forked from auracaster/openocd
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 <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/9540 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
committed by
Antonio Borneo
parent
faab1de8b1
commit
a22e4331e7
@@ -527,10 +527,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
|
for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
|
||||||
PKG_CHECK_MODULES([HIDAPI],[$hidapi_lib],[
|
PKG_CHECK_MODULES([HIDAPI],[$hidapi_lib],[
|
||||||
use_hidapi=yes
|
use_hidapi=yes
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "a64_disassembler.h"
|
#include "a64_disassembler.h"
|
||||||
|
|
||||||
#if HAVE_CAPSTONE
|
#ifdef HAVE_CAPSTONE
|
||||||
|
|
||||||
#include <capstone.h>
|
#include <capstone.h>
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "arm_disassembler.h"
|
#include "arm_disassembler.h"
|
||||||
#include <helper/log.h>
|
#include <helper/log.h>
|
||||||
|
|
||||||
#if HAVE_CAPSTONE
|
#ifdef HAVE_CAPSTONE
|
||||||
#include <capstone.h>
|
#include <capstone.h>
|
||||||
#endif
|
#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)
|
static void print_opcode(struct command_invocation *cmd, const cs_insn *insn)
|
||||||
{
|
{
|
||||||
uint32_t opcode = 0;
|
uint32_t opcode = 0;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ int arm_evaluate_opcode(uint32_t opcode, uint32_t address,
|
|||||||
int thumb_evaluate_opcode(uint16_t opcode, uint32_t address,
|
int thumb_evaluate_opcode(uint16_t opcode, uint32_t address,
|
||||||
struct arm_instruction *instruction);
|
struct arm_instruction *instruction);
|
||||||
int arm_access_size(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,
|
int arm_disassemble(struct command_invocation *cmd, struct target *target,
|
||||||
target_addr_t address, size_t count, bool thumb_mode);
|
target_addr_t address, size_t count, bool thumb_mode);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -952,7 +952,7 @@ COMMAND_HANDLER(handle_arm_core_state_command)
|
|||||||
|
|
||||||
COMMAND_HANDLER(handle_arm_disassemble_command)
|
COMMAND_HANDLER(handle_arm_disassemble_command)
|
||||||
{
|
{
|
||||||
#if HAVE_CAPSTONE
|
#ifdef HAVE_CAPSTONE
|
||||||
struct target *target = get_current_target(CMD_CTX);
|
struct target *target = get_current_target(CMD_CTX);
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
|
|||||||
Reference in New Issue
Block a user