Bug 59435 - pkg-config configure script should look for host-pkg-config before pkg-config
Summary: pkg-config configure script should look for host-pkg-config before pkg-config
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Dan Nicholson
QA Contact:
Depends on:
Reported: 2013-01-15 20:09 UTC by Ambroz Bizjak
Modified: 2013-01-17 13:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

configure.ac patch (637 bytes, text/plain)
2013-01-15 20:09 UTC, Ambroz Bizjak

Note You need to log in before you can comment on or make changes to this bug.
Description Ambroz Bizjak 2013-01-15 20:09:29 UTC
Created attachment 73115 [details]
configure.ac patch

The configure script of pkg-config tries to use pkg-config to locate GLib. The problem is that it immediately tries "pkg-config"; it should first try "${host}-pkg-config", in case pkg-config is being cross-compiled, to pick up GLib in the sysroot and not the one in the build system.

Note: ${host}-pkg-config is normally set up by the distribution to wrap pkg-config via PKG_CONFIG_SYSROOT_DIR.
Comment 1 Dan Nicholson 2013-01-16 15:30:36 UTC
Good catch. I think the more appropriate autoconf way to handle this would be to change the check to:

AC_CHECK_TOOL([PKG_CONFIG], [pkg-config], [])

Can you try that out?
Comment 2 Ambroz Bizjak 2013-01-16 21:36:48 UTC
Yes, this one works too, I've tested both cross-compile and native.
Comment 3 Dan Nicholson 2013-01-17 13:40:55 UTC
Thanks. I ended up checking in something different, which was just to use PKG_CHECK_MODULES from the in-tree pkg.m4. That will allow our glib check to work exactly the same way as projects using pkg-config. This includes using AC_PATH_TOOL for pkg-config, which will check for $host-pkg-config if you pass --host to configure.

Fixed in 7867cbd. Please report if this doesn't work for you.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.