diff --git a/configure.ac b/configure.ac index 14653c3..d1cd998 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,14 @@ AC_MSG_RESULT([$os_freebsd]) AM_CONDITIONAL([OS_FREEBSD], [test "x$os_freebsd" = "xyes"]) +# Set TUN libs based on platform +if test "x$os_windows" = "xyes"; then + TUN_LIBS="-liphlpapi -lws2_32 -ladvapi32 -lbcrypt -ldbghelp" +else + TUN_LIBS="" +fi +AC_SUBST([TUN_LIBS]) + # Checks for header files, typedefs, functions... AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h]) AC_TYPE_SIZE_T diff --git a/src/Makefile.am b/src/Makefile.am index 0c1b33a..9ca4662 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ utun_CORE_SOURCES = \ control_server.c # Platform-specific TUN libs (Windows only) -utun_TUN_LIBS = -liphlpapi -lws2_32 -ladvapi32 -lbcrypt -ldbghelp +utun_TUN_LIBS = @TUN_LIBS@ # TinyCrypt sources (only used without OpenSSL) utun_TINYCRYPT_SOURCES = \