diff --git a/configure b/configure index ec0f4072ff..25e02a2322 100755 --- a/configure +++ b/configure @@ -21642,6 +21642,15 @@ $as_echo "no" >&6; } fi +if test "$build" != "$host"; 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 @@ -23004,8 +23013,6 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi -if test "$wxUSE_OSX_IPHONE" != 1; then - if test "$wxUSE_LIBCURL" != "no"; then pkg_failed=no @@ -23101,7 +23108,6 @@ $as_echo "$as_me: WARNING: libcurl not found, wxWebRequest won't be available" > fi fi -fi TOOLKIT= TOOLKIT_INCLUDE= diff --git a/configure.in b/configure.in index c8c37a34d7..0626e73532 100644 --- a/configure.in +++ b/configure.in @@ -2383,6 +2383,23 @@ fi dnl End of pre-C++11 only checks section dnl Find pkg-config outside of any conditional. Done before any PKG_* call. PKG_PROG_PKG_CONFIG +dnl When cross-compiling, don't use .pc files on the build system, they are at +dnl best useless and can be harmful (e.g. they may define options inappropriate +dnl for the cross-build, resulting in the failure of all the subsequent tests). +if test "$build" != "$host"; then + dnl pkg.m4 forbids the use of PKG_XXX, so undo it here to avoid autoconf + dnl errors. + m4_pattern_allow([PKG_CONFIG_LIBDIR]) + + dnl If pkg-config libdir is already defined, we suppose that they know what + dnl they're doing and leave it alone, but if not, set it to a path in which + dnl no .pc files will be found. + if test -z "$PKG_CONFIG_LIBDIR"; then + PKG_CONFIG_LIBDIR=/dev/null + export PKG_CONFIG_LIBDIR + fi +fi + dnl --------------------------------------------------------------------------- dnl Optional libraries dnl @@ -2928,11 +2945,6 @@ dnl ------------------------------------------------------------------------ dnl Check for libcurl dnl ------------------------------------------------------------------------ -dnl Using libcurl on iOS doesn't make much sense and currently breaks the -dnl build, probably because it finds a wrong (native) libcurl.pc file, so just -dnl disable it for now. -if test "$wxUSE_OSX_IPHONE" != 1; then - if test "$wxUSE_LIBCURL" != "no"; then PKG_CHECK_MODULES(LIBCURL, [libcurl], [ @@ -2957,8 +2969,6 @@ if test "$wxUSE_LIBCURL" != "no"; then fi fi -fi dnl wxUSE_OSX_IPHONE != 1 - dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) dnl ----------------------------------------------------------------