Files
GlobalProtect-openconnect/scripts/build-openconnect-windows.sh

30 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# Build the bundled protocol library with MSYS2's native Windows compiler.
set -euo pipefail
subsystem=$4
export PATH="/$subsystem/bin:/usr/bin:$PATH"
repo=$(cygpath -u "$1")
prefix=$(cygpath -u "$2")
jobs=$3
export ACLOCAL_PATH="/$subsystem/share/aclocal"
source_dir="$repo/crates/openconnect/deps/openconnect"
build_dir="$repo/target/openconnect-windows"
cd "$source_dir"
autoreconf -fi
mkdir -p "$build_dir"
cd "$build_dir"
host=x86_64-w64-mingw32
if [[ $subsystem == clangarm64 ]]; then
host=aarch64-w64-mingw32
export CC=clang AR=llvm-ar RANLIB=llvm-ranlib NM=llvm-nm
fi
"$source_dir/configure" --host="$host" --prefix="$prefix" \
--enable-shared --disable-static --disable-nls --disable-docs --disable-dsa-tests \
--without-libproxy --without-stoken --without-libpcsclite --without-libpskc \
--without-gssapi --with-gnutls --without-openssl --with-gnutls-tss2=no \
--with-vpnc-script=unused
grep -q '^#define OPENCONNECT_GNUTLS 1$' config.h
make -j"$jobs" libopenconnect.la
make install-libLTLIBRARIES
install -Dm644 "$source_dir/openconnect.h" "$prefix/include/openconnect.h"