curl/curl
Getting started
This page walks through cloning the repository, building curl and libcurl from source, running the test suite, and pointing the resulting binary at a sample URL. The complete reference for every build option lives in docs/INSTALL.md and docs/INSTALL-CMAKE.md; this page covers the path most contributors take.
Prerequisites
| Requirement | Minimum version | Notes |
|---|---|---|
| C compiler | C89-capable | Must support 64-bit integers and stdint.h. GCC, Clang, MSVC, Intel, and many more are exercised in CI |
| GNU autoconf | 2.59 | Only needed when building from a git checkout (autoreconf -fi to bootstrap) |
| GNU automake | 1.7 | Same |
| GNU libtool | 1.4.2 | Same |
| CMake | 3.18 | Alternative to Autotools; required on Windows |
| perl | 5.8 (5.22 on Windows) | Used by the test suite, doc tooling, and several build scripts |
| pkg-config | recent | Recommended for finding TLS/SSH/compression dependencies |
| A TLS backend | one of many | OpenSSL ≥ 3.0.0, GnuTLS ≥ 3.6.5, mbedTLS ≥ 3.2.0, wolfSSL ≥ 5.0.0, Schannel, Rustls, Apple SecTrust, … |
The full list of supported third-party library versions is in docs/INTERNALS.md.
Build with Autotools (POSIX)
git clone https://github.com/curl/curl
cd curl
autoreconf -fi # only when building from git
./configure --with-openssl # pick a TLS backend
make
make test # optional, builds and runs ~1995 tests
sudo make installIf configure cannot find OpenSSL automatically, point it at a prefix:
./configure --with-openssl=/opt/openssl
# or
PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig ./configure --with-opensslTo explicitly build without TLS:
./configure --without-sslThe configure flag namespace is built up by configure.ac and the macros under m4/. configure --help lists all options.
Build with CMake
cmake -B bld -DCURL_USE_OPENSSL=ON
cmake --build bld -j
ctest --test-dir bld # CMake-driven test wrapper
cmake --install bldCMake variables for picking dependencies follow the pattern CURL_USE_<LIB>=ON|OFF (e.g. CURL_USE_GNUTLS, CURL_USE_WOLFSSL, CURL_USE_LIBSSH). The full set is in CMakeLists.txt. CMake is the only build system supported on Windows.
Disabling features
curl is highly configurable. For embedded systems and constrained builds, see docs/CURL-DISABLE.md and the CURL_DISABLE_* macros in lib/curl_setup.h. Examples:
./configure --disable-ftp --disable-smtp --disable-pop3 --disable-imap --disable-ldapEach disabled feature compiles out of both libcurl and the CLI. Combinations are exercised in the linux.yml and non-native.yml CI matrices.
Verifying the build
src/curl --version
src/curl https://example.com/curl --version prints the libcurl version, the SSL backend, the resolver, the SSH backend, the QUIC backend, and a feature flag list. The same data is available programmatically via curl_version_info() (lib/version.c).
Running the test suite
make test # runs the protocol tests under tests/
( cd tests && ./runtests.pl 1) # run a single test by number
( cd tests && ./runtests.pl -t) # torture mode
( cd tests && ./runtests.pl -p) # show test outputThe functional tests live in tests/data/test* (one file per test, see docs/runtests.md), the unit tests in tests/unit/ and tests/tunit/, and the test driver in tests/runtests.pl. The Perl-based harness spins up its own HTTP, FTP, IMAP, POP3, SMTP, TFTP, and SSH servers under tests/server/, then runs curl against them. See Testing for the testing model.
Sample programs
Reference C programs live under docs/examples/ (~129 small programs). Each demonstrates one feature: simple.c is a one-line GET, multi-app.c shows the multi interface, https.c shows TLS configuration, and so on. They are built into the test suite via docs/examples/Makefile.inc.
Container build
A Dockerfile at the repo root produces an image suitable for running the test suite. The official curl Docker image (curlimages/curl) is built from the same source but configured for distribution.
Where to next?
- Read Architecture to see how
curl_easy_perform()fans out into the multi loop, connection cache, and filter chain - Read How to contribute → Development workflow for the commit/PR process
- Read How to contribute → Testing before adding code
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.