x86_64-w64-mingw32-pkg-config ignores PKG_CONFIG_PATH

Bug #1327242 reported by KJ Tsanaktsidis on 2014-06-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
mingw-w64 (Ubuntu)

Bug Description

The x86_64-w64-mingw32-pkg-config program (i.e. the mingw toolchain's pkg-config) ignores the PKG_CONFIG_PATH environment variable. This program is a simple shell script wrapper, and the offending line is as follows:

PKG_CONFIG_PATH=/usr/lib/${triplet}/pkgconfig:/usr/${triplet}/lib/pkgconfig pkg-config $@

This of course discards whatever PKG_CONFIG_PATH was set in the environment. This causes the cross compilation of VLC to fail, because it expects to be alble to link to libraries it provides by setting PKG_CONFIG_PATH. The solution is to change the x86_64-w64-mingw32-pkg-config script to do something like the following

if [ -n "$PKG_CONFIG_PATH" ]; then
PKG_CONFIG_PATH=/usr/lib/${triplet}/pkgconfig:/usr/${triplet}/lib/pkgconfig${EXISTING} pkg-config $@

I'd submit a patch but i'm not entirely sure where and how to do it! If anyone has a few pointers on this that'd be great.

Ubuntu 14.04 LTS
Package: mingw-w64-tools
Package version: 3.1.0-1

Stephen Kitt (steve-sk2) wrote :


Thanks for reporting this, it's nice to see the pkg-config wrapper is useful!

The script is actually a symlink to /usr/share/pkg-config-crosswrapper, which is provided by the pkg-config package. Fixing that would improve the situation for every user of cross-pkg-config, so I'm reassigning this bug to pkg-config.



Dimitri John Ledkov (xnox) wrote :

In utopic, pkg-config-wrapper no longer uses PKG_CONFIG_PATH and instead uses PKG_CONFIG_LIBDIR, thus in utopic and later PKG_CONFIG_PATH is honored.

Changed in mingw-w64 (Ubuntu):
status: New → Invalid
Changed in pkg-config (Ubuntu):
status: New → Fix Released
Stephen Kitt (steve-sk2) wrote :

Thanks Dimitri!

Oh cool :)

Is there a better way to get this fix into my Trusty install other than just manually changing the file to use PKG_CONFIG_LIBDIR?

戴华豪 (dhh78) on 2016-01-04
affects: pkg-config (Ubuntu) → pkg-config
Changed in pkg-config:
assignee: nobody → 戴华豪 (dhh78)
Changed in mingw-w64 (Ubuntu):
assignee: nobody → 戴华豪 (dhh78)
status: Invalid → In Progress
Stephen Kitt (steve-sk2) on 2017-11-08
Changed in mingw-w64 (Ubuntu):
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers