Skip to content

Commit 1860c6f

Browse files
Release: Explicitly disable libusb-0.1 usage for OpenOCD
OpenOCD configure script uses pkg-config to identify if libusb-0.1 and libusb-1.0 are present. This causes issues with cross builds on MinGW, because pkg-config gets confused and assumes that host libusb-0.1 is ok for MinGW build, which is not true. One possible solution to this problem is to disable usage of pkg-config and instead directly pass -L and -I options required to use libusb-1.0. However this causes another trouble, as OpenOCD has some "hack" for libusb bug, and when libusb-1.0 is supplied directly it assumes that version <1.0.9 is used, but that causes a compatibility issues with libusb-1.0.20 that Synopsys uses in GNU Toolchain builds. As a solution and option --disable-libusb0 has been added to OpenOCD configure scripts that allows to disable libusb0 usage at all, since it is not needed for Synopsys builds. Default behavior is unchanged (use pkg-config to search for libusb-0.1), but if option is specified, then its value is used. Signed-off-by: Anton Kolesov <[email protected]>
1 parent d356f59 commit 1860c6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

release.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ $(OOCD_BUILD_DIR_LINUX)/Makefile:
768768
PKG_CONFIG_PATH=$(abspath $(BUILD_DIR)/libusb_linux_install)/lib/pkgconfig \
769769
$(OOCD_SRC_DIR)/configure \
770770
--enable-ftdi --disable-werror \
771+
--disable-libusb0 \
771772
PKG_CONFIG=pkg-config \
772773
--prefix=$(abspath $O/$(OOCD_DIR_LINUX))
773774

@@ -856,6 +857,7 @@ $(OOCD_BUILD_DIR_WIN)/Makefile:
856857
$(OOCD_SRC_DIR)/configure \
857858
--enable-ftdi --disable-werror \
858859
--disable-shared --enable-static \
860+
--disable-libusb0 \
859861
--host=$(WINDOWS_TRIPLET) \
860862
PKG_CONFIG=pkg-config \
861863
--prefix=$(abspath $O/$(OOCD_DIR_WIN))

0 commit comments

Comments
 (0)