[PATCH] build: fix make kernel_menuconfig

Thomas Albers thomas.gameiro at googlemail.com
Mon Sep 16 15:55:42 PDT 2019


Use system pkg-config instead of toolchain pkg-config when the kernel 
config scripts are compiled (see FS#2423)

Signed-off-by: Thomas Albers <thomas.gameiro at googlemail.com>
---
 Makefile                          | 1 +
 tools/pkg-config/files/pkg-config | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5301883061..7bfc34e002 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
 
 world:
 
+export SYSTEM_PKG_CONFIG:=$(shell which pkg-config)
 export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
 
 ifneq ($(OPENWRT_BUILD),1)
diff --git a/tools/pkg-config/files/pkg-config b/tools/pkg-config/files/pkg-config
index 82cc74ffcb..00243e663e 100755
--- a/tools/pkg-config/files/pkg-config
+++ b/tools/pkg-config/files/pkg-config
@@ -1,3 +1,7 @@
 #!/bin/sh
 
-pkg-config.real --define-variable=prefix=${STAGING_PREFIX} --define-variable=exec_prefix=${STAGING_PREFIX} --define-variable=bindir=${STAGING_PREFIX}/bin $@
+if [ -n "${STAGING_PREFIX}" ]; then
+	pkg-config.real --define-variable=prefix=${STAGING_PREFIX} --define-variable=exec_prefix=${STAGING_PREFIX} --define-variable=bindir=${STAGING_PREFIX}/bin $@
+else
+	${SYSTEM_PKG_CONFIG} $@
+fi
-- 
2.21.0




More information about the openwrt-devel mailing list