-include .openconnect.exe.d
+if OPENCONNECT_WINTUN
+-include .wintun.dll.d
+endif
+
file-list.txt: Makefile tap-windows-9.21.2.exe vpnc-script-win.js
for dll in $(sort $(DLLS)); do echo "$${dll}"; done > $@
echo $(TAPSHA256) $< | sha256sum -c
echo $< > $@
+WINTUNDRIVER = wintun-0.10.2.zip
+WINTUNSHA256 = fcd9f62f1bd5a550fcb9c21fbb5d6a556214753ccbbd1a3ebad4d318ec9dcbef
+
+$(WINTUNDRIVER):
+ curl https://www.wintun.net/builds/$(WINTUNDRIVER) -o $@
+
+.libs/wintun.dll: $(WINTUNDRIVER)
+ echo $(WINTUNSHA256) $< | sha256sum -c
+ unzip -DD -o -j -d .libs $< wintun/bin/$(WINTUN_ARCH)/wintun.dll
+
# Latest vpnc-script-win.js
vpnc-script-win.js:
curl https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js -o $@
AC_CHECK_TOOL([WINDRES], [windres], [])
AC_CHECK_TOOL([MAKENSIS], [makensis], [])
+ case $host_cpu in
+ x86_64|amd64)
+ wintun_arch=amd64
+ ;;
+ *86)
+ wintun_arch=x86
+ ;;
+ aarch64|arm64)
+ wintun_arch=arm64
+ ;;
+ arm*)
+ wintun_arch=arm
+ ;;
+ esac
+ AC_SUBST(WINTUN_ARCH, "$wintun_arch")
+
# MINGW_HAS_SECURE_API may only work on newer MinGW:
# https://stackoverflow.com/a/51977723
AC_DEFINE(MINGW_HAS_SECURE_API, 1, [Try to make getenv_s and _putenv_s available])
AM_CONDITIONAL(OPENCONNECT_WIN32, [ test "$have_win" = "yes" ])
build_nsis=no
if test "${MAKENSIS}" != ""; then
- build_nsis=yes
+ AC_CHECK_PROG(have_curl, curl, yes)
+ if test "${have_curl}" = "yes"; then
+ build_nsis=yes
+ if test "${wintun_arch}" != ""; then
+ AC_CHECK_PROG(have_unzip, unzip, yes)
+ if test "${have_unzip}" != "yes"; then
+ wintun_arch=
+ fi
+ fi
+ fi
fi
AM_CONDITIONAL(BUILD_NSIS, [ test "$build_nsis" = "yes" ])
+AM_CONDITIONAL(OPENCONNECT_WINTUN, [ test "${wintun_arch}" != "" ])
AC_ARG_WITH([vpnc-script],
[AS_HELP_STRING([--with-vpnc-script],