summaryrefslogtreecommitdiffstats
path: root/arch/sandbox
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-07-27 10:48:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-07-28 07:51:31 +0200
commit6424dd6fda45996517cd510309acb3876f7204a3 (patch)
tree3998ffd72e02d1ad368d9fe1933310130e4aa26b /arch/sandbox
parentcb2fd486df2fc433aee2fcd6158e851c3e9f618d (diff)
downloadbarebox-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')
-rw-r--r--arch/sandbox/Makefile4
-rw-r--r--arch/sandbox/os/Makefile4
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index d5ba05ba86..04fa426b1a 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -42,11 +42,11 @@ archprepare: maketools
PHONY += maketools
ifeq ($(CONFIG_SDL),y)
-SDL_LIBS := $(shell pkg-config sdl2 --libs)
+SDL_LIBS := $(shell $(PKG_CONFIG) sdl2 --libs)
endif
ifeq ($(CONFIG_GPIO_LIBFTDI1),y)
-FTDI1_LIBS := $(shell pkg-config libftdi1 --libs)
+FTDI1_LIBS := $(shell $(PKG_CONFIG) libftdi1 --libs)
endif
ifeq ($(CONFIG_ASAN),y)
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