From 06562e5fa771dab275a9cab4914cd64d961a52bc Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 13 Jan 2023 15:27:53 +0000 Subject: [PATCH 1/5] Remove configure-time setting of DEFAULT_NATPMP Default to false. --- src/mapport.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mapport.h b/src/mapport.h index 279d65167f5..38367aa1cf2 100644 --- a/src/mapport.h +++ b/src/mapport.h @@ -11,11 +11,7 @@ static constexpr bool DEFAULT_UPNP = USE_UPNP; static constexpr bool DEFAULT_UPNP = false; #endif // USE_UPNP -#ifdef USE_NATPMP -static constexpr bool DEFAULT_NATPMP = USE_NATPMP; -#else static constexpr bool DEFAULT_NATPMP = false; -#endif // USE_NATPMP enum MapPortProtoFlag : unsigned int { NONE = 0x00, From 25a0e8ba0b31d8bd265df0589fe49241a60d0fc2 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 13 Jan 2023 15:29:52 +0000 Subject: [PATCH 2/5] Remove configure-time setting of DEFAULT_UPNP Default to false. --- src/mapport.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mapport.h b/src/mapport.h index 38367aa1cf2..6f55c46f6cc 100644 --- a/src/mapport.h +++ b/src/mapport.h @@ -5,11 +5,7 @@ #ifndef BITCOIN_MAPPORT_H #define BITCOIN_MAPPORT_H -#ifdef USE_UPNP -static constexpr bool DEFAULT_UPNP = USE_UPNP; -#else static constexpr bool DEFAULT_UPNP = false; -#endif // USE_UPNP static constexpr bool DEFAULT_NATPMP = false; From 02f5a5e7b5fd7ba35e407d4409202a0e0fed003c Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 13 Jan 2023 15:35:57 +0000 Subject: [PATCH 3/5] build: remove --enable-natpmp-default from configure --- configure.ac | 15 +-------------- doc/build-unix.md | 10 +++------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 26387422324..41c12c0a00f 100644 --- a/configure.ac +++ b/configure.ac @@ -175,12 +175,6 @@ AC_ARG_WITH([natpmp], [use_natpmp=$withval], [use_natpmp=auto]) -AC_ARG_ENABLE([natpmp-default], - [AS_HELP_STRING([--enable-natpmp-default], - [if NAT-PMP is enabled, turn it on at startup (default is no)])], - [use_natpmp_default=$enableval], - [use_natpmp_default=no]) - AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]), [use_tests=$enableval], @@ -1793,15 +1787,8 @@ if test "$have_natpmp" = "no"; then else if test "$use_natpmp" != "no"; then AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([whether to build with NAT-PMP enabled by default]) use_natpmp=yes - natpmp_setting=0 - if test "$use_natpmp_default" != "no"; then - use_natpmp_default=yes - natpmp_setting=1 - fi - 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]) + AC_DEFINE([USE_NATPMP], [1], [Define to 1 if UPnP support should be compiled in.]) if test "$TARGET_OS" = "windows"; then NATPMP_CPPFLAGS="$NATPMP_CPPFLAGS -DSTATICLIB -DNATPMP_STATICLIB" fi diff --git a/doc/build-unix.md b/doc/build-unix.md index 077e278afc0..cea8eb919c7 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -72,7 +72,7 @@ executables, which are based on BerkeleyDB 4.8. If you do not care about wallet To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) -Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`, `--enable-natpmp-default`): +Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`): sudo apt install libminiupnpc-dev libnatpmp-dev @@ -133,7 +133,7 @@ pass `--with-incompatible-bdb` to configure. Otherwise, you can build Berkeley D To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) -Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`, `--enable-natpmp-default`): +Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`): sudo dnf install miniupnpc-devel libnatpmp-devel @@ -187,11 +187,7 @@ libnatpmp [libnatpmp](https://miniupnp.tuxfamily.org/libnatpmp.html) may be used for NAT-PMP port mapping. It can be downloaded from [here](https://miniupnp.tuxfamily.org/files/). NAT-PMP support is compiled in and -turned off by default. See the configure options for NAT-PMP behavior desired: - - --without-natpmp No NAT-PMP support, libnatpmp not required - --disable-natpmp-default (the default) NAT-PMP support turned off by default at runtime - --enable-natpmp-default NAT-PMP support turned on by default at runtime +turned off by default. Berkeley DB ----------- From 2b248798d96f794db08b7725730b5fb4e00b9b10 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 13 Jan 2023 15:37:42 +0000 Subject: [PATCH 4/5] build: remove --enable-upnp-default from configure --- configure.ac | 15 +-------------- doc/build-unix.md | 10 +++------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 41c12c0a00f..0667515b491 100644 --- a/configure.ac +++ b/configure.ac @@ -163,12 +163,6 @@ AC_ARG_WITH([miniupnpc], [use_upnp=$withval], [use_upnp=auto]) -AC_ARG_ENABLE([upnp-default], - [AS_HELP_STRING([--enable-upnp-default], - [if UPNP is enabled, turn it on at startup (default is no)])], - [use_upnp_default=$enableval], - [use_upnp_default=no]) - AC_ARG_WITH([natpmp], [AS_HELP_STRING([--with-natpmp], [enable NAT-PMP (default is yes if libnatpmp is found)])], @@ -1759,15 +1753,8 @@ if test "$have_miniupnpc" = "no"; then else if test "$use_upnp" != "no"; then AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([whether to build with UPnP enabled by default]) use_upnp=yes - upnp_setting=0 - if test "$use_upnp_default" != "no"; then - use_upnp_default=yes - upnp_setting=1 - fi - AC_MSG_RESULT([$use_upnp_default]) - AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state]) + AC_DEFINE([USE_UPNP], [1], [Define to 1 if UPnP support should be compiled in.]) if test "$TARGET_OS" = "windows"; then MINIUPNPC_CPPFLAGS="$MINIUPNPC_CPPFLAGS -DSTATICLIB -DMINIUPNP_STATICLIB" fi diff --git a/doc/build-unix.md b/doc/build-unix.md index cea8eb919c7..0960ae15777 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -72,7 +72,7 @@ executables, which are based on BerkeleyDB 4.8. If you do not care about wallet To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) -Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`): +Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`): sudo apt install libminiupnpc-dev libnatpmp-dev @@ -133,7 +133,7 @@ pass `--with-incompatible-bdb` to configure. Otherwise, you can build Berkeley D To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) -Optional port mapping libraries (see: `--with-miniupnpc`, `--enable-upnp-default`, and `--with-natpmp`): +Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`): sudo dnf install miniupnpc-devel libnatpmp-devel @@ -176,11 +176,7 @@ miniupnpc [miniupnpc](https://miniupnp.tuxfamily.org) may be used for UPnP port mapping. It can be downloaded from [here]( https://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and -turned off by default. See the configure options for UPnP behavior desired: - - --without-miniupnpc No UPnP support, miniupnp not required - --disable-upnp-default (the default) UPnP support turned off by default at runtime - --enable-upnp-default UPnP support turned on by default at runtime +turned off by default. libnatpmp --------- From d51f0fa4b7b19281efe65aacf414845c661d0a13 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 16 Jan 2023 13:51:54 +0000 Subject: [PATCH 5/5] doc: add release notes for 26896 --- doc/release-notes-26896.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/release-notes-26896.md diff --git a/doc/release-notes-26896.md b/doc/release-notes-26896.md new file mode 100644 index 00000000000..ff4ab44e270 --- /dev/null +++ b/doc/release-notes-26896.md @@ -0,0 +1,7 @@ +Build System +------------ + +The --enable-upnp-default and --enable-natpmp-default options +have been removed. If you want to use port mapping, you can +configure it using a .conf file, or by passing the relevant +options at runtime. \ No newline at end of file