stunnel / static-curl

static builds cURL with HTTP3
MIT License
231 stars 29 forks source link
curl http-client http3 http3-client

Static cURL with HTTP3 for Linux, macOS and Windows

Static cURL binary built with HTTP3, brotli, and zstd support.

The script will automatically retrieve the latest version of each component.
Simply execute it to compile the most recent version.

Included components

curl -V

Usage

Download the latest release from the Releases page.
Extract the archive and use it.
The binary is built with GitHub Actions.

Release files

Known issue

For Linux glibc versions, if your system’s /etc/nsswitch.conf file is configured with passwd: compat, glibc will attempt to load libnss_compat.so, libnss_nis.so, libpthread.so, etc. These libraries may not be compatible with the statically linked glibc, and the program might crash.
Currently, there is no good solution for this issue, except for compiling glibc within the script.
In this case, it is recommended to use the musl version.

Compile

This script utilizes clang or qbt-musl-cross-make for cross-compilation on Linux, mstorsjo/llvm-mingw for cross-compilation for Windows, providing support for the following architectures:

How to compile

Linux

macOS

Run the following command to compile:

ARCHES="x86_64 arm64" \
    TLS_LIB=openssl \
    CURL_VERSION="" \
    QUICTLS_VERSION="" \
    OPENSSL_VERSION="" \
    NGTCP2_VERSION="" \
    NGHTTP3_VERSION="" \
    NGHTTP2_VERSION="" \
    LIBIDN2_VERSION="" \
    LIBUNISTRING_VERSION="" \
    ZLIB_VERSION="" \
    BROTLI_VERSION="" \
    ZSTD_VERSION="" \
    LIBSSH2_VERSION="" \
    LIBPSL_VERSION="" \
    ARES_VERSION="" \
    bash curl-static-mac.sh

Windows

Environment Variables

Supported Environment Variables list:
For all VERSION variables, leaving them blank will automatically fetch the latest version.

The compiled files will be saved in the current release directory.