From: Etienne Dechamps Date: Sun, 15 Nov 2015 15:30:01 +0000 (+0000) Subject: Allow tinc to be built with miniupnpc on Windows. X-Git-Tag: release-1.1pre12~85 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;ds=sidebyside;h=675e3b497bdc87f5a4dfdef7508cd2070850e69e;p=tinc Allow tinc to be built with miniupnpc on Windows. Contrary to what I expected, it so happens that modern versions of MinGW include an implementation of pthread natively by default, so there is no need to introduce Win32-specific threading code. This means the only changes required to make UPnP work on Windows are just build parameter tuning. This commit forces MinGW to be built statically. This makes linking against miniupnpc simpler (otherwise we would have to handle the mess of dllimport & co.) and it also prevents libwinpthread from being linked dynamically (which it is by default), as this would require additional DLLs to be distributed. Since static linking is how tinc is traditionally built on Windows, I don't expect this to be a big deal. --- diff --git a/configure.ac b/configure.ac index 4fe415e9..005a24a4 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,9 @@ case $host_os in *mingw*) mingw=true AC_DEFINE(HAVE_MINGW, 1, [MinGW]) - LIBS="$LIBS -lws2_32 -lgdi32 -lcrypt32" + LIBS="$LIBS -lws2_32 -lgdi32 -lcrypt32 -liphlpapi" + LDFLAGS="$LDFLAGS -static" + CPPFLAGS="$CPPFLAGS -DMINIUPNP_STATICLIB" ;; *) AC_MSG_ERROR("Unknown operating system.")