Skip to content

Commit 26211cc

Browse files
fanquakePastaPastaPasta
authored andcommitted
Merge bitcoin#26896: build: Remove port-forwarding runtime setting options from configure
d51f0fa doc: add release notes for 26896 (fanquake) 2b24879 build: remove --enable-upnp-default from configure (fanquake) 02f5a5e build: remove --enable-natpmp-default from configure (fanquake) 25a0e8b Remove configure-time setting of DEFAULT_UPNP (fanquake) 06562e5 Remove configure-time setting of DEFAULT_NATPMP (fanquake) Pull request description: This PR removes the `--enable-upnp-default` and `--enable-natpmp-default` options from configure. It's odd to me that we maintain configure-time options for setting the default port-forwarding runtime state (but no other similar options), and I'm not sure what use-case it satisfies, that can't be achieved by multiple other means. I also doubt that we'll ever restart using these in release builds, or turning on any of this by default. I think the only scenario these options would be used is when you want to compile your own binaries (we don't use them in Guix), with port-forwarding on by default, but otherwise can't or don't want to use a `.conf` file, can't or don't want to pass command line options at runtime, and also don't want to modify the source code? ACKs for top commit: hebasto: ACK d51f0fa, rebased and comments have been addressed since my recent [review](bitcoin#26896 (review)). TheCharlatan: ACK d51f0fa Tree-SHA512: 481decd8bddd8b03b7319591e3acf189f7b6b96c9a9a8c5bc1a3f8ec00d0b8f9b52d2f5c28a298a2ec947cfe9611cfd184e393ccb2e4e21bfce86ca7d4de60d3
1 parent 25eb5cb commit 26211cc

File tree

4 files changed

+13
-49
lines changed

4 files changed

+13
-49
lines changed

configure.ac

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,12 @@ AC_ARG_WITH([miniupnpc],
144144
[use_upnp=$withval],
145145
[use_upnp=auto])
146146

147-
AC_ARG_ENABLE([upnp-default],
148-
[AS_HELP_STRING([--enable-upnp-default],
149-
[if UPNP is enabled, turn it on at startup (default is no)])],
150-
[use_upnp_default=$enableval],
151-
[use_upnp_default=no])
152-
153147
AC_ARG_WITH([natpmp],
154148
[AS_HELP_STRING([--with-natpmp],
155149
[enable NAT-PMP (default is yes if libnatpmp is found)])],
156150
[use_natpmp=$withval],
157151
[use_natpmp=auto])
158152

159-
AC_ARG_ENABLE([natpmp-default],
160-
[AS_HELP_STRING([--enable-natpmp-default],
161-
[if NAT-PMP is enabled, turn it on at startup (default is no)])],
162-
[use_natpmp_default=$enableval],
163-
[use_natpmp_default=no])
164-
165153
AC_ARG_ENABLE(tests,
166154
AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]),
167155
[use_tests=$enableval],
@@ -1609,16 +1597,8 @@ if test x$have_miniupnpc = xno; then
16091597
else
16101598
if test x$use_upnp != xno; then
16111599
AC_MSG_RESULT(yes)
1612-
AC_MSG_CHECKING([whether to build with UPnP enabled by default])
16131600
use_upnp=yes
1614-
upnp_setting=0
1615-
if test x$use_upnp_default != xno; then
1616-
use_upnp_default=yes
1617-
upnp_setting=1
1618-
fi
1619-
AC_MSG_RESULT($use_upnp_default)
1620-
AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
1621-
if test x$TARGET_OS = xwindows; then
1601+
AC_DEFINE([USE_UPNP], [1], [Define to 1 if UPnP support should be compiled in.]) if test x$TARGET_OS = xwindows; then
16221602
MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
16231603
fi
16241604
else
@@ -1637,15 +1617,8 @@ if test "x$have_natpmp" = xno; then
16371617
else
16381618
if test "x$use_natpmp" != xno; then
16391619
AC_MSG_RESULT([yes])
1640-
AC_MSG_CHECKING([whether to build with NAT-PMP enabled by default])
16411620
use_natpmp=yes
1642-
natpmp_setting=0
1643-
if test "x$use_natpmp_default" != xno; then
1644-
use_natpmp_default=yes
1645-
natpmp_setting=1
1646-
fi
1647-
AC_MSG_RESULT($use_natpmp_default)
1648-
AC_DEFINE_UNQUOTED([USE_NATPMP], [$natpmp_setting], [NAT-PMP support not compiled if undefined, otherwise value (0 or 1) determines default state])
1621+
AC_DEFINE([USE_NATPMP], [1], [Define to 1 if UPnP support should be compiled in.])
16491622
if test x$TARGET_OS = xwindows; then
16501623
NATPMP_CPPFLAGS="-DSTATICLIB -DNATPMP_STATICLIB"
16511624
fi

doc/build-unix.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ SQLite is required for the wallet:
9191

9292
To build Dash Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
9393

94-
Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`, `--enable-natpmp-default`):
94+
Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`):
9595

9696
sudo apt install libminiupnpc-dev libnatpmp-dev
9797

@@ -154,7 +154,7 @@ SQLite is required for the wallet:
154154

155155
To build Dash Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
156156

157-
Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`, `--enable-natpmp-default`):
157+
Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`):
158158

159159
sudo dnf install miniupnpc-devel libnatpmp-devel
160160

@@ -198,22 +198,14 @@ miniupnpc
198198

199199
[miniupnpc](https://miniupnp.tuxfamily.org) may be used for UPnP port mapping. It can be downloaded from [here](
200200
https://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and
201-
turned off by default. See the configure options for upnp behavior desired:
202-
203-
--without-miniupnpc No UPnP support miniupnp not required
204-
--disable-upnp-default (the default) UPnP support turned off by default at runtime
205-
--enable-upnp-default UPnP support turned on by default at runtime
201+
turned off by default.
206202

207203
libnatpmp
208204
---------
209205

210206
[libnatpmp](https://miniupnp.tuxfamily.org/libnatpmp.html) may be used for NAT-PMP port mapping. It can be downloaded
211207
from [here](https://miniupnp.tuxfamily.org/files/). NAT-PMP support is compiled in and
212-
turned off by default. See the configure options for NAT-PMP behavior desired:
213-
214-
--without-natpmp No NAT-PMP support, libnatpmp not required
215-
--disable-natpmp-default (the default) NAT-PMP support turned off by default at runtime
216-
--enable-natpmp-default NAT-PMP support turned on by default at runtime
208+
turned off by default.
217209

218210
Berkeley DB
219211
-----------

doc/release-notes-26896.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Build System
2+
------------
3+
4+
The --enable-upnp-default and --enable-natpmp-default options
5+
have been removed. If you want to use port mapping, you can
6+
configure it using a .conf file, or by passing the relevant
7+
options at runtime.

src/mapport.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@
55
#ifndef BITCOIN_MAPPORT_H
66
#define BITCOIN_MAPPORT_H
77

8-
#ifdef USE_UPNP
9-
static constexpr bool DEFAULT_UPNP = USE_UPNP;
10-
#else
118
static constexpr bool DEFAULT_UPNP = false;
12-
#endif // USE_UPNP
139

14-
#ifdef USE_NATPMP
15-
static constexpr bool DEFAULT_NATPMP = USE_NATPMP;
16-
#else
1710
static constexpr bool DEFAULT_NATPMP = false;
18-
#endif // USE_NATPMP
1911

2012
enum MapPortProtoFlag : unsigned int {
2113
NONE = 0x00,

0 commit comments

Comments
 (0)