初始化内容

This commit is contained in:
2026-09-16 14:07:40 +08:00
parent 6934b390bf
commit 4f643c1e7c
18350 changed files with 6088489 additions and 305 deletions
+204
View File
@@ -0,0 +1,204 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
# 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/configuration-reference/
version: 2.1
commands:
install-cares:
steps:
- run:
command: |
sudo apt-get update && sudo apt-get install -y libc-ares-dev
install-libssh:
steps:
- run:
command: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update && sudo apt-get install -y libssh-dev
install-deps:
steps:
- run:
command: |
sudo apt-get update && sudo apt-get install -y libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev python3-pip
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
configure:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
--with-openssl \
|| { tail -1000 config.log; false; }
configure-no-proxy:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror \
--with-openssl --disable-proxy \
|| { tail -1000 config.log; false; }
configure-libssh:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
--with-openssl --with-libssh \
|| { tail -1000 config.log; false; }
configure-cares:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-warnings \
--with-openssl --enable-ares \
|| { tail -1000 config.log; false; }
configure-cares-debug:
steps:
- run:
command: |
autoreconf -fi
./configure --disable-dependency-tracking --enable-option-checking=fatal --enable-unity --enable-werror --enable-debug \
--with-openssl --enable-ares \
|| { tail -1000 config.log; false; }
build:
steps:
- run: make -j3 V=1
- run: src/curl --disable --version
- run: make -j3 V=1 examples
test:
steps:
- run:
command: |
source ~/venv/bin/activate
# Revert a CircleCI-specific local setting that makes test 1459
# return 67 (CURLE_LOGIN_DENIED) instead of the
# expected 60 (CURLE_PEER_FAILED_VERIFICATION).
echo 'StrictHostKeyChecking yes' >> ~/.ssh/config
make -j3 V=1 test-ci TFLAGS='-j14'
executors:
ubuntu:
machine:
image: ubuntu-2204:2025.09.1
jobs:
basic:
executor: ubuntu
steps:
- checkout
- install-deps
- configure
- build
- test
no-proxy:
executor: ubuntu
steps:
- checkout
- install-deps
- configure-no-proxy
- build
- test
cares:
executor: ubuntu
steps:
- checkout
- install-deps
- install-cares
- configure-cares
- build
- test
libssh:
executor: ubuntu
steps:
- checkout
- install-deps
- install-libssh
- configure-libssh
- build
- test
arm:
machine:
image: ubuntu-2204:2025.09.1
resource_class: arm.medium
steps:
- checkout
- install-deps
- configure
- build
- test
arm-cares:
machine:
image: ubuntu-2204:2025.09.1
resource_class: arm.medium
steps:
- checkout
- install-deps
- install-cares
- configure-cares-debug
- build
- test
workflows:
x86-openssl:
jobs:
- basic
openssl-c-ares:
jobs:
- cares
openssl-libssh:
jobs:
- libssh
openssl-no-proxy:
jobs:
- no-proxy
arm-openssl:
jobs:
- arm
arm-openssl-c-ares:
jobs:
- arm-cares
+59
View File
@@ -0,0 +1,59 @@
# 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+
+33
View File
@@ -0,0 +1,33 @@
;;;***************************************************************************
;;; _ _ ____ _
;;; 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
;;;
;;;***************************************************************************
;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.
((nil . ((indent-tabs-mode . nil)
(show-trailing-whitespace . t)))
(c-mode . ((c-basic-offset . 2)
))
(c++-mode . ((c-basic-offset . 2)
))
)
+18
View File
@@ -0,0 +1,18 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
root = true
[*]
charset = utf-8
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true
[*.{c,h}]
indent_size = 2
max_line_length = 79
[*.{pl,pm}]
indent_size = 4
+6
View File
@@ -0,0 +1,6 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# Make repository REUSE compliant
ad9bc5976d6661cd5b03ebc379313bf657701c14
+14
View File
@@ -0,0 +1,14 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
configure.ac eol=lf
*.m4 eol=lf
*.in eol=lf
*.am eol=lf
*.sh eol=lf
*.[ch] whitespace=tab-in-indent
# Batch files must be run with CRLF line endings.
# Refer to https://github.com/curl/curl/pull/6442
*.bat text eol=crlf
+3
View File
@@ -0,0 +1,3 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
+22
View File
@@ -0,0 +1,22 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# How to contribute to curl
## Join the community
1. Click 'watch' on the GitHub repo
2. Subscribe to the suitable [mailing lists](https://curl.se/mail/)
## Read [CONTRIBUTE](/docs/CONTRIBUTE.md)
## Send your suggestions using one of these methods:
1. in a mail to the mailing list
2. as a [pull request](https://github.com/curl/curl/pulls)
3. as an [issue](https://github.com/curl/curl/issues)
/ The curl team
+6
View File
@@ -0,0 +1,6 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
github: curl
open_collective: curl
+50
View File
@@ -0,0 +1,50 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: Bug Report on code
description: Tell us about your problem with curl or libcurl
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
Only file bugs here! Ask questions on the mailing lists https://curl.se/mail/
**SECURITY RELATED?** Submit here: https://hackerone.com/curl
- type: textarea
id: reproducer
attributes:
label: I did this
validations:
required: false
- type: textarea
id: expected-behaviour
attributes:
label: I expected the following
validations:
required: false
- type: textarea
id: version
attributes:
label: curl/libcurl version
description: |
Please paste the output of `curl -V` here.
placeholder: 'curl 8.18.0'
validations:
required: true
- type: textarea
id: os
attributes:
label: operating system
description: |
On Unix please post the output of `uname -a` here.
placeholder: 'Fedora Linux 38'
validations:
required: true
+18
View File
@@ -0,0 +1,18 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
blank_issues_enabled: false
contact_links:
- name: Ask a question (without email)
url: https://github.com/curl/curl/discussions
about: Use the Discussion forum here on GitHub
- name: Ask a question (using email)
url: https://curl.se/mail/
about: Send question to the suitable mailing list
- name: Commercial support
url: https://curl.se/support.html
about: Pay for fast quality support for and help with curl/libcurl
- name: Feature request
url: https://curl.se/mail/
about: To propose new features or enhancements, please bring that discussion to a suitable curl mailing list.
+32
View File
@@ -0,0 +1,32 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: Bug Report on documentation
description: Problems, errors, mistakes or typos in documentation.
labels: documentation
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
Only file documentation bugs here! Ask questions on the mailing lists https://curl.se/mail/
- type: textarea
id: source
attributes:
label: Specify which documentation you found a problem with
description: |
Include function name, URL, tarball version and all other relevant
details that identify the documentation source.
validations:
required: true
- type: textarea
id: problem
attributes:
label: The problem
validations:
required: true
+38
View File
@@ -0,0 +1,38 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# https://docs.github.com/code-security/dependabot/working-with-dependabot/dependabot-options-reference
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'monthly'
cooldown:
default-days: 7
groups:
gha-dependencies:
patterns:
- '*'
commit-message:
prefix: 'GHA:'
- package-ecosystem: 'pip'
directories:
- '.github/scripts'
- 'tests'
schedule:
interval: 'monthly'
cooldown:
default-days: 7
semver-major-days: 15
semver-minor-days: 7
semver-patch-days: 3
groups:
pip-dependencies:
patterns:
- '*'
commit-message:
prefix: 'GHA:'
+556
View File
@@ -0,0 +1,556 @@
# Copyright (C) Daniel Fandrich, <dan@coneharvesters.com>, et al.
#
# SPDX-License-Identifier: curl
# The workflow configures the .github/workflows/label.yml action
# to add labels to pull requests. This is not (yet?) a replacement for human
# triaging, but is intended to add labels to the easy cases. If the matching
# language becomes more powerful, more cases should be able to be handled.
#
# Labels are added in two ways: the any-glob-to-all-files ones are added if all
# the files fit into the category, and the any-glob-to-any-file ones are added
# as long as any file matches. The first ones are for "major" categories (the
# PR is all about that one topic, like HTTP/3), while the second ones are
# "addendums" that give useful information about a PR that is really mostly
# 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.
# Therefore, to get any-glob-to-all-files semantics with multiple matching
# patterns, they must be joined with commas to a single string surrounded by
# braces. For example: '{lib/**,src/**}'.
#
# See https://github.com/actions/labeler/ for documentation on this file.
---
appleOS:
- all:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/macos.yml,\
lib/config-mac.h,\
lib/macos*,\
lib/vtls/apple.*,\
m4/curl-apple-sectrust.m4\
}"
authentication:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindGSS.cmake,\
CMake/FindLibgsasl.cmake,\
docs/libcurl/opts/CURLINFO_HTTPAUTH*,\
docs/libcurl/opts/CURLINFO_PROXYAUTH*,\
docs/libcurl/opts/CURLOPT_KRB*,\
docs/libcurl/opts/CURLOPT_SASL*,\
docs/libcurl/opts/CURLOPT_SERVICE_NAME*,\
docs/libcurl/opts/CURLOPT_USERNAME*,\
docs/libcurl/opts/CURLOPT_USERPWD*,\
docs/libcurl/opts/CURLOPT_XOAUTH*,\
lib/*gssapi*,\
lib/*ntlm*,\
lib/curl_sasl.*,\
lib/http_aws*,\
lib/http_digest.*,\
lib/http_negotiate.*,\
lib/vauth/**\
}"
build:
- all:
- changed-files:
- any-glob-to-all-files: "{\
**/CMakeLists.txt,\
**/Makefile.am,\
**/Makefile.inc,\
**/*.m4,\
*.m4,\
docs/INSTALL-CMAKE.md,\
lib/curl_config-cmake.h.in,\
lib/libcurl*.in,\
CMake/**,\
CMakeLists.txt,\
configure.ac,\
m4/**,\
Makefile.*,\
projects/**,\
lib/libcurl.def,\
tests/cmake/**\
}"
CI:
- all:
- changed-files:
- any-glob-to-any-file:
- '.circleci/**'
- '.github/**'
- 'appveyor.*'
- 'scripts/ci*'
- 'tests/azure.pm'
- 'tests/appveyor.pm'
- 'tests/CI.md'
cmake:
- all:
- changed-files:
- any-glob-to-all-files: "{\
**/CMakeLists.txt,\
CMake/**,\
docs/INSTALL-CMAKE.md,\
lib/curl_config-cmake.h.in,\
tests/cmake/**\
}"
cmdline tool:
- all:
- changed-files:
- any-glob-to-any-file:
- 'docs/cmdline-opts/**'
- 'src/**'
connecting & proxies:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/happy-eyeballs*,\
docs/cmdline-opts/ipv*,\
docs/cmdline-opts/*proxy*,\
docs/internals/CONNECTION-FILTERS.md,\
docs/examples/ipv6.c,\
docs/libcurl/opts/CURLINFO_CONNECT*,\
docs/libcurl/opts/CURLINFO_PROXY*,\
docs/libcurl/opts/CURLOPT_ADDRESS*,\
docs/libcurl/opts/CURLOPT_CONNECT*,\
docs/libcurl/opts/CURLOPT_HAPROXY*,\
docs/libcurl/opts/CURLOPT_OPENSOCKET*,\
docs/libcurl/opts/CURLOPT_PRE_PROXY*,\
docs/libcurl/opts/CURLOPT_PROXY*,\
docs/libcurl/opts/CURLOPT_SOCKOPT*,\
docs/libcurl/opts/CURLOPT_SOCKS*,\
docs/libcurl/opts/CURLOPT_TCP*,\
docs/libcurl/opts/CURLOPT_TIMEOUT*,\
lib/cf-*proxy.*,\
lib/cf-socket.*,\
lib/cfilters.*,\
lib/conncache.*,\
lib/connect.*,\
lib/http_proxy.*,\
lib/if2ip.*,\
lib/noproxy.*,\
lib/socks.*,\
src/tool_cb_soc.*,\
tests/http/*socks*,\
tests/server/socksd.c\
}"
cookies:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibpsl.cmake,\
docs/HTTP-COOKIES.md,\
docs/cmdline-opts/cookie*,\
docs/cmdline-opts/junk-session-cookies.md,\
docs/libcurl/opts/CURLINFO_COOKIE*,\
docs/libcurl/opts/CURLOPT_COOKIE*,\
docs/examples/cookie_interface.c,\
lib/cookie.*,\
lib/psl.*\
}"
cryptography:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/CIPHERS.md,\
docs/RUSTLS.md,\
docs/libcurl/opts/CURLOPT_EGDSOCKET*,\
lib/*sha256*,\
lib/*sha512*,\
lib/curl_hmac.*,\
lib/curl_md?.*,\
lib/curl_ntlm_core.*,\
lib/md?.*,\
lib/rand.*\
}"
DICT:
- all:
- changed-files:
- any-glob-to-all-files: "{\
lib/dict.*,\
tests/dictserver.py\
}"
documentation:
- all:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/checkdocs.yml,\
.github/scripts/pyspelling*,\
.github/scripts/requirements-docs.txt,\
.github/scripts/requirements-proselint.txt,\
.github/scripts/typos*,\
.github/scripts/verify-examples.pl,\
.github/scripts/verify-synopsis.pl,\
**/*.md,\
**/*.txt,\
**/*.1,\
CHANGES.md,\
docs/**,\
LICENSES/**,\
README,\
RELEASE-NOTES,\
scripts/badwords.*,\
scripts/cd*,\
scripts/mdlinkcheck,\
scripts/nroff2cd,\
scripts/release-notes.pl\
}"
- all-globs-to-all-files:
# negative matches
- '!**/CMakeLists.txt'
- '!**/Makefile.am'
FTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/ftp*,\
docs/libcurl/opts/CURLINFO_FTP*,\
docs/libcurl/opts/CURLOPT_FTP*,\
docs/libcurl/opts/CURLOPT_WILDCARDMATCH*,\
docs/examples/ftp*,\
lib/curl_fnmatch.*,\
lib/curl_range.*,\
lib/ftp*,\
tests/ftp*,\
tests/http/*ftpd*,\
tests/http/testenv/*ftpd*,\
tests/libtest/*_ftp_*\
}"
GOPHER:
- all:
- changed-files:
- any-glob-to-all-files: "{\
lib/gopher*\
}"
HTTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/HTTPSRR.md,\
docs/HSTS.md,\
docs/examples/hsts*,\
docs/examples/http-*,\
docs/examples/httpput*,\
docs/examples/https*,\
docs/examples/*post*,\
docs/HTTP-COOKIES.md,\
docs/libcurl/opts/CURLINFO_COOKIE*,\
docs/libcurl/opts/CURLINFO_HTTP*,\
docs/libcurl/opts/CURLINFO_REDIRECT*,\
docs/libcurl/opts/CURLINFO_REFER*,\
docs/libcurl/opts/CURLOPT_COOKIE*,\
docs/libcurl/opts/CURLOPT_FOLLOWLOCATION*,\
docs/libcurl/opts/CURLOPT_HSTS*,\
docs/libcurl/opts/CURLOPT_HTTP*,\
docs/libcurl/opts/CURLOPT_POST.*,\
docs/libcurl/opts/CURLOPT_POSTFIELD*,\
docs/libcurl/opts/CURLOPT_POSTREDIR*,\
docs/libcurl/opts/CURLOPT_REDIR*,\
docs/libcurl/opts/CURLOPT_REFER*,\
docs/libcurl/opts/CURLOPT_TRAILER*,\
docs/libcurl/opts/CURLOPT_TRANSFER_ENCODING*,\
lib/cf-https*,\
lib/cf-h1*,\
lib/cf-h2*,\
lib/cookie.*,\
lib/hsts.*,\
lib/http*,\
tests/http*,\
tests/http-server.pl,\
tests/http/*,\
tests/nghttp*\
}"
HTTP/2:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindNGHTTP2.cmake,\
CMake/FindQuiche.cmake,\
docs/libcurl/opts/CURLOPT_STREAM*,\
docs/examples/http2*,\
lib/http2*,\
tests/http2-server.pl\
}"
HTTP/3:
- all:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/http3-linux.yml,\
CMake/FindNGHTTP3.cmake,\
CMake/FindNGTCP2.cmake,\
docs/HTTP3.md,\
docs/examples/http3*,\
lib/vquic/**,\
tests/http3-server.pl,\
tests/nghttpx.conf\
}"
IMAP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
lib/imap*,\
docs/examples/imap*\
}"
LDAP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
lib/*ldap*\
}"
libcurl API:
- all:
- changed-files:
- any-glob-to-any-file:
- 'docs/libcurl/ABI.md'
- 'docs/libcurl/curl_*.md'
- 'include/curl/**'
logging:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/trace*,\
docs/libcurl/curl_global_trace*,\
lib/curl_trc*,\
tests/http/test_15_tracing.py\
}"
MIME:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/libcurl/curl_form*,\
docs/libcurl/curl_mime_*,\
docs/libcurl/opts/CURLOPT_MIME*,\
docs/libcurl/opts/CURLOPT_HTTPPOST*,\
lib/formdata*,\
lib/mime*,\
src/tool_formparse.*\
}"
MQTT:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/internals/MQTT.md,\
lib/mqtt*,\
tests/server/mqttd.c\
}"
name lookup:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibidn2.cmake,\
docs/cmdline-opts/doh*,\
docs/cmdline-opts/dns*,\
docs/examples/resolve.c,\
docs/internals/THRDPOOL-AND-QUEUE.md,\
docs/libcurl/opts/CURLINFO_NAMELOOKUP*,\
docs/libcurl/opts/CURLOPT_DNS*,\
docs/libcurl/opts/CURLOPT_DOH*,\
docs/libcurl/opts/CURLOPT_RESOLVE*,\
lib/*addrinfo*,\
lib/asyn*,\
lib/cf-dns.*,\
lib/curl_gethostname.*,\
lib/dns*,\
lib/doh*,\
lib/host*,\
lib/idn*,\
lib/socketpair*,\
lib/thrdpool.*,\
lib/thrdqueue.*,\
tests/http/*resolve.py,\
tests/server/dnsd.c,\
tests/server/resolve.c\
}"
POP3:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/examples/pop3*,\
lib/pop3.*\
}"
RTSP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/libcurl/opts/CURLINFO_RTSP*,\
docs/libcurl/opts/CURLOPT_RTSP*,\
lib/rtsp.*,\
tests/rtspserver.pl,\
tests/server/rtspd.c\
}"
SCP/SFTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindLibssh.cmake,\
CMake/FindLibssh2.cmake,\
docs/cmdline-opts/knownhosts.md,\
docs/libcurl/opts/CURLOPT_SSH*,\
docs/examples/sftp*,\
lib/vssh/**,\
tests/sshhelp.pm,\
tests/sshserver.pl,\
tests/http/*scp*,\
tests/http/*sftp*,\
tests/http/testenv/sshd.py\
}"
script:
- all:
- changed-files:
- any-glob-to-all-files: "{\
**/*.pl,\
**/*.sh,\
curl-config.in,\
docs/curl-config.md,\
docs/mk-ca-bundle.md,\
docs/wcurl.md,\
docs/THANKS-filter,\
scripts/**\
}"
SMB:
- all:
- changed-files:
- any-glob-to-all-files: "{\
lib/smb.*,\
tests/smbserver.py\
}"
SMTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/cmdline-opts/mail*,\
docs/examples/smtp-*,\
docs/libcurl/opts/CURLOPT_MAIL*,\
lib/smtp.*\
}"
tests:
- all:
- changed-files:
- any-glob-to-any-file:
- 'tests/**'
TFTP:
- all:
- changed-files:
- any-glob-to-all-files: "{\
lib/tftp.*,\
tests/tftpserver.pl,\
tests/server/tftp*\
}"
TLS:
- all:
- changed-files:
- any-glob-to-all-files: "{\
CMake/FindGnuTLS.cmake,\
CMake/FindMbedTLS.cmake,\
CMake/FindWolfSSL.cmake,\
CMake/FindRustls.cmake,\
docs/CIPHERS-TLS12.md,\
docs/SSL*,\
docs/cmdline-opts/dump-ca-embed.md,\
docs/cmdline-opts/*cert*,\
docs/cmdline-opts/*ssl*,\
docs/cmdline-opts/*tls*,\
docs/examples/ssl*,\
docs/examples/*ssl.*,\
docs/examples/*tls.*,\
docs/internals/TLS-SESSIONS.md,\
docs/libcurl/curl_global_sslset*,\
docs/libcurl/curl_easy_ssls*,\
docs/libcurl/opts/CURLINFO_CA*,\
docs/libcurl/opts/CURLINFO_CERT*,\
docs/libcurl/opts/CURLINFO_EARLYDATA*,\
docs/libcurl/opts/CURLINFO_SSL*,\
docs/libcurl/opts/CURLINFO_TLS*,\
docs/libcurl/opts/CURLOPT_CA*,\
docs/libcurl/opts/CURLOPT_CERT*,\
docs/libcurl/opts/CURLOPT_PINNEDPUBLICKEY*,\
docs/libcurl/opts/CURLOPT_SSL*,\
docs/libcurl/opts/CURLOPT_TLS*,\
docs/libcurl/opts/CURLOPT_USE_SSL*,\
lib/vtls/**,\
m4/curl-gnutls.m4,\
m4/curl-mbedtls.m4,\
m4/curl-openssl.m4,\
m4/curl-rustls.m4,\
m4/curl-schannel.m4,\
m4/curl-wolfssl.m4,\
src/tool_ssls.*\
}"
URL:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/libcurl/curl_url*,\
docs/URL-SYNTAX.md,\
docs/examples/parseurl*,\
include/curl/urlapi.h,\
lib/urlapi*\
}"
WebSocket:
- all:
- changed-files:
- any-glob-to-all-files: "{\
docs/internals/WEBSOCKET.md,\
docs/examples/websocket*,\
docs/libcurl/curl_ws_*,\
docs/libcurl/libcurl-ws*,\
docs/libcurl/opts/CURLOPT_WS_*,\
include/curl/websockets.h,\
lib/ws.*,\
tests/http/test_20_websockets.py,\
tests/http/testenv/ws*,\
tests/libtest/cli_ws*\
}"
Windows:
- all:
- changed-files:
- any-glob-to-all-files: "{\
.github/workflows/windows.yml,\
appveyor.*,\
CMake/win32-cache.cmake,\
lib/*win32*,\
lib/curlx/fopen.*,\
lib/curlx/multibyte.*,\
lib/curlx/winapi.*,\
lib/vtls/schannel*,\
m4/curl-schannel.m4,\
projects/Windows/**,\
src/tool_doswin.c,\
lib/libcurl.def\
}"
+12
View File
@@ -0,0 +1,12 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# Configuration for lock-threads - https://github.com/dessant/lock-threads
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 90
# Comment to post before locking. Set to `false` to disable
lockComment: false
# Limit to only `issues` or `pulls`
# only: issues
+130
View File
@@ -0,0 +1,130 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# Input: cmdline docs markdown files, they get modified *in place*
#
# Strip off the leading meta-data/header part, remove all known curl symbols
# and long command line options. Also clean up whatever else the spell checker
# might have a problem with that we still deem is fine.
#
use strict;
use warnings;
my @asyms;
open(S, "<./docs/libcurl/symbols-in-versions")
|| die "cannot find symbols-in-versions";
while(<S>) {
if(/^([^ ]*) /) {
push @asyms, $1;
}
}
close(S);
# init the opts table with "special" options not easy to figure out
my @aopts = (
'--ftp-ssl-reqd', # old alias
);
open(O, "<./docs/options-in-versions")
|| die "cannot find options-in-versions";
while(<O>) {
chomp;
if(/^([^ ]+)/) {
my $o = $1;
push @aopts, $o;
if($o =~ /^--no-(.*)/) {
# for the --no options, also make one without it
push @aopts, "--$1";
}
elsif($o =~ /^--disable-(.*)/) {
# for the --disable options, also make the special ones
push @aopts, "--$1";
push @aopts, "--no-$1";
}
}
}
close(O);
open(C, "<./.github/scripts/spellcheck.curl")
|| die "cannot find spellcheck.curl";
while(<C>) {
if(/^\#/) {
next;
}
chomp;
if(/^([^ ]+)/) {
push @asyms, $1;
}
}
close(C);
# longest symbols first
my @syms = sort { length($b) <=> length($a) } @asyms;
# longest cmdline options first
my @opts = sort { length($b) <=> length($a) } @aopts;
sub process {
my ($f) = @_;
my $ignore = 0;
my $sepcount = 0;
my $out;
my $line = 0;
open(F, "<$f") or die;
while(<F>) {
$line++;
if(/^---/ && ($line == 1)) {
$ignore = 1;
next;
}
elsif(/^---/ && $ignore) {
$ignore = 0;
next;
}
next if($ignore);
my $l = $_;
# strip out backticked words
$l =~ s/`[^`]+`//g;
# **bold**
$l =~ s/\*\*(\S.*?)\*\*//g;
# *italics*
$l =~ s/\*(\S.*?)\*//g;
# strip out https URLs, we do not want them spellchecked
$l =~ s!https://[a-z0-9\#_/.-]+!!gi;
# strip links, both name and target
$l =~ s/(\[.*?\])\(.*?\)//g;
$out .= $l;
}
close(F);
# cut out all known curl cmdline options
map { $out =~ s/$_//g; } (@opts);
# cut out all known curl symbols
map { $out =~ s/\b$_\b//g; } (@syms);
if(!$ignore) {
open(O, ">$f") or die;
print O $out;
close(O);
}
}
my @filemasks = @ARGV;
open(my $git_ls_files, '-|', 'git', 'ls-files', '--', @filemasks) or die "Failed running git ls-files: $!";
while(my $f = <$git_ls_files>) {
chomp $f;
process($f);
}
close $git_ls_files;
+137
View File
@@ -0,0 +1,137 @@
#!/usr/bin/env perl
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
use strict;
use warnings;
my $autotools = $ARGV[0];
my $cmake = $ARGV[1];
if(!$cmake) {
print "Usage: cmp-config <config1> <config2.h>\n";
exit;
}
# this lists complete lines that will be removed from the output if
# matching
my %remove = (
'#define CURL_EXTERN_SYMBOL' => 1,
'#define CURL_OS "Linux"' => 1,
'#define CURL_OS "x86_64-pc-linux-gnu"' => 1,
'#define GETHOSTNAME_TYPE_ARG2 int' => 1,
'#define GETHOSTNAME_TYPE_ARG2 size_t' => 1,
'#define HAVE_BROTLI 1' => 1,
'#define HAVE_BROTLI_DECODE_H 1' => 1,
'#define HAVE_DLFCN_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_GENERIC_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_KRB5_H 1' => 1,
'#define HAVE_INTTYPES_H 1' => 1,
'#define HAVE_LDAP_H 1' => 1,
'#define HAVE_LDAP_SSL 1' => 1,
'#define HAVE_LIBBROTLIDEC 1' => 1,
'#define HAVE_LIBPSL_H 1' => 1,
'#define HAVE_LIBSOCKET 1' => 1,
'#define HAVE_LIBSSH' => 1,
'#define HAVE_LIBSSH2 1' => 1,
'#define HAVE_LIBSSL 1' => 1,
'#define HAVE_LIBZSTD 1' => 1,
'#define HAVE_NGHTTP2_NGHTTP2_H 1' => 1,
'#define HAVE_NGHTTP3_NGHTTP3_H 1' => 1,
'#define HAVE_NGTCP2_NGTCP2_CRYPTO_H 1' => 1,
'#define HAVE_NGTCP2_NGTCP2_H 1' => 1,
'#define HAVE_OPENSSL_CRYPTO_H 1' => 1,
'#define HAVE_OPENSSL_ERR_H 1' => 1,
'#define HAVE_OPENSSL_PEM_H 1' => 1,
'#define HAVE_OPENSSL_RSA_H 1' => 1,
'#define HAVE_OPENSSL_SSL_H 1' => 1,
'#define HAVE_QUICHE_H 1' => 1,
'#define HAVE_SSL_SET_QUIC_TLS_CBS 1' => 1,
'#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
'#define HAVE_STDINT_H 1' => 1,
'#define HAVE_STDIO_H 1' => 1,
'#define HAVE_STDLIB_H 1' => 1,
'#define HAVE_STRING_H 1' => 1,
'#define HAVE_SYS_STAT_H 1' => 1,
'#define HAVE_SYS_XATTR_H 1' => 1,
'#define HAVE_UNICODE_UIDNA_H 1' => 1,
'#define HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
'#define HAVE_ZSTD 1' => 1,
'#define HAVE_ZSTD_H 1' => 1,
'#define LT_OBJDIR ".libs/"' => 1,
'#define NEED_LBER_H 1' => 1,
'#define PACKAGE "curl"' => 1,
'#define PACKAGE_BUGREPORT "a suitable curl mailing list: https://curl.se/mail/"' => 1,
'#define PACKAGE_NAME "curl"' => 1,
'#define PACKAGE_STRING "curl -"' => 1,
'#define PACKAGE_TARNAME "curl"' => 1,
'#define PACKAGE_URL ""' => 1,
'#define PACKAGE_VERSION "-"' => 1,
'#define VERSION "-"' => 1,
'#define _FILE_OFFSET_BITS 64' => 1,
);
sub filter {
my ($line) = @_;
if(!$remove{$line}) {
return "$line\n";
}
$remove{$line}++;
return "";
}
sub grepit {
my ($input, $output) = @_;
my @defines;
# first get all the #define lines
open(F, "<$input");
while(<F>) {
if($_ =~ /^#def/) {
chomp;
push @defines, $_;
}
}
close(F);
open(O, ">$output");
# output the sorted list through the filter
foreach my $d(sort @defines) {
print O filter($d);
}
close(O);
}
grepit($autotools, "/tmp/autotools");
grepit($cmake, "/tmp/cmake");
foreach my $v (keys %remove) {
if($remove{$v} == 1) {
print "Ignored, never matched line: $v\n";
}
}
# return the exit code from diff
exit system('diff', ('-u', '/tmp/autotools', '/tmp/cmake')) >> 8;
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
# Sort list of libs, libpaths, cflags found in libcurl.pc and curl-config files,
# then diff the autotools and cmake generated ones.
sort_lists() {
prevline=''
section=''
while IFS= read -r l; do
if [[ "${prevline}" =~ (--cc|--configure) ]]; then # curl-config
echo "<IGNORED>"
else
# libcurl.pc
if [[ "${l}" =~ ^(Requires|Libs|Cflags)(\.private)?:\ (.+)$ ]]; then
if [ "${BASH_REMATCH[1]}" = 'Requires' ]; then
# Spec does not allow duplicates here:
# https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html#Requires:
# "You may only mention the same package one time on the Requires: line"
val="$(printf '%s' "${BASH_REMATCH[3]}" | tr ',' '\n' | sort | tr '\n' ' ')"
else
val="$(printf '%s' "${BASH_REMATCH[3]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')"
fi
l="${BASH_REMATCH[1]}${BASH_REMATCH[2]}: ${val}"
# curl-config
elif [[ "${section}" =~ (--libs|--static-libs) && "${l}" =~ ^( *echo\ \")(.+)(\")$ ]]; then
val="$(printf '%s' "${BASH_REMATCH[2]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')"
l="${BASH_REMATCH[1]}${val}${BASH_REMATCH[3]}"
section=''
fi
echo "${l}"
fi
# curl-config
prevline="${l}"
if [[ "${l}" =~ --[a-z-]+\) ]]; then
section="${BASH_REMATCH[0]}"
fi
done < "$1"
}
am=$(mktemp -t autotools.XXX); sort_lists "$1" > "${am}"
cm=$(mktemp -t cmake.XXX) ; sort_lists "$2" > "${cm}"
diff -u "${am}" "${cm}"
res="$?"
rm -r -f "${am}" "${cm}"
exit "${res}"
+21
View File
@@ -0,0 +1,21 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
anonymou
aNULL
bu
clen
CNA
hel
htpts
inout
PASE
passwor
perfec
proxys
seh
ser
strat
te
UE
WONT
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
set -eu
cd "$(dirname "${0}")"/../..
git ls-files -z | xargs -0 -r \
codespell \
--skip '.github/scripts/pyspelling.words' \
--skip '.github/scripts/typos.toml' \
--skip 'docs/THANKS' \
--skip 'projects/OS400/*' \
--skip 'projects/vms/*' \
--skip 'RELEASE-NOTES' \
--skip 'scripts/wcurl' \
--skip 'tests/unit/unit1625.c' \
--ignore-regex '.*spellchecker:disable-line' \
--ignore-words '.github/scripts/codespell-ignore.words' \
--
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
# Compare git repo files with tarball files and report a mismatch
# after excluding exceptions.
set -eu
gitonly=".git*
^.*
^appveyor.*
^GIT-INFO.md
^README.md
^renovate.json
^REUSE.toml
^SECURITY.md
^LICENSES/*
^docs/examples/adddocsref.pl
^docs/tests/CI.md
^docs/THANKS-filter
^projects/Windows/*
^scripts/contributors.sh
^scripts/contrithanks.sh
^scripts/delta
^scripts/installcheck.sh
^scripts/release-notes.pl
^scripts/singleuse.pl"
tarfiles="$(mktemp)"
gitfiles="$(mktemp)"
tar -tf "$1" \
| sed -E 's|^[^/]+/||g' \
| grep -v -E '(/|^)$' \
| sort > "${tarfiles}"
git -C "${2:-.}" ls-files \
| grep -v -E "($(printf '%s' "${gitonly}" | tr $'\n' '|' | sed -e 's|\.|\\.|g' -e 's|\*|.+|g'))$" \
| sort > "${gitfiles}"
dif="$(diff -u "${tarfiles}" "${gitfiles}" | tail -n +3 || true)"
rm -rf "${tarfiles:?}" "${gitfiles:?}"
echo 'Only in tarball:'
echo "${dif}" | grep '^-' || true
echo
echo 'Missing from tarball:'
if echo "${dif}" | grep '^+'; then
exit 1
fi
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# Docs: https://facelessuser.github.io/pyspelling/configuration/
# Docs: https://github.com/UnicornGlobal/spellcheck-github-actions
matrix:
- name: Markdown
expect_match: false
apsell:
mode: en
dictionary:
wordlists:
- wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.markdown:
markdown_extensions:
- markdown.extensions.extra:
- pyspelling.filters.html:
comments: true
attributes:
- title
- alt
ignores:
- ':matches(code, pre)'
- 'code'
- 'pre'
- 'strong'
- 'em'
sources:
- '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md|!tests/data/data*.md'
+251
View File
@@ -0,0 +1,251 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# Input: number of seconds to run.
#
# 1. Figure out all existing command line options
# 2. Generate random command line using supported options
# 3. Run the command line
# 4. Verify that it does not return an unexpected return code
# 5. Iterate until the time runs out
#
# Do the same with regular command lines as well as reading the options from a
# -K config file
#
# BEWARE: this may create a large amount of files using random names in the
# directory where it runs.
#
use strict;
use warnings;
my $curl = "../src/curl";
my $url = "localhost:7777"; # not listening to this
my $seconds = $ARGV[0];
if($ARGV[1]) {
$curl = $ARGV[1];
}
if(!$seconds) {
$seconds = 10;
}
print "Run $curl for $seconds seconds\n";
my @opt;
my %arg;
my %uniq;
my %allrc;
my $totalargs = 0;
my $totalcmds = 0;
my $counter = 0xabcdef + time();
sub getnum {
my ($max) = @_;
return int(rand($max));
}
sub storedata {
my ($short, $long, $arg) = @_;
push @opt, "-$short" if($short);
push @opt, "--$long";
if($arg =~ /^</) {
# these take an argument
$arg{"-$short"} = $arg if($short);
$arg{"--$long"} = $arg;
}
}
sub getoptions {
my @all = `$curl --help all`;
for my $o (@all) {
chomp $o;
if($o =~ /^ -(.), --([^ ]*) (.*)/) {
storedata($1, $2, $3);
}
elsif($o =~ /^ --([^ ]*) (.*)/) {
storedata("", $1, $2);
}
}
}
# this adds a fake randomly generated command line option
sub addarg {
my $nice = "abcdefhijklmnopqrstuvwqxyz".
"ABCDEFHIJKLMNOPQRSTUVWQXYZ".
"0123456789-";
my $len = getnum(20) + 2;
my $o;
for (1 .. $len) {
$o .= substr($nice, getnum(length($nice)), 1);
}
return "--$o";
}
sub randarg {
my $nice = "abcdefhijklmnopqrstuvwqxyz".
"ABCDEFHIJKLMNOPQRSTUVWQXYZ".
"0123456789".
",-?#$%!@ ";
my $len = getnum(20);
my $o = '';
for (1 .. $len) {
$o .= substr($nice, getnum(length($nice)), 1);
}
return "\'$o\'";
}
getoptions();
my $nopts = scalar(@opt);
my %useropt = (
'-U' => 1,
'-u' => 1,
'--user' => 1,
'--proxy-user' => 1);
my %commonrc = (
'0' => 1,
'1' => 1,
'2' => 1,
'26' => 1,
);
sub runone {
my $a;
my $nargs = getnum(60) + 1;
$totalargs += $nargs;
$totalcmds++;
for (1 .. $nargs) {
my $o = getnum($nopts);
my $option = $opt[$o];
my $ar = "";
$uniq{$option}++;
if($arg{$option}) {
$ar = " ".randarg();
if($useropt{$option}) {
# append password to avoid prompting
$ar .= ":".randarg();
}
}
$a .= sprintf(" %s%s", $option, $ar);
}
if(getnum(100) < 15) {
# add a fake arg
$a .= " ".addarg();
}
my $cmd="$curl$a $url";
my $rc = system("$cmd >curl-output 2>&1 </dev/null -M 0.1") >> 8;
#my $rc = system("valgrind -q $cmd >/dev/null 2>&1 </dev/null -M 0.1") >> 8;
$allrc{$rc}++;
#print "CMD: $cmd\n";
if(!$commonrc{$rc}) {
print "CMD: $cmd\n";
print "RC: $rc\n";
print "== curl-output == \n";
open(D, "<curl-output");
my @out = <D>;
print @out;
close(D);
exit;
}
}
sub runconfig {
my $a;
my $nargs = getnum(80) + 1;
open(C, ">config");
$totalargs += $nargs;
$totalcmds++;
for (1 .. $nargs) {
my $o = getnum($nopts);
my $option = $opt[$o];
my $ar = "";
$uniq{$option} = 0 if(!exists $uniq{$option});
$uniq{$option}++;
if($arg{$option}) {
$ar = " ".randarg();
if($useropt{$option}) {
# append password
$ar .= ":".randarg();
}
}
$a .= sprintf("\n%s%s", $option, $ar);
}
if(getnum(100) < 15) {
# add a fake arg
$a .= "\n".addarg();
}
print C "$a\n";
close(C);
my $cmd="$curl -K config $url";
my $rc = system("$cmd >curl-output 2>&1 </dev/null -M 0.1") >> 8;
$allrc{$rc}++;
if(!$commonrc{$rc}) {
print "CMD: $cmd\n";
print "RC: $rc\n";
print "== config == \n";
open(D, "<config");
my @all = <D>;
print @all;
close(D);
print "\n== curl-output == \n";
open(D, "<curl-output");
my @out = <D>;
print @out;
close(D);
exit 2;
}
}
# run curl command lines using -K
my $end = time() + $seconds/2;
my $c = 0;
print "Running command lines\n";
do {
runconfig();
$c++;
} while(time() <= $end);
print "$c command lines\n";
# run curl command lines
$end = time() + $seconds/2;
$c = 0;
print "Running config lines\n";
do {
runone();
$c++;
} while(time() <= $end);
print "$c config line uses\n";
print "Recorded exit codes:\n";
for my $rc (keys %allrc) {
printf " %2d: %d times\n", $rc, $allrc{$rc};
}
printf "Number or command lines tested:\n".
" $totalcmds (%.1f/second)\n", $totalcmds/$seconds;
printf "Number or command line options tested:\n".
" $totalargs (average %.1f per command line)\n",
$totalargs/$totalcmds;
printf "Number or different options tested:\n".
" %u out of %u\n", scalar(keys %uniq), $nopts;
+5
View File
@@ -0,0 +1,5 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
pyspelling==2.12.1
@@ -0,0 +1,5 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
proselint==0.16.0
+9
View File
@@ -0,0 +1,9 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
cmakelang==0.6.13
codespell==2.4.2
pytype==2024.10.11
reuse==6.2.0
ruff==0.15.10
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
# Required: yq
set -eu
export SHELLCHECK_OPTS='--exclude=1090,1091,2086,2153 --enable=avoid-nullary-conditions,deprecate-which'
# GHA
git ls-files '.github/workflows/*.yml' | while read -r f; do
echo "Verifying ${f}..."
{
echo '#!/usr/bin/env bash'
echo 'set -eu'
yq eval '.. | select(has("run") and (.run | type == "!!str")) | .run + "\ntrue\n"' "${f}"
} | sed -E 's|\$\{\{ .+ \}\}|GHA_EXPRESSION|g' | shellcheck -
done
# Circle CI
git ls-files '.circleci/*.yml' | while read -r f; do
echo "Verifying ${f}..."
{
echo '#!/usr/bin/env bash'
echo 'set -eu'
yq eval '.. | select(has("command") and (.command | type == "!!str")) | .command + "\ntrue\n"' "${f}"
} | shellcheck -
done
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
set -eu
cd "$(dirname "${0}")"/../..
git grep -z -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' | xargs -0 -r \
shellcheck --exclude=1091,2248 \
--enable=avoid-nullary-conditions,deprecate-which \
--
+153
View File
@@ -0,0 +1,153 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# common variable types + structs
# callback typedefs
# public functions names
# some man page names
curl_fileinfo
curl_forms
curl_hstsentry
curl_httppost
curl_index
curl_khkey
curl_pushheaders
curl_waitfd
CURLcode
CURLformoption
CURLHcode
CURLMcode
CURLMsg
CURLSHcode
CURLUcode
curl_calloc_callback
curl_chunk_bgn_callback
curl_chunk_end_callback
curl_conv_callback
curl_debug_callback
curl_fnmatch_callback
curl_formget_callback
curl_free_callback
curl_hstsread_callback
curl_hstswrite_callback
curl_ioctl_callback
curl_malloc_callback
curl_multi_timer_callback
curl_opensocket_callback
curl_prereq_callback
curl_progress_callback
curl_push_callback
curl_read_callback
curl_realloc_callback
curl_resolver_start_callback
curl_seek_callback
curl_socket_callback
curl_sockopt_callback
curl_ssl_ctx_callback
curl_strdup_callback
curl_trailer_callback
curl_write_callback
curl_xferinfo_callback
curl_strequal
curl_strnequal
curl_mime_init
curl_mime_free
curl_mime_addpart
curl_mime_name
curl_mime_filename
curl_mime_type
curl_mime_encoder
curl_mime_data
curl_mime_filedata
curl_mime_data_cb
curl_mime_subparts
curl_mime_headers
curl_formadd
curl_formget
curl_formfree
curl_getdate
curl_getenv
curl_version
curl_easy_escape
curl_escape
curl_easy_unescape
curl_unescape
curl_free
curl_global_init
curl_global_init_mem
curl_global_cleanup
curl_global_trace
curl_global_sslset
curl_slist_append
curl_slist_free_all
curl_getdate
curl_share_init
curl_share_setopt
curl_share_cleanup
curl_version_info
curl_easy_strerror
curl_share_strerror
curl_easy_pause
curl_easy_ssls_import
curl_easy_ssls_export
curl_easy_init
curl_easy_setopt
curl_easy_perform
curl_easy_cleanup
curl_easy_getinfo
curl_easy_duphandle
curl_easy_reset
curl_easy_recv
curl_easy_send
curl_easy_upkeep
curl_easy_header
curl_easy_nextheader
curl_mprintf
curl_mfprintf
curl_msprintf
curl_msnprintf
curl_mvprintf
curl_mvfprintf
curl_mvsprintf
curl_mvsnprintf
curl_maprintf
curl_mvaprintf
curl_multi_init
curl_multi_add_handle
curl_multi_remove_handle
curl_multi_fdset
curl_multi_waitfds
curl_multi_wait
curl_multi_poll
curl_multi_wakeup
curl_multi_perform
curl_multi_cleanup
curl_multi_info_read
curl_multi_strerror
curl_multi_socket
curl_multi_socket_action
curl_multi_socket_all
curl_multi_timeout
curl_multi_setopt
curl_multi_assign
curl_multi_get_handles
curl_multi_get_offt
curl_multi_notify_disable
curl_multi_notify_enable
curl_pushheader_bynum
curl_pushheader_byname
curl_easy_option_by_name
curl_easy_option_by_id
curl_easy_option_next
curl_url
curl_url_cleanup
curl_url_dup
curl_url_get
curl_url_set
curl_url_strerror
curl_ws_recv
curl_ws_send
curl_ws_meta
libcurl-env
libcurl-ws
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env perl
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
#
# Given: a libcurl curldown man page
# Outputs: the same file, minus the header
#
use strict;
use warnings;
my $f = $ARGV[0] || '';
open(F, "<$f") or die;
my @out;
my $line = 0;
my $hideheader = 0;
while(<F>) {
if($hideheader) {
if(/^---/) {
# end if hiding
$hideheader = 0;
}
push @out, "\n"; # replace with blank
next;
}
elsif(!$line++ && /^---/) {
# starts with a header, strip off the header
$hideheader = 1;
push @out, "\n"; # replace with blank
next;
}
push @out, $_;
}
close(F);
open(O, ">$f") or die;
for my $l (@out) {
print O $l;
}
close(O);
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
set -eu
cd "$(dirname "${0}")"/../..
git ls-files | typos \
--isolated \
--force-exclude \
--config '.github/scripts/typos.toml' \
--file-list -
+36
View File
@@ -0,0 +1,36 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
[default]
extend-ignore-identifiers-re = [
"^(ba|fo|pn|PN|UE)$",
"^(CNA|cpy|ser)$",
"^(ECT0|ECT1|HELO|htpts|PASE)$",
"^[A-Za-z0-9_-]*(EDE|GOST)[A-Z0-9_-]*$", # ciphers
"^0x[0-9a-fA-F]+FUL$", # unsigned long hex literals ending with 'F'
"^[0-9a-zA-Z+]{64,}$", # possibly base64
"^(eyeballers|HELO_smtp|Januar|optin|passin|perfec|SMTP_HELO)$",
"^(clen|req_clen|smtp_perform_helo|smtp_state_helo_resp|Tru64|_stati64)$",
"(_ccontains|_controllen|O_WRONLY|secur32)",
"proxys", # this should be limited to tests/http/*. Short for secure proxy.
]
extend-ignore-re = [
".*spellchecker:disable-line",
]
[files]
extend-exclude = [
".github/scripts/codespell-ignore.words",
".github/scripts/pyspelling.words",
"docs/THANKS",
"projects/OS400/*",
"projects/vms/*",
"projects/Windows/tmpl/curl.vcxproj",
"projects/Windows/tmpl/libcurl.vcxproj",
"RELEASE-NOTES",
"scripts/wcurl",
"tests/data/test*",
"tests/unit/unit1625.c",
]
+106
View File
@@ -0,0 +1,106 @@
#!/usr/bin/env perl
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
use strict;
use warnings;
my @files = @ARGV;
my $cfile = "test.c";
my $check = "./scripts/checksrc.pl";
my $error = 0;
if(!@files || $files[0] eq "-h") {
print "Usage: verify-examples [markdown pages]\n";
exit;
}
sub testcompile {
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' .
'-Wno-unused-parameter -Wno-unused-but-set-variable ' .
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION') >> 8;
return $rc;
}
sub checksrc {
my $rc = system($check, ('test.c')) >> 8;
return $rc;
}
sub extract {
my($f) = @_;
my $syn = 0;
my $l = 0;
my $iline = 0;
my $fail = 0;
open(F, "<$f") or die "failed opening input file $f : $!";
open(O, ">$cfile") or die "failed opening output file $cfile : $!";
print O "#include <curl/curl.h>\n";
while(<F>) {
$iline++;
if(/^# EXAMPLE/) {
$syn = 1
}
elsif($syn == 1) {
if(/^~~~/) {
$syn++;
print O "/* !checksrc! disable BANNEDFUNC all */\n"; # for fopen()
print O "/* !checksrc! disable COPYRIGHT all */\n";
print O "/* !checksrc! disable UNUSEDIGNORE all */\n";
printf O "#line %d \"$f\"\n", $iline+1;
}
}
elsif($syn == 2) {
if(/^~~~/) {
last;
}
# two backslashes become one
$_ =~ s/\\\\/\\/g;
print O $_;
$l++;
}
}
close(F);
close(O);
return ($fail ? 0 : $l);
}
my $count = 0;
for my $m (@files) {
#print "Verify $m\n";
my $out = extract($m);
if($out) {
$error |= testcompile($m);
$error |= checksrc($m);
}
$count++;
}
if(!$error) {
print "Verified $count man pages ok\n";
}
else {
print "Detected problems\n";
}
exit $error;
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/env perl
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
use strict;
use warnings;
my @files = @ARGV;
my $cfile = "test.c";
if(!@files || $files[0] eq "-h") {
print "Usage: verify-synopsis [man pages]\n";
exit;
}
sub testcompile {
my $rc = system('gcc -c test.c -I include -W -Wall -pedantic -Werror ' .
'-DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_TYPECHECK') >> 8;
return $rc;
}
sub extract {
my($f) = @_;
my $syn = 0;
my $l = 0;
my $iline = 0;
open(F, "<$f");
open(O, ">$cfile");
while(<F>) {
$iline++;
if(/^# SYNOPSIS/) {
$syn = 1
}
elsif($syn == 1) {
if(/^\~\~\~/) {
$syn++;
print O "#line $iline \"$f\"\n";
}
}
elsif($syn == 2) {
if(/^\~\~\~/) {
last;
}
# turn the vararg argument into vararg
$_ =~ s/, parameter\)\;/, ...);/;
print O $_;
$l++;
}
}
close(F);
close(O);
if($syn < 2) {
print STDERR "Found no synopsis in $f\n";
return 1;
}
return 0;
}
my $error;
for my $m (@files) {
$error |= extract($m);
$error |= testcompile($m);
}
exit $error;
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
set -eu
cd "$(dirname "${0}")"/../..
git ls-files '*.yaml' '*.yml' -z | xargs -0 -r \
yamllint \
--format standard \
--strict \
--config-data .github/scripts/yamlcheck.yaml \
--
+17
View File
@@ -0,0 +1,17 @@
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
#
# Docs: https://yamllint.readthedocs.io/en/stable/configuration.html
extends: default
rules:
line-length:
max: 500
level: warning
braces: disable
commas: disable
comments: disable
document-start: disable
+21
View File
@@ -0,0 +1,21 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels are never considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
+43
View File
@@ -0,0 +1,43 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'AppVeyor Status Report'
'on':
status
concurrency:
group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}
cancel-in-progress: true
permissions: {}
jobs:
split:
name: 'split'
runs-on: ubuntu-24.04-arm
if: ${{ github.event.sender.login == 'appveyor[bot]' }}
permissions:
statuses: write # To update build statuses
steps:
- name: 'Create individual AppVeyor build statuses'
if: ${{ github.event.sha && github.event.target_url }}
env:
APPVEYOR_COMMIT_SHA: ${{ github.event.sha }}
APPVEYOR_TARGET_URL: ${{ github.event.target_url }}
APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
DO_NOT_TRACK: '1' # for gh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "${APPVEYOR_TARGET_URL}" | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s -- | \
jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
state: (.status | sub("queued"; "pending")
| sub("starting"; "pending")
| sub("running"; "pending")
| sub("failed"; "failure")
| sub("cancelled"; "error")),
description: .status}' \
--arg target_url "${APPVEYOR_TARGET_URL}" | tee /dev/stderr | parallel --pipe -j 1 -N 1 \
gh api --silent --input - "repos/${APPVEYOR_REPOSITORY}/statuses/${APPVEYOR_COMMIT_SHA}"
+135
View File
@@ -0,0 +1,135 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# This workflow contains tests that operate on documentation files only. Some
# checks modify the source so they cannot be combined into a single job.
name: 'Docs'
'on':
push:
branches:
- master
- '*/ci'
paths:
- '.github/workflows/checkdocs.yml'
- '.github/scripts/**'
- 'scripts/**'
- '**.md'
- 'docs/*'
pull_request:
branches:
- master
paths:
- '.github/workflows/checkdocs.yml'
- '.github/scripts/**'
- 'scripts/**'
- '**.md'
- 'docs/*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
DO_NOT_TRACK: '1'
jobs:
# config file help: https://github.com/amperser/proselint/
proselint:
name: 'proselint'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'install prereqs'
run: |
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r .github/scripts/requirements-proselint.txt
- name: 'trim headers off all *.md files'
run: git ls-files '*.md' -z | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl
- name: 'check prose'
run: |
cat <<JSON > ~/.proselintrc.json
{
"checks": {
"annotations.misc": false,
"lexical_illusions": false,
"misc.annotations": false,
"redundancy.misc.garner": false,
"security.password": false,
"spelling.ve_of": false,
"typography.diacritical_marks": false,
"typography.symbols": false
}
}
JSON
source ~/venv/bin/activate
git ls-files README '*.md' -z | grep -Evz '(CHECKSRC|DISTROS|CURLOPT_INTERFACE|interface)\.md' | xargs -0 proselint check --
- name: 'check special prose' # For CHECKSRC and files with aggressive exclamation mark needs
run: |
cat <<JSON > ~/.proselintrc.json
{
"checks": {
"annotations.misc": false,
"lexical_illusions": false,
"typography.diacritical_marks": false,
"typography.punctuation.exclamation": false,
"typography.symbols": false
}
}
JSON
source ~/venv/bin/activate
proselint check docs/internals/CHECKSRC.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md
pyspelling:
name: 'pyspelling'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'trim all *.md files in docs/'
run: .github/scripts/cleancmd.pl 'docs/*.md'
- name: 'install'
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 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'
run: |
source ~/venv/bin/activate
# setup the custom wordlist
grep -v '^#' .github/scripts/pyspelling.words > wordlist.txt
aspell --version
pyspelling --version
pyspelling --verbose --jobs 5 --config .github/scripts/pyspelling.yaml
synopsis-man-examples:
name: 'synopsis, man-examples'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'verify synopsis'
run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md
- name: 'verify examples'
run: .github/scripts/verify-examples.pl docs/libcurl/curl*.md docs/libcurl/opts/*.md
+190
View File
@@ -0,0 +1,190 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# This workflow contains checks at the source code level only.
name: 'Source'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
pull_request:
branches:
- master
paths-ignore:
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
DO_NOT_TRACK: '1'
jobs:
checksrc:
name: 'checksrc'
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check'
run: scripts/checksrc-all.pl
linters:
name: 'spellcheck, linters, REUSE'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'install prereqs'
run: |
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary \
-r .github/scripts/requirements.txt \
-r tests/http/requirements.txt \
-r tests/requirements.txt
- name: 'REUSE check'
run: |
source ~/venv/bin/activate
reuse lint
- name: 'codespell'
run: |
source ~/venv/bin/activate
codespell --version
.github/scripts/codespell.sh
- name: 'typos'
timeout-minutes: 2
run: |
HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install typos-cli
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
typos --version
.github/scripts/typos.sh
- name: 'cmakelint'
run: |
source ~/venv/bin/activate
scripts/cmakelint.sh
- name: 'perlcheck'
run: |
scripts/perlcheck.sh
- name: 'pytype'
run: |
source ~/venv/bin/activate
find . -name '*.py' -exec pytype -j auto -k -- {} +
- name: 'ruff'
run: |
source ~/venv/bin/activate
scripts/pythonlint.sh
complexity:
name: 'complexity'
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- name: 'install pmccabe'
timeout-minutes: 2
run: |
ls -l /etc/apt/sources.list.d
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 \
pmccabe
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check scores'
run: ./scripts/top-complexity
xmllint:
name: 'xmllint'
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- name: 'install prereqs'
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check'
run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint --output /dev/null
miscchecks:
name: 'misc checks'
runs-on: ubuntu-24.04-arm
timeout-minutes: 5
steps:
- name: 'install prereqs'
timeout-minutes: 2
run: HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'zizmor GHA'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
zizmor --persona pedantic .github/workflows/*.yml .github/dependabot.yml
- name: 'actionlint'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export SHELLCHECK_OPTS='--exclude=1090,1091,2086,2153 --enable=avoid-nullary-conditions,deprecate-which'
actionlint --version
actionlint --ignore matrix .github/workflows/*.yml
- name: 'shellcheck CI'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
shellcheck --version
.github/scripts/shellcheck-ci.sh
- name: 'shellcheck'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
shellcheck --version
.github/scripts/shellcheck.sh
- name: 'spacecheck'
run: scripts/spacecheck.pl
- name: 'yamlcheck'
run: .github/scripts/yamlcheck.sh
- name: 'badwords'
run: scripts/badwords-all
+43
View File
@@ -0,0 +1,43 @@
# 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'mdlinkcheck (dry run)'
if: ${{ github.event_name != 'schedule' }}
run: ./scripts/mdlinkcheck --dry-run
- name: 'mdlinkcheck'
if: ${{ github.event_name == 'schedule' }}
run: ./scripts/mdlinkcheck
+142
View File
@@ -0,0 +1,142 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'CodeQL'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'projects/**'
- 'tests/data/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'projects/**'
- 'tests/data/**'
schedule:
- cron: '0 0 * * 4'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
DO_NOT_TRACK: '1'
jobs:
gha_python:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'GHA and Python'
runs-on: ubuntu-latest
permissions:
security-events: write # To create/update security events
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'initialize'
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: actions, python
queries: security-extended
- name: 'perform analysis'
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
c:
if: ${{ github.repository_owner == 'curl' || github.event_name != 'schedule' }}
name: 'C'
runs-on: ${{ matrix.platform == 'Linux' && 'ubuntu-latest' || 'windows-2022' }}
permissions:
security-events: write # To create/update security events
strategy:
fail-fast: false
matrix:
platform: [Linux, Windows]
env:
MATRIX_PLATFORM: '${{ matrix.platform }}'
steps:
- name: 'install prereqs'
if: ${{ matrix.platform == 'Linux' }}
timeout-minutes: 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
HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install c-ares gsasl libnghttp3 libngtcp2 mbedtls rustls-ffi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'delete test input C files'
shell: bash
run: find tests/data -name '*.c' -delete
- name: 'initialize'
# https://github.com/github/codeql-action/blob/main/init/action.yml
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
with:
languages: cpp
build-mode: manual
trap-caching: false
- name: 'build'
timeout-minutes: 10
shell: bash
run: |
if [ "${MATRIX_PLATFORM}" = 'Windows' ]; then
cmake -B . -DBUILD_SHARED_LIBS=OFF -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_VS_GLOBALS=TrackFileAccess=false \
-DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF -DUSE_WIN32_IDN=ON
cmake --build . --verbose
src/Debug/curl.exe --disable --version
else
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export PKG_CONFIG_PATH
# MultiSSL
PKG_CONFIG_PATH="$(brew --prefix c-ares)/lib/pkgconfig:$(brew --prefix mbedtls)/lib/pkgconfig:$(brew --prefix rustls-ffi)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
cmake -B _bld1 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON -DENABLE_DEBUG=ON \
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DCURL_USE_WOLFSSL=ON \
-DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \
-DCURL_DISABLE_VERBOSE_STRINGS=ON
cmake --build _bld1
cmake --build _bld1 --target testdeps
cmake --build _bld1 --target curl-examples-build
# HTTP/3
PKG_CONFIG_PATH="$(brew --prefix libnghttp3)/lib/pkgconfig:$(brew --prefix libngtcp2)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
cmake -B _bld2 -G Ninja -DCURL_DISABLE_TYPECHECK=ON -DCURL_WERROR=ON \
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DUSE_NGTCP2=ON \
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON \
-DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON
cmake --build _bld2
cmake --build _bld2 --target testdeps
cmake --build _bld2 --target curl-examples-build
_bld1/src/curl --disable --version
_bld2/src/curl --disable --version
fi
- name: 'perform analysis'
# https://github.com/github/codeql-action/blob/main/analyze/action.yml
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
+192
View File
@@ -0,0 +1,192 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'configure-vs-cmake'
'on':
push:
branches:
- master
paths:
- '*.ac'
- '**/*.m4'
- '**/CMakeLists.txt'
- 'CMake/**'
- 'lib/curl_config-cmake.h.in'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml'
pull_request:
branches:
- master
paths:
- '*.ac'
- '**/*.m4'
- '**/CMakeLists.txt'
- 'CMake/**'
- 'lib/curl_config-cmake.h.in'
- 'tests/cmake/**'
- '.github/scripts/cmp-config.pl'
- '.github/workflows/configure-vs-cmake.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
DO_NOT_TRACK: '1'
jobs:
check-linux:
name: 'Linux'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'run configure --with-openssl'
run: |
autoreconf -fi
export PKG_CONFIG_DEBUG_SPEW=1
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl
- name: 'run cmake'
run: cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_LIBPSL=OFF
- name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true
- name: 'cmake log'
run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'dump generated files'
run: |
for f in libcurl.pc curl-config; do
echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::'
echo "::group::CM ${f}"; grep -v '^#' bld-cm/"${f}" || true; echo '::endgroup::'
done
- 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
- name: 'compare generated libcurl.pc files'
run: ./.github/scripts/cmp-pkg-config.sh bld-am/libcurl.pc bld-cm/libcurl.pc
- name: 'compare generated curl-config files'
run: ./.github/scripts/cmp-pkg-config.sh bld-am/curl-config bld-cm/curl-config
check-macos:
name: 'macOS'
runs-on: macos-latest
steps:
- name: 'install packages'
timeout-minutes: 2
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions'
run: echo '::group::brew packages installed'; ls -l /opt/homebrew/opt; echo '::endgroup::'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'run configure --with-openssl'
run: |
autoreconf -fi
export PKG_CONFIG_DEBUG_SPEW=1
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-openssl --without-libpsl --disable-ldap --with-brotli --with-zstd --with-apple-sectrust
- name: 'run cmake'
run: |
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAP=ON \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
-DCURL_USE_LIBSSH2=OFF -DUSE_APPLE_SECTRUST=ON
- name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true
- name: 'cmake log'
run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'dump generated files'
run: |
for f in libcurl.pc curl-config; do
echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::'
echo "::group::CM ${f}"; grep -v '^#' bld-cm/"${f}" || true; echo '::endgroup::'
done
- 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
- name: 'compare generated libcurl.pc files'
run: ./.github/scripts/cmp-pkg-config.sh bld-am/libcurl.pc bld-cm/libcurl.pc
- name: 'compare generated curl-config files'
run: ./.github/scripts/cmp-pkg-config.sh bld-am/curl-config bld-cm/curl-config
check-windows:
name: 'Windows'
runs-on: ubuntu-latest
env:
TRIPLET: 'x86_64-w64-mingw32'
steps:
- name: 'install packages'
timeout-minutes: 1
run: |
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 gcc-mingw-w64-x86-64-win32
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'run configure --with-schannel'
run: |
autoreconf -fi
export PKG_CONFIG_DEBUG_SPEW=1
mkdir bld-am && cd bld-am && ../configure --enable-static=no --with-schannel --without-libpsl --host="${TRIPLET}"
- name: 'run cmake'
run: |
cmake -B bld-cm -DCURL_WERROR=ON -DCURL_USE_CMAKECONFIG=OFF -DCURL_USE_SCHANNEL=ON -DCURL_USE_LIBPSL=OFF \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \
-DCMAKE_C_COMPILER="${TRIPLET}-gcc"
- name: 'configure log'
run: cat bld-am/config.log 2>/dev/null || true
- name: 'cmake log'
run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'dump generated files'
run: |
for f in libcurl.pc curl-config; do
echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::'
echo "::group::CM ${f}"; grep -v '^#' bld-cm/"${f}" || true; echo '::endgroup::'
done
- 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
- name: 'compare generated libcurl.pc files'
run: ./.github/scripts/cmp-pkg-config.sh bld-am/libcurl.pc bld-cm/libcurl.pc
- name: 'compare generated curl-config files'
run: ./.github/scripts/cmp-pkg-config.sh bld-am/curl-config bld-cm/curl-config
+197
View File
@@ -0,0 +1,197 @@
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
---
name: 'curl-for-win'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
CW_NOGET: 'curl trurl'
CW_MAP: '0'
CW_JOBS: '5'
CW_NOPKG: '1'
DO_NOT_TRACK: '1'
jobs:
linux-glibc-gcc:
name: 'Linux gcc glibc (amd64, arm64)'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-linux-a64-x64-gcc'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
export CW_CCSUFFIX='-15'
export CW_GCCSUFFIX='-12'
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN_STABLE}"
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_STABLE}" \
sh -c ./_ci-linux-debian.sh
linux-glibc-gcc-minimal: # use gcc to minimize installed packages
name: 'Linux gcc glibc minimal (amd64)'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-prefill-zero-osnotls-osnoidn-nohttp-nocurltool-linux-x64-gcc'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}"
podman images --digests
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
--env-file <(env | grep -a -E \
'^(CW_|DO_NOT_TRACK|GITHUB_)') \
"${OCI_IMAGE_DEBIAN}" \
sh -c ./_ci-linux-debian.sh
linux-musl-llvm:
name: 'Linux llvm MUSL (amd64, riscv64)'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-linux-musl-r64-x64'
export CW_REVISION="${GITHUB_SHA}"
. ./_versions.sh
sudo podman image trust set --type reject default
sudo podman image trust set --type accept docker.io/library
time podman pull "${OCI_IMAGE_DEBIAN}"
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
mac-clang:
name: 'macOS clang cares (x86_64)'
runs-on: macos-latest
timeout-minutes: 10
env:
CW_JOBS: '4'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-mac-x64-cares'
export CW_REVISION="${GITHUB_SHA}"
sh -c ./_ci-mac-homebrew.sh
win-llvm:
name: 'Windows llvm (x64)'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-win-x64-noWINE'
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
win-gcc-zlibold-x64:
name: 'Windows gcc zlib-classic (x64)'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: 'curl'
fetch-depth: 8
- name: 'build'
run: |
git clone --depth 1 https://github.com/curl/curl-for-win
mv curl-for-win/* .
export CW_CONFIG='-main-werror-unitybatch-nocertdata-win-x64-gcc-zlibold-noWINE'
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
+369
View File
@@ -0,0 +1,369 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'dist'
'on':
push:
branches:
- master
- '*/ci'
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
CURL_TEST_MIN: 1500
DO_NOT_TRACK: '1'
MAKEFLAGS: -j 5
jobs:
maketgz-and-verify-in-tree:
name: 'AM in-tree & maketgz'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'remove preinstalled curl libcurl4{-doc}'
run: sudo apt-get -o Dpkg::Use-Pty=0 purge curl libcurl4 libcurl4-doc
- name: 'autoreconf'
run: autoreconf -fi
- name: 'configure'
run: ./configure --without-ssl --without-libpsl
- name: 'make'
run: make V=1
- name: 'maketgz'
run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: 'release-tgz'
path: 'curl-99.98.97.tar.gz'
retention-days: 1
- name: 'configure build & install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
./configure --prefix="$HOME"/temp --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
make
make test-ci
make install
popd
# basic check of the installed files
bash scripts/installcheck.sh "$HOME"/temp
rm -rf curl-99.98.97
verify-out-of-tree-docs:
name: 'AM out-of-tree docs'
runs-on: ubuntu-latest
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
- name: 'configure build & docs'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
mkdir build
pushd build
../curl-99.98.97/configure --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
make
make test-ci
popd
rm -rf build
rm -rf curl-99.98.97
verify-out-of-tree-autotools-debug:
name: 'AM out-of-tree (debug)'
runs-on: ubuntu-latest
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
- name: 'build & install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
mkdir build
pushd build
../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --enable-debug --without-libpsl
make
make test-ci
make install
curl-install/bin/curl --disable --version
curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
popd
scripts/checksrc-all.pl
verify-out-of-tree-autotools:
name: 'AM out-of-tree !perl'
runs-on: ubuntu-latest
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
- name: 'build & install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
mkdir build
pushd build
../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
popd
verify-in-tree-autotools:
name: 'AM in-tree !perl'
runs-on: ubuntu-latest
timeout-minutes: 10
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
- name: 'build & install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
./configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
make
make install
curl-install/bin/curl --disable --version
curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
verify-out-of-tree-cmake:
name: 'CM out-of-tree !perl'
runs-on: ubuntu-latest
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
- name: 'build & install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
cmake -B build -DCMAKE_INSTALL_PREFIX="$PWD"/curl-install -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DPERL_EXECUTABLE=
cmake --build build
cmake --install build
export LD_LIBRARY_PATH="$PWD/curl-install/lib:$LD_LIBRARY_PATH"
curl-install/bin/curl --disable --version
curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
verify-in-tree-cmake:
name: 'CM in-tree !perl'
runs-on: ubuntu-latest
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
- name: 'build & install'
run: |
echo "::stop-commands::$(uuidgen)"
tar xvf curl-99.98.97.tar.gz
pushd curl-99.98.97
cmake . -G Ninja -DCMAKE_INSTALL_PREFIX="$PWD"/curl-install -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DPERL_EXECUTABLE=
cmake --build .
cmake --install .
export LD_LIBRARY_PATH="$PWD/curl-install/lib:$LD_LIBRARY_PATH"
curl-install/bin/curl --disable --version
curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
missing-files:
name: 'missing files'
runs-on: ubuntu-slim
timeout-minutes: 5
needs: maketgz-and-verify-in-tree
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: 'release-tgz'
- name: 'detect files missing from release tarball'
run: .github/scripts/distfiles.sh curl-99.98.97.tar.gz
reproducible-releases:
name: 'reproducible releases'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'remove preinstalled curl libcurl4{-doc}'
run: sudo apt-get -o Dpkg::Use-Pty=0 purge curl libcurl4 libcurl4-doc
- name: 'generate release tarballs'
run: ./scripts/dmaketgz 9.10.11
- name: 'verify release tarballs'
run: |
mkdir _verify
mv curl-9.10.11.tar.gz _verify
cd _verify
../scripts/verify-release curl-9.10.11.tar.gz
cmake-integration:
name: 'CM integration ${{ matrix.image }}'
runs-on: ${{ matrix.image }}
timeout-minutes: 15
defaults:
run:
shell: ${{ contains(matrix.image, 'windows') && 'msys2 {0}' || 'bash' }}
env:
CC: ${{ !contains(matrix.image, 'windows') && 'clang' || '' }}
MAKEFLAGS: ${{ contains(matrix.image, 'macos') && '-j 4' || '-j 5' }}
MATRIX_IMAGE: '${{ matrix.image }}'
TESTOPTS: ${{ contains(matrix.image, 'macos') && '-D_CURL_PREFILL=ON' || '' }} ${{ contains(matrix.image, 'windows') && '-DCMAKE_UNITY_BUILD_BATCH_SIZE=30' || '' }}
OLD_CMAKE_VERSION: 3.19.8
OLD_CMAKE_SHA256_LINUX_ARM: 807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1
OLD_CMAKE_SHA256_MACOS_UNI: 0976d23d982af05dcbfb3aa34fcb62ead43bea27f0e3bb95222f2a78161423f2
OLD_CMAKE_SHA256_WIN_INTEL: 2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380
strategy:
fail-fast: false
matrix:
image: [ubuntu-24.04-arm, macos-latest, windows-2022]
steps:
- uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0
if: ${{ contains(matrix.image, 'windows') }}
with:
msystem: mingw64
release: false
update: false
cache: false
path-type: inherit
install: >-
mingw-w64-x86_64-zlib mingw-w64-x86_64-zstd mingw-w64-x86_64-libpsl mingw-w64-x86_64-libssh2 mingw-w64-x86_64-nghttp2 mingw-w64-x86_64-openssl
- name: 'install prereqs'
timeout-minutes: 3
run: |
if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output pkg.bin
sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${OLD_CMAKE_SHA256_WIN_INTEL}" && unzip -q pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-win64-x64/bin/cmake.exe > ~/old-cmake-path.txt
elif [[ "${MATRIX_IMAGE}" = *'ubuntu'* ]]; then
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 libpsl-dev libssl-dev
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-aarch64.tar.gz" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_LINUX_ARM}" && tar -xzf pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Linux-aarch64/bin/cmake > ~/old-cmake-path.txt
else
brew install libpsl openssl
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-macos-universal.tar.gz" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_MACOS_UNI}" && tar -xzf pkg.bin && rm -f pkg.bin
printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-macos-universal/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
fi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'via ExternalProject'
if: ${{ !contains(matrix.image, 'ubuntu') }}
run: ./tests/cmake/test.sh ExternalProject ${TESTOPTS}
- name: 'via FetchContent'
run: ./tests/cmake/test.sh FetchContent ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via add_subdirectory'
run: ./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package'
run: ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package (C++)'
if: ${{ contains(matrix.image, 'ubuntu') }}
run: TEST_CMAKE_FLAGS=-DTEST_CPP=ON ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package (PREFER_CONFIG=ON)'
if: ${{ contains(matrix.image, 'windows') }}
run: |
export TEST_CMAKE_FLAGS_PROVIDER='-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON -DCURL_ZSTD=OFF'
TEST_CMAKE_FLAGS_PROVIDER+=' -DNGHTTP2_INCLUDE_DIR=C:/msys64/mingw64/include -DNGHTTP2_LIBRARY=C:/msys64/mingw64/lib/libnghttp2.dll.a'
export TEST_CMAKE_FLAGS_CONSUMER="${TEST_CMAKE_FLAGS_PROVIDER}"
./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via ExternalProject (old cmake)'
if: ${{ contains(matrix.image, 'ubuntu') }}
run: |
export TEST_CMAKE_CONSUMER; TEST_CMAKE_CONSUMER="$(cat ~/old-cmake-path.txt)"
if [[ "${MATRIX_IMAGE}" = *'macos'* ]]; then
export CFLAGS='-arch arm64'
fi
if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
export TEST_CMAKE_GENERATOR='MSYS Makefiles'
export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc'
fi
./tests/cmake/test.sh ExternalProject ${TESTOPTS}
- name: 'via add_subdirectory OpenSSL (old cmake)'
run: |
export TEST_CMAKE_CONSUMER; TEST_CMAKE_CONSUMER="$(cat ~/old-cmake-path.txt)"
if [[ "${MATRIX_IMAGE}" = *'macos'* ]]; then
export CFLAGS='-arch arm64'
export TEST_CMAKE_FLAGS='-DCURL_USE_LIBPSL=OFF' # auto-detection does not work with old-cmake
fi
if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
export TEST_CMAKE_GENERATOR='MSYS Makefiles'
export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DOPENSSL_ROOT_DIR=C:/msys64/mingw64'
fi
./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON
- name: 'via find_package OpenSSL (old cmake)'
run: |
export TEST_CMAKE_CONSUMER; TEST_CMAKE_CONSUMER="$(cat ~/old-cmake-path.txt)"
if [[ "${MATRIX_IMAGE}" = *'macos'* ]]; then
export CFLAGS='-arch arm64'
export TEST_CMAKE_FLAGS='-DCURL_USE_LIBPSL=OFF' # auto-detection does not work with old-cmake
fi
if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
export TEST_CMAKE_GENERATOR='MSYS Makefiles'
export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DOPENSSL_ROOT_DIR=C:/msys64/mingw64'
fi
./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
+46
View File
@@ -0,0 +1,46 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'Fuzzer'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '**/CMakeLists.txt'
- '.circleci/**'
- 'appveyor.*'
- 'CMake/**'
- 'Dockerfile'
- 'projects/**'
- 'tests/data/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '**/CMakeLists.txt'
- '.circleci/**'
- 'appveyor.*'
- 'CMake/**'
- 'Dockerfile'
- 'projects/**'
- 'tests/data/**'
concurrency:
# Hard-coded workflow name to avoid colliding with curl-fuzzer's group
group: curl-fuzz-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
DO_NOT_TRACK: '1'
jobs:
Fuzzing:
uses: curl/curl-fuzzer/.github/workflows/ci.yml@master # zizmor: ignore[unpinned-uses]
+862
View File
@@ -0,0 +1,862 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'Linux HTTP/3'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
MAKEFLAGS: -j 5
CURL_CI: github
CURL_TEST_MIN: 1850
DO_NOT_TRACK: '1'
# renovate: datasource=github-releases depName=openssl/openssl versioning=semver extractVersion=^openssl-(?<version>.+)$ registryUrl=https://github.com
OPENSSL_VERSION: 4.0.0
# manually bumped
OPENSSL_PREV_VERSION: 3.6.2
OPENSSL_PREV_SHA256: aaf51a1fe064384f811daeaeb4ec4dce7340ec8bd893027eee676af31e83a04f
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.3.1
# renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com
AWSLC_VERSION: 1.71.0
# renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com
BORINGSSL_VERSION: 0.20260413.0
# renovate: datasource=github-tags depName=gnutls/nettle versioning=semver registryUrl=https://github.com
NETTLE_VERSION: 3.10.2
# renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver extractVersion=^nettle_?(?<version>.+)_release_.+$ registryUrl=https://github.com
GNUTLS_VERSION: 3.8.11
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VERSION: 5.9.1
# renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com
NGHTTP3_VERSION: 1.15.0
# renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com
NGTCP2_VERSION: 1.22.1
# renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com
NGHTTP2_VERSION: 1.69.0
# renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com
QUICHE_VERSION: 0.24.7
jobs:
build-cache:
name: 'Build caches'
runs-on: ubuntu-latest
steps:
- name: 'cache openssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-http3-no-deprecated
env:
cache-name: cache-openssl-http3-no-deprecated
with:
path: ~/openssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
- name: 'cache openssl-prev'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-prev-http3-no-deprecated
env:
cache-name: cache-openssl-prev-http3-no-deprecated
with:
path: ~/openssl-prev/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_PREV_VERSION }}
- name: 'cache libressl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl
env:
cache-name: cache-libressl
with:
path: ~/libressl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
- name: 'cache awslc'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-awslc
env:
cache-name: cache-awslc
with:
path: ~/awslc/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.AWSLC_VERSION }}
- name: 'cache boringssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-boringssl
env:
cache-name: cache-boringssl
with:
path: ~/boringssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }}
- name: 'cache nettle'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nettle
env:
cache-name: cache-nettle
with:
path: ~/nettle/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }}
- name: 'cache gnutls'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-gnutls
env:
cache-name: cache-gnutls
with:
path: ~/gnutls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }}
- name: 'cache wolfssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-wolfssl
env:
cache-name: cache-wolfssl
with:
path: ~/wolfssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
- name: 'cache nghttp3'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp3
env:
cache-name: cache-nghttp3
with:
path: ~/nghttp3/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP3_VERSION }}
- name: 'cache ngtcp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2
env:
cache-name: cache-ngtcp2
with:
path: ~/ngtcp2/build
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}"
- name: 'cache ngtcp2 openssl-prev'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-openssl-prev
env:
cache-name: cache-ngtcp2-openssl-prev
with:
path: ~/ngtcp2-openssl-prev/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_PREV_VERSION }}
- name: 'cache ngtcp2 boringssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-boringssl
env:
cache-name: cache-ngtcp2-boringssl
with:
path: ~/ngtcp2-boringssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.BORINGSSL_VERSION }}
- name: 'cache nghttp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp2
env:
cache-name: cache-nghttp2
with:
path: ~/nghttp2/build
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}"
- id: settings
if: >-
${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' ||
steps.cache-openssl-prev-http3-no-deprecated.outputs.cache-hit != 'true' ||
steps.cache-libressl.outputs.cache-hit != 'true' ||
steps.cache-awslc.outputs.cache-hit != 'true' ||
steps.cache-boringssl.outputs.cache-hit != 'true' ||
steps.cache-nettle.outputs.cache-hit != 'true' ||
steps.cache-gnutls.outputs.cache-hit != 'true' ||
steps.cache-wolfssl.outputs.cache-hit != 'true' ||
steps.cache-nghttp3.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2-openssl-prev.outputs.cache-hit != 'true' ||
steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' ||
steps.cache-nghttp2.outputs.cache-hit != 'true' }}
run: echo 'needs-build=true' >> "$GITHUB_OUTPUT"
- name: 'install build prereqs'
if: ${{ steps.settings.outputs.needs-build == 'true' }}
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 \
libtool autoconf automake pkgconf \
libbrotli-dev libzstd-dev zlib1g-dev \
libev-dev \
libc-ares-dev \
libp11-kit-dev autopoint bison gperf gtk-doc-tools libtasn1-bin # for GnuTLS
echo 'CC=gcc-12' >> "$GITHUB_ENV"
echo 'CXX=g++-12' >> "$GITHUB_ENV"
- name: 'build openssl'
if: ${{ steps.cache-openssl-http3-no-deprecated.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 --branch "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
cd openssl
./config --prefix="$PWD"/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated
make
make -j1 install_sw
- name: 'build openssl-prev'
if: ${{ steps.cache-openssl-prev-http3-no-deprecated.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_PREV_VERSION}/openssl-${OPENSSL_PREV_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OPENSSL_PREV_SHA256}" && tar -xzf pkg.bin && rm -f pkg.bin
cd "openssl-${OPENSSL_PREV_VERSION}"
./config --prefix=/home/runner/openssl-prev/build --libdir=lib no-makedepend no-apps no-docs no-tests no-deprecated
make
make -j1 install_sw
- name: 'build libressl'
if: ${{ steps.cache-libressl.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "libressl-${LIBRESSL_VERSION}"
cmake -B . -G Ninja -DLIBRESSL_APPS=OFF -DLIBRESSL_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/libressl/build
cmake --build .
cmake --install .
- name: 'build awslc'
if: ${{ steps.cache-awslc.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/awslabs/aws-lc/archive/refs/tags/v${AWSLC_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "aws-lc-${AWSLC_VERSION}"
cmake -B . -G Ninja -DBUILD_SHARED_LIBS=ON -DBUILD_TOOL=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/awslc/build
cmake --build .
cmake --install .
- name: 'build boringssl'
if: ${{ steps.cache-boringssl.outputs.cache-hit != 'true' }}
run: |
mkdir boringssl-src
cd boringssl-src
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
"https://boringssl.googlesource.com/boringssl/+archive/${BORINGSSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cmake -B . -G Ninja -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/boringssl/build
cmake --build .
cmake --install .
- name: 'build nettle'
if: ${{ steps.cache-nettle.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://ftpmirror.gnu.org/nettle/nettle-${NETTLE_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "nettle-${NETTLE_VERSION}"
autoreconf -fi
./configure --disable-dependency-tracking --prefix=/home/runner/nettle/build \
--disable-static --disable-openssl --disable-documentation
make install
- name: 'build gnutls'
if: ${{ steps.cache-gnutls.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
"https://www.gnupg.org/ftp/gcrypt/gnutls/v${GNUTLS_VERSION%.*}/gnutls-${GNUTLS_VERSION}.tar.xz" --output pkg.bin
sha256sum pkg.bin && tar -xJf pkg.bin && rm -f pkg.bin
cd "gnutls-${GNUTLS_VERSION}"
autoreconf -fi
# required: libp11-kit-dev libev-dev autopoint bison gperf gtk-doc-tools libtasn1-bin
./configure --disable-dependency-tracking --prefix=/home/runner/gnutls/build \
PKG_CONFIG_PATH=/home/runner/nettle/build/lib64/pkgconfig \
LDFLAGS=-Wl,-rpath,/home/runner/nettle/build/lib64 \
--with-included-libtasn1 --with-included-unistring \
--disable-guile --disable-doc --disable-tests --disable-tools
make install
- name: 'build wolfssl'
if: ${{ steps.cache-wolfssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 --branch "v${WOLFSSL_VERSION}-stable" https://github.com/wolfSSL/wolfssl
cd wolfssl
./autogen.sh
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-all --enable-quic \
--disable-benchmark --disable-crypttests --disable-examples
make
make install
- name: 'build nghttp3'
if: ${{ steps.cache-nghttp3.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 --branch "v${NGHTTP3_VERSION}" https://github.com/ngtcp2/nghttp3
cd nghttp3
git submodule update --init --depth 1
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only
make
make install
- name: 'build ngtcp2'
if: ${{ steps.cache-ngtcp2.outputs.cache-hit != 'true' }}
# building twice to get crypto libs for ossl, libressl and awslc installed
run: |
cd ~
git clone --quiet --depth 1 --branch "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2
cd ngtcp2
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
PKG_CONFIG_PATH=/home/runner/libressl/build/lib/pkgconfig \
--with-openssl
make install
make clean
export PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/nettle/build/lib64/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/gnutls/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/wolfssl/build/lib/pkgconfig
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
--with-openssl --with-gnutls --with-wolfssl --with-boringssl \
BORINGSSL_LIBS='-L/home/runner/awslc/build/lib -lssl -lcrypto' \
BORINGSSL_CFLAGS='-I/home/runner/awslc/build/include'
make install
- name: 'build ngtcp2 openssl-prev'
if: ${{ steps.cache-ngtcp2-openssl-prev.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 --branch "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-openssl-prev
cd ngtcp2-openssl-prev
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
PKG_CONFIG_PATH=/home/runner/openssl-prev/build/lib/pkgconfig \
--with-openssl
make install
- name: 'build ngtcp2 boringssl'
if: ${{ steps.cache-ngtcp2-boringssl.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 --branch "v${NGTCP2_VERSION}" https://github.com/ngtcp2/ngtcp2 ngtcp2-boringssl
cd ngtcp2-boringssl
autoreconf -fi
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-lib-only \
--with-openssl=no --with-boringssl \
BORINGSSL_LIBS='-L/home/runner/boringssl/build/lib -lssl -lcrypto' \
BORINGSSL_CFLAGS='-I/home/runner/boringssl/build/include'
make install
- name: 'build nghttp2'
if: ${{ steps.cache-nghttp2.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 --branch "v${NGHTTP2_VERSION}" https://github.com/nghttp2/nghttp2
cd nghttp2
git submodule update --init --depth 1
autoreconf -fi
# required (for nghttpx application): libc-ares-dev libev-dev zlib1g-dev
# optional (for nghttpx application): libbrotli-dev
export PKG_CONFIG_PATH=/home/runner/openssl/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/nghttp3/build/lib/pkgconfig
PKG_CONFIG_PATH+=:/home/runner/ngtcp2/build/lib/pkgconfig
./configure --disable-dependency-tracking --prefix="$PWD"/build --enable-app --enable-http3 \
LDFLAGS=-Wl,-rpath,/home/runner/openssl/build/lib \
--with-libbrotlienc --with-libbrotlidec
make install
linux:
name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }}
needs: build-cache
runs-on: ubuntu-latest
timeout-minutes: 10
env:
CURL_TRACE_PKG_CONFIG: '1'
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_INSTALL_PACKAGES: '${{ matrix.build.install_packages }}'
strategy:
fail-fast: false
matrix:
build:
- name: 'openssl'
tflags: '--min=1700'
LDFLAGS: -Wl,-rpath,/home/runner/openssl/build/lib
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-openssl=/home/runner/openssl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ech --enable-ssls-export
- name: 'openssl'
install_steps: skipall
PKG_CONFIG_PATH: /home/runner/openssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl/build -DUSE_NGTCP2=ON
-DCURL_DISABLE_LDAP=ON
-DUSE_ECH=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'openssl-prev'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/openssl-prev/build/lib
PKG_CONFIG_PATH: "\
/home/runner/openssl-prev/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/nghttp2-openssl-prev/build/lib/pkgconfig"
configure: >-
--with-openssl=/home/runner/openssl-prev/build --with-ngtcp2=/home/runner/ngtcp2-openssl-prev/build --enable-ssls-export
- name: 'openssl-prev'
tflags: '--min=1700'
PKG_CONFIG_PATH: "\
/home/runner/openssl-prev/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-openssl-prev/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/openssl-prev/build -DUSE_NGTCP2=ON
-DCURL_DISABLE_LDAP=ON
- name: 'libressl'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/libressl/build/lib
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
# Intentionally using '--with-ngtcp2=<path>' to test this way of configuration, in addition to bare '--with-ngtcp2' + 'PKG_CONFIG_PATH' in other jobs.
configure: >-
--with-openssl=/home/runner/libressl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ssls-export
--enable-unity
- name: 'libressl'
PKG_CONFIG_PATH: /home/runner/libressl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/libressl/build -DUSE_NGTCP2=ON
- name: 'awslc'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/awslc/build/lib
PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
# Intentionally using bare '--with-ngtcp2' + 'PKG_CONFIG_PATH' to test this way of configuration, in addition to '--with-ngtcp2=<path>' in other jobs.
configure: >-
--with-openssl=/home/runner/awslc/build --with-ngtcp2 --enable-ssls-export
- name: 'awslc'
PKG_CONFIG_PATH: /home/runner/awslc/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/awslc/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON
- name: 'boringssl'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/boringssl/build/lib
PKG_CONFIG_PATH: /home/runner/boringssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-openssl=/home/runner/boringssl/build --with-ngtcp2=/home/runner/ngtcp2-boringssl/build --enable-ssls-export
- name: 'boringssl'
PKG_CONFIG_PATH: "\
/home/runner/boringssl/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2-boringssl/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/boringssl/build -DUSE_NGTCP2=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_UNITY_BUILD=ON
- name: 'gnutls'
install_packages: libp11-kit-dev libssh-dev
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib -Wl,-rpath,/home/runner/nettle/build/lib64 -Wl,-rpath,/home/runner/ngtcp2/build/lib
PKG_CONFIG_PATH: /home/runner/nettle/build/lib64/pkgconfig:/home/runner/gnutls/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-gnutls=/home/runner/gnutls/build --with-ngtcp2=/home/runner/ngtcp2/build --with-libssh --enable-ssls-export
- name: 'gnutls'
install_packages: libp11-kit-dev libssh-dev
LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib
PKG_CONFIG_PATH: "\
/home/runner/nettle/build/lib64/pkgconfig:\
/home/runner/gnutls/build/lib/pkgconfig:\
/home/runner/nghttp3/build/lib/pkgconfig:\
/home/runner/ngtcp2/build/lib/pkgconfig:\
/home/runner/nghttp2/build/lib/pkgconfig"
generate: >-
-DCURL_USE_GNUTLS=ON -DUSE_NGTCP2=ON -DCURL_USE_LIBSSH=ON
-DCMAKE_UNITY_BUILD=ON
- name: 'wolfssl'
install_packages: libssh2-1-dev
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/wolfssl/build/lib
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-wolfssl=/home/runner/wolfssl/build --with-ngtcp2=/home/runner/ngtcp2/build --enable-ech --with-libssh2 --enable-ssls-export
--enable-unity
- name: 'wolfssl'
install_packages: libssh2-1-dev
tflags: '--min=1900'
PKG_CONFIG_PATH: /home/runner/wolfssl/build/lib/pkgconfig:/home/runner/nghttp3/build/lib/pkgconfig:/home/runner/ngtcp2/build/lib/pkgconfig:/home/runner/nghttp2/build/lib/pkgconfig
generate: >-
-DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON
-DUSE_ECH=ON
- name: 'quiche'
install_steps: skipall
LDFLAGS: -Wl,-rpath,/home/runner/quiche/target/release
PKG_CONFIG_PATH: /home/runner/nghttp2/build/lib/pkgconfig
configure: >-
--with-openssl=/home/runner/quiche/quiche/deps/boringssl/src
--with-quiche=/home/runner/quiche/target/release
--with-ca-fallback
--enable-unity
- name: 'quiche'
PKG_CONFIG_PATH: /home/runner/nghttp2/build/lib/pkgconfig:/home/runner/quiche/target/release
generate: >-
-DOPENSSL_ROOT_DIR=/home/runner/quiche/quiche/deps/boringssl/src
-DUSE_QUICHE=ON
-DCURL_CA_FALLBACK=ON
steps:
- name: 'install prereqs'
timeout-minutes: 2
env:
INSTALL_PACKAGES: >-
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'stunnel4 ' || '' }}
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') &&
'apache2 apache2-dev libnghttp2-dev vsftpd dante-server libev-dev' || '' }}
run: |
sudo 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 \
libtool autoconf automake pkgconf \
libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libidn2-0-dev libldap-dev libuv1-dev valgrind \
${INSTALL_PACKAGES} \
${MATRIX_INSTALL_PACKAGES}
echo 'CC=gcc-12' >> "$GITHUB_ENV"
echo 'CXX=g++-12' >> "$GITHUB_ENV"
- name: 'cache openssl'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-http3-no-deprecated
env:
cache-name: cache-openssl-http3-no-deprecated
with:
path: ~/openssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache openssl-prev'
if: ${{ contains(matrix.build.name, 'openssl-prev') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-prev-http3-no-deprecated
env:
cache-name: cache-openssl-prev-http3-no-deprecated
with:
path: ~/openssl-prev/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.OPENSSL_PREV_VERSION }}
fail-on-cache-miss: true
- name: 'cache libressl'
if: ${{ contains(matrix.build.name, 'libressl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl
env:
cache-name: cache-libressl
with:
path: ~/libressl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache awslc'
if: ${{ contains(matrix.build.name, 'awslc') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-awslc
env:
cache-name: cache-awslc
with:
path: ~/awslc/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.AWSLC_VERSION }}
fail-on-cache-miss: true
- name: 'cache boringssl'
if: ${{ contains(matrix.build.name, 'boringssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-boringssl
env:
cache-name: cache-boringssl
with:
path: ~/boringssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache nettle'
if: ${{ contains(matrix.build.name, 'gnutls') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nettle
env:
cache-name: cache-nettle
with:
path: ~/nettle/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NETTLE_VERSION }}
fail-on-cache-miss: true
- name: 'cache gnutls'
if: ${{ contains(matrix.build.name, 'gnutls') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-gnutls
env:
cache-name: cache-gnutls
with:
path: ~/gnutls/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.GNUTLS_VERSION }}-${{ env.NETTLE_VERSION }}
fail-on-cache-miss: true
- name: 'cache wolfssl'
if: ${{ contains(matrix.build.name, 'wolfssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-wolfssl
env:
cache-name: cache-wolfssl
with:
path: ~/wolfssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache nghttp3'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp3
env:
cache-name: cache-nghttp3
with:
path: ~/nghttp3/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP3_VERSION }}
fail-on-cache-miss: true
- name: 'cache ngtcp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2
env:
cache-name: cache-ngtcp2
with:
path: ~/ngtcp2/build
key: "${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_VERSION }}-\
${{ env.LIBRESSL_VERSION }}-${{ env.AWSLC_VERSION }}-${{ env.NETTLE_VERSION }}-${{ env.GNUTLS_VERSION }}-${{ env.WOLFSSL_VERSION }}"
fail-on-cache-miss: true
- name: 'cache ngtcp2 openssl-prev'
if: ${{ contains(matrix.build.name, 'openssl-prev') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-openssl-prev
env:
cache-name: cache-ngtcp2-openssl-prev
with:
path: ~/ngtcp2-openssl-prev/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.OPENSSL_PREV_VERSION }}
fail-on-cache-miss: true
- name: 'cache ngtcp2 boringssl'
if: ${{ contains(matrix.build.name, 'boringssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-ngtcp2-boringssl
env:
cache-name: cache-ngtcp2-boringssl
with:
path: ~/ngtcp2-boringssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGTCP2_VERSION }}-${{ env.BORINGSSL_VERSION }}
fail-on-cache-miss: true
- name: 'cache nghttp2'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp2
env:
cache-name: cache-nghttp2
with:
path: ~/nghttp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.NGTCP2_VERSION }}-${{ env.NGHTTP3_VERSION }}
fail-on-cache-miss: true
- name: 'cache quiche'
if: ${{ contains(matrix.build.name, 'quiche') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-quiche
env:
cache-name: cache-quiche
with:
path: ~/quiche
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.QUICHE_VERSION }}
- name: 'build quiche and boringssl'
if: ${{ contains(matrix.build.name, 'quiche') && steps.cache-quiche.outputs.cache-hit != 'true' }}
run: |
cd ~
git clone --quiet --depth 1 --branch "${QUICHE_VERSION}" --recursive https://github.com/cloudflare/quiche
cd quiche
#### Work-around https://github.com/curl/curl/issues/7927 #######
#### See https://github.com/alexcrichton/cmake-rs/issues/131 ####
sed -i -e 's/cmake = "0.1"/cmake = "=0.1.45"/' quiche/Cargo.toml
cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose
ln -s libquiche.so target/release/libquiche.so.0
mkdir -v quiche/deps/boringssl/src/lib
find target/release \( -name libcrypto.a -o -name libssl.a \) -exec ln -vnf -- '{}' quiche/deps/boringssl/src/lib \;
# include dir
# /home/runner/quiche/quiche/deps/boringssl/src/include
# lib dir
# /home/runner/quiche/quiche/deps/boringssl/src/lib
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build.configure }}
run: autoreconf -fi
- name: 'configure'
env:
LDFLAGS: '${{ matrix.build.LDFLAGS }}'
MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}'
MATRIX_PKG_CONFIG_PATH: '${{ matrix.build.PKG_CONFIG_PATH }}'
run: |
[ -n "${MATRIX_PKG_CONFIG_PATH}" ] && export PKG_CONFIG_PATH="${MATRIX_PKG_CONFIG_PATH}"
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
[[ "${MATRIX_GENERATE}" = *'boringssl'* ]] && options=" -DBORINGSSL_VERSION=${BORINGSSL_VERSION}"
cmake -B bld -G Ninja \
-DCMAKE_C_COMPILER_TARGET="$(uname -m)-pc-linux-gnu" -DBUILD_STATIC_LIBS=ON \
-DCURL_WERROR=ON -DENABLE_DEBUG=ON \
-DCURL_USE_LIBUV=ON -DCURL_ENABLE_NTLM=ON \
-DTEST_NGHTTPX=/home/runner/nghttp2/build/bin/nghttpx \
-DHTTPD_NGHTTPX=/home/runner/nghttp2/build/bin/nghttpx \
${MATRIX_GENERATE} ${options}
else
[[ "${MATRIX_CONFIGURE}" = *'boringssl'* ]] && export CPPFLAGS="-DCURL_BORINGSSL_VERSION=\\\"${BORINGSSL_VERSION}\\\""
mkdir bld && cd bld && ../configure --enable-warnings --enable-werror --enable-debug --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-libuv --enable-ntlm \
--with-test-nghttpx=/home/runner/nghttp2/build/bin/nghttpx \
${MATRIX_CONFIGURE}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
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: 'test configs'
run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose
else
make -C bld V=1
fi
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
bld/src/curl --disable -V
- name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target testdeps
else
make -C bld V=1 -C tests
fi
- name: 'install test prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
python3 -m venv ~/venv
if bld/src/curl --disable -V 2>/dev/null | grep smb; then
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
fi
- name: 'run tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
env:
TFLAGS: '${{ matrix.build.tflags }}'
run: |
TFLAGS+=' -n'
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
else
make -C bld V=1 test-ci
fi
- name: 'run tests (valgrind)'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
export TFLAGS='-j6 --min=4 HTTP/3'
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
else
make -C bld V=1 test-ci
fi
- name: 'install pytest prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
[ -d ~/venv ] || python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt
- name: 'run pytest (event based)'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
env:
CURL_TEST_EVENT: 1
PYTEST_ADDOPTS: '--color=yes'
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
run: |
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target curl-pytest-ci
else
make -C bld V=1 pytest-ci
fi
+36
View File
@@ -0,0 +1,36 @@
# Copyright (C) Daniel Fandrich, <dan@coneharvesters.com>, et al.
#
# SPDX-License-Identifier: curl
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler
name: 'Labeler'
'on': [pull_request_target] # zizmor: ignore[dangerous-triggers]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
DO_NOT_TRACK: '1'
jobs:
label:
name: 'Labeler'
runs-on: ubuntu-slim
permissions:
contents: read # To comply with https://github.com/actions/labeler documentation
pull-requests: write # To edit labels on PRs
steps:
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
+187
View File
@@ -0,0 +1,187 @@
# Copyright (C) Daniel Fandrich, <dan@coneharvesters.com>, et al.
#
# SPDX-License-Identifier: curl
#
# Compile on an old version of Linux that has barely the minimal build
# requirements for CMake. This tests that curl is still usable on really
# outdated systems.
#
# Debian stretch is chosen as it closely matches some of the oldest major
# versions we support (especially cmake); see docs/INTERNALS.md and it
# is still supported (as of this writing).
# stretch has ELTS support from Freexian until 2027-06-30
# For ELTS info see https://www.freexian.com/lts/extended/docs/how-to-use-extended-lts/
# The Debian key expires 2025-05-20, after which package signature
# verification may need to be disabled.
# httrack is one of the smallest downloaders, needed to bootstrap ELTS,
# and doesn not conflict with the curl we are building.
name: 'Linux Old'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
MAKEFLAGS: -j 5
CURL_CI: github
CURL_TEST_MIN: 1560
DEBIAN_FRONTEND: noninteractive
DO_NOT_TRACK: '1'
jobs:
cmake-autotools:
name: 'autotools & cmake'
runs-on: ubuntu-latest
container: 'debian:stretch'
steps:
- name: 'install prereqs'
# Remember, this shell is dash, not bash
run: |
sed -E -i -e s@[a-z]+\.debian\.org/@archive.debian.org/debian-archive/@ -e '/ stretch-updates /d' /etc/apt/sources.list
apt-get -o Dpkg::Use-Pty=0 update
# See comment above if this fails after 2025-05-20
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends httrack
httrack --get https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb
sha256sum freexian-archive-keyring_2022.06.08_all.deb && dpkg -i freexian-archive-keyring_2022.06.08_all.deb
echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list
apt-get -o Dpkg::Use-Pty=0 update
apt-get -o Dpkg::Use-Pty=0 install -y --no-install-suggests --no-install-recommends \
make automake autoconf libtool ninja-build gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libkrb5-dev libldap2-dev stunnel4
# 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
# the main repo, so force the install.
httrack --get https://deb.freexian.com/extended-lts/pool/main/g/glibc/libc6_2.28-10+deb10u5_amd64.deb
httrack --get https://deb.freexian.com/extended-lts/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb
sha256sum libc6_*_amd64.deb libstdc++6_*_amd64.deb && dpkg -i --force-depends libc6_*_amd64.deb libstdc++6_*_amd64.deb
- name: 'install prereqs (cmake)'
env:
CMAKE_VERSION: 3.18.0 # Earliest version supported by curl
CMAKE_SHA256: 4d9a9d3351161073a67e49366d701b6fa4b0343781982dc5eef08a02a750d403
run: |
cd ~
fn="cmake-${CMAKE_VERSION}-linux-x86_64"
httrack --get "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${fn}.tar.gz"
sha256sum "${fn}".tar*.gz | tee /dev/stderr | grep -qwF -- "${CMAKE_SHA256}" && tar -xf "${fn}".tar*.gz && rm -f "${fn}".tar*.gz
mv "cmake-${CMAKE_VERSION}-Linux-x86_64" cmake
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'CM build-only configure (out-of-tree)'
run: |
~/cmake/bin/cmake -B bld-1 -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF
- name: 'CM build-only build'
run: |
~/cmake/bin/cmake --build bld-1 --verbose
~/cmake/bin/cmake --install bld-1 --verbose
- name: 'CM build-only curl -V'
run: bld-1/src/curl --disable --version
- name: 'CM build-only configure log'
if: ${{ !cancelled() }}
run: cat bld-1/CMakeFiles/CMake*.log 2>/dev/null || true
- name: 'CM build-only curl_config.h'
run: |
echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-1/lib/curl_config.h | sort || true
# when this job can get a libssh version 0.9.0 or later, this should get
# that enabled again
# when this job can get c-ares 1.16.0 or later, we can enable that
# again
- name: 'CM configure (out-of-tree, zstd, gssapi)'
run: |
~/cmake/bin/cmake -B bld-oldie -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DCURL_ENABLE_SSL=OFF -DENABLE_ARES=OFF -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF \
-DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
- name: 'CM configure log'
if: ${{ !cancelled() }}
run: cat bld-oldie/CMakeFiles/CMake*.log 2>/dev/null || true
- name: 'CM curl_config.h'
run: |
echo '::group::raw'; cat bld-oldie/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-oldie/lib/curl_config.h | sort || true
- name: 'CM build'
run: ~/cmake/bin/cmake --build bld-oldie
- name: 'CM curl -V'
run: bld-oldie/src/curl --disable --version
- name: 'CM install'
run: ~/cmake/bin/cmake --install bld-oldie
- name: 'CM build tests'
run: ~/cmake/bin/cmake --build bld-oldie --target testdeps
- name: 'CM run tests'
run: ~/cmake/bin/cmake --build bld-oldie --target test-ci
- name: 'CM build examples'
run: ~/cmake/bin/cmake --build bld-oldie --target curl-examples-build
- name: 'AM autoreconf'
run: autoreconf -fi
- name: 'AM configure (out-of-tree, zstd, gssapi)'
run: |
mkdir bld-am
cd bld-am
../configure --prefix="$PWD"/../curl-install-am --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
--without-ssl --disable-ares --without-libssh2 --with-zstd --with-gssapi
- name: 'AM configure log'
if: ${{ !cancelled() }}
run: cat bld-am/config.log 2>/dev/null || true
- name: 'AM curl_config.h'
run: |
echo '::group::raw'; cat bld-am/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld-am/lib/curl_config.h | sort || true
- name: 'AM build'
run: make -C bld-am
- name: 'AM curl -V'
run: bld-am/src/curl --disable --version
- name: 'AM install'
run: make -C bld-am install
- name: 'AM build tests'
run: make -C bld-am/tests all
+994
View File
@@ -0,0 +1,994 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'Linux'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
MAKEFLAGS: -j 5
CURL_CI: github
CURL_TEST_MIN: 1660
DO_NOT_TRACK: '1'
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.3.1
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VERSION: 5.9.1
# renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver registryUrl=https://github.com
MBEDTLS_VERSION: 4.0.0
# manually bumped
MBEDTLS_PREV_VERSION: 3.6.5
MBEDTLS_PREV_SHA256: 4a11f1777bb95bf4ad96721cac945a26e04bf19f57d905f241fe77ebeddf46d8
# renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com
AWSLC_VERSION: 1.71.0
# renovate: datasource=github-tags depName=google/boringssl versioning=semver registryUrl=https://github.com
BORINGSSL_VERSION: 0.20260413.0
# renovate: datasource=github-releases depName=openssl/openssl versioning=semver extractVersion=^openssl-(?<version>.+)$ registryUrl=https://github.com
OPENSSL_VERSION: 4.0.0
# renovate: datasource=github-tags depName=rustls/rustls-ffi versioning=semver registryUrl=https://github.com
RUSTLS_VERSION: 0.15.3
# handled in renovate.json
OPENLDAP_VERSION: 2.6.10
# renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com
NGHTTP2_VERSION: 1.69.0
# renovate: datasource=github-releases depName=pizlonator/fil-c versioning=semver-coerced registryUrl=https://github.com
FIL_C_VERSION: 0.678
jobs:
linux:
name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }}
runs-on: ${{ matrix.build.image || 'ubuntu-latest' }}
container: ${{ matrix.build.container }}
timeout-minutes: 15
env:
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_INSTALL_PACKAGES: '${{ matrix.build.install_packages }}'
MATRIX_INSTALL_STEPS: '${{ matrix.build.install_steps }}'
strategy:
fail-fast: false
matrix:
build:
- name: 'libressl krb5'
image: ubuntu-24.04-arm
install_packages: libidn2-dev libnghttp2-dev libldap-dev libkrb5-dev
install_steps: libressl-c-arm pytest codeset-test
LDFLAGS: -Wl,-rpath,/home/runner/libressl/lib
configure: --with-openssl=/home/runner/libressl --with-gssapi --enable-debug
- name: 'libressl krb5 valgrind 1'
image: ubuntu-24.04-arm
install_packages: libnghttp2-dev libldap-dev libkrb5-dev valgrind
install_steps: libressl-c-arm
tflags: '--min=870 1 to 950'
generate: -DOPENSSL_ROOT_DIR=/home/runner/libressl -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON -DCURL_ENABLE_NTLM=ON
- name: 'libressl krb5 valgrind 2'
image: ubuntu-24.04-arm
install_packages: libnghttp2-dev libldap-dev libkrb5-dev valgrind
install_steps: libressl-c-arm
tflags: '--min=900 951 to 9999'
generate: -DOPENSSL_ROOT_DIR=/home/runner/libressl -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON -DCURL_ENABLE_NTLM=ON
- name: 'libressl clang'
image: ubuntu-24.04-arm
install_packages: clang
install_steps: libressl-c-arm
CC: clang
LDFLAGS: -Wl,-rpath,/home/runner/libressl/lib
configure: --with-openssl=/home/runner/libressl --enable-debug
- name: 'wolfssl-all'
image: ubuntu-24.04-arm
install_steps: wolfssl-all-arm
LDFLAGS: -Wl,-rpath,/home/runner/wolfssl-all/lib
configure: --with-wolfssl=/home/runner/wolfssl-all --enable-ech --enable-debug
- name: 'wolfssl-opensslextra valgrind 1'
image: ubuntu-24.04-arm
install_packages: valgrind
install_steps: wolfssl-opensslextra-arm
tflags: '--min=815 1 to 1000'
LDFLAGS: -Wl,-rpath,/home/runner/wolfssl-opensslextra/lib
configure: --with-wolfssl=/home/runner/wolfssl-opensslextra --enable-ech --enable-debug
- name: 'wolfssl-opensslextra valgrind 2'
image: ubuntu-24.04-arm
install_packages: valgrind
install_steps: wolfssl-opensslextra-arm
tflags: '--min=835 1001 to 9999'
LDFLAGS: -Wl,-rpath,/home/runner/wolfssl-opensslextra/lib
configure: --with-wolfssl=/home/runner/wolfssl-opensslextra --enable-ech --enable-debug
- name: 'mbedtls gss valgrind 1'
image: ubuntu-24.04-arm
install_packages: libnghttp2-dev libidn2-dev libldap-dev libgss-dev valgrind
install_steps: mbedtls-latest-arm
tflags: '--min=850 1 to 1000'
LDFLAGS: -Wl,-rpath,/home/runner/mbedtls/lib
PKG_CONFIG_PATH: /home/runner/mbedtls/lib/pkgconfig
generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DCURL_USE_GSSAPI=ON -DCURL_DROP_UNUSED=ON
- name: 'mbedtls gss valgrind 2'
image: ubuntu-24.04-arm
install_packages: libnghttp2-dev libidn2-dev libldap-dev libgss-dev valgrind
install_steps: mbedtls-latest-arm
tflags: '--min=900 1001 to 9999'
LDFLAGS: -Wl,-rpath,/home/runner/mbedtls/lib
PKG_CONFIG_PATH: /home/runner/mbedtls/lib/pkgconfig
generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DCURL_USE_GSSAPI=ON
- name: 'mbedtls clang'
install_packages: libssh-dev libnghttp2-dev libldap-dev clang
install_steps: mbedtls-latest-intel pytest
CC: clang
LDFLAGS: -Wl,-rpath,/home/runner/mbedtls/lib
configure: --with-mbedtls=/home/runner/mbedtls --with-libssh --enable-debug --with-fish-functions-dir --with-zsh-functions-dir
- name: 'mbedtls-prev'
install_packages: libssh2-1-dev libnghttp2-dev libuv1-dev
install_steps: mbedtls-prev pytest
PKG_CONFIG_PATH: /home/runner/mbedtls-prev/lib/pkgconfig # Requires v3.6.0
generate: -DCURL_USE_MBEDTLS=ON -DCURL_USE_LIBUV=ON -DENABLE_DEBUG=ON
- name: 'mbedtls-pkg MultiSSL !pc'
install_packages: libnghttp2-dev libmbedtls-dev
install_steps: mbedtls-latest-intel skipall
generate: >-
-DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DCURL_DEFAULT_SSL_BACKEND=mbedtls
-DMBEDTLS_INCLUDE_DIR=/home/runner/mbedtls/include
-DMBEDTLS_LIBRARY=/home/runner/mbedtls/lib/libmbedtls.a
-DMBEDX509_LIBRARY=/home/runner/mbedtls/lib/libmbedx509.a
-DMBEDCRYPTO_LIBRARY=/home/runner/mbedtls/lib/libmbedcrypto.a
-DCURL_USE_PKGCONFIG=OFF -DCURL_USE_OPENSSL=ON
-DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF
-DCURL_COMPLETION_FISH=ON -DCURL_COMPLETION_ZSH=ON
- name: 'awslc'
install_steps: awslc pytest
LDFLAGS: -Wl,-rpath,/home/runner/awslc/lib
configure: --with-openssl=/home/runner/awslc --enable-ech --enable-ntlm
- name: 'awslc'
install_packages: libidn2-dev
install_steps: awslc
generate: -DOPENSSL_ROOT_DIR=/home/runner/awslc -DUSE_ECH=ON -DCMAKE_UNITY_BUILD=OFF -DCURL_DROP_UNUSED=ON -DCURL_PATCHSTAMP=test-patch -DCURL_ENABLE_NTLM=ON
- name: 'boringssl'
install_steps: boringssl pytest
generate: -DOPENSSL_ROOT_DIR=/home/runner/boringssl -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON
- name: 'openssl default'
install_steps: pytest
configure: --with-openssl --enable-debug --disable-unity
- name: 'openssl libssh2 sync-resolver valgrind 1 +analyzer'
image: ubuntu-24.04-arm
install_packages: libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev valgrind
tflags: '--min=965 1 to 1000'
generate: -DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF -DCURL_GCC_ANALYZER=ON -DCURL_ENABLE_NTLM=ON
- name: 'openssl libssh2 sync-resolver valgrind 2'
image: ubuntu-24.04-arm
install_packages: libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev valgrind
tflags: '--min=920 1001 to 9999'
generate: -DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF -DCURL_ENABLE_NTLM=ON
- name: 'openssl intel C89'
install_packages: libssh-dev
install_steps: pytest
configure: CFLAGS=-std=gnu89 --with-openssl --with-libssh --enable-debug
- name: 'openssl arm C89'
image: ubuntu-24.04-arm
install_packages: libssh2-1-dev
install_steps: pytest
configure: CFLAGS=-std=gnu89 --with-openssl --with-libssh2 --enable-debug --disable-verbose
- name: 'openssl -O3 libssh valgrind 1'
install_packages: libssh-dev valgrind
CFLAGS: -O3
tflags: '--min=950 1 to 1000'
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=50 -DCURL_ENABLE_NTLM=ON
- name: 'openssl -O3 libssh valgrind 2'
install_packages: libssh-dev valgrind
CFLAGS: -O3
tflags: '--min=900 1001 to 9999'
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=50 -DCURL_ENABLE_NTLM=ON
- name: 'openssl clang krb5 openldap static'
install_steps: openldap-static
install_packages: libidn2-dev libkrb5-dev clang libssl-dev
CC: clang
configure: >-
--enable-static --disable-shared --with-openssl --with-gssapi --enable-debug --disable-docs
--disable-manual --with-ldap=/home/runner/openldap-static --with-ldap-lib=ldap --with-lber-lib=lber
- name: 'openssl clang krb5 LTO'
image: ubuntu-24.04-arm
install_packages: libssh2-1-dev libkrb5-dev clang
install_steps: skiprun pytest
CC: clang
generate: -DCURL_USE_OPENSSL=ON -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DCURL_LTO=ON
- name: 'openssl !ipv6 !--libcurl !--digest-auth'
image: ubuntu-24.04-arm
configure: --with-openssl --disable-ipv6 --enable-debug --disable-unity --disable-libcurl-option --disable-digest-auth --enable-ntlm
- name: 'curl_global_init_mem debug valgrind'
image: ubuntu-24.04-arm
install_packages: valgrind
tflags: '--min=1700'
configure: >-
--enable-init-mem-debug
--with-openssl --disable-debug --enable-unity
--enable-ntlm
- name: 'openssl https-only'
image: ubuntu-24.04-arm
tflags: '--min=1260'
configure: >-
--with-openssl --enable-debug --disable-unity
--disable-dict --disable-gopher --disable-ldap --disable-telnet
--disable-imap --disable-pop3 --disable-smtp
--disable-rtsp
--without-libssh2 --without-libssh
--disable-tftp --disable-ftp --disable-file --disable-smb
--enable-ntlm
- name: 'openssl torture 1'
install_packages: libnghttp2-dev libssh2-1-dev libc-ares-dev
tflags: '-t --shallow=25 --min=960 1 to 1000'
torture: true
generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON -DCURL_ENABLE_NTLM=ON
- name: 'openssl torture 2'
install_packages: libnghttp2-dev libssh2-1-dev libc-ares-dev
tflags: '-t --shallow=25 --min=915 1001 to 9999'
torture: true
generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON -DCURL_ENABLE_NTLM=ON
- name: 'openssl i686'
install_packages: gcc-14-i686-linux-gnu libssl-dev:i386 libssh2-1-dev:i386 libidn2-dev:i386 libc-ares-dev:i386 zlib1g-dev:i386
CC: i686-linux-gnu-gcc-14
LDFLAGS: -L/usr/lib/i386-linux-gnu
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
configure: >-
CPPFLAGS=-I/usr/include/i386-linux-gnu
--host=i686-linux-gnu
--with-openssl --with-libssh2 --with-libidn2 --enable-ares --enable-debug
- name: '!ssl !http !smtp !imap'
image: ubuntu-24.04-arm
tflags: '--min=500'
configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity
- name: 'libressl Fil-C'
install_steps: filc libressl-filc nghttp2-filc pytest
tflags: '!776' # adds 1-9 minutes to the test run step, and fails consistently
CC: /home/runner/filc/build/bin/filcc
PKG_CONFIG_PATH: /home/runner/nghttp2/lib/pkgconfig
generate: >-
-DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_UNITY_BUILD=OFF -DCURL_DISABLE_TYPECHECK=ON
-DOPENSSL_ROOT_DIR=/home/runner/libressl -DCURL_USE_LIBPSL=OFF
-DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
-DCURL_DISABLE_LDAP=ON -DUSE_LIBIDN2=OFF -DCURL_USE_LIBSSH2=OFF
-DCURL_ENABLE_NTLM=ON
- name: 'clang-tidy'
install_packages: clang-20 clang-tidy-20 libssl-dev libidn2-dev libssh2-1-dev libnghttp2-dev libldap-dev libkrb5-dev libgnutls28-dev
install_steps: skiprun mbedtls-latest-intel rustls wolfssl-opensslextra-intel
install_steps_brew: openssl@4 gsasl
CC: clang-20
LDFLAGS: >-
-Wl,-rpath,/home/runner/wolfssl-opensslextra/lib
-Wl,-rpath,/home/runner/mbedtls/lib
-Wl,-rpath,/home/runner/rustls/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/openssl@4/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/gsasl/lib
PKG_CONFIG_PATH: "\
/home/runner/wolfssl-opensslextra/lib/pkgconfig:\
/home/runner/mbedtls/lib/pkgconfig:\
/home/runner/rustls/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/gsasl/lib/pkgconfig"
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/home/linuxbrew/.linuxbrew/opt/openssl@4
-DCURL_USE_WOLFSSL=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON
-DCURL_USE_GSASL=ON
-DUSE_ECH=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/usr/bin/clang-tidy-20
- name: 'clang-tidy H3 c-ares !examples'
install_packages: clang-20 clang-tidy-20 libidn2-dev libssh-dev libnghttp2-dev
install_steps: skiprun
install_steps_brew: libngtcp2 libnghttp3 c-ares
CC: clang-20
LDFLAGS: >-
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/openssl/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libngtcp2/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libnghttp3/lib
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/c-ares/lib
PKG_CONFIG_PATH: "\
/home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/libnghttp3/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/c-ares/lib/pkgconfig"
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/home/linuxbrew/.linuxbrew/opt/openssl -DUSE_NGTCP2=ON
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_HTTPSRR=ON -DENABLE_ARES=ON
-DCURL_DISABLE_VERBOSE_STRINGS=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/usr/bin/clang-tidy-20
- name: 'address-sanitizer'
install_packages: clang-20 libssl-dev libssh-dev libidn2-dev libnghttp2-dev libubsan1 libasan8 libtsan2
install_steps: pytest randcurl
CC: clang-20
CFLAGS: >-
-fsanitize=address,bounds,leak,signed-integer-overflow,undefined
-fno-sanitize-recover=address,bounds,leak,signed-integer-overflow,undefined
-fPIC
LDFLAGS: >-
-fsanitize=address,bounds,leak,signed-integer-overflow,undefined
-fno-sanitize-recover=address,bounds,leak,signed-integer-overflow,undefined -ldl -lubsan
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH=ON
- name: 'address-sanitizer H3 c-ares'
install_packages: clang-20 libubsan1 libasan8 libtsan2
install_steps: pytest
install_steps_brew: openssl@4 libssh2 libngtcp2 libnghttp3 c-ares
CC: clang-20
CFLAGS: >-
-fsanitize=address,bounds,leak,signed-integer-overflow,undefined
-fno-sanitize-recover=address,bounds,leak,signed-integer-overflow,undefined
LDFLAGS: >-
-fsanitize=address,bounds,leak,signed-integer-overflow,undefined
-fno-sanitize-recover=address,bounds,leak,signed-integer-overflow,undefined -ldl -lubsan
-Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/c-ares/lib
PKG_CONFIG_PATH: "\
/home/linuxbrew/.linuxbrew/opt/libssh2/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/libnghttp3/lib/pkgconfig:\
/home/linuxbrew/.linuxbrew/opt/c-ares/lib/pkgconfig"
generate: >-
-DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/home/linuxbrew/.linuxbrew/opt/openssl@4 -DUSE_ECH=ON -DUSE_NGTCP2=ON
-DUSE_SSLS_EXPORT=ON -DENABLE_ARES=ON
- name: 'thread-sanitizer'
install_packages: clang-20 libtsan2
install_steps: pytest openssl-tsan
CC: clang-20
CFLAGS: -fsanitize=thread -g
LDFLAGS: -fsanitize=thread
generate: -DOPENSSL_ROOT_DIR=/home/runner/openssl -DUSE_ECH=ON -DENABLE_DEBUG=ON
- name: 'memory-sanitizer'
install_packages: clang-20
install_steps: randcurl
CC: clang-20
CFLAGS: -fsanitize=memory -Wformat -Werror=format-security -Werror=array-bounds -g
LDFLAGS: -fsanitize=memory
LIBS: -ldl
configure: --without-ssl --without-zlib --without-brotli --without-zstd --without-libpsl --without-nghttp2 --enable-debug
tflags: '--min=1540'
- name: 'event-based'
install_packages: libssh-dev
configure: --enable-debug --enable-static --disable-shared --disable-threaded-resolver --with-libssh --with-openssl --enable-ntlm
tflags: '-n --test-event --min=1420'
- name: 'duphandle'
image: ubuntu-24.04-arm
install_packages: libssh-dev
configure: --enable-debug --enable-static --disable-shared --disable-threaded-resolver --with-libssh --with-openssl
tflags: '-n --test-duphandle'
- name: 'rustls valgrind 1'
install_packages: libnghttp2-dev libldap-dev valgrind
install_steps: rust rustls
tflags: '--min=820 1 to 1000'
generate: -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DENABLE_DEBUG=ON
- name: 'rustls valgrind 2'
install_packages: libnghttp2-dev libldap-dev valgrind
install_steps: rust rustls
tflags: '--min=830 1001 to 9999'
generate: -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DENABLE_DEBUG=ON
- name: 'rustls'
install_packages: libnghttp2-dev libldap-dev
install_steps: rust rustls skiprun pytest
configure: --with-rustls --enable-ech --enable-debug
- name: 'IntelC openssl'
install_packages: libssl-dev
install_steps: intelc
CC: icc
configure: --enable-debug --with-openssl
- name: 'Slackware !ssl gssapi gcc'
# Flags used to build the curl Slackware package, except OpenSSL 1.1.0:
# https://ftpmirror.infania.net/slackware/slackware64-current/source/n/curl/curl.SlackBuild
configure: --enable-debug --without-ssl --with-libssh2 --with-gssapi --enable-ares --without-ca-bundle --with-ca-path=/etc/ssl/certs
# Docker Hub image that `container-job` executes in
container: 'andy5995/slackware-build-essential:15.0'
- name: 'Alpine MUSL https-rr'
configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl --enable-httpsrr --enable-ares --enable-threaded-resolver
container: 'alpine:3.20'
- name: 'Alpine MUSL https-rr c-ares'
configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl --enable-httpsrr --enable-ares --disable-threaded-resolver
container: 'alpine:3.20'
steps:
- name: 'install prereqs'
if: ${{ matrix.build.container == null && !contains(matrix.build.name, 'i686') }}
timeout-minutes: 2
env:
INSTALL_PACKAGES_BREW: '${{ matrix.build.install_steps_brew }}'
INSTALL_PACKAGES: >-
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'stunnel4' || '' }}
${{ contains(matrix.build.install_steps, 'pytest') && 'apache2 apache2-dev libnghttp2-dev vsftpd dante-server' || '' }}
run: |
ls -l /etc/apt/sources.list.d
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 \
libtool autoconf automake pkgconf \
libpsl-dev zlib1g-dev libbrotli-dev libzstd-dev \
${INSTALL_PACKAGES} \
${MATRIX_INSTALL_PACKAGES}
if [ -n "${INSTALL_PACKAGES_BREW}" ]; then
HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew install ${INSTALL_PACKAGES_BREW}
fi
# Workaround for ubuntu-24.04-arm images having 0777 for /home/runner,
# which breaks the test sshd server used in pytest.
if [[ "$(uname -m)" = *'aarch64'* ]]; then
ls -l /home
chmod 0755 /home/runner
fi
- name: 'install prereqs (i686)'
if: ${{ contains(matrix.build.name, 'i686') }}
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 dpkg --add-architecture i386
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install \
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev:i386 libbrotli-dev:i386 libzstd-dev:i386 \
${MATRIX_INSTALL_PACKAGES}
- name: 'install prereqs (alpine)'
if: ${{ startsWith(matrix.build.container, 'alpine') }}
run: |
apk add --no-cache build-base autoconf automake libtool perl openssl-dev \
libssh2-dev zlib-dev brotli-dev zstd-dev libidn2-dev openldap-dev \
krb5-dev libpsl-dev c-ares-dev \
py3-impacket py3-asn1 py3-six py3-pycryptodomex \
perl-time-hires openssh stunnel sudo git openssl
- name: 'install Fil-C'
if: ${{ contains(matrix.build.install_steps, 'filc') }}
run: |
cd /home/runner
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/pizlonator/fil-c/releases/download/v${FIL_C_VERSION}/filc-${FIL_C_VERSION}-linux-x86_64.tar.xz" --output pkg.bin
sha256sum pkg.bin && tar -xJf pkg.bin && rm -f pkg.bin && mv "filc-${FIL_C_VERSION}-linux-x86_64" filc
cd filc
./setup.sh
- name: 'cache libressl (c-arm)'
if: ${{ contains(matrix.build.install_steps, 'libressl-c-arm') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl-c-arm
env:
cache-name: cache-libressl-c-arm
with:
path: ~/libressl
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
- name: 'build libressl (c-arm)'
if: ${{ contains(matrix.build.install_steps, 'libressl-c-arm') && steps.cache-libressl-c-arm.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "libressl-${LIBRESSL_VERSION}"
cmake -B . -G Ninja -DLIBRESSL_APPS=OFF -DLIBRESSL_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/libressl -DCURL_ENABLE_NTLM=ON
cmake --build .
cmake --install .
- name: 'cache libressl (filc)'
if: ${{ contains(matrix.build.install_steps, 'libressl-filc') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl-filc
env:
cache-name: cache-libressl-filc
with:
path: ~/libressl
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}-${{ env.FIL_C_VERSION }}
- name: 'build libressl (filc)'
if: ${{ contains(matrix.build.install_steps, 'libressl-filc') && steps.cache-libressl-filc.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "libressl-${LIBRESSL_VERSION}"
cmake -B . -G Ninja -DLIBRESSL_APPS=OFF -DLIBRESSL_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/libressl \
-DCMAKE_C_COMPILER=/home/runner/filc/build/bin/filcc -DENABLE_ASM=OFF
cmake --build .
cmake --install .
- name: 'cache nghttp2 (filc)'
if: ${{ contains(matrix.build.install_steps, 'nghttp2-filc') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-nghttp2-filc
env:
cache-name: cache-nghttp2-filc
with:
path: ~/nghttp2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.NGHTTP2_VERSION }}-${{ env.FIL_C_VERSION }}
- name: 'build nghttp2 (filc)'
if: ${{ contains(matrix.build.install_steps, 'nghttp2-filc') && steps.cache-nghttp2-filc.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.xz" --output pkg.bin
sha256sum pkg.bin && tar -xJf pkg.bin && rm -f pkg.bin
cd "nghttp2-${NGHTTP2_VERSION}"
cmake -B . -G Ninja -DENABLE_LIB_ONLY=ON -DBUILD_TESTING=OFF -DENABLE_DOC=OFF -DCMAKE_INSTALL_PREFIX=/home/runner/nghttp2 \
-DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_COMPILER=/home/runner/filc/build/bin/filcc
cmake --build .
cmake --install .
- name: 'cache wolfssl (all-arm)'
if: ${{ contains(matrix.build.install_steps, 'wolfssl-all-arm') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-wolfssl-all-arm
env:
cache-name: cache-wolfssl-all-arm
with:
path: ~/wolfssl-all
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
- name: 'build wolfssl (all-arm)' # does not support `OPENSSL_COEXIST`
if: ${{ contains(matrix.build.install_steps, 'wolfssl-all-arm') && steps.cache-wolfssl-all-arm.outputs.cache-hit != 'true' }}
run: |
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" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "wolfssl-${WOLFSSL_VERSION}-stable"
./autogen.sh
./configure --disable-dependency-tracking --prefix=/home/runner/wolfssl-all --enable-tls13 --enable-harden --enable-all \
--disable-benchmark --disable-crypttests --disable-examples
make install
- name: 'cache wolfssl (opensslextra-intel)' # does support `OPENSSL_COEXIST`
if: ${{ contains(matrix.build.install_steps, 'wolfssl-opensslextra-intel') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-wolfssl-opensslextra-intel
env:
cache-name: cache-wolfssl-opensslextra-intel
with:
path: ~/wolfssl-opensslextra
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
- name: 'build wolfssl (opensslextra-intel)'
if: ${{ contains(matrix.build.install_steps, 'wolfssl-opensslextra-intel') && steps.cache-wolfssl-opensslextra-intel.outputs.cache-hit != 'true' }}
run: |
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" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "wolfssl-${WOLFSSL_VERSION}-stable"
./autogen.sh
./configure --disable-dependency-tracking --prefix=/home/runner/wolfssl-opensslextra --enable-tls13 --enable-harden --enable-ech --enable-opensslextra \
--disable-benchmark --disable-crypttests --disable-examples
make install
- name: 'cache wolfssl (opensslextra-arm)' # does support `OPENSSL_COEXIST`
if: ${{ contains(matrix.build.install_steps, 'wolfssl-opensslextra-arm') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-wolfssl-opensslextra-arm
env:
cache-name: cache-wolfssl-opensslextra-arm
with:
path: ~/wolfssl-opensslextra
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.WOLFSSL_VERSION }}
- name: 'build wolfssl (opensslextra-arm)'
if: ${{ contains(matrix.build.install_steps, 'wolfssl-opensslextra-arm') && steps.cache-wolfssl-opensslextra-arm.outputs.cache-hit != 'true' }}
run: |
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" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "wolfssl-${WOLFSSL_VERSION}-stable"
./autogen.sh
./configure --disable-dependency-tracking --prefix=/home/runner/wolfssl-opensslextra --enable-tls13 --enable-harden --enable-ech --enable-opensslextra \
--disable-benchmark --disable-crypttests --disable-examples
make install
- name: 'cache mbedtls (latest-intel)'
if: ${{ contains(matrix.build.install_steps, 'mbedtls-latest-intel') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-mbedtls-latest-intel
env:
cache-name: cache-mbedtls-latest-intel
with:
path: ~/mbedtls
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.MBEDTLS_VERSION }}
- name: 'build mbedtls (latest-intel)'
if: ${{ contains(matrix.build.install_steps, 'mbedtls-latest-intel') && steps.cache-mbedtls-latest-intel.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${MBEDTLS_VERSION}/mbedtls-${MBEDTLS_VERSION}.tar.bz2" --output pkg.bin
sha256sum pkg.bin && tar -xjf pkg.bin && rm -f pkg.bin
cd "mbedtls-${MBEDTLS_VERSION}"
./scripts/config.py set MBEDTLS_THREADING_C
./scripts/config.py set MBEDTLS_THREADING_PTHREAD
cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/home/runner/mbedtls \
-DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF
cmake --build .
cmake --install .
- name: 'cache mbedtls (latest-arm)'
if: ${{ contains(matrix.build.install_steps, 'mbedtls-latest-arm') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-mbedtls-latest-arm
env:
cache-name: cache-mbedtls-latest-arm
with:
path: ~/mbedtls
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.MBEDTLS_VERSION }}
- name: 'build mbedtls (latest-arm)'
if: ${{ contains(matrix.build.install_steps, 'mbedtls-latest-arm') && steps.cache-mbedtls-latest-arm.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${MBEDTLS_VERSION}/mbedtls-${MBEDTLS_VERSION}.tar.bz2" --output pkg.bin
sha256sum pkg.bin && tar -xjf pkg.bin && rm -f pkg.bin
cd "mbedtls-${MBEDTLS_VERSION}"
./scripts/config.py set MBEDTLS_THREADING_C
./scripts/config.py set MBEDTLS_THREADING_PTHREAD
cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/home/runner/mbedtls \
-DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF
cmake --build .
cmake --install .
- name: 'cache mbedtls (prev)'
if: ${{ contains(matrix.build.install_steps, 'mbedtls-prev') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-mbedtls-prev
env:
cache-name: cache-mbedtls-prev
with:
path: ~/mbedtls-prev
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.MBEDTLS_PREV_VERSION }}
- name: 'build mbedtls (prev)'
if: ${{ contains(matrix.build.install_steps, 'mbedtls-prev') && steps.cache-mbedtls-prev.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${MBEDTLS_PREV_VERSION}/mbedtls-${MBEDTLS_PREV_VERSION}.tar.bz2" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${MBEDTLS_PREV_SHA256}" && tar -xjf pkg.bin && rm -f pkg.bin
cd "mbedtls-${MBEDTLS_PREV_VERSION}"
./scripts/config.py set MBEDTLS_THREADING_C
./scripts/config.py set MBEDTLS_THREADING_PTHREAD
cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/home/runner/mbedtls-prev \
-DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF
cmake --build .
cmake --install .
- name: 'cache openldap (static)'
if: ${{ contains(matrix.build.install_steps, 'openldap-static') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openldap-static
env:
cache-name: cache-openldap-static
with:
path: ~/openldap-static
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENLDAP_VERSION }}
- name: 'build openldap (static)'
if: ${{ contains(matrix.build.install_steps, 'openldap-static') && steps.cache-openldap-static.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${OPENLDAP_VERSION}.tgz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "openldap-${OPENLDAP_VERSION}"
autoreconf -fi
./configure --prefix=/home/runner/openldap-static --enable-static --disable-shared --disable-slapd
make install
- name: 'cache openssl (thread sanitizer)'
if: ${{ contains(matrix.build.install_steps, 'openssl-tsan') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-openssl-tsan
env:
cache-name: cache-openssl-tsan
with:
path: ~/openssl
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENSSL_VERSION }}
- name: 'build openssl (thread sanitizer)'
if: ${{ contains(matrix.build.install_steps, 'openssl-tsan') && steps.cache-openssl-tsan.outputs.cache-hit != 'true' }}
run: |
git clone --quiet --depth 1 --branch "openssl-${OPENSSL_VERSION}" https://github.com/openssl/openssl
cd openssl
CC=clang CFLAGS='-fsanitize=thread' LDFLAGS='-fsanitize=thread' ./config --prefix=/home/runner/openssl --libdir=lib no-makedepend no-apps no-docs no-tests
make
make -j1 install_sw
- name: 'cache awslc'
if: ${{ contains(matrix.build.install_steps, 'awslc') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-awslc
env:
cache-name: cache-awslc
with:
path: ~/awslc
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.AWSLC_VERSION }}
- name: 'build awslc'
if: ${{ contains(matrix.build.install_steps, 'awslc') && steps.cache-awslc.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/awslabs/aws-lc/archive/refs/tags/v${AWSLC_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "aws-lc-${AWSLC_VERSION}"
cmake -B . -G Ninja -DCMAKE_INSTALL_PREFIX=/home/runner/awslc -DBUILD_TOOL=OFF -DBUILD_TESTING=OFF
cmake --build .
cmake --install .
- name: 'cache boringssl'
if: ${{ contains(matrix.build.install_steps, 'boringssl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-boringssl
env:
cache-name: cache-boringssl
with:
path: ~/boringssl
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.BORINGSSL_VERSION }}
- name: 'build boringssl'
if: ${{ contains(matrix.build.install_steps, 'boringssl') && steps.cache-boringssl.outputs.cache-hit != 'true' }}
run: |
mkdir boringssl-src
cd boringssl-src
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
"https://boringssl.googlesource.com/boringssl/+archive/${BORINGSSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cmake -B . -G Ninja -DCMAKE_INSTALL_PREFIX=/home/runner/boringssl -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON
cmake --build .
cmake --install .
- name: 'cache rustls'
if: ${{ contains(matrix.build.install_steps, 'rustls') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-rustls
env:
cache-name: cache-rustls
with:
path: ~/rustls
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.RUSTLS_VERSION }}
- name: 'fetch rustls deb'
if: ${{ contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--location "https://github.com/rustls/rustls-ffi/releases/download/v${RUSTLS_VERSION}/librustls_${RUSTLS_VERSION}_amd64.deb.zip" --output pkg.bin
sha256sum pkg.bin && unzip pkg.bin -d rustls && rm -f pkg.bin
- name: 'build rustls'
# Note: we do not check cache-hit here. If the cache is hit, we need to dpkg install the deb.
if: ${{ contains(matrix.build.install_steps, 'rustls') }}
run: sudo dpkg -i ~/rustls/"librustls_${RUSTLS_VERSION}_amd64.deb"
- name: 'install Intel compilers'
if: ${{ contains(matrix.build.install_steps, 'intelc') }}
timeout-minutes: 2
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 6 --retry-connrefused \
--compressed https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | \
sudo tee /etc/apt/trusted.gpg.d/intel-sw.asc >/dev/null
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo add-apt-repository 'deb https://apt.repos.intel.com/oneapi all main'
sudo apt-get -o Dpkg::Use-Pty=0 install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
source /opt/intel/oneapi/setvars.sh
printenv >> "$GITHUB_ENV"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build.configure }}
run: autoreconf -fi
- name: 'configure'
env:
CC: '${{ matrix.build.CC }}'
CFLAGS: '${{ matrix.build.CFLAGS }}'
LDFLAGS: '${{ matrix.build.LDFLAGS }}'
LIBS: '${{ matrix.build.LIBS }}'
MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}'
MATRIX_PKG_CONFIG_PATH: '${{ matrix.build.PKG_CONFIG_PATH }}'
run: |
[[ "${MATRIX_INSTALL_STEPS}" = *'awslc'* ]] && sudo apt-get -o Dpkg::Use-Pty=0 purge libssl-dev
[ -n "${MATRIX_PKG_CONFIG_PATH}" ] && export PKG_CONFIG_PATH="${MATRIX_PKG_CONFIG_PATH}"
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_C_COMPILER_TARGET="$(uname -m)-pc-linux-gnu" -DBUILD_STATIC_LIBS=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
${MATRIX_GENERATE}
else
mkdir bld && cd bld && \
../configure --prefix="$HOME"/curl-install --enable-unity --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
${MATRIX_CONFIGURE}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
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: 'test configs'
run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose
else
make -C bld V=1
fi
- name: 'single-use function check'
if: ${{ (contains(matrix.build.configure, '--disable-unity') || contains(matrix.build.generate, '-DCMAKE_UNITY_BUILD=OFF')) && !contains(matrix.build.install_steps, 'filc') }}
run: |
git config --global --add safe.directory "*"
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
libcurla=bld/lib/libcurl.a
else
libcurla=bld/lib/.libs/libcurl.a
fi
./scripts/singleuse.pl --unit "${libcurla}"
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so.*' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
bld/src/curl --disable -V
- name: 'curl install'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --install bld --strip
else
make -C bld V=1 install
fi
- name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target testdeps
else
make -C bld V=1 -C tests
fi
- name: 'install test prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && matrix.build.container == null }}
run: |
python3 -m venv ~/venv
if bld/src/curl --disable -V 2>/dev/null | grep smb; then
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
fi
- name: 'run tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
timeout-minutes: ${{ contains(matrix.build.install_packages, 'valgrind') && 20 || 10 }}
env:
TEST_TARGET: ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
TFLAGS: '${{ matrix.build.tflags }}'
run: |
if [ "${TEST_TARGET}" = 'test-ci' ] && [[ "${MATRIX_INSTALL_PACKAGES}" = *'valgrind'* ]]; then
TFLAGS+=' -j6'
TFLAGS+=' !776' # skip long-running flaky test
if [[ "${MATRIX_INSTALL_PACKAGES}" = *'libgss-dev'* ]]; then
TFLAGS+=' ~2077 ~2078' # memory leaks from Curl_auth_decode_spnego_message() -> gss_init_sec_context()
fi
elif [ "${TEST_TARGET}" != 'test-ci' ]; then
TFLAGS+=' --buildinfo' # only test-ci sets this by default, set it manually for test-torture
fi
[ -f ~/venv/bin/activate ] && source ~/venv/bin/activate
if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test'* ]]; then
locale || true
export LC_ALL=C
export LC_CTYPE=C
export LC_NUMERIC=fr_FR.UTF-8
fi
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target "${TEST_TARGET}"
else
make -C bld V=1 "${TEST_TARGET}"
fi
- name: 'install pytest prereqs'
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
run: |
[ -d ~/venv ] || python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt
- name: 'run pytest'
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
env:
PYTEST_ADDOPTS: '--color=yes'
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
run: |
[ -f ~/venv/bin/activate ] && source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target curl-pytest-ci
else
make -C bld V=1 pytest-ci
fi
- name: 'randcurl'
if: ${{ contains(matrix.build.install_steps, 'randcurl') }}
run: |
mkdir run
cd run
../.github/scripts/randcurl.pl 60 ../bld/src/curl
- name: 'build examples'
if: ${{ !contains(matrix.build.install_packages, 'valgrind') && !contains(matrix.build.name, '!examples') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target curl-examples-build
else
make -C bld V=1 examples
fi
+771
View File
@@ -0,0 +1,771 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
name: 'macOS'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
# Apple APIs and the macos-version-min value required to avoid deprecation
# warnings with llvm/clang, and/or the feature getting enabled at build-time
# or runtime:
#
# - 10.7 Lion (2011) - GSS (build-time, deprecated MIT Kerberos shim)
# - 10.9 Mavericks (2013) - LDAP (build-time, deprecated), OCSP (runtime)
# - 10.11 El Capitan (2015) - connectx() (runtime)
# - 10.12 Sierra (2016) - clock_gettime() (build-time, runtime)
# - 10.14 Mojave (2018) - SecTrustEvaluateWithError() (runtime)
env:
CURL_CI: github
CURL_TEST_MIN: 1750
DO_NOT_TRACK: '1'
MAKEFLAGS: -j 4
LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
jobs:
ios:
name: "iOS, ${{ (matrix.build.generator && format('CM-{0}', matrix.build.generator)) || (matrix.build.generate && 'CM' || 'AM' )}} ${{ matrix.build.name }} arm64"
runs-on: macos-latest
timeout-minutes: 10
env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: 'clang'
LDFLAGS: ''
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_OPTIONS: ${{ matrix.build.options }}
# renovate: datasource=github-tags depName=libressl/portable versioning=semver registryUrl=https://github.com
LIBRESSL_VERSION: 4.3.1
strategy:
fail-fast: false
matrix:
build:
- name: 'libressl'
install_steps: libressl
configure: --with-openssl=/Users/runner/libressl --without-libpsl
- name: 'libressl'
install_steps: libressl
# FIXME: Could not make OPENSSL_ROOT_DIR work. CMake seems to prepend sysroot to it.
generator: Xcode
xcode: '' # default Xcode. Set it once to silence actionlint.
options: --config Debug
generate: >-
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=OFF
-DMACOSX_BUNDLE_GUI_IDENTIFIER=se.curl
-DOPENSSL_INCLUDE_DIR=/Users/runner/libressl/include
-DOPENSSL_SSL_LIBRARY=/Users/runner/libressl/lib/libssl.a
-DOPENSSL_CRYPTO_LIBRARY=/Users/runner/libressl/lib/libcrypto.a
-DCURL_USE_LIBPSL=OFF -DCURL_ENABLE_NTLM=ON
steps:
- name: 'brew install'
if: ${{ matrix.build.configure }}
timeout-minutes: 5
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions'
run: |
command -v "${CC}"; "${CC}" --version || true
xcodebuild -version || true
xcodebuild -sdk -version | grep '^Path:' || true
xcrun --sdk iphoneos --show-sdk-path 2>/dev/null || true
xcrun --sdk iphoneos --show-sdk-version || true
echo '::group::compiler defaults'; echo 'int main(void) {}' | "${CC}" -v -x c -; echo '::endgroup::'
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
- name: 'cache libressl'
if: ${{ contains(matrix.build.install_steps, 'libressl') }}
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-libressl
env:
cache-name: cache-libressl
with:
path: ~/libressl
key: iOS-${{ env.cache-name }}-${{ env.LIBRESSL_VERSION }}
- name: 'build libressl'
if: ${{ contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true' }}
run: |
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location "https://github.com/libressl/portable/releases/download/v${LIBRESSL_VERSION}/libressl-${LIBRESSL_VERSION}.tar.gz" --output pkg.bin
sha256sum pkg.bin && tar -xzf pkg.bin && rm -f pkg.bin
cd "libressl-${LIBRESSL_VERSION}"
cmake -B . -G Ninja \
-DCMAKE_INSTALL_PREFIX=/Users/runner/libressl \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DBUILD_SHARED_LIBS=OFF \
-DLIBRESSL_APPS=OFF \
-DLIBRESSL_TESTS=OFF
cmake --build .
cmake --install . --verbose
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build.configure }}
run: autoreconf -fi
- name: 'configure'
env:
MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}'
MATRIX_GENERATOR: '${{ matrix.build.generator }}'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
[ -n "${MATRIX_GENERATOR}" ] && options="-G ${MATRIX_GENERATOR}"
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_SYSTEM_NAME=iOS \
-DUSE_APPLE_IDN=ON \
${MATRIX_GENERATE} ${options}
else
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \
CFLAGS="-isysroot $(xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)" \
--host=aarch64-apple-darwin \
--with-apple-idn \
${MATRIX_CONFIGURE}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
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: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --verbose
else
make -C bld V=1
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
- name: 'build tests'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target testdeps --verbose
else
make -C bld V=1 -C tests
fi
- name: 'build examples'
if: ${{ matrix.build.generate }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld ${MATRIX_OPTIONS} --parallel 4 --target curl-examples-build --verbose
else
make -C bld examples V=1
fi
macos:
name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.compiler }} ${{ matrix.build.name }}"
runs-on: ${{ matrix.build.image || 'macos-15' }}
timeout-minutes: 15
env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
CC: '${{ matrix.build.compiler }}'
MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }}
MATRIX_COMPILER: '${{ matrix.build.compiler }}'
MATRIX_INSTALL: '${{ matrix.build.install }}'
MATRIX_INSTALL_STEPS: '${{ matrix.build.install_steps }}'
MATRIX_MACOS_VERSION_MIN: '${{ matrix.build.macos-version-min }}'
strategy:
fail-fast: false
matrix:
build:
- name: '!ssl !debug brotli zstd'
compiler: gcc-13
configure: --without-ssl --with-brotli --with-zstd --with-apple-idn
tflags: '--min=1520'
xcode: '' # default Xcode. Set it once to silence actionlint.
- name: '!ssl libssh2 AppleIDN'
compiler: clang
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH2=ON -DUSE_APPLE_IDN=ON -DCURL_ENABLE_SSL=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
tflags: '--min=1630'
- name: 'OpenSSL libssh c-ares'
compiler: clang
install: openssl@4 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
- name: 'OpenSSL libssh'
compiler: llvm@18
install: libssh libnghttp3
generate: -DENABLE_DEBUG=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
- name: '!ssl HTTP-only c-ares'
macos-version-min: '10.15' # Catalina (2019)
compiler: clang
tflags: '--min=960'
generate: >-
-DENABLE_DEBUG=ON -DENABLE_ARES=ON
-DCURL_ENABLE_SSL=OFF -DHTTP_ONLY=ON
-DCURL_DISABLE_ALTSVC=ON -DENABLE_UNIX_SOCKETS=OFF
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_NGHTTP2=OFF
-DCURL_USE_GSSAPI=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF
-DCURL_BROTLI=OFF -DCURL_ZLIB=OFF -DCURL_ZSTD=OFF
-DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF
- name: 'LibreSSL !ldap +examples'
compiler: clang
install: libressl
install_steps: pytest
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF
-DCURL_USE_LIBSSH2=OFF -DCURL_ENABLE_NTLM=ON
- name: 'OpenSSL 10.15 C89'
macos-version-min: '10.15'
compiler: clang
install: libnghttp3 libngtcp2
install_steps: pytest
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_NGTCP2=ON -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_USE_LIBSSH2=OFF
-DCMAKE_C_STANDARD=90 -DCURL_ENABLE_NTLM=ON
- name: 'OpenSSL SecTrust'
compiler: clang
install: libnghttp3 libngtcp2
install_steps: pytest
configure: --enable-debug --with-openssl=/opt/homebrew/opt/openssl --with-ngtcp2 --with-apple-sectrust --enable-ntlm
- name: 'OpenSSL event-based'
compiler: clang
generate: -DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_USE_LIBSSH2=OFF -DCURL_ENABLE_NTLM=ON
tflags: '--test-event --min=1400'
- name: 'OpenSSL gsasl AppleIDN SecTrust +examples'
compiler: clang
install: openssl@4 libnghttp3 libngtcp2 gsasl
generate: >-
-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
-DUSE_APPLE_SECTRUST=ON -DCURL_ENABLE_NTLM=ON
- name: 'MultiSSL AppleIDN clang-tidy +examples'
image: macos-26
compiler: clang
install: llvm gnutls nettle libressl krb5 mbedtls gsasl rustls-ffi libssh fish
install_steps: skiprun
chkprefill: _chkprefill
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DCURL_DEFAULT_SSL_BACKEND=openssl
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_BROTLI=ON -DCURL_ZSTD=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy
-DCURL_COMPLETION_FISH=ON -DCURL_COMPLETION_ZSH=ON
-DCURL_ENABLE_NTLM=ON
- name: 'HTTP/3 clang-tidy'
image: macos-26
compiler: clang
install: llvm libnghttp3 libngtcp2 openldap krb5
install_steps: skipall
generate: >-
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DUSE_NGTCP2=ON
-DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include
-DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib
-DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_BROTLI=ON -DCURL_ZSTD=ON
-DCURL_CLANG_TIDY=ON -DCLANG_TIDY=/opt/homebrew/opt/llvm/bin/clang-tidy
-DCURL_ENABLE_NTLM=ON
- name: 'LibreSSL openldap krb5 c-ares +examples'
compiler: clang
install: libressl krb5 openldap
generate: >-
-DENABLE_DEBUG=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/libressl -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON
-DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DLDAP_INCLUDE_DIR=/opt/homebrew/opt/openldap/include
-DLDAP_LIBRARY=/opt/homebrew/opt/openldap/lib/libldap.dylib
-DLDAP_LBER_LIBRARY=/opt/homebrew/opt/openldap/lib/liblber.dylib
- name: 'wolfSSL !ldap brotli zstd'
compiler: clang
install: brotli wolfssl zstd
install_steps: pytest
generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON -DCURL_ENABLE_NTLM=ON
- name: 'mbedTLS !ldap brotli zstd MultiSSL AppleIDN'
compiler: llvm@18
install: brotli mbedtls zstd
install_steps: codeset-test
generate: -DCURL_USE_MBEDTLS=ON -DCURL_DISABLE_LDAP=ON -DCURL_DEFAULT_SSL_BACKEND=mbedtls -DCURL_USE_OPENSSL=ON -DUSE_APPLE_IDN=ON -DCURL_ENABLE_NTLM=ON
- name: 'GnuTLS !ldap krb5 +examples'
compiler: clang
install: gnutls nettle krb5
generate: >-
-DENABLE_DEBUG=ON -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF
-DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=/opt/homebrew/opt/krb5
-DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON -DCURL_ENABLE_NTLM=ON
- name: 'aws-lc +analyzer'
compiler: gcc-15
install: aws-lc
generate: >-
-DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/aws-lc -DUSE_ECH=ON
-DCURL_DISABLE_LDAP=ON -DUSE_SSLS_EXPORT=ON -DCURL_GCC_ANALYZER=ON
- name: 'Rustls'
compiler: clang
install: rustls-ffi
generate: -DENABLE_DEBUG=ON -DCURL_USE_RUSTLS=ON -DUSE_ECH=ON -DCURL_DISABLE_LDAP=ON -DCURL_ENABLE_NTLM=ON
tflags: '--min=1730'
- name: 'OpenSSL torture 1'
compiler: clang
install: openssl@4 libnghttp3
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
tflags: '-t --shallow=25 --min=480 1 to 500'
- name: 'OpenSSL torture 2'
compiler: clang
install: openssl@4 libnghttp3
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
tflags: '-t --shallow=25 --min=730 501 to 1250'
- name: 'OpenSSL torture 3'
compiler: clang
install: openssl@4 libnghttp3
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
tflags: '-t --shallow=25 --min=628 1251 to 9999'
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'
timeout-minutes: 5
# Run this command with retries because of spurious failures seen
# while running the tests, for example
# https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
env:
INSTALL_PACKAGES: >-
${{ matrix.build.generate && 'ninja' || 'automake libtool' }}
${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') && 'nghttp2 stunnel' || '' }}
${{ contains(matrix.build.install_steps, 'pytest') && 'caddy httpd vsftpd' || '' }}
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install pkgconf libpsl libssh2 ${INSTALL_PACKAGES} ${MATRIX_INSTALL}; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions'
run: |
[[ "${MATRIX_COMPILER}" = 'llvm'* ]] && CC="$(brew --prefix "${MATRIX_COMPILER}")/bin/clang"
[[ "${MATRIX_COMPILER}" = 'gcc'* ]] && "${CC}" --print-sysroot
command -v "${CC}"; "${CC}" --version || true
xcodebuild -version || true
xcrun --sdk macosx --show-sdk-path 2>/dev/null || true
xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || true
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages installed'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build.configure }}
run: autoreconf -fi
- name: 'configure'
env:
MATRIX_CHKPREFILL: '${{ matrix.build.chkprefill }}'
MATRIX_CONFIGURE: '${{ matrix.build.configure }}'
MATRIX_GENERATE: '${{ matrix.build.generate }}'
run: |
if [[ "${MATRIX_COMPILER}" = 'gcc'* ]]; then
sysroot="$("${CC}" --print-sysroot)" # Must match the SDK gcc was built for
else
sysroot="$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)"
fi
if [[ "${MATRIX_COMPILER}" = 'llvm'* ]]; then
CC="$(brew --prefix "${MATRIX_COMPILER}")/bin/clang"
CC+=" --sysroot=${sysroot}"
CC+=" --target=$(uname -m)-apple-darwin"
fi
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
for _chkprefill in '' ${MATRIX_CHKPREFILL}; do
options=''
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && options+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MATRIX_MACOS_VERSION_MIN}"
[[ "${MATRIX_INSTALL_STEPS}" = *'pytest'* ]] && options+=' -DVSFTPD=NO' # Skip ~20 tests that stretch run time by 7x on macOS
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
${MATRIX_GENERATE} ${options}
done
if [ -d bld_chkprefill ] && ! diff -u bld/lib/curl_config.h bld_chkprefill/lib/curl_config.h; then
echo '::group::reference configure log'; cat bld_chkprefill/CMakeFiles/CMake*.yaml 2>/dev/null || true; echo '::endgroup::'
false
fi
else
export CFLAGS
if [[ "${MATRIX_COMPILER}" = 'llvm'* ]]; then
options+=" --target=$(uname -m)-apple-darwin"
fi
if [ "${MATRIX_COMPILER}" != 'clang' ]; then
options+=" --with-sysroot=${sysroot}"
CFLAGS+=" --sysroot=${sysroot}"
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
[[ "${MATRIX_INSTALL_STEPS}" = *'pytest'* ]] && options+=' --with-test-vsftpd=no' # Skip ~20 tests that stretch run time by 7x on macOS
mkdir bld && cd bld && ../configure --prefix="$PWD"/curl-install --enable-unity --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-libpsl="$(brew --prefix libpsl)" \
${MATRIX_CONFIGURE} ${options}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
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: 'test configs'
run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose
else
make -C bld V=1
fi
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
bld/src/curl --disable --version
- name: 'curl install'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --install bld --strip
else
make -C bld V=1 install
fi
- name: 'build tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target testdeps
else
make -C bld V=1 -C tests
fi
- name: 'install test prereqs'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
run: |
python3 -m venv ~/venv
if bld/src/curl --disable -V 2>/dev/null | grep smb; then
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/requirements.txt
fi
- name: 'run tests'
if: ${{ !contains(matrix.build.install_steps, 'skipall') && !contains(matrix.build.install_steps, 'skiprun') }}
timeout-minutes: ${{ contains(matrix.build.install_steps, 'torture') && 20 || 10 }}
env:
TEST_TARGET: ${{ contains(matrix.build.install_steps, 'torture') && 'test-torture' || 'test-ci' }}
TFLAGS: '${{ matrix.build.tflags }}'
run: |
TFLAGS="-j20 ${TFLAGS}"
if [ "${TEST_TARGET}" != 'test-ci' ]; then
TFLAGS+=' --buildinfo' # only test-ci sets this by default, set it manually for test-torture
fi
source ~/venv/bin/activate
if [[ "${MATRIX_INSTALL_STEPS}" = *'codeset-test'* ]]; then
locale || true
export LC_ALL=C
export LC_CTYPE=C
export LC_NUMERIC=fr_FR.UTF-8
fi
rm -f ~/.curlrc
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target "${TEST_TARGET}"
else
make -C bld V=1 "${TEST_TARGET}"
fi
- name: 'install pytest prereqs'
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
run: |
[ -d ~/venv ] || python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary -r tests/http/requirements.txt
- name: 'run pytest'
if: ${{ contains(matrix.build.install_steps, 'pytest') }}
env:
PYTEST_ADDOPTS: '--color=yes'
PYTEST_XDIST_AUTO_NUM_WORKERS: 4
run: |
source ~/venv/bin/activate
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target curl-pytest-ci
else
make -C bld V=1 pytest-ci
fi
- name: 'build examples'
if: ${{ contains(matrix.build.name, '+examples') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target curl-examples-build
else
make -C bld examples V=1
fi
combinations: # Test buildability with host OS, Xcode / SDK, compiler, target-OS, built tool, combinations
name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }}"
runs-on: ${{ matrix.image }}
timeout-minutes: 10
env:
DEVELOPER_DIR: "/Applications/Xcode${{ matrix.xcode && format('_{0}', matrix.xcode) || '' }}.app/Contents/Developer"
CC: '${{ matrix.compiler }}'
MATRIX_BUILD: '${{ matrix.build }}'
MATRIX_COMPILER: '${{ matrix.compiler }}'
MATRIX_IMAGE: '${{ matrix.image }}'
MATRIX_MACOS_VERSION_MIN: '${{ matrix.macos-version-min }}'
strategy:
fail-fast: false
matrix:
# Sources:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md
compiler: [gcc-13, gcc-14, gcc-15, llvm@15, llvm@18, llvm@20, clang]
# Xcode support matrix as of 2025-10, with default macOS SDK versions and OS names, years:
# * = default Xcode on the runner.
# macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4
# macos-15: 16.0, 16.1, 16.2, 16.3,*16.4, 26.0
# macos-26: 16.4 *26.0
# macOSSDK: 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1, 15.2, 15.4, 15.5, 26.0
# Sonoma (2023) Sequoia (2024) Tahoe (2025)
# https://github.com/actions/runner-images/tree/main/images/macos
# https://en.wikipedia.org/wiki/MacOS_version_history
image: [macos-14, macos-15, macos-26]
xcode: [''] # default Xcodes
macos-version-min: ['']
build: [autotools, cmake]
exclude:
# Combinations not covered by runner images:
- { image: macos-14, compiler: 'llvm@18' }
- { image: macos-14, compiler: 'llvm@20' }
- { image: macos-15, compiler: 'llvm@15' }
- { image: macos-15, compiler: 'llvm@20' }
- { image: macos-26, compiler: 'llvm@15' }
- { image: macos-26, compiler: 'llvm@18' }
# Covered by the main workflow
- { image: macos-15, compiler: 'gcc-13' }
- { image: macos-15, compiler: 'llvm@18' }
- { image: macos-15, compiler: 'clang' }
# Reduce build combinations, by dropping less interesting ones
- { image: macos-26, compiler: 'gcc-13' }
- { compiler: 'gcc-14' , build: cmake }
# Reduce autotools to just one job that is also build with cmake
- { compiler: 'gcc-13' , build: autotools }
- { compiler: 'gcc-14' , build: autotools }
- { compiler: 'gcc-15' , build: autotools }
- { compiler: 'llvm@15', build: autotools }
- { compiler: 'llvm@18', build: autotools }
- { compiler: 'llvm@20', build: autotools }
- { image: macos-14, build: autotools }
- { image: macos-15, build: autotools }
steps:
- name: 'install autotools'
if: ${{ matrix.build == 'autotools' }}
run: |
# shellcheck disable=SC2181
while [[ $? == 0 ]]; do
for i in 1 2 3; do
if brew update && brew install automake libtool; then
break 2
else
echo "Error: wait to try again: $i"
sleep 10
fi
done
false Too many retries
done
- name: 'toolchain versions'
run: |
[[ "${MATRIX_COMPILER}" = 'llvm'* ]] && CC="$(brew --prefix "${MATRIX_COMPILER}")/bin/clang"
[[ "${MATRIX_COMPILER}" = 'gcc'* ]] && "${CC}" --print-sysroot
command -v "${CC}"; "${CC}" --version || true
xcodebuild -version || true
xcrun --sdk macosx --show-sdk-path 2>/dev/null || true
xcrun --sdk macosx --show-sdk-version || true
ls -l /Library/Developer/CommandLineTools/SDKs || true
echo '::group::compiler defaults'; echo 'int main(void) {}' | "${CC}" -v -x c -; echo '::endgroup::'
echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)"/opt; echo '::endgroup::'
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build == 'autotools' }}
run: autoreconf -fi
- name: 'configure / ${{ matrix.build }}'
run: |
if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ]; then
# Ref: https://github.com/Homebrew/homebrew-core/issues/194778#issuecomment-2793243409
"$(brew --prefix gcc@13)"/libexec/gcc/aarch64-apple-darwin24/13/install-tools/mkheaders
fi
if [[ "${MATRIX_COMPILER}" = 'gcc'* ]]; then
sysroot="$("${CC}" --print-sysroot)" # Must match the SDK gcc was built for
else
sysroot="$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)"
fi
if [[ "${MATRIX_COMPILER}" = 'llvm'* ]]; then
CC="$(brew --prefix "${MATRIX_COMPILER}")/bin/clang"
CC+=" --sysroot=${sysroot}"
CC+=" --target=$(uname -m)-apple-darwin"
fi
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && options+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, and libssh2
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64e/')-apple-darwin$(uname -r)" \
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \
-DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF \
-DCURL_USE_OPENSSL=ON \
-DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \
-DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \
-DUSE_APPLE_IDN=ON -DUSE_APPLE_SECTRUST=ON \
${options}
else
export CFLAGS
if [[ "${MATRIX_COMPILER}" = 'llvm'* ]]; then
options+=" --target=$(uname -m)-apple-darwin"
fi
if [ "${MATRIX_COMPILER}" != 'clang' ]; then
options+=" --with-sysroot=${sysroot}"
CFLAGS+=" --sysroot=${sysroot}"
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, but libssh2 is disabled by default
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--disable-docs --disable-manual \
--with-openssl="$(brew --prefix openssl)" \
--without-nghttp2 --without-libidn2 \
--without-libpsl \
--with-apple-idn --with-apple-sectrust \
${options}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
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: 'build / ${{ matrix.build }}'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose
else
make -C bld V=1
fi
- name: 'curl -V'
run: |
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.dylib' -o -name '*.a' \) -print0 | xargs -0 stat -f '%10z bytes: %N' --
bld/src/curl --disable --version
+447
View File
@@ -0,0 +1,447 @@
# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
name: 'non-native'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
CURL_CI: github
CURL_TEST_MIN: 1820
DO_NOT_TRACK: '1'
jobs:
netbsd:
name: 'NetBSD, CM clang openssl ${{ matrix.arch }}'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
arch: ['x86_64']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455 # v1.0.0
env:
MATRIX_ARCH: '${{ matrix.arch }}'
with:
environment_variables: CURL_CI CURL_TEST_MIN DO_NOT_TRACK MATRIX_ARCH
operating_system: 'netbsd'
version: '10.1'
architecture: ${{ matrix.arch }}
run: |
# https://pkgsrc.se/
time sudo pkgin -y install cmake ninja-build pkg-config perl brotli mit-krb5 openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
time 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 \
-DCURL_ENABLE_NTLM=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'cmake'
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455 # v1.0.0
env:
MATRIX_ARCH: '${{ matrix.arch }}'
with:
environment_variables: CURL_CI CURL_TEST_MIN DO_NOT_TRACK 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 \
-DCURL_ENABLE_NTLM=ON \
|| { cat bld/CMakeFiles/CMake*.yaml; false; }
echo '::group::curl_config.h (raw)'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
echo '::group::curl_config.h'; grep -F '#define' bld/lib/curl_config.h | sort || true; echo '::endgroup::'
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: 15
strategy:
matrix:
include:
- { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
- { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF', desc: ' !unity !runtests !examples' }
- { build: 'autotools', arch: 'arm64' , compiler: 'clang', desc: ' !examples' }
- { build: 'cmake' , arch: 'arm64' , compiler: 'clang' }
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: '${{ matrix.build }}'
uses: cross-platform-actions/action@233156312992f3f169d8d0c633c21d12a5d30455 # v1.0.0
env:
CC: '${{ matrix.compiler }}'
MATRIX_ARCH: '${{ matrix.arch }}'
MATRIX_BUILD: '${{ matrix.build }}'
MATRIX_DESC: '${{ matrix.desc }}'
MATRIX_OPTIONS: '${{ matrix.options }}'
with:
environment_variables: CC CURL_CI CURL_TEST_MIN DO_NOT_TRACK MATRIX_ARCH MATRIX_BUILD MATRIX_DESC MATRIX_OPTIONS
operating_system: 'freebsd'
version: '14.3'
architecture: ${{ matrix.arch }}
run: |
export CURL_CI=github
# https://ports.freebsd.org/
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time sudo pkg install -y cmake-core ninja perl5 \
pkgconf brotli krb5-devel openldap26-client libidn2 libnghttp2 stunnel py311-impacket
else
time sudo pkg install -y autoconf automake libtool \
pkgconf brotli krb5-devel 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
options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU
fi
mkdir bld && cd bld
time ../configure --prefix="$HOME"/curl-install --enable-unity --enable-debug --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-openssl \
--with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \
${options} \
${MATRIX_OPTIONS} \
|| { tail -n 1000 config.log; false; }
cd ..
fi
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::'
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time cmake --build bld
time cmake --install bld
else
time make -C bld install
fi
bld/src/curl --disable --version
if [ "${MATRIX_ARCH}" = 'x86_64' ]; then # Slow on emulated CPU
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time cmake --build bld --target testdeps
else
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
if [ "${MATRIX_DESC#*!examples*}" = "${MATRIX_DESC}" ]; then
echo '::group::build examples'
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
time cmake --build bld --target curl-examples-build
else
time make -C bld examples
fi
echo '::endgroup::'
fi
android:
name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
strategy:
matrix:
include:
- { build: 'autotools', platform: '21', name: "!ssl !zstd",
options: '--without-ssl --without-libpsl --without-zstd' }
- { build: 'cmake' , platform: '21', name: "!ssl !zstd",
options: '-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF -DCURL_ZSTD=OFF' }
- { build: 'autotools', platform: '35', name: "!ssl !zstd",
options: '--without-ssl --without-libpsl --without-zstd' }
- { build: 'cmake' , platform: '35', name: "!ssl !zstd",
options: '-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF -DCURL_ZSTD=OFF' }
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build == 'autotools' }}
run: autoreconf -fi
- name: 'configure'
env:
MATRIX_OPTIONS: '${{ matrix.options }}'
MATRIX_PLATFORM: '${{ matrix.platform }}'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then # https://developer.android.com/ndk/guides/cmake
cmake -B bld -G Ninja \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM="android-${MATRIX_PLATFORM}" \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" -DCMAKE_WARN_DEPRECATED=OFF \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
${MATRIX_OPTIONS}
else
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \
AR="$TOOLCHAIN/bin/llvm-ar" \
RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
--host="aarch64-linux-android${MATRIX_PLATFORM}" \
${MATRIX_OPTIONS}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose
else
make -C bld V=1
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
msdos:
name: "MS-DOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} djgpp !ssl i586"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
# renovate: datasource=github-releases depName=andrewwutw/build-djgpp versioning=semver-coerced registryUrl=https://github.com
TOOLCHAIN_VERSION: 3.4
TOOLCHAIN_SHA256: 8464f17017d6ab1b2bb2df4ed82357b5bf692e6e2b7fee37e315638f3d505f00
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'install packages'
timeout-minutes: 2
run: |
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 libfl2
- name: 'cache compiler (djgpp)'
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-compiler
with:
path: ~/djgpp
key: ${{ runner.os }}-djgpp-${{ env.TOOLCHAIN_VERSION }}-amd64
- name: 'install compiler (djgpp)'
if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
--location "https://github.com/andrewwutw/build-djgpp/releases/download/v${TOOLCHAIN_VERSION}/djgpp-linux64-gcc1220.tar.bz2" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${TOOLCHAIN_SHA256}" && tar -xjf pkg.bin && rm -f pkg.bin
cd djgpp
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/wat3211b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF faa2222ab5deb2c2aac229c760bf4d45aca5379f5af97865c308a0467046b67a && unzip -q pkg.bin && rm -f pkg.bin
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/zlb13b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF f3d2fa8129e7591c7e79074306d8ab91a70ec172cc01baedeae74992285dd3a3 && unzip -q pkg.bin && rm -f pkg.bin
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=DOS \
-DCMAKE_SYSTEM_PROCESSOR=x86 \
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
-DCMAKE_C_COMPILER="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF \
-DZLIB_INCLUDE_DIR="$HOME"/djgpp/include \
-DZLIB_LIBRARY="$HOME"/djgpp/lib/libz.a \
-DWATT_ROOT="$HOME"/djgpp/net/watt
else
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
AR="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ar \
RANLIB="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
WATT_ROOT="$HOME"/djgpp/net/watt \
--host=i586-pc-msdosdjgpp \
--without-ssl --without-libpsl \
--with-zlib="$HOME"/djgpp
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 file --
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
File diff suppressed because it is too large Load Diff
+74
View File
@@ -0,0 +1,74 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
*.asc
*.dll
*.exe
*.exp
*.la
*.lib
*.a
*.res
*.lo
*.o
*.obj
*.pdb
*.pyc
*.orig
*.rej
*~
.*.sw?
.cproject
.deps
.dirstamp
.libs
.project
.settings
/.vs
/bld/
/build/
/stats/
__pycache__
Debug
INSTALL
Makefile
Makefile.in
Release
TAGS
aclocal.m4
aclocal.m4.bak
autom4te.cache
buildinfo.txt
ca-bundle.crt
certdata.txt
compile
config.cache
config.guess
config.log
config.status
config.sub
configure
curl-*.tar.bz2
curl-*.tar.gz
curl-*.tar.xz
curl-*.zip
curl-config
depcomp
install-sh
libcurl.pc
libtool
ltmain.sh
missing
mkinstalldirs
tags
test-driver
stamp-h*
scripts/_curl
scripts/curl.fish
curl_fuzzer
curl_fuzzer_seed_corpus.zip
libstandaloneengine.a
tests/string
tests/config
tests/ech-log/
+124
View File
@@ -0,0 +1,124 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
Guenter Knauf <lists@gknw.net> <gk@gknw.de>
Gisle Vanem <gvanem@yahoo.no> <gisle.vanem@gmail.com>
Gisle Vanem <gvanem@yahoo.no> <gvanem@broadpark.no>
Alessandro Ghedini <alessandro@ghedini.me> <alessandro@cloudflare.com>
Alessandro Ghedini <alessandro@ghedini.me> <al3xbio@gmail.com>
Björn Stenberg <bjorn@haxx.se>
Björn Stenberg <bjorn@haxx.se> <bjst@bjorn>
Viktor Szakats <commit@vsz.me> <commit@vszakats.net>
Viktor Szakats <commit@vsz.me> <vszakats@users.noreply.github.com>
Daniel Gustafsson <daniel@yesql.se> <dgustafsson@pivotal.io>
Daniel Gustafsson <daniel@yesql.se> <daniel@hobbit.se>
Linus Nielsen <linus@haxx.se>
Yamada Yasuharu <yasuharu.yamada@access-company.com>
Ulion <ulion2002@gmail.com>
Tim Rühsen <tim.ruehsen@gmx.de>
Steve Holme <steve_holme@hotmail.com> <steven.holme@cubic.com>
Claes Jakobsson <claes@surfar.nu> <claes@versed.se>
Sergei Nikulov <sergey.nikulov@gmail.com> <snikulov@users.noreply.github.com>
Patrick Monnerat <patrick@monnerat.net> <Patrick.Monnerat@datasphere.ch>
Patrick Monnerat <patrick@monnerat.net> <patrick.monnerat@dh.com>
Patrick Monnerat <patrick@monnerat.net> <pm@datasphere.ch>
Patrick Monnerat <patrick@monnerat.net> <monnerat@users.noreply.github.com>
Nick Zitzmann <nickzman@gmail.com> <nick@chronosnet.com>
Peter Wu <peter@lekensteyn.nl> <peter_at_lekensteyn.nl>
David Woodhouse <David.Woodhouse@intel.com> <dwmw2@infradead.org>
Marcel Raad <Marcel.Raad@teamviewer.com> <raad@teamviewer.com>
Marcel Raad <Marcel.Raad@teamviewer.com> <MarcelRaad@users.noreply.github.com>
Marcel Raad <Marcel.Raad@teamviewer.com> <marcelraad@users.sf.net>
Anthony Bryan <anthonybryan@gmail.com> <ant@localhost.localdomain>
Travis Burtrum <admin@moparisthebest.com>
Dmitry Kostjuchenko <dmitrykos@neutroncode.com>
Richard Alcock <richard.alcock@gmail.com>
Richard Alcock <richard.alcock@gmail.com> <richard.alcock@mathworks.co.uk>
Jan Ehrhardt <github@ehrhardt.nl>
Florin Petriuc <petriuc.florin@gmail.com> <pfl@northq.com>
Pavel Pavlov <pavlov.pavel@gmail.com>
Jason Juang <jasjuang@gmail.com>
Carlo Teubner <carlo.teubner@gmail.com>
Joel Depooter <joel.depooter@safe.com>
Sebastian Mundry <mundry@outlook.com>
Rainer Canavan <rainer.canavan@sevenval.com> <canavan@users.noreply.github.com>
Dan Fandrich <dan@coneharvesters.com>
Henrik S. Gaßmann <henrik@gassmann.onl>
Jiří Malák <malak.jiri@gmail.com>
Nick Zitzmann <nickzman@gmail.com>
Kees Dekker <kees.dekker@infor.com>
Max Savenkov <max.savenkov@gmail.com>
Daniel Jelinski <daniel.jelinski@thomsonreuters.com> <30433125+djelinski@users.noreply.github.com>
Amit Katyal <amkatyal@cisco.com>
Giorgos Oikonomou <giorgos.n.oikonomou@gmail.com>
Evgeny Grin (Karlson2k) <k2k@narod.ru> <k2k@yandex.ru>
Evgeny Grin (Karlson2k) <k2k@narod.ru>
Peter Pih <railsnewbie257@gmail.com>
Anton Malov <malov.anton@gmail.com>
Marquis de Muesli <marquis.de.muesli@gmail.com>
Kyohei Kadota <lufia@lufia.org>
Lucas Pardue <lucaspardue.24.7@gmail.com> <lucas@cloudflare.com>
Massimiliano Fantuzzi <superfantuz@gmail.com>
Niall O'Reilly <Niall.oReilly@ucd.ie>
Mohammad Hasbini <mohammad.hasbini@gmail.com>
Andrew Ishchuk <andrew_ishchuk@office.targem.ru>
Nicolas Guillier <59726521+nicoguillier@users.noreply.github.com>
Julian Z <julianz@example.com> <jzinn@users.noreply.github.com>
Jessa Chandler <jessachandler@gmail.com>
Gökhan Şengün <gsengun@linux-5d7d.site> <gokhansengun@gmai.com>
Svyatoslav Mishyn <juef@openmailbox.org>
Douglas Steinwand <dzs-curl@dzs.fx.org>
James Fuller <jim@webcomposite.com> <jfuller@redhat.com>
James Fuller <jim@webcomposite.com> Jim Fuller <jim@webcomposite.com>
Don J Olmstead <don.j.olmstead@gmail.com>
Nicolas Sterchele <sterchelen@gmail.com>
Sergey Raevskiy <ccik@inbox.ru>
SecuritySense on github <si@securitysense.co.uk>
Mipsters on github <tomaviv57@gmail.com>
Pavel Novikov <paul.skeptic@yandex.ru>
apique13 on github <apique@PC42.isdom.isoft.fr>
Daniel Hwang <danielleehwang@gmail.com>
Jon Rumsey <jrumsey@uk.ibm.com>
Tobias Nyholm <tobias.nyholm@gmail.com>
Timur Artikov <t.artikov@2gis.ru>
Michał Antoniak <47522782+MAntoniak@users.noreply.github.com>
Gleb Ivanovsky <gl.ivanovsky@gmail.com>
Max Dymond <max.dymond@microsoft.com> <max.dymond@metaswitch.com>
Max Dymond <max.dymond@microsoft.com> <cmeister2@gmail.com>
Abhinav Singh <theawless@gmail.com>
Malik Idrees Hasan Khan <77000356+MalikIdreesHasanKhan@users.noreply.github.com>
Yongkang Huang <hyk68691@hotmail.com>
Xiaoke Wang <xkernel.wang@foxmail.com>
Philip H <47042125+pheiduck@users.noreply.github.com>
neutric on github <5984479+neutric@users.noreply.github.com>
Jan-Piet Mens <jp@mens.de>
Henrik Holst <henrik.holst@millistream.com>
Christian Schmitz <support@monkeybreadsoftware.de>
Max Mehl <max.mehl@fsfe.org>
rzrymiak on github <106121613+rzrymiak@users.noreply.github.com>
Oliver Roberts <oliver@futaura.co.uk>
opensignature on github <antonio@piumarossa.it>
Cering on github <gfypm@qq.com>
a1346054 on github <36859588+a1346054@users.noreply.github.com>
zhanghu on xiaomi <zhanghu6@xiaomi.com>
Philip Heiduck <pheiduck@Philips-MBP.lan> <47042125+pheiduck@users.noreply.github.com>
bsergean on github <bsergean@gmail.com>
Stefan Eissing <stefan@eissing.org> <stefan.eissing@greenbytes.de>
Michael Musset <mickamusset@gmail.com>
Andy Alt <arch_stanton5995@protonmail.com>
Thomas1664 on github <46387399+Thomas1664@users.noreply.github.com>
dengjfzh on github <dengjfzh@gmail.com>
Brad Harder <brad.harder@gmail.com>
Derzsi Dániel <daniel@tohka.us>
Michael Osipov <michael.osipov@siemens.com> <1983-01-06@gmx.net>
Michael Osipov <michael.osipov@siemens.com> <michael-o@users.sf.net>
Christian Weisgerber <naddy@mips.inka.de> <curl-library@lists.haxx.se>
Moritz Buhl <git@moritzbuhl.de>
Aki Sakurai <75532970+AkiSakurai@users.noreply.github.com>
Sinkevich Artem <artsin666@gmail.com>
Andrew Kirillov <akirillo@uk.ibm.com>
Stephen Farrell <stephen.farrell@cs.tcd.ie>
Calvin Ruocco <calvin.ruocco@vector.com>
Hamza Bensliman <benslimanhamza99@gmail.com>
Kaixuan Li <kaixuan.li@ntu.edu.sg>
+12
View File
@@ -0,0 +1,12 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
In a release tarball, check the RELEASE-NOTES file for what was done in the
most recent release. In a git check-out, that file mentions changes that have
been done since the previous release.
See the online [changelog](https://curl.se/changes.html) for the edited and
human readable version of what has changed in different curl releases.
+68
View File
@@ -0,0 +1,68 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
if(WIN32 AND ENABLE_DEBUG)
# We need to export internal debug functions,
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
# so disable symbol hiding for debug builds and for memory tracking.
set(CURL_HIDDEN_SYMBOLS OFF)
elseif(DOS OR AMIGA)
set(CURL_HIDDEN_SYMBOLS OFF)
endif()
set(CURL_HIDES_PRIVATE_SYMBOLS FALSE)
set(CURL_EXTERN_SYMBOL "")
set(CURL_CFLAG_SYMBOLS_HIDE "")
if(CURL_HIDDEN_SYMBOLS)
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.4)
# Note: This is considered buggy prior to 4.0 but the autotools do not care, so let us ignore that fact
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__global")
set(CURL_CFLAG_SYMBOLS_HIDE "-xldscope=hidden")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0) # Requires 9.1.045
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
elseif(MSVC)
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
endif()
else()
if(MSVC)
# Note: This option is prone to export non-curl extra symbols.
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif()
endif()
+401
View File
@@ -0,0 +1,401 @@
/***************************************************************************
* _ _ ____ _
* 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
*
***************************************************************************/
#ifdef HAVE_FCNTL_O_NONBLOCK
/* headers for FCNTL_O_NONBLOCK test */
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#if defined(sun) || defined(__sun__) || \
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__)
# define PLATFORM_SOLARIS
# else
# define PLATFORM_SUNOS4
# endif
#endif
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
# define PLATFORM_AIX_V3
#endif
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
#error "O_NONBLOCK does not work on this platform"
#endif
int main(void)
{
/* O_NONBLOCK source test */
int flags = 0;
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
return 1;
return 0;
}
#endif
/* tests for gethostbyname_r */
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_5) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_6) || \
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
#include <sys/types.h>
#include <netdb.h>
int main(void)
{
const char *address = "example.com";
struct hostent h;
int rc = 0;
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
struct hostent_data hdata;
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \
defined(HAVE_GETHOSTBYNAME_R_6) || \
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
char buffer[8192];
struct hostent *hp;
int h_errnop;
#endif
#if defined(HAVE_GETHOSTBYNAME_R_3) || \
defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT)
rc = gethostbyname_r(address, &h, &hdata);
(void)hdata;
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop);
(void)hp;
(void)h_errnop;
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
rc = gethostbyname_r(address, &h, buffer, 8192, &hp, &h_errnop);
(void)hp;
(void)h_errnop;
#endif
(void)h;
(void)rc;
return 0;
}
#endif
#ifdef HAVE_BOOL_T
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif
int main(void)
{
return (int)sizeof(bool *);
}
#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
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We cannot define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int main(void)
{
(void)off_t_is_large;
return 0;
}
#endif
#ifdef HAVE_IOCTLSOCKET
#ifdef _WIN32
# include <winsock2.h>
#endif
int main(void)
{
/* ioctlsocket source code */
int socket = -1;
unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
(void)flags;
return 0;
}
#endif
#ifdef HAVE_IOCTLSOCKET_CAMEL
#include <proto/bsdsocket.h>
int main(void)
{
/* IoctlSocket source code */
if(0 != IoctlSocket(0, 0, 0))
return 1;
return 0;
}
#endif
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
#include <proto/bsdsocket.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
int main(void)
{
/* IoctlSocket source code */
long flags = 0;
if(0 != IoctlSocket(0, FIONBIO, &flags))
return 1;
(void)flags;
return 0;
}
#endif
#ifdef HAVE_IOCTLSOCKET_FIONBIO
#ifdef _WIN32
# include <winsock2.h>
#endif
int main(void)
{
unsigned long flags = 0;
if(0 != ioctlsocket(0, FIONBIO, &flags))
return 1;
(void)flags;
return 0;
}
#endif
#ifdef HAVE_IOCTL_FIONBIO
/* headers for FIONBIO test */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef _WIN32
# include <sys/socket.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_STROPTS_H
# include <stropts.h>
#endif
int main(void)
{
int flags = 0;
if(0 != ioctl(0, FIONBIO, &flags))
return 1;
(void)flags;
return 0;
}
#endif
#ifdef HAVE_IOCTL_SIOCGIFADDR
/* headers for FIONBIO test */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef _WIN32
# include <sys/socket.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_STROPTS_H
# include <stropts.h>
#endif
#include <net/if.h>
int main(void)
{
struct ifreq ifr;
if(0 != ioctl(0, SIOCGIFADDR, &ifr))
return 1;
(void)ifr;
return 0;
}
#endif
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
#ifdef _WIN32
# include <winsock2.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifndef _WIN32
# include <sys/socket.h>
#endif
int main(void)
{
if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
return 1;
return 0;
}
#endif
#ifdef HAVE_GLIBC_STRERROR_R
#include <string.h>
#include <errno.h>
static void check(char c)
{
(void)c;
}
int main(void)
{
char buffer[1024];
/* This will not compile if strerror_r does not return a char* */
/* !checksrc! disable ERRNOVAR 1 */
check(strerror_r(EACCES, buffer, sizeof(buffer))[0]);
return 0;
}
#endif
#ifdef HAVE_POSIX_STRERROR_R
#include <string.h>
#include <errno.h>
/* Float, because a pointer cannot be implicitly cast to float */
static void check(float f)
{
(void)f;
}
int main(void)
{
char buffer[1024];
/* This will not compile if strerror_r does not return an int */
/* !checksrc! disable ERRNOVAR 1 */
check(strerror_r(EACCES, buffer, sizeof(buffer)));
return 0;
}
#endif
#ifdef HAVE_FSETXATTR_6
#include <sys/xattr.h> /* header from libc, not from libattr */
int main(void)
{
fsetxattr(0, 0, 0, 0, 0, 0);
return 0;
}
#endif
#ifdef HAVE_FSETXATTR_5
#include <sys/xattr.h> /* header from libc, not from libattr */
int main(void)
{
fsetxattr(0, "", 0, 0, 0);
return 0;
}
#endif
#ifdef HAVE_CLOCK_GETTIME_MONOTONIC
#include <time.h>
int main(void)
{
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
(void)ts;
return 0;
}
#endif
#ifdef HAVE_BUILTIN_AVAILABLE
int main(void)
{
if(__builtin_available(macOS 10.12, iOS 5.0, *)) {}
return 0;
}
#endif
#ifdef HAVE_ATOMIC
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_STDATOMIC_H
# include <stdatomic.h>
#endif
int main(void)
{
_Atomic int i = 1;
i = 0; /* Force an atomic-write operation. */
return i;
}
#endif
#ifdef HAVE_WIN32_WINNT
#ifdef _WIN32
# ifndef NOGDI
# define NOGDI
# endif
# include <windows.h>
#endif
#define enquote(x) #x
#define expand(x) enquote(x)
#pragma message("_WIN32_WINNT=" expand(_WIN32_WINNT))
int main(void)
{
return 0;
}
#endif
#ifdef MINGW64_VERSION
#ifdef __MINGW32__
# include <_mingw.h>
#endif
#define enquote(x) #x
#define expand(x) enquote(x)
#pragma message("MINGW64_VERSION=" \
expand(__MINGW64_VERSION_MAJOR) "." \
expand(__MINGW64_VERSION_MINOR))
int main(void)
{
return 0;
}
#endif
+96
View File
@@ -0,0 +1,96 @@
#***************************************************************************
# _ _ ____ _
# 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 brotli library
#
# Input variables:
#
# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory.
# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library.
# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library.
# - `BROTLI_USE_STATIC_LIBS`: Configure for static brotli libraries.
#
# Defines:
#
# - `BROTLI_FOUND`: System has brotli.
# - `BROTLI_VERSION`: Version of brotli.
# - `CURL::brotli`: brotli library target.
set(_brotli_pc_requires "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
if(CURL_USE_PKGCONFIG AND
NOT DEFINED BROTLI_INCLUDE_DIR AND
NOT DEFINED BROTLICOMMON_LIBRARY AND
NOT DEFINED BROTLIDEC_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_brotli ${_brotli_pc_requires})
endif()
if(_brotli_FOUND)
set(Brotli_FOUND TRUE)
set(BROTLI_FOUND TRUE)
set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION})
if(BROTLI_USE_STATIC_LIBS)
set(_brotli_CFLAGS "${_brotli_STATIC_CFLAGS}")
set(_brotli_INCLUDE_DIRS "${_brotli_STATIC_INCLUDE_DIRS}")
set(_brotli_LIBRARY_DIRS "${_brotli_STATIC_LIBRARY_DIRS}")
set(_brotli_LIBRARIES "${_brotli_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
else()
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
if(BROTLI_USE_STATIC_LIBS)
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon-static" "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec-static" "brotlidec")
else()
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Brotli
REQUIRED_VARS
BROTLI_INCLUDE_DIR
BROTLIDEC_LIBRARY
BROTLICOMMON_LIBRARY
)
if(BROTLI_FOUND)
set(_brotli_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
set(_brotli_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
endif()
mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY)
endif()
if(BROTLI_FOUND)
if(NOT TARGET CURL::brotli)
add_library(CURL::brotli INTERFACE IMPORTED)
set_target_properties(CURL::brotli PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_brotli_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_brotli_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_brotli_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_brotli_LIBRARIES}")
endif()
endif()
+132
View File
@@ -0,0 +1,132 @@
#***************************************************************************
# _ _ ____ _
# 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 c-ares library
#
# Input variables:
#
# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory.
# - `CARES_LIBRARY`: Absolute path to `cares` library.
# - `CARES_USE_STATIC_LIBS`: Configure for static c-ares libraries.
#
# Defines:
#
# - `CARES_FOUND`: System has c-ares.
# - `CARES_VERSION`: Version of c-ares.
# - `CURL::cares`: c-ares library target.
set(_cares_pc_requires "libcares")
if(NOT DEFINED CARES_INCLUDE_DIR AND
NOT DEFINED CARES_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_cares ${_cares_pc_requires})
endif()
if(NOT _cares_FOUND AND CURL_USE_CMAKECONFIG)
find_package(c-ares CONFIG QUIET)
endif()
endif()
if(_cares_FOUND)
set(Cares_FOUND TRUE)
set(CARES_FOUND TRUE)
set(CARES_VERSION ${_cares_VERSION})
if(CARES_USE_STATIC_LIBS)
set(_cares_CFLAGS "${_cares_STATIC_CFLAGS}")
set(_cares_INCLUDE_DIRS "${_cares_STATIC_INCLUDE_DIRS}")
set(_cares_LIBRARY_DIRS "${_cares_STATIC_LIBRARY_DIRS}")
set(_cares_LIBRARIES "${_cares_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
elseif(c-ares_CONFIG)
set(Cares_FOUND TRUE)
set(CARES_FOUND TRUE)
set(CARES_VERSION ${c-ares_VERSION})
if(CARES_USE_STATIC_LIBS)
set(_cares_LIBRARIES c-ares::cares_static)
else()
set(_cares_LIBRARIES c-ares::cares)
endif()
message(STATUS "Found Cares (via CMake Config): ${c-ares_CONFIG} (found version \"${CARES_VERSION}\")")
else()
find_path(CARES_INCLUDE_DIR NAMES "ares.h")
if(CARES_USE_STATIC_LIBS)
set(_cares_CFLAGS "-DCARES_STATICLIB")
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares_static" "cares")
else()
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
endif()
unset(CARES_VERSION CACHE)
if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")
set(_version_regex1 "#[\t ]*define[\t ]+ARES_VERSION_MAJOR[\t ]+([0-9]+).*")
set(_version_regex2 "#[\t ]*define[\t ]+ARES_VERSION_MINOR[\t ]+([0-9]+).*")
set(_version_regex3 "#[\t ]*define[\t ]+ARES_VERSION_PATCH[\t ]+([0-9]+).*")
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str1 REGEX "${_version_regex1}")
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str2 REGEX "${_version_regex2}")
file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str3 REGEX "${_version_regex3}")
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
set(CARES_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
unset(_version_regex1)
unset(_version_regex2)
unset(_version_regex3)
unset(_version_str1)
unset(_version_str2)
unset(_version_str3)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Cares
REQUIRED_VARS
CARES_INCLUDE_DIR
CARES_LIBRARY
VERSION_VAR
CARES_VERSION
)
if(CARES_FOUND)
set(_cares_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
set(_cares_LIBRARIES ${CARES_LIBRARY})
endif()
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
endif()
if(CARES_FOUND)
if(WIN32)
list(APPEND _cares_LIBRARIES "iphlpapi") # for if_indextoname and others
endif()
if(NOT TARGET CURL::cares)
add_library(CURL::cares INTERFACE IMPORTED)
set_target_properties(CURL::cares PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_cares_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_cares_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_cares_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_cares_LIBRARIES}")
endif()
endif()
+271
View File
@@ -0,0 +1,271 @@
#***************************************************************************
# _ _ ____ _
# 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 GSS Kerberos library
#
# Input variables:
#
# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment)
#
# Defines:
#
# - `GSS_FOUND`: System has a GSS library.
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
# In case the library is found but no version info available it is set to "unknown"
# - `CURL::gss`: GSS library target.
# - `CURL_GSS_FLAVOUR`: Custom property. "GNU" or "MIT" if detected.
set(_gnu_modname "gss")
set(_mit_modname "mit-krb5-gssapi")
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckTypeSize)
set(_gss_root_hints "${GSS_ROOT_DIR}" "$ENV{GSS_ROOT_DIR}")
set(_gss_CFLAGS "")
set(_gss_LIBRARY_DIRS "")
# 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}")
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_search_module(_gss ${_gnu_modname} ${_mit_modname})
list(APPEND _gss_root_hints "${_gss_PREFIX}")
set(_gss_version "${_gss_VERSION}")
endif()
if(WIN32)
list(APPEND _gss_root_hints "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos;InstallDir]")
endif()
endif()
if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional approach.
find_file(_gss_configure_script NAMES "krb5-config" PATH_SUFFIXES "bin" HINTS ${_gss_root_hints}
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
# If not found in user-supplied directories, maybe system knows better
find_file(_gss_configure_script NAMES "krb5-config" PATH_SUFFIXES "bin")
if(_gss_configure_script)
set(_gss_INCLUDE_DIRS "")
set(_gss_LIBRARIES "")
execute_process(COMMAND ${_gss_configure_script} "--cflags" "gssapi"
OUTPUT_VARIABLE _gss_cflags_raw
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "FindGSS krb5-config --cflags: ${_gss_cflags_raw}")
if(NOT _gss_configure_failed) # 0 means success
# Should also work in an odd case when multiple directories are given.
string(STRIP "${_gss_cflags_raw}" _gss_cflags_raw)
string(REGEX REPLACE " +-(I)" ";-\\1" _gss_cflags_raw "${_gss_cflags_raw}")
string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1" _gss_cflags_raw "${_gss_cflags_raw}")
foreach(_flag IN LISTS _gss_cflags_raw)
if(_flag MATCHES "^-I")
string(REGEX REPLACE "^-I" "" _flag "${_flag}")
list(APPEND _gss_INCLUDE_DIRS "${_flag}")
else()
list(APPEND _gss_CFLAGS "${_flag}")
endif()
endforeach()
endif()
execute_process(COMMAND ${_gss_configure_script} "--libs" "gssapi"
OUTPUT_VARIABLE _gss_lib_flags
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "FindGSS krb5-config --libs: ${_gss_lib_flags}")
if(NOT _gss_configure_failed) # 0 means success
# This script gives us libraries and link directories.
string(STRIP "${_gss_lib_flags}" _gss_lib_flags)
string(REGEX REPLACE " +-(L|l)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}")
string(REGEX REPLACE " +-([^Ll][^ \\t;]*)" ";-\\1" _gss_lib_flags "${_gss_lib_flags}")
foreach(_flag IN LISTS _gss_lib_flags)
if(_flag MATCHES "^-l")
string(REGEX REPLACE "^-l" "" _flag "${_flag}")
list(APPEND _gss_LIBRARIES "${_flag}")
elseif(_flag MATCHES "^-L")
string(REGEX REPLACE "^-L" "" _flag "${_flag}")
list(APPEND _gss_LIBRARY_DIRS "${_flag}")
endif()
endforeach()
endif()
execute_process(COMMAND ${_gss_configure_script} "--version"
OUTPUT_VARIABLE _gss_version
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Older versions may not have the "--version" parameter. In this case we just do not care.
if(_gss_configure_failed)
set(_gss_version 0)
else()
# Strip prefix string to leave the version number only
string(REPLACE "Kerberos 5 release " "" _gss_version "${_gss_version}")
endif()
execute_process(COMMAND ${_gss_configure_script} "--vendor"
OUTPUT_VARIABLE _gss_vendor
RESULT_VARIABLE _gss_configure_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Older versions may not have the "--vendor" parameter. In this case we just do not care.
if(NOT _gss_configure_failed AND NOT _gss_vendor MATCHES "Heimdal|heimdal")
set(_gss_flavour "MIT") # assume a default, should not really matter
endif()
else() # Either there is no config script or we are on a platform that does not provide one (Windows?)
find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h" HINTS ${_gss_root_hints} PATH_SUFFIXES "include" "inc")
if(_gss_INCLUDE_DIRS) # We have found something
set(_gss_libdir_suffixes "")
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES "${_gss_INCLUDE_DIRS}")
check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers)
cmake_pop_check_state()
if(_gss_have_mit_headers)
set(_gss_flavour "MIT")
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _gss_libdir_suffixes "lib/AMD64")
set(_gss_libname "gssapi64")
else()
list(APPEND _gss_libdir_suffixes "lib/i386")
set(_gss_libname "gssapi32")
endif()
else()
list(APPEND _gss_libdir_suffixes "lib" "lib64") # those suffixes are not checked for HINTS
set(_gss_libname "gssapi_krb5")
endif()
endif()
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 ${_gnu_modname})
set(_gss_libname "gss")
endif()
endif()
# If we have headers, look up libraries
if(_gss_flavour)
set(_gss_libdir_hints ${_gss_root_hints})
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(GET _gss_INCLUDE_DIRS PARENT_PATH _gss_calculated_potential_root)
else()
get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY)
endif()
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()
if(NOT _gss_flavour)
message(FATAL_ERROR "GNU or MIT GSS is required")
endif()
else()
# _gss_MODULE_NAME set since CMake 3.16.
# _pkg_check_modules_pkg_name is undocumented and used as a fallback for CMake <3.16 versions.
if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _pkg_check_modules_pkg_name STREQUAL _gnu_modname)
set(_gss_flavour "GNU")
set(_gss_pc_requires ${_gnu_modname})
elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _pkg_check_modules_pkg_name STREQUAL _mit_modname)
set(_gss_flavour "MIT")
set(_gss_pc_requires ${_mit_modname})
else()
message(FATAL_ERROR "GNU or MIT GSS is required")
endif()
message(STATUS "Found GSS/${_gss_flavour} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")")
endif()
set(GSS_VERSION ${_gss_version})
if(NOT GSS_VERSION)
if(_gss_flavour STREQUAL "MIT")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
cmake_host_system_information(RESULT _mit_version QUERY WINDOWS_REGISTRY
"HKLM/SOFTWARE/MIT/Kerberos/SDK/CurrentVersion" VALUE "VersionString")
else()
get_filename_component(_mit_version
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE)
endif()
if(WIN32 AND _mit_version)
set(GSS_VERSION "${_mit_version}")
else()
set(GSS_VERSION "MIT Unknown")
endif()
else() # GNU
if(_gss_INCLUDE_DIRS AND EXISTS "${_gss_INCLUDE_DIRS}/gss.h")
set(_version_regex "#[\t ]*define[\t ]+GSS_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${_gss_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(GSS_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GSS
REQUIRED_VARS
_gss_flavour
_gss_LIBRARIES
VERSION_VAR
GSS_VERSION
FAIL_MESSAGE
"Could NOT find GSS, try to set the absolute path to GSS installation root directory in the environment variable GSS_ROOT_DIR"
)
mark_as_advanced(
_gss_CFLAGS
_gss_FOUND
_gss_INCLUDE_DIRS
_gss_LIBRARIES
_gss_LIBRARY_DIRS
_gss_MODULE_NAME
_gss_PREFIX
_gss_version
)
if(GSS_FOUND)
if(NOT TARGET CURL::gss)
add_library(CURL::gss INTERFACE IMPORTED)
set_target_properties(CURL::gss PROPERTIES
INTERFACE_CURL_GSS_FLAVOUR "${_gss_flavour}"
INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_gss_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_gss_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_gss_LIBRARIES}")
endif()
endif()
+92
View File
@@ -0,0 +1,92 @@
#***************************************************************************
# _ _ ____ _
# 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()
+115
View File
@@ -0,0 +1,115 @@
#***************************************************************************
# _ _ ____ _
# 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 ldap library
#
# Input variables:
#
# - `LDAP_INCLUDE_DIR`: Absolute path to ldap include directory.
# - `LDAP_LIBRARY`: Absolute path to `ldap` library.
# - `LDAP_LBER_LIBRARY`: Absolute path to `lber` library.
#
# Defines:
#
# - `LDAP_FOUND`: System has ldap.
# - `LDAP_VERSION`: Version of ldap.
# - `CURL::ldap`: ldap library target.
set(_ldap_pc_requires "ldap" "lber")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LDAP_INCLUDE_DIR AND
NOT DEFINED LDAP_LIBRARY AND
NOT DEFINED LDAP_LBER_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_ldap ${_ldap_pc_requires})
endif()
if(_ldap_FOUND)
set(LDAP_FOUND TRUE)
set(LDAP_VERSION ${_ldap_ldap_VERSION})
message(STATUS "Found LDAP (via pkg-config): ${_ldap_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")")
else()
set(_ldap_pc_requires "") # Depend on pkg-config only when found via pkg-config
# On Apple the SDK LDAP gets picked up from
# 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains
# ldap.h and lber.h both being stubs to include <ldap.h> and <lber.h>.
# This causes an infinite inclusion loop in compile. Also do this for libraries
# to avoid picking up the 'ldap.framework' with a full path.
set(_save_cmake_system_framework_path ${CMAKE_SYSTEM_FRAMEWORK_PATH})
set(CMAKE_SYSTEM_FRAMEWORK_PATH "")
find_path(LDAP_INCLUDE_DIR NAMES "ldap.h")
find_library(LDAP_LIBRARY NAMES "ldap")
find_library(LDAP_LBER_LIBRARY NAMES "lber")
set(CMAKE_SYSTEM_FRAMEWORK_PATH ${_save_cmake_system_framework_path})
unset(LDAP_VERSION CACHE)
if(LDAP_INCLUDE_DIR AND EXISTS "${LDAP_INCLUDE_DIR}/ldap_features.h")
set(_version_regex1 "#[\t ]*define[\t ]+LDAP_VENDOR_VERSION_MAJOR[\t ]+([0-9]+).*")
set(_version_regex2 "#[\t ]*define[\t ]+LDAP_VENDOR_VERSION_MINOR[\t ]+([0-9]+).*")
set(_version_regex3 "#[\t ]*define[\t ]+LDAP_VENDOR_VERSION_PATCH[\t ]+([0-9]+).*")
file(STRINGS "${LDAP_INCLUDE_DIR}/ldap_features.h" _version_str1 REGEX "${_version_regex1}")
file(STRINGS "${LDAP_INCLUDE_DIR}/ldap_features.h" _version_str2 REGEX "${_version_regex2}")
file(STRINGS "${LDAP_INCLUDE_DIR}/ldap_features.h" _version_str3 REGEX "${_version_regex3}")
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
set(LDAP_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
unset(_version_regex1)
unset(_version_regex2)
unset(_version_regex3)
unset(_version_str1)
unset(_version_str2)
unset(_version_str3)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LDAP
REQUIRED_VARS
LDAP_INCLUDE_DIR
LDAP_LIBRARY
LDAP_LBER_LIBRARY
VERSION_VAR
LDAP_VERSION
)
if(LDAP_FOUND)
set(_ldap_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
set(_ldap_LIBRARIES ${LDAP_LIBRARY} ${LDAP_LBER_LIBRARY})
endif()
mark_as_advanced(LDAP_INCLUDE_DIR LDAP_LIBRARY LDAP_LBER_LIBRARY)
endif()
if(LDAP_FOUND)
if(NOT TARGET CURL::ldap)
add_library(CURL::ldap INTERFACE IMPORTED)
set_target_properties(CURL::ldap PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_ldap_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_ldap_LIBRARIES}")
endif()
endif()
+61
View File
@@ -0,0 +1,61 @@
#***************************************************************************
# _ _ ____ _
# 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)
+91
View File
@@ -0,0 +1,91 @@
#***************************************************************************
# _ _ ____ _
# 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 libgsasl library
#
# Input variables:
#
# - `LIBGSASL_INCLUDE_DIR`: Absolute path to libgsasl include directory.
# - `LIBGSASL_LIBRARY`: Absolute path to `libgsasl` library.
#
# Defines:
#
# - `LIBGSASL_FOUND`: System has libgsasl.
# - `LIBGSASL_VERSION`: Version of libgsasl.
# - `CURL::libgsasl`: libgsasl library target.
set(_libgsasl_pc_requires "libgsasl")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBGSASL_INCLUDE_DIR AND
NOT DEFINED LIBGSASL_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libgsasl ${_libgsasl_pc_requires})
endif()
if(_libgsasl_FOUND)
set(Libgsasl_FOUND TRUE)
set(LIBGSASL_FOUND TRUE)
message(STATUS "Found Libgsasl (via pkg-config): ${_libgsasl_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
else()
find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h")
find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl")
unset(LIBGSASL_VERSION CACHE)
if(LIBGSASL_INCLUDE_DIR AND EXISTS "${LIBGSASL_INCLUDE_DIR}/gsasl-version.h")
set(_version_regex "#[\t ]*define[\t ]+GSASL_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${LIBGSASL_INCLUDE_DIR}/gsasl-version.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(LIBGSASL_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libgsasl
REQUIRED_VARS
LIBGSASL_INCLUDE_DIR
LIBGSASL_LIBRARY
VERSION_VAR
LIBGSASL_VERSION
)
if(LIBGSASL_FOUND)
set(_libgsasl_INCLUDE_DIRS ${LIBGSASL_INCLUDE_DIR})
set(_libgsasl_LIBRARIES ${LIBGSASL_LIBRARY})
endif()
mark_as_advanced(LIBGSASL_INCLUDE_DIR LIBGSASL_LIBRARY)
endif()
if(LIBGSASL_FOUND)
if(NOT TARGET CURL::libgsasl)
add_library(CURL::libgsasl INTERFACE IMPORTED)
set_target_properties(CURL::libgsasl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libgsasl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libgsasl_LIBRARIES}")
endif()
endif()
+92
View File
@@ -0,0 +1,92 @@
#***************************************************************************
# _ _ ____ _
# 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 libidn2 library
#
# Input variables:
#
# - `LIBIDN2_INCLUDE_DIR`: Absolute path to libidn2 include directory.
# - `LIBIDN2_LIBRARY`: Absolute path to `libidn2` library.
#
# Defines:
#
# - `LIBIDN2_FOUND`: System has libidn2.
# - `LIBIDN2_VERSION`: Version of libidn2.
# - `CURL::libidn2`: libidn2 library target.
set(_libidn2_pc_requires "libidn2")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBIDN2_INCLUDE_DIR AND
NOT DEFINED LIBIDN2_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libidn2 ${_libidn2_pc_requires})
endif()
if(_libidn2_FOUND)
set(Libidn2_FOUND TRUE)
set(LIBIDN2_FOUND TRUE)
set(LIBIDN2_VERSION ${_libidn2_VERSION})
message(STATUS "Found Libidn2 (via pkg-config): ${_libidn2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
else()
find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h")
find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2")
unset(LIBIDN2_VERSION CACHE)
if(LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/idn2.h")
set(_version_regex "#[\t ]*define[\t ]+IDN2_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(LIBIDN2_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libidn2
REQUIRED_VARS
LIBIDN2_INCLUDE_DIR
LIBIDN2_LIBRARY
VERSION_VAR
LIBIDN2_VERSION
)
if(LIBIDN2_FOUND)
set(_libidn2_INCLUDE_DIRS ${LIBIDN2_INCLUDE_DIR})
set(_libidn2_LIBRARIES ${LIBIDN2_LIBRARY})
endif()
mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARY)
endif()
if(LIBIDN2_FOUND)
if(NOT TARGET CURL::libidn2)
add_library(CURL::libidn2 INTERFACE IMPORTED)
set_target_properties(CURL::libidn2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libidn2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libidn2_LIBRARIES}")
endif()
endif()
+92
View File
@@ -0,0 +1,92 @@
#***************************************************************************
# _ _ ____ _
# 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 libpsl library
#
# Input variables:
#
# - `LIBPSL_INCLUDE_DIR`: Absolute path to libpsl include directory.
# - `LIBPSL_LIBRARY`: Absolute path to `libpsl` library.
#
# Defines:
#
# - `LIBPSL_FOUND`: System has libpsl.
# - `LIBPSL_VERSION`: Version of libpsl.
# - `CURL::libpsl`: libpsl library target.
set(_libpsl_pc_requires "libpsl")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBPSL_INCLUDE_DIR AND
NOT DEFINED LIBPSL_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libpsl ${_libpsl_pc_requires})
endif()
if(_libpsl_FOUND AND _libpsl_INCLUDE_DIRS)
set(Libpsl_FOUND TRUE)
set(LIBPSL_FOUND TRUE)
set(LIBPSL_VERSION ${_libpsl_VERSION})
message(STATUS "Found Libpsl (via pkg-config): ${_libpsl_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
else()
find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h")
find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl")
unset(LIBPSL_VERSION CACHE)
if(LIBPSL_INCLUDE_DIR AND EXISTS "${LIBPSL_INCLUDE_DIR}/libpsl.h")
set(_version_regex "#[\t ]*define[\t ]+PSL_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${LIBPSL_INCLUDE_DIR}/libpsl.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(LIBPSL_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libpsl
REQUIRED_VARS
LIBPSL_INCLUDE_DIR
LIBPSL_LIBRARY
VERSION_VAR
LIBPSL_VERSION
)
if(LIBPSL_FOUND)
set(_libpsl_INCLUDE_DIRS ${LIBPSL_INCLUDE_DIR})
set(_libpsl_LIBRARIES ${LIBPSL_LIBRARY})
endif()
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
endif()
if(LIBPSL_FOUND)
if(NOT TARGET CURL::libpsl)
add_library(CURL::libpsl INTERFACE IMPORTED)
set_target_properties(CURL::libpsl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libpsl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libpsl_LIBRARIES}")
endif()
endif()
+118
View File
@@ -0,0 +1,118 @@
#***************************************************************************
# _ _ ____ _
# 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 libssh library
#
# Input variables:
#
# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory.
# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library.
# - `LIBSSH_USE_STATIC_LIBS`: Configure for static libssh libraries.
#
# Defines:
#
# - `LIBSSH_FOUND`: System has libssh.
# - `LIBSSH_VERSION`: Version of libssh.
# - `CURL::libssh`: libssh library target.
set(_libssh_pc_requires "libssh")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBSSH_INCLUDE_DIR AND
NOT DEFINED LIBSSH_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libssh ${_libssh_pc_requires})
endif()
if(_libssh_FOUND)
set(Libssh_FOUND TRUE)
set(LIBSSH_FOUND TRUE)
set(LIBSSH_VERSION ${_libssh_VERSION})
if(LIBSSH_USE_STATIC_LIBS)
set(_libssh_CFLAGS "${_libssh_STATIC_CFLAGS}")
set(_libssh_INCLUDE_DIRS "${_libssh_STATIC_INCLUDE_DIRS}")
set(_libssh_LIBRARY_DIRS "${_libssh_STATIC_LIBRARY_DIRS}")
set(_libssh_LIBRARIES "${_libssh_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Libssh (via pkg-config): ${_libssh_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
else()
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h")
if(LIBSSH_USE_STATIC_LIBS)
set(_libssh_CFLAGS "-DLIBSSH_STATIC")
find_library(LIBSSH_LIBRARY NAMES "ssh_static" "libssh_static" "ssh" "libssh")
else()
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
endif()
unset(LIBSSH_VERSION CACHE)
if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h")
set(_version_regex1 "#[\t ]*define[\t ]+LIBSSH_VERSION_MAJOR[\t ]+([0-9]+).*")
set(_version_regex2 "#[\t ]*define[\t ]+LIBSSH_VERSION_MINOR[\t ]+([0-9]+).*")
set(_version_regex3 "#[\t ]*define[\t ]+LIBSSH_VERSION_MICRO[\t ]+([0-9]+).*")
file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str1 REGEX "${_version_regex1}")
file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str2 REGEX "${_version_regex2}")
file(STRINGS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h" _version_str3 REGEX "${_version_regex3}")
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
set(LIBSSH_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
unset(_version_regex1)
unset(_version_regex2)
unset(_version_regex3)
unset(_version_str1)
unset(_version_str2)
unset(_version_str3)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libssh
REQUIRED_VARS
LIBSSH_INCLUDE_DIR
LIBSSH_LIBRARY
VERSION_VAR
LIBSSH_VERSION
)
if(LIBSSH_FOUND)
set(_libssh_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
set(_libssh_LIBRARIES ${LIBSSH_LIBRARY})
endif()
mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY)
endif()
if(LIBSSH_FOUND)
if(WIN32)
list(APPEND _libssh_LIBRARIES "iphlpapi") # for if_nametoindex
endif()
if(NOT TARGET CURL::libssh)
add_library(CURL::libssh INTERFACE IMPORTED)
set_target_properties(CURL::libssh PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libssh_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libssh_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libssh_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libssh_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libssh_LIBRARIES}")
endif()
endif()
+117
View File
@@ -0,0 +1,117 @@
#***************************************************************************
# _ _ ____ _
# 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 libssh2 library
#
# Input variables:
#
# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory.
# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library.
# - `LIBSSH2_USE_STATIC_LIBS`: Configure for static libssh2 libraries.
#
# Defines:
#
# - `LIBSSH2_FOUND`: System has libssh2.
# - `LIBSSH2_VERSION`: Version of libssh2.
# - `CURL::libssh2`: libssh2 library target.
set(_libssh2_pc_requires "libssh2")
if(NOT DEFINED LIBSSH2_INCLUDE_DIR AND
NOT DEFINED LIBSSH2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_libssh2 ${_libssh2_pc_requires})
endif()
if(NOT _libssh2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(libssh2 CONFIG QUIET)
endif()
endif()
if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS)
set(Libssh2_FOUND TRUE)
set(LIBSSH2_FOUND TRUE)
set(LIBSSH2_VERSION ${_libssh2_VERSION})
if(LIBSSH2_USE_STATIC_LIBS)
set(_libssh2_CFLAGS "${_libssh2_STATIC_CFLAGS}")
set(_libssh2_INCLUDE_DIRS "${_libssh2_STATIC_INCLUDE_DIRS}")
set(_libssh2_LIBRARY_DIRS "${_libssh2_STATIC_LIBRARY_DIRS}")
set(_libssh2_LIBRARIES "${_libssh2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
elseif(libssh2_CONFIG)
set(Libssh2_FOUND TRUE)
set(LIBSSH2_FOUND TRUE)
set(LIBSSH2_VERSION ${libssh2_VERSION})
if(LIBSSH2_USE_STATIC_LIBS)
set(_libssh2_LIBRARIES libssh2::libssh2_static)
else()
set(_libssh2_LIBRARIES libssh2::libssh2)
endif()
message(STATUS "Found Libssh2 (via CMake Config): ${libssh2_CONFIG} (found version \"${LIBSSH2_VERSION}\")")
else()
find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h")
if(LIBSSH2_USE_STATIC_LIBS)
find_library(LIBSSH2_LIBRARY NAMES "ssh2_static" "libssh2_static" "ssh2" "libssh2")
else()
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
endif()
unset(LIBSSH2_VERSION CACHE)
if(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h")
set(_version_regex "#[\t ]*define[\t ]+LIBSSH2_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(LIBSSH2_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libssh2
REQUIRED_VARS
LIBSSH2_INCLUDE_DIR
LIBSSH2_LIBRARY
VERSION_VAR
LIBSSH2_VERSION
)
if(LIBSSH2_FOUND)
set(_libssh2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
set(_libssh2_LIBRARIES ${LIBSSH2_LIBRARY})
endif()
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
endif()
if(LIBSSH2_FOUND)
if(NOT TARGET CURL::libssh2)
add_library(CURL::libssh2 INTERFACE IMPORTED)
set_target_properties(CURL::libssh2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libssh2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libssh2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libssh2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libssh2_LIBRARIES}")
endif()
endif()
+102
View File
@@ -0,0 +1,102 @@
#***************************************************************************
# _ _ ____ _
# 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 libuv library
#
# Input variables:
#
# - `LIBUV_INCLUDE_DIR`: Absolute path to libuv include directory.
# - `LIBUV_LIBRARY`: Absolute path to `libuv` library.
#
# Defines:
#
# - `LIBUV_FOUND`: System has libuv.
# - `LIBUV_VERSION`: Version of libuv.
# - `CURL::libuv`: libuv library target.
set(_libuv_pc_requires "libuv")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED LIBUV_INCLUDE_DIR AND
NOT DEFINED LIBUV_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_libuv ${_libuv_pc_requires})
endif()
if(_libuv_FOUND)
set(Libuv_FOUND TRUE)
set(LIBUV_FOUND TRUE)
set(LIBUV_VERSION ${_libuv_VERSION})
message(STATUS "Found Libuv (via pkg-config): ${_libuv_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
else()
find_path(LIBUV_INCLUDE_DIR NAMES "uv.h")
find_library(LIBUV_LIBRARY NAMES "uv" "libuv")
unset(LIBUV_VERSION CACHE)
if(LIBUV_INCLUDE_DIR AND EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h")
set(_version_regex1 "#[\t ]*define[\t ]+UV_VERSION_MAJOR[\t ]+([0-9]+).*")
set(_version_regex2 "#[\t ]*define[\t ]+UV_VERSION_MINOR[\t ]+([0-9]+).*")
set(_version_regex3 "#[\t ]*define[\t ]+UV_VERSION_PATCH[\t ]+([0-9]+).*")
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str1 REGEX "${_version_regex1}")
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str2 REGEX "${_version_regex2}")
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" _version_str3 REGEX "${_version_regex3}")
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
set(LIBUV_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
unset(_version_regex1)
unset(_version_regex2)
unset(_version_regex3)
unset(_version_str1)
unset(_version_str2)
unset(_version_str3)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libuv
REQUIRED_VARS
LIBUV_INCLUDE_DIR
LIBUV_LIBRARY
VERSION_VAR
LIBUV_VERSION
)
if(LIBUV_FOUND)
set(_libuv_INCLUDE_DIRS ${LIBUV_INCLUDE_DIR})
set(_libuv_LIBRARIES ${LIBUV_LIBRARY})
endif()
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARY)
endif()
if(LIBUV_FOUND)
if(NOT TARGET CURL::libuv)
add_library(CURL::libuv INTERFACE IMPORTED)
set_target_properties(CURL::libuv PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_libuv_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_libuv_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_libuv_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_libuv_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_libuv_LIBRARIES}")
endif()
endif()
+137
View File
@@ -0,0 +1,137 @@
#***************************************************************************
# _ _ ____ _
# 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 mbedTLS library
#
# Input variables:
#
# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory.
# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library.
# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library.
# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library.
# - `MBEDTLS_USE_STATIC_LIBS`: Configure for static mbedTLS libraries.
#
# Defines:
#
# - `MBEDTLS_FOUND`: System has mbedTLS.
# - `MBEDTLS_VERSION`: Version of mbedTLS.
# - `CURL::mbedtls`: mbedTLS library target.
if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.")
set(MBEDTLS_INCLUDE_DIR "${MBEDTLS_INCLUDE_DIRS}")
unset(MBEDTLS_INCLUDE_DIRS)
endif()
set(_mbedtls_pc_requires "mbedtls" "mbedx509" "mbedcrypto")
if(NOT DEFINED MBEDTLS_INCLUDE_DIR AND
NOT DEFINED MBEDTLS_LIBRARY AND
NOT DEFINED MBEDX509_LIBRARY AND
NOT DEFINED MBEDCRYPTO_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_mbedtls ${_mbedtls_pc_requires})
endif()
if(NOT _mbedtls_FOUND AND CURL_USE_CMAKECONFIG)
find_package(MbedTLS CONFIG QUIET)
endif()
endif()
if(_mbedtls_FOUND)
set(MbedTLS_FOUND TRUE)
set(MBEDTLS_FOUND TRUE)
set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION})
if(MBEDTLS_USE_STATIC_LIBS)
set(_mbedtls_CFLAGS "${_mbedtls_STATIC_CFLAGS}")
set(_mbedtls_INCLUDE_DIRS "${_mbedtls_STATIC_INCLUDE_DIRS}")
set(_mbedtls_LIBRARY_DIRS "${_mbedtls_STATIC_LIBRARY_DIRS}")
set(_mbedtls_LIBRARIES "${_mbedtls_STATIC_LIBRARIES}")
endif()
message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
elseif(MbedTLS_CONFIG)
set(MbedTLS_FOUND TRUE)
set(MBEDTLS_FOUND TRUE)
set(MBEDTLS_VERSION ${MbedTLS_VERSION})
if(MBEDTLS_VERSION GREATER_EQUAL 4.0.0)
set(_mbedtls_LIBRARIES MbedTLS::tfpsacrypto)
else()
set(_mbedtls_LIBRARIES MbedTLS::mbedcrypto)
endif()
list(APPEND _mbedtls_LIBRARIES MbedTLS::mbedx509 MbedTLS::mbedtls)
message(STATUS "Found MbedTLS (via CMake Config): ${MbedTLS_CONFIG} (found version \"${MBEDTLS_VERSION}\")")
else()
set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config
find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h")
if(MBEDTLS_USE_STATIC_LIBS)
find_library(MBEDTLS_LIBRARY NAMES "mbedtls_static" "libmbedtls_static" "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509_static" "libmbedx509_static" "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto_static" "libmbedcrypto_static" "mbedcrypto" "libmbedcrypto"
"tfpsacrypto_static" "libtfpsacrypto_static" "tfpsacrypto" "libtfpsacrypto")
else()
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto" "tfpsacrypto" "libtfpsacrypto")
endif()
unset(MBEDTLS_VERSION CACHE)
if(MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
set(_version_regex "#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([0-9.]+)\"")
file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(MBEDTLS_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MbedTLS
REQUIRED_VARS
MBEDTLS_INCLUDE_DIR
MBEDTLS_LIBRARY
MBEDX509_LIBRARY
MBEDCRYPTO_LIBRARY
VERSION_VAR
MBEDTLS_VERSION
)
if(MBEDTLS_FOUND)
set(_mbedtls_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(_mbedtls_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
endif()
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
endif()
if(MBEDTLS_FOUND)
if(NOT TARGET CURL::mbedtls)
add_library(CURL::mbedtls INTERFACE IMPORTED)
set_target_properties(CURL::mbedtls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_mbedtls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_mbedtls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_mbedtls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_mbedtls_LIBRARIES}")
endif()
endif()
+116
View File
@@ -0,0 +1,116 @@
#***************************************************************************
# _ _ ____ _
# 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 nghttp2 library
#
# Input variables:
#
# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory.
# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library.
# - `NGHTTP2_USE_STATIC_LIBS`: Configure for static nghttp2 libraries.
#
# Defines:
#
# - `NGHTTP2_FOUND`: System has nghttp2.
# - `NGHTTP2_VERSION`: Version of nghttp2.
# - `CURL::nghttp2`: nghttp2 library target.
set(_nghttp2_pc_requires "libnghttp2")
if(NOT DEFINED NGHTTP2_INCLUDE_DIR AND
NOT DEFINED NGHTTP2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp2 ${_nghttp2_pc_requires})
endif()
if(NOT _nghttp2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp2 CONFIG QUIET)
endif()
endif()
if(_nghttp2_FOUND)
set(NGHTTP2_FOUND TRUE)
set(NGHTTP2_VERSION ${_nghttp2_VERSION})
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_CFLAGS "${_nghttp2_STATIC_CFLAGS}")
set(_nghttp2_INCLUDE_DIRS "${_nghttp2_STATIC_INCLUDE_DIRS}")
set(_nghttp2_LIBRARY_DIRS "${_nghttp2_STATIC_LIBRARY_DIRS}")
set(_nghttp2_LIBRARIES "${_nghttp2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGHTTP2 (via pkg-config): ${_nghttp2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")")
elseif(nghttp2_CONFIG)
set(NGHTTP2_FOUND TRUE)
set(NGHTTP2_VERSION ${nghttp2_VERSION})
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_LIBRARIES nghttp2::nghttp2_static)
else()
set(_nghttp2_LIBRARIES nghttp2::nghttp2)
endif()
message(STATUS "Found NGHTTP2 (via CMake Config): ${nghttp2_CONFIG} (found version \"${NGHTTP2_VERSION}\")")
else()
find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h")
if(NGHTTP2_USE_STATIC_LIBS)
set(_nghttp2_CFLAGS "-DNGHTTP2_STATICLIB")
find_library(NGHTTP2_LIBRARY NAMES "nghttp2_static" "nghttp2")
else()
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
endif()
unset(NGHTTP2_VERSION CACHE)
if(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h")
set(_version_regex "#[\t ]*define[\t ]+NGHTTP2_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(NGHTTP2_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NGHTTP2
REQUIRED_VARS
NGHTTP2_INCLUDE_DIR
NGHTTP2_LIBRARY
VERSION_VAR
NGHTTP2_VERSION
)
if(NGHTTP2_FOUND)
set(_nghttp2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
set(_nghttp2_LIBRARIES ${NGHTTP2_LIBRARY})
endif()
mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY)
endif()
if(NGHTTP2_FOUND)
if(NOT TARGET CURL::nghttp2)
add_library(CURL::nghttp2 INTERFACE IMPORTED)
set_target_properties(CURL::nghttp2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nghttp2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nghttp2_LIBRARIES}")
endif()
endif()
+116
View File
@@ -0,0 +1,116 @@
#***************************************************************************
# _ _ ____ _
# 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 nghttp3 library
#
# Input variables:
#
# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory.
# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library.
# - `NGHTTP3_USE_STATIC_LIBS`: Configure for static nghttp3 libraries.
#
# Defines:
#
# - `NGHTTP3_FOUND`: System has nghttp3.
# - `NGHTTP3_VERSION`: Version of nghttp3.
# - `CURL::nghttp3`: nghttp3 library target.
set(_nghttp3_pc_requires "libnghttp3")
if(NOT DEFINED NGHTTP3_INCLUDE_DIR AND
NOT DEFINED NGHTTP3_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_nghttp3 ${_nghttp3_pc_requires})
endif()
if(NOT _nghttp3_FOUND AND CURL_USE_CMAKECONFIG)
find_package(nghttp3 CONFIG QUIET)
endif()
endif()
if(_nghttp3_FOUND)
set(NGHTTP3_FOUND TRUE)
set(NGHTTP3_VERSION ${_nghttp3_VERSION})
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_CFLAGS "${_nghttp3_STATIC_CFLAGS}")
set(_nghttp3_INCLUDE_DIRS "${_nghttp3_STATIC_INCLUDE_DIRS}")
set(_nghttp3_LIBRARY_DIRS "${_nghttp3_STATIC_LIBRARY_DIRS}")
set(_nghttp3_LIBRARIES "${_nghttp3_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")")
elseif(nghttp3_CONFIG)
set(NGHTTP3_FOUND TRUE)
set(NGHTTP3_VERSION ${nghttp3_VERSION})
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_LIBRARIES nghttp3::nghttp3_static)
else()
set(_nghttp3_LIBRARIES nghttp3::nghttp3)
endif()
message(STATUS "Found NGHTTP3 (via CMake Config): ${nghttp3_CONFIG} (found version \"${NGHTTP3_VERSION}\")")
else()
find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h")
if(NGHTTP3_USE_STATIC_LIBS)
set(_nghttp3_CFLAGS "-DNGHTTP3_STATICLIB")
find_library(NGHTTP3_LIBRARY NAMES "nghttp3_static" "nghttp3")
else()
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
endif()
unset(NGHTTP3_VERSION CACHE)
if(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h")
set(_version_regex "#[\t ]*define[\t ]+NGHTTP3_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(NGHTTP3_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NGHTTP3
REQUIRED_VARS
NGHTTP3_INCLUDE_DIR
NGHTTP3_LIBRARY
VERSION_VAR
NGHTTP3_VERSION
)
if(NGHTTP3_FOUND)
set(_nghttp3_INCLUDE_DIRS ${NGHTTP3_INCLUDE_DIR})
set(_nghttp3_LIBRARIES ${NGHTTP3_LIBRARY})
endif()
mark_as_advanced(NGHTTP3_INCLUDE_DIR NGHTTP3_LIBRARY)
endif()
if(NGHTTP3_FOUND)
if(NOT TARGET CURL::nghttp3)
add_library(CURL::nghttp3 INTERFACE IMPORTED)
set_target_properties(CURL::nghttp3 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nghttp3_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nghttp3_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nghttp3_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nghttp3_LIBRARIES}")
endif()
endif()
+186
View File
@@ -0,0 +1,186 @@
#***************************************************************************
# _ _ ____ _
# 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 ngtcp2 library
#
# This module accepts optional COMPONENTS to control the crypto library (these are
# mutually exclusive):
#
# - BoringSSL: Use `libngtcp2_crypto_boringssl`. (also for AWS-LC)
# - GnuTLS: Use `libngtcp2_crypto_gnutls`.
# - LibreSSL: Use `libngtcp2_crypto_libressl`. (requires ngtcp2 1.15.0+)
# - ossl: Use `libngtcp2_crypto_ossl`.
# - quictls: Use `libngtcp2_crypto_quictls`. (also for LibreSSL with ngtcp2 <1.15.0)
# - wolfSSL: Use `libngtcp2_crypto_wolfssl`.
#
# Input variables:
#
# - `NGTCP2_INCLUDE_DIR`: Absolute path to ngtcp2 include directory.
# - `NGTCP2_LIBRARY`: Absolute path to `ngtcp2` library.
# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_boringssl` library.
# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_gnutls` library.
# - `NGTCP2_CRYPTO_LIBRESSL_LIBRARY`: Absolute path to `ngtcp2_crypto_libressl` library.
# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_ossl` library.
# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Absolute path to `ngtcp2_crypto_quictls` library.
# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Absolute path to `ngtcp2_crypto_wolfssl` library.
# - `NGTCP2_USE_STATIC_LIBS`: Configure for static ngtcp2 libraries.
#
# Defines:
#
# - `NGTCP2_FOUND`: System has ngtcp2.
# - `NGTCP2_VERSION`: Version of ngtcp2.
# - `CURL::ngtcp2`: ngtcp2 library target.
if(NGTCP2_FIND_COMPONENTS)
set(_ngtcp2_crypto_backend "")
foreach(_component IN LISTS NGTCP2_FIND_COMPONENTS)
if(_component MATCHES "^(BoringSSL|GnuTLS|LibreSSL|ossl|quictls|wolfSSL)")
if(_ngtcp2_crypto_backend)
message(FATAL_ERROR "NGTCP2: Only one crypto library can be selected")
endif()
set(_ngtcp2_crypto_backend ${_component})
endif()
endforeach()
if(_ngtcp2_crypto_backend)
string(TOLOWER "ngtcp2_crypto_${_ngtcp2_crypto_backend}" _crypto_library_lower)
string(TOUPPER "ngtcp2_crypto_${_ngtcp2_crypto_backend}" _crypto_library_upper)
endif()
endif()
set(_ngtcp2_pc_requires "libngtcp2")
if(_ngtcp2_crypto_backend)
list(APPEND _ngtcp2_pc_requires "lib${_crypto_library_lower}")
endif()
set(_tried_pkgconfig FALSE)
if(NOT DEFINED NGTCP2_INCLUDE_DIR AND
NOT DEFINED NGTCP2_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_ngtcp2 ${_ngtcp2_pc_requires})
set(_tried_pkgconfig TRUE)
endif()
if(NOT _ngtcp2_FOUND AND CURL_USE_CMAKECONFIG)
find_package(ngtcp2 CONFIG QUIET)
# Skip using it if the crypto library target is not available
if(ngtcp2_CONFIG AND
NOT TARGET ngtcp2::${_crypto_library_lower}_static AND
NOT TARGET ngtcp2::${_crypto_library_lower})
unset(ngtcp2_CONFIG)
endif()
endif()
endif()
if(_ngtcp2_FOUND)
set(NGTCP2_FOUND TRUE)
set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION})
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_CFLAGS "${_ngtcp2_STATIC_CFLAGS}")
set(_ngtcp2_INCLUDE_DIRS "${_ngtcp2_STATIC_INCLUDE_DIRS}")
set(_ngtcp2_LIBRARY_DIRS "${_ngtcp2_STATIC_LIBRARY_DIRS}")
set(_ngtcp2_LIBRARIES "${_ngtcp2_STATIC_LIBRARIES}")
endif()
message(STATUS "Found NGTCP2 (via pkg-config): ${_ngtcp2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")")
elseif(ngtcp2_CONFIG)
set(NGTCP2_FOUND TRUE)
set(NGTCP2_VERSION ${ngtcp2_VERSION})
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_LIBRARIES ngtcp2::ngtcp2_static ngtcp2::${_crypto_library_lower}_static)
else()
set(_ngtcp2_LIBRARIES ngtcp2::ngtcp2 ngtcp2::${_crypto_library_lower})
endif()
message(STATUS "Found NGTCP2 (via CMake Config): ${ngtcp2_CONFIG} (found version \"${NGTCP2_VERSION}\")")
else()
find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h")
if(NGTCP2_USE_STATIC_LIBS)
set(_ngtcp2_CFLAGS "-DNGTCP2_STATICLIB")
find_library(NGTCP2_LIBRARY NAMES "ngtcp2_static" "ngtcp2")
else()
find_library(NGTCP2_LIBRARY NAMES "ngtcp2")
endif()
unset(NGTCP2_VERSION CACHE)
if(NGTCP2_INCLUDE_DIR AND EXISTS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h")
set(_version_regex "#[\t ]*define[\t ]+NGTCP2_VERSION[\t ]+\"([^\"]*)\"")
file(STRINGS "${NGTCP2_INCLUDE_DIR}/ngtcp2/version.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(NGTCP2_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
if(_ngtcp2_crypto_backend)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
cmake_path(GET NGTCP2_LIBRARY PARENT_PATH _ngtcp2_library_dir)
else()
get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY)
endif()
if(NGTCP2_USE_STATIC_LIBS)
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower}_static ${_crypto_library_lower}
HINTS ${_ngtcp2_library_dir})
else()
find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower}
HINTS ${_ngtcp2_library_dir})
endif()
if(${_crypto_library_upper}_LIBRARY)
set(NGTCP2_${_ngtcp2_crypto_backend}_FOUND TRUE)
set(NGTCP2_CRYPTO_LIBRARY ${${_crypto_library_upper}_LIBRARY})
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NGTCP2
REQUIRED_VARS
NGTCP2_INCLUDE_DIR
NGTCP2_LIBRARY
VERSION_VAR
NGTCP2_VERSION
HANDLE_COMPONENTS
)
if(NGTCP2_FOUND)
set(_ngtcp2_INCLUDE_DIRS ${NGTCP2_INCLUDE_DIR})
set(_ngtcp2_LIBRARIES ${NGTCP2_LIBRARY} ${NGTCP2_CRYPTO_LIBRARY})
endif()
mark_as_advanced(NGTCP2_INCLUDE_DIR NGTCP2_LIBRARY NGTCP2_CRYPTO_LIBRARY)
if(NOT NGTCP2_FOUND AND _tried_pkgconfig) # reset variables to allow another round of detection
unset(NGTCP2_INCLUDE_DIR CACHE)
unset(NGTCP2_LIBRARY CACHE)
endif()
endif()
if(NGTCP2_FOUND)
if(NOT TARGET CURL::ngtcp2)
add_library(CURL::ngtcp2 INTERFACE IMPORTED)
set_target_properties(CURL::ngtcp2 PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_ngtcp2_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_ngtcp2_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_ngtcp2_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_ngtcp2_LIBRARIES}")
endif()
endif()
+97
View File
@@ -0,0 +1,97 @@
#***************************************************************************
# _ _ ____ _
# 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 nettle library
#
# Input variables:
#
# - `NETTLE_INCLUDE_DIR`: Absolute path to nettle include directory.
# - `NETTLE_LIBRARY`: Absolute path to `nettle` library.
#
# Defines:
#
# - `NETTLE_FOUND`: System has nettle.
# - `NETTLE_VERSION`: Version of nettle.
# - `CURL::nettle`: nettle library target.
set(_nettle_pc_requires "nettle")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED NETTLE_INCLUDE_DIR AND
NOT DEFINED NETTLE_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_nettle ${_nettle_pc_requires})
endif()
if(_nettle_FOUND)
set(Nettle_FOUND TRUE)
set(NETTLE_FOUND TRUE)
set(NETTLE_VERSION ${_nettle_VERSION})
message(STATUS "Found Nettle (via pkg-config): ${_nettle_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
else()
find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h")
find_library(NETTLE_LIBRARY NAMES "nettle")
unset(NETTLE_VERSION CACHE)
if(NETTLE_INCLUDE_DIR AND EXISTS "${NETTLE_INCLUDE_DIR}/nettle/version.h")
set(_version_regex1 "#[\t ]*define[ \t]+NETTLE_VERSION_MAJOR[ \t]+([0-9]+).*")
set(_version_regex2 "#[\t ]*define[ \t]+NETTLE_VERSION_MINOR[ \t]+([0-9]+).*")
file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_str1 REGEX "${_version_regex1}")
file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" _version_str2 REGEX "${_version_regex2}")
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
set(NETTLE_VERSION "${_version_str1}.${_version_str2}")
unset(_version_regex1)
unset(_version_regex2)
unset(_version_str1)
unset(_version_str2)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Nettle
REQUIRED_VARS
NETTLE_INCLUDE_DIR
NETTLE_LIBRARY
VERSION_VAR
NETTLE_VERSION
)
if(NETTLE_FOUND)
set(_nettle_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR})
set(_nettle_LIBRARIES ${NETTLE_LIBRARY})
endif()
mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARY)
endif()
if(NETTLE_FOUND)
if(NOT TARGET CURL::nettle)
add_library(CURL::nettle INTERFACE IMPORTED)
set_target_properties(CURL::nettle PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_nettle_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_nettle_LIBRARIES}")
endif()
endif()
+80
View File
@@ -0,0 +1,80 @@
#***************************************************************************
# _ _ ____ _
# 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 quiche library
#
# Input variables:
#
# - `QUICHE_INCLUDE_DIR`: Absolute path to quiche include directory.
# - `QUICHE_LIBRARY`: Absolute path to `quiche` library.
#
# Defines:
#
# - `QUICHE_FOUND`: System has quiche.
# - `QUICHE_VERSION`: Version of quiche.
# - `CURL::quiche`: quiche library target.
set(_quiche_pc_requires "quiche")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED QUICHE_INCLUDE_DIR AND
NOT DEFINED QUICHE_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_quiche ${_quiche_pc_requires})
endif()
if(_quiche_FOUND)
set(Quiche_FOUND TRUE)
set(QUICHE_FOUND TRUE)
set(QUICHE_VERSION ${_quiche_VERSION})
message(STATUS "Found Quiche (via pkg-config): ${_quiche_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
else()
find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h")
find_library(QUICHE_LIBRARY NAMES "quiche")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Quiche
REQUIRED_VARS
QUICHE_INCLUDE_DIR
QUICHE_LIBRARY
)
if(QUICHE_FOUND)
set(_quiche_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR})
set(_quiche_LIBRARIES ${QUICHE_LIBRARY})
endif()
mark_as_advanced(QUICHE_INCLUDE_DIR QUICHE_LIBRARY)
endif()
if(QUICHE_FOUND)
if(NOT TARGET CURL::quiche)
add_library(CURL::quiche INTERFACE IMPORTED)
set_target_properties(CURL::quiche PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_quiche_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_quiche_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_quiche_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_quiche_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_quiche_LIBRARIES}")
endif()
endif()
+116
View File
@@ -0,0 +1,116 @@
#***************************************************************************
# _ _ ____ _
# 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 Rustls library
#
# Input variables:
#
# - `RUSTLS_INCLUDE_DIR`: Absolute path to Rustls include directory.
# - `RUSTLS_LIBRARY`: Absolute path to `rustls` library.
#
# Defines:
#
# - `RUSTLS_FOUND`: System has Rustls.
# - `RUSTLS_VERSION`: Version of Rustls.
# - `CURL::rustls`: Rustls library target.
set(_rustls_pc_requires "rustls")
if(CURL_USE_PKGCONFIG AND
NOT DEFINED RUSTLS_INCLUDE_DIR AND
NOT DEFINED RUSTLS_LIBRARY)
find_package(PkgConfig QUIET)
pkg_check_modules(_rustls ${_rustls_pc_requires})
endif()
if(_rustls_FOUND)
set(Rustls_FOUND TRUE)
set(RUSTLS_FOUND TRUE)
set(RUSTLS_VERSION ${_rustls_VERSION})
message(STATUS "Found Rustls (via pkg-config): ${_rustls_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
else()
set(_rustls_pc_requires "") # Depend on pkg-config only when found via pkg-config
find_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h")
find_library(RUSTLS_LIBRARY NAMES "rustls")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Rustls
REQUIRED_VARS
RUSTLS_INCLUDE_DIR
RUSTLS_LIBRARY
)
if(RUSTLS_FOUND)
set(_rustls_INCLUDE_DIRS ${RUSTLS_INCLUDE_DIR})
set(_rustls_LIBRARIES ${RUSTLS_LIBRARY})
endif()
mark_as_advanced(RUSTLS_INCLUDE_DIR RUSTLS_LIBRARY)
endif()
if(RUSTLS_FOUND)
if(APPLE)
find_library(SECURITY_FRAMEWORK NAMES "Security")
mark_as_advanced(SECURITY_FRAMEWORK)
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
list(APPEND _rustls_LIBRARIES "-framework Security")
find_library(FOUNDATION_FRAMEWORK NAMES "Foundation")
mark_as_advanced(FOUNDATION_FRAMEWORK)
if(NOT FOUNDATION_FRAMEWORK)
message(FATAL_ERROR "Foundation framework not found")
endif()
list(APPEND _rustls_LIBRARIES "-framework Foundation")
elseif(NOT WIN32)
find_library(PTHREAD_LIBRARY NAMES "pthread")
if(PTHREAD_LIBRARY)
list(APPEND _rustls_LIBRARIES ${PTHREAD_LIBRARY})
endif()
mark_as_advanced(PTHREAD_LIBRARY)
find_library(DL_LIBRARY NAMES "dl")
if(DL_LIBRARY)
list(APPEND _rustls_LIBRARIES ${DL_LIBRARY})
endif()
mark_as_advanced(DL_LIBRARY)
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND _rustls_LIBRARIES ${MATH_LIBRARY})
endif()
mark_as_advanced(MATH_LIBRARY)
endif()
if(NOT TARGET CURL::rustls)
add_library(CURL::rustls INTERFACE IMPORTED)
set_target_properties(CURL::rustls PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_rustls_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_rustls_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_rustls_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_rustls_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_rustls_LIBRARIES}")
endif()
endif()
+135
View File
@@ -0,0 +1,135 @@
#***************************************************************************
# _ _ ____ _
# 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 wolfSSL library
#
# Input variables:
#
# - `WOLFSSL_INCLUDE_DIR`: Absolute path to wolfSSL include directory.
# - `WOLFSSL_LIBRARY`: Absolute path to `wolfssl` library.
#
# Defines:
#
# - `WOLFSSL_FOUND`: System has wolfSSL.
# - `WOLFSSL_VERSION`: Version of wolfSSL.
# - `CURL::wolfssl`: wolfSSL library target.
if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR)
message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.")
set(WOLFSSL_INCLUDE_DIR "${WolfSSL_INCLUDE_DIR}")
endif()
if(DEFINED WolfSSL_LIBRARY AND NOT DEFINED WOLFSSL_LIBRARY)
message(WARNING "WolfSSL_LIBRARY is deprecated, use WOLFSSL_LIBRARY instead.")
set(WOLFSSL_LIBRARY "${WolfSSL_LIBRARY}")
endif()
set(_wolfssl_pc_requires "wolfssl")
if(NOT DEFINED WOLFSSL_INCLUDE_DIR AND
NOT DEFINED WOLFSSL_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_wolfssl ${_wolfssl_pc_requires})
endif()
if(NOT _wolfssl_FOUND AND CURL_USE_CMAKECONFIG)
find_package(wolfssl CONFIG QUIET)
endif()
endif()
if(_wolfssl_FOUND)
set(WolfSSL_FOUND TRUE)
set(WOLFSSL_FOUND TRUE)
set(WOLFSSL_VERSION ${_wolfssl_VERSION})
message(STATUS "Found WolfSSL (via pkg-config): ${_wolfssl_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
elseif(wolfssl_CONFIG)
set(WolfSSL_FOUND TRUE)
set(WOLFSSL_FOUND TRUE)
set(WOLFSSL_VERSION ${wolfssl_VERSION})
set(_wolfssl_LIBRARIES wolfssl::wolfssl)
message(STATUS "Found WolfSSL (via CMake Config): ${wolfssl_CONFIG} (found version \"${WOLFSSL_VERSION}\")")
else()
find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h")
find_library(WOLFSSL_LIBRARY NAMES "wolfssl")
unset(WOLFSSL_VERSION CACHE)
if(WOLFSSL_INCLUDE_DIR AND EXISTS "${WOLFSSL_INCLUDE_DIR}/wolfssl/version.h")
set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSL_VERSION_STRING[\t ]+\"([^\"]*)\"")
file(STRINGS "${WOLFSSL_INCLUDE_DIR}/wolfssl/version.h" _version_str REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}")
set(WOLFSSL_VERSION "${_version_str}")
unset(_version_regex)
unset(_version_str)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WolfSSL
REQUIRED_VARS
WOLFSSL_INCLUDE_DIR
WOLFSSL_LIBRARY
VERSION_VAR
WOLFSSL_VERSION
)
if(WOLFSSL_FOUND)
set(_wolfssl_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
set(_wolfssl_LIBRARIES ${WOLFSSL_LIBRARY})
endif()
mark_as_advanced(WOLFSSL_INCLUDE_DIR WOLFSSL_LIBRARY)
endif()
if(WOLFSSL_FOUND)
if(APPLE)
find_library(SECURITY_FRAMEWORK NAMES "Security")
mark_as_advanced(SECURITY_FRAMEWORK)
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
list(APPEND _wolfssl_LIBRARIES "-framework Security")
find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation")
mark_as_advanced(COREFOUNDATION_FRAMEWORK)
if(NOT COREFOUNDATION_FRAMEWORK)
message(FATAL_ERROR "CoreFoundation framework not found")
endif()
list(APPEND _wolfssl_LIBRARIES "-framework CoreFoundation")
elseif(WIN32)
list(APPEND _wolfssl_LIBRARIES "crypt32")
else()
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND _wolfssl_LIBRARIES ${MATH_LIBRARY}) # for log and pow
endif()
mark_as_advanced(MATH_LIBRARY)
endif()
if(NOT TARGET CURL::wolfssl)
add_library(CURL::wolfssl INTERFACE IMPORTED)
set_target_properties(CURL::wolfssl PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_wolfssl_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_wolfssl_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_wolfssl_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_wolfssl_LIBRARIES}")
endif()
endif()
+143
View File
@@ -0,0 +1,143 @@
#***************************************************************************
# _ _ ____ _
# 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 zstd library
#
# Input variables:
#
# - `ZSTD_INCLUDE_DIR`: Absolute path to zstd include directory.
# - `ZSTD_LIBRARY`: Absolute path to `zstd` library.
# - `ZSTD_USE_STATIC_LIBS`: Configure for static zstd libraries.
#
# Defines:
#
# - `ZSTD_FOUND`: System has zstd.
# - `ZSTD_VERSION`: Version of zstd.
# - `CURL::zstd`: zstd library target.
if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR)
message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.")
set(ZSTD_INCLUDE_DIR "${Zstd_INCLUDE_DIR}")
endif()
if(DEFINED Zstd_LIBRARY AND NOT DEFINED ZSTD_LIBRARY)
message(WARNING "Zstd_LIBRARY is deprecated, use ZSTD_LIBRARY instead.")
set(ZSTD_LIBRARY "${Zstd_LIBRARY}")
endif()
set(_zstd_pc_requires "libzstd")
if(NOT DEFINED ZSTD_INCLUDE_DIR AND
NOT DEFINED ZSTD_LIBRARY)
if(CURL_USE_PKGCONFIG)
find_package(PkgConfig QUIET)
pkg_check_modules(_zstd ${_zstd_pc_requires})
endif()
if(NOT _zstd_FOUND AND CURL_USE_CMAKECONFIG)
find_package(Zstd CONFIG QUIET)
# Skip using if older than v1.4.5
if(Zstd_CONFIG AND
NOT TARGET zstd::libzstd_static AND
NOT TARGET zstd::libzstd_shared)
unset(Zstd_CONFIG)
endif()
endif()
endif()
if(_zstd_FOUND)
set(Zstd_FOUND TRUE)
set(ZSTD_FOUND TRUE)
set(ZSTD_VERSION ${_zstd_VERSION})
if(ZSTD_USE_STATIC_LIBS)
set(_zstd_CFLAGS "${_zstd_STATIC_CFLAGS}")
set(_zstd_INCLUDE_DIRS "${_zstd_STATIC_INCLUDE_DIRS}")
set(_zstd_LIBRARY_DIRS "${_zstd_STATIC_LIBRARY_DIRS}")
set(_zstd_LIBRARIES "${_zstd_STATIC_LIBRARIES}")
endif()
message(STATUS "Found Zstd (via pkg-config): ${_zstd_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
elseif(Zstd_CONFIG)
set(ZSTD_FOUND TRUE)
set(ZSTD_VERSION ${Zstd_VERSION})
if(ZSTD_USE_STATIC_LIBS)
set(_zstd_LIBRARIES zstd::libzstd_static)
elseif(TARGET zstd::libzstd)
set(_zstd_LIBRARIES zstd::libzstd) # v1.5.6+
else()
set(_zstd_LIBRARIES zstd::libzstd_shared)
endif()
message(STATUS "Found Zstd (via CMake Config): ${Zstd_CONFIG} (found version \"${ZSTD_VERSION}\")")
else()
find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h")
if(ZSTD_USE_STATIC_LIBS)
find_library(ZSTD_LIBRARY NAMES "zstd_static" "zstd")
else()
find_library(ZSTD_LIBRARY NAMES "zstd")
endif()
unset(ZSTD_VERSION CACHE)
if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h")
set(_version_regex1 "#[\t ]*define[ \t]+ZSTD_VERSION_MAJOR[ \t]+([0-9]+).*")
set(_version_regex2 "#[\t ]*define[ \t]+ZSTD_VERSION_MINOR[ \t]+([0-9]+).*")
set(_version_regex3 "#[\t ]*define[ \t]+ZSTD_VERSION_RELEASE[ \t]+([0-9]+).*")
file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str1 REGEX "${_version_regex1}")
file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str2 REGEX "${_version_regex2}")
file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" _version_str3 REGEX "${_version_regex3}")
string(REGEX REPLACE "${_version_regex1}" "\\1" _version_str1 "${_version_str1}")
string(REGEX REPLACE "${_version_regex2}" "\\1" _version_str2 "${_version_str2}")
string(REGEX REPLACE "${_version_regex3}" "\\1" _version_str3 "${_version_str3}")
set(ZSTD_VERSION "${_version_str1}.${_version_str2}.${_version_str3}")
unset(_version_regex1)
unset(_version_regex2)
unset(_version_regex3)
unset(_version_str1)
unset(_version_str2)
unset(_version_str3)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Zstd
REQUIRED_VARS
ZSTD_INCLUDE_DIR
ZSTD_LIBRARY
VERSION_VAR
ZSTD_VERSION
)
if(ZSTD_FOUND)
set(_zstd_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
set(_zstd_LIBRARIES ${ZSTD_LIBRARY})
endif()
mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
endif()
if(ZSTD_FOUND)
if(NOT TARGET CURL::zstd)
add_library(CURL::zstd INTERFACE IMPORTED)
set_target_properties(CURL::zstd PROPERTIES
INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}"
INTERFACE_COMPILE_OPTIONS "${_zstd_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${_zstd_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${_zstd_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${_zstd_LIBRARIES}")
endif()
endif()
+278
View File
@@ -0,0 +1,278 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
# File defines convenience macros for available feature testing
# Check if header file exists and add it to the list.
# This macro is intended to be called multiple times with a sequence of
# possibly dependent header files. Some headers depend on others to be
# compiled correctly.
macro(check_include_file_concat_curl _file _variable)
check_include_files("${CURL_INCLUDES};${_file}" ${_variable})
if(${_variable})
list(APPEND CURL_INCLUDES ${_file})
endif()
endmacro()
set(CURL_TEST_DEFINES "") # Initialize global variable
# For other curl specific tests, use this macro.
# Return result in variable: CURL_TEST_OUTPUT
macro(curl_internal_test _curl_test)
if(NOT DEFINED "${_curl_test}")
message(STATUS "Performing Test ${_curl_test}")
try_compile(${_curl_test}
${PROJECT_BINARY_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c"
COMPILE_DEFINITIONS "-D${_curl_test}" ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${CMAKE_REQUIRED_DEFINITIONS}
LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE CURL_TEST_OUTPUT)
if(${_curl_test})
set(${_curl_test} 1 CACHE INTERNAL "curl test")
message(STATUS "Performing Test ${_curl_test} - Success")
else()
set(${_curl_test} "" CACHE INTERNAL "curl test")
message(STATUS "Performing Test ${_curl_test} - Failed")
endif()
endif()
endmacro()
# Option for dependencies that accepts an 'AUTO' value, which enables the dependency if detected.
macro(curl_dependency_option _option_name _find_name _desc_name)
set(${_option_name} "AUTO" CACHE STRING "Build curl with ${_desc_name} support (AUTO, ON or OFF)")
set_property(CACHE ${_option_name} PROPERTY STRINGS "AUTO" "ON" "OFF")
if(${_option_name} STREQUAL "AUTO")
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name})
else()
find_package(${_find_name} MODULE)
endif()
elseif(${_option_name})
if(_find_name STREQUAL "ZLIB")
find_package(${_find_name} REQUIRED)
else()
find_package(${_find_name} MODULE REQUIRED)
endif()
else()
string(TOUPPER "${_find_name}" _find_name_upper)
set(${_find_name}_FOUND OFF) # cmake-lint: disable=C0103
set(${_find_name_upper}_FOUND OFF) # cmake-lint: disable=C0103
endif()
endmacro()
# Convert the passed paths to libpath linker options and add them to CMAKE_REQUIRED_*.
macro(curl_required_libpaths _libpaths_arg)
if(CMAKE_VERSION VERSION_LESS 3.31)
set(_libpaths "${_libpaths_arg}")
foreach(_libpath IN LISTS _libpaths)
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}")
endforeach()
else()
list(APPEND CMAKE_REQUIRED_LINK_DIRECTORIES "${_libpaths_arg}")
endif()
endmacro()
# Pre-fill variables set by a check_type_size() call.
macro(curl_prefill_type_size _type _size)
set(HAVE_SIZEOF_${_type} TRUE)
set(SIZEOF_${_type} ${_size})
set(SIZEOF_${_type}_CODE "#define SIZEOF_${_type} ${_size}")
endmacro()
# Internal: Recurse into target libraries and collect their include directories
# and macro definitions.
macro(curl_collect_target_compile_options _target)
get_target_property(_val ${_target} INTERFACE_COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _incsys ${_val})
endif()
get_target_property(_val ${_target} INTERFACE_COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
get_target_property(_val ${_target} LINK_LIBRARIES)
if(_val)
foreach(_lib IN LISTS _val)
if(TARGET "${_lib}")
curl_collect_target_compile_options(${_lib})
endif()
endforeach()
endif()
unset(_val)
endmacro()
# Create a clang-tidy target for test targets
function(curl_add_clang_tidy_test_target _target_clang_tidy _target)
if(CURL_CLANG_TIDY)
set(_definitions "")
set(_includes "")
set(_incsys "")
set(_options "")
# Make a list of known system include directories
set(_sys_incdirs "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
foreach(_inc IN LISTS CMAKE_SYSTEM_PREFIX_PATH)
if(NOT _inc MATCHES "/$")
string(APPEND _inc "/")
endif()
string(APPEND _inc "include")
if(NOT _inc IN_LIST _sys_incdirs AND IS_DIRECTORY "${_inc}")
list(APPEND _sys_incdirs "${_inc}")
endif()
endforeach()
# Collect options applying to the directory
get_directory_property(_val COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_directory_property(_val INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_directory_property(_val COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
# Collect options applying to the target
get_target_property(_val ${_target} COMPILE_DEFINITIONS)
if(_val)
list(APPEND _definitions ${_val})
endif()
get_target_property(_val ${_target} INCLUDE_DIRECTORIES)
if(_val)
list(APPEND _includes ${_val})
endif()
get_target_property(_val ${_target} COMPILE_OPTIONS)
if(_val)
list(APPEND _options ${_val})
endif()
# Collect header directories and macro definitions from lib dependencies
curl_collect_target_compile_options(${_target})
list(REMOVE_ITEM _definitions "")
string(REPLACE ";" ";-D" _definitions ";${_definitions}")
list(REMOVE_DUPLICATES _definitions)
list(SORT _definitions) # Sort like CMake does
list(REMOVE_ITEM _includes "")
string(REPLACE ";" ";-I" _includes ";${_includes}")
list(REMOVE_DUPLICATES _includes)
set(_incsys_tmp ${_incsys})
list(REMOVE_DUPLICATES _incsys_tmp)
set(_incsys "")
set(_incsystop "")
foreach(_inc IN LISTS _incsys_tmp)
if(_inc IN_LIST _sys_incdirs)
list(APPEND _incsystop "${_inc}") # Save system prefixes to re-add them later to the end of list
continue()
endif()
# Avoid empty and '$<INSTALL_INTERFACE:include>' items. The latter
# evaluates to an empty path in this context. Also skip
# '$<BUILD_INTERFACE:curl-include>', as already present in '_includes'.
if(_inc AND
NOT _inc MATCHES "INSTALL_INTERFACE:" AND
NOT _inc MATCHES "BUILD_INTERFACE:")
list(APPEND _incsys "-isystem" "${_inc}")
endif()
endforeach()
foreach(_inc IN LISTS _incsystop)
list(APPEND _incsys "-isystem" "${_inc}")
endforeach()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(REMOVE_DUPLICATES _options) # Keep the first of duplicates to imitate CMake
else()
set(_options)
endif()
# Assemble source list
set(_sources "")
foreach(_source IN ITEMS ${ARGN})
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_source}") # if not in source tree
set(_source "${CMAKE_CURRENT_BINARY_DIR}/${_source}") # look in the build tree, for generated files, e.g. lib1521.c
endif()
list(APPEND _sources "${_source}")
endforeach()
set(_cc "${CMAKE_C_COMPILER}")
if(CMAKE_C_COMPILER_TARGET AND CMAKE_C_COMPILE_OPTIONS_TARGET)
list(APPEND _cc "${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}")
endif()
if(APPLE AND CMAKE_OSX_SYSROOT)
list(APPEND _cc "-isysroot" "${CMAKE_OSX_SYSROOT}")
elseif(CMAKE_SYSROOT AND CMAKE_C_COMPILE_OPTIONS_SYSROOT)
list(APPEND _cc "${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}")
endif()
# Pass -clang-diagnostic-unused-function to disable -Wunused-function implied by -Wunused
add_custom_target(${_target_clang_tidy} USES_TERMINAL
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND ${CMAKE_C_CLANG_TIDY}
"--checks=-clang-diagnostic-unused-function"
${_sources} -- ${_cc} ${_definitions} ${_includes} ${_incsys} ${_options}
DEPENDS ${_sources})
add_dependencies(tests-clang-tidy ${_target_clang_tidy})
endif()
endfunction()
# Internal: Recurse into interface targets and collect their libraries
# and library paths.
macro(curl_collect_target_link_options _target)
get_target_property(_val ${_target} INTERFACE_LINK_DIRECTORIES)
if(_val)
list(APPEND _libdirs ${_val})
endif()
get_target_property(_val ${_target} IMPORTED)
if(_val)
# LOCATION is empty for interface library targets and safe to ignore.
# Explicitly skip this query to avoid CMake v3.18 and older erroring out.
get_target_property(_val ${_target} TYPE)
if(NOT "${_val}" STREQUAL "INTERFACE_LIBRARY")
get_target_property(_val ${_target} LOCATION)
if(_val)
list(APPEND _libs ${_val})
endif()
endif()
endif()
get_target_property(_val ${_target} INTERFACE_LINK_LIBRARIES)
if(_val)
foreach(_lib IN LISTS _val)
if(TARGET "${_lib}")
curl_collect_target_link_options(${_lib})
else()
list(APPEND _libs ${_lib})
endif()
endforeach()
endif()
unset(_val)
endmacro()
+149
View File
@@ -0,0 +1,149 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
include(CheckCSourceCompiles)
include(CheckCSourceRuns)
include(CheckTypeSize)
# #include header if condition is true
macro(curl_add_header_include _check _header)
if(${_check})
set(_source_epilogue "${_source_epilogue}
#include <${_header}>")
endif()
endmacro()
set(_cmake_try_compile_target_type_save ${CMAKE_TRY_COMPILE_TARGET_TYPE})
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE)
cmake_push_check_state()
set(CMAKE_EXTRA_INCLUDE_FILES "")
if(WIN32)
set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h")
list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32")
else()
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
endif()
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
set(HAVE_STRUCT_SOCKADDR_STORAGE ${HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE})
cmake_pop_check_state()
endif()
set(_source_epilogue "#undef inline")
check_c_source_compiles("${_source_epilogue}
#ifdef _MSC_VER
#include <winsock2.h>
#endif
#ifndef _WIN32
#include <sys/time.h>
#endif
#include <time.h>
int main(void)
{
struct timeval ts;
ts.tv_sec = 0;
ts.tv_usec = 0;
(void)ts;
return 0;
}" HAVE_STRUCT_TIMEVAL)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_cmake_try_compile_target_type_save})
unset(_cmake_try_compile_target_type_save)
# Detect HAVE_GETADDRINFO_THREADSAFE
if(WIN32)
set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO})
elseif(NOT HAVE_GETADDRINFO)
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
elseif(APPLE OR
AIX OR CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HAVE_GETADDRINFO_THREADSAFE TRUE)
elseif(BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD")
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
endif()
if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)
set(_source_epilogue "#undef inline
#ifndef _WIN32
#include <sys/socket.h>
#include <sys/time.h>
#endif")
curl_add_header_include(HAVE_NETDB_H "netdb.h")
check_c_source_compiles("${_source_epilogue}
int main(void)
{
#ifndef h_errno
#error force compilation error
#endif
return 0;
}" HAVE_H_ERRNO)
if(NOT HAVE_H_ERRNO)
check_c_source_compiles("${_source_epilogue}
int main(void)
{
h_errno = 2;
return h_errno != 0 ? 1 : 0;
}" HAVE_H_ERRNO_ASSIGNABLE)
if(NOT HAVE_H_ERRNO_ASSIGNABLE)
check_c_source_compiles("${_source_epilogue}
int main(void)
{
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
#else
#error force compilation error
#endif
return 0;
}" HAVE_H_ERRNO_SBS_ISSUE_7)
endif()
endif()
if(HAVE_H_ERRNO OR HAVE_H_ERRNO_ASSIGNABLE OR HAVE_H_ERRNO_SBS_ISSUE_7)
set(HAVE_GETADDRINFO_THREADSAFE TRUE)
endif()
endif()
if(NOT WIN32 AND NOT DEFINED HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
set(_source_epilogue "#undef inline")
curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
check_c_source_compiles("${_source_epilogue}
#include <sys/time.h>
#include <time.h>
int main(void)
{
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
return 0;
}" HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
endif()
unset(_source_epilogue)
+461
View File
@@ -0,0 +1,461 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
include(CheckCCompilerFlag)
set(_picky "")
set(_picky_nocheck "") # not to pass to feature checks
if(CURL_WERROR)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
elseif(MSVC)
list(APPEND _picky_nocheck "-WX")
else() # llvm/clang and gcc-style options
list(APPEND _picky_nocheck "-Werror")
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
NOT DOS AND # Watt-32 headers use the '#include_next' GCC extension
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) OR
CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND _picky_nocheck "-pedantic-errors")
endif()
endif()
if(APPLE AND
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.1
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND _picky "-Werror-implicit-function-declaration") # clang 1.0 gcc 2.95
endif()
if(MSVC)
list(APPEND _picky "-W4") # Use the highest warning level for Visual Studio.
elseif(BORLAND)
list(APPEND _picky "-w-") # Disable warnings on Borland to avoid changing 3rd party code.
endif()
if(PICKY_COMPILER)
# Leave disabled for GCC <4.6, because they lack #pragma features to silence locally.
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6) OR
CMAKE_C_COMPILER_ID MATCHES "Clang")
# https://clang.llvm.org/docs/DiagnosticsReference.html
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
# _picky_enable = Options we want to enable as-is.
# _picky_detect = Options we want to test first and enable if available.
# Prefer the -Wextra alias with clang.
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(_picky_enable "-Wextra")
else()
set(_picky_enable "-W")
endif()
list(APPEND _picky_enable "-Wall")
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.2) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) OR
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
list(APPEND _picky_enable "-Wpedantic") # clang 3.2 gcc 4.8 appleclang 4.2
else()
list(APPEND _picky_enable "-pedantic")
endif()
# ----------------------------------
# Add new options here, if in doubt:
# ----------------------------------
set(_picky_detect
)
# Notes: -Wno-* options should ideally be disabled at their precise cutoff versions,
# to suppress undesired warnings in case -Weverything is passed as a custom option.
# Assume these options always exist with both clang and gcc.
# Require clang 3.0 / gcc 2.95 or later.
list(APPEND _picky_enable
-Wbad-function-cast # clang 2.7 gcc 2.95
-Wconversion # clang 2.7 gcc 2.95
-Wmissing-declarations # clang 1.0 gcc 2.7
-Wmissing-prototypes # clang 1.0 gcc 1.0
-Wnested-externs # clang 1.0 gcc 2.7
-Wno-long-long # clang 1.0 gcc 2.95
-Wno-multichar # clang 1.0 gcc 2.95
-Wpointer-arith # clang 1.0 gcc 1.4
-Wshadow # clang 1.0 gcc 2.95
-Wsign-compare # clang 1.0 gcc 2.95
-Wundef # clang 1.0 gcc 2.95
-Wunused # clang 1.1 gcc 2.95
-Wwrite-strings # clang 1.0 gcc 1.4
)
# Always enable with clang, version dependent with gcc
set(_picky_common_old
-Waddress # clang 2.7 gcc 4.3
-Wattributes # clang 2.7 gcc 4.1
-Wcast-align # clang 1.0 gcc 4.2
-Wcast-qual # clang 2.7 gcc 3.4.6
-Wdeclaration-after-statement # clang 1.0 gcc 3.4
-Wdiv-by-zero # clang 2.7 gcc 4.1
-Wempty-body # clang 2.7 gcc 4.3
-Wendif-labels # clang 1.0 gcc 3.3
-Wfloat-equal # clang 1.0 gcc 2.96 (3.0)
-Wformat-security # clang 2.7 gcc 4.1
-Wignored-qualifiers # clang 2.8 gcc 4.3
-Wmissing-field-initializers # clang 2.7 gcc 4.1
-Wmissing-noreturn # clang 2.7 gcc 4.1
-Wno-padded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
-Wno-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
-Wold-style-definition # clang 2.7 gcc 3.4
-Wredundant-decls # clang 2.7 gcc 4.1
-Wstrict-prototypes # clang 1.0 gcc 3.3
-Wtype-limits # clang 2.7 gcc 4.3
-Wunreachable-code # clang 2.7 gcc 4.1
# -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
# -Wno-error=unused-macros # clang 2.7 gcc 4.1
-Wunused-parameter # clang 2.7 gcc 4.1
-Wvla # clang 2.8 gcc 4.3
)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND _picky_enable
${_picky_common_old}
-Wconditional-uninitialized # clang 3.0
-Wno-used-but-marked-unused # clang 2.9 # for typecheck-gcc.h with clang 14+, dependency headers
-Wshift-sign-overflow # clang 2.9
-Wshorten-64-to-32 # clang 1.0
-Wformat=2 # clang 2.7 gcc 4.8
)
if(NOT MSVC)
list(APPEND _picky_enable
-Wlanguage-extension-token # clang 3.0
)
endif()
# Enable based on compiler version
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.1)
list(APPEND _picky_enable
-Wno-covered-switch-default # clang 3.1 appleclang 3.1 # Annoying to fix or silence
-Wno-disabled-macro-expansion # clang 3.1 appleclang 3.1 # for std headers, and curl/curl.h (rare combos)
)
if(MSVC)
list(APPEND _picky_enable
-Wno-format-non-iso # clang 3.1 appleclang 3.1 # 'q' length modifier is not supported by ISO C
)
else()
list(APPEND _picky_enable
-Wformat-non-iso # clang 3.1 appleclang 3.1
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.3) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0))
list(APPEND _picky_enable
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
-Wmissing-variable-declarations # clang 3.2 appleclang 4.2
-Wno-documentation-unknown-command # clang 3.3 appleclang 5.0
-Wsometimes-uninitialized # clang 3.2 appleclang 4.2
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
-Wheader-guard # clang 3.4 appleclang 5.1
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
# -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
list(APPEND _picky_enable
-Wcomma # clang 3.9 appleclang 8.1
)
if(MSVC)
list(APPEND _picky_enable
-Wno-nonportable-system-include-path # clang 3.9 appleclang 8.1 # No truly portable solution to this
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11))
list(APPEND _picky_enable
-Wassign-enum # clang 7.0 appleclang 11.0
-Wextra-semi-stmt # clang 7.0 appleclang 11.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12))
list(APPEND _picky_enable
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0 # We do silencing for clang 10.0 and above only
-Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1))
list(APPEND _picky_enable
-Wcast-function-type # clang 13.0 appleclang 13.1
-Wreserved-identifier # clang 13.0 appleclang 13.1 # Keep it before -Wno-reserved-macro-identifier
-Wno-reserved-macro-identifier # clang 13.0 appleclang 13.1 # External macros have to be set sometimes
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.3))
if(CMAKE_GENERATOR STREQUAL "FASTBuild")
list(APPEND _picky_enable
-Wno-gnu-line-marker # clang 15.0 appleclang 14.0.3
)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
list(APPEND _picky_enable
-Wno-unsafe-buffer-usage # clang 16.0 appleclang 15.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0))
list(APPEND _picky_enable
-Wcast-function-type-strict # clang 16.0 appleclang 16.0
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.1) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0))
list(APPEND _picky_enable
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default
)
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 26.4))
list(APPEND _picky_enable
-Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
-Wc++-hidden-decl # clang 21.1 appleclang 26.4
-Wimplicit-int-enum-cast # clang 21.1
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
-Wno-implicit-void-ptr-cast # clang 21.1 appleclang 26.4
-Wtentative-definition-compat # clang 21.1 appleclang 26.4
)
if(WIN32)
list(APPEND _picky_enable
-Wno-c++-keyword # clang 21.1 appleclang 26.4 # `wchar_t` triggers it on Windows
)
else()
list(APPEND _picky_enable
-Wc++-keyword # clang 21.1 appleclang 26.4
)
endif()
endif()
else() # gcc
# Enable based on compiler version
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
list(APPEND _picky_enable
${_picky_common_old}
-Wclobbered # gcc 4.3
-Wmissing-parameter-type # gcc 4.3
-Wold-style-declaration # gcc 4.3
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
-Wstrict-aliasing=3 # gcc 4.0
-ftree-vrp # gcc 4.3 (required for -Warray-bounds, included in -Wall)
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
list(APPEND _picky_enable
-Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
)
if(MINGW)
list(APPEND _picky_enable
-Wno-pedantic-ms-format # gcc 4.5 (MinGW-only)
)
endif()
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
list(APPEND _picky_enable
-Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
-Wformat=2 # clang 2.7 gcc 4.8
-Wtrampolines # gcc 4.6
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
list(APPEND _picky_enable
-Warray-bounds=2 # clang 2.9 gcc 5.0 (clang default: -Warray-bounds)
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
list(APPEND _picky_enable
-Wduplicated-cond # gcc 6.0
-Wnull-dereference # clang 2.9 gcc 6.0 (clang default)
-fdelete-null-pointer-checks
-Wshift-negative-value # clang 3.7 gcc 6.0 (clang default)
-Wshift-overflow=2 # clang 2.9 gcc 6.0 (clang default: -Wshift-overflow)
-Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
list(APPEND _picky_enable
-Walloc-zero # gcc 7.0
-Wduplicated-branches # gcc 7.0
-Wformat-truncation=2 # gcc 7.0
-Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0
-Wrestrict # gcc 7.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
list(APPEND _picky_enable
-Warith-conversion # gcc 10.0
-Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
list(APPEND _picky_enable
-Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
-Wenum-int-mismatch # gcc 13.0
-Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
list(APPEND _picky_enable
-Wleading-whitespace=spaces # gcc 15.0
-Wtrailing-whitespace=any # gcc 15.0
-Wunterminated-string-initialization # gcc 15.0
)
endif()
endif()
# Assemble list of flags
set(_picky_skipped "")
foreach(_ccopt IN LISTS _picky_enable)
string(REGEX MATCH "-W([a-z0-9+-]+)" _ccmatch "${_ccopt}")
string(REPLACE "+" "\\+" _cmake_match_1 "${CMAKE_MATCH_1}") # escape '+' to make it a valid regex
if(_ccmatch AND "${CMAKE_C_FLAGS} " MATCHES "-Wno-${_cmake_match_1} " AND
NOT _ccopt STREQUAL "-Wall" AND
NOT _ccopt MATCHES "^-Wno-")
string(APPEND _picky_skipped " ${_ccopt}")
else()
list(APPEND _picky "${_ccopt}")
endif()
endforeach()
if(_picky_skipped)
message(STATUS "Picky compiler options skipped due to CMAKE_C_FLAGS override:${_picky_skipped}")
endif()
foreach(_ccopt IN LISTS _picky_detect)
# Use a unique variable name 1. for meaningful log output 2. to have a fresh, undefined variable for each detection
string(MAKE_C_IDENTIFIER "OPT${_ccopt}" _optvarname)
# GCC only warns about unknown -Wno- options if there are also other diagnostic messages,
# so test for the positive form instead
string(REPLACE "-Wno-" "-W" _ccopt_on "${_ccopt}")
check_c_compiler_flag(${_ccopt_on} ${_optvarname})
if(${_optvarname})
list(APPEND _picky "${_ccopt}")
endif()
endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.0 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
list(APPEND _picky "-Wno-missing-field-initializers") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
list(APPEND _picky "-Wno-type-limits") # Avoid false positives
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.5)
list(APPEND _picky "-Wno-conversion") # Avoid false positives
endif()
endif()
elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1950) # Skip for untested/unreleased newer versions
list(APPEND _picky "-Wall")
list(APPEND _picky "-wd4061") # enumerator 'A' in switch of enum 'B' is not explicitly handled by a case label
list(APPEND _picky "-wd4191") # 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)(void)'
list(APPEND _picky "-wd4255") # no function prototype given: converting '()' to '(void)' (in winuser.h)
list(APPEND _picky "-wd4464") # relative include path contains '..'
list(APPEND _picky "-wd4548") # expression before comma has no effect; expected expression with side-effect (in FD_SET())
list(APPEND _picky "-wd4574") # 'M' is defined to be '0': did you mean to use '#if M'? (in ws2tcpip.h)
list(APPEND _picky "-wd4668") # 'M' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' (in winbase.h)
list(APPEND _picky "-wd4710") # 'fprintf'/'printf'/'sscanf': function not inlined (in tests, with VS2022+ Release)
list(APPEND _picky "-wd4711") # function 'A' selected for automatic inline expansion
# volatile access of '<expression>' is subject to /volatile:<iso|ms> setting;
# consider using __iso_volatile_load/store intrinsic functions (ARM64)
list(APPEND _picky "-wd4746")
list(APPEND _picky "-wd4820") # 'A': 'N' bytes padding added after data member 'B'
if(MSVC_VERSION GREATER_EQUAL 1900)
list(APPEND _picky "-wd5045") # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
endif()
endif()
endif()
# clang-cl
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
list(APPEND _picky "-Wno-language-extension-token") # Allow __int64
foreach(_wlist IN ITEMS _picky_nocheck _picky)
set(_picky_tmp "")
foreach(_ccopt IN LISTS "${_wlist}")
# Prefix -Wall, otherwise clang-cl interprets it as an MSVC option and translates it to -Weverything
if(_ccopt MATCHES "^-W" AND NOT _ccopt STREQUAL "-Wall")
list(APPEND _picky_tmp ${_ccopt})
else()
list(APPEND _picky_tmp "-clang:${_ccopt}")
endif()
endforeach()
set("${_wlist}" ${_picky_tmp}) # cmake-lint: disable=C0103
endforeach()
endif()
if(CMAKE_C_STANDARD STREQUAL 90)
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2))
list(APPEND _picky "-Wno-c99-extensions") # Avoid: warning: '_Bool' is a C99 extension
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
list(APPEND _picky "-Wno-comma") # Just silly
endif()
endif()
if(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
list(APPEND _picky "-Wno-arith-conversion") # Avoid warnings in DJGPP's built-in FD_SET() macro
endif()
if(_picky_nocheck OR _picky)
set(_picky_tmp "${_picky_nocheck}" "${_picky}")
string(REPLACE ";" " " _picky_tmp "${_picky_tmp}")
string(STRIP "${_picky_tmp}" _picky_tmp)
message(STATUS "Picky compiler options: ${_picky_tmp}")
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "${_picky_nocheck}" "${_picky}")
# Apply to all feature checks
string(REPLACE ";" " " _picky_tmp "${_picky}")
string(APPEND CMAKE_REQUIRED_FLAGS " ${_picky_tmp}")
unset(_picky)
unset(_picky_tmp)
endif()
+86
View File
@@ -0,0 +1,86 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
# File containing various utilities
# Return number of arguments that evaluate to true
function(curl_count_true _output_count_var)
set(_list_len 0)
foreach(_option_var IN LISTS ARGN)
if(${_option_var})
math(EXPR _list_len "${_list_len} + 1")
endif()
endforeach()
set(${_output_count_var} ${_list_len} PARENT_SCOPE)
endfunction()
# Dump all defined variables with their values
function(curl_dumpvars)
message("::group::CMake Variable Dump")
get_cmake_property(_vars VARIABLES)
foreach(_var IN ITEMS ${_vars})
get_property(_var_type CACHE ${_var} PROPERTY TYPE)
get_property(_var_advanced CACHE ${_var} PROPERTY ADVANCED)
if(_var_type)
set(_var_type ":${_var_type}")
endif()
if(_var_advanced)
set(_var_advanced " [adv]")
endif()
message("${_var}${_var_type}${_var_advanced} = '${${_var}}'")
endforeach()
message("::endgroup::")
endfunction()
# Dump all target properties
function(curl_dumptargetprops _target)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19 AND TARGET "${_target}")
execute_process(COMMAND "${CMAKE_COMMAND}" "--help-property-list" OUTPUT_VARIABLE _cmake_property_list)
string(REPLACE "\n" ";" _cmake_property_list "${_cmake_property_list}")
list(REMOVE_DUPLICATES _cmake_property_list)
list(REMOVE_ITEM _cmake_property_list "")
list(APPEND _cmake_property_list "INTERFACE_LIBCURL_PC_MODULES")
get_target_property(_target_imported ${_target} IMPORTED)
if(NOT _target_imported)
list(REMOVE_ITEM _cmake_property_list "LOCATION" "LOCATION_<CONFIG>" "MACOSX_PACKAGE_LOCATION" "VS_DEPLOYMENT_LOCATION")
endif()
foreach(_prop IN LISTS _cmake_property_list)
if(_prop MATCHES "<CONFIG>")
foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO")
string(REPLACE "<CONFIG>" "${_config}" _propconfig "${_prop}")
get_property(_is_set TARGET "${_target}" PROPERTY "${_propconfig}" SET)
if(_is_set)
get_target_property(_val "${_target}" "${_propconfig}")
message("${_target}.${_propconfig} = '${_val}'")
endif()
endforeach()
else()
get_property(_is_set TARGET "${_target}" PROPERTY "${_prop}" SET)
if(_is_set)
get_target_property(_val "${_target}" "${_prop}")
message("${_target}.${_prop} = '${_val}'")
endif()
endif()
endforeach()
endif()
endfunction()
+50
View File
@@ -0,0 +1,50 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif()
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
endif()
message(${CMAKE_INSTALL_PREFIX})
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" _files)
string(REGEX REPLACE "\n" ";" _files "${_files}")
foreach(_file ${_files})
message(STATUS "Uninstalling $ENV{DESTDIR}${_file}")
if(IS_SYMLINK "$ENV{DESTDIR}${_file}" OR EXISTS "$ENV{DESTDIR}${_file}")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${_file}"
RESULT_VARIABLE rm_retval
OUTPUT_QUIET
ERROR_QUIET
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${_file}")
endif()
else()
message(STATUS "File $ENV{DESTDIR}${_file} does not exist.")
endif()
endforeach()
+196
View File
@@ -0,0 +1,196 @@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
@PACKAGE_INIT@
option(CURL_USE_CMAKECONFIG "Enable detecting @PROJECT_NAME@ dependencies via CMake Config. Default: @CURL_USE_CMAKECONFIG@"
"@CURL_USE_CMAKECONFIG@")
option(CURL_USE_PKGCONFIG "Enable pkg-config to detect @PROJECT_NAME@ dependencies. Default: @CURL_USE_PKGCONFIG@"
"@CURL_USE_PKGCONFIG@")
if(CMAKE_VERSION VERSION_LESS @CMAKE_MINIMUM_REQUIRED_VERSION@)
message(STATUS "@PROJECT_NAME@: @PROJECT_NAME@-specific Find modules require "
"CMake @CMAKE_MINIMUM_REQUIRED_VERSION@ or upper, found: ${CMAKE_VERSION}.")
endif()
include(CMakeFindDependencyMacro)
if("@HAVE_THREADS_POSIX@" OR "@HAVE_THREADS_POSIX_BORINGSSL@")
find_dependency(Threads) # for Threads::Threads
endif()
if("@USE_OPENSSL@")
if("@OPENSSL_VERSION_MAJOR@")
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
else()
find_dependency(OpenSSL)
endif()
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(TARGET OpenSSL::Crypto AND NOT TARGET CURL::OpenSSL_Crypto)
add_library(CURL::OpenSSL_Crypto INTERFACE IMPORTED)
set_target_properties(CURL::OpenSSL_Crypto PROPERTIES INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
endif()
endif()
if("@HAVE_LIBZ@")
find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@")
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(TARGET ZLIB::ZLIB AND NOT TARGET CURL::ZLIB)
add_library(CURL::ZLIB INTERFACE IMPORTED)
set_target_properties(CURL::ZLIB PROPERTIES INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
endif()
endif()
set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH})
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
set(_curl_libs "")
if("@HAVE_BROTLI@")
find_dependency(Brotli MODULE)
list(APPEND _curl_libs CURL::brotli)
endif()
if("@USE_ARES@")
find_dependency(Cares MODULE)
list(APPEND _curl_libs CURL::cares)
endif()
if("@HAVE_GSSAPI@")
find_dependency(GSS MODULE)
list(APPEND _curl_libs CURL::gss)
endif()
if("@USE_BACKTRACE@")
find_dependency(Libbacktrace MODULE)
list(APPEND _curl_libs CURL::libbacktrace)
endif()
if("@USE_GSASL@")
find_dependency(Libgsasl MODULE)
list(APPEND _curl_libs CURL::libgsasl)
endif()
if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@")
find_dependency(LDAP MODULE)
list(APPEND _curl_libs CURL::ldap)
endif()
if("@HAVE_LIBIDN2@")
find_dependency(Libidn2 MODULE)
list(APPEND _curl_libs CURL::libidn2)
endif()
if("@USE_LIBPSL@")
find_dependency(Libpsl MODULE)
list(APPEND _curl_libs CURL::libpsl)
endif()
if("@USE_LIBSSH@")
find_dependency(Libssh MODULE)
list(APPEND _curl_libs CURL::libssh)
endif()
if("@USE_LIBSSH2@")
find_dependency(Libssh2 MODULE)
list(APPEND _curl_libs CURL::libssh2)
endif()
if("@USE_LIBUV@")
find_dependency(Libuv MODULE)
list(APPEND _curl_libs CURL::libuv)
endif()
if("@USE_MBEDTLS@")
find_dependency(MbedTLS MODULE)
list(APPEND _curl_libs CURL::mbedtls)
endif()
if("@USE_NGHTTP2@")
find_dependency(NGHTTP2 MODULE)
list(APPEND _curl_libs CURL::nghttp2)
endif()
if("@USE_NGHTTP3@")
find_dependency(NGHTTP3 MODULE)
list(APPEND _curl_libs CURL::nghttp3)
endif()
if("@USE_NGTCP2@")
find_dependency(NGTCP2 MODULE)
list(APPEND _curl_libs CURL::ngtcp2)
endif()
if("@USE_GNUTLS@")
find_dependency(GnuTLS MODULE)
list(APPEND _curl_libs CURL::gnutls)
find_dependency(Nettle MODULE)
list(APPEND _curl_libs CURL::nettle)
endif()
if("@USE_QUICHE@")
find_dependency(Quiche MODULE)
list(APPEND _curl_libs CURL::quiche)
endif()
if("@USE_RUSTLS@")
find_dependency(Rustls MODULE)
list(APPEND _curl_libs CURL::rustls)
endif()
if("@USE_WOLFSSL@")
find_dependency(WolfSSL MODULE)
list(APPEND _curl_libs CURL::wolfssl)
endif()
if("@HAVE_ZSTD@")
find_dependency(Zstd MODULE)
list(APPEND _curl_libs CURL::zstd)
endif()
set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save})
# Define lib duplicate to fixup lib order for GCC binutils ld in static builds
if(WIN32 AND NOT TARGET CURL::win32_winsock)
add_library(CURL::win32_winsock INTERFACE IMPORTED)
set_target_properties(CURL::win32_winsock PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
# Alias for either shared or static library
if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@)
add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
endif()
# For compatibility with CMake's FindCURL.cmake
set(CURL_VERSION_STRING "@CURLVERSION@")
set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@)
set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@")
set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@")
set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@")
foreach(_curl_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES)
set(CURL_SUPPORTS_${_curl_item} TRUE)
endforeach()
set(_curl_missing_req "")
foreach(_curl_item IN LISTS CURL_FIND_COMPONENTS)
if(CURL_SUPPORTS_${_curl_item})
set(CURL_${_curl_item}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED_${_curl_item})
list(APPEND _curl_missing_req ${_curl_item})
endif()
endforeach()
if(_curl_missing_req)
string(REPLACE ";" " " _curl_missing_req "${_curl_missing_req}")
if(CURL_FIND_REQUIRED)
message(FATAL_ERROR "@PROJECT_NAME@: missing required components: ${_curl_missing_req}")
endif()
unset(_curl_missing_req)
endif()
check_required_components("@PROJECT_NAME@")
+303
View File
@@ -0,0 +1,303 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
# Based on CI runs for Cygwin/MSYS2, Linux, macOS, FreeBSD, NetBSD, OpenBSD
if(NOT UNIX)
message(FATAL_ERROR "This file should be included on Unix platforms only")
endif()
if(APPLE OR
CYGWIN)
set(HAVE_ACCEPT4 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_ACCEPT4 1)
endif()
set(HAVE_ALARM 1)
if(ANDROID)
set(HAVE_ARC4RANDOM 1)
else()
set(HAVE_ARC4RANDOM 0)
endif()
set(HAVE_ARPA_INET_H 1)
set(HAVE_ATOMIC 1)
set(HAVE_BASENAME 1)
set(HAVE_BOOL_T 1)
if(NOT APPLE)
set(HAVE_CLOCK_GETTIME_MONOTONIC 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 1)
else()
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 0)
endif()
endif()
set(HAVE_CLOSESOCKET 0)
set(HAVE_DECL_FSEEKO 1)
set(HAVE_DIRENT_H 1)
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_EVENTFD 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_EVENTFD 1)
endif()
set(HAVE_FCNTL 1)
set(HAVE_FCNTL_H 1)
set(HAVE_FCNTL_O_NONBLOCK 1)
set(HAVE_FILE_OFFSET_BITS 1)
set(HAVE_FNMATCH 1)
set(HAVE_FREEADDRINFO 1)
set(HAVE_FSEEKO 1)
if(APPLE)
set(HAVE_FSETXATTR 1)
set(HAVE_FSETXATTR_5 0)
set(HAVE_FSETXATTR_6 1)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_FSETXATTR 0)
set(HAVE_FSETXATTR_5 0)
set(HAVE_FSETXATTR_6 0)
elseif(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_FSETXATTR 1)
set(HAVE_FSETXATTR_5 1)
set(HAVE_FSETXATTR_6 0)
endif()
set(HAVE_GETADDRINFO 1)
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)
endif()
set(HAVE_GETEUID 1)
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETHOSTBYNAME_R 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(HAVE_GETHOSTBYNAME_R 1)
endif()
set(HAVE_GETHOSTBYNAME_R_3 0)
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_5 0)
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_GETHOSTBYNAME_R_6 1)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 1)
else()
set(HAVE_GETHOSTBYNAME_R_6 0)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
endif()
set(HAVE_GETHOSTNAME 1)
if(NOT ANDROID OR ANDROID_PLATFORM_LEVEL GREATER_EQUAL 24)
set(HAVE_GETIFADDRS 1)
else()
set(HAVE_GETIFADDRS 0)
endif()
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_GETPASS_R 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_GETPASS_R 1)
endif()
set(HAVE_GETPEERNAME 1)
set(HAVE_GETPPID 1)
set(HAVE_GETPWUID 1)
set(HAVE_GETPWUID_R 1)
set(HAVE_GETRLIMIT 1)
set(HAVE_GETSOCKNAME 1)
set(HAVE_GETTIMEOFDAY 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Depends on C library.
else()
set(HAVE_GLIBC_STRERROR_R 0)
endif()
set(HAVE_GMTIME_R 1)
set(HAVE_IFADDRS_H 1)
set(HAVE_IF_NAMETOINDEX 1)
set(HAVE_INET_NTOP 1)
set(HAVE_INET_PTON 1)
set(HAVE_IOCTLSOCKET 0)
set(HAVE_IOCTLSOCKET_CAMEL 0)
set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0)
set(HAVE_IOCTLSOCKET_FIONBIO 0)
set(HAVE_IOCTL_FIONBIO 1)
set(HAVE_IOCTL_SIOCGIFADDR 1)
if(CYGWIN)
set(HAVE_IO_H 1)
else()
set(HAVE_IO_H 0)
endif()
set(HAVE_LIBGEN_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Requires Linux kernel userspace headers. Expected with glibc. May be missing by default with MUSL.
else()
set(HAVE_LINUX_TCP_H 0)
endif()
set(HAVE_LOCALE_H 1)
set(HAVE_LOCALTIME_R 1)
if(APPLE)
set(HAVE_MACH_ABSOLUTE_TIME 1)
endif()
if(APPLE OR
CYGWIN)
set(HAVE_MEMRCHR 0)
else()
set(HAVE_MEMRCHR 1)
endif()
set(HAVE_NETDB_H 1)
if(ANDROID)
set(HAVE_NETINET_IN6_H 1)
else()
set(HAVE_NETINET_IN6_H 0)
endif()
set(HAVE_NETINET_IN_H 1)
set(HAVE_NETINET_TCP_H 1)
set(HAVE_NETINET_UDP_H 1)
set(HAVE_NET_IF_H 1)
set(HAVE_OPENDIR 1)
set(HAVE_PIPE 1)
if(APPLE OR
CYGWIN)
set(HAVE_PIPE2 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
BSD OR
CMAKE_SYSTEM_NAME STREQUAL "DragonFlyBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HAVE_PIPE2 1)
endif()
set(HAVE_POLL 1)
set(HAVE_POLL_H 1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Depends on C library.
else()
set(HAVE_POSIX_STRERROR_R 1)
endif()
set(HAVE_PWD_H 1)
set(HAVE_REALPATH 1)
set(HAVE_RECV 1)
set(HAVE_SA_FAMILY_T 1)
set(HAVE_SCHED_YIELD 1)
set(HAVE_SELECT 1)
set(HAVE_SEND 1)
if(APPLE OR
CYGWIN)
set(HAVE_SENDMMSG 0)
else()
set(HAVE_SENDMMSG 1)
endif()
set(HAVE_SENDMSG 1)
set(HAVE_SETLOCALE 1)
set(HAVE_SETRLIMIT 1)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 1)
set(HAVE_SIGINTERRUPT 1)
set(HAVE_SIGNAL 1)
set(HAVE_SIGSETJMP 1)
set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 1)
set(HAVE_STDATOMIC_H 1)
set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STRCASECMP 1)
set(HAVE_STRCMPI 0)
set(HAVE_STRERROR_R 1)
set(HAVE_STRICMP 0)
set(HAVE_STRINGS_H 1)
if(_CURL_OLD_LINUX)
set(HAVE_STROPTS_H 1)
else()
set(HAVE_STROPTS_H 0) # glibc 2.30 or newer. https://sourceware.org/legacy-ml/libc-alpha/2019-08/msg00029.html
endif()
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
set(HAVE_STRUCT_TIMEVAL 1)
if(ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(HAVE_SUSECONDS_T 1)
endif()
if(APPLE OR
CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
set(HAVE_SYS_EVENTFD_H 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(HAVE_SYS_EVENTFD_H 1)
endif()
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_SYS_FILIO_H 0)
else()
set(HAVE_SYS_FILIO_H 1)
endif()
set(HAVE_SYS_IOCTL_H 1)
set(HAVE_SYS_PARAM_H 1)
set(HAVE_SYS_POLL_H 1)
set(HAVE_SYS_RESOURCE_H 1)
set(HAVE_SYS_SELECT_H 1)
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_SYS_SOCKIO_H 0)
else()
set(HAVE_SYS_SOCKIO_H 1)
endif()
set(HAVE_SYS_TYPES_H 1)
set(HAVE_SYS_UN_H 1)
if(CYGWIN)
set(HAVE_SYS_UTIME_H 1)
else()
set(HAVE_SYS_UTIME_H 0)
endif()
set(HAVE_TERMIOS_H 1)
if(CYGWIN OR
CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(HAVE_TERMIO_H 1)
else()
set(HAVE_TERMIO_H 0)
endif()
set(HAVE_TIME_T_UNSIGNED 0)
set(HAVE_UNISTD_H 1)
set(HAVE_UTIME 1)
set(HAVE_UTIMES 1)
set(HAVE_UTIME_H 1)
set(HAVE_WRITABLE_ARGV 1)
set(STDC_HEADERS 1)
set(USE_UNIX_SOCKETS 1)
+192
View File
@@ -0,0 +1,192 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
if(NOT WIN32)
message(FATAL_ERROR "This file should be included on Windows platform only")
endif()
if(MINGW)
set(HAVE_BASENAME 1)
set(HAVE_BOOL_T 1) # = HAVE_STDBOOL_H
set(HAVE_DIRENT_H 1)
set(HAVE_GETTIMEOFDAY 1)
set(HAVE_LIBGEN_H 1)
set(HAVE_OPENDIR 1)
set(HAVE_STDBOOL_H 1)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STRINGS_H 1) # wrapper to string.h
set(HAVE_SYS_PARAM_H 1)
set(HAVE_UNISTD_H 1)
set(HAVE_UTIME_H 1) # wrapper to sys/utime.h
else()
set(HAVE_DIRENT_H 0)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_LIBGEN_H 0)
set(HAVE_OPENDIR 0)
set(HAVE_STRINGS_H 0)
set(HAVE_SYS_PARAM_H 0)
set(HAVE_UTIME_H 0)
if(MSVC)
set(HAVE_UNISTD_H 0)
set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size()
set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size()
if(MSVC_VERSION GREATER_EQUAL 1800)
set(HAVE_STDBOOL_H 1)
else()
set(HAVE_STDBOOL_H 0)
endif()
set(HAVE_BOOL_T "${HAVE_STDBOOL_H}")
set(HAVE_BASENAME 0)
endif()
endif()
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.9) OR
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6))
# MinGW or clang-cl
set(HAVE_STDATOMIC_H 1)
set(HAVE_ATOMIC 1)
else()
set(HAVE_STDATOMIC_H 0)
set(HAVE_ATOMIC 0)
endif()
set(HAVE_ACCEPT4 0)
set(HAVE_ALARM 0)
set(HAVE_ARC4RANDOM 0)
set(HAVE_ARPA_INET_H 0)
set(HAVE_CLOSESOCKET 1)
set(HAVE_EVENTFD 0)
set(HAVE_FCNTL 0)
set(HAVE_FCNTL_H 1)
set(HAVE_FCNTL_O_NONBLOCK 0)
set(HAVE_FNMATCH 0)
set(HAVE_FREEADDRINFO 1) # Available in Windows XP and newer
set(HAVE_FSETXATTR 0)
set(HAVE_GETADDRINFO 1) # Available in Windows XP and newer
set(HAVE_GETEUID 0)
set(HAVE_GETHOSTBYNAME_R 0)
set(HAVE_GETHOSTBYNAME_R_3 0)
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_5 0)
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_6 0)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
set(HAVE_GETHOSTNAME 1)
set(HAVE_GETIFADDRS 0)
set(HAVE_GETPASS_R 0)
set(HAVE_GETPEERNAME 1)
set(HAVE_GETPPID 0)
set(HAVE_GETPWUID 0)
set(HAVE_GETPWUID_R 0)
set(HAVE_GETRLIMIT 0)
set(HAVE_GETSOCKNAME 1)
set(HAVE_GLIBC_STRERROR_R 0)
set(HAVE_GMTIME_R 0)
set(HAVE_IFADDRS_H 0)
set(HAVE_INET_NTOP 0)
set(HAVE_INET_PTON 0)
set(HAVE_IOCTLSOCKET 1)
set(HAVE_IOCTLSOCKET_CAMEL 0)
set(HAVE_IOCTLSOCKET_CAMEL_FIONBIO 0)
set(HAVE_IOCTLSOCKET_FIONBIO 1)
set(HAVE_IOCTL_FIONBIO 0)
set(HAVE_IOCTL_SIOCGIFADDR 0)
set(HAVE_IO_H 1)
set(HAVE_LINUX_TCP_H 0)
set(HAVE_LOCALE_H 1)
set(HAVE_LOCALTIME_R 0)
set(HAVE_MEMRCHR 0)
set(HAVE_NETDB_H 0)
set(HAVE_NETINET_IN6_H 0)
set(HAVE_NETINET_IN_H 0)
set(HAVE_NETINET_TCP_H 0)
set(HAVE_NETINET_UDP_H 0)
set(HAVE_NET_IF_H 0)
set(HAVE_PIPE 0)
set(HAVE_PIPE2 0)
set(HAVE_POLL 0)
set(HAVE_POLL_H 0)
set(HAVE_POSIX_STRERROR_R 0)
set(HAVE_PWD_H 0)
set(HAVE_RECV 1)
set(HAVE_SELECT 1)
set(HAVE_SEND 1)
set(HAVE_SENDMMSG 0)
set(HAVE_SENDMSG 0)
set(HAVE_SETLOCALE 1)
set(HAVE_SETRLIMIT 0)
set(HAVE_SETSOCKOPT_SO_NONBLOCK 0)
set(HAVE_SIGACTION 0)
set(HAVE_SIGINTERRUPT 0)
set(HAVE_SIGNAL 1)
set(HAVE_SIGSETJMP 0)
set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1)
set(HAVE_SOCKET 1)
set(HAVE_SOCKETPAIR 0)
set(HAVE_STRERROR_R 0)
set(HAVE_STROPTS_H 0)
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
set(HAVE_STRUCT_TIMEVAL 1)
set(HAVE_SYS_EVENTFD_H 0)
set(HAVE_SYS_FILIO_H 0)
set(HAVE_SYS_IOCTL_H 0)
set(HAVE_SYS_POLL_H 0)
set(HAVE_SYS_RESOURCE_H 0)
set(HAVE_SYS_SELECT_H 0)
set(HAVE_SYS_SOCKIO_H 0)
set(HAVE_SYS_TYPES_H 1)
set(HAVE_SYS_UN_H 0)
set(HAVE_SYS_UTIME_H 1)
set(HAVE_TERMIOS_H 0)
set(HAVE_TERMIO_H 0)
set(HAVE_TIME_T_UNSIGNED 0)
set(HAVE_UTIME 1)
set(HAVE_UTIMES 0)
set(STDC_HEADERS 1)
# Types and sizes
set(HAVE_SIZEOF_SA_FAMILY_T 0)
set(HAVE_SIZEOF_SUSECONDS_T 0)
if(MINGW OR MSVC)
curl_prefill_type_size("INT" 4)
curl_prefill_type_size("LONG" 4)
curl_prefill_type_size("__INT64" 8)
curl_prefill_type_size("CURL_OFF_T" 8)
curl_prefill_type_size("CURL_SOCKET_T" ${CMAKE_SIZEOF_VOID_P})
curl_prefill_type_size("SIZE_T" ${CMAKE_SIZEOF_VOID_P})
# TIME_T: 8 for _WIN64 or UCRT or MSVC, 4 otherwise
# Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set.
# mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined.
if(MSVC)
set(HAVE_SIZEOF_SSIZE_T 0)
set(HAVE_FILE_OFFSET_BITS 0)
curl_prefill_type_size("OFF_T" 4)
else()
curl_prefill_type_size("SSIZE_T" ${CMAKE_SIZEOF_VOID_P})
set(HAVE_FILE_OFFSET_BITS 1) # mingw-w64 v3+
curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+
endif()
endif()
+2472
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2026, Daniel Stenberg, <daniel@haxx.se>, and many
contributors, see the THANKS file.
All rights reserved.
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.
+41
View File
@@ -0,0 +1,41 @@
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# Self-contained build environment to match the release environment.
#
# Build and set the timestamp for the date corresponding to the release
#
# docker build --build-arg SOURCE_DATE_EPOCH=1711526400 --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t curl/curl .
#
# Then run commands from within the build environment, for example
#
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl autoreconf -fi
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./configure --without-ssl --without-libpsl
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl make
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./scripts/maketgz 8.7.1
#
# or get into a shell in the build environment, for example
#
# docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl bash
# $ autoreconf -fi
# $ ./configure --without-ssl --without-libpsl
# $ make
# $ ./scripts/maketgz 8.7.1
# To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags
FROM debian:bookworm-slim@sha256:f9c6a2fd2ddbc23e336b6257a5245e31f996953ef06cd13a59fa0a1df2d5c252
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 && \
rm -rf /var/lib/apt/lists/*
ARG UID=1000 GID=1000
RUN groupadd --gid $UID dev && \
useradd --uid $UID --gid dev --shell /bin/bash --create-home dev
USER dev:dev
ARG SOURCE_DATE_EPOCH
ENV SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-1}
+33
View File
@@ -0,0 +1,33 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
# GIT-INFO
This file is only present in git - never in release archives. It contains
information about other files and things that the git repository keeps in its
inner sanctum.
To build in environments that support configure, after having extracted
everything from git, do this:
autoreconf -fi
./configure --with-openssl
make
Daniel uses a configure line similar to this for easier development:
./configure --disable-shared --enable-debug --enable-maintainer-mode
## REQUIREMENTS
See [docs/INTERNALS.md][0] for requirement details.
[0]: docs/INTERNALS.md
+33
View File
@@ -0,0 +1,33 @@
BSD-4-Clause (University of California-Specific)
Copyright [various years] The Regents of the University of California.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
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. All advertising materials mentioning features or use of this software must
display the following acknowledgement: This product includes software
developed by the University of California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
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.
+12
View File
@@ -0,0 +1,12 @@
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+22
View File
@@ -0,0 +1,22 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, and many
contributors, see the THANKS file.
All rights reserved.
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.
+185
View File
@@ -0,0 +1,185 @@
#***************************************************************************
# _ _ ____ _
# 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
#
###########################################################################
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
CMAKE_DIST = \
CMake/cmake_uninstall.in.cmake \
CMake/curl-config.in.cmake \
CMake/CurlSymbolHiding.cmake \
CMake/CurlTests.c \
CMake/FindBrotli.cmake \
CMake/FindCares.cmake \
CMake/FindGnuTLS.cmake \
CMake/FindGSS.cmake \
CMake/FindLDAP.cmake \
CMake/FindLibbacktrace.cmake \
CMake/FindLibgsasl.cmake \
CMake/FindLibidn2.cmake \
CMake/FindLibpsl.cmake \
CMake/FindLibssh.cmake \
CMake/FindLibssh2.cmake \
CMake/FindLibuv.cmake \
CMake/FindMbedTLS.cmake \
CMake/FindNGHTTP2.cmake \
CMake/FindNGHTTP3.cmake \
CMake/FindNGTCP2.cmake \
CMake/FindNettle.cmake \
CMake/FindQuiche.cmake \
CMake/FindRustls.cmake \
CMake/FindWolfSSL.cmake \
CMake/FindZstd.cmake \
CMake/Macros.cmake \
CMake/OtherTests.cmake \
CMake/PickyWarnings.cmake \
CMake/Utilities.cmake \
CMake/unix-cache.cmake \
CMake/win32-cache.cmake \
CMakeLists.txt \
tests/cmake/CMakeLists.txt \
tests/cmake/test.c \
tests/cmake/test.cpp \
tests/cmake/test.sh
EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile .clang-tidy.yml .editorconfig $(CMAKE_DIST)
DISTCLEANFILES = buildinfo.txt
bin_SCRIPTS = curl-config
SUBDIRS = lib docs src scripts
DIST_SUBDIRS = $(SUBDIRS) tests projects include docs
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc
dist-hook:
rm -rf $(top_builddir)/tests/log
find $(distdir) -name "*.dist" -exec rm -- {} \;
(distit=`find $(srcdir) -name "*.dist" | grep -v Makefile`; \
for file in $$distit; do \
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
cp -p $$file $(distdir)$$strip; \
done)
check: test examples check-docs
if CROSSCOMPILING
test-full: test
test-nonflaky: test
test-torture: test
test-event: test
test-am: test
test-ci: test
pytest: test
pytest-ci: test
test:
@echo "NOTICE: we cannot run the tests when cross-compiling!"
else
test:
@(cd tests; $(MAKE) all quiet-test)
test-full:
@(cd tests; $(MAKE) all full-test)
test-nonflaky:
@(cd tests; $(MAKE) all nonflaky-test)
test-torture:
@(cd tests; $(MAKE) all torture-test)
test-event:
@(cd tests; $(MAKE) all event-test)
test-am:
@(cd tests; $(MAKE) all am-test)
test-ci:
@(cd tests; $(MAKE) all ci-test)
pytest:
@(cd tests; $(MAKE) all default-pytest)
pytest-ci:
@(cd tests; $(MAKE) all ci-pytest)
endif
examples:
@(cd docs/examples; $(MAKE) check)
check-docs:
@(cd docs/libcurl; $(MAKE) check)
# We extend the standard install with a custom hook:
if BUILD_DOCS
install-data-hook:
(cd include && $(MAKE) install)
(cd docs && $(MAKE) install)
(cd docs/libcurl && $(MAKE) install)
else
install-data-hook:
(cd include && $(MAKE) install)
(cd docs && $(MAKE) install)
endif
# We extend the standard uninstall with a custom hook:
uninstall-hook:
(cd include && $(MAKE) uninstall)
(cd docs && $(MAKE) uninstall)
(cd docs/libcurl && $(MAKE) uninstall)
ca-bundle: $(srcdir)/scripts/mk-ca-bundle.pl
@echo "generating a fresh ca-bundle.crt"
@perl $(srcdir)/scripts/mk-ca-bundle.pl -b -l -u lib/ca-bundle.crt
ca-firefox: $(srcdir)/scripts/firefox-db2pem.sh
@echo "generating a fresh ca-bundle.crt"
$(srcdir)/scripts/firefox-db2pem.sh lib/ca-bundle.crt
checksrc:
(cd lib && $(MAKE) checksrc)
(cd src && $(MAKE) checksrc)
(cd tests && $(MAKE) checksrc)
(cd include/curl && $(MAKE) checksrc)
(cd docs/examples && $(MAKE) checksrc)
(cd projects && $(MAKE) checksrc)
badwords:
@PERL@ $(top_srcdir)/scripts/badwords-all
lint: badwords checksrc
@PERL@ $(top_srcdir)/scripts/spacecheck.pl
tidy:
(cd src && $(MAKE) tidy)
(cd lib && $(MAKE) tidy)
clean-local:
(cd tests && $(MAKE) clean)
+50
View File
@@ -0,0 +1,50 @@
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
README
Curl is a command line tool for transferring data specified with URL
syntax. Find out how to use curl by reading the curl.1 man page or the
MANUAL document. Find out how to install Curl by reading the INSTALL
document.
libcurl is the library curl is using to do its job. It is readily
available to be used by your software. Read the libcurl.3 man page to
learn how.
You find answers to the most frequent questions we get in the FAQ.md
document.
Study the COPYING file for distribution terms.
Those documents and more can be found in the docs/ directory.
CONTACT
If you have problems, questions, ideas or suggestions, please contact us
by posting to a suitable mailing list. See https://curl.se/mail/
All contributors to the project are listed in the THANKS document.
WEBSITE
Visit the curl website for the latest news and downloads:
https://curl.se/
GIT
To download the latest source code off the GIT server, do this:
git clone https://github.com/curl/curl
(you will get a directory named curl created, filled with the source code)
SECURITY PROBLEMS
Report suspected security problems privately and not in public.
https://curl.se/dev/vuln-disclosure.html
+66
View File
@@ -0,0 +1,66 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# [![curl logo](https://curl.se/logo/curl-logo.svg)](https://curl.se/)
curl is a command-line tool for transferring data from or to a server using
URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS,
HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, MQTTS, POP3, POP3S, RTSP, SCP,
SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
Learn how to use curl by reading [the
man page](https://curl.se/docs/manpage.html) or [everything
curl](https://everything.curl.dev/).
Find out how to install curl by reading [the INSTALL
document](https://curl.se/docs/install.html).
libcurl is the library curl is using to do its job. It is readily available to
be used by your software. Read [the libcurl
man page](https://curl.se/libcurl/c/libcurl.html) to learn how.
## Open Source
curl is Open Source and is distributed under an MIT-like
[license](https://curl.se/docs/copyright.html).
## Contact
Contact us on a suitable [mailing list](https://curl.se/mail/) or
use GitHub [issues](https://github.com/curl/curl/issues)/
[pull requests](https://github.com/curl/curl/pulls)/
[discussions](https://github.com/curl/curl/discussions).
All contributors to the project are listed in [the THANKS
document](https://curl.se/docs/thanks.html).
## Commercial support
For commercial support, maybe private and dedicated help with your problems or
applications using (lib)curl visit [the support page](https://curl.se/support.html).
## Website
Visit the [curl website](https://curl.se/) for the latest news and downloads.
## Source code
Download the latest source from the Git server:
git clone https://github.com/curl/curl
## Security problems
Report suspected security problems
[privately](https://curl.se/dev/vuln-disclosure.html) and not in public.
## Backers
Thank you to all our backers :pray: [Become a backer](https://opencollective.com/curl#section-contribute).
## Sponsors
Support this project by becoming a [sponsor](https://curl.se/sponsors.html).
+628
View File
@@ -0,0 +1,628 @@
curl and libcurl 8.20.0
Public curl releases: 274
Command line options: 273
curl_easy_setopt() options: 308
Public functions in libcurl: 100
Authors: 1463
Contributors: 3664
This release includes the following changes:
o async-thrdd: use thread queue for resolving [144]
o build: make NTLM disabled by default [90]
o cmake: drop support for CMake 3.17 and older [108]
o lib: add thread pool and queue [74]
o lib: drop support for < c-ares 1.16.0 [64]
o lib: make SMB support opt-in [18]
o multi.h: add CURLMNWC_CLEAR_ALL [127]
o rtmp: drop support [91]
This release includes the following bugfixes:
o altsvc: cap the list at 5,000 entries [183]
o altsvc: drop the prio field from the struct [185]
o altsvc: skip expired entries read from file [187]
o asyn-ares: connect async [220]
o asyn-ares: drop orphaned variable references [86]
o asyn-ares: fix HTTPS-lookup when not on port 443 [100]
o asyn-thrdd: drop redundant `result` check [291]
o asyn-thrdd: fix clang-tidy unused value warning [125]
o async-ares: fix query counter handling [195]
o autotools: limit checksrc target to ignore non-repo test sources [12]
o badwords-all: exit with correct code on errors [50]
o badwords: combine the whitelisting into a single regex [1]
o badwords: detect the the and with with [51]
o badwords: only check comments and strings in source code [61]
o badwords: rework exceptions, fix many of them [15]
o boringssl: fix more coexist cases with Schannel/WinCrypt [170]
o build: adjust/add casts to fix `-Wformat-signedness` [218]
o build: assume `snprintf()` in `mprintf`, drop feature check [107]
o build: compiler warning silencing tidy-ups [4]
o build: drop `openssl` module dependency for BoringSSL from `libcurl.pc` [33]
o build: drop duplicate `pthread.h` includes [158]
o build: drop redundant `USE_QUICHE` guards [159]
o build: enable `-Wimplicit-int-enum-cast` compiler warning, fix issues [84]
o build: fix `-Wformat-signedness` by adjusting printf masks [226]
o build: link `bcrypt.lib` via vcxproj files [239]
o build: skip detecting `pipe2()` for Apple targets [227]
o build: stop building and installing `runtests.1` and `testcurl.1` [235]
o cf-https-connect: silence `-Wimplicit-int-enum-cast` with HTTPS-RR [132]
o cf-https-connect: silence `-Wimplicit-int-enum-cast` with HTTPS-RR [63]
o cf-ip-happy: limit concurrent attempts [191]
o cf-socket: avoid low risk integer overflow on ancient Solaris [56]
o cfilters: fix Curl_pollset_poll() return code mixup [206]
o clang-tidy: avoid assignments in `if` expressions [175]
o clang-tidy: enable more checks, fix fallouts [254]
o cmake: add CMake Config-based dependency detection [87]
o cmake: add CMake Config-based dependency detection for c-ares, wolfSSL [134]
o cmake: do not install `wcurl` when `BUILD_CURL_EXE=OFF` [265]
o cmake: do not install shell completions when `BUILD_CURL_EXE=OFF` [263]
o cmake: document functions used from Windows system DLLs [103]
o cmake: enable pthreads for BoringSSL/AWS-LC [196]
o cmake: resolve targets recursively when generating `libcurl.pc` [45]
o cmake: rework binutils ld hack to not read `LOCATION` property [41]
o cmake: silence bad library `Threads::Threads` warning [131]
o cmake: use `AIX` built-in variable (with CMake 4.0+) [163]
o config2setopts: make --capath work in proxy disabled builds [113]
o configure: fix `--with-ngtcp2=<path>` option for crypto libs [26]
o configure: fix LibreSSL ngtcp2 1.15.0+ crypto lib selection logic [3]
o configure: prefer dependency-specific variables over `$withval` [35]
o configure: remove superfluous experimental warning for HTTP/3 [169]
o configure: silence useless clang warnings in C89 builds [156]
o configure: tidy up comments [202]
o connect: fix typo on error message
o cookie: fix rejection when tabs in value [189]
o curl-wolfssl.m4: fix to use the correct value for pkg-config directory [36]
o curl.h: replace macros with C++-friendly method to enforce 3 args [110]
o curl_ctype.h: fix spelling in a couple of locally used macros [28]
o curl_get_line: error out on read errors [9]
o curl_get_line: fix potential infinite loop when filename is a directory [46]
o curl_ngtcp2: extend and update callbacks for 1.22.0+ [165]
o curl_ntlm_core: drop redundant PP condition [140]
o curl_ntlm_core: use wolfCrypt DES API with wolfSSL [200]
o curl_setup.h: drop stray/unused `USE_OPENSSL_QUIC` guard [210]
o curl_sha512_256: support delegating to wolfSSL API [149]
o curl_version_info.md: clarify age details [69]
o CURLOPT_HAPROXY_CLIENT_IP.md: mention assumption on data format [96]
o CURLOPT_RTSP_SESSION_ID.md: clarify reuse "dangers" [270]
o CURLOPT_RTSP_SESSION_ID.md: expand the comment [267]
o CURLOPT_RTSP_SESSION_ID.md: minor language fix
o CURLOPT_SOCKS5_AUTH.md: an access property [212]
o CURLOPT_SSL_CTX_FUNCTION.md: expand on effects connection reuse [105]
o CURLOPT_UPLOAD_FLAGS.md: expand [223]
o curlx_now(), prevent zero timestamp [93]
o DEPRECATE: fix minor release number typo
o digest: pass in the user name quoted (as well) [34]
o dns: https-eyeballing async [229]
o dnscache: own source file, improvements [116]
o docs/cmdline-opts/write-out.md: tls_earlydata was adeded in 8.13.0
o docs/cmdline-opts: tidy up retry-connrefused [190]
o docs/lib: fix typos [53]
o docs/libcurl: improve easy setopt examples [266]
o docs: clarify retry-max-time timing [294]
o docs: CURLOPT_LOGIN_OPTIONS is a login property [228]
o docs: enable more compiler warnings for C snippets, fix 3 finds [71]
o docs: list more dependencies for running Python HTTP tests [123]
o docs: mention more zip bomb precautions [166]
o docs: minor wording tweaks
o docs: noproxy wants the punycoded hostname version [214]
o docs: SSH host verification is done at connect time [197]
o docs: use the correct CURLOPT_WRITEFUNCTION signature [142]
o doh: fix memory-leak when doing a second DoH resolve [55]
o doh: remove superfluous doh_req check [222]
o examples/websocket: fix to sleep more on Windows [92]
o examples: drop warning silencers no longer hit [14]
o examples: fix typo in comment [75]
o file: init fd to -1 to prevent close fd 0 on early failure [40]
o fopen: for temp files, inherit permissions only for owner [146]
o ftp: do not strdup DATA hostname [29]
o ftp: make the MDTM date parser stricter (again) [115]
o ftp: reject PWD responses containing control characters [95]
o gcc: guard `#pragma diagnostic` in core code for <4.6 [94]
o generate.bat: remove extra % from VC11 and VC12 runs
o genserv.pl: make external calls safe [119]
o getinfo: initialize `PureInfo` field `used_proxy` [43]
o getinfo: repair CURLINFO_TLS_SESSION [193]
o gnutls: fix clang-tidy warning with !verbose [126]
o gtls: fail for large files in `load_file()` [174]
o h3: HTTPS-RR use in HTTP/3 [221]
o Happy Eyeballs: add resolution time delay [238]
o haproxy: use correct ip version on client supplied address [275]
o hostip: clear the sockaddr_in6 structure before use [20]
o hostip: init the curl_jmpenv_lock appropriately [278]
o hostip: resolve user supplied ip addresses [259]
o HSTS: cap the list [177]
o hsts: make the HSTS read callback handle name dupes [141]
o hsts: skip expired HSTS entries read from file [188]
o hsts: when a dupe host adds subdomains, use that [130]
o http2: clear the h2 session at delete [99]
o http2: prevent secure schemes pushed over insecure connections [181]
o http2: return error on OOM in push headers [65]
o HTTP3.md: drop outdated mentions of OpenSSL-QUIC [2]
o http: clear credentials better on redirect [204]
o http: clear digest nonce on cross-orgin redirect [269]
o http: clear the proxy credentials as well on port or scheme change [246]
o http: fix auth_used and auth_avail [154]
o http: fix Curl_compareheader for multi value headers [11]
o http: make Curl_compareheader handle multiple commas in header
o http: on 303, switch to GET [208]
o http: use header_has_value() instead of duplicate code [251]
o imap: reset the UIDVALIDITY state between transfers [7]
o include: drop 'will' from public headers [73]
o INSTALL.md: update Cygwin instructions [198]
o keylog.h: replace literal number with macro in declaration [171]
o keylog: drop unused/redundant includes and guards [172]
o ldap: drop duplicate `ldap_set_option()` on Windows [42]
o ldap: fix to initialize cleartext connection on Windows [49]
o lib1560: fix comment typo
o lib1960: fix test failure [255]
o lib: accept larger input to md5/hmac/sha256/sha512 functions [194]
o lib: always use Curl_1st_fatal instead of Curl_1st_err [89]
o lib: fix typos in comments [240]
o lib: make resolving HTTPS DNS records reliable: [176]
o lib: minor comment typos [237]
o lib: move request specific allocations to the request struct [256]
o lib: replace `PRI*32` printf masks with C89 ones [201]
o libssh2: allocate libssh2-friendly memory in kbd_callback [225]
o libssh2: fix error handling on quote errors [21]
o libssh: fix 64-bit printf mask for mingw-w64 <=6.0.0 [215]
o libssh: fix `-Wsign-compare` in 32-bit builds [217]
o libssh: path length precaution [164]
o libssh: propagate error back in SFTP function [178]
o libtest: drop duplicate include [111]
o location/follow: mention netrc [138]
o man: fix argument type for `CURLSHOPT_[UN]SHARE` options [211]
o mbedtls: cleanup more without care for 'initialized' [262]
o mbedtls: fix ECJPAKE matching [135]
o mbedtls: remove failf() call with first argument as NULL [249]
o md4, md5: switch to wolfCrypt API in wolfSSL builds [139]
o mime: only allow 40 levels of calls [241]
o misc: fix code quality findings [209]
o mk-ca-bundle.pl: make `ca-bundle.crt` timestamp match `certdata.txt`'s [44]
o multi: enhance pending handles fairness [284]
o multi: fix connection retry for non-http [180]
o multi: improve wakeup and wait code [118]
o netrc: find login-less password when user is given in URL [6]
o netrc: remove unused parsenetrc() macro for netrc-disabled [121]
o netrc: skip malformed macdef lines [67]
o openssl channel_binding: lookup digest algorithm without NID [117]
o openssl: drop obsolete SSLv2 logic [27]
o openssl: fix build with 4.0.0-beta1 no-deprecated [184]
o openssl: fix memory leaks in ECH code (OpenSSL 3) [78]
o openssl: fix unused variable warnings in !verbose builds [252]
o openssl: trace count of found / imported Windows native CA roots [8]
o OS400: add new definitions to the ILE/RPG binding. [153]
o os400sys: fix typo in comment (symetry -> symmetry) [58]
o parsedate: bsearch the time zones [232]
o parsedate: fix wrong treatment of "military time zones" [182]
o parsedate: refactor [230]
o perl: harden external command invocations [133]
o progress: count amount of data "delivered" to application [66]
o protocol.h: fix the CURLPROTO_MASK [31]
o protocol: disable connection reuse for SMB(S) [199]
o protocol: use scheme names lowercase [38]
o proxy: chunked response, error code [143]
o pytest: add additional quiche check for flaky test_05_01 [22]
o pytest: check 429 handling [268]
o rand: use `BCryptGenRandom()` in UWP builds [88]
o ratelimit: reset on start [150]
o request: reset resp_trailer in new requests [186]
o runtests: skip setting ed25519 SSH key format [264]
o rustls: fix memory leak on repeated SSLKEYLOGFILE fails [280]
o rustls: handle EOF during initial handshake [203]
o schannel: increase renegotiation timeout to 60 seconds [261]
o scripts: drop redundant double-quotes: `"$var"` -> `$var` (Perl) [109]
o scripts: harden / tidy up more Perl `system()` calls [70]
o sectrust: fail on missing OCSP stapling [250]
o sendf: fix CR detection if no LF is in the chunk [219]
o setopt: clear proxy auth properties when switching [192]
o setopt: fix typos in comments [257]
o setopt: move CURLOPT_CURLU [260]
o setup connection filter: mark as setup [234]
o sha256, sha512_256: switch to wolfCrypt API [147]
o sha256: support delegating to wolfSSL API [148]
o share: concurrency handling, easy updates [104]
o share: do bitshifts after the type is checked to be valid [216]
o socks: reject zero-length GSSAPI/SSPI tokens from proxy [157]
o socks: use dns filter for resolving [244]
o spelling: fix typos [173]
o src: use ftruncate() unconditionally [128]
o sshserver.pl: harden more `system()` calls [81]
o sshserver.pl: pass command-line to `system()` safely [82]
o strerr: correct the strerror_s() return code condition [25]
o sws: fix potential OOB write [80]
o synctime: fix off-by-one read and write to a read-only buffer (Windows) [85]
o test 766: flag as timing-dependent [136]
o test1675: unit tests for URL API helper functions [248]
o test459: switch to mode="warn" for stderr check [5]
o testcurl.pl: replace shell commands with Perl `rmtree()` [76]
o tests/unit/README: describe how to unit test static functions [60]
o tests: avoid infinite recursion for `make check` [253]
o tests: use %b64[] instead of "raw" base64 [245]
o tool: check for curlinfo->age when determining if ssh backend [77]
o tool: fix memory mixups [106]
o tool: fix retries in parallel mode [137]
o tool: fix two more allocator mismatches [155]
o tool_cb_hdr: only truncate etags output when regular file [129]
o tool_cb_rea: make waitfd() return void [168]
o tool_cb_wrt: fix no-clobber error handling [39]
o tool_cfgable: free the SSL signature algorithms [62]
o tool_dirhie: fix to create drive-relative directory [276]
o tool_formparse: propagate my_get_line errors when reading headers [102]
o tool_getparam: use correct free function for libcurl memory [68]
o tool_ipfs: accept IPFS gateway URL without set port number [13]
o tool_msgs: avoid null pointer deref for early errors [98]
o tool_operate: actually apply the --parallel-max-host limit [167]
o tool_operate: drop the scheme-guessing in the -G handling [54]
o tool_operate: fix condition for loading `curl-ca-bundle.crt` (Windows) [79]
o tool_operate: fix memory-leak on failed uploads [124]
o tool_operate: fix minor memory-leak on early error [23]
o tool_operate: reset the upload glob counter for next URL [162]
o tool_operhlp: fix `add_file_name_to_url()` result on OOM [32]
o tool_operhlp: iterate through all slashes to find name [114]
o tool_operhlp: propagate low-level OOM in `add_file_name_to_url()` [112]
o tool_setopt: return error on OOM correctly [152]
o tool_urlglob: fix memory-leak on glob range overflow [19]
o top-complexity: prevent filename-based shell injection risk [101]
o transfer: clear the old autoreferer [236]
o transfer: clear the URL pointer in OOM to avoid UAF [179]
o transfer: enable custom methods again on next transfer [30]
o transfer: enhance secure check [10]
o unit1675: fix `-Wformat-signedness` [274]
o url: do not reuse a non-tls starttls connection if new requires TLS [145]
o url: improve connection reuse on negotiate [160]
o url: init req.no_body in DO so that it works for h2 push [161]
o url: set default upload flags to CURLULFLAG_SEEN [224]
o url: use the socks type for socks proxy [47]
o url: use URL for url even in comments [52]
o urlapi: fix handling of "file:///" [122]
o urlapi: make dedotdotify handle leading dots correctly [97]
o urlapi: same origin tests [213]
o urlapi: stop extracting hostname from file:// URLs on Windows [247]
o urlapi: verify the last letter of a scheme when set explicitly [16]
o urldata.h: fix typo and lingering backtick [279]
o urldata: connection bit ipv6_ip is wrong [59]
o urldata: import port types and conn destination format [57]
o urldata: make hstslist only present in HSTS builds [120]
o urldata: make speeder_c uint32 [37]
o urldata: move cookiehost to struct SingleRequest [242]
o urldata: remove trailers_state [17]
o vquic: fix variable name in fallback code [207]
o vtls: fix comment typos and tidy up a type [285]
o vtls: log when key logging is enabled. [288]
o vtls_scache: check reentrancy [243]
o vtls_scache: include cert_blob independently of verifypeer [231]
o wolfssl: document v5.0.0 (2021-11-01) as minimum required [151]
o wolfssl: fix `-Wmissing-prototypes` [233]
o wolfssl: fix handling of abrupt connection close [24]
o write-out.md: minor language fix [273]
o write-out.md: tls_earlydata was adeded in 8.13.0
o ws: fix a blocking curl_ws_send() to report written length correctly [258]
o x509asn1: fix to return error in an error case from `encodeOID()` [83]
o x509asn1: fixed and adapted for ASN1tostr unit testing [48]
o x509asn1: improve encodeOID [72]
This release includes the following known bugs:
See https://curl.se/docs/knownbugs.html
For all changes ever done in curl:
See https://curl.se/changes.html
Planned upcoming removals include:
o local crypto implementations
o NTLM
o SMB
o TLS-SRP support
See https://curl.se/dev/deprecate.html
This release would not have looked like this without help, code, reports and
advice from friends like these:
Alex Hamilton, am-perip on hackerone, Arkadi Vainbrand, bird on github,
BlackFuffey on github, Carlos Carrillo, Carlos Henrique Lima Melara,
crawfordxx, Cutiapreta on hackerone, Dag-Erling Smørgrav, Dan Arnfield,
Dan Fandrich, Daniel McCarney, Daniel Schulte, Daniel Stenberg,
dependabot[bot], Dexter Gerig, Dio Putra, Dwij Mehta, Ercan Ermis,
fds242 on github, finkjsc on github, Fiona Klute, Flavio Amieiro,
Geeknik Labs, Greg Kroah-Hartman, Harry Sintonen, Henrique Pereira,
herbenderbler on github, Ian Spence, Izan on hackerone, James Fuller,
Jason Stangroome, John Haugabook, Juan Belón, Kai Pastor, Kaixuan Li, kpcyrd,
lg_oled77c5pua on hackerone, M42kL33 on hackerone, m777m0 on hackerone,
Marcel Raad, Martin Dürrmeier, Mehtab Zafar, Michael Hendricks,
Michael Kaufmann, Muhamad Arga Reksapati, Ngoc Hieu, nitrogene on github,
Orgad Shaneh, Osama Hamad, Otis Cui Lei, Patrick Monnerat, Quac Tran,
Ray Satiro, renovate[bot], Richard Tollerton, Rob Crittenden,
Samuel Henrique, Scott Boudreaux, Sergey Fedorov, sergio-nsk on github,
Stefan Eissing, Ted Lyngmo, Terrance Wong, Tim Omta, Viktor Szakats,
Vladimír Marek, xkilua on hackerone, Yalguun Tumenkhuu, Yedaya Katsman,
Yiwei Hou, Yoshiro Yoneya
(73 contributors)
References to bug reports and discussions on issues:
[1] = https://curl.se/bug/?i=20880
[2] = https://curl.se/bug/?i=20914
[3] = https://curl.se/bug/?i=20889
[4] = https://curl.se/bug/?i=20908
[5] = https://curl.se/bug/?i=20910
[6] = https://curl.se/bug/?i=20950
[7] = https://curl.se/bug/?i=20962
[8] = https://curl.se/bug/?i=20899
[9] = https://curl.se/bug/?i=20958
[10] = https://curl.se/bug/?i=20951
[11] = https://curl.se/bug/?i=20894
[12] = https://curl.se/bug/?i=20898
[13] = https://curl.se/bug/?i=20957
[14] = https://curl.se/bug/?i=20896
[15] = https://curl.se/bug/?i=20886
[16] = https://curl.se/bug/?i=20893
[17] = https://curl.se/bug/?i=20960
[18] = https://curl.se/bug/?i=20846
[19] = https://curl.se/bug/?i=20956
[20] = https://curl.se/bug/?i=20885
[21] = https://curl.se/bug/?i=20883
[22] = https://curl.se/bug/?i=20952
[23] = https://curl.se/bug/?i=20954
[24] = https://curl.se/bug/?i=21002
[25] = https://curl.se/bug/?i=20955
[26] = https://curl.se/bug/?i=18022
[27] = https://curl.se/bug/?i=20945
[28] = https://curl.se/bug/?i=20810
[29] = https://curl.se/bug/?i=20953
[30] = https://curl.se/bug/?i=21037
[31] = https://curl.se/bug/?i=21031
[32] = https://curl.se/bug/?i=21011
[33] = https://curl.se/bug/?i=20926
[34] = https://curl.se/bug/?i=20940
[35] = https://curl.se/bug/?i=20944
[36] = https://curl.se/bug/?i=20943
[37] = https://curl.se/bug/?i=21036
[38] = https://curl.se/bug/?i=21033
[39] = https://curl.se/bug/?i=20939
[40] = https://curl.se/bug/?i=21029
[41] = https://curl.se/bug/?i=20839
[42] = https://curl.se/bug/?i=20930
[43] = https://curl.se/bug/?i=21020
[44] = https://curl.se/bug/?i=20528
[45] = https://curl.se/bug/?i=20840
[46] = https://curl.se/bug/?i=20823
[47] = https://curl.se/bug/?i=21025
[48] = https://curl.se/bug/?i=21013
[49] = https://curl.se/bug/?i=20927
[50] = https://curl.se/bug/?i=20934
[51] = https://curl.se/bug/?i=20934
[52] = https://curl.se/bug/?i=20935
[53] = https://curl.se/bug/?i=20933
[54] = https://curl.se/bug/?i=20992
[55] = https://curl.se/bug/?i=20929
[56] = https://curl.se/bug/?i=21111
[57] = https://curl.se/bug/?i=20918
[58] = https://curl.se/bug/?i=20923
[59] = https://curl.se/bug/?i=20919
[60] = https://curl.se/bug/?i=21018
[61] = https://curl.se/bug/?i=20909
[62] = https://curl.se/bug/?i=20915
[63] = https://curl.se/bug/?i=21057
[64] = https://curl.se/bug/?i=20911
[65] = https://hackerone.com/reports/3636044
[66] = https://curl.se/bug/?i=20787
[67] = https://curl.se/bug/?i=21049
[68] = https://curl.se/bug/?i=21075
[69] = https://curl.se/bug/?i=21052
[70] = https://curl.se/bug/?i=21007
[71] = https://curl.se/bug/?i=21006
[72] = https://curl.se/bug/?i=21003
[73] = https://curl.se/bug/?i=21005
[74] = https://curl.se/bug/?i=20916
[75] = https://curl.se/bug/?i=21001
[76] = https://curl.se/bug/?i=21053
[77] = https://curl.se/bug/?i=21050
[78] = https://curl.se/bug/?i=20993
[79] = https://curl.se/bug/?i=20989
[80] = https://curl.se/bug/?i=20988
[81] = https://curl.se/bug/?i=20997
[82] = https://curl.se/bug/?i=20996
[83] = https://curl.se/bug/?i=20991
[84] = https://curl.se/bug/?i=20990
[85] = https://curl.se/bug/?i=20987
[86] = https://curl.se/bug/?i=20999
[87] = https://curl.se/bug/?i=20814
[88] = https://curl.se/bug/?i=20983
[89] = https://curl.se/bug/?i=20980
[90] = https://curl.se/bug/?i=20698
[91] = https://curl.se/bug/?i=20673
[92] = https://curl.se/bug/?i=20978
[93] = https://curl.se/bug/?i=21034
[94] = https://curl.se/bug/?i=20892
[95] = https://curl.se/bug/?i=20949
[96] = https://curl.se/bug/?i=21042
[97] = https://curl.se/bug/?i=20974
[98] = https://curl.se/bug/?i=20967
[99] = https://curl.se/bug/?i=20975
[100] = https://curl.se/bug/?i=20966
[101] = https://curl.se/bug/?i=20969
[102] = https://curl.se/bug/?i=20963
[103] = https://curl.se/bug/?i=20965
[104] = https://curl.se/bug/?i=20870
[105] = https://curl.se/bug/?i=21164
[106] = https://curl.se/bug/?i=21099
[107] = https://curl.se/bug/?i=20763
[108] = https://curl.se/bug/?i=20407
[109] = https://curl.se/bug/?i=21009
[110] = https://curl.se/bug/?i=20709
[111] = https://curl.se/bug/?i=21046
[112] = https://curl.se/bug/?i=21011
[113] = https://curl.se/bug/?i=21063
[114] = https://curl.se/bug/?i=21165
[115] = https://curl.se/bug/?i=21041
[116] = https://curl.se/bug/?i=20864
[117] = https://curl.se/bug/?i=20590
[118] = https://curl.se/bug/?i=20832
[119] = https://curl.se/bug/?i=20971
[120] = https://curl.se/bug/?i=21068
[121] = https://curl.se/bug/?i=21067
[122] = https://curl.se/bug/?i=21070
[123] = https://curl.se/bug/?i=21110
[124] = https://curl.se/bug/?i=21062
[125] = https://curl.se/bug/?i=21061
[126] = https://curl.se/bug/?i=21060
[127] = https://curl.se/bug/?i=20968
[128] = https://curl.se/bug/?i=21109
[129] = https://curl.se/bug/?i=21103
[130] = https://curl.se/bug/?i=21108
[131] = https://curl.se/bug/?i=21170
[132] = https://curl.se/bug/?i=21167
[133] = https://curl.se/bug/?i=21097
[134] = https://curl.se/bug/?i=21098
[135] = https://curl.se/bug/?i=21264
[136] = https://curl.se/bug/?i=21155
[137] = https://curl.se/bug/?i=20669
[138] = https://curl.se/bug/?i=21091
[139] = https://curl.se/bug/?i=21093
[140] = https://curl.se/bug/?i=21096
[141] = https://curl.se/bug/?i=21201
[142] = https://curl.se/bug/?i=21265
[143] = https://curl.se/bug/?i=21084
[144] = https://curl.se/bug/?i=20936
[145] = https://curl.se/bug/?i=21082
[146] = https://curl.se/bug/?i=21092
[147] = https://curl.se/bug/?i=21090
[148] = https://curl.se/bug/?i=21078
[149] = https://curl.se/bug/?i=21077
[150] = https://curl.se/bug/?i=21086
[151] = https://curl.se/bug/?i=21080
[152] = https://curl.se/bug/?i=21083
[153] = https://curl.se/bug/?i=20672
[154] = https://curl.se/bug/?i=21274
[155] = https://curl.se/bug/?i=21150
[156] = https://curl.se/bug/?i=21263
[157] = https://curl.se/bug/?i=21159
[158] = https://curl.se/bug/?i=21144
[159] = https://curl.se/bug/?i=21135
[160] = https://curl.se/bug/?i=21203
[161] = https://curl.se/bug/?i=21194
[162] = https://curl.se/bug/?i=21402
[163] = https://curl.se/bug/?i=21134
[164] = https://curl.se/bug/?i=21193
[165] = https://curl.se/bug/?i=21152
[166] = https://curl.se/bug/?i=21143
[167] = https://curl.se/bug/?i=21147
[168] = https://curl.se/bug/?i=21127
[169] = https://curl.se/bug/?i=21139
[170] = https://curl.se/bug/?i=21136
[171] = https://curl.se/bug/?i=21141
[172] = https://curl.se/bug/?i=21137
[173] = https://curl.se/bug/?i=21198
[174] = https://curl.se/bug/?i=21256
[175] = https://curl.se/bug/?i=21256
[176] = https://curl.se/bug/?i=21175
[177] = https://curl.se/bug/?i=21190
[178] = https://curl.se/bug/?i=21122
[179] = https://curl.se/bug/?i=21123
[180] = https://curl.se/bug/?i=21121
[181] = https://curl.se/bug/?i=21113
[182] = https://curl.se/bug/?i=21251
[183] = https://curl.se/bug/?i=21183
[184] = https://curl.se/bug/?i=21119
[185] = https://curl.se/bug/?i=21188
[186] = https://curl.se/bug/?i=21112
[187] = https://curl.se/bug/?i=21187
[188] = https://curl.se/bug/?i=21186
[189] = https://curl.se/bug/?i=21185
[190] = https://curl.se/bug/?i=21182
[191] = https://curl.se/bug/?i=21252
[192] = https://curl.se/bug/?i=21453
[193] = https://curl.se/bug/?i=21290
[194] = https://curl.se/bug/?i=21174
[195] = https://curl.se/bug/?i=21399
[196] = https://curl.se/bug/?i=21168
[197] = https://curl.se/bug/?i=21173
[198] = https://curl.se/bug/?i=20995
[199] = https://curl.se/bug/?i=21238
[200] = https://curl.se/bug/?i=21247
[201] = https://curl.se/bug/?i=21234
[202] = https://curl.se/bug/?i=21246
[203] = https://curl.se/bug/?i=21242
[204] = https://curl.se/bug/?i=21345
[206] = https://curl.se/bug/?i=21231
[207] = https://curl.se/bug/?i=21281
[208] = https://curl.se/bug/?i=20715
[209] = https://curl.se/bug/?i=21393
[210] = https://curl.se/bug/?i=21235
[211] = https://curl.se/bug/?i=21232
[212] = https://curl.se/bug/?i=21230
[213] = https://curl.se/bug/?i=21328
[214] = https://curl.se/bug/?i=21228
[215] = https://curl.se/bug/?i=21229
[216] = https://curl.se/bug/?i=21224
[217] = https://curl.se/bug/?i=21225
[218] = https://curl.se/bug/?i=21339
[219] = https://curl.se/bug/?i=21221
[220] = https://curl.se/bug/?i=21205
[221] = https://curl.se/bug/?i=21253
[222] = https://curl.se/bug/?i=21216
[223] = https://curl.se/bug/?i=21218
[224] = https://curl.se/bug/?i=21217
[225] = https://curl.se/bug/?i=21336
[226] = https://curl.se/bug/?i=21335
[227] = https://curl.se/bug/?i=21236
[228] = https://curl.se/bug/?i=21215
[229] = https://curl.se/bug/?i=21267
[230] = https://curl.se/bug/?i=21394
[231] = https://curl.se/bug/?i=21222
[232] = https://curl.se/bug/?i=21266
[233] = https://curl.se/bug/?i=21392
[234] = https://curl.se/bug/?i=21437
[235] = https://curl.se/bug/?i=21461
[236] = https://curl.se/bug/?i=21322
[237] = https://curl.se/bug/?i=21388
[238] = https://curl.se/bug/?i=21354
[239] = https://curl.se/bug/?i=21386
[240] = https://curl.se/bug/?i=21385
[241] = https://curl.se/bug/?i=21384
[242] = https://curl.se/bug/?i=21312
[243] = https://curl.se/bug/?i=21383
[244] = https://curl.se/bug/?i=21297
[245] = https://curl.se/bug/?i=21313
[246] = https://curl.se/bug/?i=21304
[247] = https://curl.se/bug/?i=21296
[248] = https://curl.se/bug/?i=21296
[249] = https://curl.se/bug/?i=21441
[250] = https://curl.se/bug/?i=21444
[251] = https://curl.se/bug/?i=21302
[252] = https://curl.se/bug/?i=21380
[253] = https://curl.se/bug/?i=21378
[254] = https://curl.se/bug/?i=20794
[255] = https://curl.se/bug/?i=21377
[256] = https://curl.se/bug/?i=21301
[257] = https://curl.se/bug/?i=21303
[258] = https://curl.se/bug/?i=21372
[259] = https://curl.se/bug/?i=21146
[260] = https://curl.se/bug/?i=21298
[261] = https://curl.se/bug/?i=21270
[262] = https://curl.se/bug/?i=21440
[263] = https://curl.se/bug/?i=21460
[264] = https://curl.se/bug/?i=21360
[265] = https://curl.se/bug/?i=21458
[266] = https://curl.se/bug/?i=21364
[267] = https://curl.se/bug/?i=21363
[268] = https://curl.se/bug/?i=21357
[269] = https://curl.se/bug/?i=21359
[270] = https://curl.se/bug/?i=21358
[273] = https://curl.se/bug/?i=21455
[274] = https://curl.se/bug/?i=21351
[275] = https://curl.se/bug/?i=21340
[276] = https://curl.se/bug/?i=21449
[278] = https://curl.se/bug/?i=21432
[279] = https://curl.se/bug/?i=21430
[280] = https://curl.se/bug/?i=21427
[284] = https://curl.se/bug/?i=21396
[285] = https://curl.se/bug/?i=21421
[288] = https://curl.se/bug/?i=19814
[291] = https://curl.se/bug/?i=21415
[294] = https://curl.se/bug/?i=21411
+40
View File
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: curl
# SPDX-FileCopyrightText: Daniel Stenberg, <daniel@haxx.se>, et al.
# This file describes the licensing and copyright situation for files that
# cannot be annotated directly, for example because of being
# uncommentable. Unless this is the case, a file should be annotated directly.
#
# This follows the REUSE specification: https://reuse.software/spec-3.2/#reusetoml
version = 1
SPDX-PackageName = "curl"
SPDX-PackageDownloadLocation = "https://curl.se/"
[[annotations]]
path = [
"docs/INSTALL",
"docs/libcurl/symbols-in-versions",
"docs/options-in-versions",
"docs/THANKS",
"lib/libcurl.vers.in",
"lib/libcurl.def",
"projects/OS400/README.OS400",
"projects/vms/build_vms.com",
"projects/vms/curl_release_note_start.txt",
"projects/vms/curlmsg.sdl",
"projects/vms/macro32_exactcase.patch",
"projects/vms/readme",
"projects/Windows/**",
"README",
"RELEASE-NOTES",
"renovate.json",
"tests/certs/**",
"tests/data/data**",
"tests/data/test**",
"tests/valgrind.supp",
]
SPDX-FileCopyrightText = "Daniel Stenberg, <daniel@haxx.se>, et al."
SPDX-License-Identifier = "curl"
# If there is licensing/copyright information in or next to these files, prefer that
precedence = "closest"

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