openocd: fix build with 'configure --without-capstone'
commit978c115dac5a2f420b9ef70207f384f09e380e35
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 26 Sep 2022 13:32:24 +0000 (26 15:32 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 8 Oct 2022 07:59:44 +0000 (8 07:59 +0000)
tree1121d07cad4bf29f22056929e5ea2fb964f1e2b1
parenta69b382efd35f13e0f7e63194086a2f5ac24215b
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
configure.ac