Disable build system pkg-config when cross-compiling to non-Linux

This restores a modified form of the original commit 893ebbab0c (Disable
use of build system pkg-config files when cross-compiling, 2020-12-13),
thus mostly reverting 6dbf59f34f (Revert "Disable use of build system
pkg-config files when cross-compiling", 2022-10-25) and now disables the
use of build system pkg-config files only when cross-compiling for
non-Linux hosts.

This seems like the best behaviour by default because it avoids
unexpected problems when cross-compiling for MSW or iOS where build
system .pc files should never be used, but still uses these files, if
they are available, when cross-compiling for other Linux systems.

This is Linux-specific currently but should probably be extended to
other Unix systems too. In any case, the default behaviour can always be
overridden by setting PKG_CONFIG_LIBDIR manually.

See #22886.
This commit is contained in:
Vadim Zeitlin 2022-11-30 02:18:38 +01:00
parent 48d226bb84
commit d6ddfe87e1
2 changed files with 53 additions and 0 deletions

20
configure vendored
View file

@ -25051,6 +25051,26 @@ $as_echo "no" >&6; }
fi
if test "$build" != "$host"; then
case "${host}" in
*-linux-*)
;;
*)
disable_build_system_pkg_config=1
;;
esac
fi
if test "$disable_build_system_pkg_config" = 1; then
if test -z "$PKG_CONFIG_LIBDIR"; then
PKG_CONFIG_LIBDIR=/dev/null
export PKG_CONFIG_LIBDIR
fi
fi
if test "$wxUSE_REGEX" != "no"; then