Compare commits

..

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

4227 changed files with 145828 additions and 176608 deletions

View file

@ -24,7 +24,7 @@
# View these jobs in the browser: https://app.circleci.com/pipelines/github/curl/curl # View these jobs in the browser: https://app.circleci.com/pipelines/github/curl/curl
# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/reference/configuration-reference/ # Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/configuration-reference/
version: 2.1 version: 2.1
commands: commands:
@ -38,32 +38,67 @@ commands:
steps: steps:
- run: - run:
command: | command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update && sudo apt-get install -y libssh-dev sudo apt-get update && sudo apt-get install -y libssh-dev
install-deps: install-deps:
steps: steps:
- run: - run:
command: | command: |
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip libpsl-dev
python3 -m venv ~/venv sudo python3 -m pip install impacket
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
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: configure:
steps: steps:
- run: - run:
command: | command: |
autoreconf -fi 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-openssl \
|| { tail -1000 config.log; false; } || { 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: configure-no-proxy:
steps: steps:
- run: - run:
command: | command: |
autoreconf -fi 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 \ --with-openssl --disable-proxy \
|| { tail -1000 config.log; false; } || { tail -1000 config.log; false; }
@ -72,7 +107,7 @@ commands:
- run: - run:
command: | command: |
autoreconf -fi 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 \ --with-openssl --with-libssh \
|| { tail -1000 config.log; false; } || { tail -1000 config.log; false; }
@ -81,40 +116,42 @@ commands:
- run: - run:
command: | command: |
autoreconf -fi 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 \ --with-openssl --enable-ares \
|| { tail -1000 config.log; false; } || { 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: configure-cares-debug:
steps: steps:
- run: - run:
command: | command: |
autoreconf -fi 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 \ --with-openssl --enable-ares \
|| { tail -1000 config.log; false; } || { tail -1000 config.log; false; }
build: build:
steps: steps:
- run: make -j3 V=1 - run: make -j3 V=1
- run: src/curl --disable --version
- run: make -j3 V=1 examples - run: make -j3 V=1 examples
test: test:
steps: steps:
- run: - run: make -j3 V=1 test-ci TFLAGS='-j14'
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'
executors: executors:
ubuntu: ubuntu:
machine: machine:
image: ubuntu-2204:2026.05.1 image: ubuntu-2004:2024.01.1
jobs: jobs:
basic: basic:
@ -126,6 +163,24 @@ jobs:
- build - build
- test - 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: no-proxy:
executor: ubuntu executor: ubuntu
steps: steps:
@ -157,7 +212,7 @@ jobs:
arm: arm:
machine: machine:
image: ubuntu-2204:2026.05.1 image: ubuntu-2004:2024.01.1
resource_class: arm.medium resource_class: arm.medium
steps: steps:
- checkout - checkout
@ -168,7 +223,7 @@ jobs:
arm-cares: arm-cares:
machine: machine:
image: ubuntu-2204:2026.05.1 image: ubuntu-2004:2024.01.1
resource_class: arm.medium resource_class: arm.medium
steps: steps:
- checkout - checkout
@ -195,6 +250,14 @@ workflows:
jobs: jobs:
- no-proxy - no-proxy
openssl-no-verbose:
jobs:
- no-verbose
wolfssl-wolfssh:
jobs:
- wolfssh
arm-openssl: arm-openssl:
jobs: jobs:
- arm - 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 # SPDX-License-Identifier: curl
buildconf eol=lf
configure.ac eol=lf configure.ac eol=lf
*.m4 eol=lf *.m4 eol=lf
*.in eol=lf *.in eol=lf

View file

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

View file

@ -13,18 +13,12 @@ body:
Only file bugs here! Ask questions on the mailing lists https://curl.se/mail/ 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
- type: markdown There are collections of known issues to be aware of:
attributes:
value: "
> [!IMPORTANT]
> If you cannot understand or explain your work without using - https://curl.se/docs/knownbugs.html
Artificial Intelligence (AI) then do not file here. Do not paste - https://curl.se/docs/todo.html
massive AI generated explanations. We accept the use of AI as long as
it is digestible. Please explain your issues or improvements briefly
and clearly in your own human voice."
- type: textarea - type: textarea
id: reproducer id: reproducer
@ -46,7 +40,7 @@ body:
label: curl/libcurl version label: curl/libcurl version
description: | description: |
Please paste the output of `curl -V` here. Please paste the output of `curl -V` here.
placeholder: 'curl 8.18.0' placeholder: 'curl 8.2.0'
validations: validations:
required: true required: true

View file

@ -14,17 +14,6 @@ body:
Only file documentation bugs here! Ask questions on the mailing lists https://curl.se/mail/ Only file documentation bugs here! Ask questions on the mailing lists https://curl.se/mail/
- type: markdown
attributes:
value: "
> [!IMPORTANT]
> If you cannot understand or explain your work without using
Artificial Intelligence (AI) then do not file here. Do not paste
massive AI generated explanations. We accept the use of AI as long as
it is digestible. Please explain your issues or improvements briefly
and clearly in your own human voice."
- type: textarea - type: textarea
id: source id: source
attributes: attributes:

View file

@ -2,37 +2,9 @@
# #
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
# https://docs.github.com/code-security/dependabot/working-with-dependabot/dependabot-options-reference
version: 2 version: 2
updates: updates:
- package-ecosystem: 'github-actions' - package-ecosystem: 'github-actions'
directory: '/' directory: '/'
schedule: schedule:
interval: 'monthly' interval: 'weekly'
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:'

149
.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 # 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 # 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 # 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). # 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. # N.B. any-glob-to-all-files is misnamed; it acts like one-glob-to-all-files.
@ -28,22 +28,16 @@ appleOS:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
.github/workflows/macos.yml,\ .github/workflows/macos.yml,\
lib/config-mac.h,\ lib/config-mac.h,\
lib/macos*,\ lib/macos*\
lib/vtls/apple.*,\
m4/curl-apple-sectrust.m4\
}" }"
authentication: authentication:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
CMake/FindGSS.cmake,\ docs/mk-ca-bundle.1,\
CMake/FindLibgsasl.cmake,\
docs/cmdline-opts/httpsig*,\
docs/internals/CREDENTIALS.md,\
docs/libcurl/opts/CURLINFO_HTTPAUTH*,\ docs/libcurl/opts/CURLINFO_HTTPAUTH*,\
docs/libcurl/opts/CURLINFO_PROXYAUTH*,\ docs/libcurl/opts/CURLINFO_PROXYAUTH*,\
docs/libcurl/opts/CURLOPT_HTTPSIG*,\
docs/libcurl/opts/CURLOPT_KRB*,\ docs/libcurl/opts/CURLOPT_KRB*,\
docs/libcurl/opts/CURLOPT_SASL*,\ docs/libcurl/opts/CURLOPT_SASL*,\
docs/libcurl/opts/CURLOPT_SERVICE_NAME*,\ docs/libcurl/opts/CURLOPT_SERVICE_NAME*,\
@ -51,15 +45,12 @@ authentication:
docs/libcurl/opts/CURLOPT_USERPWD*,\ docs/libcurl/opts/CURLOPT_USERPWD*,\
docs/libcurl/opts/CURLOPT_XOAUTH*,\ docs/libcurl/opts/CURLOPT_XOAUTH*,\
lib/*gssapi*,\ lib/*gssapi*,\
lib/*krb5*,\
lib/*ntlm*,\ lib/*ntlm*,\
lib/creds.*,\
lib/curl_ntlm*,\
lib/curl_sasl.*,\ lib/curl_sasl.*,\
lib/http_aws*,\ lib/http_aws*,\
lib/http_digest.*,\ lib/http_digest.*,\
lib/http_httpsig.*,\
lib/http_negotiate.*,\ lib/http_negotiate.*,\
lib/http_ntlm.*,\
lib/vauth/**\ lib/vauth/**\
}" }"
@ -71,16 +62,20 @@ build:
**/Makefile.am,\ **/Makefile.am,\
**/Makefile.inc,\ **/Makefile.inc,\
**/*.m4,\ **/*.m4,\
**/*.mk,\
*.m4,\ *.m4,\
docs/INSTALL-CMAKE.md,\ docs/INSTALL-CMAKE.md,\
lib/curl_config-cmake.h.in,\ lib/curl_config.h.cmake,\
lib/libcurl*.in,\ lib/libcurl*.in,\
CMake/**,\ CMake/**,\
CMakeLists.txt,\ CMakeLists.txt,\
configure.ac,\ configure.ac,\
m4/**,\ m4/**,\
Makefile.*,\ Makefile.*,\
packages/**,\
plan9/**,\
projects/**,\ projects/**,\
winbuild/**,\
lib/libcurl.def,\ lib/libcurl.def,\
tests/cmake/**\ tests/cmake/**\
}" }"
@ -104,8 +99,7 @@ cmake:
**/CMakeLists.txt,\ **/CMakeLists.txt,\
CMake/**,\ CMake/**,\
docs/INSTALL-CMAKE.md,\ docs/INSTALL-CMAKE.md,\
lib/curl_config-cmake.h.in,\ lib/curl_config.h.cmake,\
scripts/cmakeopts.sh,\
tests/cmake/**\ tests/cmake/**\
}" }"
@ -120,9 +114,6 @@ connecting & proxies:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-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/internals/CONNECTION-FILTERS.md,\
docs/examples/ipv6.c,\ docs/examples/ipv6.c,\
docs/libcurl/opts/CURLINFO_CONNECT*,\ docs/libcurl/opts/CURLINFO_CONNECT*,\
@ -137,8 +128,6 @@ connecting & proxies:
docs/libcurl/opts/CURLOPT_SOCKS*,\ docs/libcurl/opts/CURLOPT_SOCKS*,\
docs/libcurl/opts/CURLOPT_TCP*,\ docs/libcurl/opts/CURLOPT_TCP*,\
docs/libcurl/opts/CURLOPT_TIMEOUT*,\ docs/libcurl/opts/CURLOPT_TIMEOUT*,\
lib/cf-https-connect.*,\
lib/cf-ip-happy.*,\
lib/cf-*proxy.*,\ lib/cf-*proxy.*,\
lib/cf-socket.*,\ lib/cf-socket.*,\
lib/cfilters.*,\ lib/cfilters.*,\
@ -146,12 +135,8 @@ connecting & proxies:
lib/connect.*,\ lib/connect.*,\
lib/http_proxy.*,\ lib/http_proxy.*,\
lib/if2ip.*,\ lib/if2ip.*,\
lib/proxy.*,\ lib/noproxy.*,\
lib/socks.*,\ lib/socks.*,\
lib/vquic/*-proxy.*,\
src/tool_cb_soc.*,\
tests/http/*proxy*,\
tests/http/*socks*,\
tests/server/socksd.c\ tests/server/socksd.c\
}" }"
@ -159,7 +144,6 @@ cookies:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
CMake/FindLibpsl.cmake,\
docs/HTTP-COOKIES.md,\ docs/HTTP-COOKIES.md,\
docs/cmdline-opts/cookie*,\ docs/cmdline-opts/cookie*,\
docs/cmdline-opts/junk-session-cookies.md,\ docs/cmdline-opts/junk-session-cookies.md,\
@ -177,12 +161,11 @@ cryptography:
docs/CIPHERS.md,\ docs/CIPHERS.md,\
docs/RUSTLS.md,\ docs/RUSTLS.md,\
docs/libcurl/opts/CURLOPT_EGDSOCKET*,\ docs/libcurl/opts/CURLOPT_EGDSOCKET*,\
lib/*ed25519*,\
lib/*sha256*,\ lib/*sha256*,\
lib/*sha512*,\ lib/*sha512*,\
lib/curl_des.*,\
lib/curl_hmac.*,\ lib/curl_hmac.*,\
lib/curl_md?.*,\ lib/curl_md?.*,\
lib/curl_ntlm_core.*,\
lib/md?.*,\ lib/md?.*,\
lib/rand.*\ lib/rand.*\
}" }"
@ -200,10 +183,11 @@ documentation:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
.github/workflows/checkdocs.yml,\ .github/workflows/checkdocs.yml,\
.github/scripts/pyspelling*,\ .github/scripts/badwords.*,\
.github/scripts/requirements-docs.txt,\ .github/scripts/cd2cd,\
.github/scripts/requirements-proselint.txt,\ .github/scripts/cd2nroff,\
.github/scripts/typos*,\ .github/scripts/cdall.pl,\
.github/scripts/nroff2cd,\
.github/scripts/verify-examples.pl,\ .github/scripts/verify-examples.pl,\
.github/scripts/verify-synopsis.pl,\ .github/scripts/verify-synopsis.pl,\
**/*.md,\ **/*.md,\
@ -214,24 +198,17 @@ documentation:
LICENSES/**,\ LICENSES/**,\
README,\ README,\
RELEASE-NOTES,\ RELEASE-NOTES,\
scripts/badwords.*,\ scripts/cd*\
scripts/cd*,\
scripts/mdlinkcheck,\
scripts/nroff2cd,\
scripts/release-notes.pl\
}" }"
- all-globs-to-all-files: - all-globs-to-all-files:
# negative matches # negative matches
- '!**/CMakeLists.txt' - '!**/CMakeLists.txt'
- '!**/Makefile.am' - '!**/Makefile.am'
- '!tests/**/data*.txt'
- '!tests/**/requirements*.txt'
FTP: FTP:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
docs/cmdline-opts/ftp*,\
docs/libcurl/opts/CURLINFO_FTP*,\ docs/libcurl/opts/CURLINFO_FTP*,\
docs/libcurl/opts/CURLOPT_FTP*,\ docs/libcurl/opts/CURLOPT_FTP*,\
docs/libcurl/opts/CURLOPT_WILDCARDMATCH*,\ docs/libcurl/opts/CURLOPT_WILDCARDMATCH*,\
@ -239,10 +216,7 @@ FTP:
lib/curl_fnmatch.*,\ lib/curl_fnmatch.*,\
lib/curl_range.*,\ lib/curl_range.*,\
lib/ftp*,\ lib/ftp*,\
tests/ftp*,\ tests/ftp*\
tests/http/*ftpd*,\
tests/http/testenv/*ftpd*,\
tests/libtest/*_ftp_*\
}" }"
GOPHER: GOPHER:
@ -256,8 +230,6 @@ HTTP:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
docs/HTTPSRR.md,\
docs/HSTS.md,\
docs/examples/hsts*,\ docs/examples/hsts*,\
docs/examples/http-*,\ docs/examples/http-*,\
docs/examples/httpput*,\ docs/examples/httpput*,\
@ -265,10 +237,10 @@ HTTP:
docs/examples/*post*,\ docs/examples/*post*,\
docs/HTTP-COOKIES.md,\ docs/HTTP-COOKIES.md,\
docs/libcurl/opts/CURLINFO_COOKIE*,\ 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_REDIRECT*,\
docs/libcurl/opts/CURLINFO_REFER*,\ docs/libcurl/opts/CURLINFO_REFER*,\
docs/libcurl/opts/CURLOPT_COOKIE*,\
docs/libcurl/opts/CURLOPT_FOLLOWLOCATION*,\ docs/libcurl/opts/CURLOPT_FOLLOWLOCATION*,\
docs/libcurl/opts/CURLOPT_HSTS*,\ docs/libcurl/opts/CURLOPT_HSTS*,\
docs/libcurl/opts/CURLOPT_HTTP*,\ docs/libcurl/opts/CURLOPT_HTTP*,\
@ -307,16 +279,16 @@ HTTP/3:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
.github/workflows/http3-linux.yml,\ .github/workflows/ngtcp2*,\
.github/workflows/quiche*,\
.github/workflows/osslq*,\
CMake/FindNGHTTP3.cmake,\ CMake/FindNGHTTP3.cmake,\
CMake/FindNGTCP2.cmake,\ CMake/FindNGTCP2.cmake,\
docs/cmdline-opts/proxy-http3.md,\
docs/HTTP3.md,\ docs/HTTP3.md,\
docs/examples/http3*,\ docs/examples/http3*,\
lib/vquic/**,\ lib/vquic/**,\
tests/http3-server.pl,\ tests/http3-server.pl,\
tests/nghttpx.conf,\ tests/nghttpx.conf\
tests/http/*httpsrr*\
}" }"
IMAP: IMAP:
@ -369,7 +341,6 @@ MQTT:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
docs/internals/MQTT.md,\
lib/mqtt*,\ lib/mqtt*,\
tests/server/mqttd.c\ tests/server/mqttd.c\
}" }"
@ -378,26 +349,18 @@ name lookup:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
CMake/FindLibidn2.cmake,\
docs/cmdline-opts/doh*,\
docs/cmdline-opts/dns*,\
docs/examples/resolve.c,\ docs/examples/resolve.c,\
docs/internals/THRDPOOL-AND-QUEUE.md,\
docs/libcurl/opts/CURLINFO_NAMELOOKUP*,\ docs/libcurl/opts/CURLINFO_NAMELOOKUP*,\
docs/libcurl/opts/CURLOPT_DNS*,\ docs/libcurl/opts/CURLOPT_DNS*,\
docs/libcurl/opts/CURLOPT_DOH*,\ docs/libcurl/opts/CURLOPT_DOH*,\
docs/libcurl/opts/CURLOPT_RESOLVE*,\ docs/libcurl/opts/CURLOPT_RESOLVE*,\
lib/*addrinfo*,\ lib/asyn*,\
lib/curl_gethostname.*,\ lib/curl_gethostname.*,\
lib/doh*,\
lib/host*,\
lib/idn*,\ lib/idn*,\
lib/inet_pton.*,\
lib/socketpair*,\ lib/socketpair*,\
lib/thrdpool.*,\
lib/thrdqueue.*,\
lib/vdns/*,\
tests/http/testenv/dnsd.*,\
tests/http/*httpsrr*,\
tests/http/*resolve.py,\
tests/server/dnsd.c,\
tests/server/resolve.c\ tests/server/resolve.c\
}" }"
@ -409,6 +372,14 @@ POP3:
lib/pop3.*\ lib/pop3.*\
}" }"
RTMP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibrtmp.cmake,\
lib/curl_rtmp.*\
}"
RTSP: RTSP:
- all: - all:
- changed-files: - changed-files:
@ -424,17 +395,12 @@ SCP/SFTP:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
CMake/FindLibssh.cmake,\
CMake/FindLibssh2.cmake,\ CMake/FindLibssh2.cmake,\
docs/cmdline-opts/knownhosts.md,\
docs/libcurl/opts/CURLOPT_SSH*,\ docs/libcurl/opts/CURLOPT_SSH*,\
docs/examples/sftp*,\ docs/examples/sftp*,\
lib/vssh/**,\ lib/vssh/**,\
tests/sshhelp.pm,\ tests/sshhelp.pm,\
tests/sshserver.pl,\ tests/sshserver.pl\
tests/http/*scp*,\
tests/http/*sftp*,\
tests/http/testenv/sshd.py\
}" }"
script: script:
@ -444,9 +410,8 @@ script:
**/*.pl,\ **/*.pl,\
**/*.sh,\ **/*.sh,\
curl-config.in,\ curl-config.in,\
docs/curl-config.md,\ docs/curl-config.1,\
docs/mk-ca-bundle.md,\ docs/mk-ca-bundle.1,\
docs/wcurl.md,\
docs/THANKS-filter,\ docs/THANKS-filter,\
scripts/**\ scripts/**\
}" }"
@ -463,7 +428,6 @@ SMTP:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
docs/cmdline-opts/mail*,\
docs/examples/smtp-*,\ docs/examples/smtp-*,\
docs/libcurl/opts/CURLOPT_MAIL*,\ docs/libcurl/opts/CURLOPT_MAIL*,\
lib/smtp.*\ lib/smtp.*\
@ -473,7 +437,6 @@ tests:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-any-file: - any-glob-to-any-file:
- 'docs/tests/**'
- 'tests/**' - 'tests/**'
TFTP: TFTP:
@ -489,25 +452,16 @@ TLS:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
CMake/FindGnuTLS.cmake,\
CMake/FindMbedTLS.cmake,\ CMake/FindMbedTLS.cmake,\
CMake/FindWolfSSL.cmake,\ CMake/FindWolfSSL.cmake,\
CMake/FindRustls.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/*ssl.*,\ docs/examples/*ssl.*,\
docs/examples/*tls.*,\ docs/examples/*tls.*,\
docs/internals/TLS-SESSIONS.md,\ docs/SSL*,\
docs/libcurl/curl_global_sslset*,\ docs/libcurl/curl_global_sslset*,\
docs/libcurl/curl_easy_ssls*,\
docs/libcurl/opts/CURLINFO_CA*,\ docs/libcurl/opts/CURLINFO_CA*,\
docs/libcurl/opts/CURLINFO_CERT*,\ docs/libcurl/opts/CURLINFO_CERT*,\
docs/libcurl/opts/CURLINFO_EARLYDATA*,\
docs/libcurl/opts/CURLINFO_SSL*,\ docs/libcurl/opts/CURLINFO_SSL*,\
docs/libcurl/opts/CURLINFO_TLS*,\ docs/libcurl/opts/CURLINFO_TLS*,\
docs/libcurl/opts/CURLOPT_CA*,\ docs/libcurl/opts/CURLOPT_CA*,\
@ -522,8 +476,7 @@ TLS:
m4/curl-openssl.m4,\ m4/curl-openssl.m4,\
m4/curl-rustls.m4,\ m4/curl-rustls.m4,\
m4/curl-schannel.m4,\ m4/curl-schannel.m4,\
m4/curl-wolfssl.m4,\ m4/curl-wolfssl.m4\
src/tool_ssls.*\
}" }"
URL: URL:
@ -541,32 +494,32 @@ WebSocket:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
docs/internals/WEBSOCKET.md,\ docs/internals/WEBSOCKET.md*,\
docs/examples/websocket*,\ docs/examples/websocket*,\
docs/libcurl/curl_ws_*,\ docs/libcurl/curl_ws_*,\
docs/libcurl/libcurl-ws*,\ docs/libcurl/libcurl-ws*,\
docs/libcurl/opts/CURLOPT_WS_*,\ docs/libcurl/opts/CURLOPT_WS_*,\
include/curl/websockets.h,\ include/curl/websockets.h,\
lib/ws.*,\ lib/ws.*,\
tests/http/clients/ws*,\
tests/http/test_20_websockets.py,\ tests/http/test_20_websockets.py,\
tests/http/testenv/ws*,\ tests/http/testenv/ws*\
tests/libtest/cli_ws*\
}" }"
Windows: Windows:
- all: - all:
- changed-files: - changed-files:
- any-glob-to-all-files: "{\ - any-glob-to-all-files: "{\
.github/workflows/windows.yml,\
appveyor.*,\ appveyor.*,\
.github/workflows/windows.yml,\
CMake/win32-cache.cmake,\ CMake/win32-cache.cmake,\
lib/*win32*,\ lib/*win32*,\
lib/curlx/fopen.*,\
lib/curlx/multibyte.*,\ lib/curlx/multibyte.*,\
lib/curlx/winapi.*,\ lib/rename.*,\
lib/libcurl.def,\
lib/vtls/schannel*,\ lib/vtls/schannel*,\
m4/curl-schannel.m4,\ m4/curl-schannel.m4,\
projects/Windows/**,\ projects/**,\
src/tool_doswin.c\ src/tool_doswin.c,\
winbuild/**,\
lib/libcurl.def\
}" }"

View file

@ -1,8 +0,0 @@
<!--
IMPORTANT:
If you cannot understand or explain your work without using
Artificial Intelligence (AI) then do not file here. Do not paste
massive AI generated explanations. We accept the use of AI as long as
it is digestible. Please explain your issues or improvements briefly
and clearly in your own human voice.
-->

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

@ -1,191 +0,0 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# Output all the C comments and double-quoted strings in the given source
# files. All other contents should be blanked out. Output the text at the same
# horizontal position as in the original file.
#
# Ignores strings for the preprocessor.
#
## States
#
# 0 - default, initial state
# 1 - there was a slash
# 2 - quoted string
# 3 - // comment
# 4 - /* comment
# 5 - asterisk found within a /* comment
# 6 - #include line
# 7 - backslash in a string
# 8 - backslash in plain code
# 9 - single quote in plain code
#
## Flags
#
# 1 - include preprocessor line, ignore strings
sub scanline {
my ($col, $state, $flags, $l) = @_;
my $line;
if($state == 3) {
# // ended on the prev line, go back to init
$state = 0;
}
if(($state == 0) && ($l =~ /^ *\# *include/)) {
# preprocessor include line
$flags |= 1;
}
else {
# not preprocessor
$flags &= ~1;
}
my @c = split(//, $l);
# state machine this line
for my $c (@c) {
if($state == 1) {
# we had a slash
if($c eq "/") {
# // confirmed, the rest of the line is a comment
$line .= "//";
$state = 3;
}
elsif($c eq "*") {
# /* confirmed
$state = 4;
$line .= "/*";
}
else {
# back to normal
$line .= " ";
$state = 0;
}
}
elsif($state == 2) {
# a string
if($c eq "\\") {
$line .= "\\";
$state = 7;
}
elsif($c eq "\"") {
# end of the string
$line .= "\"";
$state = 0;
}
else {
$line .= $c;
}
}
elsif($state == 3) {
# a // comment
$line .= $c;
}
elsif($state == 4) {
# an ongoing /* comment
if($c eq "*") {
# could a comment close
$state = 5;
}
else {
$line .= $c;
}
}
elsif($state == 5) {
if($c eq "/") {
# a /* */ comment ended here */
$line .= "*/";
$state = 0;
}
else {
# the /* comment continues
$line .= "*$c";
$state = 4;
}
}
elsif($state == 7) {
# the prev was a backslash in a string
$line .= $c;
# switch back to normal string
$state = 2;
}
elsif($state == 8) {
# the prev was a backslash in code
if($c eq "\n") {
$line .= $c;
}
else {
#$line .= " ";
}
# switch back to plain code
$state = 0;
}
elsif($state == 9) {
# the prev was a single quote in code
if($c eq "\n") {
$line .= $c;
# switch back to plain code
$state = 0;
}
elsif($c eq "\\") {
# a backslash followed the quote
$line .= " ";
$state = 8;
}
else {
# switch back to plain code
$state = 0;
}
}
else {
if($c eq "\\") {
# got a backslash
$line .= " ";
$state = 8
}
elsif($c eq "\'") {
# got a single quote
$line .= " ";
$state = 9
}
if($c eq "/") {
$state = 1; # got a slash
}
elsif(($c eq "\"") && !($flags & 1)) {
# start of a string, not within a preprocessor line
$line .= "\"";
$state = 2;
}
elsif($c eq "\n") {
$line .= "\n";
}
else {
$line .= " ";
}
}
}
# strip trailing space
$line =~ s/( +)\n/\n/;
return $state, $flags, $line;
}
sub strip {
my ($f) = @_;
my $state = 0;
my $flags = 0;
open(F, "<$f") || die "can't open $f";
while(<F>) {
my $l = $_;
($state, $flags, $line) = scanline(0, $state, $flags, $l);
print "$line";
}
close(F);
}
for my $f (@ARGV) {
strip($f);
}

View file

@ -1,7 +0,0 @@
#!/bin/sh
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
./.github/scripts/c-comments "$1" > temp
mv temp "$1"

View file

@ -15,8 +15,8 @@ use warnings;
my @asyms; my @asyms;
open(S, "<", './docs/libcurl/symbols-in-versions') open(S, "<./docs/libcurl/symbols-in-versions")
or die "cannot find symbols-in-versions"; || die "can't find symbols-in-versions";
while(<S>) { while(<S>) {
if(/^([^ ]*) /) { if(/^([^ ]*) /) {
push @asyms, $1; push @asyms, $1;
@ -29,8 +29,8 @@ my @aopts = (
'--ftp-ssl-reqd', # old alias '--ftp-ssl-reqd', # old alias
); );
open(O, "<", './docs/options-in-versions') open(O, "<./docs/options-in-versions")
or die "cannot find options-in-versions"; || die "can't find options-in-versions";
while(<O>) { while(<O>) {
chomp; chomp;
if(/^([^ ]+)/) { if(/^([^ ]+)/) {
@ -49,8 +49,8 @@ while(<O>) {
} }
close(O); close(O);
open(C, "<", './.github/scripts/spellcheck.curl') open(C, "<./.github/scripts/spellcheck.curl")
or die "cannot find spellcheck.curl"; || die "can't find spellcheck.curl";
while(<C>) { while(<C>) {
if(/^\#/) { if(/^\#/) {
next; next;
@ -75,7 +75,7 @@ sub process {
my $sepcount = 0; my $sepcount = 0;
my $out; my $out;
my $line = 0; my $line = 0;
open(F, "<", $f) or die; open(F, "<$f") or die;
while(<F>) { while(<F>) {
$line++; $line++;
@ -99,11 +99,9 @@ sub process {
# *italics* # *italics*
$l =~ s/\*(\S.*?)\*//g; $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; $l =~ s!https://[a-z0-9\#_/.-]+!!gi;
# strip links, both name and target
$l =~ s/(\[.*?\])\(.*?\)//g;
$out .= $l; $out .= $l;
} }
close(F); close(F);
@ -115,16 +113,12 @@ sub process {
map { $out =~ s/\b$_\b//g; } (@syms); map { $out =~ s/\b$_\b//g; } (@syms);
if(!$ignore) { if(!$ignore) {
open(O, ">", $f) or die; open(O, ">$f") or die;
print O $out; print O $out;
close(O); close(O);
} }
} }
my @filemasks = @ARGV; for my $f (@ARGV) {
open(my $git_ls_files, '-|', 'git', 'ls-files', '--end-of-options', @filemasks) or die "Failed running git ls-files: $!";
while(my $f = <$git_ls_files>) {
chomp $f;
process($f); process($f);
} }
close $git_ls_files;

View file

@ -34,7 +34,8 @@ if(!$cmake) {
exit; exit;
} }
# this lists complete lines that are removed from the output if matching # this lists complete lines that will be removed from the output if
# matching
my %remove = ( my %remove = (
'#define CURL_EXTERN_SYMBOL' => 1, '#define CURL_EXTERN_SYMBOL' => 1,
'#define CURL_OS "Linux"' => 1, '#define CURL_OS "Linux"' => 1,
@ -44,18 +45,18 @@ my %remove = (
'#define HAVE_BROTLI 1' => 1, '#define HAVE_BROTLI 1' => 1,
'#define HAVE_BROTLI_DECODE_H 1' => 1, '#define HAVE_BROTLI_DECODE_H 1' => 1,
'#define HAVE_DLFCN_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_GSSAPI_GSSAPI_KRB5_H 1' => 1,
'#define HAVE_INTTYPES_H 1' => 1, '#define HAVE_INTTYPES_H 1' => 1,
'#define HAVE_LDAP_H 1' => 1, '#define HAVE_LDAP_H 1' => 1,
'#define HAVE_LDAP_SSL 1' => 1, '#define HAVE_LDAP_SSL 1' => 1,
'#define HAVE_LIBBROTLIDEC 1' => 1, '#define HAVE_LIBBROTLIDEC 1' => 1,
'#define HAVE_LIBPSL_H 1' => 1, '#define HAVE_LIBPSL_H 1' => 1,
'#define HAVE_LIBRTMP_RTMP_H 1' => 1,
'#define HAVE_LIBSOCKET 1' => 1, '#define HAVE_LIBSOCKET 1' => 1,
'#define HAVE_LIBSSH' => 1, '#define HAVE_LIBSSH' => 1,
'#define HAVE_LIBSSH2 1' => 1, '#define HAVE_LIBSSH2 1' => 1,
'#define HAVE_LIBSSL 1' => 1, '#define HAVE_LIBSSL 1' => 1,
'#define HAVE_LIBWOLFSSH' => 1,
'#define HAVE_LIBZSTD 1' => 1, '#define HAVE_LIBZSTD 1' => 1,
'#define HAVE_NGHTTP2_NGHTTP2_H 1' => 1, '#define HAVE_NGHTTP2_NGHTTP2_H 1' => 1,
'#define HAVE_NGHTTP3_NGHTTP3_H 1' => 1, '#define HAVE_NGHTTP3_NGHTTP3_H 1' => 1,
@ -66,6 +67,7 @@ my %remove = (
'#define HAVE_OPENSSL_PEM_H 1' => 1, '#define HAVE_OPENSSL_PEM_H 1' => 1,
'#define HAVE_OPENSSL_RSA_H 1' => 1, '#define HAVE_OPENSSL_RSA_H 1' => 1,
'#define HAVE_OPENSSL_SSL_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_QUICHE_H 1' => 1,
'#define HAVE_SSL_SET_QUIC_TLS_CBS 1' => 1, '#define HAVE_SSL_SET_QUIC_TLS_CBS 1' => 1,
'#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1, '#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
@ -76,6 +78,7 @@ my %remove = (
'#define HAVE_SYS_STAT_H 1' => 1, '#define HAVE_SYS_STAT_H 1' => 1,
'#define HAVE_SYS_XATTR_H 1' => 1, '#define HAVE_SYS_XATTR_H 1' => 1,
'#define HAVE_UNICODE_UIDNA_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_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
'#define HAVE_ZSTD 1' => 1, '#define HAVE_ZSTD 1' => 1,
'#define HAVE_ZSTD_H 1' => 1, '#define HAVE_ZSTD_H 1' => 1,
@ -88,7 +91,7 @@ my %remove = (
'#define PACKAGE_TARNAME "curl"' => 1, '#define PACKAGE_TARNAME "curl"' => 1,
'#define PACKAGE_URL ""' => 1, '#define PACKAGE_URL ""' => 1,
'#define PACKAGE_VERSION "-"' => 1, '#define PACKAGE_VERSION "-"' => 1,
'#define STDC_HEADERS 1' => 1, '#define SIZEOF_LONG_LONG 8' => 1,
'#define VERSION "-"' => 1, '#define VERSION "-"' => 1,
'#define _FILE_OFFSET_BITS 64' => 1, '#define _FILE_OFFSET_BITS 64' => 1,
); );
@ -106,7 +109,7 @@ sub grepit {
my ($input, $output) = @_; my ($input, $output) = @_;
my @defines; my @defines;
# first get all the #define lines # first get all the #define lines
open(F, "<", $input); open(F, "<$input");
while(<F>) { while(<F>) {
if($_ =~ /^#def/) { if($_ =~ /^#def/) {
chomp; chomp;
@ -115,7 +118,7 @@ sub grepit {
} }
close(F); close(F);
open(O, ">", $output); open(O, ">$output");
# output the sorted list through the filter # output the sorted list through the filter
foreach my $d(sort @defines) { foreach my $d(sort @defines) {
@ -133,5 +136,6 @@ foreach my $v (keys %remove) {
} }
} }
# return the exit code from diff # 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

@ -44,6 +44,6 @@ am=$(mktemp -t autotools.XXX); sort_lists "$1" > "${am}"
cm=$(mktemp -t cmake.XXX) ; sort_lists "$2" > "${cm}" cm=$(mktemp -t cmake.XXX) ; sort_lists "$2" > "${cm}"
diff -u "${am}" "${cm}" diff -u "${am}" "${cm}"
res="$?" res="$?"
rm -rf "${am}" "${cm}" rm -r -f "${am}" "${cm}"
exit "${res}" exit "${res}"

View file

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

View file

@ -5,19 +5,16 @@
set -eu set -eu
cd -- "$(dirname "${0}")"/../.. cd "$(dirname "${0}")"/../..
git ls-files -z | xargs -0 -r \ # shellcheck disable=SC2046
codespell \ codespell \
--skip '.github/scripts/pyspelling.words' \ --skip '.github/scripts/spellcheck.words' \
--skip '.github/scripts/typos.toml' \ --skip '.github/scripts/typos.toml' \
--skip 'docs/THANKS' \ --skip 'docs/THANKS' \
--skip 'projects/OS400/*' \ --skip 'packages/*' \
--skip 'projects/vms/*' \
--skip 'RELEASE-NOTES' \
--skip 'scripts/wcurl' \ --skip 'scripts/wcurl' \
--skip 'tests/unit/unit1625.c' \ --skip 'winbuild/*' \
--skip 'tests/unit/unit1627.c' \
--ignore-regex '.*spellchecker:disable-line' \ --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* gitonly=".git*
^.* ^.*
^appveyor.* ^appveyor.*
^buildconf
^GIT-INFO.md ^GIT-INFO.md
^README.md ^README.md
^renovate.json ^renovate.json
@ -18,15 +19,17 @@ gitonly=".git*
^SECURITY.md ^SECURITY.md
^LICENSES/* ^LICENSES/*
^docs/examples/adddocsref.pl ^docs/examples/adddocsref.pl
^docs/tests/CI.md
^docs/THANKS-filter ^docs/THANKS-filter
^projects/Windows/* ^projects/Windows/*
^scripts/ciconfig.pl
^scripts/cijobs.pl
^scripts/contributors.sh ^scripts/contributors.sh
^scripts/contrithanks.sh ^scripts/contrithanks.sh
^scripts/delta ^scripts/delta
^scripts/installcheck.sh ^scripts/installcheck.sh
^scripts/release-notes.pl ^scripts/release-notes.pl
^scripts/singleuse.pl" ^scripts/singleuse.pl
^tests/CI.md"
tarfiles="$(mktemp)" tarfiles="$(mktemp)"
gitfiles="$(mktemp)" gitfiles="$(mktemp)"

View file

@ -61,7 +61,7 @@ sub storedata {
} }
sub getoptions { sub getoptions {
my @all = qx($curl --help all); my @all = `$curl --help all`;
for my $o (@all) { for my $o (@all) {
chomp $o; chomp $o;
if($o =~ /^ -(.), --([^ ]*) (.*)/) { if($o =~ /^ -(.), --([^ ]*) (.*)/) {
@ -116,6 +116,7 @@ my %commonrc = (
'26' => 1, '26' => 1,
); );
sub runone { sub runone {
my $a; my $a;
my $nargs = getnum(60) + 1; my $nargs = getnum(60) + 1;
@ -154,7 +155,7 @@ sub runone {
print "CMD: $cmd\n"; print "CMD: $cmd\n";
print "RC: $rc\n"; print "RC: $rc\n";
print "== curl-output == \n"; print "== curl-output == \n";
open(D, "<", 'curl-output'); open(D, "<curl-output");
my @out = <D>; my @out = <D>;
print @out; print @out;
close(D); close(D);
@ -166,7 +167,7 @@ sub runconfig {
my $a; my $a;
my $nargs = getnum(80) + 1; my $nargs = getnum(80) + 1;
open(C, ">", 'config'); open(C, ">config");
$totalargs += $nargs; $totalargs += $nargs;
$totalcmds++; $totalcmds++;
@ -204,12 +205,12 @@ sub runconfig {
print "CMD: $cmd\n"; print "CMD: $cmd\n";
print "RC: $rc\n"; print "RC: $rc\n";
print "== config == \n"; print "== config == \n";
open(D, "<", 'config'); open(D, "<config");
my @all = <D>; my @all = <D>;
print @all; print @all;
close(D); close(D);
print "\n== curl-output == \n"; print "\n== curl-output == \n";
open(D, "<", 'curl-output'); open(D, "<curl-output");
my @out = <D>; my @out = <D>;
print @out; print @out;
close(D); close(D);

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,8 +0,0 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
cmakelang==0.6.13
codespell==2.4.3
reuse==6.2.0
ruff==0.16.2

View file

@ -3,11 +3,7 @@
# #
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
set -eu # shellcheck disable=SC2046
shellcheck --exclude=1091 \
cd -- "$(dirname "${0}")"/../..
git grep -z -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' | xargs -0 -r \
shellcheck --exclude=1091,2248 \
--enable=avoid-nullary-conditions,deprecate-which \ --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_assign
curl_multi_get_handles curl_multi_get_handles
curl_multi_get_offt curl_multi_get_offt
curl_multi_notify_disable
curl_multi_notify_enable
curl_pushheader_bynum curl_pushheader_bynum
curl_pushheader_byname curl_pushheader_byname
curl_multi_waitfds
curl_easy_option_by_name curl_easy_option_by_name
curl_easy_option_by_id curl_easy_option_by_id
curl_easy_option_next curl_easy_option_next

View file

@ -53,7 +53,6 @@ axTLS
backend backend
backends backends
backoff backoff
backtick
backticks backticks
balancers balancers
Baratov Baratov
@ -98,7 +97,6 @@ changeset
CharConv CharConv
charset charset
charsets charsets
checkdocs
checksrc checksrc
checksums checksums
chgrp chgrp
@ -124,7 +122,6 @@ CMakeLists
CNA CNA
CNAME CNAME
CNAMEs CNAMEs
CodeQL
CODESET CODESET
codeset codeset
CodeSonar CodeSonar
@ -150,6 +147,7 @@ CSeq
csh csh
cshrc cshrc
CTRL CTRL
cURL
CURLcode CURLcode
curldown curldown
CURLE CURLE
@ -167,17 +165,13 @@ CWE
cyassl cyassl
Cygwin Cygwin
daniel daniel
datagrams
datatracker datatracker
dbg dbg
decapsulation
Debian Debian
DEBUGBUILD DEBUGBUILD
decrypt decrypt
decrypted
decrypting decrypting
deepcode deepcode
defacto
DELE DELE
DER DER
dereference dereference
@ -195,7 +189,6 @@ devtools
DHCP DHCP
DHE DHE
dir dir
discoverable
distro distro
distro's distro's
distros distros
@ -207,7 +200,6 @@ DLLs
DNS DNS
dns dns
dnsop dnsop
DNSSEC
DoH DoH
DoT DoT
doxygen doxygen
@ -221,7 +213,6 @@ dynbuf
EAGAIN EAGAIN
EBCDIC EBCDIC
ECC ECC
ECCN
ECDHE ECDHE
ECH ECH
ECHConfig ECHConfig
@ -236,13 +227,12 @@ EGD
EHLO EHLO
EINTR EINTR
else's else's
encapsulation
encodings encodings
enctype enctype
endianness endianness
enums
Engler Engler
enum enum
enums
epoll epoll
EPRT EPRT
EPSV EPSV
@ -253,7 +243,6 @@ et
etag etag
ETag ETag
ETags ETags
exa
exe exe
executables executables
EXPN EXPN
@ -267,7 +256,6 @@ Fedora
Feltzing Feltzing
ffi ffi
filesize filesize
filesystem
FindCURL FindCURL
FLOSS FLOSS
fnmatch fnmatch
@ -304,12 +292,9 @@ getinfo
GETing GETing
getpwuid getpwuid
ggcov ggcov
GHA
Ghedini Ghedini
giga
Gisle Gisle
Glesys Glesys
glibc
globbed globbed
globbing globbing
gmail gmail
@ -368,11 +353,9 @@ httpget
HttpGet HttpGet
HTTPS HTTPS
https https
httpsig
HTTPSIG
CURLHTTPSIG
HTTPSRR HTTPSRR
hyper's hyper's
Högskolan
IANA IANA
Icecast Icecast
ICONV ICONV
@ -394,8 +377,6 @@ imap
IMAPS IMAPS
imaps imaps
impacket impacket
implementers
INI
init init
initializer initializer
inlined inlined
@ -431,11 +412,9 @@ KDE
keepalive keepalive
Keil Keil
kerberos kerberos
keyid
Keychain Keychain
keychain keychain
KiB KiB
kibibyte
kickstart kickstart
Kirei Kirei
Knauf Knauf
@ -444,15 +423,14 @@ Krb
krb krb
Kubernetes Kubernetes
Kuhrt Kuhrt
Kungliga
Largefile Largefile
LDAP LDAP
ldap ldap
LDAPS LDAPS
ldaps ldaps
LF LF
LGPL
LGTM LGTM
libbacktrace
libbrotlidec libbrotlidec
libc libc
libcurl libcurl
@ -482,7 +460,6 @@ libWebSocket
libz libz
libzstd libzstd
LineageOS LineageOS
linter
linux linux
lldb lldb
ln ln
@ -513,7 +490,6 @@ Mavrogiannopoulos
Mbed Mbed
mbedTLS mbedTLS
md md
mebibyte
Meglio Meglio
memdebug memdebug
MesaLink MesaLink
@ -586,7 +562,6 @@ Necko
NetBSD NetBSD
netrc netrc
netstat netstat
NetWare
Netware Netware
NFS NFS
nghttp nghttp
@ -643,7 +618,6 @@ PEM
pem pem
perl perl
permafailing permafailing
peta
PINGs PINGs
pipelining pipelining
PKCS PKCS
@ -730,7 +704,6 @@ ROADMAP
Roadmap Roadmap
Rockbox Rockbox
roffit roffit
RPC
RPG RPG
RR RR
RRs RRs
@ -769,7 +742,6 @@ scp
SDK SDK
se se
SEB SEB
SecTrust
SEK SEK
selectable selectable
Serv Serv
@ -790,7 +762,6 @@ sizeof
SLE SLE
slist slist
sln sln
Slowloris
SMB SMB
smb smb
SMBS SMBS
@ -819,7 +790,6 @@ sprintf
src src
SRP SRP
SRWLOCK SRWLOCK
SSI
SSL SSL
ssl ssl
SSLeay SSLeay
@ -836,7 +806,6 @@ stateful
statvfs statvfs
stderr stderr
stdin stdin
stdint
stdout stdout
Steinar Steinar
Stenberg Stenberg
@ -878,7 +847,7 @@ Tatsuhiro
TBD TBD
TCP TCP
tcpdump tcpdump
tera Tekniska
testability testability
testcurl testcurl
TFTP TFTP
@ -904,7 +873,6 @@ trustless
Tse Tse
Tsujikawa Tsujikawa
TTL TTL
tty
tvOS tvOS
txt txt
typedef typedef
@ -916,9 +884,7 @@ UDP
UI UI
UID UID
UIDL UIDL
uint
Ultrix Ultrix
umask
Unary Unary
unassign unassign
UNC UNC
@ -963,7 +929,6 @@ VC
vcpkg vcpkg
vexxhost vexxhost
Viktor Viktor
virtualized
Virtuozzo Virtuozzo
VLAN VLAN
VM VM
@ -984,13 +949,12 @@ watchOS
WAV WAV
WB WB
wcurl wcurl
web page
WebDAV WebDAV
WebOS WebOS
webpage webpage
webpages
WebSocket WebSocket
WEBSOCKET WEBSOCKET
Wget
WHATWG WHATWG
whitespace whitespace
Whitespaces Whitespaces
@ -1000,7 +964,6 @@ WinIDN
WinLDAP WinLDAP
winsock winsock
Wireshark Wireshark
wolfCrypt
wolfSSH wolfSSH
wolfSSL wolfSSL
ws ws
@ -1010,9 +973,7 @@ www
Xbox Xbox
XDG XDG
xdigit xdigit
XHTML
Xilinx Xilinx
xmllint
XP XP
Xtensa Xtensa
XYZ XYZ
@ -1020,7 +981,6 @@ Youtube
YYYY YYYY
YYYYMMDD YYYYMMDD
Zakrzewski Zakrzewski
Zeropath
Zitzmann Zitzmann
zlib zlib
zsh zsh

View file

@ -2,13 +2,12 @@
# #
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
# #
# Docs: https://facelessuser.github.io/pyspelling/configuration/
# Docs: https://github.com/UnicornGlobal/spellcheck-github-actions # Docs: https://github.com/UnicornGlobal/spellcheck-github-actions
matrix: matrix:
- name: Markdown - name: Markdown
expect_match: false expect_match: false
aspell: apsell:
lang: en mode: en
dictionary: dictionary:
wordlists: wordlists:
- wordlist.txt - wordlist.txt
@ -30,4 +29,4 @@ matrix:
- 'strong' - 'strong'
- 'em' - 'em'
sources: 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

@ -12,7 +12,7 @@ use warnings;
my $f = $ARGV[0] || ''; my $f = $ARGV[0] || '';
open(F, "<", $f) or die; open(F, "<$f") or die;
my @out; my @out;
my $line = 0; my $line = 0;
@ -37,7 +37,7 @@ while(<F>) {
} }
close(F); close(F);
open(O, ">", $f) or die; open(O, ">$f") or die;
for my $l (@out) { for my $l (@out) {
print O $l; print O $l;
} }

View file

@ -5,7 +5,7 @@
set -eu set -eu
cd -- "$(dirname "${0}")"/../.. cd "$(dirname "${0}")"/../..
git ls-files | typos \ git ls-files | typos \
--isolated \ --isolated \

View file

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

View file

@ -37,14 +37,12 @@ if(!@files || $files[0] eq "-h") {
} }
sub testcompile { sub testcompile {
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' . 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;
'-Wno-unused-parameter -Wno-unused-but-set-variable ' .
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION') >> 8;
return $rc; return $rc;
} }
sub checksrc { sub checksrc {
my $rc = system($check, ('test.c')) >> 8; my $rc = system("$check test.c") >> 8;
return $rc; return $rc;
} }
@ -54,8 +52,8 @@ sub extract {
my $l = 0; my $l = 0;
my $iline = 0; my $iline = 0;
my $fail = 0; my $fail = 0;
open(F, "<", $f) or die "failed opening input file $f : $!"; open(F, "<$f") or die "failed opening input file $f : $!";
open(O, ">", $cfile) or die "failed opening output file $cfile : $!"; open(O, ">$cfile") or die "failed opening output file $cfile : $!";
print O "#include <curl/curl.h>\n"; print O "#include <curl/curl.h>\n";
while(<F>) { while(<F>) {
$iline++; $iline++;
@ -65,9 +63,9 @@ sub extract {
elsif($syn == 1) { elsif($syn == 1) {
if(/^~~~/) { if(/^~~~/) {
$syn++; $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 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; printf O "#line %d \"$f\"\n", $iline+1;
} }
} }

View file

@ -35,18 +35,18 @@ if(!@files || $files[0] eq "-h") {
} }
sub testcompile { sub testcompile {
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' . my $rc = system("gcc -c test.c -DCURL_DISABLE_TYPECHECK -DCURL_ALLOW_OLD_MULTI_SOCKET -I include") >> 8;
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_TYPECHECK') >> 8;
return $rc; return $rc;
} }
sub extract { sub extract {
my($f) = @_; my($f) = @_;
my $syn = 0; my $syn = 0;
my $l = 0; my $l = 0;
my $iline = 0; my $iline = 0;
open(F, "<", $f); open(F, "<$f");
open(O, ">", $cfile); open(O, ">$cfile");
while(<F>) { while(<F>) {
$iline++; $iline++;
if(/^# SYNOPSIS/) { if(/^# SYNOPSIS/) {

View file

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

4
.github/stale.yml vendored
View file

@ -6,7 +6,7 @@
daysUntilStale: 180 daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed # Number of days of inactivity before a stale issue is closed
daysUntilClose: 14 daysUntilClose: 14
# Issues with these labels are never considered stale # Issues with these labels will never be considered stale
exemptLabels: exemptLabels:
- pinned - pinned
- security - security
@ -15,7 +15,7 @@ staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable # Comment to post when marking an issue as stale. Set to `false` to disable
markComment: > markComment: >
This issue has been automatically marked as stale because it has not had This issue has been automatically marked as stale because it has not had
recent activity. It is closed if no further activity occurs. Thank you recent activity. It will be closed if no further activity occurs. Thank you
for your contributions. for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable # Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false closeComment: false

View file

@ -16,10 +16,10 @@ permissions: {}
jobs: jobs:
split: split:
name: 'split' name: 'split'
runs-on: ubuntu-24.04-arm runs-on: ubuntu-latest
if: ${{ github.event.sender.login == 'appveyor[bot]' }} if: ${{ github.event.sender.login == 'appveyor[bot]' }}
permissions: permissions:
statuses: write # To update build statuses statuses: write
steps: steps:
- name: 'Create individual AppVeyor build statuses' - name: 'Create individual AppVeyor build statuses'
if: ${{ github.event.sha && github.event.target_url }} if: ${{ github.event.sha && github.event.target_url }}
@ -27,10 +27,9 @@ jobs:
APPVEYOR_COMMIT_SHA: ${{ github.event.sha }} APPVEYOR_COMMIT_SHA: ${{ github.event.sha }}
APPVEYOR_TARGET_URL: ${{ github.event.target_url }} APPVEYOR_TARGET_URL: ${{ github.event.target_url }}
APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }} APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
DO_NOT_TRACK: '1' # for gh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | 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), jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
context: (.name | sub("^(Environment: )?"; "AppVeyor / ")), context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
state: (.status | sub("queued"; "pending") state: (.status | sub("queued"; "pending")

View file

@ -14,8 +14,8 @@ name: 'Docs'
- '*/ci' - '*/ci'
paths: paths:
- '.github/workflows/checkdocs.yml' - '.github/workflows/checkdocs.yml'
- '.github/scripts/**' - '.github/scripts/mdlinkcheck'
- 'scripts/**' - '/scripts/**'
- '**.md' - '**.md'
- 'docs/*' - 'docs/*'
pull_request: pull_request:
@ -24,7 +24,7 @@ name: 'Docs'
paths: paths:
- '.github/workflows/checkdocs.yml' - '.github/workflows/checkdocs.yml'
- '.github/scripts/**' - '.github/scripts/**'
- 'scripts/**' - '.github/scripts/mdlinkcheck'
- '**.md' - '**.md'
- 'docs/*' - 'docs/*'
@ -34,102 +34,128 @@ concurrency:
permissions: {} permissions: {}
env:
DO_NOT_TRACK: '1'
jobs: jobs:
# config file help: https://github.com/amperser/proselint/ # proselint:
proselint: # name: 'proselint'
name: 'proselint' # runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm # 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: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'install prereqs' - name: 'mdlinkcheck'
run: | run: ./scripts/mdlinkcheck
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: 'trim headers off all *.md files' spellcheck:
run: git ls-files '*.md' -z | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl name: 'spellcheck'
runs-on: ubuntu-latest
- 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'
runs-on: ubuntu-26.04
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'trim all *.md files in docs/' - name: 'trim all *.md files in docs/'
run: .github/scripts/cleancmd.pl 'docs/*.md'
- name: 'install'
timeout-minutes: 2
run: | run: |
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print # shellcheck disable=SC2046
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt .github/scripts/cleancmd.pl $(find docs -name '*.md')
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
- name: 'check spelling' - name: 'setup the custom wordlist'
run: | run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
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
synopsis-man-examples: - name: 'check Spelling'
name: 'synopsis, man-examples' uses: rojopolis/spellcheck-github-actions@35a02bae020e6999c5c37fabaf447f2eb8822ca7 # v0
runs-on: ubuntu-26.04-arm with:
config_path: .github/scripts/spellcheck.yaml
badwords-synopsis:
name: 'badwords, synopsis'
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false 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' - name: 'verify synopsis'
run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md 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' - name: 'verify examples'
run: .github/scripts/verify-examples.pl docs/libcurl/curl*.md docs/libcurl/opts/*.md 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,196 +12,129 @@ name: 'Source'
- master - master
- '*/ci' - '*/ci'
paths-ignore: paths-ignore:
- '**/*.md'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'plan9/**'
- 'tests/data/**'
- 'winbuild/**'
pull_request: pull_request:
branches: branches:
- master - master
paths-ignore: paths-ignore:
- '**/*.md'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'plan9/**'
concurrency: - 'tests/data/**'
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - 'winbuild/**'
cancel-in-progress: true
permissions: {} permissions: {}
env:
DO_NOT_TRACK: '1'
HOMEBREW_NO_INSTALL_CLEANUP: '1'
jobs: jobs:
checksrc: checksrc:
name: 'checksrc' name: 'checksrc'
runs-on: ubuntu-slim runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'check' - name: 'check'
run: scripts/checksrc-all.pl run: scripts/checksrc-all.pl
linters: spellcheck-cmakelint-pytype-ruff:
name: 'spellcheck, linters, REUSE' name: 'spellcheck, cmakelint, pytype, ruff'
runs-on: ubuntu-26.04-arm runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'install prereqs' - name: 'install'
env:
DEBIAN_FRONTEND: noninteractive
run: | run: |
python3 -m venv ~/venv sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary \ sudo apt-get -o Dpkg::Use-Pty=0 update
-r .github/scripts/requirements.txt \ sudo rm -f /var/lib/man-db/auto-update
-r tests/http/requirements.txt \ sudo apt-get -o Dpkg::Use-Pty=0 install \
-r tests/requirements.txt python3-pip python3-networkx python3-pydot python3-yaml \
python3-toml python3-markupsafe python3-jinja2 python3-tabulate \
- name: 'REUSE check' python3-typing-extensions python3-libcst python3-impacket \
run: | python3-websockets python3-pytest python3-filelock python3-pytest-xdist
source ~/venv/bin/activate python3 -m pip install --break-system-packages cmakelang==0.6.13 pytype==2024.10.11 ruff==0.11.9 codespell==2.4.1
reuse lint
- name: 'cmakelint'
run: |
source ~/venv/bin/activate
scripts/cmakelint.sh
- name: 'cmake options in documentation'
run: scripts/cmakeopts.sh
- name: 'perlcheck'
run: scripts/perlcheck.sh
- name: 'ruff'
run: |
source ~/venv/bin/activate
scripts/pythonlint.sh
- name: filter off code from all C and H files
run: |
git ls-files -z '**.[ch]' | xargs -0 -r -n1 ./.github/scripts/c-strip
- name: 'codespell' - name: 'codespell'
run: | run: |
source ~/venv/bin/activate
codespell --version codespell --version
.github/scripts/codespell.sh .github/scripts/codespell.sh
- name: 'typos' - name: 'typos'
timeout-minutes: 2
run: | run: |
/home/linuxbrew/.linuxbrew/bin/brew install typos-cli /home/linuxbrew/.linuxbrew/bin/brew install typos-cli
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
typos --version typos --version
.github/scripts/typos.sh .github/scripts/typos.sh
pytype: - name: 'cmakelint'
name: 'pytype' run: scripts/cmakelint.sh
runs-on: ubuntu-24.04-arm # pytype is discontinued and requires python 3.8-3.12
- name: 'pytype'
run: find . -name '*.py' -exec pytype -j auto -k {} +
- name: 'ruff'
run: scripts/pythonlint.sh
reuse:
name: 'REUSE'
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false 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 pytype==2024.10.11 \
-r .github/scripts/requirements.txt \
-r tests/http/requirements.txt \
-r tests/requirements.txt
- name: 'check' - name: 'check'
run: | uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5
source ~/venv/bin/activate
find . -name '*.py' -exec pytype -j auto -k -- {} +
complexity: complexity:
name: 'complexity and function sizes' name: 'complexity'
runs-on: ubuntu-slim runs-on: ubuntu-latest
timeout-minutes: 3 timeout-minutes: 3
steps: steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'install pmccabe' - name: 'install pmccabe'
timeout-minutes: 2
run: | run: |
ls -l /etc/apt/sources.list.d sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 update sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install pmccabe sudo rm -f /var/lib/man-db/auto-update
sudo apt-get -o Dpkg::Use-Pty=0 install \
pmccabe
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: 'check scores'
with:
persist-credentials: false
- name: 'check function complexity'
run: ./scripts/top-complexity run: ./scripts/top-complexity
- name: 'check function lengths'
run: ./scripts/top-length
xmllint:
name: 'xmllint'
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- name: 'install prereqs'
timeout-minutes: 2
run: |
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install libxml2-utils
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: 'check'
run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint --output /dev/null
miscchecks: miscchecks:
name: 'misc checks' name: 'misc checks'
runs-on: ubuntu-26.04-arm runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: 'install prereqs' - name: 'install prereqs'
timeout-minutes: 2 run: /home/linuxbrew/.linuxbrew/bin/brew install shellcheck zizmor
run: /home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'zizmor/actionlint (prepare)'
# Replace custom bash-like shell designators with the standard one to make linters process them
run: sed -i.bak -E 's/shell\x3a .+ zizmor\x3a ignore.+$/shell\x3a bash/g' .github/workflows/*.yml
- name: 'zizmor GHA' - name: 'zizmor GHA'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: | run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
zizmor --persona pedantic .github/workflows/*.yml .github/dependabot.yml zizmor --pedantic .github/workflows/*.yml
- name: 'zizmor GHA (auditor, warning-only)'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
zizmor --persona auditor .github/workflows/*.yml .github/dependabot.yml || true
- 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 --ignore ubuntu-26.04 .github/workflows/*.yml
- name: 'shellcheck CI' - name: 'shellcheck CI'
run: | run: |
@ -216,10 +149,14 @@ jobs:
.github/scripts/shellcheck.sh .github/scripts/shellcheck.sh
- name: 'spacecheck' - name: 'spacecheck'
run: scripts/spacecheck.pl run: .github/scripts/spacecheck.pl
- name: 'yamlcheck' - name: 'yamlcheck'
run: .github/scripts/yamlcheck.sh run: .github/scripts/yamlcheck.sh
# we allow some extra in source code
- name: 'badwords' - 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,43 +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: {}
env:
DO_NOT_TRACK: '1'
jobs:
linkcheck:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'linkcheck'
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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' - '**/*.md'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'tests/data/**' - 'tests/data/**'
- 'winbuild/**'
pull_request: pull_request:
branches: branches:
- master - master
@ -22,123 +26,36 @@ name: 'CodeQL'
- '**/*.md' - '**/*.md'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'docs/**'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'tests/data/**' - 'tests/data/**'
- 'winbuild/**'
schedule: schedule:
- cron: '0 0 * * 4' - cron: '0 0 * * 4'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} group: ${{ github.workflow }}
cancel-in-progress: true
permissions: {} permissions: {}
env:
DO_NOT_TRACK: '1'
HOMEBREW_NO_INSTALL_CLEANUP: '1'
jobs: jobs:
gha_python: codeql:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'GHA and Python' name: 'GHA and Python'
runs-on: ubuntu-26.04 runs-on: ubuntu-latest
permissions: permissions:
security-events: write # To create/update security events security-events: write
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with: with:
persist-credentials: false persist-credentials: false
- name: 'initialize' - name: 'initialize'
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 uses: github/codeql-action/init@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3
with: with:
languages: actions, python languages: actions, python
queries: security-extended queries: security-extended
- name: 'perform analysis' - name: 'perform analysis'
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 uses: github/codeql-action/analyze@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3
c:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'C'
runs-on: ${{ matrix.platform == 'Linux' && 'ubuntu-26.04' || '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: 2
run: |
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo 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
/home/linuxbrew/.linuxbrew/bin/brew install ca-certificates || true
/home/linuxbrew/.linuxbrew/bin/brew install c-ares gsasl libnghttp3 libngtcp2 mbedtls rustls-ffi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
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 -DUSE_PROXY_HTTP3=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@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3

View file

@ -12,7 +12,7 @@ name: 'configure-vs-cmake'
- '**/*.m4' - '**/*.m4'
- '**/CMakeLists.txt' - '**/CMakeLists.txt'
- 'CMake/**' - 'CMake/**'
- 'lib/curl_config-cmake.h.in' - 'lib/curl_config.h.cmake'
- 'tests/cmake/**' - 'tests/cmake/**'
- '.github/scripts/cmp-config.pl' - '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml' - '.github/workflows/configure-vs-cmake.yml'
@ -25,40 +25,30 @@ name: 'configure-vs-cmake'
- '**/*.m4' - '**/*.m4'
- '**/CMakeLists.txt' - '**/CMakeLists.txt'
- 'CMake/**' - 'CMake/**'
- 'lib/curl_config-cmake.h.in' - 'lib/curl_config.h.cmake'
- 'tests/cmake/**' - 'tests/cmake/**'
- '.github/scripts/cmp-config.pl' - '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml' - '.github/workflows/configure-vs-cmake.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {} permissions: {}
env:
CURL_CI: github
DO_NOT_TRACK: '1'
HOMEBREW_NO_INSTALL_CLEANUP: '1'
jobs: jobs:
check-linux: check-linux:
name: 'Linux' name: 'Linux'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'run configure --with-openssl' - name: 'run configure --with-openssl'
run: | run: |
autoreconf -fi autoreconf -fi
echo '::group::configure --help output'; ./configure --help; echo '::endgroup::'
export PKG_CONFIG_DEBUG_SPEW=1 export PKG_CONFIG_DEBUG_SPEW=1
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl
- name: 'run cmake' - 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' - name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true run: cat bld-am/config.log 2>/dev/null || true
@ -66,7 +56,7 @@ jobs:
- name: 'cmake log' - name: 'cmake log'
run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'generated libcurl.pc files' - name: 'dump generated files'
run: | run: |
for f in libcurl.pc curl-config; do for f in libcurl.pc curl-config; do
echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::' echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::'
@ -87,40 +77,28 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: 'install packages' - name: 'install packages'
timeout-minutes: 2
run: | run: |
# shellcheck disable=SC2181 # shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do 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
for i in 1 2 3; do
if brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions' - name: 'toolchain versions'
run: echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::' run: echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'run configure --with-openssl' - name: 'run configure --with-openssl'
run: | run: |
autoreconf -fi autoreconf -fi
echo '::group::configure --help output'; ./configure --help; echo '::endgroup::'
export PKG_CONFIG_DEBUG_SPEW=1 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' - name: 'run cmake'
run: | 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)" \ -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' - name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true run: cat bld-am/config.log 2>/dev/null || true
@ -128,15 +106,12 @@ jobs:
- name: 'cmake log' - name: 'cmake log'
run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'generated libcurl.pc files' - name: 'dump generated files'
run: | run: |
for f in libcurl.pc curl-config; do for f in libcurl.pc curl-config; do
echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::' echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::'
echo "::group::CM ${f}"; grep -v '^#' bld-cm/"${f}" || true; echo '::endgroup::' echo "::group::CM ${f}"; grep -v '^#' bld-cm/"${f}" || true; echo '::endgroup::'
done done
pccritic --version
pccritic --min-score 98 bld-am/libcurl.pc
pccritic --min-score 98 bld-cm/libcurl.pc
- name: 'compare generated curl_config.h files' - name: 'compare generated curl_config.h files'
run: ./.github/scripts/cmp-config.pl bld-am/lib/curl_config.h bld-cm/lib/curl_config.h run: ./.github/scripts/cmp-config.pl bld-am/lib/curl_config.h bld-cm/lib/curl_config.h
@ -149,32 +124,28 @@ jobs:
check-windows: check-windows:
name: 'Windows' name: 'Windows'
runs-on: ubuntu-26.04 runs-on: ubuntu-latest
env: env:
TRIPLET: 'x86_64-w64-mingw32' TRIPLET: 'x86_64-w64-mingw32'
steps: steps:
- name: 'install packages' - name: 'install packages'
timeout-minutes: 1
run: | run: |
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print sudo rm -f /var/lib/man-db/auto-update
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install gcc-mingw-w64-x86-64-win32
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: 'run configure --with-schannel' - name: 'run configure --with-schannel'
run: | run: |
autoreconf -fi autoreconf -fi
echo '::group::configure --help output'; ./configure --help; echo '::endgroup::'
export PKG_CONFIG_DEBUG_SPEW=1 export PKG_CONFIG_DEBUG_SPEW=1
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-schannel --without-libpsl --host="${TRIPLET}" mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-schannel --without-libpsl --host="${TRIPLET}"
- name: 'run cmake' - name: 'run cmake'
run: | 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_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \ -DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \
-DCMAKE_C_COMPILER="${TRIPLET}-gcc" -DCMAKE_C_COMPILER="${TRIPLET}-gcc"
@ -185,7 +156,7 @@ jobs:
- name: 'cmake log' - name: 'cmake log'
run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'generated libcurl.pc files' - name: 'dump generated files'
run: | run: |
for f in libcurl.pc curl-config; do for f in libcurl.pc curl-config; do
echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::' echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::'

View file

@ -14,7 +14,10 @@ name: 'curl-for-win'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
pull_request: pull_request:
branches: branches:
- master - master
@ -23,7 +26,10 @@ name: 'curl-for-win'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -36,15 +42,14 @@ env:
CW_MAP: '0' CW_MAP: '0'
CW_JOBS: '5' CW_JOBS: '5'
CW_NOPKG: '1' CW_NOPKG: '1'
DO_NOT_TRACK: '1'
jobs: jobs:
linux-glibc-gcc: linux-glibc-gcc:
name: 'Linux gcc glibc (amd64, arm64)' name: 'Linux gcc glibc (amd64, arm64)'
runs-on: ubuntu-26.04 runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
path: 'curl' path: 'curl'
@ -53,54 +58,27 @@ jobs:
run: | run: |
git clone --depth 1 https://github.com/curl/curl-for-win git clone --depth 1 https://github.com/curl/curl-for-win
mv 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}" export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh DOCKER_IMAGE='debian:bookworm-slim'
export CW_CCSUFFIX='-15' export CW_CCSUFFIX='-15'
export CW_GCCSUFFIX='-12' export CW_GCCSUFFIX='-12'
sudo podman image trust set --type reject default sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library 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 podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \ --env-file <(env | grep -a -E \
'^(CW_|DO_NOT_TRACK|GITHUB_)') \ '^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN_STABLE}" \ "${DOCKER_IMAGE}" \
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-26.04
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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_|DO_NOT_TRACK|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \
sh -c ./_ci-linux-debian.sh sh -c ./_ci-linux-debian.sh
linux-musl-llvm: linux-musl-llvm:
name: 'Linux llvm MUSL (amd64, riscv64)' name: 'Linux llvm MUSL (amd64, riscv64)'
runs-on: ubuntu-26.04 runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
path: 'curl' path: 'curl'
@ -109,29 +87,27 @@ jobs:
run: | run: |
git clone --depth 1 https://github.com/curl/curl-for-win git clone --depth 1 https://github.com/curl/curl-for-win
mv 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}" export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh . ./_versions.sh
export CW_CCSUFFIX='-19'
export CW_GCCSUFFIX='-14'
sudo podman image trust set --type reject default sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library 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 podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \ --env-file <(env | grep -a -E \
'^(CW_|DO_NOT_TRACK|GITHUB_)') \ '^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN_STABLE}" \ "${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh sh -c ./_ci-linux-debian.sh
mac-clang: mac-clang:
name: 'macOS clang cares (x86_64)' name: 'macOS clang (x86_64)'
runs-on: macos-latest runs-on: macos-latest
timeout-minutes: 10 timeout-minutes: 10
env: env:
CW_JOBS: '4' CW_JOBS: '4'
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
path: 'curl' path: 'curl'
@ -140,19 +116,16 @@ jobs:
run: | run: |
git clone --depth 1 https://github.com/curl/curl-for-win git clone --depth 1 https://github.com/curl/curl-for-win
mv 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}" export CW_REVISION="${GITHUB_SHA}"
sh -c ./_ci-mac-homebrew.sh sh -c ./_ci-mac-homebrew.sh
win-llvm: win-llvm:
name: 'Windows llvm (x64)' name: 'Windows llvm (x64)'
runs-on: ubuntu-26.04 runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
env:
CW_PKG_NODELETE: '1'
CW_PKG_FLATTEN: '1'
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
path: 'curl' path: 'curl'
@ -161,31 +134,25 @@ jobs:
run: | run: |
git clone --depth 1 https://github.com/curl/curl-for-win git clone --depth 1 https://github.com/curl/curl-for-win
mv 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}" export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh . ./_versions.sh
sudo podman image trust set --type reject default sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}" time podman pull "${DOCKER_IMAGE}"
podman images --digests podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \ --env-file <(env | grep -a -E \
'^(CW_|DO_NOT_TRACK|GITHUB_)') \ '^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \ "${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh sh -c ./_ci-linux-debian.sh
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 win-gcc-libssh-zlibold-x64:
with: name: 'Windows gcc libssh zlib-classic (x64)'
name: 'curl-windows-snapshot-tool' runs-on: ubuntu-latest
retention-days: 5
path: curl-*-*-*/curl*
win-gcc-zlibold-x64:
name: 'Windows gcc zlib-classic (x64)'
runs-on: ubuntu-26.04
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
path: 'curl' path: 'curl'
@ -194,15 +161,15 @@ jobs:
run: | run: |
git clone --depth 1 https://github.com/curl/curl-for-win git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* . mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-curltests-win-x64-gcc-zlibold-noWINE' export CW_CONFIG='-main-werror-unitybatch-win-x64-gcc-libssh1-zlibold'
export CW_REVISION="${GITHUB_SHA}" export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh . ./_versions.sh
sudo podman image trust set --type reject default sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}" time podman pull "${DOCKER_IMAGE}"
podman images --digests podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \ --env-file <(env | grep -a -E \
'^(CW_|DO_NOT_TRACK|GITHUB_)') \ '^(CW_|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \ "${DOCKER_IMAGE}" \
sh -c ./_ci-linux-debian.sh sh -c ./_ci-linux-debian.sh

View file

@ -20,9 +20,6 @@ concurrency:
permissions: {} permissions: {}
env: env:
CURL_TEST_MIN: 1500
DO_NOT_TRACK: '1'
HOMEBREW_NO_INSTALL_CLEANUP: '1'
MAKEFLAGS: -j 5 MAKEFLAGS: -j 5
jobs: jobs:
@ -31,7 +28,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
@ -50,7 +47,7 @@ jobs:
- name: 'maketgz' - name: 'maketgz'
run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97 run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
with: with:
name: 'release-tgz' name: 'release-tgz'
path: 'curl-99.98.97.tar.gz' path: 'curl-99.98.97.tar.gz'
@ -61,7 +58,7 @@ jobs:
echo "::stop-commands::$(uuidgen)" echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97 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
make test-ci make test-ci
make install make install
@ -76,7 +73,7 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
needs: maketgz-and-verify-in-tree needs: maketgz-and-verify-in-tree
steps: steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with: with:
name: 'release-tgz' name: 'release-tgz'
@ -87,7 +84,7 @@ jobs:
touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
mkdir build mkdir build
pushd 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
make test-ci make test-ci
popd popd
@ -100,7 +97,7 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
needs: maketgz-and-verify-in-tree needs: maketgz-and-verify-in-tree
steps: steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with: with:
name: 'release-tgz' name: 'release-tgz'
@ -111,7 +108,7 @@ jobs:
pushd curl-99.98.97 pushd curl-99.98.97
mkdir build mkdir build
pushd 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
make test-ci make test-ci
make install make install
@ -126,7 +123,7 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
needs: maketgz-and-verify-in-tree needs: maketgz-and-verify-in-tree
steps: steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with: with:
name: 'release-tgz' name: 'release-tgz'
@ -137,7 +134,7 @@ jobs:
pushd curl-99.98.97 pushd curl-99.98.97
mkdir build mkdir build
pushd 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
make install make install
curl-install/bin/curl --disable --version curl-install/bin/curl --disable --version
@ -150,7 +147,7 @@ jobs:
timeout-minutes: 10 timeout-minutes: 10
needs: maketgz-and-verify-in-tree needs: maketgz-and-verify-in-tree
steps: steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with: with:
name: 'release-tgz' name: 'release-tgz'
@ -159,7 +156,7 @@ jobs:
echo "::stop-commands::$(uuidgen)" echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97 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
make install make install
curl-install/bin/curl --disable --version curl-install/bin/curl --disable --version
@ -171,7 +168,7 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
needs: maketgz-and-verify-in-tree needs: maketgz-and-verify-in-tree
steps: steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with: with:
name: 'release-tgz' name: 'release-tgz'
@ -193,7 +190,7 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
needs: maketgz-and-verify-in-tree needs: maketgz-and-verify-in-tree
steps: steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with: with:
name: 'release-tgz' name: 'release-tgz'
@ -211,15 +208,15 @@ jobs:
missing-files: missing-files:
name: 'missing files' name: 'missing files'
runs-on: ubuntu-slim runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
needs: maketgz-and-verify-in-tree needs: maketgz-and-verify-in-tree
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with: with:
name: 'release-tgz' name: 'release-tgz'
@ -231,7 +228,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
@ -251,25 +248,21 @@ jobs:
cmake-integration: cmake-integration:
name: 'CM integration ${{ matrix.image }}' name: 'CM integration ${{ matrix.image }}'
runs-on: ${{ matrix.image }} runs-on: ${{ matrix.image }}
timeout-minutes: 15 timeout-minutes: 10
defaults: defaults:
run: run:
shell: ${{ contains(matrix.image, 'windows') && 'msys2 {0}' || 'bash' }} shell: ${{ contains(matrix.image, 'windows') && 'msys2 {0}' || 'bash' }}
env: env:
CC: ${{ !contains(matrix.image, 'windows') && 'clang' || '' }} CC: ${{ !contains(matrix.image, 'windows') && 'clang' || '' }}
MAKEFLAGS: ${{ contains(matrix.image, 'macos') && '-j 4' || '-j 5' }}
MATRIX_IMAGE: '${{ matrix.image }}' MATRIX_IMAGE: '${{ matrix.image }}'
TESTOPTS: ${{ contains(matrix.image, 'macos') && '-D_CURL_PREFILL=ON' || '' }} ${{ contains(matrix.image, 'windows') && '-DCMAKE_UNITY_BUILD_BATCH_SIZE=30' || '' }} 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_VERSION: 3.11.4
OLD_CMAKE_SHA256_LINUX_ARM: 807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1
OLD_CMAKE_SHA256_MACOS_UNI: 0976d23d982af05dcbfb3aa34fcb62ead43bea27f0e3bb95222f2a78161423f2
OLD_CMAKE_SHA256_WIN_INTEL: 2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
image: [ubuntu-26.04-arm, macos-latest, windows-2022] image: [ubuntu-latest, macos-latest, windows-2022]
steps: steps:
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0 - uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2
if: ${{ contains(matrix.image, 'windows') }} if: ${{ contains(matrix.image, 'windows') }}
with: with:
msystem: mingw64 msystem: mingw64
@ -278,37 +271,33 @@ jobs:
cache: false cache: false
path-type: inherit path-type: inherit
install: >- install: >-
perl 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 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' - name: 'install prereqs'
timeout-minutes: 3
run: | run: |
if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
cd ~ cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location --proto-redir =https "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output pkg.bin --location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output bin.zip
sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${OLD_CMAKE_SHA256_WIN_INTEL}" && unzip -q pkg.bin && rm -f pkg.bin unzip -q bin.zip
rm -f bin.zip
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-win64-x64/bin/cmake.exe > ~/old-cmake-path.txt printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-win64-x64/bin/cmake.exe > ~/old-cmake-path.txt
elif [[ "${MATRIX_IMAGE}" = *'ubuntu'* ]]; then elif [[ "${MATRIX_IMAGE}" = *'ubuntu'* ]]; then
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print sudo rm -f /var/lib/man-db/auto-update
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libssl-dev sudo apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libssl-dev
cd ~ cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location --proto-redir =https "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-aarch64.tar.gz" --output pkg.bin --location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-x86_64.tar.gz" | tar -xz
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-x86_64/bin/cmake > ~/old-cmake-path.txt
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Linux-aarch64/bin/cmake > ~/old-cmake-path.txt
else else
brew install libpsl openssl brew install libpsl openssl
cd ~ cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location --proto-redir =https "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-macos-universal.tar.gz" --output pkg.bin --location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Darwin-x86_64.tar.gz" | tar -xz
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}"-Darwin-x86_64/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-macos-universal/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
fi fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
@ -321,16 +310,6 @@ jobs:
run: ./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON run: ./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package' - name: 'via find_package'
run: ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON 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)' - name: 'via ExternalProject (old cmake)'
if: ${{ contains(matrix.image, 'ubuntu') }} if: ${{ contains(matrix.image, 'ubuntu') }}
@ -370,41 +349,3 @@ jobs:
export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DOPENSSL_ROOT_DIR=C:/msys64/mingw64' export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DOPENSSL_ROOT_DIR=C:/msys64/mingw64'
fi fi
./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
verify-tarball-downloads:
name: 'Verify tarball downloads'
runs-on: ubuntu-slim
timeout-minutes: 2
steps:
- name: 'download and import GPG key'
env:
CURL_GPG_ID: 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2
run: |
for keyserver in \
https://keyserver.ubuntu.com/ \
https://pgpkeys.eu/ \
; do
echo "--- Downloading from ${keyserver}..."
if curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
"${keyserver}pks/lookup?op=get&options=mr&exact=on&search=0x${CURL_GPG_ID}" \
| gpg --batch --keyserver-options timeout=15 --display-charset utf-8 --keyid-format 0xlong --import --status-fd 1 2>&1; then
break
fi
done
- name: 'download and verify tarballs'
run: |
echo "--- Detecting latest curl tarball version..."
curl_version="$(curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused https://curl.se/info.json \
| jq --raw-output .Version)"
for suffix in .tar.bz2 .tar.gz .tar.xz .zip; do
echo "--- Downloading ${curl_version} ${suffix}..."
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--output pkg.bin "https://curl.se/download/curl-${curl_version}${suffix}" \
--output pkg.sig "https://curl.se/download/curl-${curl_version}${suffix}.asc"
echo "--- Verifying ${curl_version} ${suffix}..."
gpg --batch --keyserver-options timeout=15 --display-charset utf-8 --keyid-format 0xlong --verify-options show-primary-uid-only \
--verify pkg.sig pkg.bin 2>&1
echo '---'
done

View file

@ -16,8 +16,11 @@ name: 'Fuzzer'
- 'appveyor.*' - 'appveyor.*'
- 'CMake/**' - 'CMake/**'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'tests/data/**' - 'tests/data/**'
- 'winbuild/**'
pull_request: pull_request:
branches: branches:
- master - master
@ -28,19 +31,14 @@ name: 'Fuzzer'
- 'appveyor.*' - 'appveyor.*'
- 'CMake/**' - 'CMake/**'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'tests/data/**' - 'tests/data/**'
- 'winbuild/**'
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
permissions: {} permissions: {}
env:
DO_NOT_TRACK: '1'
jobs: jobs:
Fuzzing: 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'

File diff suppressed because it is too large Load diff

View file

@ -2,34 +2,27 @@
# #
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
# This workflow triages pull requests and applies a label based on the # This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request. # paths that are modified in the pull request.
# #
# To use this workflow, you need to set up a .github/labeler.yml file with # To use this workflow, you will need to set up a .github/labeler.yml
# configuration. For more information, see: https://github.com/actions/labeler # file with configuration. For more information, see:
# https://github.com/actions/labeler
name: 'Labeler' name: 'Labeler'
'on': [pull_request_target] # zizmor: ignore[dangerous-triggers] 'on': [pull_request_target] # zizmor: ignore[dangerous-triggers]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {} permissions: {}
env:
DO_NOT_TRACK: '1'
jobs: jobs:
label: label:
name: 'Labeler' name: 'Labeler'
runs-on: ubuntu-slim runs-on: ubuntu-latest
permissions: permissions:
contents: read # To comply with https://github.com/actions/labeler documentation contents: read
pull-requests: write # To edit labels on PRs pull-requests: write
steps: steps:
- uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0 - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6
with: with:
repo-token: '${{ secrets.GITHUB_TOKEN }}' repo-token: '${{ secrets.GITHUB_TOKEN }}'

View file

@ -7,16 +7,16 @@
# outdated systems. # outdated systems.
# #
# Debian stretch is chosen as it closely matches some of the oldest major # Debian stretch is chosen as it closely matches some of the oldest major
# versions we support (especially cmake); see docs/DEPENDENCIES.md and it # versions we support (especially cmake); see docs/INTERNALS.md and it
# is still supported (as of this writing). # is still supported (as of this writing).
# stretch has ELTS support from Freexian until 2027-06-30 # 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/ # 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. # verification may need to be disabled.
# httrack is one of the smallest downloaders, needed to bootstrap ELTS, # 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': 'on':
push: push:
@ -28,7 +28,10 @@ name: 'Linux Old'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
pull_request: pull_request:
branches: branches:
- master - master
@ -37,26 +40,23 @@ name: 'Linux Old'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {} permissions: {}
env: env:
MAKEFLAGS: -j 5 MAKEFLAGS: -j 5
CURL_CI: github CURL_CI: github
CURL_TEST_MIN: 1560
DEBIAN_FRONTEND: noninteractive DEBIAN_FRONTEND: noninteractive
DO_NOT_TRACK: '1'
jobs: jobs:
cmake-autotools: cmake-autotools:
name: 'autotools & cmake' name: 'cmake & autotools'
runs-on: ubuntu-latest runs-on: 'ubuntu-latest'
container: debian:stretch-20220622-slim@sha256:c5cd3ffceeb25b683bf5111ea89bf8049a177e00fb237235d48076a19cc80097 container: 'debian:stretch'
steps: steps:
- name: 'install prereqs' - name: 'install prereqs'
@ -67,119 +67,90 @@ jobs:
# See comment above if this fails after 2025-05-20 # 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 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 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 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 update
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends \ 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
make automake autoconf libtool ninja-build gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libkrb5-dev libldap2-dev stunnel4
# GitHub's actions/checkout needs newer glibc and libstdc++. The latter also depends on # 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. # 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/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 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)' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: with:
persist-credentials: false persist-credentials: false
- name: 'CM build-only configure (out-of-tree)' - name: 'cmake build-only (out-of-tree, libssh2)'
run: | run: |
~/cmake/bin/cmake -B bld-1 -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ mkdir bld-1
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF 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' - name: 'cmake build-only curl_config.h'
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'
run: | run: |
echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-1/lib/curl_config.h | sort || true grep -F '#define' bld-1/lib/curl_config.h | sort || true
# when this job can get libssh 0.9.0 or greater, this should get that enabled again # when this job can get a libssh version 0.9.0 or later, this should get
# when this job can get c-ares 1.16.0 or greater, this should get that enabled again # that enabled again
- name: 'cmake generate (out-of-tree, c-ares, zstd, gssapi)'
- name: 'CM configure (out-of-tree, zstd, gssapi)'
run: | run: |
~/cmake/bin/cmake -B bld-oldie -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ mkdir bld-cares
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF \ 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 -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
- name: 'CM configure log' - name: 'cmake curl_config.h'
if: ${{ !cancelled() }}
run: cat bld-oldie/CMakeFiles/CMake*.log 2>/dev/null || true
- name: 'CM curl_config.h'
run: | run: |
echo '::group::raw'; cat bld-oldie/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld-cares/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-oldie/lib/curl_config.h | sort || true grep -F '#define' bld-cares/lib/curl_config.h | sort || true
- name: 'CM build' - name: 'cmake build'
run: ~/cmake/bin/cmake --build bld-oldie run: |
make -C bld-cares
bld-cares/src/curl --disable --version
- name: 'CM curl -V' - name: 'cmake install'
run: bld-oldie/src/curl --disable --version run: make -C bld-cares install
- name: 'CM install' - name: 'cmake build tests'
run: ~/cmake/bin/cmake --install bld-oldie run: make -C bld-cares testdeps
- name: 'CM build tests' - name: 'cmake run tests'
run: ~/cmake/bin/cmake --build bld-oldie --target testdeps run: make -C bld-cares test-ci
- name: 'CM run tests' - name: 'cmake build examples'
run: ~/cmake/bin/cmake --build bld-oldie --target test-ci run: make -C bld-cares curl-examples-build
- name: 'CM build examples' - name: 'autoreconf'
run: ~/cmake/bin/cmake --build bld-oldie --target curl-examples-build run: autoreconf -if
- name: 'AM autoreconf' - name: 'configure (out-of-tree, c-ares, libssh2, zstd, gssapi)'
run: autoreconf -fi
- name: 'AM configure (out-of-tree, zstd, gssapi)'
run: | run: |
mkdir bld-am mkdir bld-am
cd bld-am cd bld-am
../configure --prefix="$PWD"/../curl-install-am --enable-unity --enable-warnings --enable-werror --disable-shared \ ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \ --with-gnutls --enable-ares --with-libssh2 --with-zstd --with-gssapi --with-librtmp \
--without-ssl --disable-ares --without-libssh2 --with-zstd --with-gssapi --prefix="$PWD"/../curl-install-am
- name: 'AM configure log' - name: 'autotools curl_config.h'
if: ${{ !cancelled() }}
run: cat bld-am/config.log 2>/dev/null || true
- name: 'AM curl_config.h'
run: | run: |
echo '::group::raw'; cat bld-am/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld-am/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-am/lib/curl_config.h | sort || true grep -F '#define' bld-am/lib/curl_config.h | sort || true
- name: 'AM build' - name: 'autotools build'
run: make -C bld-am run: |
make -C bld-am
bld-am/src/curl --disable --version
- name: 'AM curl -V' - name: 'autotools install'
run: bld-am/src/curl --disable --version
- name: 'AM install'
run: make -C bld-am install run: make -C bld-am install
- name: 'AM build tests' - name: 'autotools build tests'
run: make -C bld-am/tests all 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/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
pull_request: pull_request:
branches: branches:
- master - master
@ -23,7 +26,10 @@ name: 'macOS'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -31,38 +37,31 @@ concurrency:
permissions: {} permissions: {}
# Apple APIs and the macos-version-min value required to avoid deprecation # Deprecated Apple APIs and the macos-version-min value required to avoid
# warnings with llvm/clang, and/or the feature getting enabled at build-time # deprecation warnings with llvm/clang:
# or runtime: #
# - 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), memset_s(), OCSP (runtime)
# - 10.10 Yosemite (2014) - SYS_recvmsg_x, SYS_sendmsg_x (build-time)
# - 10.11 El Capitan (2015) - connectx() (runtime)
# - 10.12 Sierra (2016) - clock_gettime() (build-time, runtime)
# - 10.14 Mojave (2018) - SecTrustEvaluateWithError() (runtime), GSS Framework
env: env:
CURL_CI: github CURL_CI: github
CURL_TEST_MIN: 1750
DO_NOT_TRACK: '1'
HOMEBREW_NO_INSTALL_CLEANUP: '1'
MAKEFLAGS: -j 4 MAKEFLAGS: -j 4
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
jobs: jobs:
ios: ios:
name: "iOS, ${{ (matrix.build.generator && format('CM-{0}', matrix.build.generator)) || (matrix.build.generate && 'CM' || 'AM' )}} ${{ matrix.build.name }} arm64" 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 timeout-minutes: 10
env: env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: 'clang' CC: ${{ matrix.build.compiler || 'clang' }}
LDFLAGS: '' LDFLAGS: ''
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }} MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_OPTIONS: ${{ matrix.build.options }} MATRIX_OPTIONS: ${{ matrix.build.options }}
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com # renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.3.1 LIBRESSL_VERSION: 4.1.0
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -74,8 +73,16 @@ jobs:
- name: 'libressl' - name: 'libressl'
install_steps: libressl install_steps: libressl
# FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it. # 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 generator: Xcode
xcode: '' # default Xcode. Set it once to silence actionlint.
options: --config Debug options: --config Debug
generate: >- generate: >-
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF
@ -83,25 +90,14 @@ jobs:
-DOPENSSL_INCLUDE_DIR=/Users/runner/libressl/include -DOPENSSL_INCLUDE_DIR=/Users/runner/libressl/include
-DOPENSSL_SSL_LIBRARY=/Users/runner/libressl/lib/libssl.a -DOPENSSL_SSL_LIBRARY=/Users/runner/libressl/lib/libssl.a
-DOPENSSL_CRYPTO_LIBRARY=/Users/runner/libressl/lib/libcrypto.a -DOPENSSL_CRYPTO_LIBRARY=/Users/runner/libressl/lib/libcrypto.a
-DCURL_USE_LIBPSL=OFF -DCURL_ENABLE_NTLM=ON -DCURL_USE_LIBPSL=OFF
steps: steps:
- name: 'brew install' - name: 'brew install'
if: ${{ matrix.build.configure }} if: ${{ matrix.build.configure }}
timeout-minutes: 5
run: | run: |
# shellcheck disable=SC2181 # shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do 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
for i in 1 2 3; do
if brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions' - name: 'toolchain versions'
run: | run: |
@ -110,13 +106,12 @@ jobs:
xcodebuild -sdk -version | grep '^Path:' || true xcodebuild -sdk -version | grep '^Path:' || true
xcrun --sdk iphoneos --show-sdk-path 2>/dev/null || true xcrun --sdk iphoneos --show-sdk-path 2>/dev/null || true
xcrun --sdk iphoneos --show-sdk-version || 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::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' - name: 'cache libressl'
if: ${{ contains(matrix.build.install_steps, 'libressl') }} if: ${{ contains(matrix.build.install_steps, 'libressl') }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
id: cache-libressl id: cache-libressl
env: env:
cache-name: cache-libressl cache-name: cache-libressl
@ -125,13 +120,14 @@ jobs:
key: iOS-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }} key: iOS-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
- name: 'build libressl' - name: 'build libressl'
if: ${{ contains(matrix.build.install_steps, 'libressl') && !steps.cache-libressl.outputs.cache-hit }} if: ${{ contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true' }}
run: | run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \ curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location --proto-redir =https "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin --location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" | tar -x
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "libressl-${LIBRESSL_VERSION}" cd "libressl-${LIBRESSL_VERSION}"
# FIXME: on the 4.0.1 release, delete '-DHAVE_ENDIAN_H=0'
cmake -B . -G Ninja \ cmake -B . -G Ninja \
-DHAVE_ENDIAN_H=0 \
-DCMAKE_INSTALL_PREFIX=/Users/runner/libressl \ -DCMAKE_INSTALL_PREFIX=/Users/runner/libressl \
-DCMAKE_SYSTEM_NAME=iOS \ -DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \ -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
@ -141,7 +137,7 @@ jobs:
cmake --build . cmake --build .
cmake --install . --verbose cmake --install . --verbose
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
@ -159,13 +155,13 @@ jobs:
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos # 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}" [ -n "${MATRIX_GENERATOR}" ] && options="-G ${MATRIX_GENERATOR}"
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \ 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 \ -DCMAKE_SYSTEM_NAME=iOS \
-DUSE_APPLE_IDN=ON \ -DUSE_APPLE_IDN=ON \
${MATRIX_GENERATE} ${options} ${MATRIX_GENERATE} ${options}
else else
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \ 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)" \ CFLAGS="-isysroot $(xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)" \
--host=aarch64-apple-darwin \ --host=aarch64-apple-darwin \
--with-apple-idn \ --with-apple-idn \
@ -181,16 +177,6 @@ jobs:
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'libcurl.pc, curl-config'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
if command -v pccritic >/dev/null 2>&1; then
pccritic --version
pccritic --min-score 98 bld/libcurl.pc
fi
- name: 'build' - name: 'build'
run: | run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
@ -200,12 +186,9 @@ jobs:
fi fi
- name: 'curl info' - name: 'curl info'
run: | run: find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -exec file '{}' \;
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' --
- name: 'build tests' - name: 'build tests'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: | run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target testdeps --verbose cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target testdeps --verbose
@ -214,7 +197,6 @@ jobs:
fi fi
- name: 'build examples' - name: 'build examples'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: | run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target curl-examples-build --verbose cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target curl-examples-build --verbose
@ -223,222 +205,157 @@ jobs:
fi fi
macos: macos:
name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.compiler }} ${{ matrix.build.name }}" name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.build.name }}"
runs-on: ${{ matrix.build.image || 'macos-15' }} runs-on: 'macos-15'
timeout-minutes: 15 timeout-minutes: 45
env: env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" 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_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_COMPILER: '${{ matrix.build.compiler }}' MATRIX_COMPILER: '${{ matrix.compiler }}'
MATRIX_INSTALL: '${{ matrix.build.install }}' MATRIX_INSTALL: '${{ matrix.build.install }}'
MATRIX_INSTALL_STEPS: '${{ matrix.build.install_steps }}' MATRIX_INSTALL_STEPS: '${{ matrix.build.install_steps }}'
MATRIX_MACOS_VERSION_MIN: '${{ matrix.build.macos-version-min }}' MATRIX_MACOS_VERSION_MIN: '${{ matrix.build.macos-version-min }}'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
compiler: [clang, llvm@18, gcc-12]
build: build:
# autotools
- name: '!ssl !debug brotli zstd' - name: '!ssl !debug brotli zstd'
compiler: gcc-13 compiler: clang
configure: --without-ssl --with-brotli --with-zstd --with-apple-idn install: brotli zstd
tflags: '--min=1520' configure: --without-ssl --with-brotli --with-zstd
xcode: '' # default Xcode. Set it once to silence actionlint. - name: '!ssl !debug'
compiler: gcc-12
configure: --without-ssl
- name: '!ssl'
compiler: clang
configure: --enable-debug --without-ssl
- name: '!ssl libssh2 AppleIDN' - name: '!ssl libssh2 AppleIDN'
compiler: clang compiler: clang
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH2=ON -DUSE_APPLE_IDN=ON -DCURL_ENABLE_SSL=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_HTTPSIG=OFF configure: --enable-debug --with-libssh2=/opt/homebrew/opt/libssh2 --without-ssl --with-apple-idn
tflags: '--min=1630'
- name: 'OpenSSL libssh c-ares' - name: 'OpenSSL libssh c-ares'
compiler: clang compiler: clang
install: openssl@4 libssh install: libssh
configure: --enable-debug --with-libssh --with-openssl=/opt/homebrew/opt/openssl@4 --enable-ech --enable-ares --with-fish-functions-dir --with-zsh-functions-dir configure: --enable-debug --with-libssh --with-openssl=/opt/homebrew/opt/openssl --enable-ares --with-fish-functions-dir --with-zsh-functions-dir
- name: 'OpenSSL libssh' - name: 'OpenSSL libssh'
compiler: llvm@18 compiler: llvm@18
install: libssh 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 configure: --enable-debug --with-libssh --with-openssl=/opt/homebrew/opt/openssl --with-openssl-quic
- name: '!ssl c-ares'
- name: '!ssl HTTP-only c-ares'
macos-version-min: '10.15' # Catalina (2019)
compiler: clang compiler: clang
tflags: '--min=960' configure: --enable-debug --enable-ares --without-ssl
generate: >- - name: '!ssl HTTP-only'
-DENABLE_DEBUG=ON -DENABLE_ARES=ON compiler: clang
-DCURL_ENABLE_SSL=OFF -DHTTP_ONLY=ON configure: >-
-DCURL_DISABLE_ALTSVC=ON -DENABLE_UNIX_SOCKETS=OFF --enable-debug
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_NGHTTP2=OFF --disable-alt-svc --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap
-DCURL_USE_GSSAPI=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF --disable-ldap --disable-pop3 --without-librtmp --disable-rtsp
-DCURL_BROTLI=OFF -DCURL_ZLIB=OFF -DCURL_ZSTD=OFF --disable-shared --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets
-DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF --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 compiler: clang
install: libressl install: libressl
install_steps: pytest install_steps: pytest
generate: >- configure: --enable-debug --with-openssl=/opt/homebrew/opt/libressl
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF - name: 'OpenSSL'
-DCURL_USE_LIBSSH2=OFF -DCURL_ENABLE_NTLM=ON
- name: 'OpenSSL 10.15 C89'
macos-version-min: '10.15'
compiler: clang compiler: clang
install: libnghttp3 libngtcp2 install: libnghttp3 libngtcp2
install_steps: pytest install_steps: pytest
generate: >- configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl --with-ngtcp2
-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 -DUSE_PROXY_HTTP3=ON
- name: 'OpenSSL SecTrust krb5'
compiler: clang
install: libnghttp3 libngtcp2
install_steps: pytest
configure: >-
--enable-debug --with-openssl=/opt/homebrew/opt/openssl --with-ngtcp2 --with-apple-sectrust --enable-ntlm --enable-proxy-http3 --with-gssapi
--enable-apple-fast-udp
- name: 'OpenSSL event-based' - name: 'OpenSSL event-based'
compiler: clang 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 configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl
tflags: '--test-event --min=1400' tflags: --test-event
- name: 'quictls libssh2 !ldap 10.15'
- name: 'OpenSSL gsasl AppleIDN SecTrust +examples'
compiler: clang compiler: clang
install: openssl@4 libnghttp3 libngtcp2 gsasl install: quictls
generate: >- configure: --enable-debug --disable-ldap --with-openssl=/opt/homebrew/opt/quictls LDFLAGS=-L/opt/homebrew/opt/quictls/lib
-DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@4 -DUSE_ECH=ON -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON -DUSE_NGTCP2=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON macos-version-min: '10.15'
-DUSE_APPLE_SECTRUST=ON -DCURL_ENABLE_NTLM=ON -DUSE_PROXY_HTTP3=ON # 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' - name: 'MultiSSL AppleIDN clang-tidy +examples'
image: macos-26
compiler: clang compiler: clang
install: llvm gnutls nettle libressl krb5 mbedtls gsasl rustls-ffi libssh fish install: llvm brotli zstd gnutls nettle mbedtls gsasl rtmpdump fish
install_steps: skiprun install_steps: clang-tidy
CFLAGS: -Wunused-macros 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 chkprefill: _chkprefill
generate: >- - name: 'quictls +static libssh +examples'
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DEFAULT_SSL_BACKEND=openssl install: quictls libssh
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON generate: -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/quictls -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON - name: 'LibreSSL openldap heimdal c-ares +examples'
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5 install: libressl heimdal openldap
-DCURL_BROTLI=ON -DCURL_ZSTD=ON 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
-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
CFLAGS: -Wunused-macros
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 -DUSE_PROXY_HTTP3=ON -DCURL_ENABLE_APPLE_FAST_UDP=ON
- name: 'LibreSSL openldap AppleGSS 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 -DCURL_GSS_FLAVOR=Apple
-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' - name: 'wolfSSL !ldap brotli zstd'
compiler: clang
install: brotli wolfssl zstd install: brotli wolfssl zstd
install_steps: pytest install_steps: pytest
generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON -DCURL_DISABLE_HTTPSIG=OFF generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON
- name: 'mbedTLS !ldap brotli zstd MultiSSL AppleIDN' - name: 'mbedTLS !ldap brotli zstd MultiSSL AppleIDN'
compiler: llvm@18 compiler: llvm@18
install: brotli mbedtls zstd install: brotli mbedtls zstd
install_steps: codeset-test1 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 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'
- name: 'GnuTLS !ldap krb5 +examples'
compiler: clang
install: gnutls nettle krb5 install: gnutls nettle krb5
install_steps: codeset-test2 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
generate: >- - name: 'aws-lc'
-DENABLE_DEBUG=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF compiler: gcc-12
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON
- name: 'aws-lc +analyzer'
compiler: gcc-15
install: aws-lc install: aws-lc
generate: >- 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
-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
- name: 'Rustls' - name: 'Rustls'
compiler: clang compiler: clang
install: rustls-ffi install: rustls-ffi
generate: -DENABLE_DEBUG=ON -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON -DCURL_ENABLE_NTLM=ON generate: -DENABLE_DEBUG=ON -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON
tflags: '--min=1730' - name: 'OpenSSL torture !FTP'
- name: 'OpenSSL torture 1'
compiler: clang compiler: clang
install: openssl@4 install: libnghttp3
install_steps: torture install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@4 -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON 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 --subset=0/3' tflags: -t --shallow=25 !FTP
- name: 'OpenSSL torture FTP'
- name: 'OpenSSL torture 2'
compiler: clang compiler: clang
install: openssl@4 install: libnghttp3
install_steps: torture install_steps: torture
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@4 -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON 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 --subset=1/3' tflags: -t --shallow=20 FTP
exclude:
- name: 'OpenSSL torture 3' # opt out jobs from combinations that have the compiler set manually
compiler: clang - { compiler: llvm@18, build: { compiler: 'clang' } }
install: openssl@4 - { compiler: llvm@18, build: { compiler: 'gcc-12' } }
install_steps: torture - { compiler: gcc-12, build: { compiler: 'clang' } }
generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@4 -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON - { compiler: gcc-12, build: { compiler: 'llvm@18' } }
tflags: '-t --shallow=25 --subset=2/3' - { compiler: clang, build: { compiler: 'gcc-12' } }
- { compiler: clang, build: { compiler: 'llvm@18' } }
steps: steps:
- name: 'brew unlink openssl'
if: ${{ contains(matrix.build.install, 'aws-lc') || contains(matrix.build.install, 'libressl') || contains(matrix.build.install, 'openssl@4') }}
run: |
if [ -d "$(brew --prefix)"/include/openssl ]; then
brew unlink openssl
fi
- name: 'brew install' - name: 'brew install'
timeout-minutes: 5
# Run this command with retries because of spurious failures seen # Run this command with retries because of spurious failures seen
# while running the tests, for example # while running the tests, for example
# https://github.com/curl/curl/runs/4095721123?check_suite_focus=true # https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
env: env:
INSTALL_PACKAGES: >- INSTALL_PACKAGES: >-
${{ matrix.build.generate && 'ninja' || 'automake libtool' }} ${{ 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' || '' }} ${{ contains(matrix.build.install_steps, 'pytest') && 'caddy httpd vsftpd' || '' }}
run: | run: |
# shellcheck disable=SC2181 echo pkgconf libpsl libssh2 ${INSTALL_PACKAGES} ${MATRIX_INSTALL} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
while [[ $? == 0 ]]; do # shellcheck disable=SC2181,SC2034
for i in 1 2 3; do 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
if brew install pkgconf libpsl libssh2 ${INSTALL_PACKAGES} ${MATRIX_INSTALL}; then
break 2 - name: 'brew unlink openssl'
else if: ${{ contains(matrix.build.install, 'aws-lc') || contains(matrix.build.install, 'libressl') || contains(matrix.build.install, 'quictls') }}
echo "Error: wait to try again: $i" run: |
sleep 10 if [ -d /opt/homebrew/include/openssl ]; then
brew unlink openssl
fi fi
done
false Too many retries
done
- name: 'toolchain versions' - name: 'toolchain versions'
run: | run: |
@ -450,9 +367,9 @@ jobs:
xcrun --sdk macosx --show-sdk-version || true xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || true ls -l /Library/Developer/CommandLineTools/SDKs || true
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; 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::'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
@ -462,7 +379,6 @@ jobs:
- name: 'configure' - name: 'configure'
env: env:
CFLAGS: '${{ matrix.build.CFLAGS }}'
MATRIX_CHKPREFILL: '${{ matrix.build.chkprefill }}' MATRIX_CHKPREFILL: '${{ matrix.build.chkprefill }}'
MATRIX_CONFIGURE: '${{ matrix.build.configure }}' MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}' MATRIX_GENERATE: '${{ matrix.build.generate }}'
@ -487,7 +403,7 @@ jobs:
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF' [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G Ninja -D_CURL_PREFILL=ON \ cmake -B "bld${_chkprefill}" -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \ -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_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \ -DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
${MATRIX_GENERATE} ${options} ${MATRIX_GENERATE} ${options}
@ -497,6 +413,7 @@ jobs:
false false
fi fi
else else
export CFLAGS
if [[ "${MATRIX_COMPILER}" = 'llvm'* ]]; then if [[ "${MATRIX_COMPILER}" = 'llvm'* ]]; then
options+=" --target=$(uname -m)-apple-darwin" options+=" --target=$(uname -m)-apple-darwin"
fi fi
@ -506,9 +423,9 @@ jobs:
fi fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}" [ -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 [[ "${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 \ mkdir bld && cd bld && ../configure --prefix="$PWD"/curl-install --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \ --disable-dependency-tracking \
--with-libpsl="$(brew --prefix libpsl)" \ --with-libpsl=/opt/homebrew/opt/libpsl \
${MATRIX_CONFIGURE} ${options} ${MATRIX_CONFIGURE} ${options}
fi fi
@ -521,16 +438,6 @@ jobs:
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'libcurl.pc, curl-config'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
if command -v pccritic >/dev/null 2>&1; then
pccritic --version
pccritic --min-score 96 bld/libcurl.pc
fi
- name: 'test configs' - name: 'test configs'
run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
@ -542,11 +449,8 @@ jobs:
make -C bld V=1 make -C bld V=1
fi fi
- name: 'curl -V' - name: 'curl version'
run: | run: bld/src/curl --disable --version
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 install' - name: 'curl install'
run: | run: |
@ -557,7 +461,6 @@ jobs:
fi fi
- name: 'build tests' - name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
run: | run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target testdeps cmake --build bld --verbose --target testdeps
@ -566,39 +469,26 @@ jobs:
fi fi
- name: 'install test prereqs' - 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: | run: |
python3 -m venv ~/venv python3 -m venv ~/venv
if bld/src/curl --disable -V 2>/dev/null | grep smb; then source ~/venv/bin/activate
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt python3 -m pip install -r tests/requirements.txt
fi
- name: 'run tests' - 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 }} timeout-minutes: ${{ contains(matrix.build.install_steps, 'torture') && 20 || 10 }}
env: env:
TEST_TARGET: ${{ contains(matrix.build.install_steps, 'torture') && 'test-torture' || 'test-ci' }} TEST_TARGET: ${{ contains(matrix.build.install_steps, 'torture') && 'test-torture' || 'test-ci' }}
TFLAGS: '${{ matrix.build.tflags }}' TFLAGS: '${{ matrix.build.tflags }}'
run: | run: |
TFLAGS="-j20 ${TFLAGS}" 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 source ~/venv/bin/activate
if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test1'* ]]; then if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test'* ]]; then
locale || true locale || true
unset LANG export LC_ALL=C
unset LC_ALL
unset LC_COLLATE
unset LC_MESSAGES
unset LC_MONETARY
unset LC_TIME
export LC_CTYPE=C export LC_CTYPE=C
export LC_NUMERIC=fr_FR.UTF-8 export LC_NUMERIC=fr_FR.UTF-8
elif [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test2'* ]]; then
locale || true
unset LC_ALL
export LC_TIME=fr_FR
fi fi
rm -f ~/.curlrc rm -f ~/.curlrc
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
@ -608,13 +498,13 @@ jobs:
fi fi
- name: 'install pytest prereqs' - 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: | run: |
[ -d ~/venv ] || python3 -m venv ~/venv source ~/venv/bin/activate
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt python3 -m pip install -r tests/http/requirements.txt
- name: 'run pytest' - 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: env:
PYTEST_ADDOPTS: '--color=yes' PYTEST_ADDOPTS: '--color=yes'
PYTEST_XDIST_AUTO_NUM_WORKERS: 4 PYTEST_XDIST_AUTO_NUM_WORKERS: 4
@ -636,7 +526,7 @@ jobs:
fi fi
combinations: # Test buildability with host OS, Xcode / SDK, compiler, target-OS, built tool, combinations 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 }} runs-on: ${{ matrix.image }}
timeout-minutes: 10 timeout-minutes: 10
env: env:
@ -649,64 +539,58 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
# Sources: compiler: [gcc-12, gcc-13, gcc-14, llvm@15, llvm@18, clang]
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md # Xcode support matrix as of 2024-07, with default macOS SDK versions and OS names, years:
# 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:
# * = default Xcode on the runner. # * = default Xcode on the runner.
# 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-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-15: *16.0, 16.1
# macos-26: 16.4 *26.0 # macOSSDK: 13.0, 13.1, 13.3, 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1
# macOSSDK: 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1, 15.2, 15.4, 15.5, 26.0 # Ventura (2022) Sonoma (2023) Sequoia (2024)
# Sonoma (2023) Sequoia (2024) Tahoe (2025)
# https://github.com/actions/runner-images/tree/main/images/macos # https://github.com/actions/runner-images/tree/main/images/macos
# https://en.wikipedia.org/wiki/MacOS_version_history # 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 xcode: [''] # default Xcodes
macos-version-min: [''] macos-version-min: ['']
build: [autotools, cmake] build: [autotools, cmake]
exclude: exclude:
# Combinations not covered by runner images: # 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@18' }
- { image: macos-14, compiler: 'llvm@20' }
- { image: macos-15, compiler: 'llvm@15' } - { 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 # Reduce build combinations, by dropping less interesting ones
- { image: macos-26, compiler: 'gcc-13' } - { compiler: gcc-13, build: cmake }
- { compiler: 'gcc-14' , build: cmake } - { compiler: gcc-14, build: autotools }
# Reduce autotools to only 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 }
steps: steps:
- name: 'install autotools' - name: 'install autotools'
if: ${{ matrix.build == 'autotools' }} if: ${{ matrix.build == 'autotools' }}
run: | run: |
# shellcheck disable=SC2181 # shellcheck disable=SC2181,SC2034
while [[ $? == 0 ]]; do 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
for i in 1 2 3; do
if brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions' - name: 'toolchain versions'
run: | run: |
@ -717,11 +601,10 @@ jobs:
xcrun --sdk macosx --show-sdk-path 2>/dev/null || true xcrun --sdk macosx --show-sdk-path 2>/dev/null || true
xcrun --sdk macosx --show-sdk-version || true xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || 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::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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
@ -733,7 +616,7 @@ jobs:
run: | 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 # 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 fi
if [[ "${MATRIX_COMPILER}" = 'gcc'* ]]; then if [[ "${MATRIX_COMPILER}" = 'gcc'* ]]; then
@ -752,7 +635,7 @@ jobs:
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && options+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MATRIX_MACOS_VERSION_MIN}" [ -n "${MATRIX_MACOS_VERSION_MIN}" ] && options+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, and libssh2 # would pick up nghttp2, libidn2, and libssh2
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \ 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_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \ -DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \ -DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \
@ -760,8 +643,6 @@ jobs:
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
-DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \ -DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \
-DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \ -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \
-DUSE_APPLE_IDN=ON -DUSE_APPLE_SECTRUST=ON \
-DCURL_USE_GSSAPI=ON -DCURL_GSS_FLAVOR=Apple \
${options} ${options}
else else
export CFLAGS export CFLAGS
@ -774,14 +655,12 @@ jobs:
fi fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}" [ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, but libssh2 is disabled by default # would pick up nghttp2, libidn2, but libssh2 is disabled by default
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-static \ mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \ --disable-dependency-tracking \
--disable-docs --disable-manual \ --disable-docs --disable-manual \
--with-openssl="$(brew --prefix openssl)" \ --with-openssl="$(brew --prefix openssl)" \
--without-nghttp2 --without-libidn2 \ --without-nghttp2 --without-libidn2 \
--without-libpsl \ --without-libpsl \
--with-apple-idn --with-apple-sectrust \
--enable-gssapi-apple \
${options} ${options}
fi fi
@ -794,16 +673,6 @@ jobs:
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'libcurl.pc, curl-config'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
if command -v pccritic >/dev/null 2>&1; then
pccritic --version
pccritic --min-score 94 bld/libcurl.pc
fi
- name: 'build / ${{ matrix.build }}' - name: 'build / ${{ matrix.build }}'
run: | run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
@ -812,8 +681,5 @@ jobs:
make -C bld V=1 make -C bld V=1
fi fi
- name: 'curl -V' - name: 'curl version'
run: | run: bld/src/curl --disable --version
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

View file

@ -14,7 +14,10 @@ name: 'non-native'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
pull_request: pull_request:
branches: branches:
- master - master
@ -23,7 +26,10 @@ name: 'non-native'
- '.circleci/**' - '.circleci/**'
- 'appveyor.*' - 'appveyor.*'
- 'Dockerfile' - 'Dockerfile'
- 'packages/**'
- 'plan9/**'
- 'projects/**' - 'projects/**'
- 'winbuild/**'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
@ -33,348 +39,211 @@ permissions: {}
env: env:
CURL_CI: github CURL_CI: github
CURL_TEST_MIN: 1820
DO_NOT_TRACK: '1'
jobs: jobs:
cross: netbsd:
name: "${{ matrix.os }} ${{ matrix.version }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.cc }} ${{ matrix.desc }} ${{ matrix.arch }}" name: 'NetBSD, CM clang openssl ${{ matrix.arch }}'
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 10
defaults: strategy:
run: matrix:
shell: cpa.sh {0} # zizmor: ignore[misfeature] arch: ['x86_64']
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
env: env:
CC: '${{ matrix.cc }}'
MAKEFLAGS: -j 3
MATRIX_ARCH: '${{ matrix.arch }}' MATRIX_ARCH: '${{ matrix.arch }}'
MATRIX_BUILD: '${{ matrix.build }}' with:
MATRIX_INSTALL: '${{ matrix.install }}' environment_variables: MATRIX_ARCH
MATRIX_OPTIONS: '${{ matrix.options }}' operating_system: 'netbsd'
MATRIX_OS: '${{ matrix.os }}' version: '10.1'
MATRIX_VERSION: '${{ matrix.version }}' architecture: ${{ matrix.arch }}
run: |
# https://pkgsrc.se/
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 \
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=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::'
time cmake --build bld
time cmake --install bld
bld/src/curl --disable --version
if [ "${MATRIX_ARCH}" = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --target testdeps
export TFLAGS='-j8'
time cmake --build bld --target test-ci
fi
echo '::group::build examples'
time cmake --build bld --target curl-examples-build
echo '::endgroup::'
openbsd:
name: 'OpenBSD, CM clang libressl ${{ matrix.arch }}'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
arch: ['x86_64']
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
env:
MATRIX_ARCH: '${{ matrix.arch }}'
with:
environment_variables: MATRIX_ARCH
operating_system: 'openbsd'
version: '7.7'
architecture: ${{ matrix.arch }}
run: |
# https://openbsd.app/
# https://www.openbsd.org/faq/faq15.html
time sudo pkg_add cmake ninja brotli openldap-client-- libssh2 libidn2 libpsl nghttp2 py3-six py3-impacket
time cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=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::'
time cmake --build bld
time cmake --install bld
bld/src/curl --disable --version
if [ "${MATRIX_ARCH}" = 'x86_64' ]; then # Slow on emulated CPU
time cmake --build bld --target testdeps
export TFLAGS='-j8 !2707' # Skip 2707 'ws: Peculiar frame sizes' on suspicion of hangs
time cmake --build bld --target test-ci
fi
echo '::group::build examples'
time cmake --build bld --target curl-examples-build
echo '::endgroup::'
freebsd:
name: "FreeBSD, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} openssl${{ matrix.desc }} ${{ matrix.arch }}"
runs-on: ubuntu-latest
timeout-minutes: 20
strategy: strategy:
matrix: matrix:
include: include:
# https://github.com/DragonFlyBSD/DPorts - { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
# { os: 'dragonflybsd', version: '6.4.2', build: 'autotools', arch: 'x86_64' , cc: 'gcc' , desc: 'openssl', tflags: 'skiprun', - { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF', desc: ' !unity !runtests !examples' }
# install: 'autoconf automake libtool openldap26-client libidn2', - { build: 'autotools', arch: 'arm64', compiler: 'clang' }
# options: '--with-openssl --enable-ldap --enable-ldaps --with-libidn2' } - { build: 'cmake' , arch: 'arm64', compiler: 'clang' }
# { os: 'dragonflybsd', version: '6.4.2', build: 'cmake' , arch: 'x86_64' , cc: 'gcc' , desc: 'openssl', tflags: 'skipall',
# install: 'cmake ninja' }
# https://ports.freebsd.org/
- { os: 'freebsd' , version: '15.1', build: 'autotools', arch: 'x86_64' , cc: 'clang', desc: 'openssl',
install: 'autoconf automake libtool krb5-devel openldap26-client libidn2 stunnel',
options: '--with-openssl --with-gssapi --enable-ldap --enable-ldaps --with-libidn2' }
- { os: 'freebsd' , version: '15.1', build: 'cmake' , arch: 'x86_64' , cc: 'clang', desc: 'openssl !unity !examples', tflags: 'skiprun',
install: 'cmake-core ninja perl5 krb5-devel openldap26-client libidn2',
options: '-DCURL_USE_GSSAPI=ON -DCMAKE_UNITY_BUILD=OFF' }
- { os: 'freebsd' , version: '15.1', build: 'cmake' , arch: 'riscv64', cc: 'clang', desc: 'openssl !examples', tflags: 'HTTP --min=0 --subset=0/10 -R --seed',
install: 'cmake-core ninja perl5',
options: '-D_CURL_PREFILL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_DISABLE_HTTPSIG=OFF -DCURL_DISABLE_TYPECHECK=ON' }
- { os: 'freebsd' , version: '14.3', build: 'autotools', arch: 'arm64' , cc: 'clang', desc: 'openssl !examples', tflags: 'skipall',
install: 'autoconf automake libtool krb5-devel openldap26-client libidn2 stunnel',
options: '--with-openssl --with-gssapi --enable-ldap --enable-ldaps --with-libidn2 --disable-typecheck' }
- { os: 'freebsd' , version: '14.3', build: 'cmake' , arch: 'arm64' , cc: 'clang', desc: 'openssl', tflags: 'skiprun',
install: 'cmake-core ninja perl5 krb5-devel openldap26-client libidn2 stunnel',
options: '-DCURL_USE_GSSAPI=ON -DCURL_DISABLE_TYPECHECK=ON' }
# https://app.midnightbsd.org/
# https://man.midnightbsd.org/cgi-bin/man.cgi/mport
# { os: 'midnightbsd' , version: '4.0.4', build: 'autotools', arch: 'x86_64' , cc: 'clang', desc: 'gnutls !examples', tflags: 'skipall',
# install: 'autoconf autoconf-archive automake libtool gnutls',
# options: '--with-gnutls' }
- { os: 'midnightbsd' , version: '4.0.4', build: 'cmake' , arch: 'x86_64' , cc: 'clang', desc: 'gnutls', tflags: 'skiprun',
install: 'cmake-core ninja perl5 gnutls openldap26-client libidn2',
options: '-DCURL_USE_GNUTLS=ON' }
# https://pkgsrc.se/
- { os: 'netbsd' , version: '10.1' , build: 'autotools', arch: 'x86_64' , cc: 'gcc' , desc: 'openssl !examples', tflags: 'skipall',
install: 'autoconf automake libtool mit-krb5',
options: '--with-openssl --with-gssapi' }
- { os: 'netbsd' , version: '11.0' , build: 'cmake' , arch: 'x86_64' , cc: 'gcc' , desc: 'openssl',
install: 'cmake ninja-build mit-krb5 openldap-client libidn2',
options: '-DCURL_USE_GSSAPI=ON' }
# https://openbsd.app/
# https://www.openbsd.org/faq/faq15.html
# https://github.com/OpenMPT/openmpt/blob/master/.github/workflows/OpenBSD-Autotools.yml
- { os: 'openbsd' , version: '7.9' , build: 'autotools', arch: 'x86_64' , cc: 'clang', desc: 'libressl !examples', tflags: 'skipall',
install: 'autoconf-2.72p0 automake-1.18.1 libtool', # NOTE: also sync these versions with the autoreconf step!
options: '--with-openssl' }
# Skip test 2707 'ws: Peculiar frame sizes' on suspicion of hangs
- { os: 'openbsd' , version: '7.9' , build: 'cmake' , arch: 'x86_64' , cc: 'clang', desc: 'libressl', tflags: '!2707',
install: 'cmake ninja openldap-client-- libidn2' }
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
- name: '${{ matrix.build }}'
- name: 'setup VM' uses: cross-platform-actions/action@e8a7b572196ff79ded1979dc2bb9ee67d1ddb252 # v0.29.0
uses: cross-platform-actions/action@24ef01df165c76df1ed2b9f9e9212e78dc2fc963 # v1.4.0 env:
CC: '${{ matrix.compiler }}'
MATRIX_ARCH: '${{ matrix.arch }}'
MATRIX_BUILD: '${{ matrix.build }}'
MATRIX_DESC: '${{ matrix.desc }}'
MATRIX_OPTIONS: '${{ matrix.options }}'
with: with:
environment_variables: 'CC CURL_CI CURL_TEST_MIN DO_NOT_TRACK MAKEFLAGS MATRIX_ARCH MATRIX_BUILD MATRIX_INSTALL MATRIX_OPTIONS MATRIX_OS MATRIX_VERSION TFLAGS' environment_variables: CC MATRIX_ARCH MATRIX_BUILD MATRIX_DESC MATRIX_OPTIONS
operating_system: '${{ matrix.os }}' operating_system: 'freebsd'
version: '${{ matrix.version }}' version: '14.3'
architecture: '${{ matrix.arch }}' architecture: ${{ matrix.arch }}
- name: 'install prereqs'
run: | run: |
if [ "${MATRIX_OS}" = 'dragonflybsd' ]; then export CURL_CI=github
sudo pkg install -y pkgconf brotli libnghttp2 ${MATRIX_INSTALL}
elif [ "${MATRIX_OS}" = 'freebsd' ]; then
sudo pkg install -y pkgconf brotli libnghttp2 ${MATRIX_INSTALL}
elif [ "${MATRIX_OS}" = 'midnightbsd' ]; then
if [ "${MATRIX_BUILD}" = 'autotools' ]; then
sudo mport index | grep -v -E 'Downloading.+%'
sudo mport upgrade | grep -v -E '(Downloading.+%|^/usr/local)'
fi
sudo mport install pkgconf brotli libnghttp2 ${MATRIX_INSTALL} | grep -v -E '(Downloading.+%|^/usr/local)' || true
elif [ "${MATRIX_OS}" = 'netbsd' ]; then
sudo pkgin -y install pkg-config perl brotli libssh2 libpsl nghttp2 ${MATRIX_INSTALL}
elif [ "${MATRIX_OS}" = 'openbsd' ]; then
sudo pkg_add -I brotli libssh2 libpsl nghttp2 ${MATRIX_INSTALL}
if [ "${MATRIX_BUILD}" = 'autotools' ]; then
sudo pkg_delete -I curl # to avoid autotools build linking against system libcurl
fi
fi
- name: 'autoreconf' # https://ports.freebsd.org/
if: ${{ matrix.build == 'autotools' }}
run: |
if [ "${MATRIX_OS}" = 'openbsd' ]; then
if [ "${MATRIX_VERSION}" = '7.9' ]; then
export AUTOCONF_VERSION=2.72
export AUTOMAKE_VERSION=1.18
fi
fi
autoreconf -fi
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja -DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \ time sudo pkg install -y cmake-core ninja perl5 \
-DCMAKE_C_COMPILER="${CC}" \ pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_ENABLE_NTLM=ON ${MATRIX_OPTIONS}
else else
time sudo pkg install -y autoconf automake libtool \
pkgconf brotli openldap26-client libidn2 libnghttp2 stunnel py311-impacket
export MAKEFLAGS=-j3
fi
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
-DCURL_USE_GSSAPI=ON \
${MATRIX_OPTIONS} \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
else
time autoreconf -fi
if [ "${MATRIX_ARCH}" != 'x86_64' ]; then if [ "${MATRIX_ARCH}" != 'x86_64' ]; then
options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU
fi fi
mkdir bld && cd bld mkdir bld && cd bld
../configure --prefix="$HOME"/curl-install --enable-unity --enable-debug --enable-warnings --enable-werror --disable-static \ time ../configure --enable-unity --enable-debug --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \ --prefix="$HOME"/curl-install \
--with-brotli --with-libssh2 --with-nghttp2 \ --with-openssl \
${options} ${MATRIX_OPTIONS} --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; }
cd ..
fi fi
- name: 'configure log' echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
if: ${{ !cancelled() }} echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.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: 'libcurl.pc, curl-config'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
if command -v pccritic >/dev/null 2>&1; then
pccritic --version
pccritic --min-score 98 bld/libcurl.pc
fi
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld time cmake --build bld
time cmake --install bld
else else
make -C bld V=1 time make -C bld install
fi 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 -f '%10z bytes: %N' --
bld/src/curl --disable --version bld/src/curl --disable --version
- name: 'curl install' if [ "${MATRIX_ARCH}" = 'x86_64' ]; then # Slow on emulated CPU
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --install bld time cmake --build bld --target testdeps
else else
make -C bld install time make -C bld -C tests
fi
if [ "${MATRIX_DESC#*!runtests*}" = "${MATRIX_DESC}" ]; then
export TFLAGS='-j8'
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time cmake --build bld --verbose --target test-ci
else
time make -C bld V=1 test-ci
fi
fi
fi fi
- name: 'build tests' if [ "${MATRIX_DESC#*!examples*}" = "${MATRIX_DESC}" ]; then
if: ${{ matrix.tflags != 'skipall' }} # Slow on emulated CPU echo '::group::build examples'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target testdeps time cmake --build bld --target curl-examples-build
else else
make -C bld V=1 -C tests time make -C bld examples
fi fi
echo '::endgroup::'
- name: 'run tests'
if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }} # Slow on emulated CPU
env:
TFLAGS: '${{ matrix.tflags }}'
run: |
TFLAGS="-j8 ${TFLAGS}"
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
else
make -C bld V=1 test-ci
fi
- name: 'build examples'
if: ${{ !contains(matrix.desc, '!examples') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
amiga:
name: "AmigaOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} gcc AmiSSL m68k"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
AMISSL_VERSION: '5.27'
AMISSL_SHA256: 5003bef8c5930354d16b0ce7196d71b2811891c42fad38a9238c5ce4098ad42a
TOOLCHAIN_VERSION: 6.5.0
TOOLCHAIN_SHA256: 381e227c9ef552f073771d6f851cfdf873b574f3cf5db7c1c0107ea5d7146edc
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'cache compiler'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache-compiler
with:
path: ~/opt/amiga
key: ${{ runner.os }}-amigaos-${{ env.TOOLCHAIN_VERSION }}-${{ env.AMISSL_VERSION }}-amd64
- name: 'install compiler'
if: ${{ !steps.cache-compiler.outputs.cache-hit }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
https://franke.ms/download/amiga-gcc.tgz --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${TOOLCHAIN_SHA256}" && tar -xf pkg.bin && rm -f pkg.bin
cd opt/amiga
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location --proto-redir =https "https://github.com/jens-maus/amissl/releases/download/${AMISSL_VERSION}/AmiSSL-${AMISSL_VERSION}-SDK.lha" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${AMISSL_SHA256}" && 7z x -bd -y pkg.bin && rm -f pkg.bin
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: 'configure'
run: |
ln -s ~/opt/amiga /opt
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DAMIGA=1 \
-DCMAKE_SYSTEM_NAME=Generic \
-DCMAKE_SYSTEM_PROCESSOR=m68k \
-DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \
-DCMAKE_C_COMPILER=/opt/amiga/bin/m68k-amigaos-gcc \
-DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_USE_LIBPSL=OFF \
-DAMISSL_INCLUDE_DIR=/opt/amiga/AmiSSL/Developer/include \
-DAMISSL_STUBS_LIBRARY=/opt/amiga/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \
-DAMISSL_AUTO_LIBRARY=/opt/amiga/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a
else
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \
CC=/opt/amiga/bin/m68k-amigaos-gcc \
AR=/opt/amiga/bin/m68k-amigaos-ar \
RANLIB=/opt/amiga/bin/m68k-amigaos-ranlib \
--host=m68k-amigaos \
--disable-shared \
--without-libpsl \
--with-amissl \
LDFLAGS=-L/opt/amiga/AmiSSL/Developer/lib/AmigaOS3 \
CPPFLAGS=-I/opt/amiga/AmiSSL/Developer/include \
CFLAGS='-O0 -msoft-float -mcrt=clib2' \
LIBS='-lnet -lm -latomic'
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: 'libcurl.pc, curl-config'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -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 fi
android: android:
name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64" name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64"
runs-on: ubuntu-latest runs-on: 'ubuntu-latest'
timeout-minutes: 5 timeout-minutes: 25
env: env:
LDFLAGS: -s
MAKEFLAGS: -j 5 MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}' MATRIX_BUILD: '${{ matrix.build }}'
strategy: strategy:
@ -394,7 +263,7 @@ jobs:
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with: with:
persist-credentials: false persist-credentials: false
@ -417,8 +286,7 @@ jobs:
${MATRIX_OPTIONS} ${MATRIX_OPTIONS}
else else
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64" TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \ mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \ CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \
AR="$TOOLCHAIN/bin/llvm-ar" \ AR="$TOOLCHAIN/bin/llvm-ar" \
RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \ RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
@ -435,12 +303,6 @@ jobs:
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'libcurl.pc, curl-config'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
- name: 'build' - name: 'build'
run: | run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then if [ "${MATRIX_BUILD}" = 'cmake' ]; then
@ -450,9 +312,7 @@ jobs:
fi fi
- name: 'curl info' - name: 'curl info'
run: | run: find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -exec file '{}' \;
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' --
- name: 'build tests' - name: 'build tests'
run: | run: |
@ -469,126 +329,3 @@ jobs:
else else
make -C bld examples make -C bld examples
fi 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'
timeout-minutes: 2
run: |
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install libfl2
- name: 'cache compiler (djgpp)'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
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 }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
--location --proto-redir =https "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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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: 'libcurl.pc, curl-config'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
- 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

4
.gitignore vendored
View file

@ -28,6 +28,7 @@
/.vs /.vs
/bld/ /bld/
/build/ /build/
/builds/
/stats/ /stats/
__pycache__ __pycache__
Debug Debug
@ -66,6 +67,9 @@ test-driver
stamp-h* stamp-h*
scripts/_curl scripts/_curl
scripts/curl.fish scripts/curl.fish
curl_fuzzer
curl_fuzzer_seed_corpus.zip
libstandaloneengine.a
tests/string tests/string
tests/config tests/config
tests/ech-log/ tests/ech-log/

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> Guenter Knauf <lists@gknw.net> <gk@gknw.de>
Gisle Vanem <gvanem@yahoo.no> <gisle.vanem@gmail.com> Gisle Vanem <gvanem@yahoo.no> <gisle.vanem@gmail.com>
Gisle Vanem <gvanem@yahoo.no> <gvanem@broadpark.no> Gisle Vanem <gvanem@yahoo.no> <gvanem@broadpark.no>
@ -84,8 +80,8 @@ Tobias Nyholm <tobias.nyholm@gmail.com>
Timur Artikov <t.artikov@2gis.ru> Timur Artikov <t.artikov@2gis.ru>
Michał Antoniak <47522782+MAntoniak@users.noreply.github.com> Michał Antoniak <47522782+MAntoniak@users.noreply.github.com>
Gleb Ivanovsky <gl.ivanovsky@gmail.com> Gleb Ivanovsky <gl.ivanovsky@gmail.com>
Max Dymond <cmeister2@gmail.com> <max.dymond@metaswitch.com> Max Dymond <max.dymond@microsoft.com> <max.dymond@metaswitch.com>
Max Dymond <cmeister2@gmail.com> <max.dymond@microsoft.com> Max Dymond <max.dymond@microsoft.com> <cmeister2@gmail.com>
Abhinav Singh <theawless@gmail.com> Abhinav Singh <theawless@gmail.com>
Malik Idrees Hasan Khan <77000356+MalikIdreesHasanKhan@users.noreply.github.com> Malik Idrees Hasan Khan <77000356+MalikIdreesHasanKhan@users.noreply.github.com>
Yongkang Huang <hyk68691@hotmail.com> Yongkang Huang <hyk68691@hotmail.com>
@ -120,8 +116,3 @@ Sinkevich Artem <artsin666@gmail.com>
Andrew Kirillov <akirillo@uk.ibm.com> Andrew Kirillov <akirillo@uk.ibm.com>
Stephen Farrell <stephen.farrell@cs.tcd.ie> Stephen Farrell <stephen.farrell@cs.tcd.ie>
Calvin Ruocco <calvin.ruocco@vector.com> Calvin Ruocco <calvin.ruocco@vector.com>
Hamza Bensliman <benslimanhamza99@gmail.com>
Kaixuan Li <kaixuan.li@ntu.edu.sg>
Darren Banfi <boingball@gmail.com>
Alhuda Khan <al.hudz.k@gmail.com>
Ralf Mueller <217359725+hunterinvariants@users.noreply.github.com>

View file

@ -4,7 +4,7 @@ Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl 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 most recent release. In a git check-out, that file mentions changes that have
been done since the previous release. 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) option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS) 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, # We need to export internal debug functions,
# e.g. curl_easy_perform_ev() or curl_dbg_*(), # e.g. curl_easy_perform_ev() or curl_dbg_*(),
# so disable symbol hiding for debug builds and for memory tracking. # so disable symbol hiding for debug builds and for memory tracking.
set(CURL_HIDDEN_SYMBOLS OFF) set(CURL_HIDDEN_SYMBOLS OFF)
elseif(DOS OR AMIGA) elseif(DOS OR AMIGA OR MINGW32CE)
set(CURL_HIDDEN_SYMBOLS OFF) set(CURL_HIDDEN_SYMBOLS OFF)
endif() endif()

View file

@ -27,7 +27,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
/* */
#if defined(sun) || defined(__sun__) || \ #if defined(sun) || defined(__sun__) || \
defined(__SUNPRO_C) || defined(__SUNPRO_CC) defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__) # if defined(__SVR4) || defined(__srv4__)
@ -39,7 +39,7 @@
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41) #if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
# define PLATFORM_AIX_V3 # define PLATFORM_AIX_V3
#endif #endif
/* */
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) #if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
#error "O_NONBLOCK does not work on this platform" #error "O_NONBLOCK does not work on this platform"
#endif #endif
@ -48,7 +48,7 @@ int main(void)
{ {
/* O_NONBLOCK source test */ /* O_NONBLOCK source test */
int flags = 0; int flags = 0;
if(fcntl(0, F_SETFL, flags | O_NONBLOCK)) if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
return 1; return 1;
return 0; return 0;
} }
@ -65,7 +65,7 @@ int main(void)
#include <netdb.h> #include <netdb.h>
int main(void) int main(void)
{ {
static const char address[] = "localhost"; const char *address = "example.com";
struct hostent h; struct hostent h;
int rc = 0; int rc = 0;
#if defined(HAVE_GETHOSTBYNAME_R_3) || \ #if defined(HAVE_GETHOSTBYNAME_R_3) || \
@ -114,10 +114,18 @@ int main(void)
} }
#endif #endif
#ifdef STDC_HEADERS
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
int main(void) { return 0; }
#endif
#ifdef HAVE_FILE_OFFSET_BITS #ifdef HAVE_FILE_OFFSET_BITS
#include <sys/types.h> #include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly. /* 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 since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */ 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))
@ -151,7 +159,7 @@ int main(void)
int main(void) int main(void)
{ {
/* IoctlSocket source code */ /* IoctlSocket source code */
if(IoctlSocket(0, 0, 0)) if(0 != IoctlSocket(0, 0, 0))
return 1; return 1;
return 0; return 0;
} }
@ -166,7 +174,7 @@ int main(void)
{ {
/* IoctlSocket source code */ /* IoctlSocket source code */
long flags = 0; long flags = 0;
if(IoctlSocket(0, FIONBIO, &flags)) if(0 != IoctlSocket(0, FIONBIO, &flags))
return 1; return 1;
(void)flags; (void)flags;
return 0; return 0;
@ -180,7 +188,7 @@ int main(void)
int main(void) int main(void)
{ {
unsigned long flags = 0; unsigned long flags = 0;
if(ioctlsocket(0, FIONBIO, &flags)) if(0 != ioctlsocket(0, FIONBIO, &flags))
return 1; return 1;
(void)flags; (void)flags;
return 0; return 0;
@ -207,7 +215,7 @@ int main(void)
int main(void) int main(void)
{ {
int flags = 0; int flags = 0;
if(ioctl(0, FIONBIO, &flags)) if(0 != ioctl(0, FIONBIO, &flags))
return 1; return 1;
(void)flags; (void)flags;
return 0; return 0;
@ -215,7 +223,7 @@ int main(void)
#endif #endif
#ifdef HAVE_IOCTL_SIOCGIFADDR #ifdef HAVE_IOCTL_SIOCGIFADDR
/* headers for SIOCGIFADDR test */ /* headers for FIONBIO test */
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
# include <sys/types.h> # include <sys/types.h>
#endif #endif
@ -235,7 +243,7 @@ int main(void)
int main(void) int main(void)
{ {
struct ifreq ifr; struct ifreq ifr;
if(ioctl(0, SIOCGIFADDR, &ifr)) if(0 != ioctl(0, SIOCGIFADDR, &ifr))
return 1; return 1;
(void)ifr; (void)ifr;
return 0; return 0;
@ -254,7 +262,7 @@ int main(void)
#endif #endif
int main(void) int main(void)
{ {
if(setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
return 1; return 1;
return 0; return 0;
} }
@ -264,15 +272,12 @@ int main(void)
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
static void check(char c) static void check(char c) { (void)c; }
{
(void)c;
}
int main(void) int main(void)
{ {
char buffer[1024]; char buffer[1024];
/* This does not compile if strerror_r does not return a char* */ /* This will not compile if strerror_r does not return a char* */
/* !checksrc! disable ERRNOVAR 1 */ /* !checksrc! disable ERRNOVAR 1 */
check(strerror_r(EACCES, buffer, sizeof(buffer))[0]); check(strerror_r(EACCES, buffer, sizeof(buffer))[0]);
return 0; return 0;
@ -284,15 +289,12 @@ int main(void)
#include <errno.h> #include <errno.h>
/* Float, because a pointer cannot be implicitly cast to float */ /* Float, because a pointer cannot be implicitly cast to float */
static void check(float f) static void check(float f) { (void)f; }
{
(void)f;
}
int main(void) int main(void)
{ {
char buffer[1024]; char buffer[1024];
/* This does not compile if strerror_r does not return an int */ /* This will not compile if strerror_r does not return an int */
/* !checksrc! disable ERRNOVAR 1 */ /* !checksrc! disable ERRNOVAR 1 */
check(strerror_r(EACCES, buffer, sizeof(buffer))); check(strerror_r(EACCES, buffer, sizeof(buffer)));
return 0; return 0;

View file

@ -25,47 +25,39 @@
# #
# Input variables: # Input variables:
# #
# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory. # - `BROTLI_INCLUDE_DIR`: The brotli include directory.
# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library. # - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library. # - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
# - `BROTLI_USE_STATIC_LIBS`: Configure for static brotli libraries.
# #
# Defines: # Result variables:
# #
# - `BROTLI_FOUND`: System has brotli. # - `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. # - `BROTLI_VERSION`: Version of brotli.
# - `CURL::brotli`: brotli library target.
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 if(CURL_USE_PKGCONFIG AND
NOT DEFINED BROTLI_INCLUDE_DIR AND NOT DEFINED BROTLI_INCLUDE_DIR AND
NOT DEFINED BROTLICOMMON_LIBRARY AND NOT DEFINED BROTLICOMMON_LIBRARY AND
NOT DEFINED BROTLIDEC_LIBRARY) NOT DEFINED BROTLIDEC_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_brotli ${_brotli_pc_requires}) pkg_check_modules(BROTLI ${BROTLI_PC_REQUIRES})
endif() endif()
if(_brotli_FOUND) if(BROTLI_FOUND)
set(Brotli_FOUND TRUE) set(Brotli_FOUND TRUE)
set(BROTLI_FOUND TRUE) set(BROTLI_VERSION "${BROTLI_libbrotlicommon_VERSION}")
set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION}) string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}")
if(BROTLI_USE_STATIC_LIBS) message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
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}\")")
else() else()
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") 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(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec") find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Brotli find_package_handle_standard_args(Brotli
@ -76,21 +68,9 @@ else()
) )
if(BROTLI_FOUND) if(BROTLI_FOUND)
set(_brotli_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR}) set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
set(_brotli_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY}) set(BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
endif() endif()
mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY) mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY)
endif() 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: # Input variables:
# #
# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory. # - `CARES_INCLUDE_DIR`: The c-ares include directory.
# - `CARES_LIBRARY`: Absolute path to `cares` library. # - `CARES_LIBRARY`: Path to `cares` library.
# - `CARES_USE_STATIC_LIBS`: Configure for static c-ares libraries.
# #
# Defines: # Result variables:
# #
# - `CARES_FOUND`: System has c-ares. # - `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. # - `CARES_VERSION`: Version of c-ares.
# - `CURL::cares`: c-ares library target.
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) NOT DEFINED CARES_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_cares ${_cares_pc_requires}) pkg_check_modules(CARES ${CARES_PC_REQUIRES})
endif()
if(NOT _cares_FOUND AND CURL_USE_CMAKECONFIG)
find_package(c-ares CONFIG QUIET)
endif()
endif() endif()
if(_cares_FOUND) if(CARES_FOUND)
set(Cares_FOUND TRUE) set(Cares_FOUND TRUE)
set(CARES_FOUND TRUE) string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}")
set(CARES_VERSION ${_cares_VERSION}) message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found 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}\")")
else() else()
find_path(CARES_INCLUDE_DIR NAMES "ares.h") 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") find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
endif()
unset(CARES_VERSION CACHE) unset(CARES_VERSION CACHE)
if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h") if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")
@ -108,25 +85,13 @@ else()
) )
if(CARES_FOUND) if(CARES_FOUND)
set(_cares_INCLUDE_DIRS ${CARES_INCLUDE_DIR}) set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
set(_cares_LIBRARIES ${CARES_LIBRARY}) set(CARES_LIBRARIES ${CARES_LIBRARY})
endif() endif()
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY) mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
endif() endif()
if(CARES_FOUND) if(CARES_FOUND AND WIN32)
if(WIN32) list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others
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()
endif() endif()

View file

@ -23,42 +23,43 @@
########################################################################### ###########################################################################
# Find the GSS Kerberos library # Find the GSS Kerberos library
# #
# This module accepts optional COMPONENTS to control the GSS library flavor:
#
# - Apple
#
# Input variables: # 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 GSS. # - `GSS_FOUND`: System has the Heimdal library.
# - `GSS_VERSION`: Version of GSS. # - `GSS_FLAVOUR`: "GNU", "MIT" or "Heimdal" if anything found.
# - `CURL::gss`: GSS library target. # - `GSS_INCLUDE_DIRS`: The GSS include directories.
# - `INTERFACE_CURL_GSS_FLAVOR`: Custom property. "Apple", "GNU" or "MIT" if detected. # - `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(_gnu_modname "gss")
set(_mit_modname "mit-krb5-gssapi") set(_mit_modname "mit-krb5-gssapi")
set(_heimdal_modname "heimdal-gssapi")
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckIncludeFiles) include(CheckIncludeFiles)
include(CheckTypeSize) 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_CFLAGS "")
set(_gss_LIBRARY_DIRS "") set(_gss_LIBRARY_DIRS "")
if(NOT APPLE AND GSS_FIND_COMPONENTS STREQUAL "Apple")
set(GSS_FIND_COMPONENTS "")
endif()
# Try to find library using system pkg-config if user did not specify root dir # Try to find library using system pkg-config if user did not specify root dir
if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}" AND NOT GSS_FIND_COMPONENTS STREQUAL "Apple") if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}")
if(CURL_USE_PKGCONFIG) if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_search_module(_gss ${_mit_modname} ${_gnu_modname}) pkg_search_module(_gss ${_gnu_modname} ${_mit_modname} ${_heimdal_modname})
list(APPEND _gss_root_hints "${_gss_PREFIX}") list(APPEND _gss_root_hints "${_gss_PREFIX}")
set(_gss_version "${_gss_VERSION}") set(_gss_version "${_gss_VERSION}")
endif() endif()
@ -68,31 +69,37 @@ if(NOT GSS_ROOT_DIR AND NOT "$ENV{GSS_ROOT_DIR}" AND NOT GSS_FIND_COMPONENTS STR
endif() endif()
if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional approach. if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional approach.
if(GSS_FIND_COMPONENTS STREQUAL "Apple") find_file(_gss_configure_script
find_path(_gss_INCLUDE_DIRS NAMES "GSS/gssapi.h" PATH_SUFFIXES "include") NAMES
find_library(_gss_LIBRARIES NAMES "GSS") "krb5-config"
HINTS
${_gss_root_hints}
PATH_SUFFIXES
"bin"
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
)
if(_gss_INCLUDE_DIRS AND _gss_LIBRARIES)
message(STATUS "Found AppleGSS: ${_gss_INCLUDE_DIRS}")
set(_gss_flavor "Apple")
endif()
else()
find_file(_gss_configure_script NAMES "krb5-config" PATH_SUFFIXES "bin" HINTS ${_gss_root_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
# If not found in user-supplied directories, maybe system knows better # 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) if(_gss_configure_script)
set(_gss_INCLUDE_DIRS "") set(_gss_INCLUDE_DIRS "")
set(_gss_LIBRARIES "") set(_gss_LIBRARIES "")
execute_process(COMMAND ${_gss_configure_script} "--cflags" "gssapi" execute_process(
COMMAND ${_gss_configure_script} "--cflags" "gssapi"
OUTPUT_VARIABLE _gss_cflags_raw OUTPUT_VARIABLE _gss_cflags_raw
RESULT_VARIABLE _gss_configure_failed RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "FindGSS krb5-config --cflags: ${_gss_cflags_raw}") message(STATUS "FindGSS krb5-config --cflags: ${_gss_cflags_raw}")
if(NOT _gss_configure_failed) # 0 means success if(NOT _gss_configure_failed) # 0 means success
# Should also work in an odd case when multiple directories are given. # Should also work in an odd case when multiple directories are given.
string(STRIP "${_gss_cflags_raw}" _gss_cflags_raw) string(STRIP "${_gss_cflags_raw}" _gss_cflags_raw)
@ -109,10 +116,12 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr
endforeach() endforeach()
endif() endif()
execute_process(COMMAND ${_gss_configure_script} "--libs" "gssapi" execute_process(
COMMAND ${_gss_configure_script} "--libs" "gssapi"
OUTPUT_VARIABLE _gss_lib_flags OUTPUT_VARIABLE _gss_lib_flags
RESULT_VARIABLE _gss_configure_failed RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}") message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}")
if(NOT _gss_configure_failed) # 0 means success if(NOT _gss_configure_failed) # 0 means success
@ -132,112 +141,199 @@ if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional appr
endforeach() endforeach()
endif() endif()
execute_process(COMMAND ${_gss_configure_script} "--version" execute_process(
COMMAND ${_gss_configure_script} "--version"
OUTPUT_VARIABLE _gss_version OUTPUT_VARIABLE _gss_version
RESULT_VARIABLE _gss_configure_failed 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 do not care. # Older versions may not have the "--version" parameter. In this case we just do not care.
if(_gss_configure_failed) if(_gss_configure_failed)
set(_gss_version 0) set(_gss_version 0)
else()
# Strip prefix string to leave the version number only
string(REPLACE "Kerberos 5 release " "" _gss_version "${_gss_version}")
endif() endif()
execute_process(COMMAND ${_gss_configure_script} "--vendor" execute_process(
COMMAND ${_gss_configure_script} "--vendor"
OUTPUT_VARIABLE _gss_vendor OUTPUT_VARIABLE _gss_vendor
RESULT_VARIABLE _gss_configure_failed 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 do not care. # 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") if(_gss_configure_failed)
set(_gss_flavor "MIT") # assume a default, should not really matter 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() endif()
else() # Either there is no config script or we are on a platform that does not provide one (Windows?) 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") find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h"
HINTS
if(_gss_INCLUDE_DIRS) # We have found something ${_gss_root_hints}
set(_gss_libdir_suffixes "") PATH_SUFFIXES
"include"
"inc"
)
if(_gss_INCLUDE_DIRS) # jay, we have found something
cmake_push_check_state() cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES "${_gss_INCLUDE_DIRS}") list(APPEND CMAKE_REQUIRED_INCLUDES "${_gss_INCLUDE_DIRS}")
check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers) check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)
cmake_pop_check_state()
if(_gss_have_mit_headers) if(_gss_have_mit_headers)
set(_gss_flavor "MIT") 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()
# 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 "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, check if we can link libraries
if(GSS_FLAVOUR)
set(_gss_libdir_suffixes "")
set(_gss_libdir_hints ${_gss_root_hints})
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
list(APPEND _gss_libdir_hints ${_gss_calculated_potential_root})
if(WIN32) if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _gss_libdir_suffixes "lib/AMD64") 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") set(_gss_libname "gssapi64")
else()
set(_gss_libname "libgssapi")
endif()
else() else()
list(APPEND _gss_libdir_suffixes "lib/i386") list(APPEND _gss_libdir_suffixes "lib/i386")
set(_gss_libname "gssapi32") if(GSS_FLAVOUR STREQUAL "GNU")
endif()
else()
list(APPEND _gss_libdir_suffixes "lib" "lib64") # those suffixes are not checked for HINTS
set(_gss_libname "gssapi_krb5")
endif()
endif()
else()
find_path(_gss_INCLUDE_DIRS NAMES "gss.h" HINTS ${_gss_root_hints} PATH_SUFFIXES "include")
if(_gss_INCLUDE_DIRS)
set(_gss_flavor "GNU")
set(_gss_pc_requires ${_gnu_modname})
set(_gss_libname "gss") 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()
endif() endif()
# If we have headers, look up libraries find_library(_gss_LIBRARIES NAMES ${_gss_libname}
if(_gss_flavor) HINTS
set(_gss_libdir_hints ${_gss_root_hints}) ${_gss_libdir_hints}
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) PATH_SUFFIXES
cmake_path(GET _gss_INCLUDE_DIRS PARENT_PATH _gss_calculated_potential_root) ${_gss_libdir_suffixes}
else() )
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
endif() endif()
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})
endif()
endif()
endif()
if(NOT _gss_flavor)
message(FATAL_ERROR "MIT, GNU or Apple GSS is required")
endif() endif()
else() else()
if(_gss_MODULE_NAME STREQUAL _gnu_modname) # _gss_MODULE_NAME set since CMake 3.16
set(_gss_flavor "GNU") if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _gss_${_gnu_modname}_VERSION)
set(_gss_pc_requires ${_gnu_modname}) set(GSS_FLAVOUR "GNU")
elseif(_gss_MODULE_NAME STREQUAL _mit_modname) set(GSS_PC_REQUIRES "gss")
set(_gss_flavor "MIT") if(NOT _gss_version) # for old CMake versions?
set(_gss_pc_requires ${_mit_modname}) set(_gss_version ${_gss_${_gnu_modname}_VERSION})
else()
message(FATAL_ERROR "MIT, GNU or Apple GSS is required")
endif() endif()
message(STATUS "Found GSS/${_gss_flavor} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")") 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()
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}\")")
endif() 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}) set(GSS_VERSION ${_gss_version})
if(NOT GSS_VERSION) if(GSS_FLAVOUR)
if(_gss_flavor STREQUAL "MIT" AND WIN32) if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) if(CMAKE_SIZEOF_VOID_P EQUAL 8)
cmake_host_system_information(RESULT _mit_version QUERY WINDOWS_REGISTRY set(_heimdal_manifest_file "Heimdal.Application.amd64.manifest")
"HKLM/SOFTWARE/MIT/Kerberos/SDK/CurrentVersion" VALUE "VersionString")
else() else()
get_filename_component(_mit_version set(_heimdal_manifest_file "Heimdal.Application.x86.manifest")
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE)
endif() 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}") set(GSS_VERSION "${_mit_version}")
elseif(_gss_flavor STREQUAL "GNU") else()
if(_gss_INCLUDE_DIRS AND EXISTS "${_gss_INCLUDE_DIRS}/gss.h") set(GSS_VERSION "MIT Unknown")
endif()
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 ]+\"([^\"]*)\"") 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}") string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(GSS_VERSION "${_version_str}") set(GSS_VERSION "${_version_str}")
unset(_version_regex) unset(_version_regex)
@ -249,12 +345,12 @@ endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GSS find_package_handle_standard_args(GSS
REQUIRED_VARS REQUIRED_VARS
_gss_flavor GSS_FLAVOUR
_gss_LIBRARIES GSS_LIBRARIES
VERSION_VAR VERSION_VAR
GSS_VERSION GSS_VERSION
FAIL_MESSAGE 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( mark_as_advanced(
@ -267,16 +363,3 @@ mark_as_advanced(
_gss_PREFIX _gss_PREFIX
_gss_version _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_FLAVOR "${_gss_flavor}"
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: # Input variables:
# #
# - `LDAP_INCLUDE_DIR`: Absolute path to ldap include directory. # - `LDAP_INCLUDE_DIR`: The ldap include directory.
# - `LDAP_LIBRARY`: Absolute path to `ldap` library. # - `LDAP_LIBRARY`: Path to `ldap` library.
# - `LDAP_LBER_LIBRARY`: Absolute path to `lber` library. # - `LDAP_LBER_LIBRARY`: Path to `lber` library.
# #
# Defines: # Result variables:
# #
# - `LDAP_FOUND`: System has ldap. # - `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. # - `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 if(CURL_USE_PKGCONFIG AND
NOT DEFINED LDAP_INCLUDE_DIR AND NOT DEFINED LDAP_INCLUDE_DIR AND
NOT DEFINED LDAP_LIBRARY AND NOT DEFINED LDAP_LIBRARY AND
NOT DEFINED LDAP_LBER_LIBRARY) NOT DEFINED LDAP_LBER_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_ldap ${_ldap_pc_requires}) pkg_check_modules(LDAP ${LDAP_PC_REQUIRES})
endif() endif()
if(_ldap_FOUND) if(LDAP_FOUND)
set(LDAP_FOUND TRUE) set(LDAP_VERSION "${LDAP_ldap_VERSION}")
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}\")") message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")")
else() 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 # On Apple the SDK LDAP gets picked up from
# 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains # 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains
@ -95,21 +99,9 @@ else()
) )
if(LDAP_FOUND) if(LDAP_FOUND)
set(_ldap_INCLUDE_DIRS ${LDAP_INCLUDE_DIR}) set(LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
set(_ldap_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY}) set(LDAP_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY})
endif() endif()
mark_as_advanced(LDAP_INCLUDE_DIR LDAP_LIBRARY LDAP_LBER_LIBRARY) mark_as_advanced(LDAP_INCLUDE_DIR LDAP_LIBRARY LDAP_LBER_LIBRARY)
endif() 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,29 +25,32 @@
# #
# Input variables: # Input variables:
# #
# - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory. # - `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory.
# - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library. # - `LIBGSASL_LIBRARY`: Path to `libgsasl` library.
# #
# Defines: # Result variables:
# #
# - `LIBGSASL_FOUND`: System has libgsasl. # - `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. # - `LIBGSASL_VERSION`: Version of libgsasl.
# - `CURL::libgsasl`: libgsasl library target.
set(_libgsasl_pc_requires "libgsasl") set(LIBGSASL_PC_REQUIRES "libgsasl")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBGSASL_INCLUDE_DIR AND NOT DEFINED LIBGSASL_INCLUDE_DIR AND
NOT DEFINED LIBGSASL_LIBRARY) NOT DEFINED LIBGSASL_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_libgsasl ${_libgsasl_pc_requires}) pkg_check_modules(LIBGSASL ${LIBGSASL_PC_REQUIRES})
endif() endif()
if(_libgsasl_FOUND) if(LIBGSASL_FOUND)
set(Libgsasl_FOUND TRUE) set(Libgsasl_FOUND TRUE)
set(LIBGSASL_FOUND TRUE) string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}")
set(LIBGSASL_VERSION ${_libgsasl_VERSION}) message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
message(STATUS "Found Libgsasl (via pkg-config): ${_libgsasl_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
else() else()
find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h") find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h")
find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl") find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl")
@ -72,21 +75,9 @@ else()
) )
if(LIBGSASL_FOUND) if(LIBGSASL_FOUND)
set(_libgsasl_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR}) set(LIBGSASL_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR})
set(_libgsasl_LIBRARIES ${LIBGSASL_LIBRARY}) set(LIBGSASL_LIBRARIES ${LIBGSASL_LIBRARY})
endif() endif()
mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY) mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY)
endif() 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: # Input variables:
# #
# - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory. # - `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory.
# - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library. # - `LIBIDN2_LIBRARY`: Path to `libidn2` library.
# #
# Defines: # Result variables:
# #
# - `LIBIDN2_FOUND`: System has libidn2. # - `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. # - `LIBIDN2_VERSION`: Version of libidn2.
# - `CURL::libidn2`: libidn2 library target.
set(_libidn2_pc_requires "libidn2") set(LIBIDN2_PC_REQUIRES "libidn2")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBIDN2_INCLUDE_DIR AND NOT DEFINED LIBIDN2_INCLUDE_DIR AND
NOT DEFINED LIBIDN2_LIBRARY) NOT DEFINED LIBIDN2_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_libidn2 ${_libidn2_pc_requires}) pkg_check_modules(LIBIDN2 ${LIBIDN2_PC_REQUIRES})
endif() endif()
if(_libidn2_FOUND) if(LIBIDN2_FOUND)
set(Libidn2_FOUND TRUE) set(Libidn2_FOUND TRUE)
set(LIBIDN2_FOUND TRUE) string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}")
set(LIBIDN2_VERSION ${_libidn2_VERSION}) message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
message(STATUS "Found Libidn2 (via pkg-config): ${_libidn2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
else() else()
find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h") find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h")
find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2") find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2")
@ -72,21 +75,9 @@ else()
) )
if(LIBIDN2_FOUND) if(LIBIDN2_FOUND)
set(_libidn2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR}) set(LIBIDN2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR})
set(_libidn2_LIBRARIES ${LIBIDN2_LIBRARY}) set(LIBIDN2_LIBRARIES ${LIBIDN2_LIBRARY})
endif() endif()
mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY) mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY)
endif() 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: # Input variables:
# #
# - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory. # - `LIBPSL_INCLUDE_DIR`: The libpsl include directory.
# - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library. # - `LIBPSL_LIBRARY`: Path to `libpsl` library.
# #
# Defines: # Result variables:
# #
# - `LIBPSL_FOUND`: System has libpsl. # - `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. # - `LIBPSL_VERSION`: Version of libpsl.
# - `CURL::libpsl`: libpsl library target.
set(_libpsl_pc_requires "libpsl") set(LIBPSL_PC_REQUIRES "libpsl")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBPSL_INCLUDE_DIR AND NOT DEFINED LIBPSL_INCLUDE_DIR AND
NOT DEFINED LIBPSL_LIBRARY) NOT DEFINED LIBPSL_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_libpsl ${_libpsl_pc_requires}) pkg_check_modules(LIBPSL ${LIBPSL_PC_REQUIRES})
endif() 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_FOUND TRUE) string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}")
set(LIBPSL_VERSION ${_libpsl_VERSION}) message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
message(STATUS "Found Libpsl (via pkg-config): ${_libpsl_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
else() else()
find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h") find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h")
find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl") find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl")
@ -72,21 +75,9 @@ else()
) )
if(LIBPSL_FOUND) if(LIBPSL_FOUND)
set(_libpsl_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR}) set(LIBPSL_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
set(_libpsl_LIBRARIES ${LIBPSL_LIBRARY}) set(LIBPSL_LIBRARIES ${LIBPSL_LIBRARY})
endif() endif()
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY) mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
endif() 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: # Input variables:
# #
# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory. # - `LIBSSH_INCLUDE_DIR`: The libssh include directory.
# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library. # - `LIBSSH_LIBRARY`: Path to libssh library.
# - `LIBSSH_USE_STATIC_LIBS`: Configure for static libssh libraries.
# #
# Defines: # Result variables:
# #
# - `LIBSSH_FOUND`: System has libssh. # - `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. # - `LIBSSH_VERSION`: Version of libssh.
# - `CURL::libssh`: libssh library target.
set(_libssh_pc_requires "libssh") set(LIBSSH_PC_REQUIRES "libssh")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBSSH_INCLUDE_DIR AND NOT DEFINED LIBSSH_INCLUDE_DIR AND
NOT DEFINED LIBSSH_LIBRARY) NOT DEFINED LIBSSH_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_libssh ${_libssh_pc_requires}) pkg_check_modules(LIBSSH ${LIBSSH_PC_REQUIRES})
endif() endif()
if(_libssh_FOUND) if(LIBSSH_FOUND)
set(Libssh_FOUND TRUE) set(Libssh_FOUND TRUE)
set(LIBSSH_FOUND TRUE) string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
set(LIBSSH_VERSION ${_libssh_VERSION}) message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found 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}\")")
else() else()
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h") 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") find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
endif()
unset(LIBSSH_VERSION CACHE) unset(LIBSSH_VERSION CACHE)
if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h") if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h")
@ -94,25 +85,13 @@ else()
) )
if(LIBSSH_FOUND) if(LIBSSH_FOUND)
set(_libssh_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR}) set(LIBSSH_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
set(_libssh_LIBRARIES ${LIBSSH_LIBRARY}) set(LIBSSH_LIBRARIES ${LIBSSH_LIBRARY})
endif() endif()
mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY) mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY)
endif() endif()
if(LIBSSH_FOUND) if(LIBSSH_FOUND AND WIN32)
if(WIN32) list(APPEND LIBSSH_LIBRARIES "iphlpapi") # for if_nametoindex
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()
endif() endif()

View file

@ -25,57 +25,35 @@
# #
# Input variables: # Input variables:
# #
# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory. # - `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory.
# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library. # - `LIBSSH2_LIBRARY`: Path to `libssh2` library.
# - `LIBSSH2_USE_STATIC_LIBS`: Configure for static libssh2 libraries.
# #
# Defines: # Result variables:
# #
# - `LIBSSH2_FOUND`: System has libssh2. # - `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. # - `LIBSSH2_VERSION`: Version of libssh2.
# - `CURL::libssh2`: libssh2 library target.
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) NOT DEFINED LIBSSH2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_libssh2 ${_libssh2_pc_requires}) pkg_check_modules(LIBSSH2 ${LIBSSH2_PC_REQUIRES})
endif()
if(NOT _libssh2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(libssh2 CONFIG QUIET)
endif()
endif() 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_FOUND TRUE) string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}")
set(LIBSSH2_VERSION ${_libssh2_VERSION}) message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found 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}\")")
else() else()
find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h") 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") find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
endif()
unset(LIBSSH2_VERSION CACHE) unset(LIBSSH2_VERSION CACHE)
if(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h") if(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h")
@ -97,21 +75,9 @@ else()
) )
if(LIBSSH2_FOUND) if(LIBSSH2_FOUND)
set(_libssh2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
set(_libssh2_LIBRARIES ${LIBSSH2_LIBRARY}) set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
endif() endif()
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
endif() 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: # Input variables:
# #
# - `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory. # - `LIBUV_INCLUDE_DIR`: The libuv include directory.
# - `LIBUV_LIBRARY`: Absolute path to `libuv` library. # - `LIBUV_LIBRARY`: Path to `libuv` library.
# #
# Defines: # Result variables:
# #
# - `LIBUV_FOUND`: System has libuv. # - `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. # - `LIBUV_VERSION`: Version of libuv.
# - `CURL::libuv`: libuv library target.
set(_libuv_pc_requires "libuv") set(LIBUV_PC_REQUIRES "libuv")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBUV_INCLUDE_DIR AND NOT DEFINED LIBUV_INCLUDE_DIR AND
NOT DEFINED LIBUV_LIBRARY) NOT DEFINED LIBUV_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_libuv ${_libuv_pc_requires}) pkg_check_modules(LIBUV ${LIBUV_PC_REQUIRES})
endif() endif()
if(_libuv_FOUND) if(LIBUV_FOUND)
set(Libuv_FOUND TRUE) set(Libuv_FOUND TRUE)
set(LIBUV_FOUND TRUE) string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}")
set(LIBUV_VERSION ${_libuv_VERSION}) message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
message(STATUS "Found Libuv (via pkg-config): ${_libuv_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
else() else()
find_path(LIBUV_INCLUDE_DIR NAMES "uv.h") find_path(LIBUV_INCLUDE_DIR NAMES "uv.h")
find_library(LIBUV_LIBRARY NAMES "uv" "libuv") find_library(LIBUV_LIBRARY NAMES "uv" "libuv")
@ -82,21 +85,9 @@ else()
) )
if(LIBUV_FOUND) if(LIBUV_FOUND)
set(_libuv_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR}) set(LIBUV_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR})
set(_libuv_LIBRARIES ${LIBUV_LIBRARY}) set(LIBUV_LIBRARIES ${LIBUV_LIBRARY})
endif() endif()
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY) mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
endif() 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: # Input variables:
# #
# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory. # - `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory.
# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library. # - `MBEDTLS_LIBRARY`: Path to `mbedtls` library.
# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library. # - `MBEDX509_LIBRARY`: Path to `mbedx509` library.
# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library. # - `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library.
# - `MBEDTLS_USE_STATIC_LIBS`: Configure for static mbedTLS libraries.
# #
# Defines: # Result variables:
# #
# - `MBEDTLS_FOUND`: System has mbedTLS. # - `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. # - `MBEDTLS_VERSION`: Version of mbedTLS.
# - `CURL::mbedtls`: mbedTLS library target.
if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR) if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.") 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) unset(MBEDTLS_INCLUDE_DIRS)
endif() 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 MBEDTLS_LIBRARY AND
NOT DEFINED MBEDX509_LIBRARY AND NOT DEFINED MBEDX509_LIBRARY AND
NOT DEFINED MBEDCRYPTO_LIBRARY) NOT DEFINED MBEDCRYPTO_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_mbedtls ${_mbedtls_pc_requires}) pkg_check_modules(MBEDTLS ${MBEDTLS_PC_REQUIRES})
endif()
if(NOT _mbedtls_FOUND AND CURL_USE_CMAKECONFIG)
find_package(MbedTLS CONFIG QUIET)
endif()
endif() endif()
if(_mbedtls_FOUND) if(MBEDTLS_FOUND)
set(MbedTLS_FOUND TRUE) set(MbedTLS_FOUND TRUE)
set(MBEDTLS_FOUND TRUE) set(MBEDTLS_VERSION "${MBEDTLS_mbedtls_VERSION}")
set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION}) string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}")
if(MBEDTLS_USE_STATIC_LIBS) message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
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() else()
set(_mbedtls_LIBRARIES MbedTLS::mbedcrypto) set(MBEDTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config
endif()
list(APPEND _mbedtls_LIBRARIES MbedTLS::mbedx509 MbedTLS::mbedtls)
message(STATUS "Found MbedTLS (via CMake Config): ${MbedTLS_CONFIG} (found version \"${MBEDTLS_VERSION}\")")
else()
set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config
find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h") 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(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509") find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto" "tfpsacrypto" "libtfpsacrypto") find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto")
endif()
unset(MBEDTLS_VERSION CACHE) unset(MBEDTLS_VERSION CACHE)
if(MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h") if(MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
@ -117,21 +92,9 @@ else()
) )
if(MBEDTLS_FOUND) if(MBEDTLS_FOUND)
set(_mbedtls_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR}) set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(_mbedtls_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY}) set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
endif() endif()
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
endif() 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: # Input variables:
# #
# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory. # - `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory.
# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library. # - `NGHTTP2_LIBRARY`: Path to `nghttp2` library.
# - `NGHTTP2_USE_STATIC_LIBS`: Configure for static nghttp2 libraries.
# #
# Defines: # Result variables:
# #
# - `NGHTTP2_FOUND`: System has nghttp2. # - `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. # - `NGHTTP2_VERSION`: Version of nghttp2.
# - `CURL::nghttp2`: nghttp2 library target.
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) NOT DEFINED NGHTTP2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp2 ${_nghttp2_pc_requires}) pkg_check_modules(NGHTTP2 ${NGHTTP2_PC_REQUIRES})
endif()
if(NOT _nghttp2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp2 CONFIG QUIET)
endif()
endif() endif()
if(_nghttp2_FOUND) if(NGHTTP2_FOUND)
set(NGHTTP2_FOUND TRUE) string(REPLACE ";" " " NGHTTP2_CFLAGS "${NGHTTP2_CFLAGS}")
set(NGHTTP2_VERSION ${_nghttp2_VERSION}) message(STATUS "Found NGHTTP2 (via pkg-config): ${NGHTTP2_INCLUDE_DIRS} (found 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 OR NOT TARGET nghttp2::nghttp2)
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}\")")
else() else()
find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h") 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") find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
endif()
unset(NGHTTP2_VERSION CACHE) unset(NGHTTP2_VERSION CACHE)
if(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h") if(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h")
@ -96,21 +74,9 @@ else()
) )
if(NGHTTP2_FOUND) if(NGHTTP2_FOUND)
set(_nghttp2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR}) set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
set(_nghttp2_LIBRARIES ${NGHTTP2_LIBRARY}) set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY})
endif() endif()
mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY) mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY)
endif() 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: # Input variables:
# #
# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory. # - `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory.
# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library. # - `NGHTTP3_LIBRARY`: Path to `nghttp3` library.
# - `NGHTTP3_USE_STATIC_LIBS`: Configure for static nghttp3 libraries.
# #
# Defines: # Result variables:
# #
# - `NGHTTP3_FOUND`: System has nghttp3. # - `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. # - `NGHTTP3_VERSION`: Version of nghttp3.
# - `CURL::nghttp3`: nghttp3 library target.
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) NOT DEFINED NGHTTP3_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp3 ${_nghttp3_pc_requires}) pkg_check_modules(NGHTTP3 ${NGHTTP3_PC_REQUIRES})
endif()
if(NOT _nghttp3_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp3 CONFIG QUIET)
endif()
endif() endif()
if(_nghttp3_FOUND) if(NGHTTP3_FOUND)
set(NGHTTP3_FOUND TRUE) string(REPLACE ";" " " NGHTTP3_CFLAGS "${NGHTTP3_CFLAGS}")
set(NGHTTP3_VERSION ${_nghttp3_VERSION}) message(STATUS "Found NGHTTP3 (via pkg-config): ${NGHTTP3_INCLUDE_DIRS} (found 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 OR NOT TARGET nghttp3::nghttp3)
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}\")")
else() else()
find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h") 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") find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
endif()
unset(NGHTTP3_VERSION CACHE) unset(NGHTTP3_VERSION CACHE)
if(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h") if(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h")
@ -96,21 +74,9 @@ else()
) )
if(NGHTTP3_FOUND) if(NGHTTP3_FOUND)
set(_nghttp3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR}) set(NGHTTP3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
set(_nghttp3_LIBRARIES ${NGHTTP3_LIBRARY}) set(NGHTTP3_LIBRARIES ${NGHTTP3_LIBRARY})
endif() endif()
mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY) mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY)
endif() 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,91 +35,63 @@
# #
# Input variables: # Input variables:
# #
# - `NGTCP2_INCLUDE_DIR`: Absolute path to ngtcp2 include directory. # - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory.
# - `NGTCP2_LIBRARY`: Absolute path to `ngtcp2` library. # - `NGTCP2_LIBRARY`: Path to `ngtcp2` library.
# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_boringssl` library. # - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library.
# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_gnutls` library. # - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library.
# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Absolute path to `ngtcp2_crypto_libressl` library. # - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Path to `ngtcp2_crypto_libressl` library.
# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_ossl` library. # - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library.
# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_quictls` library. # - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library.
# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_wolfssl` library. # - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library.
# - `NGTCP2_USE_STATIC_LIBS`: Configure for static ngtcp2 libraries.
# #
# Defines: # Result variables:
# #
# - `NGTCP2_FOUND`: System has ngtcp2. # - `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. # - `NGTCP2_VERSION`: Version of ngtcp2.
# - `NGTCP2_CRYPTO_BACKEND`: Name of the crypto library component. (Empty if COMPONENTS was not used.)
# - `CURL::ngtcp2`: ngtcp2 library target.
set(NGTCP2_CRYPTO_BACKEND "")
if(NGTCP2_FIND_COMPONENTS) if(NGTCP2_FIND_COMPONENTS)
set(_ngtcp2_crypto_backend "")
foreach(_component IN LISTS NGTCP2_FIND_COMPONENTS) foreach(_component IN LISTS NGTCP2_FIND_COMPONENTS)
if(_component MATCHES "^(BoringSSL|GnuTLS|LibreSSL|ossl|quictls|wolfSSL)") if(_component MATCHES "^(BoringSSL|GnuTLS|LibreSSL|ossl|quictls|wolfSSL)")
if(NGTCP2_CRYPTO_BACKEND) if(_ngtcp2_crypto_backend)
message(FATAL_ERROR "NGTCP2: Only one crypto library can be selected") message(FATAL_ERROR "NGTCP2: Only one crypto library can be selected")
endif() endif()
set(NGTCP2_CRYPTO_BACKEND ${_component}) set(_ngtcp2_crypto_backend ${_component})
endif() endif()
endforeach() endforeach()
if(NGTCP2_CRYPTO_BACKEND) if(_ngtcp2_crypto_backend)
string(TOLOWER "ngtcp2_crypto_${NGTCP2_CRYPTO_BACKEND}" _crypto_library_lower) string(TOLOWER "ngtcp2_crypto_${_ngtcp2_crypto_backend}" _crypto_library_lower)
string(TOUPPER "ngtcp2_crypto_${NGTCP2_CRYPTO_BACKEND}" _crypto_library_upper) string(TOUPPER "ngtcp2_crypto_${_ngtcp2_crypto_backend}" _crypto_library_upper)
endif() endif()
endif() endif()
set(_ngtcp2_pc_requires "libngtcp2") set(NGTCP2_PC_REQUIRES "libngtcp2")
if(NGTCP2_CRYPTO_BACKEND) if(_ngtcp2_crypto_backend)
list(APPEND _ngtcp2_pc_requires "lib${_crypto_library_lower}") list(APPEND NGTCP2_PC_REQUIRES "lib${_crypto_library_lower}")
endif() endif()
set(_tried_pkgconfig FALSE) 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) NOT DEFINED NGTCP2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_ngtcp2 ${_ngtcp2_pc_requires}) pkg_check_modules(NGTCP2 ${NGTCP2_PC_REQUIRES})
set(_tried_pkgconfig TRUE) set(_tried_pkgconfig TRUE)
endif() endif()
if(NOT _ngtcp2_FOUND AND CURL_USE_CMAKECONFIG AND NGTCP2_CRYPTO_BACKEND)
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()
endif()
if(_ngtcp2_FOUND) if(NGTCP2_FOUND)
set(NGTCP2_FOUND TRUE) set(NGTCP2_VERSION "${NGTCP2_libngtcp2_VERSION}")
set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION}) string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}")
if(NGTCP2_USE_STATIC_LIBS) message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")")
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 OR NOT TARGET ngtcp2::ngtcp2)
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}\")")
else() else()
find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h") 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") find_library(NGTCP2_LIBRARY NAMES "ngtcp2")
endif()
unset(NGTCP2_VERSION CACHE) unset(NGTCP2_VERSION CACHE)
if(NGTCP2_INCLUDE_DIR AND EXISTS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h") if(NGTCP2_INCLUDE_DIR AND EXISTS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h")
@ -131,22 +103,12 @@ else()
unset(_version_str) unset(_version_str)
endif() endif()
if(NGTCP2_CRYPTO_BACKEND) 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) get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY)
endif() find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower} HINTS ${_ngtcp2_library_dir})
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()
if(${_crypto_library_upper}_LIBRARY) if(${_crypto_library_upper}_LIBRARY)
set(NGTCP2_${NGTCP2_CRYPTO_BACKEND}_FOUND TRUE) set(NGTCP2_${_ngtcp2_crypto_backend}_FOUND TRUE)
set(NGTCP2_CRYPTO_LIBRARY ${${_crypto_library_upper}_LIBRARY}) set(NGTCP2_CRYPTO_LIBRARY ${${_crypto_library_upper}_LIBRARY})
endif() endif()
endif() endif()
@ -162,8 +124,8 @@ else()
) )
if(NGTCP2_FOUND) if(NGTCP2_FOUND)
set(_ngtcp2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR}) set(NGTCP2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
set(_ngtcp2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY}) set(NGTCP2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
endif() endif()
mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY) mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY)
@ -173,15 +135,3 @@ else()
unset(NGTCP2_LIBRARY CACHE) unset(NGTCP2_LIBRARY CACHE)
endif() endif()
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,34 +25,34 @@
# #
# Input variables: # Input variables:
# #
# - `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory. # - `NETTLE_INCLUDE_DIR`: The nettle include directory.
# - `NETTLE_HOGWEED_LIBRARY`: Absolute path to `hogweed` library. # - `NETTLE_LIBRARY`: Path to `nettle` library.
# - `NETTLE_LIBRARY`: Absolute path to `nettle` library.
# #
# Defines: # Result variables:
# #
# - `NETTLE_FOUND`: System has nettle. # - `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. # - `NETTLE_VERSION`: Version of nettle.
# - `CURL::nettle`: nettle library target.
set(_nettle_pc_requires "hogweed" "nettle") set(NETTLE_PC_REQUIRES "nettle")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED NETTLE_INCLUDE_DIR AND NOT DEFINED NETTLE_INCLUDE_DIR AND
NOT DEFINED NETTLE_HOGWEED_LIBRARY AND
NOT DEFINED NETTLE_LIBRARY) NOT DEFINED NETTLE_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_nettle ${_nettle_pc_requires}) pkg_check_modules(NETTLE ${NETTLE_PC_REQUIRES})
endif() endif()
if(_nettle_FOUND) if(NETTLE_FOUND)
set(Nettle_FOUND TRUE) set(Nettle_FOUND TRUE)
set(NETTLE_FOUND TRUE) string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}")
set(NETTLE_VERSION ${_nettle_nettle_VERSION}) message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
message(STATUS "Found Nettle (via pkg-config): ${_nettle_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
else() else()
find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h") find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h")
find_library(NETTLE_HOGWEED_LIBRARY NAMES "hogweed")
find_library(NETTLE_LIBRARY NAMES "nettle") find_library(NETTLE_LIBRARY NAMES "nettle")
unset(NETTLE_VERSION CACHE) unset(NETTLE_VERSION CACHE)
@ -74,28 +74,15 @@ else()
find_package_handle_standard_args(Nettle find_package_handle_standard_args(Nettle
REQUIRED_VARS REQUIRED_VARS
NETTLE_INCLUDE_DIR NETTLE_INCLUDE_DIR
NETTLE_HOGWEED_LIBRARY
NETTLE_LIBRARY NETTLE_LIBRARY
VERSION_VAR VERSION_VAR
NETTLE_VERSION NETTLE_VERSION
) )
if(NETTLE_FOUND) if(NETTLE_FOUND)
set(_nettle_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR}) set(NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR})
set(_nettle_LIBRARIES ${NETTLE_HOGWEED_LIBRARY} ${NETTLE_LIBRARY}) set(NETTLE_LIBRARIES ${NETTLE_LIBRARY})
endif() endif()
mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_HOGWEED_LIBRARY NETTLE_LIBRARY) 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() endif()

View file

@ -25,29 +25,32 @@
# #
# Input variables: # Input variables:
# #
# - `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory. # - `QUICHE_INCLUDE_DIR`: The quiche include directory.
# - `QUICHE_LIBRARY`: Absolute path to `quiche` library. # - `QUICHE_LIBRARY`: Path to `quiche` library.
# #
# Defines: # Result variables:
# #
# - `QUICHE_FOUND`: System has quiche. # - `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. # - `QUICHE_VERSION`: Version of quiche.
# - `CURL::quiche`: quiche library target.
set(_quiche_pc_requires "quiche") set(QUICHE_PC_REQUIRES "quiche")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED QUICHE_INCLUDE_DIR AND NOT DEFINED QUICHE_INCLUDE_DIR AND
NOT DEFINED QUICHE_LIBRARY) NOT DEFINED QUICHE_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_quiche ${_quiche_pc_requires}) pkg_check_modules(QUICHE ${QUICHE_PC_REQUIRES})
endif() endif()
if(_quiche_FOUND) if(QUICHE_FOUND)
set(Quiche_FOUND TRUE) set(Quiche_FOUND TRUE)
set(QUICHE_FOUND TRUE) string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}")
set(QUICHE_VERSION ${_quiche_VERSION}) message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
message(STATUS "Found Quiche (via pkg-config): ${_quiche_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
else() else()
find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h") find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h")
find_library(QUICHE_LIBRARY NAMES "quiche") find_library(QUICHE_LIBRARY NAMES "quiche")
@ -60,21 +63,9 @@ else()
) )
if(QUICHE_FOUND) if(QUICHE_FOUND)
set(_quiche_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR}) set(QUICHE_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
set(_quiche_LIBRARIES ${QUICHE_LIBRARY}) set(QUICHE_LIBRARIES ${QUICHE_LIBRARY})
endif() endif()
mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY) mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY)
endif() 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: # Input variables:
# #
# - `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory. # - `RUSTLS_INCLUDE_DIR`: The Rustls include directory.
# - `RUSTLS_LIBRARY`: Absolute path to `rustls` library. # - `RUSTLS_LIBRARY`: Path to `rustls` library.
# #
# Defines: # Result variables:
# #
# - `RUSTLS_FOUND`: System has Rustls. # - `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. # - `RUSTLS_VERSION`: Version of Rustls.
# - `CURL::rustls`: Rustls library target.
set(_rustls_pc_requires "rustls") set(RUSTLS_PC_REQUIRES "rustls")
if(CURL_USE_PKGCONFIG AND if(CURL_USE_PKGCONFIG AND
NOT DEFINED RUSTLS_INCLUDE_DIR AND NOT DEFINED RUSTLS_INCLUDE_DIR AND
NOT DEFINED RUSTLS_LIBRARY) NOT DEFINED RUSTLS_LIBRARY)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_rustls ${_rustls_pc_requires}) pkg_check_modules(RUSTLS ${RUSTLS_PC_REQUIRES})
endif() endif()
if(_rustls_FOUND) if(RUSTLS_FOUND)
set(Rustls_FOUND TRUE) set(Rustls_FOUND TRUE)
set(RUSTLS_FOUND TRUE) string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}")
set(RUSTLS_VERSION ${_rustls_VERSION}) message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
message(STATUS "Found Rustls (via pkg-config): ${_rustls_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
else() 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_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h")
find_library(RUSTLS_LIBRARY NAMES "rustls") find_library(RUSTLS_LIBRARY NAMES "rustls")
@ -62,8 +65,8 @@ else()
) )
if(RUSTLS_FOUND) if(RUSTLS_FOUND)
set(_rustls_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR}) set(RUSTLS_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR})
set(_rustls_LIBRARIES ${RUSTLS_LIBRARY}) set(RUSTLS_LIBRARIES ${RUSTLS_LIBRARY})
endif() endif()
mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY) mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY)
@ -76,41 +79,31 @@ if(RUSTLS_FOUND)
if(NOT SECURITY_FRAMEWORK) if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found") message(FATAL_ERROR "Security framework not found")
endif() endif()
list(APPEND _rustls_LIBRARIES "-framework Security") list(APPEND RUSTLS_LIBRARIES "-framework Security")
find_library(FOUNDATION_FRAMEWORK NAMES "Foundation") find_library(FOUNDATION_FRAMEWORK NAMES "Foundation")
mark_as_advanced(FOUNDATION_FRAMEWORK) mark_as_advanced(FOUNDATION_FRAMEWORK)
if(NOT FOUNDATION_FRAMEWORK) if(NOT FOUNDATION_FRAMEWORK)
message(FATAL_ERROR "Foundation framework not found") message(FATAL_ERROR "Foundation framework not found")
endif() endif()
list(APPEND _rustls_LIBRARIES "-framework Foundation") list(APPEND RUSTLS_LIBRARIES "-framework Foundation")
elseif(NOT WIN32) elseif(NOT WIN32)
find_library(PTHREAD_LIBRARY NAMES "pthread") find_library(PTHREAD_LIBRARY NAMES "pthread")
if(PTHREAD_LIBRARY) if(PTHREAD_LIBRARY)
list(APPEND _rustls_LIBRARIES ${PTHREAD_LIBRARY}) list(APPEND RUSTLS_LIBRARIES ${PTHREAD_LIBRARY})
endif() endif()
mark_as_advanced(PTHREAD_LIBRARY) mark_as_advanced(PTHREAD_LIBRARY)
find_library(DL_LIBRARY NAMES "dl") find_library(DL_LIBRARY NAMES "dl")
if(DL_LIBRARY) if(DL_LIBRARY)
list(APPEND _rustls_LIBRARIES ${DL_LIBRARY}) list(APPEND RUSTLS_LIBRARIES ${DL_LIBRARY})
endif() endif()
mark_as_advanced(DL_LIBRARY) mark_as_advanced(DL_LIBRARY)
find_library(MATH_LIBRARY NAMES "m") find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY) if(MATH_LIBRARY)
list(APPEND _rustls_LIBRARIES ${MATH_LIBRARY}) list(APPEND RUSTLS_LIBRARIES ${MATH_LIBRARY})
endif() endif()
mark_as_advanced(MATH_LIBRARY) mark_as_advanced(MATH_LIBRARY)
endif() 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() 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: # Input variables:
# #
# - `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory. # - `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory.
# - `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library. # - `WOLFSSL_LIBRARY`: Path to `wolfssl` library.
# #
# Defines: # Result variables:
# #
# - `WOLFSSL_FOUND`: System has wolfSSL. # - `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. # - `WOLFSSL_VERSION`: Version of wolfSSL.
# - `CURL::wolfssl`: wolfSSL library target.
if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR) if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR)
message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.") 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}") set(WOLFSSL_LIBRARY "${WolfSSL_LIBRARY}")
endif() 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) NOT DEFINED WOLFSSL_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_wolfssl ${_wolfssl_pc_requires}) pkg_check_modules(WOLFSSL ${WOLFSSL_PC_REQUIRES})
endif()
if(NOT _wolfssl_FOUND AND CURL_USE_CMAKECONFIG)
find_package(wolfssl CONFIG QUIET)
endif()
endif() endif()
if(_wolfssl_FOUND) if(WOLFSSL_FOUND)
set(WolfSSL_FOUND TRUE) set(WolfSSL_FOUND TRUE)
set(WOLFSSL_FOUND TRUE) string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}")
set(WOLFSSL_VERSION ${_wolfssl_VERSION}) message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found 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}\")")
else() else()
find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h") find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h")
find_library(WOLFSSL_LIBRARY NAMES "wolfssl") find_library(WOLFSSL_LIBRARY NAMES "wolfssl")
@ -91,8 +84,8 @@ else()
) )
if(WOLFSSL_FOUND) if(WOLFSSL_FOUND)
set(_wolfssl_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR}) set(WOLFSSL_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
set(_wolfssl_LIBRARIES ${WOLFSSL_LIBRARY}) set(WOLFSSL_LIBRARIES ${WOLFSSL_LIBRARY})
endif() endif()
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY) mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY)
@ -105,31 +98,19 @@ if(WOLFSSL_FOUND)
if(NOT SECURITY_FRAMEWORK) if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found") message(FATAL_ERROR "Security framework not found")
endif() endif()
list(APPEND _wolfssl_LIBRARIES "-framework Security") list(APPEND WOLFSSL_LIBRARIES "-framework Security")
find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation") find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation")
mark_as_advanced(COREFOUNDATION_FRAMEWORK) mark_as_advanced(COREFOUNDATION_FRAMEWORK)
if(NOT COREFOUNDATION_FRAMEWORK) if(NOT COREFOUNDATION_FRAMEWORK)
message(FATAL_ERROR "CoreFoundation framework not found") message(FATAL_ERROR "CoreFoundation framework not found")
endif() endif()
list(APPEND _wolfssl_LIBRARIES "-framework CoreFoundation") list(APPEND WOLFSSL_LIBRARIES "-framework CoreFoundation")
elseif(WIN32) elseif(NOT WIN32)
list(APPEND _wolfssl_LIBRARIES "crypt32")
else()
find_library(MATH_LIBRARY NAMES "m") find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY) if(MATH_LIBRARY)
list(APPEND _wolfssl_LIBRARIES ${MATH_LIBRARY}) # for log and pow list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow
endif() endif()
mark_as_advanced(MATH_LIBRARY) mark_as_advanced(MATH_LIBRARY)
endif() 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() endif()

View file

@ -25,15 +25,18 @@
# #
# Input variables: # Input variables:
# #
# - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory. # - `ZSTD_INCLUDE_DIR`: The zstd include directory.
# - `ZSTD_LIBRARY`: Absolute path to `zstd` library. # - `ZSTD_LIBRARY`: Path to `zstd` library.
# - `ZSTD_USE_STATIC_LIBS`: Configure for static zstd libraries.
# #
# Defines: # Result variables:
# #
# - `ZSTD_FOUND`: System has zstd. # - `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. # - `ZSTD_VERSION`: Version of zstd.
# - `CURL::zstd`: zstd library target.
if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR) if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR)
message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.") message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.")
@ -44,55 +47,22 @@ if(DEFINED Zstd_LIBRARY AND NOT DEFINED ZSTD_LIBRARY)
set(ZSTD_LIBRARY "${Zstd_LIBRARY}") set(ZSTD_LIBRARY "${Zstd_LIBRARY}")
endif() 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) NOT DEFINED ZSTD_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(_zstd ${_zstd_pc_requires}) 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()
endif() endif()
if(_zstd_FOUND) if(ZSTD_FOUND)
set(Zstd_FOUND TRUE) set(Zstd_FOUND TRUE)
set(ZSTD_FOUND TRUE) string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}")
set(ZSTD_VERSION ${_zstd_VERSION}) message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found 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_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}\")")
else() else()
find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h") 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") find_library(ZSTD_LIBRARY NAMES "zstd")
endif()
unset(ZSTD_VERSION CACHE) unset(ZSTD_VERSION CACHE)
if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h") if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h")
@ -124,21 +94,9 @@ else()
) )
if(ZSTD_FOUND) if(ZSTD_FOUND)
set(_zstd_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR}) set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
set(_zstd_LIBRARIES ${ZSTD_LIBRARY}) set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
endif() endif()
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY) mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
endif() 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 # Return result in variable: CURL_TEST_OUTPUT
macro(curl_internal_test _curl_test) macro(curl_internal_test _curl_test)
if(NOT DEFINED "${_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}") message(STATUS "Performing Test ${_curl_test}")
try_compile(${_curl_test} try_compile(${_curl_test}
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
"${PROJECT_SOURCE_DIR}/CMake/CurlTests.c" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c"
COMPILE_DEFINITIONS "-D${_curl_test}" ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${CMAKE_REQUIRED_DEFINITIONS} CMAKE_FLAGS
LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" "-DCOMPILE_DEFINITIONS:STRING=-D${_curl_test} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${_cmake_required_definitions}"
"${_curl_test_add_libraries}"
OUTPUT_VARIABLE CURL_TEST_OUTPUT) OUTPUT_VARIABLE CURL_TEST_OUTPUT)
if(${_curl_test}) 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") message(STATUS "Performing Test ${_curl_test} - Success")
else() else()
set(${_curl_test} "" CACHE INTERNAL "curl test") set(${_curl_test} "" CACHE INTERNAL "Curl test")
message(STATUS "Performing Test ${_curl_test} - Failed") message(STATUS "Performing Test ${_curl_test} - Failed")
endif() endif()
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") set_property(CACHE ${_option_name} PROPERTY STRINGS "AUTO" "ON" "OFF")
if(${_option_name} STREQUAL "AUTO") if(${_option_name} STREQUAL "AUTO")
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name}) find_package(${_find_name})
else()
find_package(${_find_name} MODULE)
endif()
elseif(${_option_name}) elseif(${_option_name})
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name} REQUIRED) 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
endif() endif()
endmacro() endmacro()
@ -102,24 +98,24 @@ endmacro()
# Internal: Recurse into target libraries and collect their include directories # Internal: Recurse into target libraries and collect their include directories
# and macro definitions. # and macro definitions.
macro(curl_collect_target_compile_options _target) macro(curl_collect_target_options _target)
get_target_property(_val ${_target} INTERFACE_COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES) get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES)
if(_val) if(_val)
list(APPEND _incsys ${_val}) list(APPEND _includes ${_val})
endif() endif()
get_target_property(_val ${_target} INTERFACE_COMPILE_OPTIONS) get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
if(_val) 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() endif()
get_target_property(_val ${_target} LINK_LIBRARIES) get_target_property(_val ${_target} LINK_LIBRARIES)
if(_val) if(_val)
foreach(_lib IN LISTS _val) foreach(_lib IN LISTS _val)
if(TARGET "${_lib}") if(TARGET "${_lib}")
curl_collect_target_compile_options(${_lib}) curl_collect_target_options(${_lib})
endif() endif()
endforeach() endforeach()
endif() endif()
@ -127,93 +123,34 @@ macro(curl_collect_target_compile_options _target)
endmacro() endmacro()
# Create a clang-tidy target for test targets # 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) if(CURL_CLANG_TIDY)
set(_definitions "")
set(_includes "") set(_includes "")
set(_incsys "") set(_definitions "")
set(_options "")
# Make a list of known system include directories # Collect header directories and macro definitions applying to the directory
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()
get_directory_property(_val INCLUDE_DIRECTORIES) get_directory_property(_val INCLUDE_DIRECTORIES)
if(_val) if(_val)
list(APPEND _includes ${_val}) list(APPEND _includes ${_val})
endif() endif()
get_directory_property(_val COMPILE_OPTIONS) get_directory_property(_val COMPILE_DEFINITIONS)
if(_val)
list(APPEND _options ${_val})
endif()
# Collect options applying to the target
get_target_property(_val ${_target} COMPILE_DEFINITIONS)
if(_val) if(_val)
list(APPEND _definitions ${_val}) list(APPEND _definitions ${_val})
endif() endif()
get_target_property(_val ${_target} INCLUDE_DIRECTORIES) unset(_val)
if(_val)
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
# Collect header directories and macro definitions from lib dependencies # Collect header directories and macro definitions from lib dependencies
curl_collect_target_compile_options(${_target}) curl_collect_target_options(${_target})
list(REMOVE_ITEM _definitions "")
string(REPLACE ";" ";-D" _definitions ";${_definitions}")
list(REMOVE_DUPLICATES _definitions)
list(SORT _definitions) # Sort like CMake does
list(REMOVE_ITEM _includes "") list(REMOVE_ITEM _includes "")
string(REPLACE ";" ";-I" _includes ";${_includes}") string(REPLACE ";" ";-I" _includes ";${_includes}")
list(REMOVE_DUPLICATES _includes) list(REMOVE_DUPLICATES _includes)
set(_incsys_tmp ${_incsys}) list(REMOVE_ITEM _definitions "")
list(REMOVE_DUPLICATES _incsys_tmp) string(REPLACE ";" ";-D" _definitions ";${_definitions}")
set(_incsys "") list(REMOVE_DUPLICATES _definitions)
set(_incsystop "") list(SORT _definitions) # Sort like CMake does
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()
# Assemble source list # Assemble source list
set(_sources "") set(_sources "")
@ -224,57 +161,14 @@ function(curl_add_clang_tidy_test_target _target_clang_tidy _target)
list(APPEND _sources "${_source}") list(APPEND _sources "${_source}")
endforeach() 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 add_custom_target(${_target_clang_tidy} USES_TERMINAL
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND ${CMAKE_C_CLANG_TIDY} COMMAND ${CMAKE_C_CLANG_TIDY} ${_sources} -- ${_includes} ${_definitions}
"--checks=-clang-diagnostic-unused-function"
${_sources} -- ${_cc} ${_definitions} ${_includes} ${_incsys} ${_options}
DEPENDS ${_sources}) DEPENDS ${_sources})
add_dependencies(tests-clang-tidy ${_target_clang_tidy}) add_dependencies(tests-clang-tidy ${_target_clang_tidy})
endif()
endfunction()
# Internal: Recurse into interface targets and collect their libraries unset(_includes)
# and library paths. unset(_definitions)
macro(curl_collect_target_link_options _target) unset(_sources)
get_target_property(_val ${_target} INTERFACE_LINK_DIRECTORIES)
if(_val)
list(APPEND _libdirs ${_val})
endif() 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)
# Extract imported target name from e.g. "$<LINK_ONLY:OpenSSL::Crypto>" set by libssh2
string(REGEX REPLACE "^\\\$<LINK_ONLY:(.*)>\$" "\\1" _lib "${_lib}")
if(TARGET "${_lib}")
curl_collect_target_link_options(${_lib})
else()
list(APPEND _libs ${_lib})
endif()
endforeach()
endif()
unset(_val)
endmacro() endmacro()

View file

@ -50,6 +50,19 @@ if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
cmake_pop_check_state() cmake_pop_check_state()
endif() 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") set(_source_epilogue "#undef inline")
check_c_source_compiles("${_source_epilogue} check_c_source_compiles("${_source_epilogue}
#ifdef _MSC_VER #ifdef _MSC_VER
@ -77,14 +90,12 @@ if(WIN32)
set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO}) set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO})
elseif(NOT HAVE_GETADDRINFO) elseif(NOT HAVE_GETADDRINFO)
set(HAVE_GETADDRINFO_THREADSAFE FALSE) set(HAVE_GETADDRINFO_THREADSAFE FALSE)
elseif(APPLE OR # Darwin 9+ / macOS 10.5+ elseif(APPLE OR
AIX OR CMAKE_SYSTEM_NAME STREQUAL "AIX" OR # 5.2+ CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR # 2.2.0+ CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR # 5.5+ CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR
CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR # 11.11+ CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR # all versions CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR # 4+
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR # 5.4+
CMAKE_SYSTEM_NAME STREQUAL "SunOS") CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HAVE_GETADDRINFO_THREADSAFE TRUE) set(HAVE_GETADDRINFO_THREADSAFE TRUE)
elseif(BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD") elseif(BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD")

View file

@ -29,11 +29,13 @@ set(_picky_nocheck "") # not to pass to feature checks
if(CURL_WERROR) if(CURL_WERROR)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON) set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
elseif(MSVC) else()
if(MSVC)
list(APPEND _picky_nocheck "-WX") list(APPEND _picky_nocheck "-WX")
else() # llvm/clang and gcc-style options else() # llvm/clang and gcc style options
list(APPEND _picky_nocheck "-Werror") list(APPEND _picky_nocheck "-Werror")
endif() endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
NOT DOS AND # Watt-32 headers use the '#include_next' GCC extension NOT DOS AND # Watt-32 headers use the '#include_next' GCC extension
@ -45,8 +47,8 @@ endif()
if(APPLE AND 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 "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 "-Werror=partial-availability") # clang 3.6 appleclang 6.1 list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.3
endif() endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
@ -60,9 +62,7 @@ elseif(BORLAND)
endif() endif()
if(PICKY_COMPILER) if(PICKY_COMPILER)
# Leave disabled for GCC <4.6, because they lack #pragma features to silence locally. if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6) OR
CMAKE_C_COMPILER_ID MATCHES "Clang")
# https://clang.llvm.org/docs/DiagnosticsReference.html # https://clang.llvm.org/docs/DiagnosticsReference.html
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
@ -77,15 +77,9 @@ if(PICKY_COMPILER)
set(_picky_enable "-W") set(_picky_enable "-W")
endif() endif()
list(APPEND _picky_enable "-Wall") list(APPEND _picky_enable
-Wall -pedantic
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()
# ---------------------------------- # ----------------------------------
# Add new options here, if in doubt: # Add new options here, if in doubt:
@ -93,9 +87,6 @@ if(PICKY_COMPILER)
set(_picky_detect 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. # Assume these options always exist with both clang and gcc.
# Require clang 3.0 / gcc 2.95 or later. # Require clang 3.0 / gcc 2.95 or later.
list(APPEND _picky_enable list(APPEND _picky_enable
@ -119,7 +110,7 @@ if(PICKY_COMPILER)
-Waddress # clang 2.7 gcc 4.3 -Waddress # clang 2.7 gcc 4.3
-Wattributes # clang 2.7 gcc 4.1 -Wattributes # clang 2.7 gcc 4.1
-Wcast-align # clang 1.0 gcc 4.2 -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 -Wdeclaration-after-statement # clang 1.0 gcc 3.4
-Wdiv-by-zero # clang 2.7 gcc 4.1 -Wdiv-by-zero # clang 2.7 gcc 4.1
-Wempty-body # clang 2.7 gcc 4.3 -Wempty-body # clang 2.7 gcc 4.3
@ -129,14 +120,14 @@ if(PICKY_COMPILER)
-Wignored-qualifiers # clang 2.8 gcc 4.3 -Wignored-qualifiers # clang 2.8 gcc 4.3
-Wmissing-field-initializers # clang 2.7 gcc 4.1 -Wmissing-field-initializers # clang 2.7 gcc 4.1
-Wmissing-noreturn # 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-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 -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 -Wold-style-definition # clang 2.7 gcc 3.4
-Wredundant-decls # clang 2.7 gcc 4.1 -Wredundant-decls # clang 2.7 gcc 4.1
-Wstrict-prototypes # clang 1.0 gcc 3.3 -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 -Wtype-limits # clang 2.7 gcc 4.3
-Wunreachable-code # clang 2.7 gcc 4.1 -Wunreachable-code # clang 2.7 gcc 4.1
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical # -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
@ -148,11 +139,9 @@ if(PICKY_COMPILER)
if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND _picky_enable list(APPEND _picky_enable
${_picky_common_old} ${_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 -Wshift-sign-overflow # clang 2.9
-Wshorten-64-to-32 # clang 1.0 -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) if(NOT MSVC)
list(APPEND _picky_enable list(APPEND _picky_enable
@ -160,119 +149,39 @@ if(PICKY_COMPILER)
) )
endif() endif()
# Enable based on compiler version # 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 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 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 -Wheader-guard # clang 3.4 appleclang 5.1
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0 -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 # -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 -Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
) )
endif() endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR 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 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() endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) OR 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 list(APPEND _picky_enable
-Wassign-enum # clang 7.0 appleclang 11.0 -Wassign-enum # clang 7.0 appleclang 10.3
-Wextra-semi-stmt # clang 7.0 appleclang 11.0 -Wextra-semi-stmt # clang 7.0 appleclang 10.3
) )
endif() endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) OR 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 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 -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 appleclang 12.0 -Wxor-used-as-pow # clang 10.0 gcc 13.0
) )
endif() 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
-Wformat-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 else() # gcc
# Enable based on compiler version # Enable based on compiler version
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
@ -288,7 +197,7 @@ if(PICKY_COMPILER)
endif() endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
list(APPEND _picky_enable list(APPEND _picky_enable
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4 -Wjump-misses-init # gcc 4.5
) )
if(MINGW) if(MINGW)
list(APPEND _picky_enable list(APPEND _picky_enable
@ -298,25 +207,23 @@ if(PICKY_COMPILER)
endif() endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
list(APPEND _picky_enable 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
-Wformat=2 # clang 2.7 gcc 4.8 -Wformat=2 # clang 3.0 gcc 4.8
-Wlogical-op # gcc 4.4
-Wtrampolines # gcc 4.6 -Wtrampolines # gcc 4.6
) )
endif() endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
list(APPEND _picky_enable list(APPEND _picky_enable
-Warray-bounds=2 # clang 2.9 gcc 5.0 (clang default: -Warray-bounds) -Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
-Wformat-signedness # clang 19.1 gcc 5.1 appleclang 17.0
) )
endif() endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
list(APPEND _picky_enable list(APPEND _picky_enable
-Wduplicated-cond # gcc 6.0 -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 -fdelete-null-pointer-checks
-Wshift-negative-value # clang 3.7 gcc 6.0 (clang default) -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 -Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
) )
endif() endif()
@ -325,21 +232,21 @@ if(PICKY_COMPILER)
-Walloc-zero # gcc 7.0 -Walloc-zero # gcc 7.0
-Wduplicated-branches # gcc 7.0 -Wduplicated-branches # gcc 7.0
-Wformat-truncation=2 # 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 -Wrestrict # gcc 7.0
) )
endif() endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
list(APPEND _picky_enable list(APPEND _picky_enable
-Warith-conversion # gcc 10.0 -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() endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
list(APPEND _picky_enable 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 -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() endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
@ -351,15 +258,12 @@ if(PICKY_COMPILER)
endif() endif()
endif() endif()
# Assemble list of flags #
set(_picky_skipped "") set(_picky_skipped "")
foreach(_ccopt IN LISTS _picky_enable) foreach(_ccopt IN LISTS _picky_enable)
string(REGEX MATCH "-W([a-z0-9+-]+)" _ccmatch "${_ccopt}") 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-")
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}") string(APPEND _picky_skipped " ${_ccopt}")
else() else()
list(APPEND _picky "${_ccopt}") list(APPEND _picky "${_ccopt}")
@ -382,6 +286,15 @@ if(PICKY_COMPILER)
endforeach() endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU") 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) 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 list(APPEND _picky "-Wno-missing-field-initializers") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
endif() endif()
@ -392,7 +305,7 @@ if(PICKY_COMPILER)
list(APPEND _picky "-Wno-conversion") # Avoid false positives list(APPEND _picky "-Wno-conversion") # Avoid false positives
endif() endif()
endif() endif()
elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1951) # Enable for tested versions only elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1944) # Skip for untested/unreleased newer versions
list(APPEND _picky "-Wall") 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 "-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)' list(APPEND _picky "-wd4191") # 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)(void)'
@ -401,14 +314,15 @@ if(PICKY_COMPILER)
list(APPEND _picky "-wd4548") # expression before comma has no effect; expected expression with side-effect (in FD_SET()) 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 "-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 "-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 list(APPEND _picky "-wd4711") # function 'A' selected for automatic inline expansion
# volatile access of '<expression>' is subject to /volatile:<iso|ms> setting; # volatile access of '<expression>' is subject to /volatile:<iso|ms> setting;
# consider using __iso_volatile_load/store intrinsic functions (ARM64) # consider using __iso_volatile_load/store intrinsic functions (ARM64)
list(APPEND _picky "-wd4746") 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' list(APPEND _picky "-wd4820") # 'A': 'N' bytes padding added after data member 'B'
if(MSVC_VERSION GREATER_EQUAL 1900) if(MSVC_VERSION GREATER_EQUAL 1900)
list(APPEND _picky "-wd5045") # Compiler inserts Spectre mitigation for memory load if /Qspectre switch specified list(APPEND _picky "-wd5045") # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
endif() endif()
endif() endif()
endif() endif()
@ -431,21 +345,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
endforeach() endforeach()
endif() 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") # 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) if(_picky_nocheck OR _picky)
set(_picky_tmp "${_picky_nocheck}" "${_picky}") set(_picky_tmp "${_picky_nocheck}" "${_picky}")
string(REPLACE ";" " " _picky_tmp "${_picky_tmp}") string(REPLACE ";" " " _picky_tmp "${_picky_tmp}")

View file

@ -37,9 +37,6 @@ endfunction()
# Dump all defined variables with their values # Dump all defined variables with their values
function(curl_dumpvars) function(curl_dumpvars)
message("::group::CMake Variable Dump") message("::group::CMake Variable Dump")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.5)
cmake_language(PRINT_VARIABLES ALL)
else()
get_cmake_property(_vars VARIABLES) get_cmake_property(_vars VARIABLES)
foreach(_var IN ITEMS ${_vars}) foreach(_var IN ITEMS ${_vars})
get_property(_var_type CACHE ${_var} PROPERTY TYPE) get_property(_var_type CACHE ${_var} PROPERTY TYPE)
@ -50,42 +47,33 @@ function(curl_dumpvars)
if(_var_advanced) if(_var_advanced)
set(_var_advanced " [adv]") set(_var_advanced " [adv]")
endif() endif()
message(" ${_var}${_var_type}${_var_advanced} = \"${${_var}}\"") message("${_var}${_var_type}${_var_advanced} = '${${_var}}'")
endforeach() endforeach()
endif()
message("::endgroup::") message("::endgroup::")
endfunction() endfunction()
# Dump all target properties # Dump all target properties
function(curl_dumptargetprops _target) function(curl_dumptargetprops _target)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 4.5) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19 AND TARGET "${_target}")
cmake_language(PRINT_PROPERTIES TARGETS "${_target}" ALL)
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19 AND TARGET "${_target}")
execute_process(COMMAND "${CMAKE_COMMAND}" "--help-property-list" OUTPUT_VARIABLE _cmake_property_list) execute_process(COMMAND "${CMAKE_COMMAND}" "--help-property-list" OUTPUT_VARIABLE _cmake_property_list)
string(REPLACE "\n" ";" _cmake_property_list "${_cmake_property_list}") string(REPLACE "\n" ";" _cmake_property_list "${_cmake_property_list}")
list(REMOVE_DUPLICATES _cmake_property_list) list(REMOVE_DUPLICATES _cmake_property_list)
list(REMOVE_ITEM _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()
list(SORT _cmake_property_list)
foreach(_prop IN LISTS _cmake_property_list) foreach(_prop IN LISTS _cmake_property_list)
if(_prop MATCHES "<CONFIG>") if(_prop MATCHES "<CONFIG>")
foreach(_config IN ITEMS "DEBUG" "MINSIZEREL" "RELEASE" "RELWITHDEBINFO") foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO")
string(REPLACE "<CONFIG>" "${_config}" _propconfig "${_prop}") string(REPLACE "<CONFIG>" "${_config}" _propconfig "${_prop}")
get_property(_is_set TARGET "${_target}" PROPERTY "${_propconfig}" SET) get_property(_is_set TARGET "${_target}" PROPERTY "${_propconfig}" SET)
if(_is_set) if(_is_set)
get_target_property(_val "${_target}" "${_propconfig}") get_target_property(_val "${_target}" "${_propconfig}")
message(" ${_target}.${_propconfig} = \"${_val}\"") message("${_target}.${_propconfig} = '${_val}'")
endif() endif()
endforeach() endforeach()
else() else()
get_property(_is_set TARGET "${_target}" PROPERTY "${_prop}" SET) get_property(_is_set TARGET "${_target}" PROPERTY "${_prop}" SET)
if(_is_set) if(_is_set)
get_target_property(_val "${_target}" "${_prop}") get_target_property(_val "${_target}" "${_prop}")
message(" ${_target}.${_prop} = \"${_val}\"") message("${_target}.${_prop} = '${_val}'")
endif() endif()
endif() endif()
endforeach() endforeach()

View file

@ -21,28 +21,30 @@
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
# #
########################################################################### ###########################################################################
set(_manifest "@PROJECT_BINARY_DIR@/install_manifest.txt") if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
if(NOT EXISTS "${_manifest}") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: ${_manifest}")
endif() endif()
set(_destdir "$ENV{DESTDIR}") if(NOT DEFINED CMAKE_INSTALL_PREFIX)
if(NOT _destdir STREQUAL "") set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
message(STATUS "DESTDIR environment: ${_destdir}")
endif() endif()
message(${CMAKE_INSTALL_PREFIX})
file(READ "${_manifest}" _files) file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" _files)
string(REGEX REPLACE "\n" ";" _files "${_files}") string(REGEX REPLACE "\n" ";" _files "${_files}")
foreach(_file IN LISTS _files) foreach(_file ${_files})
set(_target "${_destdir}${_file}") message(STATUS "Uninstalling $ENV{DESTDIR}${_file}")
if(IS_SYMLINK "${_target}" OR EXISTS "${_target}") if(IS_SYMLINK "$ENV{DESTDIR}${_file}" OR EXISTS "$ENV{DESTDIR}${_file}")
file(REMOVE "${_target}") execute_process(
if(IS_SYMLINK "${_target}" OR EXISTS "${_target}") COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${_file}"
message(STATUS "Failed to delete: ${_target}") RESULT_VARIABLE rm_retval
else() OUTPUT_QUIET
message(STATUS "Uninstalled: ${_target}") ERROR_QUIET
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${_file}")
endif() endif()
else() else()
message(STATUS "File does not exist: ${_target}") message(STATUS "File $ENV{DESTDIR}${_file} does not exist.")
endif() endif()
endforeach() endforeach()

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 COMPONENTS "@GSS_FLAVOR@")
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 COMPONENTS "@NGTCP2_CRYPTO_BACKEND@")
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

@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
# #
########################################################################### ###########################################################################
# Based on CI runs for Cygwin/MSYS2, Linux, macOS/iOS, DragonFly BSD, FreeBSD, MidnightBSD, NetBSD, OpenBSD # Based on CI runs for Cygwin/MSYS2, Linux, macOS, FreeBSD, NetBSD, OpenBSD
if(NOT UNIX) if(NOT UNIX)
message(FATAL_ERROR "This file should be included on Unix platforms only") message(FATAL_ERROR "This file should be included on Unix platforms only")
endif() endif()
@ -30,9 +30,7 @@ if(APPLE OR
CYGWIN) CYGWIN)
set(HAVE_ACCEPT4 0) set(HAVE_ACCEPT4 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_ACCEPT4 1) set(HAVE_ACCEPT4 1)
@ -60,26 +58,13 @@ set(HAVE_DECL_FSEEKO 1)
set(HAVE_DIRENT_H 1) set(HAVE_DIRENT_H 1)
if(APPLE OR if(APPLE OR
CYGWIN OR CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_EVENTFD 0) set(HAVE_EVENTFD 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD") CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_EVENTFD 1) set(HAVE_EVENTFD 1)
endif() endif()
if(ANDROID AND ANDROID_PLATFORM_LEVEL GREATER_EQUAL 34)
set(HAVE_MEMSET_EXPLICIT 1)
endif()
if((APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.9) OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR # v6+
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR # v11.2+
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD") # v1.3+
set(HAVE_MEMSET_S 1)
elseif(NOT APPLE)
set(HAVE_MEMSET_S 0)
endif()
set(HAVE_FCNTL 1) set(HAVE_FCNTL 1)
set(HAVE_FCNTL_H 1) set(HAVE_FCNTL_H 1)
set(HAVE_FCNTL_O_NONBLOCK 1) set(HAVE_FCNTL_O_NONBLOCK 1)
@ -91,9 +76,7 @@ if(APPLE)
set(HAVE_FSETXATTR 1) set(HAVE_FSETXATTR 1)
set(HAVE_FSETXATTR_5 0) set(HAVE_FSETXATTR_5 0)
set(HAVE_FSETXATTR_6 1) set(HAVE_FSETXATTR_6 1)
elseif(CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_FSETXATTR 0) set(HAVE_FSETXATTR 0)
set(HAVE_FSETXATTR_5 0) set(HAVE_FSETXATTR_5 0)
@ -105,8 +88,14 @@ elseif(CYGWIN OR
set(HAVE_FSETXATTR_5 1) set(HAVE_FSETXATTR_5 1)
set(HAVE_FSETXATTR_6 0) set(HAVE_FSETXATTR_6 0)
endif() endif()
set(HAVE_FTRUNCATE 1)
set(HAVE_GETADDRINFO 1) set(HAVE_GETADDRINFO 1)
if(CYGWIN) if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETADDRINFO_THREADSAFE 0)
elseif(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_GETADDRINFO_THREADSAFE 1) set(HAVE_GETADDRINFO_THREADSAFE 1)
endif() endif()
set(HAVE_GETEUID 1) set(HAVE_GETEUID 1)
@ -116,19 +105,14 @@ if(APPLE OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETHOSTBYNAME_R 0) set(HAVE_GETHOSTBYNAME_R 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
set(HAVE_GETHOSTBYNAME_R 1) set(HAVE_GETHOSTBYNAME_R 1)
endif() endif()
set(HAVE_GETHOSTBYNAME_R_3 0) set(HAVE_GETHOSTBYNAME_R_3 0)
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0) set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_5 0) set(HAVE_GETHOSTBYNAME_R_5 0)
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0) set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD")
set(HAVE_GETHOSTBYNAME_R_6 1) set(HAVE_GETHOSTBYNAME_R_6 1)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 1) set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 1)
else() else()
@ -144,9 +128,7 @@ endif()
if(APPLE OR if(APPLE OR
CYGWIN OR CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETPASS_R 0) set(HAVE_GETPASS_R 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD") elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
@ -160,13 +142,15 @@ set(HAVE_GETRLIMIT 1)
set(HAVE_GETSOCKNAME 1) set(HAVE_GETSOCKNAME 1)
set(HAVE_GETTIMEOFDAY 1) set(HAVE_GETTIMEOFDAY 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Depends on C library. set(HAVE_GLIBC_STRERROR_R 1)
else() else()
set(HAVE_GLIBC_STRERROR_R 0) set(HAVE_GLIBC_STRERROR_R 0)
endif() endif()
set(HAVE_GMTIME_R 1) set(HAVE_GMTIME_R 1)
set(HAVE_IFADDRS_H 1) set(HAVE_IFADDRS_H 1)
set(HAVE_IF_NAMETOINDEX 1) set(HAVE_IF_NAMETOINDEX 1)
set(HAVE_INET_NTOP 1)
set(HAVE_INET_PTON 1)
set(HAVE_IOCTLSOCKET 0) set(HAVE_IOCTLSOCKET 0)
set(HAVE_IOCTLSOCKET_CAMEL 0) set(HAVE_IOCTLSOCKET_CAMEL 0)
set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0) set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0)
@ -180,12 +164,12 @@ else()
endif() endif()
set(HAVE_LIBGEN_H 1) set(HAVE_LIBGEN_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 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() else()
set(HAVE_LINUX_TCP_H 0) set(HAVE_LINUX_TCP_H 0)
endif() endif()
set(HAVE_LOCALE_H 1) set(HAVE_LOCALE_H 1)
set(HAVE_LOCALTIME_R 1) set(HAVE_LONGLONG 1)
if(APPLE) if(APPLE)
set(HAVE_MACH_ABSOLUTE_TIME 1) set(HAVE_MACH_ABSOLUTE_TIME 1)
endif() endif()
@ -195,6 +179,7 @@ if(APPLE OR
else() else()
set(HAVE_MEMRCHR 1) set(HAVE_MEMRCHR 1)
endif() endif()
set(HAVE_MSG_NOSIGNAL 1)
set(HAVE_NETDB_H 1) set(HAVE_NETDB_H 1)
if(ANDROID) if(ANDROID)
set(HAVE_NETINET_IN6_H 1) set(HAVE_NETINET_IN6_H 1)
@ -211,14 +196,15 @@ if(APPLE OR
CYGWIN) CYGWIN)
set(HAVE_PIPE2 0) set(HAVE_PIPE2 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "SunOS") CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_PIPE2 1) set(HAVE_PIPE2 1)
endif() endif()
set(HAVE_POLL 1) set(HAVE_POLL 1)
set(HAVE_POLL_H 1) set(HAVE_POLL_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Depends on C library. set(HAVE_POSIX_STRERROR_R 0)
else() else()
set(HAVE_POSIX_STRERROR_R 1) set(HAVE_POSIX_STRERROR_R 1)
endif() endif()
@ -227,32 +213,40 @@ set(HAVE_REALPATH 1)
set(HAVE_RECV 1) set(HAVE_RECV 1)
set(HAVE_SA_FAMILY_T 1) set(HAVE_SA_FAMILY_T 1)
set(HAVE_SCHED_YIELD 1) set(HAVE_SCHED_YIELD 1)
set(HAVE_SELECT 1)
set(HAVE_SEND 1) set(HAVE_SEND 1)
if(APPLE OR if(APPLE OR
CYGWIN OR CYGWIN)
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD")
set(HAVE_SENDMMSG 0) set(HAVE_SENDMMSG 0)
else() else()
set(HAVE_SENDMMSG 1) set(HAVE_SENDMMSG 1)
endif() endif()
set(HAVE_SENDMSG 1) set(HAVE_SENDMSG 1)
set(HAVE_SETLOCALE 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_SETRLIMIT 1)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0) set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 1) set(HAVE_SIGACTION 1)
set(HAVE_SIGINTERRUPT 1) set(HAVE_SIGINTERRUPT 1)
set(HAVE_SIGNAL 1) set(HAVE_SIGNAL 1)
set(HAVE_SIGSETJMP 1) set(HAVE_SIGSETJMP 1)
set(HAVE_SNPRINTF 1)
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1) set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1) set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1) set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 1) set(HAVE_SOCKETPAIR 1)
set(HAVE_STDATOMIC_H 1) set(HAVE_STDATOMIC_H 1)
set(HAVE_STDBOOL_H 1) set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size() set(HAVE_STDDEF_H 1)
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size() set(HAVE_STDINT_H 1)
set(HAVE_STRCASECMP 1) set(HAVE_STRCASECMP 1)
set(HAVE_STRCMPI 0) set(HAVE_STRCMPI 0)
set(HAVE_STRDUP 1)
set(HAVE_STRERROR_R 1) set(HAVE_STRERROR_R 1)
set(HAVE_STRICMP 0) set(HAVE_STRICMP 0)
set(HAVE_STRINGS_H 1) set(HAVE_STRINGS_H 1)
@ -268,12 +262,10 @@ if(ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
endif() endif()
if(APPLE OR if(APPLE OR
CYGWIN OR CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_SYS_EVENTFD_H 0) set(HAVE_SYS_EVENTFD_H 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD") CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_SYS_EVENTFD_H 1) set(HAVE_SYS_EVENTFD_H 1)
endif() endif()
@ -314,4 +306,8 @@ set(HAVE_UTIME 1)
set(HAVE_UTIMES 1) set(HAVE_UTIMES 1)
set(HAVE_UTIME_H 1) set(HAVE_UTIME_H 1)
set(HAVE_WRITABLE_ARGV 1) set(HAVE_WRITABLE_ARGV 1)
if(CYGWIN)
set(HAVE__SETMODE 1)
endif()
set(STDC_HEADERS 1)
set(USE_UNIX_SOCKETS 1) set(USE_UNIX_SOCKETS 1)

View file

@ -28,7 +28,12 @@ endif()
if(MINGW) if(MINGW)
set(HAVE_BASENAME 1) set(HAVE_BASENAME 1)
set(HAVE_BOOL_T 1) # = HAVE_STDBOOL_H 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_LIBGEN_H 1)
set(HAVE_OPENDIR 1)
set(HAVE_SNPRINTF 1)
set(HAVE_STDBOOL_H 1) set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size() 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_STDINT_H 1) # detected by CMake internally in check_type_size()
@ -37,20 +42,33 @@ if(MINGW)
set(HAVE_UNISTD_H 1) set(HAVE_UNISTD_H 1)
set(HAVE_UTIME_H 1) # wrapper to sys/utime.h set(HAVE_UTIME_H 1) # wrapper to sys/utime.h
else() else()
set(HAVE_DIRENT_H 0)
set(HAVE_FTRUNCATE 0)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_LIBGEN_H 0) set(HAVE_LIBGEN_H 0)
set(HAVE_OPENDIR 0)
set(HAVE_STRINGS_H 0) set(HAVE_STRINGS_H 0)
set(HAVE_SYS_PARAM_H 0) set(HAVE_SYS_PARAM_H 0)
set(HAVE_UTIME_H 0) set(HAVE_UTIME_H 0)
if(MSVC) if(MSVC)
set(HAVE_UNISTD_H 0) set(HAVE_UNISTD_H 0)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size() set(HAVE_STDDEF_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() 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) if(MSVC_VERSION GREATER_EQUAL 1800)
set(HAVE_STDBOOL_H 1) set(HAVE_STDBOOL_H 1)
else() else()
set(HAVE_STDBOOL_H 0) set(HAVE_STDBOOL_H 0)
endif() endif()
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}") 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) set(HAVE_BASENAME 0)
endif() endif()
endif() endif()
@ -98,6 +116,8 @@ set(HAVE_GETSOCKNAME 1)
set(HAVE_GLIBC_STRERROR_R 0) set(HAVE_GLIBC_STRERROR_R 0)
set(HAVE_GMTIME_R 0) set(HAVE_GMTIME_R 0)
set(HAVE_IFADDRS_H 0) set(HAVE_IFADDRS_H 0)
set(HAVE_INET_NTOP 0)
set(HAVE_INET_PTON 0)
set(HAVE_IOCTLSOCKET 1) set(HAVE_IOCTLSOCKET 1)
set(HAVE_IOCTLSOCKET_CAMEL 0) set(HAVE_IOCTLSOCKET_CAMEL 0)
set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0) set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0)
@ -107,8 +127,8 @@ set(HAVE_IOCTL_SIOCGIFADDR 0)
set(HAVE_IO_H 1) set(HAVE_IO_H 1)
set(HAVE_LINUX_TCP_H 0) set(HAVE_LINUX_TCP_H 0)
set(HAVE_LOCALE_H 1) set(HAVE_LOCALE_H 1)
set(HAVE_LOCALTIME_R 0)
set(HAVE_MEMRCHR 0) set(HAVE_MEMRCHR 0)
set(HAVE_MSG_NOSIGNAL 0)
set(HAVE_NETDB_H 0) set(HAVE_NETDB_H 0)
set(HAVE_NETINET_IN6_H 0) set(HAVE_NETINET_IN6_H 0)
set(HAVE_NETINET_IN_H 0) set(HAVE_NETINET_IN_H 0)
@ -122,10 +142,12 @@ set(HAVE_POLL_H 0)
set(HAVE_POSIX_STRERROR_R 0) set(HAVE_POSIX_STRERROR_R 0)
set(HAVE_PWD_H 0) set(HAVE_PWD_H 0)
set(HAVE_RECV 1) set(HAVE_RECV 1)
set(HAVE_SELECT 1)
set(HAVE_SEND 1) set(HAVE_SEND 1)
set(HAVE_SENDMMSG 0) set(HAVE_SENDMMSG 0)
set(HAVE_SENDMSG 0) set(HAVE_SENDMSG 0)
set(HAVE_SETLOCALE 1) set(HAVE_SETLOCALE 1)
set(HAVE_SETMODE 1)
set(HAVE_SETRLIMIT 0) set(HAVE_SETRLIMIT 0)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0) set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 0) set(HAVE_SIGACTION 0)
@ -135,6 +157,7 @@ set(HAVE_SIGSETJMP 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1) set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1) set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 0) set(HAVE_SOCKETPAIR 0)
set(HAVE_STRDUP 1)
set(HAVE_STRERROR_R 0) set(HAVE_STRERROR_R 0)
set(HAVE_STROPTS_H 0) set(HAVE_STROPTS_H 0)
set(HAVE_STRUCT_SOCKADDR_STORAGE 1) set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
@ -154,6 +177,8 @@ set(HAVE_TERMIO_H 0)
set(HAVE_TIME_T_UNSIGNED 0) set(HAVE_TIME_T_UNSIGNED 0)
set(HAVE_UTIME 1) set(HAVE_UTIME 1)
set(HAVE_UTIMES 0) set(HAVE_UTIMES 0)
set(HAVE__SETMODE 1)
set(STDC_HEADERS 1)
# Types and sizes # Types and sizes
@ -163,11 +188,11 @@ set(HAVE_SIZEOF_SUSECONDS_T 0)
if(MINGW OR MSVC) if(MINGW OR MSVC)
curl_prefill_type_size("INT" 4) curl_prefill_type_size("INT" 4)
curl_prefill_type_size("LONG" 4) curl_prefill_type_size("LONG" 4)
curl_prefill_type_size("LONG_LONG" 8)
curl_prefill_type_size("__INT64" 8) curl_prefill_type_size("__INT64" 8)
curl_prefill_type_size("CURL_OFF_T" 8) curl_prefill_type_size("CURL_OFF_T" 8)
curl_prefill_type_size("CURL_SOCKET_T" ${CMAKE_SIZEOF_VOID_P}) # CURL_SOCKET_T, SIZE_T: 8 for _WIN64, 4 otherwise
curl_prefill_type_size("SIZE_T" ${CMAKE_SIZEOF_VOID_P}) # TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise
# TIME_T: 8 for _WIN64 or UCRT or MSVC, 4 otherwise
# Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set. # 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. # mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined.
if(MSVC) if(MSVC)
@ -175,8 +200,30 @@ if(MINGW OR MSVC)
set(HAVE_FILE_OFFSET_BITS 0) set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("OFF_T" 4) curl_prefill_type_size("OFF_T" 4)
else() 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+ set(HAVE_FILE_OFFSET_BITS 1) # mingw-w64 v3+
curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+ curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+
endif() endif()
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 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. contributors, see the THANKS file.
All rights reserved. All rights reserved.

View file

@ -24,7 +24,7 @@
# $ ./scripts/maketgz 8.7.1 # $ ./scripts/maketgz 8.7.1
# To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags # To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags
FROM debian:bookworm-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 FROM debian:bookworm-slim@sha256:df52e55e3361a81ac1bead266f3373ee55d29aa50cf0975d440c2be3483d8ed3
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \ 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 && \ build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \
@ -32,7 +32,7 @@ RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
ARG UID=1000 GID=1000 ARG UID=1000 GID=1000
RUN groupadd --gid $GID dev && \ RUN groupadd --gid $UID dev && \
useradd --uid $UID --gid dev --shell /bin/bash --create-home dev useradd --uid $UID --gid dev --shell /bin/bash --create-home dev
USER dev:dev USER dev:dev

View file

@ -1,8 +1,3 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
_ _ ____ _ _ _ ____ _
___| | | | _ \| | ___| | | | _ \| |
/ __| | | | |_) | | / __| | | | |_) | |
@ -28,6 +23,6 @@ Daniel uses a configure line similar to this for easier development:
## REQUIREMENTS ## REQUIREMENTS
See [docs/DEPENDENCIES.md][0] for requirement details. See [docs/INTERNALS.md][0] for requirement details.
[0]: docs/DEPENDENCIES.md [0]: docs/INTERNALS.md

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) BSD-4-Clause (University of California-Specific)
Copyright [various years] The Regents of the University of California. Copyright [various years] The Regents of the University of California. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, 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.
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 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.
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 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.
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 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.
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

@ -27,19 +27,19 @@ AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
CMAKE_DIST = \ CMAKE_DIST = \
CMake/cmake_uninstall.in.cmake \ CMake/cmake_uninstall.cmake.in \
CMake/curl-config.in.cmake \ CMake/CMakeConfigurableFile.in \
CMake/curl-config.cmake.in \
CMake/CurlSymbolHiding.cmake \ CMake/CurlSymbolHiding.cmake \
CMake/CurlTests.c \ CMake/CurlTests.c \
CMake/FindBrotli.cmake \ CMake/FindBrotli.cmake \
CMake/FindCares.cmake \ CMake/FindCares.cmake \
CMake/FindGnuTLS.cmake \
CMake/FindGSS.cmake \ CMake/FindGSS.cmake \
CMake/FindLDAP.cmake \ CMake/FindLDAP.cmake \
CMake/FindLibbacktrace.cmake \
CMake/FindLibgsasl.cmake \ CMake/FindLibgsasl.cmake \
CMake/FindLibidn2.cmake \ CMake/FindLibidn2.cmake \
CMake/FindLibpsl.cmake \ CMake/FindLibpsl.cmake \
CMake/FindLibrtmp.cmake \
CMake/FindLibssh.cmake \ CMake/FindLibssh.cmake \
CMake/FindLibssh2.cmake \ CMake/FindLibssh2.cmake \
CMake/FindLibuv.cmake \ CMake/FindLibuv.cmake \
@ -50,6 +50,7 @@ CMAKE_DIST = \
CMake/FindNettle.cmake \ CMake/FindNettle.cmake \
CMake/FindQuiche.cmake \ CMake/FindQuiche.cmake \
CMake/FindRustls.cmake \ CMake/FindRustls.cmake \
CMake/FindWolfSSH.cmake \
CMake/FindWolfSSL.cmake \ CMake/FindWolfSSL.cmake \
CMake/FindZstd.cmake \ CMake/FindZstd.cmake \
CMake/Macros.cmake \ CMake/Macros.cmake \
@ -61,24 +62,39 @@ CMAKE_DIST = \
CMakeLists.txt \ CMakeLists.txt \
tests/cmake/CMakeLists.txt \ tests/cmake/CMakeLists.txt \
tests/cmake/test.c \ tests/cmake/test.c \
tests/cmake/test.cpp \
tests/cmake/test.sh 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 DISTCLEANFILES = buildinfo.txt
bin_SCRIPTS = curl-config bin_SCRIPTS = curl-config
SUBDIRS = lib docs src scripts SUBDIRS = lib docs src scripts
DIST_SUBDIRS = $(SUBDIRS) tests projects include docs DIST_SUBDIRS = $(SUBDIRS) tests packages include docs
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc pkgconfig_DATA = libcurl.pc
dist-hook: dist-hook:
rm -rf $(top_builddir)/tests/log 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`; \ (distit=`find $(srcdir) -name "*.dist" | grep -v Makefile`; \
for file in $$distit; do \ for file in $$distit; do \
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \ strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
@ -88,7 +104,6 @@ dist-hook:
check: test examples check-docs check: test examples check-docs
if CROSSCOMPILING if CROSSCOMPILING
test-quiet: test
test-full: test test-full: test
test-nonflaky: test test-nonflaky: test
test-torture: test test-torture: test
@ -99,13 +114,11 @@ pytest: test
pytest-ci: test pytest-ci: test
test: test:
@echo "NOTICE: we cannot run the tests when cross-compiling!" @echo "NOTICE: we can't run the tests when cross-compiling!"
else else
test: test-quiet test:
test-quiet:
@(cd tests; $(MAKE) all quiet-test) @(cd tests; $(MAKE) all quiet-test)
test-full: test-full:
@ -140,6 +153,32 @@ examples:
check-docs: check-docs:
@(cd docs/libcurl; $(MAKE) check) @(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: # We extend the standard install with a custom hook:
if BUILD_DOCS if BUILD_DOCS
install-data-hook: install-data-hook:
@ -172,13 +211,7 @@ checksrc:
(cd tests && $(MAKE) checksrc) (cd tests && $(MAKE) checksrc)
(cd include/curl && $(MAKE) checksrc) (cd include/curl && $(MAKE) checksrc)
(cd docs/examples && $(MAKE) checksrc) (cd docs/examples && $(MAKE) checksrc)
(cd projects && $(MAKE) checksrc) (cd packages && $(MAKE) checksrc)
badwords:
@PERL@ $(top_srcdir)/scripts/badwords-all
lint: badwords checksrc
@PERL@ $(top_srcdir)/scripts/spacecheck.pl
tidy: tidy:
(cd src && $(MAKE) 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 available to be used by your software. Read the libcurl.3 man page to
learn how. learn how.
You find answers to the most frequent questions we get in the FAQ.md You find answers to the most frequent questions we get in the FAQ document.
document.
Study the COPYING file for distribution terms. Study the COPYING file for distribution terms.
@ -39,12 +38,18 @@ GIT
To download the latest source code off the GIT server, do this: 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 get a directory named curl, filled with the source code) (you will get a directory named curl created, filled with the source code)
SECURITY PROBLEMS 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,11 +6,7 @@ SPDX-License-Identifier: curl
# [![curl logo](https://curl.se/logo/curl-logo.svg)](https://curl.se/) # [![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 curl is a command-line tool for transferring data specified with URL syntax.
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.
Learn how to use curl by reading [the Learn how to use curl by reading [the
manpage](https://curl.se/docs/manpage.html) or [everything manpage](https://curl.se/docs/manpage.html) or [everything
curl](https://everything.curl.dev/). curl](https://everything.curl.dev/).
@ -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: 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 ## Security problems
Report suspected security problems Report suspected security problems via [our HackerOne
[privately](https://curl.se/dev/vuln-disclosure.html) and not in public. 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 ## Backers

File diff suppressed because it is too large Load diff

View file

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

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