package/flashrom: libusb is optional, not mandatory
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 28 Feb 2019 19:26:12 +0000 (20:26 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 5 Mar 2019 20:45:44 +0000 (21:45 +0100)
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/flashrom/Config.in
package/flashrom/flashrom.mk

index 1edf162d31c186164043da260d8c00ed84625b22..f787bb3b6290839d918db7b4a04a9ec2277dfe4e 100644 (file)
@@ -1,8 +1,6 @@
 config BR2_PACKAGE_FLASHROM
        bool "flashrom"
        depends on BR2_i386 || BR2_x86_64
-       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
-       select BR2_PACKAGE_LIBUSB
        help
          flashrom is a utility for identifying, reading, writing,
          verifying and erasing flash chips. It is designed to flash
@@ -11,7 +9,3 @@ config BR2_PACKAGE_FLASHROM
          programmer devices.
 
          http://flashrom.org/
-
-comment "flashrom needs a toolchain w/ threads"
-       depends on BR2_i386 || BR2_x86_64
-       depends on !BR2_TOOLCHAIN_HAS_THREADS
index 69a0cbfe5c3b5374c33db04a7d4198519161c371..733ad7318d71870b78b86ca2b2714053fb69c55b 100644 (file)
@@ -7,7 +7,6 @@
 FLASHROM_VERSION = 1.0
 FLASHROM_SOURCE = flashrom-$(FLASHROM_VERSION).tar.bz2
 FLASHROM_SITE = https://download.flashrom.org/releases
-FLASHROM_DEPENDENCIES = libusb host-pkgconf
 FLASHROM_LICENSE = GPL-2.0+
 FLASHROM_LICENSE_FILES = COPYING
 
@@ -22,6 +21,13 @@ FLASHROM_MAKE_OPTS += \
        CONFIG_USBBLASTER_SPI=no
 endif
 
+ifeq ($(BR2_PACKAGE_LIBUSB),y)
+FLASHROM_DEPENDENCIES += host-pkgconf libusb
+FLASHROM_MAKE_OPTS += CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=yes
+else
+FLASHROM_MAKE_OPTS += CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no
+endif
+
 ifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y)
 FLASHROM_DEPENDENCIES += host-pkgconf libusb-compat
 FLASHROM_MAKE_OPTS += CONFIG_ENABLE_LIBUSB0_PROGRAMMERS=yes