diff --git a/configure.in b/configure.in index 64d9d6db7b..0de15b4b5a 100644 --- a/configure.in +++ b/configure.in @@ -548,9 +548,12 @@ dnl There are no packages for Debian or Redhat as of this patch if test "$natpmp" = "true"; then AC_DEFINE(NAT_PMP, 1, [Define to 1 if we are building with nat-pmp.]) - TOR_SEARCH_LIBRARY(libnatpmp, $trylibnatpmpdir, [-lnatpmp], - [#include ], + TOR_SEARCH_LIBRARY(libnatpmp, $trylibnatpmpdir, [-lnatpmp $TOR_LIB_WS32 $TOR_LIB_IPHLPAPI], [#include ], + [#ifdef MS_WINDOWS + #define STATICLIB + #endif + #include ], [ int r; natpmp_t natpmp; natpmpresp_t response; diff --git a/src/tools/tor-fw-helper/Makefile.am b/src/tools/tor-fw-helper/Makefile.am index 8f64ad2ba3..393562db03 100644 --- a/src/tools/tor-fw-helper/Makefile.am +++ b/src/tools/tor-fw-helper/Makefile.am @@ -15,7 +15,7 @@ noinst_HEADERS = \ if NAT_PMP nat_pmp_ldflags = @TOR_LDFLAGS_libnatpmp@ -nat_pmp_ldadd = -lnatpmp +nat_pmp_ldadd = -lnatpmp @TOR_LIB_IPHLPAPI@ nat_pmp_cppflags = @TOR_CPPFLAGS_libnatpmp@ else nat_pmp_ldflags = diff --git a/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c b/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c index f9d5d0d586..a8cdbbf24a 100644 --- a/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c +++ b/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c @@ -9,11 +9,13 @@ #include "orconfig.h" #ifdef NAT_PMP +#ifdef MS_WINDOWS +#define STATICLIB +#endif #include #include #include #include -#include // debugging stuff #include