git clone https://gitlab.com/openconnect/openconnect.git
You can test if vpnc-script exists in your system by ls /etc/vpnc/vpnc-script
or ls /usr/share/vpnc-scripts/vpnc-script
. If it doesn't exist, you can download it from the openconnect project.
# you may need to run under sudo
curl -O https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script
# for windows, you should use vpnc-script-win.js
chmod +x ./vpnc-script
./autogen.sh
./configure --enable-shared --enable-static \
--with-openssl \
--without-gssapi \
--without-libproxy \
--without-stoken \
--without-libpcsclite \
--without-libpskc \
--without-gnutls
# --with-vpnc-script=./vpnc-script-win.js # for windows
# --with-vpnc-script=./vpnc-script # for *nix without vpnc-script installed
-
in config.h, you have to add
#define LIBXML_STATIC
-
for cargo build, you have to use CFLAGS under MSYS2 MINGW64 shell, this avoid error when building rustls. See a similar case of aws-lc-sys here: aws/aws-lc-rs#370
For bash:
export CFLAGS="-D_ISOC11_SOURCE"
For powershell:
$env:CFLAGS="-D_ISOC11_SOURCE";
make