From 2a349006b9c1feba0a29ede4838cf8f5fdc0b2e5 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Oct 2019 21:13:56 +0100 Subject: [PATCH 1/2] force pkg-config to only use --prefix when cross-compiling The current pkg-config setup has no sense of whether it is cross-compiling, so it will detect things on the build system that are not present or are wrong for the host system. This forces the cross-compiling build to only look for pkg-config .pc files in --prefix. A version of this has been the setup for many years with the Android builds. Fixes #32191 Signed-off-by: Hans-Christoph Steiner --- changes/ticket32191 | 3 +++ configure.ac | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 changes/ticket32191 diff --git a/changes/ticket32191 b/changes/ticket32191 new file mode 100644 index 0000000000..65e919fe03 --- /dev/null +++ b/changes/ticket32191 @@ -0,0 +1,3 @@ + o Minor features (build system): + - force pkg-config to only use --prefix when cross-compiling. + Closes ticket 32191. diff --git a/configure.ac b/configure.ac index 0e9bfe1f6b..ece831d5bd 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,16 @@ else pkg_config_user_action="check the PKG_CONFIG_PATH environment variable" fi +if test "x$PKG_CONFIG_PATH" = "x" && test "x$prefix" != "xNONE" && test "$host" != "$build"; then + export PKG_CONFIG_PATH=$prefix/lib/pkgconfig + AC_MSG_NOTICE([set PKG_CONFIG_PATH=$PKG_CONFIG_PATH to support cross-compiling]) + if test -f "$PKG_CONFIG_PATH/libevent.pc"; then + echo "checking for $PKG_CONFIG_PATH/libevent.pc... yes" + else + AC_MSG_ERROR([$PKG_CONFIG_PATH/libevent.pc not found!]) + fi +fi + AC_ARG_ENABLE(openbsd-malloc, AS_HELP_STRING(--enable-openbsd-malloc, [use malloc code from OpenBSD. Linux only. Deprecated: see --with-malloc])) AC_ARG_ENABLE(static-openssl, From 804d7c9bfc916c430dfd353f742257e4ae7b9c38 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 5 Nov 2019 15:48:01 +1000 Subject: [PATCH 2/2] configure: Remove a check that will always fail And update the changes file to be more specific. Part of 32191. --- changes/ticket32191 | 4 ++-- configure.ac | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/changes/ticket32191 b/changes/ticket32191 index 65e919fe03..6988328115 100644 --- a/changes/ticket32191 +++ b/changes/ticket32191 @@ -1,3 +1,3 @@ o Minor features (build system): - - force pkg-config to only use --prefix when cross-compiling. - Closes ticket 32191. + - Make pkg-config use --prefix when cross-compiling, if PKG_CONFIG_PATH + is not set. Closes ticket 32191. diff --git a/configure.ac b/configure.ac index ece831d5bd..caa2d2f7c4 100644 --- a/configure.ac +++ b/configure.ac @@ -40,11 +40,6 @@ fi if test "x$PKG_CONFIG_PATH" = "x" && test "x$prefix" != "xNONE" && test "$host" != "$build"; then export PKG_CONFIG_PATH=$prefix/lib/pkgconfig AC_MSG_NOTICE([set PKG_CONFIG_PATH=$PKG_CONFIG_PATH to support cross-compiling]) - if test -f "$PKG_CONFIG_PATH/libevent.pc"; then - echo "checking for $PKG_CONFIG_PATH/libevent.pc... yes" - else - AC_MSG_ERROR([$PKG_CONFIG_PATH/libevent.pc not found!]) - fi fi AC_ARG_ENABLE(openbsd-malloc,