aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-06-06 22:18:42 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-06-13 23:52:07 +0300
commit59cb722fd050393a69f1e0df97d857c893d19d80 (patch)
tree13198fda0e7f6b07fbfa2997432a22c7dc5d49e0 /configure.ac
parentab2190557ec2757fa48b52855b05561854af49af (diff)
downloadbitcoin-59cb722fd050393a69f1e0df97d857c893d19d80.tar.xz
Update configure to reject unsafe miniUPnPc API ver
Also fixes behavior when libminiupnpc is not installed.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 22 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 854d6b1d49..cafa7c7f94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -928,6 +928,26 @@ if test x$use_upnp != xno; then
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
[have_miniupnpc=no]
)
+dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
+dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
+if test x$have_miniupnpc != xno; then
+ AC_MSG_CHECKING([whether miniUPnPc API version is supported])
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <miniupnpc/miniupnpc.h>
+ ]], [[
+ #if MINIUPNPC_API_VERSION >= 10
+ // Everything is okay
+ #else
+ # error miniUPnPc API version is too old
+ #endif
+ ]])],[
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([miniUPnPc API version < 10 is unsupported, disabling UPnP support.])
+ have_miniupnpc=no
+ ])
+fi
fi
BITCOIN_QT_INIT
@@ -1326,9 +1346,10 @@ dnl enable upnp support
AC_MSG_CHECKING([whether to build with support for UPnP])
if test x$have_miniupnpc = xno; then
if test x$use_upnp = xyes; then
- AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
+ AC_MSG_ERROR("UPnP requested but cannot be built. Use --without-miniupnpc.")
fi
AC_MSG_RESULT(no)
+ use_upnp=no
else
if test x$use_upnp != xno; then
AC_MSG_RESULT(yes)