diff mbox series

[OpenWrt-Devel] build: fix make kernel_menuconfig

Message ID mailman.25186.1568674551.19300.openwrt-devel@lists.openwrt.org
State Rejected
Delegated to: Petr Štetiar
Headers show
Series [OpenWrt-Devel] build: fix make kernel_menuconfig | expand

Commit Message

hurrhnn--- via openwrt-devel Sept. 16, 2019, 10:55 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
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@googlemail.com>
---
 Makefile                          | 1 +
 tools/pkg-config/files/pkg-config | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Petr Štetiar Sept. 20, 2019, 7:15 p.m. UTC | #1
Thomas Albers via openwrt-devel <openwrt-devel@lists.openwrt.org> [2019-09-16 17:55:42]:

Hi,

[...]

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

[...]

> 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

I've discussed this patch today on IRC and we came to the conclusion, that
it's too fragile and that it would be preferred to simply focus on fixing just
what is broken, thus just kernel_menuconfig target.

I came up with following fix[1].

1. https://git.openwrt.org/4faf5f30e4479e4f033963c70b312035fa1774ab

-- ynezz
hurrhnn--- via openwrt-devel Sept. 21, 2019, 10:36 p.m. UTC | #2
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
This patch is working for me.

Minor issue: currently make kernel_nconfig is failing for the same
reason (target calling pkg-config from the toolchain/host), so we
might fix that target as well now.

Around line 157 in file include/toplevel.mk the patch should read

+ifneq ($(DISTRO_PKG_CONFIG),)
+kernel_menuconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
+kernel_nconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
+endif

Regards,
Thomas
diff mbox series

Patch

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