This is an automated email from Gerrit. Antonio Borneo (borneo.anto...@gmail.com) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/5719
-- gerrit commit e72f681189c665e2f033504056e0d1de94d43f8c Author: Antonio Borneo <borneo.anto...@gmail.com> Date: Wed Jun 10 16:08:41 2020 +0200 configure: split build of hla layouts 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.anto...@gmail.com> diff --git a/configure.ac b/configure.ac index a6bda88..382a00b 100644 --- a/configure.ac +++ b/configure.ac @@ -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"], [ diff --git a/src/jtag/drivers/Makefile.am b/src/jtag/drivers/Makefile.am index 07824f6..b03f560 100644 --- a/src/jtag/drivers/Makefile.am +++ b/src/jtag/drivers/Makefile.am @@ -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 diff --git a/src/jtag/hla/hla_layout.c b/src/jtag/hla/hla_layout.c index c5e3518..686e6f5 100644 --- a/src/jtag/hla/hla_layout.c +++ b/src/jtag/hla/hla_layout.c @@ -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 */ }, }; diff --git a/src/jtag/interfaces.c b/src/jtag/interfaces.c index 7d3f8a8..87ea958 100644 --- a/src/jtag/interfaces.c +++ b/src/jtag/interfaces.c @@ -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 -- _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel