@@ -750,11 +750,11 @@ case $host in
750750 if test "$use_upnp" != "no" && $BREW list --versions miniupnpc >/dev/null; then
751751 miniupnpc_prefix=$($BREW --prefix miniupnpc 2>/dev/null)
752752 if test "$suppress_external_warnings" != "no"; then
753- CORE_CPPFLAGS="$CORE_CPPFLAGS -isystem $miniupnpc_prefix/include"
753+ MINIUPNPC_CPPFLAGS=" -isystem $miniupnpc_prefix/include"
754754 else
755- CORE_CPPFLAGS="$CORE_CPPFLAGS -I$miniupnpc_prefix/include"
755+ MINIUPNPC_CPPFLAGS=" -I$miniupnpc_prefix/include"
756756 fi
757- CORE_LDFLAGS="$CORE_LDFLAGS -L$miniupnpc_prefix/lib"
757+ MINIUPNPC_LIBS=" -L$miniupnpc_prefix/lib"
758758 fi
759759 if test "$use_natpmp" != "no" && $BREW list --versions libnatpmp >/dev/null; then
760760 libnatpmp_prefix=$($BREW --prefix libnatpmp 2>/dev/null)
@@ -1392,9 +1392,11 @@ fi
13921392
13931393dnl Check for libminiupnpc (optional)
13941394if test "$use_upnp" != "no"; then
1395+ TEMP_CPPFLAGS="$CPPFLAGS"
1396+ CPPFLAGS="$CPPFLAGS $MINIUPNPC_CPPFLAGS"
13951397 AC_CHECK_HEADERS (
13961398 [ miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h] ,
1397- [ AC_CHECK_LIB ( [ miniupnpc] , [ upnpDiscover] , [ MINIUPNPC_LIBS=-lminiupnpc] , [ have_miniupnpc=no] ) ] ,
1399+ [ AC_CHECK_LIB ( [ miniupnpc] , [ upnpDiscover] , [ MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc" ] , [ have_miniupnpc=no] , [ $MINIUPNPC_LIBS ] ) ] ,
13981400 [ have_miniupnpc=no]
13991401 )
14001402 dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
@@ -1417,6 +1419,7 @@ if test "$use_upnp" != "no"; then
14171419 have_miniupnpc=no
14181420 ] )
14191421 fi
1422+ CPPFLAGS="$TEMP_CPPFLAGS"
14201423fi
14211424
14221425dnl Check for libnatpmp (optional).
@@ -1721,7 +1724,7 @@ else
17211724 AC_MSG_RESULT ( [ $use_upnp_default] )
17221725 AC_DEFINE_UNQUOTED ( [ USE_UPNP] ,[ $upnp_setting] ,[ UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state] )
17231726 if test "$TARGET_OS" = "windows"; then
1724- MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
1727+ MINIUPNPC_CPPFLAGS="$MINIUPNPC_CPPFLAGS -DSTATICLIB -DMINIUPNP_STATICLIB"
17251728 fi
17261729 else
17271730 AC_MSG_RESULT ( [ no] )
0 commit comments