0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

Merge bitcoin/bitcoin#28755: build: remove duplicate -lminiupnpc linking

b74e449ffa build: remove potential for duplciate natpmp linking (fanquake)
4e95096952 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in https://github.com/hebasto/bitcoin/pull/34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449ffa
  hebasto:
    ACK b74e449ffa, it fixes one issue mentioned in https://github.com/hebasto/bitcoin/pull/34#issuecomment-1782914787.
  TheCharlatan:
    ACK b74e449ffa
  theuni:
    ACK b74e449ffa

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
This commit is contained in:
fanquake 2023-11-01 10:05:28 +00:00
commit 9d594ed1d8
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -1424,15 +1424,13 @@ dnl Check for libminiupnpc (optional)
if test "$use_upnp" != "no"; then
TEMP_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $MINIUPNPC_CPPFLAGS"
AC_CHECK_HEADERS(
[miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])],
[have_miniupnpc=no]
)
AC_CHECK_HEADERS([miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], [], [have_miniupnpc=no])
dnl The minimum supported miniUPnPc API version is set to 17. This excludes
dnl versions with known vulnerabilities.
if test "$have_miniupnpc" != "no"; then
AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])
dnl The minimum supported miniUPnPc API version is set to 17. This excludes
dnl versions with known vulnerabilities.
AC_MSG_CHECKING([whether miniUPnPc API version is supported])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
@%:@include <miniupnpc/miniupnpc.h>
@ -1457,9 +1455,12 @@ dnl Check for libnatpmp (optional).
if test "$use_natpmp" != "no"; then
TEMP_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $NATPMP_CPPFLAGS"
AC_CHECK_HEADERS([natpmp.h],
[AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])],
[have_natpmp=no])
AC_CHECK_HEADERS([natpmp.h], [], [have_natpmp=no])
if test "$have_natpmp" != "no"; then
AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])
fi
CPPFLAGS="$TEMP_CPPFLAGS"
fi