Bug 59435

Summary: pkg-config configure script should look for host-pkg-config before pkg-config
Product: pkg-config Reporter: Ambroz Bizjak <ambrop7>
Component: srcAssignee: Dan Nicholson <dbn.lists>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: configure.ac patch

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. How we collect and use information is described in our Privacy Policy.