diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-07-27 10:48:11 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-07-28 07:51:31 +0200 |
commit | 6424dd6fda45996517cd510309acb3876f7204a3 (patch) | |
tree | 3998ffd72e02d1ad368d9fe1933310130e4aa26b /arch/sandbox/os/Makefile | |
parent | cb2fd486df2fc433aee2fcd6158e851c3e9f618d (diff) | |
download | barebox-6424dd6fda45996517cd510309acb3876f7204a3.tar.gz barebox-6424dd6fda45996517cd510309acb3876f7204a3.tar.xz |
Makefile: allow setting pkg-config binary via PKG_CONFIG
Unlike Linux, barebox build system does build both host and
target tools in the same build, each using a different pkg-config.
This is done by using `pkg-config` for the host tools and
`$CROSS_PKG_CONFIG` for the target tools. In Yocto, `pkg-config` is for
target tools and `pkg-config-native` is for host tools, which we can't
represent with the current scheme.
The usual work around that Yocto employs for the kernel is to
override PKG_CONFIG_PATH to always point into the native sysroot and
resetting PKG_CONFIG_SYSROOT_DIR, but this breaks build of target tools
that use pkg-config.
Fix this by providing a PKG_CONFIG variable that can be overridden
when necessary.
This intentionally skips the scripts/kconfig directory to make it easier
to sync with the kernel. While we should eventually switch that over to
use PKG_CONFIG as well, Yocto will set PKG_CONFIG_PATH and
PKG_CONFIG_SYSROOT_DIR appropriately in cm1.bbclass' do_menuconfig, so
this can wait until the change is done to the kernel and synced back.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230727084812.880438-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/os/Makefile')
-rw-r--r-- | arch/sandbox/os/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile index ebcbe5833b..055ce1a316 100644 --- a/arch/sandbox/os/Makefile +++ b/arch/sandbox/os/Makefile @@ -20,8 +20,8 @@ endif obj-y = common.o tap.o setjmp.o obj-$(CONFIG_MALLOC_LIBC) += libc_malloc.o -CFLAGS_sdl.o = $(shell pkg-config sdl2 --cflags) +CFLAGS_sdl.o = $(shell $(PKG_CONFIG) sdl2 --cflags) obj-$(CONFIG_SDL) += sdl.o -CFLAGS_ftdi.o = $(shell pkg-config libftdi1 --cflags) +CFLAGS_ftdi.o = $(shell $(PKG_CONFIG) libftdi1 --cflags) obj-$(CONFIG_GPIO_LIBFTDI1) += ftdi.o |