package/apcupsd: pass additional libusb libs for static build
authorJames Hilliard <james.hilliard1@gmail.com>
Tue, 28 Apr 2020 09:31:39 +0000 (03:31 -0600)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 29 Apr 2020 21:13:10 +0000 (23:13 +0200)
By default apcupsd only passes libs for libusb-compat, this is not
sufficient for static builds which also require libusb libs.

Fixes:
http://autobuild.buildroot.net/results/747/7472fec82983f5b9c2f92578b2b20b746a8d20ae/build-end.log

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/apcupsd/apcupsd.mk

index ff9cc9242fac5751405abdfcd722b6cf747f6243..410bce9aeca5ccab91018853e1748d4684c2be33 100644 (file)
@@ -10,8 +10,12 @@ APCUPSD_LICENSE = GPL-2.0
 APCUPSD_LICENSE_FILES = COPYING
 APCUPSD_CONF_OPTS = --disable-test
 
-ifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y)
-APCUPSD_CONF_ENV = ac_cv_path_usbcfg=$(STAGING_DIR)/usr/bin/libusb-config
+ifneq ($(BR2_PACKAGE_APCUPSD_MODBUS_USB)$(BR2_PACKAGE_APCUPSD_USB),)
+APCUPSD_CONF_ENV += ac_cv_path_usbcfg=$(STAGING_DIR)/usr/bin/libusb-config
+ifeq ($(BR2_STATIC_LIBS),y)
+APCUPSD_DEPENDENCIES += host-pkgconf
+APCUPSD_CONF_ENV += LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libusb`"
+endif
 endif
 
 ifeq ($(BR2_PACKAGE_APCUPSD_APCSMART),y)