Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.47 KB

MANUAL_BUILD.md

File metadata and controls

68 lines (49 loc) · 1.47 KB

Manually build openconnect for static linking

Download source

git clone https://gitlab.com/openconnect/openconnect.git

Download vpnc-script if you don't have it

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

Generate autoconf

./autogen.sh

Configure openconnect

./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

Minor changes for Windows

  • 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";

Build openconnect static library

make