Portability fixes for "make menuconfig"
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 +++++- support/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 support/kconfig/lxdialog/check-lxdialog.sh
Signature · 1 line
2.1.2
PATCH 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 (will be 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
(1) there was a conflict in one of the Buildroot kconfg patches (against linux 3.18-rc1), (2) adding this patch won't create any conflict next time someone re-syncs kconfig with linux and (3) because this is easier to review.
]
--- support/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 support/kconfig/lxdialog/check-lxdialog.sh
support/kconfig/lxdialog/check-lxdialog.sh +5 -1
@@ -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
Signature · 1 line
2.1.2
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Dear Bj?rn Forsman,
Quoted 17 lines · Bj?rn Forsman
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 (will be part of linux v3.18):
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=be8af2d54a66911693eddc556e4f7a866670082bI'm adding this instead of doing a full upstream kconfig sync because
(1) there was a conflict in one of the Buildroot kconfg patches (against linux 3.18-rc1), (2) adding this patch won't create any conflict next time someone re-syncs kconfig with linux and (3) because this is easier to review.
]
Quoted 5 lines
Signed-off-by Bj?rn Forsman <[email protected]>--- support/kconfig/lxdialog/check-lxdialog.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 support/kconfig/lxdialog/check-lxdialog.sh
Hum, whenever we do change in the kconfig code, we like them to be part of the patch series we have. See support/kconfig/README.buildroot for details. In this case, indeed, the fix is already upstream. But still, we would like to keep separated the base kconfig version (copied as-is from the kernel) from any further modification we have made.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
On 26 October 2014 16:41, Thomas Petazzoni
<[email protected]> wrote:
[...]
Quoted 7 lines
Hum, whenever we do change in the kconfig code, we like them to be part of the patch series we have. See support/kconfig/README.buildroot for details. In this case, indeed, the fix is already upstream. But still, we would like to keep separated the base kconfig version (copied as-is from the kernel) from any further modification we have made.
Thanks!
Ok. I understand. I'll try to do the re-sync as described in support/kconfig/README.buildroot then.
Best regards,
Bj?rn Forsman
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Hi Thomas,
Quoted 9 lines · Bj?rn Forsman
On 26 October 2014 16:41, Thomas Petazzoni
<[email protected]> wrote:
[...]Quoted 6 lines
Hum, whenever we do change in the kconfig code, we like them to be part of the patch series we have. See support/kconfig/README.buildroot for details. In this case, indeed, the fix is already upstream. But still, we would like to keep separated the base kconfig version (copied as-is from the kernel) from any further modification we have made.
Quoted 4 lines
Quoted 1 line
Thanks!
Ok. I understand. I'll try to do the re-sync as described in support/kconfig/README.buildroot then.
I've tried to re-sync with linux 3.18-rc1. Without luck. Quite frustrating. Something is changed upstream and I don't (yet) manage to fill in the missing bits of Make code to have Buildroot's "make menuconfig" work with these changes.
Would it be acceptable to add the patch posted in this thread directly to support/kconfig/patches/ instead?
Best regards,
Bj?rn Forsman
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Dear Bj?rn Forsman,
Quoted 4 lines · Bj?rn Forsman
I've tried to re-sync with linux 3.18-rc1. Without luck. Quite frustrating. Something is changed upstream and I don't (yet) manage to fill in the missing bits of Make code to have Buildroot's "make menuconfig" work with these changes.
Argh :/
At some point, Yann E. Morin was very active on the kbuild/kconfig code in the upstream Linux kernel. Maybe he can help there?
Quoted 2 lines
Would it be acceptable to add the patch posted in this thread directly to support/kconfig/patches/ instead?
Yes, it is acceptable. Especially if the patch description mentions that it's already upstream, it will help when we'll bump the kconfig code.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Quoted 9 lines · Thomas Petazzoni
Dear Bj?rn Forsman,
Quoted 4 lines · Bj?rn Forsman
I've tried to re-sync with linux 3.18-rc1. Without luck. Quite frustrating. Something is changed upstream and I don't (yet) manage to fill in the missing bits of Make code to have Buildroot's "make menuconfig" work with these changes.
Quoted 4 lines
Argh :/
At some point, Yann E. Morin was very active on the kbuild/kconfig code in the upstream Linux kernel. Maybe he can help there?
Sure. For someone familiar with this code, it is probably/hopefully trivial :-)
For a bit of background, it's support/kconfig/patches/06-br-build-system-integration.patch that doesn't apply, due to upstream (linux) commit 022af62d0190e1e3db63c19aeb5f51ae0612cd71 removing the code that the patch touches.
I started out by skipping 06-br-build-system-integration.patch, but I'm unable to glue the stuff back together. This is what happens now:
$ make menuconfig mkdir -p /home/bfo/buildroot/output/build/buildroot-config/lxdialog make CC="/run/current-system/sw/bin/gcc" HOSTCC="/run/current-system/sw/bin/gcc" obj=/home/bfo/buildroot/output/build/buildroot-config -C support/kconfig -f Makefile.br mconf make[1]: Entering directory `/home/bfo/buildroot/support/kconfig' make[1]: *** No rule to make target `/home/bfo/buildroot/output/build/buildroot-config/.tmp_gtkcheck', needed by `/home/bfo/buildroot/output/build/buildroot-config/gconf.o'. Stop. make[1]: Leaving directory `/home/bfo/buildroot/support/kconfig' make: *** [/home/bfo/buildroot/output/build/buildroot-config/mconf] Error 2
Quoted 6 lines
Quoted 2 lines
Would it be acceptable to add the patch posted in this thread directly to support/kconfig/patches/ instead?
Yes, it is acceptable. Especially if the patch description mentions that it's already upstream, it will help when we'll bump the kconfig code.
Great! But I'll wait and see if Yann has some inputs before going this route.
Best regards,
Bj?rn Forsman
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Hi Yann,
Quoted 44 lines · Bj?rn Forsman
Quoted 9 lines · Thomas Petazzoni
Dear Bj?rn Forsman,
Quoted 4 lines · Bj?rn Forsman
I've tried to re-sync with linux 3.18-rc1. Without luck. Quite frustrating. Something is changed upstream and I don't (yet) manage to fill in the missing bits of Make code to have Buildroot's "make menuconfig" work with these changes.
Quoted 4 lines
Argh :/
At some point, Yann E. Morin was very active on the kbuild/kconfig code in the upstream Linux kernel. Maybe he can help there?
Sure. For someone familiar with this code, it is probably/hopefully trivial :-)
For a bit of background, it's
support/kconfig/patches/06-br-build-system-integration.patchthat doesn't apply, due to upstream (linux) commit022af62d0190e1e3db63c19aeb5f51ae0612cd71removing the code that the patch touches.I started out by skipping 06-br-build-system-integration.patch, but I'm unable to glue the stuff back together. This is what happens now:
$ make menuconfig mkdir -p /home/bfo/buildroot/output/build/buildroot-config/lxdialog make CC="/run/current-system/sw/bin/gcc" HOSTCC="/run/current-system/sw/bin/gcc" obj=/home/bfo/buildroot/output/build/buildroot-config -C support/kconfig -f Makefile.br mconf make[1]: Entering directory `/home/bfo/buildroot/support/kconfig' make[1]: *** No rule to make target `/home/bfo/buildroot/output/build/buildroot-config/.tmp_gtkcheck', needed by `/home/bfo/buildroot/output/build/buildroot-config/gconf.o'. Stop. make[1]: Leaving directory `/home/bfo/buildroot/support/kconfig' make: *** [/home/bfo/buildroot/output/build/buildroot-config/mconf] Error 2Quoted 3 lines
Quoted 2 lines
Would it be acceptable to add the patch posted in this thread directly to support/kconfig/patches/ instead?
Quoted 8 lines
Quoted 3 lines
Yes, it is acceptable. Especially if the patch description mentions that it's already upstream, it will help when we'll bump the kconfig code.
Great! But I'll wait and see if Yann has some inputs before going this route.
Best regards,
Bj?rn Forsman
Are you able to help with synchronizing linux/upstream kconfig with Buildroot? (See my failed attempt above.)
If you have no time, just let me know, and I'll add a patch in support/kconfig/patches/ instead of doing a full sync.
Best regards,
Bj?rn Forsman
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Dear Bj?rn Forsman,
Quoted 5 lines · Bj?rn Forsman
Are you able to help with synchronizing linux/upstream kconfig with Buildroot? (See my failed attempt above.)
If you have no time, just let me know, and I'll add a patch in support/kconfig/patches/ instead of doing a full sync.
I personally don't have the time this week, and I also know Yann is very busy as well this week. We might be able to help with that, but not before this WE or next week.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
Quoted 7 lines · Thomas Petazzoni
Dear Bj?rn Forsman,
Quoted 3 lines · Bj?rn Forsman
Are you able to help with synchronizing linux/upstream kconfig with Buildroot? (See my failed attempt above.)
Quoted 6 lines
Quoted 2 lines
If you have no time, just let me know, and I'll add a patch in support/kconfig/patches/ instead of doing a full sync.
I personally don't have the time this week, and I also know Yann is very busy as well this week. We might be able to help with that, but not before this WE or next week.
It's been a few weeks now, just thought I'd check in and see if you guys (Thomas, Yann) have some time now to look at synchronizing kconfig with upstream.
I'm in no rush, so just let me know whether you'd like to postpone or if I should just add this change as a separate patch file in the support/kconfig/patches/ directory.
Best regards,
Bj?rn Forsman
PATCH 1/2 kconfig/lxdialog: get ncurses CFLAGS with pkg-config
On 13 December 2014 at 20:04, Bj?rn Forsman <[email protected]> wrote:
[...]
Quoted 7 lines
It's been a few weeks now, just thought I'd check in and see if you guys (Thomas, Yann) have some time now to look at synchronizing kconfig with upstream.
I'm in no rush, so just let me know whether you'd like to postpone or if I should just add this change as a separate patch file in the support/kconfig/patches/ directory.
I take it that "no answer" means "no time" :-)
I re-sent this patch (series) with the kconfig stuff as a separate patch file in support/kconfig/patches/.
Best regards,
Bj?rn Forsman
PATCH 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
@@ -263,6 +263,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
@@ -691,7 +692,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.2