[oe] gobject-introspection: pkg-config does not pick correct paths (was: pkg-config does not honor `PKG_CONFIG_SYSROOT_DIR`)

Paul Menzel paulepanter at users.sourceforge.net
Sun Oct 10 23:02:33 UTC 2010


Am Montag, den 11.10.2010, 00:47 +0200 schrieb Frederik Sdun:
> * Paul Menzel <paulepanter at users.sourceforge.net> [11.10.2010 00:17]:
> > 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 wrote:
> > 
> > […]
> > 
> > > > 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.
> > 
> > Unfortunately I could not figure out, what is going on. My suspicion is,
> > that the function `shell` of the Makefile does not honor the environment
> > variables.
> > 
> > I tried to change the syntax to
> > 
> >         GLIB_INCLUDEDIR := `$(PKG_CONFIG) --variable=includedir glib-2.0`/glib-2.0
> >         GLIB_LIBDIR := `$(PKG_CONFIG) --variable=libdir glib-2.0`
> > 
> > (`git grep PKG_CONFIG` to see that this is used in some places) or
> > 
> >         GLIB_INCLUDEDIR=$(shell /oe/build-minimal-libc/minimal-dev/sysroots/i686-linux/usr/bin/pkg-config --variable=includedir glib-2.0)/glib-2.0
> >         GLIB_LIBDIR := $(shell /oe/build-minimal-libc/minimal-dev/sysroots/i686-linux/usr/bin/pkgconfig --variable=libdir glib-2.0)
> > 
> > but although the second one worked on the command line, it did not work
> > and did not return any path at all. (I edited `Makefile` in `work` and
> > executed `run.do_compile.…` manually.)
> > 
> > I also looked at the changes of pkg-config [1] after 0.23, but could not
> > find anything applicable to this problem.

> > [1] http://cgit.freedesktop.org/pkg-config/tree/NEWS
>
> I think the problem is, that pkg-config --variable is used here, which
> doesn't expand the paths.
> I try to provide a patch, which make it possible to specify the sysroot
> and uses pkg-config --cflags-only-I for the flags

That is a good idea. But remember that the staged package config files
have the full path included already.

        $ /oe/build-minimal-libc/minimal-dev/sysroots/i686-linux/usr/bin/pkg-config --variable=libdir glib-2.0 
        /oe/build-minimal-libc/minimal-dev/sysroots/i686-linux/usr/lib

or

        $ PKG_CONFIG_DIR="/home/paul/oe/build-minimal-libc/minimal-dev/sysroots/armv7a-oe-linux-gnueabi/usr/lib/pkgconfig" ~/oe/build-minimal-libc/minimal-dev/sysroots/i686-linux/usr/bin/pkg-config --variable=libdir glib-2.0
        /oe/build-minimal-libc/minimal-dev/sysroots/i686-linux/usr/lib


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/20101011/ee7501ae/attachment-0002.sig>


More information about the Openembedded-devel mailing list