Skip to content

Commit 4a9c2ed

Browse files
fanquakeClaude Code
authored andcommitted
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
1 parent 3b3169d commit 4a9c2ed

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

configure.ac

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,14 +1427,13 @@ dnl Check for libminiupnpc (optional)
14271427
if test "$use_upnp" != "no"; then
14281428
TEMP_CPPFLAGS="$CPPFLAGS"
14291429
CPPFLAGS="$CPPFLAGS $MINIUPNPC_CPPFLAGS"
1430-
AC_CHECK_HEADERS(
1431-
[miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
1432-
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])],
1433-
[have_miniupnpc=no]
1434-
)
1435-
dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
1436-
dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
1430+
AC_CHECK_HEADERS([miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], [], [have_miniupnpc=no])
1431+
14371432
if test "$have_miniupnpc" != "no"; then
1433+
AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])
1434+
1435+
dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
1436+
dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
14381437
AC_MSG_CHECKING([whether miniUPnPc API version is supported])
14391438
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
14401439
@%:@include <miniupnpc/miniupnpc.h>
@@ -1459,9 +1458,12 @@ dnl Check for libnatpmp (optional).
14591458
if test "$use_natpmp" != "no"; then
14601459
TEMP_CPPFLAGS="$CPPFLAGS"
14611460
CPPFLAGS="$CPPFLAGS $NATPMP_CPPFLAGS"
1462-
AC_CHECK_HEADERS([natpmp.h],
1463-
[AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])],
1464-
[have_natpmp=no])
1461+
AC_CHECK_HEADERS([natpmp.h], [], [have_natpmp=no])
1462+
1463+
if test "$have_natpmp" != "no"; then
1464+
AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])
1465+
fi
1466+
14651467
CPPFLAGS="$TEMP_CPPFLAGS"
14661468
fi
14671469

0 commit comments

Comments
 (0)