From f63f00c6118bf65ba711e068380ac94bb9418e4e Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 13 Jan 2026 13:52:02 +0200 Subject: [PATCH] Set up pkg-config environment variables when cross-compiling to Linux Otherwise we won't find the .pc files. Tested by running configury on arm64 Ubuntu, for cross-compiling to amd64 Ubuntu. Note: No idea yet whether such a cross-build will run successfully to completion, or the result work. Change-Id: I517c1674d1230f91341b240f02b1b65d3ceaaef2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197207 Tested-by: Jenkins Reviewed-by: Noel Grandin --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 5a3c91dedbd4..99801f68b0ae 100644 --- a/configure.ac +++ b/configure.ac @@ -4323,6 +4323,14 @@ fi if test "$cross_compiling" = "yes"; then export CROSS_COMPILING=TRUE + if test "$_os" = "Linux"; then + if test -d /usr/lib/$host_cpu-$host_os/pkgconfig; then + export PKG_CONFIG_LIBDIR=/usr/lib/$host_cpu-$host_os/pkgconfig + if test -d /usr/share/pkgconfig; then + export PKG_CONFIG_PATH=/usr/share/pkgconfig + fi + fi + fi if test "$enable_dynamic_loading" != yes -a "$enable_wasm_strip" = yes; then ENABLE_WASM_STRIP=TRUE fi