aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-04-24 15:55:04 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-04-24 15:55:04 +0200
commit165903406ecac363fc5101c2aa142aff75f76e8f (patch)
tree9fab8985634067bc3f1453f88614172d1439fcc5 /configure.ac
parent65cddf604c4b3c70e205b4cd32612a1ab8af9856 (diff)
downloadbitcoin-165903406ecac363fc5101c2aa142aff75f76e8f.tar.xz
build: Fix `AC_CHECK_HEADERS` and `AC_CHECK_LIB` for `libnatpmp` package
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 8 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 84ef1bd89b..c27388554f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -759,11 +759,11 @@ case $host in
if test "$use_natpmp" != "no" && $BREW list --versions libnatpmp >/dev/null; then
libnatpmp_prefix=$($BREW --prefix libnatpmp 2>/dev/null)
if test "$suppress_external_warnings" != "no"; then
- CORE_CPPFLAGS="$CORE_CPPFLAGS -isystem $libnatpmp_prefix/include"
+ NATPMP_CPPFLAGS="-isystem $libnatpmp_prefix/include"
else
- CORE_CPPFLAGS="$CORE_CPPFLAGS -I$libnatpmp_prefix/include"
+ NATPMP_CPPFLAGS="-I$libnatpmp_prefix/include"
fi
- CORE_LDFLAGS="$CORE_LDFLAGS -L$libnatpmp_prefix/lib"
+ NATPMP_LIBS="-L$libnatpmp_prefix/lib"
fi
;;
esac
@@ -1424,9 +1424,12 @@ fi
dnl Check for libnatpmp (optional).
if test "$use_natpmp" != "no"; then
+ TEMP_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $NATPMP_CPPFLAGS"
AC_CHECK_HEADERS([natpmp.h],
- [AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS=-lnatpmp], [have_natpmp=no])],
+ [AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])],
[have_natpmp=no])
+ CPPFLAGS="$TEMP_CPPFLAGS"
fi
if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench" = "nonononononono"; then
@@ -1752,7 +1755,7 @@ else
AC_MSG_RESULT($use_natpmp_default)
AC_DEFINE_UNQUOTED([USE_NATPMP], [$natpmp_setting], [NAT-PMP support not compiled if undefined, otherwise value (0 or 1) determines default state])
if test "$TARGET_OS" = "windows"; then
- NATPMP_CPPFLAGS="-DSTATICLIB -DNATPMP_STATICLIB"
+ NATPMP_CPPFLAGS="$NATPMP_CPPFLAGS -DSTATICLIB -DNATPMP_STATICLIB"
fi
else
AC_MSG_RESULT([no])