diff mbox

pkgconf: Add a symlink to the GNU_TARGET_NAME-pkg-config

Message ID 1456770170-6326-1-git-send-email-jer@airfi.aero
State Rejected
Headers show

Commit Message

Jeroen Roovers Feb. 29, 2016, 6:22 p.m. UTC
Lots of packages start to call pkg-config "properly" and run into
 failures like this:

*
* System Logging Utilities
*
syslogd (SYSLOGD) [N/y/?] n
klogd (KLOGD) [N/y/?] n
logger (LOGGER) [Y/n/?] y
make[2]: .../output/host/usr/bin/arm-buildroot-linux-gnueabihf-pkg-config: Command not found
make[2]: .../output/host/usr/bin/arm-buildroot-linux-gnueabihf-pkg-config: Command not found
make[1]: Leaving directory '.../output/build/busybox-1.24.1'

 By setting a symlink to the expected target we might even solve some
 real problems.
---
 package/pkgconf/pkgconf.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Bernd Kuhls Feb. 29, 2016, 7:19 p.m. UTC | #1
Am Mon, 29 Feb 2016 19:22:50 +0100 schrieb Jeroen Roovers:

>  By setting a symlink to the expected target we might even solve some
>  real problems.

Hi,

two years ago I proposed a similar patch, which was rejected:
http://patchwork.ozlabs.org/patch/312273/

Regards, Bernd
Thomas Petazzoni Feb. 29, 2016, 8:35 p.m. UTC | #2
Hello,

On Mon, 29 Feb 2016 20:19:58 +0100, Bernd Kuhls wrote:

> >  By setting a symlink to the expected target we might even solve some
> >  real problems.
> 
> two years ago I proposed a similar patch, which was rejected:
> http://patchwork.ozlabs.org/patch/312273/

If we were to do this, then I would prefer to completely remove
$(HOST_DIR)/usr/bin/pkg-config, and only have
$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-pkg-config.

What I dislike with the current setup is that if you add
$(HOST_DIR)/usr/bin to your PATH, then any call to pkg-config returns
values that are valid only when cross-compiling, which is not
necessarily what one would expect.

However, doing this change means that any configure script or Makefile
that calls pkg-config directly would no longer find our pkg-config.

Best regards,

Thomas
Peter Korsgaard Feb. 29, 2016, 11:09 p.m. UTC | #3
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Hello,
 > On Mon, 29 Feb 2016 20:19:58 +0100, Bernd Kuhls wrote:

 >> >  By setting a symlink to the expected target we might even solve some
 >> >  real problems.
 >> 
 >> two years ago I proposed a similar patch, which was rejected:
 >> http://patchwork.ozlabs.org/patch/312273/

 > If we were to do this, then I would prefer to completely remove
 > $(HOST_DIR)/usr/bin/pkg-config, and only have
 > $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-pkg-config.

 > What I dislike with the current setup is that if you add
 > $(HOST_DIR)/usr/bin to your PATH, then any call to pkg-config returns
 > values that are valid only when cross-compiling, which is not
 > necessarily what one would expect.

On the other hand, the situations where you add it to the path are often
where you _DO_ want to cross compile.

 > However, doing this change means that any configure script or Makefile
 > that calls pkg-config directly would no longer find our pkg-config.

Indeed, that would afaik require quite some patching to fix.
Thomas Petazzoni March 1, 2016, 8:14 a.m. UTC | #4
Peter,

On Tue, 01 Mar 2016 00:09:34 +0100, Peter Korsgaard wrote:

>  > What I dislike with the current setup is that if you add
>  > $(HOST_DIR)/usr/bin to your PATH, then any call to pkg-config returns
>  > values that are valid only when cross-compiling, which is not
>  > necessarily what one would expect.
> 
> On the other hand, the situations where you add it to the path are often
> where you _DO_ want to cross compile.

Indeed, but you often end up doing both cross-compilation and native
compilation, and it's pretty easy to get confused by a pkg-config
returning absurd values.

Thomas
Peter Korsgaard March 1, 2016, 8:15 a.m. UTC | #5
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> On the other hand, the situations where you add it to the path are
 >> often where you _DO_ want to cross compile.

 > Indeed, but you often end up doing both cross-compilation and native
 > compilation, and it's pretty easy to get confused by a pkg-config
 > returning absurd values.

Sure, but you would get similary confused if you ended up using the
host pkg-config when cross compiling.
Arnout Vandecappelle March 1, 2016, 9:12 p.m. UTC | #6
On 02/29/16 21:35, Thomas Petazzoni wrote:
[snip]
> What I dislike with the current setup is that if you add
> $(HOST_DIR)/usr/bin to your PATH, then any call to pkg-config returns
> values that are valid only when cross-compiling, which is not
> necessarily what one would expect.

 For exactly this reason I would like to introduce a config-script directory,
e.g. $(HOST_DIR)/usr/cross-bin. In this directory we would put the
cross-pkg-config and the fixed up config scripts we now search for in
$(STAGING_DIR)/usr/bin.

 Regards,
 Arnout

> 
> However, doing this change means that any configure script or Makefile
> that calls pkg-config directly would no longer find our pkg-config.
> 
> Best regards,
> 
> Thomas
>
Thomas Petazzoni March 2, 2016, 8:25 p.m. UTC | #7
Dear Jeroen Roovers,

On Mon, 29 Feb 2016 19:22:50 +0100, Jeroen Roovers wrote:
>  Lots of packages start to call pkg-config "properly" and run into
>  failures like this:
> 
> *
> * System Logging Utilities
> *
> syslogd (SYSLOGD) [N/y/?] n
> klogd (KLOGD) [N/y/?] n
> logger (LOGGER) [Y/n/?] y
> make[2]: .../output/host/usr/bin/arm-buildroot-linux-gnueabihf-pkg-config: Command not found
> make[2]: .../output/host/usr/bin/arm-buildroot-linux-gnueabihf-pkg-config: Command not found
> make[1]: Leaving directory '.../output/build/busybox-1.24.1'

I think we should solve this specific problem by passing the PKG_CONFIG
in the Busybox environment.

Best regards,

Thomas
Yann E. MORIN March 18, 2016, 5:24 p.m. UTC | #8
Arnout, All,

On 2016-03-01 22:12 +0100, Arnout Vandecappelle spake thusly:
> On 02/29/16 21:35, Thomas Petazzoni wrote:
> [snip]
> > What I dislike with the current setup is that if you add
> > $(HOST_DIR)/usr/bin to your PATH, then any call to pkg-config returns
> > values that are valid only when cross-compiling, which is not
> > necessarily what one would expect.
> 
>  For exactly this reason I would like to introduce a config-script directory,
> e.g. $(HOST_DIR)/usr/cross-bin. In this directory we would put the
> cross-pkg-config and the fixed up config scripts we now search for in
> $(STAGING_DIR)/usr/bin.

Like this:
    https://git.buildroot.org/~ymorin/git/buildroot/log/?h=yem/foo-config-in-PATH

Last I sent this series, Thomas was not fond of it, IIRC...

    http://lists.busybox.net/pipermail/buildroot/2015-December/thread.html#147891
    http://lists.busybox.net/pipermail/buildroot/2015-December/147927.html
    and ensuing mails...

BTW, you were in Cc for that series. ;-)

Regards,
Yann E. MORIN.

>  Regards,
>  Arnout
> 
> > 
> > However, doing this change means that any configure script or Makefile
> > that calls pkg-config directly would no longer find our pkg-config.
> > 
> > Best regards,
> > 
> > Thomas
> > 
> 
> 
> -- 
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Yann E. MORIN March 18, 2016, 5:25 p.m. UTC | #9
Thomas, All,

On 2016-03-02 21:25 +0100, Thomas Petazzoni spake thusly:
> On Mon, 29 Feb 2016 19:22:50 +0100, Jeroen Roovers wrote:
> >  Lots of packages start to call pkg-config "properly" and run into
> >  failures like this:
> > 
> > *
> > * System Logging Utilities
> > *
> > syslogd (SYSLOGD) [N/y/?] n
> > klogd (KLOGD) [N/y/?] n
> > logger (LOGGER) [Y/n/?] y
> > make[2]: .../output/host/usr/bin/arm-buildroot-linux-gnueabihf-pkg-config: Command not found
> > make[2]: .../output/host/usr/bin/arm-buildroot-linux-gnueabihf-pkg-config: Command not found
> > make[1]: Leaving directory '.../output/build/busybox-1.24.1'
> 
> I think we should solve this specific problem by passing the PKG_CONFIG
> in the Busybox environment.

Should we not always pass PKG_CONFIG in the target environment, instead
of per-package?

Regards,
Yann E. MORIN.

> Best regards,
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Arnout Vandecappelle March 18, 2016, 9:14 p.m. UTC | #10
On 03/18/16 18:24, Yann E. MORIN wrote:
> Arnout, All,
>
> On 2016-03-01 22:12 +0100, Arnout Vandecappelle spake thusly:
>> On 02/29/16 21:35, Thomas Petazzoni wrote:
>> [snip]
>>> What I dislike with the current setup is that if you add
>>> $(HOST_DIR)/usr/bin to your PATH, then any call to pkg-config returns
>>> values that are valid only when cross-compiling, which is not
>>> necessarily what one would expect.
>>
>>   For exactly this reason I would like to introduce a config-script directory,
>> e.g. $(HOST_DIR)/usr/cross-bin. In this directory we would put the
>> cross-pkg-config and the fixed up config scripts we now search for in
>> $(STAGING_DIR)/usr/bin.
>
> Like this:
>      https://git.buildroot.org/~ymorin/git/buildroot/log/?h=yem/foo-config-in-PATH
>
> Last I sent this series, Thomas was not fond of it, IIRC...

  I re-read the thread and couldn't find a real argument from Thomas :-)

>
>      http://lists.busybox.net/pipermail/buildroot/2015-December/thread.html#147891
>      http://lists.busybox.net/pipermail/buildroot/2015-December/147927.html
>      and ensuing mails...
>
> BTW, you were in Cc for that series. ;-)

  Yes, it is still in my list of 500 mails marked "I really should reply to 
this, but it's going to take a bit of time so let's first do the easy stuff". 
Thomas DS can explain you all about that :-P

  Regards,
  Arnout


>
> Regards,
> Yann E. MORIN.
>
>>   Regards,
>>   Arnout
>>
>>>
>>> However, doing this change means that any configure script or Makefile
>>> that calls pkg-config directly would no longer find our pkg-config.
>>>
>>> Best regards,
>>>
>>> Thomas
>>>
>>
>>
>> --
>> Arnout Vandecappelle                          arnout at mind be
>> Senior Embedded Software Architect            +32-16-286500
>> Essensium/Mind                                http://www.mind.be
>> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
>> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
>> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
>> _______________________________________________
>> buildroot mailing list
>> buildroot@busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>
diff mbox

Patch

diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk
index c8b0cba..a183a1c 100644
--- a/package/pkgconf/pkgconf.mk
+++ b/package/pkgconf/pkgconf.mk
@@ -22,6 +22,7 @@  define HOST_PKGCONF_INSTALL_WRAPPER
 	$(SED) 's,@PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \
 		-e 's,@STAGING_DIR@,$(STAGING_DIR),' \
 		$(HOST_DIR)/usr/bin/pkg-config
+	ln -sf $(HOST_DIR)/usr/bin/pkg-config $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-pkg-config
 endef
 
 define HOST_PKGCONF_STATIC