[Buildroot] [PATCH v2 2/2] Makefile: pass host PKG_CONFIG_PATH at "make menuconfig" time
Bjørn Forsman
bjorn.forsman at gmail.com
Fri Jan 2 23:32:43 UTC 2015
On 2 January 2015 at 22:39, Yann E. MORIN <yann.morin.1998 at free.fr> wrote:
> Bjørn, All,
>
> On 2015-01-02 22:28 +0100, Bjørn Forsman spake thusly:
>> On 2 January 2015 at 17:16, Yann E. MORIN <yann.morin.1998 at free.fr> wrote:
>> > On 2015-01-01 21:54 +0100, Bjørn Forsman spake thusly:
>> >> 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.
> [--SNIP--]
>> >> @@ -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)
>>
>> 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.
Ah, good point. That works and looks cleaner. Will update.
- Bjørn
More information about the buildroot
mailing list