Skip to content

Commit 4e95096

Browse files
committed
build: remove duplicate -lminiupnpc linking
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 linker released with Xcode 15, and also came up in hebasto/bitcoin#34.
1 parent 4458ae8 commit 4e95096

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

configure.ac

Lines changed: 5 additions & 7 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>

0 commit comments

Comments
 (0)