lib_LTLIBRARIES = libopenconnect.la
sbin_PROGRAMS = openconnect
man8_MANS = openconnect.8
+bin_PROGRAMS :=
+sbin_SCRIPTS :=
noinst_PROGRAMS :=
AM_CFLAGS = @WFLAGS@
if OPENCONNECT_WIN32
openconnect_SOURCES += openconnect.rc
+sbin_SCRIPTS += vpnc-script-win.js
endif
library_srcs = ssl.c http.c textbuf.c http-auth.c auth-common.c \
auth-html.c library.c compat.c lzs.c mainloop.c script.c \
endif
if OPENCONNECT_SYSTEM_KEYS
+if OPENCONNECT_WIN32
+#install list-system-keys on Windows
+bin_PROGRAMS += list-system-keys
+else
+#Don't install list-system-keys
+#It breaks the Linux COPR builds since the native RPM doesn't list it as
+#one of the files that are expected to be installed.
+#see commit 17887b53e171ec7223340092dc042298a29defb0
noinst_PROGRAMS += list-system-keys
+endif #OPENCONNECT_WIN32
list_system_keys_SOURCES = list-system-keys.c
list_system_keys_CFLAGS = $(GNUTLS_CFLAGS)
list_system_keys_LDADD = $(GNUTLS_LIBS)
#EXTRA_DLLDIRS := $(OPENCONNECT_GUI_DIR)/bin $(libdir)/qt5/plugins/platforms $(libdir)/qt5/plugins/styles
DLL_EXECUTABLES := openconnect$(EXEEXT) $(EXTRA_EXECUTABLES)
+endif
if OPENCONNECT_WINTUN
WINTUN_DLL = .libs/wintun.dll
DISTCLEANFILES += $(WINTUN_DLL)
+sbin_SCRIPTS += .libs/wintun.dll
+if BUILD_NSIS
DLL_EXECUTABLES += wintun.dll
endif
+endif
+if BUILD_NSIS
if OPENCONNECT_SYSTEM_KEYS
DLL_EXECUTABLES += list-system-keys$(EXEEXT)
endif
file-list.txt: Makefile.dlldeps openconnect$(EXEEXT) libopenconnect.la $(WINTUN_DLL)
@$(MAKE) --no-print-directory -f $< $@
+endif #BUILD_NSIS
# Wintun Layer 3 TUN driver for Windows 7 and newer
# (see https://wintun.net)
jq -r '.[0] | "// This script matches the version found at " + (.web_url | sub("/commit/"; "/blob/")) + "/vpnc-script-win.js\n// Updated on " + .authored_date[:10] + " by " + .author_name + " <" + .author_email + "> (\"" + .title + "\")\n//"' > $@
curl https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js >> $@
+if BUILD_NSIS
# Let make find the file in VPATH
file-list-%.txt: %
echo $< > $@
$(AM_V_MAKENSIS) $(MAKENSIS) $<
ln -f "$$(grep -E '^OutFile' openconnect.nsi | cut -f2 -d\")" $@
-endif
+endif #BUILD_NSIS
system_pcsc_libs="-lwinscard"
system_pcsc_cflags=
AC_CHECK_TOOL([WINDRES], [windres], [])
- AC_CHECK_TOOL([MAKENSIS], [makensis], [])
+
+ AC_ARG_ENABLE([nsis-installer],
+ AS_HELP_STRING([--disable-nsis-installer], [Do not build an NSIS installer]),
+ [USE_NSIS=$enableval], [USE_NSIS=yes])
+
+ if test "$USE_NSIS" = "yes"; then
+ AC_CHECK_TOOL([MAKENSIS], [makensis], [])
+ fi
+
default_browser=open
case $host_cpu in
;;
esac
AM_CONDITIONAL(OPENCONNECT_WIN32, [ test "$have_win" = "yes" ])
-build_nsis=no
-if test "${MAKENSIS}" != ""; then
+
+if test "$have_win" = "yes"; then
+ #required for vpnc-script-win.js and wintun
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
+ AC_CHECK_PROG(have_unzip, unzip, yes)
+ AC_CHECK_PROG(have_jq, jq, yes)
+
+ if test "${wintun_arch}" != ""; then
+ if test "${have_curl}" != "yes"; then
+ wintun_arch=
+ else
+ if test "${have_unzip}" != "yes"; then
+ wintun_arch=
+ fi
fi
fi
fi
+
+build_nsis=no
+if test "$MAKENSIS" != ""; then
+ #disable NSIS build if we cannot extract wintun
+ if test "${wintun_arch}" != ""; then
+ build_nsis=yes
+ else
+ AC_MSG_WARN([Disabling NSIS installer since wintun cannot be included])
+ fi
+fi
+
AM_CONDITIONAL(BUILD_NSIS, [ test "$build_nsis" = "yes" ])
AM_CONDITIONAL(OPENCONNECT_WINTUN, [ test "${wintun_arch}" != "" ])
AC_MSG_CHECKING([for vpnc-script in standard locations])
if test "$have_win" = "yes"; then
with_vpnc_script=vpnc-script-win.js
+
+ #downloading and amending vpnc-script-win.js depends on curl and jq. Disable it if they are missing, which *should* cause configure to stop
+
+ if test "${have_curl}" != "yes"; then
+ with_vpnc_script=no
+ else
+ if test "${have_jq}" != "yes"; then
+ with_vpnc_script=no
+ fi
+ fi
+ AC_MSG_RESULT([${with_vpnc_script}])
else
for with_vpnc_script in /usr/local/share/vpnc-scripts/vpnc-script /usr/local/sbin/vpnc-script /usr/share/vpnc-scripts/vpnc-script /usr/sbin/vpnc-script /etc/vpnc/vpnc-script; do
if test -x "$with_vpnc_script"; then
AC_MSG_RESULT([${with_vpnc_script}])
fi
fi
-elif test "$with_vpnc_script" = "no"; then
+fi
+if test "$with_vpnc_script" = "no"; then
AC_MSG_ERROR(You cannot disable vpnc-script.
OpenConnect will not function correctly without it.
See https://www.infradead.org/openconnect/vpnc-script.html)
SUMMARY([PPP tests], [$enable_ppp_tests])
SUMMARY([Flask tests], [$have_python36_flask])
SUMMARY([Insecure debugging], [$insecure_debugging])
-SUMMARY([NSIS installer], [$build_nsis])
+if test "$have_win" = "yes"; then
+ SUMMARY([NSIS installer], [$build_nsis])
+ SUMMARY([wintun architecture], [$wintun_arch])
+fi
SUMMARY([External browser], [${with_external_browser}])
SUMMARY([VPNC script], [${with_vpnc_script}])