diff options
author | fanquake <fanquake@gmail.com> | 2023-10-31 10:49:40 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-10-31 11:12:28 +0000 |
commit | b74e449ffa9965f18037f0322ea178e2fe1dbc18 (patch) | |
tree | 63be8691a2b3fee8502d5083aebf9df10f7b0213 /configure.ac | |
parent | 4e9509695206bd952da00a2b1c90a92db31a0fe7 (diff) | |
download | bitcoin-b74e449ffa9965f18037f0322ea178e2fe1dbc18.tar.xz |
build: remove potential for duplciate natpmp linking
Consolidate the lib checking logic to be the same as miniupnpc.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index c5c57ab388..6add570d00 100644 --- a/configure.ac +++ b/configure.ac @@ -1455,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 |