[oe] Preferred handling of pkg-config in cross compile environments.

Paul Menzel paulepanter at users.sourceforge.net
Sun Oct 10 18:36:59 UTC 2010


Am Sonntag, den 10.10.2010, 11:11 -0700 schrieb Chris Larson:
> On Sun, Oct 10, 2010 at 10:38 AM, Paul Menzel wrote:
> 
> > Am Sonntag, den 10.10.2010, 10:09 -0700 schrieb Chris Larson:
> > > On Sun, Oct 10, 2010 at 10:05 AM, Paul Menzel <
> > > paulepanter at users.sourceforge.net> wrote:
> > >
> > > > I stumbled upon several programs who call plain `pkg-config` [1][2].
> > > >
> > > > Is the following statement correct?
> > > >
> > > > To be able to cross compile programs correctly, the build files are
> > > > supposed to use the environment variable `PKG_CONFIG` and only call
> > > > pkg-config directly if `PKG_CONFIG` is empty.
> > > >
> > > >        if test -z "${PKG_CONFIG}"; then
> > > >            PKG_CONFIG="pkg-config"
> > > >
> > > > If you agree I would note that somewhere in the Wiki, so that upstream
> > > > can be pointed to some documentation and search the Web will result in
> > > > some useful results.
> > > >
> > >
> > > Can you explain why running just 'pkg-config' is a problem?  It seems to
> > > work just fine..
> >
> > Do you have a minimal build host. Some problems do not surface if some
> > files are installed locally on the build host.
> >
> > Please take a look at [2] I forgot to add in my original message. I have
> > no clue why the staged(?) pkg-config behaves differently than the local
> > installed one. Does it search the paths in a different order?
> 
> pkgconfig-native searches its own built in path (the one in the native
> sysroot) along with the paths in PKG_CONFIG_PATH.  None of those are outside
> of the sysroots.

Well obviously something is not working then, since the bug is there as
documented in [2].

> > Secondly I am having a similar problem with `gobject-introspection`
> > where [1]
> >
> >        gir/Makefile.am:GLIB_INCLUDEDIR=$(shell pkg-config
> > --variable=includedir glib-2.0)/glib-2.0
> >        gir/Makefile.am:GLIB_LIBDIR=$(shell pkg-config --variable=libdir
> > glib-2.0)
> >
> > returns the wrong path.
> >
> >        Making all in gir
> >        make[2]: Entering directory
> > `/oe/build-minimal-libc/minimal-dev/work/armv7a-oe-linux-gnueabi/gobject-introspection-0.9.12-r0/gobject-introspection-0.9.12/gir'
> >        make[2]: *** No rule to make target
> > `/usr/lib/glib-2.0/include/glibconfig.h', needed by `GLib-2.0.gir'.  Stop.
> >        make[2]: Leaving directory
> > `/oe/build-minimal-libc/minimal-dev/work/armv7a-oe-linux-gnueabi/gobject-introspection-0.9.12-r0/gobject-introspection-0.9.12/gir'
> >        make[1]: *** [all-recursive] Error 1
>
> /usr/{lib,include} paths are mangled by pkg-config using
> PKG_CONFIG_SYSROOT_DIR.  If that's not happening here, that's a bug that
> should be investigated, but I fail to see how setting PKG_CONFIG is going to
> magically fix it.

I do not see it either. But Khem’s patch helped [2].


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20101010/9bf1c650/attachment-0002.sig>


More information about the Openembedded-devel mailing list