package/usbutils: select libiconv if needed

Since upstream commit 7c7fed30f7553b551fce3151fe315cf69e602065, which
first appeared in usbutils version 007, iconv is used when available.
Since then, the package has been failing to build when libiconv needs to
be provided by a library external to the C library. This commit fixes
that by selecting BR2_PACKAGE_LIBICONV when libiconv is not provided by
the toolchain.

Fixes:
 http://autobuild.buildroot.net/results/d7d/d7dedb754804242d020d1a0d34dd95c7c1074710//
 http://autobuild.buildroot.net/results/bca/bca14ce4fe05f087e1d8821670ba3165e9820a7f//
 http://autobuild.buildroot.net/results/665/665c064bf28a325a8bc4d9fe16f453be48472e57//
 http://autobuild.buildroot.net/results/b54/b543a3713949571b04dbd9c94f063fa0a186765b//
 http://autobuild.buildroot.net/results/6ea/6ea6cde91c2c6c49f56a08f37fef0c134eda40a0//

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit 9fb56e0367022c2d18531fd2d9882dedfc68f31d)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Sébastien Szymanski 2025-02-04 16:55:44 +01:00 committed by Peter Korsgaard
parent f81379d65f
commit 373e2c22e2
2 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ config BR2_PACKAGE_USBUTILS
depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # libusb
depends on BR2_PACKAGE_HAS_UDEV # needs hwdb
select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
select BR2_PACKAGE_LIBUSB
help
USB enumeration utilities

View File

@ -11,6 +11,11 @@ USBUTILS_DEPENDENCIES = host-pkgconf libusb udev
USBUTILS_LICENSE = GPL-2.0+ (utils) GPL-2.0 or GPL-3.0 (lsusb.py)
USBUTILS_LICENSE_FILES = LICENSES/GPL-2.0-only.txt LICENSES/GPL-3.0-only.txt
ifeq ($(BR2_PACKAGE_LIBICONV),y)
USBUTILS_DEPENDENCIES += libiconv
USBUTILS_LDFLAGS += -liconv
endif
# Nice lsusb.py script only if there's python 3.x
ifeq ($(BR2_PACKAGE_PYTHON3),)
define USBUTILS_REMOVE_PYTHON