Skip to content

Commit b9f06bf

Browse files
committed
build: Do not export PKG_CONFIG_{PATH|LIBDIR} variables
1 parent 194f6dc commit b9f06bf

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

configure.ac

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ if test "$PKG_CONFIG" = ""; then
1919
AC_MSG_ERROR([pkg-config not found])
2020
fi
2121

22+
# When compiling with depends, the `PKG_CONFIG_PATH` and `PKG_CONFIG_LIBDIR` variables,
23+
# being set in a `config.site` file, are not exported to let the `--config-cache` option
24+
# work properly.
25+
if test -n "$PKG_CONFIG_PATH"; then
26+
PKG_CONFIG="env PKG_CONFIG_PATH=$PKG_CONFIG_PATH $PKG_CONFIG"
27+
fi
28+
if test -n "$PKG_CONFIG_LIBDIR"; then
29+
PKG_CONFIG="env PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR $PKG_CONFIG"
30+
fi
31+
2232
BITCOIN_DAEMON_NAME=bitcoind
2333
BITCOIN_GUI_NAME=bitcoin-qt
2434
BITCOIN_CLI_NAME=bitcoin-cli

depends/config.site.in

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,9 @@ fi
8484

8585
PKG_CONFIG="$(which pkg-config) --static"
8686

87-
# These two need to remain exported because pkg-config does not see them
88-
# otherwise. That means they must be unexported at the end of configure.ac to
89-
# avoid ruining the cache. Sigh.
90-
export PKG_CONFIG_PATH="${depends_prefix}/share/pkgconfig:${depends_prefix}/lib/pkgconfig"
87+
PKG_CONFIG_PATH="${depends_prefix}/share/pkgconfig:${depends_prefix}/lib/pkgconfig"
9188
if test -z "@allow_host_packages@"; then
92-
export PKG_CONFIG_LIBDIR="${depends_prefix}/lib/pkgconfig"
89+
PKG_CONFIG_LIBDIR="${depends_prefix}/lib/pkgconfig"
9390
fi
9491

9592
CPPFLAGS="-I${depends_prefix}/include/ ${CPPFLAGS}"

0 commit comments

Comments
 (0)