configure: do not make Capstone dependency automagic 85/5985/5
authorPaul Fertser <fercerpav@gmail.com>
Wed, 23 Dec 2020 17:49:56 +0000 (20:49 +0300)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 8 Jan 2021 10:23:26 +0000 (10:23 +0000)
This adds regular ./configure options to control dependency on the
Capstone disassembly engine. See [0] for the rationale.

[0] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies

Change-Id: I3e16dc5255d650aa1949ccf896b26dc96e522a75
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/5985
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
configure.ac

index 236d6bc2898f5d7b723c66ba799e879ba19b1cd8..baa198730768b8f5d7a38735d4089cf28156a51d 100644 (file)
@@ -150,6 +150,8 @@ m4_define([LIBJAYLINK_ADAPTERS],
 m4_define([PCIE_ADAPTERS],
        [[[xlnx_pcie_xvc], [Xilinx XVC/PCIe], [XLNX_PCIE_XVC]]])
 
+m4_define([OPTIONAL_LIBRARIES],
+       [[[capstone], [Use Capstone disassembly framework], []]])
 
 AC_ARG_ENABLE([doxygen-html],
   AS_HELP_STRING([--disable-doxygen-html],
@@ -653,13 +655,24 @@ PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
 
 PKG_CHECK_MODULES([LIBUSB0], [libusb], [use_libusb0=yes], [use_libusb0=no])
 
-PKG_CHECK_MODULES([CAPSTONE], [capstone], [have_capstone=yes],
-       [have_capstone=no])
+AC_ARG_WITH([capstone],
+               AS_HELP_STRING([--with-capstone], [Use Capstone disassembly library (default=auto)])
+       , [
+               enable_capstone=$withval
+       ], [
+               enable_capstone=auto
+])
 
-AS_IF([test "x$have_capstone" = "xyes"], [
-  AC_DEFINE([HAVE_CAPSTONE], [1], [1 if you have captone disassembly framework.])
-], [
-  AC_DEFINE([HAVE_CAPSTONE], [0], [0 if you don't have captone disassembly framework.])
+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
+               enable_capstone=no
+       ])
 ])
 
 for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
@@ -785,7 +798,7 @@ AM_CONDITIONAL([USE_LIBGPIOD], [test "x$use_libgpiod" = "xyes"])
 AM_CONDITIONAL([USE_HIDAPI], [test "x$use_hidapi" = "xyes"])
 AM_CONDITIONAL([USE_LIBJAYLINK], [test "x$use_libjaylink" = "xyes"])
 AM_CONDITIONAL([RSHIM], [test "x$build_rshim" = "xyes"])
-AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$have_capstone" = "xyes"])
+AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
 
 AM_CONDITIONAL([MINIDRIVER], [test "x$build_minidriver" = "xyes"])
 AM_CONDITIONAL([MINIDRIVER_DUMMY], [test "x$build_minidriver_dummy" = "xyes"])
@@ -856,7 +869,8 @@ echo --------------------------------------------------
 m4_foreach([adapter], [USB1_ADAPTERS, USB0_ADAPTERS,
        HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS,
        LIBGPIOD_ADAPTERS,
-       LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS],
+       LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS,
+       OPTIONAL_LIBRARIES],
        [s=m4_format(["%-40s"], ADAPTER_DESC([adapter]))
        AS_CASE([$ADAPTER_VAR([adapter])],
                [auto], [

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)