diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-09-17 19:41:27 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-10-02 11:12:48 +0200 |
commit | 1c1198a3f252a9af91a128263c9ee25682cf7160 (patch) | |
tree | 52e0060b1f7299081f81a179c5f442f974d4d119 /scripts/Kconfig | |
parent | d297e90323f3f129feea237cd48a3fe9a290850b (diff) | |
download | barebox-1c1198a3f252a9af91a128263c9ee25682cf7160.tar.gz barebox-1c1198a3f252a9af91a128263c9ee25682cf7160.tar.xz |
scripts: allow building USB loader tools for target as well
We currently build the USB loader tools only for the host (build) system,
but it can be useful to cross compile them as well for the target.
We already have some target tools, but support for those is easier,
because they don't link against libraries. We use pkg-config to get
cc and ld flags, but we always assume that pkg-config is for the host
system and there is no well-defined way to request pkg-config for the
target system.
Support this by introducing a new CROSS_PKG_CONFIG. This will be
consulted only for target tools and default to
$(CROSS_COMPILE)pkgconfig.
Users can override it as necessary, for example, with Yocto, pkg-config
will be for the cross environment, so target tools can now be built
with:
export ARCH=sandbox CROSS_COMPILE=aarch64-linux-gnu-
export CROSS_PKG_CONFIG=pkg-config scripts
make targettools_defconfig
make scripts
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210917174127.23345-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/Kconfig')
-rw-r--r-- | scripts/Kconfig | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/Kconfig b/scripts/Kconfig index f7ed775fbc..a490aaa44e 100644 --- a/scripts/Kconfig +++ b/scripts/Kconfig @@ -69,4 +69,39 @@ config BAREBOXCRC32_TARGET 'bareboxcrc32' is a userspacetool to generate the crc32 checksums the same way barebox does. Say yes here to build it for the target. +config HAS_TARGET_LIBUSB_1_0 + def_bool $(success,$(CROSS_PKG_CONFIG) --exists libusb-1.0) + help + Ensure $(CROSS_PKG_CONFIG) is set to a valid pkg-config + binary that knows about libusb-1.0 compiled for the + target architecture. + +config MVEBU_KWBOOT_TARGET + bool "kwboot target tool" + help + Say Y here to build the kwboot tool for the target + to bootstrap over UART. + +config ARCH_IMX_USBLOADER_TARGET + depends on HAS_TARGET_LIBUSB_1_0 + bool "imx-usb-loader for target" + help + Say Y here to build the imx-usb-loader tool for the target. + The cross toolchain needs libusb-1.0 to compile this tool. + +config OMAP3_USB_LOADER_TARGET + bool "omap3 USB loader for target" + depends on HAS_TARGET_LIBUSB_1_0 + help + Say Y here to build the omap3 usb loader tool for the target. + The cross toolchain needs libusb-1.0 to compile this tool. + + +config OMAP4_USBBOOT_TARGET + bool "omap4 usbboot for target" + depends on HAS_TARGET_LIBUSB_1_0 + help + Say Y here to build the omap4 usb loader tool for the target. + The cross toolchain needs libusb-1.0 to compile this tool. + endmenu |