aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2022-09-26 15:32:24 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2022-10-08 07:59:44 +0000
commit978c115dac5a2f420b9ef70207f384f09e380e35 (patch)
tree1121d07cad4bf29f22056929e5ea2fb964f1e2b1 /configure.ac
parenta69b382efd35f13e0f7e63194086a2f5ac24215b (diff)
downloadriscv-openocd-978c115dac5a2f420b9ef70207f384f09e380e35.zip
riscv-openocd-978c115dac5a2f420b9ef70207f384f09e380e35.tar.gz
riscv-openocd-978c115dac5a2f420b9ef70207f384f09e380e35.tar.bz2
openocd: fix build with 'configure --without-capstone'
When configure option --without-capstone is used, the macro HAVE_CAPSTONE is not defined in config.h, and the following lines are instead present: /* 1 if you have Capstone disassembly framework. */ /* #undef HAVE_CAPSTONE */ This cause compile error with message: arm_disassembler.h:190:5: error: "HAVE_CAPSTONE" is not defined, evaluates to 0 [-Werror=undef] 190 | #if HAVE_CAPSTONE | ^~~~~~~~~~~~~ This is caused by configure.ac that does not call AC_DEFINE when --without-capstone option is present. Fix configure.ac to always provide the autoconf macro HAVE_CAPSTONE, with either value 0 or 1. Change-Id: Ie5ac98b2c25746dd721812c91baaac61ec877ecd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7224 Tested-by: jenkins
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 4 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index cfd2384..13c9904 100644
--- a/configure.ac
+++ b/configure.ac
@@ -631,7 +631,6 @@ AS_IF([test "x$enable_capstone" != xno], [
PKG_CHECK_MODULES([CAPSTONE], [capstone], [
AC_DEFINE([HAVE_CAPSTONE], [1], [1 if you have Capstone disassembly framework.])
], [
- AC_DEFINE([HAVE_CAPSTONE], [0], [0 if you don't have Capstone disassembly framework.])
if test "x$enable_capstone" != xauto; then
AC_MSG_ERROR([--with-capstone was given, but test for Capstone failed])
fi
@@ -639,6 +638,10 @@ 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