Compare commits

..

No commits in common. "master" and "curl-8_16_0" have entirely different histories.

3912 changed files with 120412 additions and 125435 deletions

View file

@ -38,32 +38,67 @@ commands:
steps:
- run:
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update && sudo apt-get install -y libssh-dev
install-deps:
steps:
- run:
command: |
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip libpsl-dev
sudo python3 -m pip install impacket
install-wolfssl:
steps:
- run:
command: |
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VERSION=5.8.0
echo "Installing wolfSSL $WOLFSSL_VERSION"
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VERSION-stable.tar.gz" | tar -xz
cd wolfssl-$WOLFSSL_VERSION-stable
./autogen.sh
./configure --disable-dependency-tracking --enable-tls13 --enable-all --enable-harden --prefix=$HOME/wssl
make install
install-wolfssh:
steps:
- run:
command: |
# renovate: datasource=github-tags depName=wolfSSL/wolfssh versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSH_VERSION=1.4.19
echo "Installing wolfSSH $WOLFSSH_VERSION"
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/wolfSSL/wolfssh/archive/v$WOLFSSH_VERSION-stable.tar.gz" | tar -xz
cd wolfssh-$WOLFSSH_VERSION-stable
./autogen.sh
./configure --disable-dependency-tracking --with-wolfssl=$HOME/wssl --prefix=$HOME/wssh --enable-scp --enable-sftp --disable-term --disable-examples
make install
configure:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
--with-openssl \
|| { tail -1000 config.log; false; }
configure-openssl-no-verbose:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror \
--with-openssl --disable-verbose \
|| { tail -1000 config.log; false; }
configure-no-proxy:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror \
--with-openssl --disable-proxy \
|| { tail -1000 config.log; false; }
@ -72,7 +107,7 @@ commands:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
--with-openssl --with-libssh \
|| { tail -1000 config.log; false; }
@ -81,40 +116,42 @@ commands:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
--with-openssl --enable-ares \
|| { tail -1000 config.log; false; }
configure-wolfssh:
steps:
- run:
command: |
autoreconf -fi
LDFLAGS="-Wl,-rpath,$HOME/wssh/lib" \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-warnings \
--with-wolfssl=$HOME/wssl --with-wolfssh=$HOME/wssh \
|| { tail -1000 config.log; false; }
configure-cares-debug:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-debug \
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-werror --enable-debug \
--with-openssl --enable-ares \
|| { tail -1000 config.log; false; }
build:
steps:
- run: make -j3 V=1
- run: src/curl --disable --version
- run: make -j3 V=1 examples
test:
steps:
- run:
command: |
source ~/venv/bin/activate
# Revert a CircleCI-specific local setting that makes test 1459
# return 67 (CURLE_LOGIN_DENIED) instead of the
# expected 60 (CURLE_PEER_FAILED_VERIFICATION).
echo 'StrictHostKeyChecking yes' >> ~/.ssh/config
make -j3 V=1 test-ci TFLAGS='-j14'
- run: make -j3 V=1 test-ci TFLAGS='-j14'
executors:
ubuntu:
machine:
image: ubuntu-2204:2025.09.1
image: ubuntu-2004:2024.01.1
jobs:
basic:
@ -126,6 +163,24 @@ jobs:
- build
- test
no-verbose:
executor: ubuntu
steps:
- checkout
- install-deps
- configure-openssl-no-verbose
- build
wolfssh:
executor: ubuntu
steps:
- checkout
- install-deps
- install-wolfssl
- install-wolfssh
- configure-wolfssh
- build
no-proxy:
executor: ubuntu
steps:
@ -157,7 +212,7 @@ jobs:
arm:
machine:
image: ubuntu-2204:2025.09.1
image: ubuntu-2004:2024.01.1
resource_class: arm.medium
steps:
- checkout
@ -168,7 +223,7 @@ jobs:
arm-cares:
machine:
image: ubuntu-2204:2025.09.1
image: ubuntu-2004:2024.01.1
resource_class: arm.medium
steps:
- checkout
@ -195,6 +250,14 @@ workflows:
jobs:
- no-proxy
openssl-no-verbose:
jobs:
- no-verbose
wolfssl-wolfssh:
jobs:
- wolfssh
arm-openssl:
jobs:
- arm

View file

@ -1,59 +0,0 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
---
# https://clang.llvm.org/extra/clang-tidy/
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
Checks:
- clang-analyzer-*
- -clang-analyzer-optin.performance.Padding
- -clang-analyzer-security.ArrayBound # due to false positives with clang-tidy v21.1.0+
- -clang-analyzer-security.insecureAPI.bzero # for FD_ZERO() (seen on macOS)
- -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
- -clang-diagnostic-nullability-extension
- bugprone-assert-side-effect
- bugprone-assignment-in-if-condition
- bugprone-chained-comparison
- bugprone-dynamic-static-initializers
- bugprone-invalid-enum-default-initialization
- bugprone-macro-parentheses
- bugprone-macro-repeated-side-effects
- bugprone-misplaced-operator-in-strlen-in-alloc
- bugprone-misplaced-pointer-arithmetic-in-alloc
- bugprone-not-null-terminated-result
- bugprone-posix-return
- bugprone-redundant-branch-condition
- bugprone-signed-char-misuse
- bugprone-sizeof-expression
- bugprone-suspicious-enum-usage
- bugprone-suspicious-memset-usage
- bugprone-suspicious-missing-comma
- bugprone-suspicious-realloc-usage
- bugprone-suspicious-semicolon
# bugprone-unchecked-string-to-number-conversion # needs converting sscanf to strtol or curlx_str_*
- misc-const-correctness
- misc-header-include-cycle
# misc-redundant-expression # undesired hits due to system macros, e.g. due to POLLIN == POLLRDNORM | POLLRDBAND, then or-ing all three
- portability-*
- readability-duplicate-include
# readability-else-after-return
# readability-enum-initial-value
# readability-function-cognitive-complexity
- readability-inconsistent-declaration-parameter-name
# readability-misleading-indentation # too many false positives and oddball/conditional source
- readability-named-parameter
# readability-redundant-casting # false positives in types that change from platform to platform, even with IgnoreTypeAliases: true
- readability-redundant-control-flow
- readability-redundant-declaration
- readability-redundant-function-ptr-dereference
- readability-redundant-parentheses
- readability-redundant-preprocessor
- readability-suspicious-call-argument
- readability-uppercase-literal-suffix
CheckOptions:
misc-header-include-cycle.IgnoredFilesList: 'curl/curl.h'
readability-inconsistent-declaration-parameter-name.Strict: true
HeaderFilterRegex: '.*' # Default in v22.1.0+

1
.gitattributes vendored
View file

@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: curl
buildconf eol=lf
configure.ac eol=lf
*.m4 eol=lf
*.in eol=lf

View file

@ -4,19 +4,26 @@ Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# How to contribute to curl
How to contribute to curl
=========================
## Join the community
Join the community
------------------
1. Click 'watch' on the GitHub repo
2. Subscribe to the suitable [mailing lists](https://curl.se/mail/)
1. Click 'watch' on the GitHub repo
## Read [CONTRIBUTE](/docs/CONTRIBUTE.md)
2. Subscribe to the suitable [mailing lists](https://curl.se/mail/)
## Send your suggestions using one of these methods:
Read [CONTRIBUTE](/docs/CONTRIBUTE.md)
---------------------------------------
1. in a mail to the mailing list
2. as a [pull request](https://github.com/curl/curl/pulls)
3. as an [issue](https://github.com/curl/curl/issues)
Send your suggestions using one of these methods:
-------------------------------------------------
1. in a mail to the mailing list
2. as a [pull request](https://github.com/curl/curl/pulls)
3. as an [issue](https://github.com/curl/curl/issues)
/ The curl team

View file

@ -13,7 +13,12 @@ body:
Only file bugs here! Ask questions on the mailing lists https://curl.se/mail/
**SECURITY RELATED?** Submit here: https://hackerone.com/curl
**SECURITY RELATED?** Post it here: https://hackerone.com/curl
There are collections of known issues to be aware of:
- https://curl.se/docs/knownbugs.html
- https://curl.se/docs/todo.html
- type: textarea
id: reproducer
@ -35,7 +40,7 @@ body:
label: curl/libcurl version
description: |
Please paste the output of `curl -V` here.
placeholder: 'curl 8.18.0'
placeholder: 'curl 8.2.0'
validations:
required: true

View file

@ -2,37 +2,9 @@
#
# SPDX-License-Identifier: curl
# https://docs.github.com/code-security/dependabot/working-with-dependabot/dependabot-options-reference
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'monthly'
cooldown:
default-days: 7
groups:
gha-dependencies:
patterns:
- '*'
commit-message:
prefix: 'GHA:'
- package-ecosystem: 'pip'
directories:
- '.github/scripts'
- 'tests'
schedule:
interval: 'monthly'
cooldown:
default-days: 7
semver-major-days: 15
semver-minor-days: 7
semver-patch-days: 3
groups:
pip-dependencies:
patterns:
- '*'
commit-message:
prefix: 'GHA:'
interval: 'weekly'

119
.github/labeler.yml vendored
View file

@ -11,7 +11,7 @@
# the files fit into the category, and the any-glob-to-any-file ones are added
# as long as any file matches. The first ones are for "major" categories (the
# PR is all about that one topic, like HTTP/3), while the second ones are
# "addendums" that give useful information about a PR that is really mostly
# "addendums" that give useful information about a PR that's really mostly
# something else (e.g. CI if the PR also touches CI jobs).
#
# N.B. any-glob-to-all-files is misnamed; it acts like one-glob-to-all-files.
@ -28,17 +28,14 @@ appleOS:
- any-glob-to-all-files: "{\
.github/workflows/macos.yml,\
lib/config-mac.h,\
lib/macos*,\
lib/vtls/apple.*,\
m4/curl-apple-sectrust.m4\
lib/macos*\
}"
authentication:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindGSS.cmake,\
CMake/FindLibgsasl.cmake,\
docs/mk-ca-bundle.1,\
docs/libcurl/opts/CURLINFO_HTTPAUTH*,\
docs/libcurl/opts/CURLINFO_PROXYAUTH*,\
docs/libcurl/opts/CURLOPT_KRB*,\
@ -48,6 +45,7 @@ authentication:
docs/libcurl/opts/CURLOPT_USERPWD*,\
docs/libcurl/opts/CURLOPT_XOAUTH*,\
lib/*gssapi*,\
lib/*krb5*,\
lib/*ntlm*,\
lib/curl_sasl.*,\
lib/http_aws*,\
@ -64,16 +62,20 @@ build:
**/Makefile.am,\
**/Makefile.inc,\
**/*.m4,\
**/*.mk,\
*.m4,\
docs/INSTALL-CMAKE.md,\
lib/curl_config-cmake.h.in,\
lib/curl_config.h.cmake,\
lib/libcurl*.in,\
CMake/**,\
CMakeLists.txt,\
configure.ac,\
m4/**,\
Makefile.*,\
packages/**,\
plan9/**,\
projects/**,\
winbuild/**,\
lib/libcurl.def,\
tests/cmake/**\
}"
@ -97,7 +99,7 @@ cmake:
**/CMakeLists.txt,\
CMake/**,\
docs/INSTALL-CMAKE.md,\
lib/curl_config-cmake.h.in,\
lib/curl_config.h.cmake,\
tests/cmake/**\
}"
@ -112,9 +114,6 @@ connecting & proxies:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/happy-eyeballs*,\
docs/cmdline-opts/ipv*,\
docs/cmdline-opts/*proxy*,\
docs/internals/CONNECTION-FILTERS.md,\
docs/examples/ipv6.c,\
docs/libcurl/opts/CURLINFO_CONNECT*,\
@ -138,8 +137,6 @@ connecting & proxies:
lib/if2ip.*,\
lib/noproxy.*,\
lib/socks.*,\
src/tool_cb_soc.*,\
tests/http/*socks*,\
tests/server/socksd.c\
}"
@ -147,7 +144,6 @@ cookies:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibpsl.cmake,\
docs/HTTP-COOKIES.md,\
docs/cmdline-opts/cookie*,\
docs/cmdline-opts/junk-session-cookies.md,\
@ -167,9 +163,9 @@ cryptography:
docs/libcurl/opts/CURLOPT_EGDSOCKET*,\
lib/*sha256*,\
lib/*sha512*,\
lib/curl_des.*,\
lib/curl_hmac.*,\
lib/curl_md?.*,\
lib/curl_ntlm_core.*,\
lib/md?.*,\
lib/rand.*\
}"
@ -187,10 +183,11 @@ documentation:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/checkdocs.yml,\
.github/scripts/pyspelling*,\
.github/scripts/requirements-docs.txt,\
.github/scripts/requirements-proselint.txt,\
.github/scripts/typos*,\
.github/scripts/badwords.*,\
.github/scripts/cd2cd,\
.github/scripts/cd2nroff,\
.github/scripts/cdall.pl,\
.github/scripts/nroff2cd,\
.github/scripts/verify-examples.pl,\
.github/scripts/verify-synopsis.pl,\
**/*.md,\
@ -201,11 +198,7 @@ documentation:
LICENSES/**,\
README,\
RELEASE-NOTES,\
scripts/badwords.*,\
scripts/cd*,\
scripts/mdlinkcheck,\
scripts/nroff2cd,\
scripts/release-notes.pl\
scripts/cd*\
}"
- all-globs-to-all-files:
# negative matches
@ -216,7 +209,6 @@ FTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/ftp*,\
docs/libcurl/opts/CURLINFO_FTP*,\
docs/libcurl/opts/CURLOPT_FTP*,\
docs/libcurl/opts/CURLOPT_WILDCARDMATCH*,\
@ -224,10 +216,7 @@ FTP:
lib/curl_fnmatch.*,\
lib/curl_range.*,\
lib/ftp*,\
tests/ftp*,\
tests/http/*ftpd*,\
tests/http/testenv/*ftpd*,\
tests/libtest/*_ftp_*\
tests/ftp*\
}"
GOPHER:
@ -241,8 +230,6 @@ HTTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/HTTPSRR.md,\
docs/HSTS.md,\
docs/examples/hsts*,\
docs/examples/http-*,\
docs/examples/httpput*,\
@ -250,10 +237,10 @@ HTTP:
docs/examples/*post*,\
docs/HTTP-COOKIES.md,\
docs/libcurl/opts/CURLINFO_COOKIE*,\
docs/libcurl/opts/CURLINFO_HTTP*,\
docs/libcurl/opts/CURLOPT_COOKIE*,\
docs/libcurl/opts/CURLINFO_HTTP_**,\
docs/libcurl/opts/CURLINFO_REDIRECT*,\
docs/libcurl/opts/CURLINFO_REFER*,\
docs/libcurl/opts/CURLOPT_COOKIE*,\
docs/libcurl/opts/CURLOPT_FOLLOWLOCATION*,\
docs/libcurl/opts/CURLOPT_HSTS*,\
docs/libcurl/opts/CURLOPT_HTTP*,\
@ -292,7 +279,9 @@ HTTP/3:
- all:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/http3-linux.yml,\
.github/workflows/ngtcp2*,\
.github/workflows/quiche*,\
.github/workflows/osslq*,\
CMake/FindNGHTTP3.cmake,\
CMake/FindNGTCP2.cmake,\
docs/HTTP3.md,\
@ -352,7 +341,6 @@ MQTT:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/internals/MQTT.md,\
lib/mqtt*,\
tests/server/mqttd.c\
}"
@ -361,28 +349,18 @@ name lookup:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibidn2.cmake,\
docs/cmdline-opts/doh*,\
docs/cmdline-opts/dns*,\
docs/examples/resolve.c,\
docs/internals/THRDPOOL-AND-QUEUE.md,\
docs/libcurl/opts/CURLINFO_NAMELOOKUP*,\
docs/libcurl/opts/CURLOPT_DNS*,\
docs/libcurl/opts/CURLOPT_DOH*,\
docs/libcurl/opts/CURLOPT_RESOLVE*,\
lib/*addrinfo*,\
lib/asyn*,\
lib/cf-dns.*,\
lib/curl_gethostname.*,\
lib/dns*,\
lib/doh*,\
lib/host*,\
lib/idn*,\
lib/inet_pton.*,\
lib/socketpair*,\
lib/thrdpool.*,\
lib/thrdqueue.*,\
tests/http/*resolve.py,\
tests/server/dnsd.c,\
tests/server/resolve.c\
}"
@ -394,6 +372,14 @@ POP3:
lib/pop3.*\
}"
RTMP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibrtmp.cmake,\
lib/curl_rtmp.*\
}"
RTSP:
- all:
- changed-files:
@ -409,17 +395,12 @@ SCP/SFTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibssh.cmake,\
CMake/FindLibssh2.cmake,\
docs/cmdline-opts/knownhosts.md,\
docs/libcurl/opts/CURLOPT_SSH*,\
docs/examples/sftp*,\
lib/vssh/**,\
tests/sshhelp.pm,\
tests/sshserver.pl,\
tests/http/*scp*,\
tests/http/*sftp*,\
tests/http/testenv/sshd.py\
tests/sshserver.pl\
}"
script:
@ -429,9 +410,8 @@ script:
**/*.pl,\
**/*.sh,\
curl-config.in,\
docs/curl-config.md,\
docs/mk-ca-bundle.md,\
docs/wcurl.md,\
docs/curl-config.1,\
docs/mk-ca-bundle.1,\
docs/THANKS-filter,\
scripts/**\
}"
@ -448,7 +428,6 @@ SMTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/mail*,\
docs/examples/smtp-*,\
docs/libcurl/opts/CURLOPT_MAIL*,\
lib/smtp.*\
@ -473,25 +452,16 @@ TLS:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindGnuTLS.cmake,\
CMake/FindMbedTLS.cmake,\
CMake/FindWolfSSL.cmake,\
CMake/FindRustls.cmake,\
docs/CIPHERS-TLS12.md,\
docs/SSL*,\
docs/cmdline-opts/dump-ca-embed.md,\
docs/cmdline-opts/*cert*,\
docs/cmdline-opts/*ssl*,\
docs/cmdline-opts/*tls*,\
docs/examples/ssl*,\
docs/examples/*ssl.*,\
docs/examples/*tls.*,\
docs/internals/TLS-SESSIONS.md,\
docs/SSL*,\
docs/libcurl/curl_global_sslset*,\
docs/libcurl/curl_easy_ssls*,\
docs/libcurl/opts/CURLINFO_CA*,\
docs/libcurl/opts/CURLINFO_CERT*,\
docs/libcurl/opts/CURLINFO_EARLYDATA*,\
docs/libcurl/opts/CURLINFO_SSL*,\
docs/libcurl/opts/CURLINFO_TLS*,\
docs/libcurl/opts/CURLOPT_CA*,\
@ -506,8 +476,7 @@ TLS:
m4/curl-openssl.m4,\
m4/curl-rustls.m4,\
m4/curl-schannel.m4,\
m4/curl-wolfssl.m4,\
src/tool_ssls.*\
m4/curl-wolfssl.m4\
}"
URL:
@ -525,32 +494,32 @@ WebSocket:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/internals/WEBSOCKET.md,\
docs/internals/WEBSOCKET.md*,\
docs/examples/websocket*,\
docs/libcurl/curl_ws_*,\
docs/libcurl/libcurl-ws*,\
docs/libcurl/opts/CURLOPT_WS_*,\
include/curl/websockets.h,\
lib/ws.*,\
tests/http/clients/ws*,\
tests/http/test_20_websockets.py,\
tests/http/testenv/ws*,\
tests/libtest/cli_ws*\
tests/http/testenv/ws*\
}"
Windows:
- all:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/windows.yml,\
appveyor.*,\
.github/workflows/windows.yml,\
CMake/win32-cache.cmake,\
lib/*win32*,\
lib/curlx/fopen.*,\
lib/curlx/multibyte.*,\
lib/curlx/winapi.*,\
lib/rename.*,\
lib/vtls/schannel*,\
m4/curl-schannel.m4,\
projects/Windows/**,\
projects/**,\
src/tool_doswin.c,\
winbuild/**,\
lib/libcurl.def\
}"

87
.github/scripts/badwords.pl vendored Executable file
View file

@ -0,0 +1,87 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# bad[:=]correct
#
# If separator is '=', the string will be compared case sensitively.
# If separator is ':', the check is done case insensitively.
#
# To add white listed uses of bad words that are removed before checking for
# the bad ones:
#
# ---(accepted word)
#
use strict;
use warnings;
my @whitelist;
my %alt;
my %exactcase;
my @w;
while(<STDIN>) {
chomp;
if($_ =~ /^#/) {
next;
}
if($_ =~ /^---(.*)/) {
push @whitelist, $1;
}
elsif($_ =~ /^([^:=]*)([:=])(.*)/) {
my ($bad, $sep, $better)=($1, $2, $3);
push @w, $bad;
$alt{$bad} = $better;
if($sep eq "=") {
$exactcase{$bad} = 1;
}
}
}
my $errors = 0;
sub file {
my ($f) = @_;
my $l = 0;
open(F, "<$f");
while(<F>) {
my $in = $_;
$l++;
chomp $in;
if($in =~ /^ /) {
next;
}
# remove the link part
$in =~ s/(\[.*\])\(.*\)/$1/g;
# remove backticked texts
$in =~ s/\`.*\`//g;
# remove whitelisted patterns
for my $p (@whitelist) {
$in =~ s/$p//g;
}
foreach my $w (@w) {
my $case = $exactcase{$w};
if(($in =~ /^(.*)$w/i && !$case) ||
($in =~ /^(.*)$w/ && $case) ) {
my $p = $1;
my $c = length($p)+1;
print STDERR "$f:$l:$c: error: found bad word \"$w\"\n";
printf STDERR " %4d | $in\n", $l;
printf STDERR " | %*s^%s\n", length($p), " ",
"~" x (length($w)-1);
printf STDERR " maybe use \"%s\" instead?\n", $alt{$w};
$errors++;
}
}
}
close(F);
}
my @files = @ARGV;
foreach my $each (@files) {
file($each);
}
exit $errors;

75
.github/scripts/badwords.txt vendored Normal file
View file

@ -0,0 +1,75 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
back-end:backend
e-mail:email
run-time:runtime
set-up:setup
tool chain:toolchain
tool-chain:toolchain
wild-card:wildcard
wild card:wildcard
i'm:I am
you've:You have
we've:we have
we're:we are
we'll:we will
we'd:we would
they've:They have
they're:They are
they'll:They will
they'd:They would
you've:you have
you'd:you would
you'll:you will
you're:you are
should've:should have
don't=do not
could've:could have
doesn't:does not
isn't:is not
aren't:are not
a html: an html
a http: an http
a ftp: an ftp
a IPv4: an IPv4
a IPv6: an IPv6
url =URL
internet\b=Internet
isation:ization
\bit's:it is
it'd:it would
there's:there is
[^.]\. And: Rewrite it somehow?
^(And|So|But) = Rewrite it somehow?
\. But: Rewrite it somehow?
\. So : Rewrite without "so" ?
dir :directory
can't:cannot
that's:that is
web page:webpage
host name\b:hostname
host names\b:hostnames
file name\b:filename
file names\b:filenames
\buser name\b:username
\buser names\b:usernames
\bpass phrase:passphrase
didn't:did not
doesn't:does not
won't:will not
couldn't:could not
\bwill\b:rewrite to present tense
\b32bit=32-bit
\b64bit=64-bit
32 bit\b=32-bit
64 bit\b=64-bit
64-bits:64 bits or 64-bit
32-bits:32 bits or 32-bit
\bvery\b:rephrase using an alternative word
\bCurl\b=curl
\bLibcurl\b=libcurl
---WWW::Curl
---NET::Curl
---Curl Corporation

View file

@ -16,7 +16,7 @@ use warnings;
my @asyms;
open(S, "<./docs/libcurl/symbols-in-versions")
|| die "cannot find symbols-in-versions";
|| die "can't find symbols-in-versions";
while(<S>) {
if(/^([^ ]*) /) {
push @asyms, $1;
@ -30,7 +30,7 @@ my @aopts = (
);
open(O, "<./docs/options-in-versions")
|| die "cannot find options-in-versions";
|| die "can't find options-in-versions";
while(<O>) {
chomp;
if(/^([^ ]+)/) {
@ -50,7 +50,7 @@ while(<O>) {
close(O);
open(C, "<./.github/scripts/spellcheck.curl")
|| die "cannot find spellcheck.curl";
|| die "can't find spellcheck.curl";
while(<C>) {
if(/^\#/) {
next;
@ -99,11 +99,9 @@ sub process {
# *italics*
$l =~ s/\*(\S.*?)\*//g;
# strip out https URLs, we do not want them spellchecked
# strip out https URLs, we don't want them spellchecked
$l =~ s!https://[a-z0-9\#_/.-]+!!gi;
# strip links, both name and target
$l =~ s/(\[.*?\])\(.*?\)//g;
$out .= $l;
}
close(F);
@ -121,10 +119,6 @@ sub process {
}
}
my @filemasks = @ARGV;
open(my $git_ls_files, '-|', 'git', 'ls-files', '--', @filemasks) or die "Failed running git ls-files: $!";
while(my $f = <$git_ls_files>) {
chomp $f;
for my $f (@ARGV) {
process($f);
}
close $git_ls_files;

View file

@ -45,18 +45,18 @@ my %remove = (
'#define HAVE_BROTLI 1' => 1,
'#define HAVE_BROTLI_DECODE_H 1' => 1,
'#define HAVE_DLFCN_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_GENERIC_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_KRB5_H 1' => 1,
'#define HAVE_INTTYPES_H 1' => 1,
'#define HAVE_LDAP_H 1' => 1,
'#define HAVE_LDAP_SSL 1' => 1,
'#define HAVE_LIBBROTLIDEC 1' => 1,
'#define HAVE_LIBPSL_H 1' => 1,
'#define HAVE_LIBRTMP_RTMP_H 1' => 1,
'#define HAVE_LIBSOCKET 1' => 1,
'#define HAVE_LIBSSH' => 1,
'#define HAVE_LIBSSH2 1' => 1,
'#define HAVE_LIBSSL 1' => 1,
'#define HAVE_LIBWOLFSSH' => 1,
'#define HAVE_LIBZSTD 1' => 1,
'#define HAVE_NGHTTP2_NGHTTP2_H 1' => 1,
'#define HAVE_NGHTTP3_NGHTTP3_H 1' => 1,
@ -67,6 +67,7 @@ my %remove = (
'#define HAVE_OPENSSL_PEM_H 1' => 1,
'#define HAVE_OPENSSL_RSA_H 1' => 1,
'#define HAVE_OPENSSL_SSL_H 1' => 1,
'#define HAVE_OPENSSL_X509_H 1' => 1,
'#define HAVE_QUICHE_H 1' => 1,
'#define HAVE_SSL_SET_QUIC_TLS_CBS 1' => 1,
'#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
@ -77,6 +78,7 @@ my %remove = (
'#define HAVE_SYS_STAT_H 1' => 1,
'#define HAVE_SYS_XATTR_H 1' => 1,
'#define HAVE_UNICODE_UIDNA_H 1' => 1,
'#define HAVE_WOLFSSH_SSH_H 1' => 1,
'#define HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
'#define HAVE_ZSTD 1' => 1,
'#define HAVE_ZSTD_H 1' => 1,
@ -89,6 +91,7 @@ my %remove = (
'#define PACKAGE_TARNAME "curl"' => 1,
'#define PACKAGE_URL ""' => 1,
'#define PACKAGE_VERSION "-"' => 1,
'#define SIZEOF_LONG_LONG 8' => 1,
'#define VERSION "-"' => 1,
'#define _FILE_OFFSET_BITS 64' => 1,
);
@ -133,5 +136,6 @@ foreach my $v (keys %remove) {
}
}
# return the exit code from diff
exit system('diff', ('-u', '/tmp/autotools', '/tmp/cmake')) >> 8;
exit system("diff -u /tmp/autotools /tmp/cmake") >> 8;

View file

@ -7,7 +7,7 @@ bu
clen
CNA
hel
htpts
htpt
inout
PASE
passwor

View file

@ -7,16 +7,14 @@ set -eu
cd "$(dirname "${0}")"/../..
git ls-files -z | xargs -0 -r \
# shellcheck disable=SC2046
codespell \
--skip '.github/scripts/pyspelling.words' \
--skip '.github/scripts/spellcheck.words' \
--skip '.github/scripts/typos.toml' \
--skip 'docs/THANKS' \
--skip 'projects/OS400/*' \
--skip 'projects/vms/*' \
--skip 'RELEASE-NOTES' \
--skip 'packages/*' \
--skip 'scripts/wcurl' \
--skip 'tests/unit/unit1625.c' \
--skip 'winbuild/*' \
--ignore-regex '.*spellchecker:disable-line' \
--ignore-words '.github/scripts/codespell-ignore.words' \
--
--ignore-words '.github/scripts/codespell-ignore.txt' \
$(git ls-files)

View file

@ -11,6 +11,7 @@ set -eu
gitonly=".git*
^.*
^appveyor.*
^buildconf
^GIT-INFO.md
^README.md
^renovate.json
@ -18,15 +19,17 @@ gitonly=".git*
^SECURITY.md
^LICENSES/*
^docs/examples/adddocsref.pl
^docs/tests/CI.md
^docs/THANKS-filter
^projects/Windows/*
^scripts/ciconfig.pl
^scripts/cijobs.pl
^scripts/contributors.sh
^scripts/contrithanks.sh
^scripts/delta
^scripts/installcheck.sh
^scripts/release-notes.pl
^scripts/singleuse.pl"
^scripts/singleuse.pl
^tests/CI.md"
tarfiles="$(mktemp)"
gitfiles="$(mktemp)"

View file

@ -116,6 +116,7 @@ my %commonrc = (
'26' => 1,
);
sub runone {
my $a;
my $nargs = getnum(60) + 1;

View file

@ -1,5 +0,0 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
pyspelling==2.12.1

View file

@ -1,9 +0,0 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
cmakelang==0.6.13
codespell==2.4.2
pytype==2024.10.11
reuse==6.2.0
ruff==0.15.10

View file

@ -3,11 +3,7 @@
#
# SPDX-License-Identifier: curl
set -eu
cd "$(dirname "${0}")"/../..
git grep -z -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' | xargs -0 -r \
shellcheck --exclude=1091,2248 \
# shellcheck disable=SC2046
shellcheck --exclude=1091 \
--enable=avoid-nullary-conditions,deprecate-which \
--
$(grep -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' $(git ls-files))

195
.github/scripts/spacecheck.pl vendored Executable file
View file

@ -0,0 +1,195 @@
#!/usr/bin/env perl
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Viktor Szakats
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
use strict;
use warnings;
my @tabs = (
"^m4/zz40-xc-ovr.m4",
"Makefile\\.(am|example)\$",
"/mkfile",
"\\.(sln|vc)\$",
"^tests/data/test",
);
my @mixed_eol = (
"^tests/data/test",
);
my @need_crlf = (
"\\.(bat|sln)\$",
"^winbuild/.+\\.md\$",
);
my @space_at_eol = (
"^tests/data/test",
);
my @non_ascii_allowed = (
'\xC3\xB6', # UTF-8 for https://codepoints.net/U+00F6 LATIN SMALL LETTER O WITH DIAERESIS
);
my $non_ascii_allowed = join(', ', @non_ascii_allowed);
my @non_ascii = (
".github/scripts/spellcheck.words",
".mailmap",
"RELEASE-NOTES",
"docs/BINDINGS.md",
"docs/THANKS",
"docs/THANKS-filter",
);
sub fn_match {
my ($filename, @masklist) = @_;
foreach my $mask (@masklist) {
if($filename =~ $mask) {
return 1;
}
}
return 0;
}
sub eol_detect {
my ($content) = @_;
my $cr = () = $content =~ /\r/g;
my $lf = () = $content =~ /\n/g;
if($cr > 0 && $lf == 0) {
return "cr";
}
elsif($cr == 0 && $lf > 0) {
return "lf";
}
elsif($cr == 0 && $lf == 0) {
return "bin";
}
elsif($cr == $lf) {
return "crlf";
}
return "";
}
my $issues = 0;
open my $git_ls_files, '-|', 'git ls-files' or die "Failed running git ls-files: $!";
while(my $filename = <$git_ls_files>) {
chomp $filename;
open my $fh, '<', $filename or die "Cannot open '$filename': $!";
my $content = do { local $/; <$fh> };
close $fh;
my @err = ();
if(!fn_match($filename, @tabs) &&
$content =~ /\t/) {
push @err, "content: has tab";
}
my $eol = eol_detect($content);
if($eol eq "" &&
!fn_match($filename, @mixed_eol)) {
push @err, "content: has mixed EOL types";
}
if($eol ne "crlf" &&
fn_match($filename, @need_crlf)) {
push @err, "content: must use CRLF EOL for this file type";
}
if($eol ne "lf" && $content ne "" &&
!fn_match($filename, @need_crlf) &&
!fn_match($filename, @mixed_eol)) {
push @err, "content: must use LF EOL for this file type";
}
if(!fn_match($filename, @space_at_eol) &&
$content =~ /[ \t]\n/) {
my $line;
for my $l (split(/\n/, $content)) {
$line++;
if($l =~ /[ \t]$/) {
push @err, "line $line: trailing whitespace";
}
}
}
if($content ne "" &&
$content !~ /\n\z/) {
push @err, "content: has no EOL at EOF";
}
if($content =~ /\n\n\z/ ||
$content =~ /\r\n\r\n\z/) {
push @err, "content: has multiple EOL at EOF";
}
if($content =~ /\n\n\n\n/ ||
$content =~ /\r\n\r\n\r\n\r\n/) {
push @err, "content: has 3 or more consecutive empty lines";
}
if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) {
push @err, "content: has binary contents";
}
if($filename !~ /tests\/data/) {
# the tests have no allowed UTF bytes
$content =~ s/[$non_ascii_allowed]//g;
}
if(!fn_match($filename, @non_ascii) &&
($content =~ /([\x80-\xff]+)/)) {
my $non = $1;
my $hex;
for my $e (split(//, $non)) {
$hex .= sprintf("%s%02x", $hex ? " ": "", ord($e));
}
my $line;
for my $l (split(/\n/, $content)) {
$line++;
if($l =~ /([\x80-\xff]+)/) {
push @err, "line $line: has non-ASCII: '$non' ($hex)";
}
}
}
if(@err) {
$issues++;
foreach my $err (@err) {
print "$filename: $err\n";
}
}
}
close $git_ls_files;
if($issues) {
exit 1;
}

View file

@ -133,10 +133,9 @@ curl_multi_setopt
curl_multi_assign
curl_multi_get_handles
curl_multi_get_offt
curl_multi_notify_disable
curl_multi_notify_enable
curl_pushheader_bynum
curl_pushheader_byname
curl_multi_waitfds
curl_easy_option_by_name
curl_easy_option_by_id
curl_easy_option_next

View file

@ -53,7 +53,6 @@ axTLS
backend
backends
backoff
backtick
backticks
balancers
Baratov
@ -98,7 +97,6 @@ changeset
CharConv
charset
charsets
checkdocs
checksrc
checksums
chgrp
@ -124,7 +122,6 @@ CMakeLists
CNA
CNAME
CNAMEs
CodeQL
CODESET
codeset
CodeSonar
@ -150,6 +147,7 @@ CSeq
csh
cshrc
CTRL
cURL
CURLcode
curldown
CURLE
@ -172,10 +170,8 @@ dbg
Debian
DEBUGBUILD
decrypt
decrypted
decrypting
deepcode
defacto
DELE
DER
dereference
@ -204,7 +200,6 @@ DLLs
DNS
dns
dnsop
DNSSEC
DoH
DoT
doxygen
@ -218,7 +213,6 @@ dynbuf
EAGAIN
EBCDIC
ECC
ECCN
ECDHE
ECH
ECHConfig
@ -236,9 +230,9 @@ else's
encodings
enctype
endianness
enums
Engler
enum
enums
epoll
EPRT
EPSV
@ -249,7 +243,6 @@ et
etag
ETag
ETags
exa
exe
executables
EXPN
@ -263,7 +256,6 @@ Fedora
Feltzing
ffi
filesize
filesystem
FindCURL
FLOSS
fnmatch
@ -300,12 +292,9 @@ getinfo
GETing
getpwuid
ggcov
GHA
Ghedini
giga
Gisle
Glesys
glibc
globbed
globbing
gmail
@ -366,6 +355,7 @@ HTTPS
https
HTTPSRR
hyper's
Högskolan
IANA
Icecast
ICONV
@ -387,7 +377,6 @@ imap
IMAPS
imaps
impacket
implementers
init
initializer
inlined
@ -426,7 +415,6 @@ kerberos
Keychain
keychain
KiB
kibibyte
kickstart
Kirei
Knauf
@ -435,15 +423,14 @@ Krb
krb
Kubernetes
Kuhrt
Kungliga
Largefile
LDAP
ldap
LDAPS
ldaps
LF
LGPL
LGTM
libbacktrace
libbrotlidec
libc
libcurl
@ -473,7 +460,6 @@ libWebSocket
libz
libzstd
LineageOS
linter
linux
lldb
ln
@ -504,7 +490,6 @@ Mavrogiannopoulos
Mbed
mbedTLS
md
mebibyte
Meglio
memdebug
MesaLink
@ -577,7 +562,6 @@ Necko
NetBSD
netrc
netstat
NetWare
Netware
NFS
nghttp
@ -634,7 +618,6 @@ PEM
pem
perl
permafailing
peta
PINGs
pipelining
PKCS
@ -721,7 +704,6 @@ ROADMAP
Roadmap
Rockbox
roffit
RPC
RPG
RR
RRs
@ -760,7 +742,6 @@ scp
SDK
se
SEB
SecTrust
SEK
selectable
Serv
@ -778,7 +759,6 @@ singlecwd
SINIX
Sintonen
sizeof
Slowloris
SLE
slist
sln
@ -810,7 +790,6 @@ sprintf
src
SRP
SRWLOCK
SSI
SSL
ssl
SSLeay
@ -827,7 +806,6 @@ stateful
statvfs
stderr
stdin
stdint
stdout
Steinar
Stenberg
@ -869,7 +847,7 @@ Tatsuhiro
TBD
TCP
tcpdump
tera
Tekniska
testability
testcurl
TFTP
@ -906,9 +884,7 @@ UDP
UI
UID
UIDL
uint
Ultrix
umask
Unary
unassign
UNC
@ -953,7 +929,6 @@ VC
vcpkg
vexxhost
Viktor
virtualized
Virtuozzo
VLAN
VM
@ -974,13 +949,12 @@ watchOS
WAV
WB
wcurl
web page
WebDAV
WebOS
webpage
webpages
WebSocket
WEBSOCKET
Wget
WHATWG
whitespace
Whitespaces
@ -999,9 +973,7 @@ www
Xbox
XDG
xdigit
XHTML
Xilinx
xmllint
XP
Xtensa
XYZ

View file

@ -2,7 +2,6 @@
#
# SPDX-License-Identifier: curl
#
# Docs: https://facelessuser.github.io/pyspelling/configuration/
# Docs: https://github.com/UnicornGlobal/spellcheck-github-actions
matrix:
- name: Markdown
@ -30,4 +29,4 @@ matrix:
- 'strong'
- 'em'
sources:
- '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md|!tests/data/data*.md'
- '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md'

View file

@ -4,16 +4,14 @@
[default]
extend-ignore-identifiers-re = [
"^(ba|fo|pn|PN|UE)$",
"^(CNA|cpy|ser)$",
"^(ECT0|ECT1|HELO|htpts|PASE)$",
"^(ba|pn|PN|UE)$",
"^(CNA|ser)$",
"^(ECT0|ECT1|HELO|htpt|PASE)$",
"^[A-Za-z0-9_-]*(EDE|GOST)[A-Z0-9_-]*$", # ciphers
"^0x[0-9a-fA-F]+FUL$", # unsigned long hex literals ending with 'F'
"^[0-9a-zA-Z+]{64,}$", # possibly base64
"^(eyeballers|HELO_smtp|Januar|optin|passin|perfec|SMTP_HELO)$",
"^(clen|req_clen|smtp_perform_helo|smtp_state_helo_resp|Tru64|_stati64)$",
"(_ccontains|_controllen|O_WRONLY|secur32)",
"proxys", # this should be limited to tests/http/*. Short for secure proxy.
"^[0-9a-zA-Z+]{64,}$", # possibly base64
"^(Januar|eyeballers|HELO_smtp|kno22|MkTypLibCompatible|optin|passin|perfec|__SecURE|SMTP_HELO|v_alue)$",
"^(clen|req_clen|smtp_perform_helo|smtp_state_helo_resp|_stati64)$",
]
extend-ignore-re = [
@ -22,15 +20,10 @@ extend-ignore-re = [
[files]
extend-exclude = [
".github/scripts/codespell-ignore.words",
".github/scripts/pyspelling.words",
".github/scripts/codespell-ignore.txt",
".github/scripts/spellcheck.words",
"docs/THANKS",
"projects/OS400/*",
"projects/vms/*",
"projects/Windows/tmpl/curl.vcxproj",
"projects/Windows/tmpl/libcurl.vcxproj",
"RELEASE-NOTES",
"packages/*",
"scripts/wcurl",
"tests/data/test*",
"tests/unit/unit1625.c",
"winbuild/*",
]

View file

@ -37,14 +37,12 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' .
'-Wno-unused-parameter -Wno-unused-but-set-variable ' .
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION') >> 8;
my $rc = system("gcc -c test.c -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION -Wunused -Werror -Wall -Wno-unused-but-set-variable -I include") >> 8;
return $rc;
}
sub checksrc {
my $rc = system($check, ('test.c')) >> 8;
my $rc = system("$check test.c") >> 8;
return $rc;
}
@ -65,9 +63,9 @@ sub extract {
elsif($syn == 1) {
if(/^~~~/) {
$syn++;
print O "/* !checksrc! disable BANNEDFUNC all */\n"; # for fopen()
print O "/* !checksrc! disable COPYRIGHT all */\n";
print O "/* !checksrc! disable UNUSEDIGNORE all */\n";
print O "/* !checksrc! disable COPYRIGHT all */\n";
print O "/* !checksrc! disable FOPENMODE all */\n";
printf O "#line %d \"$f\"\n", $iline+1;
}
}

View file

@ -35,11 +35,11 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' .
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_TYPECHECK') >> 8;
my $rc = system("gcc -c test.c -DCURL_DISABLE_TYPECHECK -DCURL_ALLOW_OLD_MULTI_SOCKET -I include") >> 8;
return $rc;
}
sub extract {
my($f) = @_;
my $syn = 0;

View file

@ -5,11 +5,9 @@
set -eu
cd "$(dirname "${0}")"/../..
git ls-files '*.yaml' '*.yml' -z | xargs -0 -r \
# shellcheck disable=SC2046
yamllint \
--format standard \
--strict \
--config-data .github/scripts/yamlcheck.yaml \
--
--config-data "$(dirname "$0")/yamlcheck.yaml" \
$(git ls-files '*.yaml' '*.yml')

2
.github/stale.yml vendored
View file

@ -6,7 +6,7 @@
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels are never considered stale
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security

View file

@ -16,10 +16,10 @@ permissions: {}
jobs:
split:
name: 'split'
runs-on: ubuntu-24.04-arm
runs-on: ubuntu-latest
if: ${{ github.event.sender.login == 'appveyor[bot]' }}
permissions:
statuses: write # To update build statuses
statuses: write
steps:
- name: 'Create individual AppVeyor build statuses'
if: ${{ github.event.sha && github.event.target_url }}
@ -29,7 +29,7 @@ jobs:
APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "${APPVEYOR_TARGET_URL}" | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s -- | \
echo "${APPVEYOR_TARGET_URL}" | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s | \
jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
state: (.status | sub("queued"; "pending")

View file

@ -14,8 +14,8 @@ name: 'Docs'
- '*/ci'
paths:
- '.github/workflows/checkdocs.yml'
- '.github/scripts/**'
- 'scripts/**'
- '.github/scripts/mdlinkcheck'
- '/scripts/**'
- '**.md'
- 'docs/*'
pull_request:
@ -24,7 +24,7 @@ name: 'Docs'
paths:
- '.github/workflows/checkdocs.yml'
- '.github/scripts/**'
- 'scripts/**'
- '.github/scripts/mdlinkcheck'
- '**.md'
- 'docs/*'
@ -35,96 +35,127 @@ concurrency:
permissions: {}
jobs:
# config file help: https://github.com/amperser/proselint/
proselint:
name: 'proselint'
runs-on: ubuntu-24.04-arm
# proselint:
# name: 'proselint'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
# with:
# persist-credentials: false
#
# - name: 'install prereqs'
# run: |
# sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
# sudo apt-get -o Dpkg::Use-Pty=0 update
# sudo rm -f /var/lib/man-db/auto-update
# sudo apt-get -o Dpkg::Use-Pty=0 install python3-proselint
#
# # config file help: https://github.com/amperser/proselint/
# - name: 'create proselint config'
# run: |
# cat <<JSON > ~/.proselintrc.json
# {
# "checks": {
# "typography.diacritical_marks": false,
# "typography.symbols": false,
# "annotations.misc": false,
# "security.password": false,
# "misc.annotations": false
# }
# }
# JSON
#
# - name: 'trim headers off all *.md files'
# run: git ls-files -z '*.md' | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl
#
# - name: 'check prose'
# run: git ls-files -z '*.md' | grep -Evz 'CHECKSRC.md|DISTROS.md|curl_mprintf.md|CURLOPT_INTERFACE.md|interface.md' | xargs -0 proselint README
#
# # This is for CHECKSRC and files with aggressive exclamation mark needs
# - name: 'create second proselint config'
# run: |
# cat <<JSON > ~/.proselintrc.json
# {
# "checks": {
# "typography.diacritical_marks": false,
# "typography.symbols": false,
# "typography.exclamation": false,
# "lexical_illusions.misc": false,
# "annotations.misc": false
# }
# }
# JSON
#
# - name: 'check special prose'
# run: proselint docs/internals/CHECKSRC.md docs/libcurl/curl_mprintf.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md
linkcheck:
name: 'linkcheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'install prereqs'
run: |
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r .github/scripts/requirements-proselint.txt
- name: 'mdlinkcheck'
run: ./scripts/mdlinkcheck
- name: 'trim headers off all *.md files'
run: git ls-files '*.md' -z | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl
- name: 'check prose'
run: |
cat <<JSON > ~/.proselintrc.json
{
"checks": {
"annotations.misc": false,
"lexical_illusions": false,
"misc.annotations": false,
"redundancy.misc.garner": false,
"security.password": false,
"spelling.ve_of": false,
"typography.diacritical_marks": false,
"typography.symbols": false
}
}
JSON
source ~/venv/bin/activate
git ls-files README '*.md' -z | grep -Evz '(CHECKSRC|DISTROS|CURLOPT_INTERFACE|interface)\.md' | xargs -0 proselint check --
- name: 'check special prose' # For CHECKSRC and files with aggressive exclamation mark needs
run: |
cat <<JSON > ~/.proselintrc.json
{
"checks": {
"annotations.misc": false,
"lexical_illusions": false,
"typography.diacritical_marks": false,
"typography.punctuation.exclamation": false,
"typography.symbols": false
}
}
JSON
source ~/venv/bin/activate
proselint check docs/internals/CHECKSRC.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md
pyspelling:
name: 'pyspelling'
spellcheck:
name: 'spellcheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'trim all *.md files in docs/'
run: .github/scripts/cleancmd.pl 'docs/*.md'
- name: 'install'
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install aspell aspell-en
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r .github/scripts/requirements-docs.txt
# shellcheck disable=SC2046
.github/scripts/cleancmd.pl $(find docs -name '*.md')
- name: 'check spelling'
run: |
source ~/venv/bin/activate
# setup the custom wordlist
grep -v '^#' .github/scripts/pyspelling.words > wordlist.txt
aspell --version
pyspelling --version
pyspelling --verbose --jobs 5 --config .github/scripts/pyspelling.yaml
- name: 'setup the custom wordlist'
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
synopsis-man-examples:
name: 'synopsis, man-examples'
runs-on: ubuntu-24.04-arm
- name: 'check Spelling'
uses: rojopolis/spellcheck-github-actions@35a02bae020e6999c5c37fabaf447f2eb8822ca7 # v0
with:
config_path: .github/scripts/spellcheck.yaml
badwords-synopsis:
name: 'badwords, synopsis'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'badwords'
run: |
# shellcheck disable=SC2046
.github/scripts/badwords.pl < .github/scripts/badwords.txt $(git ls-files '**.md') docs/TODO docs/KNOWN_BUGS packages/OS400/README.OS400
- name: 'verify synopsis'
run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md
man-examples:
name: 'man-examples'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'verify examples'
run: .github/scripts/verify-examples.pl docs/libcurl/curl*.md docs/libcurl/opts/*.md
miscchecks:
name: 'spacecheck'
runs-on: ubuntu-24.04-arm
timeout-minutes: 5
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'spacecheck'
run: .github/scripts/spacecheck.pl

View file

@ -12,153 +12,129 @@ name: 'Source'
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'plan9/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
- 'plan9/**'
- 'tests/data/**'
- 'winbuild/**'
permissions: {}
jobs:
checksrc:
name: 'checksrc'
runs-on: ubuntu-slim
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'check'
run: scripts/checksrc-all.pl
linters:
name: 'spellcheck, linters, REUSE'
runs-on: ubuntu-24.04-arm
spellcheck-cmakelint-pytype-ruff:
name: 'spellcheck, cmakelint, pytype, ruff'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'install prereqs'
- name: 'install'
env:
DEBIAN_FRONTEND: noninteractive
run: |
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary \
-r .github/scripts/requirements.txt \
-r tests/http/requirements.txt \
-r tests/requirements.txt
- name: 'REUSE check'
run: |
source ~/venv/bin/activate
reuse lint
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
python3-pip python3-networkx python3-pydot python3-yaml \
python3-toml python3-markupsafe python3-jinja2 python3-tabulate \
python3-typing-extensions python3-libcst python3-impacket \
python3-websockets python3-pytest python3-filelock python3-pytest-xdist
python3 -m pip install --break-system-packages cmakelang==0.6.13 pytype==2024.10.11 ruff==0.11.9 codespell==2.4.1
- name: 'codespell'
run: |
source ~/venv/bin/activate
codespell --version
.github/scripts/codespell.sh
- name: 'typos'
timeout-minutes: 2
run: |
HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install typos-cli
/home/linuxbrew/.linuxbrew/bin/brew install typos-cli
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
typos --version
.github/scripts/typos.sh
- name: 'cmakelint'
run: |
source ~/venv/bin/activate
scripts/cmakelint.sh
- name: 'perlcheck'
run: |
scripts/perlcheck.sh
run: scripts/cmakelint.sh
- name: 'pytype'
run: |
source ~/venv/bin/activate
find . -name '*.py' -exec pytype -j auto -k -- {} +
run: find . -name '*.py' -exec pytype -j auto -k {} +
- name: 'ruff'
run: |
source ~/venv/bin/activate
scripts/pythonlint.sh
run: scripts/pythonlint.sh
complexity:
name: 'complexity'
runs-on: ubuntu-slim
timeout-minutes: 3
reuse:
name: 'REUSE'
runs-on: ubuntu-latest
steps:
- name: 'install pmccabe'
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
pmccabe
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check scores'
run: ./scripts/top-complexity
xmllint:
name: 'xmllint'
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- name: 'install prereqs'
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libxml2-utils
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'check'
run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint --output /dev/null
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5
complexity:
name: 'complexity'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'install pmccabe'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
pmccabe
- name: 'check scores'
run: ./scripts/top-complexity
miscchecks:
name: 'misc checks'
runs-on: ubuntu-24.04-arm
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: 'install prereqs'
timeout-minutes: 2
run: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor
run: /home/linuxbrew/.linuxbrew/bin/brew install shellcheck zizmor
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'zizmor GHA'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
zizmor --pedantic .github/workflows/*.yml .github/dependabot.yml
- name: 'actionlint'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export SHELLCHECK_OPTS='--exclude=1090,1091,2086,2153 --enable=avoid-nullary-conditions,deprecate-which'
actionlint --version
actionlint --ignore matrix .github/workflows/*.yml
zizmor --pedantic .github/workflows/*.yml
- name: 'shellcheck CI'
run: |
@ -173,10 +149,14 @@ jobs:
.github/scripts/shellcheck.sh
- name: 'spacecheck'
run: scripts/spacecheck.pl
run: .github/scripts/spacecheck.pl
- name: 'yamlcheck'
run: .github/scripts/yamlcheck.sh
# we allow some extra in source code
- name: 'badwords'
run: scripts/badwords-all
run: |
# shellcheck disable=SC2046
grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | \
.github/scripts/badwords.pl $(git ls-files -- src lib include)

View file

@ -1,40 +0,0 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'URLs'
'on':
push:
branches:
- master
- '*/ci'
pull_request:
branches:
- master
schedule:
- cron: '10 5 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
linkcheck:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'linkcheck'
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'mdlinkcheck (dry run)'
if: ${{ github.event_name != 'schedule' }}
run: ./scripts/mdlinkcheck --dry-run
- name: 'mdlinkcheck'
if: ${{ github.event_name == 'schedule' }}
run: ./scripts/mdlinkcheck

View file

@ -13,8 +13,12 @@ name: 'CodeQL'
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -22,120 +26,36 @@ name: 'CodeQL'
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
schedule:
- cron: '0 0 * * 4'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
group: ${{ github.workflow }}
permissions: {}
jobs:
gha_python:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
codeql:
name: 'GHA and Python'
runs-on: ubuntu-latest
permissions:
security-events: write # To create/update security events
security-events: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: 'initialize'
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
uses: github/codeql-action/init@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3
with:
languages: actions, python
queries: security-extended
- name: 'perform analysis'
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
c:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'C'
runs-on: ${{ matrix.platform == 'Linux' && 'ubuntu-latest' || 'windows-2022' }}
permissions:
security-events: write # To create/update security events
strategy:
fail-fast: false
matrix:
platform: [Linux, Windows]
env:
MATRIX_PLATFORM: '${{ matrix.platform }}'
steps:
- name: 'install prereqs'
if: ${{ matrix.platform == 'Linux' }}
timeout-minutes: 5
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo apt-get -o Dpkg::Use-Pty=0 update
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 60 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install \
libpsl-dev libbrotli-dev libidn2-dev libssh2-1-dev libssh-dev \
libnghttp2-dev libldap-dev libkrb5-dev libgnutls28-dev libwolfssl-dev
HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install c-ares gsasl libnghttp3 libngtcp2 mbedtls rustls-ffi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'delete test input C files'
shell: bash
run: find tests/data -name '*.c' -delete
- name: 'initialize'
# https://github.com/github/codeql-action/blob/main/init/action.yml
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: cpp
build-mode: manual
trap-caching: false
- name: 'build'
timeout-minutes: 10
shell: bash
run: |
if [ "${MATRIX_PLATFORM}" = 'Windows' ]; then
cmake -B . -DBUILD_SHARED_LIBS=OFF -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_VS_GLOBALS=TrackFileAccess=false \
-DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF -DUSE_WIN32_IDN=ON
cmake --build . --verbose
src/Debug/curl.exe --disable --version
else
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export PKG_CONFIG_PATH
# MultiSSL
PKG_CONFIG_PATH="$(brew --prefix c-ares)/lib/pkgconfig:$(brew --prefix mbedtls)/lib/pkgconfig:$(brew --prefix rustls-ffi)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
cmake -B _bld1 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON -DENABLE_DEBUG=ON \
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DCURL_USE_WOLFSSL=ON \
-DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \
-DCURL_DISABLE_VERBOSE_STRINGS=ON
cmake --build _bld1
cmake --build _bld1 --target testdeps
cmake --build _bld1 --target curl-examples-build
# HTTP/3
PKG_CONFIG_PATH="$(brew --prefix libnghttp3)/lib/pkgconfig:$(brew --prefix libngtcp2)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
cmake -B _bld2 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON \
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DUSE_NGTCP2=ON \
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON \
-DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON
cmake --build _bld2
cmake --build _bld2 --target testdeps
cmake --build _bld2 --target curl-examples-build
_bld1/src/curl --disable --version
_bld2/src/curl --disable --version
fi
- name: 'perform analysis'
# https://github.com/github/codeql-action/blob/main/analyze/action.yml
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
uses: github/codeql-action/analyze@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3

View file

@ -12,7 +12,7 @@ name: 'configure-vs-cmake'
- '**/*.m4'
- '**/CMakeLists.txt'
- 'CMake/**'
- 'lib/curl_config-cmake.h.in'
- 'lib/curl_config.h.cmake'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml'
@ -25,15 +25,11 @@ name: 'configure-vs-cmake'
- '**/*.m4'
- '**/CMakeLists.txt'
- 'CMake/**'
- 'lib/curl_config-cmake.h.in'
- 'lib/curl_config.h.cmake'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
@ -41,7 +37,7 @@ jobs:
name: 'Linux'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -52,7 +48,7 @@ jobs:
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl
- name: 'run cmake'
run: cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_LIBPSL=OFF
run: cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF
- name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true
@ -81,25 +77,14 @@ jobs:
runs-on: macos-latest
steps:
- name: 'install packages'
timeout-minutes: 2
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
- name: 'toolchain versions'
run: echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -107,13 +92,13 @@ jobs:
run: |
autoreconf -fi
export PKG_CONFIG_DEBUG_SPEW=1
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl --disable-ldap --with-brotli --with-zstd --with-apple-sectrust
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl --disable-ldap --with-brotli --with-zstd
- name: 'run cmake'
run: |
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
-DCURL_USE_LIBSSH2=OFF -DUSE_APPLE_SECTRUST=ON
-DCURL_USE_LIBSSH2=OFF
- name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true
@ -145,12 +130,10 @@ jobs:
steps:
- name: 'install packages'
run: |
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 30 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install gcc-mingw-w64-x86-64-win32
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -162,7 +145,7 @@ jobs:
- name: 'run cmake'
run: |
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \
-DCMAKE_C_COMPILER="${TRIPLET}-gcc"

View file

@ -14,7 +14,10 @@ name: 'curl-for-win'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -23,7 +26,10 @@ name: 'curl-for-win'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -43,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
path: 'curl'
@ -52,46 +58,19 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-linux-a64-x64-gcc'
export CW_CONFIG='-main-werror-unitybatch-linux-a64-x64-gcc'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
DOCKER_IMAGE='debian:bookworm-slim'
export CW_CCSUFFIX='-15'
export CW_GCCSUFFIX='-12'
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN_STABLE}"
time podman pull "${DOCKER_IMAGE}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN_STABLE}" \
sh -c ./_ci-linux-debian.sh
linux-glibc-gcc-minimal: # use gcc to minimize installed packages
name: 'Linux gcc glibc minimal (amd64)'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-prefill-zero-osnotls-osnoidn-nohttp-nocurltool-linux-x64-gcc'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \
"${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh
linux-musl-llvm:
@ -99,7 +78,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
path: 'curl'
@ -108,27 +87,27 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-linux-musl-r64-x64'
export CW_CONFIG='-main-werror-unitybatch-linux-musl-r64-x64'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}"
time podman pull "${DOCKER_IMAGE}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \
"${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh
mac-clang:
name: 'macOS clang cares (x86_64)'
name: 'macOS clang (x86_64)'
runs-on: macos-latest
timeout-minutes: 10
env:
CW_JOBS: '4'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
path: 'curl'
@ -137,7 +116,7 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-mac-x64-cares'
export CW_CONFIG='-main-werror-unitybatch-mac-x64'
export CW_REVISION="${GITHUB_SHA}"
sh -c ./_ci-mac-homebrew.sh
@ -146,7 +125,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
path: 'curl'
@ -155,25 +134,25 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-win-x64-noWINE'
export CW_CONFIG='-main-werror-unitybatch-win-x64'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}"
time podman pull "${DOCKER_IMAGE}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \
"${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh
win-gcc-zlibold-x64:
name: 'Windows gcc zlib-classic (x64)'
win-gcc-libssh-zlibold-x64:
name: 'Windows gcc libssh zlib-classic (x64)'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
path: 'curl'
@ -182,15 +161,15 @@ jobs:
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-win-x64-gcc-zlibold-noWINE'
export CW_CONFIG='-main-werror-unitybatch-win-x64-gcc-libssh1-zlibold'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}"
time podman pull "${DOCKER_IMAGE}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \
"${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh

View file

@ -20,7 +20,6 @@ concurrency:
permissions: {}
env:
CURL_TEST_MIN: 1450
MAKEFLAGS: -j 5
jobs:
@ -29,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -48,7 +47,7 @@ jobs:
- name: 'maketgz'
run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
with:
name: 'release-tgz'
path: 'curl-99.98.97.tar.gz'
@ -59,7 +58,7 @@ jobs:
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
./configure --prefix="$HOME"/temp --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
./configure --prefix="$HOME"/temp --enable-werror --without-ssl --without-libpsl
make
make test-ci
make install
@ -74,7 +73,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: 'release-tgz'
@ -85,7 +84,7 @@ jobs:
touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
mkdir build
pushd build
../curl-99.98.97/configure --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
../curl-99.98.97/configure --enable-werror --without-ssl --without-libpsl
make
make test-ci
popd
@ -98,7 +97,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: 'release-tgz'
@ -109,7 +108,7 @@ jobs:
pushd curl-99.98.97
mkdir build
pushd build
../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --enable-debug --without-libpsl
../configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --enable-debug --without-libpsl
make
make test-ci
make install
@ -124,7 +123,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: 'release-tgz'
@ -135,7 +134,7 @@ jobs:
pushd curl-99.98.97
mkdir build
pushd build
../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
../configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
@ -148,7 +147,7 @@ jobs:
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: 'release-tgz'
@ -157,7 +156,7 @@ jobs:
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
./configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
./configure --prefix="$PWD"/curl-install --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
@ -169,7 +168,7 @@ jobs:
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: 'release-tgz'
@ -191,7 +190,7 @@ jobs:
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: 'release-tgz'
@ -209,15 +208,15 @@ jobs:
missing-files:
name: 'missing files'
runs-on: ubuntu-slim
runs-on: ubuntu-latest
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: 'release-tgz'
@ -229,7 +228,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -249,25 +248,21 @@ jobs:
cmake-integration:
name: 'CM integration ${{ matrix.image }}'
runs-on: ${{ matrix.image }}
timeout-minutes: 15
timeout-minutes: 10
defaults:
run:
shell: ${{ contains(matrix.image, 'windows') && 'msys2 {0}' || 'bash' }}
env:
CC: ${{ !contains(matrix.image, 'windows') && 'clang' || '' }}
MAKEFLAGS: ${{ contains(matrix.image, 'macos') && '-j 4' || '-j 5' }}
MATRIX_IMAGE: '${{ matrix.image }}'
TESTOPTS: ${{ contains(matrix.image, 'macos') && '-D_CURL_PREFILL=ON' || '' }} ${{ contains(matrix.image, 'windows') && '-DCMAKE_UNITY_BUILD_BATCH_SIZE=30' || '' }}
OLD_CMAKE_VERSION: 3.19.8
OLD_CMAKE_SHA256_LINUX_ARM: 807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1
OLD_CMAKE_SHA256_MACOS_UNI: 0976d23d982af05dcbfb3aa34fcb62ead43bea27f0e3bb95222f2a78161423f2
OLD_CMAKE_SHA256_WIN_INTEL: 2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380
OLD_CMAKE_VERSION: 3.11.4
strategy:
fail-fast: false
matrix:
image: [ubuntu-24.04-arm, macos-latest, windows-2022]
image: [ubuntu-latest, macos-latest, windows-2022]
steps:
- uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0
- uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2
if: ${{ contains(matrix.image, 'windows') }}
with:
msystem: mingw64
@ -279,34 +274,30 @@ jobs:
mingw-w64-x86_64-zlib mingw-w64-x86_64-zstd mingw-w64-x86_64-libpsl mingw-w64-x86_64-libssh2 mingw-w64-x86_64-nghttp2 mingw-w64-x86_64-openssl
- name: 'install prereqs'
timeout-minutes: 3
run: |
if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output pkg.bin
sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${OLD_CMAKE_SHA256_WIN_INTEL}" && unzip -q pkg.bin && rm -f pkg.bin
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output bin.zip
unzip -q bin.zip
rm -f bin.zip
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-win64-x64/bin/cmake.exe > ~/old-cmake-path.txt
elif [[ "${MATRIX_IMAGE}" = *'ubuntu'* ]]; then
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 30 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libssl-dev
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libssl-dev
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-aarch64.tar.gz" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_LINUX_ARM}" && tar -xzf pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Linux-aarch64/bin/cmake > ~/old-cmake-path.txt
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-x86_64.tar.gz" | tar -xz
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Linux-x86_64/bin/cmake > ~/old-cmake-path.txt
else
brew install libpsl openssl
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-macos-universal.tar.gz" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_MACOS_UNI}" && tar -xzf pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-macos-universal/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Darwin-x86_64.tar.gz" | tar -xz
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Darwin-x86_64/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
fi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -319,16 +310,6 @@ jobs:
run: ./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package'
run: ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package (C++)'
if: ${{ contains(matrix.image, 'ubuntu') }}
run: TEST_CMAKE_FLAGS=-DTEST_CPP=ON ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package (PREFER_CONFIG=ON)'
if: ${{ contains(matrix.image, 'windows') }}
run: |
export TEST_CMAKE_FLAGS_PROVIDER='-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON -DCURL_ZSTD=OFF'
TEST_CMAKE_FLAGS_PROVIDER+=' -DNGHTTP2_INCLUDE_DIR=C:/msys64/mingw64/include -DNGHTTP2_LIBRARY=C:/msys64/mingw64/lib/libnghttp2.dll.a'
export TEST_CMAKE_FLAGS_CONSUMER="${TEST_CMAKE_FLAGS_PROVIDER}"
./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via ExternalProject (old cmake)'
if: ${{ contains(matrix.image, 'ubuntu') }}

View file

@ -16,8 +16,11 @@ name: 'Fuzzer'
- 'appveyor.*'
- 'CMake/**'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -28,16 +31,14 @@ name: 'Fuzzer'
- 'appveyor.*'
- 'CMake/**'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'tests/data/**'
concurrency:
# Hard-coded workflow name to avoid colliding with curl-fuzzer's group
group: curl-fuzz-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
- 'winbuild/**'
permissions: {}
jobs:
Fuzzing:
uses: curl/curl-fuzzer/.github/workflows/ci.yml@master # zizmor: ignore[unpinned-uses]
uses: curl/curl-fuzzer/.github/workflows/ci.yml@master

View file

@ -0,0 +1,72 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'Hacktoberfest'
'on':
# this must not ever run on any other branch than master
push:
branches:
- master
concurrency:
# this should not run in parallel, so just run one at a time
group: ${{ github.workflow }}
permissions: {}
jobs:
# add hacktoberfest-accepted label to PRs opened starting from September 30th
# till November 1st which are closed via commit reference from master branch.
merged:
name: 'Add hacktoberfest-accepted label'
runs-on: ubuntu-latest
permissions:
# requires issues AND pull-requests write permissions to edit labels on PRs!
issues: write
pull-requests: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
fetch-depth: 100
- name: 'Check whether repo participates in Hacktoberfest'
id: check
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
gh config set prompt disabled && echo "label=$(
gh repo view --json repositoryTopics --jq '.repositoryTopics[].name' | grep '^hacktoberfest$')" >> "$GITHUB_OUTPUT"
- name: 'Search relevant commit message lines starting with Closes/Merges'
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GITHUB_EVENT_BEFORE: '${{ github.event.before }}'
GITHUB_EVENT_AFTER: '${{ github.event.after }}'
run: |
git log --format=email "${GITHUB_EVENT_BEFORE}..${GITHUB_EVENT_AFTER}" | \
grep -Ei '^Close[sd]? ' | sort | uniq | tee log
- name: 'Search for number-based PR references'
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
grep -Eo '#([0-9]+)' log | cut -d# -f2 | sort | uniq | xargs -t -n1 -I{} \
gh pr view {} --json number,createdAt \
--jq '{number, opened: .createdAt} | [.number, .opened] | join(":")' | tee /dev/stderr | \
grep -Eo '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \
gh pr edit {} --add-label 'hacktoberfest-accepted'
- name: 'Search for URL-based PR references'
if: ${{ steps.check.outputs.label == 'hacktoberfest' }}
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
grep -Eo 'github.com/(.+)/(.+)/pull/([0-9]+)' log | sort | uniq | xargs -t -n1 -I{} \
gh pr view 'https://{}' --json number,createdAt \
--jq '{number, opened: .createdAt} | [.number, .opened] | join(":")' | tee /dev/stderr | \
grep -Eo '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \
gh pr edit {} --add-label 'hacktoberfest-accepted'

View file

@ -14,7 +14,10 @@ name: 'Linux HTTP/3'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -23,10 +26,14 @@ name: 'Linux HTTP/3'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
# Hardcoded workflow filename as workflow name above is just Linux again
group: http3-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
@ -34,31 +41,28 @@ permissions: {}
env:
MAKEFLAGS: -j 5
CURL_CI: github
CURL_TEST_MIN: 1600
# renovate: datasource=github-releases depName=openssl/openssl versioning=semver extractVersion=^openssl-(?<version>.+)$ registryUrl=https://github.com
OPENSSL_VERSION: 3.6.2
# manually bumped
OPENSSL4_VERSION: 4.0.0
# handled in renovate.json
OPENSSL_VERSION: 3.5.2
# handled in renovate.json
QUICTLS_VERSION: 3.3.0
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.2.1
LIBRESSL_VERSION: 4.1.0
# renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com
AWSLC_VERSION: 1.71.0
AWSLC_VERSION: 1.60.0
# renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com
BORINGSSL_VERSION: 0.20260413.0
# renovate: datasource=github-tags depName=gnutls/nettle versioning=semver registryUrl=https://github.com
NETTLE_VERSION: 3.10.2
# renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver extractVersion=^nettle_?(?<version>.+)_release_.+$ registryUrl=https://github.com
GNUTLS_VERSION: 3.8.11
BORINGSSL_VERSION: 0.20250818.0
# renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com
GNUTLS_VERSION: 3.8.10
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VERSION: 5.9.1
WOLFSSL_VERSION: 5.8.2
# renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com
NGHTTP3_VERSION: 1.15.0
NGHTTP3_VERSION: 1.11.0
# renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com
NGTCP2_VERSION: 1.22.0
NGTCP2_VERSION: 1.15.1
# renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com
NGHTTP2_VERSION: 1.68.1
NGHTTP2_VERSION: 1.67.0
# renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com
QUICHE_VERSION: 0.24.7
QUICHE_VERSION: 0.24.6
jobs:
build-cache:
@ -67,25 +71,16 @@ jobs:
steps:
- name: 'cache openssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-http3-no-deprecated
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-openssl-http3
env:
cache-name: cache-openssl-http3-no-deprecated
cache-name: cache-openssl-http3
with:
path: ~/openssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
- name: 'cache openssl4'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl4-http3-no-deprecated
env:
cache-name: cache-openssl4-http3-no-deprecated
with:
path: ~/openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL4_VERSION }}
- name: 'cache libressl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-libressl
env:
cache-name: cache-libressl
@ -94,7 +89,7 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
- name: 'cache awslc'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-awslc
env:
cache-name: cache-awslc
@ -103,7 +98,7 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.AWSLC_VERSION }}
- name: 'cache boringssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-boringssl
env:
cache-name: cache-boringssl
@ -111,26 +106,26 @@ jobs:
path: ~/boringssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }}
- name: 'cache nettle'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nettle
- name: 'cache quictls'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-quictls-no-deprecated
env:
cache-name: cache-nettle
cache-name: cache-quictls-no-deprecated
with:
path: ~/nettle/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }}
path: ~/quictls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.QUICTLS_VERSION }}-quic1
- name: 'cache gnutls'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-gnutls
env:
cache-name: cache-gnutls
with:
path: ~/gnutls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}
- name: 'cache wolfssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-wolfssl
env:
cache-name: cache-wolfssl
@ -139,7 +134,7 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
- name: 'cache nghttp3'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-nghttp3
env:
cache-name: cache-nghttp3
@ -148,26 +143,16 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP3_VERSION }}
- name: 'cache ngtcp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-ngtcp2
env:
cache-name: cache-ngtcp2
with:
path: ~/ngtcp2/build
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}"
- name: 'cache ngtcp2 openssl4'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-openssl4
env:
cache-name: cache-ngtcp2-openssl4
with:
path: ~/ngtcp2-openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL4_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}
- name: 'cache ngtcp2 boringssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-ngtcp2-boringssl
env:
cache-name: cache-ngtcp2-boringssl
@ -176,28 +161,25 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.BORINGSSL_VERSION }}
- name: 'cache nghttp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-nghttp2
env:
cache-name: cache-nghttp2
with:
path: ~/nghttp2/build
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}"
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}
- id: settings
if: >-
${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' ||
steps.cache-openssl4-http3-no-deprecated.outputs.cache-hit != 'true' ||
${{ steps.cache-openssl-http3.outputs.cache-hit != 'true' ||
steps.cache-libressl.outputs.cache-hit != 'true' ||
steps.cache-awslc.outputs.cache-hit != 'true' ||
steps.cache-boringssl.outputs.cache-hit != 'true' ||
steps.cache-nettle.outputs.cache-hit != 'true' ||
steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' ||
steps.cache-gnutls.outputs.cache-hit != 'true' ||
steps.cache-wolfssl.outputs.cache-hit != 'true' ||
steps.cache-nghttp3.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2-openssl4.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' ||
steps.cache-nghttp2.outputs.cache-hit != 'true' }}
@ -206,37 +188,26 @@ jobs:
- name: 'install build prereqs'
if: ${{ steps.settings.outputs.needs-build == 'true' }}
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get -o Dpkg::Use-Pty=0 update
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 60 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf \
libbrotli-dev libzstd-dev zlib1g-dev \
libev-dev \
libc-ares-dev \
libp11-kit-dev autopoint bison gperf gtk-doc-tools libtasn1-bin # for GnuTLS
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
texinfo texlive texlive-extra-utils autopoint libev-dev \
apache2 apache2-dev libnghttp2-dev dante-server
echo 'CC=gcc-12' >> "$GITHUB_ENV"
echo 'CXX=g++-12' >> "$GITHUB_ENV"
- name: 'build openssl'
if: ${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' }}
if: ${{ steps.cache-openssl-http3.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
git clone --quiet --depth=1 -b "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
cd openssl
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated
make
make -j1 install_sw
- name: 'build openssl4'
if: ${{ steps.cache-openssl4-http3-no-deprecated.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "openssl-${OPENSSL4_VERSION}" https://github.com/openssl/openssl openssl4
cd openssl4
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests
make
make -j1 install_sw
@ -245,8 +216,7 @@ jobs:
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" | tar -xz
cd "libressl-${LIBRESSL_VERSION}"
cmake -B . -G Ninja -DLIBRESSL_APPS=OFF -DLIBRESSL_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/libressl/build
cmake --build .
@ -257,8 +227,7 @@ jobs:
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/awslabs/aws-lc/archive/refs/tags/v${AWSLC_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
--location "https://github.com/awslabs/aws-lc/archive/refs/tags/v${AWSLC_VERSION}.tar.gz" | tar -xz
cd "aws-lc-${AWSLC_VERSION}"
cmake -B . -G Ninja -DBUILD_SHARED_LIBS=ON -DBUILD_TOOL=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/awslc/build
cmake --build .
@ -270,51 +239,44 @@ jobs:
mkdir boringssl-src
cd boringssl-src
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
"https://boringssl.googlesource.com/boringssl/+archive/${BORINGSSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
"https://boringssl.googlesource.com/boringssl/+archive/${BORINGSSL_VERSION}.tar.gz" | tar -xz
cmake -B . -G Ninja -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/boringssl/build
cmake --build .
cmake --install .
- name: 'build nettle'
if: ${{ steps.cache-nettle.outputs.cache-hit != 'true' }}
- name: 'build quictls'
if: ${{ steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://ftpmirror.gnu.org/nettle/nettle-${NETTLE_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "nettle-${NETTLE_VERSION}"
autoreconf -fi
./configure --disable-dependency-tracking --prefix=/home/runner/nettle/build \
--disable-static --disable-openssl --disable-documentation
make install
git clone --quiet --depth=1 -b "openssl-${QUICTLS_VERSION}-quic1" https://github.com/quictls/openssl quictls
cd quictls
./config no-deprecated --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests
make
make -j1 install_sw
- name: 'build gnutls'
if: ${{ steps.cache-gnutls.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
"https://www.gnupg.org/ftp/gcrypt/gnutls/v${GNUTLS_VERSION%.*}/gnutls-${GNUTLS_VERSION}.tar.xz" --output pkg.bin
sha256sum pkg.bin && tar -xJf pkg.bin && rm -f pkg.bin
cd "gnutls-${GNUTLS_VERSION}"
autoreconf -fi
# required: libp11-kit-dev libev-dev autopoint bison gperf gtk-doc-tools libtasn1-bin
./configure --disable-dependency-tracking --prefix=/home/runner/gnutls/build \
PKG_CONFIG_PATH=/home/runner/nettle/build/lib64/pkgconfig \
LDFLAGS=-Wl,-rpath,/home/runner/nettle/build/lib64 \
git clone --quiet --depth=1 -b "${GNUTLS_VERSION}" https://github.com/gnutls/gnutls.git
cd gnutls
./bootstrap
./configure --disable-dependency-tracking --prefix="$PWD"/build \
LDFLAGS="-Wl,-rpath,$PWD/build/lib -L$PWD/build/lib" \
--with-included-libtasn1 --with-included-unistring \
--disable-guile --disable-doc --disable-tests --disable-tools
make
make install
- name: 'build wolfssl'
if: ${{ steps.cache-wolfssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl
git clone --quiet --depth=1 -b "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl.git
cd wolfssl
./autogen.sh
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-all --enable-quic \
--disable-benchmark --disable-crypttests --disable-examples
./configure --disable-dependency-tracking --enable-all --enable-quic \
--disable-benchmark --disable-crypttests --disable-examples --prefix="$PWD"/build
make
make install
@ -322,9 +284,9 @@ jobs:
if: ${{ steps.cache-nghttp3.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3
git clone --quiet --depth=1 -b "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3
cd nghttp3
git submodule update --init --depth 1
git submodule update --init --depth=1
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only
make
@ -332,48 +294,36 @@ jobs:
- name: 'build ngtcp2'
if: ${{ steps.cache-ngtcp2.outputs.cache-hit != 'true' }}
# building twice to get crypto libs for ossl, libressl and awslc installed
# building 3 times to get crypto libs for ossl, libressl, quictls and awslc installed
run: |
cd ~
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2
git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2
cd ngtcp2
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
PKG_CONFIG_PATH=/home/runner/libressl/build/lib/pkgconfig \
--with-openssl
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/libressl/build/lib/pkgconfig --enable-lib-only --with-openssl
make install
make clean
export PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/nettle/build/lib64/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/gnutls/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/wolfssl/build/lib/pkgconfig
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
--with-openssl --with-gnutls --with-wolfssl --with-boringssl \
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/quictls/build/lib/pkgconfig --enable-lib-only --with-openssl
make install
make clean
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig:/home/runner/gnutls/build/lib/pkgconfig:/home/runner/wolfssl/build/lib/pkgconfig \
--enable-lib-only --with-openssl --with-gnutls --with-wolfssl --with-boringssl \
BORINGSSL_LIBS='-L/home/runner/awslc/build/lib -lssl -lcrypto' \
BORINGSSL_CFLAGS='-I/home/runner/awslc/build/include'
make install
- name: 'build ngtcp2 openssl4'
if: ${{ steps.cache-ngtcp2-openssl4.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-openssl4
cd ngtcp2-openssl4
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
PKG_CONFIG_PATH=/home/runner/openssl4/build/lib/pkgconfig \
--with-openssl
make install
- name: 'build ngtcp2 boringssl'
if: ${{ steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl
git clone --quiet --depth=1 -b "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl
cd ngtcp2-boringssl
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
--with-openssl=no --with-boringssl \
./configure --disable-dependency-tracking --prefix="$PWD"/build \
--enable-lib-only --with-openssl=no --with-boringssl \
BORINGSSL_LIBS='-L/home/runner/boringssl/build/lib -lssl -lcrypto' \
BORINGSSL_CFLAGS='-I/home/runner/boringssl/build/include'
make install
@ -382,170 +332,160 @@ jobs:
if: ${{ steps.cache-nghttp2.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2
git clone --quiet --depth=1 -b "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2
cd nghttp2
git submodule update --init --depth 1
git submodule update --init --depth=1
autoreconf -fi
# required (for nghttpx application): libc-ares-dev libev-dev zlib1g-dev
# optional (for nghttpx application): libbrotli-dev
export PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/nghttp3/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/ngtcp2/build/lib/pkgconfig
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-app --enable-http3 \
LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib \
--with-libbrotlienc --with-libbrotlidec
./configure --disable-dependency-tracking --prefix="$PWD"/build \
PKG_CONFIG_PATH=/home/runner/quictls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig \
LDFLAGS=-Wl,-rpath,/home/runner/quictls/build/lib \
--enable-http3
make install
linux:
name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }}
needs: build-cache
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- build-cache
runs-on: 'ubuntu-latest'
timeout-minutes: 45
env:
CURL_TRACE_PKG_CONFIG: '1'
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_INSTALL_PACKAGES: '${{ matrix.build.install_packages }}'
strategy:
fail-fast: false
matrix:
build:
- name: 'openssl'
tflags: '--min=1640'
LDFLAGS: -Wl,-rpath,/home/runner/openssl/build/lib
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-openssl=/home/runner/openssl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ssls-export
LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/openssl/build --enable-ssls-export
- name: 'openssl'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl/build -DUSE_NGTCP2=ON
-DCURL_DISABLE_LDAP=ON
-DOPENSSL_ROOT_DIR=/home/runner/openssl/build
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'openssl4'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/openssl4/build/lib
PKG_CONFIG_PATH: "\
/home/runner/openssl4/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/nghttp2-openssl4/build/lib/pkgconfig"
configure: >-
--with-openssl=/home/runner/openssl4/build --with-ngtcp2=/home/runner/ngtcp2-openssl4/build --enable-ech --enable-ssls-export
- name: 'openssl4'
tflags: '--min=1640'
PKG_CONFIG_PATH: "\
/home/runner/openssl4/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-openssl4/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl4/build -DUSE_NGTCP2=ON
-DCURL_DISABLE_LDAP=ON
-DUSE_ECH=ON
- name: 'libressl'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/libressl/build/lib
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
# Intentionally using '--with-ngtcp2=<path>' to test this way of configuration, in addition to bare '--with-ngtcp2' + 'PKG_CONFIG_PATH' in other jobs.
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-openssl=/home/runner/libressl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ssls-export
LDFLAGS=-Wl,-rpath,/home/runner/libressl/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/libressl/build --enable-ssls-export
--enable-unity
- name: 'libressl'
tflags: '--min=1790'
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/libressl/build -DUSE_NGTCP2=ON
-DOPENSSL_ROOT_DIR=/home/runner/libressl/build
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
- name: 'awslc'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/awslc/build/lib
PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
# Intentionally using bare '--with-ngtcp2' + 'PKG_CONFIG_PATH' to test this way of configuration, in addition to '--with-ngtcp2=<path>' in other jobs.
configure: >-
--with-openssl=/home/runner/awslc/build --with-ngtcp2 --enable-ssls-export
LDFLAGS=-Wl,-rpath,/home/runner/awslc/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/awslc/build --enable-ssls-export
- name: 'awslc'
tflags: '--min=1790'
PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/awslc/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON
- name: 'boringssl'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/boringssl/build/lib
PKG_CONFIG_PATH: /home/runner/boringssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-openssl=/home/runner/boringssl/build --with-ngtcp2=/home/runner/ngtcp2-boringssl/build --enable-ssls-export
- name: 'boringssl'
tflags: '--min=1790'
PKG_CONFIG_PATH: "\
/home/runner/boringssl/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/boringssl/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF
-DOPENSSL_ROOT_DIR=/home/runner/awslc/build -DBUILD_SHARED_LIBS=OFF
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'gnutls'
install_packages: libp11-kit-dev libssh-dev
- name: 'boringssl'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib -Wl,-rpath,/home/runner/nettle/build/lib64 -Wl,-rpath,/home/runner/ngtcp2/build/lib
PKG_CONFIG_PATH: /home/runner/nettle/build/lib64/pkgconfig:/home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
PKG_CONFIG_PATH: /home/runner/boringssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-gnutls=/home/runner/gnutls/build --with-ngtcp2=/home/runner/ngtcp2/build --with-libssh --enable-ssls-export
LDFLAGS=-Wl,-rpath,/home/runner/boringssl/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/boringssl/build --enable-ssls-export
- name: 'boringssl'
PKG_CONFIG_PATH: /home/runner/boringssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/boringssl/build -DBUILD_SHARED_LIBS=OFF
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'quictls'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/quictls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/quictls/build/lib
--with-ngtcp2 --disable-ntlm
--with-openssl=/home/runner/quictls/build --enable-ssls-export
--enable-unity
- name: 'quictls'
PKG_CONFIG_PATH: /home/runner/quictls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/quictls/build
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
- name: 'gnutls'
install_packages: libp11-kit-dev libssh-dev
tflags: '--min=1840'
LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib
PKG_CONFIG_PATH: "\
/home/runner/nettle/build/lib64/pkgconfig:\
/home/runner/gnutls/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/gnutls/build/lib
--with-ngtcp2
--with-gnutls=/home/runner/gnutls/build --enable-ssls-export
- name: 'gnutls'
PKG_CONFIG_PATH: /home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DCURL_USE_GNUTLS=ON -DUSE_NGTCP2=ON -DCURL_USE_LIBSSH=ON
-DCURL_USE_GNUTLS=ON
-DUSE_NGTCP2=ON -DCURL_DISABLE_NTLM=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'wolfssl'
install_packages: libssh2-1-dev
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/wolfssl/build/lib
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-wolfssl=/home/runner/wolfssl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ech --with-libssh2 --enable-ssls-export
LDFLAGS=-Wl,-rpath,/home/runner/wolfssl/build/lib
--with-ngtcp2
--with-wolfssl=/home/runner/wolfssl/build
--enable-ech --enable-ssls-export
--enable-unity
- name: 'wolfssl'
install_packages: libssh2-1-dev
tflags: '--min=1840'
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON
-DUSE_ECH=ON
- name: 'openssl-quic'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib
--disable-ntlm
--with-openssl=/home/runner/openssl/build --with-openssl-quic
- name: 'openssl-quic'
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl/build -DUSE_OPENSSL_QUIC=ON
-DCURL_DISABLE_NTLM=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'quiche'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/quiche/target/release
PKG_CONFIG_PATH: /home/runner/nghttp2/build/lib/pkgconfig
configure: >-
LDFLAGS=-Wl,-rpath,/home/runner/quiche/target/release
--with-openssl=/home/runner/quiche/quiche/deps/boringssl/src
--with-quiche=/home/runner/quiche/target/release
--with-ca-fallback
--enable-unity
- name: 'quiche'
tflags: '--min=1790'
PKG_CONFIG_PATH: /home/runner/nghttp2/build/lib/pkgconfig:/home/runner/quiche/target/release
PKG_CONFIG_PATH: /home/runner/quiche/target/release
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/quiche/quiche/deps/boringssl/src
-DUSE_QUICHE=ON
@ -553,50 +493,34 @@ jobs:
steps:
- name: 'install prereqs'
env:
INSTALL_PACKAGES: >-
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'stunnel4 ' || '' }}
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') &&
'apache2 apache2-dev libnghttp2-dev vsftpd dante-server libev-dev' || '' }}
run: |
sudo rm -f /etc/apt/sources.list.d/{azure-cli.sources,microsoft-prod.list,ondrej-ubuntu-php-noble.sources}
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get -o Dpkg::Use-Pty=0 update
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 45 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libidn2-0-dev libldap-dev libuv1-dev valgrind \
${INSTALL_PACKAGES} \
${MATRIX_INSTALL_PACKAGES}
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
texinfo texlive texlive-extra-utils autopoint libev-dev libuv1-dev \
apache2 apache2-dev libnghttp2-dev vsftpd dante-server
python3 -m venv ~/venv
echo 'CC=gcc-12' >> "$GITHUB_ENV"
echo 'CXX=g++-12' >> "$GITHUB_ENV"
- name: 'cache openssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-http3-no-deprecated
if: ${{ matrix.build.name == 'openssl' || matrix.build.name == 'openssl-quic' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-openssl-http3
env:
cache-name: cache-openssl-http3-no-deprecated
cache-name: cache-openssl-http3
with:
path: ~/openssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache openssl4'
if: ${{ contains(matrix.build.name, 'openssl4') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl4-http3-no-deprecated
env:
cache-name: cache-openssl4-http3-no-deprecated
with:
path: ~/openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL4_VERSION }}
fail-on-cache-miss: true
- name: 'cache libressl'
if: ${{ contains(matrix.build.name, 'libressl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-libressl
env:
cache-name: cache-libressl
@ -606,8 +530,7 @@ jobs:
fail-on-cache-miss: true
- name: 'cache awslc'
if: ${{ contains(matrix.build.name, 'awslc') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-awslc
env:
cache-name: cache-awslc
@ -617,8 +540,7 @@ jobs:
fail-on-cache-miss: true
- name: 'cache boringssl'
if: ${{ contains(matrix.build.name, 'boringssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-boringssl
env:
cache-name: cache-boringssl
@ -627,31 +549,30 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache nettle'
if: ${{ contains(matrix.build.name, 'gnutls') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nettle
- name: 'cache quictls'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-quictls-no-deprecated
env:
cache-name: cache-nettle
cache-name: cache-quictls-no-deprecated
with:
path: ~/nettle/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }}
path: ~/quictls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.QUICTLS_VERSION }}-quic1
fail-on-cache-miss: true
- name: 'cache gnutls'
if: ${{ contains(matrix.build.name, 'gnutls') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
if: ${{ matrix.build.name == 'gnutls' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-gnutls
env:
cache-name: cache-gnutls
with:
path: ~/gnutls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}
fail-on-cache-miss: true
- name: 'cache wolfssl'
if: ${{ contains(matrix.build.name, 'wolfssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
if: ${{ matrix.build.name == 'wolfssl' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-wolfssl
env:
cache-name: cache-wolfssl
@ -661,7 +582,7 @@ jobs:
fail-on-cache-miss: true
- name: 'cache nghttp3'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-nghttp3
env:
cache-name: cache-nghttp3
@ -671,30 +592,17 @@ jobs:
fail-on-cache-miss: true
- name: 'cache ngtcp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-ngtcp2
env:
cache-name: cache-ngtcp2
with:
path: ~/ngtcp2/build
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}"
fail-on-cache-miss: true
- name: 'cache ngtcp2 openssl4'
if: ${{ contains(matrix.build.name, 'openssl4') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-openssl4
env:
cache-name: cache-ngtcp2-openssl4
with:
path: ~/ngtcp2-openssl4/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL4_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache ngtcp2 boringssl'
if: ${{ contains(matrix.build.name, 'boringssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-ngtcp2-boringssl
env:
cache-name: cache-ngtcp2-boringssl
@ -704,18 +612,18 @@ jobs:
fail-on-cache-miss: true
- name: 'cache nghttp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-nghttp2
env:
cache-name: cache-nghttp2
with:
path: ~/nghttp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.QUICTLS_VERSION }}-${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}
fail-on-cache-miss: true
- name: 'cache quiche'
if: ${{ contains(matrix.build.name, 'quiche') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
if: ${{ matrix.build.name == 'quiche' }}
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-quiche
env:
cache-name: cache-quiche
@ -724,10 +632,10 @@ jobs:
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.QUICHE_VERSION }}
- name: 'build quiche and boringssl'
if: ${{ contains(matrix.build.name, 'quiche') && steps.cache-quiche.outputs.cache-hit != 'true' }}
if: ${{ matrix.build.name == 'quiche' && steps.cache-quiche.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche
git clone --quiet --depth=1 -b "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche.git
cd quiche
#### Work-around https://github.com/curl/curl/issues/7927 #######
#### See https://github.com/alexcrichton/cmake-rs/issues/131 ####
@ -736,14 +644,15 @@ jobs:
cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose
ln -s libquiche.so target/release/libquiche.so.0
mkdir -v quiche/deps/boringssl/src/lib
find target/release \( -name libcrypto.a -o -name libssl.a \) -exec ln -vnf -- '{}' quiche/deps/boringssl/src/lib \;
# shellcheck disable=SC2046
ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
# include dir
# /home/runner/quiche/quiche/deps/boringssl/src/include
# lib dir
# /home/runner/quiche/quiche/deps/boringssl/src/lib
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -753,27 +662,24 @@ jobs:
- name: 'configure'
env:
LDFLAGS: '${{ matrix.build.LDFLAGS }}'
MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}'
MATRIX_PKG_CONFIG_PATH: '${{ matrix.build.PKG_CONFIG_PATH }}'
run: |
[ -n "${MATRIX_PKG_CONFIG_PATH}" ] && export PKG_CONFIG_PATH="${MATRIX_PKG_CONFIG_PATH}"
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
[[ "${MATRIX_GENERATE}" = *'boringssl'* ]] && options=" -DBORINGSSL_VERSION=${BORINGSSL_VERSION}"
cmake -B bld -G Ninja \
-DCMAKE_C_COMPILER_TARGET="$(uname -m)-pc-linux-gnu" -DBUILD_STATIC_LIBS=ON \
-DCURL_WERROR=ON -DENABLE_DEBUG=ON \
-DCURL_USE_LIBUV=ON -DCURL_ENABLE_NTLM=ON \
-DCURL_USE_LIBUV=ON \
-DTEST_NGHTTPX=/home/runner/nghttp2/build/bin/nghttpx \
-DHTTPD_NGHTTPX=/home/runner/nghttp2/build/bin/nghttpx \
${MATRIX_GENERATE} ${options}
${MATRIX_GENERATE}
else
[[ "${MATRIX_CONFIGURE}" = *'boringssl'* ]] && export CPPFLAGS="-DCURL_BORINGSSL_VERSION=\\\"${BORINGSSL_VERSION}\\\""
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror --enable-debug --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-libuv --enable-ntlm \
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror --enable-debug \
--with-libuv \
--with-test-nghttpx=/home/runner/nghttp2/build/bin/nghttpx \
--disable-dependency-tracking \
${MATRIX_CONFIGURE}
fi
@ -797,11 +703,8 @@ jobs:
make -C bld V=1
fi
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
bld/src/curl --disable -V
- name: 'check curl -V output'
run: bld/src/curl -V
- name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
@ -815,28 +718,14 @@ jobs:
- name: 'install test prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
python3 -m venv ~/venv
if bld/src/curl --disable -V 2>/dev/null | grep smb; then
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
fi
source ~/venv/bin/activate
python3 -m pip install -r tests/requirements.txt
- name: 'run tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
env:
TFLAGS: '${{ matrix.build.tflags }}'
run: |
TFLAGS+=' -n'
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
else
make -C bld V=1 test-ci
fi
- name: 'run tests (valgrind)'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
export TFLAGS='-j6 --min=4 HTTP/3'
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
@ -847,10 +736,10 @@ jobs:
- name: 'install pytest prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
[ -d ~/venv ] || python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt
source ~/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt
- name: 'run pytest (event based)'
- name: 'run pytest event based'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
env:
CURL_TEST_EVENT: 1

View file

@ -10,24 +10,19 @@
# https://github.com/actions/labeler
name: 'Labeler'
'on': [pull_request_target] # zizmor: ignore[dangerous-triggers]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
label:
name: 'Labeler'
runs-on: ubuntu-slim
runs-on: ubuntu-latest
permissions:
contents: read # To comply with https://github.com/actions/labeler documentation
pull-requests: write # To edit labels on PRs
contents: read
pull-requests: write
steps:
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'

View file

@ -11,12 +11,12 @@
# is still supported (as of this writing).
# stretch has ELTS support from Freexian until 2027-06-30
# For ELTS info see https://www.freexian.com/lts/extended/docs/how-to-use-extended-lts/
# The Debian key expires 2025-05-20, after which package signature
# The Debian key will expire 2025-05-20, after which package signature
# verification may need to be disabled.
# httrack is one of the smallest downloaders, needed to bootstrap ELTS,
# and doesn not conflict with the curl we are building.
# and won't conflict with the curl we're building.
name: 'Linux Old'
name: 'Old Linux'
'on':
push:
@ -28,7 +28,10 @@ name: 'Linux Old'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -37,24 +40,22 @@ name: 'Linux Old'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
- 'winbuild/**'
permissions: {}
env:
MAKEFLAGS: -j 5
CURL_CI: github
CURL_TEST_MIN: 1500
DEBIAN_FRONTEND: noninteractive
jobs:
cmake-autotools:
name: 'autotools & cmake'
runs-on: ubuntu-latest
name: 'cmake & autotools'
runs-on: 'ubuntu-latest'
container: 'debian:stretch'
steps:
@ -66,121 +67,90 @@ jobs:
# See comment above if this fails after 2025-05-20
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends httrack
httrack --get https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb
sha256sum freexian-archive-keyring_2022.06.08_all.deb && dpkg -i freexian-archive-keyring_2022.06.08_all.deb
dpkg -i freexian-archive-keyring_2022.06.08_all.deb
echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list
apt-get -o Dpkg::Use-Pty=0 update
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends \
make automake autoconf libtool ninja-build gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libkrb5-dev libldap2-dev stunnel4
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libgnutls28-dev libssh-dev libssh2-1-dev libc-ares-dev heimdal-dev libldap2-dev librtmp-dev stunnel4 groff
# GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on
# gcc-8-base, but it does not actually seem used in our situation and is not available in
# gcc-8-base, but it doesn't actually seem used in our situation and isn't available in
# the main repo, so force the install.
httrack --get https://deb.freexian.com/extended-lts/pool/main/g/glibc/libc6_2.28-10+deb10u5_amd64.deb
httrack --get https://deb.freexian.com/extended-lts/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb
sha256sum libc6_*_amd64.deb libstdc++6_*_amd64.deb && dpkg -i --force-depends libc6_*_amd64.deb libstdc++6_*_amd64.deb
dpkg -i --force-depends libc6_*_amd64.deb libstdc++6_*_amd64.deb
- name: 'install prereqs (cmake)'
env:
CMAKE_VERSION: 3.18.0 # Earliest version supported by curl
CMAKE_SHA256: 4d9a9d3351161073a67e49366d701b6fa4b0343781982dc5eef08a02a750d403
run: |
cd ~
fn="cmake-${CMAKE_VERSION}-linux-x86_64"
httrack --get "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.tar.gz"
sha256sum "${fn}".tar*.gz | tee /dev/stderr | grep -qwF -- "${CMAKE_SHA256}" && tar -xf "${fn}".tar*.gz && rm -f "${fn}".tar*.gz
mv "cmake-${CMAKE_VERSION}-Linux-x86_64" cmake
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'CM build-only configure (out-of-tree)'
- name: 'cmake build-only (out-of-tree, libssh2)'
run: |
~/cmake/bin/cmake -B bld-1 -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF
mkdir bld-1
cd bld-1
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_USE_GNUTLS=ON -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON
make install
src/curl --disable --version
- name: 'CM build-only build'
run: |
~/cmake/bin/cmake --build bld-1 --verbose
~/cmake/bin/cmake --install bld-1 --verbose
- name: 'CM build-only curl -V'
run: bld-1/src/curl --disable --version
- name: 'CM build-only configure log'
if: ${{ !cancelled() }}
run: cat bld-1/CMakeFiles/CMake*.log 2>/dev/null || true
- name: 'CM build-only curl_config.h'
- name: 'cmake build-only curl_config.h'
run: |
echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-1/lib/curl_config.h | sort || true
# when this job can get a libssh version 0.9.0 or later, this should get
# that enabled again
# when this job can get c-ares 1.16.0 or later, we can enable that
# again
- name: 'CM configure (out-of-tree, zstd, gssapi)'
- name: 'cmake generate (out-of-tree, c-ares, zstd, gssapi)'
run: |
~/cmake/bin/cmake -B bld-oldie -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF \
mkdir bld-cares
cd bld-cares
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_USE_GNUTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \
-DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
- name: 'CM configure log'
if: ${{ !cancelled() }}
run: cat bld-oldie/CMakeFiles/CMake*.log 2>/dev/null || true
- name: 'CM curl_config.h'
- name: 'cmake curl_config.h'
run: |
echo '::group::raw'; cat bld-oldie/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-oldie/lib/curl_config.h | sort || true
echo '::group::raw'; cat bld-cares/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-cares/lib/curl_config.h | sort || true
- name: 'CM build'
run: ~/cmake/bin/cmake --build bld-oldie
- name: 'cmake build'
run: |
make -C bld-cares
bld-cares/src/curl --disable --version
- name: 'CM curl -V'
run: bld-oldie/src/curl --disable --version
- name: 'cmake install'
run: make -C bld-cares install
- name: 'CM install'
run: ~/cmake/bin/cmake --install bld-oldie
- name: 'cmake build tests'
run: make -C bld-cares testdeps
- name: 'CM build tests'
run: ~/cmake/bin/cmake --build bld-oldie --target testdeps
- name: 'cmake run tests'
run: make -C bld-cares test-ci
- name: 'CM run tests'
run: ~/cmake/bin/cmake --build bld-oldie --target test-ci
- name: 'cmake build examples'
run: make -C bld-cares curl-examples-build
- name: 'CM build examples'
run: ~/cmake/bin/cmake --build bld-oldie --target curl-examples-build
- name: 'autoreconf'
run: autoreconf -if
- name: 'AM autoreconf'
run: autoreconf -fi
- name: 'AM configure (out-of-tree, zstd, gssapi)'
- name: 'configure (out-of-tree, c-ares, libssh2, zstd, gssapi)'
run: |
mkdir bld-am
cd bld-am
../configure --prefix="$PWD"/../curl-install-am --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
--without-ssl --disable-ares --without-libssh2 --with-zstd --with-gssapi
../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
--with-gnutls --enable-ares --with-libssh2 --with-zstd --with-gssapi --with-librtmp \
--prefix="$PWD"/../curl-install-am
- name: 'AM configure log'
if: ${{ !cancelled() }}
run: cat bld-am/config.log 2>/dev/null || true
- name: 'AM curl_config.h'
- name: 'autotools curl_config.h'
run: |
echo '::group::raw'; cat bld-am/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-am/lib/curl_config.h | sort || true
- name: 'AM build'
run: make -C bld-am
- name: 'autotools build'
run: |
make -C bld-am
bld-am/src/curl --disable --version
- name: 'AM curl -V'
run: bld-am/src/curl --disable --version
- name: 'AM install'
- name: 'autotools install'
run: make -C bld-am install
- name: 'AM build tests'
- name: 'autotools build tests'
run: make -C bld-am/tests all

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,10 @@ name: 'macOS'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -23,7 +26,10 @@ name: 'macOS'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -31,35 +37,31 @@ concurrency:
permissions: {}
# Apple APIs and the macos-version-min value required to avoid deprecation
# warnings with llvm/clang, and/or the feature getting enabled at build-time
# or runtime:
# Deprecated Apple APIs and the macos-version-min value required to avoid
# deprecation warnings with llvm/clang:
#
# - 10.7 Lion (2011) - GSS
# - 10.9 Mavericks (2013) - LDAP
#
# - 10.7 Lion (2011) - GSS (build-time, deprecated MIT Kerberos shim)
# - 10.9 Mavericks (2013) - LDAP (build-time, deprecated), OCSP (runtime)
# - 10.11 El Capitan (2015) - connectx() (runtime)
# - 10.12 Sierra (2016) - clock_gettime() (build-time, runtime)
# - 10.14 Mojave (2018) - SecTrustEvaluateWithError() (runtime)
env:
CURL_CI: github
CURL_TEST_MIN: 1700
MAKEFLAGS: -j 4
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
jobs:
ios:
name: "iOS, ${{ (matrix.build.generator && format('CM-{0}', matrix.build.generator)) || (matrix.build.generate && 'CM' || 'AM' )}} ${{ matrix.build.name }} arm64"
runs-on: macos-latest
runs-on: 'macos-latest'
timeout-minutes: 10
env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: 'clang'
CC: ${{ matrix.build.compiler || 'clang' }}
LDFLAGS: ''
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_OPTIONS: ${{ matrix.build.options }}
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.2.1
# renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.1.0
strategy:
fail-fast: false
matrix:
@ -71,8 +73,16 @@ jobs:
- name: 'libressl'
install_steps: libressl
# FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it.
generate: >-
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD_BATCH_SIZE=50
-DOPENSSL_INCLUDE_DIR=/Users/runner/libressl/include
-DOPENSSL_SSL_LIBRARY=/Users/runner/libressl/lib/libssl.a
-DOPENSSL_CRYPTO_LIBRARY=/Users/runner/libressl/lib/libcrypto.a
-DCURL_USE_LIBPSL=OFF
- name: 'libressl'
install_steps: libressl
generator: Xcode
xcode: '' # default Xcode. Set it once to silence actionlint.
options: --config Debug
generate: >-
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF
@ -80,25 +90,14 @@ jobs:
-DOPENSSL_INCLUDE_DIR=/Users/runner/libressl/include
-DOPENSSL_SSL_LIBRARY=/Users/runner/libressl/lib/libssl.a
-DOPENSSL_CRYPTO_LIBRARY=/Users/runner/libressl/lib/libcrypto.a
-DCURL_USE_LIBPSL=OFF -DCURL_ENABLE_NTLM=ON
-DCURL_USE_LIBPSL=OFF
steps:
- name: 'brew install'
if: ${{ matrix.build.configure }}
timeout-minutes: 5
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
- name: 'toolchain versions'
run: |
@ -107,13 +106,12 @@ jobs:
xcodebuild -sdk -version | grep '^Path:' || true
xcrun --sdk iphoneos --show-sdk-path 2>/dev/null || true
xcrun --sdk iphoneos --show-sdk-version || true
echo '::group::compiler defaults'; echo 'int main(void) {}' | "${CC}" -v -x c -; echo '::endgroup::'
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
- name: 'cache libressl'
if: ${{ contains(matrix.build.install_steps, 'libressl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-libressl
env:
cache-name: cache-libressl
@ -125,10 +123,11 @@ jobs:
if: ${{ contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" | tar -x
cd "libressl-${LIBRESSL_VERSION}"
# FIXME: on the 4.0.1 release, delete '-DHAVE_ENDIAN_H=0'
cmake -B . -G Ninja \
-DHAVE_ENDIAN_H=0 \
-DCMAKE_INSTALL_PREFIX=/Users/runner/libressl \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
@ -138,7 +137,7 @@ jobs:
cmake --build .
cmake --install . --verbose
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -156,13 +155,13 @@ jobs:
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
[ -n "${MATRIX_GENERATOR}" ] && options="-G ${MATRIX_GENERATOR}"
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_SYSTEM_NAME=iOS \
-DUSE_APPLE_IDN=ON \
${MATRIX_GENERATE} ${options}
else
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \
--disable-dependency-tracking \
CFLAGS="-isysroot $(xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)" \
--host=aarch64-apple-darwin \
--with-apple-idn \
@ -187,12 +186,9 @@ jobs:
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
run: find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -exec file '{}' \;
- name: 'build tests'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target testdeps --verbose
@ -201,7 +197,6 @@ jobs:
fi
- name: 'build examples'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target curl-examples-build --verbose
@ -210,215 +205,155 @@ jobs:
fi
macos:
name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.compiler }} ${{ matrix.build.name }}"
runs-on: ${{ matrix.build.image || 'macos-15' }}
timeout-minutes: 15
name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.build.name }}"
runs-on: 'macos-15'
timeout-minutes: 45
env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: '${{ matrix.build.compiler }}'
CC: '${{ matrix.compiler }}'
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_COMPILER: '${{ matrix.build.compiler }}'
MATRIX_COMPILER: '${{ matrix.compiler }}'
MATRIX_INSTALL: '${{ matrix.build.install }}'
MATRIX_INSTALL_STEPS: '${{ matrix.build.install_steps }}'
MATRIX_MACOS_VERSION_MIN: '${{ matrix.build.macos-version-min }}'
strategy:
fail-fast: false
matrix:
compiler: [clang, llvm@18, gcc-12]
build:
# autotools
- name: '!ssl !debug brotli zstd'
compiler: gcc-13
configure: --without-ssl --with-brotli --with-zstd --with-apple-idn
tflags: '--min=1450'
xcode: '' # default Xcode. Set it once to silence actionlint.
compiler: clang
install: brotli zstd
configure: --without-ssl --with-brotli --with-zstd
- name: '!ssl !debug'
compiler: gcc-12
configure: --without-ssl
- name: '!ssl'
compiler: clang
configure: --enable-debug --without-ssl
- name: '!ssl libssh2 AppleIDN'
compiler: clang
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH2=ON -DUSE_APPLE_IDN=ON -DCURL_ENABLE_SSL=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
tflags: '--min=1550'
configure: --enable-debug --with-libssh2=/opt/homebrew/opt/libssh2 --without-ssl --with-apple-idn
- name: 'OpenSSL libssh c-ares'
compiler: clang
install: libssh
configure: --enable-debug --with-libssh --with-openssl=/opt/homebrew/opt/openssl --enable-ares --with-fish-functions-dir --with-zsh-functions-dir
- name: 'OpenSSL libssh'
compiler: llvm@18
install: libssh libnghttp3
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
- name: '!ssl HTTP-only c-ares'
macos-version-min: '10.15' # Catalina (2019)
configure: --enable-debug --with-libssh --with-openssl=/opt/homebrew/opt/openssl --with-openssl-quic
- name: '!ssl c-ares'
compiler: clang
tflags: '--min=930'
generate: >-
-DENABLE_DEBUG=ON -DENABLE_ARES=ON
-DCURL_ENABLE_SSL=OFF -DHTTP_ONLY=ON
-DCURL_DISABLE_ALTSVC=ON -DENABLE_UNIX_SOCKETS=OFF
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_NGHTTP2=OFF
-DCURL_USE_GSSAPI=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF
-DCURL_BROTLI=OFF -DCURL_ZLIB=OFF -DCURL_ZSTD=OFF
-DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF
configure: --enable-debug --enable-ares --without-ssl
- name: '!ssl HTTP-only'
compiler: clang
configure: >-
--enable-debug
--disable-alt-svc --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap
--disable-ldap --disable-pop3 --without-librtmp --disable-rtsp
--disable-shared --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets
--without-brotli --without-gssapi --without-libidn2 --without-libpsl --without-librtmp
--without-libssh2 --without-libssh --without-wolfssh
--without-nghttp2 --disable-ntlm --without-ssl --without-zlib --without-zstd
- name: 'LibreSSL !ldap +examples'
macos-version-min: '10.15' # Catalina (2019)
- name: 'LibreSSL +examples'
compiler: clang
install: libressl
install_steps: pytest
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
-DCURL_USE_LIBSSH2=OFF -DCURL_ENABLE_NTLM=ON
- name: 'OpenSSL 10.15 C89'
macos-version-min: '10.15'
configure: --enable-debug --with-openssl=/opt/homebrew/opt/libressl
- name: 'OpenSSL'
compiler: clang
install: libnghttp3 libngtcp2
install_steps: pytest
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_NGTCP2=ON -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_USE_LIBSSH2=OFF
-DCMAKE_C_STANDARD=90 -DCURL_ENABLE_NTLM=ON
- name: 'OpenSSL SecTrust'
compiler: clang
install: libnghttp3 libngtcp2
install_steps: pytest
configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl --with-ngtcp2 --with-apple-sectrust --enable-ntlm
configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl --with-ngtcp2
- name: 'OpenSSL event-based'
compiler: clang
generate: -DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_ENABLE_NTLM=ON
tflags: '--test-event --min=1300'
- name: 'OpenSSL gsasl AppleIDN SecTrust +examples'
configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl
tflags: --test-event
- name: 'quictls libssh2 !ldap 10.15'
compiler: clang
install: libnghttp3 libngtcp2 gsasl
generate: >-
-DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON -DUSE_NGTCP2=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON
-DUSE_APPLE_SECTRUST=ON -DCURL_ENABLE_NTLM=ON
install: quictls
configure: --enable-debug --disable-ldap --with-openssl=/opt/homebrew/opt/quictls LDFLAGS=-L/opt/homebrew/opt/quictls/lib
macos-version-min: '10.15'
# cmake
- name: 'OpenSSL gsasl rtmp AppleIDN'
install: libnghttp3 libngtcp2 gsasl rtmpdump
generate: -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON -DUSE_NGTCP2=ON
- name: 'MultiSSL AppleIDN clang-tidy +examples'
image: macos-26
compiler: clang
install: llvm gnutls nettle libressl krb5 mbedtls gsasl rustls-ffi libssh fish
install_steps: skiprun
install: llvm brotli zstd gnutls nettle mbedtls gsasl rtmpdump fish
install_steps: clang-tidy
generate: -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_DEFAULT_SSL_BACKEND=openssl -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy -DCURL_COMPLETION_FISH=ON -DCURL_COMPLETION_ZSH=ON
chkprefill: _chkprefill
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DEFAULT_SSL_BACKEND=openssl
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_BROTLI=ON -DCURL_ZSTD=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy
-DCURL_COMPLETION_FISH=ON -DCURL_COMPLETION_ZSH=ON
-DCURL_ENABLE_NTLM=ON
- name: 'HTTP/3 clang-tidy'
image: macos-26
compiler: clang
install: llvm libnghttp3 libngtcp2 openldap krb5
install_steps: skipall
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_NGTCP2=ON
-DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include
-DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib
-DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_BROTLI=ON -DCURL_ZSTD=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy
-DCURL_ENABLE_NTLM=ON
- name: 'LibreSSL openldap krb5 c-ares +examples'
compiler: clang
install: libressl krb5 openldap
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON
-DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include
-DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib
-DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
- name: 'quictls +static libssh +examples'
install: quictls libssh
generate: -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/quictls -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
- name: 'LibreSSL openldap heimdal c-ares +examples'
install: libressl heimdal openldap
generate: -DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/heimdal -DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include -DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib -DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
- name: 'wolfSSL !ldap brotli zstd'
compiler: clang
install: brotli wolfssl zstd
install_steps: pytest
generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON
generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON
- name: 'mbedTLS !ldap brotli zstd MultiSSL AppleIDN'
compiler: llvm@18
install: brotli mbedtls zstd
install_steps: codeset-test
generate: -DCURL_USE_MBEDTLS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DEFAULT_SSL_BACKEND=mbedtls -DCURL_USE_OPENSSL=ON -DUSE_APPLE_IDN=ON -DCURL_ENABLE_NTLM=ON
- name: 'GnuTLS !ldap krb5 +examples'
compiler: clang
generate: -DCURL_USE_MBEDTLS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DEFAULT_SSL_BACKEND=mbedtls -DCURL_USE_OPENSSL=ON -DUSE_APPLE_IDN=ON
- name: 'GnuTLS !ldap krb5'
install: gnutls nettle krb5
generate: >-
-DENABLE_DEBUG=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON -DCURL_ENABLE_NTLM=ON
- name: 'aws-lc +analyzer'
compiler: gcc-15
generate: -DENABLE_DEBUG=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5 -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON
- name: 'aws-lc'
compiler: gcc-12
install: aws-lc
generate: >-
-DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/aws-lc -DUSE_ECH=ON
-DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON -DCURL_GCC_ANALYZER=ON
generate: -DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/aws-lc -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON
- name: 'Rustls'
compiler: clang
install: rustls-ffi
generate: -DENABLE_DEBUG=ON -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON -DCURL_ENABLE_NTLM=ON
tflags: '--min=1650'
- name: 'OpenSSL torture 1'
generate: -DENABLE_DEBUG=ON -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON
- name: 'OpenSSL torture !FTP'
compiler: clang
install: libnghttp3
install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_ENABLE_NTLM=ON
tflags: '-t --shallow=25 --min=480 1 to 500'
- name: 'OpenSSL torture 2'
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_OPENSSL_QUIC=ON
tflags: -t --shallow=25 !FTP
- name: 'OpenSSL torture FTP'
compiler: clang
install: libnghttp3
install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_ENABLE_NTLM=ON
tflags: '-t --shallow=25 --min=730 501 to 1250'
- name: 'OpenSSL torture 3'
compiler: clang
install: libnghttp3
install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_ENABLE_NTLM=ON
tflags: '-t --shallow=25 --min=628 1251 to 9999'
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_OPENSSL_QUIC=ON
tflags: -t --shallow=20 FTP
exclude:
# opt out jobs from combinations that have the compiler set manually
- { compiler: llvm@18, build: { compiler: 'clang' } }
- { compiler: llvm@18, build: { compiler: 'gcc-12' } }
- { compiler: gcc-12, build: { compiler: 'clang' } }
- { compiler: gcc-12, build: { compiler: 'llvm@18' } }
- { compiler: clang, build: { compiler: 'gcc-12' } }
- { compiler: clang, build: { compiler: 'llvm@18' } }
steps:
- name: 'brew install'
timeout-minutes: 5
# Run this command with retries because of spurious failures seen
# while running the tests, for example
# https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
env:
INSTALL_PACKAGES: >-
${{ matrix.build.generate && 'ninja' || 'automake libtool' }}
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'nghttp2 stunnel' || '' }}
${{ !contains(matrix.build.install_steps, 'clang-tidy') && 'nghttp2 stunnel' || '' }}
${{ contains(matrix.build.install_steps, 'pytest') && 'caddy httpd vsftpd' || '' }}
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install pkgconf libpsl libssh2 ${INSTALL_PACKAGES} ${MATRIX_INSTALL}; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
echo pkgconf libpsl libssh2 ${INSTALL_PACKAGES} ${MATRIX_INSTALL} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew bundle install --file /tmp/Brewfile; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
- name: 'brew unlink openssl'
if: ${{ contains(matrix.build.install, 'aws-lc') || contains(matrix.build.install, 'libressl') }}
if: ${{ contains(matrix.build.install, 'aws-lc') || contains(matrix.build.install, 'libressl') || contains(matrix.build.install, 'quictls') }}
run: |
if [ -d "$(brew --prefix)"/include/openssl ]; then
if [ -d /opt/homebrew/include/openssl ]; then
brew unlink openssl
fi
@ -432,9 +367,9 @@ jobs:
xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || true
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -468,7 +403,7 @@ jobs:
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
${MATRIX_GENERATE} ${options}
@ -488,9 +423,9 @@ jobs:
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
[[ "${MATRIX_INSTALL_STEPS}" = *'pytest'* ]] && options+=' --with-test-vsftpd=no' # Skip ~20 tests that stretch run time by 7x on macOS
mkdir bld && cd bld && ../configure --prefix="$PWD"/curl-install --enable-unity --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-libpsl="$(brew --prefix libpsl)" \
mkdir bld && cd bld && ../configure --prefix="$PWD"/curl-install --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
--with-libpsl=/opt/homebrew/opt/libpsl \
${MATRIX_CONFIGURE} ${options}
fi
@ -514,11 +449,8 @@ jobs:
make -C bld V=1
fi
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
bld/src/curl --disable --version
- name: 'curl version'
run: bld/src/curl --disable --version
- name: 'curl install'
run: |
@ -529,7 +461,6 @@ jobs:
fi
- name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target testdeps
@ -538,24 +469,20 @@ jobs:
fi
- name: 'install test prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') }}
run: |
python3 -m venv ~/venv
if bld/src/curl --disable -V 2>/dev/null | grep smb; then
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
fi
source ~/venv/bin/activate
python3 -m pip install -r tests/requirements.txt
- name: 'run tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') }}
timeout-minutes: ${{ contains(matrix.build.install_steps, 'torture') && 20 || 10 }}
env:
TEST_TARGET: ${{ contains(matrix.build.install_steps, 'torture') && 'test-torture' || 'test-ci' }}
TFLAGS: '${{ matrix.build.tflags }}'
run: |
TFLAGS="-j20 ${TFLAGS}"
if [ "${TEST_TARGET}" != 'test-ci' ]; then
TFLAGS+=' --buildinfo' # only test-ci sets this by default, set it manually for test-torture
fi
source ~/venv/bin/activate
if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test'* ]]; then
locale || true
@ -571,13 +498,13 @@ jobs:
fi
- name: 'install pytest prereqs'
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') && contains(matrix.build.install_steps, 'pytest') }}
run: |
[ -d ~/venv ] || python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt
source ~/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt
- name: 'run pytest'
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
if: ${{ !contains(matrix.build.install_steps, 'clang-tidy') && contains(matrix.build.install_steps, 'pytest') }}
env:
PYTEST_ADDOPTS: '--color=yes'
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
@ -599,7 +526,7 @@ jobs:
fi
combinations: # Test buildability with host OS, Xcode / SDK, compiler, target-OS, built tool, combinations
name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }}"
name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }} ${{ matrix.config }}"
runs-on: ${{ matrix.image }}
timeout-minutes: 10
env:
@ -612,64 +539,58 @@ jobs:
strategy:
fail-fast: false
matrix:
# Sources:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md
compiler: [gcc-13, gcc-14, gcc-15, llvm@15, llvm@18, llvm@20, clang]
# Xcode support matrix as of 2025-10, with default macOS SDK versions and OS names, years:
compiler: [gcc-12, gcc-13, gcc-14, llvm@15, llvm@18, clang]
# Xcode support matrix as of 2024-07, with default macOS SDK versions and OS names, years:
# * = default Xcode on the runner.
# macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4
# macos-15: 16.0, 16.1, 16.2, 16.3,*16.4, 26.0
# macos-26: 16.4 *26.0
# macOSSDK: 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1, 15.2, 15.4, 15.5, 26.0
# Sonoma (2023) Sequoia (2024) Tahoe (2025)
# macos-13: 14.1, 14.2, 14.3.1, 15.0.1, 15.1,*15.2
# macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4
# macos-15: *16.0, 16.1
# macOSSDK: 13.0, 13.1, 13.3, 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1
# Ventura (2022) Sonoma (2023) Sequoia (2024)
# https://github.com/actions/runner-images/tree/main/images/macos
# https://en.wikipedia.org/wiki/MacOS_version_history
image: [macos-14, macos-15, macos-26]
# TODO when dropping macos-13: replace '$(brew --prefix ...' with /opt/homebrew
image: [macos-13, macos-14, macos-15]
# Can skip these to reduce jobs:
# 15.1 has the same default macOS SDK as 15.2 and identical test results.
# 14.1, 15.4 not revealing new fallouts.
#xcode: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1', '15.2', '15.3', '15.4', '16.0', '16.1'] # all Xcode
#xcode: ['14.1', '14.2', '14.3.1', '15.0.1' , '15.2', '15.3', '15.4', '16.0', '16.1'] # all SDK
#xcode: [ '14.2', '14.3.1', '15.0.1' , '15.2', '15.3' , '16.0' ] # coverage
xcode: [''] # default Xcodes
macos-version-min: ['']
build: [autotools, cmake]
exclude:
# Combinations not covered by runner images:
- { image: macos-13, xcode: '15.3' }
- { image: macos-13, xcode: '15.4' }
- { image: macos-13, xcode: '16.0' }
- { image: macos-13, xcode: '16.1' }
- { image: macos-14, xcode: '14.1' }
- { image: macos-14, xcode: '14.2' }
- { image: macos-14, xcode: '14.3.1' }
- { image: macos-14, xcode: '16.0' }
- { image: macos-14, xcode: '16.1' }
- { image: macos-15, xcode: '14.1' }
- { image: macos-15, xcode: '14.2' }
- { image: macos-15, xcode: '14.3.1' }
- { image: macos-15, xcode: '15.0.1' }
- { image: macos-15, xcode: '15.1' }
- { image: macos-15, xcode: '15.2' }
- { image: macos-15, xcode: '15.3' }
- { image: macos-15, xcode: '15.4' }
- { image: macos-13, compiler: 'llvm@18' }
- { image: macos-14, compiler: 'llvm@18' }
- { image: macos-14, compiler: 'llvm@20' }
- { image: macos-15, compiler: 'llvm@15' }
- { image: macos-15, compiler: 'llvm@20' }
- { image: macos-26, compiler: 'llvm@15' }
- { image: macos-26, compiler: 'llvm@18' }
# Covered by the main workflow
- { image: macos-15, compiler: 'gcc-13' }
- { image: macos-15, compiler: 'llvm@18' }
- { image: macos-15, compiler: 'clang' }
# Reduce build combinations, by dropping less interesting ones
- { image: macos-26, compiler: 'gcc-13' }
- { compiler: 'gcc-14' , build: cmake }
# Reduce autotools to just one job that is also build with cmake
- { compiler: 'gcc-13' , build: autotools }
- { compiler: 'gcc-14' , build: autotools }
- { compiler: 'gcc-15' , build: autotools }
- { compiler: 'llvm@15', build: autotools }
- { compiler: 'llvm@18', build: autotools }
- { compiler: 'llvm@20', build: autotools }
- { image: macos-14, build: autotools }
- { image: macos-15, build: autotools }
- { compiler: gcc-13, build: cmake }
- { compiler: gcc-14, build: autotools }
steps:
- name: 'install autotools'
if: ${{ matrix.build == 'autotools' }}
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
# shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do for i in 1 2 3; do if brew update && brew install automake libtool; then break 2; else echo Error: wait to try again; sleep 10; fi; done; false Too many retries; done
- name: 'toolchain versions'
run: |
@ -680,11 +601,10 @@ jobs:
xcrun --sdk macosx --show-sdk-path 2>/dev/null || true
xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || true
echo '::group::compiler defaults'; echo 'int main(void) {}' | "${CC}" -v -x c -; echo '::endgroup::'
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -694,9 +614,9 @@ jobs:
- name: 'configure / ${{ matrix.build }}'
run: |
if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ]; then
if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ] ; then
# Ref: https://github.com/Homebrew/homebrew-core/issues/194778#issuecomment-2793243409
"$(brew --prefix gcc@13)"/libexec/gcc/aarch64-apple-darwin24/13/install-tools/mkheaders
/opt/homebrew/opt/gcc@13/libexec/gcc/aarch64-apple-darwin24/13/install-tools/mkheaders
fi
if [[ "${MATRIX_COMPILER}" = 'gcc'* ]]; then
@ -715,7 +635,7 @@ jobs:
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && options+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, and libssh2
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \
@ -723,7 +643,6 @@ jobs:
-DCURL_USE_OPENSSL=ON \
-DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \
-DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \
-DUSE_APPLE_IDN=ON -DUSE_APPLE_SECTRUST=ON \
${options}
else
export CFLAGS
@ -736,13 +655,12 @@ jobs:
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, but libssh2 is disabled by default
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
--disable-docs --disable-manual \
--with-openssl="$(brew --prefix openssl)" \
--without-nghttp2 --without-libidn2 \
--without-libpsl \
--with-apple-idn --with-apple-sectrust \
${options}
fi
@ -763,8 +681,5 @@ jobs:
make -C bld V=1
fi
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
bld/src/curl --disable --version
- name: 'curl version'
run: bld/src/curl --disable --version

View file

@ -14,7 +14,10 @@ name: 'non-native'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
pull_request:
branches:
- master
@ -23,7 +26,10 @@ name: 'non-native'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -33,7 +39,6 @@ permissions: {}
env:
CURL_CI: github
CURL_TEST_MIN: 1750
jobs:
netbsd:
@ -44,21 +49,21 @@ jobs:
matrix:
arch: ['x86_64']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455 # v1.0.0
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
env:
MATRIX_ARCH: '${{ matrix.arch }}'
with:
environment_variables: CURL_CI CURL_TEST_MIN MATRIX_ARCH
environment_variables: MATRIX_ARCH
operating_system: 'netbsd'
version: '10.1'
architecture: ${{ matrix.arch }}
run: |
# https://pkgsrc.se/
time sudo pkgin -y install cmake ninja-build pkg-config perl brotli mit-krb5 openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
time sudo pkgin -y install cmake ninja-build pkg-config perl brotli heimdal openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
time cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON \
@ -66,7 +71,6 @@ jobs:
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=ON \
-DCURL_ENABLE_NTLM=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
@ -90,15 +94,15 @@ jobs:
matrix:
arch: ['x86_64']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455 # v1.0.0
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
env:
MATRIX_ARCH: '${{ matrix.arch }}'
with:
environment_variables: CURL_CI CURL_TEST_MIN MATRIX_ARCH
environment_variables: MATRIX_ARCH
operating_system: 'openbsd'
version: '7.7'
architecture: ${{ matrix.arch }}
@ -112,7 +116,6 @@ jobs:
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
-DCURL_ENABLE_NTLM=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
@ -131,30 +134,29 @@ jobs:
freebsd:
name: "FreeBSD, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} openssl${{ matrix.desc }} ${{ matrix.arch }}"
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 20
strategy:
matrix:
include:
- { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
- { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF', desc: ' !unity !runtests !examples' }
- { build: 'autotools', arch: 'arm64' , compiler: 'clang', desc: ' !examples' }
- { build: 'cmake' , arch: 'arm64' , compiler: 'clang' }
- { build: 'autotools', arch: 'arm64', compiler: 'clang' }
- { build: 'cmake' , arch: 'arm64', compiler: 'clang' }
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: '${{ matrix.build }}'
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455 # v1.0.0
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
env:
CC: '${{ matrix.compiler }}'
CURL_TEST_MIN: 1800
MATRIX_ARCH: '${{ matrix.arch }}'
MATRIX_BUILD: '${{ matrix.build }}'
MATRIX_DESC: '${{ matrix.desc }}'
MATRIX_OPTIONS: '${{ matrix.options }}'
with:
environment_variables: CC CURL_CI CURL_TEST_MIN MATRIX_ARCH MATRIX_BUILD MATRIX_DESC MATRIX_OPTIONS
environment_variables: CC MATRIX_ARCH MATRIX_BUILD MATRIX_DESC MATRIX_OPTIONS
operating_system: 'freebsd'
version: '14.3'
architecture: ${{ matrix.arch }}
@ -164,10 +166,10 @@ jobs:
# https://ports.freebsd.org/
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time sudo pkg install -y cmake-core ninja perl5 \
pkgconf brotli krb5-devel openldap26-client libidn2 libnghttp2 stunnel py311-impacket
pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
else
time sudo pkg install -y autoconf automake libtool \
pkgconf brotli krb5-devel openldap26-client libidn2 libnghttp2 stunnel py311-impacket
pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
export MAKEFLAGS=-j3
fi
@ -188,10 +190,11 @@ jobs:
options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU
fi
mkdir bld && cd bld
time ../configure --prefix="$HOME"/curl-install --enable-unity --enable-debug --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
time ../configure --enable-unity --enable-debug --enable-warnings --enable-werror \
--prefix="$HOME"/curl-install \
--with-openssl \
--with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \
--disable-dependency-tracking \
${options} \
${MATRIX_OPTIONS} \
|| { tail -n 1000 config.log; false; }
@ -238,10 +241,9 @@ jobs:
android:
name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64"
runs-on: ubuntu-latest
timeout-minutes: 5
runs-on: 'ubuntu-latest'
timeout-minutes: 25
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
strategy:
@ -261,7 +263,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
@ -284,8 +286,7 @@ jobs:
${MATRIX_OPTIONS}
else
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \
AR="$TOOLCHAIN/bin/llvm-ar" \
RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
@ -311,9 +312,7 @@ jobs:
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
run: find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -exec file '{}' \;
- name: 'build tests'
run: |
@ -330,119 +329,3 @@ jobs:
else
make -C bld examples
fi
msdos:
name: "MS-DOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} djgpp !ssl i586"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
# renovate: datasource=github-releases depName=andrewwutw/build-djgpp versioning=semver-coerced registryUrl=https://github.com
TOOLCHAIN_VERSION: 3.4
TOOLCHAIN_SHA256: 8464f17017d6ab1b2bb2df4ed82357b5bf692e6e2b7fee37e315638f3d505f00
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'install packages'
run: |
printf "#!/bin/sh
while [ \$? = 0 ]; do for i in 1 2 3; do timeout 30 \"\$@\" && break 2; echo \"Error: slow server, retry \$i\"; sleep 1
dpkg --configure -a; done; false; done" > "$HOME"/my-apt; chmod +x "$HOME"/my-apt
sudo "$HOME"/my-apt apt-get -o Dpkg::Use-Pty=0 install libfl2
- name: 'cache compiler (djgpp)'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-compiler
with:
path: ~/djgpp
key: ${{ runner.os }}-djgpp-${{ env.TOOLCHAIN_VERSION }}-amd64
- name: 'install compiler (djgpp)'
if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
--location "https://github.com/andrewwutw/build-djgpp/releases/download/v${TOOLCHAIN_VERSION}/djgpp-linux64-gcc1220.tar.bz2" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${TOOLCHAIN_SHA256}" && tar -xjf pkg.bin && rm -f pkg.bin
cd djgpp
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/wat3211b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF faa2222ab5deb2c2aac229c760bf4d45aca5379f5af97865c308a0467046b67a && unzip -q pkg.bin && rm -f pkg.bin
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/zlb13b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF f3d2fa8129e7591c7e79074306d8ab91a70ec172cc01baedeae74992285dd3a3 && unzip -q pkg.bin && rm -f pkg.bin
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=DOS \
-DCMAKE_SYSTEM_PROCESSOR=x86 \
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
-DCMAKE_C_COMPILER="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF \
-DZLIB_INCLUDE_DIR="$HOME"/djgpp/include \
-DZLIB_LIBRARY="$HOME"/djgpp/lib/libz.a \
-DWATT_ROOT="$HOME"/djgpp/net/watt
else
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
AR="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ar \
RANLIB="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
WATT_ROOT="$HOME"/djgpp/net/watt \
--host=i586-pc-msdosdjgpp \
--without-ssl --without-libpsl \
--with-zlib="$HOME"/djgpp
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 file --
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi

File diff suppressed because it is too large Load diff

1
.gitignore vendored
View file

@ -28,6 +28,7 @@
/.vs
/bld/
/build/
/builds/
/stats/
__pycache__
Debug

View file

@ -1,7 +1,3 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
Guenter Knauf <lists@gknw.net> <gk@gknw.de>
Gisle Vanem <gvanem@yahoo.no> <gisle.vanem@gmail.com>
Gisle Vanem <gvanem@yahoo.no> <gvanem@broadpark.no>
@ -120,5 +116,3 @@ Sinkevich Artem <artsin666@gmail.com>
Andrew Kirillov <akirillo@uk.ibm.com>
Stephen Farrell <stephen.farrell@cs.tcd.ie>
Calvin Ruocco <calvin.ruocco@vector.com>
Hamza Bensliman <benslimanhamza99@gmail.com>
Kaixuan Li <kaixuan.li@ntu.edu.sg>

View file

@ -4,7 +4,7 @@ Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
In a release tarball, check the RELEASE-NOTES file for what was done in the
In a release tarball, check the RELEASES-NOTES file for what was done in the
most recent release. In a git check-out, that file mentions changes that have
been done since the previous release.

View file

@ -0,0 +1,24 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
@CMAKE_CONFIGURABLE_FILE_CONTENT@

View file

@ -24,12 +24,12 @@
option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
if(WIN32 AND ENABLE_DEBUG)
if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
# We need to export internal debug functions,
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
# so disable symbol hiding for debug builds and for memory tracking.
set(CURL_HIDDEN_SYMBOLS OFF)
elseif(DOS OR AMIGA)
elseif(DOS OR AMIGA OR MINGW32CE)
set(CURL_HIDDEN_SYMBOLS OFF)
endif()

View file

@ -27,9 +27,9 @@
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
/* */
#if defined(sun) || defined(__sun__) || \
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__)
# define PLATFORM_SOLARIS
# else
@ -39,7 +39,7 @@
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
# define PLATFORM_AIX_V3
#endif
/* */
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
#error "O_NONBLOCK does not work on this platform"
#endif
@ -119,19 +119,16 @@ int main(void)
#include <stdarg.h>
#include <string.h>
#include <float.h>
int main(void)
{
return 0;
}
int main(void) { return 0; }
#endif
#ifdef HAVE_FILE_OFFSET_BITS
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We cannot define LARGE_OFF_T to be 9223372036854775807,
We cannot simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -275,10 +272,7 @@ int main(void)
#include <string.h>
#include <errno.h>
static void check(char c)
{
(void)c;
}
static void check(char c) { (void)c; }
int main(void)
{
@ -295,10 +289,7 @@ int main(void)
#include <errno.h>
/* Float, because a pointer cannot be implicitly cast to float */
static void check(float f)
{
(void)f;
}
static void check(float f) { (void)f; }
int main(void)
{

View file

@ -25,47 +25,39 @@
#
# Input variables:
#
# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory.
# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library.
# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library.
# - `BROTLI_USE_STATIC_LIBS`: Configure for static brotli libraries.
# - `BROTLI_INCLUDE_DIR`: The brotli include directory.
# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
#
# Defines:
# Result variables:
#
# - `BROTLI_FOUND`: System has brotli.
# - `BROTLI_VERSION`: Version of brotli.
# - `CURL::brotli`: brotli library target.
# - `BROTLI_FOUND`: System has brotli.
# - `BROTLI_INCLUDE_DIRS`: The brotli include directories.
# - `BROTLI_LIBRARIES`: The brotli library names.
# - `BROTLI_LIBRARY_DIRS`: The brotli library directories.
# - `BROTLI_PC_REQUIRES`: The brotli pkg-config packages.
# - `BROTLI_CFLAGS`: Required compiler flags.
# - `BROTLI_VERSION`: Version of brotli.
set(_brotli_pc_requires "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
set(BROTLI_PC_REQUIRES "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
if(CURL_USE_PKGCONFIG AND
NOT DEFINED BROTLI_INCLUDE_DIR AND
NOT DEFINED BROTLICOMMON_LIBRARY AND
NOT DEFINED BROTLIDEC_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_brotli ${_brotli_pc_requires})
pkg_check_modules(BROTLI ${BROTLI_PC_REQUIRES})
endif()
if(_brotli_FOUND)
if(BROTLI_FOUND)
set(Brotli_FOUND TRUE)
set(BROTLI_FOUND TRUE)
set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION})
if(BROTLI_USE_STATIC_LIBS)
set(_brotli_CFLAGS "${_brotli_STATIC_CFLAGS}")
set(_brotli_INCLUDE_DIRS "${_brotli_STATIC_INCLUDE_DIRS}")
set(_brotli_LIBRARY_DIRS "${_brotli_STATIC_LIBRARY_DIRS}")
set(_brotli_LIBRARIES "${_brotli_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
set(BROTLI_VERSION "${BROTLI_libbrotlicommon_VERSION}")
string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}")
message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
else()
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
if(BROTLI_USE_STATIC_LIBS)
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon-static" "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec-static" "brotlidec")
else()
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
endif()
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Brotli
@ -76,21 +68,9 @@ else()
)
if(BROTLI_FOUND)
set(_brotli_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
set(_brotli_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
set(BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
endif()
mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY)
endif()
if(BROTLI_FOUND)
if(NOT TARGET CURL::brotli)
add_library(CURL::brotli INTERFACE IMPORTED)
set_target_properties(CURL::brotli PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_brotli_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_brotli_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_brotli_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_brotli_LIBRARIES}")
endif()
endif()

View file

@ -25,58 +25,35 @@
#
# Input variables:
#
# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory.
# - `CARES_LIBRARY`: Absolute path to `cares` library.
# - `CARES_USE_STATIC_LIBS`: Configure for static c-ares libraries.
# - `CARES_INCLUDE_DIR`: The c-ares include directory.
# - `CARES_LIBRARY`: Path to `cares` library.
#
# Defines:
# Result variables:
#
# - `CARES_FOUND`: System has c-ares.
# - `CARES_VERSION`: Version of c-ares.
# - `CURL::cares`: c-ares library target.
# - `CARES_FOUND`: System has c-ares.
# - `CARES_INCLUDE_DIRS`: The c-ares include directories.
# - `CARES_LIBRARIES`: The c-ares library names.
# - `CARES_LIBRARY_DIRS`: The c-ares library directories.
# - `CARES_PC_REQUIRES`: The c-ares pkg-config packages.
# - `CARES_CFLAGS`: Required compiler flags.
# - `CARES_VERSION`: Version of c-ares.
set(_cares_pc_requires "libcares")
set(CARES_PC_REQUIRES "libcares")
if(NOT DEFINED CARES_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED CARES_INCLUDE_DIR AND
NOT DEFINED CARES_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_cares ${_cares_pc_requires})
endif()
if(NOT _cares_FOUND AND CURL_USE_CMAKECONFIG)
find_package(c-ares CONFIG QUIET)
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(CARES ${CARES_PC_REQUIRES})
endif()
if(_cares_FOUND)
if(CARES_FOUND)
set(Cares_FOUND TRUE)
set(CARES_FOUND TRUE)
set(CARES_VERSION ${_cares_VERSION})
if(CARES_USE_STATIC_LIBS)
set(_cares_CFLAGS "${_cares_STATIC_CFLAGS}")
set(_cares_INCLUDE_DIRS "${_cares_STATIC_INCLUDE_DIRS}")
set(_cares_LIBRARY_DIRS "${_cares_STATIC_LIBRARY_DIRS}")
set(_cares_LIBRARIES "${_cares_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
elseif(c-ares_CONFIG)
set(Cares_FOUND TRUE)
set(CARES_FOUND TRUE)
set(CARES_VERSION ${c-ares_VERSION})
if(CARES_USE_STATIC_LIBS)
set(_cares_LIBRARIES c-ares::cares_static)
else()
set(_cares_LIBRARIES c-ares::cares)
endif()
message(STATUS "Found Cares (via CMake Config): ${c-ares_CONFIG} (found version \"${CARES_VERSION}\")")
string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}")
message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
else()
find_path(CARES_INCLUDE_DIR NAMES "ares.h")
if(CARES_USE_STATIC_LIBS)
set(_cares_CFLAGS "-DCARES_STATICLIB")
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares_static" "cares")
else()
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
endif()
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
unset(CARES_VERSION CACHE)
if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")
@ -108,25 +85,13 @@ else()
)
if(CARES_FOUND)
set(_cares_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
set(_cares_LIBRARIES ${CARES_LIBRARY})
set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
set(CARES_LIBRARIES ${CARES_LIBRARY})
endif()
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
endif()
if(CARES_FOUND)
if(WIN32)
list(APPEND _cares_LIBRARIES "iphlpapi") # for if_indextoname and others
endif()
if(NOT TARGET CURL::cares)
add_library(CURL::cares INTERFACE IMPORTED)
set_target_properties(CURL::cares PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_cares_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_cares_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_cares_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_cares_LIBRARIES}")
endif()
if(CARES_FOUND AND WIN32)
list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others
endif()

View file

@ -25,24 +25,32 @@
#
# Input variables:
#
# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment)
# - `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment)
#
# Defines:
# Result variables:
#
# - `GSS_FOUND`: System has a GSS library.
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
# In case the library is found but no version info available it is set to "unknown"
# - `CURL::gss`: GSS library target.
# - `CURL_GSS_FLAVOUR`: Custom property. "GNU" or "MIT" if detected.
# - `GSS_FOUND`: System has the Heimdal library.
# - `GSS_FLAVOUR`: "GNU", "MIT" or "Heimdal" if anything found.
# - `GSS_INCLUDE_DIRS`: The GSS include directories.
# - `GSS_LIBRARIES`: The GSS library names.
# - `GSS_LIBRARY_DIRS`: The GSS library directories.
# - `GSS_PC_REQUIRES`: The GSS pkg-config packages.
# - `GSS_CFLAGS`: Required compiler flags.
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
# In case the library is found but no version info available it is set to "unknown"
set(_gnu_modname "gss")
set(_mit_modname "mit-krb5-gssapi")
set(_heimdal_modname "heimdal-gssapi")
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckTypeSize)
set(_gss_root_hints "${GSS_ROOT_DIR}" "$ENV{GSS_ROOT_DIR}")
set(_gss_root_hints
"${GSS_ROOT_DIR}"
"$ENV{GSS_ROOT_DIR}"
)
set(_gss_CFLAGS "")
set(_gss_LIBRARY_DIRS "")
@ -51,7 +59,7 @@ set(_gss_LIBRARY_DIRS "")
if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_search_module(_gss ${_gnu_modname} ${_mit_modname})
pkg_search_module(_gss ${_gnu_modname} ${_mit_modname} ${_heimdal_modname})
list(APPEND _gss_root_hints "${_gss_PREFIX}")
set(_gss_version "${_gss_VERSION}")
endif()
@ -61,22 +69,37 @@ if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
endif()
if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional approach.
find_file(_gss_configure_script NAMES "krb5-config" PATH_SUFFIXES "bin" HINTS ${_gss_root_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
find_file(_gss_configure_script
NAMES
"krb5-config"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"bin"
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
)
# If not found in user-supplied directories, maybe system knows better
find_file(_gss_configure_script NAMES "krb5-config" PATH_SUFFIXES "bin")
find_file(_gss_configure_script
NAMES
"krb5-config"
PATH_SUFFIXES
"bin"
)
if(_gss_configure_script)
set(_gss_INCLUDE_DIRS "")
set(_gss_LIBRARIES "")
execute_process(COMMAND ${_gss_configure_script} "--cflags" "gssapi"
execute_process(
COMMAND ${_gss_configure_script} "--cflags" "gssapi"
OUTPUT_VARIABLE _gss_cflags_raw
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "FindGSS krb5-config --cflags: ${_gss_cflags_raw}")
if(NOT _gss_configure_failed) # 0 means success
# Should also work in an odd case when multiple directories are given.
string(STRIP "${_gss_cflags_raw}" _gss_cflags_raw)
@ -93,10 +116,12 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr
endforeach()
endif()
execute_process(COMMAND ${_gss_configure_script} "--libs" "gssapi"
execute_process(
COMMAND ${_gss_configure_script} "--libs" "gssapi"
OUTPUT_VARIABLE _gss_lib_flags
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}")
if(NOT _gss_configure_failed) # 0 means success
@ -116,117 +141,199 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr
endforeach()
endif()
execute_process(COMMAND ${_gss_configure_script} "--version"
execute_process(
COMMAND ${_gss_configure_script} "--version"
OUTPUT_VARIABLE _gss_version
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Older versions may not have the "--version" parameter. In this case we just do not care.
if(_gss_configure_failed)
set(_gss_version 0)
else()
# Strip prefix string to leave the version number only
string(REPLACE "Kerberos 5 release " "" _gss_version "${_gss_version}")
endif()
execute_process(COMMAND ${_gss_configure_script} "--vendor"
execute_process(
COMMAND ${_gss_configure_script} "--vendor"
OUTPUT_VARIABLE _gss_vendor
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Older versions may not have the "--vendor" parameter. In this case we just do not care.
if(NOT _gss_configure_failed AND NOT _gss_vendor MATCHES "Heimdal|heimdal")
set(_gss_flavour "MIT") # assume a default, should not really matter
if(_gss_configure_failed)
set(GSS_FLAVOUR "Heimdal") # most probably, should not really matter
else()
if(_gss_vendor MATCHES "H|heimdal")
set(GSS_FLAVOUR "Heimdal")
else()
set(GSS_FLAVOUR "MIT")
endif()
endif()
else() # Either there is no config script or we are on a platform that does not provide one (Windows?)
find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h" HINTS ${_gss_root_hints} PATH_SUFFIXES "include" "inc")
if(_gss_INCLUDE_DIRS) # We have found something
set(_gss_libdir_suffixes "")
find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"include"
"inc"
)
if(_gss_INCLUDE_DIRS) # jay, we have found something
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES "${_gss_INCLUDE_DIRS}")
check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)
cmake_pop_check_state()
if(_gss_have_mit_headers)
set(_gss_flavour "MIT")
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _gss_libdir_suffixes "lib/AMD64")
set(_gss_libname "gssapi64")
else()
list(APPEND _gss_libdir_suffixes "lib/i386")
set(_gss_libname "gssapi32")
endif()
else()
list(APPEND _gss_libdir_suffixes "lib" "lib64") # those suffixes are not checked for HINTS
set(_gss_libname "gssapi_krb5")
set(GSS_FLAVOUR "MIT")
else()
# Prevent compiling the header - just check if we can include it
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
check_include_file("roken.h" _gss_have_roken_h)
check_include_file("heimdal/roken.h" _gss_have_heimdal_roken_h)
if(_gss_have_roken_h OR _gss_have_heimdal_roken_h)
set(GSS_FLAVOUR "Heimdal")
endif()
endif()
cmake_pop_check_state()
else()
find_path(_gss_INCLUDE_DIRS NAMES "gss.h" HINTS ${_gss_root_hints} PATH_SUFFIXES "include")
# I am not convinced if this is the right way but this is what autotools do at the moment
find_path(_gss_INCLUDE_DIRS NAMES "gssapi.h"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"include"
"inc"
)
if(_gss_INCLUDE_DIRS)
set(_gss_flavour "GNU")
set(_gss_pc_requires ${_gnu_modname})
set(_gss_libname "gss")
set(GSS_FLAVOUR "Heimdal")
else()
find_path(_gss_INCLUDE_DIRS NAMES "gss.h"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"include"
)
if(_gss_INCLUDE_DIRS)
set(GSS_FLAVOUR "GNU")
set(GSS_PC_REQUIRES "gss")
endif()
endif()
endif()
# If we have headers, look up libraries
if(_gss_flavour)
# If we have headers, check if we can link libraries
if(GSS_FLAVOUR)
set(_gss_libdir_suffixes "")
set(_gss_libdir_hints ${_gss_root_hints})
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(GET _gss_INCLUDE_DIRS PARENT_PATH _gss_calculated_potential_root)
else()
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
endif()
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
list(APPEND _gss_libdir_hints ${_gss_calculated_potential_root})
find_library(_gss_LIBRARIES NAMES ${_gss_libname} HINTS ${_gss_libdir_hints} PATH_SUFFIXES ${_gss_libdir_suffixes})
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _gss_libdir_suffixes "lib/AMD64")
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_libname "gssapi64")
else()
set(_gss_libname "libgssapi")
endif()
else()
list(APPEND _gss_libdir_suffixes "lib/i386")
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_libname "gssapi32")
else()
set(_gss_libname "libgssapi")
endif()
endif()
else()
list(APPEND _gss_libdir_suffixes "lib;lib64") # those suffixes are not checked for HINTS
if(GSS_FLAVOUR STREQUAL "GNU")
set(_gss_libname "gss")
elseif(GSS_FLAVOUR STREQUAL "MIT")
set(_gss_libname "gssapi_krb5")
else()
set(_gss_libname "gssapi")
endif()
endif()
find_library(_gss_LIBRARIES NAMES ${_gss_libname}
HINTS
${_gss_libdir_hints}
PATH_SUFFIXES
${_gss_libdir_suffixes}
)
endif()
endif()
if(NOT _gss_flavour)
message(FATAL_ERROR "GNU or MIT GSS is required")
endif()
else()
# _gss_MODULE_NAME set since CMake 3.16.
# _pkg_check_modules_pkg_name is undocumented and used as a fallback for CMake <3.16 versions.
if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _pkg_check_modules_pkg_name STREQUAL _gnu_modname)
set(_gss_flavour "GNU")
set(_gss_pc_requires ${_gnu_modname})
elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _pkg_check_modules_pkg_name STREQUAL _mit_modname)
set(_gss_flavour "MIT")
set(_gss_pc_requires ${_mit_modname})
# _gss_MODULE_NAME set since CMake 3.16
if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _gss_${_gnu_modname}_VERSION)
set(GSS_FLAVOUR "GNU")
set(GSS_PC_REQUIRES "gss")
if(NOT _gss_version) # for old CMake versions?
set(_gss_version ${_gss_${_gnu_modname}_VERSION})
endif()
elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _gss_${_mit_modname}_VERSION)
set(GSS_FLAVOUR "MIT")
set(GSS_PC_REQUIRES "mit-krb5-gssapi")
if(NOT _gss_version) # for old CMake versions?
set(_gss_version ${_gss_${_mit_modname}_VERSION})
endif()
else()
message(FATAL_ERROR "GNU or MIT GSS is required")
set(GSS_FLAVOUR "Heimdal")
set(GSS_PC_REQUIRES "heimdal-gssapi")
if(NOT _gss_version) # for old CMake versions?
set(_gss_version ${_gss_${_heimdal_modname}_VERSION})
endif()
endif()
message(STATUS "Found GSS/${_gss_flavour} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")")
message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")")
endif()
string(REPLACE ";" " " _gss_CFLAGS "${_gss_CFLAGS}")
set(GSS_INCLUDE_DIRS ${_gss_INCLUDE_DIRS})
set(GSS_LIBRARIES ${_gss_LIBRARIES})
set(GSS_LIBRARY_DIRS ${_gss_LIBRARY_DIRS})
set(GSS_CFLAGS ${_gss_CFLAGS})
set(GSS_VERSION ${_gss_version})
if(NOT GSS_VERSION)
if(_gss_flavour STREQUAL "MIT")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
cmake_host_system_information(RESULT _mit_version QUERY WINDOWS_REGISTRY
"HKLM/SOFTWARE/MIT/Kerberos/SDK/CurrentVersion" VALUE "VersionString")
if(GSS_FLAVOUR)
if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_heimdal_manifest_file "Heimdal.Application.amd64.manifest")
else()
get_filename_component(_mit_version
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE)
set(_heimdal_manifest_file "Heimdal.Application.x86.manifest")
endif()
if(EXISTS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}")
file(STRINGS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}" _heimdal_version_str
REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$")
string(REGEX MATCH "[0-9]\\.[^\"]+" GSS_VERSION "${_heimdal_version_str}")
endif()
if(NOT GSS_VERSION)
set(GSS_VERSION "Heimdal Unknown")
endif()
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT")
get_filename_component(_mit_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME
CACHE)
if(WIN32 AND _mit_version)
set(GSS_VERSION "${_mit_version}")
else()
set(GSS_VERSION "MIT Unknown")
endif()
else() # GNU
if(_gss_INCLUDE_DIRS AND EXISTS "${_gss_INCLUDE_DIRS}/gss.h")
elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "GNU")
if(GSS_INCLUDE_DIRS AND EXISTS "${GSS_INCLUDE_DIRS}/gss.h")
set(_version_regex "#[\t ]*define[\t ]+GSS_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${_gss_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}")
file(STRINGS "${GSS_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(GSS_VERSION "${_version_str}")
unset(_version_regex)
@ -238,12 +345,12 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GSS
REQUIRED_VARS
_gss_flavour
_gss_LIBRARIES
GSS_FLAVOUR
GSS_LIBRARIES
VERSION_VAR
GSS_VERSION
FAIL_MESSAGE
"Could NOT find GSS, try to set the absolute path to GSS installation root directory in the environment variable GSS_ROOT_DIR"
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
)
mark_as_advanced(
@ -256,16 +363,3 @@ mark_as_advanced(
_gss_PREFIX
_gss_version
)
if(GSS_FOUND)
if(NOT TARGET CURL::gss)
add_library(CURL::gss INTERFACE IMPORTED)
set_target_properties(CURL::gss PROPERTIES
INTERFACE_CURL_GSS_FLAVOUR "${_gss_flavour}"
INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_gss_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_gss_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_gss_LIBRARIES}")
endif()
endif()

View file

@ -1,92 +0,0 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the GnuTLS library
#
# Input variables:
#
# - `GNUTLS_INCLUDE_DIR`: Absolute path to GnuTLS include directory.
# - `GNUTLS_LIBRARY`: Absolute path to `gnutls` library.
#
# Defines:
#
# - `GNUTLS_FOUND`: System has GnuTLS.
# - `GNUTLS_VERSION`: Version of GnuTLS.
# - `CURL::gnutls`: GnuTLS library target.
set(_gnutls_pc_requires "gnutls")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED GNUTLS_INCLUDE_DIR AND
NOT DEFINED GNUTLS_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_gnutls ${_gnutls_pc_requires})
endif()
if(_gnutls_FOUND)
set(GnuTLS_FOUND TRUE)
set(GNUTLS_FOUND TRUE)
set(GNUTLS_VERSION ${_gnutls_VERSION})
message(STATUS "Found GnuTLS (via pkg-config): ${_gnutls_INCLUDE_DIRS} (found version \"${GNUTLS_VERSION}\")")
else()
find_path(GNUTLS_INCLUDE_DIR NAMES "gnutls/gnutls.h")
find_library(GNUTLS_LIBRARY NAMES "gnutls" "libgnutls")
unset(GNUTLS_VERSION CACHE)
if(GNUTLS_INCLUDE_DIR AND EXISTS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h")
set(_version_regex "#[\t ]*define[\t ]+GNUTLS_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(GNUTLS_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GnuTLS
REQUIRED_VARS
GNUTLS_INCLUDE_DIR
GNUTLS_LIBRARY
VERSION_VAR
GNUTLS_VERSION
)
if(GNUTLS_FOUND)
set(_gnutls_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
set(_gnutls_LIBRARIES ${GNUTLS_LIBRARY})
endif()
mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
endif()
if(GNUTLS_FOUND)
if(NOT TARGET CURL::gnutls)
add_library(CURL::gnutls INTERFACE IMPORTED)
set_target_properties(CURL::gnutls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_gnutls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_gnutls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_gnutls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_gnutls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_gnutls_LIBRARIES}")
endif()
endif()

View file

@ -25,32 +25,36 @@
#
# Input variables:
#
# - `LDAP_INCLUDE_DIR`: Absolute path to ldap include directory.
# - `LDAP_LIBRARY`: Absolute path to `ldap` library.
# - `LDAP_LBER_LIBRARY`: Absolute path to `lber` library.
# - `LDAP_INCLUDE_DIR`: The ldap include directory.
# - `LDAP_LIBRARY`: Path to `ldap` library.
# - `LDAP_LBER_LIBRARY`: Path to `lber` library.
#
# Defines:
# Result variables:
#
# - `LDAP_FOUND`: System has ldap.
# - `LDAP_INCLUDE_DIRS`: The ldap include directories.
# - `LDAP_LIBRARIES`: The ldap library names.
# - `LDAP_LIBRARY_DIRS`: The ldap library directories.
# - `LDAP_PC_REQUIRES`: The ldap pkg-config packages.
# - `LDAP_CFLAGS`: Required compiler flags.
# - `LDAP_VERSION`: Version of ldap.
# - `CURL::ldap`: ldap library target.
set(_ldap_pc_requires "ldap" "lber")
set(LDAP_PC_REQUIRES "ldap" "lber")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LDAP_INCLUDE_DIR AND
NOT DEFINED LDAP_LIBRARY AND
NOT DEFINED LDAP_LBER_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_ldap ${_ldap_pc_requires})
pkg_check_modules(LDAP ${LDAP_PC_REQUIRES})
endif()
if(_ldap_FOUND)
set(LDAP_FOUND TRUE)
set(LDAP_VERSION ${_ldap_ldap_VERSION})
message(STATUS "Found LDAP (via pkg-config): ${_ldap_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")")
if(LDAP_FOUND)
set(LDAP_VERSION "${LDAP_ldap_VERSION}")
string(REPLACE ";" " " LDAP_CFLAGS "${LDAP_CFLAGS}")
message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")")
else()
set(_ldap_pc_requires "") # Depend on pkg-config only when found via pkg-config
set(LDAP_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
# On Apple the SDK LDAP gets picked up from
# 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains
@ -95,21 +99,9 @@ else()
)
if(LDAP_FOUND)
set(_ldap_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
set(_ldap_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY})
set(LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
set(LDAP_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY})
endif()
mark_as_advanced(LDAP_INCLUDE_DIR LDAP_LIBRARY LDAP_LBER_LIBRARY)
endif()
if(LDAP_FOUND)
if(NOT TARGET CURL::ldap)
add_library(CURL::ldap INTERFACE IMPORTED)
set_target_properties(CURL::ldap PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_ldap_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_ldap_LIBRARIES}")
endif()
endif()

View file

@ -1,61 +0,0 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the libbacktrace library
#
# Input variables:
#
# - `LIBBACKTRACE_INCLUDE_DIR`: Absolute path to libbacktrace include directory.
# - `LIBBACKTRACE_LIBRARY`: Absolute path to `libbacktrace` library.
#
# Defines:
#
# - `LIBBACKTRACE_FOUND`: System has libbacktrace.
# - `CURL::libbacktrace`: libbacktrace library target.
find_path(LIBBACKTRACE_INCLUDE_DIR NAMES "backtrace.h")
find_library(LIBBACKTRACE_LIBRARY NAMES "backtrace" "libbacktrace")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libbacktrace
REQUIRED_VARS
LIBBACKTRACE_INCLUDE_DIR
LIBBACKTRACE_LIBRARY
)
if(LIBBACKTRACE_FOUND)
set(_libbacktrace_INCLUDE_DIRS ${LIBBACKTRACE_INCLUDE_DIR})
set(_libbacktrace_LIBRARIES ${LIBBACKTRACE_LIBRARY})
if(NOT TARGET CURL::libbacktrace)
add_library(CURL::libbacktrace INTERFACE IMPORTED)
set_target_properties(CURL::libbacktrace PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libbacktrace_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libbacktrace_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libbacktrace_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libbacktrace_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libbacktrace_LIBRARIES}")
endif()
endif()
mark_as_advanced(LIBBACKTRACE_INCLUDE_DIR LIBBACKTRACE_LIBRARY)

View file

@ -25,28 +25,32 @@
#
# Input variables:
#
# - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory.
# - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library.
# - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory.
# - `LIBGSASL_LIBRARY`: Path to `libgsasl` library.
#
# Defines:
# Result variables:
#
# - `LIBGSASL_FOUND`: System has libgsasl.
# - `LIBGSASL_VERSION`: Version of libgsasl.
# - `CURL::libgsasl`: libgsasl library target.
# - `LIBGSASL_FOUND`: System has libgsasl.
# - `LIBGSASL_INCLUDE_DIRS`: The libgsasl include directories.
# - `LIBGSASL_LIBRARIES`: The libgsasl library names.
# - `LIBGSASL_LIBRARY_DIRS`: The libgsasl library directories.
# - `LIBGSASL_PC_REQUIRES`: The libgsasl pkg-config packages.
# - `LIBGSASL_CFLAGS`: Required compiler flags.
# - `LIBGSASL_VERSION`: Version of libgsasl.
set(_libgsasl_pc_requires "libgsasl")
set(LIBGSASL_PC_REQUIRES "libgsasl")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBGSASL_INCLUDE_DIR AND
NOT DEFINED LIBGSASL_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libgsasl ${_libgsasl_pc_requires})
pkg_check_modules(LIBGSASL ${LIBGSASL_PC_REQUIRES})
endif()
if(_libgsasl_FOUND)
if(LIBGSASL_FOUND)
set(Libgsasl_FOUND TRUE)
set(LIBGSASL_FOUND TRUE)
message(STATUS "Found Libgsasl (via pkg-config): ${_libgsasl_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}")
message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
else()
find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h")
find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl")
@ -71,21 +75,9 @@ else()
)
if(LIBGSASL_FOUND)
set(_libgsasl_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR})
set(_libgsasl_LIBRARIES ${LIBGSASL_LIBRARY})
set(LIBGSASL_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR})
set(LIBGSASL_LIBRARIES ${LIBGSASL_LIBRARY})
endif()
mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY)
endif()
if(LIBGSASL_FOUND)
if(NOT TARGET CURL::libgsasl)
add_library(CURL::libgsasl INTERFACE IMPORTED)
set_target_properties(CURL::libgsasl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libgsasl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libgsasl_LIBRARIES}")
endif()
endif()

View file

@ -25,29 +25,32 @@
#
# Input variables:
#
# - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory.
# - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library.
# - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory.
# - `LIBIDN2_LIBRARY`: Path to `libidn2` library.
#
# Defines:
# Result variables:
#
# - `LIBIDN2_FOUND`: System has libidn2.
# - `LIBIDN2_VERSION`: Version of libidn2.
# - `CURL::libidn2`: libidn2 library target.
# - `LIBIDN2_FOUND`: System has libidn2.
# - `LIBIDN2_INCLUDE_DIRS`: The libidn2 include directories.
# - `LIBIDN2_LIBRARIES`: The libidn2 library names.
# - `LIBIDN2_LIBRARY_DIRS`: The libidn2 library directories.
# - `LIBIDN2_PC_REQUIRES`: The libidn2 pkg-config packages.
# - `LIBIDN2_CFLAGS`: Required compiler flags.
# - `LIBIDN2_VERSION`: Version of libidn2.
set(_libidn2_pc_requires "libidn2")
set(LIBIDN2_PC_REQUIRES "libidn2")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBIDN2_INCLUDE_DIR AND
NOT DEFINED LIBIDN2_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libidn2 ${_libidn2_pc_requires})
pkg_check_modules(LIBIDN2 ${LIBIDN2_PC_REQUIRES})
endif()
if(_libidn2_FOUND)
if(LIBIDN2_FOUND)
set(Libidn2_FOUND TRUE)
set(LIBIDN2_FOUND TRUE)
set(LIBIDN2_VERSION ${_libidn2_VERSION})
message(STATUS "Found Libidn2 (via pkg-config): ${_libidn2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}")
message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
else()
find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h")
find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2")
@ -72,21 +75,9 @@ else()
)
if(LIBIDN2_FOUND)
set(_libidn2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR})
set(_libidn2_LIBRARIES ${LIBIDN2_LIBRARY})
set(LIBIDN2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR})
set(LIBIDN2_LIBRARIES ${LIBIDN2_LIBRARY})
endif()
mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY)
endif()
if(LIBIDN2_FOUND)
if(NOT TARGET CURL::libidn2)
add_library(CURL::libidn2 INTERFACE IMPORTED)
set_target_properties(CURL::libidn2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libidn2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libidn2_LIBRARIES}")
endif()
endif()

View file

@ -25,29 +25,32 @@
#
# Input variables:
#
# - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory.
# - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library.
# - `LIBPSL_INCLUDE_DIR`: The libpsl include directory.
# - `LIBPSL_LIBRARY`: Path to `libpsl` library.
#
# Defines:
# Result variables:
#
# - `LIBPSL_FOUND`: System has libpsl.
# - `LIBPSL_VERSION`: Version of libpsl.
# - `CURL::libpsl`: libpsl library target.
# - `LIBPSL_FOUND`: System has libpsl.
# - `LIBPSL_INCLUDE_DIRS`: The libpsl include directories.
# - `LIBPSL_LIBRARIES`: The libpsl library names.
# - `LIBPSL_LIBRARY_DIRS`: The libpsl library directories.
# - `LIBPSL_PC_REQUIRES`: The libpsl pkg-config packages.
# - `LIBPSL_CFLAGS`: Required compiler flags.
# - `LIBPSL_VERSION`: Version of libpsl.
set(_libpsl_pc_requires "libpsl")
set(LIBPSL_PC_REQUIRES "libpsl")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBPSL_INCLUDE_DIR AND
NOT DEFINED LIBPSL_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libpsl ${_libpsl_pc_requires})
pkg_check_modules(LIBPSL ${LIBPSL_PC_REQUIRES})
endif()
if(_libpsl_FOUND AND _libpsl_INCLUDE_DIRS)
if(LIBPSL_FOUND AND LIBPSL_INCLUDE_DIRS)
set(Libpsl_FOUND TRUE)
set(LIBPSL_FOUND TRUE)
set(LIBPSL_VERSION ${_libpsl_VERSION})
message(STATUS "Found Libpsl (via pkg-config): ${_libpsl_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}")
message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
else()
find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h")
find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl")
@ -72,21 +75,9 @@ else()
)
if(LIBPSL_FOUND)
set(_libpsl_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
set(_libpsl_LIBRARIES ${LIBPSL_LIBRARY})
set(LIBPSL_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
set(LIBPSL_LIBRARIES ${LIBPSL_LIBRARY})
endif()
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
endif()
if(LIBPSL_FOUND)
if(NOT TARGET CURL::libpsl)
add_library(CURL::libpsl INTERFACE IMPORTED)
set_target_properties(CURL::libpsl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libpsl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libpsl_LIBRARIES}")
endif()
endif()

103
CMake/FindLibrtmp.cmake Normal file
View file

@ -0,0 +1,103 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the librtmp library
#
# Input variables:
#
# - `LIBRTMP_INCLUDE_DIR`: The librtmp include directory.
# - `LIBRTMP_LIBRARY`: Path to `librtmp` library.
#
# Result variables:
#
# - `LIBRTMP_FOUND`: System has librtmp.
# - `LIBRTMP_INCLUDE_DIRS`: The librtmp include directories.
# - `LIBRTMP_LIBRARIES`: The librtmp library names.
# - `LIBRTMP_LIBRARY_DIRS`: The librtmp library directories.
# - `LIBRTMP_PC_REQUIRES`: The librtmp pkg-config packages.
# - `LIBRTMP_CFLAGS`: Required compiler flags.
# - `LIBRTMP_VERSION`: Version of librtmp.
set(LIBRTMP_PC_REQUIRES "librtmp")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBRTMP_INCLUDE_DIR AND
NOT DEFINED LIBRTMP_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(LIBRTMP ${LIBRTMP_PC_REQUIRES})
endif()
if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS)
set(Librtmp_FOUND TRUE)
string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}")
message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")")
else()
find_path(LIBRTMP_INCLUDE_DIR NAMES "librtmp/rtmp.h")
find_library(LIBRTMP_LIBRARY NAMES "rtmp")
unset(LIBRTMP_VERSION CACHE)
if(LIBRTMP_INCLUDE_DIR AND EXISTS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h")
set(_version_regex "#[\t ]*define[\t ]+RTMP_LIB_VERSION[\t ]+0x([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F]).*")
file(STRINGS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str1 "${_version_str}")
string(REGEX REPLACE "${_version_regex}" "\\2" _version_str2 "${_version_str}")
if(CMAKE_VERSION VERSION_LESS 3.13)
# No support for hex version numbers, just strip leading zeroes
string(REGEX REPLACE "^0" "" _version_str1 "${_version_str1}")
string(REGEX REPLACE "^0" "" _version_str2 "${_version_str2}")
else()
math(EXPR _version_str1 "0x${_version_str1}" OUTPUT_FORMAT DECIMAL)
math(EXPR _version_str2 "0x${_version_str2}" OUTPUT_FORMAT DECIMAL)
endif()
set(LIBRTMP_VERSION "${_version_str1}.${_version_str2}")
unset(_version_regex)
unset(_version_str1)
unset(_version_str2)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Librtmp
REQUIRED_VARS
LIBRTMP_INCLUDE_DIR
LIBRTMP_LIBRARY
VERSION_VAR
LIBRTMP_VERSION
)
if(LIBRTMP_FOUND)
set(LIBRTMP_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR})
set(LIBRTMP_LIBRARIES ${LIBRTMP_LIBRARY})
endif()
mark_as_advanced(LIBRTMP_INCLUDE_DIR LIBRTMP_LIBRARY)
# Necessary when linking a static librtmp
find_package(OpenSSL)
if(OPENSSL_FOUND)
list(APPEND LIBRTMP_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
endif()
endif()
if(LIBRTMP_FOUND AND WIN32)
list(APPEND LIBRTMP_LIBRARIES "winmm")
endif()

View file

@ -25,44 +25,35 @@
#
# Input variables:
#
# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory.
# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library.
# - `LIBSSH_USE_STATIC_LIBS`: Configure for static libssh libraries.
# - `LIBSSH_INCLUDE_DIR`: The libssh include directory.
# - `LIBSSH_LIBRARY`: Path to libssh library.
#
# Defines:
# Result variables:
#
# - `LIBSSH_FOUND`: System has libssh.
# - `LIBSSH_VERSION`: Version of libssh.
# - `CURL::libssh`: libssh library target.
# - `LIBSSH_FOUND`: System has libssh.
# - `LIBSSH_INCLUDE_DIRS`: The libssh include directories.
# - `LIBSSH_LIBRARIES`: The libssh library names.
# - `LIBSSH_LIBRARY_DIRS`: The libssh library directories.
# - `LIBSSH_PC_REQUIRES`: The libssh pkg-config packages.
# - `LIBSSH_CFLAGS`: Required compiler flags.
# - `LIBSSH_VERSION`: Version of libssh.
set(_libssh_pc_requires "libssh")
set(LIBSSH_PC_REQUIRES "libssh")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBSSH_INCLUDE_DIR AND
NOT DEFINED LIBSSH_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libssh ${_libssh_pc_requires})
pkg_check_modules(LIBSSH ${LIBSSH_PC_REQUIRES})
endif()
if(_libssh_FOUND)
if(LIBSSH_FOUND)
set(Libssh_FOUND TRUE)
set(LIBSSH_FOUND TRUE)
set(LIBSSH_VERSION ${_libssh_VERSION})
if(LIBSSH_USE_STATIC_LIBS)
set(_libssh_CFLAGS "${_libssh_STATIC_CFLAGS}")
set(_libssh_INCLUDE_DIRS "${_libssh_STATIC_INCLUDE_DIRS}")
set(_libssh_LIBRARY_DIRS "${_libssh_STATIC_LIBRARY_DIRS}")
set(_libssh_LIBRARIES "${_libssh_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Libssh (via pkg-config): ${_libssh_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
else()
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h")
if(LIBSSH_USE_STATIC_LIBS)
set(_libssh_CFLAGS "-DLIBSSH_STATIC")
find_library(LIBSSH_LIBRARY NAMES "ssh_static" "libssh_static" "ssh" "libssh")
else()
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
endif()
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
unset(LIBSSH_VERSION CACHE)
if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h")
@ -94,25 +85,13 @@ else()
)
if(LIBSSH_FOUND)
set(_libssh_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
set(_libssh_LIBRARIES ${LIBSSH_LIBRARY})
set(LIBSSH_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
set(LIBSSH_LIBRARIES ${LIBSSH_LIBRARY})
endif()
mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY)
endif()
if(LIBSSH_FOUND)
if(WIN32)
list(APPEND _libssh_LIBRARIES "iphlpapi") # for if_nametoindex
endif()
if(NOT TARGET CURL::libssh)
add_library(CURL::libssh INTERFACE IMPORTED)
set_target_properties(CURL::libssh PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libssh_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libssh_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libssh_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libssh_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libssh_LIBRARIES}")
endif()
if(LIBSSH_FOUND AND WIN32)
list(APPEND LIBSSH_LIBRARIES "iphlpapi") # for if_nametoindex
endif()

View file

@ -25,57 +25,35 @@
#
# Input variables:
#
# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory.
# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library.
# - `LIBSSH2_USE_STATIC_LIBS`: Configure for static libssh2 libraries.
# - `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory.
# - `LIBSSH2_LIBRARY`: Path to `libssh2` library.
#
# Defines:
# Result variables:
#
# - `LIBSSH2_FOUND`: System has libssh2.
# - `LIBSSH2_VERSION`: Version of libssh2.
# - `CURL::libssh2`: libssh2 library target.
# - `LIBSSH2_FOUND`: System has libssh2.
# - `LIBSSH2_INCLUDE_DIRS`: The libssh2 include directories.
# - `LIBSSH2_LIBRARIES`: The libssh2 library names.
# - `LIBSSH2_LIBRARY_DIRS`: The libssh2 library directories.
# - `LIBSSH2_PC_REQUIRES`: The libssh2 pkg-config packages.
# - `LIBSSH2_CFLAGS`: Required compiler flags.
# - `LIBSSH2_VERSION`: Version of libssh2.
set(_libssh2_pc_requires "libssh2")
set(LIBSSH2_PC_REQUIRES "libssh2")
if(NOT DEFINED LIBSSH2_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBSSH2_INCLUDE_DIR AND
NOT DEFINED LIBSSH2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_libssh2 ${_libssh2_pc_requires})
endif()
if(NOT _libssh2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(libssh2 CONFIG QUIET)
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(LIBSSH2 ${LIBSSH2_PC_REQUIRES})
endif()
if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS)
if(LIBSSH2_FOUND AND LIBSSH2_INCLUDE_DIRS)
set(Libssh2_FOUND TRUE)
set(LIBSSH2_FOUND TRUE)
set(LIBSSH2_VERSION ${_libssh2_VERSION})
if(LIBSSH2_USE_STATIC_LIBS)
set(_libssh2_CFLAGS "${_libssh2_STATIC_CFLAGS}")
set(_libssh2_INCLUDE_DIRS "${_libssh2_STATIC_INCLUDE_DIRS}")
set(_libssh2_LIBRARY_DIRS "${_libssh2_STATIC_LIBRARY_DIRS}")
set(_libssh2_LIBRARIES "${_libssh2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
elseif(libssh2_CONFIG)
set(Libssh2_FOUND TRUE)
set(LIBSSH2_FOUND TRUE)
set(LIBSSH2_VERSION ${libssh2_VERSION})
if(LIBSSH2_USE_STATIC_LIBS)
set(_libssh2_LIBRARIES libssh2::libssh2_static)
else()
set(_libssh2_LIBRARIES libssh2::libssh2)
endif()
message(STATUS "Found Libssh2 (via CMake Config): ${libssh2_CONFIG} (found version \"${LIBSSH2_VERSION}\")")
string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}")
message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
else()
find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h")
if(LIBSSH2_USE_STATIC_LIBS)
find_library(LIBSSH2_LIBRARY NAMES "ssh2_static" "libssh2_static" "ssh2" "libssh2")
else()
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
endif()
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
unset(LIBSSH2_VERSION CACHE)
if(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h")
@ -97,21 +75,9 @@ else()
)
if(LIBSSH2_FOUND)
set(_libssh2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
set(_libssh2_LIBRARIES ${LIBSSH2_LIBRARY})
set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
endif()
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
endif()
if(LIBSSH2_FOUND)
if(NOT TARGET CURL::libssh2)
add_library(CURL::libssh2 INTERFACE IMPORTED)
set_target_properties(CURL::libssh2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libssh2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libssh2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libssh2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libssh2_LIBRARIES}")
endif()
endif()

View file

@ -25,29 +25,32 @@
#
# Input variables:
#
# - `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory.
# - `LIBUV_LIBRARY`: Absolute path to `libuv` library.
# - `LIBUV_INCLUDE_DIR`: The libuv include directory.
# - `LIBUV_LIBRARY`: Path to `libuv` library.
#
# Defines:
# Result variables:
#
# - `LIBUV_FOUND`: System has libuv.
# - `LIBUV_VERSION`: Version of libuv.
# - `CURL::libuv`: libuv library target.
# - `LIBUV_FOUND`: System has libuv.
# - `LIBUV_INCLUDE_DIRS`: The libuv include directories.
# - `LIBUV_LIBRARIES`: The libuv library names.
# - `LIBUV_LIBRARY_DIRS`: The libuv library directories.
# - `LIBUV_PC_REQUIRES`: The libuv pkg-config packages.
# - `LIBUV_CFLAGS`: Required compiler flags.
# - `LIBUV_VERSION`: Version of libuv.
set(_libuv_pc_requires "libuv")
set(LIBUV_PC_REQUIRES "libuv")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBUV_INCLUDE_DIR AND
NOT DEFINED LIBUV_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libuv ${_libuv_pc_requires})
pkg_check_modules(LIBUV ${LIBUV_PC_REQUIRES})
endif()
if(_libuv_FOUND)
if(LIBUV_FOUND)
set(Libuv_FOUND TRUE)
set(LIBUV_FOUND TRUE)
set(LIBUV_VERSION ${_libuv_VERSION})
message(STATUS "Found Libuv (via pkg-config): ${_libuv_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}")
message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
else()
find_path(LIBUV_INCLUDE_DIR NAMES "uv.h")
find_library(LIBUV_LIBRARY NAMES "uv" "libuv")
@ -82,21 +85,9 @@ else()
)
if(LIBUV_FOUND)
set(_libuv_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR})
set(_libuv_LIBRARIES ${LIBUV_LIBRARY})
set(LIBUV_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR})
set(LIBUV_LIBRARIES ${LIBUV_LIBRARY})
endif()
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
endif()
if(LIBUV_FOUND)
if(NOT TARGET CURL::libuv)
add_library(CURL::libuv INTERFACE IMPORTED)
set_target_properties(CURL::libuv PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libuv_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libuv_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libuv_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libuv_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libuv_LIBRARIES}")
endif()
endif()

View file

@ -25,17 +25,20 @@
#
# Input variables:
#
# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory.
# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library.
# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library.
# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library.
# - `MBEDTLS_USE_STATIC_LIBS`: Configure for static mbedTLS libraries.
# - `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory.
# - `MBEDTLS_LIBRARY`: Path to `mbedtls` library.
# - `MBEDX509_LIBRARY`: Path to `mbedx509` library.
# - `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library.
#
# Defines:
# Result variables:
#
# - `MBEDTLS_FOUND`: System has mbedTLS.
# - `MBEDTLS_VERSION`: Version of mbedTLS.
# - `CURL::mbedtls`: mbedTLS library target.
# - `MBEDTLS_FOUND`: System has mbedTLS.
# - `MBEDTLS_INCLUDE_DIRS`: The mbedTLS include directories.
# - `MBEDTLS_LIBRARIES`: The mbedTLS library names.
# - `MBEDTLS_LIBRARY_DIRS`: The mbedTLS library directories.
# - `MBEDTLS_PC_REQUIRES`: The mbedTLS pkg-config packages.
# - `MBEDTLS_CFLAGS`: Required compiler flags.
# - `MBEDTLS_VERSION`: Version of mbedTLS.
if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.")
@ -43,57 +46,29 @@ if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
unset(MBEDTLS_INCLUDE_DIRS)
endif()
set(_mbedtls_pc_requires "mbedtls" "mbedx509" "mbedcrypto")
set(MBEDTLS_PC_REQUIRES "mbedtls" "mbedx509" "mbedcrypto")
if(NOT DEFINED MBEDTLS_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED MBEDTLS_INCLUDE_DIR AND
NOT DEFINED MBEDTLS_LIBRARY AND
NOT DEFINED MBEDX509_LIBRARY AND
NOT DEFINED MBEDCRYPTO_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_mbedtls ${_mbedtls_pc_requires})
endif()
if(NOT _mbedtls_FOUND AND CURL_USE_CMAKECONFIG)
find_package(MbedTLS CONFIG QUIET)
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(MBEDTLS ${MBEDTLS_PC_REQUIRES})
endif()
if(_mbedtls_FOUND)
if(MBEDTLS_FOUND)
set(MbedTLS_FOUND TRUE)
set(MBEDTLS_FOUND TRUE)
set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION})
if(MBEDTLS_USE_STATIC_LIBS)
set(_mbedtls_CFLAGS "${_mbedtls_STATIC_CFLAGS}")
set(_mbedtls_INCLUDE_DIRS "${_mbedtls_STATIC_INCLUDE_DIRS}")
set(_mbedtls_LIBRARY_DIRS "${_mbedtls_STATIC_LIBRARY_DIRS}")
set(_mbedtls_LIBRARIES "${_mbedtls_STATIC_LIBRARIES}")
endif()
message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
elseif(MbedTLS_CONFIG)
set(MbedTLS_FOUND TRUE)
set(MBEDTLS_FOUND TRUE)
set(MBEDTLS_VERSION ${MbedTLS_VERSION})
if(MBEDTLS_VERSION GREATER_EQUAL 4.0.0)
set(_mbedtls_LIBRARIES MbedTLS::tfpsacrypto)
else()
set(_mbedtls_LIBRARIES MbedTLS::mbedcrypto)
endif()
list(APPEND _mbedtls_LIBRARIES MbedTLS::mbedx509 MbedTLS::mbedtls)
message(STATUS "Found MbedTLS (via CMake Config): ${MbedTLS_CONFIG} (found version \"${MBEDTLS_VERSION}\")")
set(MBEDTLS_VERSION "${MBEDTLS_mbedtls_VERSION}")
string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}")
message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
else()
set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config
set(MBEDTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h")
if(MBEDTLS_USE_STATIC_LIBS)
find_library(MBEDTLS_LIBRARY NAMES "mbedtls_static" "libmbedtls_static" "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509_static" "libmbedx509_static" "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto_static" "libmbedcrypto_static" "mbedcrypto" "libmbedcrypto"
"tfpsacrypto_static" "libtfpsacrypto_static" "tfpsacrypto" "libtfpsacrypto")
else()
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto" "tfpsacrypto" "libtfpsacrypto")
endif()
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto")
unset(MBEDTLS_VERSION CACHE)
if(MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
@ -117,21 +92,9 @@ else()
)
if(MBEDTLS_FOUND)
set(_mbedtls_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(_mbedtls_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
endif()
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
endif()
if(MBEDTLS_FOUND)
if(NOT TARGET CURL::mbedtls)
add_library(CURL::mbedtls INTERFACE IMPORTED)
set_target_properties(CURL::mbedtls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_mbedtls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_mbedtls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_mbedtls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_mbedtls_LIBRARIES}")
endif()
endif()

View file

@ -25,56 +25,34 @@
#
# Input variables:
#
# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory.
# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library.
# - `NGHTTP2_USE_STATIC_LIBS`: Configure for static nghttp2 libraries.
# - `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory.
# - `NGHTTP2_LIBRARY`: Path to `nghttp2` library.
#
# Defines:
# Result variables:
#
# - `NGHTTP2_FOUND`: System has nghttp2.
# - `NGHTTP2_VERSION`: Version of nghttp2.
# - `CURL::nghttp2`: nghttp2 library target.
# - `NGHTTP2_FOUND`: System has nghttp2.
# - `NGHTTP2_INCLUDE_DIRS`: The nghttp2 include directories.
# - `NGHTTP2_LIBRARIES`: The nghttp2 library names.
# - `NGHTTP2_LIBRARY_DIRS`: The nghttp2 library directories.
# - `NGHTTP2_PC_REQUIRES`: The nghttp2 pkg-config packages.
# - `NGHTTP2_CFLAGS`: Required compiler flags.
# - `NGHTTP2_VERSION`: Version of nghttp2.
set(_nghttp2_pc_requires "libnghttp2")
set(NGHTTP2_PC_REQUIRES "libnghttp2")
if(NOT DEFINED NGHTTP2_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NGHTTP2_INCLUDE_DIR AND
NOT DEFINED NGHTTP2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp2 ${_nghttp2_pc_requires})
endif()
if(NOT _nghttp2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp2 CONFIG QUIET)
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(NGHTTP2 ${NGHTTP2_PC_REQUIRES})
endif()
if(_nghttp2_FOUND)
set(NGHTTP2_FOUND TRUE)
set(NGHTTP2_VERSION ${_nghttp2_VERSION})
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_CFLAGS "${_nghttp2_STATIC_CFLAGS}")
set(_nghttp2_INCLUDE_DIRS "${_nghttp2_STATIC_INCLUDE_DIRS}")
set(_nghttp2_LIBRARY_DIRS "${_nghttp2_STATIC_LIBRARY_DIRS}")
set(_nghttp2_LIBRARIES "${_nghttp2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGHTTP2 (via pkg-config): ${_nghttp2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")")
elseif(nghttp2_CONFIG)
set(NGHTTP2_FOUND TRUE)
set(NGHTTP2_VERSION ${nghttp2_VERSION})
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_LIBRARIES nghttp2::nghttp2_static)
else()
set(_nghttp2_LIBRARIES nghttp2::nghttp2)
endif()
message(STATUS "Found NGHTTP2 (via CMake Config): ${nghttp2_CONFIG} (found version \"${NGHTTP2_VERSION}\")")
if(NGHTTP2_FOUND)
string(REPLACE ";" " " NGHTTP2_CFLAGS "${NGHTTP2_CFLAGS}")
message(STATUS "Found NGHTTP2 (via pkg-config): ${NGHTTP2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")")
else()
find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h")
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_CFLAGS "-DNGHTTP2_STATICLIB")
find_library(NGHTTP2_LIBRARY NAMES "nghttp2_static" "nghttp2")
else()
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
endif()
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
unset(NGHTTP2_VERSION CACHE)
if(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h")
@ -96,21 +74,9 @@ else()
)
if(NGHTTP2_FOUND)
set(_nghttp2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
set(_nghttp2_LIBRARIES ${NGHTTP2_LIBRARY})
set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY})
endif()
mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY)
endif()
if(NGHTTP2_FOUND)
if(NOT TARGET CURL::nghttp2)
add_library(CURL::nghttp2 INTERFACE IMPORTED)
set_target_properties(CURL::nghttp2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nghttp2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nghttp2_LIBRARIES}")
endif()
endif()

View file

@ -25,56 +25,34 @@
#
# Input variables:
#
# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory.
# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library.
# - `NGHTTP3_USE_STATIC_LIBS`: Configure for static nghttp3 libraries.
# - `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory.
# - `NGHTTP3_LIBRARY`: Path to `nghttp3` library.
#
# Defines:
# Result variables:
#
# - `NGHTTP3_FOUND`: System has nghttp3.
# - `NGHTTP3_VERSION`: Version of nghttp3.
# - `CURL::nghttp3`: nghttp3 library target.
# - `NGHTTP3_FOUND`: System has nghttp3.
# - `NGHTTP3_INCLUDE_DIRS`: The nghttp3 include directories.
# - `NGHTTP3_LIBRARIES`: The nghttp3 library names.
# - `NGHTTP3_LIBRARY_DIRS`: The nghttp3 library directories.
# - `NGHTTP3_PC_REQUIRES`: The nghttp3 pkg-config packages.
# - `NGHTTP3_CFLAGS`: Required compiler flags.
# - `NGHTTP3_VERSION`: Version of nghttp3.
set(_nghttp3_pc_requires "libnghttp3")
set(NGHTTP3_PC_REQUIRES "libnghttp3")
if(NOT DEFINED NGHTTP3_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NGHTTP3_INCLUDE_DIR AND
NOT DEFINED NGHTTP3_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp3 ${_nghttp3_pc_requires})
endif()
if(NOT _nghttp3_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp3 CONFIG QUIET)
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(NGHTTP3 ${NGHTTP3_PC_REQUIRES})
endif()
if(_nghttp3_FOUND)
set(NGHTTP3_FOUND TRUE)
set(NGHTTP3_VERSION ${_nghttp3_VERSION})
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_CFLAGS "${_nghttp3_STATIC_CFLAGS}")
set(_nghttp3_INCLUDE_DIRS "${_nghttp3_STATIC_INCLUDE_DIRS}")
set(_nghttp3_LIBRARY_DIRS "${_nghttp3_STATIC_LIBRARY_DIRS}")
set(_nghttp3_LIBRARIES "${_nghttp3_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")")
elseif(nghttp3_CONFIG)
set(NGHTTP3_FOUND TRUE)
set(NGHTTP3_VERSION ${nghttp3_VERSION})
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_LIBRARIES nghttp3::nghttp3_static)
else()
set(_nghttp3_LIBRARIES nghttp3::nghttp3)
endif()
message(STATUS "Found NGHTTP3 (via CMake Config): ${nghttp3_CONFIG} (found version \"${NGHTTP3_VERSION}\")")
if(NGHTTP3_FOUND)
string(REPLACE ";" " " NGHTTP3_CFLAGS "${NGHTTP3_CFLAGS}")
message(STATUS "Found NGHTTP3 (via pkg-config): ${NGHTTP3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")")
else()
find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h")
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_CFLAGS "-DNGHTTP3_STATICLIB")
find_library(NGHTTP3_LIBRARY NAMES "nghttp3_static" "nghttp3")
else()
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
endif()
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
unset(NGHTTP3_VERSION CACHE)
if(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h")
@ -96,21 +74,9 @@ else()
)
if(NGHTTP3_FOUND)
set(_nghttp3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
set(_nghttp3_LIBRARIES ${NGHTTP3_LIBRARY})
set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY})
endif()
mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY)
endif()
if(NGHTTP3_FOUND)
if(NOT TARGET CURL::nghttp3)
add_library(CURL::nghttp3 INTERFACE IMPORTED)
set_target_properties(CURL::nghttp3 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nghttp3_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nghttp3_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nghttp3_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nghttp3_LIBRARIES}")
endif()
endif()

View file

@ -35,21 +35,24 @@
#
# Input variables:
#
# - `NGTCP2_INCLUDE_DIR`: Absolute path to ngtcp2 include directory.
# - `NGTCP2_LIBRARY`: Absolute path to `ngtcp2` library.
# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_boringssl` library.
# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_gnutls` library.
# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Absolute path to `ngtcp2_crypto_libressl` library.
# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_ossl` library.
# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_quictls` library.
# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_wolfssl` library.
# - `NGTCP2_USE_STATIC_LIBS`: Configure for static ngtcp2 libraries.
# - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory.
# - `NGTCP2_LIBRARY`: Path to `ngtcp2` library.
# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library.
# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library.
# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Path to `ngtcp2_crypto_libressl` library.
# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library.
# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library.
# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library.
#
# Defines:
# Result variables:
#
# - `NGTCP2_FOUND`: System has ngtcp2.
# - `NGTCP2_INCLUDE_DIRS`: The ngtcp2 include directories.
# - `NGTCP2_LIBRARIES`: The ngtcp2 library names.
# - `NGTCP2_LIBRARY_DIRS`: The ngtcp2 library directories.
# - `NGTCP2_PC_REQUIRES`: The ngtcp2 pkg-config packages.
# - `NGTCP2_CFLAGS`: Required compiler flags.
# - `NGTCP2_VERSION`: Version of ngtcp2.
# - `CURL::ngtcp2`: ngtcp2 library target.
if(NGTCP2_FIND_COMPONENTS)
set(_ngtcp2_crypto_backend "")
@ -68,57 +71,27 @@ if(NGTCP2_FIND_COMPONENTS)
endif()
endif()
set(_ngtcp2_pc_requires "libngtcp2")
set(NGTCP2_PC_REQUIRES "libngtcp2")
if(_ngtcp2_crypto_backend)
list(APPEND _ngtcp2_pc_requires "lib${_crypto_library_lower}")
list(APPEND NGTCP2_PC_REQUIRES "lib${_crypto_library_lower}")
endif()
set(_tried_pkgconfig FALSE)
if(NOT DEFINED NGTCP2_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NGTCP2_INCLUDE_DIR AND
NOT DEFINED NGTCP2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_ngtcp2 ${_ngtcp2_pc_requires})
set(_tried_pkgconfig TRUE)
endif()
if(NOT _ngtcp2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(ngtcp2 CONFIG QUIET)
# Skip using it if the crypto library target is not available
if(ngtcp2_CONFIG AND
NOT TARGET ngtcp2::${_crypto_library_lower}_static AND
NOT TARGET ngtcp2::${_crypto_library_lower})
unset(ngtcp2_CONFIG)
endif()
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(NGTCP2 ${NGTCP2_PC_REQUIRES})
set(_tried_pkgconfig TRUE)
endif()
if(_ngtcp2_FOUND)
set(NGTCP2_FOUND TRUE)
set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION})
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_CFLAGS "${_ngtcp2_STATIC_CFLAGS}")
set(_ngtcp2_INCLUDE_DIRS "${_ngtcp2_STATIC_INCLUDE_DIRS}")
set(_ngtcp2_LIBRARY_DIRS "${_ngtcp2_STATIC_LIBRARY_DIRS}")
set(_ngtcp2_LIBRARIES "${_ngtcp2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGTCP2 (via pkg-config): ${_ngtcp2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")")
elseif(ngtcp2_CONFIG)
set(NGTCP2_FOUND TRUE)
set(NGTCP2_VERSION ${ngtcp2_VERSION})
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_LIBRARIES ngtcp2::ngtcp2_static ngtcp2::${_crypto_library_lower}_static)
else()
set(_ngtcp2_LIBRARIES ngtcp2::ngtcp2 ngtcp2::${_crypto_library_lower})
endif()
message(STATUS "Found NGTCP2 (via CMake Config): ${ngtcp2_CONFIG} (found version \"${NGTCP2_VERSION}\")")
if(NGTCP2_FOUND)
set(NGTCP2_VERSION "${NGTCP2_libngtcp2_VERSION}")
string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}")
message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")")
else()
find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h")
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_CFLAGS "-DNGTCP2_STATICLIB")
find_library(NGTCP2_LIBRARY NAMES "ngtcp2_static" "ngtcp2")
else()
find_library(NGTCP2_LIBRARY NAMES "ngtcp2")
endif()
find_library(NGTCP2_LIBRARY NAMES "ngtcp2")
unset(NGTCP2_VERSION CACHE)
if(NGTCP2_INCLUDE_DIR AND EXISTS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h")
@ -131,18 +104,8 @@ else()
endif()
if(_ngtcp2_crypto_backend)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(GET NGTCP2_LIBRARY PARENT_PATH _ngtcp2_library_dir)
else()
get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY)
endif()
if(NGTCP2_USE_STATIC_LIBS)
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower}_static ${_crypto_library_lower}
HINTS ${_ngtcp2_library_dir})
else()
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower}
HINTS ${_ngtcp2_library_dir})
endif()
get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY)
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower} HINTS ${_ngtcp2_library_dir})
if(${_crypto_library_upper}_LIBRARY)
set(NGTCP2_${_ngtcp2_crypto_backend}_FOUND TRUE)
@ -161,8 +124,8 @@ else()
)
if(NGTCP2_FOUND)
set(_ngtcp2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
set(_ngtcp2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
set(NGTCP2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
set(NGTCP2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
endif()
mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY)
@ -172,15 +135,3 @@ else()
unset(NGTCP2_LIBRARY CACHE)
endif()
endif()
if(NGTCP2_FOUND)
if(NOT TARGET CURL::ngtcp2)
add_library(CURL::ngtcp2 INTERFACE IMPORTED)
set_target_properties(CURL::ngtcp2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_ngtcp2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_ngtcp2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_ngtcp2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_ngtcp2_LIBRARIES}")
endif()
endif()

View file

@ -25,29 +25,32 @@
#
# Input variables:
#
# - `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory.
# - `NETTLE_LIBRARY`: Absolute path to `nettle` library.
# - `NETTLE_INCLUDE_DIR`: The nettle include directory.
# - `NETTLE_LIBRARY`: Path to `nettle` library.
#
# Defines:
# Result variables:
#
# - `NETTLE_FOUND`: System has nettle.
# - `NETTLE_VERSION`: Version of nettle.
# - `CURL::nettle`: nettle library target.
# - `NETTLE_FOUND`: System has nettle.
# - `NETTLE_INCLUDE_DIRS`: The nettle include directories.
# - `NETTLE_LIBRARIES`: The nettle library names.
# - `NETTLE_LIBRARY_DIRS`: The nettle library directories.
# - `NETTLE_PC_REQUIRES`: The nettle pkg-config packages.
# - `NETTLE_CFLAGS`: Required compiler flags.
# - `NETTLE_VERSION`: Version of nettle.
set(_nettle_pc_requires "nettle")
set(NETTLE_PC_REQUIRES "nettle")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NETTLE_INCLUDE_DIR AND
NOT DEFINED NETTLE_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_nettle ${_nettle_pc_requires})
pkg_check_modules(NETTLE ${NETTLE_PC_REQUIRES})
endif()
if(_nettle_FOUND)
if(NETTLE_FOUND)
set(Nettle_FOUND TRUE)
set(NETTLE_FOUND TRUE)
set(NETTLE_VERSION ${_nettle_VERSION})
message(STATUS "Found Nettle (via pkg-config): ${_nettle_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}")
message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
else()
find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h")
find_library(NETTLE_LIBRARY NAMES "nettle")
@ -77,21 +80,9 @@ else()
)
if(NETTLE_FOUND)
set(_nettle_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR})
set(_nettle_LIBRARIES ${NETTLE_LIBRARY})
set(NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR})
set(NETTLE_LIBRARIES ${NETTLE_LIBRARY})
endif()
mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARY)
endif()
if(NETTLE_FOUND)
if(NOT TARGET CURL::nettle)
add_library(CURL::nettle INTERFACE IMPORTED)
set_target_properties(CURL::nettle PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nettle_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nettle_LIBRARIES}")
endif()
endif()

View file

@ -25,29 +25,32 @@
#
# Input variables:
#
# - `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory.
# - `QUICHE_LIBRARY`: Absolute path to `quiche` library.
# - `QUICHE_INCLUDE_DIR`: The quiche include directory.
# - `QUICHE_LIBRARY`: Path to `quiche` library.
#
# Defines:
# Result variables:
#
# - `QUICHE_FOUND`: System has quiche.
# - `QUICHE_VERSION`: Version of quiche.
# - `CURL::quiche`: quiche library target.
# - `QUICHE_FOUND`: System has quiche.
# - `QUICHE_INCLUDE_DIRS`: The quiche include directories.
# - `QUICHE_LIBRARIES`: The quiche library names.
# - `QUICHE_LIBRARY_DIRS`: The quiche library directories.
# - `QUICHE_PC_REQUIRES`: The quiche pkg-config packages.
# - `QUICHE_CFLAGS`: Required compiler flags.
# - `QUICHE_VERSION`: Version of quiche.
set(_quiche_pc_requires "quiche")
set(QUICHE_PC_REQUIRES "quiche")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED QUICHE_INCLUDE_DIR AND
NOT DEFINED QUICHE_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_quiche ${_quiche_pc_requires})
pkg_check_modules(QUICHE ${QUICHE_PC_REQUIRES})
endif()
if(_quiche_FOUND)
if(QUICHE_FOUND)
set(Quiche_FOUND TRUE)
set(QUICHE_FOUND TRUE)
set(QUICHE_VERSION ${_quiche_VERSION})
message(STATUS "Found Quiche (via pkg-config): ${_quiche_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}")
message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
else()
find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h")
find_library(QUICHE_LIBRARY NAMES "quiche")
@ -60,21 +63,9 @@ else()
)
if(QUICHE_FOUND)
set(_quiche_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
set(_quiche_LIBRARIES ${QUICHE_LIBRARY})
set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
set(QUICHE_LIBRARIES ${QUICHE_LIBRARY})
endif()
mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY)
endif()
if(QUICHE_FOUND)
if(NOT TARGET CURL::quiche)
add_library(CURL::quiche INTERFACE IMPORTED)
set_target_properties(CURL::quiche PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_quiche_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_quiche_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_quiche_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_quiche_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_quiche_LIBRARIES}")
endif()
endif()

View file

@ -25,31 +25,34 @@
#
# Input variables:
#
# - `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory.
# - `RUSTLS_LIBRARY`: Absolute path to `rustls` library.
# - `RUSTLS_INCLUDE_DIR`: The Rustls include directory.
# - `RUSTLS_LIBRARY`: Path to `rustls` library.
#
# Defines:
# Result variables:
#
# - `RUSTLS_FOUND`: System has Rustls.
# - `RUSTLS_VERSION`: Version of Rustls.
# - `CURL::rustls`: Rustls library target.
# - `RUSTLS_FOUND`: System has Rustls.
# - `RUSTLS_INCLUDE_DIRS`: The Rustls include directories.
# - `RUSTLS_LIBRARIES`: The Rustls library names.
# - `RUSTLS_LIBRARY_DIRS`: The Rustls library directories.
# - `RUSTLS_PC_REQUIRES`: The Rustls pkg-config packages.
# - `RUSTLS_CFLAGS`: Required compiler flags.
# - `RUSTLS_VERSION`: Version of Rustls.
set(_rustls_pc_requires "rustls")
set(RUSTLS_PC_REQUIRES "rustls")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED RUSTLS_INCLUDE_DIR AND
NOT DEFINED RUSTLS_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_rustls ${_rustls_pc_requires})
pkg_check_modules(RUSTLS ${RUSTLS_PC_REQUIRES})
endif()
if(_rustls_FOUND)
if(RUSTLS_FOUND)
set(Rustls_FOUND TRUE)
set(RUSTLS_FOUND TRUE)
set(RUSTLS_VERSION ${_rustls_VERSION})
message(STATUS "Found Rustls (via pkg-config): ${_rustls_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}")
message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
else()
set(_rustls_pc_requires "") # Depend on pkg-config only when found via pkg-config
set(RUSTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
find_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h")
find_library(RUSTLS_LIBRARY NAMES "rustls")
@ -62,8 +65,8 @@ else()
)
if(RUSTLS_FOUND)
set(_rustls_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR})
set(_rustls_LIBRARIES ${RUSTLS_LIBRARY})
set(RUSTLS_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR})
set(RUSTLS_LIBRARIES ${RUSTLS_LIBRARY})
endif()
mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY)
@ -76,41 +79,31 @@ if(RUSTLS_FOUND)
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
list(APPEND _rustls_LIBRARIES "-framework Security")
list(APPEND RUSTLS_LIBRARIES "-framework Security")
find_library(FOUNDATION_FRAMEWORK NAMES "Foundation")
mark_as_advanced(FOUNDATION_FRAMEWORK)
if(NOT FOUNDATION_FRAMEWORK)
message(FATAL_ERROR "Foundation framework not found")
endif()
list(APPEND _rustls_LIBRARIES "-framework Foundation")
list(APPEND RUSTLS_LIBRARIES "-framework Foundation")
elseif(NOT WIN32)
find_library(PTHREAD_LIBRARY NAMES "pthread")
if(PTHREAD_LIBRARY)
list(APPEND _rustls_LIBRARIES ${PTHREAD_LIBRARY})
list(APPEND RUSTLS_LIBRARIES ${PTHREAD_LIBRARY})
endif()
mark_as_advanced(PTHREAD_LIBRARY)
find_library(DL_LIBRARY NAMES "dl")
if(DL_LIBRARY)
list(APPEND _rustls_LIBRARIES ${DL_LIBRARY})
list(APPEND RUSTLS_LIBRARIES ${DL_LIBRARY})
endif()
mark_as_advanced(DL_LIBRARY)
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND _rustls_LIBRARIES ${MATH_LIBRARY})
list(APPEND RUSTLS_LIBRARIES ${MATH_LIBRARY})
endif()
mark_as_advanced(MATH_LIBRARY)
endif()
if(NOT TARGET CURL::rustls)
add_library(CURL::rustls INTERFACE IMPORTED)
set_target_properties(CURL::rustls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_rustls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_rustls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_rustls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_rustls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_rustls_LIBRARIES}")
endif()
endif()

65
CMake/FindWolfSSH.cmake Normal file
View file

@ -0,0 +1,65 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Find the wolfSSH library
#
# Input variables:
#
# - `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory.
# - `WOLFSSH_LIBRARY`: Path to `wolfssh` library.
#
# Result variables:
#
# - `WOLFSSH_FOUND`: System has wolfSSH.
# - `WOLFSSH_INCLUDE_DIRS`: The wolfSSH include directories.
# - `WOLFSSH_LIBRARIES`: The wolfSSH library names.
# - `WOLFSSH_VERSION`: Version of wolfSSH.
find_path(WOLFSSH_INCLUDE_DIR NAMES "wolfssh/ssh.h")
find_library(WOLFSSH_LIBRARY NAMES "wolfssh" "libwolfssh")
unset(WOLFSSH_VERSION CACHE)
if(WOLFSSH_INCLUDE_DIR AND EXISTS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h")
set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSH_VERSION_STRING[\t ]+\"([^\"]*)\"")
file(STRINGS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(WOLFSSH_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WolfSSH
REQUIRED_VARS
WOLFSSH_INCLUDE_DIR
WOLFSSH_LIBRARY
VERSION_VAR
WOLFSSH_VERSION
)
if(WOLFSSH_FOUND)
set(WOLFSSH_INCLUDE_DIRS ${WOLFSSH_INCLUDE_DIR})
set(WOLFSSH_LIBRARIES ${WOLFSSH_LIBRARY})
endif()
mark_as_advanced(WOLFSSH_INCLUDE_DIR WOLFSSH_LIBRARY)

View file

@ -25,14 +25,18 @@
#
# Input variables:
#
# - `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory.
# - `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library.
# - `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory.
# - `WOLFSSL_LIBRARY`: Path to `wolfssl` library.
#
# Defines:
# Result variables:
#
# - `WOLFSSL_FOUND`: System has wolfSSL.
# - `WOLFSSL_VERSION`: Version of wolfSSL.
# - `CURL::wolfssl`: wolfSSL library target.
# - `WOLFSSL_FOUND`: System has wolfSSL.
# - `WOLFSSL_INCLUDE_DIRS`: The wolfSSL include directories.
# - `WOLFSSL_LIBRARIES`: The wolfSSL library names.
# - `WOLFSSL_LIBRARY_DIRS`: The wolfSSL library directories.
# - `WOLFSSL_PC_REQUIRES`: The wolfSSL pkg-config packages.
# - `WOLFSSL_CFLAGS`: Required compiler flags.
# - `WOLFSSL_VERSION`: Version of wolfSSL.
if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR)
message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.")
@ -43,30 +47,19 @@ if(DEFINED WolfSSL_LIBRARY AND NOT DEFINED WOLFSSL_LIBRARY)
set(WOLFSSL_LIBRARY "${WolfSSL_LIBRARY}")
endif()
set(_wolfssl_pc_requires "wolfssl")
set(WOLFSSL_PC_REQUIRES "wolfssl")
if(NOT DEFINED WOLFSSL_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED WOLFSSL_INCLUDE_DIR AND
NOT DEFINED WOLFSSL_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_wolfssl ${_wolfssl_pc_requires})
endif()
if(NOT _wolfssl_FOUND AND CURL_USE_CMAKECONFIG)
find_package(wolfssl CONFIG QUIET)
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(WOLFSSL ${WOLFSSL_PC_REQUIRES})
endif()
if(_wolfssl_FOUND)
if(WOLFSSL_FOUND)
set(WolfSSL_FOUND TRUE)
set(WOLFSSL_FOUND TRUE)
set(WOLFSSL_VERSION ${_wolfssl_VERSION})
message(STATUS "Found WolfSSL (via pkg-config): ${_wolfssl_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
elseif(wolfssl_CONFIG)
set(WolfSSL_FOUND TRUE)
set(WOLFSSL_FOUND TRUE)
set(WOLFSSL_VERSION ${wolfssl_VERSION})
set(_wolfssl_LIBRARIES wolfssl::wolfssl)
message(STATUS "Found WolfSSL (via CMake Config): ${wolfssl_CONFIG} (found version \"${WOLFSSL_VERSION}\")")
string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}")
message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
else()
find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h")
find_library(WOLFSSL_LIBRARY NAMES "wolfssl")
@ -91,8 +84,8 @@ else()
)
if(WOLFSSL_FOUND)
set(_wolfssl_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
set(_wolfssl_LIBRARIES ${WOLFSSL_LIBRARY})
set(WOLFSSL_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
set(WOLFSSL_LIBRARIES ${WOLFSSL_LIBRARY})
endif()
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY)
@ -105,31 +98,19 @@ if(WOLFSSL_FOUND)
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
list(APPEND _wolfssl_LIBRARIES "-framework Security")
list(APPEND WOLFSSL_LIBRARIES "-framework Security")
find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation")
mark_as_advanced(COREFOUNDATION_FRAMEWORK)
if(NOT COREFOUNDATION_FRAMEWORK)
message(FATAL_ERROR "CoreFoundation framework not found")
endif()
list(APPEND _wolfssl_LIBRARIES "-framework CoreFoundation")
elseif(WIN32)
list(APPEND _wolfssl_LIBRARIES "crypt32")
else()
list(APPEND WOLFSSL_LIBRARIES "-framework CoreFoundation")
elseif(NOT WIN32)
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND _wolfssl_LIBRARIES ${MATH_LIBRARY}) # for log and pow
list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow
endif()
mark_as_advanced(MATH_LIBRARY)
endif()
if(NOT TARGET CURL::wolfssl)
add_library(CURL::wolfssl INTERFACE IMPORTED)
set_target_properties(CURL::wolfssl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_wolfssl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_wolfssl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_wolfssl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_wolfssl_LIBRARIES}")
endif()
endif()

View file

@ -25,15 +25,18 @@
#
# Input variables:
#
# - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory.
# - `ZSTD_LIBRARY`: Absolute path to `zstd` library.
# - `ZSTD_USE_STATIC_LIBS`: Configure for static zstd libraries.
# - `ZSTD_INCLUDE_DIR`: The zstd include directory.
# - `ZSTD_LIBRARY`: Path to `zstd` library.
#
# Defines:
# Result variables:
#
# - `ZSTD_FOUND`: System has zstd.
# - `ZSTD_VERSION`: Version of zstd.
# - `CURL::zstd`: zstd library target.
# - `ZSTD_FOUND`: System has zstd.
# - `ZSTD_INCLUDE_DIRS`: The zstd include directories.
# - `ZSTD_LIBRARIES`: The zstd library names.
# - `ZSTD_LIBRARY_DIRS`: The zstd library directories.
# - `ZSTD_PC_REQUIRES`: The zstd pkg-config packages.
# - `ZSTD_CFLAGS`: Required compiler flags.
# - `ZSTD_VERSION`: Version of zstd.
if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR)
message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.")
@ -44,54 +47,22 @@ if(DEFINED Zstd_LIBRARY AND NOT DEFINED ZSTD_LIBRARY)
set(ZSTD_LIBRARY "${Zstd_LIBRARY}")
endif()
set(_zstd_pc_requires "libzstd")
set(ZSTD_PC_REQUIRES "libzstd")
if(NOT DEFINED ZSTD_INCLUDE_DIR AND
if(CURL_USE_PKGCONFIG AND
NOT DEFINED ZSTD_INCLUDE_DIR AND
NOT DEFINED ZSTD_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_zstd ${_zstd_pc_requires})
endif()
if(NOT _zstd_FOUND AND CURL_USE_CMAKECONFIG)
find_package(Zstd CONFIG QUIET)
# Skip using if older than v1.4.5
if(Zstd_CONFIG AND
NOT TARGET zstd::libzstd_static AND
NOT TARGET zstd::libzstd_shared)
unset(Zstd_CONFIG)
endif()
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(ZSTD ${ZSTD_PC_REQUIRES})
endif()
if(_zstd_FOUND)
if(ZSTD_FOUND)
set(Zstd_FOUND TRUE)
set(ZSTD_FOUND TRUE)
set(ZSTD_VERSION ${_zstd_VERSION})
if(ZSTD_USE_STATIC_LIBS)
set(_zstd_CFLAGS "${_zstd_STATIC_CFLAGS}")
set(_zstd_INCLUDE_DIRS "${_zstd_STATIC_INCLUDE_DIRS}")
set(_zstd_LIBRARY_DIRS "${_zstd_STATIC_LIBRARY_DIRS}")
set(_zstd_LIBRARIES "${_zstd_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Zstd (via pkg-config): ${_zstd_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
elseif(Zstd_CONFIG)
set(ZSTD_FOUND TRUE)
set(ZSTD_VERSION ${Zstd_VERSION})
if(ZSTD_USE_STATIC_LIBS)
set(_zstd_LIBRARIES zstd::libzstd_static)
elseif(TARGET zstd::libzstd)
set(_zstd_LIBRARIES zstd::libzstd) # v1.5.6+
else()
set(_zstd_LIBRARIES zstd::libzstd_shared)
endif()
message(STATUS "Found Zstd (via CMake Config): ${Zstd_CONFIG} (found version \"${ZSTD_VERSION}\")")
string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}")
message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
else()
find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h")
if(ZSTD_USE_STATIC_LIBS)
find_library(ZSTD_LIBRARY NAMES "zstd_static" "zstd")
else()
find_library(ZSTD_LIBRARY NAMES "zstd")
endif()
find_library(ZSTD_LIBRARY NAMES "zstd")
unset(ZSTD_VERSION CACHE)
if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h")
@ -123,21 +94,9 @@ else()
)
if(ZSTD_FOUND)
set(_zstd_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
set(_zstd_LIBRARIES ${ZSTD_LIBRARY})
set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
endif()
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
endif()
if(ZSTD_FOUND)
if(NOT TARGET CURL::zstd)
add_library(CURL::zstd INTERFACE IMPORTED)
set_target_properties(CURL::zstd PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_zstd_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_zstd_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_zstd_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_zstd_LIBRARIES}")
endif()
endif()

View file

@ -40,18 +40,26 @@ set(CURL_TEST_DEFINES "") # Initialize global variable
# Return result in variable: CURL_TEST_OUTPUT
macro(curl_internal_test _curl_test)
if(NOT DEFINED "${_curl_test}")
string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}")
set(_curl_test_add_libraries "")
if(CMAKE_REQUIRED_LIBRARIES)
set(_curl_test_add_libraries
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
endif()
message(STATUS "Performing Test ${_curl_test}")
try_compile(${_curl_test}
${PROJECT_BINARY_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c"
COMPILE_DEFINITIONS "-D${_curl_test}" ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=-D${_curl_test} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${_cmake_required_definitions}"
"${_curl_test_add_libraries}"
OUTPUT_VARIABLE CURL_TEST_OUTPUT)
if(${_curl_test})
set(${_curl_test} 1 CACHE INTERNAL "curl test")
set(${_curl_test} 1 CACHE INTERNAL "Curl test")
message(STATUS "Performing Test ${_curl_test} - Success")
else()
set(${_curl_test} "" CACHE INTERNAL "curl test")
set(${_curl_test} "" CACHE INTERNAL "Curl test")
message(STATUS "Performing Test ${_curl_test} - Failed")
endif()
endif()
@ -63,21 +71,9 @@ macro(curl_dependency_option _option_name _find_name _desc_name)
set_property(CACHE ${_option_name} PROPERTY STRINGS "AUTO" "ON" "OFF")
if(${_option_name} STREQUAL "AUTO")
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name})
else()
find_package(${_find_name} MODULE)
endif()
find_package(${_find_name})
elseif(${_option_name})
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name} REQUIRED)
else()
find_package(${_find_name} MODULE REQUIRED)
endif()
else()
string(TOUPPER "${_find_name}" _find_name_upper)
set(${_find_name}_FOUND OFF) # cmake-lint: disable=C0103
set(${_find_name_upper}_FOUND OFF) # cmake-lint: disable=C0103
find_package(${_find_name} REQUIRED)
endif()
endmacro()
@ -102,24 +98,24 @@ endmacro()
# Internal: Recurse into target libraries and collect their include directories
# and macro definitions.
macro(curl_collect_target_compile_options _target)
get_target_property(_val ${_target} INTERFACE_COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
macro(curl_collect_target_options _target)
get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _incsys ${_val})
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} INTERFACE_COMPILE_OPTIONS)
get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _options ${_val})
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_target_property(_val ${_target} LINK_LIBRARIES)
if(_val)
foreach(_lib IN LISTS _val)
if(TARGET "${_lib}")
curl_collect_target_compile_options(${_lib})
curl_collect_target_options(${_lib})
endif()
endforeach()
endif()
@ -127,93 +123,34 @@ macro(curl_collect_target_compile_options _target)
endmacro()
# Create a clang-tidy target for test targets
function(curl_add_clang_tidy_test_target _target_clang_tidy _target)
macro(curl_add_clang_tidy_test_target _target_clang_tidy _target)
if(CURL_CLANG_TIDY)
set(_definitions "")
set(_includes "")
set(_incsys "")
set(_options "")
set(_definitions "")
# Make a list of known system include directories
set(_sys_incdirs "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
foreach(_inc IN LISTS CMAKE_SYSTEM_PREFIX_PATH)
if(NOT _inc MATCHES "/$")
string(APPEND _inc "/")
endif()
string(APPEND _inc "include")
if(NOT _inc IN_LIST _sys_incdirs AND IS_DIRECTORY "${_inc}")
list(APPEND _sys_incdirs "${_inc}")
endif()
endforeach()
# Collect options applying to the directory
get_directory_property(_val COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
# Collect header directories and macro definitions applying to the directory
get_directory_property(_val INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_directory_property(_val COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
# Collect options applying to the target
get_target_property(_val ${_target} COMPILE_DEFINITIONS)
get_directory_property(_val COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
unset(_val)
# Collect header directories and macro definitions from lib dependencies
curl_collect_target_compile_options(${_target})
list(REMOVE_ITEM _definitions "")
string(REPLACE ";" ";-D" _definitions ";${_definitions}")
list(REMOVE_DUPLICATES _definitions)
list(SORT _definitions) # Sort like CMake does
curl_collect_target_options(${_target})
list(REMOVE_ITEM _includes "")
string(REPLACE ";" ";-I" _includes ";${_includes}")
list(REMOVE_DUPLICATES _includes)
set(_incsys_tmp ${_incsys})
list(REMOVE_DUPLICATES _incsys_tmp)
set(_incsys "")
set(_incsystop "")
foreach(_inc IN LISTS _incsys_tmp)
if(_inc IN_LIST _sys_incdirs)
list(APPEND _incsystop "${_inc}") # Save system prefixes to re-add them later to the end of list
continue()
endif()
# Avoid empty and '$<INSTALL_INTERFACE:include>' items. The latter
# evaluates to an empty path in this context. Also skip
# '$<BUILD_INTERFACE:curl-include>', as already present in '_includes'.
if(_inc AND
NOT _inc MATCHES "INSTALL_INTERFACE:" AND
NOT _inc MATCHES "BUILD_INTERFACE:")
list(APPEND _incsys "-isystem" "${_inc}")
endif()
endforeach()
foreach(_inc IN LISTS _incsystop)
list(APPEND _incsys "-isystem" "${_inc}")
endforeach()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(REMOVE_DUPLICATES _options) # Keep the first of duplicates to imitate CMake
else()
set(_options)
endif()
list(REMOVE_ITEM _definitions "")
string(REPLACE ";" ";-D" _definitions ";${_definitions}")
list(REMOVE_DUPLICATES _definitions)
list(SORT _definitions) # Sort like CMake does
# Assemble source list
set(_sources "")
@ -224,55 +161,14 @@ function(curl_add_clang_tidy_test_target _target_clang_tidy _target)
list(APPEND _sources "${_source}")
endforeach()
set(_cc "${CMAKE_C_COMPILER}")
if(CMAKE_C_COMPILER_TARGET AND CMAKE_C_COMPILE_OPTIONS_TARGET)
list(APPEND _cc "${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}")
endif()
if(APPLE AND CMAKE_OSX_SYSROOT)
list(APPEND _cc "-isysroot" "${CMAKE_OSX_SYSROOT}")
elseif(CMAKE_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT)
list(APPEND _cc "${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}")
endif()
# Pass -clang-diagnostic-unused-function to disable -Wunused-function implied by -Wunused
add_custom_target(${_target_clang_tidy} USES_TERMINAL
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND ${CMAKE_C_CLANG_TIDY}
"--checks=-clang-diagnostic-unused-function"
${_sources} -- ${_cc} ${_definitions} ${_includes} ${_incsys} ${_options}
COMMAND ${CMAKE_C_CLANG_TIDY} ${_sources} -- ${_includes} ${_definitions}
DEPENDS ${_sources})
add_dependencies(tests-clang-tidy ${_target_clang_tidy})
endif()
endfunction()
# Internal: Recurse into interface targets and collect their libraries
# and library paths.
macro(curl_collect_target_link_options _target)
get_target_property(_val ${_target} INTERFACE_LINK_DIRECTORIES)
if(_val)
list(APPEND _libdirs ${_val})
unset(_includes)
unset(_definitions)
unset(_sources)
endif()
get_target_property(_val ${_target} IMPORTED)
if(_val)
# LOCATION is empty for interface library targets and safe to ignore.
# Explicitly skip this query to avoid CMake v3.18 and older erroring out.
get_target_property(_val ${_target} TYPE)
if(NOT "${_val}" STREQUAL "INTERFACE_LIBRARY")
get_target_property(_val ${_target} LOCATION)
if(_val)
list(APPEND _libs ${_val})
endif()
endif()
endif()
get_target_property(_val ${_target} INTERFACE_LINK_LIBRARIES)
if(_val)
foreach(_lib IN LISTS _val)
if(TARGET "${_lib}")
curl_collect_target_link_options(${_lib})
else()
list(APPEND _libs ${_lib})
endif()
endforeach()
endif()
unset(_val)
endmacro()

View file

@ -50,6 +50,19 @@ if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
cmake_pop_check_state()
endif()
if(NOT WIN32)
set(_source_epilogue "#undef inline")
curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
check_c_source_compiles("${_source_epilogue}
#include <sys/socket.h>
int main(void)
{
int flag = MSG_NOSIGNAL;
(void)flag;
return 0;
}" HAVE_MSG_NOSIGNAL)
endif()
set(_source_epilogue "#undef inline")
check_c_source_compiles("${_source_epilogue}
#ifdef _MSC_VER
@ -78,7 +91,7 @@ if(WIN32)
elseif(NOT HAVE_GETADDRINFO)
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
elseif(APPLE OR
AIX OR CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR

View file

@ -29,10 +29,12 @@ set(_picky_nocheck "") # not to pass to feature checks
if(CURL_WERROR)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
elseif(MSVC)
list(APPEND _picky_nocheck "-WX")
else() # llvm/clang and gcc-style options
list(APPEND _picky_nocheck "-Werror")
else()
if(MSVC)
list(APPEND _picky_nocheck "-WX")
else() # llvm/clang and gcc style options
list(APPEND _picky_nocheck "-Werror")
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
@ -45,8 +47,8 @@ endif()
if(APPLE AND
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.1
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.3))
list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.3
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
@ -60,9 +62,7 @@ elseif(BORLAND)
endif()
if(PICKY_COMPILER)
# Leave disabled for GCC <4.6, because they lack #pragma features to silence locally.
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6) OR
CMAKE_C_COMPILER_ID MATCHES "Clang")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# https://clang.llvm.org/docs/DiagnosticsReference.html
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
@ -77,15 +77,9 @@ if(PICKY_COMPILER)
set(_picky_enable "-W")
endif()
list(APPEND _picky_enable "-Wall")
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.2) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) OR
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
list(APPEND _picky_enable "-Wpedantic") # clang 3.2 gcc 4.8 appleclang 4.2
else()
list(APPEND _picky_enable "-pedantic")
endif()
list(APPEND _picky_enable
-Wall -pedantic
)
# ----------------------------------
# Add new options here, if in doubt:
@ -93,9 +87,6 @@ if(PICKY_COMPILER)
set(_picky_detect
)
# Notes: -Wno-* options should ideally be disabled at their precise cutoff versions,
# to suppress undesired warnings in case -Weverything is passed as a custom option.
# Assume these options always exist with both clang and gcc.
# Require clang 3.0 / gcc 2.95 or later.
list(APPEND _picky_enable
@ -119,7 +110,7 @@ if(PICKY_COMPILER)
-Waddress # clang 2.7 gcc 4.3
-Wattributes # clang 2.7 gcc 4.1
-Wcast-align # clang 1.0 gcc 4.2
-Wcast-qual # clang 2.7 gcc 3.4.6
-Wcast-qual # clang 3.0 gcc 3.4.6
-Wdeclaration-after-statement # clang 1.0 gcc 3.4
-Wdiv-by-zero # clang 2.7 gcc 4.1
-Wempty-body # clang 2.7 gcc 4.3
@ -129,14 +120,14 @@ if(PICKY_COMPILER)
-Wignored-qualifiers # clang 2.8 gcc 4.3
-Wmissing-field-initializers # clang 2.7 gcc 4.1
-Wmissing-noreturn # clang 2.7 gcc 4.1
-Wno-padded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
-Wno-format-nonliteral # clang 1.0 gcc 2.96 (3.0)
-Wno-sign-conversion # clang 2.9 gcc 4.3
-Wno-switch-default # clang 2.7 gcc 4.1 # Not used: Annoying to fix or silence
-Wno-switch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case
-Wno-system-headers # clang 1.0 gcc 3.0
# -Wpadded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
-Wold-style-definition # clang 2.7 gcc 3.4
-Wredundant-decls # clang 2.7 gcc 4.1
-Wstrict-prototypes # clang 1.0 gcc 3.3
# -Wswitch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case
-Wtype-limits # clang 2.7 gcc 4.3
-Wunreachable-code # clang 2.7 gcc 4.1
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
@ -148,11 +139,9 @@ if(PICKY_COMPILER)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND _picky_enable
${_picky_common_old}
-Wconditional-uninitialized # clang 3.0
-Wno-used-but-marked-unused # clang 2.9 # for typecheck-gcc.h with clang 14+, dependency headers
-Wshift-sign-overflow # clang 2.9
-Wshorten-64-to-32 # clang 1.0
-Wformat=2 # clang 2.7 gcc 4.8
-Wformat=2 # clang 3.0 gcc 4.8
)
if(NOT MSVC)
list(APPEND _picky_enable
@ -160,119 +149,39 @@ if(PICKY_COMPILER)
)
endif()
# Enable based on compiler version
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.1)
list(APPEND _picky_enable
-Wno-covered-switch-default # clang 3.1 appleclang 3.1 # Annoying to fix or silence
-Wno-disabled-macro-expansion # clang 3.1 appleclang 3.1 # for std headers, and curl/curl.h (rare combos)
)
if(MSVC)
list(APPEND _picky_enable
-Wno-format-non-iso # clang 3.1 appleclang 3.1 # 'q' length modifier is not supported by ISO C
)
else()
list(APPEND _picky_enable
-Wformat-non-iso # clang 3.1 appleclang 3.1
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.3) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0))
list(APPEND _picky_enable
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
-Wmissing-variable-declarations # clang 3.2 appleclang 4.2
-Wno-documentation-unknown-command # clang 3.3 appleclang 5.0
-Wsometimes-uninitialized # clang 3.2 appleclang 4.2
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.3))
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0
-Wheader-guard # clang 3.4 appleclang 5.1
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
-Wsometimes-uninitialized # clang 3.2 appleclang 4.6
# -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.3))
list(APPEND _picky_enable
-Wcomma # clang 3.9 appleclang 8.1
-Wcomma # clang 3.9 appleclang 8.3
-Wmissing-variable-declarations # clang 3.2 appleclang 4.6
)
if(MSVC)
list(APPEND _picky_enable
-Wno-nonportable-system-include-path # clang 3.9 appleclang 8.1 # No truly portable solution to this
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11))
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.3))
list(APPEND _picky_enable
-Wassign-enum # clang 7.0 appleclang 11.0
-Wextra-semi-stmt # clang 7.0 appleclang 11.0
-Wassign-enum # clang 7.0 appleclang 10.3
-Wextra-semi-stmt # clang 7.0 appleclang 10.3
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12))
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.4))
list(APPEND _picky_enable
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0 # We do silencing for clang 10.0 and above only
-Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # We do silencing for clang 10.0 and above only
-Wxor-used-as-pow # clang 10.0 gcc 13.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1))
list(APPEND _picky_enable
-Wcast-function-type # clang 13.0 appleclang 13.1
-Wreserved-identifier # clang 13.0 appleclang 13.1 # Keep it before -Wno-reserved-macro-identifier
-Wno-reserved-macro-identifier # clang 13.0 appleclang 13.1 # External macros have to be set sometimes
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.3))
if(CMAKE_GENERATOR STREQUAL "FASTBuild")
list(APPEND _picky_enable
-Wno-gnu-line-marker # clang 15.0 appleclang 14.0.3
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
list(APPEND _picky_enable
-Wno-unsafe-buffer-usage # clang 16.0 appleclang 15.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0))
list(APPEND _picky_enable
-Wcast-function-type-strict # clang 16.0 appleclang 16.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.1) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0))
list(APPEND _picky_enable
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 26.4))
list(APPEND _picky_enable
-Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
-Wc++-hidden-decl # clang 21.1 appleclang 26.4
-Wimplicit-int-enum-cast # clang 21.1
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
-Wno-implicit-void-ptr-cast # clang 21.1 appleclang 26.4
-Wtentative-definition-compat # clang 21.1 appleclang 26.4
)
if(WIN32)
list(APPEND _picky_enable
-Wno-c++-keyword # clang 21.1 appleclang 26.4 # `wchar_t` triggers it on Windows
)
else()
list(APPEND _picky_enable
-Wc++-keyword # clang 21.1 appleclang 26.4
)
endif()
endif()
else() # gcc
# Enable based on compiler version
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
@ -288,7 +197,7 @@ if(PICKY_COMPILER)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
list(APPEND _picky_enable
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
-Wjump-misses-init # gcc 4.5
)
if(MINGW)
list(APPEND _picky_enable
@ -298,24 +207,23 @@ if(PICKY_COMPILER)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
-Wformat=2 # clang 2.7 gcc 4.8
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3
-Wformat=2 # clang 3.0 gcc 4.8
-Wtrampolines # gcc 4.6
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
list(APPEND _picky_enable
-Warray-bounds=2 # clang 2.9 gcc 5.0 (clang default: -Warray-bounds)
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0
-Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
list(APPEND _picky_enable
-Wduplicated-cond # gcc 6.0
-Wnull-dereference # clang 2.9 gcc 6.0 (clang default)
-Wnull-dereference # clang 3.0 gcc 6.0 (clang default)
-fdelete-null-pointer-checks
-Wshift-negative-value # clang 3.7 gcc 6.0 (clang default)
-Wshift-overflow=2 # clang 2.9 gcc 6.0 (clang default: -Wshift-overflow)
-Wshift-overflow=2 # clang 3.0 gcc 6.0 (clang default: -Wshift-overflow)
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
)
endif()
@ -324,21 +232,21 @@ if(PICKY_COMPILER)
-Walloc-zero # gcc 7.0
-Wduplicated-branches # gcc 7.0
-Wformat-truncation=2 # gcc 7.0
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0
-Wimplicit-fallthrough # clang 4.0 gcc 7.0
-Wrestrict # gcc 7.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
list(APPEND _picky_enable
-Warith-conversion # gcc 10.0
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
list(APPEND _picky_enable
-Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
-Warray-compare # clang 20.0 gcc 12.0
-Wenum-int-mismatch # gcc 13.0
-Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
-Wxor-used-as-pow # clang 10.0 gcc 13.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
@ -350,15 +258,12 @@ if(PICKY_COMPILER)
endif()
endif()
# Assemble list of flags
#
set(_picky_skipped "")
foreach(_ccopt IN LISTS _picky_enable)
string(REGEX MATCH "-W([a-z0-9+-]+)" _ccmatch "${_ccopt}")
string(REPLACE "+" "\\+" _cmake_match_1 "${CMAKE_MATCH_1}") # escape '+' to make it a valid regex
if(_ccmatch AND "${CMAKE_C_FLAGS} " MATCHES "-Wno-${_cmake_match_1} " AND
NOT _ccopt STREQUAL "-Wall" AND
NOT _ccopt MATCHES "^-Wno-")
string(REGEX MATCH "-W([a-z0-9-]+)" _ccmatch "${_ccopt}")
if(_ccmatch AND CMAKE_C_FLAGS MATCHES "-Wno-${CMAKE_MATCH_1}" AND NOT _ccopt STREQUAL "-Wall" AND NOT _ccopt MATCHES "^-Wno-")
string(APPEND _picky_skipped " ${_ccopt}")
else()
list(APPEND _picky "${_ccopt}")
@ -381,6 +286,15 @@ if(PICKY_COMPILER)
endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
# Avoid false positives
list(APPEND _picky "-Wno-shadow")
list(APPEND _picky "-Wno-unreachable-code")
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
# GCC <4.6 do not support #pragma to suppress warnings locally. Disable them globally instead.
list(APPEND _picky "-Wno-overlength-strings")
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.0 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
list(APPEND _picky "-Wno-missing-field-initializers") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
endif()
@ -391,7 +305,7 @@ if(PICKY_COMPILER)
list(APPEND _picky "-Wno-conversion") # Avoid false positives
endif()
endif()
elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1950) # Skip for untested/unreleased newer versions
elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1944) # Skip for untested/unreleased newer versions
list(APPEND _picky "-Wall")
list(APPEND _picky "-wd4061") # enumerator 'A' in switch of enum 'B' is not explicitly handled by a case label
list(APPEND _picky "-wd4191") # 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)(void)'
@ -400,11 +314,12 @@ if(PICKY_COMPILER)
list(APPEND _picky "-wd4548") # expression before comma has no effect; expected expression with side-effect (in FD_SET())
list(APPEND _picky "-wd4574") # 'M' is defined to be '0': did you mean to use '#if M'? (in ws2tcpip.h)
list(APPEND _picky "-wd4668") # 'M' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' (in winbase.h)
list(APPEND _picky "-wd4710") # 'fprintf'/'printf'/'sscanf': function not inlined (in tests, with VS2022+ Release)
list(APPEND _picky "-wd4710") # 'snprintf': function not inlined
list(APPEND _picky "-wd4711") # function 'A' selected for automatic inline expansion
# volatile access of '<expression>' is subject to /volatile:<iso|ms> setting;
# consider using __iso_volatile_load/store intrinsic functions (ARM64)
list(APPEND _picky "-wd4746")
list(APPEND _picky "-wd4774") # 'snprintf': format string expected in argument 3 is not a string literal
list(APPEND _picky "-wd4820") # 'A': 'N' bytes padding added after data member 'B'
if(MSVC_VERSION GREATER_EQUAL 1900)
list(APPEND _picky "-wd5045") # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
@ -430,21 +345,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
endforeach()
endif()
if(CMAKE_C_STANDARD STREQUAL 90)
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2))
list(APPEND _picky "-Wno-c99-extensions") # Avoid: warning: '_Bool' is a C99 extension
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
list(APPEND _picky "-Wno-comma") # Just silly
endif()
endif()
if(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
list(APPEND _picky "-Wno-arith-conversion") # Avoid warnings in DJGPP's built-in FD_SET() macro
endif()
if(_picky_nocheck OR _picky)
set(_picky_tmp "${_picky_nocheck}" "${_picky}")
string(REPLACE ";" " " _picky_tmp "${_picky_tmp}")

View file

@ -59,11 +59,6 @@ function(curl_dumptargetprops _target)
string(REPLACE "\n" ";" _cmake_property_list "${_cmake_property_list}")
list(REMOVE_DUPLICATES _cmake_property_list)
list(REMOVE_ITEM _cmake_property_list "")
list(APPEND _cmake_property_list "INTERFACE_LIBCURL_PC_MODULES")
get_target_property(_target_imported ${_target} IMPORTED)
if(NOT _target_imported)
list(REMOVE_ITEM _cmake_property_list "LOCATION" "LOCATION_<CONFIG>" "MACOSX_PACKAGE_LOCATION" "VS_DEPLOYMENT_LOCATION")
endif()
foreach(_prop IN LISTS _cmake_property_list)
if(_prop MATCHES "<CONFIG>")
foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO")

View file

@ -0,0 +1,77 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
if("@USE_OPENSSL@")
if("@OPENSSL_VERSION_MAJOR@")
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
else()
find_dependency(OpenSSL)
endif()
endif()
if("@HAVE_LIBZ@")
find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
# Alias for either shared or static library
if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.11 AND CMAKE_VERSION VERSION_LESS 3.18)
set_target_properties(@PROJECT_NAME@::@LIB_SELECTED@ PROPERTIES IMPORTED_GLOBAL TRUE)
endif()
add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
endif()
# For compatibility with CMake's FindCURL.cmake
set(CURL_VERSION_STRING "@CURLVERSION@")
set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@)
set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@")
set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@")
foreach(_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES)
set(CURL_SUPPORTS_${_item} TRUE)
endforeach()
set(_missing_req "")
foreach(_item IN LISTS CURL_FIND_COMPONENTS)
if(CURL_SUPPORTS_${_item})
set(CURL_${_item}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED_${_item})
list(APPEND _missing_req ${_item})
endif()
endforeach()
if(_missing_req)
string(REPLACE ";" " " _missing_req "${_missing_req}")
if(CURL_FIND_REQUIRED)
message(FATAL_ERROR "CURL: missing required components: ${_missing_req}")
endif()
unset(_missing_req)
endif()
check_required_components("@PROJECT_NAME@")

View file

@ -1,196 +0,0 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
@PACKAGE_INIT@
option(CURL_USE_CMAKECONFIG "Enable detecting @PROJECT_NAME@ dependencies via CMake Config. Default: @CURL_USE_CMAKECONFIG@"
"@CURL_USE_CMAKECONFIG@")
option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@"
"@CURL_USE_PKGCONFIG@")
if(CMAKE_VERSION VERSION_LESS @CMAKE_MINIMUM_REQUIRED_VERSION@)
message(STATUS "@PROJECT_NAME@: @PROJECT_NAME@-specific Find modules require "
"CMake @CMAKE_MINIMUM_REQUIRED_VERSION@ or upper, found: ${CMAKE_VERSION}.")
endif()
include(CMakeFindDependencyMacro)
if("@HAVE_THREADS_POSIX@" OR "@HAVE_THREADS_POSIX_BORINGSSL@")
find_dependency(Threads) # for Threads::Threads
endif()
if("@USE_OPENSSL@")
if("@OPENSSL_VERSION_MAJOR@")
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
else()
find_dependency(OpenSSL)
endif()
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(TARGET OpenSSL::Crypto AND NOT TARGET CURL::OpenSSL_Crypto)
add_library(CURL::OpenSSL_Crypto INTERFACE IMPORTED)
set_target_properties(CURL::OpenSSL_Crypto PROPERTIES INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
endif()
endif()
if("@HAVE_LIBZ@")
find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@")
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(TARGET ZLIB::ZLIB AND NOT TARGET CURL::ZLIB)
add_library(CURL::ZLIB INTERFACE IMPORTED)
set_target_properties(CURL::ZLIB PROPERTIES INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
endif()
endif()
set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH})
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
set(_curl_libs "")
if("@HAVE_BROTLI@")
find_dependency(Brotli MODULE)
list(APPEND _curl_libs CURL::brotli)
endif()
if("@USE_ARES@")
find_dependency(Cares MODULE)
list(APPEND _curl_libs CURL::cares)
endif()
if("@HAVE_GSSAPI@")
find_dependency(GSS MODULE)
list(APPEND _curl_libs CURL::gss)
endif()
if("@USE_BACKTRACE@")
find_dependency(Libbacktrace MODULE)
list(APPEND _curl_libs CURL::libbacktrace)
endif()
if("@USE_GSASL@")
find_dependency(Libgsasl MODULE)
list(APPEND _curl_libs CURL::libgsasl)
endif()
if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@")
find_dependency(LDAP MODULE)
list(APPEND _curl_libs CURL::ldap)
endif()
if("@HAVE_LIBIDN2@")
find_dependency(Libidn2 MODULE)
list(APPEND _curl_libs CURL::libidn2)
endif()
if("@USE_LIBPSL@")
find_dependency(Libpsl MODULE)
list(APPEND _curl_libs CURL::libpsl)
endif()
if("@USE_LIBSSH@")
find_dependency(Libssh MODULE)
list(APPEND _curl_libs CURL::libssh)
endif()
if("@USE_LIBSSH2@")
find_dependency(Libssh2 MODULE)
list(APPEND _curl_libs CURL::libssh2)
endif()
if("@USE_LIBUV@")
find_dependency(Libuv MODULE)
list(APPEND _curl_libs CURL::libuv)
endif()
if("@USE_MBEDTLS@")
find_dependency(MbedTLS MODULE)
list(APPEND _curl_libs CURL::mbedtls)
endif()
if("@USE_NGHTTP2@")
find_dependency(NGHTTP2 MODULE)
list(APPEND _curl_libs CURL::nghttp2)
endif()
if("@USE_NGHTTP3@")
find_dependency(NGHTTP3 MODULE)
list(APPEND _curl_libs CURL::nghttp3)
endif()
if("@USE_NGTCP2@")
find_dependency(NGTCP2 MODULE)
list(APPEND _curl_libs CURL::ngtcp2)
endif()
if("@USE_GNUTLS@")
find_dependency(GnuTLS MODULE)
list(APPEND _curl_libs CURL::gnutls)
find_dependency(Nettle MODULE)
list(APPEND _curl_libs CURL::nettle)
endif()
if("@USE_QUICHE@")
find_dependency(Quiche MODULE)
list(APPEND _curl_libs CURL::quiche)
endif()
if("@USE_RUSTLS@")
find_dependency(Rustls MODULE)
list(APPEND _curl_libs CURL::rustls)
endif()
if("@USE_WOLFSSL@")
find_dependency(WolfSSL MODULE)
list(APPEND _curl_libs CURL::wolfssl)
endif()
if("@HAVE_ZSTD@")
find_dependency(Zstd MODULE)
list(APPEND _curl_libs CURL::zstd)
endif()
set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save})
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(WIN32 AND NOT TARGET CURL::win32_winsock)
add_library(CURL::win32_winsock INTERFACE IMPORTED)
set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
# Alias for either shared or static library
if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@)
add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
endif()
# For compatibility with CMake's FindCURL.cmake
set(CURL_VERSION_STRING "@CURLVERSION@")
set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@)
set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@")
set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@")
set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@")
foreach(_curl_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES)
set(CURL_SUPPORTS_${_curl_item} TRUE)
endforeach()
set(_curl_missing_req "")
foreach(_curl_item IN LISTS CURL_FIND_COMPONENTS)
if(CURL_SUPPORTS_${_curl_item})
set(CURL_${_curl_item}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED_${_curl_item})
list(APPEND _curl_missing_req ${_curl_item})
endif()
endforeach()
if(_curl_missing_req)
string(REPLACE ";" " " _curl_missing_req "${_curl_missing_req}")
if(CURL_FIND_REQUIRED)
message(FATAL_ERROR "@PROJECT_NAME@: missing required components: ${_curl_missing_req}")
endif()
unset(_curl_missing_req)
endif()
check_required_components("@PROJECT_NAME@")

View file

@ -88,6 +88,7 @@ elseif(CYGWIN OR
set(HAVE_FSETXATTR_5 1)
set(HAVE_FSETXATTR_6 0)
endif()
set(HAVE_FTRUNCATE 1)
set(HAVE_GETADDRINFO 1)
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETADDRINFO_THREADSAFE 0)
@ -141,7 +142,7 @@ set(HAVE_GETRLIMIT 1)
set(HAVE_GETSOCKNAME 1)
set(HAVE_GETTIMEOFDAY 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Depends on C library.
set(HAVE_GLIBC_STRERROR_R 1)
else()
set(HAVE_GLIBC_STRERROR_R 0)
endif()
@ -163,12 +164,12 @@ else()
endif()
set(HAVE_LIBGEN_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Requires Linux kernel userspace headers. Expected with glibc. May be missing by default with MUSL.
set(HAVE_LINUX_TCP_H 1)
else()
set(HAVE_LINUX_TCP_H 0)
endif()
set(HAVE_LOCALE_H 1)
set(HAVE_LOCALTIME_R 1)
set(HAVE_LONGLONG 1)
if(APPLE)
set(HAVE_MACH_ABSOLUTE_TIME 1)
endif()
@ -178,6 +179,7 @@ if(APPLE OR
else()
set(HAVE_MEMRCHR 1)
endif()
set(HAVE_MSG_NOSIGNAL 1)
set(HAVE_NETDB_H 1)
if(ANDROID)
set(HAVE_NETINET_IN6_H 1)
@ -194,18 +196,15 @@ if(APPLE OR
CYGWIN)
set(HAVE_PIPE2 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
BSD OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "SunOS")
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_PIPE2 1)
endif()
set(HAVE_POLL 1)
set(HAVE_POLL_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Depends on C library.
set(HAVE_POSIX_STRERROR_R 0)
else()
set(HAVE_POSIX_STRERROR_R 1)
endif()
@ -224,22 +223,30 @@ else()
endif()
set(HAVE_SENDMSG 1)
set(HAVE_SETLOCALE 1)
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_SETMODE 0)
else()
set(HAVE_SETMODE 1)
endif()
set(HAVE_SETRLIMIT 1)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 1)
set(HAVE_SIGINTERRUPT 1)
set(HAVE_SIGNAL 1)
set(HAVE_SIGSETJMP 1)
set(HAVE_SNPRINTF 1)
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 1)
set(HAVE_STDATOMIC_H 1)
set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDDEF_H 1)
set(HAVE_STDINT_H 1)
set(HAVE_STRCASECMP 1)
set(HAVE_STRCMPI 0)
set(HAVE_STRDUP 1)
set(HAVE_STRERROR_R 1)
set(HAVE_STRICMP 0)
set(HAVE_STRINGS_H 1)
@ -299,5 +306,8 @@ set(HAVE_UTIME 1)
set(HAVE_UTIMES 1)
set(HAVE_UTIME_H 1)
set(HAVE_WRITABLE_ARGV 1)
if(CYGWIN)
set(HAVE__SETMODE 1)
endif()
set(STDC_HEADERS 1)
set(USE_UNIX_SOCKETS 1)

View file

@ -29,9 +29,11 @@ if(MINGW)
set(HAVE_BASENAME 1)
set(HAVE_BOOL_T 1) # = HAVE_STDBOOL_H
set(HAVE_DIRENT_H 1)
set(HAVE_FTRUNCATE 1)
set(HAVE_GETTIMEOFDAY 1)
set(HAVE_LIBGEN_H 1)
set(HAVE_OPENDIR 1)
set(HAVE_SNPRINTF 1)
set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
@ -41,6 +43,7 @@ if(MINGW)
set(HAVE_UTIME_H 1) # wrapper to sys/utime.h
else()
set(HAVE_DIRENT_H 0)
set(HAVE_FTRUNCATE 0)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_LIBGEN_H 0)
set(HAVE_OPENDIR 0)
@ -50,13 +53,22 @@ else()
if(MSVC)
set(HAVE_UNISTD_H 0)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
if(MSVC_VERSION GREATER_EQUAL 1600)
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
else()
set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size()
endif()
if(MSVC_VERSION GREATER_EQUAL 1800)
set(HAVE_STDBOOL_H 1)
else()
set(HAVE_STDBOOL_H 0)
endif()
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
if(MSVC_VERSION GREATER_EQUAL 1900)
set(HAVE_SNPRINTF 1)
else()
set(HAVE_SNPRINTF 0)
endif()
set(HAVE_BASENAME 0)
endif()
endif()
@ -115,8 +127,8 @@ set(HAVE_IOCTL_SIOCGIFADDR 0)
set(HAVE_IO_H 1)
set(HAVE_LINUX_TCP_H 0)
set(HAVE_LOCALE_H 1)
set(HAVE_LOCALTIME_R 0)
set(HAVE_MEMRCHR 0)
set(HAVE_MSG_NOSIGNAL 0)
set(HAVE_NETDB_H 0)
set(HAVE_NETINET_IN6_H 0)
set(HAVE_NETINET_IN_H 0)
@ -135,6 +147,7 @@ set(HAVE_SEND 1)
set(HAVE_SENDMMSG 0)
set(HAVE_SENDMSG 0)
set(HAVE_SETLOCALE 1)
set(HAVE_SETMODE 1)
set(HAVE_SETRLIMIT 0)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 0)
@ -144,6 +157,7 @@ set(HAVE_SIGSETJMP 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 0)
set(HAVE_STRDUP 1)
set(HAVE_STRERROR_R 0)
set(HAVE_STROPTS_H 0)
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
@ -163,6 +177,7 @@ set(HAVE_TERMIO_H 0)
set(HAVE_TIME_T_UNSIGNED 0)
set(HAVE_UTIME 1)
set(HAVE_UTIMES 0)
set(HAVE__SETMODE 1)
set(STDC_HEADERS 1)
# Types and sizes
@ -173,11 +188,11 @@ set(HAVE_SIZEOF_SUSECONDS_T 0)
if(MINGW OR MSVC)
curl_prefill_type_size("INT" 4)
curl_prefill_type_size("LONG" 4)
curl_prefill_type_size("LONG_LONG" 8)
curl_prefill_type_size("__INT64" 8)
curl_prefill_type_size("CURL_OFF_T" 8)
curl_prefill_type_size("CURL_SOCKET_T" ${CMAKE_SIZEOF_VOID_P})
curl_prefill_type_size("SIZE_T" ${CMAKE_SIZEOF_VOID_P})
# TIME_T: 8 for _WIN64 or UCRT or MSVC, 4 otherwise
# CURL_SOCKET_T, SIZE_T: 8 for _WIN64, 4 otherwise
# TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise
# Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set.
# mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined.
if(MSVC)
@ -185,8 +200,30 @@ if(MINGW OR MSVC)
set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("OFF_T" 4)
else()
curl_prefill_type_size("SSIZE_T" ${CMAKE_SIZEOF_VOID_P})
# SSIZE_T: 8 for _WIN64, 4 otherwise
set(HAVE_FILE_OFFSET_BITS 1) # mingw-w64 v3+
curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+
endif()
endif()
# Windows CE exceptions
if(WINCE)
set(HAVE_FREEADDRINFO 0)
set(HAVE_GETADDRINFO 0)
set(HAVE_LOCALE_H 0)
set(HAVE_SETLOCALE 0)
set(HAVE_SETMODE 0)
set(HAVE_SIGNAL 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0)
curl_prefill_type_size("CURL_SOCKET_T" 4)
curl_prefill_type_size("TIME_T" 4)
curl_prefill_type_size("SIZE_T" 4)
if(MINGW32CE)
set(HAVE_STRTOK_R 0)
set(HAVE__SETMODE 0)
set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("SSIZE_T" 4)
curl_prefill_type_size("OFF_T" 4)
endif()
endif()

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2026, Daniel Stenberg, <daniel@haxx.se>, and many
Copyright (c) 1996 - 2025, Daniel Stenberg, <daniel@haxx.se>, and many
contributors, see the THANKS file.
All rights reserved.

View file

@ -24,7 +24,7 @@
# $ ./scripts/maketgz 8.7.1
# To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags
FROM debian:bookworm-slim@sha256:4724b8cc51e33e398f0e2e15e18d5ec2851ff0c2280647e1310bc1642182655d
FROM debian:bookworm-slim@sha256:df52e55e3361a81ac1bead266f3373ee55d29aa50cf0975d440c2be3483d8ed3
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \

View file

@ -1,8 +1,3 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |

11
LICENSES/BSD-3-Clause.txt Normal file
View file

@ -0,0 +1,11 @@
Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,33 +1,15 @@
BSD-4-Clause (University of California-Specific)
Copyright [various years] The Regents of the University of California.
All rights reserved.
Copyright [various years] The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software must
display the following acknowledgement: This product includes software
developed by the University of California, Berkeley and its contributors.
3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -26,59 +26,75 @@ AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
CMAKE_DIST = \
CMake/cmake_uninstall.in.cmake \
CMake/curl-config.in.cmake \
CMake/CurlSymbolHiding.cmake \
CMake/CurlTests.c \
CMake/FindBrotli.cmake \
CMake/FindCares.cmake \
CMake/FindGnuTLS.cmake \
CMake/FindGSS.cmake \
CMake/FindLDAP.cmake \
CMake/FindLibbacktrace.cmake \
CMake/FindLibgsasl.cmake \
CMake/FindLibidn2.cmake \
CMake/FindLibpsl.cmake \
CMake/FindLibssh.cmake \
CMake/FindLibssh2.cmake \
CMake/FindLibuv.cmake \
CMake/FindMbedTLS.cmake \
CMake/FindNGHTTP2.cmake \
CMake/FindNGHTTP3.cmake \
CMake/FindNGTCP2.cmake \
CMake/FindNettle.cmake \
CMake/FindQuiche.cmake \
CMake/FindRustls.cmake \
CMake/FindWolfSSL.cmake \
CMake/FindZstd.cmake \
CMake/Macros.cmake \
CMake/OtherTests.cmake \
CMake/PickyWarnings.cmake \
CMake/Utilities.cmake \
CMake/unix-cache.cmake \
CMake/win32-cache.cmake \
CMakeLists.txt \
tests/cmake/CMakeLists.txt \
tests/cmake/test.c \
tests/cmake/test.cpp \
tests/cmake/test.sh
CMAKE_DIST = \
CMake/cmake_uninstall.cmake.in \
CMake/CMakeConfigurableFile.in \
CMake/curl-config.cmake.in \
CMake/CurlSymbolHiding.cmake \
CMake/CurlTests.c \
CMake/FindBrotli.cmake \
CMake/FindCares.cmake \
CMake/FindGSS.cmake \
CMake/FindLDAP.cmake \
CMake/FindLibgsasl.cmake \
CMake/FindLibidn2.cmake \
CMake/FindLibpsl.cmake \
CMake/FindLibrtmp.cmake \
CMake/FindLibssh.cmake \
CMake/FindLibssh2.cmake \
CMake/FindLibuv.cmake \
CMake/FindMbedTLS.cmake \
CMake/FindNGHTTP2.cmake \
CMake/FindNGHTTP3.cmake \
CMake/FindNGTCP2.cmake \
CMake/FindNettle.cmake \
CMake/FindQuiche.cmake \
CMake/FindRustls.cmake \
CMake/FindWolfSSH.cmake \
CMake/FindWolfSSL.cmake \
CMake/FindZstd.cmake \
CMake/Macros.cmake \
CMake/OtherTests.cmake \
CMake/PickyWarnings.cmake \
CMake/Utilities.cmake \
CMake/unix-cache.cmake \
CMake/win32-cache.cmake \
CMakeLists.txt \
tests/cmake/CMakeLists.txt \
tests/cmake/test.c \
tests/cmake/test.sh
EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile .clang-tidy.yml .editorconfig $(CMAKE_DIST)
VC_DIST = projects/README.md projects/generate.bat
WINBUILD_DIST = winbuild/README.md \
winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.bat
PLAN9_DIST = plan9/include/mkfile \
plan9/include/mkfile \
plan9/mkfile.proto \
plan9/mkfile \
plan9/README \
plan9/lib/mkfile.inc \
plan9/lib/mkfile \
plan9/src/mkfile.inc \
plan9/src/mkfile
EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile .editorconfig \
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) $(PLAN9_DIST)
DISTCLEANFILES = buildinfo.txt
bin_SCRIPTS = curl-config
SUBDIRS = lib docs src scripts
DIST_SUBDIRS = $(SUBDIRS) tests projects include docs
DIST_SUBDIRS = $(SUBDIRS) tests packages include docs
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc
dist-hook:
rm -rf $(top_builddir)/tests/log
find $(distdir) -name "*.dist" -exec rm -- {} \;
find $(distdir) -name "*.dist" -exec rm {} \;
(distit=`find $(srcdir) -name "*.dist" | grep -v Makefile`; \
for file in $$distit; do \
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
@ -98,7 +114,7 @@ pytest: test
pytest-ci: test
test:
@echo "NOTICE: we cannot run the tests when cross-compiling!"
@echo "NOTICE: we can't run the tests when cross-compiling!"
else
@ -137,6 +153,32 @@ examples:
check-docs:
@(cd docs/libcurl; $(MAKE) check)
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
# must contain the following line:
# %_topdir /home/loic/local/rpm
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
#
# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
#
# If additional configure flags are needed to build the package, add the
# following in ~/.rpmmacros
# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
# and run make rpm in the following way:
# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
#
rpms:
$(MAKE) RPMDIST=curl rpm
$(MAKE) RPMDIST=curl-ssl rpm
rpm:
RPM_TOPDIR=`rpm --showrc | @PERL@ -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
# We extend the standard install with a custom hook:
if BUILD_DOCS
install-data-hook:
@ -169,13 +211,7 @@ checksrc:
(cd tests && $(MAKE) checksrc)
(cd include/curl && $(MAKE) checksrc)
(cd docs/examples && $(MAKE) checksrc)
(cd projects && $(MAKE) checksrc)
badwords:
@PERL@ $(top_srcdir)/scripts/badwords-all
lint: badwords checksrc
@PERL@ $(top_srcdir)/scripts/spacecheck.pl
(cd packages && $(MAKE) checksrc)
tidy:
(cd src && $(MAKE) tidy)

17
README
View file

@ -15,8 +15,7 @@ README
available to be used by your software. Read the libcurl.3 man page to
learn how.
You find answers to the most frequent questions we get in the FAQ.md
document.
You find answers to the most frequent questions we get in the FAQ document.
Study the COPYING file for distribution terms.
@ -33,18 +32,24 @@ WEBSITE
Visit the curl website for the latest news and downloads:
https://curl.se/
https://curl.se/
GIT
To download the latest source code off the GIT server, do this:
git clone https://github.com/curl/curl
git clone https://github.com/curl/curl.git
(you will get a directory named curl created, filled with the source code)
SECURITY PROBLEMS
Report suspected security problems privately and not in public.
Report suspected security problems via our HackerOne page and not in public.
https://curl.se/dev/vuln-disclosure.html
https://hackerone.com/curl
NOTICE
Curl contains pieces of source code that is Copyright (c) 1998, 1999
Kungliga Tekniska Högskolan. This notice is included here to comply with the
distribution terms.

View file

@ -6,13 +6,9 @@ SPDX-License-Identifier: curl
# [![curl logo](https://curl.se/logo/curl-logo.svg)](https://curl.se/)
curl is a command-line tool for transferring data from or to a server using
URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS,
HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP,
SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
curl is a command-line tool for transferring data specified with URL syntax.
Learn how to use curl by reading [the
man page](https://curl.se/docs/manpage.html) or [everything
manpage](https://curl.se/docs/manpage.html) or [everything
curl](https://everything.curl.dev/).
Find out how to install curl by reading [the INSTALL
@ -20,7 +16,7 @@ document](https://curl.se/docs/install.html).
libcurl is the library curl is using to do its job. It is readily available to
be used by your software. Read [the libcurl
man page](https://curl.se/libcurl/c/libcurl.html) to learn how.
manpage](https://curl.se/libcurl/c/libcurl.html) to learn how.
## Open Source
@ -50,12 +46,18 @@ Visit the [curl website](https://curl.se/) for the latest news and downloads.
Download the latest source from the Git server:
git clone https://github.com/curl/curl
git clone https://github.com/curl/curl.git
## Security problems
Report suspected security problems
[privately](https://curl.se/dev/vuln-disclosure.html) and not in public.
Report suspected security problems via [our HackerOne
page](https://hackerone.com/curl) and not in public.
## Notice
curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga
Tekniska Högskolan. This notice is included here to comply with the
distribution terms.
## Backers

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: Daniel Stenberg, <daniel@haxx.se>, et al.
# This file describes the licensing and copyright situation for files that
# cannot be annotated directly, for example because of being
# cannot be annotated directly, for example because of being simply
# uncommentable. Unless this is the case, a file should be annotated directly.
#
# This follows the REUSE specification: https://reuse.software/spec-3.2/#reusetoml
@ -13,26 +13,41 @@ SPDX-PackageDownloadLocation = "https://curl.se/"
[[annotations]]
path = [
".mailmap",
"docs/FAQ",
"docs/INSTALL",
"docs/KNOWN_BUGS",
"docs/libcurl/symbols-in-versions",
"docs/MAIL-ETIQUETTE",
"docs/options-in-versions",
"docs/THANKS",
"docs/TODO",
"GIT-INFO.md",
"lib/libcurl.vers.in",
"lib/libcurl.def",
"projects/OS400/README.OS400",
"projects/vms/build_vms.com",
"projects/vms/curl_release_note_start.txt",
"projects/vms/curlmsg.sdl",
"projects/vms/macro32_exactcase.patch",
"projects/vms/readme",
"packages/OS400/README.OS400",
"packages/vms/build_vms.com",
"packages/vms/curl_release_note_start.txt",
"packages/vms/curlmsg.sdl",
"packages/vms/macro32_exactcase.patch",
"packages/vms/readme",
"plan9/README",
"projects/Windows/**",
"README",
"RELEASE-NOTES",
"renovate.json",
"tests/certs/**",
"tests/data/data**",
"tests/data/test**",
"tests/valgrind.supp",
# checksrc control files
"lib/.checksrc",
"lib/curlx/.checksrc",
"lib/vauth/.checksrc",
"lib/vquic/.checksrc",
"lib/vssh/.checksrc",
"lib/vtls/.checksrc",
"src/.checksrc",
"tests/server/.checksrc",
]
SPDX-FileCopyrightText = "Daniel Stenberg, <daniel@haxx.se>, et al."
SPDX-License-Identifier = "curl"

View file

@ -10,20 +10,19 @@ Read our [Vulnerability Disclosure Policy](docs/VULN-DISCLOSURE-POLICY.md).
## Reporting a Vulnerability
If you have found or suspect a security problem somewhere in curl or libcurl,
[report it](https://curl.se/dev/vuln-disclosure.html)!
If you have found or just suspect a security problem somewhere in curl or
libcurl, report it on [HackerOne](https://hackerone.com/curl).
We treat security issues with confidentiality until controlled and disclosed
responsibly.
We treat security issues with confidentiality until controlled and disclosed responsibly.
## OpenSSF Best Practices
curl has achieved Gold status on the Open Source Security Foundation (OpenSSF)
[Best Practices](https://bestpractices.dev/) (formerly Core Infrastructure
Initiative Best Practices), reflecting its adherence to rigorous security and
best practice standards. This achievement highlights curl's comprehensive
documentation, secure development processes, effective change control
mechanisms, and strong maintenance routines. Meeting these criteria
Initiative Best Practices), reflecting its adherence to rigorous
security and best practice standards. This achievement highlights curl's
comprehensive documentation, secure development processes, effective change
control mechanisms, and strong maintenance routines. Meeting these criteria
demonstrates curl's commitment to security and reliability, ensuring the
project's sustainability and trustworthiness. This underscores curl's role as
a leader in open-source software practices. More information can be found on

View file

@ -32,12 +32,12 @@ dnl result in a set of double-quoted strings the returned expansion will
dnl actually be a single double-quoted string concatenating all them.
AC_DEFUN([CURL_CHECK_DEF], [
AC_REQUIRE([CURL_CPP_P])
AC_REQUIRE([CURL_CPP_P])dnl
OLDCPPFLAGS=$CPPFLAGS
dnl CPPPFLAG comes from CURL_CPP_P
# CPPPFLAG comes from CURL_CPP_P
CPPFLAGS="$CPPFLAGS $CPPPFLAG"
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])
AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl
if test -z "$SED"; then
AC_MSG_ERROR([SED not set. Cannot continue without SED being set.])
fi
@ -70,8 +70,8 @@ AC_DEFUN([CURL_CHECK_DEF], [
AS_VAR_SET(ac_Def, $tmp_exp)
ifelse($3,,[AC_MSG_RESULT([$tmp_exp])])
fi
AS_VAR_POPDEF([ac_Def])
AS_VAR_POPDEF([ac_HaveDef])
AS_VAR_POPDEF([ac_Def])dnl
AS_VAR_POPDEF([ac_HaveDef])dnl
CPPFLAGS=$OLDCPPFLAGS
])
@ -84,7 +84,7 @@ dnl default includes even if no INCLUDES argument is given. This macro
dnl will run silently when invoked with three arguments.
AC_DEFUN([CURL_CHECK_DEF_CC], [
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])])
AC_COMPILE_IFELSE([
AC_LANG_SOURCE(
@ -109,7 +109,7 @@ AC_DEFUN([CURL_CHECK_DEF_CC], [
AS_VAR_SET(ac_HaveDef, no)
ifelse($3,,[AC_MSG_RESULT([no])])
fi
AS_VAR_POPDEF([ac_HaveDef])
AS_VAR_POPDEF([ac_HaveDef])dnl
])
@ -152,8 +152,8 @@ AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif])
AC_BEFORE([$0], [AC_SYS_LARGEFILE])
AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])
AC_BEFORE([$0], [AC_SYS_LARGEFILE])dnl
AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])dnl
AC_MSG_CHECKING([if OS is AIX (to define _ALL_SOURCE)])
AC_EGREP_CPP([yes_this_is_aix],[
#ifdef _AIX
@ -190,7 +190,7 @@ AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
curl_cv_native_windows="no"
])
])
AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "$curl_cv_native_windows" = "yes")
AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$curl_cv_native_windows" = xyes)
])
@ -200,7 +200,7 @@ dnl Check for compilable and valid lber.h header,
dnl and check if it is needed even with ldap.h
AC_DEFUN([CURL_CHECK_HEADER_LBER], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_CACHE_CHECK([for lber.h], [curl_cv_header_lber_h], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -233,7 +233,7 @@ AC_DEFUN([CURL_CHECK_HEADER_LBER], [
if test "$curl_cv_header_lber_h" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_LBER_H, 1,
[Define to 1 if you have the lber.h header file.])
#
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
@ -264,7 +264,7 @@ AC_DEFUN([CURL_CHECK_HEADER_LBER], [
],[
curl_cv_need_header_lber_h="yes"
])
#
case "$curl_cv_need_header_lber_h" in
yes)
AC_DEFINE_UNQUOTED(NEED_LBER_H, 1,
@ -280,7 +280,7 @@ dnl -------------------------------------------------
dnl Check for compilable and valid ldap.h header
AC_DEFUN([CURL_CHECK_HEADER_LDAP], [
AC_REQUIRE([CURL_CHECK_HEADER_LBER])
AC_REQUIRE([CURL_CHECK_HEADER_LBER])dnl
AC_CACHE_CHECK([for ldap.h], [curl_cv_header_ldap_h], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -327,7 +327,7 @@ dnl -------------------------------------------------
dnl Check for compilable and valid ldap_ssl.h header
AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
AC_CACHE_CHECK([for ldap_ssl.h], [curl_cv_header_ldap_ssl_h], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -380,12 +380,12 @@ dnl whitespace separated list of libraries to check
dnl before the WINLDAP default ones.
AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
AC_REQUIRE([CURL_CHECK_HEADER_WINBER])
AC_REQUIRE([CURL_CHECK_HEADER_WINBER])dnl
#
AC_MSG_CHECKING([for WINLDAP libraries])
#
u_libs=""
#
ifelse($1,,,[
for x_lib in $1; do
case "$x_lib" in
@ -403,10 +403,10 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
fi
done
])
#
curl_cv_save_LIBS="$LIBS"
curl_cv_ldap_LIBS="unknown"
#
for x_nlibs in '' "$u_libs" \
'-lwldap32' ; do
if test "$curl_cv_ldap_LIBS" = "unknown"; then
@ -441,9 +441,9 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
])
fi
done
#
LIBS="$curl_cv_save_LIBS"
#
case X-"$curl_cv_ldap_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find WINLDAP libraries])
@ -460,6 +460,7 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [
AC_MSG_RESULT([$curl_cv_ldap_LIBS])
;;
esac
#
])
@ -472,12 +473,12 @@ dnl whitespace separated list of libraries to check
dnl before the default ones.
AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])
AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl
#
AC_MSG_CHECKING([for LDAP libraries])
#
u_libs=""
#
ifelse($1,,,[
for x_lib in $1; do
case "$x_lib" in
@ -495,10 +496,10 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
fi
done
])
#
curl_cv_save_LIBS="$LIBS"
curl_cv_ldap_LIBS="unknown"
#
for x_nlibs in '' "$u_libs" \
'-lldap' \
'-lldap -llber' \
@ -551,9 +552,9 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
])
fi
done
#
LIBS="$curl_cv_save_LIBS"
#
case X-"$curl_cv_ldap_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find LDAP libraries])
@ -567,13 +568,14 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [
else
LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS"
fi
dnl FIXME: Enable when ldap was detected via pkg-config
# FIXME: Enable when ldap was detected via pkg-config
if false; then
LIBCURL_PC_REQUIRES_PRIVATE="ldap $LIBCURL_PC_REQUIRES_PRIVATE"
fi
AC_MSG_RESULT([$curl_cv_ldap_LIBS])
;;
esac
#
])
@ -614,10 +616,10 @@ dnl -------------------------------------------------
dnl Test if the socket recv() function is available,
AC_DEFUN([CURL_CHECK_FUNC_RECV], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_CHECK_HEADERS(sys/types.h)
#
AC_MSG_CHECKING([for recv])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
@ -644,7 +646,7 @@ AC_DEFUN([CURL_CHECK_FUNC_RECV], [
AC_MSG_RESULT([no])
curl_cv_recv="no"
])
#
if test "$curl_cv_recv" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_RECV, 1,
[Define to 1 if you have the recv function.])
@ -660,10 +662,10 @@ dnl -------------------------------------------------
dnl Test if the socket send() function is available,
AC_DEFUN([CURL_CHECK_FUNC_SEND], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_CHECK_HEADERS(sys/types.h)
#
AC_MSG_CHECKING([for send])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
@ -691,7 +693,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
AC_MSG_RESULT([no])
curl_cv_send="no"
])
#
if test "$curl_cv_send" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_SEND, 1,
[Define to 1 if you have the send function.])
@ -701,13 +703,52 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
fi
])
dnl CURL_CHECK_MSG_NOSIGNAL
dnl -------------------------------------------------
dnl Check for MSG_NOSIGNAL
AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
AC_CHECK_HEADERS(sys/types.h)
AC_CACHE_CHECK([for MSG_NOSIGNAL], [curl_cv_msg_nosignal], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/socket.h>
#endif
]],[[
int flag = MSG_NOSIGNAL;
(void)flag;
]])
],[
curl_cv_msg_nosignal="yes"
],[
curl_cv_msg_nosignal="no"
])
])
case "$curl_cv_msg_nosignal" in
yes)
AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1,
[Define to 1 if you have the MSG_NOSIGNAL flag.])
;;
esac
])
dnl CURL_CHECK_STRUCT_TIMEVAL
dnl -------------------------------------------------
dnl Check for timeval struct
AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_CHECK_HEADERS(sys/types.h)
AC_CACHE_CHECK([for struct timeval], [curl_cv_struct_timeval], [
AC_COMPILE_IFELSE([
@ -728,7 +769,7 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
#include <time.h>
]],[[
struct timeval ts;
ts.tv_sec = 0;
ts.tv_sec = 0;
ts.tv_usec = 0;
(void)ts;
]])
@ -754,6 +795,7 @@ dnl Check if monotonic clock_gettime is available.
AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
AC_CHECK_HEADERS(sys/types.h)
AC_MSG_CHECKING([for monotonic clock_gettime])
#
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -778,7 +820,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
])
dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed
dnl until library linking and runtime checks for clock_gettime succeed.
dnl until library linking and run-time checks for clock_gettime succeed.
])
dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW
@ -788,7 +830,7 @@ dnl Check if monotonic clock_gettime is available.
AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [
AC_CHECK_HEADERS(sys/types.h)
AC_MSG_CHECKING([for raw monotonic clock_gettime])
#
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
@ -819,15 +861,15 @@ dnl If monotonic clock_gettime is available then,
dnl check and prepended to LIBS any needed libraries.
AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
AC_REQUIRE([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC])
AC_REQUIRE([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC])dnl
#
if test "$curl_func_clock_gettime" = "yes"; then
#
AC_MSG_CHECKING([for clock_gettime in libraries])
#
curl_cv_save_LIBS="$LIBS"
curl_cv_gclk_LIBS="unknown"
#
for x_xlibs in '' '-lrt' '-lposix4' ; do
if test "$curl_cv_gclk_LIBS" = "unknown"; then
if test -z "$x_xlibs"; then
@ -854,9 +896,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
])
fi
done
#
LIBS="$curl_cv_save_LIBS"
#
case X-"$curl_cv_gclk_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find clock_gettime])
@ -868,7 +910,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
curl_func_clock_gettime="yes"
;;
*)
if test "$dontwant_rt" = "yes"; then
if test "x$dontwant_rt" = "xyes" ; then
AC_MSG_WARN([needs -lrt but asked not to use it, HAVE_CLOCK_GETTIME_MONOTONIC will not be defined])
curl_func_clock_gettime="no"
else
@ -882,9 +924,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
fi
;;
esac
#
dnl only do runtime verification when not cross-compiling
if test "$cross_compiling" != "yes" &&
if test "x$cross_compiling" != "xyes" &&
test "$curl_func_clock_gettime" = "yes"; then
AC_MSG_CHECKING([if monotonic clock_gettime works])
CURL_RUN_IFELSE([
@ -913,14 +955,16 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
LIBS="$curl_cv_save_LIBS"
])
fi
#
case "$curl_func_clock_gettime" in
yes)
AC_DEFINE_UNQUOTED(HAVE_CLOCK_GETTIME_MONOTONIC, 1,
[Define to 1 if you have the clock_gettime function and monotonic timer.])
;;
esac
#
fi
#
])
@ -930,8 +974,8 @@ dnl Verify if network connect function is already available
dnl using current libraries or if another one is required.
AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_MSG_CHECKING([for connect in libraries])
tst_connect_save_LIBS="$LIBS"
tst_connect_need_LIBS="unknown"
@ -955,7 +999,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [
fi
done
LIBS="$tst_connect_save_LIBS"
#
case X-"$tst_connect_need_LIBS" in
X-unknown)
AC_MSG_RESULT([cannot find connect])
@ -977,10 +1021,10 @@ dnl -------------------------------------------------
dnl Test if the socket select() function is available.
AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])
AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_CHECK_HEADERS(sys/select.h)
#
AC_MSG_CHECKING([for select])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
@ -1016,7 +1060,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
AC_MSG_RESULT([no])
curl_cv_select="no"
])
#
if test "$curl_cv_select" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
[Define to 1 if you have the select function.])
@ -1038,11 +1082,11 @@ dnl macro. It must also run AFTER all lib-checking macros are complete.
AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [
dnl this test is of course not sensible if we are cross-compiling!
if test "$cross_compiling" != "yes"; then
if test "x$cross_compiling" != xyes; then
dnl just run a program to verify that the libs checked for previous to this
dnl point also is available runtime!
AC_MSG_CHECKING([runtime libs availability])
dnl point also is available run-time!
AC_MSG_CHECKING([run-time libs availability])
CURL_RUN_IFELSE([
int main(void)
{
@ -1051,7 +1095,7 @@ AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [
],
AC_MSG_RESULT([fine]),
AC_MSG_RESULT([failed])
AC_MSG_ERROR([one or more libs available at link-time are not available runtime. Libs used at link-time: $LIBS])
AC_MSG_ERROR([one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS])
)
dnl if this test fails, configure has already stopped
@ -1078,7 +1122,7 @@ AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
AC_ARG_WITH(ca-bundle,
AS_HELP_STRING([--with-ca-bundle=FILE],
[Absolute path to a file containing CA certificates (example: /etc/ca-bundle.crt)])
AS_HELP_STRING([--without-ca-bundle], [Do not use a default CA bundle]),
AS_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
[
want_ca="$withval"
if test "x$want_ca" = "xyes"; then
@ -1092,7 +1136,7 @@ AS_HELP_STRING([--with-ca-path=DIRECTORY],
their filenames in a hash format. This option can be used with the OpenSSL, \
GnuTLS, mbedTLS and wolfSSL backends. Refer to OpenSSL c_rehash for details. \
(example: /etc/certificates)])
AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]),
AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
[
want_capath="$withval"
if test "x$want_capath" = "xyes"; then
@ -1105,45 +1149,33 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]),
capath_warning=" (warning: certs not found)"
check_capath=""
if test "$APPLE_SECTRUST_ENABLED" = "1"; then
ca_native="Apple SecTrust"
elif test "$ca_native_opt" = "1"; then
ca_native="yes"
else
ca_native="no"
fi
if test "x$want_ca" != "xno" && test "x$want_ca" != "xunset" &&
test "x$want_capath" != "xno" && test "x$want_capath" != "xunset"; then
if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \
"x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
dnl both given
ca="$want_ca"
capath="$want_capath"
elif test "x$want_ca" != "xno" && test "x$want_ca" != "xunset"; then
elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then
dnl --with-ca-bundle given
ca="$want_ca"
capath="no"
elif test "x$want_capath" != "xno" && test "x$want_capath" != "xunset"; then
elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
dnl --with-ca-path given
capath="$want_capath"
ca="no"
elif test "$ca_native" != "no"; then
dnl native ca configured, do not look further
ca="no"
capath="no"
else
dnl First try auto-detecting a CA bundle, then a CA path.
dnl Both auto-detections can be skipped by --without-ca-*
ca="no"
capath="no"
if test "$cross_compiling" != "yes" &&
test "$curl_cv_native_windows" != "yes"; then
if test "x$cross_compiling" != "xyes" -a \
"x$curl_cv_native_windows" != "xyes"; then
dnl NOT cross-compiling and...
dnl neither of the --with-ca-* options are provided
if test "x$want_ca" = "xunset"; then
dnl the path we previously would have installed the curl CA bundle
dnl to, and thus we now check for an already existing cert in that
dnl place in case we find no other
if test "x$prefix" != "xNONE"; then
if test "x$prefix" != xNONE; then
cac="${prefix}/share/curl/curl-ca-bundle.crt"
else
cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
@ -1179,7 +1211,7 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]),
check_capath="$capath"
fi
if test -n "$check_capath"; then
if test ! -z "$check_capath"; then
for a in "$check_capath"; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
if test "x$capath" = "xno"; then
@ -1213,16 +1245,16 @@ AS_HELP_STRING([--without-ca-path], [Do not use a default CA path]),
AC_MSG_CHECKING([whether to use OpenSSL's built-in CA store])
AC_ARG_WITH(ca-fallback,
AS_HELP_STRING([--with-ca-fallback], [Use OpenSSL's built-in CA store])
AS_HELP_STRING([--without-ca-fallback], [Do not use OpenSSL's built-in CA store]),
AS_HELP_STRING([--without-ca-fallback], [Don't use OpenSSL's built-in CA store]),
[
if test "x$with_ca_fallback" != "xyes" && test "x$with_ca_fallback" != "xno"; then
if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then
AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter])
fi
],
[ with_ca_fallback="no"])
AC_MSG_RESULT([$with_ca_fallback])
if test "x$with_ca_fallback" = "xyes"; then
if test "$OPENSSL_ENABLED" != "1"; then
if test "x$OPENSSL_ENABLED" != "x1"; then
AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL])
fi
AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use OpenSSL's built-in CA store])
@ -1241,7 +1273,7 @@ AC_DEFUN([CURL_CHECK_CA_EMBED], [
AC_ARG_WITH(ca-embed,
AS_HELP_STRING([--with-ca-embed=FILE],
[Absolute path to a file containing CA certificates to embed in the curl tool (example: /etc/ca-bundle.crt)])
AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the curl tool]),
AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle in the curl tool]),
[
want_ca_embed="$withval"
if test "x$want_ca_embed" = "xyes"; then
@ -1251,7 +1283,7 @@ AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the cu
[ want_ca_embed="unset" ])
CURL_CA_EMBED=''
if test "x$want_ca_embed" != "xno" && test "x$want_ca_embed" != "xunset" && test -f "$want_ca_embed"; then
if test "x$want_ca_embed" != "xno" -a "x$want_ca_embed" != "xunset" -a -f "$want_ca_embed"; then
if test -n "$PERL"; then
CURL_CA_EMBED="$want_ca_embed"
AC_SUBST(CURL_CA_EMBED)
@ -1265,15 +1297,47 @@ AS_HELP_STRING([--without-ca-embed], [Do not embed a default CA bundle in the cu
fi
])
dnl CURL_CHECK_WIN32_LARGEFILE
dnl -------------------------------------------------
dnl Check if curl's Win32 large file will be used
AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
if test "$curl_cv_native_windows" = 'yes'; then
AC_MSG_CHECKING([whether build target supports Win32 large files])
if test "$curl_cv_wince" = 'yes'; then
dnl Windows CE does not support large files
curl_win32_has_largefile='no'
else
dnl All mingw-w64 versions support large files
curl_win32_has_largefile='yes'
fi
case "$curl_win32_has_largefile" in
yes)
if test x"$enable_largefile" = 'xno'; then
AC_MSG_RESULT([yes (large file disabled)])
else
AC_MSG_RESULT([yes (large file enabled)])
AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1,
[Define to 1 if you are building a Windows target with large file support.])
fi
;;
*)
AC_MSG_RESULT([no])
;;
esac
fi
])
dnl CURL_CHECK_WIN32_CRYPTO
dnl -------------------------------------------------
dnl Check if curl's Win32 crypto lib can be used
AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
AC_MSG_CHECKING([whether build target supports Win32 crypto API])
curl_win32_crypto_api="no"
if test "$curl_cv_native_windows" = "yes" && test "$curl_cv_winuwp" != "yes"; then
if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#undef inline
@ -1306,65 +1370,22 @@ AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [
esac
])
dnl CURL_EXPORT_PCDIR ($pcdir, [$additive])
dnl CURL_EXPORT_PCDIR ($pcdir)
dnl ------------------------
dnl if $pcdir is not empty, set PKG_CONFIG_LIBDIR to $pcdir and export.
dnl if $additive is set, extend PKG_CONFIG_PATH instead, by prepending $pcdir
dnl to it, to ensure that system locations are still checked. This is
dnl necessary for modules that depend on modules residing there
dnl (e.g. gnutls.pc).
dnl if $pcdir is not empty, set PKG_CONFIG_LIBDIR to $pcdir and export
dnl
dnl we need this macro to limit/expand search locations to/with a custom
dnl configured one.
dnl we need this macro since pkg-config distinguishes among empty and unset
dnl variable while checking PKG_CONFIG_LIBDIR
dnl
AC_DEFUN([CURL_EXPORT_PCDIR], [
if test -n "$1"; then
if test -n "$2"; then
dnl honor system locations
PKG_CONFIG_PATH="$1${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
else
dnl ignore and override system locations
PKG_CONFIG_LIBDIR="$1"
export PKG_CONFIG_LIBDIR
fi
PKG_CONFIG_LIBDIR="$1"
export PKG_CONFIG_LIBDIR
fi
])
dnl CURL_TRACE_PCDIR ($module, [$pcdir], [$additive])
dnl ------------------------
dnl show pkg-config module lookup details, along with a detailed errors
dnl message in case of failure. Supports both pkg-config and pkgconf.
dnl
AC_DEFUN([CURL_TRACE_PCDIR], [
dnl Example pkgconf line:
dnl libpkgconf/pkg.c:746 [pkgconf_pkg_t *pkgconf_pkg_try_specific_path(pkgconf_client_t *, [...]*)]:
dnl trying path: /usr/local/lib/pkgconfig for libngtcp2_crypto_gnutls
dnl Rest of strings are for catching classic pkg-config lines.
trc=`CURL_EXPORT_PCDIR([$2], [$3])
if test -n "$PKG_CONFIG_LIBDIR"; then
echo "PKG_CONFIG_LIBDIR: '$PKG_CONFIG_LIBDIR'"
fi
if test -n "$PKG_CONFIG_PATH"; then
echo "PKG_CONFIG_PATH: '$PKG_CONFIG_PATH'"
fi
$PKGCONFIG --exists --debug $1 2>&1 | \
$EGREP '(trying path:|Adding directory|Looking for|Scanning directory|Cannot open directory)' | \
$SED 's/^.*trying path:/trying path:/'`
msg=`CURL_EXPORT_PCDIR([$2], [$3])
$PKGCONFIG --exists --print-errors $1 2>&1`
if test -n "$msg"; then
trc=`echo "$trc"; echo '==== error:'; echo "$msg"`
fi
AC_MSG_NOTICE([pkg-config --exists $1 trace:
---- begin
${trc}
---- end])
])
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir], [$additive])
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir])
dnl ------------------------
dnl search for the pkg-config tool. Set the PKGCONFIG variable to hold the
dnl path to it, or 'no' if not found/present.
@ -1383,25 +1404,19 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
[$PATH:/usr/bin:/usr/local/bin])
fi
if test "$PKGCONFIG" != "no"; then
if test "x$PKGCONFIG" != "xno"; then
AC_MSG_CHECKING([for $1 options with pkg-config])
dnl ask pkg-config about $1
itexists=`CURL_EXPORT_PCDIR([$2], [$3])
itexists=`CURL_EXPORT_PCDIR([$2]) dnl
$PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1`
if test -z "$itexists"; then
dnl pkg-config does not have info about the given module! set the
dnl variable to 'no'
AC_MSG_RESULT([no])
if test -n "$CURL_TRACE_PKG_CONFIG$CURL_CI"; then
CURL_TRACE_PCDIR([$1], [$2], [$3])
fi
PKGCONFIG="no"
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([found])
if test -n "$CURL_TRACE_PKG_CONFIG"; then
CURL_TRACE_PCDIR([$1], [$2], [$3])
fi
fi
fi
])
@ -1415,7 +1430,7 @@ dnl when the configure script runs. For portability reasons, test
dnl harness needs information on how to run the C preprocessor.
AC_DEFUN([CURL_PREPARE_CONFIGUREHELP_PM], [
AC_REQUIRE([AC_PROG_CPP])
AC_REQUIRE([AC_PROG_CPP])dnl
tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null`
if test -z "$tmp_cpp"; then
tmp_cpp='cpp'
@ -1430,7 +1445,7 @@ dnl Save build info for test runner to pick up and log
AC_DEFUN([CURL_PREPARE_BUILDINFO], [
curl_pflags=""
if test "$curl_cv_apple" = "yes"; then
if test "$curl_cv_apple" = 'yes'; then
curl_pflags="${curl_pflags} APPLE"
fi
case $host in
@ -1450,31 +1465,37 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
fi
;;
esac
if test "$curl_cv_native_windows" = "yes"; then
if test "$curl_cv_native_windows" = 'yes'; then
curl_pflags="${curl_pflags} WIN32"
fi
if test "$curl_cv_winuwp" = "yes"; then
if test "$curl_cv_wince" = 'yes'; then
curl_pflags="${curl_pflags} WINCE"
fi
if test "$curl_cv_winuwp" = 'yes'; then
curl_pflags="${curl_pflags} UWP"
fi
case $host_os in
cygwin*|msys*) curl_pflags="${curl_pflags} CYGWIN";;
case $host in
*-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*)
curl_pflags="${curl_pflags} UNIX";;
esac
case $host in
*-*-*bsd*)
curl_pflags="${curl_pflags} BSD";;
esac
if test "$curl_cv_cygwin" = 'yes'; then
curl_pflags="${curl_pflags} CYGWIN"
fi
case $host_os in
msdos*) curl_pflags="${curl_pflags} DOS";;
amiga*) curl_pflags="${curl_pflags} AMIGA";;
esac
if test "$compiler_id" = "GNU_C"; then
if test "x$compiler_id" = 'xGNU_C'; then
curl_pflags="${curl_pflags} GCC"
fi
if test "$compiler_id" = "APPLECLANG"; then
curl_pflags="${curl_pflags} APPLE-CLANG"
elif test "$compiler_id" = "CLANG"; then
curl_pflags="${curl_pflags} LLVM-CLANG"
fi
case $host_os in
mingw*) curl_pflags="${curl_pflags} MINGW";;
esac
if test "$cross_compiling" = "yes"; then
if test "x$cross_compiling" = 'xyes'; then
curl_pflags="${curl_pflags} CROSS"
fi
squeeze curl_pflags
@ -1516,7 +1537,7 @@ TEST EINVAL TEST
AC_MSG_RESULT([$cpp])
dnl we need cpp -P so check if it works then
if test "$cpp" = "yes"; then
if test "x$cpp" = "xyes"; then
AC_MSG_CHECKING([if cpp -P works])
OLDCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -P"
@ -1526,18 +1547,18 @@ TEST EINVAL TEST
], [cpp_p=yes], [cpp_p=no])
AC_MSG_RESULT([$cpp_p])
if test "$cpp_p" = "no"; then
if test "x$cpp_p" = "xno"; then
AC_MSG_WARN([failed to figure out cpp -P alternative])
dnl without -P
# without -P
CPPPFLAG=""
else
dnl with -P
# with -P
CPPPFLAG="-P"
fi
dnl restore CPPFLAGS
CPPFLAGS=$OLDCPPFLAGS
else
dnl without -P
# without -P
CPPPFLAG=""
fi
])
@ -1546,7 +1567,7 @@ TEST EINVAL TEST
dnl CURL_DARWIN_CFLAGS
dnl
dnl Set -Werror=partial-availability to detect possible breaking code
dnl with low deployment targets.
dnl with very low deployment targets.
dnl
AC_DEFUN([CURL_DARWIN_CFLAGS], [
@ -1563,7 +1584,7 @@ AC_DEFUN([CURL_DARWIN_CFLAGS], [
dnl CURL_SUPPORTS_BUILTIN_AVAILABLE
dnl
dnl Check to see if the compiler supports __builtin_available. This built-in
dnl compiler function first appeared in Apple LLVM 9.0.0. It is so new that, at
dnl compiler function first appeared in Apple LLVM 9.0.0. It's so new that, at
dnl the time this macro was written, the function was not yet documented. Its
dnl purpose is to return true if the code is running under a certain OS version
dnl or later.

View file

@ -28,83 +28,98 @@ set -eux; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
# build
if [ -n "${CMAKE_GENERATOR:-}" ]; then
case "${TARGET:-}" in
*Win32) openssl_suffix='-Win32';;
*) openssl_suffix='-Win64';;
esac
PRJ_CFG='Debug'
[[ "${APPVEYOR_JOB_NAME}" = *'Release'* ]] && PRJ_CFG='Release'
# Configure OpenSSL
case "${CMAKE_GENERATE:-}" in
*Win32*) openssl_suffix='-Win32';;
*) openssl_suffix='-Win64';;
esac
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
openssl_root_win="C:/OpenSSL-v35${openssl_suffix}"
openssl_root="$(cygpath "${openssl_root_win}")"
elif [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2019' ]; then
openssl_root_win="C:/OpenSSL-v30${openssl_suffix}"
openssl_root="$(cygpath "${openssl_root_win}")"
fi
# Install custom cmake version
if [ -n "${CMAKE_VERSION:-}" ]; then
cmake_ver="$(printf '%02d%02d' \
"$(echo "${CMAKE_VERSION}" | cut -f1 -d.)" \
"$(echo "${CMAKE_VERSION}" | cut -f2 -d.)")"
if [ "${cmake_ver}" -ge '0320' ]; then
fn="cmake-${CMAKE_VERSION}-windows-x86_64"
else
fn="cmake-${CMAKE_VERSION}-win64-x64"
fi
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.zip" --output pkg.bin
sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${CMAKE_SHA256}" && 7z x -y pkg.bin >/dev/null && rm -f pkg.bin
PATH="$PWD/${fn}/bin:$PATH"
fi
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
openssl_root_win="C:/OpenSSL-v34${openssl_suffix}"
else
openssl_root_win="C:/OpenSSL-v111${openssl_suffix}"
fi
openssl_root="$(cygpath "${openssl_root_win}")"
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
# Set env CHKPREFILL to the value '_chkprefill' to compare feature detection
# results with and without the pre-fill feature. They have to match.
for _chkprefill in '' ${CHKPREFILL:-}; do
options=''
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
[[ "${CMAKE_GENERATE:-}" = *'-A ARM64'* ]] && SKIP_RUN='ARM64 architecture'
[[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
[[ "${TARGET}" = *'ARM64'* ]] && SKIP_RUN='ARM64 architecture'
[ -n "${TOOLSET:-}" ] && options+=" -T ${TOOLSET}"
[ -n "${WINTARGET:-}" ] && options+=" -DCURL_TARGET_WINDOWS_VERSION=${WINTARGET}"
[ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
[ -n "${CURLDEBUG:-}" ] && options+=" -DENABLE_CURLDEBUG=${CURLDEBUG}"
if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ]; then
mkdir "_bld${_chkprefill}"
cd "_bld${_chkprefill}"
options+=' ..'
root='..'
else
options+=" -B _bld${_chkprefill}"
options+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false'
options+=" -DCMAKE_UNITY_BUILD=${UNITY}"
root='.'
fi
# shellcheck disable=SC2086
time cmake -B "_bld${_chkprefill}" \
-DENABLE_DEBUG=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_VS_GLOBALS=TrackFileAccess=false \
time cmake -G "${PRJ_GEN}" ${TARGET} \
-DCURL_WERROR=ON \
-DBUILD_SHARED_LIBS="${SHARED}" \
-DCURL_STATIC_CRT=ON \
-DCURL_DROP_UNUSED=ON \
-DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
${CMAKE_GENERATE:-} \
-DENABLE_DEBUG="${DEBUG}" \
-DENABLE_UNICODE="${ENABLE_UNICODE}" \
-DHTTP_ONLY="${HTTP_ONLY}" \
-DCURL_USE_SCHANNEL="${SCHANNEL}" \
-DCURL_USE_OPENSSL="${OPENSSL}" \
-DCURL_USE_LIBPSL=OFF \
${options} \
|| { cat _bld/CMakeFiles/CMake* 2>/dev/null; false; }
|| { cat ${root}/_bld/CMakeFiles/CMake* 2>/dev/null; false; }
[ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ] && cd ..
done
if [ -d _bld_chkprefill ] && ! diff -u _bld/lib/curl_config.h _bld_chkprefill/lib/curl_config.h; then
cat _bld_chkprefill/CMakeFiles/CMake* 2>/dev/null || true
false
fi
echo 'curl_config.h'; grep -F '#define' _bld/lib/curl_config.h | sort || true
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2
[[ "${CMAKE_GENERATE:-}" != *'-DBUILD_SHARED_LIBS=OFF'* ]] && PATH="$PWD/_bld/lib/${PRJ_CFG}:$PATH"
[[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]] && { PATH="${openssl_root}:$PATH"; cp "${openssl_root}"/*.dll "_bld/src/${PRJ_CFG}"; }
# shellcheck disable=SC2086
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 -- ${BUILD_OPT:-}
[ "${SHARED}" = 'ON' ] && PATH="$PWD/_bld/lib/${PRJ_CFG}:$PATH"
[ "${OPENSSL}" = 'ON' ] && { PATH="${openssl_root}:$PATH"; cp "${openssl_root}"/*.dll "_bld/src/${PRJ_CFG}"; }
curl="_bld/src/${PRJ_CFG}/curl.exe"
else
elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then
(
cd projects/Windows
cd projects
./generate.bat "${VC_VERSION}"
msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "-property:Platform=${PLAT}" "${VC_VERSION}/curl-all.sln"
msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "Windows/${VC_VERSION}/curl-all.sln"
)
[ "${PLAT}" = 'x64' ] && platdir='Win64' || platdir='Win32'
[[ "${PRJ_CFG}" = *'Debug'* ]] && binsuffix='d' || binsuffix=''
curl="build/${platdir}/${VC_VERSION}/${PRJ_CFG}/curl${binsuffix}.exe"
curl="build/Win32/${VC_VERSION}/${PRJ_CFG}/curld.exe"
elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2015' ]; then
(
cd winbuild
cat << EOF > _make.bat
call "C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/SetEnv.cmd" /x64
call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" x86_amd64
nmake -f Makefile.vc mode=dll VC=14 "SSL_PATH=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE} WINBUILD_ACKNOWLEDGE_DEPRECATED=yes
EOF
./_make.bat
rm _make.bat
)
curl="builds/libcurl-vc14-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe"
elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2017' ]; then
(
cd winbuild
cat << EOF > _make.bat
call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat"
nmake -f Makefile.vc mode=dll VC=14.10 "SSL_PATH=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE} WINBUILD_ACKNOWLEDGE_DEPRECATED=yes
EOF
./_make.bat
rm _make.bat
)
curl="builds/libcurl-vc14.10-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe"
fi
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -print0 | grep -z curl | xargs -0 file --
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -print0 | grep -z curl | xargs -0 stat -c '%10s bytes: %n' --
find . \( -name '*.exe' -o -name '*.dll' -o -name '*.lib' -o -name '*.pdb' \) -exec file '{}' \;
if [ -z "${SKIP_RUN:-}" ]; then
"${curl}" --disable --version
else
@ -113,19 +128,42 @@ fi
# build tests
if [ -n "${CMAKE_GENERATOR:-}" ] && [[ "${APPVEYOR_JOB_NAME}" = *'Build-tests'* ]]; then
if [ "${TFLAGS}" != 'skipall' ] && \
[ "${BUILD_SYSTEM}" = 'CMake' ]; then
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target testdeps
fi
# run tests
if [ "${TFLAGS}" != 'skipall' ] && \
[ "${TFLAGS}" != 'skiprun' ]; then
if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
elif [ -x "$(cygpath 'C:/msys64/usr/bin/curl.exe')" ]; then
TFLAGS+=" -ac $(cygpath 'C:/msys64/usr/bin/curl.exe')"
fi
TFLAGS+=' -j0'
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
time cmake --build _bld --config "${PRJ_CFG}" --target test-ci
else
(
TFLAGS="-a -p !flaky -r ${TFLAGS}"
cd _bld/tests
time ./runtests.pl
)
fi
fi
# build examples
if [ -n "${CMAKE_GENERATOR:-}" ] && [[ "${APPVEYOR_JOB_NAME}" = *'examples'* ]]; then
if [ "${EXAMPLES}" = 'ON' ] && \
[ "${BUILD_SYSTEM}" = 'CMake' ]; then
time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target curl-examples-build
fi
# disk space used
du -sh .; echo; du -sh -t 250KB ./*
if [ -n "${CMAKE_GENERATOR:-}" ]; then
if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
echo; du -h -t 250KB _bld
fi

View file

@ -31,92 +31,179 @@
version: 7.50.0.{build}
environment:
BUILD_SYSTEM: CMake
UNITY: 'ON'
OPENSSL: 'OFF'
SCHANNEL: 'OFF'
ENABLE_UNICODE: 'OFF'
DEBUG: 'ON'
SHARED: 'OFF'
HTTP_ONLY: 'OFF'
TFLAGS: 'skiprun'
EXAMPLES: 'OFF'
matrix:
# CMake Visual Studio builds
- job_name: 'CM VS2022, Release, x64, OpenSSL 3.5, Shared, Build-tests'
# generated CMake-based Visual Studio builds
- job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.4, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON'
- job_name: 'CM VS2022, Release, arm64, Schannel, Static, !DEBUGBUILD, Build-tests'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Release
OPENSSL: 'ON'
SHARED: 'ON'
- job_name: 'CMake, VS2022, Release, arm64, Schannel, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A ARM64 -DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=OFF'
- job_name: 'CM VS2010, Debug, x64, Schannel, Shared, Build-tests & examples'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
CMAKE_VERSION: 3.18.4
CMAKE_SHA256: a932bc0c8ee79f1003204466c525b38a840424d4ae29f9e5fb88959116f2407d
CMAKE_GENERATOR: 'Visual Studio 10 2010'
CMAKE_GENERATE: '-A x64'
- job_name: 'CM VS2012, Release, x86, Schannel, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
CMAKE_VERSION: 3.21.7
CMAKE_SHA256: 4c4840e2dc2bf82e8a16081ff506bba54f3a228b91ce36317129fed4035ef2e3
CMAKE_GENERATOR: 'Visual Studio 11 2012'
CMAKE_GENERATE: '-A Win32'
- job_name: 'CM VS2013, Debug, x64, Schannel, Shared'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
CMAKE_VERSION: 3.18.4
CMAKE_SHA256: a932bc0c8ee79f1003204466c525b38a840424d4ae29f9e5fb88959116f2407d
CMAKE_GENERATOR: 'Visual Studio 12 2013'
CMAKE_GENERATE: '-A x64'
- job_name: 'CM VS2015, Debug, x64, Schannel, Static'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
CMAKE_VERSION: 3.19.8
CMAKE_SHA256: 2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380
CMAKE_GENERATOR: 'Visual Studio 14 2015'
CMAKE_GENERATE: '-A x64 -DBUILD_SHARED_LIBS=OFF'
- job_name: 'CM VS2017, Debug, x64, Schannel, Shared'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
CMAKE_VERSION: 3.20.6
CMAKE_SHA256: f240a38c964712aac474644b3ba21bdc2b4e8d5e31179f67bd2e6f45fa349419
CMAKE_GENERATOR: 'Visual Studio 15 2017'
CMAKE_GENERATE: '-A x64'
- job_name: 'CM VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, !verbose, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019'
CMAKE_GENERATOR: 'Visual Studio 16 2019'
CMAKE_GENERATE: '-A x64 -DCURL_USE_OPENSSL=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON'
- job_name: 'CM VS2022, Debug, x64, OpenSSL 3.5 + Schannel, Static, Unicode, Build-tests & examples, clang-cl'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -T ClangCl -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=ON'
- job_name: 'CM VS2022, Release, x64, Schannel, Shared, Unicode, !DEBUGBUILD, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
ENABLE_UNICODE: 'ON'
CMAKE_GENERATE: '-A x64 -DENABLE_UNICODE=ON -DENABLE_DEBUG=OFF'
- job_name: 'CM VS2022, Debug, x64, !ssl, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=OFF'
- job_name: 'CM VS2022, Debug, x64, !ssl, Static, HTTP-only, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
CMAKE_GENERATE: '-A x64 -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=OFF -DHTTP_ONLY=ON'
# VisualStudioSolution builds
- job_name: 'VisualStudioSolution VS2010, Release, x86, Schannel'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A ARM64'
PRJ_CFG: Release
SCHANNEL: 'ON'
DEBUG: 'OFF'
CURLDEBUG: 'ON'
- job_name: 'CMake, VS2010, Debug, x64, Schannel, Shared, Build-tests & examples, XP'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2013'
PRJ_CFG: 'DLL Release - DLL Windows SSPI - DLL WinIDN'
PLAT: 'Win32'
VC_VERSION: VC10
- job_name: 'VisualStudioSolution VS2013, Debug, x64, Schannel'
PRJ_GEN: 'Visual Studio 10 2010'
TARGET: '-A x64'
WINTARGET: 0x0501 # Windows XP
PRJ_CFG: Debug
SCHANNEL: 'ON'
SHARED: 'ON'
EXAMPLES: 'ON'
- job_name: 'CMake, VS2012, Release, x86, OpenSSL 1.1.1 + Schannel, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 11 2012'
TARGET: '-A Win32'
PRJ_CFG: Release
OPENSSL: 'ON'
SCHANNEL: 'ON'
SHARED: 'ON'
- job_name: 'CMake, VS2013, Debug, x64, OpenSSL 1.1.1, Shared, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 12 2013'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SHARED: 'ON'
TFLAGS: 'skipall'
- job_name: 'CMake, VS2015, Debug, x64, OpenSSL 1.1.1, Static, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
PRJ_GEN: 'Visual Studio 14 2015'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
TFLAGS: 'skipall'
- job_name: 'CMake, VS2017, Debug, x64, OpenSSL 1.1.1, Shared, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
PRJ_GEN: 'Visual Studio 15 2017'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SHARED: 'ON'
TFLAGS: 'skipall'
- job_name: 'CMake, VS2019, Debug, x64, OpenSSL 1.1.1 + Schannel, Shared, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019'
PRJ_GEN: 'Visual Studio 16 2019'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SCHANNEL: 'ON'
SHARED: 'ON'
- job_name: 'CMake, VS2022, Debug, x64, OpenSSL 3.4 + Schannel, Static, Unicode, Build-tests & examples, clang-cl'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
OPENSSL: 'ON'
SCHANNEL: 'ON'
ENABLE_UNICODE: 'ON'
EXAMPLES: 'ON'
TOOLSET: 'ClangCl'
- job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
SCHANNEL: 'ON'
ENABLE_UNICODE: 'ON'
- job_name: 'CMake, VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBUILD, no-CURLDEBUG, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Release
SCHANNEL: 'ON'
ENABLE_UNICODE: 'ON'
SHARED: 'ON'
CURLDEBUG: 'OFF'
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
PRJ_GEN: 'Visual Studio 17 2022'
TARGET: '-A x64'
PRJ_CFG: Debug
HTTP_ONLY: 'ON'
# winbuild-based builds
- job_name: 'winbuild, VS2015, Debug, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2015, Release, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2017, Debug, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2017, Release, x64, OpenSSL 1.1.1, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'no'
- job_name: 'winbuild, VS2015, Debug, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'yes'
- job_name: 'winbuild, VS2015, Release, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: winbuild_vs2015
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'yes'
- job_name: 'winbuild, VS2017, Debug, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'yes'
PATHPART: debug
ENABLE_UNICODE: 'yes'
- job_name: 'winbuild, VS2017, Release, x64, OpenSSL 1.1.1, Unicode, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
BUILD_SYSTEM: winbuild_vs2017
DEBUG: 'no'
PATHPART: release
ENABLE_UNICODE: 'yes'
# generated VisualStudioSolution-based builds
- job_name: 'VisualStudioSolution, VS2013, Debug, x86, Schannel, Build-only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
BUILD_SYSTEM: VisualStudioSolution
PRJ_CFG: 'DLL Debug - DLL Windows SSPI - DLL WinIDN'
PLAT: 'x64'
VC_VERSION: VC12
install:
@ -138,13 +225,11 @@ skip_commits:
- '.circleci/*'
- '.github/**/*'
- 'Dockerfile'
- 'projects/OS400/*'
- 'projects/vms/*'
- 'packages/**/*'
- 'plan9/**/*'
#artifacts:
# - path: '**/curl.exe'
# name: curl
# - path: '**/*.dll'
# name: libcurl dll
# - path: '**/*.lib'
# name: libcurl lib

8
buildconf Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
echo "*** Do not use buildconf. Instead, just use: autoreconf -fi" >&2
exec ${AUTORECONF:-autoreconf} -fi "${@}"

File diff suppressed because it is too large Load diff

View file

@ -149,7 +149,7 @@ while test "$#" -gt 0; do
;;
--libs)
if test "@libdir@" != '/usr/lib' && test "@libdir@" != '/usr/lib64'; then
if test "@libdir@" != '/usr/lib' -a "@libdir@" != '/usr/lib64'; then
curllibdir="-L@libdir@ "
else
curllibdir=''

Some files were not shown because too many files have changed in this diff Show more