configure: Set PKG_CONFIG_PATH to get the right settings for the target host.

Francois Gouget fgouget at
Wed Jun 7 04:25:36 CDT 2017

Ideally we would use the right <triplet>-pkg-config tool for the target
host. However Red Hat and SUSE respectively add '-redhat' and '-suse' to
the triplet which makes it hard to find the right tool. Furthermore on
Debian and derivatives a lot of development packages do not support
multiarch so that the required .pc files would not be found.

Setting PKG_CONFIG_PATH side-steps the non-standard Red Hat and SUSE
triplets. It also lets pkg-config fall back to the 'wrong' .pc files
on Debian which is fine in most cases, which using the right one in
cases where it matters (GStreamer 1.0), assuming they are actually

Only set PKG_CONFIG_PATH when it won't interfere with cross-compiling.

Signed-off-by: Francois Gouget <fgouget at>
--- | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ b/
index 71bf7ca2bf7..31649846480 100644
--- a/
+++ b/
@@ -151,6 +151,11 @@ case $host in
       notice_platform="32-bit "
+      if test "x$PKG_CONFIG_PATH" = "x"
+      then
+        PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig"
+        export PKG_CONFIG_PATH
+      fi
       if test "x${GCC}" = "xyes"

More information about the wine-patches mailing list