configure: split build of hla layouts 19/5719/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Wed, 10 Jun 2020 14:08:41 +0000 (16:08 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Wed, 8 Jul 2020 21:07:21 +0000 (22:07 +0100)
Current hla driver supports two "layout": stlink and ti-icdi.
The configure script allows to independently enable/disable the
the two layout. But in reality by selecting only one of them the
whole hla driver is built, including both "layouts".
This is currently not a big issue because the dependencies of the
two layout are the same (libusb), so we are sure that selecting
one of them would permit to build both.
This is going to change with the merge of a third "layout" for
Nuvoton Nu-Link, because it would be based on hidapi.
We need, at least, to decouple the build of libusb and hidapi
"layouts". A full decouple of each "layout" is also welcome to
match the selection done during configure.

Introduce a new automake macro for each of the two "layout" and
use them to conditionally build the "layout" files.
Use the existing autoconf macros to conditionally compile the code
that depends by the "layout".

Change-Id: Ia20da7a260002a8d2af883425aa401b8920d3f36
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5719
Tested-by: jenkins
configure.ac
src/jtag/drivers/Makefile.am
src/jtag/hla/hla_layout.c
src/jtag/interfaces.c

index a6bda8856cdf3f5b4b6d79b33855358fcab0769d..382a00b6e69ea7ab9610affbe6efc57f912fec85 100644 (file)
@@ -683,10 +683,13 @@ AS_IF([test "x$build_openjtag" = "xyes"], [
 
 AS_IF([test "x$enable_stlink" != "xno" -o "x$enable_ti_icdi" != "xno"], [
        AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.])
+       AM_CONDITIONAL([HLADAPTER], [true])
 ], [
        AC_DEFINE([BUILD_HLADAPTER], [0], [0 if you want the High Level JTAG driver.])
+       AM_CONDITIONAL([HLADAPTER], [false])
 ])
-AM_CONDITIONAL([HLADAPTER], [test "x$enable_stlink" != "xno" -o "x$enable_ti_icdi" != "xno"])
+AM_CONDITIONAL([HLADAPTER_STLINK], [test "x$enable_stlink" != "xno"])
+AM_CONDITIONAL([HLADAPTER_ICDI], [test "x$enable_ti_icdi" != "xno"])
 
 AS_IF([test "x$enable_jlink" != "xno"], [
   AS_IF([test "x$use_internal_libjaylink" = "xyes"], [
index 07824f6789b950d1ad11fe57c52b2a51ee1e69d3..b03f560b3ba57dabbe60086dadb300cc54c3a745 100644 (file)
@@ -129,8 +129,10 @@ endif
 if REMOTE_BITBANG
 DRIVERFILES += %D%/remote_bitbang.c
 endif
-if HLADAPTER
+if HLADAPTER_STLINK
 DRIVERFILES += %D%/stlink_usb.c
+endif
+if HLADAPTER_ICDI
 DRIVERFILES += %D%/ti_icdi_usb.c
 endif
 if RSHIM
index c5e35182d5ea54003aae553d960adff61c9eaebb..686e6f5b28dd253ba5aa4883e318158bb888f9d2 100644 (file)
@@ -57,18 +57,22 @@ static int hl_layout_close(struct hl_interface_s *adapter)
 }
 
 static const struct hl_layout hl_layouts[] = {
+#if BUILD_HLADAPTER_STLINK
        {
         .name = "stlink",
         .open = hl_layout_open,
         .close = hl_layout_close,
         .api = &stlink_usb_layout_api,
         },
+#endif
+#if BUILD_HLADAPTER_ICDI
        {
         .name = "ti-icdi",
         .open = hl_layout_open,
         .close = hl_layout_close,
         .api = &icdi_usb_layout_api,
        },
+#endif
        {.name = NULL, /* END OF TABLE */ },
 };
 
index 7d3f8a8ca10dc7dafc0a954ef81f9beffe455c1d..87ea9582266d7ac897a38b4041dec4eaf9bdef84 100644 (file)
@@ -138,7 +138,7 @@ extern struct adapter_driver imx_gpio_adapter_driver;
 #if BUILD_XDS110 == 1
 extern struct adapter_driver xds110_adapter_driver;
 #endif
-#if BUILD_HLADAPTER == 1
+#if BUILD_HLADAPTER_STLINK == 1
 extern struct adapter_driver stlink_dap_adapter_driver;
 #endif
 #if BUILD_RSHIM == 1
@@ -252,7 +252,7 @@ struct adapter_driver *adapter_drivers[] = {
 #if BUILD_XDS110 == 1
                &xds110_adapter_driver,
 #endif
-#if BUILD_HLADAPTER == 1
+#if BUILD_HLADAPTER_STLINK == 1
                &stlink_dap_adapter_driver,
 #endif
 #if BUILD_RSHIM == 1

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)