@@ -756,20 +756,20 @@ case $host in
756
756
if test "$use_upnp" != "no" && $BREW list --versions miniupnpc >/dev/null; then
757
757
miniupnpc_prefix=$($BREW --prefix miniupnpc 2>/dev/null)
758
758
if test "$suppress_external_warnings" != "no"; then
759
- CORE_CPPFLAGS="$CORE_CPPFLAGS -isystem $miniupnpc_prefix/include"
759
+ MINIUPNPC_CPPFLAGS=" -isystem $miniupnpc_prefix/include"
760
760
else
761
- CORE_CPPFLAGS="$CORE_CPPFLAGS -I$miniupnpc_prefix/include"
761
+ MINIUPNPC_CPPFLAGS=" -I$miniupnpc_prefix/include"
762
762
fi
763
- CORE_LDFLAGS="$CORE_LDFLAGS -L$miniupnpc_prefix/lib"
763
+ MINIUPNPC_LIBS=" -L$miniupnpc_prefix/lib"
764
764
fi
765
765
if test "$use_natpmp" != "no" && $BREW list --versions libnatpmp >/dev/null; then
766
766
libnatpmp_prefix=$($BREW --prefix libnatpmp 2>/dev/null)
767
767
if test "$suppress_external_warnings" != "no"; then
768
- CORE_CPPFLAGS="$CORE_CPPFLAGS -isystem $libnatpmp_prefix/include"
768
+ NATPMP_CPPFLAGS=" -isystem $libnatpmp_prefix/include"
769
769
else
770
- CORE_CPPFLAGS="$CORE_CPPFLAGS -I$libnatpmp_prefix/include"
770
+ NATPMP_CPPFLAGS=" -I$libnatpmp_prefix/include"
771
771
fi
772
- CORE_LDFLAGS="$CORE_LDFLAGS -L$libnatpmp_prefix/lib"
772
+ NATPMP_LIBS=" -L$libnatpmp_prefix/lib"
773
773
fi
774
774
;;
775
775
esac
@@ -1398,38 +1398,44 @@ fi
1398
1398
1399
1399
dnl Check for libminiupnpc (optional)
1400
1400
if test "$use_upnp" != "no"; then
1401
+ TEMP_CPPFLAGS="$CPPFLAGS"
1402
+ CPPFLAGS="$CPPFLAGS $MINIUPNPC_CPPFLAGS"
1401
1403
AC_CHECK_HEADERS (
1402
1404
[ miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h] ,
1403
- [ AC_CHECK_LIB ( [ miniupnpc] , [ upnpDiscover] , [ MINIUPNPC_LIBS=-lminiupnpc] , [ have_miniupnpc=no] ) ] ,
1405
+ [ AC_CHECK_LIB ( [ miniupnpc] , [ upnpDiscover] , [ MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc" ] , [ have_miniupnpc=no] , [ $MINIUPNPC_LIBS ] ) ] ,
1404
1406
[ have_miniupnpc=no]
1405
1407
)
1406
- dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
1407
- dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
1408
- if test "$have_miniupnpc" != "no"; then
1409
- AC_MSG_CHECKING ( [ whether miniUPnPc API version is supported] )
1410
- AC_PREPROC_IFELSE ( [ AC_LANG_PROGRAM ( [ [
1411
- @%:@ include <miniupnpc/miniupnpc.h>
1412
- ] ] , [ [
1413
- #if MINIUPNPC_API_VERSION >= 10
1414
- // Everything is okay
1415
- #else
1416
- # error miniUPnPc API version is too old
1417
- #endif
1418
- ] ] ) ] ,[
1419
- AC_MSG_RESULT ( [ yes] )
1420
- ] ,[
1421
- AC_MSG_RESULT ( [ no] )
1422
- AC_MSG_WARN ( [ miniUPnPc API version < 10 is unsupported, disabling UPnP support.] )
1423
- have_miniupnpc=no
1424
- ] )
1425
- fi
1408
+ dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
1409
+ dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
1410
+ if test "$have_miniupnpc" != "no"; then
1411
+ AC_MSG_CHECKING ( [ whether miniUPnPc API version is supported] )
1412
+ AC_PREPROC_IFELSE ( [ AC_LANG_PROGRAM ( [ [
1413
+ @%:@ include <miniupnpc/miniupnpc.h>
1414
+ ] ] , [ [
1415
+ #if MINIUPNPC_API_VERSION >= 10
1416
+ // Everything is okay
1417
+ #else
1418
+ # error miniUPnPc API version is too old
1419
+ #endif
1420
+ ] ] ) ] ,[
1421
+ AC_MSG_RESULT ( [ yes] )
1422
+ ] ,[
1423
+ AC_MSG_RESULT ( [ no] )
1424
+ AC_MSG_WARN ( [ miniUPnPc API version < 10 is unsupported, disabling UPnP support.] )
1425
+ have_miniupnpc=no
1426
+ ] )
1427
+ fi
1428
+ CPPFLAGS="$TEMP_CPPFLAGS"
1426
1429
fi
1427
1430
1428
1431
dnl Check for libnatpmp (optional).
1429
1432
if test "$use_natpmp" != "no"; then
1433
+ TEMP_CPPFLAGS="$CPPFLAGS"
1434
+ CPPFLAGS="$CPPFLAGS $NATPMP_CPPFLAGS"
1430
1435
AC_CHECK_HEADERS ( [ natpmp.h] ,
1431
- [ AC_CHECK_LIB ( [ natpmp] , [ initnatpmp] , [ NATPMP_LIBS=-lnatpmp] , [ have_natpmp=no] ) ] ,
1436
+ [ AC_CHECK_LIB ( [ natpmp] , [ initnatpmp] , [ NATPMP_LIBS="$NATPMP_LIBS -lnatpmp" ] , [ have_natpmp=no] , [ $NATPMP_LIBS ] ) ] ,
1432
1437
[ have_natpmp=no] )
1438
+ CPPFLAGS="$TEMP_CPPFLAGS"
1433
1439
fi
1434
1440
1435
1441
if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench" = "nonononononono"; then
@@ -1735,7 +1741,7 @@ else
1735
1741
AC_MSG_RESULT ( [ $use_upnp_default] )
1736
1742
AC_DEFINE_UNQUOTED ( [ USE_UPNP] ,[ $upnp_setting] ,[ UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state] )
1737
1743
if test "$TARGET_OS" = "windows"; then
1738
- MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
1744
+ MINIUPNPC_CPPFLAGS="$MINIUPNPC_CPPFLAGS -DSTATICLIB -DMINIUPNP_STATICLIB"
1739
1745
fi
1740
1746
else
1741
1747
AC_MSG_RESULT ( [ no] )
@@ -1763,7 +1769,7 @@ else
1763
1769
AC_MSG_RESULT ( $use_natpmp_default )
1764
1770
AC_DEFINE_UNQUOTED ( [ USE_NATPMP] , [ $natpmp_setting] , [ NAT-PMP support not compiled if undefined, otherwise value (0 or 1) determines default state] )
1765
1771
if test "$TARGET_OS" = "windows"; then
1766
- NATPMP_CPPFLAGS="-DSTATICLIB -DNATPMP_STATICLIB"
1772
+ NATPMP_CPPFLAGS="$NATPMP_CPPFLAGS -DSTATICLIB -DNATPMP_STATICLIB"
1767
1773
fi
1768
1774
else
1769
1775
AC_MSG_RESULT ( [ no] )
0 commit comments