kumquat-buildroot/package/libusb/libusb.mk
Fabrice Fontaine d661740201 package/libusb: add -latomic to libusb-1.0.pc if needed
libusb unconditionally uses atomic since version 1.0.25 and
1a08aa84d9
resulting in the following build failure with pcsc-lite or openocd since
commit aad609936f:

checking for libusb_init... configure: error: libusb not found, use ./configure LIBUSB_LIBS=...

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libusb-1.0.so: undefined reference to `__atomic_fetch_add_4'
collect2: error: ld returned 1 exit status

Fixes:
 - http://autobuild.buildroot.org/results/4a27a769bb3cdf78643c3049b87d792178d6512c
 - http://autobuild.buildroot.org/results/b59b30cbe0e27399db5c7586f369104e68a1589a

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-02-14 21:38:43 +01:00

41 lines
1.2 KiB
Makefile

################################################################################
#
# libusb
#
################################################################################
LIBUSB_VERSION_MAJOR = 1.0
LIBUSB_VERSION = $(LIBUSB_VERSION_MAJOR).25
LIBUSB_SOURCE = libusb-$(LIBUSB_VERSION).tar.bz2
LIBUSB_SITE = https://github.com/libusb/libusb/releases/download/v$(LIBUSB_VERSION)
LIBUSB_LICENSE = LGPL-2.1+
LIBUSB_LICENSE_FILES = COPYING
LIBUSB_CPE_ID_VENDOR = libusb
LIBUSB_DEPENDENCIES = host-pkgconf
LIBUSB_INSTALL_STAGING = YES
# We're patching configure.ac
LIBUSB_AUTORECONF = YES
# Avoid the discovery of udev for the host variant
HOST_LIBUSB_CONF_OPTS = --disable-udev
HOST_LIBUSB_DEPENDENCIES = host-pkgconf
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
LIBUSB_DEPENDENCIES += udev
else
LIBUSB_CONF_OPTS += --disable-udev
endif
ifeq ($(BR2_PACKAGE_LIBUSB_EXAMPLES),y)
LIBUSB_CONF_OPTS += --enable-examples-build
define LIBUSB_INSTALL_TARGET_EXAMPLES
$(foreach example,listdevs xusb fxload hotplugtest testlibusb dpfp dpfp_threaded sam3u_benchmark,
$(INSTALL) -D -m0755 $(@D)/examples/$(example) $(TARGET_DIR)/usr/bin/$(example)
)
endef
LIBUSB_POST_INSTALL_TARGET_HOOKS += LIBUSB_INSTALL_TARGET_EXAMPLES
endif
$(eval $(autotools-package))
$(eval $(host-autotools-package))