In an ideal world I think the previous patch would have been ok but due to the issues mentioned in the first paragraph this one may be better.
Regarding the 64 bit case, since we feel it necessary to set CC="$CC -m64", I think we should also set PKG_CONFIG_PATH to make sure the 64 bit .pc files will be used rather than the 32 bit ones. What's a bit strange is that this branch does not have the "$cross_compiling" != "yes" check. This case being much less common I would be ok with dropping that part.
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 present.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/configure.ac b/configure.ac index 71bf7ca2bf7..7ecf41846c5 100644 --- a/configure.ac +++ b/configure.ac @@ -151,6 +151,8 @@ case $host in host_cpu="i386" notice_platform="32-bit " AC_SUBST(TARGETFLAGS,"-m32") + PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + export PKG_CONFIG_PATH enable_win16=${enable_win16:-yes} else if test "x${GCC}" = "xyes" @@ -166,6 +168,8 @@ case $host in host_cpu="x86_64" notice_platform="64-bit " AC_SUBST(TARGETFLAGS,"-m64") + PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig" + export PKG_CONFIG_PATH fi ;; arm*)