All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] Portability fixes for "make menuconfig"
@ 2014-10-26 13:17 Bjørn Forsman
  2014-10-26 13:17 ` [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config Bjørn Forsman
  2014-10-26 13:17 ` [Buildroot] [PATCH 2/2] Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time Bjørn Forsman
  0 siblings, 2 replies; 12+ messages in thread
From: Bjørn Forsman @ 2014-10-26 13:17 UTC (permalink / raw)
  To: buildroot

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

-- 
2.1.2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-10-26 13:17 [Buildroot] [PATCH 0/2] Portability fixes for "make menuconfig" Bjørn Forsman
@ 2014-10-26 13:17 ` Bjørn Forsman
  2014-10-26 15:41   ` Thomas Petazzoni
  2014-10-26 13:17 ` [Buildroot] [PATCH 2/2] Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time Bjørn Forsman
  1 sibling, 1 reply; 12+ messages in thread
From: Bjørn Forsman @ 2014-10-26 13:17 UTC (permalink / raw)
  To: buildroot

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.
]

Signed-off-by: Bj?rn Forsman <bjorn.forsman@gmail.com>
---
 support/kconfig/lxdialog/check-lxdialog.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 support/kconfig/lxdialog/check-lxdialog.sh

diff --git a/support/kconfig/lxdialog/check-lxdialog.sh b/support/kconfig/lxdialog/check-lxdialog.sh
old mode 100644
new mode 100755
index 4789b72..3ce0a23
--- a/support/kconfig/lxdialog/check-lxdialog.sh
+++ b/support/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.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/2] Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
  2014-10-26 13:17 [Buildroot] [PATCH 0/2] Portability fixes for "make menuconfig" Bjørn Forsman
  2014-10-26 13:17 ` [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config Bjørn Forsman
@ 2014-10-26 13:17 ` Bjørn Forsman
  1 sibling, 0 replies; 12+ messages in thread
From: Bjørn Forsman @ 2014-10-26 13:17 UTC (permalink / raw)
  To: buildroot

Buildroot 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/

Signed-off-by: Bj?rn Forsman <bjorn.forsman@gmail.com>
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 907a0fc..afabaf7 100644
--- a/Makefile
+++ b/Makefile
@@ -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))
 
-- 
2.1.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-10-26 13:17 ` [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config Bjørn Forsman
@ 2014-10-26 15:41   ` Thomas Petazzoni
  2014-10-26 16:06     ` Bjørn Forsman
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2014-10-26 15:41 UTC (permalink / raw)
  To: buildroot

Dear Bj?rn Forsman,

On Sun, 26 Oct 2014 14:17:25 +0100, Bj?rn Forsman wrote:
> 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.
> ]
> 
> Signed-off-by: Bj?rn Forsman <bjorn.forsman@gmail.com>
> ---
>  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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-10-26 15:41   ` Thomas Petazzoni
@ 2014-10-26 16:06     ` Bjørn Forsman
  2014-10-26 21:16       ` Bjørn Forsman
  0 siblings, 1 reply; 12+ messages in thread
From: Bjørn Forsman @ 2014-10-26 16:06 UTC (permalink / raw)
  To: buildroot

On 26 October 2014 16:41, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
[...]
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-10-26 16:06     ` Bjørn Forsman
@ 2014-10-26 21:16       ` Bjørn Forsman
  2014-10-26 21:24         ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Bjørn Forsman @ 2014-10-26 21:16 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On 26 October 2014 17:06, Bj?rn Forsman <bjorn.forsman@gmail.com> wrote:
> On 26 October 2014 16:41, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
> [...]
>> 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.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-10-26 21:16       ` Bjørn Forsman
@ 2014-10-26 21:24         ` Thomas Petazzoni
  2014-10-26 21:45           ` Bjørn Forsman
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2014-10-26 21:24 UTC (permalink / raw)
  To: buildroot

Dear Bj?rn Forsman,

On Sun, 26 Oct 2014 22:16:33 +0100, Bj?rn Forsman wrote:

> 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?

> 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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-10-26 21:24         ` Thomas Petazzoni
@ 2014-10-26 21:45           ` Bjørn Forsman
  2014-11-05  7:10             ` Bjørn Forsman
  0 siblings, 1 reply; 12+ messages in thread
From: Bjørn Forsman @ 2014-10-26 21:45 UTC (permalink / raw)
  To: buildroot

On 26 October 2014 22:24, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Bj?rn Forsman,
>
> On Sun, 26 Oct 2014 22:16:33 +0100, Bj?rn Forsman wrote:
>
>> 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?

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

>> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-10-26 21:45           ` Bjørn Forsman
@ 2014-11-05  7:10             ` Bjørn Forsman
  2014-11-05  7:15               ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Bjørn Forsman @ 2014-11-05  7:10 UTC (permalink / raw)
  To: buildroot

Hi Yann,

On 26 October 2014 22:45, Bj?rn Forsman <bjorn.forsman@gmail.com> wrote:
> On 26 October 2014 22:24, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Dear Bj?rn Forsman,
>>
>> On Sun, 26 Oct 2014 22:16:33 +0100, Bj?rn Forsman wrote:
>>
>>> 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?
>
> 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
>
>>> 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

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-11-05  7:10             ` Bjørn Forsman
@ 2014-11-05  7:15               ` Thomas Petazzoni
  2014-12-13 19:04                 ` Bjørn Forsman
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2014-11-05  7:15 UTC (permalink / raw)
  To: buildroot

Dear Bj?rn Forsman,

On Wed, 5 Nov 2014 08:10:26 +0100, Bj?rn Forsman wrote:

> 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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-11-05  7:15               ` Thomas Petazzoni
@ 2014-12-13 19:04                 ` Bjørn Forsman
  2015-01-02 16:01                   ` Bjørn Forsman
  0 siblings, 1 reply; 12+ messages in thread
From: Bjørn Forsman @ 2014-12-13 19:04 UTC (permalink / raw)
  To: buildroot

On 5 November 2014 at 08:15, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Bj?rn Forsman,
>
> On Wed, 5 Nov 2014 08:10:26 +0100, Bj?rn Forsman wrote:
>
>> 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.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  2014-12-13 19:04                 ` Bjørn Forsman
@ 2015-01-02 16:01                   ` Bjørn Forsman
  0 siblings, 0 replies; 12+ messages in thread
From: Bjørn Forsman @ 2015-01-02 16:01 UTC (permalink / raw)
  To: buildroot

On 13 December 2014 at 20:04, Bj?rn Forsman <bjorn.forsman@gmail.com> wrote:
[...]
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-01-02 16:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-26 13:17 [Buildroot] [PATCH 0/2] Portability fixes for "make menuconfig" Bjørn Forsman
2014-10-26 13:17 ` [Buildroot] [PATCH 1/2] kconfig/lxdialog: get ncurses CFLAGS with pkg-config Bjørn Forsman
2014-10-26 15:41   ` Thomas Petazzoni
2014-10-26 16:06     ` Bjørn Forsman
2014-10-26 21:16       ` Bjørn Forsman
2014-10-26 21:24         ` Thomas Petazzoni
2014-10-26 21:45           ` Bjørn Forsman
2014-11-05  7:10             ` Bjørn Forsman
2014-11-05  7:15               ` Thomas Petazzoni
2014-12-13 19:04                 ` Bjørn Forsman
2015-01-02 16:01                   ` Bjørn Forsman
2014-10-26 13:17 ` [Buildroot] [PATCH 2/2] Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time Bjørn Forsman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.