Skip to content

Commit 79e18eb

Browse files
committed
Merge bitcoin/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/bitcoin#26896 (review)). TheCharlatan: ACK d51f0fa Tree-SHA512: 481decd8bddd8b03b7319591e3acf189f7b6b96c9a9a8c5bc1a3f8ec00d0b8f9b52d2f5c28a298a2ec947cfe9611cfd184e393ccb2e4e21bfce86ca7d4de60d3
2 parents b1329b7 + d51f0fa commit 79e18eb

File tree

4 files changed

+13
-48
lines changed

4 files changed

+13
-48
lines changed

configure.ac

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,12 @@ AC_ARG_WITH([miniupnpc],
163163
[use_upnp=$withval],
164164
[use_upnp=auto])
165165

166-
AC_ARG_ENABLE([upnp-default],
167-
[AS_HELP_STRING([--enable-upnp-default],
168-
[if UPNP is enabled, turn it on at startup (default is no)])],
169-
[use_upnp_default=$enableval],
170-
[use_upnp_default=no])
171-
172166
AC_ARG_WITH([natpmp],
173167
[AS_HELP_STRING([--with-natpmp],
174168
[enable NAT-PMP (default is yes if libnatpmp is found)])],
175169
[use_natpmp=$withval],
176170
[use_natpmp=auto])
177171

178-
AC_ARG_ENABLE([natpmp-default],
179-
[AS_HELP_STRING([--enable-natpmp-default],
180-
[if NAT-PMP is enabled, turn it on at startup (default is no)])],
181-
[use_natpmp_default=$enableval],
182-
[use_natpmp_default=no])
183-
184172
AC_ARG_ENABLE(tests,
185173
AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]),
186174
[use_tests=$enableval],
@@ -1765,15 +1753,8 @@ if test "$have_miniupnpc" = "no"; then
17651753
else
17661754
if test "$use_upnp" != "no"; then
17671755
AC_MSG_RESULT([yes])
1768-
AC_MSG_CHECKING([whether to build with UPnP enabled by default])
17691756
use_upnp=yes
1770-
upnp_setting=0
1771-
if test "$use_upnp_default" != "no"; then
1772-
use_upnp_default=yes
1773-
upnp_setting=1
1774-
fi
1775-
AC_MSG_RESULT([$use_upnp_default])
1776-
AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
1757+
AC_DEFINE([USE_UPNP], [1], [Define to 1 if UPnP support should be compiled in.])
17771758
if test "$TARGET_OS" = "windows"; then
17781759
MINIUPNPC_CPPFLAGS="$MINIUPNPC_CPPFLAGS -DSTATICLIB -DMINIUPNP_STATICLIB"
17791760
fi
@@ -1793,15 +1774,8 @@ if test "$have_natpmp" = "no"; then
17931774
else
17941775
if test "$use_natpmp" != "no"; then
17951776
AC_MSG_RESULT([yes])
1796-
AC_MSG_CHECKING([whether to build with NAT-PMP enabled by default])
17971777
use_natpmp=yes
1798-
natpmp_setting=0
1799-
if test "$use_natpmp_default" != "no"; then
1800-
use_natpmp_default=yes
1801-
natpmp_setting=1
1802-
fi
1803-
AC_MSG_RESULT($use_natpmp_default)
1804-
AC_DEFINE_UNQUOTED([USE_NATPMP], [$natpmp_setting], [NAT-PMP support not compiled if undefined, otherwise value (0 or 1) determines default state])
1778+
AC_DEFINE([USE_NATPMP], [1], [Define to 1 if UPnP support should be compiled in.])
18051779
if test "$TARGET_OS" = "windows"; then
18061780
NATPMP_CPPFLAGS="$NATPMP_CPPFLAGS -DSTATICLIB -DNATPMP_STATICLIB"
18071781
fi

doc/build-unix.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ executables, which are based on BerkeleyDB 4.8. If you do not care about wallet
7272

7373
To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
7474

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

7777
sudo apt install libminiupnpc-dev libnatpmp-dev
7878

@@ -133,7 +133,7 @@ pass `--with-incompatible-bdb` to configure. Otherwise, you can build Berkeley D
133133

134134
To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
135135

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

138138
sudo dnf install miniupnpc-devel libnatpmp-devel
139139

@@ -176,22 +176,14 @@ miniupnpc
176176

177177
[miniupnpc](https://miniupnp.tuxfamily.org) may be used for UPnP port mapping. It can be downloaded from [here](
178178
https://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and
179-
turned off by default. See the configure options for UPnP behavior desired:
180-
181-
--without-miniupnpc No UPnP support, miniupnp not required
182-
--disable-upnp-default (the default) UPnP support turned off by default at runtime
183-
--enable-upnp-default UPnP support turned on by default at runtime
179+
turned off by default.
184180

185181
libnatpmp
186182
---------
187183

188184
[libnatpmp](https://miniupnp.tuxfamily.org/libnatpmp.html) may be used for NAT-PMP port mapping. It can be downloaded
189185
from [here](https://miniupnp.tuxfamily.org/files/). NAT-PMP support is compiled in and
190-
turned off by default. See the configure options for NAT-PMP behavior desired:
191-
192-
--without-natpmp No NAT-PMP support, libnatpmp not required
193-
--disable-natpmp-default (the default) NAT-PMP support turned off by default at runtime
194-
--enable-natpmp-default NAT-PMP support turned on by default at runtime
186+
turned off by default.
195187

196188
Berkeley DB
197189
-----------

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)