Portability fixes for "make menuconfig"
v2 cover Portability fixes for "make menuconfig"
Hi,
Here are two portability fixes needed to be able to run "make menuconfig" on NixOS[1].
[1]: http://nixos.org/
Bj?rn Forsman (2):
kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
Makefile | 6 ++- ...dialog-get-ncurses-CFLAGS-with-pkg-config.patch | 50 ++++++++++++++++++++++ support/kconfig/patches/series | 1 + 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch
Signature · 4 lines
Changes v1 -> v2:
- make the kconfig/lxdialog patch a separate patch file, instead of modifying
the kconfig sources (which are synced with linux from time to time).
Suggested by Thomas P.PATCH v2 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
This makes "make menuconfig" also work on systems where ncurses is not installed in a standard location (such as on NixOS).
This patch changes ccflags() so that it tries pkg-config first, and only if pkg-config fails does it go back to the fallback/manual checks. This is the same algorithm that ldflags() already uses.
[This patch is already applied upstream (is part of linux v3.18):
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b
I'm adding this instead of doing a full upstream kconfig sync because there was a conflict in one of the Buildroot kconfig patches (against linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time Buildroot kconfig is synced against upstream.
]
--- ...dialog-get-ncurses-CFLAGS-with-pkg-config.patch | 50 ++++++++++++++++++++++ support/kconfig/patches/series | 1 + 2 files changed, 51 insertions(+) create mode 100644 support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch
support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch new file +50 -0
@@ -0,0 +1,50 @@ +From be8af2d54a66911693eddc556e4f7a866670082b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <[email protected]> +Date: Sun, 14 Sep 2014 12:57:50 +0200 +Subject: [PATCH] kconfig/lxdialog: get ncurses CFLAGS with pkg-config +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This makes "make menuconfig" also work on systems where ncurses is not +installed in a standard location (such as on NixOS). + +This patch changes ccflags() so that it tries pkg-config first, and only +if pkg-config fails does it go back to the fallback/manual checks. This +is the same algorithm that ldflags() already uses. + +Signed-off-by: Bj?rn Forsman <[email protected]> +Signed-off-by: Michal Marek <[email protected]> +--- +[This patch is already applied upstream (is part of linux v3.18): +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b + +I'm adding this instead of doing a full upstream kconfig sync because +there was a conflict in one of the Buildroot kconfig patches (against +linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time +Buildroot kconfig is synced against upstream. +] + + scripts/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh +index 9d2a4c5..5075ebf 100755 +--- a/scripts/kconfig/lxdialog/check-lxdialog.sh ++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh +@@ -21,7 +21,11 @@ ldflags() + # Where is ncurses.h? + ccflags() + { +- if [ -f /usr/include/ncursesw/curses.h ]; then ++ if pkg-config --cflags ncursesw 2>/dev/null; then ++ echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1' ++ elif pkg-config --cflags ncurses 2>/dev/null; then ++ echo '-DCURSES_LOC="<ncurses.h>"' ++ elif [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"' + echo ' -DNCURSES_WIDECHAR=1' + elif [ -f /usr/include/ncurses/ncurses.h ]; then +-- +2.1.3 +
support/kconfig/patches/series +1 -0
@@ -6,3 +6,4 @@ 14-support-out-of-tree-config.patch 15-fix-qconf-moc-rule.patch 16-fix-space-to-de-select-options.patch +17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch
Signature · 1 line
2.1.3
PATCH v2 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Bj?rn, All,
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 10 lines
This makes "make menuconfig" also work on systems where ncurses is not installed in a standard location (such as on NixOS).
This patch changes
ccflags()so that it tries pkg-config first, and only if pkg-config fails does it go back to the fallback/manual checks. This is the same algorithm thatldflags()already uses.[This patch is already applied upstream (is part of linux v3.18):
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b
Quoted 7 lines
I'm adding this instead of doing a full upstream kconfig sync because there was a conflict in one of the Buildroot kconfig patches (against linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time Buildroot kconfig is synced against upstream.
]Signed-off-by Bj?rn Forsman <[email protected]>
Regards,
Yann E. MORIN.
Quoted 78 lines
--- ...dialog-get-ncurses-CFLAGS-with-pkg-config.patch | 50 ++++++++++++++++++++++ support/kconfig/patches/series | 1 + 2 files changed, 51 insertions(+) create mode 100644 support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patchsupport/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patch new file +50
-0@@ -0,0 +1,50 @@ +From be8af2d54a66911693eddc556e4f7a866670082b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <[email protected]> +Date: Sun, 14 Sep 2014 12:57:50 +0200 +Subject: [PATCH] kconfig/lxdialog: get ncurses CFLAGS with pkg-config +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This makes "make menuconfig" also work on systems where ncurses is not +installed in a standard location (such as on NixOS). + +This patch changes ccflags() so that it tries pkg-config first, and only +if pkg-config fails does it go back to the fallback/manual checks. This +is the same algorithm that ldflags() already uses. + +Signed-off-by: Bj?rn Forsman <[email protected]> +Signed-off-by: Michal Marek <[email protected]> +--- +[This patch is already applied upstream (is part of linux v3.18): +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082b + +I'm adding this instead of doing a full upstream kconfig sync because +there was a conflict in one of the Buildroot kconfig patches (against +linux 3.18-rc1), which I was unable to resolve. Just drop this patch next time +Buildroot kconfig is synced against upstream. +] + + scripts/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh +index 9d2a4c5..5075ebf 100755 +--- a/scripts/kconfig/lxdialog/check-lxdialog.sh ++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh +@@ -21,7 +21,11 @@ ldflags() + # Where is ncurses.h? + ccflags() + { +- if [ -f /usr/include/ncursesw/curses.h ]; then ++ if pkg-config --cflags ncursesw 2>/dev/null; then ++ echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1' ++ elif pkg-config --cflags ncurses 2>/dev/null; then ++ echo '-DCURSES_LOC="<ncurses.h>"' ++ elif [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"' + echo ' -DNCURSES_WIDECHAR=1' + elif [ -f /usr/include/ncurses/ncurses.h ]; then +-- +2.1.3 +support/kconfig/patches/series +1
-0@@ -6,3 +6,4 @@ 14-support-out-of-tree-config.patch 15-fix-qconf-moc-rule.patch 16-fix-space-to-de-select-options.patch +17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patchSignature · 6 lines
2.1.3 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 2/2 Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
In reply to Bjørn ForsmanBuildroot unexports PKG_CONFIG_PATH in the top-level Makefile for purity reasons. But it has an unfortunate side-effect in that "make menuconfig" will not (necessarily) be able to pick up ncurses via host pkg-config, breaking "make menuconfig" on systems where ncurses is installed in a non-standard location.
This patch saves the original PKG_CONFIG_PATH variable in HOST_PKG_CONFIG_PATH and restores the original PKG_CONFIG_PATH variable only in the sub-processes that builds the various menuconfig/nconfig/... targets.
With this change, I am able to run "make menuconfig" on NixOS[1].
[1]: http://nixos.org/
--- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Makefile +5 -1
@@ -264,6 +264,7 @@ export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE # Make sure pkg-config doesn't look outside the buildroot tree +export HOST_PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) unexport PKG_CONFIG_PATH unexport PKG_CONFIG_SYSROOT_DIR unexport PKG_CONFIG_LIBDIR
@@ -692,7 +693,10 @@ export HOSTCFLAGS $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog - $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) + (export PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH); \ + $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \ + obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) \ + ) DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
Signature · 1 line
2.1.3
PATCH v2 2/2 Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
Bj?rn, All,
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 25 lines
Buildroot unexports
PKG_CONFIG_PATHin the top-levelMakefilefor purity reasons. But it has an unfortunate side-effect in that "make menuconfig" will not (necessarily) be able to pick up ncurses via host pkg-config, breaking "make menuconfig" on systems where ncurses is installed in a non-standard location.This patch saves the original
PKG_CONFIG_PATHvariable inHOST_PKG_CONFIG_PATHand restores the originalPKG_CONFIG_PATHvariable only in the sub-processes that builds the various menuconfig/nconfig/... targets.With this change, I am able to run "make menuconfig" on NixOS[1].
[1]: http://nixos.org/
Signed-off-by Bj?rn Forsman <[email protected]>--- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Makefile +0
-0
Makefile export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD · line 267
Quoted 4 lines
Makefile +1
-0@@ -264,6 +264,7 @@ export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE # Make sure pkg-config doesn't look outside the buildroot tree +export HOST_PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
I think you'd want to do an immediate assignment here, and not do an export (see below):
HOST_PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH)
Makefile export HOSTCFLAGS · line 699
Quoted 12 lines
Makefile +4
-1unexport PKG_CONFIG_PATH unexport PKG_CONFIG_SYSROOT_DIR unexport PKG_CONFIG_LIBDIR@@ -692,7 +693,10 @@ export HOSTCFLAGS $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog - $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) + (export PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH); \ + $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \ + obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) \ + )
Well, you do not need this convoluted sub-shell. Just pass the variable as a make option:
$(MAKE) PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
Thus, you do not need to export HOST_PKG_CONFIG_PATH (see above).
Regards,
Yann E. MORIN.
Quoted 10 lines
Makefile +0
-0DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))Signature · 6 lines
2.1.3 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 2/2 Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
Hi Yann,
Thanks for the feedback. Comments below.
Quoted 30 lines · Yann E. MORIN
Bj?rn, All,
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 27 lines
Buildroot unexports
PKG_CONFIG_PATHin the top-levelMakefilefor purity reasons. But it has an unfortunate side-effect in that "make menuconfig" will not (necessarily) be able to pick up ncurses via host pkg-config, breaking "make menuconfig" on systems where ncurses is installed in a non-standard location.This patch saves the original
PKG_CONFIG_PATHvariable inHOST_PKG_CONFIG_PATHand restores the originalPKG_CONFIG_PATHvariable only in the sub-processes that builds the various menuconfig/nconfig/... targets.With this change, I am able to run "make menuconfig" on NixOS[1].
[1]: http://nixos.org/
Signed-off-by Bj?rn Forsman <[email protected]>--- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Makefile +0
-0@@ -264,6 +264,7 @@ export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
Quoted 7 lines
Makefile export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD · line 267
Quoted 2 lines
Makefile +1
-0# Make sure pkg-config doesn't look outside the buildroot tree +export HOST_PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)I think you'd want to do an immediate assignment here, and not do an export (see below):
HOST_PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH)
Will fix.
Quoted 16 lines
Makefile export HOSTCFLAGS · line 699
Quoted 12 lines
Makefile +4
-1unexport PKG_CONFIG_PATH unexport PKG_CONFIG_SYSROOT_DIR unexport PKG_CONFIG_LIBDIR@@ -692,7 +693,10 @@ export HOSTCFLAGS $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog - $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) + (export PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH); \ + $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \ + obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) \ + )Well, you do not need this convoluted sub-shell. Just pass the variable as a make option:
Quoted 1 line
$(MAKE) PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
I tested that. It doesn't work. I guess when the variable is given on the command line to make (not 'exported') it is not available to sub-processes that make spawns.
- Bj?rn
PATCH v2 2/2 Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
Quoted 41 lines · Bj?rn Forsman
Hi Yann,
Thanks for the feedback. Comments below.
Quoted 36 lines · Yann E. MORIN
Bj?rn, All,
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 25 lines
Buildroot unexports
PKG_CONFIG_PATHin the top-levelMakefilefor purity reasons. But it has an unfortunate side-effect in that "make menuconfig" will not (necessarily) be able to pick up ncurses via host pkg-config, breaking "make menuconfig" on systems where ncurses is installed in a non-standard location.This patch saves the original
PKG_CONFIG_PATHvariable inHOST_PKG_CONFIG_PATHand restores the originalPKG_CONFIG_PATHvariable only in the sub-processes that builds the various menuconfig/nconfig/... targets.With this change, I am able to run "make menuconfig" on NixOS[1].
[1]: http://nixos.org/
Signed-off-by Bj?rn Forsman <[email protected]>--- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Makefile +0
-0Makefile export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD · line 267
Quoted 4 lines
Makefile +1
-0@@ -264,6 +264,7 @@ export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE # Make sure pkg-config doesn't look outside the buildroot tree +export HOST_PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)I think you'd want to do an immediate assignment here, and not do an export (see below):
Quoted 3 lines
Quoted 1 line
HOST_PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH)Will fix.
Some comments. There are other HOST_* variables that are exported from the top-level Makefile. I guess that's why I used 'export' in the first place. For now, nobody but Buildroot itself uses HOST_PKG_CONFIG_PATH (well, when this patch gets in), but I can see a future where pkg-config is used within Buildroot for other host packages too. But it is of course trivial to add the "export" at any time :-)
- Bj?rn
PATCH v2 2/2 Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
Bj?rn, All,
On 2015-01-02 22:34 +0100, Bj?rn Forsman spake thusly:
Quoted 38 lines · Bj?rn Forsman
Quoted 37 lines · Yann E. MORIN
Quoted 36 lines
Bj?rn, All,
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 25 lines
Buildroot unexports
PKG_CONFIG_PATHin the top-levelMakefilefor purity reasons. But it has an unfortunate side-effect in that "make menuconfig" will not (necessarily) be able to pick up ncurses via host pkg-config, breaking "make menuconfig" on systems where ncurses is installed in a non-standard location.This patch saves the original
PKG_CONFIG_PATHvariable inHOST_PKG_CONFIG_PATHand restores the originalPKG_CONFIG_PATHvariable only in the sub-processes that builds the various menuconfig/nconfig/... targets.With this change, I am able to run "make menuconfig" on NixOS[1].
[1]: http://nixos.org/
Signed-off-by Bj?rn Forsman <[email protected]>--- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)Makefile +0
-0Makefile export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD · line 267
Quoted 4 lines
Makefile +1
-0@@ -264,6 +264,7 @@ export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE # Make sure pkg-config doesn't look outside the buildroot tree +export HOST_PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)I think you'd want to do an immediate assignment here, and not do an export (see below):
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
HOST_PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH)Will fix.
Some comments. There are other HOST_* variables that are exported from the top-level
Makefile. I guess that's why I used 'export' in the first place.
You're right. I believe export is not needed, but for consistency sake, I understand you would want to use export on it.
Do with an export if you want, I won't complain much. ;-) But state in the commit log that it is not strictly required for the current use-case, and is here just for consistency with other similarly-named variables.
Quoted 5 lines
For now, nobody but Buildroot itself uses
HOST_PKG_CONFIG_PATH(well, when this patch gets in), but I can see a future where pkg-config is used within Buildroot for other host packages too. But it is of course trivial to add the "export" at any time :-)
Hey! :-)
Thanks!
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 2/2 Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
In reply to Bjørn ForsmanBj?rn, All,
On 2015-01-02 22:28 +0100, Bj?rn Forsman spake thusly:
Quoted 7 lines · Yann E. MORIN
Quoted 6 lines
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 5 lines
Buildroot unexports
PKG_CONFIG_PATHin the top-levelMakefilefor purity reasons. But it has an unfortunate side-effect in that "make menuconfig" will not (necessarily) be able to pick up ncurses via host pkg-config, breaking "make menuconfig" on systems where ncurses is installed in a non-standard location.
[--SNIP--]
Quoted 13 lines
Quoted 13 lines
Makefile export HOSTCFLAGS · line 699
Quoted 9 lines
Makefile +4
-1@@ -692,7 +693,10 @@ export HOSTCFLAGS $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog - $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) + (export PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH); \ + $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \ + obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) \ + )Well, you do not need this convoluted sub-shell. Just pass the variable as a make option:
Quoted 5 lines
Quoted 1 line
$(MAKE) PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)I tested that. It doesn't work. I guess when the variable is given on the command line to make (not 'exported') it is not available to sub-processes that make spawns.
In that case, just put it in front of it, like:
PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)
This will put PKG_CONFIG_PATH in the environment just for the duration of the sub-make.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 2/2 Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
Quoted 30 lines · Yann E. MORIN
Bj?rn, All,
On 2015-01-02 22:28 +0100, Bj?rn Forsman spake thusly:
Quoted 7 lines · Yann E. MORIN
Quoted 6 lines
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 5 lines
Buildroot unexports
PKG_CONFIG_PATHin the top-levelMakefilefor purity reasons. But it has an unfortunate side-effect in that "make menuconfig" will not (necessarily) be able to pick up ncurses via host pkg-config, breaking "make menuconfig" on systems where ncurses is installed in a non-standard location.[--SNIP--]
Quoted 13 lines
Quoted 13 lines
Makefile export HOSTCFLAGS · line 699
Quoted 9 lines
Makefile +4
-1@@ -692,7 +693,10 @@ export HOSTCFLAGS $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog - $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) + (export PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH); \ + $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \ + obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F) \ + )Well, you do not need this convoluted sub-shell. Just pass the variable as a make option:
Quoted 5 lines
Quoted 1 line
$(MAKE) PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)I tested that. It doesn't work. I guess when the variable is given on the command line to make (not 'exported') it is not available to sub-processes that make spawns.
Quoted 6 lines
In that case, just put it in front of it, like:
PKG_CONFIG_PATH=$(HOST_PKG_CONFIG_PATH) $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" obj=$(@D) -C $(CONFIG) -f Makefile.br $(@F)This will put
PKG_CONFIG_PATHin the environment just for the duration of the sub-make.
Ah, good point. That works and looks cleaner. Will update.
- Bj?rn
v2 cover Portability fixes for "make menuconfig"
In reply to Bjørn ForsmanBj?rn, All,
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 8 lines
Here are two portability fixes needed to be able to run "make menuconfig" on NixOS[1].
[1]: http://nixos.org/
Bj?rn Forsman (2):
kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Makefile: pass hostPKG_CONFIG_PATHat "make menuconfig" time
I think the order should be the other way around, because you need the latter for the former to work.
Regards,
Yann E. MORIN.
Quoted 15 lines
Makefile | 6 ++- ...dialog-get-ncurses-CFLAGS-with-pkg-config.patch | 50 ++++++++++++++++++++++ support/kconfig/patches/series | 1 + 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 support/kconfig/patches/17-kconfig-lxdialog-get-ncurses-CFLAGS-with-pkg-config.patchSignature · 8 lines
Changes v1 -> v2: - make the kconfig/lxdialog patch a separate patch file, instead of modifying the kconfig sources (which are synced with linux from time to time). Suggested by Thomas P. _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
v2 cover Portability fixes for "make menuconfig"
Quoted 6 lines · Yann E. MORIN
Bj?rn, All,
On 2015-01-01 21:54 +0100, Bj?rn Forsman spake thusly:
Quoted 3 lines
Here are two portability fixes needed to be able to run "make menuconfig" on NixOS[1].
Quoted 8 lines
Quoted 5 lines
[1]: http://nixos.org/
Bj?rn Forsman (2):
kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Makefile: pass hostPKG_CONFIG_PATHat "make menuconfig" timeI think the order should be the other way around, because you need the latter for the former to work.
In my opinion, both orders are equally correct. But I'll change it for you :-)
- Bj?rn