Skip to content

Commit 9d594ed

Browse files
committed
Merge bitcoin#28755: build: remove duplicate -lminiupnpc linking
b74e449 build: remove potential for duplciate natpmp linking (fanquake) 4e95096 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 hebasto#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 b74e449 hebasto: ACK b74e449, it fixes one issue mentioned in hebasto#34 (comment). TheCharlatan: ACK b74e449 theuni: ACK b74e449 Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
2 parents 04bfe8c + b74e449 commit 9d594ed

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

configure.ac

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,15 +1424,13 @@ dnl Check for libminiupnpc (optional)
14241424
if test "$use_upnp" != "no"; then
14251425
TEMP_CPPFLAGS="$CPPFLAGS"
14261426
CPPFLAGS="$CPPFLAGS $MINIUPNPC_CPPFLAGS"
1427-
AC_CHECK_HEADERS(
1428-
[miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
1429-
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])],
1430-
[have_miniupnpc=no]
1431-
)
1427+
AC_CHECK_HEADERS([miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], [], [have_miniupnpc=no])
14321428

1433-
dnl The minimum supported miniUPnPc API version is set to 17. This excludes
1434-
dnl versions with known vulnerabilities.
14351429
if test "$have_miniupnpc" != "no"; then
1430+
AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])
1431+
1432+
dnl The minimum supported miniUPnPc API version is set to 17. This excludes
1433+
dnl versions with known vulnerabilities.
14361434
AC_MSG_CHECKING([whether miniUPnPc API version is supported])
14371435
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
14381436
@%:@include <miniupnpc/miniupnpc.h>
@@ -1457,9 +1455,12 @@ dnl Check for libnatpmp (optional).
14571455
if test "$use_natpmp" != "no"; then
14581456
TEMP_CPPFLAGS="$CPPFLAGS"
14591457
CPPFLAGS="$CPPFLAGS $NATPMP_CPPFLAGS"
1460-
AC_CHECK_HEADERS([natpmp.h],
1461-
[AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])],
1462-
[have_natpmp=no])
1458+
AC_CHECK_HEADERS([natpmp.h], [], [have_natpmp=no])
1459+
1460+
if test "$have_natpmp" != "no"; then
1461+
AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])
1462+
fi
1463+
14631464
CPPFLAGS="$TEMP_CPPFLAGS"
14641465
fi
14651466

0 commit comments

Comments
 (0)