Skip to content

Commit b74e449

Browse files
committed
build: remove potential for duplciate natpmp linking
Consolidate the lib checking logic to be the same as miniupnpc.
1 parent 4e95096 commit b74e449

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

configure.ac

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,12 @@ dnl Check for libnatpmp (optional).
14551455
if test "$use_natpmp" != "no"; then
14561456
TEMP_CPPFLAGS="$CPPFLAGS"
14571457
CPPFLAGS="$CPPFLAGS $NATPMP_CPPFLAGS"
1458-
AC_CHECK_HEADERS([natpmp.h],
1459-
[AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])],
1460-
[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+
14611464
CPPFLAGS="$TEMP_CPPFLAGS"
14621465
fi
14631466

0 commit comments

Comments
 (0)