diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..2d01d71c9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml new file mode 100644 index 000000000..9c7b7f763 --- /dev/null +++ b/.github/workflows/CI_build.yml @@ -0,0 +1,65 @@ +name: CI_build + +on: [push, pull_request] + +jobs: + build: + + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + build_platform: [x64, x86, ARM64] + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Add nmake + if: matrix.build_platform == 'ARM64' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: amd64_arm64 + + - name: Add nmake + if: matrix.build_platform == 'x64' || matrix.build_platform == 'x86' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.build_platform }} + + - name: nmake libcurl + working-directory: curl/winbuild + run: | + set WINBUILD_ACKNOWLEDGE_DEPRECATED=yes + nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static WINBUILD_ACKNOWLEDGE_DEPRECATED=yes MACHINE="${{ matrix.build_platform }}" + nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static WINBUILD_ACKNOWLEDGE_DEPRECATED=yes DEBUG=yes MACHINE="${{ matrix.build_platform }}" + + - name: MSBuild of GUP exe + working-directory: vcproj + run: | + msbuild GUP.sln /m /p:configuration="Release" /p:platform="${{ matrix.build_platform }}" + msbuild GUP.sln /m /p:configuration="Debug" /p:platform="${{ matrix.build_platform }}" + + - name: Archive artifacts for x64 + if: matrix.build_platform == 'x64' + uses: actions/upload-artifact@v4 + with: + name: gup_exe_x64 + path: bin64\ + + - name: Archive artifacts for x86 + if: matrix.build_platform == 'x86' + uses: actions/upload-artifact@v4 + with: + name: gup_exe_x86 + path: bin\ + + - name: Archive artifacts for ARM64 + if: matrix.build_platform == 'ARM64' + uses: actions/upload-artifact@v4 + with: + name: gup_exe_arm64 + path: binarm64\ diff --git a/.gitignore b/.gitignore index 36c54019c..d301ccacf 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ ipch/ *.opensdf *.sdf *.cachefile +*.opendb #-- Backup & report files from converting an old project file to a newer # Visual Studio version. Backup files are not needed, because we have git ;-) @@ -51,8 +52,10 @@ UpgradeLog*.htm *.tmp_proj .builds *.pidb +*.bak bin/ bin64/ +binarm64/ curl/build curl/builds @@ -87,7 +90,6 @@ $RECYCLE.BIN/ *.d *.o -vcproj/GUP.sln curl/winbuild/CURL_OBJS.inc curl/winbuild/LIBCURL_OBJS.inc curl/winbuild/vc120.idb diff --git a/README.md b/README.md index f074fb5f3..0de274a88 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,24 @@ -What is WinGup? +What is WinGUp for Notepad++? +-------------------------- + +This project is a fork of [WinGUp](https://github.com/gup4win/wingup)
+WinGUp was originally built to meet the need of Notepad++, but its functionality was kept generic so it could be used with any Windows application. With the introduction of the built-in Plugins Admin in Notepad++, a more specific updater for Notepad++ become necessary. Hence this fork was created from the original WinGUp. + +**Note:** [the original repository of WinGUp](https://github.com/gup4win/wingup) is no longer maintained. You can integrate ***WinGUp for Notepad++***, which provides the basic updating feature, into your project. + +What is WinGUp? --------------- -WinGup is a Generic Updater running under Windows environment. -The aim of WinGup is to provide a ready to use and configurable updater +WinGUp is a Generic Updater running under Windows environment. +The aim of WinGUp is to provide a ready to use and configurable updater which downloads a update package then installs it. By using cURL library -and TinyXml module, WinGup is capable to deal with http protocol and process XML data. +and TinyXml module, WinGUp is capable to deal with http protocol and process XML data. -Why WinGup? +Why WinGUp? ----------- -Originally WinGup was made for the need of Notepad++ (a generic source code editor under MS Windows). +Originally WinGUp was made for the need of Notepad++ (a generic source code editor under MS Windows). During its conception, the idea came up in my mind: if it can fit Notepad++, it can fit for any Windows program. So here it is, with LGPL license to have no (almost not) restriction for integration in any project. @@ -19,8 +27,8 @@ So here it is, with LGPL license to have no (almost not) restriction for integra How does it work? ----------------- -WinGup can be launched by your program or manually. It reads from a xml configuration file -for getting the current version of your program and url where WinGup gets update information, +WinGUp can be launched by your program or manually. It reads from a xml configuration file +for getting the current version of your program and url where WinGUp gets update information, checks the url (with given current version) to get the update package location, downloads the update package, then run the update package (it should be a msi or an exe) in question. @@ -29,47 +37,50 @@ downloads the update package, then run the update package (it should be a msi or Who will need it? ----------------- -Being LGPLed, WinGup can be integrated in both commercial (or close source) and open source project. +Being LGPLed, WinGUp can be integrated in both commercial (or close source) and open source project. So if you run a commercial or open a source project under MS Windows and you release your program at -regular intervals, then you may need WinGup to notice your users the new update. +regular intervals, then you may need WinGUp to notice your users the new update. What do you need to use it? --------------------------- -A url to provide the update information to your WinGup and an another url location +A url to provide the update information to your WinGUp and an another url location to store your update package, that's it! -How is WinGup easy to use? +How is WinGUp easy to use? -------------------------- -All you have to do is point WinGup to your url update page (by modifying gup.xml), +All you have to do is point WinGUp to your url update page (by modifying gup.xml), then work on your pointed url update page (see getDownLoadUrl.php comes with the release) -to make sure it responds to your WinGup with the correct xml data. +to make sure it responds to your WinGUp with the correct xml data. How to build it? ---------------- - 0. You have to build cURL before building WinGup: - ``` - a. Open VS2015 Native Tool Command for 32/64 bits - b. go to curl winbuild directory: - cd \curl\winbuild - c. compile cURL by using one of the following commands, according the mode and archetecture of wingup you want to build. - x64 release: nmake /f Makefile.vc mode=dll vc=14 RTLIBCFG=static MACHINE=x64 - x64 debug: nmake /f Makefile.vc mode=dll vc=14 RTLIBCFG=static DEBUG=yes MACHINE=x64 - x86 release: nmake /f Makefile.vc mode=dll vc=14 RTLIBCFG=static MACHINE=x86 - x86 debug: nmake /f Makefile.vc mode=dll vc=14 RTLIBCFG=static DEBUG=yes MACHINE=x86 -``` - 1. Open [`vcproj\GUP.vcxproj`](https://github.com/gup4win/wingup/blob/master/vcproj/GUP.vcxproj) + * Step 1: You have to build cURL before building WinGUp: + + 1. Open VS2022 Native Tool Command for 32/64 bits. If you want to build for ARM, open a cmd, and run the following command:
+ `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat` + 2. Go to winbuild directory under curl directory:
+ `cd \curl\winbuild\` then run: + `set WINBUILD_ACKNOWLEDGE_DEPRECATED=yes` + 3. Compile cURL by using one of the following commands, according the mode and architecture of WinGUp you want to build. + - x64 release: `nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static MACHINE=x64` + - x64 debug: `nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static DEBUG=yes MACHINE=x64` + - x86 release: `nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static MACHINE=x86` + - x86 debug: `nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static DEBUG=yes MACHINE=x86` + - ARM64 release: `nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static MACHINE=ARM64` + - ARM64 debug: `nmake /f Makefile.vc mode=dll vc=15 RTLIBCFG=static DEBUG=yes MACHINE=ARM64` + + * Step 2: Open [`vcproj\GUP.sln`](https://github.com/gup4win/wingup/blob/master/vcproj/GUP.sln) with VS2022. - 2. Build WinGup [like a normal Visual Studio project](https://msdn.microsoft.com/en-us/library/7s88b19e.aspx) with VS2015 - + * Step 3: Build WinGUp like a normal Visual Studio project. To whom should you say "thank you"? @@ -77,3 +88,4 @@ To whom should you say "thank you"? Don HO + diff --git a/curl/CHANGES b/curl/CHANGES deleted file mode 100644 index 5043a1f58..000000000 --- a/curl/CHANGES +++ /dev/null @@ -1,6806 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Changelog - -Version 7.56.1 (23 Oct 2017) - -Daniel Stenberg (23 Oct 2017) -- RELEASE-NOTES: 7.56.1 - -- THANKS: update at 7.56.1 release time - -- [Jon DeVree brought this change] - - mk-ca-bundle: Remove URL for aurora - - Aurora is no longer used by Mozilla - https://hacks.mozilla.org/2017/04/simplifying-firefox-release-channels/ - -- [Jon DeVree brought this change] - - mk-ca-bundle: Fix URL for NSS - - The 'tip' is the most recent branch committed to, this should be - 'default' like the URLs for the browser are. - - Closes #1998 - -- imap: if a FETCH response has no size, don't call write callback - - CVE-2017-1000257 - - Reported-by: Brian Carpenter and 0xd34db347 - Also detected by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3586 - -- ftp: reject illegal IP/port in PASV 227 response - - ... by using range checks. Among other things, this avoids an undefined - behavior for a left shift that could happen on negative or very large - values. - - Closes #1997 - - Detected by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3694 - -Patrick Monnerat (20 Oct 2017) -- test653: check reuse of easy handle after mime data change - - See issue #1999 - -- mime: do not reuse previously computed multipart size - - The contents might have changed: size must be recomputed. - - Reported-by: moteus on github - Fixes #1999 - -- test308: disable if MultiSSL feature enabled - - Even if OpenSSL is enabled, it might not be the default backend when - multi-ssl is enabled, causing the test to fail. - -- runtests: support MultiSSL client feature - -- vtls: change struct Curl_ssl `close' field name to `close_one'. - - On OS/400, `close' is an ASCII system macro that corrupts the code if - not used in a context not targetting the close() system API. - -- os400: add missing symbols in config file. - - Also adjust makefile to renamed files and warn about installation dirs mix-up. - -- test652: curl_mime_data + base64 encoder with large contents - -- mime: limit bas64-encoded lines length to 76 characters - -Daniel Stenberg (16 Oct 2017) -- RELEASE-NOTES: synced with f121575c0 - -- setopt: range check most long options - - ... filter early instead of risking "funny values" having to be dealt - with elsewhere. - -- setopt: avoid integer overflows when setting millsecond values - - ... that are multiplied by 1000 when stored. - - For 32 bit long systems, the max value accepted (2147483 seconds) is > - 596 hours which is unlikely to ever be set by a legitimate application - - and previously it didn't work either, it just caused undefined behavior. - - Also updated the man pages for these timeout options to mention the - return code. - - Closes #1938 - -Viktor Szakats (15 Oct 2017) -- makefile.m32: allow to override gcc, ar and ranlib - - Allow to ovverride certain build tools, making it possible to - use LLVM/Clang to build curl. The default behavior is unchanged. - To build with clang (as offered by MSYS2), these settings can - be used: - - CURL_CC=clang - CURL_AR=llvm-ar - CURL_RANLIB=llvm-ranlib - - Closes https://github.com/curl/curl/pull/1993 - -- ldap: silence clang warning - - Use memset() to initialize a structure to avoid LLVM/Clang warning: - ldap.c:193:39: warning: missing field 'UserLength' initializer [-Wmissing-field-initializers] - - Closes https://github.com/curl/curl/pull/1992 - -Daniel Stenberg (14 Oct 2017) -- runtests: use valgrind for torture as well - - NOTE: it makes them terribly slow. I recommend only using valgrind for - specific torture tests or using lots of patience. - -- memdebug: trace send, recv and socket - - ... to allow them to be included in torture tests too. - - closes #1980 - -- configure: remove the C++ compiler check - - ... we used it only for the fuzzer, which we now have in a separate git - repo. - - Closes #1990 - -Patrick Monnerat (13 Oct 2017) -- mime: do not call failf() if easy handle is NULL. - -Daniel Stenberg (13 Oct 2017) -- test651: curl_formadd with huge COPYCONTENTS - -- mime: fix the content reader to handle >16K data properly - - Reported-by: Jeroen Ooms - Closes #1988 - -Patrick Monnerat (12 Oct 2017) -- mime: keep "text/plain" content type if user-specified. - - Include test cases in 554, 587, 650. - - Fixes https://github.com/curl/curl/issues/1986 - -- cli tool: use file2memory() to buffer stdin in -F option. - - Closes PR https://github.com/curl/curl/pull/1985 - -- cli tool: reimplement stdin buffering in -F option. - - If stdin is not a regular file, its content is memory-buffered to enable - a possible data "rewind". - In all cases, stdin data size is determined before real use to avoid - having an unknown part's size. - - --libcurl generated code is left as an unbuffered stdin fread/fseek callback - part with unknown data size. - - Buffering is not supported in deprecated curl_formadd() API. - -Daniel Stenberg (12 Oct 2017) -- winbuild/BUILD.WINDOWS.txt: mention WITH_NGHTTP2 - -- HELP-US: the label "PR-welcome" is now renamed to "help wanted" - - following the new github "standard" - -- RELEASE-NOTES: synced with 5505df7d2 - -Jay Satiro (11 Oct 2017) -- [Artak Galoyan brought this change] - - url: Update current connection SSL verify params in setopt - - Now VERIFYHOST, VERIFYPEER and VERIFYSTATUS options change during active - connection updates the current connection's (i.e.'connectdata' - structure) appropriate ssl_config (and ssl_proxy_config) structures - variables, making these options effective for ongoing connection. - - This functionality was available before and was broken by the - following change: - "proxy: Support HTTPS proxy and SOCKS+HTTP(s)" - CommitId: cb4e2be7c6d42ca0780f8e0a747cecf9ba45f151. - - Bug: https://github.com/curl/curl/issues/1941 - - Closes https://github.com/curl/curl/pull/1951 - -Daniel Stenberg (11 Oct 2017) -- [David Benjamin brought this change] - - openssl: don't use old BORINGSSL_YYYYMM macros - - Those were temporary things we'd add and remove for our own convenience - long ago. The last few stayed around for too long as an oversight but - have since been removed. These days we have a running - BORINGSSL_API_VERSION counter which is bumped when we find it - convenient, but 2015-11-19 was quite some time ago, so just check - OPENSSL_IS_BORINGSSL. - - Closes #1979 - -- test950; verify SMTP with custom request - -- ftpserver: support case insensitive commands - -- smtp_done: free data before returning (on send failure) - - ... as otherwise it could leak that memory. - - Detected by OSS-fuzz: - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3600 - - Assisted-by: Max Dymond - Closes #1977 - -- FTP: URL decode path for dir listing in nocwd mode - - Reported-by: Zenju on github - - Test 244 added to verify - Fixes #1974 - Closes #1976 - -- test298: verify --ftp-method nowcwd with URL encoded path - - Ref: #1974 - -- CURLOPT_XFERINFODATA.3: fix duplicate see also - -- CURLOPT_NOPROGRESS.3: also refer to xferinfofunction - -- FAQ: s/CURLOPT_PROGRESSFUNCTION/CURLOPT_XFERINFOFUNCTION - -- openssl: enable PKCS12 support for !BoringSSL - - Enable PKCS12 for all non-boringssl builds without relying on configure - or cmake checks. - - Bug: https://curl.haxx.se/mail/lib-2017-10/0007.html - Reported-by: Christian Schmitz - Closes #1948 - -- [Kristiyan Tsaklev brought this change] - - curl: don't pass semicolons when parsing Content-Disposition - - Test 1422 updated to verify. - - Closes #1964 - -Patrick Monnerat (9 Oct 2017) -- mime: properly unbind mime structure in curl_mime_free(). - - This allows freeing a mime structure bound to the easy handle before - curl_easy_cleanup(). - - Fixes #1970. - -Daniel Stenberg (9 Oct 2017) -- RTSP: avoid integer overflow on funny RTSP response - - ... like a very large non-existing RTSP version number. - - Added test 577 to verify. - - Detected by OSS-fuzz. - Closes #1969 - -Patrick Monnerat (8 Oct 2017) -- ftpserver: properly reset $ftptargetdir. - -- test643: verify curl_mime_subparts() rejects cyclic additions. - -- mime: refuse to add subparts to one of their own descendants. - - Reported-by: Alexey Melnichuk - Fixes #1962 - -- mime: avoid resetting a part's encoder when part's contents change. - -- mime: improve unbinding top multipart from easy handle. - - Also avoid dangling pointers in referencing parts. - -Daniel Stenberg (8 Oct 2017) -- RELEASE-NOTES: synced with a4c1c75da30af1 - -- curlver.h: next expected release is 7.57.0 - -Patrick Monnerat (8 Oct 2017) -- mime: be tolerant about setting twice the same header list in a part. - -- docs: clarify form/mime usage of non-regular data files. - -Daniel Stenberg (8 Oct 2017) -- Revert "multi_done: wait for name resolve to finish if still ongoing" - - This reverts commit f3e03f6c0ac52a1bf396e03f7d7e9b5b3b7165fe. - - Caused memory leaks in the fuzzer, needs to be done differently. - - Disable test 1553 for now too, as it causes memory leaks without this - commit! - -- remove_handle: call multi_done() first, then clear dns cache pointer - - Closes #1960 - -- multi_done: wait for name resolve to finish if still ongoing - - ... as we must clean up memory. - -- pingpong: return error when trying to send without connection - - When imap_done() got called before a connection is setup, it would try - to "finish up" and dereffed a NULL pointer. - - Test case 1553 managed to reproduce. I had to actually use a host name - to try to resolve to slow it down, as using the normal local server IP - will make libcurl get a connection in the first curl_multi_perform() - loop and then the bug doesn't trigger. - - Fixes #1953 - Assisted-by: Max Dymond - -Dan Fandrich (6 Oct 2017) -- tests: added flaky keyword to tests 587 and 644 - - These are around 5% flaky in my Linux x86 autobuilds. - -Marcel Raad (6 Oct 2017) -- vtls: fix warnings with --disable-crypto-auth - - When CURL_DISABLE_CRYPTO_AUTH is defined, Curl_none_md5sum's parameters - are not used. - -Daniel Stenberg (6 Oct 2017) -- multi_cleanup: call DONE on handles that never got that - - ... fixes a memory leak with at least IMAP when remove_handle is never - called and the transfer is abruptly just abandoned early. - - Test 1552 added to verify - - Detected by OSS-fuzz - Assisted-by: Max Dymond - Closes #1954 - -- [Benbuck Nason brought this change] - - strtoofft: Remove extraneous null check - - Fixes #1950: curlx_strtoofft() doesn't fully protect against null 'str' - argument. - - Closes #1952 - -- openssl: fix build without HAVE_OPAQUE_EVP_PKEY - - Reported-by: Javier Sixto - Fixes #1955 - Closes #1956 - -Viktor Szakats (6 Oct 2017) -- lib/config-win32.h: let SMB/SMBS be enabled with OpenSSL/NSS - - The source code is now prepared to handle the case when both - Win32 Crypto and OpenSSL/NSS crypto backends are enabled - at the same time, making it now possible to enable `USE_WIN32_CRYPTO` - whenever the targeted Windows version supports it. Since this - matches the minimum Windows version supported by curl - (Windows 2000), enable it unconditionally for the Win32 platform. - - This in turn enables SMB (and SMBS) protocol support whenever - Win32 Crypto is available, regardless of what other crypto backends - are enabled. - - Ref: https://github.com/curl/curl/pull/1840#issuecomment-325682052 - - Closes https://github.com/curl/curl/pull/1943 - -Daniel Stenberg (5 Oct 2017) -- build: fix --disable-crypto-auth - - Reported-by: Wyatt O'Day - Fixes #1945 - Closes #1947 - -Jay Satiro (5 Oct 2017) -- [Nick Zitzmann brought this change] - - darwinssl: add support for TLSv1.3 - - Closes https://github.com/curl/curl/pull/1794 - -Daniel Stenberg (4 Oct 2017) -- [Felix Kaiser brought this change] - - docs: fix typo in curl_mime_data_cb man page - - Closes #1946 - -Viktor Szakats (4 Oct 2017) -- lib/Makefile.m32: allow customizing dll suffixes - - - New `CURL_DLL_SUFFIX` envvar will add a suffix to the generated - libcurl dll name. Useful to add `-x64` to 64-bit builds so that - it can live in the same directory as the 32-bit one. By default - this is empty. - - - New `CURL_DLL_A_SUFFIX` envvar to customize the suffix of the - generated import library (implib) for libcurl .dll. It defaults - to `dll`, and it's useful to modify that to `.dll` to have the - standard naming scheme for mingw-built .dlls, i.e. `libcurl.dll.a`. - - Closes https://github.com/curl/curl/pull/1942 - -Daniel Stenberg (4 Oct 2017) -- [Max Dymond brought this change] - - fuzzer: move to using external curl-fuzzer - - Use the external curl-fuzzer repository for fuzzing. - - Closes #1923 - -- failf: skip the sprintf() if there are no consumers - - Closes #1936 - -- ftp: UBsan fixup 'pointer index expression overflowed' - - Closes #1939 - -- RELEASE-PROCEDURE: update the release schedule - -Version 7.56.0 (4 Oct 2017) - -Daniel Stenberg (4 Oct 2017) -- RELEASE-NOTES: curl 7.56.0 - -- THANKS: added new 7.56.0 contributors - -Jay Satiro (4 Oct 2017) -- build-openssl.bat: Warn OpenSSL 1.1.0 not yet supported - - Ref: https://github.com/curl/curl/issues/1002 - -Michael Kaufmann (3 Oct 2017) -- idn: fix source code comment - -- vtls: compare and clone ssl configs properly - - Compare these settings in Curl_ssl_config_matches(): - - verifystatus (CURLOPT_SSL_VERIFYSTATUS) - - random_file (CURLOPT_RANDOM_FILE) - - egdsocket (CURLOPT_EGDSOCKET) - - Also copy the setting "verifystatus" in Curl_clone_primary_ssl_config(), - and copy the setting "sessionid" unconditionally. - - This means that reusing connections that are secured with a client - certificate is now possible, and the statement "TLS session resumption - is disabled when a client certificate is used" in the old advisory at - https://curl.haxx.se/docs/adv_20170419.html is obsolete. - - Reviewed-by: Daniel Stenberg - - Closes #1917 - -- proxy: read the "no_proxy" variable only if necessary - - Reviewed-by: Daniel Stenberg - - Closes #1919 - -Patrick Monnerat (3 Oct 2017) -- libcurl-tutorial: add casts in example to avoid compilation warnings. - -Daniel Stenberg (3 Oct 2017) -- examples: bring back curl_formadd-using examples - - ... now with a -formadd suffix. While the new mime API is introduced in - 7.56.0 we must acknowledge that lots of users can't upgrade their curl - versions immediately. - -- test1153: verify quoted double-qoutes in PWD response - -- FTP: zero terminate the entry path even on bad input - - ... a single double quote could leave the entry path buffer without a zero - terminating byte. CVE-2017-1000254 - - Test 1152 added to verify. - - Reported-by: Max Dymond - Bug: https://curl.haxx.se/docs/adv_20171004.html - -Jay Satiro (2 Oct 2017) -- [Sergei Nikulov brought this change] - - cmake: disable tests and man generation if perl/nroff not found - - Fixes https://github.com/curl/curl/issues/1500 - Reported-by: Jay Satiro - - Fixes https://github.com/curl/curl/pull/1662 - Assisted-by: Tom Seddon - Assisted-by: dpull@users.noreply.github.com - Assisted-by: elelel@users.noreply.github.com - - Closes https://github.com/curl/curl/pull/1924 - -Patrick Monnerat (2 Oct 2017) -- libcurl-tutorial: fix two typos. - -- TODO: remove deprecated form API items. - -- libcurl-tutorial: describe MIME API and deprecate form API. - - Include a guide to form/mime API conversion. - -Daniel Stenberg (30 Sep 2017) -- cookie: fix memory leak if path was set twice in header - - ... this will let the second occurance override the first. - - Added test 1161 to verify. - - Reported-by: Max Dymond - Fixes #1932 - Closes #1933 - -Dan Fandrich (30 Sep 2017) -- test650: Use variable replacement to set the host address and port - - Otherwise, the test fails when the -b test option is used to set a - different test port range. - -- Set and use more necessary options when some protocols are disabled - - When curl and libcurl are built with some protocols disabled, they stop - setting and receiving some options that don't make sense with those - protocols. In particular, when HTTP is disabled many options aren't set - that are used only by HTTP. However, some options that appear to be - HTTP-only are actually used by other protocols as well (some despite - having HTTP in the name) and should be set, but weren't. This change now - causes some of these options to be set and used for more (or for all) - protocols. In particular, this fixes tests 646 through 649 in an - HTTP-disabled build, which use the MIME API in the mail protocols. - -Daniel Stenberg (29 Sep 2017) -- test1160: verifies cookie leak for large cookies - - The fix done in 20ea22ff735 - -- cookie: fix memory leak on oversized rejection - - Regression brought by 2bc230de63b - - Detected by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3513 - Assisted-by: Max Dymond - - Closes #1930 - -- [Anders Bakken brought this change] - - connect: fix race condition with happy eyeballs timeout - - The timer should be started after conn->connecttime is set. Otherwise - the timer could expire without this condition being true: - - /* should we try another protocol family? */ - if(i == 0 && conn->tempaddr[1] == NULL && - curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) { - - Ref: #1928 - -Michael Kaufmann (28 Sep 2017) -- docs: link CURLOPT_CONNECTTIMEOUT and CURLOPT_CONNECTTIMEOUT_MS - - Closes #1922 - -- docs: clarify the use of environment variables for proxy - - Closes #1921 - -- http: add custom empty headers to repeated requests - - Closes #1920 - -- reuse_conn: don't copy flags that are known to be equal - - A connection can only be reused if the flags "conn_to_host" and - "conn_to_port" match. Therefore it is not necessary to copy these flags - in reuse_conn(). - - Closes #1918 - -Daniel Stenberg (27 Sep 2017) -- curl.h: include on cygwin too - - When building with -std=c++14 on cygwin, this header won't be - automatically included as it otherwise is. - - The include decision should ideally be reversed and be - avoided where that header file doesn't exist. - - Reported-by: Ian Fette - Fixes #1925 - -- RELEASE-NOTES: synced with d8ab5dc50 - -Michael Kaufmann (24 Sep 2017) -- tests: adjust .gitignore for new tests - -Jay Satiro (23 Sep 2017) -- ntlm: move NTLM_NEEDS_NSS_INIT define into core NTLM header - - .. and include the core NTLM header in all NTLM-related source files. - - Follow up to 6f86022. Since then http_ntlm checks NTLM_NEEDS_NSS_INIT - but did not include vtls.h where it was defined. - - Closes https://github.com/curl/curl/pull/1911 - -Daniel Stenberg (23 Sep 2017) -- file_range: avoid integer overflow when figuring out byte range - - When trying to bump the value with one and the value is already at max, - it causes an integer overflow. - - Closes #1908 - Detected by oss-fuzz: - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3465 - - Assisted-by: Max Dymond - -Michael Kaufmann (23 Sep 2017) -- tests: fix a compiler warning in test 643 - -Jay Satiro (23 Sep 2017) -- symbols-in-versions: fix CURLSSLSET_NO_BACKENDS entry - - - Use spaces instead of tabs as the delimiter. - - Follow up to 7c52b12 which added the entry. The entry had used tabs but - the symbol-scan parser doesn't recognize tabs and would fail the symbol. - -Viktor Szakats (22 Sep 2017) -- metalink: fix NSS issue in MultiSSL builds - - In MultiSSL mode (i.e. when more than one SSL backend is compiled - in), we cannot use the compile time flag `USE_NSS` as indicator that - the NSS backend is in use. As far as Metalink is concerned, the SSL - backend is only used for MD5, SHA-1 and SHA-256 calculations, - therefore one of the available SSL backends is selected at compile - time, in a strict order of preference. - - Let's introduce a new `HAVE_NSS_CONTEXT` constant that can be used - to determine whether the SSL backend used for Metalink is the NSS - backend, and use that to guard the code that wants to de-initialize - the NSS-specific data structure. - - Ref: https://github.com/curl/curl/pull/1848 - -- ntlm: use strict order for SSL backend #if branches - - With the recently introduced MultiSSL support multiple SSL backends - can be compiled into cURL That means that now the order of the SSL - - One option would be to use the same SSL backend as was configured - via `curl_global_sslset()`, however, NTLMv2 support would appear - to be available only with some SSL backends. For example, when - eb88d778e (ntlm: Use Windows Crypt API, 2014-12-02) introduced - support for NTLMv1 using Windows' Crypt API, it specifically did - *not* introduce NTLMv2 support using Crypt API at the same time. - - So let's select one specific SSL backend for NTLM support when - compiled with multiple SSL backends, using a priority order such - that we support NTLMv2 even if only one compiled-in SSL backend can - be used for that. - - Ref: https://github.com/curl/curl/pull/1848 - -Daniel Stenberg (22 Sep 2017) -- symbols-in-versions: add CURLSSLSET_NO_BACKENDS - - ...fixup from b8e0fe19ec - -- imap: quote atoms properly when escaping characters - - Updates test 800 to verify - - Fixes #1902 - Closes #1903 - -- tests: make the imap server not verify user+password - - ... as the test cases themselves do that and it makes it easier to add - crazy test cases. - - Test 800 updated to use user name + password that need quoting. - - Test 856 updated to trigger an auth fail differently. - - Ref: #1902 - -- vtls: provide curl_global_sslset() even in non-SSL builds - - ... it just returns error: - - Bug: https://github.com/curl/curl/commit/1328f69d53f2f2e937696ea954c480412b018451#commitcomment-24470367 - Reported-by: Marcel Raad - - Closes #1906 - -Patrick Monnerat (22 Sep 2017) -- form/mime: field names are not allowed to contain zero-valued bytes. - - Also suppress length argument of curl_mime_name() (names are always - zero-terminated). - -Daniel Stenberg (21 Sep 2017) -- [Dirk Feytons brought this change] - - openssl: only verify RSA private key if supported - - In some cases the RSA key does not support verifying it because it's - located on a smart card, an engine wants to hide it, ... - Check the flags on the key before trying to verify it. - OpenSSL does the same thing internally; see ssl/ssl_rsa.c - - Closes #1904 - -Marcel Raad (21 Sep 2017) -- examples/post-callback: use long for CURLOPT_POSTFIELDSIZE - - Otherwise, typecheck-gcc.h warns on MinGW-w64. - -Patrick Monnerat (20 Sep 2017) -- mime: rephrase the multipart output state machine (#1898) ... - - ... in hope coverity will like it much. - -- mime: fix an explicit null dereference (#1899) - -Daniel Stenberg (20 Sep 2017) -- curl: check fseek() return code and bail on error - - Detected by coverity. CID 1418137. - -- smtp: fix memory leak in OOM - - Regression since ce0881edee - - Coverity CID 1418139 and CID 1418136 found it, but it was also seen in - torture testing. - -- RELEASE-NOTES: synced with 5fe85587c - -- [Pavel P brought this change] - - cookies: use lock when using CURLINFO_COOKIELIST - - Closes #1896 - -- [Max Dymond brought this change] - - ossfuzz: changes before merging the generated corpora - - Before merging in the oss-fuzz corpora from Google, there are some changes - to the fuzzer. - - Add a read corpus script, to display corpus files nicely. - - Change the behaviour of the fuzzer so that TLV parse failures all now - go down the same execution paths, which should reduce the size of the - corpora. - - Make unknown TLVs a failure to parse, which should decrease the size - of the corpora as well. - - Closes #1881 - -- mime:escape_string minor clarification change - - ... as it also removes a warning with old gcc versions. - - Bug: https://curl.haxx.se/mail/lib-2017-09/0049.html - Reported-by: Ben Greear - -- [Max Dymond brought this change] - - ossfuzz: don't write out to stdout - - Don't make the fuzzer write out to stdout - instead write some of the - contents to a memory block so we exercise the data output code but - quietly. - - Closes #1885 - -- cookies: reject oversized cookies - - ... instead of truncating them. - - There's no fixed limit for acceptable cookie names in RFC 6265, but the - entire cookie is said to be less than 4096 bytes (section 6.1). This is - also what browsers seem to implement. - - We now allow max 5000 bytes cookie header. Max 4095 bytes length per - cookie name and value. Name + value together may not exceed 4096 bytes. - - Added test 1151 to verify - - Bug: https://curl.haxx.se/mail/lib-2017-09/0062.html - Reported-by: Kevin Smith - - Closes #1894 - -- travis: on mac, don't install openssl or libidn - - - openssl is already installed and causes warnings when trying to - install again - - - libidn isn't used these days, and homebrew doesn't seem to have a - libidn2 package to replace with easily - - Closes #1895 - -- curl: make str2udouble not return values on error - - ... previously it would store a return value even when it returned - error, which could make the value get used anyway! - - Reported-by: Brian Carpenter - Closes #1893 - -Jay Satiro (18 Sep 2017) -- socks: fix incorrect port number in SOCKS4 error message - - Prior to this change it appears the SOCKS5 port parsing was erroneously - used for the SOCKS4 error message, and as a result an incorrect port - would be shown in the error message. - - Bug: https://github.com/curl/curl/issues/1892 - Reported-by: Jackarain@users.noreply.github.com - -- [Marc Aldorasi brought this change] - - schannel: Support partial send for when data is too large - - Schannel can only encrypt a certain amount of data at once. Instead of - failing when too much data is to be sent at once, send as much data as - we can and let the caller send the remaining data by calling send again. - - Bug: https://curl.haxx.se/mail/lib-2014-07/0033.html - - Closes https://github.com/curl/curl/pull/1890 - -- [David Benjamin brought this change] - - openssl: add missing includes - - lib/vtls/openssl.c uses OpenSSL APIs from BUF_MEM and BIO APIs. Include - their headers directly rather than relying on other OpenSSL headers - including things. - - Closes https://github.com/curl/curl/pull/1891 - -Daniel Stenberg (15 Sep 2017) -- conversions: fix several compiler warnings - -- server/getpart: provide dummy function to build conversion enabled - -- non-ascii: use iconv() with 'char **' argument - - Bug: https://curl.haxx.se/mail/lib-2017-09/0031.html - -- escape.c: error: pointer targets differ in signedness - -- docs: clarify the CURLOPT_INTERLEAVE* options behavior - -- [Max Dymond brought this change] - - rtsp: Segfault in rtsp.c when using WRITEDATA - - If the INTERLEAVEFUNCTION is defined, then use that plus the - INTERLEAVEDATA information when writing RTP. Otherwise, use - WRITEFUNCTION and WRITEDATA. - - Fixes #1880 - Closes #1884 - -Marcel Raad (15 Sep 2017) -- [Isaac Boukris brought this change] - - tests: enable gssapi in travis-ci linux build - - Closes https://github.com/curl/curl/pull/1687 - -- [Isaac Boukris brought this change] - - tests: add initial gssapi test using stub implementation - - The stub implementation is pre-loaded using LD_PRELOAD - and emulates common gssapi uses (only builds if curl is - initially built with gssapi support). - - The initial tests are currently disabled for debug builds - as LD_PRELOAD is not used then. - - Ref: https://github.com/curl/curl/pull/1687 - -Daniel Stenberg (15 Sep 2017) -- test1150: verify same host fetch using different ports over proxy - - Closes #1889 - -- URL: on connection re-use, still pick the new remote port - - ... as when a proxy connection is being re-used, it can still get a - different remote port. - - Fixes #1887 - Reported-by: Oli Kingshott - -- RELEASE-NOTES: synced with 87501e57f - -- code style: remove wrong uses of multiple spaces - - Closes #1878 - -- checksrc: detect and warn for multiple spaces - -- code style: use space after semicolon - -- checksrc: verify space after semicolons - -- code style: use spaces around pluses - -- checksrc: detect and warn for lack of spaces next to plus signs - -- code style: use spaces around equals signs - -- checksrc: verify spaces around equals signs - - ... as the code style mandates. - -- Curl_checkheaders: make it available for IMAP and SMTP too - - ... not only HTTP uses this now. - - Closes #1875 - -- travis: add build without HTTP/SMTP/IMAP - -Jay Satiro (10 Sep 2017) -- mbedtls: enable CA path processing - - CA path processing was implemented when mbedtls.c was added to libcurl - in fe7590f, but it was never enabled. - - Bug: https://github.com/curl/curl/issues/1877 - Reported-by: SBKarr@users.noreply.github.com - -Daniel Stenberg (8 Sep 2017) -- rtsp: do not call fwrite() with NULL pointer FILE * - - If the default write callback is used and no destination has been set, a - NULL pointer would be passed to fwrite()'s 4th argument. - - OSS-fuzz bug https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3327 - (not publicly open yet) - - Detected by OSS-fuzz - Closes #1874 - -- configure: use -Wno-varargs on clang 3.9[.X] debug builds - - ... to avoid a clang bug - -- [Max Dymond brought this change] - - ossfuzz: add some more handled CURL options - - Add support for HEADER, COOKIE, RANGE, CUSTOMREQUEST, MAIL_RECIPIENT, - MAIL_FROM and uploading data. - -- configure: check for C++ compiler after C, to make it non-fatal - - The tests for object file/executable file extensions are presumably only - done for the first of these macros in the configure file. - - Bug: https://github.com/curl/curl/pull/1851#issuecomment-327597515 - Reported-by: Marcel Raad - Closes #1873 - -Patrick Monnerat (7 Sep 2017) -- form API: add new test 650. - - Now that the form API is deprecated and not used anymore in curl tool, - a lot of its features left untested. Test 650 attempts to check all these - features not tested elsewhere. - -Jay Satiro (7 Sep 2017) -- configure: fix curl_off_t check's include order - - - Prepend srcdir include path instead of append. - - Prior to this change it was possible that during the check for the size - of curl_off_t the include path of a user's already installed curl could - come before the include path of the to-be-built curl, resulting in the - system.h of the former being incorrectly included for that check. - - Closes https://github.com/curl/curl/pull/1870 - -Daniel Stenberg (7 Sep 2017) -- [Jakub Zakrzewski brought this change] - - KNOWN_BUGS: Remove CMake symbol hiding issue - - It has already been fixed in 6140dfc - -- http-proxy: when not doing CONNECT, that phase is done immediately - - `conn->connect_state` is NULL when doing a regular non-CONNECT request - over the proxy and should therefor be considered complete at once. - - Fixes #1853 - Closes #1862 - Reported-by: Lawrence Wagerfield - -- [Johannes Schindelin brought this change] - - OpenSSL: fix yet another mistake while encapsulating SSL backend data - - Another mistake in my manual fixups of the largely mechanical - search-and-replace ("connssl->" -> "BACKEND->"), just like the previous - commit concerning HTTPS proxies (and hence not caught during my - earlier testing). - - Fixes #1855 - Closes #1871 - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - OpenSSL: fix erroneous SSL backend encapsulation - - In d65e6cc4f (vtls: prepare the SSL backends for encapsulated private - data, 2017-06-21), this developer prepared for a separation of the - private data of the SSL backends from the general connection data. - - This conversion was partially automated (search-and-replace) and - partially manual (e.g. proxy_ssl's backend data). - - Sadly, there was a crucial error in the manual part, where the wrong - handle was used: rather than connecting ssl[sockindex]' BIO to the - proxy_ssl[sockindex]', we reconnected proxy_ssl[sockindex]. The reason - was an incorrect location to paste "BACKEND->"... d'oh. - - Reported by Jay Satiro in https://github.com/curl/curl/issues/1855. - - Signed-off-by: Johannes Schindelin - -- [Jay Satiro brought this change] - - vtls: fix memory corruption - - Ever since 70f1db321 (vtls: encapsulate SSL backend-specific data, - 2017-07-28), the code handling HTTPS proxies was broken because the - pointer to the SSL backend data was not swapped between - conn->ssl[sockindex] and conn->proxy_ssl[sockindex] as intended, but - instead set to NULL (causing segmentation faults). - - [jes: provided the commit message, tested and verified the patch] - - Signed-off-by: Johannes Schindelin - -- vtls: switch to CURL_SHA256_DIGEST_LENGTH define - - ... instead of the prefix-less version since WolfSSL 3.12 now uses an - enum with that name that causes build failures for us. - - Fixes #1865 - Closes #1867 - Reported-by: Gisle Vanem - -- travis: add c-ares enabled builds linux + osx - - Closes #1868 - -- HISTORY: added some recent items - -Jay Satiro (6 Sep 2017) -- SSL: fix unused parameter warnings - -Patrick Monnerat (6 Sep 2017) -- mime: drop internal FILE * support. - - - The part kind MIMEKIND_FILE and associated code are suppressed. - - Seek data origin offset not used anymore: suppressed. - - MIMEKIND_NAMEDFILE renamed MIMEKIND_FILE; associated fields/functions - renamed accordingly. - - Curl_getformdata() processes stdin via a callback. - -Daniel Stenberg (6 Sep 2017) -- configure: remove --enable-soname-bump and SONAME_BUMP - - Back in 2008, (and commit 3f3d6ebe665f3) we changed the logic in how we - determine the native type for `curl_off_t`. To really make sure we - didn't break ABI without bumping SONAME, we introduced logic that - attempted to detect that it would use a different size and thus not be - compatible. We also provided a manual switch that allowed users to tell - configure to bump SONAME by force. - - Today, we know of no one who ever got a SONAME bump auto-detected and we - don't know of anyone who's using the manual bump feature. The auto- - detection is also no longer working since we introduced defining - curl_off_t in system.h (7.55.0). - - Finally, this bumping logic is not present in the cmake build. - - Closes #1861 - -Jay Satiro (6 Sep 2017) -- [Gisle Vanem brought this change] - - vtls: select ssl backend case-insensitive (follow-up) - - - Do a case-insensitive comparison of CURL_SSL_BACKEND env as well. - - - Change Curl_strcasecompare calls to strcasecompare - (maps to the former but shorter). - - Follow-up to c290b8f. - - Bug: https://github.com/curl/curl/commit/c290b8f#commitcomment-24094313 - - Co-authored-by: Jay Satiro - -- openssl: Integrate Peter Wu's SSLKEYLOGFILE implementation - - This is an adaptation of 2 of Peter Wu's SSLKEYLOGFILE implementations. - - The first one, written for old OpenSSL versions: - https://git.lekensteyn.nl/peter/wireshark-notes/tree/src/sslkeylog.c - - The second one, written for BoringSSL and new OpenSSL versions: - https://github.com/curl/curl/pull/1346 - - Note the first one is GPL licensed but the author gave permission to - waive that license for libcurl. - - As of right now this feature is disabled by default, and does not have - a configure option to enable it. To enable this feature define - ENABLE_SSLKEYLOGFILE when building libcurl and set environment - variable SSLKEYLOGFILE to a pathname that will receive the keys. - - And in Wireshark change your preferences to point to that key file: - Edit > Preferences > Protocols > SSL > Master-Secret - - Co-authored-by: Peter Wu - - Ref: https://github.com/curl/curl/pull/1030 - Ref: https://github.com/curl/curl/pull/1346 - - Closes https://github.com/curl/curl/pull/1866 - -Patrick Monnerat (5 Sep 2017) -- mime: fix a trivial warning. - -- mime: replace 'struct Curl_mimepart' by 'curl_mimepart' in encoder code. - - mime_state is now a typedef. - -- mime: implement encoders. - - curl_mime_encoder() is operational and documented. - curl tool -F option is extended with ";encoder=". - curl tool --libcurl option generates calls to curl_mime_encoder(). - New encoder tests 648 & 649. - Test 1404 extended with an encoder specification. - -- runtests.pl: support attribute "nonewline" in part verify/upload. - -- [Daniel Stenberg brought this change] - - fixup data/test1135 - -- [Daniel Stenberg brought this change] - - mime: unified to use the typedef'd mime structs everywhere - - ... and slightly edited to follow our code style better. - -- [Daniel Stenberg brought this change] - - curl.h: use lower case curl_mime* as for all public symbols - -- [Daniel Stenberg brought this change] - - docs/curl_mime_*.3: use correct variable types in examples - -Kamil Dudka (5 Sep 2017) -- openssl: use OpenSSL's default ciphers by default - - Up2date versions of OpenSSL maintain the default reasonably secure - without breaking compatibility, so it is better not to override the - default by curl. Suggested at https://bugzilla.redhat.com/1483972 - - Closes #1846 - -Viktor Szakats (5 Sep 2017) -- examples/mime: minor example code fixes - -Daniel Stenberg (5 Sep 2017) -- docs/curl_mime_*.3: added examples - -- configure: add MultiSSL to FEATURES when enabled - - ...for curl-config and its corresponding test 1014 - -- http-proxy: treat all 2xx as CONNECT success - - Added test 1904 to verify. - - Reported-by: Lawrence Wagerfield - Fixes #1859 - Closes #1860 - -- MAIL-ETIQUETTE: added "1.9 Your emails are public" - -- curl.h: fix "unused checksrc ignore", remove dangling reference - - ... to a README file that doesn't exist anymore - -Viktor Szakats (4 Sep 2017) -- docs: Update to secure URL versions - -- mime: use CURL_ZERO_TERMINATED in examples - - and some minor whitespace fixes - -Daniel Stenberg (4 Sep 2017) -- schannel: return CURLE_SSL_CACERT on failed verification - - ... not *CACERT_BADFILE as it isn't really because of a bad file. - - Bug: https://curl.haxx.se/mail/lib-2017-09/0002.html - Closes #1858 - -- test1135: fixed after bd8070085f9 - -- examples/post-callback: stop returning one byte at a time - - ... since people copy and paste code from this example and thus they get - an inefficient POST operation without a good reason and sometimes - without understanding why. - - Instead this now returns as much data as possible. - -- RELEASE-NOTES: fixed the function counter script - -- curl.h: make the curl_strequal() protos use the same style - - ... as the other functions. Makes it easier to machine-parse! - -- docs: curl_mime_*.3 man page formatting edits - -- RELEASE-NOTES: synced with 1ab9e9b50 - -Patrick Monnerat (4 Sep 2017) -- lib: bump version info (soname). Adapt and reenable test 1135. - -Daniel Stenberg (3 Sep 2017) -- headers: move the global_sslset() proto from multi.h to curl.h - - As it was added to multi.h simply to not break test 1135, which now has - been disabled due to the mime API addition anyway and su we can now move - the sslset stuff to where the other curl_global_* prototypes are. - -Patrick Monnerat (3 Sep 2017) -- mime: fix signed/unsigned conversions. - - Use and generate CURL_ZERO_TERMINATED in curl tool and tests. - -Jay Satiro (3 Sep 2017) -- tool_formparse: fix some trivial warnings - -Patrick Monnerat (3 Sep 2017) -- mime: use size_t instead of ssize_t in public API interface. - - To support telling a string is nul-terminated, symbol CURL_ZERO_TERMINATED - has been introduced. - - Documentation updated accordingly. - - symbols in versions updated. Added form API symbols deprecation info. - -- mime: remove support "-" stdin pseudo-file name in curl_mime_filedata(). - - This feature is badly supported in Windows: as a replacement, a caller has - to use curl_mime_data_cb() with fread, fseek and possibly fclose - callbacks to process opened files. - - The cli tool and documentation are updated accordingly. - - The feature is however kept internally for form API compatibility, with - the known caveats it always had. - - As a side effect, stdin size is not determined by the cli tool even if - possible and this results in a chunked transfer encoding. Test 173 is - updated accordingly. - -- mime: fix some implicit curl_off_t --> size_t conversion warnings. - -- mime: tests and examples. - - Additional mime-specific tests. - Existing tests updated to reflect small differences (Expect: 100-continue, - data size change due to empty lines, etc). - Option -F headers= keyword added to tests. - test1135 disabled until the entry point order change is resolved. - New example smtp-mime. - Examples postit2 and multi-post converted from form API to mime API. - -- mime: use in curl cli tool instead of form API. - - Extended -F option syntax to support multipart mail messages. - -F keyword headers= added to include custom headers in parts. - Documentation upgraded. - -- mime: new MIME API. - - Available in HTTP, SMTP and IMAP. - Deprecates the FORM API. - See CURLOPT_MIMEPOST. - Lib code and associated documentation. - -- test564: Add a warning comment about shell profile output. - - Shell profile output makes the SSH server failing and this problem reason - is not easy to find when no hint is given. - -- checksrc: disable SPACEBEFOREPAREN for case statement. - - The case keyword may be followed by a constant expression and thus should - allow it to start with an open parenthesis. - -- runtests.pl: allow tags in client section. - - This enables tests to create more than one file on the client side. - -- runtests.pl: Apply strippart to upload too. - - This will allow substitution of boundaries in mail messages. - -- Curl_base64_encode: always call with a real data handle. - - Some calls in different modules were setting the data handle to NULL, causing - segmentation faults when using builds that enable character code conversions. - -- non-ascii: allow conversion functions to be called with a NULL data handle. - -- http: fix a memory leakage in checkrtspprefix(). - -Daniel Stenberg (2 Sep 2017) -- [Max Dymond brought this change] - - ossfuzz: Move to C++ for curl_fuzzer. - - Automake gets confused if you want to use C++ static libraries with C - code - basically we need to involve the clang++ linker. The easiest way - of achieving this is to rename the C code as C++ code. This gets us a - bit further along the path and ought to be compatible with Google's - version of clang. - -- curl_global_sslset: select backend by name case insensitively - - Closes #1849 - -- [Max Dymond brought this change] - - ossfuzz: additional seed corpora - - Create simple seed corpora for: - - FTP - - telnet - - dict - - tftp - - imap - - pop3 - - based off the tests of the same number. - - Closes #1842 - -- [Max Dymond brought this change] - - ossfuzz: moving towards the ideal integration - - - Start with the basic code from the ossfuzz project. - - Rewrite fuzz corpora to be binary files full of Type-Length-Value - data, and write a glue layer in the fuzzing function to convert - corpora into CURL options. - - Have supporting functions to generate corpora from existing tests - - Integrate with Makefile.am - -- strcase: corrected comment header for Curl_strcasecompare() - -- unit1301: fix error message on first test - -- curl_global_sslset.3: show the struct and enum too - - ... so that users can actually write code based on the man page alone, - not having to read the header file. - -Jay Satiro (31 Aug 2017) -- darwinssl: handle long strings in TLS certs (follow-up) - - - Fix handling certificate subjects that are already UTF-8 encoded. - - Follow-up to b3b75d1 from two days ago. Since then a copy would be - skipped if the subject was already UTF-8, possibly resulting in a NULL - deref later on. - - Ref: https://github.com/curl/curl/issues/1823 - Ref: https://github.com/curl/curl/pull/1831 - - Closes https://github.com/curl/curl/pull/1836 - -Daniel Stenberg (31 Aug 2017) -- cyassl: call it the "WolfSSL" backend - - ... instead of cyassl, as this is the current name for it. - - Closes #1844 - -- polarssl: fix multissl breakage - - Reported-by: Dan Fandrich - Bug: https://curl.haxx.se/mail/lib-2017-08/0121.html - Closes #1843 - -- configure: remove the leading comma from the backends list - - ... when darwinssl is used. - - Reported-by: Viktor Szakats - Bug: https://github.com/curl/curl/commit/b0989cd3abaff4f9a0717b4875022fa79e33b481#commitcomment-23943493 - - Closes #1845 - -Kamil Dudka (30 Aug 2017) -- examples/sslbackend.c: fix failure of 'make checksrc' - - ./sslbackend.c:58:3: warning: else after closing brace on same line (BRACEELSE) - } else if(isdigit(*name)) { - ^ - ./sslbackend.c:62:3: warning: else after closing brace on same line (BRACEELSE) - } else - ^ - -Viktor Szakats (30 Aug 2017) -- makefile.m32: add multissl support - - Closes https://github.com/curl/curl/pull/1840 - -Daniel Stenberg (30 Aug 2017) -- curl.h: CURLSSLBACKEND_WOLFSSL used wrong value - - The CURLSSLBACKEND_WOLFSSL is supposed to be an alias for - CURLSSLBACKEND_CYASSL, but used an erronous value. To reduce the risk - for a similar mistake, define the backend aliases to use the enum values - instead. - - Reported-by: Gisle Vanem - Bug: https://curl.haxx.se/mail/lib-2017-08/0120.html - -- curl_global_sslset.3: clarify - - it is a one time *set*, not necessarily a one time use... it can be - called again if the first call failed or just listed the alternatives. - - clarify that the available backends are the ones this build supports - - plus add some formatting - - Reported-by: Rich Gray - Bug: https://curl.haxx.se/mail/lib-2017-08/0119.html - -- curl/multi.h: remove duplicated closing c++ brace - - Regression since 1328f69d53f2f2e93 - - Fixes #1841 - Reported-by: Andrei Karas - -- RELEASE-NOTES: synced with 8c33c963a - -- HELP-US.md: spelling - -- HELP-US.md: "How to get started helping out in the curl project" - - Closes #1837 - -Dan Fandrich (29 Aug 2017) -- asyn-thread: Fixed cleanup after OOM - - destroy_async_data() assumes that if the flag "done" is not set yet, the - thread itself will clean up once the request is complete. But if an - error (generally OOM) occurs before the thread even has a chance to - start, it will never get a chance to clean up and memory will be leaked. - By clearing "done" only just before starting the thread, the correct - cleanup sequence will happen in all cases. - -Daniel Stenberg (28 Aug 2017) -- curl_global_init.3: mention curl_global_sslset(3) - -Dan Fandrich (28 Aug 2017) -- unit1606: Fixed shadowed variable warning - -- asyn-thread: Improved cleanup after OOM situations - -- asyn-thread: Set errno to the proper value ENOMEM in OOM situation - - This used to be set in some configurations to EAI_MEMORY which is not a - valid value for errno and caused Curl_strerror to fail an assertion. - -Daniel Stenberg (28 Aug 2017) -- [Johannes Schindelin brought this change] - - configure: Handle "MultiSSL" specially When versioning symbols - - There is a mode in which libcurl is compiled with versioned symbols, - depending on the active SSL backend. - - When multiple SSL backends are active, it does not make sense to favor - one over the others, so let's not: introduce a new prefix for the case - where multiple SSL backends are compiled into cURL. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - configure: allow setting the default SSL backend - - Previously, we used as default SSL backend whatever was first in the - `available_backends` array. - - However, some users may want to override that default without patching - the source code. - - Now they can: with the --with-default-ssl-backend= option of - the ./configure script. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: use Curl_ssl_multi pseudo backend only when needed - - When only one SSL backend is configured, it is totally unnecessary to - let multissl_init() configure the backend at runtime, we can select the - correct backend at build time already. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - version: if built with more than one SSL backend, report all of them - - To discern the active one from the inactive ones, put the latter into - parentheses. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - version: add the CURL_VERSION_MULTI_SSL feature flag - - This new feature flag reports When cURL was built with multiple SSL - backends. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - metalink: allow compiling with multiple SSL backends - - Previously, the code assumed that at most one of the SSL backends would - be compiled in, emulating OpenSSL's functions if the configured backend - was not OpenSSL itself. - - However, now we allow building with multiple SSL backends and choosing - one at runtime. Therefore, metalink needs to be adjusted to handle this - scenario, too. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - docs/examples: demonstrate how to select SSL backends - - The newly-introduced curl_global_sslset() function deserves to be - show-cased. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - Add a man page for curl_global_sslset() - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: introduce curl_global_sslset() - - Let's add a compile time safe API to select an SSL backend. This - function needs to be called *before* curl_global_init(), and can be - called only once. - - Side note: we do not explicitly test that it is called before - curl_global_init(), but we do verify that it is not called multiple times - (even implicitly). - - If SSL is used before the function was called, it will use whatever the - CURL_SSL_BACKEND environment variable says (or default to the first - available SSL backend), and if a subsequent call to - curl_global_sslset() disagrees with the previous choice, it will fail - with CURLSSLSET_TOO_LATE. - - The function also accepts an "avail" parameter to point to a (read-only) - NULL-terminated list of available backends. This comes in real handy if - an application wants to let the user choose between whatever SSL backends - the currently available libcurl has to offer: simply call - - curl_global_sslset(-1, NULL, &avail); - - which will return CURLSSLSET_UNKNOWN_BACKEND and populate the avail - variable to point to the relevant information to present to the user. - - Just like with the HTTP/2 push functions, we have to add the function - declaration of curl_global_sslset() function to the header file - *multi.h* because VMS and OS/400 require a stable order of functions - declared in include/curl/*.h (where the header files are sorted - alphabetically). This looks a bit funny, but it cannot be helped. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: refactor out essential information about the SSL backends - - There is information about the compiled-in SSL backends that is really - no concern of any code other than the SSL backend itself, such as which - function (if any) implements SHA-256 summing. - - And there is information that is really interesting to the user, such as - the name, or the curl_sslbackend value. - - Let's factor out the latter into a publicly visible struct. This - information will be used in the upcoming API to set the SSL backend - globally. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: allow selecting which SSL backend to use at runtime - - When building software for the masses, it is sometimes not possible to - decide for all users which SSL backend is appropriate. - - Git for Windows, for example, uses cURL to perform clones, fetches and - pushes via HTTPS, and some users strongly prefer OpenSSL, while other - users really need to use Secure Channel because it offers - enterprise-ready tools to manage credentials via Windows' Credential - Store. - - The current Git for Windows versions use the ugly work-around of - building libcurl once with OpenSSL support and once with Secure Channel - support, and switching out the binaries in the installer depending on - the user's choice. - - Needless to say, this is a super ugly workaround that actually only - works in some cases: Git for Windows also comes in a portable form, and - in a form intended for third-party applications requiring Git - functionality, in which cases this "swap out libcurl-4.dll" simply is - not an option. - - Therefore, the Git for Windows project has a vested interest in teaching - cURL to make the SSL backend a *runtime* option. - - This patch makes that possible. - - By running ./configure with multiple --with- options, cURL will - be built with multiple backends. - - For the moment, the backend can be configured using the environment - variable CURL_SSL_BACKEND (valid values are e.g. "openssl" and - "schannel"). - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: fold the backend ID into the Curl_ssl structure - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - curl_ntlm_core: don't complain but #include OpenSSL header if needed - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: encapsulate SSL backend-specific data - - So far, all of the SSL backends' private data has been declared as - part of the ssl_connect_data struct, in one big #if .. #elif .. #endif - block. - - This can only work as long as the SSL backend is a compile-time option, - something we want to change in the next commits. - - Therefore, let's encapsulate the exact data needed by each SSL backend - into a private struct, and let's avoid bleeding any SSL backend-specific - information into urldata.h. This is also necessary to allow multiple SSL - backends to be compiled in at the same time, as e.g. OpenSSL's and - CyaSSL's headers cannot be included in the same .c file. - - To avoid too many malloc() calls, we simply append the private structs - to the connectdata struct in allocate_conn(). - - This requires us to take extra care of alignment issues: struct fields - often need to be aligned on certain boundaries e.g. 32-bit values need to - be stored at addresses that divide evenly by 4 (= 32 bit / 8 - bit-per-byte). - - We do that by assuming that no SSL backend's private data contains any - fields that need to be aligned on boundaries larger than `long long` - (typically 64-bit) would need. Under this assumption, we simply add a - dummy field of type `long long` to the `struct connectdata` struct. This - field will never be accessed but acts as a placeholder for the four - instances of ssl_backend_data instead. the size of each ssl_backend_data - struct is stored in the SSL backend-specific metadata, to allow - allocate_conn() to know how much extra space to allocate, and how to - initialize the ssl[sockindex]->backend and proxy_ssl[sockindex]->backend - pointers. - - This would appear to be a little complicated at first, but is really - necessary to encapsulate the private data of each SSL backend correctly. - And we need to encapsulate thusly if we ever want to allow selecting - CyaSSL and OpenSSL at runtime, as their headers cannot be included within - the same .c file (there are just too many conflicting definitions and - declarations for that). - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: prepare the SSL backends for encapsulated private data - - At the moment, cURL's SSL backend needs to be configured at build time. - As such, it is totally okay for them to hard-code their backend-specific - data in the ssl_connect_data struct. - - In preparation for making the SSL backend a runtime option, let's make - the access of said private data a bit more abstract so that it can be - adjusted later in an easy manner. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - urldata.h: move SSPI-specific #include to correct location - - In 86b889485 (sasl_gssapi: Added GSS-API based Kerberos V5 variables, - 2014-12-03), an SSPI-specific field was added to the kerberos5data - struct without moving the #include "curl_sspi.h" later in the same file. - - This broke the build when SSPI was enabled, unless Secure Channel was - used as SSL backend, because it just so happens that Secure Channel also - requires "curl_sspi.h" to be #included. - - In f4739f639 (urldata: include curl_sspi.h when Windows SSPI is enabled, - 2017-02-21), this bug was fixed incorrectly: Instead of moving the - appropriate conditional #include, the Secure Channel-conditional part - was now also SSPI-conditional. - - Fix this problem by moving the correct #include instead. - - This is also required for an upcoming patch that moves all the Secure - Channel-specific stuff out of urldata.h and encapsulates it properly in - vtls/schannel.c instead. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - urldata.h: remove support for obsolete PolarSSL version - - Since 5017d5ada (polarssl: now require 1.3.0+, 2014-03-17), we require - a newer PolarSSL version. No need to keep code trying to support any - older version. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - getinfo: access SSL internals via Curl_ssl - - In the ongoing endeavor to abstract out all SSL backend-specific - functionality, this is the next step: Instead of hard-coding how the - different SSL backends access their internal data in getinfo.c, let's - implement backend-specific functions to do that task. - - This will also allow for switching SSL backends as a runtime option. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: move SSL backends' private constants out of their header files - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - axtls: use Curl_none_* versions of init() and cleanup() - - There are convenient no-op versions of the init/cleanup functions now, - no need to define private ones for axTLS. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: remove obsolete declarations of SSL backend functionality - - These functions are all available via the Curl_ssl struct now, no need - to declare them separately anymore. - - As the global declarations are removed, the corresponding function - definitions are marked as file-local. The only two exceptions here are - Curl_mbedtls_shutdown() and Curl_polarssl_shutdown(): only the - declarations were removed, there are no function definitions to mark - file-local. - - Please note that Curl_nss_force_init() is *still* declared globally, as - the only SSL backend-specific function, because it was introduced - specifically for the use case where cURL was compiled with - `--without-ssl --with-nss`. For details, see f3b77e561 (http_ntlm: add - support for NSS, 2010-06-27). - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - schannel: reorder functions topologically - - The _shutdown() function calls the _session_free() function; While this - is not a problem now (because schannel.h declares both functions), a - patch looming in the immediate future with make all of these functions - file-local. - - So let's just move the _session_free() function's definition before it - is called. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - axtls: reorder functions topologically - - The connect_finish() function (like many other functions after it) calls - the Curl_axtls_close() function; While this is not a problem now - (because axtls.h declares the latter function), a patch looming in the - immediate future with make all of these functions file-local. - - So let's just move the Curl_axtls_close() function's definition before - it is called. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: move the SUPPORT_HTTPS_PROXY flag into the Curl_ssl struct - - That will allow us to choose the SSL backend at runtime. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: convert the have_curlssl_* constants to runtime flags - - The entire idea of introducing the Curl_ssl struct to describe SSL - backends is to prepare for choosing the SSL backend at runtime. - - To that end, convert all the #ifdef have_curlssl_* style conditionals - to use bit flags instead. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: move sha256sum into the Curl_ssl struct - - The SHA-256 checksumming is also an SSL backend-specific function. - Let's include it in the struct declaring the functionality of SSL - backends. - - In contrast to MD5, there is no fall-back code. To indicate this, the - respective entries are NULL for those backends that offer no support for - SHA-256 checksumming. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: move md5sum into the Curl_ssl struct - - The MD5 summing is also an SSL backend-specific function. So let's - include it, offering the previous fall-back code as a separate function - now: Curl_none_md5sum(). To allow for that, the signature had to be - changed so that an error could be returned from the implementation - (Curl_none_md5sum() can run out of memory). - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: use the Curl_ssl struct to access all SSL backends' functionality - - This is the first step to unify the SSL backend handling. Now all the - SSL backend-specific functionality is accessed via a global instance of - the Curl_ssl struct. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: declare Curl_ssl structs for every SSL backend - - The idea of introducing the Curl_ssl struct was to unify how the SSL - backends are declared and called. To this end, we now provide an - instance of the Curl_ssl struct for each and every SSL backend. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: introduce a new struct for SSL backends - - This new struct is similar in nature to Curl_handler: it will define the - functions and capabilities of all the SSL backends (where Curl_handler - defines the functions and capabilities of protocol handlers). - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: make sure every _sha256sum()'s first arg is const - - This patch makes the signature of the _sha256sum() functions consistent - among the SSL backends, in preparation for unifying the way all SSL - backends are accessed. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: make sure all _data_pending() functions return bool - - This patch makes the signature of the _data_pending() functions - consistent among the SSL backends, in preparation for unifying the way - all SSL backends are accessed. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: make sure all _cleanup() functions return void - - This patch makes the signature of the _cleanup() functions consistent - among the SSL backends, in preparation for unifying the way all SSL - backends are accessed. - - Signed-off-by: Johannes Schindelin - -- [Johannes Schindelin brought this change] - - vtls: use consistent signature for _random() implementations - - This will make the upcoming multissl backend much easier to implement. - - Signed-off-by: Johannes Schindelin - -- strtooff: fix build for systems with long long but no strtoll option - - Closes #1829 - - Reported-by: Dan Fandrich - Bug: https://github.com/curl/curl/pull/1758#issuecomment-324861615 - -- darwinssl: handle long strings in TLS certs - - ... as the previous fixed length 128 bytes buffer was sometimes too - small. - - Fixes #1823 - Closes #1831 - - Reported-by: Benjamin Sergeant - Assisted-by: Bill Pyne, Ray Satiro, Nick Zitzmann - -- system.h: include sys/poll.h for AIX - - ... to get the event/revent defines that might be used for the poll - struct. - - Reported-by: Michael Smith - Fixes #1828 - Closes #1833 - -Dan Fandrich (26 Aug 2017) -- tests: Make sure libtests & unittests call curl_global_cleanup() - - These were missed in commit c468c27b. - -Jay Satiro (26 Aug 2017) -- [theantigod brought this change] - - winbuild: fix embedded manifest option - - Embedded manifest option didn't work due to incorrect path. - - Fixes https://github.com/curl/curl/issues/1832 - -Daniel Stenberg (25 Aug 2017) -- fuzz/Makefile.am: remove curlbuild.h leftovers - -- examples/threaded-ssl: mention that this is for openssl before 1.1 - -- imap: use defined names for response codes - - When working on this code I found the previous setup a bit weird while - using proper defines increases readability. - - Closes #1824 - -- CURLOPT_USERPWD.3: see also CURLOPT_PROXYUSERPWD - -- imap: support PREAUTH - - It is a defined possible greeting at server startup that means the - connection is already authenticated. See - https://tools.ietf.org/html/rfc3501#section-7.1.4 - - Test 846 added to verify. - - Fixes #1818 - Closes #1820 - -Jay Satiro (23 Aug 2017) -- config-tpf: define SIZEOF_LONG - - Recent changes that replaced CURL_SIZEOF_LONG in the source with - SIZEOF_LONG broke builds that use the premade configuration files and - don't have SIZEOF_LONG defined. - - Bug: https://github.com/curl/curl/issues/1816 - -Dan Fandrich (23 Aug 2017) -- test1453: Fixed - -Daniel Stenberg (22 Aug 2017) -- [Gisle Vanem brought this change] - - config-dos: add missing defines, SIZEOF_* and two others - - Bug: #1816 - -- curl: shorten and clean up CA cert verification error message - - The previous message was just too long for ordinary people and it was - encouraging users to use `--insecure` a little too easy. - - Based-on-work-by: Frank Denis - - Closes #1810 - Closes #1817 - -- request-target.d: mention added in 7.55.0 - -Marcel Raad (22 Aug 2017) -- tool_main: turn off MinGW CRT's globbing - - By default, the MinGW CRT globs command-line arguments. This prevents - getting a single asterisk into an argument as test 1299 does. Turn off - globbing by setting the global variable _CRT_glob to 0 for MinGW. - - Fixes https://github.com/curl/curl/issues/1751 - Closes https://github.com/curl/curl/pull/1813 - -Viktor Szakats (22 Aug 2017) -- makefile.m32: add support for libidn2 - - libidn was replaced with libidn2 last year in configure. - Caveat: libidn2 may depend on a list of further libs. - These can be manually specified via CURL_LDFLAG_EXTRAS. - - Closes https://github.com/curl/curl/pull/1815 - -Jay Satiro (22 Aug 2017) -- [Viktor Szakats brought this change] - - config-win32: define SIZEOF_LONG - - Recent changes that replaced CURL_SIZEOF_LONG in the source with - SIZEOF_LONG broke builds that use the premade configuration files and - don't have SIZEOF_LONG defined. - - Closes https://github.com/curl/curl/pull/1814 - -Daniel Stenberg (20 Aug 2017) -- cmake: enable picky compiler options with clang and gcc - - closes #1799 - -- curl/system.h: fix build for hppa - - Reported-by: John David Anglin - Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=872502#10 - -- [Even Rouault brought this change] - - tftp: fix memory leak on too long filename - - Fixes - - $ valgrind --leak-check=full ~/install-curl-git/bin/curl tftp://localhost/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz - - ==9752== Memcheck, a memory error detector - ==9752== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. - ==9752== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info - ==9752== Command: /home/even/install-curl-git/bin/curl tftp://localhost/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz - ==9752== - curl: (71) TFTP file name too long - - ==9752== - ==9752== HEAP SUMMARY: - ==9752== 505 bytes in 1 blocks are definitely lost in loss record 11 of 11 - ==9752== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) - ==9752== by 0x4E61CED: Curl_urldecode (in /home/even/install-curl-git/lib/libcurl.so.4.4.0) - ==9752== by 0x4E75868: tftp_state_machine (in /home/even/install-curl-git/lib/libcurl.so.4.4.0) - ==9752== by 0x4E761B6: tftp_do (in /home/even/install-curl-git/lib/libcurl.so.4.4.0) - ==9752== by 0x4E711B6: multi_runsingle (in /home/even/install-curl-git/lib/libcurl.so.4.4.0) - ==9752== by 0x4E71D00: curl_multi_perform (in /home/even/install-curl-git/lib/libcurl.so.4.4.0) - ==9752== by 0x4E6950D: curl_easy_perform (in /home/even/install-curl-git/lib/libcurl.so.4.4.0) - ==9752== by 0x40E0B7: operate_do (in /home/even/install-curl-git/bin/curl) - ==9752== by 0x40E849: operate (in /home/even/install-curl-git/bin/curl) - ==9752== by 0x402693: main (in /home/even/install-curl-git/bin/curl) - - Fixes https://oss-fuzz.com/v2/testcase-detail/5232311106797568 - Credit to OSS Fuzz - - Closes #1808 - -Dan Fandrich (19 Aug 2017) -- runtests: fixed case insensitive matching of keywords - - Commit 5c2aac71 didn't work in the case of mixed-case keywords given on - the command-line. - -- tests: Make sure libtests call curl_global_cleanup() - - This ensures that global data allocations are freed so Valgrind stays - happy. This was a problem with at least PolarSSL and mbedTLS. - -Daniel Stenberg (18 Aug 2017) -- RELEASE-NOTES: synced with 8baead425 - -- scripts/contri*sh: use "git log --use-mailmap" - -- mailmap: de-duplify some git authors - -- http2_recv: return error better on fatal h2 errors - - Ref #1012 - Figured-out-by: Tatsuhiro Tsujikawa - -- KNOWN_BUGS: HTTP test server 'connection-monitor' problems - - Closes #868 - -- curl/system.h: check for __ppc__ as well - - ... regression since issue #1774 (commit 10b3df10596a) since obviously - some older gcc doesn't know __powerpc__ while some newer doesn't know - __ppc__ ... - - Fixes #1797 - Closes #1798 - Reported-by: Ryan Schmidt - -- [Jan Alexander Steffens (heftig) brought this change] - - http: Don't wait on CONNECT when there is no proxy - - Since curl 7.55.0, NetworkManager almost always failed its connectivity - check by timeout. I bisected this to 5113ad04 (http-proxy: do the HTTP - CONNECT process entirely non-blocking). - - This patch replaces !Curl_connect_complete with Curl_connect_ongoing, - which returns false if the CONNECT state was left uninitialized and lets - the connection continue. - - Closes #1803 - Fixes #1804 - - Also-fixed-by: Gergely Nagy - -- [Johannes Schindelin brought this change] - - metalink: adjust source code style - - Signed-off-by: Johannes Schindelin - -- CURL_SIZEOF_LONG: removed, use only SIZEOF_LONG - -- lib557: no longer use CURL_SIZEOF_* defines - -- config-win32: define SIZEOF_CURL_OFF_T - -- cmake: sizeof curl_off_t, remove unused detections - -- system.h: remove all CURL_SIZEOF_* defines - - ... as they're not used externally and internally we check for the sizes - already in configure etc. - - Closes #1767 - -- ftp: fix CWD when doing multicwd then nocwd on same connection - - Fixes #1782 - Closes #1787 - Reported-by: Peter Lamare - -- CURLOPT_SSH_COMPRESSION.3: enable with 1L - - (leaves other values reserved for the future) - -- compressed-ssh.d: "Added: 7.56.0" - -- curl/system.h: checksrc compliance - -Jay Satiro (17 Aug 2017) -- [Viktor Szakats brought this change] - - ssh: add the ability to enable compression (for SCP/SFTP) - - The required low-level logic was already available as part of - `libssh2` (via `LIBSSH2_FLAG_COMPRESS` `libssh2_session_flag()`[1] - option.) - - This patch adds the new `libcurl` option `CURLOPT_SSH_COMPRESSION` - (boolean) and the new `curl` command-line option `--compressed-ssh` - to request this `libssh2` feature. To have compression enabled, it - is required that the SSH server supports a (zlib) compatible - compression method and that `libssh2` was built with `zlib` support - enabled. - - [1] https://www.libssh2.org/libssh2_session_flag.html - - Ref: https://github.com/curl/curl/issues/1732 - Closes https://github.com/curl/curl/pull/1735 - -- examples/ftpuploadresume: checksrc compliance - -- [Maksim Stsepanenka brought this change] - - http_proxy: fix build error for CURL_DOES_CONVERSIONS - - Closes https://github.com/curl/curl/pull/1793 - -GitHub (16 Aug 2017) -- [Nick Zitzmann brought this change] - - configure: check for __builtin_available() availability (#1788) - - This change does two things: - 1. It un-breaks the build in Xcode 9.0. (Xcode 9.0 is currently - failing trying to compile connectx() in lib/connect.c.) - 2. It finally weak-links the connectx() function, and falls back on - connect() when run on older operating systems. - -Daniel Stenberg (16 Aug 2017) -- travis: add metalink to some osx builds - - Closes #1790 - -- [Max Dymond brought this change] - - coverage: Use two coveralls commands to get lib/vtls results - - closes #1747 - -- darwinssi: fix error: variable length array used - -- m4/curl-compilers.m4: use proper quotes around string, not backticks - - ... when setting clang version to assume 3.7 - - Caused a lot of "integer expression expected" warnings by configure. - -- [Benbuck Nason brought this change] - - cmake: remove dead code for DISABLED_THREADSAFE - - Closes #1786 - -Jay Satiro (15 Aug 2017) -- [Jakub Zakrzewski brought this change] - - curl-confopts.m4: fix --disable-threaded-resolver - - Closes https://github.com/curl/curl/issues/1784 - -Daniel Stenberg (15 Aug 2017) -- [Ryan Winograd brought this change] - - progress: Track total times following redirects - - Update the progress timers `t_nslookup`, `t_connect`, `t_appconnect`, - `t_pretransfer`, and `t_starttransfer` to track the total times for - these activities when a redirect is followed. Previously, only the times - for the most recent request would be tracked. - - Related changes: - - - Rename `Curl_pgrsResetTimesSizes` to `Curl_pgrsResetTransferSizes` - now that the function only resets transfer sizes and no longer - modifies any of the progress timers. - - - Add a bool to the `Progress` struct that is used to prevent - double-counting `t_starttransfer` times. - - Added test case 1399. - - Fixes #522 and Known Bug 1.8 - Closes #1602 - Reported-by: joshhe on github - -- [Benbuck Nason brought this change] - - cmake: remove dead code for CURL_DISABLE_RTMP - - Closes #1785 - -Kamil Dudka (15 Aug 2017) -- zsh.pl: produce a working completion script again - - Commit curl-7_54_0-118-g8b2f22e changed the output format of curl --help - to use and instead of FILE and DIR, which caused zsh.pl to - produce a broken completion script: - - % curl -- - _curl:10: no such file or directory: seconds - - Closes #1779 - -Daniel Stenberg (15 Aug 2017) -- curlver: toward 7.56.0? - -- RELEASE-NOTES: synced with 91c46dc44 - -- test1449: FTP download range with an too large size - -- strtoofft: reduce integer overflow risks globally - - ... make sure we bail out on overflows. - - Reported-by: Brian Carpenter - Closes #1758 - -- travis: build the examples too - - to make sure they keep building warning-free - - Closes #1777 - -- runtests: match keywords case insensitively - -- examples/ftpuploadresume.c: use portable code - - ... converted from the MS specific _snscanf() - -Version 7.55.1 (13 Aug 2017) - -Daniel Stenberg (13 Aug 2017) -- RELEASE-NOTES/THANKS: curl 7.55.1 release time - -- gitignore: ignore .xz now instead of .lzma - -- [Sergei Nikulov brought this change] - - cmake: Threads detection update. ref: #1702 - - Closes #1719 - -- ipv6_scope: support unique local addresses - - Fixes #1764 - Closes #1773 - Reported-by: James Slaughter - -- [Alex Potapenko brought this change] - - curl/system.h: GCC doesn't define __ppc__ on PowerPC, uses __powerpc__ - - Closes #1774 - -- test1448: verify redirect to IDN using URL - - Closes #1772 - -- [Salah-Eddin Shaban brought this change] - - redirect: skip URL encoding for host names - - This fixes redirects to IDN URLs - - Fixes #1441 - Closes #1762 - Reported by: David Lord - -- test2032: mark as flaky (again) - -- travis: test cmake build on tarball too - - Could've prevented #1755 - -- [Simon Warta brought this change] - - cmake: allow user to override CMAKE_DEBUG_POSTFIX - - Closes #1763 - -- connect-to.d: better language - -- connect-to.d: clarified - -- bagder/Curl_tvdiff_us: fix the math - - Regression since adef394ac5 (released in 7.55.0) - - Reported-by: Han Qiao - Fixes #1769 - Closes #1771 - -- curl/system.h: add Oracle Solaris Studio - - Fixes #1752 - -- [Alessandro Ghedini brought this change] - - docs: fix typo funtion -> function - - Closes #1770 - -Alessandro Ghedini (12 Aug 2017) -- docs: fix grammar in CURL_SSLVERSION_MAX_DEFAULT description - -- docs: fix typo stuct -> struct - -Dan Fandrich (12 Aug 2017) -- test1447: require a curl with http support - -Daniel Stenberg (11 Aug 2017) -- [Thomas Petazzoni brought this change] - - curl/system.h: support more architectures - - The long list of architectures in include/curl/system.h is annoying to - maintain, and needs to be extended for each and every architecture to - support. - - Instead, let's rely on the __SIZEOF_LONG__ define of the gcc compiler - (we are in the GNUC condition anyway), which tells us if long is 4 - bytes or 8 bytes. - - This fixes the build of libcurl 7.55.0 on architectures such as - OpenRISC or ARC. - - Closes #1766 - - Signed-off-by: Thomas Petazzoni - -- test2033: this went flaky again - - Suspicion: when we enabled the threaded resolver by default. - -- test1447: verifies the parse proxy fix in 6e0e152ce5c - -- [Even Rouault brought this change] - - parse_proxy(): fix memory leak in case of invalid proxy server name - - Fixes the below leak: - - $ valgrind --leak-check=full ~/install-curl-git/bin/curl --proxy "http://a:b@/x" http://127.0.0.1 - curl: (5) Couldn't resolve proxy name - ==5048== - ==5048== HEAP SUMMARY: - ==5048== in use at exit: 532 bytes in 12 blocks - ==5048== total heap usage: 5,288 allocs, 5,276 frees, 445,271 bytes allocated - ==5048== - ==5048== 2 bytes in 1 blocks are definitely lost in loss record 1 of 12 - ==5048== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) - ==5048== by 0x4E6CB79: parse_login_details (url.c:5614) - ==5048== by 0x4E6BA82: parse_proxy (url.c:5091) - ==5048== by 0x4E6C46D: create_conn_helper_init_proxy (url.c:5346) - ==5048== by 0x4E6EA18: create_conn (url.c:6498) - ==5048== by 0x4E6F9B4: Curl_connect (url.c:6967) - ==5048== by 0x4E86D05: multi_runsingle (multi.c:1436) - ==5048== by 0x4E88432: curl_multi_perform (multi.c:2160) - ==5048== by 0x4E7C515: easy_transfer (easy.c:708) - ==5048== by 0x4E7C74A: easy_perform (easy.c:794) - ==5048== by 0x4E7C7B1: curl_easy_perform (easy.c:813) - ==5048== by 0x414025: operate_do (tool_operate.c:1563) - ==5048== - ==5048== 2 bytes in 1 blocks are definitely lost in loss record 2 of 12 - ==5048== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) - ==5048== by 0x4E6CBB6: parse_login_details (url.c:5621) - ==5048== by 0x4E6BA82: parse_proxy (url.c:5091) - ==5048== by 0x4E6C46D: create_conn_helper_init_proxy (url.c:5346) - ==5048== by 0x4E6EA18: create_conn (url.c:6498) - ==5048== by 0x4E6F9B4: Curl_connect (url.c:6967) - ==5048== by 0x4E86D05: multi_runsingle (multi.c:1436) - ==5048== by 0x4E88432: curl_multi_perform (multi.c:2160) - ==5048== by 0x4E7C515: easy_transfer (easy.c:708) - ==5048== by 0x4E7C74A: easy_perform (easy.c:794) - ==5048== by 0x4E7C7B1: curl_easy_perform (easy.c:813) - ==5048== by 0x414025: operate_do (tool_operate.c:1563) - - Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2984 - Credit to OSS Fuzz for discovery - - Closes #1761 - -- RELEASE-NOTES: synced with 37f2195a9 - -- curlver: bump to 7.55.1 - -- openssl: fix "error: this statement may fall through" - - A gcc7 warning. - -- [David Benjamin brought this change] - - openssl: remove CONST_ASN1_BIT_STRING. - - Just making the pointer as const works for the pre-1.1.0 path too. - - Closes #1759 - -- maketgz: remove old *.dist files before making the tarball - - To avoid "old crap" unintentionally getting shipped. - - Bug: https://curl.haxx.se/mail/lib-2017-08/0050.html - Reported-by: Christian Weisgerber - -Jay Satiro (10 Aug 2017) -- mkhelp.pl: allow executing this script directly - - - Enable execute permission (chmod +x) - - - Change interpreter to /usr/bin/env perl - - Ref: https://github.com/curl/curl/issues/1743 - -Daniel Stenberg (10 Aug 2017) -- configure: use the threaded resolver backend by default if possible - - Closes #1647 - -- cmake: move cmake_uninstall.cmake to CMake/ - - Closes #1756 - -- metalink: fix error: ‘*’ in boolean context, suggest ‘&&’ instead - -- dist: fix the cmake build by shipping cmake_uninstall.cmake.in too - - Fixes #1755 - -- travis: verify "make install" - - Help-by: Jay Satiro - Closes #1753 - -Marcel Raad (10 Aug 2017) -- build: check out *.sln files with Windows line endings - - Visual Studio doesn't like LF line endings in solution files and always - converts them to CRLF when doing changes to the solution. Notably, this - affects the solutions in the release archive. - - Closes https://github.com/curl/curl/pull/1746 - -- gitignore: ignore top-level .vs folder - - This folder is generated when using the CMake build system from within - Visual Studio. - - Closes https://github.com/curl/curl/pull/1746 - -Jay Satiro (10 Aug 2017) -- digest_sspi: Don't reuse context if the user/passwd has changed - - Bug: https://github.com/curl/curl/issues/1685 - Reported-by: paulharris@users.noreply.github.com - - Assisted-by: Isaac Boukris - - Closes https://github.com/curl/curl/pull/1742 - -Daniel Stenberg (9 Aug 2017) -- [Adam Sampson brought this change] - - dist: Add dictserver.py/negtelnetserver.py to EXTRA_DIST - - These weren't included in the 7.55.0 release, but are required in order - to run the full test suite. - - Closes #1744 - -- [Adam Sampson brought this change] - - curl: do bounds check using a double comparison - - The fix for this in 8661a0aacc01492e0436275ff36a21734f2541bb wasn't - complete: if the parsed number in num is larger than will fit in a long, - the conversion is undefined behaviour (causing test1427 to fail for me - on IA32 with GCC 7.1, although it passes on AMD64 and ARMv7). Getting - rid of the cast means the comparison will be done using doubles. - - It might make more sense for the max argument to also be a double... - - Fixes #1750 - Closes #1749 - -- make install: add 8 missing man pages to the installation - -- build: fix 'make install' with configure, install docs/libcurl/* too - - Broken since d24838d4da9faa - - Reported-by: Bernard Spil - -Version 7.55.0 (9 Aug 2017) - -Daniel Stenberg (9 Aug 2017) -- RELEASE-NOTES: curl 7.55.0 - -- THANKS: 20 new contributors in 7.55.0 - -- [Viktor Szakats brought this change] - - docs/comments: Update to secure URL versions - - Closes #1741 - -- configure: fix recv/send/select detection on Android - - ... since they now provide several functions as - __attribute__((overloadable)), the argument detection logic need - updates. - - Patched-by: destman at github - - Fixes #1738 - Closes #1739 - -Marcel Raad (8 Aug 2017) -- ax_code_coverage.m4: update to latest version - - This updates the script to aad5ad5fedb306b39f901a899b7bd305b66c418d - from August 01, 2017. Notably, this removes the lconv version whitelist. - - Closes https://github.com/curl/curl/pull/1716 - -Daniel Stenberg (7 Aug 2017) -- test1427: verify command line parser integer overflow detection - -- curl: detect and bail out early on parameter integer overflows - - Make the number parser aware of the maximum limit curl accepts for a - value and return an error immediately if larger, instead of running an - integer overflow later. - - Fixes #1730 - Closes #1736 - -- glob: do not continue parsing after a strtoul() overflow range - - Added test 1289 to verify. - - CVE-2017-1000101 - - Bug: https://curl.haxx.se/docs/adv_20170809A.html - Reported-by: Brian Carpenter - -- tftp: reject file name lengths that don't fit - - ... and thereby avoid telling send() to send off more bytes than the - size of the buffer! - - CVE-2017-1000100 - - Bug: https://curl.haxx.se/docs/adv_20170809B.html - Reported-by: Even Rouault - - Credit to OSS-Fuzz for the discovery - -- [Even Rouault brought this change] - - file: output the correct buffer to the user - - Regression brought by 7c312f84ea930d8 (April 2017) - - CVE-2017-1000099 - - Bug: https://curl.haxx.se/docs/adv_20170809C.html - - Credit to OSS-Fuzz for the discovery - -- easy_events: make event data static - - First: this function is only used in debug-builds and not in - release/real builds. It is used to drive tests using the event-based - API. - - A pointer to the local struct is passed to CURLMOPT_TIMERDATA, but the - CURLMOPT_TIMERFUNCTION calback can in fact be called even after this - funtion returns, namely when curl_multi_remove_handle() is called. - - Reported-by: Brian Carpenter - -- getparameter: avoid returning uninitialized 'usedarg' - - Fixes #1728 - -Marcel Raad (5 Aug 2017) -- [Isaac Boukris brought this change] - - gssapi: fix memory leak of output token in multi round context - - When multiple rounds are needed to establish a security context - (usually ntlm), we overwrite old token with a new one without free. - Found by proposed gss tests using stub a gss implementation (by - valgrind error), though I have confirmed the leak with a real - gssapi implementation as well. - - Closes https://github.com/curl/curl/pull/1733 - -- darwinssl: fix compiler warning - - clang complains: - vtls/darwinssl.c:40:8: error: extra tokens at end of #endif directive - [-Werror,-Wextra-tokens] - - This breaks the darwinssl build on Travis. Fix it by making this token - a comment. - - Closes https://github.com/curl/curl/pull/1734 - -- CMake: fix CURL_WERROR for MSVC - - When using CURL_WERROR in MSVC builds, the debug flags were overridden - by the release flags and /WX got added twice in debug mode. - - Closes https://github.com/curl/curl/pull/1715 - -Daniel Stenberg (4 Aug 2017) -- RELEASE-NOTES: synced with 561e9217c - -- test1010: verify that #1718 is fixed - - ... by doing two transfers in nocwd mode and check that there's no - superfluous CWD command. - -- FTP: skip unnecessary CWD when in nocwd mode - - ... when reusing a connection. If it didn't do any CWD previously. - - Fixes #1718 - -Marcel Raad (4 Aug 2017) -- travis: explicitly specify dist - - This makes the builds more reproducible as travis is currently rolling - out trusty as default dist [1]. Specifically, this avoids coverage - check failures when trusty is used as seen in [2] until we figure out - what's wrong. - - [1] https://blog.travis-ci.com/2017-07-11-trusty-as-default-linux-is-coming - [2] https://github.com/curl/curl/pull/1692 - - Closes https://github.com/curl/curl/pull/1725 - -Daniel Stenberg (4 Aug 2017) -- travis: BUILD_TYPE => T - - (to make the full line appear nicer on travis web UI) - -- travis: add osx build with darwinssl - - Closes #1706 - -- darwin: silence compiler warnings - - With a clang pragma and three type fixes - - Fixes #1722 - -- BUILD.WINDOWS: mention buildconf.bat for builds off git - -- darwinssl: fix curlssl_sha256sum() compiler warnings on first argument - -- test130: verify comments in .netrc - -- [Gisle Vanem brought this change] - - netrc: skip lines starting with '#' - - Bug: https://curl.haxx.se/mail/lib-2017-08/0008.html - -Marcel Raad (3 Aug 2017) -- CMake: set MSVC warning level to 4 - - The MSVC warning level defaults to 3 in CMake. Change it to 4, which is - consistent with the Visual Studio and NMake builds. Disable level 4 - warning C4127 for the library and additionally C4306 for the test - servers to get a clean CURL_WERROR build as that warning is raised in - some macros in older Visual Studio versions. - - Ref: https://github.com/curl/curl/pull/1667#issuecomment-314082794 - Closes https://github.com/curl/curl/pull/1711 - -Daniel Stenberg (2 Aug 2017) -- CURLOPT_NETRC.3: fix typo in 7e48aa386156f9c2 - - Reported-by: Viktor Szakats - -- CURLOPT_NETRC.3: mention the file name on windows - - ... and CURLOPT_NETRC_FILE(3). - -- travis: build osx with libressl too - -- travis: build osx with openssl too - -- tests/server/util: fix curltime mistake from 4dee50b9c80f9 - -Marcel Raad (1 Aug 2017) -- curl_threads: fix MSVC compiler warning - - Use LongToHandle to convert from long to HANDLE in the Win32 - implementation. - This should fix the following warning when compiling with - MSVC 11 (2012) in 64-bit mode: - lib\curl_threads.c(113): warning C4306: - 'type cast' : conversion from 'long' to 'HANDLE' of greater size - - Closes https://github.com/curl/curl/pull/1717 - -Daniel Stenberg (1 Aug 2017) -- BUGS: improved phrasing about security bugs - - Reported-by: Max Dymond - -- BUGS: clarify how to report security related bugs - -- [Brad Spencer brought this change] - - multi: fix request timer management - - There are some bugs in how timers are managed for a single easy handle - that causes the wrong "next timeout" value to be reported to the - application when a new minimum needs to be recomputed and that new - minimum should be an existing timer that isn't currently set for the - easy handle. When the application drives a set of easy handles via the - `curl_multi_socket_action()` API (for example), it gets told to wait the - wrong amount of time before the next call, which causes requests to - linger for a long time (or, it is my guess, possibly forever). - - Bug: https://curl.haxx.se/mail/lib-2017-07/0033.html - -Jay Satiro (1 Aug 2017) -- curl_setup: Define CURL_NO_OLDIES for building libcurl - - .. to catch accidental use of deprecated error codes. - - Ref: https://github.com/curl/curl/issues/1688#issuecomment-316764237 - -Daniel Stenberg (1 Aug 2017) -- [Jeremy Tan brought this change] - - configure: fix the check for IdnToUnicode - - Fixes #1669 - Closes #1713 - -- http: fix response code parser to avoid integer overflow - - test 1429 and 1433 were updated to work with the stricter HTTP status line - parser. - - Closes #1714 - Reported-by: Brian Carpenter - -Jay Satiro (31 Jul 2017) -- [Dwarakanath Yadavalli brought this change] - - libcurl: Stop using error codes defined under CURL_NO_OLDIES - - Fixes https://github.com/curl/curl/issues/1688 - Closes https://github.com/curl/curl/pull/1712 - -- include.d: clarify --include is only for response headers - - Follow-up to 171f8de and de6de94. - - Bug: https://github.com/curl/curl/commit/de6de94#commitcomment-23370851 - Reported-by: Daniel Stenberg - -Daniel Stenberg (30 Jul 2017) -- [jasjuang brought this change] - - cmake: support make uninstall - - Closes #1674 - -- RELEASE-NOTES: synced with 001701c47 - -Marcel Raad (29 Jul 2017) -- AppVeyor: now really use CURL_WERROR - - It was misspelled as CURL_ERROR in commit - 2d86e8d1286e0fbe3d811e2e87fa0b5e53722db4. - - Closes https://github.com/curl/curl/pull/1686 - -Jay Satiro (29 Jul 2017) -- tool_help: clarify --include is only for response headers - - Follow-up to 171f8de. - - Ref: https://github.com/curl/curl/issues/1704 - -- splay: fix signed/unsigned mismatch warning - - Follow-up to 4dee50b. - - Ref: https://github.com/curl/curl/pull/1693 - -Daniel Stenberg (28 Jul 2017) -- include.d: clarify that it concerns the response headers - - Reported-by: olesteban at github - Fixes #1704 - -- [Johannes Schindelin brought this change] - - curl_rtmp: fix a compiler warning - - The headers of librtmp declare the socket as `int`, and on Windows, that - disagrees with curl_socket_t. - - Bug: #1652 - - Signed-off-by: Johannes Schindelin - -- test1323: verify curlx_tvdiff - -- timeval: struct curltime is a struct timeval replacement - - ... to make all libcurl internals able to use the same data types for - the struct members. The timeval struct differs subtly on several - platforms so it makes it cumbersome to use everywhere. - - Ref: #1652 - Closes #1693 - -- darwinssl: fix variable type mistake (regression) - - ... which made --tlsv1.2 not work because it would blank the max tls - version variable. - - Reported-by: Nick Miyake - Bug: #1703 - -- multi: mention integer overflow risk if using > 500 million sockets - - Reported-by: ovidiu-benea@users.noreply.github.com - - Closes #1675 - Closes #1683 - -- checksrc: escape open brace in regex - - ... to silence warning. - -Kamil Dudka (20 Jul 2017) -- nss: fix a possible use-after-free in SelectClientCert() - - ... causing a SIGSEGV in showit() in case the handle used to initiate - the connection has already been freed. - - This commit fixes a bug introduced in curl-7_19_5-204-g5f0cae803. - - Reported-by: Rob Sanders - Bug: https://bugzilla.redhat.com/1436158 - -- nss: unify the coding style of nss_send() and nss_recv() - - No changes in behavior intended by this commit. - -Marcel Raad (18 Jul 2017) -- tests/server/resolve.c: fix deprecation warning - - MSVC warns that gethostbyname is deprecated. Always use getaddrinfo - instead to fix this when IPv6 is enabled, also for IPv4 resolves. This - is also consistent with what libcurl does. - - Closes https://github.com/curl/curl/pull/1682 - -Jay Satiro (17 Jul 2017) -- darwinssl: fix pinnedpubkey build error - - - s/SessionHandle/Curl_easy/ - - Bug: https://github.com/curl/curl/commit/eb16305#commitcomment-23035670 - Reported-by: Gisle Vanem - -Marcel Raad (16 Jul 2017) -- rtspd: fix GCC warning after MSVC warning fix - - Older GCC warns: - /tests/server/rtspd.c:1194:10: warning: missing braces around - initializer [-Wmissing-braces] - - Fix this by using memset instead of an initializer. - -- libtest: fix MSVC warning C4706 - - With warning level 4, MSVC warns about assignments within conditional - expressions. Change the while loop to a do-while loop to fix this. This - change is also consistent with CODE_STYLE.md. - -- sockfilt: suppress conversion warning with explicit cast - - MSVC warns when implicitly casting -1 to unsigned long. - -- rtspd: fix MSVC level 4 warning - - warning C4701: potentially uninitialized local variable 'req' used - -- winbuild: re-enable warning C4127 for curl tool - - Disabled in cda19a345f6970e22fe8b7a808aeb8f086a21eac. It only needs to - be disabled for libcurl. - -- winbuild: build with warning level 4 - - This is consistent with 7bc64561a2e63ca93e4b0b31d350773ba80955c2, which - changed the warning level from 3 to 4 for the Visual Studio project - files. But disable the level 4 warning C4127 "conditional expression is - constant", as that one is issued by older versions of the Windows SDK - as well as curl itself under some circumstances. - - Closes https://github.com/curl/curl/pull/1667 - -Jay Satiro (12 Jul 2017) -- [Max Dymond brought this change] - - travis: install libidn2 - - Install libidn2 to increase test coverage (IDN tests) - - Closes https://github.com/curl/curl/pull/1673 - -Marcel Raad (12 Jul 2017) -- travis: enable warnings also in release mode - - ... to get warnings also on Linux/GCC and OSX/clang. - - Closes https://github.com/curl/curl/pull/1666 - -Daniel Stenberg (12 Jul 2017) -- [Max Dymond brought this change] - - travis: install libssh2 - - Install libssh2 to increase test coverage (SFTP, SCP) - -Marcel Raad (12 Jul 2017) -- system.h: include winsock2.h before windows.h - - ... to avoid compiler warnings if the user doesn't want - WIN32_LEAN_AND_MEAN. - -- build: remove WIN32_LEAN_AND_MEAN from individual build systems - - It's defined for all build systems in curl_setup.h since commit - beb08481d01a07a8b10938b1078a5e298b1c2912. This caused macro - redefinition warnings in the configure builds. - - Closes https://github.com/curl/curl/pull/1677 - -Jay Satiro (11 Jul 2017) -- ISSUE_TEMPLATE: Add a comment not to file security issues on github - -Marcel Raad (11 Jul 2017) -- curl_setup: always define WIN32_LEAN_AND_MEAN on Windows - - Make sure to always define WIN32_LEAN_AND_MEAN before including any - Windows headers to avoid pulling in unnecessary headers. This avoids - unnecessary macro clashes and compiler warnings. - - Ref: https://github.com/curl/curl/issues/1562 - Closes https://github.com/curl/curl/pull/1672 - -Jay Satiro (11 Jul 2017) -- strerror: Preserve Windows error code in some functions - - This is a follow-up to af02162 which removed (SET_)ERRNO macros. That - commit was an earlier draft that I committed by mistake, which was then - remedied by a5834e5 and e909de6, and now this commit. With this commit - there is now no difference between the current code and the changes that - were approved in the final draft. - - Thanks-to: Max Dymond, Marcel Raad, Daniel Stenberg, Gisle Vanem - Ref: https://github.com/curl/curl/pull/1589 - -Marcel Raad (10 Jul 2017) -- [Max Dymond brought this change] - - tests: Fix up issues with errno in test files - - Closes https://github.com/curl/curl/pull/1671 - -Daniel Stenberg (10 Jul 2017) -- errno: fix non-windows builds after af0216251b94e7 - -- [Ryan Winograd brought this change] - - make: fix docs build on OpenBSD - - Ref: #1591 - -Marcel Raad (10 Jul 2017) -- ldap: fix MinGW compiler warning - - ldap_bind_s is marked as deprecated in w32api's winldap.h shipping with - the latest original MinGW, resulting in compiler warnings since commit - f0fe66f13c93d3d0af45d9fb1231c9164e0f9dc8. Fix this for the non-SSPI - case by using ldap_simple_bind_s again instead of ldap_bind_s with - LDAP_AUTH_SIMPLE. - - Closes https://github.com/curl/curl/pull/1664 - -- curl-compilers.m4: disable warning spam with Cygwin's clang - - When building with Cygwin or MinGW, libtool uses a wrapper executable - instead of a wrapper script [1], which is written in C and throws - missing-variable-declarations warnings. Don't enable these warnings on - Cygwin and MinGW in order to avoid warnings for every executable built, - which spams the test suite output when using Cygwin's clang. - - [1] https://www.gnu.org/software/libtool/manual/html_node/Wrapper-executables.html - - Closes https://github.com/curl/curl/pull/1665 - -Jay Satiro (10 Jul 2017) -- curl_setup_once: Remove ERRNO/SET_ERRNO macros - - Prior to this change (SET_)ERRNO mapped to GetLastError/SetLastError - for Win32 and regular errno otherwise. - - I reviewed the code and found no justifiable reason for conflating errno - on WIN32 with GetLastError/SetLastError. All Win32 CRTs support errno, - and any Win32 multithreaded CRT supports thread-local errno. - - Fixes https://github.com/curl/curl/issues/895 - Closes https://github.com/curl/curl/pull/1589 - -- tool_getparam: fix potentially uninitialized err - -Marcel Raad (9 Jul 2017) -- smb: rename variable to fix shadowing warning - - GCC 4.6.3 on travis complains: - smb.c: In function ‘get_posix_time’: - smb.c:725:13: error: declaration of ‘time’ shadows a global declaration - [-Werror=shadow] - - Fix this by renaming the variable. - -- tool_cb_wrt: fix variable shadowing warning - - GCC 4.4 complains: - tool_cb_wrt.c:81: error: declaration of ‘isatty’ shadows a global - declaration - /usr/include/unistd.h:782: error: shadowed declaration is here - - Fix this by renaming the variable. - - Closes https://github.com/curl/curl/pull/1661 - -Daniel Stenberg (8 Jul 2017) -- RELEASE-NOTES: synced with be2c999b8 - -- travis: install stunnel - -- valgrind.supp: supress OpenSSL false positive seen on travis - -- travis: detect and use valgrind for normal builds - - Closes #1653 - -- travis: add SMB, DICT, TELNET torture to coverage test - -- [Paul Harris brought this change] - - cmake: offer CMAKE_DEBUG_POSTFIX when building with MSVC - - Removes BUILD_RELEASE_DEBUG_DIRS since it wasn't used anywhere. - - Closes #1649 - -- CURLOPT_POSTFIELDS.3: explain the 100-continue magic better - -- [Max Dymond brought this change] - - test1452: add telnet negotiation - - Add a basic telnet server for negotiating some telnet options before - echoing back any data that's sent to it. - - Closes #1645 - -- travis: do more tests in the coverage run - - I added a selection of torture and event tests that run "fast enough" - -- curl_easy_escape.3: mention the (lack of) encoding - - Fixes #1612 - Reported-by: Jeroen Ooms - -- [Gisle Vanem brought this change] - - memdebug: don't setbuf() if the file open failed - - Bug: https://github.com/curl/curl/issues/828#issuecomment-313475151 - -- appveyor: enable CURL_WERROR on all builds - -- cmake: add CURL_WERROR for enabling "warning as errors" - -- [Hannes Magnusson brought this change] - - cmake: remove spurious "-l" from linker flags - - Fixes #1552 - -- test506: skip if threaded-resolver - -- runtests: support "threaded-resolver" as a feature - - ... to let tests require it or skip if present - -- asyn-thread.c: fix unused variable warnings on macOS - -- http: s/TINY_INITIAL_POST_SIZE/EXPECT_100_THRESHOLD - - Make the name reflect its use better, and add a short comment describing - what it's for. - -- cmake: if inet_pton is used, bump _WIN32_WINNT - - ... and make sure inet_pton is always checked for when *not* using Windows, - which is a regression from 4fc6ebe18. - - Idea-by: Sergei Nikulov - -- select.h: avoid macro redefinition harder - - ... by checking the POLLIN define, as the header file checks don't work - on Windows. - -- inet_pton: fix include on windows to get prototype - - inet_pton() exists on Windows and gets used by our cmake builds. Make - sure the correct header file is included to avoid compiler warnings. - - Closes #1639 - -- TODO: 1.10 auto-detect proxy - - Closes #1572 - -- TODO: HTTP proxy CONNECT is non-blocking now - -- cmake: fix send/recv argument scanner for windows - - ... by simply trying the Windows argument types first. - - Fixes #1640 - -- RELEASE-NOTES: synced with 596cfb6c0 - -- [Gisle Vanem brought this change] - - smb: add support for CURLOPT_FILETIME - - Bug: https://curl.haxx.se/mail/lib-2017-07/0005.html - - Closes #1643 - -- travis: install nghttp2 on linux builds - - Closes #1642 - -- [Gisle Vanem brought this change] - - smb: fix build for djgpp/MSDOS - - bug: https://curl.haxx.se/mail/lib-2017-07/0005.html - -- configure: try ldap/lber in reversed order first - - When scanning for which LDAP libraries to use, try the -lldap -llber - combination before the reversed order since it has a greater chance of - working when linking with libcurl statically. - - Fixes #1619 - Closes #1634 - Reported-by: David E. Narváez - -- configure: remove checks for 5 functions never used - - fork, getprotobyname, inet_addr, perror, uname - - closes #1638 - -- dist: add SMB python deps into the tarball - -- [Max Dymond brought this change] - - test1451: add SMB support to the testbed - - Add test 1451 which does some very basic SMB testing using the impacket - SMB server. - - Closes #1630 - -- [Max Dymond brought this change] - - test: add impacket for SMB testing - - Import impacket 0.9.15 for use in SMB testing. This was generated by - doing "pip2.7 install -t . impacket" - - Unnecessary files for current testing were deleted. - -- travis.yml: use --enable-werror on debug builds - - ... to better detect and fault on compiler warnings/errors - - Closes #1637 - -- tool_sleep: typecast to avoid macos compiler warning - - tool_sleep.c:54:24: error: implicit conversion loses integer precision: - 'long' to '__darwin_suseconds_t' (aka 'int') - [-Werror,-Wshorten-64-to-32] - -- [Martin Kepplinger brought this change] - - timeval.c: Use long long constant type for timeval assignment - - On a 64 bit host, sparse says: - - timeval.c:148:15: warning: constant 0x7fffffffffffffff is so big it is long - timeval.c:149:12: warning: constant 0x7fffffffffffffff is so big it is long - - so let's use long long constant types in order to prevent undesired overflow - failures. - - Bug: https://curl.haxx.se/mail/lib-2017-07/0003.html - - Closes #1636 - - Signed-off-by: Martin Kepplinger - -- url: make the original string get used on subsequent transfers - - ... since CURLOPT_URL should follow the same rules as other options: - they remain set until changed or cleared. - - Added test 1551 to verify. - - Fixes #1631 - Closes #1632 - Reported-by: Pavel Rochnyak - -- [Johannes Schindelin brought this change] - - gtls: fix build when sizeof(long) < sizeof(void *) - - - Change gnutls pointer/int macros to pointer/curl_socket_t. - Prior to this change they used long type as well. - - The size of the `long` data type can be shorter than that of pointer - types. This is the case most notably on Windows. - - If C99 were acceptable, we could simply use `intptr_t` here. But we - want to retain C89 compatibility. - - Simply use the trick of performing pointer arithmetic with the NULL - pointer: to convert an integer `i` to a pointer, simply take the - address of the `i`th element of a hypothetical character array - starting at address NULL. To convert back, simply cast the pointer - difference. - - Thanks to Jay Satiro for the initial modification to use curl_socket_t - instead of int/long. - - Closes #1617 - - Signed-off-by: Johannes Schindelin - -- [Ryan Winograd brought this change] - - unit1399: fix integer overflow - - Bug: #1616 - Closes #1633 - -- [Per Malmberg brought this change] - - cmake: Added compatibility options for older Windows versions - - CURL_STATIC_CRT and ENABLE_INET_PTON - - Closes #1621 - -- unit1399: add logging to time comparison - - ... to enable tracking down why autobuilds fail on this - - Bug: #1616 - -- make: build the docs subdir only from within src - - ... and don't build at all in include - - Prompted-by-work-by: Simon Warta - Ref: #1590 - Closes #1591 - -- [Max Dymond brought this change] - - test1450: fix up DICT server in torture mode - - As per https://github.com/curl/curl/pull/1615, the DICT server is a - little spammy in torture mode due to the sockets being torn down - unexpectedly. Fix this by adding some error handling to the handling - function. - - Closes #1629 - -- [Max Dymond brought this change] - - test1450: add simple testing for DICT - - Add a new server which provides a DICT interface. This is intended to - begin coverage testing for lib/dict.c - - Closes #1615 - -- [Dan Fandrich brought this change] - - test1521: fix out-of-tree builds, broken with 467da3af - - The test.h file is no longer in the same directory as the source file, - so that directory needs to be added to the include path. - - Fixes #1627 - Closes #1628 - -- [Max Dymond brought this change] - - http2: handle PING frames - - Add a connection check function to HTTP2 based off RTSP. This causes - PINGs to be handled the next time the connection is reused. - - Closes #1521 - -- [Max Dymond brought this change] - - handler: refactor connection checking - - Add a new type of callback to Curl_handler which performs checks on - the connection. Alter RTSP so that it uses this callback to do its - own check on connection health. - -- [dmitrykos brought this change] - - openssl: improve fallback seed of PRNG with a time based hash - - Fixes #1620 - -- [Ryan Winograd brought this change] - - progress: prevent resetting t_starttransfer - - Prevent `Curl_pgrsTime` from modifying `t_starttransfer` when invoked - with `TIMER_STARTTRANSFER` more than once during a single request. - - When a redirect occurs, this is considered a new request and - `t_starttransfer` can be updated to reflect the `t_starttransfer` time - of the redirect request. - - Closes #1616 - - Bug: https://github.com/curl/curl/pull/1602#issuecomment-310267370 - -- curl_strequal.3: fix typo in SYNOPSIS - - Reported-by: Jesse Chisholm - - Fixes #1623 - -- RELEASE-NOTES: synced with ce2c3ebda - -Kamil Dudka (28 Jun 2017) -- curl --socks5-{basic,gssapi}: control socks5 auth - - Closes https://github.com/curl/curl/pull/1454 - -- CURLOPT_SOCKS5_AUTH: allowed methods for SOCKS5 proxy auth - - If libcurl was built with GSS-API support, it unconditionally advertised - GSS-API authentication while connecting to a SOCKS5 proxy. This caused - problems in environments with improperly configured Kerberos: a stock - libcurl failed to connect, despite libcurl built without GSS-API - connected fine using username and password. - - This commit introduces the CURLOPT_SOCKS5_AUTH option to control the - allowed methods for SOCKS5 authentication at run time. - - Note that a new option was preferred over reusing CURLOPT_PROXYAUTH - for compatibility reasons because the set of authentication methods - allowed by default was different for HTTP and SOCKS5 proxies. - - Bug: https://curl.haxx.se/mail/lib-2017-01/0005.html - Closes https://github.com/curl/curl/pull/1454 - -- socks: deduplicate the code for auth request - -- socks: use proxy_user instead of proxy_name - - ... to make it obvious what the data is used for - -Daniel Stenberg (27 Jun 2017) -- libtest/make: generate lib1521.c - - ... instead of having the generated code checked in. This saves space in - the tarball but primarily automatically adapts to newly added options. - - Closes #1614 - -Jay Satiro (26 Jun 2017) -- tool_getparam: fix memory leak on test 1147 OOM (torture tests) - - Bug: https://github.com/curl/curl/pull/1486#issuecomment-310926872 - Reported-by: Dan Fandrich - -Dan Fandrich (25 Jun 2017) -- test1537: fixed memory leak on OOM - -Marcel Raad (25 Jun 2017) -- test1521: fix compiler warnings - - The integer literal 3123123123 doesn't fit into a 32-bit signed - integer, so GCC with 32-bit long warns in C90 mode: - this decimal constant is unsigned only in ISO C90 [enabled by default] - Fix this by using ULONG_MAX, which should fit in any curl_off_t and has - the correct suffix to not issue any warnings. - Also adds the missing CURLOPT_REQUEST_TARGET from commit - 9b167fd090f596eac828817d48c247eeae53407f. - - Closes https://github.com/curl/curl/pull/1611 - -Daniel Stenberg (24 Jun 2017) -- curl/system.h: add check for XTENSA for 32bit gcc - - Reported-by: Neil Kolban - Fixes: 1598 - -- [Henrik S. Gaßmann brought this change] - - winbuild: fix boringssl build - - Compile with `WIN32_LEAN_AND_MEAN` which prevents `windows.h` from - including too much clutter including `wincrypt.h` which in turn contains - some preprocessor macros that clash with boringssl symbols. - - Detect boringssl by checking the existance of `is_boringssl.h` and set - the corresponding `HAVE_BORINGSSL` for compilation which is used in - `ldap.c` to undefine the evil macros. - - Closes #1610 - -- progress: progress.timespent needs to be us - - follow-up to 64ed44a815e4e to fix test 500 failures - -Marcel Raad (24 Jun 2017) -- curl-compilers.m4: fix unknown-warning-option on Apple clang - - Since 5598b0bd63f690c151074494ce47ef872f004ab4, clang -v is used to - detect the clang version. The version number was expected to come after - the word "version". For Apple clang, this doesn't work as it has its - own versioning scheme. - The version number is now first searched after the string - "based on LLVM". This works for Apple clang before version 7, and also - for e.g. Ubuntu's clang up to version 3.7. If it's not found and the - version string contains "Apple LLVM version", clang version 3.7 is - assumed, which is the version that comes with Xcode 7. Otherwise, the - version number is still expected after the word "version", which works - for very old Apple clang versions. - - Ref: https://trac.macports.org/wiki/XcodeVersionInfo - Fixes https://github.com/curl/curl/issues/1606 - Closes https://github.com/curl/curl/pull/1607 - -Daniel Stenberg (24 Jun 2017) -- progress: fix "time spent", broke in adef394ac - -- CURLINFO_REDIRECT_URL.3: mention the CURLOPT_MAXREDIRS case - - ... supported since 7.54.1 - -- maketgz: switch to -6e for xz - - To reduce the memory requirement for decompress, and still do almost as - good compression as with -9e. - - Pointed-out-by: Dan Fandrich - -- libtest/Makefile: remove unused lib1541 variables - -- CONTRIBUTE.md: mention the out-of-tree build test too - -- maketgz: switch to xz instead of lzma - - The compressed output size seems to be a tad bit smaller, but generally - xz seems more preferred these days and is used directly by for example - gentoo instead of bz2. - - "Users of LZMA Utils should move to XZ Utils" => - https://tukaani.org/lzma/ - - Closes #1604 - -- --request-target: instead of --strip-path-slash - - ... and CURLOPT_REQUEST_TARGET instead of CURLOPT_STRIP_PATH_SLASH. - - This option instead provides the full "alternative" target to use in the - request, instead of extracting the path from the URL. - - Test 1298 and 1299 updated accordingly. - - Idea-by: Evert Pot - Suggestion: https://daniel.haxx.se/blog/2017/06/19/options-with-curl/comment-page-1/#comment-18373 - - Closes #1593 - -Marcel Raad (21 Jun 2017) -- lib1521: fix missing-variable-declarations clang warnings - - Declare TU-local variables static. - -- travis: enable typecheck-gcc warnings - - - switch debug and release configurations so that we get an optimized - build with GCC 4.3+ as required by typecheck-gcc - - enable warnings-as-errors for release builds - (which have warnings disabled) - - Closes https://github.com/curl/curl/pull/1595 - -- typecheck-gcc: add support for CURLINFO_OFF_T - - typecheck-gcc expected curl_socket_t instead of curl_off_t arguments - for CURLINFO_OFF_T. Detected by test1521, unfortunately only when run - locally. - - Closes https://github.com/curl/curl/pull/1592 - -Daniel Stenberg (21 Jun 2017) -- [Simon Warta brought this change] - - ci: whitelist branches to avoid testing feature branches twice - -- [Gisle Vanem brought this change] - - lib: fix the djgpp build - - Bug: https://github.com/curl/curl/commit/73a2fcea0b4adea6ba342cd7ed1149782c214ae3#commitcomment-22655993 - -Marcel Raad (20 Jun 2017) -- if2ip: fix compiler warning in ISO C90 mode - - remote_scope_id is only used when both HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID - and ENABLE_IPV6 are defined instead of only one of them. - -Daniel Stenberg (20 Jun 2017) -- travis: do the distcheck test build out-of-tree as well - -- http: add --strip-path-slash and CURLOPT_STRIP_PATH_SLASH - - ... to enable sending "OPTIONS *" which wasn't possible previously. - - This option currently only works for HTTP. - - Added test cases 1298 + 1299 to verify - - Fixes #1280 - Closes #1462 - -- test1521: test getinfo's OFF_T types too - - Closes #1588 - -- lib1521: add curl_easy_getinfo calls to the test set - - Also added return value checks to make sure no unexpected return codes - are used. - -- [Simon Warta brought this change] - - automake: use $(MKHELP) variable instead if constant mkhelp.pl - - this improves symmetry with the rule above - -- [Simon Warta brought this change] - - mkhelp.pl: fix script name in usage text - -- RELEASE-NOTES: synced with 3b80d3ca4 - -- getinfo: return sizes as curl_off_t - - This change introduces new alternatives for the existing six - curl_easy_getinfo() options that return sizes or speeds as doubles. The - new versions are named like the old ones but with an appended '_T': - - CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - CURLINFO_CONTENT_LENGTH_UPLOAD_T - CURLINFO_SIZE_DOWNLOAD_T - CURLINFO_SIZE_UPLOAD_T - CURLINFO_SPEED_DOWNLOAD_T - CURLINFO_SPEED_UPLOAD_T - - Closes #1511 - -- PIPELINING_SERVER_BL: cleanup the internal list use - - The list was freed incorrectly since the llist refactor of - cbae73e1dd959. Added test 1550 to verify that it works and avoid future - regressions. - - Reported-by: Pascal Terjan - - Fixes #1584 - Closes #1585 - -- http2: fix OOM crash - - torture mode with test 1021 found it - -- CURLOPT_PREQUOTE.3: spellfix man page reference - -Marcel Raad (18 Jun 2017) -- http_proxy: fix build with http and proxy - - After deff7de0eb0e22d2d142b96b9cc84cd8db5d2a48, the build without - CURL_DISABLE_PROXY and CURL_DISABLE_HTTP was failing because of missing - includes. - -- http_proxy: fix compiler warning - - With CURL_DISABLE_PROXY or CURL_DISABLE_HTTP, GCC complained about a - missing prototype for Curl_connect_free. - -Daniel Stenberg (18 Jun 2017) -- TODO: update the TOC too - -- TODO: implement support for CURLOPT_PREQUOTE with SFTP - - ... also updated the CURLOPT_PREQUOTE.3 man page to mention the correct - protocol support. - - Closes #1514 - -- tool_wrte_cb: remove check for config == NULL - - ... as it really cannot have reached this far with config being NULL, - thus this is unnecesary and misleading. - - Bug: https://news.ycombinator.com/item?id=14577585 and - https://daniel.haxx.se/blog/2017/06/17/curl-doesnt-spew-binary-anymore/comment-page-1/#comment-18356 - - Forwarded-to-us-by: Jakub Wilk - -- curl: prevent binary output spewed to terminal - - ... unless "--output -" is used. Binary detection is done by simply - checking for a binary zero in early data. - - Added test 1425 1426 to verify. - - Closes #1512 - -Marcel Raad (16 Jun 2017) -- Makefile.m32: enable -W for MinGW32 build - - The configure-based build also has this in addition to -Wall. - - Closes https://github.com/curl/curl/pull/1578 - -- curl-compilers.m4: enable comma clang warning - - It usually warns when using commas instead of semicolons or other - operators by accident. - - Closes https://github.com/curl/curl/pull/1578 - -- curl-compilers.m4: enable missing-variable-declarations clang warning - - It usually warns when forgetting to declare TU-local variables static. - - Closes https://github.com/curl/curl/pull/1578 - -- curl-compilers.m4: enable double-promotion warning - - Enable -Wdouble-promotion for both GCC and clang. It warns on implicit - promotion from float to double. - - Closes https://github.com/curl/curl/pull/1578 - -- curl-compilers.m4: enable vla warning for clang - - Previously, that warning was only implicitly active in C90 mode. - Enable it unconditionally as already done for GCC. - - Closes https://github.com/curl/curl/pull/1578 - -Daniel Stenberg (16 Jun 2017) -- http-proxy: fix chunked-encoded CONNECT responses - - Regression since 5113ad0424. - - ... and remove 'flaky' from test 1061 again - - Closes #1579 - -- http-proxy: deal with EAGAIN - - ... the previous code would reset the header length wrongly (since - 5113ad0424). This makes test 1060 reliable again. - - Also: make sws send even smaller chunks of data to increase the - likeliness of this happening. - -- libtest/libntlmconnect: fix compiler warnings from f94fcdb - -- [Jay Satiro brought this change] - - HTTPS-Proxy: don't offer h2 for https proxy connections - - Bug: https://github.com/curl/curl/issues/1254 - - Closes #1546 - -- tests: stabilize test 2032 and 2033 - - Both these tests run the same underlying test code: libntlmconnect.c - - this test code made some assumptions about socket ordering when it used - curl_easy_fdset() and when we changed timing or got accidental changes - in libcurl the tests would fail. - - The tests verify that the different transfers keep using the same - connections, which I now instead made sure by adding the number of bytes - each transfer gets and then verifies that they always get the same - amount as when these tests worked. - - Closes #1576 - -- test1148: verify the -# progressbar - - Closes #1569 - -- test1061: mark as flaky - - Fails intermittently on travis builds since a few days. Likely due to - 5113ad0424. - -Jay Satiro (16 Jun 2017) -- url: refactor the check for Windows drive letter in path - - - Move the logic to detect a Windows drive letter prefix - (eg c: in c:foo) into a function-like macro. - - Closes https://github.com/curl/curl/pull/1571 - -- mk-ca-bundle.pl: Check curl's exit code after certdata download - - - No longer allow partial downloads of certdata. - - Prior to this change partial downloads were (erroneously?) allowed since - only the server code was checked to be 200. - - Bug: https://github.com/curl/curl/pull/1577 - Reported-by: Matteo B. - -Daniel Stenberg (16 Jun 2017) -- dist: add the fuzz dir to the tarball - -- configure: disable nghttp2 too if HTTP has been disabled - -- http-proxy: fix build with --disable-proxy or --disable-http - - Reported-by: Dan Fandrich - -- fuzz/README: document how to build - - Fixes #1476 - -- [Frederik B brought this change] - - fuzz: corpora file structure, initial commit - -- [Frederik B brought this change] - - fuzz: bring oss-fuzz initial code converted to C89 - -- http-proxy: only attempt FTP over HTTP proxy - - ... all other non-HTTP protocol schemes are now defaulting to "tunnel - trough" mode if a HTTP proxy is specified. In reality there are no HTTP - proxies out there that allow those other schemes. - - Assisted-by: Ray Satiro, Michael Kaufmann - - Closes #1505 - -- TODO: the generated include file is gone - - ... since commit 73a2fcea0b - -- curl_setup.h: error out on CURL_WANTS_CA_BUNDLE_ENV use - - ... to make it really apparent if there's any user using this on purpose. - - Suggested-by: Jay Satiro - - Closes #1542 - -- lib/curl_setup.h: remove CURL_WANTS_CA_BUNDLE_ENV - - When this define was set, libcurl would check the environment variable - named CURL_CA_BUNDLE at run-time and use that CA cert bundle. This - feature was only defined by the watcom and m32 makefiles and caused - inconsistent behaviours among libcurls built on different platforms. - - The curl tool does already feature its own similar logic and the library - does not really need it, and it isn't documented libcurl behavior. So - this change removes it. - - Ref: #1538 - -- test1147: verify -H on a file - -- curl: allow --header and --proxy-header read from file - - So many headers can be provided as @filename. - - Suggested-by: Timothe Litt - - Closes #1486 - -- RELEASE-NOTES: synced with 2ad80eec5 - -- curl/curlver.h: start working on 7.55.0 - -- http-proxy: do the HTTP CONNECT process entirely non-blocking - - Mentioned as a problem since 2007 (8f87c15bdac63) and of course it - existed even before that. - - Closes #1547 - -- progress: let "current speed" be UL + DL speeds combined - - Bug #1556 - Reported-by: Paul Harris - Closes #1559 - -Marcel Raad (14 Jun 2017) -- system.h: fix MinGW build - - CURLSYS_PULL_WS2TCPIP_H got renamed to CURL_PULL_WS2TCPIP_H in commit - 73a2fcea0b4adea6ba342cd7ed1149782c214ae3. - -Daniel Stenberg (14 Jun 2017) -- timers: store internal time stamps as time_t instead of doubles - - This gives us accurate precision and it allows us to avoid storing "no - time" for systems with too low timer resolution as we then bump the time - up to 1 microsecond. Should fix test 573 on windows. - - Remove the now unused curlx_tvdiff_secs() function. - - Maintains the external getinfo() API with using doubles. - - Fixes #1531 - -- dist: make the hugehelp.c not get regenerated unnecessarily - - The maketgz script now makes sure the generated hugehelp.c file in the - tarball is newer than the generated curl.1 man page, so that it doesn't - have to get unnecessarily rebuilt first thing in a typical build. It - thus also removes the need for perl to build off a plain release - tarball. - - Fixes #1565 - -- includes: remove curl/curlbuild.h and curl/curlrules.h - - Rely entirely on curl/system.h now. - - Introduced in Aug 2008 with commit 14240e9e109f. Now gone. - - Fixes #1456 - -Version 7.54.1 (14 Jun 2017) - -Daniel Stenberg (14 Jun 2017) -- release: 7.54.1 - -Dan Fandrich (13 Jun 2017) -- mk-lib1521.pl: updated to match the test changes in 916ec30a - -Daniel Stenberg (13 Jun 2017) -- [Stuart Henderson brought this change] - - libressl: OCSP and intermediate certs workaround no longer needed - - lib/vtls/openssl.c has a workaround for a bug with OCSP responses signed - by intermediate certs, this was fixed in LibreSSL in - https://github.com/libressl-portable/openbsd/commit/912c64f68f7ac4f225b7d1fdc8fbd43168912ba0 - - Bug: https://curl.haxx.se/mail/lib-2017-06/0038.html - -- url: fix buffer overwrite with file protocol (CVE-2017-9502) - - Bug: https://github.com/curl/curl/issues/1540 - Advisory: https://curl.haxx.se/docs/adv_20170614.html - - Assisted-by: Ray Satiro - Reported-by: Marcel Raad - -- urlglob: fix division by zero - - The multiply() function that is used to avoid integer overflows, was - itself reason for a possible division by zero error when passed a - specially formatted glob. - - Reported-by: GwanYeong Kim - -- configure: update the copyright year in the output - -- [ygrek brought this change] - - BINDINGS: update SP-Forth and OCaml urls - -Michael Kaufmann (11 Jun 2017) -- FindWin32CACert: Use a temporary buffer on the stack - - Don't malloc() the temporary buffer, and use the correct type: - SearchPath() works with TCHAR, but SearchPathA() works with char. - Set the buffer size to MAX_PATH, because the terminating null byte - is already included in MAX_PATH. - - Reviewed-by: Daniel Stenberg - Reviewed-by: Marcel Raad - - Closes #1548 - -Dan Fandrich (11 Jun 2017) -- test1521: fixed OOM handling - -Daniel Stenberg (9 Jun 2017) -- RELEASE-PROCEDURE: updated future release dates - -- [Paul Harris brought this change] - - gitignore: ignore all vim swap files - - Closes #1561 - -- lib1521: fix compiler warnings on the use of bad 'long' values - - Reported-by: Marcel Raad - Bug: https://github.com/curl/curl/commit/cccac4fb2b20d6ed87da7978408c3ecacc464fe4#commitcomment-22453387 - -- setopt: check CURLOPT_ADDRESS_SCOPE option range - - ... and return error instead of triggering an assert() when being way - out of range. - -Jay Satiro (8 Jun 2017) -- [TheAssassin brought this change] - - cmake: Fix inconsistency regarding mbed TLS include directory - - Previously, one had to set MBEDTLS_INCLUDE_DIR to make CMake find the - headers, but the system complained that mbed TLS wasn't found due to - MBEDTLS_INCLUDE_DIRS (note the trailing s) was not set. This commit - attempts to fix that. - - Closes https://github.com/curl/curl/pull/1541 - -Daniel Stenberg (8 Jun 2017) -- [Ryuichi KAWAMATA brought this change] - - examples/multi-uv.c: fix deprecated symbol - - Closes #1557 - -- asyn-ares: s/Curl_expire_latest/Curl_expire - -- expire: remove Curl_expire_latest() - - With the introduction of expire IDs and the fact that existing timers - can be removed now and thus never expire, the concept with adding a - "latest" timer is not working anymore as it risks to not expire at all. - - So, to be certain the timers actually are in line and will expire, the - plain Curl_expire() needs to be used. The _latest() function was added - as a sort of shortcut in the past that's quite simply not necessary - anymore. - - Follow-up to 31b39c40cf90 - - Reported-by: Paul Harris - - Closes #1555 - -- [Chris Carlmar brought this change] - - configure: fix link with librtmp when specifying path - - Bug: https://curl.haxx.se/mail/lib-2017-06/0017.html - -- file: make speedcheck use current time for checks - - ... as it would previously just get the "now" timestamp before the - transfer starts and then not update it again. - - Closes #1550 - -- metalink: remove unused printf() argument - -- travis: let some builds *not* use --enable-debug - - typecheck-gcc and other things require optimized builds - - Closes #1544 - -- README.md: show the coverall coverage on github - -- lib1521: fix compiler warnings - -- test1521: make the code < 80 columns wide - -- test1121: use stricter types to work with typcheck-gcc - -- typecheck-gcc: allow CURLOPT_STDERR to be NULL too - -- test1521: test *all* curl_easy_setopt options - - mk-lib1521.pl generates a test program (lib1521.c) that calls - curl_easy_setopt() for every known option with a few typical values to - make sure they work (ignoring the return codes). - - Some small changes were necessary to avoid asserts and NULL accesses - when doing this. - - The perl script needs to be manually rerun when we add new options. - - Closes #1543 - -Dan Fandrich (5 Jun 2017) -- test1538: added "verbose logs" keyword - - These error messages are not displayed with --disable-verbose - -Daniel Stenberg (5 Jun 2017) -- test1262: verify ftp download with -z for "if older than this" - -Marcel Raad (5 Jun 2017) -- curl_ntlm_core: use Curl_raw_toupper instead of toupper - - This was the only remaining use of toupper in the entire source code. - - Suggested-by: Daniel Stenberg - -Daniel Stenberg (4 Jun 2017) -- RELEASE-NOTES: synced with 65ba92650 - -Marcel Raad (4 Jun 2017) -- curl_ntlm_core: pass unsigned char to toupper - - Otherwise, clang on Cygwin64 warns: - curl_ntlm_core.c:525:35: error: array subscript is of type 'char' - [-Werror,-Wchar-subscripts] - dest[2 * i] = (unsigned char)(toupper(src[i])); - ^~~~~~~~~~~~~~~ - /usr/include/ctype.h:152:25: note: expanded from macro 'toupper' - (void) __CTYPE_PTR[__x]; (toupper) (__x);}) - ^~~~ - -Jay Satiro (3 Jun 2017) -- [Mahmoud Samir Fayed brought this change] - - BINDINGS: add Ring binding - - Closes https://github.com/curl/curl/pull/1539 - -Daniel Stenberg (4 Jun 2017) -- CONTRIBUTE.md: mention tests done on pull requests - -- travis: add coverage, distcheck and cmake builds - - Closes #1534 - -Marcel Raad (3 Jun 2017) -- libtest: fix int-in-bool-context warnings - - GCC 7 complained: - ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] - -- libtest: fix implicit-fallthrough warnings with GCC 7 - -- x509asn1: fix implicit-fallthrough warning with GCC 7 - -- curl_sasl: fix unused-variable warning - - This fixes the following warning with CURL_DISABLE_CRYPTO_AUTH, - as seen in the autobuilds: - - curl_sasl.c:417:9: warning: unused variable 'serverdata' - [-Wunused-variable] - -Daniel Stenberg (3 Jun 2017) -- updatemanpages.pl: error out on too old git version - -Marcel Raad (3 Jun 2017) -- cyassl: define build macros before including ssl.h - - cyassl/ssl.h needs the macros from cyassl/options.h, so define them - before including cyassl/ssl.h the first time, which happens in - urldata.h. - This broke the build on Ubuntu Xenial, which comes with WolfSSL 3.4.8 - and therefore redefines the symbols from cyassl/options.h instead of - including the header. - - Closes https://github.com/curl/curl/pull/1536 - -Daniel Stenberg (3 Jun 2017) -- tool_util: remove unused tvdiff_secs and remove tool_ prefix - - Closes #1532 - -- dedotdot: fixed output for ".." and "." only input - - Found when updating test 1395, which I did to increase test coverage of - this source file... - - Closes #1535 - -Marcel Raad (2 Jun 2017) -- mbedtls: make TU-local variable static - - mbedtls_x509_crt_profile_fr is only used locally. - This fixes a missing-variable-declarations warning with clang. - -- MD(4|5): silence cast-align clang warning - - Unaligned access is on purpose here and the warning is harmless on - affected architectures. GCC knows that, while clang warns on all - architectures. - -Daniel Stenberg (2 Jun 2017) -- test1538: fix typo - -- test1538: verify the libcurl strerror API calls - -- curl_endian: remove unused functions - - Closes #1529 - -- test1537: dedicated tests of the URL (un)escape API calls - - Closes #1530 - -- coverage: run event tests too - - ... the torture ones are commented out only because they are slooooow. - -- build: provide easy code coverage measuring - - Closes #1528 - -- typecheck-gcc.h: check CURLINFO_CERTINFO - - ... and update the certinfo.c example accordingly. - - Fixes https://github.com/curl/curl/issues/846 - -- typecheck-gcc.h: check CURLINFO_TLS_SSL_PTR and CURLINFO_TLS_SESSION - - ... so that they get the required "struct curl_tlssessioninfo **" - arguments. - -- typecheck-gcc.h: separate getinfo slist checks from other pointers - - Fixes #1524 - -Marcel Raad (1 Jun 2017) -- curl-compilers.m4: escape square brackets in regex - - Otherwise, they are removed in the final configure file. - Also changed sed to "$SED" like in most other calls in this file. - -- curl-compilers.m4: fix compiler_num for clang - - "clang -dumpversion" always returns "4.2.1", the GCC version that clang - was initially compatible to. Use "clang -v" instead, which returns the - actual clang version. - - Fixes https://github.com/curl/curl/issues/1522 - Closes https://github.com/curl/curl/pull/1523 - -Daniel Stenberg (31 May 2017) -- examples/externalsocket.c: s/closesocket/closecb - - ... since closesocket is a function in WinSock. - - Reported-by: Marcel Raad - Bug: https://github.com/curl/curl/commit/55fcb8485914700132fd1854c9509b66c955efbe#co - mmitcomment-22347818 - -Marcel Raad (31 May 2017) -- lib583: fix compiler warning - - Use CURLMcode for variable 'res' and cast to int where necessary - instead of the other way around. Other tests do the same. - - This fixes the following clang warning: - lib583.c:68:15: warning: cast from function call of type 'CURLMcode' to - non-matching type 'int' [-Wbad-function-cast] - -Daniel Stenberg (31 May 2017) -- CURLOPT_SSH_KEY*.3: typos - - Reported-by: Gisle Vanem - -- CURLOPT_STREAM_DEPENDS.3: typo - -- CURLOPT_FNMATCH_FUNCTION.3: also modified example to avoid fcpp issues - -- CURLOPT_FNMATCH_DATA.3: modified example to avoid fcpp issues - -- opts: more than 100 more examples for man pages... - -- libtest/lib574.c: use correct callback proto - -- examples/sampleconv.c: indent changes, made callbacks static - -- example/externalsocket.c: make it use CLOSESOCKETFUNCTION too - -Marcel Raad (31 May 2017) -- curl-compilers.m4: enable -Wshift-sign-overflow for clang - - clang 2.9+ supports -Wshift-sign-overflow, which warns about undefined - behavior on signed left shifts when shifting by too many places. - - Ref: https://github.com/curl/curl/issues/1516 - Closes https://github.com/curl/curl/pull/1517 - -Daniel Stenberg (31 May 2017) -- CURLOPT_PROXY.3: fix test 1140 breakage - -Jay Satiro (31 May 2017) -- build-wolfssl: Sync config with wolfSSL 3.11 - - wolfSSL configure script relevant changes from 3.10 to 3.11: - - - Async threading support added; disabled by default without async - crypto, which continues to be disabled by default. - - wolfSSL configure script relevant changes from 3.11 to 3.11.1 (beta): - - - TLS 1.3 beta support added; disabled by default. - - For experimenting I put in a comment block the defines needed to enable - TLS 1.3 support (ie the equivalent of --enable-tls13). - -Daniel Stenberg (30 May 2017) -- opts: more examples added to man pages - -- docs: clarify NO_PROXY further - - Fixes #1208 - -- CURLOPT_PROXY.3: describe the environment variables more - -- transfer: init the infilesize from the postfields... - - ... with a strlen() if no size was set, and do this in the pretransfer - function so that the info is set early. Otherwise, the default strlen() - done on the POSTFIELDS data never sets state.infilesize. - - Reported-by: Vincas Razma - Bug: #1294 - -Jay Satiro (29 May 2017) -- test557: fix ubsan runtime error due to int left shift - - - Test curl_msnprintf negative int width arg using INT_MIN instead of - 1 << 31 which is undefined behavior. - - Closes https://github.com/curl/curl/issues/1516 - -- mbedtls: fix variable shadow warning - - vtls/mbedtls.c:804:69: warning: declaration of 'entropy' shadows a global declaration [-Wshadow] - CURLcode Curl_mbedtls_random(struct Curl_easy *data, unsigned char *entropy, - ^~~~~~~ - -Daniel Stenberg (29 May 2017) -- RELEASE-NOTES: synced with 3aaac8c2f - -Dan Fandrich (28 May 2017) -- tests: removed some redundant empty sections - -- runtests.pl: removed feature - - This hasn't been used in over a decade. can still be used to - run commands before the main test. - -Daniel Stenberg (27 May 2017) -- opts: more examples added in option man pages - -Dan Fandrich (27 May 2017) -- runtests.pl: removed unused arguments to valgrindparse - -Daniel Stenberg (25 May 2017) -- TODO: 6.4 is done, send telnet data in chunks - -- [Phil Crump brought this change] - - docs/CURLOPT_SSLVERSION.3: Correct define name in example - - Closes #1509 - -- ssh: fix 'left' may be used uninitialized - - follow-up to f31760e63b4e - - Reported-by: Michael Kaufmann - Bug: https://github.com/curl/curl/pull/1495#issuecomment-303982793 - -Michael Kaufmann (24 May 2017) -- time: fix type conversions and compiler warnings - - Fix bugs and compiler warnings on systems with 32-bit long and - 64-bit time_t. - - Reviewed-by: Daniel Stenberg - - Closes #1499 - -Marcel Raad (24 May 2017) -- examples: fix Wimplicit-fallthrough warnings - - This is contained in -Wextra with GCC 7. - -Daniel Stenberg (24 May 2017) -- [Anatol Belski brought this change] - - winbuild: fix the nghttp2 build - - Closes #1321 - -GitHub (24 May 2017) -- [Sergei Nikulov brought this change] - - LDAP: documentation update per #878 changes (#1506) - -Daniel Stenberg (23 May 2017) -- redirect: store the "would redirect to" URL when max redirs is reached - - Test 1261 added to verify. - - Reported-by: Lloyd Fournier - - Fixes #1489 - Closes #1497 - -GitHub (24 May 2017) -- [Sergei Nikulov brought this change] - - LDAP: fixed checksrc issue - -- [Sergei Nikulov brought this change] - - LDAP: using ldap_bind_s on Windows with methods (#878) - - * LDAP: using ldap_bind_s on Windows with methods(BASIC/DIGEST/NTLM/AUTONEG) - - * ldap: updated per build options handling - - * ldap: fixed logic for auth selection - -Daniel Stenberg (23 May 2017) -- [Akhil Kedia brought this change] - - cmake: fix build on Ubuntu 14.04 - - Fixed a syntax error with setting cache variables (The type and - docstring were missing), resulting in build errors. Quoted the - CURL_CA_PATH and CURL_CA_BUNDLE otherwise the path was written without - quotes in C code, resulting in build errors. - - Closes #1503 - - Signed-off-by: Akhil - -- url: fix declaration of 'pipe' shadows a global declaration - - follow-up to 4cdb1be8246c - -Kamil Dudka (22 May 2017) -- memdebug: fix compilation failure - - .... caused by a typo in the last commit (fixing issue #1504): - - memdebug.c: In function ‘curl_fclose’: - memdebug.c:444:3: error: implicit declaration of function - ‘DEBUGDEBUGASSERT’ [-Werror=implicit-function-declaration] - -Daniel Stenberg (22 May 2017) -- assert: avoid, use DEBUGASSERT instead! - - ... as it does extra checks to actually work. - - Reported-by: jonrumsey at github - Fixes #1504 - -- [Simon Warta brought this change] - - cmake: remove unused variables: GNUTLS_ENABLED, NSS_ENABLED - -- [Simon Warta brought this change] - - cmake: remove CURL_CA_BUNDLE from cmake TODO - -- [Simon Warta brought this change] - - cmake: auto detection of CURL_CA_BUNDLE/CURL_CA_PATH - - Closes #1461 - -- [Simon Warta brought this change] - - cmake: add CURL_CA_BUNDLE/CURL_CA_FALLBACK/CURL_CA_PATH options - -- [Simon Warta brought this change] - - cmake: Add CURL_CA_FALLBACK to curl_config.h.cmake - - This is for symmetry with the autoconf generated curl_config.h.in - -- RELEASE-NOTES: synced with 052a14e3c - -Michael Kaufmann (20 May 2017) -- tests: stabilize test 1034 - - Pass the invalid domain name on stdin. On some systems, the test - framework cannot pass invalid UTF-8 sequences on the command line. - - Closes #1488 - -Daniel Stenberg (20 May 2017) -- ssh: ignore timeouts during disconnect - - ... as otherwise it risks not cleaning up the libssh2 handle properly - which leads to memory leak! - - Assisted-by: Joel Depooter - - Closes #1495 - Closes #1479 - - Bug: https://curl.haxx.se/mail/lib-2017-04/0024.html - -- ghiper.c/hiperfifo.c: add comment about missing timer functionality - - It takes someone to read up on the APIs of these libraries to figure out - how to do this correctly. - - Reported-by: Michael Kaufmann - - Closes #1253 - -- asiohiper.cpp / evhiperfifo.c: deal with negative timerfunction input - - That means delete the timer. - - Reported-by: Michael Kaufmann - Ref: #1253 - -- cmdline-opts/write-out.d: s/-L/--location - - Since the man page generator wants the long option name version to - generate the proper output. - -- [Bernhard M. Wiedemann brought this change] - - mkhelp.pl: do not add current time into curl binary - - ... as part of hugehelpgz rodata to make build reproducible. - - See https://reproducible-builds.org/ for why this is good - - Closes #1490 - -- oauth2-bearer.d: mention the argument - -Nick Zitzmann (16 May 2017) -- darwinssl: Fix exception when processing a client-side certificate file - if no error was raised by the API but the SecIdentityRef was null - - Fixes #1450 - -Daniel Stenberg (16 May 2017) -- curl_sasl: fix build error with CURL_DISABLE_CRYPTO_AUTH + USE_NTLM - - Reported-by: wyattoday at github - Fixes #1487 - -- docs/cmdline-opts/config.d: edit for language - -- RELEASE-NOTES: synced with eb16305e6 - -- [moparisthebest brought this change] - - SecureTransport/DarwinSSL: Implement public key pinning - - Closes #1400 - -- man pages: fix example syntax errors - - follow-up to 5ddad099b42b50 - -- docs/libcurl/opts: added more examples in man pages - -- CURLOPT_HTTPPROXYTUNNEL: clarify, add example - -- curl: show the libcurl release date in --version output - - ... and support and additional "security patched" date for those who - enhance older versions that way. Pass on the define CURL_PATCHSTAMP with - a date for that. - - Building with non-release headers shows the date as [unreleased]. - - Also: this changes the date format generated in the curlver.h file to be - "YYYY-MM-DD" (no name of the day or month, no time, no time zone) to - make it easier on the eye and easier to parse. Example (new) date - string: 2017-05-09 - - Suggested-by: Brian Childs - - Closes #1474 - -Dan Fandrich (13 May 2017) -- url.c: add a compile-time check that CURL_MAX_WRITE_SIZE is large enough - - Some code (e.g. Curl_fillreadbuffer) assumes that this buffer is not - exceedingly tiny and will break if it is. This same check is already - done at run time in the CURLOPT_BUFFERSIZE option. - -- lib510: don't write past the end of the buffer if it's too small - -- tests: added missing keywords "chunked Transfer-Encoding" - -Daniel Stenberg (13 May 2017) -- THANKS: add a few missing names - - ... I found them in the commit logs from the early years - -Dan Fandrich (13 May 2017) -- tests: made a couple of prechecks consistent with others - - Also removed a TODO suggesting caching the precheck results. Tests - showed this would save about 0.1 sec on the total test run time on a - relatively modern system, an unnoticeable gain at the cost of longer and - more complicated code. There would also be a danger that a cached test - result would be inappropriately returned, such as when other test - dependencies (like environment variables) are different or when the - precheck causes side effects (like filesystem changes). - -Daniel Stenberg (12 May 2017) -- FAQ: add 7.4 to toc - - ... and delete trailing whitespace - - Fixes #1484 - -- multi: remove leftover debug infof() calls from e9fd794a6 - -- pipeline: fix mistakenly trying to pipeline POSTs - - The function IsPipeliningPossible() would return TRUE if either - pipelining OR HTTP/2 were possible on a connection, which would lead to - it returning TRUE even for POSTs on HTTP/1 connections. - - It now returns a bitmask so that the caller can differentiate which kind - the connection allows. - - Fixes #1481 - Closes #1483 - Reported-by: stootill at github - -Jay Satiro (12 May 2017) -- [Ron Eldor brought this change] - - mbedtls: Support server renegotiation request - - Tested with servers: IIS 7.5; OpenSSL 1.0.2. - - Closes https://github.com/curl/curl/pull/1475 - -Marcel Raad (11 May 2017) -- cookie_interface: fix -Wcomma warning - - clang 5.0 complains: - possible misuse of comma operator here [-Wcomma] - -- formdata: fix -Wcomma warning - - clang 5.0 complains: - possible misuse of comma operator here [-Wcomma] - - Change the comma to a semicolon to fix that. - -Daniel Stenberg (10 May 2017) -- multi: use a fixed array of timers instead of malloc - - ... since the total amount is low this is faster, easier and reduces - memory overhead. - - Also, Curl_expire_done() can now mark an expire timeout as done so that - it never times out. - - Closes #1472 - -- multi: assign IDs to all timers and make each timer singleton - - A) reduces the timeout lists drastically - - B) prevents a lot of superfluous loops for timers that expires "in vain" - when it has actually already been extended to fire later on - -- [Richard Hsu brought this change] - - tests: remove superfluous test 1399 - - @MarcelRaad noted that `test1399` causes infinite loop on MinGW. - Looking into this, seems like it is related to how Windows handles - CRLF. See https://github.com/curl/curl/commit/9e093f by @mback2k. - Removing `test1399` as it's identical to `test1326` then with such a - fix. - - Test 1399 was broughy by commit 862b02f8947039e - - Closes #1478 - -Dan Fandrich (9 May 2017) -- tests: make test file names more unique - - Include the test number in the names of files written out by tests to - reduce the chance of accidental duplication and to make it more clear - which test is associated with which file. - -- tests: removed redundant --trace-ascii arguments - - This is already added by the test suite; it's not clear why all these - tests had it, unless it's cargo-culting. - -Marcel Raad (9 May 2017) -- tool: fix remaining -Wcast-qual warnings - - Avoid casting away low-level const. - -Daniel Stenberg (9 May 2017) -- formboundary: convert assert into run-time check - - ... to really make sure the boundary fits in the target buffer. - - Fixes unused parameter 'buflen' warning. - - Reported-by: Michael Kaufmann - Bug: https://github.com/curl/curl/pull/1468#issuecomment-300078754 - -Dan Fandrich (9 May 2017) -- tests: list the primary server first in the server section - -Daniel Stenberg (8 May 2017) -- curl: generate the --help output - - ... using the docs/cmdline-opts/gen.pl script, so that we get all the - command line option documentation from the same source. - - The generation of the list has to be done manually and pasted into the - source code. - - Closes #1465 - -- tests: updated for modified fake random - -- [Jay Satiro brought this change] - - rand: treat fake entropy the same regardless of endianness - - When the random seed is purposely made predictable for testing purposes - by using the CURL_ENTROPY environment variable, process that data in an - endian agnostic way so the the initial random seed is the same - regardless of endianness. - - - Change Curl_rand to write to a char array instead of int array. - - - Add Curl_rand_hex to write random hex characters to a buffer. - - Fixes #1315 - Closes #1468 - - Co-authored-by: Daniel Stenberg - Reported-by: Michael Kaufmann - -Dan Fandrich (8 May 2017) -- tests: give each stunnel.conf file a unique name - - Otherwise, subsequent uses of stunnel overwrite the configuration file - of previous invocations so they can no longer be inspected. - -Marcel Raad (8 May 2017) -- tool_msgs: remove wrong cast - - Commit 481e0de00a9003b9c5220b120e3fc302d9b0932d changed the variable - type from int to size_t, so don't cast the result of strlen to int - anymore. - -- tftpd: fix signed/unsigned mismatch warnings - - alarm's argument is unsigned. - -- libtest: fix MinGW-w64 warnings - - long is 32 bits while size_t is 64 bits on MinGW-w64, so - typecheck-gcc.h complains when using size_t for a long option. - Also, curl_socket_t is unsigned long long rather than int. - -Daniel Stenberg (8 May 2017) -- curl.1: depend the build on the Makefile.inc too - - ... to also make it update when we remove files, like we did for - --environment in commit a8e388dd1095. - -- RELEASE-NOTES: synced with e3f84efc32d6b01a - -- runtests: fix "use of undefined value" warning in -R handling - -Marcel Raad (8 May 2017) -- test537: use correct variable type - - Avoids narrowing conversion warnings because rlim_t is usually - unsigned long. - - Closes https://github.com/curl/curl/pull/1469 - -- sendrecv: fix MinGW-w64 warning - - The first argument to select is an int, while curl_socket_t is - unsigned long long when using WinSock. It's ignored anyway [1]. - - [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms740141.aspx - -- tool_parsecfg: fix -Wcast-qual warning - - Don't convert string literal to char * before assigning it to - const char *. - -- asyn-thread: fix unused macro warnings - - Don't do anything in this file if CURLRES_THREADED is not defined. - -- tftp: silence bad-function-cast warning - - The cases this warns about are handled elsewhere, so just use an - intermediate variable to silence the warning. - -Daniel Stenberg (7 May 2017) -- [canavan at github brought this change] - - buildconf: fix hang on IRIX - - Apparently, /usr/bin/m4 ignores the --version parameter and waits for - input from stdin. - - Fixes #1471 - -- opts: fix bad example formatting \n => \\n - - ...to render properly nroff. - -- opts: examples added to 8 more libcurl option man pages - -- curl: remove tool_writeenv.[ch] - - ... and USE_ENVIRONMENT and --environment. It was once added for RISC OS - support and its platform specific behavior has been annoying ever - since. Added in commit c3c8bbd3b2688da8e, mostly unchanged since - then. Most probably not actually used for years. - - Closes #1463 - -Dan Fandrich (6 May 2017) -- runtests.pl: simplify the datacheck read section - - Also, document that numbered datacheck sections are possible. - -Marcel Raad (5 May 2017) -- tests: fix -Wcast-qual warnings - - Avoid casting string literals to non-const char *. - -Daniel Stenberg (5 May 2017) -- docs/opts: 24 more man pages now have examples - -- docs/opts: 23 more man pages now have examples - -- tests/server: run checksrc by default in debug-builds - -- curl_slist_append.3: clarify a NULL input creates a new list - -Marcel Raad (5 May 2017) -- unit1305: fix compiler warning - - calloc and ai_addrlen expect different (usually unsigned) types. - -Daniel Stenberg (5 May 2017) -- runtests: use -R for random order - - Suggested-by: Dan Fandrich - -- runtests: add -o to run test cases in scrambled order - - ... instead of numerical order. - - Closes #1466 - -Dan Fandrich (4 May 2017) -- sockfilt.c: shortened too long line - -Marcel Raad (4 May 2017) -- tests/server: make string literals const - - assign string literals to const char * instead of char * in order to - avoid a lot of these warnings: - cast from 'const char *' to 'char *' drops const qualifier - [-Wcast-qual] - -Dan Fandrich (4 May 2017) -- schannel: return a more specific error code for SEC_E_UNTRUSTED_ROOT - -- test557: set a known good numeric locale - - Windows does not allow setting the locale with environment variables (as - the test attempted to do), so the test failed when run with a user - locale that has a comma as radixchar. Changed the test to call - setlocale() explicitly to ensure that a known working locale is set even - on Windows. - -Daniel Stenberg (4 May 2017) -- curl: fix warning "comma at end of enumerator list" - -- test559: verify use of minimum CURLOPT_BUFFERSIZE - -Marcel Raad (4 May 2017) -- curl_setup_once: use SEND_QUAL_ARG2 for swrite - - SEND_QUAL_ARG2 had to be set, but was never used. Use it in swrite to - avoid warnings about casting away low-level const. - - Closes https://github.com/curl/curl/pull/1464 - -Daniel Stenberg (4 May 2017) -- CURLINFO_REDIRECT_URL.3: add example - -- CURLINFO_EFFECTIVE_URL.3: add example - -Marcel Raad (3 May 2017) -- lib: fix compiler warnings - - Fix the following warnings when building the tests by using the correct - types: - cast from 'const char *' to 'void *' drops const qualifier - [-Wcast-qual] - implicit conversion changes signedness [-Wsign-conversion] - -- typecheck-gcc: add support for CURLINFO_SOCKET - - Closes https://github.com/curl/curl/pull/1452 - -- typecheck-gcc: add missing string options - - Closes https://github.com/curl/curl/pull/1452 - -Daniel Stenberg (3 May 2017) -- abstract-unix-socket.d: shorten the help text to fit within 79 cols - -- RELEASE-NOTES: synced with 862b02f89 - -- [Richard Hsu brought this change] - - Telnet: Write full buffer instead of byte-by-byte - - Previous TODO wanting to write in chunks. We should support writing more - at once since some TELNET servers may respond immediately upon first - byte written such as WHOIS servers. - - Closes #1389 - -- curl: non-boolean command line args reject --no- prefixes - - ... and instead properly respond with an error message to the user - instead of silently ignoring. - - Fixes #1453 - Closes #1458 - -Marcel Raad (2 May 2017) -- testpart: remove _MPRINTF_REPLACE - - Support for _MPRINTF_REPLACE in mprintf.h was removed in - 55452ebdff47f98bf3cc383f1dfc3623fcaefefd, replaced with curl_printf.h. - -Dan Fandrich (2 May 2017) -- gtls: fixed a lingering BUFSIZE reference - -Daniel Stenberg (2 May 2017) -- ssh: fix compiler warning from e40e9d7f0de - -- url: let CURLOPT_BUFFERSIZE realloc to smaller sizes too - - Closes #1449 - -- BUFSIZE: rename to READBUFFER_*, make separate MASTERBUF_SIZE - -- openssl: use local stack for temp storage - -- sendf: remove use of BUFSIZE from debug data conversions - - The buffer can have other sizes. - -- buffer: use data->set.buffer_size instead of BUFSIZE - - ... to properly use the dynamically set buffer size! - -- krb5: use private buffer for temp string, not receive buffer - -- upload: UPLOAD_BUFSIZE is now for the upload buffer - -- unit1606: do not print/access buffer - - It was a wrong assumption that it could do that! - -- http-proxy: use a dedicated CONNECT response buffer - - To make it suitably independent of the receive buffer and its flexible - size. - -- transfer: fix minor buffer_size mistake - -- failf: use private buffer, don't clobber receive buffer - -- pingpong: use the set buffer size - -- http2: use the correct set buffer size - -- http: don't clobber the receive buffer for timecond - -- buffer_size: make sure it always has the correct size - - Removes the need for CURL_BUFSIZE - -- file: use private buffer for C-L output - - ... instead of clobbering the download buffer. - -- CURLOPT_BUFFERSIZE: 1024 bytes is now the minimum size - - The buffer is needed to receive FTP, HTTP CONNECT responses etc so - already at this size things risk breaking and smaller is certainly not - wise. - -- ftp: use private buffer for temp storage, not receive buffer - -- http: use private user:password output buffer - - Don't clobber the receive buffer. - -Marcel Raad (1 May 2017) -- anyauthput: remove unused code - - The definition of TRUE was introduced in - 4a728747e6f8845e500910e397dfc99aaf4a7984 and is not used anymore since - e664cd5826d43930fcc5b5dbaedbec94af33184b. - The usage of intptr_t was removed in - 32e38b8f42477cf5ce3c3fef2fcc9db82f7fb7be. - -Jay Satiro (1 May 2017) -- tool: Fix missing prototype warnings for CURL_DOES_CONVERSIONS - - - Include tool_convert.h where needed. - - Bug: https://github.com/curl/curl/issues/1460 - Reported-by: Gisle Vanem - -- curl_setup: Ensure no more than one IDN lib is enabled - - Prior to this change it was possible for libcurl to be built with both - Windows' native IDN lib (normaliz) and libidn2 enabled. It appears that - doesn't offer any benefit --and could cause a bug-- since libcurl's IDN - handling is written to use either one but not both. - - Bug: https://github.com/curl/curl/issues/1441#issuecomment-297689856 - Reported-by: Gisle Vanem - -Marcel Raad (1 May 2017) -- getpart: use correct variable type - - This fixes the following clang warning: - getpart.c:201:17: warning: cast from function call of type 'CURLcode' - to non-matching type 'int' [-Wbad-function-cast] - -- tests: declare TU-local variables static - - This fixes missing-variable-declarations warnings when building with - clang. - -- tool_cb_prg: fix double-promotion warning - - clang complains: - tool_cb_prg.c:86:22: error: implicit conversion increases - floating-point precision: 'float' to 'double' - [-Werror,-Wdouble-promotion] - - Fix this by using a double instead of a float constant. - -Dan Fandrich (1 May 2017) -- examples: fixed too long line and too long string warnings - -Marcel Raad (30 Apr 2017) -- examples: declare TU-local variables static - - This fixes missing-variable-declarations warnings when building with - clang. - -- http2: declare TU-local variables static - - This fixes the following clang warnings: - - http2.c:184:27: error: no previous extern declaration for non-static - variable 'Curl_handler_http2' [-Werror,-Wmissing-variable-declarations] - http2.c:204:27: error: no previous extern declaration for non-static - variable 'Curl_handler_http2_ssl' - [-Werror,-Wmissing-variable-declarations] - -Dan Fandrich (30 Apr 2017) -- unit1604: fixed indentation - -- unit1604: fixed compilation under Windows, broken in the previous commit - -- tests: fixed OOM handling of unit tests to abort test - - It's dangerous to continue to run the test when a memory alloc fails. - -Marcel Raad (29 Apr 2017) -- curl_rtmp: fix missing-variable-declarations warnings - - clang complains: - - curl_rtmp.c:61:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmp' [-Werror,-Wmissing-variable-declarations] - curl_rtmp.c:81:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpt' [-Werror,-Wmissing-variable-declarations] - curl_rtmp.c:101:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpe' [-Werror,-Wmissing-variable-declarations] - curl_rtmp.c:121:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpte' [-Werror,-Wmissing-variable-declarations] - curl_rtmp.c:141:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmps' [-Werror,-Wmissing-variable-declarations] - curl_rtmp.c:161:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpts' [-Werror,-Wmissing-variable-declarations] - - Fix this by including the header file. - -Dan Fandrich (29 Apr 2017) -- url: fixed a memory leak on OOM while setting CURLOPT_BUFFERSIZE - -- tests: added --remote-time tests for remaining protocols that support it - -- runtests.pl: support multiline commands - -- tool_operate: use utimes instead of obsolescent utime when available - -- test1443: test --remote-time - -- http-proxy: removed unused argument in CURL_DISABLE_PROXY case - - Missed in commit 55c3c02e - -Daniel Stenberg (27 Apr 2017) -- cookie_interface.c: changed the other domain to example.com too - -- cookie_interface.c: fix cookie domain so the example works - -Dan Fandrich (26 Apr 2017) -- Makefile: fix make dist - - Commit 80a87e8a broke 'make dist' as it can't handle installing from - absolute target names. Rearranged the dependencies so the absolute name - is used for building but the relative name is use for distributing. - -Marcel Raad (26 Apr 2017) -- lib: remove unused code - - This fixes the following clang warnings: - macro is not used [-Wunused-macros] - will never be executed [-Wunreachable-code] - - Closes https://github.com/curl/curl/pull/1448 - -Daniel Stenberg (26 Apr 2017) -- http-proxy: remove unused argument from Curl_proxyCONNECT() - -- [Martin Kepplinger brought this change] - - url: declare get_protocol_family() static - - get_protocol_family() is not defined static even though there is a - static local forward declaration. Let's simply make the definition match - it's declaration. - - Bug: https://curl.haxx.se/mail/lib-2017-04/0127.html - -- examples: ftpuploadfrommem.c - - Uploads data to an FTP site, directly from memory. - - Closes #1451 - -Kamil Dudka (25 Apr 2017) -- nss: load libnssckbi.so if no other trust is specified - - The module contains a more comprehensive set of trust information than - supported by nss-pem, because libnssckbi.so also includes information - about distrusted certificates. - - Reviewed-by: Kai Engert - Closes #1414 - -- nss: factorize out nss_{un,}load_module to separate fncs - - No change of behavior is intended by this commit. - -- nss: do not leak PKCS #11 slot while loading a key - - It could prevent nss-pem from being unloaded later on. - - Bug: https://bugzilla.redhat.com/1444860 - -Marcel Raad (25 Apr 2017) -- typecheck-gcc: fix _curl_is_slist_info - - Info values starting with CURLINFO_SOCKET expect a curl_socket_t, not a - curl_slist argument. - - This fixes the following GCC warning when building the examples with - --enable-optimize: - - ../../include/curl/typecheck-gcc.h:126:42: warning: call to - ‘_curl_easy_getinfo_err_curl_slist’ declared with attribute warning: - curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this - info [enabled by default] - sendrecv.c:90:11: note: in expansion of macro ‘curl_easy_getinfo’ - res = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd); - - Closes https://github.com/curl/curl/pull/1447 - -Daniel Stenberg (25 Apr 2017) -- curl: set a 100K buffer size by default - - Test command 'time curl http://localhost/80GB -so /dev/null' on a Debian - Linux. - - Before (middle performing run out 9): - - real 0m28.078s - user 0m11.240s - sys 0m12.876s - - After (middle performing run out 9) - - real 0m26.356s (93.9%) - user 0m5.324s (47.4%) - sys 0m8.368s (65.0%) - - Also, doing SFTP over a 200 millsecond latency link is now about 6 times - faster. - - Closes #1446 - -- transfer: remove 'uploadbuf' pointer and cleanup readwrite_upload() - - The data->req.uploadbuf struct member served no good purpose, instead we - use ->state.uploadbuffer directly. It makes it clearer in the code which - buffer that's being used. - - Removed the 'SingleRequest *' argument from the readwrite_upload() proto - as it can be derived from the Curl_easy struct. Also made the code in - the readwrite_upload() function use the 'k->' shortcut to all references - to struct fields in 'data->req', which previously was made with a mix of - both. - -Jay Satiro (25 Apr 2017) -- configure: stop prepending to LDFLAGS, CPPFLAGS - - - Change prepends to appends because user's LDFLAGS and CPPFLAGS should - always come first so they're searched before ours. - - Bug: https://github.com/curl/curl/issues/1420 - Reported-by: Helmut K. C. Tessarek - -Marcel Raad (25 Apr 2017) -- if2ip: fix -Wcast-align warning - - Follow-up to 119037325de02579f5c58256ca2ed2a0aa592c86, which fixed the - warning in the HAVE_GETIFADDRS block, but not in the - HAVE_IOCTL_SIOCGIFADDR block. - -Dan Fandrich (24 Apr 2017) -- Makefile: avoid use of GNU-specific form of $< - - $< is only allowed in implicit rules in some non-GNU makes (e.g. BSD, - AIX) so avoid use elsewhere by referencing the dependent curl.1 file - directly instead. This is somewhat tricky because the file is supplied - in the packaged tar ball (but not in git) but must still be able to be - rebuilt when its dependencies change. The right thing must happen in - both tar ball and git source trees, as well as in both in-tree and - out-of-tree builds. - -Kamil Dudka (24 Apr 2017) -- nss: adapt to the new Curl_llist API - - This commit fixes compilation failure caused by - cbae73e1dd95946597ea74ccb580c30f78e3fa73. - -Marcel Raad (24 Apr 2017) -- curl-compilers.m4: accept -Og and -Ofast GCC flags - - -Og, introduced in GCC 4.8, optimizes for debugging experience. - -Ofast, introduced in GCC 4.7, builds on -O3 and enables further - optimizations breaking strict standards compliance. - When specified in CFLAGS, these were always overridden by -O0 or -O2. - Fix this by adding them to flags_opt_all. - - Ref: https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html - Ref: https://github.com/curl/curl/pull/1404#issuecomment-296401570 - Closes https://github.com/curl/curl/pull/1440 - -Daniel Stenberg (24 Apr 2017) -- RELEASE-NOTES: synced with c68fed875 - -- configure: fix the -ldl check for openssl, add -lpthread check - - The check for if -ldl is needed to build with (a statically built) - openssl was broken. This repairs the check, and adds a check for - -lpthread as well since OpenSSL 1.1.0+ does in fact require -lpthread so - only adding -ldl for a static openssl build is no longer enough. - - Reported-by: Jay Satiro - Ref: #1426 - Closes #1427 - -- llist: fix a comment after cbae73e1dd9 - - Pointed-it-by: Kevin Ji - URL: https://github.com/curl/curl/commit/cbae73e1dd95946597ea74ccb580c30f78e3fa73#commitcomment-21872622 - -Jay Satiro (22 Apr 2017) -- schannel: Don't treat encrypted partial record as pending data - - - Track when the cached encrypted data contains only a partial record - that can't be decrypted without more data (SEC_E_INCOMPLETE_MESSAGE). - - - Change Curl_schannel_data_pending to return false in such a case. - - Other SSL libraries have pending data functions that behave similarly. - - Ref: https://github.com/curl/curl/pull/1387 - - Closes https://github.com/curl/curl/pull/1392 - -Daniel Stenberg (22 Apr 2017) -- [Alan Jenkins brought this change] - - multi: clarify condition in curl_multi_wait - - `if(nfds || extra_nfds) {` is followed by `malloc(nfds * ...)`. - - If `extra_fs` could be non-zero when `nfds` was zero, then we have - `malloc(0)` which is allowed to return `NULL`. But, malloc returning - NULL can be confusing. In this code, the next line would treat the NULL - as an allocation failure. - - It turns out, if `nfds` is zero then `extra_nfds` must also be zero. - The final value of `nfds` includes `extra_nfds`. So the test for - `extra_nfds` is redundant. It can only confuse the reader. - - Closes #1439 - -Marcel Raad (22 Apr 2017) -- lib: fix maybe-uninitialized warnings - - With -Og, GCC complains: - - easy.c:628:7: error: ‘mcode’ may be used uninitialized in this function [-Werror=maybe-uninitialized] - - ../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] - vauth/digest.c:208:9: note: ‘tok_buf’ was declared here - - ../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] - vauth/digest.c:566:15: note: ‘tok_buf’ was declared here - - Fix this by initializing the variables. - -Dan Fandrich (22 Apr 2017) -- gnutls: removed some code when --disable-verbose is configured - - This reduces the binary size and fixes a compile warning. - -Daniel Stenberg (22 Apr 2017) -- llist: no longer uses malloc - - The 'list element' struct now has to be within the data that is being - added to the list. Removes 16.6% (tiny) mallocs from a simple HTTP - transfer. (96 => 80) - - Also removed return codes since the llist functions can't fail now. - - Test 1300 updated accordingly. - - Closes #1435 - -Marcel Raad (21 Apr 2017) -- typecheck-gcc: handle function pointers properly - - All the callbacks passed to curl_easy_setopt are defined as function - pointers. The possibility to pass both functions and function pointers - was handled for the callbacks that typecheck-gcc.h defined as - compatible, but not for the public callback types themselves. - - This makes all compatible callback types defined in typecheck-gcc.h - function pointers too and checks all functions uniformly with - _curl_callback_compatible, which handles both functions and function - pointers. - - A symptom of the problem was a warning in tool_operate.c with - --disable-libcurl-option and without --enable-debug as that file - passes the callback functions to curl_easy_setopt directly. - - Fixes https://github.com/curl/curl/issues/1403 - Closes https://github.com/curl/curl/pull/1404 - -Dan Fandrich (21 Apr 2017) -- mbedtls: enable NTLM (& SMB) even if MD4 support is unavailable - - In that case, use libcurl's internal MD4 routine. This fixes tests 1013 - and 1014 which were failing due to configure assuming NTLM and SMB were - always available whenever mbed TLS was in use (which is now true). - -Daniel Stenberg (21 Apr 2017) -- tests: remove the html and PDF versions from the tarball - -- openssl: fix memory leak in servercert - - ... when failing to get the server certificate. - -- Revert "src/Makefile.am: avoid explicit $<" - - This reverts commit 5b4cbcf11d5100ff793a8e9edbaa6fe1fc7495f5. - - Since it broke out-of-tree builds from tarballs. See discussion in #1432 - -- bump: start working on next release - -- src/Makefile.am: avoid explicit $< - - ... since apparently "BSD make" doesn't support it. - - Reported-by: Thomas Klausner - Fixes #1432 - -Version 7.54.0 (19 Apr 2017) - -Daniel Stenberg (19 Apr 2017) -- THANKS: add contributors from 7.54.0 release notes - -- RELEASE-NOTES: curl 7.54.0 - -Marcel Raad (18 Apr 2017) -- nss: fix MinGW compiler warnings - - This fixes 3 warnings issued by MinGW: - 1. PR_ImportTCPSocket actually has a paramter of type PROsfd instead of - PRInt32, which is 64 bits on Windows. Fixed this by including the - corresponding header file instead of redeclaring the function, which is - supported even though it is in the private include folder. [1] - 2. In 64-bit mode, size_t is 64 bits while CK_ULONG is 32 bits, so an explicit - narrowing cast is needed. - 3. Curl_timeleft returns time_t instead of long since commit - 21aa32d30dbf319f2d336e0cb68d3a3235869fbb. - - [1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ImportTCPSocket - - Closes https://github.com/curl/curl/pull/1393 - -Daniel Stenberg (18 Apr 2017) -- [Jay Satiro brought this change] - - TLS: Fix switching off SSL session id when client cert is used - - Move the sessionid flag to ssl_primary_config so that ssl and proxy_ssl - will each have their own sessionid flag. - - Regression since HTTPS-Proxy support was added in cb4e2be. Prior to that - this issue had been fixed in 247d890, CVE-2016-5419. - - Bug: https://github.com/curl/curl/issues/1341 - Reported-by: lijian996@users.noreply.github.com - - The new incarnation of this bug is called CVE-2017-7468 and is documented - here: https://curl.haxx.se/docs/adv_20170419.html - -- [David Benjamin brought this change] - - openssl: don't try to print nonexistant peer private keys - - X.509 certificates carry public keys, not private keys. Fields - corresponding to the private half of the key will always be NULL. - - Closes #1425 - -- [David Benjamin brought this change] - - openssl: fix thread-safety bugs in error-handling - - ERR_error_string with NULL parameter is not thread-safe. The library - writes the string into some static buffer. Two threads doing this at - once may clobber each other and run into problems. Switch to - ERR_error_string_n which avoids this problem and is explicitly - bounds-checked. - - Also clean up some remnants of OpenSSL 0.9.5 around here. A number of - comments (fixed buffer size, explaining that ERR_error_string_n was - added in a particular version) date to when ossl_strerror tried to - support pre-ERR_error_string_n OpenSSLs. - - Closes #1424 - -- [David Benjamin brought this change] - - openssl: make SSL_ERROR_to_str more future-proof - - Rather than making assumptions about the values, use a switch-case. - - Closes #1424 - -- [Daniel Gustafsson brought this change] - - code: fix typos and style in comments - - A few random typos, and minor whitespace cleanups, found in comments - while reading code. - - Closes #1423 - -Marcel Raad (17 Apr 2017) -- extern-scan.pl: strip trailing CR - - This makes test 1135 pass with CRLF checkouts. - - Ref: https://github.com/curl/curl/pull/1344#issuecomment-289243166 - Closes https://github.com/curl/curl/pull/1422 - -- configure.ac: ignore CR after version numbers - - Ignore everything after the version numbers in LIBCURL_VERSION and - LIBCURL_VERSION_NUM to ged rid of the extra CR character. - This makes tests 1022 and 1023 pass on Linux with a CRLF checkout. - - Ref: https://github.com/curl/curl/pull/1344#issuecomment-289243166 - Closes https://github.com/curl/curl/pull/1422 - -- .gitattributes: force shell scripts to LF - - Bash on Linux errors out on CR characters. - This makes tests 1221 and 1222 pass on Linux with a CRLF checkout. - - Ref: https://github.com/curl/curl/pull/1344#issuecomment-289243166 - Closes https://github.com/curl/curl/pull/1422 - -- unit1303: fix compiler warning - - MinGW-w64 complains: - warning: conversion to 'long int' from 'time_t {aka long long int}' may - alter its value [-Wconversion] - Fix this by using the correct type. - -Daniel Stenberg (16 Apr 2017) -- RELEASE-NOTES: synced with 1451271e0 - -- [Larry Stefani brought this change] - - http2: fix handle leak in error path - - Add missing newhandle free call in push_promise(). - - Closes #1416 - -- [Larry Stefani brought this change] - - mbedtls: fix memory leak in error path - - Add missing our_ssl_sessionid free call in mbed_connect_step3(). - - Closes #1417 - -Marcel Raad (15 Apr 2017) -- curl-compilers.m4: turn implicit function declarations into errors - - This adds -Werror-implicit-function-declaration for GCC 2.95+ so that - these errors are visible at the point where they occur instead of only - at link time. - Implicit function declarations are illegal in C99 and C++ anyway, and - the same warning has been turned into an error for ICC in commit - 3072c5b8a127057aa922b7c51051bbb4a630b091. - - Ref: https://gcc.gnu.org/onlinedocs/gcc-2.95.2/gcc_2.html#SEC8 - Ref: https://curl.haxx.se/mail/lib-2017-04/0001.html - Closes https://github.com/curl/curl/pull/1419 - -- test1541: also test for CURL_PULL_WS2TCPIP_H - - Ref: https://github.com/curl/curl/issues/1408 - Closes https://github.com/curl/curl/pull/1412 - -- tests/server/util: prefer over - - Follow-up to aa573c3c55cda72ec5ef677d87f6f46a53385f0c - - Ref: https://github.com/curl/curl/pull/1406 - -Daniel Stenberg (11 Apr 2017) -- Curl_expire_latest: ignore already expired timers - - If the existing timer is still in there but has expired, the new timer - should be added. - - Reported-by: Rainer Canavan - Bug: https://curl.haxx.se/mail/lib-2017-04/0030.html - Closes #1407 - -- system.h: fix mingw section - - Reported-by: Marcel Raad - Fixes #1408 - Closes #1409 - -Marcel Raad (11 Apr 2017) -- polarssl: unbreak build with versions < 1.3.8 - - ssl_session_init was only introduced in version 1.3.8, the penultimate - version. The function only contains a memset, so replace it with that. - - Suggested-by: Jay Satiro - Fixes https://github.com/curl/curl/issues/1401 - -- poll: prefer over - - The POSIX standard location is . Using results in - warning spam when using the musl standard library. - - Closes https://github.com/curl/curl/pull/1406 - -Daniel Stenberg (10 Apr 2017) -- [Alexis La Goutte brought this change] - - openssl: fix this statement may fall through [-Wimplicit-fallthrough=] - - Closes #1402 - -Kamil Dudka (10 Apr 2017) -- nss: load CA certificates even with --insecure - - ... because they may include an intermediate certificate for a client - certificate and the intermediate certificate needs to be presented to - the server, no matter if we verify the peer or not. - - Reported-by: thraidh - Closes #851 - -Daniel Stenberg (10 Apr 2017) -- RELEASE-NOTES: synced with f9d1e9a27f7e1 - -Dan Fandrich (10 Apr 2017) -- libcurl-thread.3: fixed a bad macro that caused test 1140 to fail - -Daniel Stenberg (9 Apr 2017) -- libcurl-thread.3: also mention threaded-resolver - - Reported-by: Alex Bligh - Bug: https://curl.haxx.se/mail/lib-2017-04/0044.html - -- .github/stale.yml: enable the stale bot - - Issues and PRs with no activity for 180 days will get marked as stale, - and if no further activity happens within 14 more days, the issue gets - closed. - - This follows our established policy of not letting stalled bugs "get in - the way": https://curl.haxx.se/docs/bugs.html#Closing_off_stalled_bugs - - Closes #1398 - -Jay Satiro (8 Apr 2017) -- CURLINFO_SCHEME.3: fix variable type - - - Change documented param type to char ** from incorrect long *. - -Marcel Raad (8 Apr 2017) -- INSTALL.md: fix secure transport configure arguments - - --without-ssl is needed instead of --with-winssl. - -- vtls: fix unreferenced variable warnings - - ... by moving the variables into the correct #ifdef block. - -Daniel Stenberg (7 Apr 2017) -- BUGS: "Bugs in old versions" - -- system.h: add section for tcc - - Closes #1397 - -Marcel Raad (7 Apr 2017) -- schannel: fix compiler warnings - - When UNICODE is not defined, the Curl_convert_UTF8_to_tchar macro maps - directly to its argument. As it is declared as a pointer to const and - InitializeSecurityContext expects a pointer to non-const, both MSVC and MinGW - issue a warning about implicitly casting away the const. Fix this by declaring - the variables as pointers to non-const. - - Closes https://github.com/curl/curl/pull/1394 - -- [Isaac Boukris brought this change] - - sspi: print out InitializeSecurityContext() error message - - Reported-by: Carsten (talksinmath) - - Fixes #1384 - Closes #1395 - -- gtls: fix compiler warning - - Curl_timeleft returns time_t instead of long since commit - 21aa32d30dbf319f2d336e0cb68d3a3235869fbb. - -Daniel Stenberg (6 Apr 2017) -- test1606: verify speedcheck - -- low_speed_limit: improved function for longer time periods - - Previously, periods of fast speed between periods of slow speed would - not count and could still erroneously trigger a timeout. - - Reported-by: Paul Harris - Fixes #1345 - Closes #1390 - -- system.h: set sizeof long to 4 on "default 32 bit" systems - - Triggered a test failure on test 1541 for the build known as - "Linux 4.4 i686 tcc 0.9.26 glibc 2.20" - -Marcel Raad (6 Apr 2017) -- nss: fix build after e60fe20fdf94e829ba5fce33f7a9d6c281149f7d - - Curl_llist_alloc is now Curl_llist_init. - - Closes https://github.com/curl/curl/pull/1391 - -Daniel Stenberg (6 Apr 2017) -- INSTALL.cmake: more problems - - and mention specific issues where they are discussed - -- test1541: ignore the curl_off_t variable type name comparison - - ... the sizes and the formatting strings are what's really important and - avoids problems with int64_t vs "long long". - - Bug: https://curl.haxx.se/mail/lib-2017-04/0019.html - -- Revert "configure: prefer 'long long' to int64_t for curl_off_t" - - This reverts commit 81284374bf3c670d2050f8562edeb69f060b07cc. - - Due to mingw32 brekage. - -Marcel Raad (5 Apr 2017) -- tool_operate: fix MinGW compiler warning - - MinGW complains: - tool_operate.c:197:15: error: comparison is always true due to limited range - of data type [-Werror=type-limits] - - Fix this by only doing the comparison if 'long' is large enough to hold the - constant it is compared with. - - Closes https://github.com/curl/curl/pull/1378 - -- tool_operate: move filetime code to its own function - - Ref: https://github.com/curl/curl/pull/1378 - -Daniel Stenberg (5 Apr 2017) -- configure: prefer 'long long' to int64_t for curl_off_t - - Since it is a native type and it makes it less complicated to find a - matching one in system.h - - Bug: https://curl.haxx.se/mail/lib-2017-04/0010.html - Reported-by: Dan Fandrich - - Closes #1388 - -- [Dániel Bakai brought this change] - - tests: added test for Curl_splaygetbest to unit1309 - - This checks the new behavior of Curl_splaygetbest, so that the smallest - node not larger than the key is removed, and FIFO behavior is kept even - when there are multiple nodes with the same key. - - Closes #1358 - -- [Dániel Bakai brought this change] - - multi: fix queueing of pending easy handles - - Multi handles repeatedly invert the queue of pending easy handles when - used with CURLMOPT_MAX_TOTAL_CONNECTIONS. This is caused by a multistep - process involving Curl_splaygetbest and violates the FIFO property of - the multi handle. - This patch fixes this issue by redefining the "best" node in the - context of timeouts as the "smallest not larger than now", and - implementing the necessary data structure modifications to do this - effectively, namely: - - splay nodes with the same key are now stored in a doubly-linked - circular list instead of a non-circular one to enable O(1) - insertion to the tail of the list - - Curl_splayinsert inserts nodes with the same key to the tail of - the same list - - in case of multiple nodes with the same key, the one on the head of - the list gets selected - -Marcel Raad (4 Apr 2017) -- tool: fix Windows Unicode build - - ... by explicitly calling the ANSI versions of Windows API functions where - required. - -Daniel Stenberg (4 Apr 2017) -- [Martin Kepplinger brought this change] - - curl_sasl: declare mechtable static - - struct mechtable is only used locally here. It can be declared static. - -Jay Satiro (4 Apr 2017) -- [Antti Hätälä brought this change] - - url: don't free postponed data on connection reuse - - - Don't free postponed data on a connection that will be reused since - doing so can cause data loss when pipelining. - - Only Windows builds are affected by this. - - Closes https://github.com/curl/curl/issues/1380 - -Daniel Stenberg (4 Apr 2017) -- RELEASE-NOTES: synced with 4f2e348f9b42c69c480 - -- hash: move key into hash struct to reduce mallocs - - This removes one tiny malloc for each hash struct allocated. In a simple - case like "curl localhost", this save three mallocs. - - Closes #1376 - -- llist: replace Curl_llist_alloc with Curl_llist_init - - No longer allocate the curl_llist head struct for lists separately. - - Removes 17 (15%) tiny allocations in a normal "curl localhost" invoke. - - closes #1381 - -Jay Satiro (4 Apr 2017) -- easy: silence compiler warning - - Safe to silence warning adding time delta of poll, which can trigger on - Windows since sizeof time_t > sizeof long. - - warning C4244: '+=' : conversion from 'time_t' to 'long', possible loss - of data - -Daniel Stenberg (4 Apr 2017) -- [Richlv brought this change] - - docs: minor typo in write-out.d - - Closes #1382 - -- include: curl/system.h is a run-time version of curlbuild.h - - system.h is aimed to replace curlbuild.h at a later point in time when - we feel confident system.h works sufficiently well. - - curl/system.h is currently used in parallel with curl/curlbuild.h - - curl/system.h determines a data sizes, data types and include file - status based on available preprocessor defines instead of getting - generated at build-time. This, in order to avoid relying on a build-time - generated file that makes it complicated to do 32 and 64 bit bields from - the same installed set of headers. - - Test 1541 verifies that system.h comes to the same conclusion that - curlbuild.h offers. - - Closes #1373 - -- multi: make curl_multi_wait avoid malloc in the typical case - - When only a few additional file descriptors are used, avoid the malloc. - - Closes #1377 - -Marcel Raad (3 Apr 2017) -- tests/server/util: remove in6addr_any for recent MinGW - - In ancient MinGW versions, in6addr_any was declared as extern, but not - defined. Because of that, 22a0c57746ae12506b1ba0f0fafffd26c1907d6a added - definitions for in6addr_any when compiling with MinGW. The bug was fixed in - w32api version 3.6 from 2006, so this workaround is not needed anymore for - recent versions. - - This fixes the following MinGW-w64 warnings because the MinGW-w64 version of - IN6ADDR_ANY_INIT has the two additional braces inside the macro: - util.c:59:14: warning: braces around scalar initializer - util.c:59:40: warning: excess elements in scalar initializer - - Ref: https://sourceforge.net/p/mingw/mingw-org-wsl/ci/e4803e0da25c57ae1ad0fa75ae2b7182ff7fa339/tree/w32api/ChangeLog - Closes https://github.com/curl/curl/pull/1379 - -Daniel Stenberg (3 Apr 2017) -- docs: added examples for CURLINFO_FILETIME.3 and CURLOPT_FILETIME.3 - -Jay Satiro (31 Mar 2017) -- fail-early.d: fix typos - -- docs: Explain --fail-early does not imply --fail - - Closes https://github.com/curl/curl/pull/1375 - -Daniel Stenberg (1 Apr 2017) -- telnet: (win32) fix read callback return variable - - telnet.c(1427,21): warning: comparison of constant 268435456 with - expression of type 'CURLcode' is always false - - telnet.c(1433,21): warning: comparison of constant 268435457 with - expression of type 'CURLcode' is always false - - Reviewed-by: Jay Satiro - Reported-by: Gisle Vanem - Bug: https://github.com/curl/curl/issues/1225#issuecomment-290340890 - - Closes #1374 - -- CTestConfig.cmake: removed, unused - -- libcurl.def: removed, unused - -- docs/index.html: removed, was not shipped anyway - -- dist: add missing files to the tarball - -Peter Wu (30 Mar 2017) -- cmake: fix build with cmake 2.8.12.2 - - For some reason, CMake 2.8.12.2 did not expand the list argument in a - single DEPENDS argument. Remove the quotes, so it gets expanded into - multiple arguments for add_custom_command and add_custom_target. - - Fixes https://github.com/curl/curl/issues/1370 - Closes #1372 - -Marcel Raad (30 Mar 2017) -- ssh: fix narrowing conversion warning - - 'left' is used as time_t but declared as long. - MinGW complains: - error: conversion to 'long int' from 'time_t {aka long long int}' may alter - its value [-Werror=conversion] - Changed the declaration to time_t. - -- http2: silence unused parameter warnings - - In release mode, MinGW complains: - error: unused parameter 'lib_error_code' [-Werror=unused-parameter] - -Daniel Stenberg (30 Mar 2017) -- [Hanno Böck brought this change] - - curl: fix callback functions to match prototype - - The function tool_debug_cb doesn't match curl_debug_callback in curl.h - (unsigned vs. signed char* for 3rd param). - - Bug: https://curl.haxx.se/mail/lib-2017-03/0120.html - -- [Alexis La Goutte brought this change] - - gcc7: fix ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] - - Closes #1371 - -Marcel Raad (30 Mar 2017) -- schannel: fix unused variable warning - - If CURL_DISABLE_VERBOSE_STRINGS is defined, hostname is not used in - schannel_connect_step3. - -- connect: fix unreferenced parameter warning - - When CURL_DISABLE_VERBOSE_STRINGS is defined, the reason parameter in - Curl_conncontrol is not used as the infof macro expands to nothing. - -- select: use correct SIZEOF_ constant - - At least under Windows, there is no SIZEOF_LONG, so it evaluates to 0 even - though sizeof(int) == sizeof(long). This should probably have been - CURL_SIZEOF_LONG, but the type of timeout_ms changed from long to time_t - anyway. - This triggered MSVC warning C4668 about implicitly replacing undefined - macros with '0'. - - Closes https://github.com/curl/curl/pull/1362 - -Daniel Stenberg (30 Mar 2017) -- cmake: add cmake file in docs/libcurl/opts/ to dist - -- cmake: add more missing files to the dist - -- docs/Makefile.am: include CMakeLists.txt in the dist tarball - -Marcel Raad (29 Mar 2017) -- NTLM: check for features with #ifdef instead of #if - - Feature defines are normally checked with #ifdef instead of #if in the rest of - the codebase. Additionally, some compilers warn when a macro is implicitly - evaluated to 0 because it is not defined, which was the case here. - - Ref: https://github.com/curl/curl/pull/1362#discussion_r108605101 - Closes https://github.com/curl/curl/pull/1367 - -Daniel Stenberg (29 Mar 2017) -- [Hanno Böck brought this change] - - curl: fix callback argument inconsistency - - As you can see the callback definition uses a char* for the first - argument, while the function uses a void*. - - URL: https://curl.haxx.se/mail/lib-2017-03/0116.html - -- RELEASE-NOTES: synced with 556c51a2df - -- [madblobfish brought this change] - - KNOWN_BUGS: typo - - Closes #1364 - -- [Maksim Stsepanenka brought this change] - - make: use the variable MAKE for recursive calls - - Closes #1366 - -- conncache: make hashkey avoid malloc - - ... to make it much faster. Idea developed with primepie on IRC. - - Closes #1365 - -Kamil Dudka (28 Mar 2017) -- http: do not treat FTPS over CONNECT as HTTPS - - If we use FTPS over CONNECT, the TLS handshake for the FTPS control - connection needs to be initiated in the SENDPROTOCONNECT state, not - the WAITPROXYCONNECT state. Otherwise, if the TLS handshake completed - without blocking, the information about the completed TLS handshake - would be saved to a wrong flag. Consequently, the TLS handshake would - be initiated in the SENDPROTOCONNECT state once again on the same - connection, resulting in a failure of the TLS handshake. I was able to - observe the failure with the NSS backend if curl ran through valgrind. - - Note that this commit partially reverts curl-7_21_6-52-ge34131d. - -Daniel Stenberg (28 Mar 2017) -- pause: handle mixed types of data when paused - - When receiving chunked encoded data with trailers, and the write - callback returns PAUSE, there might be both body and header to store to - resend on unpause. Previously libcurl returned error for that case. - - Added test case 1540 to verify. - - Reported-by: Stephen Toub - Fixes #1354 - Closes #1357 - -Jay Satiro (28 Mar 2017) -- [Isaac Boukris brought this change] - - http: Fix proxy connection reuse with basic-auth - - When using basic-auth, connections and proxy connections - can be re-used with different Authorization headers since - it does not authenticate the connection (like NTLM does). - - For instance, the below command should re-use the proxy - connection, but it currently doesn't: - curl -v -U alice:a -x http://localhost:8181 http://localhost/ - --next -U bob:b -x http://localhost:8181 http://localhost/ - - This is a regression since refactoring of ConnectionExists() - as part of: cb4e2be7c6d42ca0780f8e0a747cecf9ba45f151 - - Fix the above by removing the username and password compare - when re-using proxy connection at proxy_info_matches(). - - However, this fix brings back another bug would make curl - to re-print the old proxy-authorization header of previous - proxy basic-auth connection because it wasn't cleared. - - For instance, in the below command the second request should - fail if the proxy requires authentication, but would succeed - after the above fix (and before aforementioned commit): - curl -v -U alice:a -x http://localhost:8181 http://localhost/ - --next -x http://localhost:8181 http://localhost/ - - Fix this by clearing conn->allocptr.proxyuserpwd after use - unconditionally, same as we do for conn->allocptr.userpwd. - - Also fix test 540 to not expect digest auth header to be - resent when connection is reused. - - Signed-off-by: Isaac Boukris - - Closes https://github.com/curl/curl/pull/1350 - -- openssl: exclude DSA code when OPENSSL_NO_DSA is defined - - - Fix compile errors that occur in openssl.c when OpenSSL lib was - built without DSA support. - - Bug: https://github.com/curl/curl/issues/1361 - Reported-by: neheb@users.noreply.github.com - -- examples/fopen: checksrc compliance - -Marcel Raad (28 Mar 2017) -- schannel: fix variable shadowing warning - - No need to redeclare the variable. - -- multi: fix MinGW-w64 compiler warnings - - error: conversion to 'long int' from 'time_t {aka long long int}' may alter - its value [-Werror=conversion] - -- .gitattributes: turn off CRLF for *.am - - If Makefile.am uses CRLF, buildconf in a Windows checkout fails with: - ".ibtoolize: error: AC_CONFIG_MACRO_DIRS([m4]) conflicts with - ACLOCAL_AMFLAGS=-I m4" - -Daniel Stenberg (26 Mar 2017) -- [klemens brought this change] - - spelling fixes - - Closes #1356 - -- curl: check for end of input in writeout backslash handling - - Reported-by: Brian Carpenter - - Added test 1442 to verify - -Marcel Raad (24 Mar 2017) -- tests/README: make "Run" section foolproof - - curl must be built before building the tests. - - Closes https://github.com/curl/curl/pull/1352 - -Daniel Stenberg (23 Mar 2017) -- openssl: fix comparison between signed and unsigned integer expressions - -Marcel Raad (23 Mar 2017) -- [Edward Kimmel brought this change] - - asiohiper: make sure socket is open in event_cb - - Send curl_socket_t to event_cb and make sure it hasn't been closed yet. - - Closes https://github.com/curl/curl/pull/1318 - -Dan Fandrich (23 Mar 2017) -- openssl: made the error table static const - -Jay Satiro (23 Mar 2017) -- openssl: fall back on SSL_ERROR_* string when no error detail - - - If SSL_get_error is called but no extended error detail is available - then show that SSL_ERROR_* as a string. - - Prior to this change there was some inconsistency in that case: the - SSL_ERROR_* code may or may not have been shown, or may have been shown - as unknown even if it was known. - - Ref: https://github.com/curl/curl/issues/1300 - - Closes https://github.com/curl/curl/pull/1348 - -Dan Fandrich (23 Mar 2017) -- mkhelp: disable compression if the perl gzip module is unavailable - - This is nowadays included with the base perl distribution, but wasn't - prior to about perl 5.14 - -Daniel Stenberg (23 Mar 2017) -- [Anders Roxell brought this change] - - tests/README: mention nroff for --manual tests - - Signed-off-by: Anders Roxell - - Closes #1342 - -- CURLINFO_PRIMARY_IP.3: add example - -- travis: run tests-nonflaky instead of tests-full - -- make: introduce 'test-nonflaky' target - - Running this in the root build dir will invoke the test suite to only - run tests not marked as 'flaky'. - -- test2033: flaky - -Jay Satiro (21 Mar 2017) -- [Ales Mlakar brought this change] - - mbedtls: add support for CURLOPT_SSL_CTX_FUNCTION - - Ref: https://curl.haxx.se/mail/lib-2017-02/0097.html - - Closes https://github.com/curl/curl/pull/1272 - -Peter Wu (21 Mar 2017) -- cmake: add support for building HTML and PDF docs - - Note that for some reason there is this warning (that also exists with - autotools, added since curl-7_15_1-94-ga718cb05f): - - docs/libcurl/curl_multi_socket_all.3:1: can't open `man3/curl_multi_socket.3': No such file or directory - - Additionally, adjust the roffit --mandir option to support creating - links when doing out-of-tree builds. - - Ref: https://github.com/curl/curl/pull/1288 - -- cmake: build manual pages (including curl.1) - - Also make Perl mandatory to allow building the docs. - - While CMakeLists.txt could probably read the list of manual pages from - Makefile.am, actually putting those in CMakeLists.txt is cleaner so that - is what is done here. - - Fixes #1230 - Ref: https://github.com/curl/curl/pull/1288 - -- docs: split file lists into Makefile.inc - - For easier sharing with CMake. The contents were reformatted to use - two-space indent and expanded tabs (matching lib/Makefile.common). - - Ref: https://github.com/curl/curl/pull/1288 - -Daniel Stenberg (21 Mar 2017) -- examples: comment typos in http2 examples - -- RELEASE-NOTES: typo - -- RELEASE-NOTES: synced with 6e0f26c8a8c28df - -- multi: fix streamclose() crash in debug mode - - The code would refer to the wrong data pointer. Only debug builds do - this - for verbosity. - - Reported-by: zelinchen@users.noreply.github.com - Fixes #1329 - -- CONTRIBUTE: mention referring to github issues in commit msgs - -Dan Fandrich (20 Mar 2017) -- runtests.pl: fixed display of the Gopher IPv6 port number - -- tests: fixed the documented test server port numbers - -- test714/5: added HTTP as a required feature - - These tests use an HTTP proxy so require that curl be built with HTTP - support. - -- tests: strip more options from non-HTTP --libcurl tests - - The CURLOPT_USERAGENT and CURLOPT_MAXREDIRS options are only set if HTTP - support is available, so ignore them in tests where HTTP is not - guaranteed. - -Jay Satiro (18 Mar 2017) -- [Palo Markovic brought this change] - - darwinssl: fix typo in variable name - - Broken a week ago in 6448f98. - - Closes https://github.com/curl/curl/pull/1337 - -- tool_operate: Fix showing HTTPS-Proxy options on CURLE_SSL_CACERT - - - Show the HTTPS-proxy options on CURLE_SSL_CACERT if libcurl was built - with HTTPS-proxy support. - - Prior to this change those options were shown only if an HTTPS-proxy was - specified by --proxy, but that did not take into account environment - variables such as http_proxy, https_proxy, etc. Follow-up to e1187c4. - - Bug: https://github.com/curl/curl/issues/1331 - Reported-by: Nehal J Wani - -- CURLINFO_LOCAL_PORT.3: fix typo - -Daniel Stenberg (16 Mar 2017) -- CURLINFO_LOCAL_PORT.3: added example - -- SSLCERTS.md: mention HTTPS proxies and their separate options - -- BINDINGS: a Delphi binding - -- KNOWN_BUGS: remove libidn related issue - - ... as we no longer use libidn - -Dan Fandrich (14 Mar 2017) -- build: removed redundant DEPENDENCIES from makefiles - -Daniel Stenberg (13 Mar 2017) -- [Sylvestre Ledru brought this change] - - Improve code readbility - - ... by removing the else branch after a return, break or continue. - - Closes #1310 - -Jay Satiro (13 Mar 2017) -- [Anatol Belski brought this change] - - winbuild: add basic support for OpenSSL 1.1.x - - - Auto-detect OpenSSL 1.1 libs - - Closes https://github.com/curl/curl/pull/1322 - -Daniel Stenberg (13 Mar 2017) -- RELEASE-NOTES: synced with c25e0761d0fc49c4 - -- make: regenerate docs/curl.1 by runinng make in docs - - ... previously, docs/ was only a dist subdir, now also a build subdir. - - Reported-by: Dan Fandrich - Bug: https://curl.haxx.se/mail/lib-2017-03/0017.html - -Dan Fandrich (12 Mar 2017) -- test1440/1: depend on well-defined file: behaviour - - Depend on the known behaviour of URLs for nonexistent files rather than - the undefined behaviour of URLs for directories (which fails on Windows). - The test isn't about file: URLs at all, so the URL used doesn't really - matter. - -- tests: clear the SSL_CERT_FILE variable on --libcurl tests - - Otherwise, the contents will end up in the output and fail the - verification. - -- test1287: added verbose logs keyword - -- tool_writeout: fixed a buffer read overrun on --write-out - - If a % ended the statement, the string's trailing NUL would be skipped - and memory past the end of the buffer would be accessed and potentially - displayed as part of the --write-out output. Added tests 1440 and 1441 - to check for this kind of condition. - - Reported-by: Brian Carpenter - -Jay Satiro (12 Mar 2017) -- [Desmond O. Chang brought this change] - - url: add option CURLOPT_SUPPRESS_CONNECT_HEADERS - - - Add new option CURLOPT_SUPPRESS_CONNECT_HEADERS to allow suppressing - proxy CONNECT response headers from the user callback functions - CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION. - - - Add new tool option --suppress-connect-headers to expose - CURLOPT_SUPPRESS_CONNECT_HEADERS and allow suppressing proxy CONNECT - response headers from --dump-header and --include. - - Assisted-by: Jay Satiro - Assisted-by: CarloCannas@users.noreply.github.com - Closes https://github.com/curl/curl/pull/783 - -- http_proxy: Ignore TE and CL in CONNECT 2xx responses - - A client MUST ignore any Content-Length or Transfer-Encoding header - fields received in a successful response to CONNECT. - "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 - - Prior to this change such a case would cause an error. - - In some ways this bug appears to be a regression since c50b878. Prior to - that libcurl may have appeared to function correctly in such cases by - acting on those headers instead of causing an error. But that behavior - was also incorrect. - - Bug: https://github.com/curl/curl/issues/1317 - Reported-by: mkzero@users.noreply.github.com - -- [Thomas Glanzmann brought this change] - - mbedtls: fix typo in variable name - - Broken a few days ago in 6448f98. - - Bug: https://curl.haxx.se/mail/lib-2017-03/0015.html - -Michael Kaufmann (11 Mar 2017) -- tests: fix the authretry tests - - Do not call curl_easy_reset() between the requests, because the - auth state must be preserved for these tests. - - Follow-up to 0afbcfd - -- proxy: skip SSL initialization for closed connections - - This prevents a "Descriptor is not a socket" error for WinSSL. - - Reported-by: Antony74@users.noreply.github.com - Reviewed-by: Jay Satiro - - Fixes https://github.com/curl/curl/issues/1239 - -- curl_easy_reset: Also reset the authentication state - - Follow-up to 5278462 - See https://github.com/curl/curl/issues/1095 - -- [Isaac Boukris brought this change] - - authneg: clear auth.multi flag at http_done - - This flag is meant for the current request based on authentication - state, once the request is done we can clear the flag. - - Also change auth.multi to auth.multipass for better readability. - - Fixes https://github.com/curl/curl/issues/1095 - Closes https://github.com/curl/curl/pull/1326 - - Signed-off-by: Isaac Boukris - Reported-by: Michael Kaufmann - -Dan Fandrich (11 Mar 2017) -- url: don't compile detect_proxy if HTTP support is disabled - -- cmdline-opts: fixed a few typos - -Daniel Stenberg (10 Mar 2017) -- README.md: add coverity and travis badges - -- ISSUE_TEMPLATE: for bugs, ask questions on the mailing list - - and try to add the top comment within an HTML comment in the hope - that it might get hidden if the text is kept - -- openssl: add two /* FALLTHROUGH */ to satisfy coverity - - CID 1402159 and 1402158 - -- tests: disabled 1903 now - - Test 1903 is doing HTTP pipelining, and that is a timing and ordering - sensitive operation and this fails far too often on the Travis CI - leading to people more or less ignoring test failures there. Not good. - - The end of pipelning is probably coming sooner rather than later - anyway... - -Dan Fandrich (9 Mar 2017) -- tls-max.d: added to the makefile - -- build: fixed making man page in out-of-tree tarball builds - - The man page taken from the release package is found in a different - location than if it's built from source. It must be referenced as $< in - the rule to get its correct location in the VPATH. - -- mkhelp: simplified the gzip code - - This eliminates the need for an external gzip program, which wasn't - working with Busybox's gzip, anyway. It now compresses using perl's - IO::Compress::Gzip - -- polarssl: fixed compile errors introduced in 6448f98c - -Daniel Stenberg (8 Mar 2017) -- bump: next release will be known as 7.54.0 - - ...due to the newly added CURL_SSLVERSION_MAX_* functionality - -- openssl: unbreak the build after 6448f98c1857de - - Verified with OpenSSL 1.1.0e and OpenSSL master (1.1.1) - -Kamil Dudka (8 Mar 2017) -- [Jozef Kralik brought this change] - - vtls: add options to specify range of enabled TLS versions - - This commit introduces the CURL_SSLVERSION_MAX_* constants as well as - the --tls-max option of the curl tool. - - Closes https://github.com/curl/curl/pull/1166 - -Daniel Stenberg (8 Mar 2017) -- RELEASE-NOTES: synced with 6888a670aa01 - -- MANPAGE: clarify the dash situation in meta data - -- insecure.d: clarify that this is for server connections - - Assisted-by: Ray Satiro - Bug: https://curl.haxx.se/mail/lib-2017-03/0002.html - -Dan Fandrich (8 Mar 2017) -- test1260: added http as a required feature - -Daniel Stenberg (7 Mar 2017) -- [Steve Brokenshire brought this change] - - maketgz: Run updatemanpages.pl to update man pages - - maketgz now runs scripts/updatemanpages.pl to update the man pages .TH - section to use the current date and curl/libcurl version. - - (TODO Section 3.1) - - Closes #1058 - -- [Steve Brokenshire brought this change] - - gitignore: Ignore man page dist files - - Ignore man page dist files generated by scripts/updatemanpages.pl - -- [Steve Brokenshire brought this change] - - Makefile.am: Remove distribution man pages when running 'make clean' - -- [Steve Brokenshire brought this change] - - Makefile.am: Added scripts/updatemanpages.pl to EXTRA_DIST - -- [Steve Brokenshire brought this change] - - updatemanpages.pl: Update man pages to use current date and versions - - Added script to update man pages to use the current date and - curl/libcurl versions. - - updatemanpages.pl has three arrays: list of directories to look in, - list of extensions to process, list of files to exclude from - processing. - - Check man page in git repoistory using the date from the existing man - page before updating to avoid updating the man page if no change is - made. - - If data is received from the git command then update the man page with - the current date and version otherwise leave alone. - - Applied patch from badger to make the date argument optional, change the - git command used, added date argument to processfile subroutine and - print to STDERR if no date is found in a man page. - - Added code to process the changed man page into a new man page with - .dist added to the filename to keep the original source files unchanged. - Updated POD documentation to reflect that the date argument optional. - - Code style is in line with CODE_STYLE.md. - - Directories: docs/ docs/libcurl/ docs/libcurl/opts/ tests/ - Extensions: .1 .3 - Excluded files: mk-ca-bundle.1 template.3 - - (TODO Section 3.1) - -- [Tatsuhiro Tsujikawa brought this change] - - http2: Fix assertion error on redirect with CL=0 - - This fixes assertion error which occurs when redirect is done with 0 - length body via HTTP/2, and the easy handle is reused, but new - connection is established due to hostname change: - - curl: http2.c:1572: ssize_t http2_recv(struct connectdata *, - int, char *, size_t, CURLcode *): - Assertion `httpc->drain_total >= data->state.drain' failed. - - To fix this bug, ensure that http2_handle_stream is called. - - Fixes #1286 - Closes #1302 - -- ares: Curl_resolver_wait_resolv: clear *entry first in function - -- ares: better error return on timeouts - - Assisted-by: Ray Satiro - - Bug: https://curl.haxx.se/mail/lib-2017-03/0009.html - -Jay Satiro (6 Mar 2017) -- KNOWN_BUGS: Add DarwinSSL won't import PKCS#12 without a password - - Bug: https://github.com/curl/curl/issues/1308 - Reported-by: Justin Clift - -Dan Fandrich (6 Mar 2017) -- test1260: removed errant XML tag - -Daniel Stenberg (6 Mar 2017) -- URL: return error on malformed URLs with junk after port number - - ... because it causes confusion with users. Example URLs: - - "http://[127.0.0.1]:11211:80" which a lot of languages' URL parsers will - parse and claim uses port number 80, while libcurl would use port number - 11211. - - "http://user@example.com:80@localhost" which by the WHATWG URL spec will - be treated to contain user name 'user@example.com' but according to - RFC3986 is user name 'user' for the host 'example.com' and then port 80 - is followed by "@localhost" - - Both these formats are now rejected, and verified so in test 1260. - - Reported-by: Orange Tsai - -- BINDINGS: update the Lua-cURL URL - -- [Sylvestre Ledru brought this change] - - BINDINGS: add Scilab binding - - Closes #1312 - -- BINDINGS: add go-curl and perl6-net-curl - - Reported-by: Peter Pentchev - -- BINDINGS: add misssing C++ bindings - - Reported-by: Giuseppe Persico diff --git a/curl/CHANGES.md b/curl/CHANGES.md new file mode 100644 index 000000000..6e2f7c6bc --- /dev/null +++ b/curl/CHANGES.md @@ -0,0 +1,12 @@ + + +In a release tarball, check the RELEASES-NOTES file for what was done in the +most recent release. In a git check-out, that file mentions changes that have +been done since the previous release. + +See the online [changelog](https://curl.se/changes.html) for the edited and +human readable version of what has changed in different curl releases. diff --git a/curl/CMake/CMakeConfigurableFile.in b/curl/CMake/CMakeConfigurableFile.in index 4cf74a12b..a3d2bc4a2 100644 --- a/curl/CMake/CMakeConfigurableFile.in +++ b/curl/CMake/CMakeConfigurableFile.in @@ -1,2 +1,24 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### @CMAKE_CONFIGURABLE_FILE_CONTENT@ - diff --git a/curl/CMake/CurlSymbolHiding.cmake b/curl/CMake/CurlSymbolHiding.cmake index 9f7d29633..217c8832c 100644 --- a/curl/CMake/CurlSymbolHiding.cmake +++ b/curl/CMake/CurlSymbolHiding.cmake @@ -1,61 +1,68 @@ -include(CheckCSourceCompiles) - -option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON) +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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(CURL_HIDDEN_SYMBOLS) - set(SUPPORTS_SYMBOL_HIDING FALSE) +if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG)) + # We need to export internal debug functions, + # e.g. curl_easy_perform_ev() or curl_dbg_*(), + # so disable symbol hiding for debug builds and for memory tracking. + set(CURL_HIDDEN_SYMBOLS OFF) +elseif(DOS OR AMIGA OR MINGW32CE) + set(CURL_HIDDEN_SYMBOLS OFF) +endif() - if(CMAKE_C_COMPILER_ID MATCHES "Clang") - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") - elseif(CMAKE_COMPILER_IS_GNUCC) - if(NOT CMAKE_VERSION VERSION_LESS 2.8.10) - set(GCC_VERSION ${CMAKE_C_COMPILER_VERSION}) - else() - execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion - OUTPUT_VARIABLE GCC_VERSION) - endif() - if(NOT GCC_VERSION VERSION_LESS 3.4) - # note: this is considered buggy prior to 4.0 but the autotools don't care, so let's ignore that fact - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") - endif() - elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__global") - set(_CFLAG_SYMBOLS_HIDE "-xldscope=hidden") - elseif(CMAKE_C_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.0) - # note: this should probably just check for version 9.1.045 but I'm not 100% sure - # so let's to it the same way autotools do. - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") - check_c_source_compiles("#include - int main (void) { printf(\"icc fvisibility bug test\"); return 0; }" _no_bug) - if(NOT _no_bug) - set(SUPPORTS_SYMBOL_HIDING FALSE) - set(_SYMBOL_EXTERN "") - set(_CFLAG_SYMBOLS_HIDE "") - endif() - elseif(MSVC) - set(SUPPORTS_SYMBOL_HIDING TRUE) - endif() +set(CURL_HIDES_PRIVATE_SYMBOLS FALSE) +set(CURL_EXTERN_SYMBOL "") +set(CURL_CFLAG_SYMBOLS_HIDE "") - set(HIDES_CURL_PRIVATE_SYMBOLS ${SUPPORTS_SYMBOL_HIDING}) -elseif(MSVC) - if(NOT CMAKE_VERSION VERSION_LESS 3.7) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) #present since 3.4.3 but broken - set(HIDES_CURL_PRIVATE_SYMBOLS FALSE) - else() - message(WARNING "Hiding private symbols regardless CURL_HIDDEN_SYMBOLS being disabled.") - set(HIDES_CURL_PRIVATE_SYMBOLS TRUE) +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() - set(HIDES_CURL_PRIVATE_SYMBOLS FALSE) + 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() - -set(CURL_CFLAG_SYMBOLS_HIDE ${_CFLAG_SYMBOLS_HIDE}) -set(CURL_EXTERN_SYMBOL ${_SYMBOL_EXTERN}) diff --git a/curl/CMake/CurlTests.c b/curl/CMake/CurlTests.c index bc36c8ef7..410a0f70c 100644 --- a/curl/CMake/CurlTests.c +++ b/curl/CMake/CurlTests.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. + * 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 @@ -18,27 +18,11 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * + * SPDX-License-Identifier: curl + * ***************************************************************************/ -#ifdef TIME_WITH_SYS_TIME -/* Time with sys/time test */ - -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} - -#endif #ifdef HAVE_FCNTL_O_NONBLOCK - /* headers for FCNTL_O_NONBLOCK test */ #include #include @@ -46,148 +30,77 @@ return 0; /* */ #if defined(sun) || defined(__sun__) || \ defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# if defined(__SVR4) || defined(__srv4__) -# define PLATFORM_SOLARIS -# else -# define PLATFORM_SUNOS4 -# endif +# 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 +# define PLATFORM_AIX_V3 #endif /* */ -#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__) +#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) #error "O_NONBLOCK does not work on this platform" #endif -int -main () +int main(void) { - /* O_NONBLOCK source test */ - int flags = 0; - if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) - return 1; - return 0; + /* O_NONBLOCK source test */ + int flags = 0; + if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) + return 1; + return 0; } #endif -/* tests for gethostbyaddr_r or gethostbyname_r */ -#if defined(HAVE_GETHOSTBYADDR_R_5_REENTRANT) || \ - defined(HAVE_GETHOSTBYADDR_R_7_REENTRANT) || \ - defined(HAVE_GETHOSTBYADDR_R_8_REENTRANT) || \ +/* tests for gethostbyname_r */ +#if defined(HAVE_GETHOSTBYNAME_R_3) || \ defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) || \ - defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \ - defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT) -# define _REENTRANT - /* no idea whether _REENTRANT is always set, just invent a new flag */ -# define TEST_GETHOSTBYFOO_REENTRANT -#endif -#if defined(HAVE_GETHOSTBYADDR_R_5) || \ - defined(HAVE_GETHOSTBYADDR_R_7) || \ - defined(HAVE_GETHOSTBYADDR_R_8) || \ - defined(HAVE_GETHOSTBYNAME_R_3) || \ defined(HAVE_GETHOSTBYNAME_R_5) || \ + defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT) || \ defined(HAVE_GETHOSTBYNAME_R_6) || \ - defined(TEST_GETHOSTBYFOO_REENTRANT) + defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT) #include #include int main(void) { - char *address = "example.com"; - int length = 0; - int type = 0; + const char *address = "example.com"; struct hostent h; int rc = 0; -#if defined(HAVE_GETHOSTBYADDR_R_5) || \ - defined(HAVE_GETHOSTBYADDR_R_5_REENTRANT) || \ - \ - defined(HAVE_GETHOSTBYNAME_R_3) || \ - defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) +#if defined(HAVE_GETHOSTBYNAME_R_3) || \ + defined(HAVE_GETHOSTBYNAME_R_3_REENTRANT) struct hostent_data hdata; -#elif defined(HAVE_GETHOSTBYADDR_R_7) || \ - defined(HAVE_GETHOSTBYADDR_R_7_REENTRANT) || \ - defined(HAVE_GETHOSTBYADDR_R_8) || \ - defined(HAVE_GETHOSTBYADDR_R_8_REENTRANT) || \ - \ - defined(HAVE_GETHOSTBYNAME_R_5) || \ +#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]; - int h_errnop; struct hostent *hp; -#endif - -#ifndef gethostbyaddr_r - (void)gethostbyaddr_r; -#endif - -#if defined(HAVE_GETHOSTBYADDR_R_5) || \ - defined(HAVE_GETHOSTBYADDR_R_5_REENTRANT) - rc = gethostbyaddr_r(address, length, type, &h, &hdata); -#elif defined(HAVE_GETHOSTBYADDR_R_7) || \ - defined(HAVE_GETHOSTBYADDR_R_7_REENTRANT) - hp = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &h_errnop); - (void)hp; -#elif defined(HAVE_GETHOSTBYADDR_R_8) || \ - defined(HAVE_GETHOSTBYADDR_R_8_REENTRANT) - rc = gethostbyaddr_r(address, length, type, &h, buffer, 8192, &hp, &h_errnop); + 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; /* not used for test */ + (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)length; - (void)type; + (void)h; (void)rc; return 0; } #endif -#ifdef HAVE_SOCKLEN_T -#ifdef _WIN32 -#include -#else -#include -#include -#endif -int -main () -{ -if ((socklen_t *) 0) - return 0; -if (sizeof (socklen_t)) - return 0; - ; - return 0; -} -#endif -#ifdef HAVE_IN_ADDR_T -#include -#include -#include - -int -main () -{ -if ((in_addr_t *) 0) - return 0; -if (sizeof (in_addr_t)) - return 0; - ; - return 0; -} -#endif - #ifdef HAVE_BOOL_T #ifdef HAVE_SYS_TYPES_H #include @@ -195,13 +108,9 @@ if (sizeof (in_addr_t)) #ifdef HAVE_STDBOOL_H #include #endif -int -main () +int main(void) { -if (sizeof (bool *) ) - return 0; - ; - return 0; + return (int)sizeof(bool *); } #endif @@ -210,215 +119,91 @@ if (sizeof (bool *) ) #include #include #include -int main() { return 0; } -#endif -#ifdef RETSIGTYPE_TEST -#include -#include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); +int main(void) { return 0; } #endif -int -main () -{ - return 0; -} -#endif -#ifdef HAVE_INET_NTOA_R_DECL -#include - -typedef void (*func_type)(); - -int main() +#ifdef HAVE_FILE_OFFSET_BITS +#include +/* Check that off_t can represent 2**63 - 1 correctly. + We cannot simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && + LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int main(void) { -#ifndef inet_ntoa_r - func_type func; - func = (func_type)inet_ntoa_r; -#endif + (void)off_t_is_large; return 0; } #endif -#ifdef HAVE_INET_NTOA_R_DECL_REENTRANT -#define _REENTRANT -#include -typedef void (*func_type)(); - -int main() -{ -#ifndef inet_ntoa_r - func_type func; - func = (func_type)&inet_ntoa_r; -#endif - return 0; -} -#endif -#ifdef HAVE_GETADDRINFO -#include -#include -#include - -int main(void) { - struct addrinfo hints, *ai; - int error; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; -#ifndef getaddrinfo - (void)getaddrinfo; -#endif - error = getaddrinfo("127.0.0.1", "8080", &hints, &ai); - if (error) { - return 1; - } - return 0; -} -#endif -#ifdef HAVE_FILE_OFFSET_BITS -#ifdef _FILE_OFFSET_BITS -#undef _FILE_OFFSET_BITS -#endif -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int main () { ; return 0; } -#endif #ifdef HAVE_IOCTLSOCKET -/* includes start */ -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif +#ifdef _WIN32 +# include #endif - -int -main () +int main(void) { - -/* ioctlsocket source code */ - int socket; - unsigned long flags = ioctlsocket(socket, FIONBIO, &flags); - - ; + /* ioctlsocket source code */ + int socket = -1; + unsigned long flags = ioctlsocket(socket, FIONBIO, &flags); + (void)flags; return 0; } -#endif -#ifdef HAVE_IOCTLSOCKET_CAMEL -/* includes start */ -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif #endif -int -main () +#ifdef HAVE_IOCTLSOCKET_CAMEL +#include +int main(void) { - -/* IoctlSocket source code */ - if(0 != IoctlSocket(0, 0, 0)) - return 1; - ; + /* IoctlSocket source code */ + if(0 != IoctlSocket(0, 0, 0)) + return 1; return 0; } #endif + #ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO -/* includes start */ -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif +#include +#ifdef HAVE_SYS_IOCTL_H +# include #endif - -int -main () +int main(void) { - -/* IoctlSocket source code */ - long flags = 0; - if(0 != ioctlsocket(0, FIONBIO, &flags)) - return 1; - ; + /* IoctlSocket source code */ + long flags = 0; + if(0 != IoctlSocket(0, FIONBIO, &flags)) + return 1; + (void)flags; return 0; } #endif + #ifdef HAVE_IOCTLSOCKET_FIONBIO -/* includes start */ -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif +#ifdef _WIN32 +# include #endif - -int -main () +int main(void) { - - int flags = 0; - if(0 != ioctlsocket(0, FIONBIO, &flags)) - return 1; - - ; + 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 */ -/* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif #ifdef HAVE_SYS_IOCTL_H @@ -427,29 +212,25 @@ main () #ifdef HAVE_STROPTS_H # include #endif - -int -main () +int main(void) { - - int flags = 0; - if(0 != ioctl(0, FIONBIO, &flags)) - return 1; - - ; + int flags = 0; + if(0 != ioctl(0, FIONBIO, &flags)) + return 1; + (void)flags; return 0; } #endif + #ifdef HAVE_IOCTL_SIOCGIFADDR /* headers for FIONBIO test */ -/* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif #ifdef HAVE_SYS_IOCTL_H @@ -459,93 +240,153 @@ main () # include #endif #include - -int -main () +int main(void) { - struct ifreq ifr; - if(0 != ioctl(0, SIOCGIFADDR, &ifr)) - return 1; - - ; + struct ifreq ifr; + if(0 != ioctl(0, SIOCGIFADDR, &ifr)) + return 1; + (void)ifr; return 0; } #endif + #ifdef HAVE_SETSOCKOPT_SO_NONBLOCK -/* includes start */ -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif +#ifdef _WIN32 +# include #endif -/* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif -/* includes end */ - -int -main () +int main(void) { - if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) - return 1; - ; + if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) + return 1; return 0; } #endif + #ifdef HAVE_GLIBC_STRERROR_R #include #include -int -main () { - char buffer[1024]; /* big enough to play with */ - char *string = - strerror_r(EACCES, buffer, sizeof(buffer)); - /* this should've returned a string */ - if(!string || !string[0]) - return 99; - return 0; + +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 #include -int -main () { - char buffer[1024]; /* big enough to play with */ - int error = - strerror_r(EACCES, buffer, sizeof(buffer)); - /* This should've returned zero, and written an error string in the - buffer.*/ - if(!buffer[0] || error) - return 99; - return 0; + +/* 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 /* header from libc, not from libattr */ -int -main() { +int main(void) +{ fsetxattr(0, 0, 0, 0, 0, 0); return 0; } #endif + #ifdef HAVE_FSETXATTR_5 #include /* header from libc, not from libattr */ -int -main() { - fsetxattr(0, 0, 0, 0, 0); +int main(void) +{ + fsetxattr(0, "", 0, 0, 0); + return 0; +} +#endif + +#ifdef HAVE_CLOCK_GETTIME_MONOTONIC +#include +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 +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_STDATOMIC_H +# include +#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 +#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 diff --git a/curl/CMake/FindBrotli.cmake b/curl/CMake/FindBrotli.cmake new file mode 100644 index 000000000..690b5a9c2 --- /dev/null +++ b/curl/CMake/FindBrotli.cmake @@ -0,0 +1,76 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The brotli include directory. +# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library. +# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library. +# +# Result variables: +# +# - `BROTLI_FOUND`: System has brotli. +# - `BROTLI_INCLUDE_DIRS`: The brotli include directories. +# - `BROTLI_LIBRARIES`: The brotli library names. +# - `BROTLI_LIBRARY_DIRS`: The brotli library directories. +# - `BROTLI_PC_REQUIRES`: The brotli pkg-config packages. +# - `BROTLI_CFLAGS`: Required compiler flags. +# - `BROTLI_VERSION`: Version of brotli. + +set(BROTLI_PC_REQUIRES "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon + +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_VERSION "${BROTLI_libbrotlicommon_VERSION}") + string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}") + message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") +else() + find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") + find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon") + find_library(BROTLIDEC_LIBRARY NAMES "brotlidec") + + 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() diff --git a/curl/CMake/FindCARES.cmake b/curl/CMake/FindCARES.cmake index c4ab5f132..cc47e2d33 100644 --- a/curl/CMake/FindCARES.cmake +++ b/curl/CMake/FindCARES.cmake @@ -1,42 +1,97 @@ -# - Find c-ares -# Find the c-ares includes and library -# This module defines -# CARES_INCLUDE_DIR, where to find ares.h, etc. -# CARES_LIBRARIES, the libraries needed to use c-ares. -# CARES_FOUND, If false, do not try to use c-ares. -# also defined, but not for general use are -# CARES_LIBRARY, where to find the c-ares library. - -FIND_PATH(CARES_INCLUDE_DIR ares.h - /usr/local/include - /usr/include - ) +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The c-ares include directory. +# - `CARES_LIBRARY`: Path to `cares` library. +# +# Result variables: +# +# - `CARES_FOUND`: System has c-ares. +# - `CARES_INCLUDE_DIRS`: The c-ares include directories. +# - `CARES_LIBRARIES`: The c-ares library names. +# - `CARES_LIBRARY_DIRS`: The c-ares library directories. +# - `CARES_PC_REQUIRES`: The c-ares pkg-config packages. +# - `CARES_CFLAGS`: Required compiler flags. +# - `CARES_VERSION`: Version of c-ares. -SET(CARES_NAMES ${CARES_NAMES} cares) -FIND_LIBRARY(CARES_LIBRARY - NAMES ${CARES_NAMES} - PATHS /usr/lib /usr/local/lib - ) +set(CARES_PC_REQUIRES "libcares") + +if(CURL_USE_PKGCONFIG AND + NOT DEFINED CARES_INCLUDE_DIR AND + NOT DEFINED CARES_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(CARES ${CARES_PC_REQUIRES}) +endif() + +if(CARES_FOUND) + set(Cares_FOUND TRUE) + string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}") + message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")") +else() + find_path(CARES_INCLUDE_DIR NAMES "ares.h") + find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares") -IF (CARES_LIBRARY AND CARES_INCLUDE_DIR) - SET(CARES_LIBRARIES ${CARES_LIBRARY}) - SET(CARES_FOUND "YES") -ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR) - SET(CARES_FOUND "NO") -ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR) - - -IF (CARES_FOUND) - IF (NOT CARES_FIND_QUIETLY) - MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}") - ENDIF (NOT CARES_FIND_QUIETLY) -ELSE (CARES_FOUND) - IF (CARES_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find c-ares library") - ENDIF (CARES_FIND_REQUIRED) -ENDIF (CARES_FOUND) - -MARK_AS_ADVANCED( - CARES_LIBRARY - CARES_INCLUDE_DIR + 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 AND WIN32) + list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others +endif() diff --git a/curl/CMake/FindGSS.cmake b/curl/CMake/FindGSS.cmake index 60dcb73c9..9000445ac 100644 --- a/curl/CMake/FindGSS.cmake +++ b/curl/CMake/FindGSS.cmake @@ -1,289 +1,365 @@ -# - Try to find the GSS Kerberos library -# Once done this will define +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| # -# GSS_ROOT_DIR - Set this variable to the root installation of GSS +# Copyright (C) Daniel Stenberg, , et al. # -# Read-Only variables: -# GSS_FOUND - system has the Heimdal library -# GSS_FLAVOUR - "MIT" or "Heimdal" if anything found. -# GSS_INCLUDE_DIR - the Heimdal include directory -# GSS_LIBRARIES - The libraries needed to use GSS -# GSS_LINK_DIRECTORIES - Directories to add to linker search path -# GSS_LINKER_FLAGS - Additional linker flags -# GSS_COMPILER_FLAGS - Additional compiler flags -# GSS_VERSION - This is set to version advertised by pkg-config or read from manifest. -# In case the library is found but no version info available it'll be set to "unknown" - -set(_MIT_MODNAME mit-krb5-gssapi) -set(_HEIMDAL_MODNAME heimdal-gssapi) +# 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`: Set this variable to the root installation of GSS. (also supported as environment) +# +# Result variables: +# +# - `GSS_FOUND`: System has the Heimdal library. +# - `GSS_FLAVOUR`: "GNU", "MIT" or "Heimdal" if anything found. +# - `GSS_INCLUDE_DIRS`: The GSS include directories. +# - `GSS_LIBRARIES`: The GSS library names. +# - `GSS_LIBRARY_DIRS`: The GSS library directories. +# - `GSS_PC_REQUIRES`: The GSS pkg-config packages. +# - `GSS_CFLAGS`: Required compiler flags. +# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest. +# In case the library is found but no version info available it is set to "unknown" + +set(_gnu_modname "gss") +set(_mit_modname "mit-krb5-gssapi") +set(_heimdal_modname "heimdal-gssapi") include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckTypeSize) -set(_GSS_ROOT_HINTS - "${GSS_ROOT_DIR}" - "$ENV{GSS_ROOT_DIR}" +set(_gss_root_hints + "${GSS_ROOT_DIR}" + "$ENV{GSS_ROOT_DIR}" ) -# try to find library using system pkg-config if user didn't specify 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(UNIX) - find_package(PkgConfig QUIET) - pkg_search_module(_GSS_PKG ${_MIT_MODNAME} ${_HEIMDAL_MODNAME}) - list(APPEND _GSS_ROOT_HINTS "${_GSS_PKG_PREFIX}") - elseif(WIN32) - list(APPEND _GSS_ROOT_HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos;InstallDir]") - endif() + if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_search_module(_gss ${_gnu_modname} ${_mit_modname} ${_heimdal_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's take more traditional approach. - find_file(_GSS_CONFIGURE_SCRIPT - NAMES - "krb5-config" - HINTS - ${_GSS_ROOT_HINTS} - PATH_SUFFIXES - bin - NO_CMAKE_PATH - NO_CMAKE_ENVIRONMENT_PATH +if(NOT _gss_FOUND) # Not found by pkg-config. Let us take more traditional approach. + find_file(_gss_configure_script + NAMES + "krb5-config" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "bin" + NO_CMAKE_PATH + NO_CMAKE_ENVIRONMENT_PATH + ) + + # If not found in user-supplied directories, maybe system knows better + find_file(_gss_configure_script + NAMES + "krb5-config" + PATH_SUFFIXES + "bin" + ) + + 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() - # if not found in user-supplied directories, maybe system knows better - find_file(_GSS_CONFIGURE_SCRIPT - NAMES - "krb5-config" - PATH_SUFFIXES - bin + execute_process( + COMMAND ${_gss_configure_script} "--libs" "gssapi" + OUTPUT_VARIABLE _gss_lib_flags + RESULT_VARIABLE _gss_configure_failed + OUTPUT_STRIP_TRAILING_WHITESPACE ) - - if(_GSS_CONFIGURE_SCRIPT) - execute_process( - COMMAND ${_GSS_CONFIGURE_SCRIPT} "--cflags" "gssapi" - OUTPUT_VARIABLE _GSS_CFLAGS - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - ) -message(STATUS "CFLAGS: ${_GSS_CFLAGS}") - if(NOT _GSS_CONFIGURE_FAILED) # 0 means success - # should also work in an odd case when multiple directories are given - string(STRIP "${_GSS_CFLAGS}" _GSS_CFLAGS) - string(REGEX REPLACE " +-I" ";" _GSS_CFLAGS "${_GSS_CFLAGS}") - string(REGEX REPLACE " +-([^I][^ \\t;]*)" ";-\\1"_GSS_CFLAGS "${_GSS_CFLAGS}") - - foreach(_flag ${_GSS_CFLAGS}) - if(_flag MATCHES "^-I.*") - string(REGEX REPLACE "^-I" "" _val "${_flag}") - list(APPEND _GSS_INCLUDE_DIR "${_val}") - else() - list(APPEND _GSS_COMPILER_FLAGS "${_flag}") - endif() - endforeach() + 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} "--libs" "gssapi" - OUTPUT_VARIABLE _GSS_LIB_FLAGS - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - ) -message(STATUS "LDFLAGS: ${_GSS_LIB_FLAGS}") - if(NOT _GSS_CONFIGURE_FAILED) # 0 means success - # this script gives us libraries and link directories. Blah. We have to deal with it. - 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 ${_GSS_LIB_FLAGS}) - if(_flag MATCHES "^-l.*") - string(REGEX REPLACE "^-l" "" _val "${_flag}") - list(APPEND _GSS_LIBRARIES "${_val}") - elseif(_flag MATCHES "^-L.*") - string(REGEX REPLACE "^-L" "" _val "${_flag}") - list(APPEND _GSS_LINK_DIRECTORIES "${_val}") - else() - list(APPEND _GSS_LINKER_FLAGS "${_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) + endif() - execute_process( - COMMAND ${_GSS_CONFIGURE_SCRIPT} "--version" - OUTPUT_VARIABLE _GSS_VERSION - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - ) + 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 "--version" parameter. In this case we just don't care. - if(_GSS_CONFIGURE_FAILED) - set(_GSS_VERSION 0) - endif() + # Older versions may not have the "--vendor" parameter. In this case we just do not care. + if(_gss_configure_failed) + set(GSS_FLAVOUR "Heimdal") # most probably, should not really matter + else() + if(_gss_vendor MATCHES "H|heimdal") + set(GSS_FLAVOUR "Heimdal") + else() + set(GSS_FLAVOUR "MIT") + endif() + endif() + else() # Either there is no config script or we are on a platform that does not provide one (Windows?) - execute_process( - COMMAND ${_GSS_CONFIGURE_SCRIPT} "--vendor" - OUTPUT_VARIABLE _GSS_VENDOR - RESULT_VARIABLE _GSS_CONFIGURE_FAILED - ) + find_path(_gss_INCLUDE_DIRS NAMES "gssapi/gssapi.h" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "include" + "inc" + ) - # older versions may not have the "--vendor" parameter. In this case we just don't care. - if(_GSS_CONFIGURE_FAILED) - set(GSS_FLAVOUR "Heimdal") # most probably, shouldn't really matter - else() - if(_GSS_VENDOR MATCHES ".*H|heimdal.*") - set(GSS_FLAVOUR "Heimdal") - else() - set(GSS_FLAVOUR "MIT") - endif() - endif() + if(_gss_INCLUDE_DIRS) # jay, we have found something + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES "${_gss_INCLUDE_DIRS}") + check_include_files("gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _gss_have_mit_headers) - else() # either there is no config script or we are on platform that doesn't provide one (Windows?) + if(_gss_have_mit_headers) + set(GSS_FLAVOUR "MIT") + else() + # Prevent compiling the header - just check if we can include it + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__") + check_include_file("roken.h" _gss_have_roken_h) + + check_include_file("heimdal/roken.h" _gss_have_heimdal_roken_h) + if(_gss_have_roken_h OR _gss_have_heimdal_roken_h) + set(GSS_FLAVOUR "Heimdal") + endif() + endif() + cmake_pop_check_state() + else() + # I am not convinced if this is the right way but this is what autotools do at the moment + find_path(_gss_INCLUDE_DIRS NAMES "gssapi.h" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "include" + "inc" + ) - find_path(_GSS_INCLUDE_DIR - NAMES - "gssapi/gssapi.h" - HINTS - ${_GSS_ROOT_HINTS} - PATH_SUFFIXES - include - inc + if(_gss_INCLUDE_DIRS) + set(GSS_FLAVOUR "Heimdal") + else() + find_path(_gss_INCLUDE_DIRS NAMES "gss.h" + HINTS + ${_gss_root_hints} + PATH_SUFFIXES + "include" ) - if(_GSS_INCLUDE_DIR) #jay, we've found something - set(CMAKE_REQUIRED_INCLUDES "${_GSS_INCLUDE_DIR}") - check_include_files( "gssapi/gssapi_generic.h;gssapi/gssapi_krb5.h" _GSS_HAVE_MIT_HEADERS) - - if(_GSS_HAVE_MIT_HEADERS) - set(GSS_FLAVOUR "MIT") - else() - # prevent compiling the header - just check if we can include it - set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D__ROKEN_H__") - check_include_file( "roken.h" _GSS_HAVE_ROKEN_H) - - check_include_file( "heimdal/roken.h" _GSS_HAVE_HEIMDAL_ROKEN_H) - if(_GSS_HAVE_ROKEN_H OR _GSS_HAVE_HEIMDAL_ROKEN_H) - set(GSS_FLAVOUR "Heimdal") - endif() - set(CMAKE_REQUIRED_DEFINITIONS "") - endif() - else() - # I'm not convienced if this is the right way but this is what autotools do at the moment - find_path(_GSS_INCLUDE_DIR - NAMES - "gssapi.h" - HINTS - ${_GSS_ROOT_HINTS} - PATH_SUFFIXES - include - inc - ) - - if(_GSS_INCLUDE_DIR) - set(GSS_FLAVOUR "Heimdal") - endif() + if(_gss_INCLUDE_DIRS) + set(GSS_FLAVOUR "GNU") + set(GSS_PC_REQUIRES "gss") endif() + endif() + endif() - # if we have headers, check if we can link libraries - if(GSS_FLAVOUR) - set(_GSS_LIBDIR_SUFFIXES "") - set(_GSS_LIBDIR_HINTS ${_GSS_ROOT_HINTS}) - get_filename_component(_GSS_CALCULATED_POTENTIAL_ROOT "${_GSS_INCLUDE_DIR}" PATH) - list(APPEND _GSS_LIBDIR_HINTS ${_GSS_CALCULATED_POTENTIAL_ROOT}) - - if(WIN32) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - list(APPEND _GSS_LIBDIR_SUFFIXES "lib/AMD64") - if(GSS_FLAVOUR STREQUAL "MIT") - set(_GSS_LIBNAME "gssapi64") - else() - set(_GSS_LIBNAME "libgssapi") - endif() - else() - list(APPEND _GSS_LIBDIR_SUFFIXES "lib/i386") - if(GSS_FLAVOUR STREQUAL "MIT") - set(_GSS_LIBNAME "gssapi32") - else() - set(_GSS_LIBNAME "libgssapi") - endif() - endif() - else() - list(APPEND _GSS_LIBDIR_SUFFIXES "lib;lib64") # those suffixes are not checked for HINTS - if(GSS_FLAVOUR STREQUAL "MIT") - set(_GSS_LIBNAME "gssapi_krb5") - else() - set(_GSS_LIBNAME "gssapi") - endif() - endif() - - find_library(_GSS_LIBRARIES - NAMES - ${_GSS_LIBNAME} - HINTS - ${_GSS_LIBDIR_HINTS} - PATH_SUFFIXES - ${_GSS_LIBDIR_SUFFIXES} - ) + # If we have headers, check if we can link libraries + if(GSS_FLAVOUR) + set(_gss_libdir_suffixes "") + set(_gss_libdir_hints ${_gss_root_hints}) + get_filename_component(_gss_calculated_potential_root "${_gss_INCLUDE_DIRS}" DIRECTORY) + list(APPEND _gss_libdir_hints ${_gss_calculated_potential_root}) + if(WIN32) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + list(APPEND _gss_libdir_suffixes "lib/AMD64") + if(GSS_FLAVOUR STREQUAL "GNU") + set(_gss_libname "gss") + elseif(GSS_FLAVOUR STREQUAL "MIT") + set(_gss_libname "gssapi64") + else() + set(_gss_libname "libgssapi") + endif() + else() + list(APPEND _gss_libdir_suffixes "lib/i386") + if(GSS_FLAVOUR STREQUAL "GNU") + set(_gss_libname "gss") + elseif(GSS_FLAVOUR STREQUAL "MIT") + set(_gss_libname "gssapi32") + else() + set(_gss_libname "libgssapi") + endif() + endif() + else() + list(APPEND _gss_libdir_suffixes "lib;lib64") # those suffixes are not checked for HINTS + if(GSS_FLAVOUR STREQUAL "GNU") + set(_gss_libname "gss") + elseif(GSS_FLAVOUR STREQUAL "MIT") + set(_gss_libname "gssapi_krb5") + else() + set(_gss_libname "gssapi") endif() + endif() + find_library(_gss_LIBRARIES NAMES ${_gss_libname} + HINTS + ${_gss_libdir_hints} + PATH_SUFFIXES + ${_gss_libdir_suffixes} + ) endif() + endif() else() - if(_GSS_PKG_${_MIT_MODNAME}_VERSION) - set(GSS_FLAVOUR "MIT") - set(_GSS_VERSION _GSS_PKG_${_MIT_MODNAME}_VERSION) - else() - set(GSS_FLAVOUR "Heimdal") - set(_GSS_VERSION _GSS_PKG_${_MIT_HEIMDAL}_VERSION) + # _gss_MODULE_NAME set since CMake 3.16 + if(_gss_MODULE_NAME STREQUAL _gnu_modname OR _gss_${_gnu_modname}_VERSION) + set(GSS_FLAVOUR "GNU") + set(GSS_PC_REQUIRES "gss") + if(NOT _gss_version) # for old CMake versions? + set(_gss_version ${_gss_${_gnu_modname}_VERSION}) + endif() + elseif(_gss_MODULE_NAME STREQUAL _mit_modname OR _gss_${_mit_modname}_VERSION) + set(GSS_FLAVOUR "MIT") + set(GSS_PC_REQUIRES "mit-krb5-gssapi") + if(NOT _gss_version) # for old CMake versions? + set(_gss_version ${_gss_${_mit_modname}_VERSION}) endif() + else() + set(GSS_FLAVOUR "Heimdal") + set(GSS_PC_REQUIRES "heimdal-gssapi") + if(NOT _gss_version) # for old CMake versions? + set(_gss_version ${_gss_${_heimdal_modname}_VERSION}) + endif() + endif() + message(STATUS "Found GSS/${GSS_FLAVOUR} (via pkg-config): ${_gss_INCLUDE_DIRS} (found version \"${_gss_version}\")") endif() -set(GSS_INCLUDE_DIR ${_GSS_INCLUDE_DIR}) -set(GSS_LIBRARIES ${_GSS_LIBRARIES}) -set(GSS_LINK_DIRECTORIES ${_GSS_LINK_DIRECTORIES}) -set(GSS_LINKER_FLAGS ${_GSS_LINKER_FLAGS}) -set(GSS_COMPILER_FLAGS ${_GSS_COMPILER_FLAGS}) -set(GSS_VERSION ${_GSS_VERSION}) +string(REPLACE ";" " " _gss_CFLAGS "${_gss_CFLAGS}") -if(GSS_FLAVOUR) +set(GSS_INCLUDE_DIRS ${_gss_INCLUDE_DIRS}) +set(GSS_LIBRARIES ${_gss_LIBRARIES}) +set(GSS_LIBRARY_DIRS ${_gss_LIBRARY_DIRS}) +set(GSS_CFLAGS ${_gss_CFLAGS}) +set(GSS_VERSION ${_gss_version}) - if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal") - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.amd64.manifest") - else() - set(HEIMDAL_MANIFEST_FILE "Heimdal.Application.x86.manifest") - endif() +if(GSS_FLAVOUR) + if(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "Heimdal") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(_heimdal_manifest_file "Heimdal.Application.amd64.manifest") + else() + set(_heimdal_manifest_file "Heimdal.Application.x86.manifest") + endif() - if(EXISTS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}") - file(STRINGS "${GSS_INCLUDE_DIR}/${HEIMDAL_MANIFEST_FILE}" heimdal_version_str - REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$") + if(EXISTS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}") + file(STRINGS "${GSS_INCLUDE_DIRS}/${_heimdal_manifest_file}" _heimdal_version_str + REGEX "^.*version=\"[0-9]\\.[^\"]+\".*$") - string(REGEX MATCH "[0-9]\\.[^\"]+" - GSS_VERSION "${heimdal_version_str}") - endif() + string(REGEX MATCH "[0-9]\\.[^\"]+" GSS_VERSION "${_heimdal_version_str}") + endif() - if(NOT GSS_VERSION) - set(GSS_VERSION "Heimdal Unknown") - endif() - elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT") - get_filename_component(_MIT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME CACHE) - if(WIN32 AND _MIT_VERSION) - set(GSS_VERSION "${_MIT_VERSION}") - else() - set(GSS_VERSION "MIT Unknown") - endif() + if(NOT GSS_VERSION) + set(GSS_VERSION "Heimdal Unknown") + endif() + elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "MIT") + get_filename_component(_mit_version "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MIT\\Kerberos\\SDK\\CurrentVersion;VersionString]" NAME + CACHE) + if(WIN32 AND _mit_version) + set(GSS_VERSION "${_mit_version}") + else() + set(GSS_VERSION "MIT Unknown") + endif() + elseif(NOT GSS_VERSION AND GSS_FLAVOUR STREQUAL "GNU") + if(GSS_INCLUDE_DIRS AND EXISTS "${GSS_INCLUDE_DIRS}/gss.h") + set(_version_regex "#[\t ]*define[\t ]+GSS_VERSION[\t ]+\"([^\"]*)\"") + file(STRINGS "${GSS_INCLUDE_DIRS}/gss.h" _version_str REGEX "${_version_regex}") + 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) - -set(_GSS_REQUIRED_VARS GSS_LIBRARIES GSS_FLAVOUR) - find_package_handle_standard_args(GSS - REQUIRED_VARS - ${_GSS_REQUIRED_VARS} - VERSION_VAR - GSS_VERSION - FAIL_MESSAGE - "Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR" + REQUIRED_VARS + GSS_FLAVOUR + GSS_LIBRARIES + VERSION_VAR + GSS_VERSION + FAIL_MESSAGE + "Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR" ) -mark_as_advanced(GSS_INCLUDE_DIR GSS_LIBRARIES) +mark_as_advanced( + _gss_CFLAGS + _gss_FOUND + _gss_INCLUDE_DIRS + _gss_LIBRARIES + _gss_LIBRARY_DIRS + _gss_MODULE_NAME + _gss_PREFIX + _gss_version +) diff --git a/curl/CMake/FindLDAP.cmake b/curl/CMake/FindLDAP.cmake new file mode 100644 index 000000000..fdc6d7be9 --- /dev/null +++ b/curl/CMake/FindLDAP.cmake @@ -0,0 +1,107 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The ldap include directory. +# - `LDAP_LIBRARY`: Path to `ldap` library. +# - `LDAP_LBER_LIBRARY`: Path to `lber` library. +# +# Result variables: +# +# - `LDAP_FOUND`: System has ldap. +# - `LDAP_INCLUDE_DIRS`: The ldap include directories. +# - `LDAP_LIBRARIES`: The ldap library names. +# - `LDAP_LIBRARY_DIRS`: The ldap library directories. +# - `LDAP_PC_REQUIRES`: The ldap pkg-config packages. +# - `LDAP_CFLAGS`: Required compiler flags. +# - `LDAP_VERSION`: Version of ldap. + +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_VERSION "${LDAP_ldap_VERSION}") + string(REPLACE ";" " " LDAP_CFLAGS "${LDAP_CFLAGS}") + message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")") +else() + set(LDAP_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config + + # 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 and . + # 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() diff --git a/curl/CMake/FindLibPSL.cmake b/curl/CMake/FindLibPSL.cmake new file mode 100644 index 000000000..d6fde4b2d --- /dev/null +++ b/curl/CMake/FindLibPSL.cmake @@ -0,0 +1,83 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The libpsl include directory. +# - `LIBPSL_LIBRARY`: Path to `libpsl` library. +# +# Result variables: +# +# - `LIBPSL_FOUND`: System has libpsl. +# - `LIBPSL_INCLUDE_DIRS`: The libpsl include directories. +# - `LIBPSL_LIBRARIES`: The libpsl library names. +# - `LIBPSL_LIBRARY_DIRS`: The libpsl library directories. +# - `LIBPSL_PC_REQUIRES`: The libpsl pkg-config packages. +# - `LIBPSL_CFLAGS`: Required compiler flags. +# - `LIBPSL_VERSION`: Version of libpsl. + +set(LIBPSL_PC_REQUIRES "libpsl") + +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) + string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}") + message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")") +else() + find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h") + find_library(LIBPSL_LIBRARY NAMES "psl" "libpsl") + + 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() diff --git a/curl/CMake/FindLibSSH2.cmake b/curl/CMake/FindLibSSH2.cmake index 12a7c612b..0b81ecb3c 100644 --- a/curl/CMake/FindLibSSH2.cmake +++ b/curl/CMake/FindLibSSH2.cmake @@ -1,35 +1,83 @@ -# - Try to find the libssh2 library -# Once done this will define +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| # -# LIBSSH2_FOUND - system has the libssh2 library -# LIBSSH2_INCLUDE_DIR - the libssh2 include directory -# LIBSSH2_LIBRARY - the libssh2 library name - -if (LIBSSH2_INCLUDE_DIR AND LIBSSH2_LIBRARY) - set(LibSSH2_FIND_QUIETLY TRUE) -endif (LIBSSH2_INCLUDE_DIR AND LIBSSH2_LIBRARY) - -FIND_PATH(LIBSSH2_INCLUDE_DIR libssh2.h -) +# Copyright (C) Daniel Stenberg, , 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`: The libssh2 include directory. +# - `LIBSSH2_LIBRARY`: Path to `libssh2` library. +# +# Result variables: +# +# - `LIBSSH2_FOUND`: System has libssh2. +# - `LIBSSH2_INCLUDE_DIRS`: The libssh2 include directories. +# - `LIBSSH2_LIBRARIES`: The libssh2 library names. +# - `LIBSSH2_LIBRARY_DIRS`: The libssh2 library directories. +# - `LIBSSH2_PC_REQUIRES`: The libssh2 pkg-config packages. +# - `LIBSSH2_CFLAGS`: Required compiler flags. +# - `LIBSSH2_VERSION`: Version of libssh2. -FIND_LIBRARY(LIBSSH2_LIBRARY NAMES ssh2 -) +set(LIBSSH2_PC_REQUIRES "libssh2") -if(LIBSSH2_INCLUDE_DIR) - file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" libssh2_version_str REGEX "^#define[\t ]+LIBSSH2_VERSION_NUM[\t ]+0x[0-9][0-9][0-9][0-9][0-9][0-9].*") +if(CURL_USE_PKGCONFIG AND + NOT DEFINED LIBSSH2_INCLUDE_DIR AND + NOT DEFINED LIBSSH2_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(LIBSSH2 ${LIBSSH2_PC_REQUIRES}) +endif() - string(REGEX REPLACE "^.*LIBSSH2_VERSION_NUM[\t ]+0x([0-9][0-9]).*$" "\\1" LIBSSH2_VERSION_MAJOR "${libssh2_version_str}") - string(REGEX REPLACE "^.*LIBSSH2_VERSION_NUM[\t ]+0x[0-9][0-9]([0-9][0-9]).*$" "\\1" LIBSSH2_VERSION_MINOR "${libssh2_version_str}") - string(REGEX REPLACE "^.*LIBSSH2_VERSION_NUM[\t ]+0x[0-9][0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" LIBSSH2_VERSION_PATCH "${libssh2_version_str}") +if(LIBSSH2_FOUND AND LIBSSH2_INCLUDE_DIRS) + set(Libssh2_FOUND TRUE) + string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}") + message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")") +else() + find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h") + find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2") - string(REGEX REPLACE "^0(.+)" "\\1" LIBSSH2_VERSION_MAJOR "${LIBSSH2_VERSION_MAJOR}") - string(REGEX REPLACE "^0(.+)" "\\1" LIBSSH2_VERSION_MINOR "${LIBSSH2_VERSION_MINOR}") - string(REGEX REPLACE "^0(.+)" "\\1" LIBSSH2_VERSION_PATCH "${LIBSSH2_VERSION_PATCH}") + 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() - set(LIBSSH2_VERSION "${LIBSSH2_VERSION_MAJOR}.${LIBSSH2_VERSION_MINOR}.${LIBSSH2_VERSION_PATCH}") -endif(LIBSSH2_INCLUDE_DIR) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libssh2 + REQUIRED_VARS + LIBSSH2_INCLUDE_DIR + LIBSSH2_LIBRARY + VERSION_VAR + LIBSSH2_VERSION + ) -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibSSH2 DEFAULT_MSG LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY ) + if(LIBSSH2_FOUND) + set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR}) + set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY}) + endif() -MARK_AS_ADVANCED(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY LIBSSH2_VERSION_MAJOR LIBSSH2_VERSION_MINOR LIBSSH2_VERSION_PATCH LIBSSH2_VERSION) + mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) +endif() diff --git a/curl/CMake/FindLibgsasl.cmake b/curl/CMake/FindLibgsasl.cmake new file mode 100644 index 000000000..878d65188 --- /dev/null +++ b/curl/CMake/FindLibgsasl.cmake @@ -0,0 +1,83 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The libgsasl include directory. +# - `LIBGSASL_LIBRARY`: Path to `libgsasl` library. +# +# Result variables: +# +# - `LIBGSASL_FOUND`: System has libgsasl. +# - `LIBGSASL_INCLUDE_DIRS`: The libgsasl include directories. +# - `LIBGSASL_LIBRARIES`: The libgsasl library names. +# - `LIBGSASL_LIBRARY_DIRS`: The libgsasl library directories. +# - `LIBGSASL_PC_REQUIRES`: The libgsasl pkg-config packages. +# - `LIBGSASL_CFLAGS`: Required compiler flags. +# - `LIBGSASL_VERSION`: Version of libgsasl. + +set(LIBGSASL_PC_REQUIRES "libgsasl") + +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) + string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}") + message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")") +else() + find_path(LIBGSASL_INCLUDE_DIR NAMES "gsasl.h") + find_library(LIBGSASL_LIBRARY NAMES "gsasl" "libgsasl") + + 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() diff --git a/curl/CMake/FindLibidn2.cmake b/curl/CMake/FindLibidn2.cmake new file mode 100644 index 000000000..f8f00f0c7 --- /dev/null +++ b/curl/CMake/FindLibidn2.cmake @@ -0,0 +1,83 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The libidn2 include directory. +# - `LIBIDN2_LIBRARY`: Path to `libidn2` library. +# +# Result variables: +# +# - `LIBIDN2_FOUND`: System has libidn2. +# - `LIBIDN2_INCLUDE_DIRS`: The libidn2 include directories. +# - `LIBIDN2_LIBRARIES`: The libidn2 library names. +# - `LIBIDN2_LIBRARY_DIRS`: The libidn2 library directories. +# - `LIBIDN2_PC_REQUIRES`: The libidn2 pkg-config packages. +# - `LIBIDN2_CFLAGS`: Required compiler flags. +# - `LIBIDN2_VERSION`: Version of libidn2. + +set(LIBIDN2_PC_REQUIRES "libidn2") + +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) + string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}") + message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")") +else() + find_path(LIBIDN2_INCLUDE_DIR NAMES "idn2.h") + find_library(LIBIDN2_LIBRARY NAMES "idn2" "libidn2") + + 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() diff --git a/curl/CMake/FindLibrtmp.cmake b/curl/CMake/FindLibrtmp.cmake new file mode 100644 index 000000000..50fc9692b --- /dev/null +++ b/curl/CMake/FindLibrtmp.cmake @@ -0,0 +1,103 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### +# Find the librtmp library +# +# Input variables: +# +# - `LIBRTMP_INCLUDE_DIR`: The librtmp include directory. +# - `LIBRTMP_LIBRARY`: Path to `librtmp` library. +# +# Result variables: +# +# - `LIBRTMP_FOUND`: System has librtmp. +# - `LIBRTMP_INCLUDE_DIRS`: The librtmp include directories. +# - `LIBRTMP_LIBRARIES`: The librtmp library names. +# - `LIBRTMP_LIBRARY_DIRS`: The librtmp library directories. +# - `LIBRTMP_PC_REQUIRES`: The librtmp pkg-config packages. +# - `LIBRTMP_CFLAGS`: Required compiler flags. +# - `LIBRTMP_VERSION`: Version of librtmp. + +set(LIBRTMP_PC_REQUIRES "librtmp") + +if(CURL_USE_PKGCONFIG AND + NOT DEFINED LIBRTMP_INCLUDE_DIR AND + NOT DEFINED LIBRTMP_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(LIBRTMP ${LIBRTMP_PC_REQUIRES}) +endif() + +if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS) + set(Librtmp_FOUND TRUE) + string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}") + message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")") +else() + find_path(LIBRTMP_INCLUDE_DIR NAMES "librtmp/rtmp.h") + find_library(LIBRTMP_LIBRARY NAMES "rtmp") + + unset(LIBRTMP_VERSION CACHE) + if(LIBRTMP_INCLUDE_DIR AND EXISTS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h") + set(_version_regex "#[\t ]*define[\t ]+RTMP_LIB_VERSION[\t ]+0x([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F]).*") + file(STRINGS "${LIBRTMP_INCLUDE_DIR}/librtmp/rtmp.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str1 "${_version_str}") + string(REGEX REPLACE "${_version_regex}" "\\2" _version_str2 "${_version_str}") + if(CMAKE_VERSION VERSION_LESS 3.13) + # No support for hex version numbers, just strip leading zeroes + string(REGEX REPLACE "^0" "" _version_str1 "${_version_str1}") + string(REGEX REPLACE "^0" "" _version_str2 "${_version_str2}") + else() + math(EXPR _version_str1 "0x${_version_str1}" OUTPUT_FORMAT DECIMAL) + math(EXPR _version_str2 "0x${_version_str2}" OUTPUT_FORMAT DECIMAL) + endif() + set(LIBRTMP_VERSION "${_version_str1}.${_version_str2}") + unset(_version_regex) + unset(_version_str1) + unset(_version_str2) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Librtmp + REQUIRED_VARS + LIBRTMP_INCLUDE_DIR + LIBRTMP_LIBRARY + VERSION_VAR + LIBRTMP_VERSION + ) + + if(LIBRTMP_FOUND) + set(LIBRTMP_INCLUDE_DIRS ${LIBRTMP_INCLUDE_DIR}) + set(LIBRTMP_LIBRARIES ${LIBRTMP_LIBRARY}) + endif() + + mark_as_advanced(LIBRTMP_INCLUDE_DIR LIBRTMP_LIBRARY) + + # Necessary when linking a static librtmp + find_package(OpenSSL) + if(OPENSSL_FOUND) + list(APPEND LIBRTMP_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) + endif() +endif() + +if(LIBRTMP_FOUND AND WIN32) + list(APPEND LIBRTMP_LIBRARIES "winmm") +endif() diff --git a/curl/CMake/FindLibssh.cmake b/curl/CMake/FindLibssh.cmake new file mode 100644 index 000000000..e2b27d975 --- /dev/null +++ b/curl/CMake/FindLibssh.cmake @@ -0,0 +1,97 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The libssh include directory. +# - `LIBSSH_LIBRARY`: Path to libssh library. +# +# Result variables: +# +# - `LIBSSH_FOUND`: System has libssh. +# - `LIBSSH_INCLUDE_DIRS`: The libssh include directories. +# - `LIBSSH_LIBRARIES`: The libssh library names. +# - `LIBSSH_LIBRARY_DIRS`: The libssh library directories. +# - `LIBSSH_PC_REQUIRES`: The libssh pkg-config packages. +# - `LIBSSH_CFLAGS`: Required compiler flags. +# - `LIBSSH_VERSION`: Version of libssh. + +set(LIBSSH_PC_REQUIRES "libssh") + +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) + string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}") + message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")") +else() + find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h") + find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh") + + 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 AND WIN32) + list(APPEND LIBSSH_LIBRARIES "iphlpapi") # for if_nametoindex +endif() diff --git a/curl/CMake/FindLibuv.cmake b/curl/CMake/FindLibuv.cmake new file mode 100644 index 000000000..b16b3554f --- /dev/null +++ b/curl/CMake/FindLibuv.cmake @@ -0,0 +1,93 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The libuv include directory. +# - `LIBUV_LIBRARY`: Path to `libuv` library. +# +# Result variables: +# +# - `LIBUV_FOUND`: System has libuv. +# - `LIBUV_INCLUDE_DIRS`: The libuv include directories. +# - `LIBUV_LIBRARIES`: The libuv library names. +# - `LIBUV_LIBRARY_DIRS`: The libuv library directories. +# - `LIBUV_PC_REQUIRES`: The libuv pkg-config packages. +# - `LIBUV_CFLAGS`: Required compiler flags. +# - `LIBUV_VERSION`: Version of libuv. + +set(LIBUV_PC_REQUIRES "libuv") + +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) + string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}") + message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")") +else() + find_path(LIBUV_INCLUDE_DIR NAMES "uv.h") + find_library(LIBUV_LIBRARY NAMES "uv" "libuv") + + 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() diff --git a/curl/CMake/FindMSH3.cmake b/curl/CMake/FindMSH3.cmake new file mode 100644 index 000000000..da38d4582 --- /dev/null +++ b/curl/CMake/FindMSH3.cmake @@ -0,0 +1,72 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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 msh3 library +# +# Input variables: +# +# - `MSH3_INCLUDE_DIR`: The msh3 include directory. +# - `MSH3_LIBRARY`: Path to `msh3` library. +# +# Result variables: +# +# - `MSH3_FOUND`: System has msh3. +# - `MSH3_INCLUDE_DIRS`: The msh3 include directories. +# - `MSH3_LIBRARIES`: The msh3 library names. +# - `MSH3_LIBRARY_DIRS`: The msh3 library directories. +# - `MSH3_PC_REQUIRES`: The msh3 pkg-config packages. +# - `MSH3_CFLAGS`: Required compiler flags. +# - `MSH3_VERSION`: Version of msh3. + +set(MSH3_PC_REQUIRES "libmsh3") + +if(CURL_USE_PKGCONFIG AND + NOT DEFINED MSH3_INCLUDE_DIR AND + NOT DEFINED MSH3_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(MSH3 ${MSH3_PC_REQUIRES}) +endif() + +if(MSH3_FOUND) + string(REPLACE ";" " " MSH3_CFLAGS "${MSH3_CFLAGS}") + message(STATUS "Found MSH3 (via pkg-config): ${MSH3_INCLUDE_DIRS} (found version \"${MSH3_VERSION}\")") +else() + set(MSH3_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config + + find_path(MSH3_INCLUDE_DIR NAMES "msh3.h") + find_library(MSH3_LIBRARY NAMES "msh3") + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(MSH3 + REQUIRED_VARS + MSH3_INCLUDE_DIR + MSH3_LIBRARY + ) + + if(MSH3_FOUND) + set(MSH3_INCLUDE_DIRS ${MSH3_INCLUDE_DIR}) + set(MSH3_LIBRARIES ${MSH3_LIBRARY}) + endif() + + mark_as_advanced(MSH3_INCLUDE_DIR MSH3_LIBRARY) +endif() diff --git a/curl/CMake/FindMbedTLS.cmake b/curl/CMake/FindMbedTLS.cmake index a91639589..fcd6afb3a 100644 --- a/curl/CMake/FindMbedTLS.cmake +++ b/curl/CMake/FindMbedTLS.cmake @@ -1,13 +1,110 @@ -find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h) +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The mbedTLS include directory. +# - `MBEDTLS_LIBRARY`: Path to `mbedtls` library. +# - `MBEDX509_LIBRARY`: Path to `mbedx509` library. +# - `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library. +# +# Result variables: +# +# - `MBEDTLS_FOUND`: System has mbedTLS. +# - `MBEDTLS_INCLUDE_DIRS`: The mbedTLS include directories. +# - `MBEDTLS_LIBRARIES`: The mbedTLS library names. +# - `MBEDTLS_LIBRARY_DIRS`: The mbedTLS library directories. +# - `MBEDTLS_PC_REQUIRES`: The mbedTLS pkg-config packages. +# - `MBEDTLS_CFLAGS`: Required compiler flags. +# - `MBEDTLS_VERSION`: Version of mbedTLS. -find_library(MBEDTLS_LIBRARY mbedtls) -find_library(MBEDX509_LIBRARY mbedx509) -find_library(MBEDCRYPTO_LIBRARY mbedcrypto) +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_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}") +set(MBEDTLS_PC_REQUIRES "mbedtls" "mbedx509" "mbedcrypto") -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MBEDTLS DEFAULT_MSG - MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) +if(CURL_USE_PKGCONFIG AND + NOT DEFINED MBEDTLS_INCLUDE_DIR AND + NOT DEFINED MBEDTLS_LIBRARY AND + NOT DEFINED MBEDX509_LIBRARY AND + NOT DEFINED MBEDCRYPTO_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(MBEDTLS ${MBEDTLS_PC_REQUIRES}) +endif() -mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY) +if(MBEDTLS_FOUND) + set(MbedTLS_FOUND TRUE) + set(MBEDTLS_VERSION "${MBEDTLS_mbedtls_VERSION}") + string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}") + message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") +else() + set(MBEDTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config + + find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h") + find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls") + find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509") + find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto") + + unset(MBEDTLS_VERSION CACHE) + if(MBEDTLS_INCLUDE_DIR) + if(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h") # 3.x + set(_version_header "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h") + elseif(EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h") # 2.x + set(_version_header "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h") + else() + unset(_version_header) + endif() + if(_version_header) + set(_version_regex "#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"([0-9.]+)\"") + file(STRINGS "${_version_header}" _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) + unset(_version_header) + endif() + 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() diff --git a/curl/CMake/FindNGHTTP2.cmake b/curl/CMake/FindNGHTTP2.cmake index 4e566cf02..b8f37fdae 100644 --- a/curl/CMake/FindNGHTTP2.cmake +++ b/curl/CMake/FindNGHTTP2.cmake @@ -1,18 +1,82 @@ -include(FindPackageHandleStandardArgs) +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The nghttp2 include directory. +# - `NGHTTP2_LIBRARY`: Path to `nghttp2` library. +# +# Result variables: +# +# - `NGHTTP2_FOUND`: System has nghttp2. +# - `NGHTTP2_INCLUDE_DIRS`: The nghttp2 include directories. +# - `NGHTTP2_LIBRARIES`: The nghttp2 library names. +# - `NGHTTP2_LIBRARY_DIRS`: The nghttp2 library directories. +# - `NGHTTP2_PC_REQUIRES`: The nghttp2 pkg-config packages. +# - `NGHTTP2_CFLAGS`: Required compiler flags. +# - `NGHTTP2_VERSION`: Version of nghttp2. -find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h") +set(NGHTTP2_PC_REQUIRES "libnghttp2") -find_library(NGHTTP2_LIBRARY NAMES nghttp2) +if(CURL_USE_PKGCONFIG AND + NOT DEFINED NGHTTP2_INCLUDE_DIR AND + NOT DEFINED NGHTTP2_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(NGHTTP2 ${NGHTTP2_PC_REQUIRES}) +endif() -find_package_handle_standard_args(NGHTTP2 - FOUND_VAR - NGHTTP2_FOUND +if(NGHTTP2_FOUND) + string(REPLACE ";" " " NGHTTP2_CFLAGS "${NGHTTP2_CFLAGS}") + message(STATUS "Found NGHTTP2 (via pkg-config): ${NGHTTP2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")") +else() + find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h") + find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static") + + 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_LIBRARY NGHTTP2_INCLUDE_DIR - FAIL_MESSAGE - "Could NOT find NGHTTP2" -) + NGHTTP2_LIBRARY + VERSION_VAR + NGHTTP2_VERSION + ) + + if(NGHTTP2_FOUND) + set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR}) + set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY}) + endif() -set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR} ) -set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY}) + mark_as_advanced(NGHTTP2_INCLUDE_DIR NGHTTP2_LIBRARY) +endif() diff --git a/curl/CMake/FindNGHTTP3.cmake b/curl/CMake/FindNGHTTP3.cmake new file mode 100644 index 000000000..99edd1995 --- /dev/null +++ b/curl/CMake/FindNGHTTP3.cmake @@ -0,0 +1,82 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The nghttp3 include directory. +# - `NGHTTP3_LIBRARY`: Path to `nghttp3` library. +# +# Result variables: +# +# - `NGHTTP3_FOUND`: System has nghttp3. +# - `NGHTTP3_INCLUDE_DIRS`: The nghttp3 include directories. +# - `NGHTTP3_LIBRARIES`: The nghttp3 library names. +# - `NGHTTP3_LIBRARY_DIRS`: The nghttp3 library directories. +# - `NGHTTP3_PC_REQUIRES`: The nghttp3 pkg-config packages. +# - `NGHTTP3_CFLAGS`: Required compiler flags. +# - `NGHTTP3_VERSION`: Version of nghttp3. + +set(NGHTTP3_PC_REQUIRES "libnghttp3") + +if(CURL_USE_PKGCONFIG AND + NOT DEFINED NGHTTP3_INCLUDE_DIR AND + NOT DEFINED NGHTTP3_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(NGHTTP3 ${NGHTTP3_PC_REQUIRES}) +endif() + +if(NGHTTP3_FOUND) + string(REPLACE ";" " " NGHTTP3_CFLAGS "${NGHTTP3_CFLAGS}") + message(STATUS "Found NGHTTP3 (via pkg-config): ${NGHTTP3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")") +else() + find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h") + find_library(NGHTTP3_LIBRARY NAMES "nghttp3") + + 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() diff --git a/curl/CMake/FindNGTCP2.cmake b/curl/CMake/FindNGTCP2.cmake new file mode 100644 index 000000000..02e7652ab --- /dev/null +++ b/curl/CMake/FindNGTCP2.cmake @@ -0,0 +1,128 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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): +# +# - quictls: Use `libngtcp2_crypto_quictls`. (choose this for LibreSSL) +# - BoringSSL: Use `libngtcp2_crypto_boringssl`. (choose this for AWS-LC) +# - wolfSSL: Use `libngtcp2_crypto_wolfssl`. +# - GnuTLS: Use `libngtcp2_crypto_gnutls`. +# - ossl: Use `libngtcp2_crypto_ossl`. +# +# Input variables: +# +# - `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory. +# - `NGTCP2_LIBRARY`: Path to `ngtcp2` library. +# - `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library. +# - `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library. +# - `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library. +# - `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library. +# - `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library. +# +# Result variables: +# +# - `NGTCP2_FOUND`: System has ngtcp2. +# - `NGTCP2_INCLUDE_DIRS`: The ngtcp2 include directories. +# - `NGTCP2_LIBRARIES`: The ngtcp2 library names. +# - `NGTCP2_LIBRARY_DIRS`: The ngtcp2 library directories. +# - `NGTCP2_PC_REQUIRES`: The ngtcp2 pkg-config packages. +# - `NGTCP2_CFLAGS`: Required compiler flags. +# - `NGTCP2_VERSION`: Version of ngtcp2. + +if(NGTCP2_FIND_COMPONENTS) + set(_ngtcp2_crypto_backend "") + foreach(_component IN LISTS NGTCP2_FIND_COMPONENTS) + if(_component MATCHES "^(BoringSSL|GnuTLS|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() + +if(CURL_USE_PKGCONFIG AND + NOT DEFINED NGTCP2_INCLUDE_DIR AND + NOT DEFINED NGTCP2_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(NGTCP2 ${NGTCP2_PC_REQUIRES}) +endif() + +if(NGTCP2_FOUND) + set(NGTCP2_VERSION "${NGTCP2_libngtcp2_VERSION}") + string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}") + message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") +else() + find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h") + find_library(NGTCP2_LIBRARY NAMES "ngtcp2") + + 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) + get_filename_component(_ngtcp2_library_dir "${NGTCP2_LIBRARY}" DIRECTORY) + find_library(${_crypto_library_upper}_LIBRARY NAMES ${_crypto_library_lower} HINTS ${_ngtcp2_library_dir}) + + if(${_crypto_library_upper}_LIBRARY) + set(NGTCP2_${_ngtcp2_crypto_backend}_FOUND TRUE) + 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) +endif() diff --git a/curl/CMake/FindNettle.cmake b/curl/CMake/FindNettle.cmake new file mode 100644 index 000000000..c2decf6e7 --- /dev/null +++ b/curl/CMake/FindNettle.cmake @@ -0,0 +1,88 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The nettle include directory. +# - `NETTLE_LIBRARY`: Path to `nettle` library. +# +# Result variables: +# +# - `NETTLE_FOUND`: System has nettle. +# - `NETTLE_INCLUDE_DIRS`: The nettle include directories. +# - `NETTLE_LIBRARIES`: The nettle library names. +# - `NETTLE_LIBRARY_DIRS`: The nettle library directories. +# - `NETTLE_PC_REQUIRES`: The nettle pkg-config packages. +# - `NETTLE_CFLAGS`: Required compiler flags. +# - `NETTLE_VERSION`: Version of nettle. + +set(NETTLE_PC_REQUIRES "nettle") + +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) + string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}") + message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")") +else() + find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h") + find_library(NETTLE_LIBRARY NAMES "nettle") + + 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() diff --git a/curl/CMake/FindQUICHE.cmake b/curl/CMake/FindQUICHE.cmake new file mode 100644 index 000000000..6939c64e0 --- /dev/null +++ b/curl/CMake/FindQUICHE.cmake @@ -0,0 +1,71 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The quiche include directory. +# - `QUICHE_LIBRARY`: Path to `quiche` library. +# +# Result variables: +# +# - `QUICHE_FOUND`: System has quiche. +# - `QUICHE_INCLUDE_DIRS`: The quiche include directories. +# - `QUICHE_LIBRARIES`: The quiche library names. +# - `QUICHE_LIBRARY_DIRS`: The quiche library directories. +# - `QUICHE_PC_REQUIRES`: The quiche pkg-config packages. +# - `QUICHE_CFLAGS`: Required compiler flags. +# - `QUICHE_VERSION`: Version of quiche. + +set(QUICHE_PC_REQUIRES "quiche") + +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) + string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}") + message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")") +else() + find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h") + find_library(QUICHE_LIBRARY NAMES "quiche") + + 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() diff --git a/curl/CMake/FindRustls.cmake b/curl/CMake/FindRustls.cmake new file mode 100644 index 000000000..564b08ce1 --- /dev/null +++ b/curl/CMake/FindRustls.cmake @@ -0,0 +1,109 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The Rustls include directory. +# - `RUSTLS_LIBRARY`: Path to `rustls` library. +# +# Result variables: +# +# - `RUSTLS_FOUND`: System has Rustls. +# - `RUSTLS_INCLUDE_DIRS`: The Rustls include directories. +# - `RUSTLS_LIBRARIES`: The Rustls library names. +# - `RUSTLS_LIBRARY_DIRS`: The Rustls library directories. +# - `RUSTLS_PC_REQUIRES`: The Rustls pkg-config packages. +# - `RUSTLS_CFLAGS`: Required compiler flags. +# - `RUSTLS_VERSION`: Version of Rustls. + +set(RUSTLS_PC_REQUIRES "rustls") + +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) + string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}") + message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")") +else() + set(RUSTLS_PC_REQUIRES "") # Depend on pkg-config only when found via pkg-config + + 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() +endif() diff --git a/curl/CMake/FindWolfSSH.cmake b/curl/CMake/FindWolfSSH.cmake new file mode 100644 index 000000000..98de656b9 --- /dev/null +++ b/curl/CMake/FindWolfSSH.cmake @@ -0,0 +1,65 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### +# Find the wolfSSH library +# +# Input variables: +# +# - `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory. +# - `WOLFSSH_LIBRARY`: Path to `wolfssh` library. +# +# Result variables: +# +# - `WOLFSSH_FOUND`: System has wolfSSH. +# - `WOLFSSH_INCLUDE_DIRS`: The wolfSSH include directories. +# - `WOLFSSH_LIBRARIES`: The wolfSSH library names. +# - `WOLFSSH_VERSION`: Version of wolfSSH. + +find_path(WOLFSSH_INCLUDE_DIR NAMES "wolfssh/ssh.h") +find_library(WOLFSSH_LIBRARY NAMES "wolfssh" "libwolfssh") + +unset(WOLFSSH_VERSION CACHE) +if(WOLFSSH_INCLUDE_DIR AND EXISTS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h") + set(_version_regex "#[\t ]*define[\t ]+LIBWOLFSSH_VERSION_STRING[\t ]+\"([^\"]*)\"") + file(STRINGS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h" _version_str REGEX "${_version_regex}") + string(REGEX REPLACE "${_version_regex}" "\\1" _version_str "${_version_str}") + set(WOLFSSH_VERSION "${_version_str}") + unset(_version_regex) + unset(_version_str) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WolfSSH + REQUIRED_VARS + WOLFSSH_INCLUDE_DIR + WOLFSSH_LIBRARY + VERSION_VAR + WOLFSSH_VERSION +) + +if(WOLFSSH_FOUND) + set(WOLFSSH_INCLUDE_DIRS ${WOLFSSH_INCLUDE_DIR}) + set(WOLFSSH_LIBRARIES ${WOLFSSH_LIBRARY}) +endif() + +mark_as_advanced(WOLFSSH_INCLUDE_DIR WOLFSSH_LIBRARY) diff --git a/curl/CMake/FindWolfSSL.cmake b/curl/CMake/FindWolfSSL.cmake new file mode 100644 index 000000000..e33fef871 --- /dev/null +++ b/curl/CMake/FindWolfSSL.cmake @@ -0,0 +1,100 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The wolfSSL include directory. +# - `WOLFSSL_LIBRARY`: Path to `wolfssl` library. +# +# Result variables: +# +# - `WOLFSSL_FOUND`: System has wolfSSL. +# - `WOLFSSL_INCLUDE_DIRS`: The wolfSSL include directories. +# - `WOLFSSL_LIBRARIES`: The wolfSSL library names. +# - `WOLFSSL_LIBRARY_DIRS`: The wolfSSL library directories. +# - `WOLFSSL_PC_REQUIRES`: The wolfSSL pkg-config packages. +# - `WOLFSSL_CFLAGS`: Required compiler flags. +# - `WOLFSSL_VERSION`: Version of wolfSSL. + +if(DEFINED WolfSSL_INCLUDE_DIR AND NOT DEFINED WOLFSSL_INCLUDE_DIR) + message(WARNING "WolfSSL_INCLUDE_DIR is deprecated, use WOLFSSL_INCLUDE_DIR instead.") + 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(CURL_USE_PKGCONFIG AND + NOT DEFINED WOLFSSL_INCLUDE_DIR AND + NOT DEFINED WOLFSSL_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(WOLFSSL ${WOLFSSL_PC_REQUIRES}) +endif() + +if(WOLFSSL_FOUND) + set(WolfSSL_FOUND TRUE) + string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}") + message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")") +else() + find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h") + find_library(WOLFSSL_LIBRARY NAMES "wolfssl") + + 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 AND NOT WIN32) + 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() diff --git a/curl/CMake/FindZstd.cmake b/curl/CMake/FindZstd.cmake new file mode 100644 index 000000000..0ea1fef46 --- /dev/null +++ b/curl/CMake/FindZstd.cmake @@ -0,0 +1,102 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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`: The zstd include directory. +# - `ZSTD_LIBRARY`: Path to `zstd` library. +# +# Result variables: +# +# - `ZSTD_FOUND`: System has zstd. +# - `ZSTD_INCLUDE_DIRS`: The zstd include directories. +# - `ZSTD_LIBRARIES`: The zstd library names. +# - `ZSTD_LIBRARY_DIRS`: The zstd library directories. +# - `ZSTD_PC_REQUIRES`: The zstd pkg-config packages. +# - `ZSTD_CFLAGS`: Required compiler flags. +# - `ZSTD_VERSION`: Version of zstd. + +if(DEFINED Zstd_INCLUDE_DIR AND NOT DEFINED ZSTD_INCLUDE_DIR) + message(WARNING "Zstd_INCLUDE_DIR is deprecated, use ZSTD_INCLUDE_DIR instead.") + 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(CURL_USE_PKGCONFIG AND + NOT DEFINED ZSTD_INCLUDE_DIR AND + NOT DEFINED ZSTD_LIBRARY) + find_package(PkgConfig QUIET) + pkg_check_modules(ZSTD ${ZSTD_PC_REQUIRES}) +endif() + +if(ZSTD_FOUND) + set(Zstd_FOUND TRUE) + string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}") + message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")") +else() + find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h") + find_library(ZSTD_LIBRARY NAMES "zstd") + + 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() diff --git a/curl/CMake/Macros.cmake b/curl/CMake/Macros.cmake index 82aadca9d..710df7011 100644 --- a/curl/CMake/Macros.cmake +++ b/curl/CMake/Macros.cmake @@ -1,124 +1,174 @@ -#File defines convenience macros for available feature testing - -# This macro checks if the symbol exists in the library and if it -# does, it prepends library to the list. It is intended to be called -# multiple times with a sequence of possibly dependent libraries in -# order of least-to-most-dependent. Some libraries depend on others -# to link correctly. -macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) - check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}" - ${VARIABLE}) - if(${VARIABLE}) - set(CURL_LIBS ${LIBRARY} ${CURL_LIBS}) - endif(${VARIABLE}) -endmacro(CHECK_LIBRARY_EXISTS_CONCAT) +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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 FILE VARIABLE) - check_include_files("${CURL_INCLUDES};${FILE}" ${VARIABLE}) - if(${VARIABLE}) - set(CURL_INCLUDES ${CURL_INCLUDES} ${FILE}) - set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}") - endif(${VARIABLE}) -endmacro(CHECK_INCLUDE_FILE_CONCAT) +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. -macro(CURL_INTERNAL_TEST CURL_TEST) - if(NOT DEFINED "${CURL_TEST}") - set(MACRO_CHECK_FUNCTION_DEFINITIONS - "-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}") +# Return result in variable: CURL_TEST_OUTPUT +macro(curl_internal_test _curl_test) + if(NOT DEFINED "${_curl_test}") + string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}") + set(_curl_test_add_libraries "") if(CMAKE_REQUIRED_LIBRARIES) - set(CURL_TEST_ADD_LIBRARIES + set(_curl_test_add_libraries "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif(CMAKE_REQUIRED_LIBRARIES) - - message(STATUS "Performing Curl Test ${CURL_TEST}") - try_compile(${CURL_TEST} - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - "${CURL_TEST_ADD_LIBRARIES}" - OUTPUT_VARIABLE OUTPUT) - if(${CURL_TEST}) - set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}") - message(STATUS "Performing Curl Test ${CURL_TEST} - Success") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing Curl Test ${CURL_TEST} passed with the following output:\n" - "${OUTPUT}\n") - else(${CURL_TEST}) - message(STATUS "Performing Curl Test ${CURL_TEST} - Failed") - set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Performing Curl Test ${CURL_TEST} failed with the following output:\n" - "${OUTPUT}\n") - endif(${CURL_TEST}) + endif() + + message(STATUS "Performing Test ${_curl_test}") + try_compile(${_curl_test} + ${PROJECT_BINARY_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c" + CMAKE_FLAGS + "-DCOMPILE_DEFINITIONS:STRING=-D${_curl_test} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS} ${_cmake_required_definitions}" + "${_curl_test_add_libraries}" + OUTPUT_VARIABLE CURL_TEST_OUTPUT) + if(${_curl_test}) + set(${_curl_test} 1 CACHE INTERNAL "Curl test") + 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(CURL_INTERNAL_TEST) +endmacro() -macro(CURL_INTERNAL_TEST_RUN CURL_TEST) - if(NOT DEFINED "${CURL_TEST}_COMPILE") - set(MACRO_CHECK_FUNCTION_DEFINITIONS - "-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}") - if(CMAKE_REQUIRED_LIBRARIES) - set(CURL_TEST_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif(CMAKE_REQUIRED_LIBRARIES) - - message(STATUS "Performing Curl Test ${CURL_TEST}") - try_run(${CURL_TEST} ${CURL_TEST}_COMPILE - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - "${CURL_TEST_ADD_LIBRARIES}" - OUTPUT_VARIABLE OUTPUT) - if(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST}) - set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}") - message(STATUS "Performing Curl Test ${CURL_TEST} - Success") - else(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST}) - message(STATUS "Performing Curl Test ${CURL_TEST} - Failed") - set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}") - file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" - "Performing Curl Test ${CURL_TEST} failed with the following output:\n" - "${OUTPUT}") - if(${CURL_TEST}_COMPILE) - file(APPEND - "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" - "There was a problem running this test\n") - endif(${CURL_TEST}_COMPILE) - file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" - "\n\n") - endif(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST}) +# 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") + find_package(${_find_name}) + elseif(${_option_name}) + find_package(${_find_name} REQUIRED) + 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_options _target) + get_target_property(_val ${_target} INTERFACE_INCLUDE_DIRECTORIES) + if(_val) + list(APPEND _includes ${_val}) + endif() + get_target_property(_val ${_target} INCLUDE_DIRECTORIES) + if(_val) + list(APPEND _includes ${_val}) endif() -endmacro(CURL_INTERNAL_TEST_RUN) - -macro(CURL_NROFF_CHECK) - find_program(NROFF NAMES gnroff nroff) - if(NROFF) - # Need a way to write to stdin, this will do - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt" "test") - # Tests for a valid nroff option to generate a manpage - foreach(_MANOPT "-man" "-mandoc") - execute_process(COMMAND "${NROFF}" ${_MANOPT} - OUTPUT_VARIABLE NROFF_MANOPT_OUTPUT - INPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt" - ERROR_QUIET) - # Save the option if it was valid - if(NROFF_MANOPT_OUTPUT) - message("Found *nroff option: -- ${_MANOPT}") - set(NROFF_MANOPT ${_MANOPT}) - set(NROFF_USEFUL ON) - break() + get_target_property(_val ${_target} COMPILE_DEFINITIONS) + if(_val) + list(APPEND _definitions ${_val}) + endif() + get_target_property(_val ${_target} LINK_LIBRARIES) + if(_val) + foreach(_lib IN LISTS _val) + if(TARGET "${_lib}") + curl_collect_target_options(${_lib}) endif() endforeach() - # No need for the temporary file - file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt") - if(NOT NROFF_USEFUL) - message(WARNING "Found no *nroff option to get plaintext from man pages") + endif() + unset(_val) +endmacro() + +# Create a clang-tidy target for test targets +macro(curl_add_clang_tidy_test_target _target_clang_tidy _target) + if(CURL_CLANG_TIDY) + + set(_includes "") + set(_definitions "") + + # Collect header directories and macro definitions applying to the directory + get_directory_property(_val INCLUDE_DIRECTORIES) + if(_val) + list(APPEND _includes ${_val}) endif() - else() - message(WARNING "Found no *nroff program") + get_directory_property(_val COMPILE_DEFINITIONS) + if(_val) + list(APPEND _definitions ${_val}) + endif() + unset(_val) + + # Collect header directories and macro definitions from lib dependencies + curl_collect_target_options(${_target}) + + list(REMOVE_ITEM _includes "") + string(REPLACE ";" ";-I" _includes ";${_includes}") + list(REMOVE_DUPLICATES _includes) + + list(REMOVE_ITEM _definitions "") + string(REPLACE ";" ";-D" _definitions ";${_definitions}") + list(REMOVE_DUPLICATES _definitions) + list(SORT _definitions) # Sort like CMake does + + # Assemble source list + set(_sources "") + 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() + + add_custom_target(${_target_clang_tidy} USES_TERMINAL + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMAND ${CMAKE_C_CLANG_TIDY} ${_sources} -- ${_includes} ${_definitions} + DEPENDS ${_sources}) + add_dependencies(tests-clang-tidy ${_target_clang_tidy}) + + unset(_includes) + unset(_definitions) + unset(_sources) endif() -endmacro(CURL_NROFF_CHECK) +endmacro() diff --git a/curl/CMake/OtherTests.cmake b/curl/CMake/OtherTests.cmake index 989f04eb2..9f59e0dc8 100644 --- a/curl/CMake/OtherTests.cmake +++ b/curl/CMake/OtherTests.cmake @@ -1,232 +1,162 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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) -# The begin of the sources (macros and includes) -set(_source_epilogue "#undef inline") - -macro(add_header_include check header) - if(${check}) - set(_source_epilogue "${_source_epilogue}\n#include <${header}>") - endif(${check}) -endmacro(add_header_include) - -set(signature_call_conv) -if(HAVE_WINDOWS_H) - add_header_include(HAVE_WINSOCK2_H "winsock2.h") - add_header_include(HAVE_WINDOWS_H "windows.h") - add_header_include(HAVE_WINSOCK_H "winsock.h") - set(_source_epilogue - "${_source_epilogue}\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif") - set(signature_call_conv "PASCAL") - if(HAVE_LIBWS2_32) - set(CMAKE_REQUIRED_LIBRARIES ws2_32) - endif() -else(HAVE_WINDOWS_H) - add_header_include(HAVE_SYS_TYPES_H "sys/types.h") - add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h") -endif(HAVE_WINDOWS_H) +include(CheckCSourceRuns) +include(CheckTypeSize) -check_c_source_compiles("${_source_epilogue} -int main(void) { - recv(0, 0, 0, 0); - return 0; -}" curl_cv_recv) -if(curl_cv_recv) - if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown") - foreach(recv_retv "int" "ssize_t" ) - foreach(recv_arg1 "SOCKET" "int" ) - foreach(recv_arg2 "char *" "void *" ) - foreach(recv_arg3 "int" "size_t" "socklen_t" "unsigned int") - foreach(recv_arg4 "int" "unsigned int") - if(NOT curl_cv_func_recv_done) - unset(curl_cv_func_recv_test CACHE) - check_c_source_compiles(" - ${_source_epilogue} - extern ${recv_retv} ${signature_call_conv} - recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4}); - int main(void) { - ${recv_arg1} s=0; - ${recv_arg2} buf=0; - ${recv_arg3} len=0; - ${recv_arg4} flags=0; - ${recv_retv} res = recv(s, buf, len, flags); - (void) res; - return 0; - }" - curl_cv_func_recv_test) - message(STATUS - "Tested: ${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})") - if(curl_cv_func_recv_test) - set(curl_cv_func_recv_args - "${recv_arg1},${recv_arg2},${recv_arg3},${recv_arg4},${recv_retv}") - set(RECV_TYPE_ARG1 "${recv_arg1}") - set(RECV_TYPE_ARG2 "${recv_arg2}") - set(RECV_TYPE_ARG3 "${recv_arg3}") - set(RECV_TYPE_ARG4 "${recv_arg4}") - set(RECV_TYPE_RETV "${recv_retv}") - set(HAVE_RECV 1) - set(curl_cv_func_recv_done 1) - endif(curl_cv_func_recv_test) - endif(NOT curl_cv_func_recv_done) - endforeach(recv_arg4) - endforeach(recv_arg3) - endforeach(recv_arg2) - endforeach(recv_arg1) - endforeach(recv_retv) - else() - string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}") - string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}") - string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}") - string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}") - string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}") +# #include header if condition is true +macro(curl_add_header_include _check _header) + if(${_check}) + set(_source_epilogue "${_source_epilogue} + #include <${_header}>") endif() +endmacro() - if("${curl_cv_func_recv_args}" STREQUAL "unknown") - message(FATAL_ERROR "Cannot find proper types to use for recv args") - endif("${curl_cv_func_recv_args}" STREQUAL "unknown") -else(curl_cv_recv) - message(FATAL_ERROR "Unable to link function recv") -endif(curl_cv_recv) -set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv") -set(HAVE_RECV 1) +set(_cmake_try_compile_target_type_save ${CMAKE_TRY_COMPILE_TARGET_TYPE}) +set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") -check_c_source_compiles("${_source_epilogue} -int main(void) { - send(0, 0, 0, 0); - return 0; -}" curl_cv_send) -if(curl_cv_send) - if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown") - foreach(send_retv "int" "ssize_t" ) - foreach(send_arg1 "SOCKET" "int" "ssize_t" ) - foreach(send_arg2 "const char *" "const void *" "void *" "char *") - foreach(send_arg3 "int" "size_t" "socklen_t" "unsigned int") - foreach(send_arg4 "int" "unsigned int") - if(NOT curl_cv_func_send_done) - unset(curl_cv_func_send_test CACHE) - check_c_source_compiles(" - ${_source_epilogue} - extern ${send_retv} ${signature_call_conv} - send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4}); - int main(void) { - ${send_arg1} s=0; - ${send_arg2} buf=0; - ${send_arg3} len=0; - ${send_arg4} flags=0; - ${send_retv} res = send(s, buf, len, flags); - (void) res; - return 0; - }" - curl_cv_func_send_test) - message(STATUS - "Tested: ${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})") - if(curl_cv_func_send_test) - string(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}") - string(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}") - set(curl_cv_func_send_args - "${send_arg1},${send_arg2},${send_arg3},${send_arg4},${send_retv},${send_qual_arg2}") - set(SEND_TYPE_ARG1 "${send_arg1}") - set(SEND_TYPE_ARG2 "${send_arg2}") - set(SEND_TYPE_ARG3 "${send_arg3}") - set(SEND_TYPE_ARG4 "${send_arg4}") - set(SEND_TYPE_RETV "${send_retv}") - set(HAVE_SEND 1) - set(curl_cv_func_send_done 1) - endif(curl_cv_func_send_test) - endif(NOT curl_cv_func_send_done) - endforeach(send_arg4) - endforeach(send_arg3) - endforeach(send_arg2) - endforeach(send_arg1) - endforeach(send_retv) +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() - string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}") - string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}") - string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}") - string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}") - string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}") - string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}") + 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() - if("${curl_cv_func_send_args}" STREQUAL "unknown") - message(FATAL_ERROR "Cannot find proper types to use for send args") - endif("${curl_cv_func_send_args}" STREQUAL "unknown") - set(SEND_QUAL_ARG2 "const") -else(curl_cv_send) - message(FATAL_ERROR "Unable to link function send") -endif(curl_cv_send) -set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send") -set(HAVE_SEND 1) +if(NOT WIN32) + set(_source_epilogue "#undef inline") + curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h") + check_c_source_compiles("${_source_epilogue} + #include + int main(void) + { + int flag = MSG_NOSIGNAL; + (void)flag; + return 0; + }" HAVE_MSG_NOSIGNAL) +endif() +set(_source_epilogue "#undef inline") check_c_source_compiles("${_source_epilogue} - int main(void) { - int flag = MSG_NOSIGNAL; - (void)flag; + #ifdef _MSC_VER + #include + #endif + #ifndef _WIN32 + #include + #endif + #include + int main(void) + { + struct timeval ts; + ts.tv_sec = 0; + ts.tv_usec = 0; + (void)ts; return 0; - }" HAVE_MSG_NOSIGNAL) + }" HAVE_STRUCT_TIMEVAL) -if(NOT HAVE_WINDOWS_H) - add_header_include(HAVE_SYS_TIME_H "sys/time.h") - add_header_include(TIME_WITH_SYS_TIME "time.h") - add_header_include(HAVE_TIME_H "time.h") -endif() -check_c_source_compiles("${_source_epilogue} -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 -include(CheckCSourceRuns) -# See HAVE_POLL in CMakeLists.txt for why poll is disabled on macOS -if(NOT APPLE) - set(CMAKE_REQUIRED_FLAGS) - if(HAVE_SYS_POLL_H) - set(CMAKE_REQUIRED_FLAGS "-DHAVE_SYS_POLL_H") - endif(HAVE_SYS_POLL_H) - check_c_source_runs(" - #ifdef HAVE_SYS_POLL_H - # include - #endif - int main(void) { - return poll((void *)0, 0, 10 /*ms*/); - }" HAVE_POLL_FINE) +if(WIN32) + set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO}) +elseif(NOT HAVE_GETADDRINFO) + set(HAVE_GETADDRINFO_THREADSAFE FALSE) +elseif(APPLE 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() -set(HAVE_SIG_ATOMIC_T 1) -set(CMAKE_REQUIRED_FLAGS) -if(HAVE_SIGNAL_H) - set(CMAKE_REQUIRED_FLAGS "-DHAVE_SIGNAL_H") - set(CMAKE_EXTRA_INCLUDE_FILES "signal.h") -endif(HAVE_SIGNAL_H) -check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T) -if(HAVE_SIZEOF_SIG_ATOMIC_T) - check_c_source_compiles(" - #ifdef HAVE_SIGNAL_H - # include +if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE) + set(_source_epilogue "#undef inline + #ifndef _WIN32 + #include + #include + #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 - int main(void) { - static volatile sig_atomic_t dummy = 0; - (void)dummy; return 0; - }" HAVE_SIG_ATOMIC_T_NOT_VOLATILE) - if(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE) - set(HAVE_SIG_ATOMIC_T_VOLATILE 1) - endif(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE) -endif(HAVE_SIZEOF_SIG_ATOMIC_T) + }" HAVE_H_ERRNO) -if(HAVE_WINDOWS_H) - set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h) -else() - set(CMAKE_EXTRA_INCLUDE_FILES) - if(HAVE_SYS_SOCKET_H) - set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) - endif(HAVE_SYS_SOCKET_H) + 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() -check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE) -if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE) - set(HAVE_STRUCT_SOCKADDR_STORAGE 1) -endif(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE) +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 + #include + int main(void) + { + struct timespec ts; + (void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts); + return 0; + }" HAVE_CLOCK_GETTIME_MONOTONIC_RAW) +endif() +unset(_source_epilogue) diff --git a/curl/CMake/PickyWarnings.cmake b/curl/CMake/PickyWarnings.cmake new file mode 100644 index 000000000..7838f6f8b --- /dev/null +++ b/curl/CMake/PickyWarnings.cmake @@ -0,0 +1,361 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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) + else() + if(MSVC) + list(APPEND _picky_nocheck "-WX") + else() # llvm/clang and gcc style options + list(APPEND _picky_nocheck "-Werror") + endif() + endif() + + if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND + 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.3)) + list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.3 +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") + 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) + if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") + + # https://clang.llvm.org/docs/DiagnosticsReference.html + # https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html + + # _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 -pedantic + ) + + # ---------------------------------- + # Add new options here, if in doubt: + # ---------------------------------- + set(_picky_detect + ) + + # 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 3.0 gcc 3.4.6 + -Wdeclaration-after-statement # clang 1.0 gcc 3.4 + -Wdiv-by-zero # clang 2.7 gcc 4.1 + -Wempty-body # clang 2.7 gcc 4.3 + -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-format-nonliteral # clang 1.0 gcc 2.96 (3.0) + -Wno-sign-conversion # clang 2.9 gcc 4.3 + -Wno-system-headers # clang 1.0 gcc 3.0 + # -Wpadded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs + -Wold-style-definition # clang 2.7 gcc 3.4 + -Wredundant-decls # clang 2.7 gcc 4.1 + -Wstrict-prototypes # clang 1.0 gcc 3.3 + # -Wswitch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case + -Wtype-limits # clang 2.7 gcc 4.3 + -Wunreachable-code # clang 2.7 gcc 4.1 + # -Wunused-macros # clang 2.7 gcc 4.1 # Not practical + # -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} + -Wshift-sign-overflow # clang 2.9 + -Wshorten-64-to-32 # clang 1.0 + -Wformat=2 # clang 3.0 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_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.3)) + list(APPEND _picky_enable + -Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.3 + -Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.6 g++ 11.0 + -Wheader-guard # clang 3.4 appleclang 5.1 + -Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0 + -Wsometimes-uninitialized # clang 3.2 appleclang 4.6 + # -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds + -Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1 + ) + endif() + if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR + (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.3)) + list(APPEND _picky_enable + -Wcomma # clang 3.9 appleclang 8.3 + -Wmissing-variable-declarations # clang 3.2 appleclang 4.6 + ) + 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 10.3)) + list(APPEND _picky_enable + -Wassign-enum # clang 7.0 appleclang 10.3 + -Wextra-semi-stmt # clang 7.0 appleclang 10.3 + ) + endif() + if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) OR + (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.4)) + list(APPEND _picky_enable + -Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 12.4 # We do silencing for clang 10.0 and above only + -Wxor-used-as-pow # clang 10.0 gcc 13.0 + ) + endif() + 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 # gcc 4.5 + ) + 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.3 + -Wformat=2 # clang 3.0 gcc 4.8 + -Wtrampolines # gcc 4.6 + ) + endif() + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) + list(APPEND _picky_enable + -Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds) + ) + endif() + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) + list(APPEND _picky_enable + -Wduplicated-cond # gcc 6.0 + -Wnull-dereference # clang 3.0 gcc 6.0 (clang default) + -fdelete-null-pointer-checks + -Wshift-negative-value # clang 3.7 gcc 6.0 (clang default) + -Wshift-overflow=2 # clang 3.0 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 + -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.6 g++ 11.0 + ) + endif() + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) + list(APPEND _picky_enable + -Warray-compare # clang 20.0 gcc 12.0 + -Wenum-int-mismatch # gcc 13.0 + -Wxor-used-as-pow # clang 10.0 gcc 13.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() + + # + + set(_picky_skipped "") + foreach(_ccopt IN LISTS _picky_enable) + string(REGEX MATCH "-W([a-z0-9-]+)" _ccmatch "${_ccopt}") + if(_ccmatch AND CMAKE_C_FLAGS MATCHES "-Wno-${CMAKE_MATCH_1}" AND NOT _ccopt STREQUAL "-Wall" AND NOT _ccopt MATCHES "^-Wno-") + string(APPEND _picky_skipped " ${_ccopt}") + else() + list(APPEND _picky "${_ccopt}") + 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_LESS 4.5) + # Avoid false positives + list(APPEND _picky "-Wno-shadow") + list(APPEND _picky "-Wno-unreachable-code") + endif() + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + # GCC <4.6 do not support #pragma to suppress warnings locally. Disable them globally instead. + list(APPEND _picky "-Wno-overlength-strings") + endif() + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.0 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + list(APPEND _picky "-Wno-missing-field-initializers") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750 + endif() + 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 1943) # 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") # 'snprintf': function not inlined + list(APPEND _picky "-wd4711") # function 'A' selected for automatic inline expansion + # volatile access of '' is subject to /volatile: setting; + # consider using __iso_volatile_load/store intrinsic functions (ARM64) + list(APPEND _picky "-wd4746") + list(APPEND _picky "-wd4774") # 'snprintf': format string expected in argument 3 is not a string literal + list(APPEND _picky "-wd4820") # 'A': 'N' bytes padding added after data member 'B' + if(MSVC_VERSION GREATER_EQUAL 1900) + list(APPEND _picky "-wd5045") # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified + 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(_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() diff --git a/curl/CMake/Platforms/WindowsCache.cmake b/curl/CMake/Platforms/WindowsCache.cmake deleted file mode 100644 index 6fc2991cd..000000000 --- a/curl/CMake/Platforms/WindowsCache.cmake +++ /dev/null @@ -1,125 +0,0 @@ -if(NOT UNIX) - if(WIN32) - set(HAVE_LIBDL 0) - set(HAVE_LIBUCB 0) - set(HAVE_LIBSOCKET 0) - set(NOT_NEED_LIBNSL 0) - set(HAVE_LIBNSL 0) - set(HAVE_GETHOSTNAME 1) - set(HAVE_LIBZ 0) - set(HAVE_LIBCRYPTO 0) - - set(HAVE_DLOPEN 0) - - set(HAVE_ALLOCA_H 0) - set(HAVE_ARPA_INET_H 0) - set(HAVE_DLFCN_H 0) - set(HAVE_FCNTL_H 1) - set(HAVE_INTTYPES_H 0) - set(HAVE_IO_H 1) - set(HAVE_MALLOC_H 1) - set(HAVE_MEMORY_H 1) - set(HAVE_NETDB_H 0) - set(HAVE_NETINET_IF_ETHER_H 0) - set(HAVE_NETINET_IN_H 0) - set(HAVE_NET_IF_H 0) - set(HAVE_PROCESS_H 1) - set(HAVE_PWD_H 0) - set(HAVE_SETJMP_H 1) - set(HAVE_SGTTY_H 0) - set(HAVE_SIGNAL_H 1) - set(HAVE_SOCKIO_H 0) - set(HAVE_STDINT_H 0) - set(HAVE_STDLIB_H 1) - set(HAVE_STRINGS_H 0) - set(HAVE_STRING_H 1) - set(HAVE_SYS_PARAM_H 0) - set(HAVE_SYS_POLL_H 0) - set(HAVE_SYS_SELECT_H 0) - set(HAVE_SYS_SOCKET_H 0) - set(HAVE_SYS_SOCKIO_H 0) - set(HAVE_SYS_STAT_H 1) - set(HAVE_SYS_TIME_H 0) - set(HAVE_SYS_TYPES_H 1) - set(HAVE_SYS_UTIME_H 1) - set(HAVE_TERMIOS_H 0) - set(HAVE_TERMIO_H 0) - set(HAVE_TIME_H 1) - set(HAVE_UNISTD_H 0) - set(HAVE_UTIME_H 0) - set(HAVE_X509_H 0) - set(HAVE_ZLIB_H 0) - - set(HAVE_SIZEOF_LONG_DOUBLE 1) - set(SIZEOF_LONG_DOUBLE 8) - - set(HAVE_SOCKET 1) - set(HAVE_POLL 0) - set(HAVE_SELECT 1) - set(HAVE_STRDUP 1) - set(HAVE_STRSTR 1) - set(HAVE_STRTOK_R 0) - set(HAVE_STRFTIME 1) - set(HAVE_UNAME 0) - set(HAVE_STRCASECMP 0) - set(HAVE_STRICMP 1) - set(HAVE_STRCMPI 1) - set(HAVE_GETHOSTBYADDR 1) - set(HAVE_GETTIMEOFDAY 0) - set(HAVE_INET_ADDR 1) - set(HAVE_INET_NTOA 1) - set(HAVE_INET_NTOA_R 0) - set(HAVE_TCGETATTR 0) - set(HAVE_TCSETATTR 0) - set(HAVE_PERROR 1) - set(HAVE_CLOSESOCKET 1) - set(HAVE_SETVBUF 0) - set(HAVE_SIGSETJMP 0) - set(HAVE_GETPASS_R 0) - set(HAVE_STRLCAT 0) - set(HAVE_GETPWUID 0) - set(HAVE_GETEUID 0) - set(HAVE_UTIME 1) - set(HAVE_RAND_EGD 0) - set(HAVE_RAND_SCREEN 0) - set(HAVE_RAND_STATUS 0) - set(HAVE_GMTIME_R 0) - set(HAVE_LOCALTIME_R 0) - set(HAVE_GETHOSTBYADDR_R 0) - set(HAVE_GETHOSTBYNAME_R 0) - set(HAVE_SIGNAL_FUNC 1) - set(HAVE_SIGNAL_MACRO 0) - - set(HAVE_GETHOSTBYADDR_R_5 0) - set(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0) - set(HAVE_GETHOSTBYADDR_R_7 0) - set(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0) - set(HAVE_GETHOSTBYADDR_R_8 0) - set(HAVE_GETHOSTBYADDR_R_8_REENTRANT 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(TIME_WITH_SYS_TIME 0) - set(HAVE_O_NONBLOCK 0) - set(HAVE_IN_ADDR_T 0) - set(HAVE_INET_NTOA_R_DECL 0) - set(HAVE_INET_NTOA_R_DECL_REENTRANT 0) - if(ENABLE_IPV6) - set(HAVE_GETADDRINFO 1) - else() - set(HAVE_GETADDRINFO 0) - endif() - set(STDC_HEADERS 1) - set(RETSIGTYPE_TEST 1) - - set(HAVE_SIGACTION 0) - set(HAVE_MACRO_SIGSETJMP 0) - else(WIN32) - message("This file should be included on Windows platform only") - endif(WIN32) -endif(NOT UNIX) - diff --git a/curl/CMake/Utilities.cmake b/curl/CMake/Utilities.cmake index 8b6276df6..335713c84 100644 --- a/curl/CMake/Utilities.cmake +++ b/curl/CMake/Utilities.cmake @@ -1,44 +1,81 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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 -# Converts a CMake list to a string containing elements separated by spaces -function(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR) - set(NEW_LIST_SPACE) - foreach(ITEM ${${_LIST_NAME}}) - set(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}") +# 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() - string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE) - set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE) + set(${_output_count_var} ${_list_len} PARENT_SCOPE) endfunction() -# Appends a lis of item to a string which is a space-separated list, if they don't already exist. -function(LIST_SPACES_APPEND_ONCE LIST_NAME) - string(REPLACE " " ";" _LIST ${${LIST_NAME}}) - list(APPEND _LIST ${ARGN}) - list(REMOVE_DUPLICATES _LIST) - to_list_spaces(_LIST NEW_LIST_SPACE) - set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE) +# 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() -# Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value. -# Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND) -function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL) - list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS) - if(${FIND_POS} EQUAL -1) - set(${RETVAL} FALSE PARENT_SCOPE) - else() - set(${RETVAL} TRUE PARENT_SCOPE) +# 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 "") + foreach(_prop IN LISTS _cmake_property_list) + if(_prop MATCHES "") + foreach(_config IN ITEMS "DEBUG" "RELEASE" "MINSIZEREL" "RELWITHDEBINFO") + string(REPLACE "" "${_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() - -# Returns a list of arguments that evaluate to true -function(collect_true output_var output_count_var) - set(${output_var}) - foreach(option_var IN LISTS ARGN) - if(${option_var}) - list(APPEND ${output_var} ${option_var}) - endif() - endforeach() - set(${output_var} ${${output_var}} PARENT_SCOPE) - list(LENGTH ${output_var} ${output_count_var}) - set(${output_count_var} ${${output_count_var}} PARENT_SCOPE) -endfunction() diff --git a/curl/CMake/cmake_uninstall.cmake.in b/curl/CMake/cmake_uninstall.cmake.in index d00a51665..bb95d85a0 100644 --- a/curl/CMake/cmake_uninstall.cmake.in +++ b/curl/CMake/cmake_uninstall.cmake.in @@ -1,26 +1,50 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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(NOT EXISTS "@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}) +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}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) +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(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${_file}") + endif() + else() + message(STATUS "File $ENV{DESTDIR}${_file} does not exist.") + endif() +endforeach() diff --git a/curl/CMake/curl-config.cmake.in b/curl/CMake/curl-config.cmake.in new file mode 100644 index 000000000..d1582b8d4 --- /dev/null +++ b/curl/CMake/curl-config.cmake.in @@ -0,0 +1,77 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +if("@USE_OPENSSL@") + if("@OPENSSL_VERSION_MAJOR@") + find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@") + else() + find_dependency(OpenSSL) + endif() +endif() +if("@HAVE_LIBZ@") + find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@") +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") + +# Alias for either shared or static library +if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.11 AND CMAKE_VERSION VERSION_LESS 3.18) + set_target_properties(@PROJECT_NAME@::@LIB_SELECTED@ PROPERTIES IMPORTED_GLOBAL TRUE) + endif() + add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@) +endif() + +# For compatibility with CMake's FindCURL.cmake +set(CURL_VERSION_STRING "@CURLVERSION@") +set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@) +set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") + +set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") +set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@") + +foreach(_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES) + set(CURL_SUPPORTS_${_item} TRUE) +endforeach() + +set(_missing_req "") +foreach(_item IN LISTS CURL_FIND_COMPONENTS) + if(CURL_SUPPORTS_${_item}) + set(CURL_${_item}_FOUND TRUE) + elseif(CURL_FIND_REQUIRED_${_item}) + list(APPEND _missing_req ${_item}) + endif() +endforeach() + +if(_missing_req) + string(REPLACE ";" " " _missing_req "${_missing_req}") + if(CURL_FIND_REQUIRED) + message(FATAL_ERROR "CURL: missing required components: ${_missing_req}") + endif() + unset(_missing_req) +endif() + +check_required_components("@PROJECT_NAME@") diff --git a/curl/CMake/unix-cache.cmake b/curl/CMake/unix-cache.cmake new file mode 100644 index 000000000..2c85626a4 --- /dev/null +++ b/curl/CMake/unix-cache.cmake @@ -0,0 +1,313 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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_FTRUNCATE 1) +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") + set(HAVE_GLIBC_STRERROR_R 1) +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") + set(HAVE_LINUX_TCP_H 1) +else() + set(HAVE_LINUX_TCP_H 0) +endif() +set(HAVE_LOCALE_H 1) +set(HAVE_LONGLONG 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_MSG_NOSIGNAL 1) +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 + CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + set(HAVE_PIPE2 1) +endif() +set(HAVE_POLL 1) +set(HAVE_POLL_H 1) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(HAVE_POSIX_STRERROR_R 0) +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) +if(CYGWIN OR + CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(HAVE_SETMODE 0) +else() + set(HAVE_SETMODE 1) +endif() +set(HAVE_SETRLIMIT 1) +set(HAVE_SETSOCKOPT_SO_NONBLOCK 0) +set(HAVE_SIGACTION 1) +set(HAVE_SIGINTERRUPT 1) +set(HAVE_SIGNAL 1) +set(HAVE_SIGSETJMP 1) +set(HAVE_SNPRINTF 1) +set(HAVE_SOCKADDR_IN6_SIN6_ADDR 1) +set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1) +set(HAVE_SOCKET 1) +set(HAVE_SOCKETPAIR 1) +set(HAVE_STDATOMIC_H 1) +set(HAVE_STDBOOL_H 1) +set(HAVE_STDDEF_H 1) +set(HAVE_STDINT_H 1) +set(HAVE_STRCASECMP 1) +set(HAVE_STRCMPI 0) +set(HAVE_STRDUP 1) +set(HAVE_STRERROR_R 1) +set(HAVE_STRICMP 0) +set(HAVE_STRINGS_H 1) +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) +if(CYGWIN) + set(HAVE__SETMODE 1) +endif() +set(STDC_HEADERS 1) +set(USE_UNIX_SOCKETS 1) diff --git a/curl/CMake/win32-cache.cmake b/curl/CMake/win32-cache.cmake new file mode 100644 index 000000000..4fe9eb113 --- /dev/null +++ b/curl/CMake/win32-cache.cmake @@ -0,0 +1,240 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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_FTRUNCATE 1) + set(HAVE_GETTIMEOFDAY 1) + set(HAVE_LIBGEN_H 1) + set(HAVE_OPENDIR 1) + set(HAVE_SNPRINTF 1) + set(HAVE_STDBOOL_H 1) + set(HAVE_STDDEF_H 1) # detected by CMake internally in check_type_size() + set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size() + 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_FTRUNCATE 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() + if(MSVC_VERSION GREATER_EQUAL 1600) + set(HAVE_STDINT_H 1) # detected by CMake internally in check_type_size() + else() + set(HAVE_STDINT_H 0) # detected by CMake internally in check_type_size() + endif() + if(MSVC_VERSION GREATER_EQUAL 1800) + set(HAVE_STDBOOL_H 1) + else() + set(HAVE_STDBOOL_H 0) + endif() + set(HAVE_BOOL_T "${HAVE_STDBOOL_H}") + if(MSVC_VERSION GREATER_EQUAL 1900) + set(HAVE_SNPRINTF 1) + else() + set(HAVE_SNPRINTF 0) + endif() + set(HAVE_BASENAME 0) + endif() +endif() + +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_MEMRCHR 0) +set(HAVE_MSG_NOSIGNAL 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_SETMODE 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_STRDUP 1) +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(HAVE__SETMODE 1) +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("LONG_LONG" 8) + curl_prefill_type_size("__INT64" 8) + curl_prefill_type_size("CURL_OFF_T" 8) + # CURL_SOCKET_T, SIZE_T: 8 for _WIN64, 4 otherwise + # TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise + # Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set. + # mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined. + if(MSVC) + set(HAVE_SIZEOF_SSIZE_T 0) + set(HAVE_FILE_OFFSET_BITS 0) + curl_prefill_type_size("OFF_T" 4) + curl_prefill_type_size("ADDRESS_FAMILY" 2) + else() + # SSIZE_T: 8 for _WIN64, 4 otherwise + if(MINGW64_VERSION) + if(MINGW64_VERSION VERSION_GREATER_EQUAL 3.0) + set(HAVE_FILE_OFFSET_BITS 1) + curl_prefill_type_size("OFF_T" 8) + endif() + if(MINGW64_VERSION VERSION_GREATER_EQUAL 2.0) + curl_prefill_type_size("ADDRESS_FAMILY" 2) + else() + set(HAVE_SIZEOF_ADDRESS_FAMILY 0) + endif() + endif() + endif() +endif() + +# Windows CE exceptions + +if(WINCE) + set(HAVE_FREEADDRINFO 0) + set(HAVE_GETADDRINFO 0) + set(HAVE_LOCALE_H 0) + set(HAVE_SETLOCALE 0) + set(HAVE_SETMODE 0) + set(HAVE_SIGNAL 0) + set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0) + curl_prefill_type_size("CURL_SOCKET_T" 4) + curl_prefill_type_size("TIME_T" 4) + curl_prefill_type_size("SIZE_T" 4) + if(MINGW32CE) + set(HAVE_STRTOK_R 0) + set(HAVE__SETMODE 0) + set(HAVE_FILE_OFFSET_BITS 0) + set(HAVE_SIZEOF_ADDRESS_FAMILY 0) + curl_prefill_type_size("SSIZE_T" 4) + curl_prefill_type_size("OFF_T" 4) + endif() +endif() diff --git a/curl/CMakeLists.txt b/curl/CMakeLists.txt index 3bfb5febd..c0cc0c57b 100644 --- a/curl/CMakeLists.txt +++ b/curl/CMakeLists.txt @@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -18,472 +18,1248 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # +# SPDX-License-Identifier: curl +# ########################################################################### -# curl/libcurl CMake script # by Tetetest and Sukender (Benoit Neil) -# TODO: -# The output .so file lacks the soname number which we currently have within the lib/Makefile.am file -# Add full (4 or 5 libs) SSL support -# Add INSTALL target (EXTRA_DIST variables in Makefile.am may be moved to Makefile.inc so that CMake/CPack is aware of what's to include). -# Add CTests(?) -# Check on all possible platforms -# Test with as many configurations possible (With or without any option) -# Create scripts that help keeping the CMake build system up to date (to reduce maintenance). According to Tetetest: -# - lists of headers that 'configure' checks for; -# - curl-specific tests (the ones that are in m4/curl-*.m4 files); -# - (most obvious thing:) curl version numbers. -# Add documentation subproject -# -# To check: -# (From Daniel Stenberg) The cmake build selected to run gcc with -fPIC on my box while the plain configure script did not. -# (From Daniel Stenberg) The gcc command line use neither -g nor any -O options. As a developer, I also treasure our configure scripts's --enable-debug option that sets a long range of "picky" compiler options. -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}") +cmake_minimum_required(VERSION 3.7...3.16 FATAL_ERROR) +message(STATUS "Using CMake version ${CMAKE_VERSION}") + +# Collect command-line arguments for buildinfo.txt. +# Must reside at the top of the script to work as expected. +set(_cmake_args "") +if(NOT "$ENV{CURL_BUILDINFO}$ENV{CURL_CI}$ENV{CI}" STREQUAL "") + get_cmake_property(_cache_vars CACHE_VARIABLES) + foreach(_cache_var IN ITEMS ${_cache_vars}) + get_property(_cache_var_helpstring CACHE ${_cache_var} PROPERTY HELPSTRING) + if(_cache_var_helpstring STREQUAL "No help, variable specified on the command line.") + get_property(_cache_var_type CACHE ${_cache_var} PROPERTY TYPE) + get_property(_cache_var_value CACHE ${_cache_var} PROPERTY VALUE) + if(_cache_var_type STREQUAL "UNINITIALIZED") + set(_cache_var_type) + else() + set(_cache_var_type ":${_cache_var_type}") + endif() + string(APPEND _cmake_args " -D${_cache_var}${_cache_var_type}=\"${_cache_var_value}\"") + endif() + endforeach() +endif() + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) include(Utilities) include(Macros) include(CMakeDependentOption) include(CheckCCompilerFlag) -project( CURL C ) +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/curl/curlver.h" _curl_version_h_contents REGEX "#define LIBCURL_VERSION( |_NUM )") +string(REGEX MATCH "#define LIBCURL_VERSION \"[^\"]*" _curl_version ${_curl_version_h_contents}) +string(REGEX REPLACE "[^\"]+\"" "" _curl_version ${_curl_version}) +string(REGEX MATCH "#define LIBCURL_VERSION_NUM 0x[0-9a-fA-F]+" _curl_version_num ${_curl_version_h_contents}) +string(REGEX REPLACE "[^0]+0x" "" _curl_version_num ${_curl_version_num}) +unset(_curl_version_h_contents) + +message(STATUS "curl version=[${_curl_version}]") + +string(REGEX REPLACE "([0-9]+\.[0-9]+\.[0-9]+).+" "\\1" _curl_version_sem "${_curl_version}") +project(CURL + VERSION "${_curl_version_sem}" + LANGUAGES C) + +# CMake does not recognize some targets accurately. Touch up configuration manually as a workaround. +if(WINDOWS_STORE AND MINGW) # mingw UWP build + # CMake (as of v3.31.2) gets confused and applies the MSVC rc.exe command-line + # template to windres. Reset it to the windres template via 'Modules/Platform/Windows-windres.cmake': + set(CMAKE_RC_COMPILE_OBJECT " -O coff ") +elseif(WIN32 AND WINCE AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # mingw32ce build + if(NOT MINGW32CE_LIBRARY_DIR) + message(FATAL_ERROR "Set MINGW32CE_LIBRARY_DIR variable to the mingw32ce platform library directory.") + endif() -message(WARNING "the curl cmake build system is poorly maintained. Be aware") + set(MINGW 1) + set(MINGW32CE 1) + + # Build implib with libcurl DLL. Copied from CMake's 'Modules/Platform/Windows-GNU.cmake'. + set(CMAKE_C_CREATE_SHARED_LIBRARY " ") + string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " -o -Wl,--out-implib,") + string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " ${CMAKE_GNULD_IMAGE_VERSION} ") + + # Build resources. Copied from CMake's 'Modules/Platform/Windows-windres.cmake'. + set(CMAKE_RC_COMPILE_OBJECT " -O coff ") + enable_language(RC) + + # To compile long long integer literals + set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-std=gnu99") + string(APPEND CMAKE_REQUIRED_FLAGS " -std=gnu99") + + set(CMAKE_C_COMPILE_OPTIONS_PIC "") # CMake sets it to '-fPIC', confusing the toolchain and breaking builds. Zap it. + + set(CMAKE_STATIC_LIBRARY_PREFIX "lib") + set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") + set(CMAKE_SHARED_LIBRARY_PREFIX "lib") + set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") + set(CMAKE_IMPORT_LIBRARY_PREFIX "lib") + set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a") + set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib") +elseif(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # DJGPP + set(CMAKE_STATIC_LIBRARY_PREFIX "lib") + set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") + set(CMAKE_FIND_LIBRARY_PREFIXES "lib") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") +endif() -file (READ ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS) -string (REGEX MATCH "#define LIBCURL_VERSION \"[^\"]*" - CURL_VERSION ${CURL_VERSION_H_CONTENTS}) -string (REGEX REPLACE "[^\"]+\"" "" CURL_VERSION ${CURL_VERSION}) -string (REGEX MATCH "#define LIBCURL_VERSION_NUM 0x[0-9a-fA-F]+" - CURL_VERSION_NUM ${CURL_VERSION_H_CONTENTS}) -string (REGEX REPLACE "[^0]+0x" "" CURL_VERSION_NUM ${CURL_VERSION_NUM}) +# Fill platform level variable when using CMake's built-in Android configuration +if(ANDROID AND NOT DEFINED ANDROID_PLATFORM_LEVEL AND NOT CMAKE_SYSTEM_VERSION EQUAL 1) + set(ANDROID_PLATFORM_LEVEL "${CMAKE_SYSTEM_VERSION}") +endif() -include_regular_expression("^.*$") # Sukender: Is it necessary? +set(_target_flags "") +if(APPLE) + string(APPEND _target_flags " APPLE") +endif() +if(UNIX) + string(APPEND _target_flags " UNIX") +endif() +if(BSD) + string(APPEND _target_flags " BSD") +endif() +if(ANDROID) + string(APPEND _target_flags " ANDROID-${ANDROID_PLATFORM_LEVEL}") +endif() +if(WIN32) + string(APPEND _target_flags " WIN32") +endif() +if(WINCE) + string(APPEND _target_flags " WINCE") +endif() +if(WINDOWS_STORE) + string(APPEND _target_flags " UWP") +endif() +if(CYGWIN) + string(APPEND _target_flags " CYGWIN") +endif() +if(DOS) + string(APPEND _target_flags " DOS") +endif() +if(AMIGA) + string(APPEND _target_flags " AMIGA") +endif() +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + string(APPEND _target_flags " GCC") +endif() +if(MINGW) + string(APPEND _target_flags " MINGW") +endif() +if(MSVC) + string(APPEND _target_flags " MSVC-${MSVC_VERSION}") +endif() +if(VCPKG_TOOLCHAIN) + string(APPEND _target_flags " VCPKG") +endif() +if(CMAKE_CROSSCOMPILING) + string(APPEND _target_flags " CROSS") +endif() +message(STATUS "CMake platform flags:${_target_flags}") -# Setup package meta-data -# SET(PACKAGE "curl") -message(STATUS "curl version=[${CURL_VERSION}]") -# SET(PACKAGE_TARNAME "curl") -# SET(PACKAGE_NAME "curl") -# SET(PACKAGE_VERSION "-") -# SET(PACKAGE_STRING "curl-") -# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.haxx.se/mail/") -set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}") -set(OS "\"${CMAKE_SYSTEM_NAME}\"") +if(CMAKE_CROSSCOMPILING) + message(STATUS "Cross-compiling: " + "${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR} -> " + "${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}") +endif() -include_directories(${PROJECT_BINARY_DIR}/include/curl) -include_directories( ${CURL_SOURCE_DIR}/include ) +if(CMAKE_C_COMPILER_TARGET) + set(CURL_OS "\"${CMAKE_C_COMPILER_TARGET}\"") +else() + set(CURL_OS "\"${CMAKE_SYSTEM_NAME}\"") +endif() + +set(LIB_NAME "libcurl") + +set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/include") + +if(NOT DEFINED CMAKE_UNITY_BUILD_BATCH_SIZE) + set(CMAKE_UNITY_BUILD_BATCH_SIZE 0) +endif() + +# Having CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY breaks certain +# 'check_function_exists()' detections (possibly more), by detecting +# non-existing features. This happens by default when using 'ios.toolchain.cmake'. +# Work it around by setting this value to `EXECUTABLE`. +if(CMAKE_TRY_COMPILE_TARGET_TYPE STREQUAL "STATIC_LIBRARY") + message(STATUS "CMAKE_TRY_COMPILE_TARGET_TYPE was found set to STATIC_LIBRARY. " + "Overriding with EXECUTABLE for feature detections to work.") + set(_cmake_try_compile_target_type_save ${CMAKE_TRY_COMPILE_TARGET_TYPE}) + set(CMAKE_TRY_COMPILE_TARGET_TYPE "EXECUTABLE") +endif() option(CURL_WERROR "Turn compiler warnings into errors" OFF) option(PICKY_COMPILER "Enable picky compiler options" ON) -option(BUILD_CURL_EXE "Set to ON to build curl executable." ON) -option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF) -option(ENABLE_ARES "Set to ON to enable c-ares support" OFF) +option(BUILD_CURL_EXE "Build curl executable" ON) +option(BUILD_SHARED_LIBS "Build shared libraries" ON) +option(BUILD_STATIC_LIBS "Build static libraries" OFF) +option(BUILD_STATIC_CURL "Build curl executable with static libcurl" OFF) +option(ENABLE_ARES "Enable c-ares support" OFF) +option(CURL_DISABLE_INSTALL "Disable installation targets" OFF) + if(WIN32) - option(CURL_STATIC_CRT "Set to ON to build libcurl with static CRT on Windows (/MT)." OFF) - option(ENABLE_INET_PTON "Set to OFF to prevent usage of inet_pton when building against modern SDKs while still requiring compatibility with older Windows versions, such as Windows XP, Windows Server 2003 etc." ON) -endif() + option(ENABLE_UNICODE "Use the Unicode version of the Windows API functions" OFF) + if(WINDOWS_STORE OR WINCE) + set(ENABLE_UNICODE ON) + endif() + if(ENABLE_UNICODE) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "UNICODE" "_UNICODE") + if(MINGW AND NOT MINGW32CE) + set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-municode") + endif() + endif() -CMAKE_DEPENDENT_OPTION(ENABLE_THREADED_RESOLVER "Set to ON to enable threaded DNS lookup" - ON "NOT ENABLE_ARES" - OFF) + # Apply to all feature checks + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DWIN32_LEAN_AND_MEAN") + if(MSVC) + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_CRT_NONSTDC_NO_DEPRECATE") # for strdup() detection + endif() -option(ENABLE_DEBUG "Set to ON to enable curl debug features" OFF) -option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" OFF) + set(CURL_TARGET_WINDOWS_VERSION "" CACHE STRING "Minimum target Windows version as hex string") + if(CURL_TARGET_WINDOWS_VERSION) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}") + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_WIN32_WINNT=${CURL_TARGET_WINDOWS_VERSION}") # Apply to all feature checks + endif() -if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) - if (PICKY_COMPILER) - foreach (_CCOPT -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wundef -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wstrict-aliasing=3 -Wcast-align -Wtype-limits -Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers -Wconversion -Wno-sign-conversion -Wvla -Wdouble-promotion -Wno-system-headers) - # surprisingly, CHECK_C_COMPILER_FLAG needs a new variable to store each new - # test result in. - CHECK_C_COMPILER_FLAG(${_CCOPT} OPT${_CCOPT}) - if(OPT${_CCOPT}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}") + # Detect actual value of _WIN32_WINNT and store as HAVE_WIN32_WINNT + curl_internal_test(HAVE_WIN32_WINNT) + if(HAVE_WIN32_WINNT) + string(REGEX MATCH "_WIN32_WINNT=0x[0-9a-fA-F]+" CURL_TEST_OUTPUT "${CURL_TEST_OUTPUT}") + string(REGEX REPLACE "_WIN32_WINNT=" "" CURL_TEST_OUTPUT "${CURL_TEST_OUTPUT}") + string(REGEX REPLACE "0x([0-9a-f][0-9a-f][0-9a-f])$" "0x0\\1" CURL_TEST_OUTPUT "${CURL_TEST_OUTPUT}") # pad to 4 digits + string(TOLOWER "${CURL_TEST_OUTPUT}" HAVE_WIN32_WINNT) + message(STATUS "Found _WIN32_WINNT=${HAVE_WIN32_WINNT}") + endif() + unset(HAVE_WIN32_WINNT CACHE) # Avoid storing in CMake cache + + if(MINGW) + # Detect __MINGW64_VERSION_MAJOR, __MINGW64_VERSION_MINOR and store as MINGW64_VERSION + curl_internal_test(MINGW64_VERSION) + if(MINGW64_VERSION) + string(REGEX MATCH "MINGW64_VERSION=[0-9]+\.[0-9]+" CURL_TEST_OUTPUT "${CURL_TEST_OUTPUT}") + string(REGEX REPLACE "MINGW64_VERSION=" "" MINGW64_VERSION "${CURL_TEST_OUTPUT}") + if(MINGW64_VERSION) + message(STATUS "Found MINGW64_VERSION=${MINGW64_VERSION}") endif() - endforeach() - endif(PICKY_COMPILER) -endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) - -if (ENABLE_DEBUG) - # DEBUGBUILD will be defined only for Debug builds - if(NOT CMAKE_VERSION VERSION_LESS 3.0) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$:DEBUGBUILD>) + endif() + unset(MINGW64_VERSION CACHE) # Avoid storing in CMake cache + endif() +elseif(DOS OR AMIGA) + set(BUILD_SHARED_LIBS OFF) + set(BUILD_STATIC_LIBS ON) +endif() +option(CURL_LTO "Enable compiler Link Time Optimizations" OFF) + +if(NOT DOS AND NOT AMIGA) + # if c-ares is used, default the threaded resolver to OFF + if(ENABLE_ARES) + set(_enable_threaded_resolver_default OFF) else() - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUGBUILD) + set(_enable_threaded_resolver_default ON) endif() - set(ENABLE_CURLDEBUG ON) + option(ENABLE_THREADED_RESOLVER "Enable threaded DNS lookup" ${_enable_threaded_resolver_default}) endif() -if (ENABLE_CURLDEBUG) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG) +include(PickyWarnings) + +if(CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux") + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "_GNU_SOURCE") # Required for accept4(), pipe2(), sendmmsg() + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") # Apply to all feature checks +endif() + +option(ENABLE_DEBUG "Enable curl debug features (for developing curl itself)" OFF) +if(ENABLE_DEBUG) + message(WARNING "This curl build is Debug-enabled and insecure, do not use in production.") +endif() +option(ENABLE_CURLDEBUG "Enable TrackMemory debug feature" ${ENABLE_DEBUG}) + +set(CURL_DEBUG_MACROS "") +if(ENABLE_DEBUG) + list(APPEND CURL_DEBUG_MACROS "DEBUGBUILD") +endif() +if(ENABLE_CURLDEBUG) + list(APPEND CURL_DEBUG_MACROS "CURLDEBUG") +endif() + +option(CURL_CLANG_TIDY "Run the build through clang-tidy" OFF) +if(CURL_CLANG_TIDY) + set(CMAKE_UNITY_BUILD OFF) # clang-tidy is not looking into #included sources, thus not compatible with unity builds. + set(_tidy_checks "") + list(APPEND _tidy_checks "-clang-analyzer-security.insecureAPI.bzero") # for FD_ZERO() (seen on macOS) + list(APPEND _tidy_checks "-clang-analyzer-security.insecureAPI.strcpy") + list(APPEND _tidy_checks "-clang-analyzer-optin.performance.Padding") + list(APPEND _tidy_checks "-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling") + string(REPLACE ";" "," _tidy_checks "${_tidy_checks}") + find_program(CLANG_TIDY NAMES "clang-tidy" REQUIRED) + set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY}" "-checks=${_tidy_checks}" "-quiet") + unset(_tidy_checks) + if(CURL_WERROR) + list(APPEND CMAKE_C_CLANG_TIDY "--warnings-as-errors=*") + endif() + if(CURL_CLANG_TIDYFLAGS) + list(APPEND CMAKE_C_CLANG_TIDY ${CURL_CLANG_TIDYFLAGS}) + endif() endif() # For debug libs and exes, add "-d" postfix -set(CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "Set debug library postfix") +if(NOT DEFINED CMAKE_DEBUG_POSTFIX) + set(CMAKE_DEBUG_POSTFIX "-d") +endif() + +set(LIB_STATIC "libcurl_static") +set(LIB_SHARED "libcurl_shared") + +if(NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) + set(BUILD_STATIC_LIBS ON) +endif() +if(NOT BUILD_STATIC_CURL AND NOT BUILD_SHARED_LIBS) + set(BUILD_STATIC_CURL ON) +elseif(BUILD_STATIC_CURL AND NOT BUILD_STATIC_LIBS) + set(BUILD_STATIC_CURL OFF) +endif() -# initialize CURL_LIBS +# Lib flavour selected for curl tool +if(BUILD_STATIC_CURL) + set(LIB_SELECTED_FOR_EXE ${LIB_STATIC}) +else() + set(LIB_SELECTED_FOR_EXE ${LIB_SHARED}) +endif() + +# Lib flavour selected for example and test programs. +if(BUILD_SHARED_LIBS) + set(LIB_SELECTED ${LIB_SHARED}) +else() + set(LIB_SELECTED ${LIB_STATIC}) +endif() + +if(WIN32) + option(CURL_STATIC_CRT "Build libcurl with static CRT with MSVC (/MT)" OFF) + if(CURL_STATIC_CRT AND MSVC) + if(MSVC_VERSION GREATER_EQUAL 1900 OR BUILD_STATIC_CURL OR NOT BUILD_CURL_EXE) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "$<$:-MT>") + set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "$<$:-MTd>") + else() + message(WARNING "Static CRT requires UCRT, static libcurl or no curl executable.") + endif() + endif() +endif() + +# Override to force-disable or force-enable the use of pkg-config. +if((UNIX AND NOT ANDROID AND (NOT APPLE OR CMAKE_SYSTEM_NAME MATCHES "Darwin")) OR + VCPKG_TOOLCHAIN OR + (MINGW AND NOT CMAKE_CROSSCOMPILING)) + set(_curl_use_pkgconfig_default ON) +else() + set(_curl_use_pkgconfig_default OFF) +endif() +option(CURL_USE_PKGCONFIG "Enable pkg-config to detect dependencies" ${_curl_use_pkgconfig_default}) + +# Initialize variables collecting dependency libs, paths, pkg-config names. set(CURL_LIBS "") +set(CURL_LIBDIRS "") +set(LIBCURL_PC_REQUIRES_PRIVATE "") if(ENABLE_ARES) set(USE_ARES 1) - find_package(CARES REQUIRED) - list(APPEND CURL_LIBS ${CARES_LIBRARY} ) - set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY}) + find_package(Cares REQUIRED) + list(APPEND CURL_LIBS ${CARES_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${CARES_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${CARES_PC_REQUIRES}) + include_directories(SYSTEM ${CARES_INCLUDE_DIRS}) + link_directories(${CARES_LIBRARY_DIRS}) + if(CARES_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${CARES_CFLAGS}") + endif() endif() include(CurlSymbolHiding) -option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF) -mark_as_advanced(HTTP_ONLY) -option(CURL_DISABLE_FTP "disables FTP" OFF) -mark_as_advanced(CURL_DISABLE_FTP) -option(CURL_DISABLE_LDAP "disables LDAP" OFF) -mark_as_advanced(CURL_DISABLE_LDAP) -option(CURL_DISABLE_TELNET "disables Telnet" OFF) -mark_as_advanced(CURL_DISABLE_TELNET) -option(CURL_DISABLE_DICT "disables DICT" OFF) +option(CURL_ENABLE_EXPORT_TARGET "Enable CMake export target" ON) +mark_as_advanced(CURL_ENABLE_EXPORT_TARGET) + +option(CURL_DISABLE_ALTSVC "Disable alt-svc support" OFF) +mark_as_advanced(CURL_DISABLE_ALTSVC) +option(CURL_DISABLE_SRP "Disable TLS-SRP support" OFF) +mark_as_advanced(CURL_DISABLE_SRP) +option(CURL_DISABLE_COOKIES "Disable cookies support" OFF) +mark_as_advanced(CURL_DISABLE_COOKIES) +option(CURL_DISABLE_BASIC_AUTH "Disable Basic authentication" OFF) +mark_as_advanced(CURL_DISABLE_BASIC_AUTH) +option(CURL_DISABLE_BEARER_AUTH "Disable Bearer authentication" OFF) +mark_as_advanced(CURL_DISABLE_BEARER_AUTH) +option(CURL_DISABLE_DIGEST_AUTH "Disable Digest authentication" OFF) +mark_as_advanced(CURL_DISABLE_DIGEST_AUTH) +option(CURL_DISABLE_KERBEROS_AUTH "Disable Kerberos authentication" OFF) +mark_as_advanced(CURL_DISABLE_KERBEROS_AUTH) +option(CURL_DISABLE_NEGOTIATE_AUTH "Disable negotiate authentication" OFF) +mark_as_advanced(CURL_DISABLE_NEGOTIATE_AUTH) +option(CURL_DISABLE_AWS "Disable aws-sigv4" OFF) +mark_as_advanced(CURL_DISABLE_AWS) +option(CURL_DISABLE_DICT "Disable DICT" OFF) mark_as_advanced(CURL_DISABLE_DICT) -option(CURL_DISABLE_FILE "disables FILE" OFF) +option(CURL_DISABLE_DOH "Disable DNS-over-HTTPS" OFF) +mark_as_advanced(CURL_DISABLE_DOH) +option(CURL_DISABLE_FILE "Disable FILE" OFF) mark_as_advanced(CURL_DISABLE_FILE) -option(CURL_DISABLE_TFTP "disables TFTP" OFF) -mark_as_advanced(CURL_DISABLE_TFTP) -option(CURL_DISABLE_HTTP "disables HTTP" OFF) +option(CURL_DISABLE_FTP "Disable FTP" OFF) +mark_as_advanced(CURL_DISABLE_FTP) +option(CURL_DISABLE_GETOPTIONS "Disable curl_easy_options API for existing options to curl_easy_setopt" OFF) +mark_as_advanced(CURL_DISABLE_GETOPTIONS) +option(CURL_DISABLE_GOPHER "Disable Gopher" OFF) +mark_as_advanced(CURL_DISABLE_GOPHER) +option(CURL_DISABLE_HEADERS_API "Disable headers-api support" OFF) +mark_as_advanced(CURL_DISABLE_HEADERS_API) +option(CURL_DISABLE_HSTS "Disable HSTS support" OFF) +mark_as_advanced(CURL_DISABLE_HSTS) +option(CURL_DISABLE_HTTP "Disable HTTP" OFF) mark_as_advanced(CURL_DISABLE_HTTP) - -option(CURL_DISABLE_LDAPS "to disable LDAPS" OFF) +option(CURL_DISABLE_HTTP_AUTH "Disable all HTTP authentication methods" OFF) +mark_as_advanced(CURL_DISABLE_HTTP_AUTH) +option(CURL_DISABLE_IMAP "Disable IMAP" OFF) +mark_as_advanced(CURL_DISABLE_IMAP) +option(CURL_DISABLE_LDAP "Disable LDAP" OFF) +mark_as_advanced(CURL_DISABLE_LDAP) +option(CURL_DISABLE_LDAPS "Disable LDAPS" ${CURL_DISABLE_LDAP}) mark_as_advanced(CURL_DISABLE_LDAPS) - -option(CURL_DISABLE_RTSP "to disable RTSP" OFF) -mark_as_advanced(CURL_DISABLE_RTSP) -option(CURL_DISABLE_PROXY "to disable proxy" OFF) -mark_as_advanced(CURL_DISABLE_PROXY) -option(CURL_DISABLE_POP3 "to disable POP3" OFF) +option(CURL_DISABLE_LIBCURL_OPTION "Disable --libcurl option from the curl tool" OFF) +mark_as_advanced(CURL_DISABLE_LIBCURL_OPTION) +option(CURL_DISABLE_MIME "Disable MIME support" OFF) +mark_as_advanced(CURL_DISABLE_MIME) +cmake_dependent_option(CURL_DISABLE_FORM_API "Disable form-api" + OFF "NOT CURL_DISABLE_MIME" + ON) +mark_as_advanced(CURL_DISABLE_FORM_API) +option(CURL_DISABLE_MQTT "Disable MQTT" OFF) +mark_as_advanced(CURL_DISABLE_MQTT) +option(CURL_DISABLE_BINDLOCAL "Disable local binding support" OFF) +mark_as_advanced(CURL_DISABLE_BINDLOCAL) +option(CURL_DISABLE_NETRC "Disable netrc parser" OFF) +mark_as_advanced(CURL_DISABLE_NETRC) +option(CURL_DISABLE_NTLM "Disable NTLM support" OFF) +mark_as_advanced(CURL_DISABLE_NTLM) +option(CURL_DISABLE_PARSEDATE "Disable date parsing" OFF) +mark_as_advanced(CURL_DISABLE_PARSEDATE) +option(CURL_DISABLE_POP3 "Disable POP3" OFF) mark_as_advanced(CURL_DISABLE_POP3) -option(CURL_DISABLE_IMAP "to disable IMAP" OFF) -mark_as_advanced(CURL_DISABLE_IMAP) -option(CURL_DISABLE_SMTP "to disable SMTP" OFF) +option(CURL_DISABLE_PROGRESS_METER "Disable built-in progress meter" OFF) +mark_as_advanced(CURL_DISABLE_PROGRESS_METER) +option(CURL_DISABLE_PROXY "Disable proxy support" OFF) +mark_as_advanced(CURL_DISABLE_PROXY) +option(CURL_DISABLE_IPFS "Disable IPFS" OFF) +mark_as_advanced(CURL_DISABLE_IPFS) +option(CURL_DISABLE_RTSP "Disable RTSP" OFF) +mark_as_advanced(CURL_DISABLE_RTSP) +option(CURL_DISABLE_SHA512_256 "Disable SHA-512/256 hash algorithm" OFF) +mark_as_advanced(CURL_DISABLE_SHA512_256) +option(CURL_DISABLE_SHUFFLE_DNS "Disable shuffle DNS feature" OFF) +mark_as_advanced(CURL_DISABLE_SHUFFLE_DNS) +option(CURL_DISABLE_SMB "Disable SMB" OFF) +mark_as_advanced(CURL_DISABLE_SMB) +option(CURL_DISABLE_SMTP "Disable SMTP" OFF) mark_as_advanced(CURL_DISABLE_SMTP) -option(CURL_DISABLE_GOPHER "to disable Gopher" OFF) -mark_as_advanced(CURL_DISABLE_GOPHER) +option(CURL_DISABLE_SOCKETPAIR "Disable use of socketpair for curl_multi_poll" OFF) +mark_as_advanced(CURL_DISABLE_SOCKETPAIR) +option(CURL_DISABLE_WEBSOCKETS "Disable WebSocket" OFF) +mark_as_advanced(CURL_DISABLE_WEBSOCKETS) +option(CURL_DISABLE_TELNET "Disable Telnet" OFF) +mark_as_advanced(CURL_DISABLE_TELNET) +option(CURL_DISABLE_TFTP "Disable TFTP" OFF) +mark_as_advanced(CURL_DISABLE_TFTP) +option(CURL_DISABLE_VERBOSE_STRINGS "Disable verbose strings" OFF) +mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS) + +if(CURL_DISABLE_HTTP) + set(CURL_DISABLE_IPFS ON) + set(CURL_DISABLE_RTSP ON) + set(CURL_DISABLE_ALTSVC ON) + set(CURL_DISABLE_HSTS ON) +endif() + +# Corresponds to HTTP_ONLY in lib/curl_setup.h +option(HTTP_ONLY "Disable all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF) +mark_as_advanced(HTTP_ONLY) if(HTTP_ONLY) + set(CURL_DISABLE_DICT ON) + set(CURL_DISABLE_FILE ON) set(CURL_DISABLE_FTP ON) + set(CURL_DISABLE_GOPHER ON) + set(CURL_DISABLE_IMAP ON) set(CURL_DISABLE_LDAP ON) set(CURL_DISABLE_LDAPS ON) - set(CURL_DISABLE_TELNET ON) - set(CURL_DISABLE_DICT ON) - set(CURL_DISABLE_FILE ON) - set(CURL_DISABLE_TFTP ON) - set(CURL_DISABLE_RTSP ON) + set(CURL_DISABLE_MQTT ON) set(CURL_DISABLE_POP3 ON) - set(CURL_DISABLE_IMAP ON) + set(CURL_DISABLE_IPFS ON) + set(CURL_DISABLE_RTSP ON) + set(CURL_DISABLE_SMB ON) set(CURL_DISABLE_SMTP ON) - set(CURL_DISABLE_GOPHER ON) + set(CURL_DISABLE_TELNET ON) + set(CURL_DISABLE_TFTP ON) endif() -option(CURL_DISABLE_COOKIES "to disable cookies support" OFF) -mark_as_advanced(CURL_DISABLE_COOKIES) - -option(CURL_DISABLE_CRYPTO_AUTH "to disable cryptographic authentication" OFF) -mark_as_advanced(CURL_DISABLE_CRYPTO_AUTH) -option(CURL_DISABLE_VERBOSE_STRINGS "to disable verbose strings" OFF) -mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS) -option(ENABLE_IPV6 "Define if you want to enable IPv6 support" ON) -mark_as_advanced(ENABLE_IPV6) -if(ENABLE_IPV6 AND NOT WIN32) - include(CheckStructHasMember) - check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h" - HAVE_SOCKADDR_IN6_SIN6_ADDR) - check_struct_has_member("struct sockaddr_in6" sin6_scope_id "netinet/in.h" - HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) - if(NOT HAVE_SOCKADDR_IN6_SIN6_ADDR) - message(WARNING "struct sockaddr_in6 not available, disabling IPv6 support") - # Force the feature off as this name is used as guard macro... - set(ENABLE_IPV6 OFF - CACHE BOOL "Define if you want to enable IPv6 support" FORCE) - endif() +if(WINDOWS_STORE OR WINCE) + set(CURL_DISABLE_TELNET ON) # telnet code needs fixing to compile for UWP. endif() -CURL_NROFF_CHECK() find_package(Perl) -CMAKE_DEPENDENT_OPTION(ENABLE_MANUAL "to provide the built-in manual" - ON "NROFF_USEFUL;PERL_FOUND" - OFF) - -if(NOT PERL_FOUND) - message(STATUS "Perl not found, testing disabled.") - set(BUILD_TESTING OFF) -endif() -if(ENABLE_MANUAL) - set(USE_MANUAL ON) -endif() - -# We need ansi c-flags, especially on HP -set(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") -set(CMAKE_REQUIRED_FLAGS ${CMAKE_ANSI_CFLAGS}) - -if(CURL_STATIC_CRT) - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +if(PERL_EXECUTABLE) + add_custom_target(curl-ca-bundle + COMMENT "Generating a fresh ca-bundle.crt" VERBATIM USES_TERMINAL + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/mk-ca-bundle.pl" -b -l -u "lib/ca-bundle.crt" + DEPENDS "${PROJECT_SOURCE_DIR}/scripts/mk-ca-bundle.pl" + ) + add_custom_target(curl-ca-firefox + COMMENT "Generating a fresh ca-bundle.crt" VERBATIM USES_TERMINAL + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/firefox-db2pem.sh" "lib/ca-bundle.crt" + DEPENDS "${PROJECT_SOURCE_DIR}/scripts/firefox-db2pem.sh" + ) endif() -# Disable warnings on Borland to avoid changing 3rd party code. -if(BORLAND) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") -endif(BORLAND) +option(BUILD_LIBCURL_DOCS "Build libcurl man pages" ON) +option(BUILD_MISC_DOCS "Build misc man pages (e.g. curl-config and mk-ca-bundle)" ON) +option(ENABLE_CURL_MANUAL "Build the man page for curl and enable its -M/--manual option" ON) -if(CURL_WERROR) - if(MSVC_VERSION) - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /WX") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") - else() - # this assumes clang or gcc style options - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") +if(ENABLE_CURL_MANUAL OR BUILD_LIBCURL_DOCS) + if(PERL_FOUND) + set(HAVE_MANUAL_TOOLS ON) + endif() + if(NOT HAVE_MANUAL_TOOLS) + message(WARNING "Perl not found. Will not build manuals.") endif() -endif(CURL_WERROR) +endif() # If we are on AIX, do the _ALL_SOURCE magic -if(${CMAKE_SYSTEM_NAME} MATCHES AIX) - set(_ALL_SOURCE 1) -endif(${CMAKE_SYSTEM_NAME} MATCHES AIX) +if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "_ALL_SOURCE") +endif() + +# If we are on Haiku, make sure that the network library is brought in. +if(CMAKE_SYSTEM_NAME STREQUAL "Haiku") + list(APPEND CURL_LIBS "network") +elseif(AMIGA) + list(APPEND CURL_LIBS "net" "m" "atomic") + list(APPEND CMAKE_REQUIRED_LIBRARIES "net" "m" "atomic") +endif() # Include all the necessary files for macros -include (CheckFunctionExists) -include (CheckIncludeFile) -include (CheckIncludeFiles) -include (CheckLibraryExists) -include (CheckSymbolExists) -include (CheckTypeSize) -include (CheckCSourceCompiles) -include (CMakeDependentOption) - -# On windows preload settings -if(WIN32) - set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_WINSOCKAPI_=") - include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake) -endif(WIN32) +include(CMakePushCheckState) +include(CheckFunctionExists) +include(CheckIncludeFile) +include(CheckIncludeFiles) +include(CheckLibraryExists) +include(CheckSymbolExists) +include(CheckTypeSize) +include(CheckCSourceCompiles) + +option(_CURL_PREFILL "Fast-track known feature detection results (Windows, some Apple)" "${WIN32}") +if(_CURL_PREFILL) + if(WIN32) + include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/win32-cache.cmake") + elseif(UNIX) + include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/unix-cache.cmake") + message(STATUS "Pre-filling feature detection results for UNIX") + endif() +elseif(WIN32) + message(STATUS "Pre-filling feature detection results disabled.") +elseif(APPLE) + set(HAVE_EVENTFD 0) + set(HAVE_GETPASS_R 0) + set(HAVE_WRITABLE_ARGV 1) + set(HAVE_SENDMMSG 0) +endif() + +if(AMIGA) + set(HAVE_GETADDRINFO 0) # Breaks the build when detected and used. +endif() +if(DOS OR AMIGA) + set(HAVE_TIME_T_UNSIGNED 1) +endif() if(ENABLE_THREADED_RESOLVER) - find_package(Threads REQUIRED) if(WIN32) set(USE_THREADS_WIN32 ON) else() + find_package(Threads REQUIRED) set(USE_THREADS_POSIX ${CMAKE_USE_PTHREADS_INIT}) set(HAVE_PTHREAD_H ${CMAKE_USE_PTHREADS_INIT}) + list(APPEND CURL_LIBS ${CMAKE_THREAD_LIBS_INIT}) endif() - set(CURL_LIBS ${CURL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) endif() # Check for all needed libraries -check_library_exists_concat("dl" dlopen HAVE_LIBDL) -check_library_exists_concat("socket" connect HAVE_LIBSOCKET) -check_library_exists("c" gethostbyname "" NOT_NEED_LIBNSL) +if(WIN32) + if(WINCE) + set(_win32_winsock "ws2") + else() + set(_win32_winsock "ws2_32") + endif() + set(_win32_crypt32 "crypt32") + set(_win32_secur32 "secur32") -# Yellowtab Zeta needs different libraries than BeOS 5. -if(BEOS) - set(NOT_NEED_LIBNSL 1) - check_library_exists_concat("bind" gethostbyname HAVE_LIBBIND) - check_library_exists_concat("bnetapi" closesocket HAVE_LIBBNETAPI) -endif(BEOS) + if(MINGW32CE) # FIXME upstream: must specify the full path to avoid CMake converting "ws2" to "ws2.lib" + set(_win32_winsock "${MINGW32CE_LIBRARY_DIR}/lib${_win32_winsock}.a") + set(_win32_crypt32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_crypt32}.a") + set(_win32_secur32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_secur32}.a") + endif() +elseif(DOS) + if(WATT_ROOT) + set(USE_WATT32 ON) + # FIXME upstream: must specify the full path to avoid CMake converting "watt" to "watt.lib" + list(APPEND CURL_LIBS "${WATT_ROOT}/lib/libwatt.a") + include_directories(SYSTEM "${WATT_ROOT}/inc") + list(APPEND CMAKE_REQUIRED_INCLUDES "${WATT_ROOT}/inc") + else() + message(FATAL_ERROR "Set WATT_ROOT variable to the root installation of Watt-32.") + endif() +elseif(AMIGA) + if(AMISSL_INCLUDE_DIR AND AMISSL_STUBS_LIBRARY AND AMISSL_AUTO_LIBRARY) + set(USE_AMISSL ON) + list(APPEND CMAKE_REQUIRED_INCLUDES "${AMISSL_INCLUDE_DIR}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${AMISSL_STUBS_LIBRARY}" "${AMISSL_AUTO_LIBRARY}") + set(OPENSSL_INCLUDE_DIR "${AMISSL_INCLUDE_DIR}") + set(OPENSSL_SSL_LIBRARY "${AMISSL_STUBS_LIBRARY}") + set(OPENSSL_CRYPTO_LIBRARY "${AMISSL_AUTO_LIBRARY}") + set(CURL_USE_OPENSSL ON) + set(CURL_CA_FALLBACK ON CACHE BOOL "") + endif() +elseif(NOT APPLE) + check_library_exists("socket" "connect" "" HAVE_LIBSOCKET) + if(HAVE_LIBSOCKET) + set(CURL_LIBS "socket" ${CURL_LIBS}) + endif() +endif() -if(NOT NOT_NEED_LIBNSL) - check_library_exists_concat("nsl" gethostbyname HAVE_LIBNSL) -endif(NOT NOT_NEED_LIBNSL) +option(ENABLE_IPV6 "Enable IPv6 support" ON) +mark_as_advanced(ENABLE_IPV6) +if(ENABLE_IPV6) + include(CheckStructHasMember) + if(WIN32) + check_struct_has_member("struct sockaddr_in6" "sin6_scope_id" "winsock2.h;ws2tcpip.h" HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) + else() + check_struct_has_member("struct sockaddr_in6" "sin6_scope_id" "netinet/in.h" HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) + check_struct_has_member("struct sockaddr_in6" "sin6_addr" "netinet/in.h" HAVE_SOCKADDR_IN6_SIN6_ADDR) + if(NOT HAVE_SOCKADDR_IN6_SIN6_ADDR) + if(NOT DOS AND NOT AMIGA) + message(WARNING "struct sockaddr_in6 not available, disabling IPv6 support") + endif() + set(ENABLE_IPV6 OFF CACHE BOOL "Enable IPv6 support" FORCE) # Force the feature off as we use this name as guard macro + endif() -check_function_exists(gethostname HAVE_GETHOSTNAME) + if(APPLE AND NOT ENABLE_ARES) + set(_use_core_foundation_and_core_services ON) -if(WIN32) - check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32) - check_library_exists_concat("winmm" getch HAVE_LIBWINMM) + find_library(SYSTEMCONFIGURATION_FRAMEWORK NAMES "SystemConfiguration") + mark_as_advanced(SYSTEMCONFIGURATION_FRAMEWORK) + if(NOT SYSTEMCONFIGURATION_FRAMEWORK) + message(FATAL_ERROR "SystemConfiguration framework not found") + endif() + list(APPEND CURL_LIBS "-framework SystemConfiguration") + endif() + endif() +endif() +if(ENABLE_IPV6 AND NOT WINCE) + set(USE_IPV6 ON) endif() -# check SSL libraries -# TODO support GNUTLS, NSS, POLARSSL, AXTLS, CYASSL +# Check SSL libraries +option(CURL_ENABLE_SSL "Enable SSL support" ON) -if(APPLE) - option(CMAKE_USE_DARWINSSL "enable Apple OS native SSL/TLS" OFF) +if(CURL_DEFAULT_SSL_BACKEND) + set(_valid_default_ssl_backend FALSE) endif() + if(WIN32) - option(CMAKE_USE_WINSSL "enable Windows native SSL/TLS" OFF) - cmake_dependent_option(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON - CMAKE_USE_WINSSL OFF) + cmake_dependent_option(CURL_USE_SCHANNEL "Enable Windows native SSL/TLS (Schannel)" OFF CURL_ENABLE_SSL OFF) + option(CURL_WINDOWS_SSPI "Enable SSPI on Windows" ${CURL_USE_SCHANNEL}) endif() -option(CMAKE_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF) - -set(openssl_default ON) -if(WIN32 OR CMAKE_USE_DARWINSSL OR CMAKE_USE_WINSSL OR CMAKE_USE_MBEDTLS) - set(openssl_default OFF) +cmake_dependent_option(CURL_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF) +cmake_dependent_option(CURL_USE_WOLFSSL "Enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF) +cmake_dependent_option(CURL_USE_GNUTLS "Enable GnuTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF) +cmake_dependent_option(CURL_USE_RUSTLS "Enable Rustls for SSL/TLS" OFF CURL_ENABLE_SSL OFF) + +if(WIN32 OR + CURL_USE_SCHANNEL OR + CURL_USE_MBEDTLS OR + CURL_USE_WOLFSSL OR + CURL_USE_GNUTLS OR + CURL_USE_RUSTLS) + set(_openssl_default OFF) +else() + set(_openssl_default ON) endif() -option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default}) - -collect_true(enabled_ssl_options enabled_ssl_options_count - CMAKE_USE_WINSSL - CMAKE_USE_DARWINSSL - CMAKE_USE_OPENSSL - CMAKE_USE_MBEDTLS +cmake_dependent_option(CURL_USE_OPENSSL "Enable OpenSSL for SSL/TLS" ${_openssl_default} CURL_ENABLE_SSL OFF) +option(USE_OPENSSL_QUIC "Use OpenSSL and nghttp3 libraries for HTTP/3 support" OFF) +if(USE_OPENSSL_QUIC AND NOT CURL_USE_OPENSSL) + message(WARNING "OpenSSL QUIC has been requested, but without enabling OpenSSL. Will not enable QUIC.") + set(USE_OPENSSL_QUIC OFF) +endif() +option(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG "Disable automatic loading of OpenSSL configuration" OFF) + +curl_count_true(_enabled_ssl_options_count + CURL_USE_SCHANNEL + CURL_USE_OPENSSL + CURL_USE_MBEDTLS + CURL_USE_WOLFSSL + CURL_USE_GNUTLS + CURL_USE_RUSTLS ) -if(enabled_ssl_options_count GREATER 1) - message(FATAL_ERROR "Multiple SSL options specified: ${enabled_ssl_options}. Please pick at most one and disable the rest.") +if(_enabled_ssl_options_count GREATER 1) + set(CURL_WITH_MULTI_SSL ON) +elseif(_enabled_ssl_options_count EQUAL 0) + set(CURL_DISABLE_HSTS ON) endif() -if(CMAKE_USE_WINSSL) - set(SSL_ENABLED ON) - set(USE_SCHANNEL ON) # Windows native SSL/TLS support - set(USE_WINDOWS_SSPI ON) # CMAKE_USE_WINSSL implies CURL_WINDOWS_SSPI - list(APPEND CURL_LIBS "crypt32") +if(CURL_USE_SCHANNEL) + set(_ssl_enabled ON) + set(USE_SCHANNEL ON) # Windows native SSL/TLS support + set(USE_WINDOWS_SSPI ON) # CURL_USE_SCHANNEL requires CURL_WINDOWS_SSPI + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "schannel") + set(_valid_default_ssl_backend TRUE) + endif() endif() if(CURL_WINDOWS_SSPI) set(USE_WINDOWS_SSPI ON) - set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DSECURITY_WIN32") endif() -if(CMAKE_USE_DARWINSSL) - find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation") +if(_use_core_foundation_and_core_services) + find_library(COREFOUNDATION_FRAMEWORK NAMES "CoreFoundation") + mark_as_advanced(COREFOUNDATION_FRAMEWORK) if(NOT COREFOUNDATION_FRAMEWORK) - message(FATAL_ERROR "CoreFoundation framework not found") + message(FATAL_ERROR "CoreFoundation framework not found") endif() + list(APPEND CURL_LIBS "-framework CoreFoundation") - find_library(SECURITY_FRAMEWORK "Security") - if(NOT SECURITY_FRAMEWORK) - message(FATAL_ERROR "Security framework not found") + find_library(CORESERVICES_FRAMEWORK NAMES "CoreServices") + mark_as_advanced(CORESERVICES_FRAMEWORK) + if(NOT CORESERVICES_FRAMEWORK) + message(FATAL_ERROR "CoreServices framework not found") endif() - - set(SSL_ENABLED ON) - set(USE_DARWINSSL ON) - list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}") + list(APPEND CURL_LIBS "-framework CoreServices") endif() -if(CMAKE_USE_OPENSSL) +if(CURL_USE_OPENSSL) find_package(OpenSSL REQUIRED) - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_OPENSSL ON) - set(HAVE_LIBCRYPTO ON) - set(HAVE_LIBSSL ON) - list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) - include_directories(${OPENSSL_INCLUDE_DIR}) - set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) - check_include_file("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H) - check_include_file("openssl/engine.h" HAVE_OPENSSL_ENGINE_H) - check_include_file("openssl/err.h" HAVE_OPENSSL_ERR_H) - check_include_file("openssl/pem.h" HAVE_OPENSSL_PEM_H) - check_include_file("openssl/rsa.h" HAVE_OPENSSL_RSA_H) - check_include_file("openssl/ssl.h" HAVE_OPENSSL_SSL_H) - check_include_file("openssl/x509.h" HAVE_OPENSSL_X509_H) - check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H) - check_symbol_exists(RAND_status "${CURL_INCLUDES}" HAVE_RAND_STATUS) - check_symbol_exists(RAND_screen "${CURL_INCLUDES}" HAVE_RAND_SCREEN) - check_symbol_exists(RAND_egd "${CURL_INCLUDES}" HAVE_RAND_EGD) -endif() - -if(CMAKE_USE_MBEDTLS) + + # Depend on OpenSSL via imported targets. This allows our dependents to + # get our dependencies transitively. + list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "openssl") + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") + set(_valid_default_ssl_backend TRUE) + endif() + set(_curl_ca_bundle_supported TRUE) + + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) + if(NOT DEFINED HAVE_BORINGSSL) + check_symbol_exists("OPENSSL_IS_BORINGSSL" "openssl/base.h" HAVE_BORINGSSL) + endif() + if(NOT DEFINED HAVE_AWSLC) + check_symbol_exists("OPENSSL_IS_AWSLC" "openssl/base.h" HAVE_AWSLC) + endif() + if(NOT DEFINED HAVE_LIBRESSL) + check_symbol_exists("LIBRESSL_VERSION_NUMBER" "openssl/opensslv.h" HAVE_LIBRESSL) + endif() + cmake_pop_check_state() + + if(HAVE_BORINGSSL OR HAVE_AWSLC) + if(OPENSSL_USE_STATIC_LIBS AND CMAKE_C_COMPILER_ID MATCHES "Clang") + list(APPEND CURL_LIBS "stdc++") + list(APPEND CMAKE_REQUIRED_LIBRARIES "stdc++") + endif() + endif() + + if(HAVE_BORINGSSL) + set(_openssl "BoringSSL") + elseif(HAVE_AWSLC) + set(_openssl "AWS-LC") + elseif(HAVE_LIBRESSL) + set(_openssl "LibreSSL") + elseif(USE_AMISSL) + set(_openssl "AmiSSL") + else() + set(_openssl "OpenSSL") + endif() +endif() + +if(CURL_USE_MBEDTLS) find_package(MbedTLS REQUIRED) - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_MBEDTLS ON) list(APPEND CURL_LIBS ${MBEDTLS_LIBRARIES}) - include_directories(${MBEDTLS_INCLUDE_DIRS}) + list(APPEND CURL_LIBDIRS ${MBEDTLS_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${MBEDTLS_PC_REQUIRES}) + include_directories(SYSTEM ${MBEDTLS_INCLUDE_DIRS}) + link_directories(${MBEDTLS_LIBRARY_DIRS}) + if(MBEDTLS_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${MBEDTLS_CFLAGS}") + endif() + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "mbedtls") + set(_valid_default_ssl_backend TRUE) + endif() + set(_curl_ca_bundle_supported TRUE) endif() -option(USE_NGHTTP2 "Use Nghttp2 library" OFF) -if(USE_NGHTTP2) - find_package(NGHTTP2 REQUIRED) - include_directories(${NGHTTP2_INCLUDE_DIRS}) - list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES}) +if(CURL_USE_WOLFSSL) + find_package(WolfSSL REQUIRED) + set(_ssl_enabled ON) + set(USE_WOLFSSL ON) + list(APPEND CURL_LIBS ${WOLFSSL_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${WOLFSSL_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${WOLFSSL_PC_REQUIRES}) + include_directories(SYSTEM ${WOLFSSL_INCLUDE_DIRS}) + link_directories(${WOLFSSL_LIBRARY_DIRS}) + if(WOLFSSL_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${WOLFSSL_CFLAGS}") + endif() + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "wolfssl") + set(_valid_default_ssl_backend TRUE) + endif() + set(_curl_ca_bundle_supported TRUE) endif() -if(NOT CURL_DISABLE_LDAP) +if(CURL_USE_GNUTLS) + if(CURL_USE_PKGCONFIG) + find_package(PkgConfig QUIET) + pkg_check_modules(GNUTLS "gnutls") + if(GNUTLS_FOUND) + set(GNUTLS_LIBRARIES ${GNUTLS_LINK_LIBRARIES}) + string(REPLACE ";" " " GNUTLS_CFLAGS "${GNUTLS_CFLAGS}") + if(GNUTLS_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${GNUTLS_CFLAGS}") + endif() + endif() + endif() + if(NOT GNUTLS_FOUND) + find_package(GnuTLS REQUIRED) + endif() + find_package(Nettle REQUIRED) + set(_ssl_enabled ON) + set(USE_GNUTLS ON) + list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${GNUTLS_LIBRARY_DIRS} ${NETTLE_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gnutls" ${NETTLE_PC_REQUIRES}) + include_directories(SYSTEM ${GNUTLS_INCLUDE_DIRS} ${NETTLE_INCLUDE_DIRS}) + link_directories(${NETTLE_LIBRARY_DIRS}) + if(NETTLE_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${NETTLE_CFLAGS}") + endif() + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "gnutls") + set(_valid_default_ssl_backend TRUE) + endif() + set(_curl_ca_bundle_supported TRUE) + + if(NOT DEFINED HAVE_GNUTLS_SRP AND NOT CURL_DISABLE_SRP) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}") + check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP) + cmake_pop_check_state() + endif() +endif() + +if(CURL_USE_RUSTLS) + find_package(Rustls REQUIRED) + set(_ssl_enabled ON) + set(USE_RUSTLS ON) + list(APPEND CURL_LIBS ${RUSTLS_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${RUSTLS_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${RUSTLS_PC_REQUIRES}) + include_directories(SYSTEM ${RUSTLS_INCLUDE_DIRS}) + link_directories(${RUSTLS_LIBRARY_DIRS}) + if(RUSTLS_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${RUSTLS_CFLAGS}") + endif() + + if(NOT DEFINED HAVE_RUSTLS_SUPPORTED_HPKE) + if(RUSTLS_VERSION AND RUSTLS_VERSION VERSION_GREATER_EQUAL 0.15) + set(HAVE_RUSTLS_SUPPORTED_HPKE TRUE) + elseif(NOT RUSTLS_VERSION) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES "${RUSTLS_INCLUDE_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${RUSTLS_LIBRARIES}") + curl_required_libpaths("${RUSTLS_LIBRARY_DIRS}") + check_symbol_exists("rustls_supported_hpke" "rustls.h" HAVE_RUSTLS_SUPPORTED_HPKE) + cmake_pop_check_state() + endif() + endif() + if(NOT HAVE_RUSTLS_SUPPORTED_HPKE) + message(FATAL_ERROR "rustls-ffi library does not provide rustls_supported_hpke function. Required version is 0.15 or newer.") + endif() + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "rustls") + set(_valid_default_ssl_backend TRUE) + endif() + set(_curl_ca_bundle_supported TRUE) +endif() + +if(CURL_DEFAULT_SSL_BACKEND AND NOT _valid_default_ssl_backend) + message(FATAL_ERROR "CURL_DEFAULT_SSL_BACKEND '${CURL_DEFAULT_SSL_BACKEND}' not enabled.") +endif() + +# Keep ZLIB detection after TLS detection, +# and before calling curl_openssl_check_exists(). + +set(HAVE_LIBZ OFF) +curl_dependency_option(CURL_ZLIB ZLIB "ZLIB") +if(ZLIB_FOUND) + set(HAVE_LIBZ ON) + # Depend on ZLIB via imported targets. This allows our dependents to + # get our dependencies transitively. + list(APPEND CURL_LIBS ZLIB::ZLIB) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "zlib") +endif() + +set(HAVE_BROTLI OFF) +curl_dependency_option(CURL_BROTLI Brotli "brotli") +if(BROTLI_FOUND) + set(HAVE_BROTLI ON) + list(APPEND CURL_LIBS ${BROTLI_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${BROTLI_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${BROTLI_PC_REQUIRES}) + include_directories(SYSTEM ${BROTLI_INCLUDE_DIRS}) + link_directories(${BROTLI_LIBRARY_DIRS}) + if(BROTLI_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${BROTLI_CFLAGS}") + endif() +endif() + +set(HAVE_ZSTD OFF) +curl_dependency_option(CURL_ZSTD Zstd "zstd") +if(ZSTD_FOUND) + if(ZSTD_VERSION VERSION_GREATER_EQUAL 1.0.0) + set(HAVE_ZSTD ON) + list(APPEND CURL_LIBS ${ZSTD_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${ZSTD_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${ZSTD_PC_REQUIRES}) + include_directories(SYSTEM ${ZSTD_INCLUDE_DIRS}) + link_directories(${ZSTD_LIBRARY_DIRS}) + if(ZSTD_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${ZSTD_CFLAGS}") + endif() + else() + message(WARNING "zstd v1.0.0 or newer is required, disabling zstd support.") + endif() +endif() + +# Check function in an OpenSSL-like TLS backend. +macro(curl_openssl_check_exists) + cmake_push_check_state() + if(USE_OPENSSL) + list(APPEND CMAKE_REQUIRED_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DOPENSSL_SUPPRESS_DEPRECATED") # for SSL_CTX_set_srp_username deprecated since 3.0.0 + if(HAVE_LIBZ) + list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB) + endif() + if(WIN32 AND NOT WINCE) + list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt") # for OpenSSL/LibreSSL + endif() + endif() + if(USE_WOLFSSL) + list(APPEND CMAKE_REQUIRED_INCLUDES "${WOLFSSL_INCLUDE_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${WOLFSSL_LIBRARIES}") + curl_required_libpaths("${WOLFSSL_LIBRARY_DIRS}") + if(HAVE_LIBZ) + list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB) # Public wolfSSL headers also require zlib headers + endif() + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAVE_UINTPTR_T") # to pull in stdint.h (as of wolfSSL v5.5.4) + endif() if(WIN32) - option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON) - if(USE_WIN32_LDAP) - check_library_exists_concat("wldap32" cldap_open HAVE_WLDAP32) - if(NOT HAVE_WLDAP32) - set(USE_WIN32_LDAP OFF) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}" "${_win32_crypt32}") # for OpenSSL/wolfSSL + endif() + if(${ARGC} EQUAL 2) + check_function_exists(${ARGN}) + else() + check_symbol_exists(${ARGN}) # Uses CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_DEFINITIONS + endif() + cmake_pop_check_state() +endmacro() + +# Ensure that OpenSSL (or fork) or wolfSSL actually supports QUICTLS API. +macro(curl_openssl_check_quic) + if(USE_OPENSSL AND NOT USE_OPENSSL_QUIC) + if(OPENSSL_VERSION VERSION_GREATER_EQUAL 3.5.0) + if(NOT DEFINED HAVE_SSL_SET_QUIC_TLS_CBS) + curl_openssl_check_exists("SSL_set_quic_tls_cbs" HAVE_SSL_SET_QUIC_TLS_CBS) + endif() + else() + if(NOT DEFINED HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT) + curl_openssl_check_exists("SSL_set_quic_use_legacy_codepoint" HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT) endif() endif() endif() + if(USE_WOLFSSL AND NOT DEFINED HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT) + curl_openssl_check_exists("wolfSSL_set_quic_use_legacy_codepoint" HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT) + endif() + if(NOT HAVE_SSL_SET_QUIC_TLS_CBS AND + NOT HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT AND + NOT HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT) + message(FATAL_ERROR "QUICTLS API support is missing from OpenSSL/fork/wolfSSL. Try setting -DOPENSSL_ROOT_DIR") + endif() +endmacro() + +if(USE_WOLFSSL) + curl_openssl_check_exists("wolfSSL_get_peer_certificate" HAVE_WOLFSSL_GET_PEER_CERTIFICATE) + curl_openssl_check_exists("wolfSSL_UseALPN" HAVE_WOLFSSL_USEALPN) + curl_openssl_check_exists("wolfSSL_DES_ecb_encrypt" HAVE_WOLFSSL_DES_ECB_ENCRYPT) + curl_openssl_check_exists("wolfSSL_BIO_new" HAVE_WOLFSSL_BIO_NEW) + curl_openssl_check_exists("wolfSSL_BIO_set_shutdown" HAVE_WOLFSSL_BIO_SET_SHUTDOWN) +endif() - option(CMAKE_USE_OPENLDAP "Use OpenLDAP code." OFF) - mark_as_advanced(CMAKE_USE_OPENLDAP) - set(CMAKE_LDAP_LIB "ldap" CACHE STRING "Name or full path to ldap library") - set(CMAKE_LBER_LIB "lber" CACHE STRING "Name or full path to lber library") +if(USE_OPENSSL) + if(NOT DEFINED HAVE_SSL_SET0_WBIO) + curl_openssl_check_exists("SSL_set0_wbio" HAVE_SSL_SET0_WBIO) + endif() + if(NOT DEFINED HAVE_OPENSSL_SRP AND NOT CURL_DISABLE_SRP) + curl_openssl_check_exists("SSL_CTX_set_srp_username" "openssl/ssl.h" HAVE_OPENSSL_SRP) + endif() +endif() - if(CMAKE_USE_OPENLDAP AND USE_WIN32_LDAP) - message(FATAL_ERROR "Cannot use USE_WIN32_LDAP and CMAKE_USE_OPENLDAP at the same time") +option(USE_HTTPSRR "Enable HTTPS RR support" OFF) +option(USE_ECH "Enable ECH support" OFF) +if(USE_ECH) + if(USE_OPENSSL OR USE_WOLFSSL OR USE_RUSTLS) + # Be sure that the TLS library actually supports ECH. + if(USE_WOLFSSL) + curl_openssl_check_exists("wolfSSL_CTX_GenerateEchConfig" HAVE_WOLFSSL_CTX_GENERATEECHCONFIG) + endif() + if(USE_OPENSSL) + curl_openssl_check_exists("SSL_set1_ech_config_list" HAVE_SSL_SET1_ECH_CONFIG_LIST) + endif() + if(HAVE_WOLFSSL_CTX_GENERATEECHCONFIG OR + HAVE_SSL_SET1_ECH_CONFIG_LIST OR + USE_RUSTLS) + set(HAVE_ECH 1) + endif() + if(NOT HAVE_ECH) + message(FATAL_ERROR "ECH support missing in OpenSSL/BoringSSL/AWS-LC/wolfSSL/rustls-ffi") + else() + message(STATUS "ECH enabled") + # ECH wants HTTPSRR + set(USE_HTTPSRR ON) + message(STATUS "HTTPSRR enabled") + endif() + else() + message(FATAL_ERROR "ECH requires ECH-enabled OpenSSL, BoringSSL, AWS-LC, wolfSSL or rustls-ffi") endif() +endif() - # Now that we know, we're not using windows LDAP... - if(USE_WIN32_LDAP) - check_include_file_concat("winldap.h" HAVE_WINLDAP_H) - check_include_file_concat("winber.h" HAVE_WINBER_H) +option(USE_SSLS_EXPORT "Enable SSL session export support" OFF) +if(USE_SSLS_EXPORT) + if(_ssl_enabled) + message(STATUS "SSL export enabled.") else() - # Check for LDAP - set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) - check_library_exists_concat(${CMAKE_LDAP_LIB} ldap_init HAVE_LIBLDAP) - check_library_exists_concat(${CMAKE_LBER_LIB} ber_init HAVE_LIBLBER) - - set(CMAKE_REQUIRED_INCLUDES_BAK ${CMAKE_REQUIRED_INCLUDES}) - set(CMAKE_LDAP_INCLUDE_DIR "" CACHE STRING "Path to LDAP include directory") - if(CMAKE_LDAP_INCLUDE_DIR) - list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_LDAP_INCLUDE_DIR}) + message(FATAL_ERROR "SSL session export requires SSL enabled") + endif() +endif() + +option(USE_NGHTTP2 "Use nghttp2 library" ON) +if(USE_NGHTTP2) + find_package(NGHTTP2) + if(NGHTTP2_FOUND) + list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${NGHTTP2_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP2_PC_REQUIRES}) + include_directories(SYSTEM ${NGHTTP2_INCLUDE_DIRS}) + link_directories(${NGHTTP2_LIBRARY_DIRS}) + if(NGHTTP2_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${NGHTTP2_CFLAGS}") endif() - check_include_file_concat("ldap.h" HAVE_LDAP_H) - check_include_file_concat("lber.h" HAVE_LBER_H) + else() + set(USE_NGHTTP2 OFF) + endif() +endif() - if(NOT HAVE_LDAP_H) - message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON") - set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used - elseif(NOT HAVE_LIBLDAP) - message(STATUS "LDAP library '${CMAKE_LDAP_LIB}' not found CURL_DISABLE_LDAP set ON") - set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE) - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used +option(USE_NGTCP2 "Use ngtcp2 and nghttp3 libraries for HTTP/3 support" OFF) +if(USE_NGTCP2) + if(USE_OPENSSL OR USE_WOLFSSL) + if(USE_WOLFSSL) + find_package(NGTCP2 REQUIRED "wolfSSL") + elseif(HAVE_BORINGSSL OR HAVE_AWSLC) + find_package(NGTCP2 REQUIRED "BoringSSL") + elseif(OPENSSL_VERSION VERSION_GREATER_EQUAL 3.5.0 AND NOT USE_OPENSSL_QUIC) + find_package(NGTCP2 REQUIRED "ossl") + if(NGTCP2_VERSION VERSION_LESS 1.12.0) + message(FATAL_ERROR "ngtcp2 1.12.0 or upper required for OpenSSL") + endif() + set(OPENSSL_QUIC_API2 1) else() - if(CMAKE_USE_OPENLDAP) - set(USE_OPENLDAP ON) + find_package(NGTCP2 REQUIRED "quictls") + if(NOT HAVE_LIBRESSL) + set(_openssl "quictls") endif() - if(CMAKE_LDAP_INCLUDE_DIR) - include_directories(${CMAKE_LDAP_INCLUDE_DIR}) + endif() + curl_openssl_check_quic() + elseif(USE_GNUTLS) + find_package(NGTCP2 REQUIRED "GnuTLS") + else() + message(FATAL_ERROR "ngtcp2 requires a supported TLS-backend") + endif() + list(APPEND CURL_LIBS ${NGTCP2_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${NGTCP2_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGTCP2_PC_REQUIRES}) + include_directories(SYSTEM ${NGTCP2_INCLUDE_DIRS}) + link_directories(${NGTCP2_LIBRARY_DIRS}) + if(NGTCP2_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${NGTCP2_CFLAGS}") + endif() + + find_package(NGHTTP3 REQUIRED) + set(USE_NGHTTP3 ON) + list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${NGHTTP3_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP3_PC_REQUIRES}) + include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS}) + link_directories(${NGHTTP3_LIBRARY_DIRS}) + if(NGHTTP3_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${NGHTTP3_CFLAGS}") + endif() +endif() + +option(USE_QUICHE "Use quiche library for HTTP/3 support" OFF) +if(USE_QUICHE) + if(USE_NGTCP2) + message(FATAL_ERROR "Only one HTTP/3 backend can be selected") + endif() + find_package(Quiche REQUIRED) + if(NOT HAVE_BORINGSSL) + message(FATAL_ERROR "quiche requires BoringSSL") + endif() + curl_openssl_check_quic() + list(APPEND CURL_LIBS ${QUICHE_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${QUICHE_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${QUICHE_PC_REQUIRES}) + include_directories(SYSTEM ${QUICHE_INCLUDE_DIRS}) + link_directories(${QUICHE_LIBRARY_DIRS}) + if(QUICHE_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${QUICHE_CFLAGS}") + endif() + if(NOT DEFINED HAVE_QUICHE_CONN_SET_QLOG_FD) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES "${QUICHE_INCLUDE_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${QUICHE_LIBRARIES}") + check_symbol_exists("quiche_conn_set_qlog_fd" "quiche.h" HAVE_QUICHE_CONN_SET_QLOG_FD) + cmake_pop_check_state() + endif() +endif() + +option(USE_MSH3 "Use msh3/msquic library for HTTP/3 support" OFF) +if(USE_MSH3) + if(USE_NGTCP2 OR USE_QUICHE) + message(FATAL_ERROR "Only one HTTP/3 backend can be selected") + endif() + if(NOT WIN32) + if(NOT USE_OPENSSL) + message(FATAL_ERROR "msh3/msquic requires OpenSSL fork with QUIC API") + endif() + curl_openssl_check_quic() + endif() + find_package(MSH3 REQUIRED) + list(APPEND CURL_LIBS ${MSH3_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${MSH3_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${MSH3_PC_REQUIRES}) + include_directories(SYSTEM ${MSH3_INCLUDE_DIRS}) + link_directories(${MSH3_LIBRARY_DIRS}) + if(MSH3_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${MSH3_CFLAGS}") + endif() +endif() + +if(USE_OPENSSL_QUIC) + if(USE_NGTCP2 OR USE_QUICHE OR USE_MSH3) + message(FATAL_ERROR "Only one HTTP/3 backend can be selected") + endif() + find_package(OpenSSL 3.3.0 REQUIRED) + + find_package(NGHTTP3 REQUIRED) + set(USE_NGHTTP3 ON) + list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${NGHTTP3_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP3_PC_REQUIRES}) + include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS}) + link_directories(${NGHTTP3_LIBRARY_DIRS}) + if(NGHTTP3_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${NGHTTP3_CFLAGS}") + endif() +endif() + +if(CURL_WITH_MULTI_SSL AND (USE_NGTCP2 OR USE_QUICHE OR USE_MSH3 OR USE_OPENSSL_QUIC)) + message(FATAL_ERROR "MultiSSL cannot be enabled with HTTP/3 and vice versa.") +endif() + +if(NOT CURL_DISABLE_SRP AND (HAVE_GNUTLS_SRP OR HAVE_OPENSSL_SRP)) + set(USE_TLS_SRP 1) +endif() + +if(NOT CURL_DISABLE_LDAP) + if(WIN32 AND NOT WINDOWS_STORE AND NOT WINCE) + option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON) + if(USE_WIN32_LDAP) + list(APPEND CURL_LIBS "wldap32") + if(NOT CURL_DISABLE_LDAPS) + set(HAVE_LDAP_SSL ON) endif() - set(NEED_LBER_H ON) - set(_HEADER_LIST) - if(HAVE_WINDOWS_H) - list(APPEND _HEADER_LIST "windows.h") + endif() + endif() + + # Now that we know, we are not using Windows LDAP... + if(NOT USE_WIN32_LDAP) + # Check for LDAP + cmake_push_check_state() + if(USE_OPENSSL) + list(APPEND CMAKE_REQUIRED_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) + endif() + find_package(LDAP) + if(LDAP_FOUND) + set(HAVE_LBER_H 1) + set(CURL_LIBS ${LDAP_LIBRARIES} ${CURL_LIBS}) + list(APPEND CURL_LIBDIRS ${LDAP_LIBRARY_DIRS}) + if(LDAP_PC_REQUIRES) + set(LIBCURL_PC_REQUIRES_PRIVATE ${LDAP_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) endif() - if(HAVE_SYS_TYPES_H) - list(APPEND _HEADER_LIST "sys/types.h") + include_directories(SYSTEM ${LDAP_INCLUDE_DIRS}) + link_directories(${LDAP_LIBRARY_DIRS}) + if(LDAP_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LDAP_CFLAGS}") endif() - list(APPEND _HEADER_LIST "ldap.h") - set(_SRC_STRING "") - foreach(_HEADER ${_HEADER_LIST}) - set(_INCLUDE_STRING "${_INCLUDE_STRING}#include <${_HEADER}>\n") - endforeach() + # LDAP feature checks - set(_SRC_STRING - " - ${_INCLUDE_STRING} - int main(int argc, char ** argv) - { - BerValue *bvp = NULL; - BerElement *bep = ber_init(bvp); - ber_free(bep, 1); - return 0; - }" - ) - set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DLDAP_DEPRECATED=1") - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB}) - if(HAVE_LIBLBER) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LBER_LIB}) - endif() - check_c_source_compiles("${_SRC_STRING}" NOT_NEED_LBER_H) + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DLDAP_DEPRECATED=1") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${LDAP_LIBRARIES}") + curl_required_libpaths("${LDAP_LIBRARY_DIRS}") - if(NOT_NEED_LBER_H) - set(NEED_LBER_H OFF) - else() - set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DNEED_LBER_H") + check_function_exists("ldap_url_parse" HAVE_LDAP_URL_PARSE) + check_function_exists("ldap_init_fd" HAVE_LDAP_INIT_FD) + + check_include_file("ldap_ssl.h" HAVE_LDAP_SSL_H) + + if(HAVE_LDAP_INIT_FD) + set(USE_OPENLDAP ON) endif() + if(NOT CURL_DISABLE_LDAPS) + set(HAVE_LDAP_SSL ON) + endif() + else() + message(STATUS "LDAP not found. CURL_DISABLE_LDAP set ON") + set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE) endif() + cmake_pop_check_state() endif() - endif() # No ldap, no ldaps. @@ -494,434 +1270,568 @@ if(CURL_DISABLE_LDAP) endif() endif() -if(NOT CURL_DISABLE_LDAPS) - check_include_file_concat("ldap_ssl.h" HAVE_LDAP_SSL_H) - check_include_file_concat("ldapssl.h" HAVE_LDAPSSL_H) +if(WIN32) + option(USE_WIN32_IDN "Use WinIDN for IDN support" OFF) + if(USE_WIN32_IDN) + list(APPEND CURL_LIBS "normaliz") + endif() +else() + set(USE_WIN32_IDN OFF) +endif() + +if(APPLE) + option(USE_APPLE_IDN "Use Apple built-in IDN support" OFF) + if(USE_APPLE_IDN) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_LIBRARIES "icucore") + check_symbol_exists("uidna_openUTS46" "unicode/uidna.h" HAVE_APPLE_IDN) + cmake_pop_check_state() + if(HAVE_APPLE_IDN) + list(APPEND CURL_LIBS "icucore" "iconv") + else() + set(USE_APPLE_IDN OFF) + endif() + endif() +else() + set(USE_APPLE_IDN OFF) endif() -# Check for idn -check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2) +# Check for libidn2 +option(USE_LIBIDN2 "Use libidn2 for IDN support" ON) +set(HAVE_IDN2_H OFF) +set(HAVE_LIBIDN2 OFF) +if(USE_LIBIDN2 AND NOT USE_APPLE_IDN AND NOT USE_WIN32_IDN) + find_package(Libidn2) + if(LIBIDN2_FOUND) + set(CURL_LIBS ${LIBIDN2_LIBRARIES} ${CURL_LIBS}) + list(APPEND CURL_LIBDIRS ${LIBIDN2_LIBRARY_DIRS}) + set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBIDN2_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) + include_directories(SYSTEM ${LIBIDN2_INCLUDE_DIRS}) + link_directories(${LIBIDN2_LIBRARY_DIRS}) + if(LIBIDN2_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LIBIDN2_CFLAGS}") + endif() + set(HAVE_IDN2_H 1) + set(HAVE_LIBIDN2 1) + endif() +endif() -# Check for symbol dlopen (same as HAVE_LIBDL) -check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN) +# libpsl +option(CURL_USE_LIBPSL "Use libpsl" ON) +mark_as_advanced(CURL_USE_LIBPSL) +set(USE_LIBPSL OFF) + +if(CURL_USE_LIBPSL) + find_package(Libpsl REQUIRED) + list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${LIBPSL_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBPSL_PC_REQUIRES}) + include_directories(SYSTEM ${LIBPSL_INCLUDE_DIRS}) + link_directories(${LIBPSL_LIBRARY_DIRS}) + if(LIBPSL_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LIBPSL_CFLAGS}") + endif() + set(USE_LIBPSL ON) +endif() -option(CURL_ZLIB "Set to ON to enable building curl with zlib support." ON) -set(HAVE_LIBZ OFF) -set(HAVE_ZLIB_H OFF) -set(HAVE_ZLIB OFF) -if(CURL_ZLIB) - find_package(ZLIB QUIET) - if(ZLIB_FOUND) - set(HAVE_ZLIB_H ON) - set(HAVE_ZLIB ON) - set(HAVE_LIBZ ON) - list(APPEND CURL_LIBS ${ZLIB_LIBRARIES}) - include_directories(${ZLIB_INCLUDE_DIRS}) - list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) - endif() -endif() - -#libSSH2 -option(CMAKE_USE_LIBSSH2 "Use libSSH2" ON) -mark_as_advanced(CMAKE_USE_LIBSSH2) +# libssh2 +option(CURL_USE_LIBSSH2 "Use libssh2" ON) +mark_as_advanced(CURL_USE_LIBSSH2) set(USE_LIBSSH2 OFF) -set(HAVE_LIBSSH2 OFF) -set(HAVE_LIBSSH2_H OFF) -if(CMAKE_USE_LIBSSH2) - find_package(LibSSH2) +if(CURL_USE_LIBSSH2) + find_package(Libssh2) if(LIBSSH2_FOUND) - list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY}) - set(CMAKE_REQUIRED_LIBRARIES ${LIBSSH2_LIBRARY}) - list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}") - include_directories("${LIBSSH2_INCLUDE_DIR}") - set(HAVE_LIBSSH2 ON) + set(CURL_LIBS ${LIBSSH2_LIBRARIES} ${CURL_LIBS}) # keep it before TLS-crypto, compression + list(APPEND CURL_LIBDIRS ${LIBSSH2_LIBRARY_DIRS}) + set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBSSH2_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) + include_directories(SYSTEM ${LIBSSH2_INCLUDE_DIRS}) + link_directories(${LIBSSH2_LIBRARY_DIRS}) + if(LIBSSH2_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LIBSSH2_CFLAGS}") + endif() set(USE_LIBSSH2 ON) + endif() +endif() - # find_package has already found the headers - set(HAVE_LIBSSH2_H ON) - set(CURL_INCLUDES ${CURL_INCLUDES} "${LIBSSH2_INCLUDE_DIR}/libssh2.h") - set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DHAVE_LIBSSH2_H") +# libssh +option(CURL_USE_LIBSSH "Use libssh" OFF) +mark_as_advanced(CURL_USE_LIBSSH) +if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH) + find_package(Libssh REQUIRED) + set(CURL_LIBS ${LIBSSH_LIBRARIES} ${CURL_LIBS}) # keep it before TLS-crypto, compression + list(APPEND CURL_LIBDIRS ${LIBSSH_LIBRARY_DIRS}) + set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBSSH_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) + include_directories(SYSTEM ${LIBSSH_INCLUDE_DIRS}) + link_directories(${LIBSSH_LIBRARY_DIRS}) + if(LIBSSH_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LIBSSH_CFLAGS}") + endif() + set(USE_LIBSSH ON) +endif() - # now check for specific libssh2 symbols as they were added in different versions - set(CMAKE_EXTRA_INCLUDE_FILES "libssh2.h") - check_function_exists(libssh2_version HAVE_LIBSSH2_VERSION) - check_function_exists(libssh2_init HAVE_LIBSSH2_INIT) - check_function_exists(libssh2_exit HAVE_LIBSSH2_EXIT) - check_function_exists(libssh2_scp_send64 HAVE_LIBSSH2_SCP_SEND64) - check_function_exists(libssh2_session_handshake HAVE_LIBSSH2_SESSION_HANDSHAKE) - set(CMAKE_EXTRA_INCLUDE_FILES "") +# wolfSSH +option(CURL_USE_WOLFSSH "Use wolfSSH" OFF) +mark_as_advanced(CURL_USE_WOLFSSH) +set(USE_WOLFSSH OFF) +if(NOT USE_LIBSSH2 AND NOT USE_LIBSSH AND CURL_USE_WOLFSSH) + if(USE_WOLFSSL) + find_package(WolfSSH) + if(WOLFSSH_FOUND) + set(CURL_LIBS ${WOLFSSH_LIBRARIES} ${CURL_LIBS}) # keep it before TLS-crypto, compression + include_directories(SYSTEM ${WOLFSSH_INCLUDE_DIRS}) + set(USE_WOLFSSH ON) + endif() + else() + message(WARNING "wolfSSH requires wolfSSL. Skipping.") + endif() +endif() - endif(LIBSSH2_FOUND) -endif(CMAKE_USE_LIBSSH2) +option(CURL_USE_GSASL "Use libgsasl" OFF) +mark_as_advanced(CURL_USE_GSASL) +if(CURL_USE_GSASL) + find_package(Libgsasl REQUIRED) + list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${LIBGSASL_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBGSASL_PC_REQUIRES}) + include_directories(SYSTEM ${LIBGSASL_INCLUDE_DIRS}) + link_directories(${LIBGSASL_LIBRARY_DIRS}) + if(LIBGSASL_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LIBGSASL_CFLAGS}") + endif() + set(USE_GSASL ON) +endif() -option(CMAKE_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is supported with CMake build)" OFF) -mark_as_advanced(CMAKE_USE_GSSAPI) +option(CURL_USE_GSSAPI "Use GSSAPI implementation" OFF) +mark_as_advanced(CURL_USE_GSSAPI) -if(CMAKE_USE_GSSAPI) +if(CURL_USE_GSSAPI) find_package(GSS) set(HAVE_GSSAPI ${GSS_FOUND}) if(GSS_FOUND) + list(APPEND CURL_LIBS ${GSS_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${GSS_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${GSS_PC_REQUIRES}) + include_directories(SYSTEM ${GSS_INCLUDE_DIRS}) + link_directories(${GSS_LIBRARY_DIRS}) + if(GSS_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${GSS_CFLAGS}") + endif() - message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"") - - list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRECTORIES}) - check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H) - check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H) - check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H) + if(GSS_FLAVOUR STREQUAL "GNU") + set(HAVE_GSSGNU 1) + else() + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES "${GSS_INCLUDE_DIRS}") - if(GSS_FLAVOUR STREQUAL "Heimdal") - set(HAVE_GSSHEIMDAL ON) - else() # MIT - set(HAVE_GSSMIT ON) - set(_INCLUDE_LIST "") + set(_include_list "") + check_include_file("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H) if(HAVE_GSSAPI_GSSAPI_H) - list(APPEND _INCLUDE_LIST "gssapi/gssapi.h") - endif() - if(HAVE_GSSAPI_GSSAPI_GENERIC_H) - list(APPEND _INCLUDE_LIST "gssapi/gssapi_generic.h") + list(APPEND _include_list "gssapi/gssapi.h") endif() - if(HAVE_GSSAPI_GSSAPI_KRB5_H) - list(APPEND _INCLUDE_LIST "gssapi/gssapi_krb5.h") - endif() - - string(REPLACE ";" " " _COMPILER_FLAGS_STR "${GSS_COMPILER_FLAGS}") - string(REPLACE ";" " " _LINKER_FLAGS_STR "${GSS_LINKER_FLAGS}") + check_include_files("${_include_list};gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H) - foreach(_dir ${GSS_LINK_DIRECTORIES}) - set(_LINKER_FLAGS_STR "${_LINKER_FLAGS_STR} -L\"${_dir}\"") - endforeach() + if(GSS_FLAVOUR STREQUAL "MIT") + check_include_files("${_include_list};gssapi/gssapi_krb5.h" _have_gssapi_gssapi_krb5_h) + if(HAVE_GSSAPI_GSSAPI_GENERIC_H) + list(APPEND _include_list "gssapi/gssapi_generic.h") + endif() + if(_have_gssapi_gssapi_krb5_h) + list(APPEND _include_list "gssapi/gssapi_krb5.h") + endif() - set(CMAKE_REQUIRED_FLAGS "${_COMPILER_FLAGS_STR} ${_LINKER_FLAGS_STR}") - set(CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES}) - check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" ${_INCLUDE_LIST} HAVE_GSS_C_NT_HOSTBASED_SERVICE) - if(NOT HAVE_GSS_C_NT_HOSTBASED_SERVICE) - set(HAVE_OLD_GSSMIT ON) + if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE) + string(APPEND CMAKE_REQUIRED_FLAGS " ${GSS_CFLAGS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${GSS_LIBRARIES}") + curl_required_libpaths("${GSS_LIBRARY_DIRS}") + check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" "${_include_list}" HAVE_GSS_C_NT_HOSTBASED_SERVICE) + endif() + if(NOT HAVE_GSS_C_NT_HOSTBASED_SERVICE) + set(HAVE_OLD_GSSMIT ON) + endif() endif() - + unset(_include_list) + cmake_pop_check_state() endif() + else() + message(WARNING "GSSAPI has been requested, but no supporting libraries found. Skipping.") + endif() +endif() - include_directories(${GSS_INCLUDE_DIRECTORIES}) - link_directories(${GSS_LINK_DIRECTORIES}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LINKER_FLAGS}") - list(APPEND CURL_LIBS ${GSS_LIBRARIES}) +# libuv +option(CURL_USE_LIBUV "Use libuv for event-based tests" OFF) +if(CURL_USE_LIBUV) + if(NOT ENABLE_DEBUG) + message(FATAL_ERROR "Using libuv without debug support enabled is useless") + endif() + find_package(Libuv REQUIRED) + list(APPEND CURL_LIBS ${LIBUV_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${LIBUV_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBUV_PC_REQUIRES}) + include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS}) + link_directories(${LIBUV_LIBRARY_DIRS}) + if(LIBUV_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LIBUV_CFLAGS}") + endif() + set(USE_LIBUV ON) + set(HAVE_UV_H ON) +endif() - else() - message(WARNING "GSSAPI support has been requested but no supporting libraries found. Skipping.") +option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF) +if(USE_LIBRTMP) + find_package(Librtmp REQUIRED) + list(APPEND CURL_LIBS ${LIBRTMP_LIBRARIES}) + list(APPEND CURL_LIBDIRS ${LIBRTMP_LIBRARY_DIRS}) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBRTMP_PC_REQUIRES}) + include_directories(SYSTEM ${LIBRTMP_INCLUDE_DIRS}) + link_directories(${LIBRTMP_LIBRARY_DIRS}) + if(LIBRTMP_CFLAGS) + string(APPEND CMAKE_C_FLAGS " ${LIBRTMP_CFLAGS}") endif() endif() -option(ENABLE_UNIX_SOCKETS "Define if you want Unix domain sockets support" ON) -if(ENABLE_UNIX_SOCKETS) - include(CheckStructHasMember) - check_struct_has_member("struct sockaddr_un" sun_path "sys/un.h" USE_UNIX_SOCKETS) +option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON) +if(ENABLE_UNIX_SOCKETS AND NOT WINCE) + if(WIN32 OR DOS) + set(USE_UNIX_SOCKETS ON) + else() + include(CheckStructHasMember) + check_struct_has_member("struct sockaddr_un" "sun_path" "sys/un.h" USE_UNIX_SOCKETS) + endif() else() unset(USE_UNIX_SOCKETS CACHE) endif() - # # CA handling # -set(CURL_CA_BUNDLE "auto" CACHE STRING - "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") -set(CURL_CA_FALLBACK OFF CACHE BOOL - "Set ON to use built-in CA store of TLS backend. Defaults to OFF") -set(CURL_CA_PATH "auto" CACHE STRING - "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") - -if("${CURL_CA_BUNDLE}" STREQUAL "") +if(_curl_ca_bundle_supported) + set(CURL_CA_BUNDLE "auto" CACHE + STRING "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + set(CURL_CA_FALLBACK OFF CACHE + BOOL "Use built-in CA store of TLS backend. Defaults to OFF") + set(CURL_CA_PATH "auto" CACHE + STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + set(CURL_CA_EMBED "" CACHE + STRING "Path to the CA bundle to embed in the curl tool.") + + if(CURL_CA_BUNDLE STREQUAL "") message(FATAL_ERROR "Invalid value of CURL_CA_BUNDLE. Use 'none', 'auto' or file path.") -elseif("${CURL_CA_BUNDLE}" STREQUAL "none") + elseif(CURL_CA_BUNDLE STREQUAL "none") unset(CURL_CA_BUNDLE CACHE) -elseif("${CURL_CA_BUNDLE}" STREQUAL "auto") + elseif(CURL_CA_BUNDLE STREQUAL "auto") unset(CURL_CA_BUNDLE CACHE) - set(CURL_CA_BUNDLE_AUTODETECT TRUE) -else() + if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32) + set(_curl_ca_bundle_autodetect TRUE) + endif() + else() set(CURL_CA_BUNDLE_SET TRUE) -endif() + endif() + mark_as_advanced(CURL_CA_BUNDLE_SET) -if("${CURL_CA_PATH}" STREQUAL "") + if(CURL_CA_PATH STREQUAL "") message(FATAL_ERROR "Invalid value of CURL_CA_PATH. Use 'none', 'auto' or directory path.") -elseif("${CURL_CA_PATH}" STREQUAL "none") + elseif(CURL_CA_PATH STREQUAL "none") unset(CURL_CA_PATH CACHE) -elseif("${CURL_CA_PATH}" STREQUAL "auto") + elseif(CURL_CA_PATH STREQUAL "auto") unset(CURL_CA_PATH CACHE) - set(CURL_CA_PATH_AUTODETECT TRUE) -else() + if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32) + set(_curl_ca_path_autodetect TRUE) + endif() + else() set(CURL_CA_PATH_SET TRUE) -endif() + endif() + mark_as_advanced(CURL_CA_PATH_SET) + + if(CURL_CA_BUNDLE_SET AND _curl_ca_path_autodetect) + # Skip auto-detection of unset CA path because CA bundle is set explicitly + elseif(CURL_CA_PATH_SET AND _curl_ca_bundle_autodetect) + # Skip auto-detection of unset CA bundle because CA path is set explicitly + elseif(_curl_ca_bundle_autodetect OR _curl_ca_path_autodetect) + # First try auto-detecting a CA bundle, then a CA path + + if(_curl_ca_bundle_autodetect) + foreach(_search_ca_bundle_path IN ITEMS + "/etc/ssl/certs/ca-certificates.crt" + "/etc/pki/tls/certs/ca-bundle.crt" + "/usr/share/ssl/certs/ca-bundle.crt" + "/usr/local/share/certs/ca-root-nss.crt" + "/etc/ssl/cert.pem") + if(EXISTS "${_search_ca_bundle_path}") + message(STATUS "Found CA bundle: ${_search_ca_bundle_path}") + set(CURL_CA_BUNDLE "${_search_ca_bundle_path}" CACHE + STRING "Path to the CA bundle. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + set(CURL_CA_BUNDLE_SET TRUE CACHE BOOL "Path to the CA bundle has been set") + break() + endif() + endforeach() + endif() -if(CURL_CA_BUNDLE_SET AND CURL_CA_PATH_AUTODETECT) - # Skip autodetection of unset CA path because CA bundle is set explicitly -elseif(CURL_CA_PATH_SET AND CURL_CA_BUNDLE_AUTODETECT) - # Skip autodetection of unset CA bundle because CA path is set explicitly -elseif(CURL_CA_PATH_AUTODETECT OR CURL_CA_BUNDLE_AUTODETECT) - # first try autodetecting a CA bundle, then a CA path - - if(CURL_CA_BUNDLE_AUTODETECT) - set(SEARCH_CA_BUNDLE_PATHS - /etc/ssl/certs/ca-certificates.crt - /etc/pki/tls/certs/ca-bundle.crt - /usr/share/ssl/certs/ca-bundle.crt - /usr/local/share/certs/ca-root-nss.crt - /etc/ssl/cert.pem) - - foreach(SEARCH_CA_BUNDLE_PATH ${SEARCH_CA_BUNDLE_PATHS}) - if(EXISTS "${SEARCH_CA_BUNDLE_PATH}") - message(STATUS "Found CA bundle: ${SEARCH_CA_BUNDLE_PATH}") - set(CURL_CA_BUNDLE "${SEARCH_CA_BUNDLE_PATH}") - set(CURL_CA_BUNDLE_SET TRUE CACHE BOOL "Path to the CA bundle has been set") - break() - endif() - endforeach() + if(_curl_ca_path_autodetect AND NOT CURL_CA_PATH_SET) + set(_search_ca_path "/etc/ssl/certs") + file(GLOB _curl_ca_files_found "${_search_ca_path}/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].0") + if(_curl_ca_files_found) + unset(_curl_ca_files_found) + message(STATUS "Found CA path: ${_search_ca_path}") + set(CURL_CA_PATH "${_search_ca_path}" CACHE + STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") + set(CURL_CA_PATH_SET TRUE CACHE BOOL "Path to the CA bundle has been set") + endif() endif() + endif() - if(CURL_CA_PATH_AUTODETECT AND (NOT CURL_CA_PATH_SET)) - if(EXISTS "/etc/ssl/certs") - set(CURL_CA_PATH "/etc/ssl/certs") - set(CURL_CA_PATH_SET TRUE CACHE BOOL "Path to the CA bundle has been set") - endif() + set(CURL_CA_EMBED_SET FALSE) + if(BUILD_CURL_EXE AND NOT CURL_CA_EMBED STREQUAL "") + if(EXISTS "${CURL_CA_EMBED}") + set(CURL_CA_EMBED_SET TRUE) + message(STATUS "Found CA bundle to embed: ${CURL_CA_EMBED}") + else() + message(FATAL_ERROR "CA bundle to embed is missing: '${CURL_CA_EMBED}'") endif() + endif() endif() -if(CURL_CA_PATH_SET AND NOT USE_OPENSSL AND NOT USE_MBEDTLS) - message(FATAL_ERROR - "CA path only supported by OpenSSL, GnuTLS or mbed TLS. " - "Set CURL_CA_PATH=none or enable one of those TLS backends.") +if(WIN32) + option(CURL_DISABLE_CA_SEARCH "Disable unsafe CA bundle search in PATH on Windows" OFF) + option(CURL_CA_SEARCH_SAFE "Enable safe CA bundle search (within the curl tool directory) on Windows" OFF) endif() - # Check for header files -if(NOT UNIX) - check_include_file_concat("windows.h" HAVE_WINDOWS_H) - check_include_file_concat("winsock.h" HAVE_WINSOCK_H) - check_include_file_concat("ws2tcpip.h" HAVE_WS2TCPIP_H) - check_include_file_concat("winsock2.h" HAVE_WINSOCK2_H) - if(NOT CURL_WINDOWS_SSPI AND USE_OPENSSL) - set(CURL_LIBS ${CURL_LIBS} "crypt32") - endif() -endif(NOT UNIX) - -check_include_file_concat("stdio.h" HAVE_STDIO_H) -check_include_file_concat("inttypes.h" HAVE_INTTYPES_H) -check_include_file_concat("sys/filio.h" HAVE_SYS_FILIO_H) -check_include_file_concat("sys/ioctl.h" HAVE_SYS_IOCTL_H) -check_include_file_concat("sys/param.h" HAVE_SYS_PARAM_H) -check_include_file_concat("sys/poll.h" HAVE_SYS_POLL_H) -check_include_file_concat("sys/resource.h" HAVE_SYS_RESOURCE_H) -check_include_file_concat("sys/select.h" HAVE_SYS_SELECT_H) -check_include_file_concat("sys/socket.h" HAVE_SYS_SOCKET_H) -check_include_file_concat("sys/sockio.h" HAVE_SYS_SOCKIO_H) -check_include_file_concat("sys/stat.h" HAVE_SYS_STAT_H) -check_include_file_concat("sys/time.h" HAVE_SYS_TIME_H) -check_include_file_concat("sys/types.h" HAVE_SYS_TYPES_H) -check_include_file_concat("sys/uio.h" HAVE_SYS_UIO_H) -check_include_file_concat("sys/un.h" HAVE_SYS_UN_H) -check_include_file_concat("sys/utime.h" HAVE_SYS_UTIME_H) -check_include_file_concat("sys/xattr.h" HAVE_SYS_XATTR_H) -check_include_file_concat("alloca.h" HAVE_ALLOCA_H) -check_include_file_concat("arpa/inet.h" HAVE_ARPA_INET_H) -check_include_file_concat("arpa/tftp.h" HAVE_ARPA_TFTP_H) -check_include_file_concat("assert.h" HAVE_ASSERT_H) -check_include_file_concat("crypto.h" HAVE_CRYPTO_H) -check_include_file_concat("des.h" HAVE_DES_H) -check_include_file_concat("err.h" HAVE_ERR_H) -check_include_file_concat("errno.h" HAVE_ERRNO_H) -check_include_file_concat("fcntl.h" HAVE_FCNTL_H) -check_include_file_concat("idn2.h" HAVE_IDN2_H) -check_include_file_concat("ifaddrs.h" HAVE_IFADDRS_H) -check_include_file_concat("io.h" HAVE_IO_H) -check_include_file_concat("krb.h" HAVE_KRB_H) -check_include_file_concat("libgen.h" HAVE_LIBGEN_H) -check_include_file_concat("limits.h" HAVE_LIMITS_H) -check_include_file_concat("locale.h" HAVE_LOCALE_H) -check_include_file_concat("net/if.h" HAVE_NET_IF_H) -check_include_file_concat("netdb.h" HAVE_NETDB_H) -check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H) -check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H) - -check_include_file_concat("pem.h" HAVE_PEM_H) -check_include_file_concat("poll.h" HAVE_POLL_H) -check_include_file_concat("pwd.h" HAVE_PWD_H) -check_include_file_concat("rsa.h" HAVE_RSA_H) -check_include_file_concat("setjmp.h" HAVE_SETJMP_H) -check_include_file_concat("sgtty.h" HAVE_SGTTY_H) -check_include_file_concat("signal.h" HAVE_SIGNAL_H) -check_include_file_concat("ssl.h" HAVE_SSL_H) -check_include_file_concat("stdbool.h" HAVE_STDBOOL_H) -check_include_file_concat("stdint.h" HAVE_STDINT_H) -check_include_file_concat("stdio.h" HAVE_STDIO_H) -check_include_file_concat("stdlib.h" HAVE_STDLIB_H) -check_include_file_concat("string.h" HAVE_STRING_H) -check_include_file_concat("strings.h" HAVE_STRINGS_H) -check_include_file_concat("stropts.h" HAVE_STROPTS_H) -check_include_file_concat("termio.h" HAVE_TERMIO_H) -check_include_file_concat("termios.h" HAVE_TERMIOS_H) -check_include_file_concat("time.h" HAVE_TIME_H) -check_include_file_concat("unistd.h" HAVE_UNISTD_H) -check_include_file_concat("utime.h" HAVE_UTIME_H) -check_include_file_concat("x509.h" HAVE_X509_H) - -check_include_file_concat("process.h" HAVE_PROCESS_H) -check_include_file_concat("stddef.h" HAVE_STDDEF_H) -check_include_file_concat("dlfcn.h" HAVE_DLFCN_H) -check_include_file_concat("malloc.h" HAVE_MALLOC_H) -check_include_file_concat("memory.h" HAVE_MEMORY_H) -check_include_file_concat("netinet/if_ether.h" HAVE_NETINET_IF_ETHER_H) -check_include_file_concat("stdint.h" HAVE_STDINT_H) -check_include_file_concat("sockio.h" HAVE_SOCKIO_H) -check_include_file_concat("sys/utsname.h" HAVE_SYS_UTSNAME_H) - -check_type_size(size_t SIZEOF_SIZE_T) -check_type_size(ssize_t SIZEOF_SSIZE_T) -check_type_size("long long" SIZEOF_LONG_LONG) -check_type_size("long" SIZEOF_LONG) -check_type_size("short" SIZEOF_SHORT) -check_type_size("int" SIZEOF_INT) -check_type_size("__int64" SIZEOF___INT64) -check_type_size("long double" SIZEOF_LONG_DOUBLE) -check_type_size("time_t" SIZEOF_TIME_T) +if(WIN32) + list(APPEND CURL_INCLUDES "winsock2.h") + list(APPEND CURL_INCLUDES "ws2tcpip.h") + + if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT LESS 0x0501 AND NOT WINCE) + # Windows XP is required for freeaddrinfo, getaddrinfo + message(FATAL_ERROR "Building for Windows XP or newer is required.") + endif() + + # Pre-fill detection results based on target OS version + if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT GREATER_EQUAL 0x0600 AND # Windows Vista or newer + (MINGW OR MSVC) AND + NOT WINCE AND NOT WINDOWS_STORE) + set(HAVE_IF_NAMETOINDEX 1) + else() + set(HAVE_IF_NAMETOINDEX 0) + endif() + unset(HAVE_IF_NAMETOINDEX CACHE) +endif() + +if(NOT WIN32) + list(APPEND CURL_INCLUDES "sys/socket.h") +endif() +if(NOT WIN32 OR MINGW) + list(APPEND CURL_INCLUDES "sys/time.h") +endif() + +# Detect headers + +# Use check_include_file_concat_curl() for headers required by subsequent +# check_include_file_concat_curl() or check_symbol_exists() detections. +# Order for these is significant. +check_include_file("sys/eventfd.h" HAVE_SYS_EVENTFD_H) +check_include_file("sys/filio.h" HAVE_SYS_FILIO_H) +check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H) +check_include_file("sys/param.h" HAVE_SYS_PARAM_H) +check_include_file("sys/poll.h" HAVE_SYS_POLL_H) +check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) +check_include_file_concat_curl("sys/select.h" HAVE_SYS_SELECT_H) +check_include_file("sys/sockio.h" HAVE_SYS_SOCKIO_H) +check_include_file_concat_curl("sys/types.h" HAVE_SYS_TYPES_H) +check_include_file("sys/un.h" HAVE_SYS_UN_H) +check_include_file_concat_curl("sys/utime.h" HAVE_SYS_UTIME_H) # sys/types.h (AmigaOS) + +check_include_file_concat_curl("arpa/inet.h" HAVE_ARPA_INET_H) +check_include_file("dirent.h" HAVE_DIRENT_H) +check_include_file("fcntl.h" HAVE_FCNTL_H) +check_include_file_concat_curl("ifaddrs.h" HAVE_IFADDRS_H) +check_include_file("io.h" HAVE_IO_H) +check_include_file_concat_curl("libgen.h" HAVE_LIBGEN_H) +check_include_file("linux/tcp.h" HAVE_LINUX_TCP_H) +check_include_file("locale.h" HAVE_LOCALE_H) +check_include_file_concat_curl("net/if.h" HAVE_NET_IF_H) # sys/select.h (e.g. MS-DOS/Watt-32) +check_include_file_concat_curl("netdb.h" HAVE_NETDB_H) +check_include_file_concat_curl("netinet/in.h" HAVE_NETINET_IN_H) +check_include_file("netinet/in6.h" HAVE_NETINET_IN6_H) +check_include_file_concat_curl("netinet/tcp.h" HAVE_NETINET_TCP_H) # sys/types.h (e.g. Cygwin) netinet/in.h +check_include_file_concat_curl("netinet/udp.h" HAVE_NETINET_UDP_H) # sys/types.h (e.g. Cygwin) +check_include_file("poll.h" HAVE_POLL_H) +check_include_file("pwd.h" HAVE_PWD_H) +check_include_file("stdatomic.h" HAVE_STDATOMIC_H) +check_include_file("stdbool.h" HAVE_STDBOOL_H) +check_include_file("stdint.h" HAVE_STDINT_H) +check_include_file("strings.h" HAVE_STRINGS_H) +check_include_file("stropts.h" HAVE_STROPTS_H) +check_include_file("termio.h" HAVE_TERMIO_H) +check_include_file("termios.h" HAVE_TERMIOS_H) +check_include_file_concat_curl("unistd.h" HAVE_UNISTD_H) +check_include_file("utime.h" HAVE_UTIME_H) + +if(AMIGA) + check_include_file_concat_curl("proto/bsdsocket.h" HAVE_PROTO_BSDSOCKET_H) +endif() + +# Pass these detection results to curl_internal_test() for use in CurlTests.c +# Add here all feature flags referenced from CurlTests.c +foreach(_variable IN ITEMS + HAVE_STDATOMIC_H + HAVE_STDBOOL_H + HAVE_STROPTS_H + HAVE_SYS_IOCTL_H + HAVE_SYS_TYPES_H + HAVE_UNISTD_H +) + if(${_variable}) + string(APPEND CURL_TEST_DEFINES " -D${_variable}") + endif() +endforeach() + +check_type_size("size_t" SIZEOF_SIZE_T) +check_type_size("ssize_t" SIZEOF_SSIZE_T) +check_type_size("long long" SIZEOF_LONG_LONG) +check_type_size("long" SIZEOF_LONG) +check_type_size("int" SIZEOF_INT) +check_type_size("__int64" SIZEOF___INT64) +check_type_size("time_t" SIZEOF_TIME_T) +check_type_size("suseconds_t" SIZEOF_SUSECONDS_T) if(NOT HAVE_SIZEOF_SSIZE_T) if(SIZEOF_LONG EQUAL SIZEOF_SIZE_T) - set(ssize_t long) - endif(SIZEOF_LONG EQUAL SIZEOF_SIZE_T) + set(ssize_t "long") + endif() if(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T) - set(ssize_t __int64) - endif(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T) -endif(NOT HAVE_SIZEOF_SSIZE_T) + set(ssize_t "__int64") + endif() +endif() # off_t is sized later, after the HAVE_FILE_OFFSET_BITS test -if(HAVE_SIZEOF_LONG_LONG) +if(SIZEOF_LONG_LONG) set(HAVE_LONGLONG 1) - set(HAVE_LL 1) -endif(HAVE_SIZEOF_LONG_LONG) - -find_file(RANDOM_FILE urandom /dev) -mark_as_advanced(RANDOM_FILE) +endif() +if(SIZEOF_SUSECONDS_T) + set(HAVE_SUSECONDS_T 1) +endif() # Check for some functions that are used -if(HAVE_LIBWS2_32) - set(CMAKE_REQUIRED_LIBRARIES ws2_32) -elseif(HAVE_LIBSOCKET) - set(CMAKE_REQUIRED_LIBRARIES socket) -endif() - -check_symbol_exists(basename "${CURL_INCLUDES}" HAVE_BASENAME) -check_symbol_exists(socket "${CURL_INCLUDES}" HAVE_SOCKET) -# poll on macOS is unreliable, it first did not exist, then was broken until -# fixed in 10.9 only to break again in 10.12. -if(NOT APPLE) - check_symbol_exists(poll "${CURL_INCLUDES}" HAVE_POLL) -endif() -check_symbol_exists(select "${CURL_INCLUDES}" HAVE_SELECT) -check_symbol_exists(strdup "${CURL_INCLUDES}" HAVE_STRDUP) -check_symbol_exists(strstr "${CURL_INCLUDES}" HAVE_STRSTR) -check_symbol_exists(strtok_r "${CURL_INCLUDES}" HAVE_STRTOK_R) -check_symbol_exists(strftime "${CURL_INCLUDES}" HAVE_STRFTIME) -check_symbol_exists(uname "${CURL_INCLUDES}" HAVE_UNAME) -check_symbol_exists(strcasecmp "${CURL_INCLUDES}" HAVE_STRCASECMP) -check_symbol_exists(stricmp "${CURL_INCLUDES}" HAVE_STRICMP) -check_symbol_exists(strcmpi "${CURL_INCLUDES}" HAVE_STRCMPI) -check_symbol_exists(strncmpi "${CURL_INCLUDES}" HAVE_STRNCMPI) -check_symbol_exists(alarm "${CURL_INCLUDES}" HAVE_ALARM) -if(NOT HAVE_STRNCMPI) - set(HAVE_STRCMPI) -endif(NOT HAVE_STRNCMPI) -check_symbol_exists(gethostbyaddr "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR) -check_symbol_exists(gethostbyaddr_r "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR_R) -check_symbol_exists(gettimeofday "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY) -check_symbol_exists(inet_addr "${CURL_INCLUDES}" HAVE_INET_ADDR) -check_symbol_exists(inet_ntoa "${CURL_INCLUDES}" HAVE_INET_NTOA) -check_symbol_exists(inet_ntoa_r "${CURL_INCLUDES}" HAVE_INET_NTOA_R) -check_symbol_exists(tcsetattr "${CURL_INCLUDES}" HAVE_TCSETATTR) -check_symbol_exists(tcgetattr "${CURL_INCLUDES}" HAVE_TCGETATTR) -check_symbol_exists(perror "${CURL_INCLUDES}" HAVE_PERROR) -check_symbol_exists(closesocket "${CURL_INCLUDES}" HAVE_CLOSESOCKET) -check_symbol_exists(setvbuf "${CURL_INCLUDES}" HAVE_SETVBUF) -check_symbol_exists(sigsetjmp "${CURL_INCLUDES}" HAVE_SIGSETJMP) -check_symbol_exists(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R) -check_symbol_exists(strlcat "${CURL_INCLUDES}" HAVE_STRLCAT) -check_symbol_exists(getpwuid "${CURL_INCLUDES}" HAVE_GETPWUID) -check_symbol_exists(geteuid "${CURL_INCLUDES}" HAVE_GETEUID) -check_symbol_exists(utime "${CURL_INCLUDES}" HAVE_UTIME) -check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R) -check_symbol_exists(localtime_r "${CURL_INCLUDES}" HAVE_LOCALTIME_R) - -check_symbol_exists(gethostbyname "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME) -check_symbol_exists(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R) - -check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL_FUNC) -check_symbol_exists(SIGALRM "${CURL_INCLUDES}" HAVE_SIGNAL_MACRO) -if(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO) - set(HAVE_SIGNAL 1) -endif(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO) -check_symbol_exists(uname "${CURL_INCLUDES}" HAVE_UNAME) -check_symbol_exists(strtoll "${CURL_INCLUDES}" HAVE_STRTOLL) -check_symbol_exists(_strtoi64 "${CURL_INCLUDES}" HAVE__STRTOI64) -check_symbol_exists(strerror_r "${CURL_INCLUDES}" HAVE_STRERROR_R) -check_symbol_exists(siginterrupt "${CURL_INCLUDES}" HAVE_SIGINTERRUPT) -check_symbol_exists(perror "${CURL_INCLUDES}" HAVE_PERROR) -check_symbol_exists(fork "${CURL_INCLUDES}" HAVE_FORK) -check_symbol_exists(getaddrinfo "${CURL_INCLUDES}" HAVE_GETADDRINFO) -check_symbol_exists(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO) -check_symbol_exists(freeifaddrs "${CURL_INCLUDES}" HAVE_FREEIFADDRS) -check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE) -check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE) -check_symbol_exists(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME) -check_symbol_exists(getrlimit "${CURL_INCLUDES}" HAVE_GETRLIMIT) -check_symbol_exists(setlocale "${CURL_INCLUDES}" HAVE_SETLOCALE) -check_symbol_exists(setrlimit "${CURL_INCLUDES}" HAVE_SETRLIMIT) -check_symbol_exists(fcntl "${CURL_INCLUDES}" HAVE_FCNTL) -check_symbol_exists(ioctl "${CURL_INCLUDES}" HAVE_IOCTL) -check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT) - -# symbol exists in win32, but function does not. + +# Apply to all feature checks if(WIN32) - if(ENABLE_INET_PTON) - check_function_exists(inet_pton HAVE_INET_PTON) - # _WIN32_WINNT_VISTA (0x0600) - add_definitions(-D_WIN32_WINNT=0x0600) - else() - # _WIN32_WINNT_WINXP (0x0501) - add_definitions(-D_WIN32_WINNT=0x0501) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}") + if(NOT WINCE AND NOT WINDOWS_STORE) + list(APPEND CMAKE_REQUIRED_LIBRARIES "iphlpapi") endif() -else() - check_function_exists(inet_pton HAVE_INET_PTON) +elseif(HAVE_LIBSOCKET) + list(APPEND CMAKE_REQUIRED_LIBRARIES "socket") +elseif(DOS) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${WATT_ROOT}/lib/libwatt.a") +endif() + +check_function_exists("accept4" HAVE_ACCEPT4) +check_function_exists("fnmatch" HAVE_FNMATCH) +check_symbol_exists("basename" "${CURL_INCLUDES};string.h" HAVE_BASENAME) # libgen.h unistd.h +check_symbol_exists("opendir" "dirent.h" HAVE_OPENDIR) +check_function_exists("poll" HAVE_POLL) # poll.h +check_symbol_exists("socket" "${CURL_INCLUDES}" HAVE_SOCKET) # winsock2.h sys/socket.h +check_symbol_exists("socketpair" "${CURL_INCLUDES}" HAVE_SOCKETPAIR) # sys/socket.h +check_symbol_exists("recv" "${CURL_INCLUDES}" HAVE_RECV) # proto/bsdsocket.h sys/types.h sys/socket.h +check_symbol_exists("send" "${CURL_INCLUDES}" HAVE_SEND) # proto/bsdsocket.h sys/types.h sys/socket.h +check_function_exists("sendmsg" HAVE_SENDMSG) +check_function_exists("sendmmsg" HAVE_SENDMMSG) +check_symbol_exists("select" "${CURL_INCLUDES}" HAVE_SELECT) # proto/bsdsocket.h sys/select.h sys/socket.h +check_symbol_exists("strdup" "string.h" HAVE_STRDUP) +check_symbol_exists("memrchr" "string.h" HAVE_MEMRCHR) +check_symbol_exists("alarm" "unistd.h" HAVE_ALARM) +check_symbol_exists("fcntl" "fcntl.h" HAVE_FCNTL) +check_function_exists("getppid" HAVE_GETPPID) +check_function_exists("utimes" HAVE_UTIMES) + +check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY) # sys/time.h +check_symbol_exists("closesocket" "${CURL_INCLUDES}" HAVE_CLOSESOCKET) # winsock2.h +check_symbol_exists("sigsetjmp" "setjmp.h" HAVE_SIGSETJMP) +check_function_exists("getpass_r" HAVE_GETPASS_R) +check_function_exists("getpwuid" HAVE_GETPWUID) +check_function_exists("getpwuid_r" HAVE_GETPWUID_R) +check_function_exists("geteuid" HAVE_GETEUID) +check_function_exists("utime" HAVE_UTIME) +check_symbol_exists("gmtime_r" "stdlib.h;time.h" HAVE_GMTIME_R) + +check_symbol_exists("gethostbyname_r" "netdb.h" HAVE_GETHOSTBYNAME_R) +check_symbol_exists("gethostname" "${CURL_INCLUDES}" HAVE_GETHOSTNAME) # winsock2.h unistd.h proto/bsdsocket.h + +check_symbol_exists("signal" "signal.h" HAVE_SIGNAL) +check_symbol_exists("strerror_r" "stdlib.h;string.h" HAVE_STRERROR_R) +check_symbol_exists("sigaction" "signal.h" HAVE_SIGACTION) +check_symbol_exists("siginterrupt" "signal.h" HAVE_SIGINTERRUPT) +check_symbol_exists("getaddrinfo" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_GETADDRINFO) # ws2tcpip.h sys/socket.h netdb.h +check_symbol_exists("getifaddrs" "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS) # ifaddrs.h +check_symbol_exists("freeaddrinfo" "${CURL_INCLUDES}" HAVE_FREEADDRINFO) # ws2tcpip.h sys/socket.h netdb.h +check_function_exists("pipe" HAVE_PIPE) +check_function_exists("pipe2" HAVE_PIPE2) +check_function_exists("eventfd" HAVE_EVENTFD) +check_symbol_exists("ftruncate" "unistd.h" HAVE_FTRUNCATE) +check_symbol_exists("getpeername" "${CURL_INCLUDES}" HAVE_GETPEERNAME) # winsock2.h unistd.h proto/bsdsocket.h +check_symbol_exists("getsockname" "${CURL_INCLUDES}" HAVE_GETSOCKNAME) # winsock2.h unistd.h proto/bsdsocket.h +check_function_exists("if_nametoindex" HAVE_IF_NAMETOINDEX) # iphlpapi.h (Windows Vista+ non-UWP), net/if.h +check_function_exists("getrlimit" HAVE_GETRLIMIT) +check_function_exists("setlocale" HAVE_SETLOCALE) +check_function_exists("setrlimit" HAVE_SETRLIMIT) + +if(NOT WIN32) + check_function_exists("realpath" HAVE_REALPATH) + check_function_exists("sched_yield" HAVE_SCHED_YIELD) + check_symbol_exists("strcasecmp" "string.h" HAVE_STRCASECMP) + check_symbol_exists("stricmp" "string.h" HAVE_STRICMP) + check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI) +endif() + +if(NOT MINGW32CE) # Avoid false detections + check_function_exists("setmode" HAVE_SETMODE) + if(WIN32 OR CYGWIN) + check_function_exists("_setmode" HAVE__SETMODE) + endif() +endif() + +if(AMIGA) + check_symbol_exists("CloseSocket" "${CURL_INCLUDES}" HAVE_CLOSESOCKET_CAMEL) # sys/socket.h proto/bsdsocket.h +endif() + +if(NOT _ssl_enabled) + check_symbol_exists("arc4random" "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM) +endif() + +if(NOT MSVC) + check_function_exists("snprintf" HAVE_SNPRINTF) # to match detection method in ./configure +elseif(MSVC_VERSION GREATER_EQUAL 1900) # Earlier MSVC compilers had faulty snprintf implementations + check_symbol_exists("snprintf" "stdio.h" HAVE_SNPRINTF) # snprintf may be a compatibility macro, not an exported function +endif() +if(APPLE) + check_function_exists("mach_absolute_time" HAVE_MACH_ABSOLUTE_TIME) +endif() +if(NOT WIN32) + check_symbol_exists("inet_ntop" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_NTOP) # arpa/inet.h netinet/in.h sys/socket.h + check_symbol_exists("inet_pton" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_INET_PTON) # arpa/inet.h netinet/in.h sys/socket.h endif() -check_symbol_exists(fsetxattr "${CURL_INCLUDES}" HAVE_FSETXATTR) +check_symbol_exists("fsetxattr" "sys/xattr.h" HAVE_FSETXATTR) if(HAVE_FSETXATTR) - foreach(CURL_TEST HAVE_FSETXATTR_5 HAVE_FSETXATTR_6) - curl_internal_test_run(${CURL_TEST}) - endforeach(CURL_TEST) -endif(HAVE_FSETXATTR) - -# sigaction and sigsetjmp are special. Use special mechanism for -# detecting those, but only if previous attempt failed. -if(HAVE_SIGNAL_H) - check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION) -endif(HAVE_SIGNAL_H) - -if(NOT HAVE_SIGSETJMP) - if(HAVE_SETJMP_H) - check_symbol_exists(sigsetjmp "setjmp.h" HAVE_MACRO_SIGSETJMP) - if(HAVE_MACRO_SIGSETJMP) - set(HAVE_SIGSETJMP 1) - endif(HAVE_MACRO_SIGSETJMP) - endif(HAVE_SETJMP_H) -endif(NOT HAVE_SIGSETJMP) - -# If there is no stricmp(), do not allow LDAP to parse URLs -if(NOT HAVE_STRICMP) - set(HAVE_LDAP_URL_PARSE 1) -endif(NOT HAVE_STRICMP) + curl_internal_test(HAVE_FSETXATTR_5) + curl_internal_test(HAVE_FSETXATTR_6) +endif() + +cmake_push_check_state() +if(WIN32) + list(APPEND CMAKE_EXTRA_INCLUDE_FILES "winsock2.h") + check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY) + set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY}) +else() + list(APPEND CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") + check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T) + set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T}) +endif() +cmake_pop_check_state() # Do curl specific tests -foreach(CURL_TEST +foreach(_curl_test IN ITEMS HAVE_FCNTL_O_NONBLOCK HAVE_IOCTLSOCKET HAVE_IOCTLSOCKET_CAMEL @@ -930,372 +1840,673 @@ foreach(CURL_TEST HAVE_IOCTL_FIONBIO HAVE_IOCTL_SIOCGIFADDR HAVE_SETSOCKOPT_SO_NONBLOCK - HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID - TIME_WITH_SYS_TIME - HAVE_O_NONBLOCK - HAVE_GETHOSTBYADDR_R_5 - HAVE_GETHOSTBYADDR_R_7 - HAVE_GETHOSTBYADDR_R_8 - HAVE_GETHOSTBYADDR_R_5_REENTRANT - HAVE_GETHOSTBYADDR_R_7_REENTRANT - HAVE_GETHOSTBYADDR_R_8_REENTRANT HAVE_GETHOSTBYNAME_R_3 HAVE_GETHOSTBYNAME_R_5 HAVE_GETHOSTBYNAME_R_6 - HAVE_GETHOSTBYNAME_R_3_REENTRANT - HAVE_GETHOSTBYNAME_R_5_REENTRANT - HAVE_GETHOSTBYNAME_R_6_REENTRANT - HAVE_SOCKLEN_T - HAVE_IN_ADDR_T HAVE_BOOL_T STDC_HEADERS - RETSIGTYPE_TEST - HAVE_INET_NTOA_R_DECL - HAVE_INET_NTOA_R_DECL_REENTRANT - HAVE_GETADDRINFO - HAVE_FILE_OFFSET_BITS - ) - curl_internal_test(${CURL_TEST}) -endforeach(CURL_TEST) - -if(HAVE_FILE_OFFSET_BITS) - set(_FILE_OFFSET_BITS 64) - set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64") -endif(HAVE_FILE_OFFSET_BITS) -check_type_size("off_t" SIZEOF_OFF_T) - -# include this header to get the type -set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include") -set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h") -check_type_size("curl_off_t" SIZEOF_CURL_OFF_T) -set(CMAKE_EXTRA_INCLUDE_FILES "") - -set(CMAKE_REQUIRED_FLAGS) - -foreach(CURL_TEST - HAVE_GLIBC_STRERROR_R - HAVE_POSIX_STRERROR_R - ) - curl_internal_test_run(${CURL_TEST}) -endforeach(CURL_TEST) + HAVE_ATOMIC +) + curl_internal_test(${_curl_test}) +endforeach() # Check for reentrant -foreach(CURL_TEST - HAVE_GETHOSTBYADDR_R_5 - HAVE_GETHOSTBYADDR_R_7 - HAVE_GETHOSTBYADDR_R_8 +cmake_push_check_state() +list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_REENTRANT") +foreach(_curl_test IN ITEMS HAVE_GETHOSTBYNAME_R_3 HAVE_GETHOSTBYNAME_R_5 - HAVE_GETHOSTBYNAME_R_6 - HAVE_INET_NTOA_R_DECL_REENTRANT) - if(NOT ${CURL_TEST}) - if(${CURL_TEST}_REENTRANT) - set(NEED_REENTRANT 1) - endif(${CURL_TEST}_REENTRANT) - endif(NOT ${CURL_TEST}) -endforeach(CURL_TEST) + HAVE_GETHOSTBYNAME_R_6) + curl_internal_test(${_curl_test}_REENTRANT) + if(NOT ${_curl_test} AND ${_curl_test}_REENTRANT) + set(NEED_REENTRANT 1) + endif() +endforeach() +cmake_pop_check_state() if(NEED_REENTRANT) - foreach(CURL_TEST - HAVE_GETHOSTBYADDR_R_5 - HAVE_GETHOSTBYADDR_R_7 - HAVE_GETHOSTBYADDR_R_8 + foreach(_curl_test IN ITEMS HAVE_GETHOSTBYNAME_R_3 HAVE_GETHOSTBYNAME_R_5 HAVE_GETHOSTBYNAME_R_6) - set(${CURL_TEST} 0) - if(${CURL_TEST}_REENTRANT) - set(${CURL_TEST} 1) - endif(${CURL_TEST}_REENTRANT) - endforeach(CURL_TEST) -endif(NEED_REENTRANT) - -if(HAVE_INET_NTOA_R_DECL_REENTRANT) - set(HAVE_INET_NTOA_R_DECL 1) - set(NEED_REENTRANT 1) -endif(HAVE_INET_NTOA_R_DECL_REENTRANT) + set(${_curl_test} 0) + if(${_curl_test}_REENTRANT) + set(${_curl_test} 1) + endif() + endforeach() +endif() -# Some other minor tests +cmake_push_check_state() +list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64") +curl_internal_test(HAVE_FILE_OFFSET_BITS) +cmake_pop_check_state() -if(NOT HAVE_IN_ADDR_T) - set(in_addr_t "unsigned long") -endif(NOT HAVE_IN_ADDR_T) - -# Fix libz / zlib.h - -if(NOT CURL_SPECIAL_LIBZ) - if(NOT HAVE_LIBZ) - set(HAVE_ZLIB_H 0) - endif(NOT HAVE_LIBZ) - - if(NOT HAVE_ZLIB_H) - set(HAVE_LIBZ 0) - endif(NOT HAVE_ZLIB_H) -endif(NOT CURL_SPECIAL_LIBZ) - -# Check for nonblocking -set(HAVE_DISABLED_NONBLOCKING 1) -if(HAVE_FIONBIO OR - HAVE_IOCTLSOCKET OR - HAVE_IOCTLSOCKET_CASE OR - HAVE_O_NONBLOCK) - set(HAVE_DISABLED_NONBLOCKING) -endif(HAVE_FIONBIO OR - HAVE_IOCTLSOCKET OR - HAVE_IOCTLSOCKET_CASE OR - HAVE_O_NONBLOCK) - -if(RETSIGTYPE_TEST) - set(RETSIGTYPE void) -else(RETSIGTYPE_TEST) - set(RETSIGTYPE int) -endif(RETSIGTYPE_TEST) - -if(CMAKE_COMPILER_IS_GNUCC AND APPLE) - include(CheckCCompilerFlag) - check_c_compiler_flag(-Wno-long-double HAVE_C_FLAG_Wno_long_double) - if(HAVE_C_FLAG_Wno_long_double) - # The Mac version of GCC warns about use of long double. Disable it. - get_source_file_property(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS) - if(MPRINTF_COMPILE_FLAGS) - set(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double") - else(MPRINTF_COMPILE_FLAGS) - set(MPRINTF_COMPILE_FLAGS "-Wno-long-double") - endif(MPRINTF_COMPILE_FLAGS) - set_source_files_properties(mprintf.c PROPERTIES - COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS}) - endif(HAVE_C_FLAG_Wno_long_double) -endif(CMAKE_COMPILER_IS_GNUCC AND APPLE) - -if(HAVE_SOCKLEN_T) - set(CURL_TYPEOF_CURL_SOCKLEN_T "socklen_t") - if(WIN32) - set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h;ws2tcpip.h") - elseif(HAVE_SYS_SOCKET_H) - set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") - endif() - check_type_size("socklen_t" CURL_SIZEOF_CURL_SOCKLEN_T) - set(CMAKE_EXTRA_INCLUDE_FILES) - if(NOT HAVE_CURL_SIZEOF_CURL_SOCKLEN_T) - message(FATAL_ERROR - "Check for sizeof socklen_t failed, see CMakeFiles/CMakerror.log") +cmake_push_check_state() +if(HAVE_FILE_OFFSET_BITS) + set(_FILE_OFFSET_BITS 64) + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64") +endif() +check_type_size("off_t" SIZEOF_OFF_T) + +if(NOT WIN32) + # fseeko may not exist with _FILE_OFFSET_BITS=64 but can exist with + # _FILE_OFFSET_BITS unset or 32 (e.g. Android ARMv7 with NDK 26b and API level < 24) + # so we need to test fseeko after testing for _FILE_OFFSET_BITS + check_symbol_exists("fseeko" "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO) + + if(HAVE_FSEEKO) + set(HAVE_DECL_FSEEKO 1) endif() -else() - set(CURL_TYPEOF_CURL_SOCKLEN_T int) - set(CURL_SIZEOF_CURL_SOCKLEN_T ${SIZEOF_INT}) endif() -# TODO test which of these headers are required -if(WIN32) - set(CURL_PULL_WS2TCPIP_H ${HAVE_WS2TCPIP_H}) -else() - set(CURL_PULL_SYS_TYPES_H ${HAVE_SYS_TYPES_H}) - set(CURL_PULL_SYS_SOCKET_H ${HAVE_SYS_SOCKET_H}) - set(CURL_PULL_SYS_POLL_H ${HAVE_SYS_POLL_H}) +# Include this header to get the type +cmake_push_check_state() +list(APPEND CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/include") +list(APPEND CMAKE_EXTRA_INCLUDE_FILES "curl/system.h") +check_type_size("curl_off_t" SIZEOF_CURL_OFF_T) +list(APPEND CMAKE_EXTRA_INCLUDE_FILES "curl/curl.h") +check_type_size("curl_socket_t" SIZEOF_CURL_SOCKET_T) +cmake_pop_check_state() # pop curl system headers +cmake_pop_check_state() # pop -D_FILE_OFFSET_BITS=64 + +if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) + # On non-Windows and not cross-compiling, check for writable argv[] + include(CheckCSourceRuns) + check_c_source_runs(" + int main(int argc, char **argv) + { + (void)argc; + argv[0][0] = ' '; + return (argv[0][0] == ' ')?0:1; + }" HAVE_WRITABLE_ARGV) +endif() + +if(NOT CMAKE_CROSSCOMPILING) + include(CheckCSourceRuns) + check_c_source_runs(" + #include + int main(void) { + time_t t = -1; + return t < 0; + }" HAVE_TIME_T_UNSIGNED) +endif() + +curl_internal_test(HAVE_GLIBC_STRERROR_R) +curl_internal_test(HAVE_POSIX_STRERROR_R) + +if(NOT WIN32) + curl_internal_test(HAVE_CLOCK_GETTIME_MONOTONIC) # Check clock_gettime(CLOCK_MONOTONIC, x) support +endif() + +if(APPLE) + curl_internal_test(HAVE_BUILTIN_AVAILABLE) # Check compiler support of __builtin_available() +endif() + +# Some other minor tests + +if(_cmake_try_compile_target_type_save) + set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_cmake_try_compile_target_type_save}) + unset(_cmake_try_compile_target_type_save) endif() -set(CURL_PULL_STDINT_H ${HAVE_STDINT_H}) -set(CURL_PULL_INTTYPES_H ${HAVE_INTTYPES_H}) include(CMake/OtherTests.cmake) -add_definitions(-DHAVE_CONFIG_H) +set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "HAVE_CONFIG_H") -# For windows, all compilers used by cmake should support large files if(WIN32) - set(USE_WIN32_LARGE_FILES ON) -endif(WIN32) + list(APPEND CURL_LIBS "${_win32_winsock}") + if(NOT WINCE AND NOT WINDOWS_STORE) + list(APPEND CURL_LIBS "iphlpapi") + endif() + if(NOT WINCE) + list(APPEND CURL_LIBS "bcrypt") + endif() + + if(NOT WINCE) + set(USE_WIN32_LARGE_FILES ON) + endif() + + # We use crypto functions that are not available for UWP apps + if(NOT WINDOWS_STORE) + set(USE_WIN32_CRYPTO ON) + endif() + + # Link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL + if(USE_WIN32_CRYPTO OR USE_SCHANNEL) + if(NOT WINCE) + list(APPEND CURL_LIBS "advapi32") + endif() + list(APPEND CURL_LIBS "${_win32_crypt32}") + endif() + if(USE_WINDOWS_SSPI) + list(APPEND CURL_LIBS "${_win32_secur32}") + endif() +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl + set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation +endif() + +if(CURL_LTO) + if(CMAKE_VERSION VERSION_LESS 3.9) + message(FATAL_ERROR "LTO has been requested, but your cmake version ${CMAKE_VERSION} is to old. You need at least 3.9") + endif() + + cmake_policy(SET CMP0069 NEW) + + include(CheckIPOSupported) + check_ipo_supported(RESULT CURL_HAS_LTO OUTPUT _lto_error LANGUAGES C) + if(CURL_HAS_LTO) + message(STATUS "LTO supported and enabled") + else() + message(FATAL_ERROR "LTO has been requested, but the compiler does not support it\n${_lto_error}") + endif() +endif() -if(MSVC) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) - if(CMAKE_C_FLAGS MATCHES "/W[0-4]") - string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - else(CMAKE_C_FLAGS MATCHES "/W[0-4]") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - endif(CMAKE_C_FLAGS MATCHES "/W[0-4]") -endif(MSVC) - -# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it). -function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE) - file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT) - string(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) - string(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) - - string(REGEX REPLACE "\\\\\n" "!π!α!" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) - string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) - string(REPLACE "!π!α!" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) - - string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${} - string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace @@ with ${}, even if that may not be read by CMake scripts. - file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT}) +# Ugly (but functional) way to include "Makefile.inc" by transforming it +# (= regenerate it). +function(curl_transform_makefile_inc _input_file _output_file) + file(READ ${_input_file} _makefile_inc_text) + # cmake-lint: disable=W0106 + string(REPLACE "$(top_srcdir)" "\${PROJECT_SOURCE_DIR}" _makefile_inc_text ${_makefile_inc_text}) + string(REPLACE "$(top_builddir)" "\${PROJECT_BINARY_DIR}" _makefile_inc_text ${_makefile_inc_text}) + + string(REGEX REPLACE "\\\\\n" "!^!^!" _makefile_inc_text ${_makefile_inc_text}) + string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "set(\\1 \\2)" _makefile_inc_text ${_makefile_inc_text}) + string(REPLACE "!^!^!" "\n" _makefile_inc_text ${_makefile_inc_text}) + + # Replace $() with ${} + string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" _makefile_inc_text ${_makefile_inc_text}) + # Replace @@ with ${}, even if that may not be read by CMake scripts. + string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" _makefile_inc_text ${_makefile_inc_text}) + + file(WRITE ${_output_file} ${_makefile_inc_text}) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${_input_file}") endfunction() -if(USE_MANUAL) +include(GNUInstallDirs) + +set(_install_cmake_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") +set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") +set(_generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(_project_config "${_generated_dir}/${PROJECT_NAME}Config.cmake") +set(_version_config "${_generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") + +option(BUILD_TESTING "Build tests" ON) +if(BUILD_TESTING AND PERL_FOUND) + set(CURL_BUILD_TESTING ON) +else() + set(CURL_BUILD_TESTING OFF) +endif() + +if(HAVE_MANUAL_TOOLS) + set(CURL_MANPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.1") + set(CURL_ASCIIPAGE "${PROJECT_BINARY_DIR}/docs/cmdline-opts/curl.txt") add_subdirectory(docs) endif() +add_subdirectory(scripts) # for shell completions + +list(REMOVE_DUPLICATES CURL_LIBDIRS) + add_subdirectory(lib) if(BUILD_CURL_EXE) add_subdirectory(src) endif() -include(CTest) -if(BUILD_TESTING) +option(BUILD_EXAMPLES "Build libcurl examples" ON) +if(BUILD_EXAMPLES) + add_subdirectory(docs/examples) +endif() + +if(CURL_BUILD_TESTING) add_subdirectory(tests) endif() -# Helper to populate a list (_items) with a label when conditions (the remaining -# args) are satisfied -function(_add_if label) - # TODO need to disable policy CMP0054 (CMake 3.1) to allow this indirection +# Helper to populate a list (_items) with a label when conditions +# (the remaining args) are satisfied +macro(curl_add_if _label) + # Needs to be a macro to allow this indirection if(${ARGN}) - set(_items ${_items} "${label}" PARENT_SCOPE) + set(_items ${_items} "${_label}") endif() -endfunction() - -# Clear list and try to detect available features -set(_items) -_add_if("WinSSL" SSL_ENABLED AND USE_WINDOWS_SSPI) -_add_if("OpenSSL" SSL_ENABLED AND USE_OPENSSL) -_add_if("DarwinSSL" SSL_ENABLED AND USE_DARWINSSL) -_add_if("mbedTLS" SSL_ENABLED AND USE_MBEDTLS) -_add_if("IPv6" ENABLE_IPV6) -_add_if("unix-sockets" USE_UNIX_SOCKETS) -_add_if("libz" HAVE_LIBZ) -_add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX OR USE_THREADS_WIN32) -_add_if("IDN" HAVE_LIBIDN2) -_add_if("Largefile" (CURL_SIZEOF_CURL_OFF_T GREATER 4) AND - ((SIZEOF_OFF_T GREATER 4) OR USE_WIN32_LARGE_FILES)) -# TODO SSP1 (WinSSL) check is missing -_add_if("SSPI" USE_WINDOWS_SSPI) -_add_if("GSS-API" HAVE_GSSAPI) -# TODO SSP1 missing for SPNEGO -_add_if("SPNEGO" NOT CURL_DISABLE_CRYPTO_AUTH AND - (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) -_add_if("Kerberos" NOT CURL_DISABLE_CRYPTO_AUTH AND - (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) -# NTLM support requires crypto function adaptions from various SSL libs -# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS -if(NOT CURL_DISABLE_CRYPTO_AUTH AND (USE_OPENSSL OR USE_WINDOWS_SSPI OR USE_DARWINSSL OR USE_MBEDTLS)) - _add_if("NTLM" 1) - # TODO missing option (autoconf: --enable-ntlm-wb) - _add_if("NTLM_WB" NOT CURL_DISABLE_HTTP AND NTLM_WB_ENABLED) -endif() -# TODO missing option (--enable-tls-srp), depends on GNUTLS_SRP/OPENSSL_SRP -_add_if("TLS-SRP" USE_TLS_SRP) -# TODO option --with-nghttp2 tests for nghttp2 lib and nghttp2/nghttp2.h header -_add_if("HTTP2" USE_NGHTTP2) -string(REPLACE ";" " " SUPPORT_FEATURES "${_items}") -message(STATUS "Enabled features: ${SUPPORT_FEATURES}") +endmacro() + +# NTLM support requires crypto functions from various SSL libs. +# These conditions must match those in lib/curl_setup.h. +if(NOT CURL_DISABLE_NTLM AND + (USE_OPENSSL OR + USE_MBEDTLS OR + USE_GNUTLS OR + USE_WIN32_CRYPTO OR + (USE_WOLFSSL AND HAVE_WOLFSSL_DES_ECB_ENCRYPT))) + set(_use_curl_ntlm_core ON) +endif() # Clear list and try to detect available protocols -set(_items) -_add_if("HTTP" NOT CURL_DISABLE_HTTP) -_add_if("HTTPS" NOT CURL_DISABLE_HTTP AND SSL_ENABLED) -_add_if("FTP" NOT CURL_DISABLE_FTP) -_add_if("FTPS" NOT CURL_DISABLE_FTP AND SSL_ENABLED) -_add_if("FILE" NOT CURL_DISABLE_FILE) -_add_if("TELNET" NOT CURL_DISABLE_TELNET) -_add_if("LDAP" NOT CURL_DISABLE_LDAP) +set(_items "") +curl_add_if("HTTP" NOT CURL_DISABLE_HTTP) +curl_add_if("HTTPS" NOT CURL_DISABLE_HTTP AND _ssl_enabled) +curl_add_if("FTP" NOT CURL_DISABLE_FTP) +curl_add_if("FTPS" NOT CURL_DISABLE_FTP AND _ssl_enabled) +curl_add_if("FILE" NOT CURL_DISABLE_FILE) +curl_add_if("TELNET" NOT CURL_DISABLE_TELNET) +curl_add_if("LDAP" NOT CURL_DISABLE_LDAP) # CURL_DISABLE_LDAP implies CURL_DISABLE_LDAPS -# TODO check HAVE_LDAP_SSL (in autoconf this is enabled with --enable-ldaps) -_add_if("LDAPS" NOT CURL_DISABLE_LDAPS AND - ((USE_OPENLDAP AND SSL_ENABLED) OR - (NOT USE_OPENLDAP AND HAVE_LDAP_SSL))) -_add_if("DICT" NOT CURL_DISABLE_DICT) -_add_if("TFTP" NOT CURL_DISABLE_TFTP) -_add_if("GOPHER" NOT CURL_DISABLE_GOPHER) -_add_if("POP3" NOT CURL_DISABLE_POP3) -_add_if("POP3S" NOT CURL_DISABLE_POP3 AND SSL_ENABLED) -_add_if("IMAP" NOT CURL_DISABLE_IMAP) -_add_if("IMAPS" NOT CURL_DISABLE_IMAP AND SSL_ENABLED) -_add_if("SMTP" NOT CURL_DISABLE_SMTP) -_add_if("SMTPS" NOT CURL_DISABLE_SMTP AND SSL_ENABLED) -_add_if("SCP" USE_LIBSSH2) -_add_if("SFTP" USE_LIBSSH2) -_add_if("RTSP" NOT CURL_DISABLE_RTSP) -_add_if("RTMP" USE_LIBRTMP) -list(SORT _items) +curl_add_if("LDAPS" NOT CURL_DISABLE_LDAPS AND + ((USE_OPENLDAP AND _ssl_enabled) OR + (NOT USE_OPENLDAP AND HAVE_LDAP_SSL))) +curl_add_if("DICT" NOT CURL_DISABLE_DICT) +curl_add_if("TFTP" NOT CURL_DISABLE_TFTP) +curl_add_if("GOPHER" NOT CURL_DISABLE_GOPHER) +curl_add_if("GOPHERS" NOT CURL_DISABLE_GOPHER AND _ssl_enabled) +curl_add_if("POP3" NOT CURL_DISABLE_POP3) +curl_add_if("POP3S" NOT CURL_DISABLE_POP3 AND _ssl_enabled) +curl_add_if("IMAP" NOT CURL_DISABLE_IMAP) +curl_add_if("IMAPS" NOT CURL_DISABLE_IMAP AND _ssl_enabled) +curl_add_if("SMB" NOT CURL_DISABLE_SMB AND + _use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4)) +curl_add_if("SMBS" NOT CURL_DISABLE_SMB AND _ssl_enabled AND + _use_curl_ntlm_core AND (SIZEOF_CURL_OFF_T GREATER 4)) +curl_add_if("SMTP" NOT CURL_DISABLE_SMTP) +curl_add_if("SMTPS" NOT CURL_DISABLE_SMTP AND _ssl_enabled) +curl_add_if("SCP" USE_LIBSSH2 OR USE_LIBSSH OR USE_WOLFSSH) +curl_add_if("SFTP" USE_LIBSSH2 OR USE_LIBSSH OR USE_WOLFSSH) +curl_add_if("IPFS" NOT CURL_DISABLE_IPFS) +curl_add_if("IPNS" NOT CURL_DISABLE_IPFS) +curl_add_if("RTSP" NOT CURL_DISABLE_RTSP) +curl_add_if("RTMP" USE_LIBRTMP) +curl_add_if("MQTT" NOT CURL_DISABLE_MQTT) +curl_add_if("WS" NOT CURL_DISABLE_WEBSOCKETS) +curl_add_if("WSS" NOT CURL_DISABLE_WEBSOCKETS AND _ssl_enabled) +if(_items) + list(SORT _items) +endif() +set(CURL_SUPPORTED_PROTOCOLS_LIST "${_items}") string(REPLACE ";" " " SUPPORT_PROTOCOLS "${_items}") -message(STATUS "Enabled protocols: ${SUPPORT_PROTOCOLS}") - -# curl-config needs the following options to be set. -set(CC "${CMAKE_C_COMPILER}") -# TODO probably put a -D... options here? -set(CONFIGURE_OPTIONS "") -# TODO when to set "-DCURL_STATICLIB" for CPPFLAG_CURL_STATICLIB? -set(CPPFLAG_CURL_STATICLIB "") -set(CURLVERSION "${CURL_VERSION}") -set(ENABLE_SHARED "yes") -if(CURL_STATICLIB) - set(ENABLE_STATIC "yes") -else() - set(ENABLE_STATIC "no") -endif() -set(exec_prefix "\${prefix}") -set(includedir "\${prefix}/include") -set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") -set(LIBCURL_LIBS "") -set(libdir "${CMAKE_INSTALL_PREFIX}/lib") -foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS}) - if(_lib MATCHES ".*/.*" OR _lib MATCHES "^-") - set(LIBCURL_LIBS "${LIBCURL_LIBS} ${_lib}") +string(TOLOWER "${SUPPORT_PROTOCOLS}" _support_protocols_lower) +message(STATUS "Protocols: ${_support_protocols_lower}") + +# Clear list and try to detect available features +set(_items "") +curl_add_if("SSL" _ssl_enabled) +curl_add_if("IPv6" USE_IPV6) +curl_add_if("UnixSockets" USE_UNIX_SOCKETS) +curl_add_if("libz" HAVE_LIBZ) +curl_add_if("brotli" HAVE_BROTLI) +curl_add_if("gsasl" USE_GSASL) +curl_add_if("zstd" HAVE_ZSTD) +curl_add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX OR USE_THREADS_WIN32) +curl_add_if("asyn-rr" USE_ARES AND ENABLE_THREADED_RESOLVER AND USE_HTTPSRR) +curl_add_if("IDN" (HAVE_LIBIDN2 AND HAVE_IDN2_H) OR + USE_WIN32_IDN OR + USE_APPLE_IDN) +curl_add_if("Largefile" (SIZEOF_CURL_OFF_T GREATER 4) AND + ((SIZEOF_OFF_T GREATER 4) OR USE_WIN32_LARGE_FILES)) +curl_add_if("SSPI" USE_WINDOWS_SSPI) +curl_add_if("GSS-API" HAVE_GSSAPI) +curl_add_if("alt-svc" NOT CURL_DISABLE_ALTSVC) +curl_add_if("HSTS" NOT CURL_DISABLE_HSTS) +curl_add_if("SPNEGO" NOT CURL_DISABLE_NEGOTIATE_AUTH AND + (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) +curl_add_if("Kerberos" NOT CURL_DISABLE_KERBEROS_AUTH AND + (HAVE_GSSAPI OR USE_WINDOWS_SSPI)) +curl_add_if("NTLM" NOT CURL_DISABLE_NTLM AND + (_use_curl_ntlm_core OR USE_WINDOWS_SSPI)) +curl_add_if("TLS-SRP" USE_TLS_SRP) +curl_add_if("HTTP2" USE_NGHTTP2) +curl_add_if("HTTP3" USE_NGTCP2 OR USE_QUICHE OR USE_MSH3 OR USE_OPENSSL_QUIC) +curl_add_if("MultiSSL" CURL_WITH_MULTI_SSL) +curl_add_if("HTTPS-proxy" NOT CURL_DISABLE_PROXY AND _ssl_enabled AND (USE_OPENSSL OR USE_GNUTLS + OR USE_SCHANNEL OR USE_RUSTLS OR USE_MBEDTLS OR + (USE_WOLFSSL AND HAVE_WOLFSSL_BIO_NEW))) +curl_add_if("Unicode" ENABLE_UNICODE) +curl_add_if("threadsafe" HAVE_ATOMIC OR + (USE_THREADS_POSIX AND HAVE_PTHREAD_H) OR + (WIN32 AND HAVE_WIN32_WINNT GREATER_EQUAL 0x0600)) +curl_add_if("Debug" ENABLE_DEBUG) +curl_add_if("TrackMemory" ENABLE_CURLDEBUG) +curl_add_if("ECH" _ssl_enabled AND HAVE_ECH) +curl_add_if("HTTPSRR" _ssl_enabled AND USE_HTTPSRR) +curl_add_if("PSL" USE_LIBPSL) +curl_add_if("CAcert" CURL_CA_EMBED_SET) +curl_add_if("SSLS-EXPORT" _ssl_enabled AND USE_SSLS_EXPORT) +if(_items) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) + list(SORT _items CASE INSENSITIVE) else() - set(LIBCURL_LIBS "${LIBCURL_LIBS} -l${_lib}") + list(SORT _items) endif() -endforeach() -# "a" (Linux) or "lib" (Windows) -string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}") -set(prefix "${CMAKE_INSTALL_PREFIX}") -# Set this to "yes" to append all libraries on which -lcurl is dependent -set(REQUIRE_LIB_DEPS "no") -# SUPPORT_FEATURES -# SUPPORT_PROTOCOLS -set(VERSIONNUM "${CURL_VERSION_NUM}") - -# Finally generate a "curl-config" matching this config -configure_file("${CURL_SOURCE_DIR}/curl-config.in" - "${CURL_BINARY_DIR}/curl-config" @ONLY) -install(FILES "${CURL_BINARY_DIR}/curl-config" - DESTINATION bin - PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) - -# Finally generate a pkg-config file matching this config -configure_file("${CURL_SOURCE_DIR}/libcurl.pc.in" - "${CURL_BINARY_DIR}/libcurl.pc" @ONLY) -install(FILES "${CURL_BINARY_DIR}/libcurl.pc" - DESTINATION lib/pkgconfig) - -# This needs to be run very last so other parts of the scripts can take advantage of this. -if(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE) - set(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before") -endif() - -# install headers -install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/curl" - DESTINATION include - FILES_MATCHING PATTERN "*.h") - -# Workaround for MSVS10 to avoid the Dialog Hell -# FIXME: This could be removed with future version of CMake. -if(MSVC_VERSION EQUAL 1600) - set(CURL_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/CURL.sln") - if(EXISTS "${CURL_SLN_FILENAME}") - file(APPEND "${CURL_SLN_FILENAME}" "\n# This should be regenerated!\n") +endif() +set(CURL_SUPPORTED_FEATURES_LIST "${_items}") +string(REPLACE ";" " " SUPPORT_FEATURES "${_items}") +message(STATUS "Features: ${SUPPORT_FEATURES}") + +# Clear list and collect SSL backends +set(_items "") +curl_add_if("Schannel" _ssl_enabled AND USE_SCHANNEL) +curl_add_if("${_openssl}" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_LESS 3.0.0) +curl_add_if("${_openssl} v3+" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_GREATER_EQUAL 3.0.0) +curl_add_if("mbedTLS" _ssl_enabled AND USE_MBEDTLS) +curl_add_if("wolfSSL" _ssl_enabled AND USE_WOLFSSL) +curl_add_if("GnuTLS" _ssl_enabled AND USE_GNUTLS) +curl_add_if("rustls" _ssl_enabled AND USE_RUSTLS) + +if(_items) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) + list(SORT _items CASE INSENSITIVE) + else() + list(SORT _items) endif() endif() +string(REPLACE ";" " " SSL_BACKENDS "${_items}") +message(STATUS "Enabled SSL backends: ${SSL_BACKENDS}") +if(CURL_DEFAULT_SSL_BACKEND) + message(STATUS "Default SSL backend: ${CURL_DEFAULT_SSL_BACKEND}") +endif() + +if(NOT CURL_DISABLE_INSTALL) + + # curl-config needs the following options to be set. + set(CC "${CMAKE_C_COMPILER}") + set(CONFIGURE_OPTIONS "") + set(CURLVERSION "${_curl_version}") + set(VERSIONNUM "${_curl_version_num}") + set(prefix "${CMAKE_INSTALL_PREFIX}") + set(exec_prefix "\${prefix}") + if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR}) + set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else() + set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + endif() + if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) + set(libdir "${CMAKE_INSTALL_LIBDIR}") + else() + set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") + endif() + # "a" (Linux) or "lib" (Windows) + string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}") + + set(_ldflags "") + set(LIBCURL_PC_LIBS_PRIVATE "") + + # Filter CMAKE_SHARED_LINKER_FLAGS for libs and libpaths + string(STRIP "${CMAKE_SHARED_LINKER_FLAGS}" _custom_ldflags) + string(REGEX REPLACE " +-([^ \\t;]*)" ";-\\1" _custom_ldflags "${_custom_ldflags}") + + set(_custom_libs "") + set(_custom_libdirs "") + foreach(_flag IN LISTS _custom_ldflags) + if(_flag MATCHES "^-l") + string(REGEX REPLACE "^-l" "" _flag "${_flag}") + list(APPEND _custom_libs "${_flag}") + elseif(_flag MATCHES "^-framework|^-F") + list(APPEND _custom_libs "${_flag}") + elseif(_flag MATCHES "^-L") + string(REGEX REPLACE "^-L" "" _flag "${_flag}") + list(APPEND _custom_libdirs "${_flag}") + elseif(_flag MATCHES "^--library-path=") + string(REGEX REPLACE "^--library-path=" "" _flag "${_flag}") + list(APPEND _custom_libdirs "${_flag}") + endif() + endforeach() + + # Avoid getting unnecessary -L options for known system directories. + set(_sys_libdirs "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + foreach(_libdir IN LISTS CMAKE_SYSTEM_PREFIX_PATH) + if(_libdir MATCHES "/$") + string(APPEND _libdir "lib") + else() + string(APPEND _libdir "/lib") + endif() + if(IS_DIRECTORY "${_libdir}") + list(APPEND _sys_libdirs "${_libdir}") + endif() + if(DEFINED CMAKE_LIBRARY_ARCHITECTURE) + string(APPEND _libdir "/${CMAKE_LIBRARY_ARCHITECTURE}") + if(IS_DIRECTORY "${_libdir}") + list(APPEND _sys_libdirs "${_libdir}") + endif() + endif() + endforeach() + + foreach(_libdir IN LISTS _custom_libdirs CURL_LIBDIRS) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) + cmake_path(SET _libdir NORMALIZE "${_libdir}") + endif() + list(FIND _sys_libdirs "${_libdir}" _libdir_index) + if(_libdir_index LESS 0) + list(APPEND _ldflags "-L${_libdir}") + endif() + endforeach() + + set(_implicit_libs "") + if(NOT MINGW AND NOT UNIX) + set(_implicit_libs "${CMAKE_C_IMPLICIT_LINK_LIBRARIES}") + endif() + + foreach(_lib IN LISTS _implicit_libs _custom_libs CURL_LIBS) + if(TARGET "${_lib}") + set(_libname "${_lib}") + get_target_property(_imported "${_libname}" IMPORTED) + if(NOT _imported) + # Reading the LOCATION property on non-imported target will error out. + # Assume the user will not need this information in the .pc file. + continue() + endif() + get_target_property(_lib "${_libname}" LOCATION) + if(NOT _lib) + message(WARNING "Bad lib in library list: ${_libname}") + continue() + endif() + endif() + if(_lib MATCHES "^-") # '-framework ' + list(APPEND _ldflags "${_lib}") + elseif(_lib MATCHES "/") + # This gets a bit more complex, because we want to specify the + # directory separately, and only once per directory + get_filename_component(_libdir ${_lib} DIRECTORY) + get_filename_component(_libname ${_lib} NAME_WE) + if(_libname MATCHES "^lib") + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) + cmake_path(SET _libdir NORMALIZE "${_libdir}") + endif() + list(FIND _sys_libdirs "${_libdir}" _libdir_index) + if(_libdir_index LESS 0) + list(APPEND _ldflags "-L${_libdir}") + endif() + string(REGEX REPLACE "^lib" "" _libname "${_libname}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") + else() + list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") + endif() + else() + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") + endif() + endforeach() + + if(LIBCURL_PC_REQUIRES_PRIVATE) + string(REPLACE ";" "," LIBCURL_PC_REQUIRES_PRIVATE "${LIBCURL_PC_REQUIRES_PRIVATE}") + endif() + if(LIBCURL_PC_LIBS_PRIVATE) + string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") + endif() + if(_ldflags) + list(REMOVE_DUPLICATES _ldflags) + string(REPLACE ";" " " _ldflags "${_ldflags}") + set(LIBCURL_PC_LDFLAGS_PRIVATE "${_ldflags}") + string(STRIP "${LIBCURL_PC_LDFLAGS_PRIVATE}" LIBCURL_PC_LDFLAGS_PRIVATE) + else() + set(LIBCURL_PC_LDFLAGS_PRIVATE "") + endif() + set(LIBCURL_PC_CFLAGS_PRIVATE "-DCURL_STATICLIB") + + # Merge pkg-config private fields into public ones when static-only + if(BUILD_SHARED_LIBS) + set(ENABLE_SHARED "yes") + set(LIBCURL_PC_REQUIRES "") + set(LIBCURL_PC_LIBS "") + set(LIBCURL_PC_CFLAGS "") + else() + set(ENABLE_SHARED "no") + set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}") + set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}") + set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}") + endif() + if(BUILD_STATIC_LIBS) + set(ENABLE_STATIC "yes") + else() + set(ENABLE_STATIC "no") + endif() -if(NOT TARGET uninstall) + # Generate a "curl-config" matching this config. + # Consumed variables: + # CC + # CONFIGURE_OPTIONS + # CURLVERSION + # CURL_CA_BUNDLE + # ENABLE_SHARED + # ENABLE_STATIC + # exec_prefix + # includedir + # LIBCURL_PC_CFLAGS + # LIBCURL_PC_LDFLAGS_PRIVATE + # LIBCURL_PC_LIBS_PRIVATE + # libdir + # libext + # prefix + # SSL_BACKENDS + # SUPPORT_FEATURES + # SUPPORT_PROTOCOLS + # VERSIONNUM configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake - IMMEDIATE @ONLY) + "${PROJECT_SOURCE_DIR}/curl-config.in" + "${PROJECT_BINARY_DIR}/curl-config" @ONLY) + install(FILES "${PROJECT_BINARY_DIR}/curl-config" + DESTINATION ${CMAKE_INSTALL_BINDIR} + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + + # Generate a pkg-config file matching this config. + # Consumed variables: + # CURLVERSION + # exec_prefix + # includedir + # LIBCURL_PC_CFLAGS + # LIBCURL_PC_CFLAGS_PRIVATE + # LIBCURL_PC_LDFLAGS_PRIVATE + # LIBCURL_PC_LIBS + # LIBCURL_PC_LIBS_PRIVATE + # LIBCURL_PC_REQUIRES + # LIBCURL_PC_REQUIRES_PRIVATE + # libdir + # prefix + # SUPPORT_FEATURES + # SUPPORT_PROTOCOLS + # Documentation: + # https://people.freedesktop.org/~dbn/pkg-config-guide.html + # https://manpages.debian.org/unstable/pkgconf/pkg-config.1.en.html + # https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html + # https://www.msys2.org/docs/pkgconfig/ + configure_file( + "${PROJECT_SOURCE_DIR}/libcurl.pc.in" + "${PROJECT_BINARY_DIR}/libcurl.pc" @ONLY) + install(FILES "${PROJECT_BINARY_DIR}/libcurl.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + + # Install headers + install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/curl" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING PATTERN "*.h") + + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${_version_config}" + VERSION ${_curl_version} + COMPATIBILITY SameMajorVersion) + file(READ "${_version_config}" _generated_version_config) + file(WRITE "${_version_config}" " + if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\") + # Version 8 satisfies version 7... requirements + set(PACKAGE_FIND_VERSION_MAJOR 8) + set(PACKAGE_FIND_VERSION_COUNT 1) + endif() + ${_generated_version_config}") + + # Consumed custom variables: + # CURLVERSION + # LIB_NAME + # LIB_SELECTED + # TARGETS_EXPORT_NAME + # USE_OPENSSL OPENSSL_VERSION_MAJOR + # HAVE_LIBZ ZLIB_VERSION_MAJOR + # CURL_SUPPORTED_FEATURES_LIST + # CURL_SUPPORTED_PROTOCOLS_LIST + configure_package_config_file("CMake/curl-config.cmake.in" + "${_project_config}" + INSTALL_DESTINATION ${_install_cmake_dir} + PATH_VARS CMAKE_INSTALL_INCLUDEDIR) + + if(CURL_ENABLE_EXPORT_TARGET) + install(EXPORT "${TARGETS_EXPORT_NAME}" + NAMESPACE "${PROJECT_NAME}::" + DESTINATION ${_install_cmake_dir}) + endif() + + install(FILES ${_version_config} ${_project_config} + DESTINATION ${_install_cmake_dir}) + + if(NOT TARGET curl_uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake" + @ONLY) + + add_custom_target(curl_uninstall + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake") + endif() + + install(FILES "${PROJECT_SOURCE_DIR}/scripts/wcurl" + DESTINATION ${CMAKE_INSTALL_BINDIR} + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + + # The `-DEV` part is important + string(REGEX REPLACE "([0-9]+\.[0-9]+)\.([0-9]+.*)" "\\2" CPACK_PACKAGE_VERSION_PATCH "${_curl_version}") + set(CPACK_GENERATOR "TGZ") + include(CPack) +endif() - add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P - ${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake) +# Save build info for test runner to pick up and log +set(_cmake_sysroot "") +if(CMAKE_OSX_SYSROOT) + set(_cmake_sysroot ${CMAKE_OSX_SYSROOT}) +elseif(CMAKE_SYSROOT) + set(_cmake_sysroot ${CMAKE_SYSROOT}) +endif() +set(_buildinfo "\ +buildinfo.configure.tool: cmake +buildinfo.configure.command: ${CMAKE_COMMAND} +buildinfo.configure.version: ${CMAKE_VERSION} +buildinfo.configure.args:${_cmake_args} +buildinfo.configure.generator: ${CMAKE_GENERATOR} +buildinfo.configure.make: ${CMAKE_MAKE_PROGRAM} +buildinfo.host.cpu: ${CMAKE_HOST_SYSTEM_PROCESSOR} +buildinfo.host.os: ${CMAKE_HOST_SYSTEM_NAME} +buildinfo.target.cpu: ${CMAKE_SYSTEM_PROCESSOR} +buildinfo.target.os: ${CMAKE_SYSTEM_NAME} +buildinfo.target.flags:${_target_flags} +buildinfo.compiler: ${CMAKE_C_COMPILER_ID} +buildinfo.compiler.version: ${CMAKE_C_COMPILER_VERSION} +buildinfo.sysroot: ${_cmake_sysroot} +") +file(WRITE "${PROJECT_BINARY_DIR}/buildinfo.txt" "# This is a generated file. Do not edit.\n${_buildinfo}") +if(NOT "$ENV{CURL_BUILDINFO}$ENV{CURL_CI}$ENV{CI}" STREQUAL "") + message(STATUS "\n${_buildinfo}") endif() diff --git a/curl/COPYING b/curl/COPYING index 1e45a5e2c..3fa85ebb6 100644 --- a/curl/COPYING +++ b/curl/COPYING @@ -1,6 +1,6 @@ COPYRIGHT AND PERMISSION NOTICE -Copyright (c) 1996 - 2017, Daniel Stenberg, , and many +Copyright (c) 1996 - 2025, Daniel Stenberg, , and many contributors, see the THANKS file. All rights reserved. diff --git a/curl/Dockerfile b/curl/Dockerfile new file mode 100644 index 000000000..e6ad44698 --- /dev/null +++ b/curl/Dockerfile @@ -0,0 +1,41 @@ +# Copyright (C) Daniel Stenberg, , 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:6ac2c08566499cc2415926653cf2ed7c3aedac445675a013cc09469c9e118fdd + +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} diff --git a/curl/MacOSX-Framework b/curl/MacOSX-Framework deleted file mode 100644 index e6badcde5..000000000 --- a/curl/MacOSX-Framework +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -# This script performs all of the steps needed to build a -# universal binary libcurl.framework for Mac OS X 10.4 or greater. -# -# Hendrik Visage: -# Generalizations added since Snowleopard (10.6) do not include -# the 10.4u SDK. -# -# Also note: -# 10.5 is the *ONLY* SDK that support PPC64 :( -- 10.6 do not have ppc64 support -#If you need to have PPC64 support then change below to 1 -PPC64_NEEDED=0 -# Apple does not support building for PPC anymore in Xcode 4 and later. -# If you're using Xcode 3 or earlier and need PPC support, then change -# the setting below to 1 -PPC_NEEDED=0 - -# For me the default is to develop for the platform I am on, and if you -#desire compatibility with older versions then change USE_OLD to 1 :) -USE_OLD=0 - -VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h` -FRAMEWORK_VERSION=Versions/Release-$VERSION - -#I also wanted to "copy over" the system, and thus the reason I added the -# version to Versions/Release-7.20.1 etc. -# now a simple rsync -vaP libcurl.framework /Library/Frameworks will install it -# and setup the right paths to this version, leaving the system version -# "intact", so you can "fix" it later with the links to Versions/A/... - -DEVELOPER_PATH=`xcode-select --print-path` -# Around Xcode 4.3, SDKs were moved from the Developer folder into the -# MacOSX.platform folder -if test -d "$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs"; then - SDK_PATH="$DEVELOPER_PATH/Platforms/MacOSX.platform/Developer/SDKs" -else - SDK_PATH="$DEVELOPER_PATH/SDKs"; -fi -OLD_SDK=`ls $SDK_PATH|head -1` -NEW_SDK=`ls -r $SDK_PATH|head -1` - -if test "0"$USE_OLD -gt 0 -then - SDK32=$OLD_SDK -else - SDK32=$NEW_SDK -fi - -MACVER=`echo $SDK32|sed -e s/[a-zA-Z]//g -e s/.\$//` - -SDK32_DIR=$SDK_PATH/$SDK32 -MINVER32='-mmacosx-version-min='$MACVER -if test $PPC_NEEDED -gt 0; then - ARCHES32='-arch i386 -arch ppc' -else - ARCHES32='-arch i386' -fi - -if test $PPC64_NEEDED -gt 0 -then - SDK64=10.5 - ARCHES64='-arch x86_64 -arch ppc64' - SDK64=`ls $SDK_PATH|grep 10.5|head -1` -else - ARCHES64='-arch x86_64' - #We "know" that 10.4 and earlier do not support 64bit - OLD_SDK64=`ls $SDK_PATH|egrep -v "10.[0-4]"|head -1` - NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4][^0-9]" | head -1` - if test $USE_OLD -gt 0 - then - SDK64=$OLD_SDK64 - else - SDK64=$NEW_SDK64 - fi -fi - -SDK64_DIR=$SDK_PATH/$SDK64 -MACVER64=`echo $SDK64|sed -e s/[a-zA-Z]//g -e s/.\$//` - -MINVER64='-mmacosx-version-min='$MACVER64 - -if test ! -z $SDK32; then - echo "----Configuring libcurl for 32 bit universal framework..." - make clean - ./configure --disable-dependency-tracking --disable-static --with-gssapi --with-darwinssl \ - CFLAGS="-Os -isysroot $SDK32_DIR $ARCHES32" \ - LDFLAGS="-Wl,-syslibroot,$SDK32_DIR $ARCHES32 -Wl,-headerpad_max_install_names" \ - CC=$CC - - echo "----Building 32 bit libcurl..." - make -j `sysctl -n hw.logicalcpu_max` - - echo "----Creating 32 bit framework..." - rm -r libcurl.framework - mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources - cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl - install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl - /usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist - mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl - cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl - pushd libcurl.framework - ln -fs ${FRAMEWORK_VERSION}/libcurl libcurl - ln -fs ${FRAMEWORK_VERSION}/Resources Resources - ln -fs ${FRAMEWORK_VERSION}/Headers Headers - cd Versions - ln -fs $(basename "${FRAMEWORK_VERSION}") Current - - echo Testing for SDK64 - if test -d $SDK64_DIR; then - echo entering... - popd - make clean - echo "----Configuring libcurl for 64 bit universal framework..." - ./configure --disable-dependency-tracking --disable-static --with-gssapi --with-darwinssl \ - CFLAGS="-Os -isysroot $SDK64_DIR $ARCHES64" \ - LDFLAGS="-Wl,-syslibroot,$SDK64_DIR $ARCHES64 -Wl,-headerpad_max_install_names" \ - CC=$CC - - echo "----Building 64 bit libcurl..." - make -j `sysctl -n hw.logicalcpu_max` - - echo "----Appending 64 bit framework to 32 bit framework..." - cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 - install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 - cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 - pwd - lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl - rm libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 - fi - - pwd - lipo -info libcurl.framework/${FRAMEWORK_VERSION}/libcurl - echo "libcurl.framework is built and can now be included in other projects." - echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks." -else - echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4/5/6 SDK installed." -fi diff --git a/curl/Makefile b/curl/Makefile deleted file mode 100644 index 8577c8a14..000000000 --- a/curl/Makefile +++ /dev/null @@ -1,151 +0,0 @@ -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2017, Daniel Stenberg, , 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.haxx.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. -# -########################################################################### - -all: - ./configure - make - -ssl: - ./configure --with-ssl - make - -borland: - cd lib - $(MAKE) -f Makefile.b32 - cd ..\src - $(MAKE) -f Makefile.b32 - -borland-ssl: - cd lib - $(MAKE) -f Makefile.b32 WITH_SSL=1 - cd ..\src - $(MAKE) -f Makefile.b32 WITH_SSL=1 - -borland-ssl-zlib: - cd lib - $(MAKE) -f Makefile.b32 WITH_SSL=1 WITH_ZLIB=1 - cd ..\src - $(MAKE) -f Makefile.b32 WITH_SSL=1 WITH_ZLIB=1 - -borland-clean: - cd lib - $(MAKE) -f Makefile.b32 clean - cd ..\src - $(MAKE) -f Makefile.b32 clean - -watcom: .SYMBOLIC - cd lib && $(MAKE) -u -f Makefile.Watcom - cd src && $(MAKE) -u -f Makefile.Watcom - -watcom-clean: .SYMBOLIC - cd lib && $(MAKE) -u -f Makefile.Watcom clean - cd src && $(MAKE) -u -f Makefile.Watcom clean - -watcom-vclean: .SYMBOLIC - cd lib && $(MAKE) -u -f Makefile.Watcom vclean - cd src && $(MAKE) -u -f Makefile.Watcom vclean - -mingw32: - $(MAKE) -C lib -f Makefile.m32 - $(MAKE) -C src -f Makefile.m32 - -mingw32-clean: - $(MAKE) -C lib -f Makefile.m32 clean - $(MAKE) -C src -f Makefile.m32 clean - $(MAKE) -C docs/examples -f Makefile.m32 clean - -mingw32-vclean mingw32-distclean: - $(MAKE) -C lib -f Makefile.m32 vclean - $(MAKE) -C src -f Makefile.m32 vclean - $(MAKE) -C docs/examples -f Makefile.m32 vclean - -mingw32-examples%: - $(MAKE) -C docs/examples -f Makefile.m32 CFG=$@ - -mingw32%: - $(MAKE) -C lib -f Makefile.m32 CFG=$@ - $(MAKE) -C src -f Makefile.m32 CFG=$@ - -vc: - cd winbuild - nmake /f Makefile.vc MACHINE=x86 - -vc-x64: - cd winbuild - nmake /f Makefile.vc MACHINE=x64 - -djgpp: - $(MAKE) -C lib -f Makefile.dj - $(MAKE) -C src -f Makefile.dj - -cygwin: - ./configure - make - -cygwin-ssl: - ./configure --with-ssl - make - -amiga: - cd ./lib && make -f makefile.amiga - cd ./src && make -f makefile.amiga - -netware: - $(MAKE) -C lib -f Makefile.netware - $(MAKE) -C src -f Makefile.netware - -netware-clean: - $(MAKE) -C lib -f Makefile.netware clean - $(MAKE) -C src -f Makefile.netware clean - $(MAKE) -C docs/examples -f Makefile.netware clean - -netware-vclean netware-distclean: - $(MAKE) -C lib -f Makefile.netware vclean - $(MAKE) -C src -f Makefile.netware vclean - $(MAKE) -C docs/examples -f Makefile.netware vclean - -netware-install: - $(MAKE) -C lib -f Makefile.netware install - $(MAKE) -C src -f Makefile.netware install - -netware-examples-%: - $(MAKE) -C docs/examples -f Makefile.netware CFG=$@ - -netware-%: - $(MAKE) -C lib -f Makefile.netware CFG=$@ - $(MAKE) -C src -f Makefile.netware CFG=$@ - -unix: all - -unix-ssl: ssl - -linux: all - -linux-ssl: ssl - -ca-bundle: lib/mk-ca-bundle.pl - @echo "generate a fresh ca-bundle.crt" - @perl $< -b -l -u lib/ca-bundle.crt - -ca-firefox: lib/firefox-db2pem.sh - @echo "generate a fresh ca-bundle.crt" - ./lib/firefox-db2pem.sh lib/ca-bundle.crt diff --git a/curl/Makefile.am b/curl/Makefile.am index ab8f11cbc..08d59e807 100644 --- a/curl/Makefile.am +++ b/curl/Makefile.am @@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -18,172 +18,101 @@ # 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 = CMakeLists.txt CMake/CMakeConfigurableFile.in \ - CMake/CurlTests.c CMake/FindGSS.cmake CMake/OtherTests.cmake \ - CMake/Platforms/WindowsCache.cmake CMake/Utilities.cmake \ - CMake/Macros.cmake \ - CMake/CurlSymbolHiding.cmake CMake/FindCARES.cmake \ - CMake/FindLibSSH2.cmake CMake/FindNGHTTP2.cmake \ - CMake/FindMbedTLS.cmake CMake/cmake_uninstall.cmake.in - -VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl -VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp.dist -VC6_LIBDSP_DEPS = $(VC6_LIBTMPL) Makefile.am lib/Makefile.inc -VC6_SRCTMPL = projects/Windows/VC6/src/curl.tmpl -VC6_SRCDSP = projects/Windows/VC6/src/curl.dsp.dist -VC6_SRCDSP_DEPS = $(VC6_SRCTMPL) Makefile.am src/Makefile.inc - -VC7_LIBTMPL = projects/Windows/VC7/lib/libcurl.tmpl -VC7_LIBVCPROJ = projects/Windows/VC7/lib/libcurl.vcproj.dist -VC7_LIBVCPROJ_DEPS = $(VC7_LIBTMPL) Makefile.am lib/Makefile.inc -VC7_SRCTMPL = projects/Windows/VC7/src/curl.tmpl -VC7_SRCVCPROJ = projects/Windows/VC7/src/curl.vcproj.dist -VC7_SRCVCPROJ_DEPS = $(VC7_SRCTMPL) Makefile.am src/Makefile.inc - -VC71_LIBTMPL = projects/Windows/VC7.1/lib/libcurl.tmpl -VC71_LIBVCPROJ = projects/Windows/VC7.1/lib/libcurl.vcproj.dist -VC71_LIBVCPROJ_DEPS = $(VC71_LIBTMPL) Makefile.am lib/Makefile.inc -VC71_SRCTMPL = projects/Windows/VC7.1/src/curl.tmpl -VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curl.vcproj.dist -VC71_SRCVCPROJ_DEPS = $(VC71_SRCTMPL) Makefile.am src/Makefile.inc - -VC8_LIBTMPL = projects/Windows/VC8/lib/libcurl.tmpl -VC8_LIBVCPROJ = projects/Windows/VC8/lib/libcurl.vcproj.dist -VC8_LIBVCPROJ_DEPS = $(VC8_LIBTMPL) Makefile.am lib/Makefile.inc -VC8_SRCTMPL = projects/Windows/VC8/src/curl.tmpl -VC8_SRCVCPROJ = projects/Windows/VC8/src/curl.vcproj.dist -VC8_SRCVCPROJ_DEPS = $(VC8_SRCTMPL) Makefile.am src/Makefile.inc - -VC9_LIBTMPL = projects/Windows/VC9/lib/libcurl.tmpl -VC9_LIBVCPROJ = projects/Windows/VC9/lib/libcurl.vcproj.dist -VC9_LIBVCPROJ_DEPS = $(VC9_LIBTMPL) Makefile.am lib/Makefile.inc -VC9_SRCTMPL = projects/Windows/VC9/src/curl.tmpl -VC9_SRCVCPROJ = projects/Windows/VC9/src/curl.vcproj.dist -VC9_SRCVCPROJ_DEPS = $(VC9_SRCTMPL) Makefile.am src/Makefile.inc - -VC10_LIBTMPL = projects/Windows/VC10/lib/libcurl.tmpl -VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj.dist -VC10_LIBVCXPROJ_DEPS = $(VC10_LIBTMPL) Makefile.am lib/Makefile.inc -VC10_SRCTMPL = projects/Windows/VC10/src/curl.tmpl -VC10_SRCVCXPROJ = projects/Windows/VC10/src/curl.vcxproj.dist -VC10_SRCVCXPROJ_DEPS = $(VC10_SRCTMPL) Makefile.am src/Makefile.inc - -VC11_LIBTMPL = projects/Windows/VC11/lib/libcurl.tmpl -VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj.dist -VC11_LIBVCXPROJ_DEPS = $(VC11_LIBTMPL) Makefile.am lib/Makefile.inc -VC11_SRCTMPL = projects/Windows/VC11/src/curl.tmpl -VC11_SRCVCXPROJ = projects/Windows/VC11/src/curl.vcxproj.dist -VC11_SRCVCXPROJ_DEPS = $(VC11_SRCTMPL) Makefile.am src/Makefile.inc - -VC12_LIBTMPL = projects/Windows/VC12/lib/libcurl.tmpl -VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj.dist -VC12_LIBVCXPROJ_DEPS = $(VC12_LIBTMPL) Makefile.am lib/Makefile.inc -VC12_SRCTMPL = projects/Windows/VC12/src/curl.tmpl -VC12_SRCVCXPROJ = projects/Windows/VC12/src/curl.vcxproj.dist -VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc - -VC14_LIBTMPL = projects/Windows/VC14/lib/libcurl.tmpl -VC14_LIBVCXPROJ = projects/Windows/VC14/lib/libcurl.vcxproj.dist -VC14_LIBVCXPROJ_DEPS = $(VC14_LIBTMPL) Makefile.am lib/Makefile.inc -VC14_SRCTMPL = projects/Windows/VC14/src/curl.tmpl -VC14_SRCVCXPROJ = projects/Windows/VC14/src/curl.vcxproj.dist -VC14_SRCVCXPROJ_DEPS = $(VC14_SRCTMPL) Makefile.am src/Makefile.inc - -VC_DIST = projects/README \ - projects/build-openssl.bat \ - projects/build-wolfssl.bat \ - projects/checksrc.bat \ - projects/Windows/VC6/curl-all.dsw \ - projects/Windows/VC6/lib/libcurl.dsw \ - projects/Windows/VC6/src/curl.dsw \ - projects/Windows/VC7/curl-all.sln \ - projects/Windows/VC7/lib/libcurl.sln \ - projects/Windows/VC7/src/curl.sln \ - projects/Windows/VC7.1/curl-all.sln \ - projects/Windows/VC7.1/lib/libcurl.sln \ - projects/Windows/VC7.1/src/curl.sln \ - projects/Windows/VC8/curl-all.sln \ - projects/Windows/VC8/lib/libcurl.sln \ - projects/Windows/VC8/src/curl.sln \ - projects/Windows/VC9/curl-all.sln \ - projects/Windows/VC9/lib/libcurl.sln \ - projects/Windows/VC9/src/curl.sln \ - projects/Windows/VC10/curl-all.sln \ - projects/Windows/VC10/lib/libcurl.sln \ - projects/Windows/VC10/lib/libcurl.vcxproj.filters \ - projects/Windows/VC10/src/curl.sln \ - projects/Windows/VC10/src/curl.vcxproj.filters \ - projects/Windows/VC11/curl-all.sln \ - projects/Windows/VC11/lib/libcurl.sln \ - projects/Windows/VC11/lib/libcurl.vcxproj.filters \ - projects/Windows/VC11/src/curl.sln \ - projects/Windows/VC11/src/curl.vcxproj.filters \ - projects/Windows/VC12/curl-all.sln \ - projects/Windows/VC12/lib/libcurl.sln \ - projects/Windows/VC12/lib/libcurl.vcxproj.filters \ - projects/Windows/VC12/src/curl.sln \ - projects/Windows/VC12/src/curl.vcxproj.filters \ - projects/Windows/VC14/curl-all.sln \ - projects/Windows/VC14/lib/libcurl.sln \ - projects/Windows/VC14/lib/libcurl.vcxproj.filters \ - projects/Windows/VC14/src/curl.sln \ - projects/Windows/VC14/src/curl.vcxproj.filters \ - projects/generate.bat \ - projects/wolfssl_options.h \ - projects/wolfssl_override.props - -WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \ - winbuild/MakefileBuild.vc winbuild/Makefile.vc - -EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ - RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework scripts/zsh.pl \ - scripts/updatemanpages.pl $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) \ - lib/libcurl.vers.in buildconf.bat scripts/coverage.sh - -CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \ - $(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \ - $(VC9_LIBVCPROJ) $(VC9_SRCVCPROJ) $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) \ - $(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \ - $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) +CMAKE_DIST = \ + CMake/cmake_uninstall.cmake.in \ + CMake/CMakeConfigurableFile.in \ + CMake/curl-config.cmake.in \ + CMake/CurlSymbolHiding.cmake \ + CMake/CurlTests.c \ + CMake/FindBrotli.cmake \ + CMake/FindCares.cmake \ + CMake/FindGSS.cmake \ + CMake/FindLDAP.cmake \ + CMake/FindLibgsasl.cmake \ + CMake/FindLibidn2.cmake \ + CMake/FindLibpsl.cmake \ + CMake/FindLibrtmp.cmake \ + CMake/FindLibssh.cmake \ + CMake/FindLibssh2.cmake \ + CMake/FindLibuv.cmake \ + CMake/FindMSH3.cmake \ + CMake/FindMbedTLS.cmake \ + CMake/FindNGHTTP2.cmake \ + CMake/FindNGHTTP3.cmake \ + CMake/FindNGTCP2.cmake \ + CMake/FindNettle.cmake \ + CMake/FindQuiche.cmake \ + CMake/FindRustls.cmake \ + CMake/FindWolfSSH.cmake \ + CMake/FindWolfSSL.cmake \ + CMake/FindZstd.cmake \ + CMake/Macros.cmake \ + CMake/OtherTests.cmake \ + CMake/PickyWarnings.cmake \ + CMake/Utilities.cmake \ + CMake/unix-cache.cmake \ + CMake/win32-cache.cmake \ + CMakeLists.txt \ + tests/cmake/CMakeLists.txt \ + tests/cmake/test.c \ + tests/cmake/test.sh + +VC_DIST = projects/README.md projects/generate.bat + +WINBUILD_DIST = winbuild/README.md \ + winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.bat + +PLAN9_DIST = plan9/include/mkfile \ + plan9/include/mkfile \ + plan9/mkfile.proto \ + plan9/mkfile \ + plan9/README \ + plan9/lib/mkfile.inc \ + plan9/lib/mkfile \ + plan9/src/mkfile.inc \ + plan9/src/mkfile + +EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile \ + $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) $(PLAN9_DIST) + +DISTCLEANFILES = buildinfo.txt bin_SCRIPTS = curl-config -SUBDIRS = lib src -DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs +SUBDIRS = lib docs src scripts +DIST_SUBDIRS = $(SUBDIRS) tests packages include docs pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc -# List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files -include lib/Makefile.inc -include src/Makefile.inc - dist-hook: rm -rf $(top_builddir)/tests/log find $(distdir) -name "*.dist" -exec rm {} \; - (distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \ + (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) -html: - cd docs && $(MAKE) html - -pdf: - cd docs && $(MAKE) pdf - 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 can't run the tests when cross-compiling!" @@ -208,6 +137,15 @@ test-event: 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: @@ -216,15 +154,6 @@ examples: check-docs: @(cd docs/libcurl; $(MAKE) check) -# This is a hook to have 'make clean' also clean up the docs and the tests -# dir. The extra check for the Makefiles being present is necessary because -# 'make distcheck' will make clean first in these directories _before_ it runs -# this hook. -clean-local: - @(if test -f tests/Makefile; then cd tests; $(MAKE) clean; fi) - @(if test -f docs/Makefile; then cd docs; $(MAKE) clean; fi) - -# # Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros # must contain the following line: # %_topdir /home/loic/local/rpm @@ -251,369 +180,43 @@ rpm: mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \ mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm . -# -# Build a Solaris pkgadd format file -# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format -# file (which ends up back in this directory). -# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do -# pkgadd -d ./HAXXcurl-* -# - -# gak - libtool requires an absolute directory, hence the pwd below... -pkgadd: - umask 022 ; \ - $(MAKE) install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \ - cat COPYING > $(srcdir)/packages/Solaris/copyright ; \ - cd $(srcdir)/packages/Solaris && $(MAKE) package - -# -# Build a cygwin binary tarball installation file -# resulting .tar.bz2 file will end up at packages/Win32/cygwin -cygwinbin: - $(MAKE) -C packages/Win32/cygwin cygwinbin - # 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 + (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 + (cd include && $(MAKE) uninstall) + (cd docs && $(MAKE) uninstall) + (cd docs/libcurl && $(MAKE) uninstall) -ca-bundle: lib/mk-ca-bundle.pl +ca-bundle: $(srcdir)/scripts/mk-ca-bundle.pl @echo "generating a fresh ca-bundle.crt" - @perl $< -b -l -u lib/ca-bundle.crt + @perl $(srcdir)/scripts/mk-ca-bundle.pl -b -l -u lib/ca-bundle.crt -ca-firefox: lib/firefox-db2pem.sh +ca-firefox: $(srcdir)/scripts/firefox-db2pem.sh @echo "generating a fresh ca-bundle.crt" - ./lib/firefox-db2pem.sh lib/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 - -.PHONY: vc-ide - -vc-ide: $(VC6_LIBDSP_DEPS) $(VC6_SRCDSP_DEPS) $(VC7_LIBVCPROJ_DEPS) \ - $(VC7_SRCVCPROJ_DEPS) $(VC71_LIBVCPROJ_DEPS) $(VC71_SRCVCPROJ_DEPS) \ - $(VC8_LIBVCPROJ_DEPS) $(VC8_SRCVCPROJ_DEPS) $(VC9_LIBVCPROJ_DEPS) \ - $(VC9_SRCVCPROJ_DEPS) $(VC10_LIBVCXPROJ_DEPS) $(VC10_SRCVCXPROJ_DEPS) \ - $(VC11_LIBVCXPROJ_DEPS) $(VC11_SRCVCXPROJ_DEPS) $(VC12_LIBVCXPROJ_DEPS) \ - $(VC12_SRCVCXPROJ_DEPS) $(VC14_LIBVCXPROJ_DEPS) $(VC14_SRCVCXPROJ_DEPS) - @(win32_lib_srcs='$(LIB_CFILES)'; \ - win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \ - win32_lib_rc='$(LIB_RCFILES)'; \ - win32_lib_vauth_srcs='$(LIB_VAUTH_CFILES)'; \ - win32_lib_vauth_hdrs='$(LIB_VAUTH_HFILES)'; \ - win32_lib_vtls_srcs='$(LIB_VTLS_CFILES)'; \ - win32_lib_vtls_hdrs='$(LIB_VTLS_HFILES)'; \ - win32_src_srcs='$(CURL_CFILES)'; \ - win32_src_hdrs='$(CURL_HFILES)'; \ - win32_src_rc='$(CURL_RCFILES)'; \ - win32_src_x_srcs='$(CURLX_CFILES)'; \ - win32_src_x_hdrs='$(CURLX_HFILES) ../lib/config-win32.h'; \ - \ - sorted_lib_srcs=`for file in $$win32_lib_srcs; do echo $$file; done | sort`; \ - sorted_lib_hdrs=`for file in $$win32_lib_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vauth_srcs=`for file in $$win32_lib_vauth_srcs; do echo $$file; done | sort`; \ - sorted_lib_vauth_hdrs=`for file in $$win32_lib_vauth_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vtls_srcs=`for file in $$win32_lib_vtls_srcs; do echo $$file; done | sort`; \ - sorted_lib_vtls_hdrs=`for file in $$win32_lib_vtls_hdrs; do echo $$file; done | sort`; \ - sorted_src_srcs=`for file in $$win32_src_srcs; do echo $$file; done | sort`; \ - sorted_src_hdrs=`for file in $$win32_src_hdrs; do echo $$file; done | sort`; \ - sorted_src_x_srcs=`for file in $$win32_src_x_srcs; do echo $$file; done | sort`; \ - sorted_src_x_hdrs=`for file in $$win32_src_x_hdrs; do echo $$file; done | sort`; \ - \ - awk_code='\ -function gen_element(type, dir, file)\ -{\ - sub(/vauth\//, "", file);\ - sub(/vtls\//, "", file);\ -\ - spaces=" ";\ - if(dir == "lib\\vauth" || dir == "lib\\vtls")\ - tabs=" ";\ - else\ - tabs=" ";\ -\ - if(type == "dsp") {\ - printf("# Begin Source File\r\n");\ - printf("\r\n");\ - printf("SOURCE=..\\..\\..\\..\\%s\\%s\r\n", dir, file);\ - printf("# End Source File\r\n");\ - }\ - else if(type == "vcproj1") {\ - printf("%s\r\n",\ - tabs, dir, file);\ - printf("%s\r\n", tabs);\ - }\ - else if(type == "vcproj2") {\ - printf("%s\r\n", tabs);\ - printf("%s\r\n", tabs);\ - }\ - else if(type == "vcxproj") {\ - i = index(file, ".");\ - ext = substr(file, i == 0 ? 0 : i + 1);\ -\ - if(ext == "c")\ - printf("%s\r\n",\ - spaces, dir, file);\ - else if(ext == "h")\ - printf("%s\r\n",\ - spaces, dir, file);\ - else if(ext == "rc")\ - printf("%s\r\n",\ - spaces, dir, file);\ - }\ -}\ -\ -{\ -\ - if($$0 == "CURL_LIB_C_FILES") {\ - split(lib_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_H_FILES") {\ - split(lib_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_RC_FILES") {\ - split(lib_rc, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VAUTH_C_FILES") {\ - split(lib_vauth_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VAUTH_H_FILES") {\ - split(lib_vauth_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VTLS_C_FILES") {\ - split(lib_vtls_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VTLS_H_FILES") {\ - split(lib_vtls_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_C_FILES") {\ - split(src_srcs, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_H_FILES") {\ - split(src_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_RC_FILES") {\ - split(src_rc, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_X_C_FILES") {\ - split(src_x_srcs, arr);\ - for(val in arr) {\ - sub(/..\/lib\//, "", arr[val]);\ - gen_element(proj_type, "lib", arr[val]);\ - }\ - }\ - else if($$0 == "CURL_SRC_X_H_FILES") {\ - split(src_x_hdrs, arr);\ - for(val in arr) {\ - sub(/..\/lib\//, "", arr[val]);\ - gen_element(proj_type, "lib", arr[val]);\ - }\ - }\ - else\ - printf("%s\r\n", $$0);\ -}';\ - \ - echo "generating '$(VC6_LIBDSP)'"; \ - awk -v proj_type=dsp \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC6_LIBTMPL) > $(VC6_LIBDSP) || { exit 1; }; \ - \ - echo "generating '$(VC6_SRCDSP)'"; \ - awk -v proj_type=dsp \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC6_SRCTMPL) > $(VC6_SRCDSP) || { exit 1; }; \ - \ - echo "generating '$(VC7_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC7_LIBTMPL) > $(VC7_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC7_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC7_SRCTMPL) > $(VC7_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC71_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC71_LIBTMPL) > $(VC71_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC71_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC71_SRCTMPL) > $(VC71_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC8_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC8_LIBTMPL) > $(VC8_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC8_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC8_SRCTMPL) > $(VC8_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC9_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC9_LIBTMPL) > $(VC9_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC9_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC9_SRCTMPL) > $(VC9_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC10_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC10_LIBTMPL) > $(VC10_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC10_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC10_SRCTMPL) > $(VC10_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC11_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC11_LIBTMPL) > $(VC11_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC11_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC11_SRCTMPL) > $(VC11_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC12_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC12_LIBTMPL) > $(VC12_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC12_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_LIBTMPL) > $(VC14_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_SRCTMPL) > $(VC14_SRCVCXPROJ) || { exit 1; };) + (cd lib && $(MAKE) checksrc) + (cd src && $(MAKE) checksrc) + (cd tests && $(MAKE) checksrc) + (cd include/curl && $(MAKE) checksrc) + (cd docs/examples && $(MAKE) checksrc) + (cd packages && $(MAKE) checksrc) + +tidy: + (cd src && $(MAKE) tidy) + (cd lib && $(MAKE) tidy) + +clean-local: + (cd tests && $(MAKE) clean) diff --git a/curl/Makefile.in b/curl/Makefile.in index 711e70158..8d6bb5389 100644 --- a/curl/Makefile.in +++ b/curl/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,11 +21,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -34,39 +34,10 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # -########################################################################### - -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2016, Daniel Stenberg, , 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.haxx.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 # ########################################################################### -# ./src/Makefile.inc -# Using the backslash as line continuation character might be problematic -# with some make flavours, as Watcom's wmake showed us already. If we -# ever want to change this in a portable manner then we should consider -# this idea (posted to the libcurl list by Adam Kellas): -# CSRC1 = file1.c file2.c file3.c -# CSRC2 = file4.c file5.c file6.c -# CSOURCES = $(CSRC1) $(CSRC2) - VPATH = @srcdir@ am__is_gnu_make = { \ @@ -144,19 +115,24 @@ build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/curl-amissl.m4 \ $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ + $(top_srcdir)/m4/curl-gnutls.m4 \ + $(top_srcdir)/m4/curl-mbedtls.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ - $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/curl-reentrant.m4 \ + $(top_srcdir)/m4/curl-rustls.m4 \ + $(top_srcdir)/m4/curl-schannel.m4 \ + $(top_srcdir)/m4/curl-sysconfig.m4 \ + $(top_srcdir)/m4/curl-wolfssl.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ - $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ @@ -236,7 +212,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck + cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -254,12 +230,8 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/curl-config.in \ - $(srcdir)/lib/Makefile.inc $(srcdir)/libcurl.pc.in \ - $(srcdir)/src/Makefile.inc COPYING README compile config.guess \ + $(srcdir)/libcurl.pc.in COPYING README compile config.guess \ config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) @@ -299,6 +271,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -306,51 +280,34 @@ distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APXS = @APXS@ AR = @AR@ +AR_FLAGS = @AR_FLAGS@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ +CADDY = @CADDY@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ +CURL_CA_EMBED = @CURL_CA_EMBED@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ -CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ -CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ -CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ -CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ -CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ -CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ -CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ -CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ -CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ -CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ -CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ -CURL_DISABLE_SMB = @CURL_DISABLE_SMB@ -CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ -CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ -CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ -CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ +CURL_CPP = @CURL_CPP@ +CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX = @CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX@ +CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME = @CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ -CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ -CURL_WITH_MULTI_SSL = @CURL_WITH_MULTI_SSL@ CYGPATH_W = @CYGPATH_W@ -DEFAULT_SSL_BACKEND = @DEFAULT_SSL_BACKEND@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -362,29 +319,31 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ +FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@ GCOV = @GCOV@ -GENHTML = @GENHTML@ GREP = @GREP@ -HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ -HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ -HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@ -IDN_ENABLED = @IDN_ENABLED@ +HTTPD = @HTTPD@ +HTTPD_NGHTTPX = @HTTPD_NGHTTPX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -IPV6_ENABLED = @IPV6_ENABLED@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LIBCURL_LIBS = @LIBCURL_LIBS@ -LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ -LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ -LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ +LIBCURL_PC_CFLAGS = @LIBCURL_PC_CFLAGS@ +LIBCURL_PC_CFLAGS_PRIVATE = @LIBCURL_PC_CFLAGS_PRIVATE@ +LIBCURL_PC_LDFLAGS_PRIVATE = @LIBCURL_PC_LDFLAGS_PRIVATE@ +LIBCURL_PC_LIBS = @LIBCURL_PC_LIBS@ +LIBCURL_PC_LIBS_PRIVATE = @LIBCURL_PC_LIBS_PRIVATE@ +LIBCURL_PC_REQUIRES = @LIBCURL_PC_REQUIRES@ +LIBCURL_PC_REQUIRES_PRIVATE = @LIBCURL_PC_REQUIRES_PRIVATE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -395,12 +354,9 @@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ -MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ -NROFF = @NROFF@ -NSS_LIBS = @NSS_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ @@ -414,39 +370,20 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PKGADD_NAME = @PKGADD_NAME@ -PKGADD_PKG = @PKGADD_PKG@ -PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ -RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ -REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ +RC = @RC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ -SSL_ENABLED = @SSL_ENABLED@ -SSL_LIBS = @SSL_LIBS@ +SSL_BACKENDS = @SSL_BACKENDS@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ -USE_ARES = @USE_ARES@ -USE_AXTLS = @USE_AXTLS@ -USE_CYASSL = @USE_CYASSL@ -USE_DARWINSSL = @USE_DARWINSSL@ -USE_GNUTLS = @USE_GNUTLS@ -USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ -USE_LIBRTMP = @USE_LIBRTMP@ -USE_LIBSSH2 = @USE_LIBSSH2@ -USE_MBEDTLS = @USE_MBEDTLS@ -USE_NGHTTP2 = @USE_NGHTTP2@ -USE_NSS = @USE_NSS@ -USE_OPENLDAP = @USE_OPENLDAP@ -USE_POLARSSL = @USE_POLARSSL@ -USE_SCHANNEL = @USE_SCHANNEL@ -USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@ -USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ +TEST_NGHTTPX = @TEST_NGHTTPX@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ +VSFTPD = @VSFTPD@ ZLIB_LIBS = @ZLIB_LIBS@ ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@ abs_builddir = @abs_builddir@ @@ -498,7 +435,6 @@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -506,294 +442,74 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 -CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in \ - CMake/CurlTests.c CMake/FindGSS.cmake CMake/OtherTests.cmake \ - CMake/Platforms/WindowsCache.cmake CMake/Utilities.cmake \ - CMake/Macros.cmake \ - CMake/CurlSymbolHiding.cmake CMake/FindCARES.cmake \ - CMake/FindLibSSH2.cmake CMake/FindNGHTTP2.cmake \ - CMake/FindMbedTLS.cmake CMake/cmake_uninstall.cmake.in - -VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl -VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp.dist -VC6_LIBDSP_DEPS = $(VC6_LIBTMPL) Makefile.am lib/Makefile.inc -VC6_SRCTMPL = projects/Windows/VC6/src/curl.tmpl -VC6_SRCDSP = projects/Windows/VC6/src/curl.dsp.dist -VC6_SRCDSP_DEPS = $(VC6_SRCTMPL) Makefile.am src/Makefile.inc -VC7_LIBTMPL = projects/Windows/VC7/lib/libcurl.tmpl -VC7_LIBVCPROJ = projects/Windows/VC7/lib/libcurl.vcproj.dist -VC7_LIBVCPROJ_DEPS = $(VC7_LIBTMPL) Makefile.am lib/Makefile.inc -VC7_SRCTMPL = projects/Windows/VC7/src/curl.tmpl -VC7_SRCVCPROJ = projects/Windows/VC7/src/curl.vcproj.dist -VC7_SRCVCPROJ_DEPS = $(VC7_SRCTMPL) Makefile.am src/Makefile.inc -VC71_LIBTMPL = projects/Windows/VC7.1/lib/libcurl.tmpl -VC71_LIBVCPROJ = projects/Windows/VC7.1/lib/libcurl.vcproj.dist -VC71_LIBVCPROJ_DEPS = $(VC71_LIBTMPL) Makefile.am lib/Makefile.inc -VC71_SRCTMPL = projects/Windows/VC7.1/src/curl.tmpl -VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curl.vcproj.dist -VC71_SRCVCPROJ_DEPS = $(VC71_SRCTMPL) Makefile.am src/Makefile.inc -VC8_LIBTMPL = projects/Windows/VC8/lib/libcurl.tmpl -VC8_LIBVCPROJ = projects/Windows/VC8/lib/libcurl.vcproj.dist -VC8_LIBVCPROJ_DEPS = $(VC8_LIBTMPL) Makefile.am lib/Makefile.inc -VC8_SRCTMPL = projects/Windows/VC8/src/curl.tmpl -VC8_SRCVCPROJ = projects/Windows/VC8/src/curl.vcproj.dist -VC8_SRCVCPROJ_DEPS = $(VC8_SRCTMPL) Makefile.am src/Makefile.inc -VC9_LIBTMPL = projects/Windows/VC9/lib/libcurl.tmpl -VC9_LIBVCPROJ = projects/Windows/VC9/lib/libcurl.vcproj.dist -VC9_LIBVCPROJ_DEPS = $(VC9_LIBTMPL) Makefile.am lib/Makefile.inc -VC9_SRCTMPL = projects/Windows/VC9/src/curl.tmpl -VC9_SRCVCPROJ = projects/Windows/VC9/src/curl.vcproj.dist -VC9_SRCVCPROJ_DEPS = $(VC9_SRCTMPL) Makefile.am src/Makefile.inc -VC10_LIBTMPL = projects/Windows/VC10/lib/libcurl.tmpl -VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj.dist -VC10_LIBVCXPROJ_DEPS = $(VC10_LIBTMPL) Makefile.am lib/Makefile.inc -VC10_SRCTMPL = projects/Windows/VC10/src/curl.tmpl -VC10_SRCVCXPROJ = projects/Windows/VC10/src/curl.vcxproj.dist -VC10_SRCVCXPROJ_DEPS = $(VC10_SRCTMPL) Makefile.am src/Makefile.inc -VC11_LIBTMPL = projects/Windows/VC11/lib/libcurl.tmpl -VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj.dist -VC11_LIBVCXPROJ_DEPS = $(VC11_LIBTMPL) Makefile.am lib/Makefile.inc -VC11_SRCTMPL = projects/Windows/VC11/src/curl.tmpl -VC11_SRCVCXPROJ = projects/Windows/VC11/src/curl.vcxproj.dist -VC11_SRCVCXPROJ_DEPS = $(VC11_SRCTMPL) Makefile.am src/Makefile.inc -VC12_LIBTMPL = projects/Windows/VC12/lib/libcurl.tmpl -VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj.dist -VC12_LIBVCXPROJ_DEPS = $(VC12_LIBTMPL) Makefile.am lib/Makefile.inc -VC12_SRCTMPL = projects/Windows/VC12/src/curl.tmpl -VC12_SRCVCXPROJ = projects/Windows/VC12/src/curl.vcxproj.dist -VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc -VC14_LIBTMPL = projects/Windows/VC14/lib/libcurl.tmpl -VC14_LIBVCXPROJ = projects/Windows/VC14/lib/libcurl.vcxproj.dist -VC14_LIBVCXPROJ_DEPS = $(VC14_LIBTMPL) Makefile.am lib/Makefile.inc -VC14_SRCTMPL = projects/Windows/VC14/src/curl.tmpl -VC14_SRCVCXPROJ = projects/Windows/VC14/src/curl.vcxproj.dist -VC14_SRCVCXPROJ_DEPS = $(VC14_SRCTMPL) Makefile.am src/Makefile.inc -VC_DIST = projects/README \ - projects/build-openssl.bat \ - projects/build-wolfssl.bat \ - projects/checksrc.bat \ - projects/Windows/VC6/curl-all.dsw \ - projects/Windows/VC6/lib/libcurl.dsw \ - projects/Windows/VC6/src/curl.dsw \ - projects/Windows/VC7/curl-all.sln \ - projects/Windows/VC7/lib/libcurl.sln \ - projects/Windows/VC7/src/curl.sln \ - projects/Windows/VC7.1/curl-all.sln \ - projects/Windows/VC7.1/lib/libcurl.sln \ - projects/Windows/VC7.1/src/curl.sln \ - projects/Windows/VC8/curl-all.sln \ - projects/Windows/VC8/lib/libcurl.sln \ - projects/Windows/VC8/src/curl.sln \ - projects/Windows/VC9/curl-all.sln \ - projects/Windows/VC9/lib/libcurl.sln \ - projects/Windows/VC9/src/curl.sln \ - projects/Windows/VC10/curl-all.sln \ - projects/Windows/VC10/lib/libcurl.sln \ - projects/Windows/VC10/lib/libcurl.vcxproj.filters \ - projects/Windows/VC10/src/curl.sln \ - projects/Windows/VC10/src/curl.vcxproj.filters \ - projects/Windows/VC11/curl-all.sln \ - projects/Windows/VC11/lib/libcurl.sln \ - projects/Windows/VC11/lib/libcurl.vcxproj.filters \ - projects/Windows/VC11/src/curl.sln \ - projects/Windows/VC11/src/curl.vcxproj.filters \ - projects/Windows/VC12/curl-all.sln \ - projects/Windows/VC12/lib/libcurl.sln \ - projects/Windows/VC12/lib/libcurl.vcxproj.filters \ - projects/Windows/VC12/src/curl.sln \ - projects/Windows/VC12/src/curl.vcxproj.filters \ - projects/Windows/VC14/curl-all.sln \ - projects/Windows/VC14/lib/libcurl.sln \ - projects/Windows/VC14/lib/libcurl.vcxproj.filters \ - projects/Windows/VC14/src/curl.sln \ - projects/Windows/VC14/src/curl.vcxproj.filters \ - projects/generate.bat \ - projects/wolfssl_options.h \ - projects/wolfssl_override.props - -WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \ - winbuild/MakefileBuild.vc winbuild/Makefile.vc - -EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ - RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework scripts/zsh.pl \ - scripts/updatemanpages.pl $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) \ - lib/libcurl.vers.in buildconf.bat scripts/coverage.sh - -CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \ - $(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \ - $(VC9_LIBVCPROJ) $(VC9_SRCVCPROJ) $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) \ - $(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \ - $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) - +CMAKE_DIST = \ + CMake/cmake_uninstall.cmake.in \ + CMake/CMakeConfigurableFile.in \ + CMake/curl-config.cmake.in \ + CMake/CurlSymbolHiding.cmake \ + CMake/CurlTests.c \ + CMake/FindBrotli.cmake \ + CMake/FindCares.cmake \ + CMake/FindGSS.cmake \ + CMake/FindLDAP.cmake \ + CMake/FindLibgsasl.cmake \ + CMake/FindLibidn2.cmake \ + CMake/FindLibpsl.cmake \ + CMake/FindLibrtmp.cmake \ + CMake/FindLibssh.cmake \ + CMake/FindLibssh2.cmake \ + CMake/FindLibuv.cmake \ + CMake/FindMSH3.cmake \ + CMake/FindMbedTLS.cmake \ + CMake/FindNGHTTP2.cmake \ + CMake/FindNGHTTP3.cmake \ + CMake/FindNGTCP2.cmake \ + CMake/FindNettle.cmake \ + CMake/FindQuiche.cmake \ + CMake/FindRustls.cmake \ + CMake/FindWolfSSH.cmake \ + CMake/FindWolfSSL.cmake \ + CMake/FindZstd.cmake \ + CMake/Macros.cmake \ + CMake/OtherTests.cmake \ + CMake/PickyWarnings.cmake \ + CMake/Utilities.cmake \ + CMake/unix-cache.cmake \ + CMake/win32-cache.cmake \ + CMakeLists.txt \ + tests/cmake/CMakeLists.txt \ + tests/cmake/test.c \ + tests/cmake/test.sh + +VC_DIST = projects/README.md projects/generate.bat +WINBUILD_DIST = winbuild/README.md \ + winbuild/MakefileBuild.vc winbuild/Makefile.vc winbuild/makedebug.bat + +PLAN9_DIST = plan9/include/mkfile \ + plan9/include/mkfile \ + plan9/mkfile.proto \ + plan9/mkfile \ + plan9/README \ + plan9/lib/mkfile.inc \ + plan9/lib/mkfile \ + plan9/src/mkfile.inc \ + plan9/src/mkfile + +EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile \ + $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) $(PLAN9_DIST) + +DISTCLEANFILES = buildinfo.txt bin_SCRIPTS = curl-config -SUBDIRS = lib src -DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs +SUBDIRS = lib docs src scripts +DIST_SUBDIRS = $(SUBDIRS) tests packages include docs pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc -LIB_VAUTH_CFILES = vauth/vauth.c vauth/cleartext.c vauth/cram.c \ - vauth/digest.c vauth/digest_sspi.c vauth/krb5_gssapi.c \ - vauth/krb5_sspi.c vauth/ntlm.c vauth/ntlm_sspi.c vauth/oauth2.c \ - vauth/spnego_gssapi.c vauth/spnego_sspi.c - -LIB_VAUTH_HFILES = vauth/vauth.h vauth/digest.h vauth/ntlm.h -LIB_VTLS_CFILES = vtls/openssl.c vtls/gtls.c vtls/vtls.c vtls/nss.c \ - vtls/polarssl.c vtls/polarssl_threadlock.c vtls/axtls.c \ - vtls/cyassl.c vtls/schannel.c vtls/darwinssl.c vtls/gskit.c \ - vtls/mbedtls.c - -LIB_VTLS_HFILES = vtls/openssl.h vtls/vtls.h vtls/gtls.h \ - vtls/nssg.h vtls/polarssl.h vtls/polarssl_threadlock.h vtls/axtls.h \ - vtls/cyassl.h vtls/schannel.h vtls/darwinssl.h vtls/gskit.h \ - vtls/mbedtls.h - -LIB_CFILES = file.c timeval.c base64.c hostip.c progress.c formdata.c \ - cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \ - ldap.c version.c getenv.c escape.c mprintf.c telnet.c netrc.c \ - getinfo.c transfer.c strcase.c easy.c security.c curl_fnmatch.c \ - fileinfo.c ftplistparser.c wildcard.c krb5.c memdebug.c http_chunks.c \ - strtok.c connect.c llist.c hash.c multi.c content_encoding.c share.c \ - http_digest.c md4.c md5.c http_negotiate.c inet_pton.c strtoofft.c \ - strerror.c amigaos.c hostasyn.c hostip4.c hostip6.c hostsyn.c \ - inet_ntop.c parsedate.c select.c tftp.c splay.c strdup.c socks.c \ - ssh.c curl_addrinfo.c socks_gssapi.c socks_sspi.c \ - curl_sspi.c slist.c nonblock.c curl_memrchr.c imap.c pop3.c smtp.c \ - pingpong.c rtsp.c curl_threads.c warnless.c hmac.c curl_rtmp.c \ - openldap.c curl_gethostname.c gopher.c idn_win32.c \ - http_proxy.c non-ascii.c asyn-ares.c asyn-thread.c curl_gssapi.c \ - http_ntlm.c curl_ntlm_wb.c curl_ntlm_core.c curl_sasl.c rand.c \ - curl_multibyte.c hostcheck.c conncache.c pipeline.c dotdot.c \ - x509asn1.c http2.c smb.c curl_endian.c curl_des.c system_win32.c \ - mime.c - -LIB_HFILES = arpa_telnet.h netrc.h file.h timeval.h hostip.h progress.h \ - formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h if2ip.h \ - speedcheck.h urldata.h curl_ldap.h escape.h telnet.h getinfo.h \ - strcase.h curl_sec.h memdebug.h http_chunks.h curl_fnmatch.h \ - wildcard.h fileinfo.h ftplistparser.h strtok.h connect.h llist.h \ - hash.h content_encoding.h share.h curl_md4.h curl_md5.h http_digest.h \ - http_negotiate.h inet_pton.h amigaos.h strtoofft.h strerror.h \ - inet_ntop.h curlx.h curl_memory.h curl_setup.h transfer.h select.h \ - easyif.h multiif.h parsedate.h tftp.h sockaddr.h splay.h strdup.h \ - socks.h ssh.h curl_base64.h curl_addrinfo.h curl_sspi.h \ - slist.h nonblock.h curl_memrchr.h imap.h pop3.h smtp.h pingpong.h \ - rtsp.h curl_threads.h warnless.h curl_hmac.h curl_rtmp.h \ - curl_gethostname.h gopher.h http_proxy.h non-ascii.h asyn.h \ - http_ntlm.h curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h \ - curl_sasl.h curl_multibyte.h hostcheck.h conncache.h \ - curl_setup_once.h multihandle.h setup-vms.h pipeline.h dotdot.h \ - x509asn1.h http2.h sigpipe.h smb.h curl_endian.h curl_des.h \ - curl_printf.h system_win32.h rand.h mime.h - -LIB_RCFILES = libcurl.rc -CSOURCES = $(LIB_CFILES) $(LIB_VAUTH_CFILES) $(LIB_VTLS_CFILES) -HHEADERS = $(LIB_HFILES) $(LIB_VAUTH_HFILES) $(LIB_VTLS_HFILES) - -# libcurl has sources that provide functions named curlx_* that aren't part of -# the official API, but we re-use the code here to avoid duplication. -CURLX_CFILES = \ - ../lib/strtoofft.c \ - ../lib/nonblock.c \ - ../lib/warnless.c - -CURLX_HFILES = \ - ../lib/curl_setup.h \ - ../lib/strtoofft.h \ - ../lib/nonblock.h \ - ../lib/warnless.h - -CURL_CFILES = \ - slist_wc.c \ - tool_binmode.c \ - tool_bname.c \ - tool_cb_dbg.c \ - tool_cb_hdr.c \ - tool_cb_prg.c \ - tool_cb_rea.c \ - tool_cb_see.c \ - tool_cb_wrt.c \ - tool_cfgable.c \ - tool_convert.c \ - tool_dirhie.c \ - tool_doswin.c \ - tool_easysrc.c \ - tool_formparse.c \ - tool_getparam.c \ - tool_getpass.c \ - tool_help.c \ - tool_helpers.c \ - tool_homedir.c \ - tool_hugehelp.c \ - tool_libinfo.c \ - tool_main.c \ - tool_metalink.c \ - tool_msgs.c \ - tool_operate.c \ - tool_operhlp.c \ - tool_panykey.c \ - tool_paramhlp.c \ - tool_parsecfg.c \ - tool_strdup.c \ - tool_setopt.c \ - tool_sleep.c \ - tool_urlglob.c \ - tool_util.c \ - tool_vms.c \ - tool_writeout.c \ - tool_xattr.c - -CURL_HFILES = \ - slist_wc.h \ - tool_binmode.h \ - tool_bname.h \ - tool_cb_dbg.h \ - tool_cb_hdr.h \ - tool_cb_prg.h \ - tool_cb_rea.h \ - tool_cb_see.h \ - tool_cb_wrt.h \ - tool_cfgable.h \ - tool_convert.h \ - tool_dirhie.h \ - tool_doswin.h \ - tool_easysrc.h \ - tool_formparse.h \ - tool_getparam.h \ - tool_getpass.h \ - tool_help.h \ - tool_helpers.h \ - tool_homedir.h \ - tool_hugehelp.h \ - tool_libinfo.h \ - tool_main.h \ - tool_metalink.h \ - tool_msgs.h \ - tool_operate.h \ - tool_operhlp.h \ - tool_panykey.h \ - tool_paramhlp.h \ - tool_parsecfg.h \ - tool_sdecls.h \ - tool_setopt.h \ - tool_setup.h \ - tool_sleep.h \ - tool_strdup.h \ - tool_urlglob.h \ - tool_util.h \ - tool_version.h \ - tool_vms.h \ - tool_writeout.h \ - tool_xattr.h - -CURL_RCFILES = curl.rc - -# curl_SOURCES is special and gets assigned in src/Makefile.am -CURL_FILES = $(CURL_CFILES) $(CURLX_CFILES) $(CURL_HFILES) all: all-recursive .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/lib/Makefile.inc $(srcdir)/src/Makefile.inc $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -812,10 +528,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; -$(srcdir)/lib/Makefile.inc $(srcdir)/src/Makefile.inc $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -1000,8 +715,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -1084,6 +801,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -1126,6 +847,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -1141,7 +864,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -1222,11 +945,11 @@ install-strip: mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1245,6 +968,8 @@ dvi: dvi-recursive dvi-am: +html: html-recursive + html-am: info: info-recursive @@ -1290,6 +1015,8 @@ mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool +pdf: pdf-recursive + pdf-am: ps: ps-recursive @@ -1306,8 +1033,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool clean-local cscope cscopelist-am ctags ctags-am \ dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzip \ - dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ - distclean-generic distclean-libtool distclean-tags \ + dist-shar dist-tarZ dist-xz dist-zip dist-zstd distcheck \ + distclean distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binSCRIPTS \ install-data install-data-am install-data-hook install-dvi \ @@ -1324,27 +1051,25 @@ uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA .PRECIOUS: Makefile -# List of files required to generate VC IDE .dsp, .vcproj and .vcxproj files - dist-hook: rm -rf $(top_builddir)/tests/log find $(distdir) -name "*.dist" -exec rm {} \; - (distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \ + (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) -html: - cd docs && $(MAKE) html - -pdf: - cd docs && $(MAKE) pdf - check: test examples check-docs @CROSSCOMPILING_TRUE@test-full: test +@CROSSCOMPILING_TRUE@test-nonflaky: test @CROSSCOMPILING_TRUE@test-torture: test +@CROSSCOMPILING_TRUE@test-event: test +@CROSSCOMPILING_TRUE@test-am: test +@CROSSCOMPILING_TRUE@test-ci: test +@CROSSCOMPILING_TRUE@pytest: test +@CROSSCOMPILING_TRUE@pytest-ci: test @CROSSCOMPILING_TRUE@test: @CROSSCOMPILING_TRUE@ @echo "NOTICE: we can't run the tests when cross-compiling!" @@ -1367,21 +1092,21 @@ check: test examples check-docs @CROSSCOMPILING_FALSE@test-am: @CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all am-test) +@CROSSCOMPILING_FALSE@test-ci: +@CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all ci-test) + +@CROSSCOMPILING_FALSE@pytest: +@CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all default-pytest) + +@CROSSCOMPILING_FALSE@pytest-ci: +@CROSSCOMPILING_FALSE@ @(cd tests; $(MAKE) all ci-pytest) + examples: @(cd docs/examples; $(MAKE) check) check-docs: @(cd docs/libcurl; $(MAKE) check) -# This is a hook to have 'make clean' also clean up the docs and the tests -# dir. The extra check for the Makefiles being present is necessary because -# 'make distcheck' will make clean first in these directories _before_ it runs -# this hook. -clean-local: - @(if test -f tests/Makefile; then cd tests; $(MAKE) clean; fi) - @(if test -f docs/Makefile; then cd docs; $(MAKE) clean; fi) - -# # Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros # must contain the following line: # %_topdir /home/loic/local/rpm @@ -1408,372 +1133,43 @@ rpm: mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \ mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm . -# -# Build a Solaris pkgadd format file -# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format -# file (which ends up back in this directory). -# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do -# pkgadd -d ./HAXXcurl-* -# - -# gak - libtool requires an absolute directory, hence the pwd below... -pkgadd: - umask 022 ; \ - $(MAKE) install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \ - cat COPYING > $(srcdir)/packages/Solaris/copyright ; \ - cd $(srcdir)/packages/Solaris && $(MAKE) package - -# -# Build a cygwin binary tarball installation file -# resulting .tar.bz2 file will end up at packages/Win32/cygwin -cygwinbin: - $(MAKE) -C packages/Win32/cygwin cygwinbin - # We extend the standard install with a custom hook: -install-data-hook: - cd include && $(MAKE) install - cd docs && $(MAKE) install - cd docs/libcurl && $(MAKE) install +@BUILD_DOCS_TRUE@install-data-hook: +@BUILD_DOCS_TRUE@ (cd include && $(MAKE) install) +@BUILD_DOCS_TRUE@ (cd docs && $(MAKE) install) +@BUILD_DOCS_TRUE@ (cd docs/libcurl && $(MAKE) install) +@BUILD_DOCS_FALSE@install-data-hook: +@BUILD_DOCS_FALSE@ (cd include && $(MAKE) install) +@BUILD_DOCS_FALSE@ (cd docs && $(MAKE) install) # We extend the standard uninstall with a custom hook: uninstall-hook: - cd include && $(MAKE) uninstall - cd docs && $(MAKE) uninstall - cd docs/libcurl && $(MAKE) uninstall + (cd include && $(MAKE) uninstall) + (cd docs && $(MAKE) uninstall) + (cd docs/libcurl && $(MAKE) uninstall) -ca-bundle: lib/mk-ca-bundle.pl +ca-bundle: $(srcdir)/scripts/mk-ca-bundle.pl @echo "generating a fresh ca-bundle.crt" - @perl $< -b -l -u lib/ca-bundle.crt + @perl $(srcdir)/scripts/mk-ca-bundle.pl -b -l -u lib/ca-bundle.crt -ca-firefox: lib/firefox-db2pem.sh +ca-firefox: $(srcdir)/scripts/firefox-db2pem.sh @echo "generating a fresh ca-bundle.crt" - ./lib/firefox-db2pem.sh lib/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 - -.PHONY: vc-ide - -vc-ide: $(VC6_LIBDSP_DEPS) $(VC6_SRCDSP_DEPS) $(VC7_LIBVCPROJ_DEPS) \ - $(VC7_SRCVCPROJ_DEPS) $(VC71_LIBVCPROJ_DEPS) $(VC71_SRCVCPROJ_DEPS) \ - $(VC8_LIBVCPROJ_DEPS) $(VC8_SRCVCPROJ_DEPS) $(VC9_LIBVCPROJ_DEPS) \ - $(VC9_SRCVCPROJ_DEPS) $(VC10_LIBVCXPROJ_DEPS) $(VC10_SRCVCXPROJ_DEPS) \ - $(VC11_LIBVCXPROJ_DEPS) $(VC11_SRCVCXPROJ_DEPS) $(VC12_LIBVCXPROJ_DEPS) \ - $(VC12_SRCVCXPROJ_DEPS) $(VC14_LIBVCXPROJ_DEPS) $(VC14_SRCVCXPROJ_DEPS) - @(win32_lib_srcs='$(LIB_CFILES)'; \ - win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \ - win32_lib_rc='$(LIB_RCFILES)'; \ - win32_lib_vauth_srcs='$(LIB_VAUTH_CFILES)'; \ - win32_lib_vauth_hdrs='$(LIB_VAUTH_HFILES)'; \ - win32_lib_vtls_srcs='$(LIB_VTLS_CFILES)'; \ - win32_lib_vtls_hdrs='$(LIB_VTLS_HFILES)'; \ - win32_src_srcs='$(CURL_CFILES)'; \ - win32_src_hdrs='$(CURL_HFILES)'; \ - win32_src_rc='$(CURL_RCFILES)'; \ - win32_src_x_srcs='$(CURLX_CFILES)'; \ - win32_src_x_hdrs='$(CURLX_HFILES) ../lib/config-win32.h'; \ - \ - sorted_lib_srcs=`for file in $$win32_lib_srcs; do echo $$file; done | sort`; \ - sorted_lib_hdrs=`for file in $$win32_lib_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vauth_srcs=`for file in $$win32_lib_vauth_srcs; do echo $$file; done | sort`; \ - sorted_lib_vauth_hdrs=`for file in $$win32_lib_vauth_hdrs; do echo $$file; done | sort`; \ - sorted_lib_vtls_srcs=`for file in $$win32_lib_vtls_srcs; do echo $$file; done | sort`; \ - sorted_lib_vtls_hdrs=`for file in $$win32_lib_vtls_hdrs; do echo $$file; done | sort`; \ - sorted_src_srcs=`for file in $$win32_src_srcs; do echo $$file; done | sort`; \ - sorted_src_hdrs=`for file in $$win32_src_hdrs; do echo $$file; done | sort`; \ - sorted_src_x_srcs=`for file in $$win32_src_x_srcs; do echo $$file; done | sort`; \ - sorted_src_x_hdrs=`for file in $$win32_src_x_hdrs; do echo $$file; done | sort`; \ - \ - awk_code='\ -function gen_element(type, dir, file)\ -{\ - sub(/vauth\//, "", file);\ - sub(/vtls\//, "", file);\ -\ - spaces=" ";\ - if(dir == "lib\\vauth" || dir == "lib\\vtls")\ - tabs=" ";\ - else\ - tabs=" ";\ -\ - if(type == "dsp") {\ - printf("# Begin Source File\r\n");\ - printf("\r\n");\ - printf("SOURCE=..\\..\\..\\..\\%s\\%s\r\n", dir, file);\ - printf("# End Source File\r\n");\ - }\ - else if(type == "vcproj1") {\ - printf("%s\r\n",\ - tabs, dir, file);\ - printf("%s\r\n", tabs);\ - }\ - else if(type == "vcproj2") {\ - printf("%s\r\n", tabs);\ - printf("%s\r\n", tabs);\ - }\ - else if(type == "vcxproj") {\ - i = index(file, ".");\ - ext = substr(file, i == 0 ? 0 : i + 1);\ -\ - if(ext == "c")\ - printf("%s\r\n",\ - spaces, dir, file);\ - else if(ext == "h")\ - printf("%s\r\n",\ - spaces, dir, file);\ - else if(ext == "rc")\ - printf("%s\r\n",\ - spaces, dir, file);\ - }\ -}\ -\ -{\ -\ - if($$0 == "CURL_LIB_C_FILES") {\ - split(lib_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_H_FILES") {\ - split(lib_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_RC_FILES") {\ - split(lib_rc, arr);\ - for(val in arr) gen_element(proj_type, "lib", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VAUTH_C_FILES") {\ - split(lib_vauth_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VAUTH_H_FILES") {\ - split(lib_vauth_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vauth", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VTLS_C_FILES") {\ - split(lib_vtls_srcs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\ - }\ - else if($$0 == "CURL_LIB_VTLS_H_FILES") {\ - split(lib_vtls_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "lib\\vtls", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_C_FILES") {\ - split(src_srcs, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_H_FILES") {\ - split(src_hdrs, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_RC_FILES") {\ - split(src_rc, arr);\ - for(val in arr) gen_element(proj_type, "src", arr[val]);\ - }\ - else if($$0 == "CURL_SRC_X_C_FILES") {\ - split(src_x_srcs, arr);\ - for(val in arr) {\ - sub(/..\/lib\//, "", arr[val]);\ - gen_element(proj_type, "lib", arr[val]);\ - }\ - }\ - else if($$0 == "CURL_SRC_X_H_FILES") {\ - split(src_x_hdrs, arr);\ - for(val in arr) {\ - sub(/..\/lib\//, "", arr[val]);\ - gen_element(proj_type, "lib", arr[val]);\ - }\ - }\ - else\ - printf("%s\r\n", $$0);\ -}';\ - \ - echo "generating '$(VC6_LIBDSP)'"; \ - awk -v proj_type=dsp \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC6_LIBTMPL) > $(VC6_LIBDSP) || { exit 1; }; \ - \ - echo "generating '$(VC6_SRCDSP)'"; \ - awk -v proj_type=dsp \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC6_SRCTMPL) > $(VC6_SRCDSP) || { exit 1; }; \ - \ - echo "generating '$(VC7_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC7_LIBTMPL) > $(VC7_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC7_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC7_SRCTMPL) > $(VC7_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC71_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC71_LIBTMPL) > $(VC71_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC71_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj1 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC71_SRCTMPL) > $(VC71_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC8_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC8_LIBTMPL) > $(VC8_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC8_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC8_SRCTMPL) > $(VC8_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC9_LIBVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC9_LIBTMPL) > $(VC9_LIBVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC9_SRCVCPROJ)'"; \ - awk -v proj_type=vcproj2 \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC9_SRCTMPL) > $(VC9_SRCVCPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC10_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC10_LIBTMPL) > $(VC10_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC10_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC10_SRCTMPL) > $(VC10_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC11_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC11_LIBTMPL) > $(VC11_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC11_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC11_SRCTMPL) > $(VC11_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC12_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC12_LIBTMPL) > $(VC12_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC12_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_LIBVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v lib_srcs="$$sorted_lib_srcs" \ - -v lib_hdrs="$$sorted_lib_hdrs" \ - -v lib_rc="$$win32_lib_rc" \ - -v lib_vauth_srcs="$$sorted_lib_vauth_srcs" \ - -v lib_vauth_hdrs="$$sorted_lib_vauth_hdrs" \ - -v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \ - -v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_LIBTMPL) > $(VC14_LIBVCXPROJ) || { exit 1; }; \ - \ - echo "generating '$(VC14_SRCVCXPROJ)'"; \ - awk -v proj_type=vcxproj \ - -v src_srcs="$$sorted_src_srcs" \ - -v src_hdrs="$$sorted_src_hdrs" \ - -v src_rc="$$win32_src_rc" \ - -v src_x_srcs="$$sorted_src_x_srcs" \ - -v src_x_hdrs="$$sorted_src_x_hdrs" \ - "$$awk_code" $(srcdir)/$(VC14_SRCTMPL) > $(VC14_SRCVCXPROJ) || { exit 1; };) + (cd lib && $(MAKE) checksrc) + (cd src && $(MAKE) checksrc) + (cd tests && $(MAKE) checksrc) + (cd include/curl && $(MAKE) checksrc) + (cd docs/examples && $(MAKE) checksrc) + (cd packages && $(MAKE) checksrc) + +tidy: + (cd src && $(MAKE) tidy) + (cd lib && $(MAKE) tidy) + +clean-local: + (cd tests && $(MAKE) clean) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/curl/README b/curl/README index f0b3b9393..f5efbd70a 100644 --- a/curl/README +++ b/curl/README @@ -13,34 +13,40 @@ README 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! + learn how. You find answers to the most frequent questions we get in the FAQ document. - Study the COPYING file for distribution terms and similar. If you distribute - curl binaries or other binaries that involve libcurl, you might enjoy the - LICENSE-MIXING 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.haxx.se/mail/ + by posting to a suitable mailing list. See https://curl.se/mail/ All contributors to the project are listed in the THANKS document. -WEB SITE +WEBSITE - Visit the curl web site for the latest news and downloads: + Visit the curl website for the latest news and downloads: - https://curl.haxx.se/ + https://curl.se/ GIT - To download the very latest source off the GIT server do this: + To download the latest source code off the GIT server, do this: git clone https://github.com/curl/curl.git - (you'll get a directory named curl created, filled with the source code) + (you will get a directory named curl created, filled with the source code) + +SECURITY PROBLEMS + + Report suspected security problems via our HackerOne page and not in public. + + https://hackerone.com/curl NOTICE diff --git a/curl/RELEASE-NOTES b/curl/RELEASE-NOTES index 7da35d2eb..89656f85a 100644 --- a/curl/RELEASE-NOTES +++ b/curl/RELEASE-NOTES @@ -1,115 +1,510 @@ -Curl and libcurl 7.56.1 +curl and libcurl 8.15.0 - Public curl releases: 170 - Command line options: 211 - curl_easy_setopt() options: 249 - Public functions in libcurl: 74 - Contributors: 1626 + Public curl releases: 269 + Command line options: 269 + curl_easy_setopt() options: 308 + Public functions in libcurl: 96 + Contributors: 3460 + +This release includes the following changes: + + o TLS: remove support for Secure Transport and BearSSL [19] This release includes the following bugfixes: - o imap: if a FETCH response has no size, don't call write callback [32] - o ftp: UBsan fixup 'pointer index expression overflowed [1] - o failf: skip the sprintf() if there are no consumers [2] - o fuzzer: move to using external curl-fuzzer [3] - o lib/Makefile.m32: allow customizing dll suffixes [4] - o docs: fix typo in curl_mime_data_cb man page [5] - o darwinssl: add support for TLSv1.3 [6] - o build: fix --disable-crypto-auth [7] - o lib/config-win32.h: let SMB/SMBS be enabled with OpenSSL/NSS [8] - o openssl: fix build without HAVE_OPAQUE_EVP_PKEY [9] - o strtoofft: Remove extraneous null check [10] - o multi_cleanup: call DONE on handles that never got that [11] - o tests: added flaky keyword to tests 587 and 644 - o pingpong: return error when trying to send without connection [12] - o remove_handle: call multi_done() first, then clear dns cache pointer [13] - o mime: be tolerant about setting twice the same header list in a part. - o mime: improve unbinding top multipart from easy handle. - o mime: avoid resetting a part's encoder when part's contents change. - o mime: refuse to add subparts to one of their own descendants [14] - o RTSP: avoid integer overflow on funny RTSP responses [15] - o curl: don't pass semicolons when parsing Content-Disposition [16] - o openssl: enable PKCS12 support for !BoringSSL [17] - o FAQ: s/CURLOPT_PROGRESSFUNCTION/CURLOPT_XFERINFOFUNCTION - o CURLOPT_NOPROGRESS.3: also refer to xferinfofunction - o CURLOPT_XFERINFODATA.3: fix duplicate see also - o test298: verify --ftp-method nowcwd with URL encoded path [18] - o FTP: URL decode path for dir listing in nocwd mode [19] - o smtp_done: fix memory leak on send failure [20] - o ftpserver: support case insensitive commands - o test950; verify SMTP with custom request - o openssl: don't use old BORINGSSL_YYYYMM macros [21] - o setopt: update current connection SSL verify params [22] - o winbuild/BUILD.WINDOWS.txt: mention WITH_NGHTTP2 - o curl: reimplement stdin buffering in -F option [23] - o mime: keep "text/plain" content type if user-specified [24] - o mime: fix the content reader to handle >16K data properly [25] - o configure: remove the C++ compiler check [26] - o memdebug: trace send, recv and socket [27] - o runtests: use valgrind for torture as well - o ldap: silence clang warning [28] - o makefile.m32: allow to override gcc, ar and ranlib [29] - o setopt: avoid integer overflows when setting millsecond values [30] - o setopt: range check most long options [31] - o ftp: reject illegal IP/port in PASV 227 response [33] - o mime: do not reuse previously computed multipart size [34] - o vtls: change struct Curl_ssl `close' field name to `close_one' - o os400: add missing symbols in config file - o mime: limit bas64-encoded lines length to 76 characters - o mk-ca-bundle: Remove URL for aurora [35] - o mk-ca-bundle: Fix URL for NSS [36] + o altsvc: accept 'clear' without semicolon as well [190] + o asyn-ares: remove redundant NULL check [152] + o asyn-thrdd: free the previous name before strdup'ing the new [84] + o autotools: detect and link `brotlicommon` library for brotli [130] + o autotools: drop `$top_builddir/src` from src header path [23] + o autotools: drop headers from src mk-unity rules (fixup) [136] + o autotools: drop no longer necessary `--srcdir` unity options [66] + o autotools: drop redundant `Makefile.inc` from `EXTRA_DIST` in src [127] + o autotools: simplify configuration in tests, examples [47] + o bufq: change read/write signatures [120] + o bufq: remove the unused Curl_bufq_unwrite function [143] + o build: assume `sys/socket.h`, `sys/time.h` on non-Windows (as in `curl/curl.h`) [21] + o build: drop `HAVE_SYS_SOCKET_H` and `HAVE_SYS_TIME_H` macros [69] + o build: drop explicit curlx from hdr paths, refer headers with `curlx/` prefix [150] + o build: drop unused variables in tests + o build: fix libcurltool with cmake and tunits, related tidy-ups [138] + o build: split `.c` and `.h` file lists in tests [128] + o build: stop checking for `sys/stat.h` [146] + o build: stubgss tidy-ups (in tests) [137] + o build: sync build scripts between client/libtest [49] + o build: tidy up `Makefile.inc` use in lib and src [116] + o build: tidy up header paths, use srcdir where possible [42] + o cf-socket: make socket data_pending a nop [175] + o checksrc-all: rewrite in Perl, remove `checksrc.bat` [217] + o checksrc: reduce exceptions, apply again to curlx [114] + o cmake/FindGSS: fix processing C header path options [160] + o cmake/FindGSS: initialize result variables [159] + o cmake: `curl_add_clang_tidy_test_target` tidy-ups [185] + o cmake: build `stubgss` library for libtests to match autotools [34] + o cmake: check USE_WINDOWS_SSPI when adding secur32 to CURL_LIBS [144] + o cmake: configure c-ares header directory in project root (was: lib) [106] + o cmake: document OpenSSL and ngtcp2 crypto lib custom variables [29] + o cmake: drop never propagated C macros [22] + o cmake: drop passing redundant `CURL_STATICLIB` in examples and clients [52] + o cmake: drop redundant macro from test clients [51] + o cmake: drop reference to future variable + o cmake: enable soversion by default for OpenHarmony OS [131] + o cmake: fix `curl_add_clang_tidy_test_target` when no `-D` option [155] + o cmake: fix generator expression in docs/examples [109] + o cmake: gather options recursively in `curl_add_clang_tidy_test_target` [156] + o cmake: make docs depend on support files [80] + o cmake: move `OUTPUT` argument in the `add_custom_command()` line [50] + o cmake: omit clang-tidy on internal libs curlu and curltool [64] + o cmake: replace `cmakelint` with `cmake-lint` from `cmakelang`, fix issues [20] + o cmake: replace the way clang-tidy verifies tests, fix issues found [101] + o cmake: simplify handling generated `lib1521.c` in libtests [24] + o cmake: sync `target_link_libraries()` order in tests more [44] + o cmake: sync tests scripts by using the variable `BUNDLE` [46] + o cmake: sync tests scripts with each other and autotools (more) [100] + o cmake: use `target_link_options()` when available [43] + o config-win32: fix default targets, shorten macro logic [227] + o configure: order LDAP after the SSL libraries + o connect: drop unused struct member [209] + o connection: clarify `transport` [197] + o connection: eliminate member `remote_addr` [10] + o curl-config: fix whitespace in usage text [122] + o curl.h: make CURL_IPRESOLVE_* symbols defined as longs [206] + o curl.h: make CURLSSLOPT_* symbols defined as longs [3] + o curl.h: remove the "RESERVED" error codes [2] + o curl: implement non-blocking STDIN read on Windows [28] + o curl: improve non-blocking STDIN performance [129] + o curl: remove the global argument from many functions [218] + o curl: unify pointer names to global config [219] + o curl_get_line: make sure lines end with newline [110] + o curl_memory.h: fix to undefine `accept4` [180] + o curl_path: make SFTP handle a path like /~ properly. [11] + o curlinfo: provide the 'digest' feature [168] + o CURLSHOPT_SHARE.md: mention multi-threading requires callbacks [161] + o DEPRECATE.md: add VS2005 removal to the list [214] + o digest: fix build with disabled digest auth [72] + o DISTROS: update NixOS link + o docs,tests: fix english grammar "allow to" -> "allow to" [158] + o docs/CONTRIBUTE: fix broken link [173] + o docs/examples: add ftp-delete.c [5] + o docs: beef up examples/websocket.c [189] + o docs: fix broken link in CODE_REVIEW.md [67] + o docs: fix broken link in INSTALL.md [68] + o docs: fix docs for CURLOPT_PREQUOTE after #17616 [70] + o docs: fix documentation of connect_only 2 [78] + o docs: fix two typos [163] + o docs: mention that the netrc file works without port numbers [112] + o docs: mention the as-is concept generically [225] + o docs: note SSLS-EXPORT feature in -ssl-sessions doc [199] + o docs: reflect that delimiter-separated capath is only OpenSSL [135] + o docs: sync -tls-earlydata support w/ CURLOPT_SSL_OPTIONS [198] + o docs: warn about lifetime in CURLOPT_CLOSESOCKET* [54] + o easy: fix comment-documentation [36] + o easygetopt: fix curl logo in header comment [167] + o firefox-db2pem: avoid use of eval in script [103] + o ftp: fix prequotes for a directory in URL [83] + o ftplistparser: split parse_unix into sub functions [77] + o h2_serverpush: fix file handle leaks reported by clang-tidy [105] + o h3: fix query of concurrent streams [220] + o http/3: report handshake with version and cipher as for TCP connections [212] + o http2: do not delay RST send on aborted transfer [57] + o http2: fix var types in is_alive() implementations [222] + o http: explicitly ignore parsing errors for Retry-After [98] + o http: fix build with cookies and HSTS disabled [124] + o http_ntlm: protect against null deref [95] + o http_ntlm: remove unreachable code [88] + o INSTALL.md: cygwin details and add source code link [4] + o ldap: avoid automake caching issues with LDAP library names + o ldap: if ldap-lib is sufficient, add it to LIBS. + o ldap: initial support for --with-ldap option + o lib2082: drop `typedef struct` [118] + o lib: address singleuse issues [132] + o lib: avoid reusing unclean connection [73] + o lib: drop two interim macros in favor of native libcurl API calls [172] + o lib: fix unused parameter/function compiler warnings [186] + o lib: make `CURLX_SET_BINMODE()` and use it [39] + o lib: make `curlx_wait_ms()` and use it [40] + o lib: replace scache no-op macros with `#ifdef` [117] + o lib: stop `time()` debug overrides at the end of source in altsvc, hsts [211] + o lib: unify recv/send function signatures [92] + o libcurl-env.md: drop LOGNAME, USER and NTLMUSER [99] + o libcurl.m4: fix indentation [194] + o libssh2: remove use of 'initialised' for cleanup [208] + o libssh: de-complex myssh_statemach_act() [18] + o libssh: fix readdir issues [191] + o libtests: make test 1503,1504,1505 use the 1502 binary [90] + o libtests: more header tidy-ups [224] + o libtests: stop building the sames source multiple times [89] + o memdebug.h: #undef `fclose` before defining it + o memdebug.h: eliminate global macro `CURL_MT_LOGFNAME_BUFSIZE` [178] + o memdebug: include in unity batch [63] + o memory: stop overriding unused `wcsdup()`/`_wcsdup()` system functions [204] + o memory: tidy up `_tcsdup()` override [202] + o misc: fix typos [207] + o mk-lib1521: replace `printf` with `curl_mprintf` [141] + o multi: add dirty bitset [115] + o multi: do no expire a blocked transfer [56] + o multi: fix polling with pending input [60] + o multi: remove careful bounds check as coverity says it is not needed [174] + o multi: xfer table/bitset, handle limits [142] + o ngtcp2: fix coverity warning about result handling [166] + o openssl: enable readahead [91] + o openssl: error on SSL_ERROR_SYSCALL [94] + o openssl: fix handling of buffered data [82] + o openssl: fix openssl engine use [74] + o openssl: fix pkcs11 provider available check [154] + o os400: upgrade ILE/RPG bindings with latest definitions. [184] + o pingpong: on disconnect, check for unflushed pingpong state [12] + o projects/build-openssl.bat: remove [223] + o pytest test_07_70, weaken early data check [96] + o pytest: adapt for runs with openssl-1.1.1 + o pytest: disable test_07_37 and test_07_36 with openssl's quic [1] + o quic: implement CURLINFO_TLS_SSL_PTR [176] + o RELEASE-PROCEDURE.md: update docs/VERSIONS [7] + o runtests.pl: fix sprintf() using one too many %s [134] + o runtests: fix `LD_PRELOAD` detection for cmake-built curl binaries [123] + o runtests: support memory-limits per test [193] + o rustls: apply memory function overrides, fixing an ECH buffer free [181] + o rustls: don't try printing the not provided file [104] + o schannel: allow partial chains for manual peer verification [79] + o schannel: drop Windows 2000 compatibility logic [26] + o scorecard: flame graphs and documentation [165] + o SCP/SFTP: avoid busy loop after EAGAIN [8] + o scripts: fix to quote the copyright email address [210] + o socks: fix query when filter context is null [221] + o system.h: remove some macros [6] + o test1117: reduce write delays [9] + o test1175: fix to run, and fix documentation issues detected [216] + o test1222: fix for out-of-tree and no-libcurl-manual builds [215] + o test1499, 1599: use `%LOGDIR` [226] + o test1499: verify two chunked responses on reused connection [145] + o test1596: let test pass after year 2036 [35] + o test1706: pass include directory to `managen` for out-of-tree builds [187] + o tests/client: drop autotools logic no longer necessary [45] + o tests/client: use `curl_mfprintf()` [48] + o tests/dnsd: read config from file [85] + o tests/http/clients: drop hack and use `curl_setup.h` again [58] + o tests/http/clients: move to tests/client [53] + o tests/http/requirements: remove multipart [183] + o tests/libtest: call `curlx_now_init()` for unit 1399, 2600 (Windows) [76] + o tests/libtest: drop `TEST_HANG_TIMEOUT` redefinition hack [108] + o tests/libtest: drop a checksrc exception [119] + o tests/libtest: use `curltime` from curlx [71] + o tests/server/util.c: include netinet/in6.h [113] + o tests/server: de-dupe/merge three `sockdaemon()` clones into one [149] + o tests/server: drop `memdebug.h` [111] + o tests/server: make all global vars/funcs static [41] + o tests/server: move memory init to `memptr.c` [140] + o tests/servers.pm: add more ways to figure out current user [17] + o tests: always make bundles, adapt build and tests [81] + o tests: bundle http clients, de-dupe, enable for MSVC [61] + o tests: constify, make consts static [139] + o tests: drop `BUNDLE_SRC` variable [59] + o tests: drop mk-bundle exceptions [25] + o tests: drop unused or redundant includes [153] + o tests: drop useless "nodist_SOURCES" assignments [93] + o tests: fail torture if !valgrind&threaded resolver [31] + o tests: fix 1301, 1308 to fail on error [177] + o tests: fix `BUNDLE` variable references in `Makefile.am` [125] + o tests: make all names < 75 characters long [182] + o tests: make individual test sources compile cleanly [107] + o tests: make sshserver less verbose [55] + o tests: move `curlcheck.h` to libtest as `unitcheck.h` [171] + o tests: move GSS-API dynamic stub into debug-mode libcurl [169] + o tests: torture: don't duplicate valgrind command [32] + o tests: use %b64[] to base64 data [151] + o tests: use %b64[] to base64 data in 2056, 2057 [126] + o tftpd: use `CURLMIN()` macro [38] + o tidy-up: replace `` with `"memdebug.h"` (src, units) [147] + o tls: remove Curl_ssl false_start [86] + o tool1621: drop unused internal libcurl headers [157] + o tool_getparam: fix --ftp-pasv [15] + o tool_operate: fix return code when --retry is used but not triggered [13] + o tool_paramhelp: fix language in comments [196] + o top-complexity: lower max allowed complexity threshold to 90 [33] + o unit tests: extract "private" prototypes at build time [170] + o unit1302: expand the base64 encode/decode tests [148] + o url: fix connection lifetime checks [14] + o url: fix NULL deref with bad password when no user is provided [87] + o urlapi: simplify and split into sub functions [16] + o urlapi: use uppercase hex encoding [133] + o vauth: move auth structs to conn meta data [30] + o vtls: change send/recv signatures of tls backends [65] + o vtls: fix a copy-pasted early data comment typo [200] + o vtls: log rustls negotiated KEX group name [201] + o vtls: prefer ciphersuite to cipher in msgs [203] + o vtls: prefer rustls-ffi ciphersuite name API [205] + o VULN-DISCLOSURE-POLICY.md: fix typos [164] + o VULN-DISCLOSURE-POLICY: all reports should be disclosed [102] + o VULN-DISCLOSURE-POLICY: exclude not installed software [121] + o VULN-DISCLOSURE-POLICY: minor language polish [162] + o warnless: drop parts of the `read`/`write` preprocessor hack (Windows) [37] + o warnless: replace `read()`/`write()` wrapper functions with macros (Windows) [75] + o windows: drop redundant `curl_wcsdup_callback` callback [188] + o windows: fixup `fopen()` in `CURLDEBUG` builds [62] + o windows: reduce/stop loading DLLs at runtime [27] + o wolfssl: add support for ML_KEM hybrids [195] + o ws: drop redundant `CURL_EXTERN` from function definitions [179] + o xfer: manage pause bits [97] This release includes the following known bugs: - o see docs/KNOWN_BUGS (https://curl.haxx.se/docs/knownbugs.html) + 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 Support for the msh3 HTTP/3 backend + o Supporting curl builds using VS2008 + o The winbuild build system + o Windows CE 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: - Alexey Melnichuk, Artak Galoyan, Benbuck Nason, Brian Carpenter, - Christian Schmitz, Dan Fandrich, Daniel Stenberg, David Benjamin, - Felix Kaiser, Javier Sixto, Jeroen Ooms, Jon DeVree, Kristiyan Tsaklev, - Marcel Raad, Max Dymond, Nick Zitzmann, Patrick Monnerat, Viktor Szakáts, - Wyatt O'Day, Zenju on github, 0xd34db347 - (21 contributors) - - Thanks! (and sorry if I forgot to mention someone) + 4lan.m, afengsoft on github, albrechtd on github, Ameda Amahru, + Bartosz Ruszczak, behindtheblackwall on hackerone, Bernhard M. Wiedemann, + Brad Harder, Brian Harris, Calvin Ruocco, Carlos Henrique Lima Melara, + Christian Hesse, Christian Weisgerber, Christopher Boyd, Dan Fandrich, + Daniel Gustafsson, Daniel McCarney, Daniel Stenberg, defnull, DoI, + Edwin Török, Eshan Kelkar, Ethan Alker, Fabrício Canedo, fjaell on github, + hiimmat on github, Jeroen Ooms, Joel Depooter, John Haugabook, + Karthik Dasari, Keno Fischer, Kirill Obukhov, Larry Campbell, + Luca Kellermann, Luke Wilde, Marcel Lang, Marcel Raad, Markus Unterwaditzer, + Max Dymond, Michael Kaufmann, NINIKA, Orgad Shaneh, Patrick Monnerat, + Patrick Stoeckle, Piotr Nakraszewicz, Randall S. Becker, Ray Satiro, + renovate[bot], Rod Widdowson, Ryan Hooper, SC404, Stefan Eissing, + Theodore A. Roth, Tristan Perrault, Viktor Szakats, Yedaya Katsman, z2_ + (57 contributors) References to bug reports and discussions on issues: - [1] = https://curl.haxx.se/bug/?i=1939 - [2] = https://curl.haxx.se/bug/?i=1936 - [3] = https://curl.haxx.se/bug/?i=1923 - [4] = https://curl.haxx.se/bug/?i=1942 - [5] = https://curl.haxx.se/bug/?i=1946 - [6] = https://curl.haxx.se/bug/?i=1794 - [7] = https://curl.haxx.se/bug/?i=1945 - [8] = https://curl.haxx.se/bug/?i=1943 - [9] = https://curl.haxx.se/bug/?i=1955 - [10] = https://curl.haxx.se/bug/?i=1950 - [11] = https://curl.haxx.se/bug/?i=1954 - [12] = https://curl.haxx.se/bug/?i=1953 - [13] = https://curl.haxx.se/bug/?i=1960 - [14] = https://curl.haxx.se/bug/?i=1962 - [15] = https://curl.haxx.se/bug/?i=1969 - [16] = https://curl.haxx.se/bug/?i=1964 - [17] = https://curl.haxx.se/bug/?i=1948 - [18] = https://curl.haxx.se/bug/?i=1974 - [19] = https://curl.haxx.se/bug/?i=1974 - [20] = https://curl.haxx.se/bug/?i=1977 - [21] = https://curl.haxx.se/bug/?i=1979 - [22] = https://curl.haxx.se/bug/?i=1941 - [23] = https://curl.haxx.se/bug/?i=1985 - [24] = https://curl.haxx.se/bug/?i=1986 - [25] = https://curl.haxx.se/bug/?i=1988 - [26] = https://curl.haxx.se/bug/?i=1990 - [27] = https://curl.haxx.se/bug/?i=1980 - [28] = https://curl.haxx.se/bug/?i=1992 - [29] = https://curl.haxx.se/bug/?i=1993 - [30] = https://curl.haxx.se/bug/?i=1938 - [31] = https://curl.haxx.se/bug/?i=1938 - [32] = https://curl.haxx.se/docs/adv_20171023.html - [33] = https://curl.haxx.se/bug/?i=1997 - [34] = https://curl.haxx.se/bug/?i=1999 - [35] = https://curl.haxx.se/bug/?i=1998 - [36] = https://curl.haxx.se/bug/?i=1998 + [1] = https://curl.se/bug/?i=17539 + [2] = https://curl.se/bug/?i=17563 + [3] = https://curl.se/bug/?i=17535 + [4] = https://curl.se/bug/?i=17485 + [5] = https://curl.se/bug/?i=17540 + [6] = https://curl.se/bug/?i=17498 + [7] = https://curl.se/bug/?i=17584 + [8] = https://curl.se/bug/?i=17533 + [9] = https://curl.se/bug/?i=17530 + [10] = https://curl.se/bug/?i=17385 + [11] = https://curl.se/bug/?i=17534 + [12] = https://curl.se/bug/?i=17555 + [13] = https://curl.se/bug/?i=17554 + [14] = https://curl.se/bug/?i=17571 + [15] = https://curl.se/bug/?i=17545 + [16] = https://curl.se/bug/?i=17565 + [17] = https://curl.se/bug/?i=17544 + [18] = https://curl.se/bug/?i=17573 + [19] = https://curl.se/bug/?i=16677 + [20] = https://curl.se/bug/?i=17576 + [21] = https://curl.se/bug/?i=17522 + [22] = https://curl.se/bug/?i=17580 + [23] = https://curl.se/bug/?i=17679 + [24] = https://curl.se/bug/?i=17676 + [25] = https://curl.se/bug/?i=17468 + [26] = https://curl.se/bug/?i=17447 + [27] = https://curl.se/bug/?i=17413 + [28] = https://curl.se/bug/?i=17451 + [29] = https://curl.se/bug/?i=17574 + [30] = https://curl.se/bug/?i=17557 + [31] = https://curl.se/bug/?i=17501 + [32] = https://curl.se/bug/?i=17501 + [33] = https://curl.se/bug/?i=17689 + [34] = https://curl.se/bug/?i=17653 + [35] = https://curl.se/bug/?i=17665 + [36] = https://curl.se/bug/?i=17664 + [37] = https://curl.se/bug/?i=17673 + [38] = https://curl.se/bug/?i=17674 + [39] = https://curl.se/bug/?i=17672 + [40] = https://curl.se/bug/?i=17641 + [41] = https://curl.se/bug/?i=17671 + [42] = https://curl.se/bug/?i=17630 + [43] = https://curl.se/bug/?i=17670 + [44] = https://curl.se/bug/?i=17669 + [45] = https://curl.se/bug/?i=17668 + [46] = https://curl.se/bug/?i=17667 + [47] = https://curl.se/bug/?i=17661 + [48] = https://curl.se/bug/?i=17651 + [49] = https://curl.se/bug/?i=17660 + [50] = https://curl.se/bug/?i=17658 + [51] = https://curl.se/bug/?i=17657 + [52] = https://curl.se/bug/?i=17655 + [53] = https://curl.se/bug/?i=17637 + [54] = https://curl.se/bug/?i=17816 + [55] = https://curl.se/bug/?i=17647 + [56] = https://curl.se/bug/?i=17639 + [57] = https://curl.se/bug/?i=17611 + [58] = https://curl.se/bug/?i=17642 + [59] = https://curl.se/bug/?i=17692 + [60] = https://curl.se/bug/?i=17636 + [61] = https://curl.se/bug/?i=17627 + [62] = https://curl.se/bug/?i=16747 + [63] = https://curl.se/bug/?i=16746 + [64] = https://curl.se/bug/?i=17693 + [65] = https://curl.se/bug/?i=17593 + [66] = https://curl.se/bug/?i=17632 + [67] = https://curl.se/bug/?i=17656 + [68] = https://github.com/curl/curl-www/issues/427 + [69] = https://curl.se/bug/?i=17581 + [70] = https://curl.se/bug/?i=17690 + [71] = https://curl.se/bug/?i=17716 + [72] = https://curl.se/bug/?i=17612 + [73] = https://curl.se/bug/?i=17578 + [74] = https://curl.se/bug/?i=17617 + [75] = https://curl.se/bug/?i=17619 + [76] = https://curl.se/bug/?i=17714 + [77] = https://curl.se/bug/?i=17608 + [78] = https://curl.se/bug/?i=17621 + [79] = https://curl.se/bug/?i=17418 + [80] = https://curl.se/bug/?i=17620 + [81] = https://curl.se/bug/?i=17590 + [82] = https://curl.se/bug/?i=17601 + [83] = https://curl.se/bug/?i=8602 + [84] = https://curl.se/bug/?i=17602 + [85] = https://curl.se/bug/?i=17543 + [86] = https://curl.se/bug/?i=17595 + [87] = https://curl.se/bug/?i=17659 + [88] = https://curl.se/bug/?i=17587 + [89] = https://curl.se/bug/?i=17598 + [90] = https://curl.se/bug/?i=17591 + [91] = https://curl.se/bug/?i=17548 + [92] = https://curl.se/bug/?i=17546 + [93] = https://curl.se/bug/?i=17688 + [94] = https://curl.se/bug/?i=17471 + [95] = https://curl.se/bug/?i=17585 + [96] = https://curl.se/bug/?i=17575 + [97] = https://curl.se/bug/?i=17650 + [98] = https://curl.se/bug/?i=17682 + [99] = https://curl.se/bug/?i=17713 + [100] = https://curl.se/bug/?i=17711 + [101] = https://curl.se/bug/?i=17705 + [102] = https://curl.se/bug/?i=17778 + [103] = https://curl.se/bug/?i=17766 + [104] = https://curl.se/bug/?i=17704 + [105] = https://curl.se/bug/?i=17706 + [106] = https://curl.se/bug/?i=17707 + [107] = https://curl.se/bug/?i=17703 + [108] = https://curl.se/bug/?i=17702 + [109] = https://curl.se/bug/?i=17767 + [110] = https://curl.se/bug/?i=17697 + [111] = https://curl.se/bug/?i=17700 + [112] = https://curl.se/bug/?i=17698 + [113] = https://curl.se/mail/lib-2025-06/0016.html + [114] = https://curl.se/bug/?i=17764 + [115] = https://curl.se/bug/?i=17662 + [116] = https://curl.se/bug/?i=17694 + [117] = https://curl.se/bug/?i=17754 + [118] = https://curl.se/bug/?i=17763 + [119] = https://curl.se/bug/?i=17762 + [120] = https://curl.se/bug/?i=17396 + [121] = https://curl.se/bug/?i=17761 + [122] = https://curl.se/bug/?i=17758 + [123] = https://curl.se/bug/?i=17756 + [124] = https://curl.se/bug/?i=17753 + [125] = https://curl.se/bug/?i=17750 + [126] = https://curl.se/bug/?i=17748 + [127] = https://curl.se/bug/?i=17747 + [128] = https://curl.se/bug/?i=17745 + [129] = https://curl.se/bug/?i=17566 + [130] = https://curl.se/bug/?i=17678 + [131] = https://curl.se/bug/?i=17743 + [132] = https://curl.se/bug/?i=17734 + [133] = https://curl.se/bug/?i=17685 + [134] = https://curl.se/bug/?i=17740 + [135] = https://curl.se/bug/?i=17737 + [136] = https://curl.se/bug/?i=17742 + [137] = https://curl.se/bug/?i=17738 + [138] = https://curl.se/bug/?i=17727 + [139] = https://curl.se/bug/?i=17736 + [140] = https://curl.se/bug/?i=17735 + [141] = https://curl.se/bug/?i=17732 + [142] = https://curl.se/bug/?i=17731 + [143] = https://curl.se/bug/?i=17730 + [144] = https://curl.se/bug/?i=17728 + [145] = https://curl.se/bug/?i=17815 + [146] = https://curl.se/bug/?i=17724 + [147] = https://curl.se/bug/?i=17722 + [148] = https://curl.se/bug/?i=17726 + [149] = https://curl.se/bug/?i=17719 + [150] = https://curl.se/bug/?i=17680 + [151] = https://curl.se/bug/?i=17721 + [152] = https://curl.se/bug/?i=17720 + [153] = https://curl.se/bug/?i=17717 + [154] = https://curl.se/bug/?i=17804 + [155] = https://curl.se/bug/?i=17813 + [156] = https://curl.se/bug/?i=17812 + [157] = https://curl.se/bug/?i=17811 + [158] = https://curl.se/bug/?i=17787 + [159] = https://curl.se/bug/?i=17806 + [160] = https://curl.se/bug/?i=17805 + [161] = https://curl.se/bug/?i=17774 + [162] = https://curl.se/bug/?i=17799 + [163] = https://curl.se/bug/?i=17795 + [164] = https://curl.se/bug/?i=17796 + [165] = https://curl.se/bug/?i=17792 + [166] = https://curl.se/bug/?i=17783 + [167] = https://curl.se/bug/?i=17793 + [168] = https://curl.se/bug/?i=17786 + [169] = https://curl.se/bug/?i=17752 + [170] = https://curl.se/bug/?i=17750 + [171] = https://curl.se/bug/?i=17868 + [172] = https://curl.se/bug/?i=17772 + [173] = https://curl.se/bug/?i=17780 + [174] = https://curl.se/bug/?i=17784 + [175] = https://curl.se/bug/?i=17785 + [176] = https://curl.se/bug/?i=17801 + [177] = https://curl.se/bug/?i=17867 + [178] = https://curl.se/bug/?i=17833 + [179] = https://curl.se/bug/?i=17832 + [180] = https://curl.se/bug/?i=17831 + [181] = https://curl.se/bug/?i=17830 + [182] = https://curl.se/bug/?i=17824 + [183] = https://curl.se/bug/?i=17825 + [184] = https://curl.se/bug/?i=17822 + [185] = https://curl.se/bug/?i=17814 + [186] = https://curl.se/bug/?i=17818 + [187] = https://curl.se/bug/?i=17926 + [188] = https://curl.se/bug/?i=17843 + [189] = https://curl.se/bug/?i=13288 + [190] = https://curl.se/bug/?i=17917 + [191] = https://curl.se/bug/?i=17856 + [193] = https://curl.se/bug/?i=17821 + [194] = https://curl.se/bug/?i=17913 + [195] = https://curl.se/bug/?i=17902 + [196] = https://curl.se/bug/?i=17895 + [197] = https://curl.se/bug/?i=17923 + [198] = https://curl.se/bug/?i=17909 + [199] = https://curl.se/bug/?i=17909 + [200] = https://curl.se/bug/?i=17907 + [201] = https://curl.se/bug/?i=17906 + [202] = https://curl.se/bug/?i=17845 + [203] = https://curl.se/bug/?i=17906 + [204] = https://curl.se/bug/?i=17840 + [205] = https://curl.se/bug/?i=17906 + [206] = https://curl.se/bug/?i=17790 + [207] = https://curl.se/bug/?i=17904 + [208] = https://curl.se/bug/?i=17819 + [209] = https://curl.se/bug/?i=17908 + [210] = https://curl.se/bug/?i=17903 + [211] = https://curl.se/bug/?i=17897 + [212] = https://curl.se/bug/?i=17922 + [214] = https://curl.se/bug/?i=17934 + [215] = https://curl.se/bug/?i=17892 + [216] = https://curl.se/bug/?i=17880 + [217] = https://curl.se/bug/?i=17882 + [218] = https://curl.se/bug/?i=17890 + [219] = https://curl.se/bug/?i=17888 + [220] = https://curl.se/bug/?i=17886 + [221] = https://curl.se/bug/?i=17885 + [222] = https://curl.se/bug/?i=17881 + [223] = https://curl.se/bug/?i=17879 + [224] = https://curl.se/bug/?i=17875 + [225] = https://curl.se/bug/?i=17829 + [226] = https://curl.se/bug/?i=17871 + [227] = https://curl.se/bug/?i=17916 diff --git a/curl/acinclude.m4 b/curl/acinclude.m4 index 69bb6c002..e10e4a01e 100644 --- a/curl/acinclude.m4 +++ b/curl/acinclude.m4 @@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -18,6 +18,8 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # +# SPDX-License-Identifier: curl +# #*************************************************************************** dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT]) @@ -46,10 +48,10 @@ AC_DEFUN([CURL_CHECK_DEF], [ tmp_exp="" AC_PREPROC_IFELSE([ AC_LANG_SOURCE( -ifelse($2,,,[$2])[[ -#ifdef $1 -CURL_DEF_TOKEN $1 -#endif + ifelse($2,,,[$2])[[ + #ifdef $1 + CURL_DEF_TOKEN $1 + #endif ]]) ],[ tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ @@ -86,15 +88,14 @@ AC_DEFUN([CURL_CHECK_DEF_CC], [ ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE( -ifelse($2,,,[$2])[[ -int main (void) -{ -#ifdef $1 - return 0; -#else - force compilation error -#endif -} + ifelse($2,,,[$2])[[ + int main(void) + { + #ifndef $1 + #error force compilation error + #endif + return 0; + } ]]) ],[ tst_symbol_defined="yes" @@ -121,16 +122,15 @@ AC_DEFUN([CURL_CHECK_LIB_XNET], [ tst_lib_xnet_required="no" AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ -int main (void) -{ -#if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) - return 0; -#elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) - return 0; -#else - force compilation error -#endif -} + int main(void) + { + #if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) + #elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) + #else + #error force compilation error + #endif + return 0; + } ]]) ],[ tst_lib_xnet_required="yes" @@ -143,7 +143,7 @@ int main (void) dnl CURL_CHECK_AIX_ALL_SOURCE dnl ------------------------------------------------- dnl Provides a replacement of traditional AC_AIX with -dnl an uniform behaviour across all autoconf versions, +dnl an uniform behavior across all autoconf versions, dnl and with our own placement rules. AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [ @@ -154,7 +154,6 @@ AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [ #endif]) AC_BEFORE([$0], [AC_SYS_LARGEFILE])dnl AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])dnl - AC_BEFORE([$0], [CURL_CONFIGURE_PULL_SYS_POLL])dnl AC_MSG_CHECKING([if OS is AIX (to define _ALL_SOURCE)]) AC_EGREP_CPP([yes_this_is_aix],[ #ifdef _AIX @@ -169,263 +168,29 @@ AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [ ]) -dnl CURL_CHECK_HEADER_WINDOWS -dnl ------------------------------------------------- -dnl Check for compilable and valid windows.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [ - AC_CACHE_CHECK([for windows.h], [curl_cv_header_windows_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include - ]],[[ -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINDOWS_H shall not be defined. -#else - int dummy=2*WINVER; -#endif - ]]) - ],[ - curl_cv_header_windows_h="yes" - ],[ - curl_cv_header_windows_h="no" - ]) - ]) - case "$curl_cv_header_windows_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1, - [Define to 1 if you have the windows.h header file.]) - ;; - esac -]) - - dnl CURL_CHECK_NATIVE_WINDOWS dnl ------------------------------------------------- dnl Check if building a native Windows target AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl AC_CACHE_CHECK([whether build target is a native Windows one], [curl_cv_native_windows], [ - if test "$curl_cv_header_windows_h" = "no"; then - curl_cv_native_windows="no" - else - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ -#if defined(__MINGW32__) || defined(__MINGW32CE__) || \ - (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))) - int dummy=1; -#else - Not a native Windows build target. -#endif - ]]) - ],[ - curl_cv_native_windows="yes" - ],[ - curl_cv_native_windows="no" - ]) - fi - ]) - AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$curl_cv_native_windows" = xyes) -]) - - -dnl CURL_CHECK_HEADER_WINSOCK -dnl ------------------------------------------------- -dnl Check for compilable and valid winsock.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl - AC_CACHE_CHECK([for winsock.h], [curl_cv_header_winsock_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include - ]],[[ -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINSOCK_H shall not be defined. -#else - int dummy=WSACleanup(); -#endif - ]]) - ],[ - curl_cv_header_winsock_h="yes" - ],[ - curl_cv_header_winsock_h="no" - ]) - ]) - case "$curl_cv_header_winsock_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1, - [Define to 1 if you have the winsock.h header file.]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_WINSOCK2 -dnl ------------------------------------------------- -dnl Check for compilable and valid winsock2.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl - AC_CACHE_CHECK([for winsock2.h], [curl_cv_header_winsock2_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include - ]],[[ -#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) - HAVE_WINSOCK2_H shall not be defined. -#else - int dummy=2*IPPROTO_ESP; -#endif - ]]) - ],[ - curl_cv_header_winsock2_h="yes" - ],[ - curl_cv_header_winsock2_h="no" - ]) - ]) - case "$curl_cv_header_winsock2_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1, - [Define to 1 if you have the winsock2.h header file.]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_WS2TCPIP -dnl ------------------------------------------------- -dnl Check for compilable and valid ws2tcpip.h header - -AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CACHE_CHECK([for ws2tcpip.h], [curl_cv_header_ws2tcpip_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#include ]],[[ -#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) - HAVE_WS2TCPIP_H shall not be defined. -#else - int dummy=2*IP_PKTINFO; -#endif + #ifdef _WIN32 + int dummy = 1; + (void)dummy; + #else + #error Not a native Windows build target. + #endif ]]) ],[ - curl_cv_header_ws2tcpip_h="yes" + curl_cv_native_windows="yes" ],[ - curl_cv_header_ws2tcpip_h="no" - ]) - ]) - case "$curl_cv_header_ws2tcpip_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1, - [Define to 1 if you have the ws2tcpip.h header file.]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_WINLDAP -dnl ------------------------------------------------- -dnl Check for compilable and valid winldap.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINLDAP], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl - AC_CACHE_CHECK([for winldap.h], [curl_cv_header_winldap_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif -#include - ]],[[ -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINLDAP_H shall not be defined. -#else - LDAP *ldp = ldap_init("dummy", LDAP_PORT); - ULONG res = ldap_unbind(ldp); -#endif - ]]) - ],[ - curl_cv_header_winldap_h="yes" - ],[ - curl_cv_header_winldap_h="no" - ]) - ]) - case "$curl_cv_header_winldap_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINLDAP_H, 1, - [Define to 1 if you have the winldap.h header file.]) - ;; - esac -]) - - -dnl CURL_CHECK_HEADER_WINBER -dnl ------------------------------------------------- -dnl Check for compilable and valid winber.h header - -AC_DEFUN([CURL_CHECK_HEADER_WINBER], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINLDAP])dnl - AC_CACHE_CHECK([for winber.h], [curl_cv_header_winber_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif -#include -#include - ]],[[ -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINBER_H shall not be defined. -#else - BERVAL *bvp = NULL; - BerElement *bep = ber_init(bvp); - ber_free(bep, 1); -#endif - ]]) - ],[ - curl_cv_header_winber_h="yes" - ],[ - curl_cv_header_winber_h="no" + curl_cv_native_windows="no" ]) ]) - case "$curl_cv_header_winber_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_WINBER_H, 1, - [Define to 1 if you have the winber.h header file.]) - ;; - esac + AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$curl_cv_native_windows" = xyes) ]) @@ -435,25 +200,25 @@ dnl Check for compilable and valid lber.h header, dnl and check if it is needed even with ldap.h AC_DEFUN([CURL_CHECK_HEADER_LBER], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl + AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl AC_CACHE_CHECK([for lber.h], [curl_cv_header_lber_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #include ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); @@ -471,24 +236,24 @@ AC_DEFUN([CURL_CHECK_HEADER_LBER], [ # AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #include ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); @@ -519,27 +284,28 @@ AC_DEFUN([CURL_CHECK_HEADER_LDAP], [ AC_CACHE_CHECK([for ldap.h], [curl_cv_header_ldap_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #include ]],[[ - LDAP *ldp = ldap_init("dummy", LDAP_PORT); + LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); int res = ldap_unbind(ldp); + (void)res; ]]) ],[ curl_cv_header_ldap_h="yes" @@ -565,29 +331,30 @@ AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [ AC_CACHE_CHECK([for ldap_ssl.h], [curl_cv_header_ldap_ssl_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif + #include ]],[[ - LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1); + LDAP *ldp = ldapssl_init("0.0.0.0", LDAPS_PORT, 1); + (void)ldp; ]]) ],[ curl_cv_header_ldap_ssl_h="yes" @@ -604,64 +371,12 @@ AC_DEFUN([CURL_CHECK_HEADER_LDAP_SSL], [ ]) -dnl CURL_CHECK_HEADER_LDAPSSL -dnl ------------------------------------------------- -dnl Check for compilable and valid ldapssl.h header - -AC_DEFUN([CURL_CHECK_HEADER_LDAPSSL], [ - AC_REQUIRE([CURL_CHECK_HEADER_LDAP])dnl - AC_CACHE_CHECK([for ldapssl.h], [curl_cv_header_ldapssl_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif -#include - ]],[[ - char *cert_label = NULL; - LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label); - ]]) - ],[ - curl_cv_header_ldapssl_h="yes" - ],[ - curl_cv_header_ldapssl_h="no" - ]) - ]) - case "$curl_cv_header_ldapssl_h" in - yes) - AC_DEFINE_UNQUOTED(HAVE_LDAPSSL_H, 1, - [Define to 1 if you have the ldapssl.h header file.]) - ;; - esac -]) - - dnl CURL_CHECK_LIBS_WINLDAP dnl ------------------------------------------------- dnl Check for libraries needed for WINLDAP support, dnl and prepended to LIBS any needed libraries. dnl This macro can take an optional parameter with a -dnl white space separated list of libraries to check +dnl whitespace separated list of libraries to check dnl before the WINLDAP default ones. AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [ @@ -702,25 +417,24 @@ AC_DEFUN([CURL_CHECK_LIBS_WINLDAP], [ fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINLDAP_H -#include -#endif -#ifdef HAVE_WINBER_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include + #ifdef HAVE_WINBER_H + #include + #endif + #endif ]],[[ BERVAL *bvp = NULL; BerElement *bep = ber_init(bvp); - LDAP *ldp = ldap_init("dummy", LDAP_PORT); + LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); ULONG res = ldap_unbind(ldp); ber_free(bep, 1); + (void)res; ]]) ],[ curl_cv_ldap_LIBS="$x_nlibs" @@ -755,7 +469,7 @@ dnl ------------------------------------------------- dnl Check for libraries needed for LDAP support, dnl and prepended to LIBS any needed libraries. dnl This macro can take an optional parameter with a -dnl white space separated list of libraries to check +dnl whitespace separated list of libraries to check dnl before the default ones. AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ @@ -791,7 +505,9 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ '-lldap -llber' \ '-llber -lldap' \ '-lldapssl -lldapx -lldapsdk' \ - '-lldapsdk -lldapx -lldapssl' ; do + '-lldapsdk -lldapx -lldapssl' \ + '-lldap -llber -lssl -lcrypto'; do + if test "$curl_cv_ldap_LIBS" = "unknown"; then if test -z "$x_nlibs"; then LIBS="$curl_cv_save_LIBS" @@ -800,35 +516,36 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif ]],[[ BerValue *bvp = NULL; BerElement *bep = ber_init(bvp); - LDAP *ldp = ldap_init("dummy", LDAP_PORT); + LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); int res = ldap_unbind(ldp); ber_free(bep, 1); + (void)res; ]]) ],[ curl_cv_ldap_LIBS="$x_nlibs" @@ -851,6 +568,10 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ else LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS" fi + # FIXME: Enable when ldap was detected via pkg-config + if false; then + LIBCURL_PC_REQUIRES_PRIVATE="ldap $LIBCURL_PC_REQUIRES_PRIVATE" + fi AC_MSG_RESULT([$curl_cv_ldap_LIBS]) ;; esac @@ -858,314 +579,6 @@ AC_DEFUN([CURL_CHECK_LIBS_LDAP], [ ]) -dnl CURL_CHECK_HEADER_MALLOC -dnl ------------------------------------------------- -dnl Check for compilable and valid malloc.h header, -dnl and check if it is needed even with stdlib.h - -AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [ - AC_CACHE_CHECK([for malloc.h], [curl_cv_header_malloc_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include - ]],[[ - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); - ]]) - ],[ - curl_cv_header_malloc_h="yes" - ],[ - curl_cv_header_malloc_h="no" - ]) - ]) - if test "$curl_cv_header_malloc_h" = "yes"; then - AC_DEFINE_UNQUOTED(HAVE_MALLOC_H, 1, - [Define to 1 if you have the malloc.h header file.]) - # - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include - ]],[[ - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); - ]]) - ],[ - curl_cv_need_header_malloc_h="no" - ],[ - curl_cv_need_header_malloc_h="yes" - ]) - # - case "$curl_cv_need_header_malloc_h" in - yes) - AC_DEFINE_UNQUOTED(NEED_MALLOC_H, 1, - [Define to 1 if you need the malloc.h header file even with stdlib.h]) - ;; - esac - fi -]) - - -dnl CURL_CHECK_HEADER_MEMORY -dnl ------------------------------------------------- -dnl Check for compilable and valid memory.h header, -dnl and check if it is needed even with stdlib.h for -dnl memory related functions. - -AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [ - AC_CACHE_CHECK([for memory.h], [curl_cv_header_memory_h], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include - ]],[[ - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); - ]]) - ],[ - curl_cv_header_memory_h="yes" - ],[ - curl_cv_header_memory_h="no" - ]) - ]) - if test "$curl_cv_header_memory_h" = "yes"; then - AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1, - [Define to 1 if you have the memory.h header file.]) - # - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include - ]],[[ - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); - ]]) - ],[ - curl_cv_need_header_memory_h="no" - ],[ - curl_cv_need_header_memory_h="yes" - ]) - # - case "$curl_cv_need_header_memory_h" in - yes) - AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1, - [Define to 1 if you need the memory.h header file even with stdlib.h]) - ;; - esac - fi -]) - - -dnl CURL_CHECK_FUNC_GETNAMEINFO -dnl ------------------------------------------------- -dnl Test if the getnameinfo function is available, -dnl and check the types of five of its arguments. -dnl If the function succeeds HAVE_GETNAMEINFO will be -dnl defined, defining the types of the arguments in -dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2, -dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7, -dnl and also defining the type qualifier of first -dnl argument in GETNAMEINFO_QUAL_ARG1. - -AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [ - AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h) - # - AC_MSG_CHECKING([for getnameinfo]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([getnameinfo]) - ],[ - AC_MSG_RESULT([yes]) - curl_cv_getnameinfo="yes" - ],[ - AC_MSG_RESULT([no]) - curl_cv_getnameinfo="no" - ]) - # - if test "$curl_cv_getnameinfo" != "yes"; then - AC_MSG_CHECKING([deeper for getnameinfo]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ - getnameinfo(); - ]]) - ],[ - AC_MSG_RESULT([yes]) - curl_cv_getnameinfo="yes" - ],[ - AC_MSG_RESULT([but still no]) - curl_cv_getnameinfo="no" - ]) - fi - # - if test "$curl_cv_getnameinfo" != "yes"; then - AC_MSG_CHECKING([deeper and deeper for getnameinfo]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#endif - ]],[[ - getnameinfo(0, 0, 0, 0, 0, 0, 0); - ]]) - ],[ - AC_MSG_RESULT([yes]) - curl_cv_getnameinfo="yes" - ],[ - AC_MSG_RESULT([but still no]) - curl_cv_getnameinfo="no" - ]) - fi - # - if test "$curl_cv_getnameinfo" = "yes"; then - AC_CACHE_CHECK([types of arguments for getnameinfo], - [curl_cv_func_getnameinfo_args], [ - curl_cv_func_getnameinfo_args="unknown" - for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do - for gni_arg2 in 'socklen_t' 'size_t' 'int'; do - for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do - for gni_arg7 in 'int' 'unsigned int'; do - if test "$curl_cv_func_getnameinfo_args" = "unknown"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0501 -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#define GNICALLCONV WSAAPI -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#define GNICALLCONV -#endif - extern int GNICALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) -#endif - getnameinfo($gni_arg1, $gni_arg2, - char *, $gni_arg46, - char *, $gni_arg46, - $gni_arg7); - ]],[[ - $gni_arg2 salen=0; - $gni_arg46 hostlen=0; - $gni_arg46 servlen=0; - $gni_arg7 flags=0; - int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags); - ]]) - ],[ - curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7" - ]) - fi - done - done - done - done - ]) # AC-CACHE-CHECK - if test "$curl_cv_func_getnameinfo_args" = "unknown"; then - AC_MSG_WARN([Cannot find proper types to use for getnameinfo args]) - AC_MSG_WARN([HAVE_GETNAMEINFO will not be defined]) - else - gni_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'` - IFS=$gni_prev_IFS - shift - # - gni_qual_type_arg1=$[1] - # - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2], - [Define to the type of arg 2 for getnameinfo.]) - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3], - [Define to the type of args 4 and 6 for getnameinfo.]) - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4], - [Define to the type of arg 7 for getnameinfo.]) - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) - ;; - *) - set -f - ;; - esac - # - case "$gni_qual_type_arg1" in - const*) - gni_qual_arg1=const - gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'` - ;; - *) - gni_qual_arg1= - gni_type_arg1=$gni_qual_type_arg1 - ;; - esac - # - AC_DEFINE_UNQUOTED(GETNAMEINFO_QUAL_ARG1, $gni_qual_arg1, - [Define to the type qualifier of arg 1 for getnameinfo.]) - AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $gni_type_arg1, - [Define to the type of arg 1 for getnameinfo.]) - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # - AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1, - [Define to 1 if you have the getnameinfo function.]) - curl_cv_func_getnameinfo="yes" - fi - fi -]) - - dnl TYPE_SOCKADDR_STORAGE dnl ------------------------------------------------- dnl Check for struct sockaddr_storage. Most IPv6-enabled @@ -1174,175 +587,55 @@ dnl hosts have it, but AIX 4.3 is one known exception. AC_DEFUN([TYPE_SOCKADDR_STORAGE], [ AC_CHECK_TYPE([struct sockaddr_storage], - AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, - [if struct sockaddr_storage is defined]), , + AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, + [if struct sockaddr_storage is defined]), , [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #endif ]) ]) - -dnl CURL_CHECK_NI_WITHSCOPEID -dnl ------------------------------------------------- -dnl Check for working NI_WITHSCOPEID in getnameinfo() - -AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [ - AC_REQUIRE([CURL_CHECK_FUNC_GETNAMEINFO])dnl - AC_REQUIRE([TYPE_SOCKADDR_STORAGE])dnl - AC_CHECK_HEADERS(stdio.h sys/types.h sys/socket.h \ - netdb.h netinet/in.h arpa/inet.h) - # - AC_CACHE_CHECK([for working NI_WITHSCOPEID], - [curl_cv_working_ni_withscopeid], [ - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([[ -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif - ]],[[ -#if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO) -#ifdef HAVE_STRUCT_SOCKADDR_STORAGE - struct sockaddr_storage sa; -#else - unsigned char sa[256]; -#endif - char hostbuf[NI_MAXHOST]; - int rc; - GETNAMEINFO_TYPE_ARG2 salen = (GETNAMEINFO_TYPE_ARG2)sizeof(sa); - GETNAMEINFO_TYPE_ARG46 hostlen = (GETNAMEINFO_TYPE_ARG46)sizeof(hostbuf); - GETNAMEINFO_TYPE_ARG7 flags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; - int fd = socket(AF_INET6, SOCK_STREAM, 0); - if(fd < 0) { - perror("socket()"); - return 1; /* Error creating socket */ - } - rc = getsockname(fd, (GETNAMEINFO_TYPE_ARG1)&sa, &salen); - if(rc) { - perror("getsockname()"); - return 2; /* Error retrieving socket name */ - } - rc = getnameinfo((GETNAMEINFO_TYPE_ARG1)&sa, salen, hostbuf, hostlen, NULL, 0, flags); - if(rc) { - printf("rc = %s\n", gai_strerror(rc)); - return 3; /* Error translating socket address */ - } - return 0; /* Ok, NI_WITHSCOPEID works */ -#else - return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */ -#endif - ]]) # AC-LANG-PROGRAM - ],[ - # Exit code == 0. Program worked. - curl_cv_working_ni_withscopeid="yes" - ],[ - # Exit code != 0. Program failed. - curl_cv_working_ni_withscopeid="no" - ],[ - # Program is not run when cross-compiling. So we assume - # NI_WITHSCOPEID will work if we are able to compile it. - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include -#include -#include - ]],[[ - unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; - ]]) - ],[ - curl_cv_working_ni_withscopeid="yes" - ],[ - curl_cv_working_ni_withscopeid="no" - ]) # AC-COMPILE-IFELSE - ]) # AC-RUN-IFELSE - ]) # AC-CACHE-CHECK - case "$curl_cv_working_ni_withscopeid" in - yes) - AC_DEFINE(HAVE_NI_WITHSCOPEID, 1, - [Define to 1 if NI_WITHSCOPEID exists and works.]) - ;; - esac -]) - - dnl CURL_CHECK_FUNC_RECV dnl ------------------------------------------------- dnl Test if the socket recv() function is available, -dnl and check its return type and the types of its -dnl arguments. If the function succeeds HAVE_RECV -dnl will be defined, defining the types of the arguments -dnl in RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3 -dnl and RECV_TYPE_ARG4, defining the type of the function -dnl return value in RECV_TYPE_RETV. AC_DEFUN([CURL_CHECK_FUNC_RECV], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h) + AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl + AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl + AC_CHECK_HEADERS(sys/types.h) # AC_MSG_CHECKING([for recv]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + $curl_includes_bsdsocket + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #endif ]],[[ recv(0, 0, 0, 0); ]]) @@ -1355,85 +648,9 @@ AC_DEFUN([CURL_CHECK_FUNC_RECV], [ ]) # if test "$curl_cv_recv" = "yes"; then - AC_CACHE_CHECK([types of args and return type for recv], - [curl_cv_func_recv_args], [ - curl_cv_func_recv_args="unknown" - for recv_retv in 'int' 'ssize_t'; do - for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do - for recv_arg2 in 'char *' 'void *'; do - for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do - for recv_arg4 in 'int' 'unsigned int'; do - if test "$curl_cv_func_recv_args" = "unknown"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define RECVCALLCONV PASCAL -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define RECVCALLCONV -#endif - extern $recv_retv RECVCALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) -#endif - recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4); - ]],[[ - $recv_arg1 s=0; - $recv_arg2 buf=0; - $recv_arg3 len=0; - $recv_arg4 flags=0; - $recv_retv res = recv(s, buf, len, flags); - ]]) - ],[ - curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv" - ]) - fi - done - done - done - done - done - ]) # AC-CACHE-CHECK - if test "$curl_cv_func_recv_args" = "unknown"; then - AC_MSG_ERROR([Cannot find proper types to use for recv args]) - else - recv_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'` - IFS=$recv_prev_IFS - shift - # - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG1, $[1], - [Define to the type of arg 1 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG2, $[2], - [Define to the type of arg 2 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG3, $[3], - [Define to the type of arg 3 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_ARG4, $[4], - [Define to the type of arg 4 for recv.]) - AC_DEFINE_UNQUOTED(RECV_TYPE_RETV, $[5], - [Define to the function return type for recv.]) - # - AC_DEFINE_UNQUOTED(HAVE_RECV, 1, - [Define to 1 if you have the recv function.]) - curl_cv_func_recv="yes" - fi + AC_DEFINE_UNQUOTED(HAVE_RECV, 1, + [Define to 1 if you have the recv function.]) + curl_cv_func_recv="yes" else AC_MSG_ERROR([Unable to link function recv]) fi @@ -1443,45 +660,31 @@ __attribute__((overloadable)) dnl CURL_CHECK_FUNC_SEND dnl ------------------------------------------------- dnl Test if the socket send() function is available, -dnl and check its return type and the types of its -dnl arguments. If the function succeeds HAVE_SEND -dnl will be defined, defining the types of the arguments -dnl in SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3 -dnl and SEND_TYPE_ARG4, defining the type of the function -dnl return value in SEND_TYPE_RETV, and also defining the -dnl type qualifier of second argument in SEND_QUAL_ARG2. AC_DEFUN([CURL_CHECK_FUNC_SEND], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h) + AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl + AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl + AC_CHECK_HEADERS(sys/types.h) # AC_MSG_CHECKING([for send]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + $curl_includes_bsdsocket + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #endif ]],[[ - send(0, 0, 0, 0); + char s[] = ""; + send(0, (void *)s, 0, 0); ]]) ],[ AC_MSG_RESULT([yes]) @@ -1492,118 +695,9 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [ ]) # if test "$curl_cv_send" = "yes"; then - AC_CACHE_CHECK([types of args and return type for send], - [curl_cv_func_send_args], [ - curl_cv_func_send_args="unknown" - for send_retv in 'int' 'ssize_t'; do - for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do - for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do - for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do - for send_arg4 in 'int' 'unsigned int'; do - if test "$curl_cv_func_send_args" = "unknown"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define SENDCALLCONV PASCAL -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define SENDCALLCONV -#endif - extern $send_retv SENDCALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) -#endif - send($send_arg1, $send_arg2, $send_arg3, $send_arg4); - ]],[[ - $send_arg1 s=0; - $send_arg3 len=0; - $send_arg4 flags=0; - $send_retv res = send(s, 0, len, flags); - ]]) - ],[ - curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv" - ]) - fi - done - done - done - done - done - ]) # AC-CACHE-CHECK - if test "$curl_cv_func_send_args" = "unknown"; then - AC_MSG_ERROR([Cannot find proper types to use for send args]) - else - send_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'` - IFS=$send_prev_IFS - shift - # - send_qual_type_arg2=$[2] - # - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG1, $[1], - [Define to the type of arg 1 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG3, $[3], - [Define to the type of arg 3 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG4, $[4], - [Define to the type of arg 4 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_RETV, $[5], - [Define to the function return type for send.]) - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) - ;; - *) - set -f - ;; - esac - # - case "$send_qual_type_arg2" in - const*) - send_qual_arg2=const - send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'` - ;; - *) - send_qual_arg2= - send_type_arg2=$send_qual_type_arg2 - ;; - esac - # - AC_DEFINE_UNQUOTED(SEND_QUAL_ARG2, $send_qual_arg2, - [Define to the type qualifier of arg 2 for send.]) - AC_DEFINE_UNQUOTED(SEND_TYPE_ARG2, $send_type_arg2, - [Define to the type of arg 2 for send.]) - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # - AC_DEFINE_UNQUOTED(HAVE_SEND, 1, - [Define to 1 if you have the send function.]) - curl_cv_func_send="yes" - fi + AC_DEFINE_UNQUOTED(HAVE_SEND, 1, + [Define to 1 if you have the send function.]) + curl_cv_func_send="yes" else AC_MSG_ERROR([Unable to link function send]) fi @@ -1614,33 +708,25 @@ dnl ------------------------------------------------- dnl Check for MSG_NOSIGNAL AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [ - AC_CHECK_HEADERS(sys/types.h sys/socket.h) + AC_CHECK_HEADERS(sys/types.h) AC_CACHE_CHECK([for MSG_NOSIGNAL], [curl_cv_msg_nosignal], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #endif ]],[[ - int flag=MSG_NOSIGNAL; + int flag = MSG_NOSIGNAL; + (void)flag; ]]) ],[ curl_cv_msg_nosignal="yes" @@ -1662,47 +748,30 @@ dnl ------------------------------------------------- dnl Check for timeval struct AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ - AC_REQUIRE([AC_HEADER_TIME])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl - AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl - AC_CHECK_HEADERS(sys/types.h sys/time.h time.h sys/socket.h) + AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl + AC_CHECK_HEADERS(sys/types.h) AC_CACHE_CHECK([for struct timeval], [curl_cv_struct_timeval], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #include + #include + #endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include ]],[[ struct timeval ts; ts.tv_sec = 0; ts.tv_usec = 0; + (void)ts; ]]) ],[ curl_cv_struct_timeval="yes" @@ -1719,183 +788,72 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ ]) -dnl TYPE_SIG_ATOMIC_T -dnl ------------------------------------------------- -dnl Check if the sig_atomic_t type is available, and -dnl verify if it is already defined as volatile. - -AC_DEFUN([TYPE_SIG_ATOMIC_T], [ - AC_CHECK_HEADERS(signal.h) - AC_CHECK_TYPE([sig_atomic_t],[ - AC_DEFINE(HAVE_SIG_ATOMIC_T, 1, - [Define to 1 if sig_atomic_t is an available typedef.]) - ], ,[ -#ifdef HAVE_SIGNAL_H -#include -#endif - ]) - case "$ac_cv_type_sig_atomic_t" in - yes) - # - AC_MSG_CHECKING([if sig_atomic_t is already defined as volatile]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ -#ifdef HAVE_SIGNAL_H -#include -#endif - ]],[[ - static volatile sig_atomic_t dummy = 0; - ]]) - ],[ - AC_MSG_RESULT([no]) - curl_cv_sig_atomic_t_volatile="no" - ],[ - AC_MSG_RESULT([yes]) - curl_cv_sig_atomic_t_volatile="yes" - ]) - # - if test "$curl_cv_sig_atomic_t_volatile" = "yes"; then - AC_DEFINE(HAVE_SIG_ATOMIC_T_VOLATILE, 1, - [Define to 1 if sig_atomic_t is already defined as volatile.]) - fi - ;; - esac -]) - - -dnl TYPE_IN_ADDR_T -dnl ------------------------------------------------- -dnl Check for in_addr_t: it is used to receive the return code of inet_addr() -dnl and a few other things. - -AC_DEFUN([TYPE_IN_ADDR_T], [ - AC_CHECK_TYPE([in_addr_t], ,[ - dnl in_addr_t not available - AC_CACHE_CHECK([for in_addr_t equivalent], - [curl_cv_in_addr_t_equiv], [ - curl_cv_in_addr_t_equiv="unknown" - for t in "unsigned long" int size_t unsigned long; do - if test "$curl_cv_in_addr_t_equiv" = "unknown"; then - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif - ]],[[ - $t data = inet_addr ("1.2.3.4"); - ]]) - ],[ - curl_cv_in_addr_t_equiv="$t" - ]) - fi - done - ]) - case "$curl_cv_in_addr_t_equiv" in - unknown) - AC_MSG_ERROR([Cannot find a type to use in place of in_addr_t]) - ;; - *) - AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv, - [Type to use in place of in_addr_t when system does not provide it.]) - ;; - esac - ],[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif - ]) -]) - - dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC dnl ------------------------------------------------- dnl Check if monotonic clock_gettime is available. AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [ - AC_REQUIRE([AC_HEADER_TIME])dnl - AC_CHECK_HEADERS(sys/types.h sys/time.h time.h) + AC_CHECK_HEADERS(sys/types.h) AC_MSG_CHECKING([for monotonic clock_gettime]) # - if test "x$dontwant_rt" = "xno" ; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif - ]],[[ - struct timespec ts; - (void)clock_gettime(CLOCK_MONOTONIC, &ts); - ]]) - ],[ - AC_MSG_RESULT([yes]) - curl_func_clock_gettime="yes" - ],[ - AC_MSG_RESULT([no]) - curl_func_clock_gettime="no" - ]) - fi + + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include + ]],[[ + struct timespec ts; + (void)clock_gettime(CLOCK_MONOTONIC, &ts); + (void)ts; + ]]) + ],[ + AC_MSG_RESULT([yes]) + curl_func_clock_gettime="yes" + ],[ + AC_MSG_RESULT([no]) + curl_func_clock_gettime="no" + ]) + dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed dnl until library linking and run-time checks for clock_gettime succeed. ]) +dnl CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW +dnl ------------------------------------------------- +dnl Check if monotonic clock_gettime is available. + +AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [ + AC_CHECK_HEADERS(sys/types.h) + AC_MSG_CHECKING([for raw monotonic clock_gettime]) + # + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include + ]],[[ + struct timespec ts; + (void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts); + (void)ts; + ]]) + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE_UNQUOTED(HAVE_CLOCK_GETTIME_MONOTONIC_RAW, 1, + [Define to 1 if you have the clock_gettime function and raw monotonic timer.]) + ],[ + AC_MSG_RESULT([no]) + ]) +]) + dnl CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC dnl ------------------------------------------------- @@ -1921,22 +879,17 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ fi AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include ]],[[ struct timespec ts; (void)clock_gettime(CLOCK_MONOTONIC, &ts); + (void)ts; ]]) ],[ curl_cv_gclk_LIBS="$x_xlibs" @@ -1957,13 +910,18 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ curl_func_clock_gettime="yes" ;; *) - if test -z "$curl_cv_save_LIBS"; then - LIBS="$curl_cv_gclk_LIBS" + if test "x$dontwant_rt" = "xyes" ; then + AC_MSG_WARN([needs -lrt but asked not to use it, HAVE_CLOCK_GETTIME_MONOTONIC will not be defined]) + curl_func_clock_gettime="no" else - LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS" + if test -z "$curl_cv_save_LIBS"; then + LIBS="$curl_cv_gclk_LIBS" + else + LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS" + fi + AC_MSG_RESULT([$curl_cv_gclk_LIBS]) + curl_func_clock_gettime="yes" fi - AC_MSG_RESULT([$curl_cv_gclk_LIBS]) - curl_func_clock_gettime="yes" ;; esac # @@ -1971,30 +929,22 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ if test "x$cross_compiling" != "xyes" && test "$curl_func_clock_gettime" = "yes"; then AC_MSG_CHECKING([if monotonic clock_gettime works]) - AC_RUN_IFELSE([ + CURL_RUN_IFELSE([ AC_LANG_PROGRAM([[ -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif + #include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include ]],[[ struct timespec ts; - if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) - exit(0); - else - exit(1); + if(0 == clock_gettime(CLOCK_MONOTONIC, &ts)) + return 0; + (void)ts; + return 1; ]]) ],[ AC_MSG_RESULT([yes]) @@ -2025,6 +975,7 @@ dnl using current libraries or if another one is required. AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl + AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl AC_MSG_CHECKING([for connect in libraries]) tst_connect_save_LIBS="$LIBS" tst_connect_need_LIBS="unknown" @@ -2034,7 +985,8 @@ AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [ AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 - #ifndef HAVE_WINDOWS_H + $curl_includes_bsdsocket + #if !defined(_WIN32) && !defined(HAVE_PROTO_BSDSOCKET_H) int connect(int, void*, int); #endif ]],[[ @@ -2064,238 +1016,40 @@ AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [ ]) -dnl CURL_DEFINE_UNQUOTED (VARIABLE, [VALUE]) -dnl ------------------------------------------------- -dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor -dnl symbol that can be further used in custom template configuration -dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third -dnl argument for the description. Symbol definitions done with this -dnl macro are intended to be exclusively used in handcrafted *.h.in -dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one -dnl prevents autoheader generation and insertion of symbol template -dnl stub and definition into the first configuration header file. Do -dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each -dnl one serves different functional needs. - -AC_DEFUN([CURL_DEFINE_UNQUOTED], [ -cat >>confdefs.h <<_EOF -[@%:@define] $1 ifelse($#, 2, [$2], 1) -_EOF -]) - - -dnl CURL_CONFIGURE_CURL_SOCKLEN_T -dnl ------------------------------------------------- -dnl The need for the curl_socklen_t definition arises mainly to properly -dnl interface HP-UX systems which on one hand have a typedef'ed socklen_t -dnl data type which is 32 or 64-Bit wide depending on the data model being -dnl used, and that on the other hand is only actually used when interfacing -dnl the X/Open sockets provided in the xnet library. - -AC_DEFUN([CURL_CONFIGURE_CURL_SOCKLEN_T], [ - AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl - AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl - AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl - # - AC_BEFORE([$0], [CURL_CONFIGURE_PULL_SYS_POLL])dnl - # - AC_MSG_CHECKING([for curl_socklen_t data type]) - curl_typeof_curl_socklen_t="unknown" - for arg1 in int SOCKET; do - for arg2 in 'struct sockaddr' void; do - for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do - if test "$curl_typeof_curl_socklen_t" = "unknown"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_preprocess_callconv - extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *); - ]],[[ - $t *lenptr = 0; - if(0 != getpeername(0, 0, lenptr)) - return 1; - ]]) - ],[ - curl_typeof_curl_socklen_t="$t" - ]) - fi - done - done - done - for t in socklen_t int; do - if test "$curl_typeof_curl_socklen_t" = "void"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_sys_socket - typedef $t curl_socklen_t; - ]],[[ - curl_socklen_t dummy; - ]]) - ],[ - curl_typeof_curl_socklen_t="$t" - ]) - fi - done - AC_MSG_RESULT([$curl_typeof_curl_socklen_t]) - if test "$curl_typeof_curl_socklen_t" = "void" || - test "$curl_typeof_curl_socklen_t" = "unknown"; then - AC_MSG_ERROR([cannot find data type for curl_socklen_t.]) - fi - # - AC_MSG_CHECKING([size of curl_socklen_t]) - curl_sizeof_curl_socklen_t="unknown" - curl_pull_headers_socklen_t="unknown" - if test "$curl_cv_header_ws2tcpip_h" = "yes"; then - tst_pull_header_checks='none ws2tcpip' - tst_size_checks='4' - else - tst_pull_header_checks='none systypes syssocket' - tst_size_checks='4 8 2' - fi - for tst_size in $tst_size_checks; do - for tst_pull_headers in $tst_pull_header_checks; do - if test "$curl_sizeof_curl_socklen_t" = "unknown"; then - case $tst_pull_headers in - ws2tcpip) - tmp_includes="$curl_includes_ws2tcpip" - ;; - systypes) - tmp_includes="$curl_includes_sys_types" - ;; - syssocket) - tmp_includes="$curl_includes_sys_socket" - ;; - *) - tmp_includes="" - ;; - esac - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $tmp_includes - typedef $curl_typeof_curl_socklen_t curl_socklen_t; - typedef char dummy_arr[sizeof(curl_socklen_t) == $tst_size ? 1 : -1]; - ]],[[ - curl_socklen_t dummy; - ]]) - ],[ - curl_sizeof_curl_socklen_t="$tst_size" - curl_pull_headers_socklen_t="$tst_pull_headers" - ]) - fi - done - done - AC_MSG_RESULT([$curl_sizeof_curl_socklen_t]) - if test "$curl_sizeof_curl_socklen_t" = "unknown"; then - AC_MSG_ERROR([cannot find out size of curl_socklen_t.]) - fi - # - case $curl_pull_headers_socklen_t in - ws2tcpip) - CURL_DEFINE_UNQUOTED([CURL_PULL_WS2TCPIP_H]) - ;; - systypes) - CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H]) - ;; - syssocket) - CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_TYPES_H]) - CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_SOCKET_H]) - ;; - esac - CURL_DEFINE_UNQUOTED([CURL_TYPEOF_CURL_SOCKLEN_T], [$curl_typeof_curl_socklen_t]) - CURL_DEFINE_UNQUOTED([CURL_SIZEOF_CURL_SOCKLEN_T], [$curl_sizeof_curl_socklen_t]) -]) - - -dnl CURL_CONFIGURE_PULL_SYS_POLL -dnl ------------------------------------------------- -dnl The need for the sys/poll.h inclusion arises mainly to properly -dnl interface AIX systems which define macros 'events' and 'revents'. - -AC_DEFUN([CURL_CONFIGURE_PULL_SYS_POLL], [ - AC_REQUIRE([CURL_INCLUDES_POLL])dnl - # - tst_poll_events_macro_defined="unknown" - # - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_poll - ]],[[ -#if defined(events) || defined(revents) - return 0; -#else - force compilation error -#endif - ]]) - ],[ - tst_poll_events_macro_defined="yes" - ],[ - tst_poll_events_macro_defined="no" - ]) - # - if test "$tst_poll_events_macro_defined" = "yes"; then - if test "x$ac_cv_header_sys_poll_h" = "xyes"; then - CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_POLL_H]) - fi - fi - # -]) - - dnl CURL_CHECK_FUNC_SELECT dnl ------------------------------------------------- -dnl Test if the socket select() function is available, -dnl and check its return type and the types of its -dnl arguments. If the function succeeds HAVE_SELECT -dnl will be defined, defining the types of the -dnl arguments in SELECT_TYPE_ARG1, SELECT_TYPE_ARG234 -dnl and SELECT_TYPE_ARG5, defining the type of the -dnl function return value in SELECT_TYPE_RETV, and -dnl also defining the type qualifier of fifth argument -dnl in SELECT_QUAL_ARG5. +dnl Test if the socket select() function is available. AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])dnl - AC_CHECK_HEADERS(sys/select.h sys/socket.h) + AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl + AC_CHECK_HEADERS(sys/select.h) # AC_MSG_CHECKING([for select]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif -#ifndef HAVE_WINDOWS_H -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #include + #include + #endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #ifndef _WIN32 + #ifdef HAVE_SYS_SELECT_H + #include + #elif defined(HAVE_UNISTD_H) + #include + #endif + $curl_includes_bsdsocket + #endif ]],[[ select(0, 0, 0, 0, 0); ]]) @@ -2308,140 +1062,9 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ ]) # if test "$curl_cv_select" = "yes"; then - AC_CACHE_CHECK([types of args and return type for select], - [curl_cv_func_select_args], [ - curl_cv_func_select_args="unknown" - for sel_retv in 'int' 'ssize_t'; do - for sel_arg1 in 'int' 'ssize_t' 'size_t' 'unsigned long int' 'unsigned int'; do - for sel_arg234 in 'fd_set *' 'int *' 'void *'; do - for sel_arg5 in 'struct timeval *' 'const struct timeval *'; do - if test "$curl_cv_func_select_args" = "unknown"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define SELECTCALLCONV PASCAL -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif -#ifndef HAVE_WINDOWS_H -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define SELECTCALLCONV -#endif -#ifndef HAVE_STRUCT_TIMEVAL - struct timeval { - long tv_sec; - long tv_usec; - }; -#endif - extern $sel_retv SELECTCALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) -#endif - select($sel_arg1, - $sel_arg234, - $sel_arg234, - $sel_arg234, - $sel_arg5); - ]],[[ - $sel_arg1 nfds=0; - $sel_arg234 rfds=0; - $sel_arg234 wfds=0; - $sel_arg234 efds=0; - $sel_retv res = select(nfds, rfds, wfds, efds, 0); - ]]) - ],[ - curl_cv_func_select_args="$sel_arg1,$sel_arg234,$sel_arg5,$sel_retv" - ]) - fi - done - done - done - done - ]) # AC-CACHE-CHECK - if test "$curl_cv_func_select_args" = "unknown"; then - AC_MSG_WARN([Cannot find proper types to use for select args]) - AC_MSG_WARN([HAVE_SELECT will not be defined]) - else - select_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_select_args" | sed 's/\*/\*/g'` - IFS=$select_prev_IFS - shift - # - sel_qual_type_arg5=$[3] - # - AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $[1], - [Define to the type of arg 1 for select.]) - AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, $[2], - [Define to the type of args 2, 3 and 4 for select.]) - AC_DEFINE_UNQUOTED(SELECT_TYPE_RETV, $[4], - [Define to the function return type for select.]) - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) - ;; - *) - set -f - ;; - esac - # - case "$sel_qual_type_arg5" in - const*) - sel_qual_arg5=const - sel_type_arg5=`echo $sel_qual_type_arg5 | sed 's/^const //'` - ;; - *) - sel_qual_arg5= - sel_type_arg5=$sel_qual_type_arg5 - ;; - esac - # - AC_DEFINE_UNQUOTED(SELECT_QUAL_ARG5, $sel_qual_arg5, - [Define to the type qualifier of arg 5 for select.]) - AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, $sel_type_arg5, - [Define to the type of arg 5 for select.]) - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # - AC_DEFINE_UNQUOTED(HAVE_SELECT, 1, - [Define to 1 if you have the select function.]) - curl_cv_func_select="yes" - fi + AC_DEFINE_UNQUOTED(HAVE_SELECT, 1, + [Define to 1 if you have the select function.]) + curl_cv_func_select="yes" fi ]) @@ -2464,12 +1087,12 @@ AC_DEFUN([CURL_VERIFY_RUNTIMELIBS], [ dnl just run a program to verify that the libs checked for previous to this dnl point also is available run-time! AC_MSG_CHECKING([run-time libs availability]) - AC_TRY_RUN([ -main() -{ - return 0; -} -], + CURL_RUN_IFELSE([ + int main(void) + { + return 0; + } + ], AC_MSG_RESULT([fine]), AC_MSG_RESULT([failed]) AC_MSG_ERROR([one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS]) @@ -2480,70 +1103,6 @@ main() ]) -dnl CURL_CHECK_VARIADIC_MACROS -dnl ------------------------------------------------- -dnl Check compiler support of variadic macros - -AC_DEFUN([CURL_CHECK_VARIADIC_MACROS], [ - AC_CACHE_CHECK([for compiler support of C99 variadic macro style], - [curl_cv_variadic_macros_c99], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define c99_vmacro3(first, ...) fun3(first, __VA_ARGS__) -#define c99_vmacro2(first, ...) fun2(first, __VA_ARGS__) - int fun3(int arg1, int arg2, int arg3); - int fun2(int arg1, int arg2); - int fun3(int arg1, int arg2, int arg3) - { return arg1 + arg2 + arg3; } - int fun2(int arg1, int arg2) - { return arg1 + arg2; } - ]],[[ - int res3 = c99_vmacro3(1, 2, 3); - int res2 = c99_vmacro2(1, 2); - ]]) - ],[ - curl_cv_variadic_macros_c99="yes" - ],[ - curl_cv_variadic_macros_c99="no" - ]) - ]) - case "$curl_cv_variadic_macros_c99" in - yes) - AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_C99, 1, - [Define to 1 if compiler supports C99 variadic macro style.]) - ;; - esac - AC_CACHE_CHECK([for compiler support of old gcc variadic macro style], - [curl_cv_variadic_macros_gcc], [ - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#define gcc_vmacro3(first, args...) fun3(first, args) -#define gcc_vmacro2(first, args...) fun2(first, args) - int fun3(int arg1, int arg2, int arg3); - int fun2(int arg1, int arg2); - int fun3(int arg1, int arg2, int arg3) - { return arg1 + arg2 + arg3; } - int fun2(int arg1, int arg2) - { return arg1 + arg2; } - ]],[[ - int res3 = gcc_vmacro3(1, 2, 3); - int res2 = gcc_vmacro2(1, 2); - ]]) - ],[ - curl_cv_variadic_macros_gcc="yes" - ],[ - curl_cv_variadic_macros_gcc="no" - ]) - ]) - case "$curl_cv_variadic_macros_gcc" in - yes) - AC_DEFINE_UNQUOTED(HAVE_VARIADIC_MACROS_GCC, 1, - [Define to 1 if compiler supports old gcc variadic macro style.]) - ;; - esac -]) - - dnl CURL_CHECK_CA_BUNDLE dnl ------------------------------------------------- dnl Check if a default ca-bundle should be used @@ -2552,18 +1111,18 @@ dnl regarding the paths this will scan: dnl /etc/ssl/certs/ca-certificates.crt Debian systems dnl /etc/pki/tls/certs/ca-bundle.crt Redhat and Mandriva dnl /usr/share/ssl/certs/ca-bundle.crt old(er) Redhat -dnl /usr/local/share/certs/ca-root-nss.crt FreeBSD -dnl /etc/ssl/cert.pem OpenBSD, FreeBSD (symlink) -dnl /etc/ssl/certs/ (ca path) SUSE +dnl /usr/local/share/certs/ca-root-nss.crt MidnightBSD +dnl /etc/ssl/cert.pem OpenBSD, MidnightBSD (symlink) +dnl /etc/ssl/certs (CA path) SUSE, FreeBSD AC_DEFUN([CURL_CHECK_CA_BUNDLE], [ AC_MSG_CHECKING([default CA cert bundle/path]) AC_ARG_WITH(ca-bundle, -AC_HELP_STRING([--with-ca-bundle=FILE], -[Path to a file containing CA certificates (example: /etc/ca-bundle.crt)]) -AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]), +AS_HELP_STRING([--with-ca-bundle=FILE], + [Absolute path to a file containing CA certificates (example: /etc/ca-bundle.crt)]) +AS_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]), [ want_ca="$withval" if test "x$want_ca" = "xyes"; then @@ -2572,12 +1131,12 @@ AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]), ], [ want_ca="unset" ]) AC_ARG_WITH(ca-path, -AC_HELP_STRING([--with-ca-path=DIRECTORY], -[Path to a directory containing CA certificates stored individually, with \ -their filenames in a hash format. This option can be used with OpenSSL, \ -GnuTLS and PolarSSL backends. Refer to OpenSSL c_rehash for details. \ +AS_HELP_STRING([--with-ca-path=DIRECTORY], + [Absolute path to a directory containing CA certificates stored individually, with \ +their filenames in a hash format. This option can be used with the OpenSSL, \ +GnuTLS, mbedTLS and wolfSSL backends. Refer to OpenSSL c_rehash for details. \ (example: /etc/certificates)]) -AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), +AS_HELP_STRING([--without-ca-path], [Don't use a default CA path]), [ want_capath="$withval" if test "x$want_capath" = "xyes"; then @@ -2601,21 +1160,19 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), capath="no" elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then dnl --with-ca-path given - if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then - AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL]) - fi capath="$want_capath" ca="no" else - dnl first try autodetecting a CA bundle , then a CA path - dnl both autodetections can be skipped by --without-ca-* + dnl First try auto-detecting a CA bundle, then a CA path. + dnl Both auto-detections can be skipped by --without-ca-* ca="no" capath="no" - if test "x$cross_compiling" != "xyes"; then + if test "x$cross_compiling" != "xyes" -a \ + "x$curl_cv_native_windows" != "xyes"; then dnl NOT cross-compiling and... dnl neither of the --with-ca-* options are provided if test "x$want_ca" = "xunset"; then - dnl the path we previously would have installed the curl ca bundle + dnl the path we previously would have installed the curl CA bundle dnl to, and thus we now check for an already existing cert in that dnl place in case we find no other if test "x$prefix" != xNONE; then @@ -2636,9 +1193,9 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), fi done fi - if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \ - "x$OPENSSL_ENABLED" = "x1"; then - check_capath="/etc/ssl/certs/" + AC_MSG_NOTICE([want $want_capath ca $ca]) + if test "x$want_capath" = "xunset"; then + check_capath="/etc/ssl/certs" fi else dnl no option given and cross-compiling @@ -2671,7 +1228,7 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), fi if test "x$ca" != "xno"; then - CURL_CA_BUNDLE='"'$ca'"' + CURL_CA_BUNDLE="$ca" AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle]) AC_SUBST(CURL_CA_BUNDLE) AC_MSG_RESULT([$ca]) @@ -2685,10 +1242,10 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), AC_MSG_RESULT([no]) fi - AC_MSG_CHECKING([whether to use builtin CA store of SSL library]) + AC_MSG_CHECKING([whether to use built-in CA store of SSL library]) AC_ARG_WITH(ca-fallback, -AC_HELP_STRING([--with-ca-fallback], [Use the built in CA store of the SSL library]) -AC_HELP_STRING([--without-ca-fallback], [Don't use the built in CA store of the SSL library]), +AS_HELP_STRING([--with-ca-fallback], [Use the built-in CA store of the SSL library]) +AS_HELP_STRING([--without-ca-fallback], [Don't use the built-in CA store of the SSL library]), [ if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter]) @@ -2700,60 +1257,107 @@ AC_HELP_STRING([--without-ca-fallback], [Don't use the built in CA store of the if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1"; then AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL or GnuTLS]) fi - AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use built in CA store of SSL library ]) + AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use built-in CA store of SSL library]) + fi +]) + + +dnl CURL_CHECK_CA_EMBED +dnl ------------------------------------------------- +dnl Check if a ca-bundle should be embedded + +AC_DEFUN([CURL_CHECK_CA_EMBED], [ + + AC_MSG_CHECKING([CA cert bundle path to embed in the curl tool]) + + AC_ARG_WITH(ca-embed, +AS_HELP_STRING([--with-ca-embed=FILE], + [Absolute path to a file containing CA certificates to embed in the curl tool (example: /etc/ca-bundle.crt)]) +AS_HELP_STRING([--without-ca-embed], [Don't embed a default CA bundle in the curl tool]), + [ + want_ca_embed="$withval" + if test "x$want_ca_embed" = "xyes"; then + AC_MSG_ERROR([--with-ca-embed=FILE requires a path to the CA bundle]) + fi + ], + [ want_ca_embed="unset" ]) + + CURL_CA_EMBED='' + if test "x$want_ca_embed" != "xno" -a "x$want_ca_embed" != "xunset" -a -f "$want_ca_embed"; then + CURL_CA_EMBED="$want_ca_embed" + AC_SUBST(CURL_CA_EMBED) + AC_MSG_RESULT([$want_ca_embed]) + else + AC_MSG_RESULT([no]) fi ]) dnl CURL_CHECK_WIN32_LARGEFILE dnl ------------------------------------------------- -dnl Check if curl's WIN32 large file will be used +dnl Check if curl's Win32 large file will be used AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ - AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl - AC_MSG_CHECKING([whether build target supports WIN32 file API]) - curl_win32_file_api="no" - if test "$curl_cv_header_windows_h" = "yes"; then - if test x"$enable_largefile" != "xno"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ -#if !defined(_WIN32_WCE) && \ - (defined(__MINGW32__) || \ - (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64)))) - int dummy=1; -#else - WIN32 large file API not supported. -#endif - ]]) - ],[ - curl_win32_file_api="win32_large_files" - ]) - fi - if test "$curl_win32_file_api" = "no"; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ -#if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER) - int dummy=1; -#else - WIN32 small file API not supported. -#endif - ]]) - ],[ - curl_win32_file_api="win32_small_files" - ]) + AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl + if test "$curl_cv_native_windows" = 'yes'; then + AC_MSG_CHECKING([whether build target supports Win32 large files]) + if test "$curl_cv_wince" = 'yes'; then + dnl Windows CE does not support large files + curl_win32_has_largefile='no' + else + dnl All mingw-w64 versions support large files + curl_win32_has_largefile='yes' fi + case "$curl_win32_has_largefile" in + yes) + if test x"$enable_largefile" = 'xno'; then + AC_MSG_RESULT([yes (large file disabled)]) + else + AC_MSG_RESULT([yes (large file enabled)]) + AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1, + [Define to 1 if you are building a Windows target with large file support.]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac fi - case "$curl_win32_file_api" in - win32_large_files) - AC_MSG_RESULT([yes (large file enabled)]) - AC_DEFINE_UNQUOTED(USE_WIN32_LARGE_FILES, 1, - [Define to 1 if you are building a Windows target with large file support.]) - ;; - win32_small_files) - AC_MSG_RESULT([yes (large file disabled)]) - AC_DEFINE_UNQUOTED(USE_WIN32_SMALL_FILES, 1, - [Define to 1 if you are building a Windows target without large file support.]) +]) + +dnl CURL_CHECK_WIN32_CRYPTO +dnl ------------------------------------------------- +dnl Check if curl's Win32 crypto lib can be used + +AC_DEFUN([CURL_CHECK_WIN32_CRYPTO], [ + AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl + AC_MSG_CHECKING([whether build target supports Win32 crypto API]) + curl_win32_crypto_api="no" + if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #undef inline + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include + ]],[[ + HCRYPTPROV hCryptProv; + if(CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { + CryptReleaseContext(hCryptProv, 0); + } + ]]) + ],[ + curl_win32_crypto_api="yes" + ]) + fi + case "$curl_win32_crypto_api" in + yes) + AC_MSG_RESULT([yes]) + AC_DEFINE_UNQUOTED(USE_WIN32_CRYPTO, 1, + [Define to 1 if you are building a Windows target with crypto API support.]) + USE_WIN32_CRYPTO=1 ;; *) AC_MSG_RESULT([no]) @@ -2770,10 +1374,10 @@ dnl variable while checking PKG_CONFIG_LIBDIR dnl AC_DEFUN([CURL_EXPORT_PCDIR], [ - if test -n "$1"; then - PKG_CONFIG_LIBDIR="$1" - export PKG_CONFIG_LIBDIR - fi + if test -n "$1"; then + PKG_CONFIG_LIBDIR="$1" + export PKG_CONFIG_LIBDIR + fi ]) dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir]) @@ -2788,71 +1392,124 @@ dnl Optionally PKG_CONFIG_LIBDIR may be given as $pcdir. dnl AC_DEFUN([CURL_CHECK_PKGCONFIG], [ - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], - [$PATH:/usr/bin:/usr/local/bin]) - fi + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], + [$PATH:/usr/bin:/usr/local/bin]) + fi - if test "x$PKGCONFIG" != "xno"; then - AC_MSG_CHECKING([for $1 options with pkg-config]) - dnl ask pkg-config about $1 - itexists=`CURL_EXPORT_PCDIR([$2]) dnl - $PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1` + if test "x$PKGCONFIG" != "xno"; then + AC_MSG_CHECKING([for $1 options with pkg-config]) + dnl ask pkg-config about $1 + itexists=`CURL_EXPORT_PCDIR([$2]) dnl + $PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1` - if test -z "$itexists"; then - dnl pkg-config does not have info about the given module! set the - dnl variable to 'no' - PKGCONFIG="no" - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([found]) - fi + if test -z "$itexists"; then + dnl pkg-config does not have info about the given module! set the + dnl variable to 'no' + PKGCONFIG="no" + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([found]) fi + fi ]) -dnl CURL_GENERATE_CONFIGUREHELP_PM +dnl CURL_PREPARE_CONFIGUREHELP_PM dnl ------------------------------------------------- -dnl Generate test harness configurehelp.pm module, defining and +dnl Prepare test harness configurehelp.pm module, defining and dnl initializing some perl variables with values which are known dnl when the configure script runs. For portability reasons, test dnl harness needs information on how to run the C preprocessor. -AC_DEFUN([CURL_GENERATE_CONFIGUREHELP_PM], [ +AC_DEFUN([CURL_PREPARE_CONFIGUREHELP_PM], [ AC_REQUIRE([AC_PROG_CPP])dnl tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null` if test -z "$tmp_cpp"; then tmp_cpp='cpp' fi - cat >./tests/configurehelp.pm <<_EOF -[@%:@] This is a generated file. Do not edit. - -package configurehelp; - -use strict; -use warnings; -use Exporter; - -use vars qw( - @ISA - @EXPORT_OK - \$Cpreprocessor - ); - -@ISA = qw(Exporter); + AC_SUBST(CURL_CPP, $tmp_cpp) +]) -@EXPORT_OK = qw( - \$Cpreprocessor - ); -\$Cpreprocessor = '$tmp_cpp'; +dnl CURL_PREPARE_BUILDINFO +dnl ------------------------------------------------- +dnl Save build info for test runner to pick up and log -1; -_EOF +AC_DEFUN([CURL_PREPARE_BUILDINFO], [ + curl_pflags="" + if test "$curl_cv_apple" = 'yes'; then + curl_pflags="${curl_pflags} APPLE" + fi + case $host in + *-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*) + curl_pflags="${curl_pflags} UNIX";; + esac + case $host in + *-*-*bsd*) + curl_pflags="${curl_pflags} BSD";; + esac + case $host in + *-*-android*) + curl_pflags="${curl_pflags} ANDROID" + ANDROID_PLATFORM_LEVEL=`echo "$host_os" | $SED -ne 's/.*android\(@<:@0-9@:>@*\).*/\1/p'` + if test -n "${ANDROID_PLATFORM_LEVEL}"; then + curl_pflags="${curl_pflags}-${ANDROID_PLATFORM_LEVEL}" + fi + ;; + esac + if test "$curl_cv_native_windows" = 'yes'; then + curl_pflags="${curl_pflags} WIN32" + fi + if test "$curl_cv_wince" = 'yes'; then + curl_pflags="${curl_pflags} WINCE" + fi + if test "$curl_cv_winuwp" = 'yes'; then + curl_pflags="${curl_pflags} UWP" + fi + case $host in + *-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*) + curl_pflags="${curl_pflags} UNIX";; + esac + case $host in + *-*-*bsd*) + curl_pflags="${curl_pflags} BSD";; + esac + if test "$curl_cv_cygwin" = 'yes'; then + curl_pflags="${curl_pflags} CYGWIN" + fi + case $host_os in + msdos*) curl_pflags="${curl_pflags} DOS";; + amiga*) curl_pflags="${curl_pflags} AMIGA";; + esac + if test "x$compiler_id" = 'xGNU_C'; then + curl_pflags="${curl_pflags} GCC" + fi + case $host_os in + mingw*) curl_pflags="${curl_pflags} MINGW";; + esac + if test "x$cross_compiling" = 'xyes'; then + curl_pflags="${curl_pflags} CROSS" + fi + squeeze curl_pflags + curl_buildinfo=" +buildinfo.configure.tool: configure +buildinfo.configure.args: $ac_configure_args +buildinfo.host: $build +buildinfo.host.cpu: $build_cpu +buildinfo.host.os: $build_os +buildinfo.target: $host +buildinfo.target.cpu: $host_cpu +buildinfo.target.os: $host_os +buildinfo.target.flags: $curl_pflags +buildinfo.compiler: $compiler_id +buildinfo.compiler.version: $compiler_ver +buildinfo.sysroot: $lt_sysroot" ]) + dnl CURL_CPP_P dnl dnl Check if $cpp -P should be used for extract define values due to gcc 5 @@ -2902,47 +1559,20 @@ TEST EINVAL TEST ]) -dnl CURL_MAC_CFLAGS +dnl CURL_DARWIN_CFLAGS dnl -dnl Check if -mmacosx-version-min, -miphoneos-version-min or any -dnl similar are set manually, otherwise do. And set -dnl -Werror=partial-availability. +dnl Set -Werror=partial-availability to detect possible breaking code +dnl with very low deployment targets. dnl -AC_DEFUN([CURL_MAC_CFLAGS], [ - - tst_cflags="no" - case $host_os in - darwin*) - tst_cflags="yes" - ;; - esac - - AC_MSG_CHECKING([for good-to-use Mac CFLAGS]) - AC_MSG_RESULT([$tst_cflags]); - - if test "$tst_cflags" = "yes"; then - AC_MSG_CHECKING([for *version-min in CFLAGS]) - min="" - if test -z "$(echo $CFLAGS | grep m.*os.*-version-min)"; then - min="-mmacosx-version-min=10.8" - CFLAGS="$CFLAGS $min" - fi - if test -z "$min"; then - AC_MSG_RESULT([set by user]) - else - AC_MSG_RESULT([$min set]) - fi - - old_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Werror=partial-availability" - AC_MSG_CHECKING([whether $CC accepts -Werror=partial-availability]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - CFLAGS=$old_CFLAGS]) - fi - +AC_DEFUN([CURL_DARWIN_CFLAGS], [ + old_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror=partial-availability" + AC_MSG_CHECKING([whether $CC accepts -Werror=partial-availability]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + CFLAGS=$old_CFLAGS]) ]) @@ -2958,14 +1588,13 @@ AC_DEFUN([CURL_SUPPORTS_BUILTIN_AVAILABLE], [ AC_MSG_CHECKING([to see if the compiler supports __builtin_available()]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include ]],[[ - if (__builtin_available(macOS 10.8, iOS 5.0, *)) {} + if(__builtin_available(macOS 10.12, iOS 5.0, *)) {} ]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED(HAVE_BUILTIN_AVAILABLE, 1, - [Define to 1 if you have the __builtin_available function.]) + [Define to 1 if you have the __builtin_available function.]) ],[ AC_MSG_RESULT([no]) ]) diff --git a/curl/aclocal.m4 b/curl/aclocal.m4 index c17bd6147..b660ce738 100644 --- a/curl/aclocal.m4 +++ b/curl/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15.1], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15.1])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -108,9 +108,46 @@ AC_DEFUN([AM_AUX_DIR_EXPAND], am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) +# AM_COND_IF -*- Autoconf -*- + +# Copyright (C) 2008-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_COND_IF +# _AM_COND_ELSE +# _AM_COND_ENDIF +# -------------- +# These macros are only used for tracing. +m4_define([_AM_COND_IF]) +m4_define([_AM_COND_ELSE]) +m4_define([_AM_COND_ENDIF]) + +# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE]) +# --------------------------------------- +# If the shell condition COND is true, execute IF-TRUE, otherwise execute +# IF-FALSE. Allow automake to learn about conditional instantiating macros +# (the AC_CONFIG_FOOS). +AC_DEFUN([AM_COND_IF], +[m4_ifndef([_AM_COND_VALUE_$1], + [m4_fatal([$0: no such condition "$1"])])dnl +_AM_COND_IF([$1])dnl +if test -z "$$1_TRUE"; then : + m4_n([$2])[]dnl +m4_ifval([$3], +[_AM_COND_ELSE([$1])dnl +else + $3 +])dnl +_AM_COND_ENDIF([$1])dnl +fi[]dnl +]) + # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +178,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,13 +369,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -346,49 +382,43 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -397,18 +427,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -436,6 +465,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -472,7 +505,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -495,8 +528,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -524,6 +557,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -563,7 +610,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -605,7 +652,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -626,7 +673,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2017 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -648,7 +695,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -683,7 +730,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -691,49 +738,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -754,12 +794,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -772,7 +807,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -801,7 +836,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -848,7 +883,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -867,7 +902,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -948,7 +983,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1008,7 +1043,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1036,7 +1071,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2017 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1055,7 +1090,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2017 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1186,13 +1221,19 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/ax_code_coverage.m4]) +m4_include([m4/curl-amissl.m4]) m4_include([m4/curl-compilers.m4]) m4_include([m4/curl-confopts.m4]) m4_include([m4/curl-functions.m4]) +m4_include([m4/curl-gnutls.m4]) +m4_include([m4/curl-mbedtls.m4]) m4_include([m4/curl-openssl.m4]) m4_include([m4/curl-override.m4]) m4_include([m4/curl-reentrant.m4]) +m4_include([m4/curl-rustls.m4]) +m4_include([m4/curl-schannel.m4]) +m4_include([m4/curl-sysconfig.m4]) +m4_include([m4/curl-wolfssl.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) @@ -1201,7 +1242,6 @@ m4_include([m4/lt~obsolete.m4]) m4_include([m4/xc-am-iface.m4]) m4_include([m4/xc-cc-check.m4]) m4_include([m4/xc-lt-iface.m4]) -m4_include([m4/xc-translit.m4]) m4_include([m4/xc-val-flgs.m4]) m4_include([m4/zz40-xc-ovr.m4]) m4_include([m4/zz50-xc-ovr.m4]) diff --git a/curl/buildconf b/curl/buildconf deleted file mode 100644 index 509575312..000000000 --- a/curl/buildconf +++ /dev/null @@ -1,448 +0,0 @@ -#!/bin/sh -#*************************************************************************** -# _ _ ____ _ -# Project ___| | | | _ \| | -# / __| | | | |_) | | -# | (__| |_| | _ <| |___ -# \___|\___/|_| \_\_____| -# -# Copyright (C) 1998 - 2017, Daniel Stenberg, , 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.haxx.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. -# -########################################################################### - -#-------------------------------------------------------------------------- -# die prints argument string to stdout and exits this shell script. -# -die(){ - echo "buildconf: $@" - exit 1 -} - -#-------------------------------------------------------------------------- -# findtool works as 'which' but we use a different name to make it more -# obvious we aren't using 'which'! ;-) -# Unlike 'which' does, the current directory is ignored. -# -findtool(){ - file="$1" - - if { echo "$file" | grep "/" >/dev/null 2>&1; } then - # when file is given with a path check it first - if test -f "$file"; then - echo "$file" - return - fi - fi - - old_IFS=$IFS; IFS=':' - for path in $PATH - do - IFS=$old_IFS - # echo "checks for $file in $path" >&2 - if test "$path" -a "$path" != '.' -a -f "$path/$file"; then - echo "$path/$file" - return - fi - done - IFS=$old_IFS -} - -#-------------------------------------------------------------------------- -# removethis() removes all files and subdirectories with the given name, -# inside and below the current subdirectory at invocation time. -# -removethis(){ - if test "$#" = "1"; then - find . -depth -name $1 -print > buildconf.tmp.$$ - while read fdname - do - if test -f "$fdname"; then - rm -f "$fdname" - elif test -d "$fdname"; then - rm -f -r "$fdname" - fi - done < buildconf.tmp.$$ - rm -f buildconf.tmp.$$ - fi -} - -#-------------------------------------------------------------------------- -# Ensure that buildconf runs from the subdirectory where configure.ac lives -# -if test ! -f configure.ac || - test ! -f src/tool_main.c || - test ! -f lib/urldata.h || - test ! -f include/curl/curl.h || - test ! -f m4/curl-functions.m4; then - echo "Can not run buildconf from outside of curl's source subdirectory!" - echo "Change to the subdirectory where buildconf is found, and try again." - exit 1 -fi - -#-------------------------------------------------------------------------- -# autoconf 2.57 or newer. Unpatched version 2.67 does not generate proper -# configure script. Unpatched version 2.68 is simply unusable, we should -# disallow 2.68 usage. -# -need_autoconf="2.57" -ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ac_version"; then - echo "buildconf: autoconf not found." - echo " You need autoconf version $need_autoconf or newer installed." - exit 1 -fi -old_IFS=$IFS; IFS='.'; set $ac_version; IFS=$old_IFS -if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then - echo "buildconf: autoconf version $ac_version found." - echo " You need autoconf version $need_autoconf or newer installed." - echo " If you have a sufficient autoconf installed, but it" - echo " is not named 'autoconf', then try setting the" - echo " AUTOCONF environment variable." - exit 1 -fi - -if test "$1" = "2" -a "$2" -eq "67"; then - echo "buildconf: autoconf version $ac_version (BAD)" - echo " Unpatched version generates broken configure script." -elif test "$1" = "2" -a "$2" -eq "68"; then - echo "buildconf: autoconf version $ac_version (BAD)" - echo " Unpatched version generates unusable configure script." -else - echo "buildconf: autoconf version $ac_version (ok)" -fi - -am4te_version=`${AUTOM4TE:-autom4te} --version 2>/dev/null|head -n 1| sed -e 's/autom4te\(.*\)/\1/' -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$am4te_version"; then - echo "buildconf: autom4te not found. Weird autoconf installation!" - exit 1 -fi -if test "$am4te_version" = "$ac_version"; then - echo "buildconf: autom4te version $am4te_version (ok)" -else - echo "buildconf: autom4te version $am4te_version (ERROR: does not match autoconf version)" - exit 1 -fi - -#-------------------------------------------------------------------------- -# autoheader 2.50 or newer -# -ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ah_version"; then - echo "buildconf: autoheader not found." - echo " You need autoheader version 2.50 or newer installed." - exit 1 -fi -old_IFS=$IFS; IFS='.'; set $ah_version; IFS=$old_IFS -if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then - echo "buildconf: autoheader version $ah_version found." - echo " You need autoheader version 2.50 or newer installed." - echo " If you have a sufficient autoheader installed, but it" - echo " is not named 'autoheader', then try setting the" - echo " AUTOHEADER environment variable." - exit 1 -fi - -echo "buildconf: autoheader version $ah_version (ok)" - -#-------------------------------------------------------------------------- -# automake 1.7 or newer -# -need_automake="1.7" -am_version=`${AUTOMAKE:-automake} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'` -if test -z "$am_version"; then - echo "buildconf: automake not found." - echo " You need automake version $need_automake or newer installed." - exit 1 -fi -old_IFS=$IFS; IFS='.'; set $am_version; IFS=$old_IFS -if test "$1" = "1" -a "$2" -lt "7" || test "$1" -lt "1"; then - echo "buildconf: automake version $am_version found." - echo " You need automake version $need_automake or newer installed." - echo " If you have a sufficient automake installed, but it" - echo " is not named 'automake', then try setting the" - echo " AUTOMAKE environment variable." - exit 1 -fi - -echo "buildconf: automake version $am_version (ok)" - -acloc_version=`${ACLOCAL:-aclocal} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'` -if test -z "$acloc_version"; then - echo "buildconf: aclocal not found. Weird automake installation!" - exit 1 -fi -if test "$acloc_version" = "$am_version"; then - echo "buildconf: aclocal version $acloc_version (ok)" -else - echo "buildconf: aclocal version $acloc_version (ERROR: does not match automake version)" - exit 1 -fi - -#-------------------------------------------------------------------------- -# GNU libtoolize preliminary check -# -want_lt_major=1 -want_lt_minor=4 -want_lt_patch=2 -want_lt_version=1.4.2 - -# This approach that tries 'glibtoolize' first is intended for systems that -# have GNU libtool named as 'glibtoolize' and libtoolize not being GNU's. - -libtoolize=`findtool glibtoolize 2>/dev/null` -if test ! -x "$libtoolize"; then - libtoolize=`findtool ${LIBTOOLIZE:-libtoolize}` -fi -if test -z "$libtoolize"; then - echo "buildconf: libtoolize not found." - echo " You need GNU libtoolize $want_lt_version or newer installed." - exit 1 -fi - -lt_pver=`$libtoolize --version 2>/dev/null|head -n 1` -lt_qver=`echo $lt_pver|sed -e "s/([^)]*)//g" -e "s/^[^0-9]*//g"` -lt_version=`echo $lt_qver|sed -e "s/[- ].*//" -e "s/\([a-z]*\)$//"` -if test -z "$lt_version"; then - echo "buildconf: libtoolize not found." - echo " You need GNU libtoolize $want_lt_version or newer installed." - exit 1 -fi -old_IFS=$IFS; IFS='.'; set $lt_version; IFS=$old_IFS -lt_major=$1 -lt_minor=$2 -lt_patch=$3 - -if test -z "$lt_major"; then - lt_status="bad" -elif test "$lt_major" -gt "$want_lt_major"; then - lt_status="good" -elif test "$lt_major" -lt "$want_lt_major"; then - lt_status="bad" -elif test -z "$lt_minor"; then - lt_status="bad" -elif test "$lt_minor" -gt "$want_lt_minor"; then - lt_status="good" -elif test "$lt_minor" -lt "$want_lt_minor"; then - lt_status="bad" -elif test -z "$lt_patch"; then - lt_status="bad" -elif test "$lt_patch" -gt "$want_lt_patch"; then - lt_status="good" -elif test "$lt_patch" -lt "$want_lt_patch"; then - lt_status="bad" -else - lt_status="good" -fi -if test "$lt_status" != "good"; then - echo "buildconf: libtoolize version $lt_version found." - echo " You need GNU libtoolize $want_lt_version or newer installed." - exit 1 -fi - -echo "buildconf: libtoolize version $lt_version (ok)" - -#-------------------------------------------------------------------------- -# m4 check -# -m4=`(${M4:-m4} --version 0<&- || ${M4:-gm4} --version) 2>/dev/null 0<&- | head -n 1`; -m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'` - -if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then - echo "buildconf: GNU m4 version $m4_version (ok)" -else - if test -z "$m4"; then - echo "buildconf: m4 version not recognized. You need a GNU m4 installed!" - else - echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!" - fi - exit 1 -fi - -#-------------------------------------------------------------------------- -# perl check -# -PERL=`findtool ${PERL:-perl}` -if test -z "$PERL"; then - echo "buildconf: perl not found" - exit 1 -fi - -#-------------------------------------------------------------------------- -# Remove files generated on previous buildconf/configure run. -# -for fname in .deps \ - .libs \ - *.la \ - *.lo \ - *.a \ - *.o \ - Makefile \ - Makefile.in \ - aclocal.m4 \ - aclocal.m4.bak \ - ares_build.h \ - ares_config.h \ - ares_config.h.in \ - autom4te.cache \ - compile \ - config.guess \ - curl_config.h \ - curl_config.h.in \ - config.log \ - config.lt \ - config.status \ - config.sub \ - configure \ - configurehelp.pm \ - curl-config \ - depcomp \ - libcares.pc \ - libcurl.pc \ - libtool \ - libtool.m4 \ - libtool.m4.tmp \ - ltmain.sh \ - ltoptions.m4 \ - ltsugar.m4 \ - ltversion.m4 \ - lt~obsolete.m4 \ - missing \ - install-sh \ - stamp-h1 \ - stamp-h2 \ - stamp-h3 ; do - removethis "$fname" -done - -#-------------------------------------------------------------------------- -# run the correct scripts now -# - -echo "buildconf: running libtoolize" -${libtoolize} --copy --force || die "libtoolize command failed" - -# When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4 -# subdirectory and this local copy is patched to fix some warnings that -# are triggered when running aclocal and using autoconf 2.62 or later. - -if test "$lt_major" = "1" && test "$lt_minor" = "5"; then - if test -z "$lt_patch" || test "$lt_patch" -lt "26"; then - echo "buildconf: copying libtool.m4 to local m4 subdir" - ac_dir=`${ACLOCAL:-aclocal} --print-ac-dir` - if test -f $ac_dir/libtool.m4; then - cp -f $ac_dir/libtool.m4 m4/libtool.m4 - else - echo "buildconf: $ac_dir/libtool.m4 not found" - fi - if test -f m4/libtool.m4; then - echo "buildconf: renaming some variables in local m4/libtool.m4" - $PERL -i.tmp -pe \ - 's/lt_prog_compiler_pic_works/lt_cv_prog_compiler_pic_works/g; \ - s/lt_prog_compiler_static_works/lt_cv_prog_compiler_static_works/g;' \ - m4/libtool.m4 - rm -f m4/libtool.m4.tmp - fi - fi -fi - -if test -f m4/libtool.m4; then - echo "buildconf: converting all mv to mv -f in local m4/libtool.m4" - $PERL -i.tmp -pe 's/\bmv +([^-\s])/mv -f $1/g' m4/libtool.m4 - rm -f m4/libtool.m4.tmp -fi - -echo "buildconf: running aclocal" -${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "aclocal command failed" - -echo "buildconf: converting all mv to mv -f in local aclocal.m4" -$PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4 - -echo "buildconf: running autoheader" -${AUTOHEADER:-autoheader} || die "autoheader command failed" - -echo "buildconf: running autoconf" -${AUTOCONF:-autoconf} || die "autoconf command failed" - -if test -d ares; then - cd ares - echo "buildconf: running in ares" - ./buildconf - cd .. -fi - -echo "buildconf: running automake" -${AUTOMAKE:-automake} --add-missing --copy || die "automake command failed" - -#-------------------------------------------------------------------------- -# GNU libtool complementary check -# -# Depending on the libtool and automake versions being used, config.guess -# might not be installed in the subdirectory until automake has finished. -# So we can not attempt to use it until this very last buildconf stage. -# -if test ! -f ./config.guess; then - echo "buildconf: config.guess not found" -else - buildhost=`./config.guess 2>/dev/null|head -n 1` - case $buildhost in - *-*-darwin*) - need_lt_major=1 - need_lt_minor=5 - need_lt_patch=26 - need_lt_check="yes" - ;; - *-*-hpux*) - need_lt_major=1 - need_lt_minor=5 - need_lt_patch=24 - need_lt_check="yes" - ;; - esac - if test ! -z "$need_lt_check"; then - if test -z "$lt_major"; then - lt_status="bad" - elif test "$lt_major" -gt "$need_lt_major"; then - lt_status="good" - elif test "$lt_major" -lt "$need_lt_major"; then - lt_status="bad" - elif test -z "$lt_minor"; then - lt_status="bad" - elif test "$lt_minor" -gt "$need_lt_minor"; then - lt_status="good" - elif test "$lt_minor" -lt "$need_lt_minor"; then - lt_status="bad" - elif test -z "$lt_patch"; then - lt_status="bad" - elif test "$lt_patch" -gt "$need_lt_patch"; then - lt_status="good" - elif test "$lt_patch" -lt "$need_lt_patch"; then - lt_status="bad" - else - lt_status="good" - fi - if test "$lt_status" != "good"; then - need_lt_version="$need_lt_major.$need_lt_minor.$need_lt_patch" - echo "buildconf: libtool version $lt_version found." - echo " $buildhost requires GNU libtool $need_lt_version or newer installed." - rm -f configure - exit 1 - fi - fi -fi - -#-------------------------------------------------------------------------- -# Finished successfully. -# -echo "buildconf: OK" -exit 0 diff --git a/curl/buildconf.bat b/curl/buildconf.bat deleted file mode 100644 index da5c0391a..000000000 --- a/curl/buildconf.bat +++ /dev/null @@ -1,317 +0,0 @@ -@echo off -rem *************************************************************************** -rem * _ _ ____ _ -rem * Project ___| | | | _ \| | -rem * / __| | | | |_) | | -rem * | (__| |_| | _ <| |___ -rem * \___|\___/|_| \_\_____| -rem * -rem * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. -rem * -rem * This software is licensed as described in the file COPYING, which -rem * you should have received as part of this distribution. The terms -rem * are also available at https://curl.haxx.se/docs/copyright.html. -rem * -rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell -rem * copies of the Software, and permit persons to whom the Software is -rem * furnished to do so, under the terms of the COPYING file. -rem * -rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -rem * KIND, either express or implied. -rem * -rem *************************************************************************** - -rem NOTES -rem -rem This batch file must be used to set up a git tree to build on systems where -rem there is no autotools support (i.e. DOS and Windows). -rem - -:begin - rem Set our variables - if "%OS%" == "Windows_NT" setlocal - set MODE=GENERATE - - rem Switch to this batch file's directory - cd /d "%~0\.." 1>NUL 2>&1 - - rem Check we are running from a curl git repository - if not exist GIT-INFO goto norepo - - rem Detect programs. HAVE_ - rem When not found the variable is set undefined. The undefined pattern - rem allows for statements like "if not defined HAVE_PERL (command)" - groff --version NUL 2>&1 - if errorlevel 1 (set HAVE_GROFF=) else (set HAVE_GROFF=Y) - nroff --version NUL 2>&1 - if errorlevel 1 (set HAVE_NROFF=) else (set HAVE_NROFF=Y) - perl --version NUL 2>&1 - if errorlevel 1 (set HAVE_PERL=) else (set HAVE_PERL=Y) - gzip --version NUL 2>&1 - if errorlevel 1 (set HAVE_GZIP=) else (set HAVE_GZIP=Y) - -:parseArgs - if "%~1" == "" goto start - - if /i "%~1" == "-clean" ( - set MODE=CLEAN - ) else if /i "%~1" == "-?" ( - goto syntax - ) else if /i "%~1" == "-h" ( - goto syntax - ) else if /i "%~1" == "-help" ( - goto syntax - ) else ( - goto unknown - ) - - shift & goto parseArgs - -:start - if "%MODE%" == "GENERATE" ( - echo. - echo Generating prerequisite files - - call :generate - if errorlevel 3 goto nogenhugehelp - if errorlevel 2 goto nogenmakefile - if errorlevel 1 goto warning - - ) else ( - echo. - echo Removing prerequisite files - - call :clean - if errorlevel 2 goto nocleanhugehelp - if errorlevel 1 goto nocleanmakefile - ) - - goto success - -rem Main generate function. -rem -rem Returns: -rem -rem 0 - success -rem 1 - success with simplified tool_hugehelp.c -rem 2 - failed to generate Makefile -rem 3 - failed to generate tool_hugehelp.c -rem -:generate - if "%OS%" == "Windows_NT" setlocal - set BASIC_HUGEHELP=0 - - rem Create Makefile - echo * %CD%\Makefile - if exist Makefile.dist ( - copy /Y Makefile.dist Makefile 1>NUL 2>&1 - if errorlevel 1 ( - if "%OS%" == "Windows_NT" endlocal - exit /B 2 - ) - ) - - rem Create tool_hugehelp.c - echo * %CD%\src\tool_hugehelp.c - call :genHugeHelp - if errorlevel 2 ( - if "%OS%" == "Windows_NT" endlocal - exit /B 3 - ) - if errorlevel 1 ( - set BASIC_HUGEHELP=1 - ) - cmd /c exit 0 - - rem Setup c-ares git tree - if exist ares\buildconf.bat ( - echo. - echo Configuring c-ares build environment - cd ares - call buildconf.bat - cd .. - ) - - if "%BASIC_HUGEHELP%" == "1" ( - if "%OS%" == "Windows_NT" endlocal - exit /B 1 - ) - - if "%OS%" == "Windows_NT" endlocal - exit /B 0 - -rem Main clean function. -rem -rem Returns: -rem -rem 0 - success -rem 1 - failed to clean Makefile -rem 2 - failed to clean tool_hugehelp.c -rem -:clean - rem Remove Makefile - echo * %CD%\Makefile - if exist Makefile ( - del Makefile 2>NUL - if exist Makefile ( - exit /B 1 - ) - ) - - rem Remove tool_hugehelp.c - echo * %CD%\src\tool_hugehelp.c - if exist src\tool_hugehelp.c ( - del src\tool_hugehelp.c 2>NUL - if exist src\tool_hugehelp.c ( - exit /B 2 - ) - ) - - exit /B - -rem Function to generate src\tool_hugehelp.c -rem -rem Returns: -rem -rem 0 - full tool_hugehelp.c generated -rem 1 - simplified tool_hugehelp.c -rem 2 - failure -rem -:genHugeHelp - if "%OS%" == "Windows_NT" setlocal - set LC_ALL=C - set ROFFCMD= - set BASIC=1 - - if defined HAVE_PERL ( - if defined HAVE_GROFF ( - set ROFFCMD=groff -mtty-char -Tascii -P-c -man - ) else if defined HAVE_NROFF ( - set ROFFCMD=nroff -c -Tascii -man - ) - ) - - if defined ROFFCMD ( - echo #include "tool_setup.h"> src\tool_hugehelp.c - echo #include "tool_hugehelp.h">> src\tool_hugehelp.c - - if defined HAVE_GZIP ( - echo #ifndef HAVE_LIBZ>> src\tool_hugehelp.c - ) - - %ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl docs\MANUAL >> src\tool_hugehelp.c - if defined HAVE_GZIP ( - echo #else>> src\tool_hugehelp.c - %ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl -c docs\MANUAL >> src\tool_hugehelp.c - echo #endif /^* HAVE_LIBZ ^*/>> src\tool_hugehelp.c - ) - - set BASIC=0 - ) else ( - if exist src\tool_hugehelp.c.cvs ( - copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c 1>NUL 2>&1 - ) else ( - echo #include "tool_setup.h"> src\tool_hugehelp.c - echo #include "tool_hugehelp.hd">> src\tool_hugehelp.c - echo.>> src\tool_hugehelp.c - echo void hugehelp(void^)>> src\tool_hugehelp.c - echo {>> src\tool_hugehelp.c - echo #ifdef USE_MANUAL>> src\tool_hugehelp.c - echo fputs("Built-in manual not included\n", stdout^);>> src\tool_hugehelp.c - echo #endif>> src\tool_hugehelp.c - echo }>> src\tool_hugehelp.c - ) - ) - - findstr "/C:void hugehelp(void)" src\tool_hugehelp.c 1>NUL 2>&1 - if errorlevel 1 ( - if "%OS%" == "Windows_NT" endlocal - exit /B 2 - ) - - if "%BASIC%" == "1" ( - if "%OS%" == "Windows_NT" endlocal - exit /B 1 - ) - - if "%OS%" == "Windows_NT" endlocal - exit /B 0 - -rem Function to clean-up local variables under DOS, Windows 3.x and -rem Windows 9x as setlocal isn't available until Windows NT -rem -:dosCleanup - set MODE= - set HAVE_GROFF= - set HAVE_NROFF= - set HAVE_PERL= - set HAVE_GZIP= - set BASIC_HUGEHELP= - set LC_ALL - set ROFFCMD= - set BASIC= - - exit /B - -:syntax - rem Display the help - echo. - echo Usage: buildconf [-clean] - echo. - echo -clean - Removes the files - goto error - -:unknown - echo. - echo Error: Unknown argument '%1' - goto error - -:norepo - echo. - echo Error: This batch file should only be used with a curl git repository - goto error - -:nogenmakefile - echo. - echo Error: Unable to generate Makefile - goto error - -:nogenhugehelp - echo. - echo Error: Unable to generate src\tool_hugehelp.c - goto error - -:nocleanmakefile - echo. - echo Error: Unable to clean Makefile - goto error - -:nocleanhugehelp - echo. - echo Error: Unable to clean src\tool_hugehelp.c - goto error - -:warning - echo. - echo Warning: The curl manual could not be integrated in the source. This means when - echo you build curl the manual will not be available (curl --man^). Integration of - echo the manual is not required and a summary of the options will still be available - echo (curl --help^). To integrate the manual your PATH is required to have - echo groff/nroff, perl and optionally gzip for compression. - goto success - -:error - if "%OS%" == "Windows_NT" ( - endlocal - ) else ( - call :dosCleanup - ) - exit /B 1 - -:success - if "%OS%" == "Windows_NT" ( - endlocal - ) else ( - call :dosCleanup - ) - exit /B 0 diff --git a/curl/compile b/curl/compile index a85b723c7..df363c8fb 100644 --- a/curl/compile +++ b/curl/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/curl/config.guess b/curl/config.guess index 2e9ad7fe8..7f76b6228 100644 --- a/curl/config.guess +++ b/curl/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2016-10-02' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ timestamp='2016-10-02' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,11 +29,19 @@ timestamp='2016-10-02' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -39,7 +49,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,7 +94,8 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +# Just in case it came from the environment. +GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -96,66 +107,90 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -167,32 +202,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +243,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,47 +254,68 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -273,7 +329,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -310,126 +366,121 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -439,44 +490,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -485,95 +536,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux${UNAME_RELEASE} + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -584,77 +636,77 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -687,13 +739,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -712,15 +764,15 @@ EOF HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -745,38 +797,38 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -784,139 +836,148 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case $UNAME_PROCESSOR in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case $UNAME_MACHINE in x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -927,183 +988,225 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1111,12 +1214,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1126,11 +1229,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1138,31 +1241,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1170,9 +1273,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1181,249 +1284,437 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv${UNAME_RELEASE} + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/curl/config.sub b/curl/config.sub index dd2ca93c6..dba16e84c 100644 --- a/curl/config.sub +++ b/curl/config.sub @@ -1,12 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2016-11-04' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ timestamp='2016-11-04' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +35,7 @@ timestamp='2016-11-04' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,6 +52,13 @@ timestamp='2016-11-04' # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -57,7 +66,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +76,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -89,12 +98,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,1244 +119,1186 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + basic_os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + basic_os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos + cpu=m68k + vendor=motorola ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) + cpu=mips + vendor=sgi + case $basic_os in + irix*) ;; *) - os=-irix4 + basic_os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl + cpu=m68000 + vendor=convergent ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + basic_os=nextstep2 ;; *) - os=-nextstep3 + basic_os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + basic_os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc + cpu=m68k + vendor=tti ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown + cpu=pn + vendor=gould ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + cpu=i386 + vendor=ibm ;; rm[46]00) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm + cpu=romp + vendor=ibm ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} ;; - sb1) - basic_machine=mipsisa64sb1-unknown + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sde) - basic_machine=mipsisa32-sde - os=-elf + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sei) - basic_machine=mips-sei - os=-seiux + w65) + cpu=w65 + vendor=wdc ;; - sequent) - basic_machine=i386-sequent + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf ;; - sh) - basic_machine=sh-hitachi - os=-hms + none) + cpu=none + vendor=none ;; - sh5el) - basic_machine=sh5le-unknown + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - sh64) - basic_machine=sh64-unknown + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb | arc32 | arc64 \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1355,203 +1306,215 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if test x$basic_os != x then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1564,261 +1527,363 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; - *-be) - os=-beos + pru-*) + os=elf ;; - *-haiku) - os=-haiku + *-be) + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - -os400*) + s390-* | s390x-*) vendor=ibm ;; - -ptx*) + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/curl/configure b/curl/configure index c6701b527..3b7b0df6a 100644 --- a/curl/configure +++ b/curl/configure @@ -1,17 +1,18 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for curl -. +# Generated by GNU Autoconf 2.71 for curl -. # -# Report bugs to . +# Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # -# Copyright (c) 1998 - 2017 Daniel Stenberg, +# Copyright (C) Daniel Stenberg, # This configure script may be copied, distributed and modified under the # terms of the curl license; see COPYING for more details @@ -233,9 +234,10 @@ if test $xc_tst_dirs_sem -eq $xc_tst_dirs_col; then # When both counting methods give the same result we do not want to # chose one over the other, and consider auto-detection not possible. if test -z "$PATH_SEPARATOR"; then - # Stop dead until user provides 'PATH_SEPARATOR' definition. - echo "$xc_msg_err 'PATH_SEPARATOR' variable not set. $xc_msg_abrt" >&2 - exit 1 + # User should provide the correct 'PATH_SEPARATOR' definition. + # Until then, guess that it is colon! + echo "$xc_msg_warn path separator not determined, guessing colon" >&2 + PATH_SEPARATOR=':' fi else # Separator with the greater directory count is the auto-detected one. @@ -262,14 +264,16 @@ xc_configure_preamble_result='yes' # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -279,53 +283,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) IFS=" "" $as_nl" +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + + + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -334,8 +331,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -347,30 +348,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -392,20 +373,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -425,12 +408,15 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO @@ -445,30 +431,38 @@ test \$(( 1 + 1 )) = 2 || exit 1 PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -476,14 +470,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -501,20 +502,21 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and a suitable curl -$0: mailing list: https://curl.haxx.se/mail/ about your -$0: system, including any error possibly output before this + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and a suitable curl +$0: mailing list: https://curl.se/mail/ about your system, +$0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi @@ -540,6 +542,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -557,6 +560,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -571,7 +582,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -580,7 +591,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -619,12 +630,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -636,18 +648,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -659,9 +680,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -688,7 +709,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -732,7 +753,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -746,6 +767,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -759,6 +784,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -830,143 +862,109 @@ PACKAGE_NAME='curl' PACKAGE_TARNAME='curl' PACKAGE_VERSION='-' PACKAGE_STRING='curl -' -PACKAGE_BUGREPORT='a suitable curl mailing list: https://curl.haxx.se/mail/' +PACKAGE_BUGREPORT='a suitable curl mailing list: https://curl.se/mail/' PACKAGE_URL='' ac_unique_file="lib/urldata.h" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" -enable_option_checking=no +ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +CURL_CPP +SSL_BACKENDS SUPPORT_PROTOCOLS SUPPORT_FEATURES +LIBCURL_PC_LIBS +LIBCURL_PC_REQUIRES +LIBCURL_PC_REQUIRES_PRIVATE ENABLE_STATIC ENABLE_SHARED CROSSCOMPILING_FALSE CROSSCOMPILING_TRUE BLANK_AT_MAKETIME CURL_NETWORK_AND_TIME_LIBS -CURL_NETWORK_LIBS -LIBCURL_LIBS +LIBCURL_PC_LIBS_PRIVATE +LIBCURL_PC_LDFLAGS_PRIVATE CFLAG_CURL_SYMBOL_HIDING DOING_CURL_SYMBOL_HIDING_FALSE DOING_CURL_SYMBOL_HIDING_TRUE -USE_UNIX_SOCKETS -BUILD_LIBHOSTNAME_FALSE -BUILD_LIBHOSTNAME_TRUE -USE_EMBEDDED_ARES_FALSE -USE_EMBEDDED_ARES_TRUE -USE_ARES -subdirs USE_MANUAL_FALSE USE_MANUAL_TRUE -MANOPT -NROFF +BUILD_DOCS_FALSE +BUILD_DOCS_TRUE PERL -IPV6_ENABLED +USE_FISH_COMPLETION_FALSE +USE_FISH_COMPLETION_TRUE +FISH_FUNCTIONS_DIR +USE_ZSH_COMPLETION_FALSE +USE_ZSH_COMPLETION_TRUE ZSH_FUNCTIONS_DIR -USE_NGHTTP2 -IDN_ENABLED +USE_UNICODE_FALSE +USE_UNICODE_TRUE CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE -CURL_LT_SHLIB_VERSIONED_FLAVOUR -USE_LIBRTMP -USE_LIBSSH2 -LIBMETALINK_CPPFLAGS -LIBMETALINK_LDFLAGS -LIBMETALINK_LIBS +CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME +CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX +USE_GSASL_FALSE +USE_GSASL_TRUE USE_LIBPSL_FALSE USE_LIBPSL_TRUE +CURL_CA_EMBED_SET_FALSE +CURL_CA_EMBED_SET_TRUE +CURL_CA_EMBED CURL_CA_BUNDLE -CURL_WITH_MULTI_SSL -SSL_ENABLED -USE_AXTLS -NSS_LIBS -USE_NSS -USE_CYASSL -USE_MBEDTLS -USE_POLARSSL -HAVE_GNUTLS_SRP -USE_GNUTLS_NETTLE -USE_GNUTLS -HAVE_OPENSSL_SRP -RANDOM_FILE -SSL_LIBS -USE_DARWINSSL -USE_WINDOWS_SSPI -USE_SCHANNEL -DEFAULT_SSL_BACKEND BUILD_STUB_GSS_FALSE BUILD_STUB_GSS_TRUE -USE_OPENLDAP ZLIB_LIBS HAVE_LIBZ_FALSE HAVE_LIBZ_TRUE HAVE_LIBZ PKGCONFIG -CURL_DISABLE_GOPHER -CURL_DISABLE_SMTP -CURL_DISABLE_SMB -CURL_DISABLE_IMAP -CURL_DISABLE_POP3 -CURL_DISABLE_TFTP -CURL_DISABLE_TELNET -CURL_DISABLE_DICT -CURL_DISABLE_PROXY -HAVE_LDAP_SSL -CURL_DISABLE_LDAPS -CURL_DISABLE_LDAP -CURL_DISABLE_FILE -CURL_DISABLE_FTP -CURL_DISABLE_RTSP -CURL_DISABLE_HTTP -DOING_NATIVE_WINDOWS_FALSE -DOING_NATIVE_WINDOWS_TRUE +USE_UNITY_FALSE +USE_UNITY_TRUE +HAVE_WINDRES_FALSE +HAVE_WINDRES_TRUE BUILD_UNITTESTS_FALSE BUILD_UNITTESTS_TRUE -CURLDEBUG_FALSE -CURLDEBUG_TRUE -USE_EXPLICIT_LIB_DEPS_FALSE -USE_EXPLICIT_LIB_DEPS_TRUE -REQUIRE_LIB_DEPS -CPPFLAG_CURL_STATICLIB +CURL_WERROR_FALSE +CURL_WERROR_TRUE +CURL_CFLAG_EXTRAS +DOING_NATIVE_WINDOWS_FALSE +DOING_NATIVE_WINDOWS_TRUE +LIBCURL_PC_CFLAGS +LIBCURL_PC_CFLAGS_PRIVATE USE_CPPFLAG_CURL_STATICLIB_FALSE USE_CPPFLAG_CURL_STATICLIB_TRUE CURL_LT_SHLIB_USE_MIMPURE_TEXT_FALSE @@ -975,6 +973,9 @@ CURL_LT_SHLIB_USE_NO_UNDEFINED_FALSE CURL_LT_SHLIB_USE_NO_UNDEFINED_TRUE CURL_LT_SHLIB_USE_VERSION_INFO_FALSE CURL_LT_SHLIB_USE_VERSION_INFO_TRUE +NOT_CURL_CI_FALSE +NOT_CURL_CI_TRUE +RC LT_SYS_LIBRARY_PATH OTOOL64 OTOOL @@ -984,6 +985,7 @@ DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR +FILECMD LN_S NM ac_ct_DUMPBIN @@ -994,6 +996,7 @@ LIBTOOL OBJDUMP DLLTOOL AS +AR_FLAGS host_os host_vendor host_cpu @@ -1002,11 +1005,17 @@ build_os build_vendor build_cpu build -PKGADD_VENDOR -PKGADD_NAME -PKGADD_PKG +HTTPD_NGHTTPX +HTTPD +APXS +VSFTPD +CADDY +TEST_NGHTTPX VERSIONNUM CURLVERSION +CSCOPE +ETAGS +CTAGS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -1014,7 +1023,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR am__untar @@ -1037,6 +1045,8 @@ VERSION PACKAGE CYGPATH_W am__isrc +LCOV +GCOV CPP OBJEXT EXEEXT @@ -1052,21 +1062,12 @@ libext AR EGREP GREP -CURL_CFLAG_EXTRAS -CONFIGURE_OPTIONS -CODE_COVERAGE_RULES -CODE_COVERAGE_LDFLAGS -CODE_COVERAGE_LIBS -CODE_COVERAGE_CXXFLAGS -CODE_COVERAGE_CFLAGS -CODE_COVERAGE_CPPFLAGS -GENHTML -LCOV -GCOV -CODE_COVERAGE_ENABLED -CODE_COVERAGE_ENABLED_FALSE -CODE_COVERAGE_ENABLED_TRUE SED +CONFIGURE_OPTIONS +CURLDEBUG_FALSE +CURLDEBUG_TRUE +DEBUGBUILD_FALSE +DEBUGBUILD_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -1112,7 +1113,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME SHELL -PATH_SEPARATOR' +PATH_SEPARATOR +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -1124,12 +1126,26 @@ enable_warnings enable_werror enable_curldebug enable_symbol_hiding -enable_hidden_symbols enable_ares enable_rt -with_gcov +enable_httpsrr +enable_ech +enable_ssls_export enable_code_coverage enable_dependency_tracking +with_schannel +with_amissl +with_ssl +with_openssl +with_gnutls +with_mbedtls +with_wolfssl +with_rustls +with_test_nghttpx +with_test_caddy +with_test_vsftpd +with_test_httpd +with_darwinssl enable_largefile enable_shared enable_static @@ -1139,9 +1155,11 @@ with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock +enable_unity enable_http enable_ftp enable_file +enable_ipfs enable_ldap enable_ldaps enable_rtsp @@ -1154,49 +1172,79 @@ enable_imap enable_smb enable_smtp enable_gopher +enable_mqtt enable_manual +enable_docs enable_libcurl_option enable_libgcc with_zlib -with_ldap_lib -with_lber_lib +with_brotli +with_zstd enable_ipv6 with_gssapi_includes with_gssapi_libs with_gssapi with_default_ssl_backend -with_winssl -with_darwinssl -with_ssl -with_egd_socket -with_random -with_gnutls -with_polarssl -with_mbedtls -with_cyassl -with_nss -with_axtls +enable_openssl_auto_load_config with_ca_bundle with_ca_path with_ca_fallback +with_ca_embed +enable_ca_search +enable_ca_search_safe with_libpsl +with_libgsasl with_libmetalink with_libssh2 +with_libssh +with_wolfssh +with_ldap_lib +with_lber_lib +with_ldap with_librtmp enable_versioned_symbols +enable_windows_unicode with_winidn +with_apple_idn with_libidn2 with_nghttp2 +with_ngtcp2 +with_openssl_quic +with_nghttp3 +with_quiche +with_msh3 +with_libuv with_zsh_functions_dir +with_fish_functions_dir enable_threaded_resolver -enable_pthreads enable_verbose enable_sspi -enable_crypto_auth -enable_ntlm_wb +enable_basic_auth +enable_bearer_auth +enable_digest_auth +enable_kerberos_auth +enable_negotiate_auth +enable_aws +enable_ntlm enable_tls_srp enable_unix_sockets enable_cookies +enable_socketpair +enable_http_auth +enable_doh +enable_mime +enable_bindlocal +enable_form_api +enable_dateparse +enable_netrc +enable_progress_meter +enable_sha512_256 +enable_dnsshuffle +enable_get_easy_options +enable_alt_svc +enable_headers_api +enable_hsts +enable_websockets ' ac_precious_vars='build_alias host_alias @@ -1208,7 +1256,7 @@ LIBS CPPFLAGS CPP LT_SYS_LIBRARY_PATH' -ac_subdirs_all='ares' + # Initialize some variables set by options. ac_init_help= @@ -1276,8 +1324,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -1318,9 +1364,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1344,9 +1390,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1557,9 +1603,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1573,9 +1619,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1619,9 +1665,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1637,7 +1683,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1701,7 +1747,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1854,13 +1900,16 @@ Optional Features: --disable-curldebug Disable curl debug memory tracking --enable-symbol-hiding Enable hiding of library internal symbols --disable-symbol-hiding Disable hiding of library internal symbols - --enable-hidden-symbols To be deprecated, use --enable-symbol-hiding - --disable-hidden-symbols - To be deprecated, use --disable-symbol-hiding --enable-ares[=PATH] Enable c-ares for DNS lookups --disable-ares Disable c-ares for DNS lookups --disable-rt disable dependency on -lrt - --enable-code-coverage Whether to enable code coverage support + --enable-httpsrr Enable HTTPSRR support + --disable-httpsrr Disable HTTPSRR support + --enable-ech Enable ECH support + --disable-ech Disable ECH support + --enable-ssls-export Enable SSL session export support + --disable-ssls-export Disable SSL session export support + --enable-code-coverage Provide code coverage --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking @@ -1871,12 +1920,16 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-unity Enable unity mode + --disable-unity Disable unity (default) --enable-http Enable HTTP support --disable-http Disable HTTP support --enable-ftp Enable FTP support --disable-ftp Disable FTP support --enable-file Enable FILE support --disable-file Disable FILE support + --enable-ipfs Enable IPFS support + --disable-ipfs Disable IPFS support --enable-ldap Enable LDAP support --disable-ldap Disable LDAP support --enable-ldaps Enable LDAPS support @@ -1901,46 +1954,126 @@ Optional Features: --disable-smtp Disable SMTP support --enable-gopher Enable Gopher support --disable-gopher Disable Gopher support + --enable-mqtt Enable MQTT support + --disable-mqtt Disable MQTT support --enable-manual Enable built-in manual --disable-manual Disable built-in manual + --enable-docs Enable documentation + --disable-docs Disable documentation --enable-libcurl-option Enable --libcurl C code generation support --disable-libcurl-option Disable --libcurl C code generation support --enable-libgcc use libgcc when linking --enable-ipv6 Enable IPv6 (with IPv4) support --disable-ipv6 Disable IPv6 support + --enable-openssl-auto-load-config + Enable automatic loading of OpenSSL configuration + --disable-openssl-auto-load-config + Disable automatic loading of OpenSSL configuration + --enable-ca-search Enable unsafe CA bundle search in PATH on Windows + (default) + --disable-ca-search Disable unsafe CA bundle search in PATH on Windows + --enable-ca-search-safe Enable safe CA bundle search + --disable-ca-search-safe + Disable safe CA bundle search (default) --enable-versioned-symbols Enable versioned symbols in shared library --disable-versioned-symbols Disable versioned symbols in shared library + --enable-windows-unicode + Enable Windows Unicode + --disable-windows-unicode + Disable Windows Unicode (default) --enable-threaded-resolver Enable threaded resolver --disable-threaded-resolver Disable threaded resolver - --enable-pthreads Enable POSIX threads (default for threaded resolver) - --disable-pthreads Disable POSIX threads --enable-verbose Enable verbose strings --disable-verbose Disable verbose strings --enable-sspi Enable SSPI --disable-sspi Disable SSPI - --enable-crypto-auth Enable cryptographic authentication - --disable-crypto-auth Disable cryptographic authentication - --enable-ntlm-wb[=FILE] Enable NTLM delegation to winbind's ntlm_auth - helper, where FILE is ntlm_auth's absolute filename - (default: /usr/bin/ntlm_auth) - --disable-ntlm-wb Disable NTLM delegation to winbind's ntlm_auth - helper + --enable-basic-auth Enable basic authentication (default) + --disable-basic-auth Disable basic authentication + --enable-bearer-auth Enable bearer authentication (default) + --disable-bearer-auth Disable bearer authentication + --enable-digest-auth Enable digest authentication (default) + --disable-digest-auth Disable digest authentication + --enable-kerberos-auth Enable kerberos authentication (default) + --disable-kerberos-auth Disable kerberos authentication + --enable-negotiate-auth Enable negotiate authentication (default) + --disable-negotiate-auth + Disable negotiate authentication + --enable-aws Enable AWS sig support (default) + --disable-aws Disable AWS sig support + --enable-ntlm Enable NTLM support + --disable-ntlm Disable NTLM support --enable-tls-srp Enable TLS-SRP authentication --disable-tls-srp Disable TLS-SRP authentication --enable-unix-sockets Enable Unix domain sockets --disable-unix-sockets Disable Unix domain sockets --enable-cookies Enable cookies support --disable-cookies Disable cookies support + --enable-socketpair Enable socketpair support + --disable-socketpair Disable socketpair support + --enable-http-auth Enable HTTP authentication support + --disable-http-auth Disable HTTP authentication support + --enable-doh Enable DoH support + --disable-doh Disable DoH support + --enable-mime Enable mime API support + --disable-mime Disable mime API support + --enable-bindlocal Enable local binding support + --disable-bindlocal Disable local binding support + --enable-form-api Enable form API support + --disable-form-api Disable form API support + --enable-dateparse Enable date parsing + --disable-dateparse Disable date parsing + --enable-netrc Enable netrc parsing + --disable-netrc Disable netrc parsing + --enable-progress-meter Enable progress-meter + --disable-progress-meter + Disable progress-meter + --enable-sha512-256 Enable SHA-512/256 hash algorithm (default) + --disable-sha512-256 Disable SHA-512/256 hash algorithm + --enable-dnsshuffle Enable DNS shuffling + --disable-dnsshuffle Disable DNS shuffling + --enable-get-easy-options + Enable curl_easy_options + --disable-get-easy-options + Disable curl_easy_options + --enable-alt-svc Enable alt-svc support + --disable-alt-svc Disable alt-svc support + --enable-headers-api Enable headers-api support + --disable-headers-api Disable headers-api support + --enable-hsts Enable HSTS support + --disable-hsts Disable HSTS support + --enable-websockets Enable WebSockets support + --disable-websockets Disable WebSockets support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). + --with-schannel enable Windows native SSL/TLS + --with-amissl enable Amiga native SSL/TLS (AmiSSL) + --with-ssl=PATH old version of --with-openssl + --without-ssl build without any TLS library + --with-openssl=PATH Where to look for OpenSSL, PATH points to the SSL + installation (default: /usr/local/ssl); when + possible, set the PKG_CONFIG_PATH environment + variable instead of using this option + --with-gnutls=PATH where to look for GnuTLS, PATH points to the + installation root + --with-mbedtls=PATH where to look for mbedTLS, PATH points to the + installation root + --with-wolfssl=PATH where to look for wolfSSL, PATH points to the + installation root (default: system lib default) + --with-rustls=PATH where to look for Rustls, PATH points to the + installation root + --with-test-nghttpx=PATH + where to find nghttpx for testing + --with-test-caddy=PATH where to find caddy for testing + --with-test-vsftpd=PATH where to find vsftpd for testing + --with-test-httpd=PATH where to find httpd/apache2 for testing + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both @@ -1951,8 +2084,15 @@ Optional Packages: compiler's sysroot if not specified). --with-zlib=PATH search for zlib in PATH --without-zlib disable use of zlib - --with-ldap-lib=libname Specify name of ldap lib file - --with-lber-lib=libname Specify name of lber lib file + --with-brotli=PATH Where to look for brotli, PATH points to the BROTLI + installation; when possible, set the PKG_CONFIG_PATH + environment variable instead of using this option + --without-brotli disable BROTLI + --with-zstd=PATH Where to look for libzstd, PATH points to the + libzstd installation; when possible, set the + PKG_CONFIG_PATH environment variable instead of + using this option + --without-zstd disable libzstd --with-gssapi-includes=DIR Specify location of GSS-API headers --with-gssapi-libs=DIR Specify location of GSS-API libs @@ -1961,57 +2101,48 @@ Optional Packages: Use NAME as default SSL backend --without-default-ssl-backend Use implicit default SSL backend - --with-winssl enable Windows native SSL/TLS - --without-winssl disable Windows native SSL/TLS - --with-darwinssl enable Apple OS native SSL/TLS - --without-darwinssl disable Apple OS native SSL/TLS - --with-ssl=PATH Where to look for OpenSSL, PATH points to the SSL - installation (default: /usr/local/ssl); when - possible, set the PKG_CONFIG_PATH environment - variable instead of using this option - --without-ssl disable OpenSSL - --with-egd-socket=FILE Entropy Gathering Daemon socket pathname - --with-random=FILE read randomness from FILE (default=/dev/urandom) - --with-gnutls=PATH where to look for GnuTLS, PATH points to the - installation root - --without-gnutls disable GnuTLS detection - --with-polarssl=PATH where to look for PolarSSL, PATH points to the - installation root - --without-polarssl disable PolarSSL detection - --with-mbedtls=PATH where to look for mbedTLS, PATH points to the - installation root - --without-mbedtls disable mbedTLS detection - --with-cyassl=PATH where to look for CyaSSL, PATH points to the - installation root (default: system lib default) - --without-cyassl disable CyaSSL detection - --with-nss=PATH where to look for NSS, PATH points to the - installation root - --without-nss disable NSS detection - --with-axtls=PATH Where to look for axTLS, PATH points to the axTLS - installation prefix (default: /usr/local). Ignored - if another SSL engine is selected. - --without-axtls disable axTLS - --with-ca-bundle=FILE Path to a file containing CA certificates (example: - /etc/ca-bundle.crt) + --with-ca-bundle=FILE Absolute path to a file containing CA certificates + (example: /etc/ca-bundle.crt) --without-ca-bundle Don't use a default CA bundle --with-ca-path=DIRECTORY - Path to a directory containing CA certificates - stored individually, with their filenames in a hash - format. This option can be used with OpenSSL, GnuTLS - and PolarSSL backends. Refer to OpenSSL c_rehash for - details. (example: /etc/certificates) + Absolute path to a directory containing CA + certificates stored individually, with their + filenames in a hash format. This option can be used + with the OpenSSL, GnuTLS, mbedTLS and wolfSSL + backends. Refer to OpenSSL c_rehash for details. + (example: /etc/certificates) --without-ca-path Don't use a default CA path - --with-ca-fallback Use the built in CA store of the SSL library - --without-ca-fallback Don't use the built in CA store of the SSL library - --without-libpsl disable support for libpsl cookie checking - --with-libmetalink=PATH where to look for libmetalink, PATH points to the - installation root - --without-libmetalink disable libmetalink detection + --with-ca-fallback Use the built-in CA store of the SSL library + --without-ca-fallback Don't use the built-in CA store of the SSL library + --with-ca-embed=FILE Absolute path to a file containing CA certificates + to embed in the curl tool (example: + /etc/ca-bundle.crt) + --without-ca-embed Don't embed a default CA bundle in the curl tool + --with-libpsl=PATH Where to look for libpsl, PATH points to the LIBPSL + installation; when possible, set the PKG_CONFIG_PATH + environment variable instead of using this option + --without-libpsl disable LIBPSL + --without-libgsasl disable libgsasl support for SCRAM --with-libssh2=PATH Where to look for libssh2, PATH points to the - LIBSSH2 installation; when possible, set the + libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option - --without-libssh2 disable LIBSSH2 + --with-libssh2 enable libssh2 + --with-libssh=PATH Where to look for libssh, PATH points to the libssh + installation; when possible, set the PKG_CONFIG_PATH + environment variable instead of using this option + --with-libssh enable libssh + --with-wolfssh=PATH Where to look for wolfssh, PATH points to the + wolfSSH installation; when possible, set the + PKG_CONFIG_PATH environment variable instead of + using this option + --with-wolfssh enable wolfssh + --with-ldap-lib=libname Specify name of ldap lib file + --with-lber-lib=libname Specify name of lber lib file + --with-ldap=PATH Where to look for LDAP, PATH points to the LDAP + installation; when possible, set the PKG_CONFIG_PATH + environment variable instead of using this option + --without-ldap disable LDAP --with-librtmp=PATH Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of @@ -2019,14 +2150,32 @@ Optional Packages: --without-librtmp disable LIBRTMP --with-winidn=PATH enable Windows native IDN --without-winidn disable Windows native IDN + --with-apple-idn Enable AppleIDN + --without-apple-idn Disable AppleIDN --with-libidn2=PATH Enable libidn2 usage --without-libidn2 Disable libidn2 usage --with-nghttp2=PATH Enable nghttp2 usage --without-nghttp2 Disable nghttp2 usage + --with-ngtcp2=PATH Enable ngtcp2 usage + --without-ngtcp2 Disable ngtcp2 usage + --with-openssl-quic Enable OpenSSL QUIC usage + --without-openssl-quic Disable OpenSSL QUIC usage + --with-nghttp3=PATH Enable nghttp3 usage + --without-nghttp3 Disable nghttp3 usage + --with-quiche=PATH Enable quiche usage + --without-quiche Disable quiche usage + --with-msh3=PATH Enable msh3 usage + --without-msh3 Disable msh3 usage + --with-libuv=PATH Enable libuv + --without-libuv Disable libuv --with-zsh-functions-dir=PATH Install zsh completions to PATH --without-zsh-functions-dir Do not install zsh completions + --with-fish-functions-dir=PATH + Install fish completions to PATH + --without-fish-functions-dir + Do not install fish completions Some influential environment variables: CC C compiler command @@ -2043,7 +2192,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -2059,9 +2208,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -2089,7 +2238,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -2097,7 +2247,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -2107,13 +2257,13 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF curl configure - -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -Copyright (c) 1998 - 2017 Daniel Stenberg, +Copyright (C) Daniel Stenberg, This configure script may be copied, distributed and modified under the terms of the curl license; see COPYING for more details _ACEOF @@ -2130,14 +2280,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2145,14 +2295,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2174,7 +2325,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2182,14 +2333,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2199,20 +2351,53 @@ fi } # ac_fn_c_try_cpp +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2220,17 +2405,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2245,41 +2431,62 @@ fi } # ac_fn_c_try_link -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$4 -#include <$2> + +#define $2 innocuous_$2 +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $2 +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +#if defined __stub_$2 || defined __stub___$2 +#error force compilation error +#endif + +int main(void) +{ +return $2 (); + return 0; +} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_header_compile +} # ac_fn_c_check_func # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -2289,25 +2496,26 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status @@ -2318,376 +2526,108 @@ fi } # ac_fn_c_try_run -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () +# ac_fn_c_check_type LINENO SIZEOF_LONG_LONG VAR INCLUDES +# ------------------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int main(void) +{ +if (sizeof ($2)) + return 0; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$4 +int main(void) +{ +if (sizeof (($2))) + return 0; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -#define $2 innocuous_$2 -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $2 +else $as_nop + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int main(void) +{ +#ifndef $as_decl_name #ifdef __cplusplus -extern "C" + (void) $as_decl_use; +#else + (void) $as_decl_name; #endif -char $2 (); -#if defined __stub_$2 || defined __stub___$2 -choke me #endif -int main (void) -{ -return $2 (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_func - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------------------------------------------- ## -## Report this to a suitable curl mailing list: https://curl.haxx.se/mail/ ## -## ----------------------------------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int main (void) -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int main (void) -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int main (void) -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int main (void) -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int main (void) -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int main (void) -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 &5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int main (void) -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int main (void) -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type +} # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- @@ -2696,61 +2636,82 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 -int main (void) +int main(void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 -int main (void) +int main(void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" -else +else $as_nop eval "$4=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by curl $as_me -, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2783,8 +2744,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2819,7 +2784,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2854,11 +2819,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2869,8 +2836,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2894,7 +2861,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2902,14 +2869,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2917,15 +2884,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2933,8 +2900,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2948,63 +2915,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -3014,113 +2966,531 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' -# using curl-override.m4 +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; +struct incomplete_array +{ + int datasize; + double data[]; +}; +struct named_init { + int number; + const wchar_t *name; + double average; +}; +typedef const char *ccp; -ac_config_headers="$ac_config_headers lib/curl_config.h" +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + const char *str = ""; + int number = 0; + float fnumber = 0; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh config.guess config.sub missing compile install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +# using curl-override.m4 + + + + + +ac_config_headers="$ac_config_headers lib/curl_config.h" + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : +if test ${enable_maintainer_mode+y} +then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else +else $as_nop USE_MAINTAINER_MODE=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' @@ -3133,7 +3503,8 @@ fi # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3143,12 +3514,13 @@ case $enable_silent_rules in # ((( *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3160,8 +3532,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3173,11 +3545,12 @@ AM_BACKSLASH='\' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debug build options" >&5 -$as_echo_n "checking whether to enable debug build options... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable debug build options" >&5 +printf %s "checking whether to enable debug build options... " >&6; } OPT_DEBUG_BUILD="default" # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : +if test ${enable_debug+y} +then : enableval=$enable_debug; OPT_DEBUG_BUILD=$enableval fi @@ -3192,48 +3565,58 @@ fi want_debug="yes" ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_debug" >&5 -$as_echo "$want_debug" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_debug" >&5 +printf "%s\n" "$want_debug" >&6; } + + if test x$want_debug = xyes; then + DEBUGBUILD_TRUE= + DEBUGBUILD_FALSE='#' +else + DEBUGBUILD_TRUE='#' + DEBUGBUILD_FALSE= +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler optimizer" >&5 -$as_echo_n "checking whether to enable compiler optimizer... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler optimizer" >&5 +printf %s "checking whether to enable compiler optimizer... " >&6; } OPT_COMPILER_OPTIMIZE="default" # Check whether --enable-optimize was given. -if test "${enable_optimize+set}" = set; then : +if test ${enable_optimize+y} +then : enableval=$enable_optimize; OPT_COMPILER_OPTIMIZE=$enableval fi case "$OPT_COMPILER_OPTIMIZE" in no) want_optimize="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; default) if test "$want_debug" = "yes"; then want_optimize="assume_no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) no" >&5 -$as_echo "(assumed) no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (assumed) no" >&5 +printf "%s\n" "(assumed) no" >&6; } else want_optimize="assume_yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 -$as_echo "(assumed) yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 +printf "%s\n" "(assumed) yes" >&6; } fi ;; *) want_optimize="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable strict compiler warnings" >&5 -$as_echo_n "checking whether to enable strict compiler warnings... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable strict compiler warnings" >&5 +printf %s "checking whether to enable strict compiler warnings... " >&6; } OPT_COMPILER_WARNINGS="default" # Check whether --enable-warnings was given. -if test "${enable_warnings+set}" = set; then : +if test ${enable_warnings+y} +then : enableval=$enable_warnings; OPT_COMPILER_WARNINGS=$enableval fi @@ -3248,15 +3631,16 @@ fi want_warnings="yes" ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_warnings" >&5 -$as_echo "$want_warnings" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_warnings" >&5 +printf "%s\n" "$want_warnings" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings as errors" >&5 -$as_echo_n "checking whether to enable compiler warnings as errors... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable compiler warnings as errors" >&5 +printf %s "checking whether to enable compiler warnings as errors... " >&6; } OPT_COMPILER_WERROR="default" # Check whether --enable-werror was given. -if test "${enable_werror+set}" = set; then : +if test ${enable_werror+y} +then : enableval=$enable_werror; OPT_COMPILER_WERROR=$enableval fi @@ -3271,80 +3655,86 @@ fi want_werror="yes" ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_werror" >&5 -$as_echo "$want_werror" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_werror" >&5 +printf "%s\n" "$want_werror" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable curl debug memory tracking" >&5 -$as_echo_n "checking whether to enable curl debug memory tracking... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable curl debug memory tracking" >&5 +printf %s "checking whether to enable curl debug memory tracking... " >&6; } OPT_CURLDEBUG_BUILD="default" # Check whether --enable-curldebug was given. -if test "${enable_curldebug+set}" = set; then : +if test ${enable_curldebug+y} +then : enableval=$enable_curldebug; OPT_CURLDEBUG_BUILD=$enableval fi case "$OPT_CURLDEBUG_BUILD" in no) want_curldebug="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; default) if test "$want_debug" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 -$as_echo "(assumed) yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 +printf "%s\n" "(assumed) yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi want_curldebug_assumed="yes" want_curldebug="$want_debug" ;; *) want_curldebug="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; esac + if test x$want_curldebug = xyes; then + CURLDEBUG_TRUE= + CURLDEBUG_FALSE='#' +else + CURLDEBUG_TRUE='#' + CURLDEBUG_FALSE= +fi + - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable hiding of library internal symbols" >&5 -$as_echo_n "checking whether to enable hiding of library internal symbols... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable hiding of library internal symbols" >&5 +printf %s "checking whether to enable hiding of library internal symbols... " >&6; } OPT_SYMBOL_HIDING="default" # Check whether --enable-symbol-hiding was given. -if test "${enable_symbol_hiding+set}" = set; then : +if test ${enable_symbol_hiding+y} +then : enableval=$enable_symbol_hiding; OPT_SYMBOL_HIDING=$enableval fi - # Check whether --enable-hidden-symbols was given. -if test "${enable_hidden_symbols+set}" = set; then : - enableval=$enable_hidden_symbols; OPT_SYMBOL_HIDING=$enableval -fi - case "$OPT_SYMBOL_HIDING" in no) want_symbol_hiding="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; default) want_symbol_hiding="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; *) want_symbol_hiding="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable c-ares for DNS lookups" >&5 -$as_echo_n "checking whether to enable c-ares for DNS lookups... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable c-ares for DNS lookups" >&5 +printf %s "checking whether to enable c-ares for DNS lookups... " >&6; } OPT_ARES="default" # Check whether --enable-ares was given. -if test "${enable_ares+set}" = set; then : +if test ${enable_ares+y} +then : enableval=$enable_ares; OPT_ARES=$enableval fi @@ -3362,33 +3752,127 @@ fi fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_ares" >&5 -$as_echo "$want_ares" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_ares" >&5 +printf "%s\n" "$want_ares" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable dependency on -lrt" >&5 -$as_echo_n "checking whether to disable dependency on -lrt... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to disable dependency on -lrt" >&5 +printf %s "checking whether to disable dependency on -lrt... " >&6; } OPT_RT="default" # Check whether --enable-rt was given. -if test "${enable_rt+set}" = set; then : +if test ${enable_rt+y} +then : enableval=$enable_rt; OPT_RT=$enableval fi case "$OPT_RT" in no) dontwant_rt="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; default) dontwant_rt="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed no)" >&5 -$as_echo "(assumed no)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (assumed no)" >&5 +printf "%s\n" "(assumed no)" >&6; } ;; *) dontwant_rt="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable HTTPSRR support" >&5 +printf %s "checking whether to enable HTTPSRR support... " >&6; } + OPT_HTTPSRR="default" + # Check whether --enable-httpsrr was given. +if test ${enable_httpsrr+y} +then : + enableval=$enable_httpsrr; OPT_HTTPSRR=$enableval +fi + + case "$OPT_HTTPSRR" in + no) + want_httpsrr="no" + curl_httpsrr_msg="no (--enable-httpsrr)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + default) + want_httpsrr="no" + curl_httpsrr_msg="no (--enable-httpsrr)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + *) + want_httpsrr="yes" + curl_httpsrr_msg="enabled" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable ECH support" >&5 +printf %s "checking whether to enable ECH support... " >&6; } + OPT_ECH="default" + # Check whether --enable-ech was given. +if test ${enable_ech+y} +then : + enableval=$enable_ech; OPT_ECH=$enableval +fi + + case "$OPT_ECH" in + no) + want_ech="no" + curl_ech_msg="no (--enable-ech)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + default) + want_ech="no" + curl_ech_msg="no (--enable-ech)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + *) + want_ech="yes" + curl_ech_msg="enabled (--disable-ech)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable SSL session export support" >&5 +printf %s "checking whether to enable SSL session export support... " >&6; } + OPT_SSLS_EXPORT="default" + # Check whether --enable-ssls-export was given. +if test ${enable_ssls_export+y} +then : + enableval=$enable_ssls_export; OPT_SSLS_EXPORT=$enableval +fi + + case "$OPT_SSLS_EXPORT" in + no) + want_ssls_export="no" + curl_ssls_export_msg="no (--enable-ssls-export)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + default) + want_ssls_export="no" + curl_ssls_export_msg="no (--enable-ssls-export)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + *) + want_ssls_export="yes" + curl_ssls_export_msg="enabled (--disable-ssls-export)" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; esac @@ -3411,498 +3895,58 @@ fi if test -z "$PATH_SEPARATOR"; then as_fn_error $? "PATH_SEPARATOR not set (internal or config.site problem)" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for path separator" >&5 -$as_echo_n "checking for path separator... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_SEPARATOR" >&5 -$as_echo "$PATH_SEPARATOR" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for path separator" >&5 +printf %s "checking for path separator... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_SEPARATOR" >&5 +printf "%s\n" "$PATH_SEPARATOR" >&6; } if test "x$PATH_SEPARATOR" != "x$xc_PATH_SEPARATOR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initial path separator" >&5 -$as_echo_n "checking for initial path separator... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_PATH_SEPARATOR" >&5 -$as_echo "$xc_PATH_SEPARATOR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for initial path separator" >&5 +printf %s "checking for initial path separator... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_PATH_SEPARATOR" >&5 +printf "%s\n" "$xc_PATH_SEPARATOR" >&6; } as_fn_error $? "path separator mismatch (internal or config.site problem)" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST + +# +# save the configure arguments +# +CONFIGURE_OPTIONS="\"$ac_configure_args\"" + + +if test -z "$SED"; then + # Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SED in + [\\/]* | ?:[\\/]*) + ac_cv_path_SED="$SED" # Let the user override the test with a path. + ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SED="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - - - - # allow to override gcov location - -# Check whether --with-gcov was given. -if test "${with_gcov+set}" = set; then : - withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov -else - _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 -$as_echo_n "checking whether to build with code coverage support... " >&6; } - # Check whether --enable-code-coverage was given. -if test "${enable_code_coverage+set}" = set; then : - enableval=$enable_code_coverage; -else - enable_code_coverage=no -fi - - - if test x$enable_code_coverage = xyes; then - CODE_COVERAGE_ENABLED_TRUE= - CODE_COVERAGE_ENABLED_FALSE='#' -else - CODE_COVERAGE_ENABLED_TRUE='#' - CODE_COVERAGE_ENABLED_FALSE= -fi - - CODE_COVERAGE_ENABLED=$enable_code_coverage - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 -$as_echo "$enable_code_coverage" >&6; } - - if test "$enable_code_coverage" = "yes" ; then : - - # check for gcov - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GCOV"; then - ac_cv_prog_GCOV="$GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -GCOV=$ac_cv_prog_GCOV -if test -n "$GCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 -$as_echo "$GCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_GCOV"; then - ac_ct_GCOV=$GCOV - # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_GCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_GCOV"; then - ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV -if test -n "$ac_ct_GCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 -$as_echo "$ac_ct_GCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_GCOV" = x; then - GCOV=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - GCOV=$ac_ct_GCOV - fi -else - GCOV="$ac_cv_prog_GCOV" -fi - - if test "X$GCOV" = "X:"; then : - as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 -fi - - - if test "$GCC" = "no" ; then : - - as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 - -fi - - # Extract the first word of "lcov", so it can be a program name with args. -set dummy lcov; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LCOV"; then - ac_cv_prog_LCOV="$LCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LCOV="lcov" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LCOV=$ac_cv_prog_LCOV -if test -n "$LCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 -$as_echo "$LCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "genhtml", so it can be a program name with args. -set dummy genhtml; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GENHTML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GENHTML"; then - ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GENHTML="genhtml" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -GENHTML=$ac_cv_prog_GENHTML -if test -n "$GENHTML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 -$as_echo "$GENHTML" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - if test -z "$LCOV" ; then : - - as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 - -fi - - if test -z "$GENHTML" ; then : - - as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 - -fi - - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LIBS="-lgcov" - CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" - - - - - - - - CODE_COVERAGE_RULES_CHECK=' - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -' - CODE_COVERAGE_RULES_CAPTURE=' - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -' - CODE_COVERAGE_RULES_CLEAN=' -clean: code-coverage-clean -distclean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -' - -else - - CODE_COVERAGE_RULES_CHECK=' - @echo "Need to reconfigure with --enable-code-coverage" -' - CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" - CODE_COVERAGE_RULES_CLEAN='' - -fi - -CODE_COVERAGE_RULES=' -# Code coverage -# -# Optional: -# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. -# Multiple directories may be specified, separated by whitespace. -# (Default: $(top_builddir)) -# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated -# by lcov for code coverage. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) -# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage -# reports to be created. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) -# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, -# set to 0 to disable it and leave empty to stay with the default. -# (Default: empty) -# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov -# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov -# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the -# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov -# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering -# lcov instance. (Default: empty) -# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov -# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the -# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml -# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) -# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore -# -# The generated report will be titled using the $(PACKAGE_NAME) and -# $(PACKAGE_VERSION). In order to add the current git hash to the title, -# use the git-version-gen script, available online. - -# Optional variables -CODE_COVERAGE_DIRECTORY ?= $(top_builddir) -CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info -CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage -CODE_COVERAGE_BRANCH_COVERAGE ?= -CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= -CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ -$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) -CODE_COVERAGE_IGNORE_PATTERN ?= - -GITIGNOREFILES ?= -GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) -code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ - $(CODE_COVERAGE_OUTPUT_FILE); -code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) -code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ - $(CODE_COVERAGE_IGNORE_PATTERN); -code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) -code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) -code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); -code_coverage_quiet = $(code_coverage_quiet_$(V)) -code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) -code_coverage_quiet_0 = --quiet - -# sanitizes the test-name: replaces with underscores: dashes and dots -code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) - -# Use recursive makes in order to ignore errors during check -check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' - -# Capture code coverage data -code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' - -# Hook rule executed before code-coverage-capture, overridable by the user -code-coverage-capture-hook: - -'"$CODE_COVERAGE_RULES_CLEAN"' - -A''M_DISTCHECK_CONFIGURE_FLAGS ?= -A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage - -.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean -' - - - - - -# -# save the configure arguments -# -CONFIGURE_OPTIONS="\"$ac_configure_args\"" - - -CURL_CFLAG_EXTRAS="" -if test X"$want_werror" = Xyes; then - CURL_CFLAG_EXTRAS="-Werror" -fi - - -if test -z "$SED"; then - # Extract the first word of "sed", so it can be a program name with args. -set dummy sed; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SED in - [\\/]* | ?:[\\/]*) - ac_cv_path_SED="$SED" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +IFS=$as_save_IFS test -z "$ac_cv_path_SED" && ac_cv_path_SED="not_found" ;; @@ -3910,11 +3954,11 @@ esac fi SED=$ac_cv_path_SED if test -n "$SED"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 -$as_echo "$SED" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 +printf "%s\n" "$SED" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3927,11 +3971,12 @@ fi if test -z "$GREP"; then # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. @@ -3942,11 +3987,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3959,11 +4008,11 @@ esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 -$as_echo "$GREP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 +printf "%s\n" "$GREP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3974,20 +4023,23 @@ fi if test -z "$EGREP"; then - if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that grep -E works" >&5 +printf %s "checking that grep -E works... " >&6; } + if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then EGREP="$GREP -E" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EGREP" >&5 -$as_echo "$EGREP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } # Extract the first word of "egrep", so it can be a program name with args. set dummy egrep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path. @@ -3998,11 +4050,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_EGREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_EGREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4015,18 +4071,18 @@ esac fi EGREP=$ac_cv_path_EGREP if test -n "$EGREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EGREP" >&5 -$as_echo "$EGREP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EGREP" >&5 +printf "%s\n" "$EGREP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi fi if test -z "$EGREP" || test "$EGREP" = "not_found"; then - as_fn_error $? "egrep not found in PATH. Cannot continue without egrep." "$LINENO" 5 + as_fn_error $? "grep -E is not working and egrep is not found in PATH. Cannot continue." "$LINENO" 5 fi @@ -4034,11 +4090,12 @@ if test -z "$AR"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. @@ -4049,11 +4106,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_AR="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4065,11 +4126,11 @@ esac fi AR=$ac_cv_path_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4078,11 +4139,12 @@ if test -z "$ac_cv_path_AR"; then ac_pt_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_AR in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_AR="$ac_pt_AR" # Let the user override the test with a path. @@ -4093,11 +4155,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_AR="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4109,11 +4175,11 @@ esac fi ac_pt_AR=$ac_cv_path_ac_pt_AR if test -n "$ac_pt_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_AR" >&5 -$as_echo "$ac_pt_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_AR" >&5 +printf "%s\n" "$ac_pt_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_AR" = x; then @@ -4121,8 +4187,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_pt_AR @@ -4161,10 +4227,10 @@ CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/inc esac done if test $xc_bad_var_libs = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using LIBS: $LIBS" >&5 -$as_echo "$as_me: using LIBS: $LIBS" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS note: LIBS should only be used to specify libraries (-lname)." >&5 -$as_echo "$as_me: LIBS note: LIBS should only be used to specify libraries (-lname)." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using LIBS: $LIBS" >&5 +printf "%s\n" "$as_me: using LIBS: $LIBS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: LIBS note: LIBS should only be used to specify libraries (-lname)." >&5 +printf "%s\n" "$as_me: LIBS note: LIBS should only be used to specify libraries (-lname)." >&6;} fi @@ -4186,26 +4252,26 @@ $as_echo "$as_me: LIBS note: LIBS should only be used to specify libraries (-lna esac done if test $xc_bad_var_ldflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS: $LDFLAGS" >&5 -$as_echo "$as_me: using LDFLAGS: $LDFLAGS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using LDFLAGS: $LDFLAGS" >&5 +printf "%s\n" "$as_me: using LDFLAGS: $LDFLAGS" >&6;} xc_bad_var_msg="LDFLAGS note: LDFLAGS should only be used to specify linker flags, not" for xc_word in $LDFLAGS; do case "$xc_word" in -D*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done @@ -4227,22 +4293,22 @@ $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} esac done if test $xc_bad_var_cppflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS: $CPPFLAGS" >&5 -$as_echo "$as_me: using CPPFLAGS: $CPPFLAGS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using CPPFLAGS: $CPPFLAGS" >&5 +printf "%s\n" "$as_me: using CPPFLAGS: $CPPFLAGS" >&6;} xc_bad_var_msg="CPPFLAGS note: CPPFLAGS should only be used to specify C preprocessor flags, not" for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done @@ -4273,34 +4339,34 @@ $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} esac done if test $xc_bad_var_cflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS: $CFLAGS" >&5 -$as_echo "$as_me: using CFLAGS: $CFLAGS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using CFLAGS: $CFLAGS" >&5 +printf "%s\n" "$as_me: using CFLAGS: $CFLAGS" >&6;} xc_bad_var_msg="CFLAGS note: CFLAGS should only be used to specify C compiler flags, not" for xc_word in $CFLAGS; do case "$xc_word" in -D*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -rpath*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done @@ -4310,40 +4376,13 @@ $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Continuing even with errors mentioned immediately above this line." >&5 -$as_echo "$as_me: WARNING: Continuing even with errors mentioned immediately above this line." >&2;} - fi - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Continuing even with errors mentioned immediately above this line." >&5 +printf "%s\n" "$as_me: WARNING: Continuing even with errors mentioned immediately above this line." >&2;} fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Find a good install program. We prefer a C program (faster), + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -4357,20 +4396,25 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -4380,13 +4424,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -4394,12 +4438,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -4415,7 +4459,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -4425,8 +4469,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -4436,6 +4480,16 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + + + + + + + + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` @@ -4447,11 +4501,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4459,11 +4514,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4474,11 +4533,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4487,11 +4546,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4499,11 +4559,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4514,11 +4578,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -4526,8 +4590,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4540,11 +4604,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4552,11 +4617,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4567,11 +4636,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4580,11 +4649,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4593,15 +4663,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4617,18 +4691,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4639,11 +4713,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4651,11 +4726,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4666,11 +4745,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4683,11 +4762,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4695,11 +4775,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4710,11 +4794,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4726,34 +4810,138 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + fi - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -4763,18 +4951,17 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF ac_clean_files_save=$ac_clean_files @@ -4782,9 +4969,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -4805,11 +4992,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -4826,7 +5014,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -4842,44 +5030,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -4893,15 +5083,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -4909,20 +5099,19 @@ ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -int main (void) +int main(void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; - ; - return 0; + return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -4930,10 +5119,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -4941,42 +5130,42 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF rm -f conftest.o conftest.obj @@ -4986,11 +5175,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -4999,62 +5189,66 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { #ifndef __GNUC__ choke me #endif - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -5062,55 +5256,55 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -5125,93 +5319,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int main (void) -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -5220,24 +5465,25 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. @@ -5261,8 +5507,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -5284,40 +5530,36 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5329,10 +5571,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5342,7 +5585,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -5354,29 +5598,24 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5388,10 +5627,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5401,11 +5641,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -5427,136 +5668,213 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.15' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -rm -f conftest.file -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + fi -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 + for ac_header in stdatomic.h +do : + ac_fn_c_check_header_compile "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default" +if test "x$ac_cv_header_stdatomic_h" = xyes +then : + printf "%s\n" "#define HAVE_STDATOMIC_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _Atomic is available" >&5 +printf %s "checking if _Atomic is available... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_unistd + +int main(void) +{ + + _Atomic int i = 0; + i = 4; // Force an atomic-write operation. + (void)i; + + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_ATOMIC 1" >>confdefs.h + + tst_atomic="yes" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_atomic="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi + +done + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for code coverage support" >&5 +printf %s "checking for code coverage support... " >&6; } + coverage="no" + curl_coverage_msg="disabled" + + # Check whether --enable-code-coverage was given. +if test ${enable_code_coverage+y} +then : + enableval=$enable_code_coverage; coverage="$enableval" +fi + + + if test "$GCC" != "yes" +then : + coverage="no" +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $coverage" >&5 +printf "%s\n" "$coverage" >&6; } + + if test "x$coverage" = "xyes"; then + curl_coverage_msg="enabled" + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcov", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcov; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_GCOV+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$GCOV"; then + ac_cv_prog_GCOV="$GCOV" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_GCOV="${ac_tool_prefix}gcov" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5565,38 +5883,43 @@ IFS=$as_save_IFS fi fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +GCOV=$ac_cv_prog_GCOV +if test -n "$GCOV"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 +printf "%s\n" "$GCOV" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +if test -z "$ac_cv_prog_GCOV"; then + ac_ct_GCOV=$GCOV + # Extract the first word of "gcov", so it can be a program name with args. +set dummy gcov; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_GCOV+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_GCOV"; then + ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GCOV="gcov" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5605,96 +5928,57 @@ IFS=$as_save_IFS fi fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } +ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV +if test -n "$ac_ct_GCOV"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 +printf "%s\n" "$ac_ct_GCOV" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ac_ct_STRIP" = x; then - STRIP=":" + if test "x$ac_ct_GCOV" = x; then + GCOV="gcov" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - STRIP=$ac_ct_STRIP + GCOV=$ac_ct_GCOV fi else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi + GCOV="$ac_cv_prog_GCOV" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. + if test -z "$GCOV"; then + as_fn_error $? "needs gcov for code coverage" "$LINENO" 5 + fi + # Extract the first word of "lcov", so it can be a program name with args. +set dummy lcov; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LCOV+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$LCOV"; then + ac_cv_prog_LCOV="$LCOV" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LCOV="lcov" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5703,180 +5987,491 @@ IFS=$as_save_IFS fi fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } +LCOV=$ac_cv_prog_LCOV +if test -n "$LCOV"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 +printf "%s\n" "$LCOV" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null + if test -z "$LCOV"; then + as_fn_error $? "needs lcov for code coverage" "$LINENO" 5 + fi -DEPDIR="${am__leading_dot}deps" + CPPFLAGS="$CPPFLAGS -DNDEBUG" + CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage" + LIBS="$LIBS -lgcov" + fi -ac_config_commands="$ac_config_commands depfiles" +am__api_version='1.16' -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! fi -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else - AMDEP_TRUE='#' - AMDEP_FALSE= + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi -## --------------------------------------- ## -## Start of automake initialization code ## -## --------------------------------------- ## +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' + if test "x$ac_ct_STRIP" = x; then + STRIP=":" else - CYGPATH_W=echo + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP fi +else + STRIP="$ac_cv_prog_STRIP" fi +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -# Define the identity of the package. - PACKAGE='curl' - VERSION='-' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +fi + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# Some tools Automake needs. +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + test -n "$AWK" && break +done -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} +DEPDIR="${am__leading_dot}deps" +ac_config_commands="$ac_config_commands depfiles" -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +## --------------------------------------- ## +## Start of automake initialization code ## +## --------------------------------------- ## + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='curl' + VERSION='-' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -5897,11 +6492,12 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -6008,8 +6604,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -6023,6 +6619,20 @@ else fi +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -6055,7 +6665,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -6071,829 +6681,1161 @@ fi ## ------------------------------------- ## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking curl version" >&5 -$as_echo_n "checking curl version... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURLVERSION" >&5 -$as_echo "$CURLVERSION" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking curl version" >&5 +printf %s "checking curl version... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CURLVERSION" >&5 +printf "%s\n" "$CURLVERSION" >&6; } VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h` -PKGADD_PKG="HAXXcurl" -PKGADD_NAME="curl - a client that groks URLs" -PKGADD_VENDOR="curl.haxx.se" - - - - - curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )" - curl_ssh_msg="no (--with-libssh2)" + curl_ssl_msg="no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,amissl,rustls} )" + curl_ssh_msg="no (--with-{libssh,libssh2})" curl_zlib_msg="no (--with-zlib)" + curl_brotli_msg="no (--with-brotli)" + curl_zstd_msg="no (--with-zstd)" curl_gss_msg="no (--with-gssapi)" + curl_gsasl_msg="no (--with-gsasl)" curl_tls_srp_msg="no (--enable-tls-srp)" - curl_res_msg="default (--enable-ares / --enable-threaded-resolver)" + curl_res_msg="blocking (--enable-ares / --enable-threaded-resolver)" curl_ipv6_msg="no (--enable-ipv6)" curl_unix_sockets_msg="no (--enable-unix-sockets)" curl_idn_msg="no (--with-{libidn2,winidn})" + curl_docs_msg="enabled (--disable-docs)" curl_manual_msg="no (--enable-manual)" curl_libcurl_msg="enabled (--disable-libcurl-option)" curl_verbose_msg="enabled (--disable-verbose)" curl_sspi_msg="no (--enable-sspi)" curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" curl_ldaps_msg="no (--enable-ldaps)" + curl_ipfs_msg="no (--enable-ipfs)" curl_rtsp_msg="no (--enable-rtsp)" curl_rtmp_msg="no (--with-librtmp)" - curl_mtlnk_msg="no (--with-libmetalink)" curl_psl_msg="no (--with-libpsl)" - + curl_altsvc_msg="enabled (--disable-alt-svc)" +curl_headers_msg="enabled (--disable-headers-api)" + curl_hsts_msg="enabled (--disable-hsts)" ssl_backends= + curl_h1_msg="enabled (internal)" + curl_h2_msg="no (--with-nghttp2)" + curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic, --with-msh3)" + +enable_altsvc="yes" +hsts="yes" INITIAL_LDFLAGS=$LDFLAGS INITIAL_LIBS=$LIBS +compilersh="run-compiler" +CURL_SAVED_CC="$CC" +export CURL_SAVED_CC +CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" +export CURL_SAVED_LD_LIBRARY_PATH +cat <<\EOF > "$compilersh" +CC="$CURL_SAVED_CC" +export CC +LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH" +export LD_LIBRARY_PATH +exec $CC "$@" +EOF -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +OPT_SCHANNEL=no +# Check whether --with-schannel was given. +if test ${with_schannel+y} +then : + withval=$with_schannel; OPT_SCHANNEL=$withval + TLSCHOICE="schannel" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +OPT_AMISSL=no +# Check whether --with-amissl was given. +if test ${with_amissl+y} +then : + withval=$with_amissl; + OPT_AMISSL=$withval + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL" +fi -cat >>confdefs.h <<_ACEOF -#define OS "${host}" -_ACEOF +OPT_OPENSSL=no +ca="no" +# Check whether --with-ssl was given. +if test ${with_ssl+y} +then : + withval=$with_ssl; + OPT_SSL=$withval + OPT_OPENSSL=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" + else + SSL_DISABLED="D" + fi +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 +# Check whether --with-openssl was given. +if test ${with_openssl+y} +then : + withval=$with_openssl; + OPT_OPENSSL=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" fi -else - ac_cv_path_GREP=$GREP -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac +OPT_GNUTLS=no - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 +# Check whether --with-gnutls was given. +if test ${with_gnutls+y} +then : + withval=$with_gnutls; + OPT_GNUTLS=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS" fi -else - ac_cv_path_EGREP=$EGREP -fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +OPT_MBEDTLS=no +# Check whether --with-mbedtls was given. +if test ${with_mbedtls+y} +then : + withval=$with_mbedtls; + OPT_MBEDTLS=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OS is AIX (to define _ALL_SOURCE)" >&5 -$as_echo_n "checking if OS is AIX (to define _ALL_SOURCE)... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi -#ifdef _AIX - yes_this_is_aix -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes_this_is_aix" >/dev/null 2>&1; then : +OPT_WOLFSSL=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h +# Check whether --with-wolfssl was given. +if test ${with_wolfssl+y} +then : + withval=$with_wolfssl; + OPT_WOLFSSL=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL" + fi +fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f conftest* +OPT_RUSTLS=no +# Check whether --with-rustls was given. +if test ${with_rustls+y} +then : + withval=$with_rustls; + OPT_RUSTLS=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls" + experimental="$experimental rustls" + fi +fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is already defined" >&5 -$as_echo_n "checking if _THREAD_SAFE is already defined... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +TEST_NGHTTPX=nghttpx +# Check whether --with-test-nghttpx was given. +if test ${with_test_nghttpx+y} +then : + withval=$with_test_nghttpx; TEST_NGHTTPX=$withval + if test X"$TEST_NGHTTPX" = "Xno"; then + TEST_NGHTTPX="" + fi +fi -int main (void) -{ -#ifdef _THREAD_SAFE - int dummy=1; -#else - force compilation error -#endif - ; - return 0; -} +if test -x /usr/bin/caddy; then + CADDY=/usr/bin/caddy +elif test -x /usr/local/bin/caddy; then + CADDY=/usr/local/bin/caddy +elif test -x "`brew --prefix 2>/dev/null`/bin/caddy"; then + CADDY=`brew --prefix`/bin/caddy +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +# Check whether --with-test-caddy was given. +if test ${with_test_caddy+y} +then : + withval=$with_test_caddy; CADDY=$withval + if test X"$CADDY" = "Xno"; then + CADDY="" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tmp_thread_safe_initially_defined="yes" +fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tmp_thread_safe_initially_defined="no" +if test -x /usr/sbin/vsftpd; then + VSFTPD=/usr/sbin/vsftpd +elif test -x /usr/local/sbin/vsftpd; then + VSFTPD=/usr/local/sbin/vsftpd +elif test -x "`brew --prefix 2>/dev/null`/sbin/vsftpd"; then + VSFTPD=`brew --prefix`/sbin/vsftpd fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # - if test "$tmp_thread_safe_initially_defined" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is actually needed" >&5 -$as_echo_n "checking if _THREAD_SAFE is actually needed... " >&6; } - - case $host_os in - aix[123].* | aix4.[012].*) - tmp_need_thread_safe="no" - ;; - aix*) - tmp_need_thread_safe="yes" - ;; - *) - tmp_need_thread_safe="no" - ;; - esac - if test "$tmp_need_thread_safe" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi +# Check whether --with-test-vsftpd was given. +if test ${with_test_vsftpd+y} +then : + withval=$with_test_vsftpd; VSFTPD=$withval + if test X"$VSFTPD" = "Xno"; then + VSFTPD="" fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is onwards defined" >&5 -$as_echo_n "checking if _THREAD_SAFE is onwards defined... " >&6; } - if test "$tmp_thread_safe_initially_defined" = "yes" || - test "$tmp_need_thread_safe" = "yes"; then - -$as_echo "#define NEED_THREAD_SAFE 1" >>confdefs.h +fi -cat >>confdefs.h <<_EOF -#ifndef _THREAD_SAFE -# define _THREAD_SAFE -#endif -_EOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - # +HTTPD_ENABLED="maybe" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is already defined" >&5 -$as_echo_n "checking if _REENTRANT is already defined... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +# Check whether --with-test-httpd was given. +if test ${with_test_httpd+y} +then : + withval=$with_test_httpd; request_httpd=$withval +else $as_nop + request_httpd=check +fi +if test x"$request_httpd" = "xcheck" -o x"$request_httpd" = "xyes"; then + if test -x "/usr/sbin/apache2"; then + # common location on distros (debian/ubuntu) + HTTPD="/usr/sbin/apache2" + # Extract the first word of "apxs", so it can be a program name with args. +set dummy apxs; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_APXS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $APXS in + [\\/]* | ?:[\\/]*) + ac_cv_path_APXS="$APXS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_APXS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +APXS=$ac_cv_path_APXS +if test -n "$APXS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $APXS" >&5 +printf "%s\n" "$APXS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -int main (void) -{ -#ifdef _REENTRANT - int dummy=1; -#else - force compilation error -#endif + if test "x$APXS" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: apache2-dev not installed, httpd tests disabled" >&5 +printf "%s\n" "$as_me: apache2-dev not installed, httpd tests disabled" >&6;} + HTTPD_ENABLED="no" + fi + else + # Extract the first word of "httpd", so it can be a program name with args. +set dummy httpd; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_HTTPD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $HTTPD in + [\\/]* | ?:[\\/]*) + ac_cv_path_HTTPD="$HTTPD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_HTTPD="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ; - return 0; -} + ;; +esac +fi +HTTPD=$ac_cv_path_HTTPD +if test -n "$HTTPD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HTTPD" >&5 +printf "%s\n" "$HTTPD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tmp_reentrant_initially_defined="yes" + if test "x$HTTPD" = "x"; then + # Extract the first word of "apache2", so it can be a program name with args. +set dummy apache2; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_HTTPD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $HTTPD in + [\\/]* | ?:[\\/]*) + ac_cv_path_HTTPD="$HTTPD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_HTTPD="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +HTTPD=$ac_cv_path_HTTPD +if test -n "$HTTPD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HTTPD" >&5 +printf "%s\n" "$HTTPD" >&6; } else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tmp_reentrant_initially_defined="no" - + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # - if test "$tmp_reentrant_initially_defined" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is actually needed" >&5 -$as_echo_n "checking if _REENTRANT is actually needed... " >&6; } - case $host_os in - solaris*) - tmp_need_reentrant="yes" - ;; - *) - tmp_need_reentrant="no" - ;; + + fi + # Extract the first word of "apxs", so it can be a program name with args. +set dummy apxs; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_APXS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $APXS in + [\\/]* | ?:[\\/]*) + ac_cv_path_APXS="$APXS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_APXS="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - if test "$tmp_need_reentrant" = "no"; then + ;; +esac +fi +APXS=$ac_cv_path_APXS +if test -n "$APXS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $APXS" >&5 +printf "%s\n" "$APXS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "x$HTTPD" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: httpd/apache2 not in PATH, http tests disabled" >&5 +printf "%s\n" "$as_me: httpd/apache2 not in PATH, http tests disabled" >&6;} + HTTPD_ENABLED="no" + fi + if test "x$APXS" = "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: apxs not in PATH, http tests disabled" >&5 +printf "%s\n" "$as_me: apxs not in PATH, http tests disabled" >&6;} + HTTPD_ENABLED="no" + fi + fi +elif test x"$request_httpd" != "xno"; then + HTTPD="${request_httpd}/bin/httpd" + APXS="${request_httpd}/bin/apxs" + if test ! -x "${HTTPD}"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: httpd not found as ${HTTPD}, http tests disabled" >&5 +printf "%s\n" "$as_me: httpd not found as ${HTTPD}, http tests disabled" >&6;} + HTTPD_ENABLED="no" + elif test ! -x "${APXS}"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: apxs not found as ${APXS}, http tests disabled" >&5 +printf "%s\n" "$as_me: apxs not found as ${APXS}, http tests disabled" >&6;} + HTTPD_ENABLED="no" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using HTTPD=$HTTPD for tests" >&5 +printf "%s\n" "$as_me: using HTTPD=$HTTPD for tests" >&6;} + fi +fi +if test x"$HTTPD_ENABLED" = "xno"; then + HTTPD="" + APXS="" +fi -#include -int main (void) -{ - if(0 != errno) - return 1; +if test "x$TEST_NGHTTPX" != "x" -a "x$TEST_NGHTTPX" != "xnghttpx"; then + HTTPD_NGHTTPX="$TEST_NGHTTPX" +else + # Extract the first word of "nghttpx", so it can be a program name with args. +set dummy nghttpx; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_HTTPD_NGHTTPX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $HTTPD_NGHTTPX in + [\\/]* | ?:[\\/]*) + ac_cv_path_HTTPD_NGHTTPX="$HTTPD_NGHTTPX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_HTTPD_NGHTTPX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ; - return 0; -} + ;; +esac +fi +HTTPD_NGHTTPX=$ac_cv_path_HTTPD_NGHTTPX +if test -n "$HTTPD_NGHTTPX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HTTPD_NGHTTPX" >&5 +printf "%s\n" "$HTTPD_NGHTTPX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - tmp_errno="yes" +fi -else - tmp_errno="no" +if test "x$TEST_CADDY" != "x"; then + CADDY="$TEST_CADDY" +else + # Extract the first word of "caddy", so it can be a program name with args. +set dummy caddy; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CADDY+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $CADDY in + [\\/]* | ?:[\\/]*) + ac_cv_path_CADDY="$CADDY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CADDY="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +CADDY=$ac_cv_path_CADDY +if test -n "$CADDY"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CADDY" >&5 +printf "%s\n" "$CADDY" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$tmp_errno" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +fi -int main (void) -{ -#ifdef errno - int dummy=1; -#else - force compilation error -#endif +if test -z "$TLSCHOICE"; then + if test "x$OPT_SSL" != "xno"; then + as_fn_error $? "select TLS backend(s) or disable TLS with --without-ssl. - ; - return 0; -} +Select from these: -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + --with-amissl + --with-gnutls + --with-mbedtls + --with-openssl (also works for BoringSSL and LibreSSL) + --with-rustls + --with-schannel + --with-wolfssl +" "$LINENO" 5 + fi +fi - tmp_errno="errno_macro_defined" -else +# Check whether --with-darwinssl was given. +if test ${with_darwinssl+y} +then : + withval=$with_darwinssl; as_fn_error $? "--with-darwin-ssl and --without-darwin-ssl no longer work!" "$LINENO" 5 +fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _REENTRANT -#include -int main (void) -{ -#ifdef errno - int dummy=1; -#else - force compilation error -#endif + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 - ; - return 0; -} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - tmp_errno="errno_macro_needs_reentrant" - tmp_need_reentrant="yes" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - fi - if test "$tmp_need_reentrant" = "no"; then - if test "$tmp_need_reentrant" = "no"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +printf "%s\n" "#define CURL_OS \"${host}\"" >>confdefs.h -#define gmtime_r innocuous_gmtime_r -#ifdef __STDC__ -# include -#else -# include -#endif -#undef gmtime_r -#ifdef __cplusplus -extern "C" -#endif -char gmtime_r (); -#if defined __stub_gmtime_r || defined __stub___gmtime_r -choke me -#endif +# Silence warning: ar: 'u' modifier ignored since 'D' is the default +AR_FLAGS=cr -int main (void) -{ -return gmtime_r (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tmp_gmtime_r="yes" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else + ac_cv_path_GREP=$GREP +fi - tmp_gmtime_r="no" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$tmp_gmtime_r" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gmtime_r" >/dev/null 2>&1; then : - tmp_gmtime_r="proto_declared" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if OS is AIX (to define _ALL_SOURCE)" >&5 +printf %s "checking if OS is AIX (to define _ALL_SOURCE)... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include +#ifdef _AIX + yes_this_is_aix +#endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gmtime_r" >/dev/null 2>&1; then : + $EGREP "yes_this_is_aix" >/dev/null 2>&1 +then : - tmp_gmtime_r="proto_needs_reentrant" - tmp_need_reentrant="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h -fi -rm -f conftest* +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f conftest* +rm -rf conftest* + - fi - fi - if test "$tmp_need_reentrant" = "no"; then + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is already defined" >&5 +printf %s "checking if _THREAD_SAFE is already defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define localtime_r innocuous_localtime_r -#ifdef __STDC__ -# include -#else -# include -#endif -#undef localtime_r -#ifdef __cplusplus -extern "C" -#endif -char localtime_r (); -#if defined __stub_localtime_r || defined __stub___localtime_r -choke me -#endif -int main (void) +int main(void) { -return localtime_r (); - ; - return 0; + + #ifdef _THREAD_SAFE + int dummy = 1; + (void)dummy; + #else + #error force compilation error + #endif + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - tmp_localtime_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tmp_thread_safe_initially_defined="yes" -else +else $as_nop - tmp_localtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tmp_thread_safe_initially_defined="no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$tmp_localtime_r" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + # + if test "$tmp_thread_safe_initially_defined" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is actually needed" >&5 +printf %s "checking if _THREAD_SAFE is actually needed... " >&6; } -#include -#include + case $host_os in + aix[123].* | aix4.[012].*) + tmp_need_thread_safe="no" + ;; + aix*) + tmp_need_thread_safe="yes" + ;; + *) + tmp_need_thread_safe="no" + ;; + esac -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "localtime_r" >/dev/null 2>&1; then : + if test "$tmp_need_thread_safe" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _THREAD_SAFE is onwards defined" >&5 +printf %s "checking if _THREAD_SAFE is onwards defined... " >&6; } + if test "$tmp_thread_safe_initially_defined" = "yes" || + test "$tmp_need_thread_safe" = "yes"; then - tmp_localtime_r="proto_declared" -else +printf "%s\n" "#define NEED_THREAD_SAFE 1" >>confdefs.h - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >>confdefs.h <<_EOF +#ifndef _THREAD_SAFE +# define _THREAD_SAFE +#endif +_EOF + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + # + + + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is already defined" >&5 +printf %s "checking if _REENTRANT is already defined... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "localtime_r" >/dev/null 2>&1; then : - tmp_localtime_r="proto_needs_reentrant" - tmp_need_reentrant="yes" +int main(void) +{ -fi -rm -f conftest* + #ifdef _REENTRANT + int dummy = 1; + (void)dummy; + #else + #error force compilation error + #endif + return 0; +} -fi -rm -f conftest* +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tmp_reentrant_initially_defined="yes" - fi - if test "$tmp_need_reentrant" = "no"; then +else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tmp_reentrant_initially_defined="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + # + if test "$tmp_reentrant_initially_defined" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is actually needed" >&5 +printf %s "checking if _REENTRANT is actually needed... " >&6; } + + case $host_os in + solaris*) + tmp_need_reentrant="yes" + ;; + *) + tmp_need_reentrant="no" + ;; + esac + + if test "$tmp_need_reentrant" = "no"; then + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#define strerror_r innocuous_strerror_r -#ifdef __STDC__ -# include -#else -# include -#endif -#undef strerror_r -#ifdef __cplusplus -extern "C" -#endif -char strerror_r (); -#if defined __stub_strerror_r || defined __stub___strerror_r -choke me -#endif -int main (void) + #include + +int main(void) { -return strerror_r (); - ; - return 0; + + if(0 != errno) + return 1; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - tmp_strerror_r="yes" + tmp_errno="yes" -else +else $as_nop - tmp_strerror_r="no" + tmp_errno="no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$tmp_strerror_r" = "yes"; then +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test "$tmp_errno" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include + + #include + +int main(void) +{ + + #ifdef errno + int dummy = 1; + (void)dummy; + #else + #error force compilation error + #endif + + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror_r" >/dev/null 2>&1; then : +if ac_fn_c_try_compile "$LINENO" +then : - tmp_strerror_r="proto_declared" + tmp_errno="errno_macro_defined" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include + + #define _REENTRANT + #include + +int main(void) +{ + + #ifdef errno + int dummy = 1; + (void)dummy; + #else + #error force compilation error + #endif + + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror_r" >/dev/null 2>&1; then : +if ac_fn_c_try_compile "$LINENO" +then : - tmp_strerror_r="proto_needs_reentrant" + tmp_errno="errno_macro_needs_reentrant" tmp_need_reentrant="yes" fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi + fi + if test "$tmp_need_reentrant" = "no"; then + if test "$tmp_need_reentrant" = "no"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strtok_r innocuous_strtok_r +#define gmtime_r innocuous_gmtime_r #ifdef __STDC__ # include #else # include #endif -#undef strtok_r +#undef gmtime_r #ifdef __cplusplus extern "C" #endif -char strtok_r (); -#if defined __stub_strtok_r || defined __stub___strtok_r -choke me +char gmtime_r (); +#if defined __stub_gmtime_r || defined __stub___gmtime_r +#error force compilation error #endif -int main (void) +int main(void) { -return strtok_r (); - ; - return 0; +return gmtime_r (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - tmp_strtok_r="yes" + tmp_gmtime_r="yes" -else +else $as_nop - tmp_strtok_r="no" + tmp_gmtime_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "$tmp_strtok_r" = "yes"; then + if test "$tmp_gmtime_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtok_r" >/dev/null 2>&1; then : + $EGREP "gmtime_r" >/dev/null 2>&1 +then : - tmp_strtok_r="proto_declared" + tmp_gmtime_r="proto_declared" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtok_r" >/dev/null 2>&1; then : + $EGREP "gmtime_r" >/dev/null 2>&1 +then : - tmp_strtok_r="proto_needs_reentrant" + tmp_gmtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi -rm -f conftest* +rm -rf conftest* fi -rm -f conftest* +rm -rf conftest* fi @@ -6904,79 +7846,77 @@ rm -f conftest* /* end confdefs.h. */ -#define inet_ntoa_r innocuous_inet_ntoa_r +#define localtime_r innocuous_localtime_r #ifdef __STDC__ # include #else # include #endif -#undef inet_ntoa_r +#undef localtime_r #ifdef __cplusplus extern "C" #endif -char inet_ntoa_r (); -#if defined __stub_inet_ntoa_r || defined __stub___inet_ntoa_r -choke me +char localtime_r (); +#if defined __stub_localtime_r || defined __stub___localtime_r +#error force compilation error #endif -int main (void) +int main(void) { -return inet_ntoa_r (); - ; - return 0; +return localtime_r (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - tmp_inet_ntoa_r="yes" + tmp_localtime_r="yes" -else +else $as_nop - tmp_inet_ntoa_r="no" + tmp_localtime_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "$tmp_inet_ntoa_r" = "yes"; then + if test "$tmp_localtime_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "inet_ntoa_r" >/dev/null 2>&1; then : + $EGREP "localtime_r" >/dev/null 2>&1 +then : - tmp_inet_ntoa_r="proto_declared" + tmp_localtime_r="proto_declared" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include -#include -#include + #define _REENTRANT + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "inet_ntoa_r" >/dev/null 2>&1; then : + $EGREP "localtime_r" >/dev/null 2>&1 +then : - tmp_inet_ntoa_r="proto_needs_reentrant" + tmp_localtime_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi -rm -f conftest* +rm -rf conftest* fi -rm -f conftest* +rm -rf conftest* fi @@ -6987,75 +7927,77 @@ rm -f conftest* /* end confdefs.h. */ -#define gethostbyaddr_r innocuous_gethostbyaddr_r +#define strerror_r innocuous_strerror_r #ifdef __STDC__ # include #else # include #endif -#undef gethostbyaddr_r +#undef strerror_r #ifdef __cplusplus extern "C" #endif -char gethostbyaddr_r (); -#if defined __stub_gethostbyaddr_r || defined __stub___gethostbyaddr_r -choke me +char strerror_r (); +#if defined __stub_strerror_r || defined __stub___strerror_r +#error force compilation error #endif -int main (void) +int main(void) { -return gethostbyaddr_r (); - ; - return 0; +return strerror_r (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - tmp_gethostbyaddr_r="yes" + tmp_strerror_r="yes" -else +else $as_nop - tmp_gethostbyaddr_r="no" + tmp_strerror_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "$tmp_gethostbyaddr_r" = "yes"; then + if test "$tmp_strerror_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyaddr_r" >/dev/null 2>&1; then : + $EGREP "strerror_r" >/dev/null 2>&1 +then : - tmp_gethostbyaddr_r="proto_declared" + tmp_strerror_r="proto_declared" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyaddr_r" >/dev/null 2>&1; then : + $EGREP "strerror_r" >/dev/null 2>&1 +then : - tmp_gethostbyaddr_r="proto_needs_reentrant" + tmp_strerror_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi -rm -f conftest* +rm -rf conftest* fi -rm -f conftest* +rm -rf conftest* fi @@ -7078,63 +8020,65 @@ extern "C" #endif char gethostbyname_r (); #if defined __stub_gethostbyname_r || defined __stub___gethostbyname_r -choke me +#error force compilation error #endif -int main (void) +int main(void) { return gethostbyname_r (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : tmp_gethostbyname_r="yes" -else +else $as_nop tmp_gethostbyname_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_gethostbyname_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyname_r" >/dev/null 2>&1; then : + $EGREP "gethostbyname_r" >/dev/null 2>&1 +then : tmp_gethostbyname_r="proto_declared" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyname_r" >/dev/null 2>&1; then : + $EGREP "gethostbyname_r" >/dev/null 2>&1 +then : tmp_gethostbyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi -rm -f conftest* +rm -rf conftest* fi -rm -f conftest* +rm -rf conftest* fi @@ -7157,142 +8101,65 @@ extern "C" #endif char getprotobyname_r (); #if defined __stub_getprotobyname_r || defined __stub___getprotobyname_r -choke me +#error force compilation error #endif -int main (void) +int main(void) { return getprotobyname_r (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : tmp_getprotobyname_r="yes" -else +else $as_nop tmp_getprotobyname_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "$tmp_getprotobyname_r" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getprotobyname_r" >/dev/null 2>&1; then : + $EGREP "getprotobyname_r" >/dev/null 2>&1 +then : tmp_getprotobyname_r="proto_declared" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _REENTRANT -#include -#include + #define _REENTRANT + #include + #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getprotobyname_r" >/dev/null 2>&1; then : + $EGREP "getprotobyname_r" >/dev/null 2>&1 +then : tmp_getprotobyname_r="proto_needs_reentrant" tmp_need_reentrant="yes" fi -rm -f conftest* - - -fi -rm -f conftest* - - fi - - fi - if test "$tmp_need_reentrant" = "no"; then - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define getservbyport_r innocuous_getservbyport_r -#ifdef __STDC__ -# include -#else -# include -#endif -#undef getservbyport_r -#ifdef __cplusplus -extern "C" -#endif -char getservbyport_r (); -#if defined __stub_getservbyport_r || defined __stub___getservbyport_r -choke me -#endif - -int main (void) -{ -return getservbyport_r (); - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - tmp_getservbyport_r="yes" - -else - - tmp_getservbyport_r="no" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$tmp_getservbyport_r" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getservbyport_r" >/dev/null 2>&1; then : - - tmp_getservbyport_r="proto_declared" - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define _REENTRANT -#include -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getservbyport_r" >/dev/null 2>&1; then : - - tmp_getservbyport_r="proto_needs_reentrant" - tmp_need_reentrant="yes" - -fi -rm -f conftest* +rm -rf conftest* fi -rm -f conftest* +rm -rf conftest* fi @@ -7300,21 +8167,21 @@ rm -f conftest* fi if test "$tmp_need_reentrant" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is onwards defined" >&5 -$as_echo_n "checking if _REENTRANT is onwards defined... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _REENTRANT is onwards defined" >&5 +printf %s "checking if _REENTRANT is onwards defined... " >&6; } if test "$tmp_reentrant_initially_defined" = "yes" || test "$tmp_need_reentrant" = "yes"; then -$as_echo "#define NEED_REENTRANT 1" >>confdefs.h +printf "%s\n" "#define NEED_REENTRANT 1" >>confdefs.h cat >>confdefs.h <<_EOF #ifndef _REENTRANT @@ -7322,27 +8189,29 @@ cat >>confdefs.h <<_EOF #endif _EOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # # Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : +if test ${enable_largefile+y} +then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC @@ -7356,43 +8225,45 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_largefile_CC=' -n32'; break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7401,21 +8272,21 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 @@ -7424,42 +8295,41 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=64; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7468,21 +8338,21 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 @@ -7491,52 +8361,49 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=1; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi - - fi case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' + @@ -7573,8 +8440,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -7600,12 +8467,12 @@ func_echo_all () } case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac @@ -7621,11 +8488,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -7639,10 +8507,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -7651,13 +8524,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -7685,8 +8558,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -7703,11 +8576,12 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -7718,10 +8592,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -7730,13 +8609,13 @@ case `"$ac_path_FGREP" --version 2>&1` in ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -7765,8 +8644,8 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -7791,17 +8670,18 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw @@ -7830,15 +8710,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -7867,18 +8748,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -7901,11 +8783,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM @@ -7930,13 +8813,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -7955,8 +8838,8 @@ else : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else @@ -7969,11 +8852,12 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -7981,11 +8865,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7996,11 +8884,11 @@ fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8013,11 +8901,12 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -8025,11 +8914,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8040,11 +8933,11 @@ fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8056,15 +8949,15 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -8085,11 +8978,12 @@ test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -8105,26 +8999,27 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 teststring=ABCD @@ -8166,7 +9061,7 @@ else lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -8209,7 +9104,7 @@ else sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -8251,11 +9146,11 @@ else fi if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -8299,11 +9194,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in @@ -8339,18 +9235,19 @@ esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in @@ -8366,22 +9263,23 @@ esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -8412,25 +9310,30 @@ esac if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8439,38 +9342,43 @@ IFS=$as_save_IFS fi fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8479,42 +9387,151 @@ IFS=$as_save_IFS fi fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OBJDUMP=$ac_ct_OBJDUMP + FILECMD=$ac_ct_FILECMD fi else - OBJDUMP="$ac_cv_prog_OBJDUMP" + FILECMD="$ac_cv_prog_FILECMD" fi -test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -8540,7 +9557,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -8574,14 +9591,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -8595,7 +9612,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -8642,7 +9659,7 @@ netbsd* | netbsdelf*-gnu) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -8710,8 +9727,8 @@ os2*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no @@ -8755,11 +9772,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -8767,11 +9785,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8782,11 +9804,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8795,11 +9817,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -8807,11 +9830,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8822,11 +9849,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -8834,8 +9861,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -8852,11 +9879,12 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in @@ -8879,8 +9907,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -8895,11 +9923,12 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -8907,11 +9936,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8922,11 +9955,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8939,11 +9972,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -8951,11 +9985,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8966,11 +10004,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8982,8 +10020,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -8991,41 +10029,58 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. @@ -9033,7 +10088,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ @@ -9042,11 +10097,11 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= @@ -9063,11 +10118,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -9075,11 +10131,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9090,11 +10150,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9103,11 +10163,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -9115,11 +10176,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9130,11 +10195,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -9142,8 +10207,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -9162,11 +10227,12 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -9174,11 +10240,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9189,11 +10259,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9202,11 +10272,12 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -9214,11 +10285,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9229,11 +10304,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -9241,8 +10316,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -9331,11 +10406,12 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -9390,7 +10466,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -9408,20 +10484,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -9445,7 +10521,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -9463,9 +10539,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -9487,15 +10563,12 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -9555,7 +10628,7 @@ static const void *lt_preloaded_setup() { #endif _LT_EOF # Now try linking the two files. - mv -f conftest.$ac_objext conftstm.$ac_objext + mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext @@ -9563,7 +10636,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi @@ -9598,11 +10671,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -9648,13 +10721,14 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi @@ -9667,29 +10741,30 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} @@ -9700,10 +10775,15 @@ if test -z "$lt_DD"; then for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ @@ -9723,15 +10803,16 @@ fi rm -f conftest.i conftest2.i conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= @@ -9742,8 +10823,8 @@ fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -9766,7 +10847,8 @@ func_cc_basename () } # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi @@ -9782,9 +10864,9 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -9802,10 +10884,10 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -9817,7 +10899,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -9840,10 +10922,10 @@ mips64*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -9851,7 +10933,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -9859,7 +10941,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -9881,16 +10963,16 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -9944,11 +11026,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9958,19 +11041,19 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -9979,8 +11062,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS @@ -9993,9 +11076,9 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -10030,11 +11113,12 @@ need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -10042,11 +11126,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10057,11 +11145,11 @@ fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10070,11 +11158,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -10082,11 +11171,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10097,11 +11190,11 @@ fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -10109,8 +11202,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -10120,11 +11213,12 @@ else fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out @@ -10134,8 +11228,8 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -10150,11 +11244,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -10162,11 +11257,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10177,11 +11276,11 @@ fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10190,11 +11289,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -10202,11 +11302,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10217,11 +11321,11 @@ fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -10229,8 +11333,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -10242,11 +11346,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -10254,11 +11359,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10269,11 +11378,11 @@ fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10282,11 +11391,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -10294,11 +11404,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10309,11 +11423,11 @@ fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -10321,8 +11435,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -10334,11 +11448,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -10346,11 +11461,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10361,11 +11480,11 @@ fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10374,11 +11493,12 @@ if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -10386,11 +11506,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10401,11 +11525,11 @@ fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -10413,8 +11537,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -10426,11 +11550,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -10438,11 +11563,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10453,11 +11582,11 @@ fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10466,11 +11595,12 @@ if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -10478,11 +11608,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10493,11 +11627,11 @@ fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -10505,8 +11639,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -10518,11 +11652,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -10530,11 +11665,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10545,11 +11684,11 @@ fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10558,11 +11697,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -10570,11 +11710,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10585,11 +11729,11 @@ fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -10597,8 +11741,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -10633,11 +11777,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override @@ -10666,14 +11811,15 @@ else rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -10681,39 +11827,40 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -10733,24 +11880,19 @@ _LT_EOF rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -10805,147 +11947,14 @@ func_munge_path_list () esac } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done - # ------------------------------------ # # Determine libtool default behavior # # ------------------------------------ # @@ -10987,7 +11996,7 @@ fi if test "x$xc_lt_want_enable_shared" = 'xyes' && test "x$xc_lt_want_enable_static" = 'xyes'; then case $host_os in # ( - pw32* | cegcc* | os2* | aix*) + cegcc* | os2* | aix*) xc_lt_want_enable_static='no' ;; esac @@ -11034,7 +12043,7 @@ if test "x$xc_lt_want_with_pic" = 'xdefault'; then case $host_cpu in # ( x86_64 | amd64 | ia64) case $host_os in # ( - linux* | freebsd*) + linux* | freebsd* | midnightbsd*) xc_lt_want_with_pic='yes' ;; esac @@ -11065,11 +12074,12 @@ case $host in if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else @@ -11077,11 +12087,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11092,11 +12106,11 @@ fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf "%s\n" "$AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11105,11 +12119,12 @@ if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else @@ -11117,11 +12132,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11132,11 +12151,11 @@ fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +printf "%s\n" "$ac_ct_AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AS" = x; then @@ -11144,8 +12163,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS @@ -11157,11 +12176,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -11169,11 +12189,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11184,11 +12208,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11197,11 +12221,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -11209,11 +12234,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11224,11 +12253,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -11236,8 +12265,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -11249,11 +12278,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -11261,11 +12291,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11276,11 +12310,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11289,11 +12323,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -11301,11 +12336,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11316,11 +12355,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -11328,8 +12367,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -11366,7 +12405,8 @@ test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -11384,7 +12424,7 @@ if test "${enable_shared+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=yes fi @@ -11397,7 +12437,8 @@ fi # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -11415,7 +12456,7 @@ if test "${enable_static+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -11429,7 +12470,8 @@ fi # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; @@ -11446,7 +12488,7 @@ if test "${with_pic+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop pic_mode=default fi @@ -11458,7 +12500,8 @@ fi # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -11476,7 +12519,7 @@ if test "${enable_fast_install+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -11490,11 +12533,12 @@ fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : +if test ${with_aix_soname+y} +then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; @@ -11503,18 +12547,19 @@ if test "${with_aix_soname+set}" = set; then : ;; esac lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', @@ -11596,11 +12641,12 @@ if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -11611,17 +12657,15 @@ else fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -11642,8 +12686,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -11667,11 +12711,12 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -11720,11 +12765,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11733,11 +12778,12 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -11786,11 +12832,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11875,11 +12921,12 @@ if test yes = "$GCC"; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -11910,8 +12957,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -12108,6 +13155,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -12152,7 +13205,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -12268,26 +13321,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -12318,8 +13373,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in @@ -12347,11 +13402,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -12375,8 +13431,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : @@ -12390,11 +13446,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -12437,19 +13494,20 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -12492,8 +13550,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -12501,19 +13559,19 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -12525,8 +13583,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -12570,15 +13628,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -12633,7 +13691,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -12745,6 +13803,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -12759,7 +13818,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -12802,7 +13861,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -12814,13 +13873,14 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -12830,7 +13890,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -12962,7 +14022,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -13084,20 +14144,21 @@ _LT_EOF if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -13112,7 +14173,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -13136,20 +14197,21 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -13164,7 +14226,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -13227,12 +14289,12 @@ fi cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -13273,7 +14335,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -13314,8 +14376,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -13349,7 +14411,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -13358,9 +14420,9 @@ fi hpux9*) if test yes = "$GCC"; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv -f $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv -f $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: @@ -13415,11 +14477,12 @@ fi # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" @@ -13443,8 +14506,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -13484,28 +14547,30 @@ fi # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi @@ -13527,6 +14592,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; @@ -13598,6 +14664,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -13786,8 +14853,8 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -13823,18 +14890,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -13852,7 +14920,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -13866,8 +14934,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -14026,8 +15094,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in @@ -14289,7 +15357,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -14299,14 +15367,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -14325,7 +15393,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -14362,7 +15430,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -14395,7 +15463,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -14588,9 +15656,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -14599,19 +15668,20 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -14855,8 +15925,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -14977,8 +16047,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -15002,8 +16072,8 @@ else # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then @@ -15047,11 +16117,12 @@ else darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15062,27 +16133,28 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext extern "C" #endif char dlopen (); -int main (void) +int main(void) { return dlopen (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else +else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= @@ -15102,14 +16174,16 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = xyes +then : lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15120,36 +16194,39 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext extern "C" #endif char shl_load (); -int main (void) +int main(void) { return shl_load (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = xyes +then : lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15160,32 +16237,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext extern "C" #endif char dlopen (); -int main (void) +int main(void) { return dlopen (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15196,32 +16275,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext extern "C" #endif char dlopen (); -int main (void) +int main(void) { return dlopen (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15232,25 +16313,26 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext extern "C" #endif char dld_link (); -int main (void) +int main(void) { return dld_link (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -15289,11 +16371,12 @@ fi save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else @@ -15372,7 +16455,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -15390,16 +16473,17 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else @@ -15478,7 +16562,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -15496,8 +16580,8 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS @@ -15535,32 +16619,43 @@ fi striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi fi @@ -15575,13 +16670,13 @@ fi # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -15605,15 +16700,15 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -15683,8 +16778,8 @@ esac # Verify if libtool shared libraries should be linked using flag -version-info # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -version-info" >&5 -$as_echo_n "checking whether to build shared libraries with -version-info... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -version-info" >&5 +printf %s "checking whether to build shared libraries with -version-info... " >&6; } xc_lt_shlib_use_version_info='yes' if test "x$version_type" = 'xnone'; then xc_lt_shlib_use_version_info='no' @@ -15694,15 +16789,15 @@ case $host_os in # ( xc_lt_shlib_use_version_info='yes' ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_version_info" >&5 -$as_echo "$xc_lt_shlib_use_version_info" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_version_info" >&5 +printf "%s\n" "$xc_lt_shlib_use_version_info" >&6; } # # Verify if libtool shared libraries should be linked using flag -no-undefined # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -no-undefined" >&5 -$as_echo_n "checking whether to build shared libraries with -no-undefined... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -no-undefined" >&5 +printf %s "checking whether to build shared libraries with -no-undefined... " >&6; } xc_lt_shlib_use_no_undefined='no' if test "x$allow_undefined" = 'xno'; then xc_lt_shlib_use_no_undefined='yes' @@ -15710,19 +16805,19 @@ elif test "x$allow_undefined_flag" = 'xunsupported'; then xc_lt_shlib_use_no_undefined='yes' fi case $host_os in # ( - cygwin* | mingw* | pw32* | cegcc* | os2* | aix*) + cygwin* | mingw* | cegcc* | os2* | aix*) xc_lt_shlib_use_no_undefined='yes' ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_no_undefined" >&5 -$as_echo "$xc_lt_shlib_use_no_undefined" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_no_undefined" >&5 +printf "%s\n" "$xc_lt_shlib_use_no_undefined" >&6; } # # Verify if libtool shared libraries should be linked using flag -mimpure-text # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -mimpure-text" >&5 -$as_echo_n "checking whether to build shared libraries with -mimpure-text... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with -mimpure-text" >&5 +printf %s "checking whether to build shared libraries with -mimpure-text... " >&6; } xc_lt_shlib_use_mimpure_text='no' case $host_os in # ( solaris2*) @@ -15731,11 +16826,11 @@ case $host_os in # ( fi ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_mimpure_text" >&5 -$as_echo "$xc_lt_shlib_use_mimpure_text" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_lt_shlib_use_mimpure_text" >&5 +printf "%s\n" "$xc_lt_shlib_use_mimpure_text" >&6; } # -# Find out whether libtool libraries would be built wit PIC +# Find out whether libtool libraries would be built with PIC # case "x$pic_mode" in # (((( @@ -15754,50 +16849,240 @@ case "x$pic_mode" in # (((( *) xc_lt_build_shared_with_pic='unknown' xc_lt_build_static_with_pic='unknown' - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unexpected libtool pic_mode value: $pic_mode" >&5 -$as_echo "$as_me: WARNING: unexpected libtool pic_mode value: $pic_mode" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unexpected libtool pic_mode value: $pic_mode" >&5 +printf "%s\n" "$as_me: WARNING: unexpected libtool pic_mode value: $pic_mode" >&2;} ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with PIC" >&5 -$as_echo_n "checking whether to build shared libraries with PIC... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_shared_with_pic" >&5 -$as_echo "$xc_lt_build_shared_with_pic" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries with PIC" >&5 -$as_echo_n "checking whether to build static libraries with PIC... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_static_with_pic" >&5 -$as_echo "$xc_lt_build_static_with_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries with PIC" >&5 +printf %s "checking whether to build shared libraries with PIC... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_shared_with_pic" >&5 +printf "%s\n" "$xc_lt_build_shared_with_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries with PIC" >&5 +printf %s "checking whether to build static libraries with PIC... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_static_with_pic" >&5 +printf "%s\n" "$xc_lt_build_static_with_pic" >&6; } # # Verify if libtool shared libraries will be built while static not built # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries only" >&5 -$as_echo_n "checking whether to build shared libraries only... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries only" >&5 +printf %s "checking whether to build shared libraries only... " >&6; } if test "$xc_lt_build_shared" = 'yes' && test "$xc_lt_build_static" = 'no'; then xc_lt_build_shared_only='yes' else xc_lt_build_shared_only='no' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_shared_only" >&5 -$as_echo "$xc_lt_build_shared_only" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_shared_only" >&5 +printf "%s\n" "$xc_lt_build_shared_only" >&6; } # # Verify if libtool static libraries will be built while shared not built # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries only" >&5 -$as_echo_n "checking whether to build static libraries only... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries only" >&5 +printf %s "checking whether to build static libraries only... " >&6; } if test "$xc_lt_build_static" = 'yes' && test "$xc_lt_build_shared" = 'no'; then xc_lt_build_static_only='yes' else xc_lt_build_static_only='no' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_static_only" >&5 -$as_echo "$xc_lt_build_static_only" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xc_lt_build_static_only" >&5 +printf "%s\n" "$xc_lt_build_static_only" >&6; } + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RC"; then + ac_cv_prog_RC="$RC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RC="${ac_tool_prefix}windres" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RC=$ac_cv_prog_RC +if test -n "$RC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 +printf "%s\n" "$RC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RC"; then + ac_ct_RC=$RC + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RC"; then + ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RC="windres" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RC=$ac_cv_prog_ac_ct_RC +if test -n "$ac_ct_RC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 +printf "%s\n" "$ac_ct_RC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RC" = x; then + RC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RC=$ac_ct_RC + fi +else + RC="$ac_cv_prog_RC" +fi + + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +compiler_RC=$CC +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + +lt_cv_prog_compiler_c_o_RC=yes + +if test -n "$compiler"; then + : + + + +fi + +GCC=$lt_save_GCC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS + if test -z "$CURL_CI"; then + NOT_CURL_CI_TRUE= + NOT_CURL_CI_FALSE='#' +else + NOT_CURL_CI_TRUE='#' + NOT_CURL_CI_FALSE= +fi # @@ -15860,77 +17145,20 @@ fi # targeting a static library and not building its shared counterpart. # -CPPFLAG_CURL_STATICLIB= -if test "x$xc_lt_build_static_only" = 'xyes'; then - CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB' -fi - - - -# Determine whether all dependent libraries must be specified when linking -if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" -then - REQUIRE_LIB_DEPS=no -else - REQUIRE_LIB_DEPS=yes -fi - - if test x$REQUIRE_LIB_DEPS = xyes; then - USE_EXPLICIT_LIB_DEPS_TRUE= - USE_EXPLICIT_LIB_DEPS_FALSE='#' -else - USE_EXPLICIT_LIB_DEPS_TRUE='#' - USE_EXPLICIT_LIB_DEPS_FALSE= -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif +LIBCURL_PC_CFLAGS_PRIVATE='-DCURL_STATICLIB' -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done +LIBCURL_PC_CFLAGS= +if test "x$xc_lt_build_static_only" = 'xyes'; then + LIBCURL_PC_CFLAGS="${LIBCURL_PC_CFLAGS_PRIVATE}" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if cpp -P is needed" >&5 -$as_echo_n "checking if cpp -P is needed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if cpp -P is needed" >&5 +printf %s "checking if cpp -P is needed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15939,19 +17167,20 @@ TEST EINVAL TEST _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "TEST.*TEST" >/dev/null 2>&1; then : + $EGREP "TEST.*TEST" >/dev/null 2>&1 +then : cpp=no -else +else $as_nop cpp=yes fi -rm -f conftest* +rm -rf conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpp" >&5 -$as_echo "$cpp" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cpp" >&5 +printf "%s\n" "$cpp" >&6; } if test "x$cpp" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if cpp -P works" >&5 -$as_echo_n "checking if cpp -P works... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if cpp -P works" >&5 +printf %s "checking if cpp -P works... " >&6; } OLDCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -P" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15962,19 +17191,20 @@ TEST EINVAL TEST _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "TEST.*TEST" >/dev/null 2>&1; then : + $EGREP "TEST.*TEST" >/dev/null 2>&1 +then : cpp_p=yes -else +else $as_nop cpp_p=no fi -rm -f conftest* +rm -rf conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpp_p" >&5 -$as_echo "$cpp_p" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cpp_p" >&5 +printf "%s\n" "$cpp_p" >&6; } if test "x$cpp_p" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: failed to figure out cpp -P alternative" >&5 -$as_echo "$as_me: WARNING: failed to figure out cpp -P alternative" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: failed to figure out cpp -P alternative" >&5 +printf "%s\n" "$as_me: WARNING: failed to figure out cpp -P alternative" >&2;} # without -P CPPPFLAG="" else @@ -15990,11 +17220,10 @@ $as_echo "$as_me: WARNING: failed to figure out cpp -P alternative" >&2;} # compiler_id="unknown" + compiler_ver="" compiler_num="0" # - flags_dbg_all="unknown" flags_dbg_yes="unknown" - flags_dbg_off="unknown" flags_opt_all="unknown" flags_opt_yes="unknown" flags_opt_off="unknown" @@ -16002,8 +17231,8 @@ $as_echo "$as_me: WARNING: failed to figure out cpp -P alternative" >&2;} flags_prefer_cppflags="no" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is DEC/Compaq/HP C" >&5 -$as_echo_n "checking if compiler is DEC/Compaq/HP C... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is DEC/Compaq/HP C" >&5 +printf %s "checking if compiler is DEC/Compaq/HP C... " >&6; } OLDCPPFLAGS=$CPPFLAGS # CPPPFLAG comes from CURL_CPP_P @@ -16020,13 +17249,14 @@ $as_echo_n "checking if compiler is DEC/Compaq/HP C... " >&6; } /* end confdefs.h. */ -#ifdef __DECC -CURL_DEF_TOKEN __DECC -#endif + #ifdef __DECC + CURL_DEF_TOKEN __DECC + #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ @@ -16064,13 +17294,14 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ -#ifdef __DECC_VER -CURL_DEF_TOKEN __DECC_VER -#endif + #ifdef __DECC_VER + CURL_DEF_TOKEN __DECC_VER + #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ @@ -16093,24 +17324,22 @@ rm -f conftest.err conftest.i conftest.$ac_ext CPPFLAGS=$OLDCPPFLAGS if test "$curl_cv_have_def___DECC" = "yes" && - test "$curl_cv_have_def___DECC_VER" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + test "$curl_cv_have_def___DECC_VER" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } compiler_id="DEC_C" - flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g2" - flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4" flags_opt_yes="-O1" flags_opt_off="-O0" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is HP-UX C" >&5 -$as_echo_n "checking if compiler is HP-UX C... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is HP-UX C" >&5 +printf %s "checking if compiler is HP-UX C... " >&6; } OLDCPPFLAGS=$CPPFLAGS # CPPPFLAG comes from CURL_CPP_P @@ -16127,13 +17356,14 @@ $as_echo_n "checking if compiler is HP-UX C... " >&6; } /* end confdefs.h. */ -#ifdef __HP_cc -CURL_DEF_TOKEN __HP_cc -#endif + #ifdef __HP_cc + CURL_DEF_TOKEN __HP_cc + #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ @@ -16156,23 +17386,21 @@ rm -f conftest.err conftest.i conftest.$ac_ext CPPFLAGS=$OLDCPPFLAGS if test "$curl_cv_have_def___HP_cc" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } compiler_id="HP_UX_C" - flags_dbg_all="-g -s" flags_dbg_yes="-g" - flags_dbg_off="-s" flags_opt_all="-O +O0 +O1 +O2 +O3 +O4" flags_opt_yes="+O2" flags_opt_off="+O0" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is IBM C" >&5 -$as_echo_n "checking if compiler is IBM C... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is IBM C" >&5 +printf %s "checking if compiler is IBM C... " >&6; } OLDCPPFLAGS=$CPPFLAGS # CPPPFLAG comes from CURL_CPP_P @@ -16189,13 +17417,14 @@ $as_echo_n "checking if compiler is IBM C... " >&6; } /* end confdefs.h. */ -#ifdef __IBMC__ -CURL_DEF_TOKEN __IBMC__ -#endif + #ifdef __IBMC__ + CURL_DEF_TOKEN __IBMC__ + #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ @@ -16218,12 +17447,10 @@ rm -f conftest.err conftest.i conftest.$ac_ext CPPFLAGS=$OLDCPPFLAGS if test "$curl_cv_have_def___IBMC__" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } compiler_id="IBM_C" - flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" - flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4 -O5" flags_opt_all="$flags_opt_all -qnooptimize" flags_opt_all="$flags_opt_all -qoptimize=0" @@ -16236,13 +17463,13 @@ $as_echo "yes" >&6; } flags_opt_off="-qnooptimize" flags_prefer_cppflags="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is Intel C" >&5 -$as_echo_n "checking if compiler is Intel C... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is Intel C" >&5 +printf %s "checking if compiler is Intel C... " >&6; } OLDCPPFLAGS=$CPPFLAGS # CPPPFLAG comes from CURL_CPP_P @@ -16259,13 +17486,14 @@ $as_echo_n "checking if compiler is Intel C... " >&6; } /* end confdefs.h. */ -#ifdef __INTEL_COMPILER -CURL_DEF_TOKEN __INTEL_COMPILER -#endif + #ifdef __INTEL_COMPILER + CURL_DEF_TOKEN __INTEL_COMPILER + #endif _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ @@ -16284,6062 +17512,4895 @@ rm -f conftest.err conftest.i conftest.$ac_ext curl_cv_have_def___INTEL_COMPILER=yes curl_cv_def___INTEL_COMPILER=$tmp_exp - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_num="$curl_cv_def___INTEL_COMPILER" - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __unix__ -CURL_DEF_TOKEN __unix__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = ""; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___unix__=no - - else - curl_cv_have_def___unix__=yes - curl_cv_def___unix__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___unix__" = "yes"; then - compiler_id="INTEL_UNIX_C" - flags_dbg_all="-g -g0" - flags_dbg_yes="-g" - flags_dbg_off="" - flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" - flags_opt_yes="-O2" - flags_opt_off="-O0" - else - compiler_id="INTEL_WINDOWS_C" - flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" - flags_dbg_all="$flags_dbg_all /debug" - flags_dbg_all="$flags_dbg_all /debug:none" - flags_dbg_all="$flags_dbg_all /debug:minimal" - flags_dbg_all="$flags_dbg_all /debug:partial" - flags_dbg_all="$flags_dbg_all /debug:full" - flags_dbg_all="$flags_dbg_all /debug:semantic_stepping" - flags_dbg_all="$flags_dbg_all /debug:extended" - flags_dbg_yes="/Zi /Oy-" - flags_dbg_off="/debug:none /Oy-" - flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-" - flags_opt_yes="/O2" - flags_opt_off="/Od" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is clang" >&5 -$as_echo_n "checking if compiler is clang... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __clang__ -CURL_DEF_TOKEN __clang__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__clang__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___clang__=no - - else - curl_cv_have_def___clang__=yes - curl_cv_def___clang__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___clang__" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_id="CLANG" - fullclangver=`$CC -v 2>&1 | grep version` - clangver=`echo $fullclangver | grep "based on LLVM " | "$SED" 's/.*(based on LLVM \([0-9]*\.[0-9]*\).*)/\1/'` - if test -z "$clangver"; then - if echo $fullclangver | grep "Apple LLVM version " >/dev/null; then - clangver="3.7" - else - clangver=`echo $fullclangver | "$SED" 's/.*version \([0-9]*\.[0-9]*\).*/\1/'` - fi - fi - clangvhi=`echo $clangver | cut -d . -f1` - clangvlo=`echo $clangver | cut -d . -f2` - compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` - flags_dbg_all="-g -g0 -g1 -g2 -g3" - flags_dbg_all="$flags_dbg_all -ggdb" - flags_dbg_all="$flags_dbg_all -gstabs" - flags_dbg_all="$flags_dbg_all -gstabs+" - flags_dbg_all="$flags_dbg_all -gcoff" - flags_dbg_all="$flags_dbg_all -gxcoff" - flags_dbg_all="$flags_dbg_all -gdwarf-2" - flags_dbg_all="$flags_dbg_all -gvms" - flags_dbg_yes="-g" - flags_dbg_off="" - flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4" - flags_opt_yes="-Os" - flags_opt_off="-O0" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is GNU C" >&5 -$as_echo_n "checking if compiler is GNU C... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __GNUC__ -CURL_DEF_TOKEN __GNUC__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___GNUC__=no - - else - curl_cv_have_def___GNUC__=yes - curl_cv_def___GNUC__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___GNUC__" = "yes" && - test "$compiler_id" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_id="GNU_C" - gccver=`$CC -dumpversion` - gccvhi=`echo $gccver | cut -d . -f1` - gccvlo=`echo $gccver | cut -d . -f2` - compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` - flags_dbg_all="-g -g0 -g1 -g2 -g3" - flags_dbg_all="$flags_dbg_all -ggdb" - flags_dbg_all="$flags_dbg_all -gstabs" - flags_dbg_all="$flags_dbg_all -gstabs+" - flags_dbg_all="$flags_dbg_all -gcoff" - flags_dbg_all="$flags_dbg_all -gxcoff" - flags_dbg_all="$flags_dbg_all -gdwarf-2" - flags_dbg_all="$flags_dbg_all -gvms" - flags_dbg_yes="-g" - flags_dbg_off="" - flags_opt_all="-O -O0 -O1 -O2 -O3 -Os -Og -Ofast" - flags_opt_yes="-O2" - flags_opt_off="-O0" - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef _WIN32 -CURL_DEF_TOKEN _WIN32 -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "_WIN32"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def__WIN32=no - - else - curl_cv_have_def__WIN32=yes - curl_cv_def__WIN32=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is LCC" >&5 -$as_echo_n "checking if compiler is LCC... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __LCC__ -CURL_DEF_TOKEN __LCC__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__LCC__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___LCC__=no - - else - curl_cv_have_def___LCC__=yes - curl_cv_def___LCC__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___LCC__" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_id="LCC" - flags_dbg_all="-g" - flags_dbg_yes="-g" - flags_dbg_off="" - flags_opt_all="" - flags_opt_yes="" - flags_opt_off="" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is SGI MIPSpro C" >&5 -$as_echo_n "checking if compiler is SGI MIPSpro C... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __GNUC__ -CURL_DEF_TOKEN __GNUC__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___GNUC__=no - - else - curl_cv_have_def___GNUC__=yes - curl_cv_def___GNUC__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef _COMPILER_VERSION -CURL_DEF_TOKEN _COMPILER_VERSION -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "_COMPILER_VERSION"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def__COMPILER_VERSION=no - - else - curl_cv_have_def__COMPILER_VERSION=yes - curl_cv_def__COMPILER_VERSION=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef _SGI_COMPILER_VERSION -CURL_DEF_TOKEN _SGI_COMPILER_VERSION -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "_SGI_COMPILER_VERSION"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def__SGI_COMPILER_VERSION=no - - else - curl_cv_have_def__SGI_COMPILER_VERSION=yes - curl_cv_def__SGI_COMPILER_VERSION=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___GNUC__" = "no" && - (test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes" || - test "$curl_cv_have_def__COMPILER_VERSION" = "yes"); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_id="SGI_MIPSPRO_C" - flags_dbg_all="-g -g0 -g1 -g2 -g3" - flags_dbg_yes="-g" - flags_dbg_off="" - flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" - flags_opt_yes="-O2" - flags_opt_off="-O0" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is SGI MIPS C" >&5 -$as_echo_n "checking if compiler is SGI MIPS C... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __GNUC__ -CURL_DEF_TOKEN __GNUC__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___GNUC__=no - - else - curl_cv_have_def___GNUC__=yes - curl_cv_def___GNUC__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __sgi -CURL_DEF_TOKEN __sgi -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__sgi"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___sgi=no - - else - curl_cv_have_def___sgi=yes - curl_cv_def___sgi=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___GNUC__" = "no" && - test "$curl_cv_have_def___sgi" = "yes" && - test "$compiler_id" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_id="SGI_MIPS_C" - flags_dbg_all="-g -g0 -g1 -g2 -g3" - flags_dbg_yes="-g" - flags_dbg_off="" - flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" - flags_opt_yes="-O2" - flags_opt_off="-O0" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is SunPro C" >&5 -$as_echo_n "checking if compiler is SunPro C... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __SUNPRO_C -CURL_DEF_TOKEN __SUNPRO_C -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__SUNPRO_C"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___SUNPRO_C=no - - else - curl_cv_have_def___SUNPRO_C=yes - curl_cv_def___SUNPRO_C=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_id="SUNPRO_C" - flags_dbg_all="-g -s" - flags_dbg_yes="-g" - flags_dbg_off="-s" - flags_opt_all="-O -xO -xO1 -xO2 -xO3 -xO4 -xO5" - flags_opt_yes="-xO2" - flags_opt_off="" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is Tiny C" >&5 -$as_echo_n "checking if compiler is Tiny C... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __TINYC__ -CURL_DEF_TOKEN __TINYC__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__TINYC__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___TINYC__=no - - else - curl_cv_have_def___TINYC__=yes - curl_cv_def___TINYC__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___TINYC__" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - compiler_id="TINY_C" - flags_dbg_all="-g -b" - flags_dbg_yes="-g" - flags_dbg_off="" - flags_opt_all="" - flags_opt_yes="" - flags_opt_off="" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is Watcom C" >&5 -$as_echo_n "checking if compiler is Watcom C... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __WATCOMC__ -CURL_DEF_TOKEN __WATCOMC__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__WATCOMC__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___WATCOMC__=no - - else - curl_cv_have_def___WATCOMC__=yes - curl_cv_def___WATCOMC__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___WATCOMC__" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - - tmp_exp="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef __UNIX__ -CURL_DEF_TOKEN __UNIX__ -#endif - - -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "__UNIX__"; then - tmp_exp="" - fi - -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def___UNIX__=no - - else - curl_cv_have_def___UNIX__=yes - curl_cv_def___UNIX__=$tmp_exp - - fi - CPPFLAGS=$OLDCPPFLAGS - - if test "$curl_cv_have_def___UNIX__" = "yes"; then - compiler_id="WATCOM_UNIX_C" - flags_dbg_all="-g1 -g1+ -g2 -g3" - flags_dbg_yes="-g2" - flags_dbg_off="" - flags_opt_all="-O0 -O1 -O2 -O3" - flags_opt_yes="-O2" - flags_opt_off="-O0" - else - compiler_id="WATCOM_WINDOWS_C" - flags_dbg_all="" - flags_dbg_yes="" - flags_dbg_off="" - flags_opt_all="" - flags_opt_yes="" - flags_opt_off="" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - # - if test "$compiler_id" = "unknown"; then - cat <<_EOF 1>&2 -*** -*** Warning: This configure script does not have information about the -*** compiler you are using, relative to the flags required to enable or -*** disable generation of debug info, optimization options or warnings. -*** -*** Whatever settings are present in CFLAGS will be used for this run. -*** -*** If you wish to help the curl project to better support your compiler -*** you can report this and the required info on the libcurl development -*** mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/ -*** -_EOF - fi - - -squeeze() { - _sqz_result="" - eval _sqz_input=\$$1 - for _sqz_token in $_sqz_input; do - if test -z "$_sqz_result"; then - _sqz_result="$_sqz_token" - else - _sqz_result="$_sqz_result $_sqz_token" - fi - done - eval $1=\$_sqz_result - return 0 -} - - - # - if test "$compiler_id" != "unknown"; then - # - if test "$compiler_id" = "GNU_C" || - test "$compiler_id" = "CLANG"; then - - if test "$compiler_id" = "GNU_C" || - test "$compiler_id" = "CLANG"; then - tmp_has_include="no" - tmp_chg_FLAGS="$CFLAGS" - for word1 in $tmp_chg_FLAGS; do - case "$word1" in - -I*) - tmp_has_include="yes" - ;; - esac - done - if test "$tmp_has_include" = "yes"; then - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` - CFLAGS="$tmp_chg_FLAGS" - squeeze CFLAGS - fi - tmp_has_include="no" - tmp_chg_FLAGS="$CPPFLAGS" - for word1 in $tmp_chg_FLAGS; do - case "$word1" in - -I*) - tmp_has_include="yes" - ;; - esac - done - if test "$tmp_has_include" = "yes"; then - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` - CPPFLAGS="$tmp_chg_FLAGS" - squeeze CPPFLAGS - fi - fi - - fi - # - tmp_save_CPPFLAGS="$CPPFLAGS" - tmp_save_CFLAGS="$CFLAGS" - tmp_CPPFLAGS="" - tmp_CFLAGS="" - # - case "$compiler_id" in - # - CLANG) - # - tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" - ;; - # - DEC_C) - # - tmp_CFLAGS="$tmp_CFLAGS -std1" - tmp_CFLAGS="$tmp_CFLAGS -noansi_alias" - tmp_CFLAGS="$tmp_CFLAGS -warnprotos" - tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs" - ;; - # - GNU_C) - # - if test "$compiler_num" -ge "295"; then - tmp_CFLAGS="$tmp_CFLAGS -Werror-implicit-function-declaration" - fi - ;; - # - HP_UX_C) - # - tmp_CFLAGS="$tmp_CFLAGS -z" - tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255" - ;; - # - IBM_C) - # - tmp_CPPFLAGS="$tmp_CPPFLAGS -qthreaded" - tmp_CPPFLAGS="$tmp_CPPFLAGS -qnoansialias" - tmp_CPPFLAGS="$tmp_CPPFLAGS -qhalt=e" - ;; - # - INTEL_UNIX_C) - # - tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" - tmp_CPPFLAGS="$tmp_CPPFLAGS -we140,147,165,266" - tmp_CPPFLAGS="$tmp_CPPFLAGS -wd279,981,1469" - ;; - # - INTEL_WINDOWS_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - LCC) - # - tmp_CFLAGS="$tmp_CFLAGS -n" - ;; - # - SGI_MIPS_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - SGI_MIPSPRO_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - SUNPRO_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - TINY_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - WATCOM_UNIX_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - WATCOM_WINDOWS_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - esac - # - squeeze tmp_CPPFLAGS - squeeze tmp_CFLAGS - # - if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts some basic options" >&5 -$as_echo_n "checking if compiler accepts some basic options... " >&6; } - CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" - CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" - squeeze CPPFLAGS - squeeze CFLAGS - - tmp_compiler_works="unknown" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int main (void) -{ - - int i = 1; - return i; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/cc-fail: /' conftest.err >&6 - echo " " >&6 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$tmp_compiler_works" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int main (void) -{ - - int i = 1; - return i; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/link-fail: /' conftest.err >&6 - echo " " >&6 - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "x$cross_compiling" != "xyes" && - test "$tmp_compiler_works" = "yes"; then - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -# ifdef __STDC__ -# include -# endif - -int main (void) -{ - - int i = 0; - exit(i); - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - echo "run-fail: test program exited with status $ac_status" >&6 - echo " " >&6 - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi - if test "$tmp_compiler_works" = "yes"; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 -$as_echo "$as_me: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&6;} - - else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 -$as_echo "$as_me: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&2;} - CPPFLAGS="$tmp_save_CPPFLAGS" - CFLAGS="$tmp_save_CFLAGS" - - fi - - fi - # - fi - - - # - if test "$compiler_id" != "unknown"; then - # - tmp_save_CFLAGS="$CFLAGS" - tmp_save_CPPFLAGS="$CPPFLAGS" - # - tmp_options="" - tmp_CFLAGS="$CFLAGS" - tmp_CPPFLAGS="$CPPFLAGS" - - ac_var_stripped="" - for word1 in $tmp_CFLAGS; do - ac_var_strip_word="no" - for word2 in $flags_dbg_all; do - if test "$word1" = "$word2"; then - ac_var_strip_word="yes" - fi - done - if test "$ac_var_strip_word" = "no"; then - ac_var_stripped="$ac_var_stripped $word1" - fi - done - tmp_CFLAGS="$ac_var_stripped" - squeeze tmp_CFLAGS - - - ac_var_stripped="" - for word1 in $tmp_CPPFLAGS; do - ac_var_strip_word="no" - for word2 in $flags_dbg_all; do - if test "$word1" = "$word2"; then - ac_var_strip_word="yes" - fi - done - if test "$ac_var_strip_word" = "no"; then - ac_var_stripped="$ac_var_stripped $word1" - fi - done - tmp_CPPFLAGS="$ac_var_stripped" - squeeze tmp_CPPFLAGS - - # - if test "$want_debug" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts debug enabling options" >&5 -$as_echo_n "checking if compiler accepts debug enabling options... " >&6; } - tmp_options="$flags_dbg_yes" - fi - if test "$want_debug" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts debug disabling options" >&5 -$as_echo_n "checking if compiler accepts debug disabling options... " >&6; } - tmp_options="$flags_dbg_off" - fi - # - if test "$flags_prefer_cppflags" = "yes"; then - CPPFLAGS="$tmp_CPPFLAGS $tmp_options" - CFLAGS="$tmp_CFLAGS" - else - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS $tmp_options" - fi - squeeze CPPFLAGS - squeeze CFLAGS - - tmp_compiler_works="unknown" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int main (void) -{ - - int i = 1; - return i; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/cc-fail: /' conftest.err >&6 - echo " " >&6 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$tmp_compiler_works" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int main (void) -{ - - int i = 1; - return i; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/link-fail: /' conftest.err >&6 - echo " " >&6 - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "x$cross_compiling" != "xyes" && - test "$tmp_compiler_works" = "yes"; then - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -# ifdef __STDC__ -# include -# endif - -int main (void) -{ - - int i = 0; - exit(i); - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - echo "run-fail: test program exited with status $ac_status" >&6 - echo " " >&6 - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi - if test "$tmp_compiler_works" = "yes"; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_options" >&5 -$as_echo "$as_me: compiler options added: $tmp_options" >&6;} - - else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_options" >&5 -$as_echo "$as_me: WARNING: compiler options rejected: $tmp_options" >&2;} - CPPFLAGS="$tmp_save_CPPFLAGS" - CFLAGS="$tmp_save_CFLAGS" - - fi - - # - fi - - - # - if test "$compiler_id" != "unknown"; then - # - tmp_save_CFLAGS="$CFLAGS" - tmp_save_CPPFLAGS="$CPPFLAGS" - # - tmp_options="" - tmp_CFLAGS="$CFLAGS" - tmp_CPPFLAGS="$CPPFLAGS" - honor_optimize_option="yes" - # - # - if test "$want_optimize" = "assume_no" || - test "$want_optimize" = "assume_yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler optimizer assumed setting might be used" >&5 -$as_echo_n "checking if compiler optimizer assumed setting might be used... " >&6; } - - - ac_var_match_word="no" - for word1 in $tmp_CFLAGS; do - for word2 in $flags_opt_all; do - if test "$word1" = "$word2"; then - ac_var_match_word="yes" - fi - done - done - - if test "$ac_var_match_word" = "yes"; then - - honor_optimize_option="no" - - - fi - - - - ac_var_match_word="no" - for word1 in $tmp_CPPFLAGS; do - for word2 in $flags_opt_all; do - if test "$word1" = "$word2"; then - ac_var_match_word="yes" - fi - done - done - - if test "$ac_var_match_word" = "yes"; then - - honor_optimize_option="no" - - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $honor_optimize_option" >&5 -$as_echo "$honor_optimize_option" >&6; } - if test "$honor_optimize_option" = "yes"; then - if test "$want_optimize" = "assume_yes"; then - want_optimize="yes" - fi - if test "$want_optimize" = "assume_no"; then - want_optimize="no" - fi - fi - fi - # - if test "$honor_optimize_option" = "yes"; then - - ac_var_stripped="" - for word1 in $tmp_CFLAGS; do - ac_var_strip_word="no" - for word2 in $flags_opt_all; do - if test "$word1" = "$word2"; then - ac_var_strip_word="yes" - fi - done - if test "$ac_var_strip_word" = "no"; then - ac_var_stripped="$ac_var_stripped $word1" - fi - done - tmp_CFLAGS="$ac_var_stripped" - squeeze tmp_CFLAGS - - - ac_var_stripped="" - for word1 in $tmp_CPPFLAGS; do - ac_var_strip_word="no" - for word2 in $flags_opt_all; do - if test "$word1" = "$word2"; then - ac_var_strip_word="yes" - fi - done - if test "$ac_var_strip_word" = "no"; then - ac_var_stripped="$ac_var_stripped $word1" - fi - done - tmp_CPPFLAGS="$ac_var_stripped" - squeeze tmp_CPPFLAGS - - if test "$want_optimize" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer enabling options" >&5 -$as_echo_n "checking if compiler accepts optimizer enabling options... " >&6; } - tmp_options="$flags_opt_yes" - fi - if test "$want_optimize" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer disabling options" >&5 -$as_echo_n "checking if compiler accepts optimizer disabling options... " >&6; } - tmp_options="$flags_opt_off" - fi - if test "$flags_prefer_cppflags" = "yes"; then - CPPFLAGS="$tmp_CPPFLAGS $tmp_options" - CFLAGS="$tmp_CFLAGS" - else - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS $tmp_options" - fi - squeeze CPPFLAGS - squeeze CFLAGS - - tmp_compiler_works="unknown" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int main (void) -{ - - int i = 1; - return i; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/cc-fail: /' conftest.err >&6 - echo " " >&6 - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$tmp_compiler_works" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int main (void) -{ - - int i = 1; - return i; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/link-fail: /' conftest.err >&6 - echo " " >&6 - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "x$cross_compiling" != "xyes" && - test "$tmp_compiler_works" = "yes"; then - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -# ifdef __STDC__ -# include -# endif - -int main (void) -{ - - int i = 0; - exit(i); - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - - tmp_compiler_works="yes" - -else - - tmp_compiler_works="no" - echo " " >&6 - echo "run-fail: test program exited with status $ac_status" >&6 - echo " " >&6 - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi - if test "$tmp_compiler_works" = "yes"; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_options" >&5 -$as_echo "$as_me: compiler options added: $tmp_options" >&6;} - - else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_options" >&5 -$as_echo "$as_me: WARNING: compiler options rejected: $tmp_options" >&2;} - CPPFLAGS="$tmp_save_CPPFLAGS" - CFLAGS="$tmp_save_CFLAGS" - - fi - - fi - # - fi - - - # - if test "$compiler_id" != "unknown"; then - # - tmp_save_CPPFLAGS="$CPPFLAGS" - tmp_save_CFLAGS="$CFLAGS" - tmp_CPPFLAGS="" - tmp_CFLAGS="" - # - case "$compiler_id" in - # - CLANG) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -pedantic" - tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" - tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" - tmp_CFLAGS="$tmp_CFLAGS -Wshadow" - tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" - tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" - tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" - tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" - tmp_CFLAGS="$tmp_CFLAGS -Wundef" - tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" - tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" - tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" - tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" - tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" - tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" - # - if test "$compiler_num" -ge "101"; then - tmp_CFLAGS="$tmp_CFLAGS -Wunused" - fi - # - if test "$compiler_num" -ge "208"; then - tmp_CFLAGS="$tmp_CFLAGS -Wvla" - fi - # - if test "$compiler_num" -ge "209"; then - tmp_CFLAGS="$tmp_CFLAGS -Wshift-sign-overflow" - fi - # - if test "$compiler_num" -ge "302"; then - case $host_os in - cygwin* | mingw*) - ;; - *) - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-variable-declarations" - ;; - esac - fi - # - if test "$compiler_num" -ge "306"; then - tmp_CFLAGS="$tmp_CFLAGS -Wdouble-promotion" - fi - # - if test "$compiler_num" -ge "309"; then - tmp_CFLAGS="$tmp_CFLAGS -Wcomma" - # avoid the varargs warning, fixed in 4.0 - # https://bugs.llvm.org/show_bug.cgi?id=29140 - if test "$compiler_num" -lt "400"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-varargs" - fi - fi - fi - ;; - # - DEC_C) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -msg_enable level3" - fi - ;; - # - GNU_C) - # - if test "$want_warnings" = "yes"; then - # - if test "x$cross_compiling" != "xyes" || - test "$compiler_num" -ge "300"; then - tmp_CFLAGS="$tmp_CFLAGS -pedantic" - fi - # - tmp_CFLAGS="$tmp_CFLAGS -Wall -W" - # - if test "$compiler_num" -ge "104"; then - tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" - if test "x$cross_compiling" != "xyes" || - test "$compiler_num" -ge "300"; then - tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow" - fi - fi - # - if test "$compiler_num" -ge "207"; then - tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" - if test "x$cross_compiling" != "xyes" || - test "$compiler_num" -ge "300"; then - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" - fi - fi - # - if test "$compiler_num" -ge "295"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" - fi - # - if test "$compiler_num" -ge "296"; then - tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" - tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" - tmp_CFLAGS="$tmp_CFLAGS -Wundef" - fi - # - if test "$compiler_num" -ge "297"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" - fi - # - if test "$compiler_num" -ge "300"; then - tmp_CFLAGS="$tmp_CFLAGS" - fi - # - if test "$compiler_num" -ge "303"; then - tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" - fi - # - if test "$compiler_num" -ge "304"; then - tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" - fi - # - if test "$compiler_num" -ge "400"; then - tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" - fi - # - if test "$compiler_num" -ge "402"; then - tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" - fi - # - if test "$compiler_num" -ge "403"; then - tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration" - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-parameter-type -Wempty-body" - tmp_CFLAGS="$tmp_CFLAGS -Wclobbered -Wignored-qualifiers" - tmp_CFLAGS="$tmp_CFLAGS -Wconversion -Wno-sign-conversion -Wvla" - fi - # - if test "$compiler_num" -ge "405"; then - if test "$curl_cv_have_def__WIN32" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format" - fi - fi - # - if test "$compiler_num" -ge "406"; then - tmp_CFLAGS="$tmp_CFLAGS -Wdouble-promotion" - fi - # - fi - # - if test "$compiler_num" -ge "300"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" - else - if test "x$cross_compiling" = "xyes"; then - if test "$compiler_num" -ge "104"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" - fi - if test "$compiler_num" -ge "207"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-declarations" - tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" - fi - fi - fi - ;; - # - HP_UX_C) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS +w1" - fi - ;; - # - IBM_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - INTEL_UNIX_C) - # - if test "$want_warnings" = "yes"; then - if test "$compiler_num" -gt "600"; then - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcomment" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wdeprecated" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wmissing-prototypes" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wp64" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wpointer-arith" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wreturn-type" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wshadow" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wuninitialized" - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wunused-function" - fi - fi - tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" - tmp_CFLAGS="$tmp_CFLAGS -fno-strict-aliasing" - tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" - if test "$compiler_num" -ge "1000"; then - tmp_CFLAGS="$tmp_CFLAGS -vec-report0" - fi - ;; - # - INTEL_WINDOWS_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - LCC) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS" - fi - ;; - # - SGI_MIPS_C) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -fullwarn" - fi - ;; - # - SGI_MIPSPRO_C) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -fullwarn" - tmp_CFLAGS="$tmp_CFLAGS -woff 1209" - fi - ;; - # - SUNPRO_C) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -v" - fi - ;; - # - TINY_C) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -Wall" - tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" - tmp_CFLAGS="$tmp_CFLAGS -Wunsupported" - fi - ;; - # - WATCOM_UNIX_C) - # - if test "$want_warnings" = "yes"; then - tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" - fi - ;; - # - WATCOM_WINDOWS_C) - # - tmp_CFLAGS="$tmp_CFLAGS" - ;; - # - esac - # - squeeze tmp_CPPFLAGS - squeeze tmp_CFLAGS - # - if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts strict warning options" >&5 -$as_echo_n "checking if compiler accepts strict warning options... " >&6; } - CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" - CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" - squeeze CPPFLAGS - squeeze CFLAGS + fi + CPPFLAGS=$OLDCPPFLAGS - tmp_compiler_works="unknown" + if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking compiler version" >&5 +printf %s "checking compiler version... " >&6; } + compiler_num="$curl_cv_def___INTEL_COMPILER" + compiler_ver=`echo "$compiler_num" | cut -c -2 | $SED 's/^0//'`.`echo "$compiler_num" | cut -c 3-4 | $SED 's/^0//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Intel C '$compiler_num'" >&5 +printf "%s\n" "Intel C '$compiler_num'" >&6; } + + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi + + tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef __unix__ + CURL_DEF_TOKEN __unix__ + #endif -int main (void) -{ - int i = 1; - return i; +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : - ; - return 0; -} + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = ""; then + tmp_exp="" + fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___unix__=no - tmp_compiler_works="yes" + else + curl_cv_have_def___unix__=yes + curl_cv_def___unix__=$tmp_exp -else + fi + CPPFLAGS=$OLDCPPFLAGS - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/cc-fail: /' conftest.err >&6 - echo " " >&6 + if test "$curl_cv_have_def___unix__" = "yes"; then + compiler_id="INTEL_UNIX_C" + flags_dbg_yes="-g" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + compiler_id="INTEL_WINDOWS_C" + flags_dbg_yes="/Zi /Oy-" + flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-" + flags_opt_yes="/O2" + flags_opt_off="/Od" + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$tmp_compiler_works" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is clang" >&5 +printf %s "checking if compiler is clang... " >&6; } + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi -int main (void) -{ + tmp_exp="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - int i = 1; - return i; - ; - return 0; -} + #ifdef __clang__ + CURL_DEF_TOKEN __clang__ + #endif + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : - tmp_compiler_works="yes" + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__clang__"; then + tmp_exp="" + fi -else +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___clang__=no - tmp_compiler_works="no" - echo " " >&6 - sed 's/^/link-fail: /' conftest.err >&6 - echo " " >&6 + else + curl_cv_have_def___clang__=yes + curl_cv_def___clang__=$tmp_exp -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext fi - if test "x$cross_compiling" != "xyes" && - test "$tmp_compiler_works" = "yes"; then - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else + CPPFLAGS=$OLDCPPFLAGS + + if test "$curl_cv_have_def___clang__" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is xlclang" >&5 +printf %s "checking if compiler is xlclang... " >&6; } + + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi + + tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# ifdef __STDC__ -# include -# endif + #ifdef __ibmxl__ + CURL_DEF_TOKEN __ibmxl__ + #endif -int main (void) -{ - int i = 0; - exit(i); +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : - ; - return 0; -} + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__ibmxl__"; then + tmp_exp="" + fi -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___ibmxl__=no - tmp_compiler_works="yes" + else + curl_cv_have_def___ibmxl__=yes + curl_cv_def___ibmxl__=$tmp_exp -else + fi + CPPFLAGS=$OLDCPPFLAGS - tmp_compiler_works="no" - echo " " >&6 - echo "run-fail: test program exited with status $ac_status" >&6 - echo " " >&6 + if test "$curl_cv_have_def___ibmxl__" = "yes" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + compiler_id="XLCLANG" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + compiler_id="CLANG" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is Apple clang" >&5 +printf %s "checking if compiler is Apple clang... " >&6; } + fullclangver=`$CC -v 2>&1 | grep version` + if echo $fullclangver | grep 'Apple' >/dev/null; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + appleclang=1 + compiler_id="APPLECLANG" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + appleclang=0 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking compiler version" >&5 +printf %s "checking compiler version... " >&6; } + clangver=`echo $fullclangver | grep "based on LLVM " | "$SED" 's/.*(based on LLVM \([0-9]*\.[0-9]*\).*)/\1/'` + if test -z "$clangver"; then + clangver=`echo $fullclangver | "$SED" 's/.*version \([0-9]*\.[0-9]*\).*/\1/'` + oldapple=0 + else + oldapple=1 + fi + clangvhi=`echo $clangver | cut -d . -f1` + clangvlo=`echo $clangver | cut -d . -f2` + compiler_ver="$clangver" + compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` + if test "$appleclang" = '1' && test "$oldapple" = '0'; then + if test "$compiler_num" -ge '1300'; then compiler_num='1200' + elif test "$compiler_num" -ge '1205'; then compiler_num='1101' + elif test "$compiler_num" -ge '1204'; then compiler_num='1000' + elif test "$compiler_num" -ge '1107'; then compiler_num='900' + elif test "$compiler_num" -ge '1103'; then compiler_num='800' + elif test "$compiler_num" -ge '1003'; then compiler_num='700' + elif test "$compiler_num" -ge '1001'; then compiler_num='600' + elif test "$compiler_num" -ge '904'; then compiler_num='500' + elif test "$compiler_num" -ge '902'; then compiler_num='400' + elif test "$compiler_num" -ge '803'; then compiler_num='309' + elif test "$compiler_num" -ge '703'; then compiler_num='308' + else compiler_num='307' + fi + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: clang '$compiler_num' (raw: '$fullclangver' / '$clangver')" >&5 +printf "%s\n" "clang '$compiler_num' (raw: '$fullclangver' / '$clangver')" >&6; } + flags_dbg_yes="-g" + flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is GNU C" >&5 +printf %s "checking if compiler is GNU C... " >&6; } + + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi - if test "$tmp_compiler_works" = "yes"; then + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi + + tmp_exp="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #ifdef __GNUC__ + CURL_DEF_TOKEN __GNUC__ + #endif + + +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then + tmp_exp="" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 -$as_echo "$as_me: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&6;} +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___GNUC__=no else + curl_cv_have_def___GNUC__=yes + curl_cv_def___GNUC__=$tmp_exp - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 -$as_echo "$as_me: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&2;} - CPPFLAGS="$tmp_save_CPPFLAGS" - CFLAGS="$tmp_save_CFLAGS" + fi + CPPFLAGS=$OLDCPPFLAGS + + if test "$curl_cv_have_def___GNUC__" = "yes" && + test "$compiler_id" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + compiler_id="GNU_C" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking compiler version" >&5 +printf %s "checking compiler version... " >&6; } + # strip '-suffix' parts, e.g. Ubuntu Windows cross-gcc returns '10-win32' + gccver=`$CC -dumpversion | "$SED" 's/-.\{1,\}$//'` + gccvhi=`echo $gccver | cut -d . -f1` + if echo $gccver | grep -F '.' >/dev/null; then + gccvlo=`echo $gccver | cut -d . -f2` + else + gccvlo="0" + fi + compiler_ver="$gccver" + compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gcc '$compiler_num' (raw: '$gccver')" >&5 +printf "%s\n" "gcc '$compiler_num' (raw: '$gccver')" >&6; } + flags_dbg_yes="-g" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Os -Og -Ofast" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + case $host in + mips-sgi-irix*) + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is SGI MIPSpro C" >&5 +printf %s "checking if compiler is SGI MIPSpro C... " >&6; } + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi - fi - # + tmp_exp="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #ifdef __GNUC__ + CURL_DEF_TOKEN __GNUC__ + #endif + + +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then + tmp_exp="" + fi + +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___GNUC__=no + + else + curl_cv_have_def___GNUC__=yes + curl_cv_def___GNUC__=$tmp_exp + fi + CPPFLAGS=$OLDCPPFLAGS -if test "$compiler_id" = "INTEL_UNIX_C"; then - # - if test "$compiler_num" -ge "1000"; then - CFLAGS="$CFLAGS -shared-intel" - elif test "$compiler_num" -ge "900"; then - CFLAGS="$CFLAGS -i-dynamic" + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi - # -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler halts on compilation errors" >&5 -$as_echo_n "checking if compiler halts on compilation errors... " >&6; } + tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef _COMPILER_VERSION + CURL_DEF_TOKEN _COMPILER_VERSION + #endif -int main (void) -{ - - force compilation error - - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "compiler does not halt on compilation errors." "$LINENO" 5 + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "_COMPILER_VERSION"; then + tmp_exp="" + fi -else +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def__COMPILER_VERSION=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + else + curl_cv_have_def__COMPILER_VERSION=yes + curl_cv_def__COMPILER_VERSION=$tmp_exp -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + CPPFLAGS=$OLDCPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler halts on negative sized arrays" >&5 -$as_echo_n "checking if compiler halts on negative sized arrays... " >&6; } + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi + + tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ]; + #ifdef _SGI_COMPILER_VERSION + CURL_DEF_TOKEN _SGI_COMPILER_VERSION + #endif -int main (void) -{ - bad_t dummy; +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : - ; - return 0; -} + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "_SGI_COMPILER_VERSION"; then + tmp_exp="" + fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def__SGI_COMPILER_VERSION=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "compiler does not halt on negative sized arrays." "$LINENO" 5 + else + curl_cv_have_def__SGI_COMPILER_VERSION=yes + curl_cv_def__SGI_COMPILER_VERSION=$tmp_exp -else + fi + CPPFLAGS=$OLDCPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "$curl_cv_have_def___GNUC__" = "no" && + (test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes" || + test "$curl_cv_have_def__COMPILER_VERSION" = "yes"); then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + compiler_id="SGI_MIPSPRO_C" + flags_dbg_yes="-g" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is SGI MIPS C" >&5 +printf %s "checking if compiler is SGI MIPS C... " >&6; } + + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler halts on function prototype mismatch" >&5 -$as_echo_n "checking if compiler halts on function prototype mismatch... " >&6; } + tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# include - int rand(int n); - int rand(int n) - { - if(n) - return ++n; - else - return n; - } - -int main (void) -{ - - int i[2]={0,0}; - int j = rand(i[0]); - if(j) - return j; + #ifdef __GNUC__ + CURL_DEF_TOKEN __GNUC__ + #endif - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "compiler does not halt on function prototype mismatch." "$LINENO" 5 +if ac_fn_c_try_cpp "$LINENO" +then : -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__GNUC__"; then + tmp_exp="" + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___GNUC__=no + else + curl_cv_have_def___GNUC__=yes + curl_cv_def___GNUC__=$tmp_exp - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports hiding library internal symbols" >&5 -$as_echo_n "checking if compiler supports hiding library internal symbols... " >&6; } - supports_symbol_hiding="no" - symbol_hiding_CFLAGS="" - symbol_hiding_EXTERN="" - tmp_CFLAGS="" - tmp_EXTERN="" - case "$compiler_id" in - CLANG) - tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" - tmp_CFLAGS="-fvisibility=hidden" - supports_symbol_hiding="yes" - ;; - GNU_C) - if test "$compiler_num" -ge "304"; then - if $CC --help --verbose 2>/dev/null | grep fvisibility= >/dev/null ; then - tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" - tmp_CFLAGS="-fvisibility=hidden" - supports_symbol_hiding="yes" - fi - fi - ;; - INTEL_UNIX_C) - if test "$compiler_num" -ge "900"; then - if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then - tmp_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fvisibility=hidden" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + fi + CPPFLAGS=$OLDCPPFLAGS -# include + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi -int main (void) -{ + tmp_exp="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - printf("icc fvisibility bug test"); - ; - return 0; -} + #ifdef __sgi + CURL_DEF_TOKEN __sgi + #endif + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : - tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" - tmp_CFLAGS="-fvisibility=hidden" - supports_symbol_hiding="yes" + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__sgi"; then + tmp_exp="" + fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$tmp_save_CFLAGS" - fi - fi - ;; - SUNPRO_C) - if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then - tmp_EXTERN="__global" - tmp_CFLAGS="-xldscope=hidden" - supports_symbol_hiding="yes" - fi - ;; +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___sgi=no + + else + curl_cv_have_def___sgi=yes + curl_cv_def___sgi=$tmp_exp + + fi + CPPFLAGS=$OLDCPPFLAGS + + if test "$curl_cv_have_def___GNUC__" = "no" && + test "$curl_cv_have_def___sgi" = "yes" && + test "$compiler_id" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + compiler_id="SGI_MIPS_C" + flags_dbg_yes="-g" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + ;; esac - if test "$supports_symbol_hiding" = "yes"; then - tmp_save_CFLAGS="$CFLAGS" - CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" - squeeze CFLAGS - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is SunPro C" >&5 +printf %s "checking if compiler is SunPro C... " >&6; } - $tmp_EXTERN char *dummy(char *buff); - char *dummy(char *buff) - { - if(buff) - return ++buff; - else - return buff; - } + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 + fi + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 + fi -int main (void) -{ + tmp_exp="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - char b[16]; - char *r = dummy(&b[0]); - if(r) - return (int)*r; - ; - return 0; -} + #ifdef __SUNPRO_C + CURL_DEF_TOKEN __SUNPRO_C + #endif + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : - supports_symbol_hiding="yes" - if test -f conftest.err; then - grep 'visibility' conftest.err >/dev/null - if test "$?" -eq "0"; then - supports_symbol_hiding="no" - fi - fi + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__SUNPRO_C"; then + tmp_exp="" + fi -else +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___SUNPRO_C=no - supports_symbol_hiding="no" - echo " " >&6 - sed 's/^/cc-src: /' conftest.$ac_ext >&6 - sed 's/^/cc-err: /' conftest.err >&6 - echo " " >&6 + else + curl_cv_have_def___SUNPRO_C=yes + curl_cv_def___SUNPRO_C=$tmp_exp -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$tmp_save_CFLAGS" fi - if test "$supports_symbol_hiding" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - symbol_hiding_CFLAGS="$tmp_CFLAGS" - symbol_hiding_EXTERN="$tmp_EXTERN" + CPPFLAGS=$OLDCPPFLAGS + + if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + compiler_id="SUNPRO_C" + flags_dbg_yes="-g" + flags_opt_all="-O -xO -xO1 -xO2 -xO3 -xO4 -xO5" + flags_opt_yes="-xO2" + flags_opt_off="" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler is Tiny C" >&5 +printf %s "checking if compiler is Tiny C... " >&6; } - supports_curldebug="unknown" - if test "$want_curldebug" = "yes"; then - if test "x$enable_shared" != "xno" && - test "x$enable_shared" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown enable_shared setting." >&5 -$as_echo "$as_me: WARNING: unknown enable_shared setting." >&2;} - supports_curldebug="no" - fi - if test "x$enable_static" != "xno" && - test "x$enable_static" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown enable_static setting." >&5 -$as_echo "$as_me: WARNING: unknown enable_static setting." >&2;} - supports_curldebug="no" - fi - if test "$supports_curldebug" != "no"; then - if test "$enable_shared" = "yes" && - test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then - supports_curldebug="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: shared library does not support undefined symbols." >&5 -$as_echo "$as_me: WARNING: shared library does not support undefined symbols." >&2;} - fi - fi - fi - # - if test "$want_curldebug" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if curl debug memory tracking can be enabled" >&5 -$as_echo_n "checking if curl debug memory tracking can be enabled... " >&6; } - test "$supports_curldebug" = "no" || supports_curldebug="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports_curldebug" >&5 -$as_echo "$supports_curldebug" >&6; } - if test "$supports_curldebug" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot enable curl debug memory tracking." >&5 -$as_echo "$as_me: WARNING: cannot enable curl debug memory tracking." >&2;} - want_curldebug="no" - fi - fi - # - if test "$want_curldebug" = "yes"; then - CPPFLAGS="-DCURLDEBUG $CPPFLAGS" - squeeze CPPFLAGS + OLDCPPFLAGS=$CPPFLAGS + # CPPPFLAG comes from CURL_CPP_P + CPPFLAGS="$CPPFLAGS $CPPPFLAG" + if test -z "$SED"; then + as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 fi - if test "$want_debug" = "yes"; then - CPPFLAGS="-DDEBUGBUILD $CPPFLAGS" - squeeze CPPFLAGS + if test -z "$GREP"; then + as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 fi - if test x$want_curldebug = xyes; then - CURLDEBUG_TRUE= - CURLDEBUG_FALSE='#' -else - CURLDEBUG_TRUE='#' - CURLDEBUG_FALSE= -fi + tmp_exp="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -supports_unittests=yes -# cross-compilation of unit tests static library/programs fails when -# libcurl shared library is built. This might be due to a libtool or -# automake issue. In this case we disable unit tests. -if test "x$cross_compiling" != "xno" && - test "x$enable_shared" != "xno"; then - supports_unittests=no -fi + #ifdef __TINYC__ + CURL_DEF_TOKEN __TINYC__ + #endif -# IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to -# a problem related with OpenSSL headers and library versions not matching. -# Disable unit tests while time to further investigate this is found. -case $host in - mips-sgi-irix6.5) - if test "$compiler_id" = "GNU_C"; then - supports_unittests=no - fi - ;; -esac -# All AIX autobuilds fails unit tests linking against unittests library -# due to unittests library being built with no symbols or members. Libtool ? -# Disable unit tests while time to further investigate this is found. -case $host_os in - aix*) - supports_unittests=no - ;; -esac +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + + tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ + "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ + "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ + "$SED" 's/["][ ]*["]//g' 2>/dev/null` + if test -z "$tmp_exp" || test "$tmp_exp" = "__TINYC__"; then + tmp_exp="" + fi -if test "x$want_debug" = "xyes" && - test "x$supports_unittests" = "xyes"; then - want_unittests=yes -else - want_unittests=no -fi - if test x$want_unittests = xyes; then - BUILD_UNITTESTS_TRUE= - BUILD_UNITTESTS_FALSE='#' -else - BUILD_UNITTESTS_TRUE='#' - BUILD_UNITTESTS_FALSE= fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$tmp_exp"; then + curl_cv_have_def___TINYC__=no + + else + curl_cv_have_def___TINYC__=yes + curl_cv_def___TINYC__=$tmp_exp + fi + CPPFLAGS=$OLDCPPFLAGS + if test "$curl_cv_have_def___TINYC__" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + compiler_id="TINY_C" + flags_dbg_yes="-g" + flags_opt_all="" + flags_opt_yes="" + flags_opt_off="" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + # + if test "$compiler_id" = "unknown"; then + cat <<_EOF 1>&2 +*** +*** Warning: This configure script does not have information about the +*** compiler you are using, relative to the flags required to enable or +*** disable generation of debug info, optimization options or warnings. +*** +*** Whatever settings are present in CFLAGS will be used for this run. +*** +*** If you wish to help the curl project to better support your compiler +*** you can report this and the required info on the libcurl development +*** mailing list: https://lists.haxx.selistinfo/curl-library/ +*** +_EOF + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows.h" >&5 -$as_echo_n "checking for windows.h... " >&6; } -if ${curl_cv_header_windows_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build target is a native Windows one" >&5 +printf %s "checking whether build target is a native Windows one... " >&6; } +if test ${curl_cv_native_windows+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -int main (void) +int main(void) { -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINDOWS_H shall not be defined. -#else - int dummy=2*WINVER; -#endif + #ifdef _WIN32 + int dummy = 1; + (void)dummy; + #else + #error Not a native Windows build target. + #endif - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - curl_cv_header_windows_h="yes" + curl_cv_native_windows="yes" -else +else $as_nop - curl_cv_header_windows_h="no" + curl_cv_native_windows="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_windows_h" >&5 -$as_echo "$curl_cv_header_windows_h" >&6; } - case "$curl_cv_header_windows_h" in - yes) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_native_windows" >&5 +printf "%s\n" "$curl_cv_native_windows" >&6; } + if test "x$curl_cv_native_windows" = xyes; then + DOING_NATIVE_WINDOWS_TRUE= + DOING_NATIVE_WINDOWS_FALSE='#' +else + DOING_NATIVE_WINDOWS_TRUE='#' + DOING_NATIVE_WINDOWS_FALSE= +fi -cat >>confdefs.h <<_ACEOF -#define HAVE_WINDOWS_H 1 -_ACEOF - ;; - esac +curl_cv_wince='no' +curl_cv_winuwp='no' +if test "$curl_cv_native_windows" = "yes"; then + case $host_os in + mingw32ce*) curl_cv_wince='yes';; + esac + case "$CPPFLAGS" in + *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';; + esac +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build target is a native Windows one" >&5 -$as_echo_n "checking whether build target is a native Windows one... " >&6; } -if ${curl_cv_native_windows+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$curl_cv_header_windows_h" = "no"; then - curl_cv_native_windows="no" +squeeze() { + _sqz_result="" + eval _sqz_input=\$$1 + for _sqz_token in $_sqz_input; do + if test -z "$_sqz_result"; then + _sqz_result="$_sqz_token" else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + _sqz_result="$_sqz_result $_sqz_token" + fi + done + eval $1=\$_sqz_result + return 0 +} + + + # + if test "$compiler_id" != "unknown"; then + # + tmp_save_CPPFLAGS="$CPPFLAGS" + tmp_save_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="" + tmp_CFLAGS="" + # + case "$compiler_id" in + # + CLANG|APPLECLANG) + # + tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" + tmp_CFLAGS="$tmp_CFLAGS -Werror-implicit-function-declaration" + ;; + # + DEC_C) + # + tmp_CFLAGS="$tmp_CFLAGS -std1" + tmp_CFLAGS="$tmp_CFLAGS -noansi_alias" + tmp_CFLAGS="$tmp_CFLAGS -warnprotos" + tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs" + ;; + # + GNU_C) + # + if test "$compiler_num" -ge "295"; then + tmp_CFLAGS="$tmp_CFLAGS -Werror-implicit-function-declaration" + fi + ;; + # + HP_UX_C) + # + tmp_CFLAGS="$tmp_CFLAGS -z" + tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255" + ;; + # + IBM_C) + # + tmp_CPPFLAGS="$tmp_CPPFLAGS -qthreaded" + tmp_CPPFLAGS="$tmp_CPPFLAGS -qnoansialias" + tmp_CPPFLAGS="$tmp_CPPFLAGS -qhalt=e" + ;; + # + INTEL_UNIX_C) + # + tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" + tmp_CPPFLAGS="$tmp_CPPFLAGS -diag-error 140,147,165,266" + tmp_CPPFLAGS="$tmp_CPPFLAGS -diag-disable 279,981,1025,1469,2259" + ;; + # + INTEL_WINDOWS_C) + # + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + SGI_MIPS_C) + # + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + SGI_MIPSPRO_C) + # + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + SUNPRO_C) + # + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + TINY_C) + # + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + esac + # + squeeze tmp_CPPFLAGS + squeeze tmp_CFLAGS + # + if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts some basic options" >&5 +printf %s "checking if compiler accepts some basic options... " >&6; } + CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" + squeeze CPPFLAGS + squeeze CFLAGS + + tmp_compiler_works="unknown" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int main (void) +int main(void) { -#if defined(__MINGW32__) || defined(__MINGW32CE__) || \ - (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64))) - int dummy=1; -#else - Not a native Windows build target. -#endif + int i = 1; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - curl_cv_native_windows="yes" - -else + tmp_compiler_works="yes" - curl_cv_native_windows="no" +else $as_nop -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi + tmp_compiler_works="no" + echo " " >&6 + sed 's/^/cc-fail: /' conftest.err >&6 + echo " " >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_native_windows" >&5 -$as_echo "$curl_cv_native_windows" >&6; } - if test "x$curl_cv_native_windows" = xyes; then - DOING_NATIVE_WINDOWS_TRUE= - DOING_NATIVE_WINDOWS_FALSE='#' -else - DOING_NATIVE_WINDOWS_TRUE='#' - DOING_NATIVE_WINDOWS_FALSE= -fi - - -case X-"$curl_cv_native_windows" in - X-yes) - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock.h" >&5 -$as_echo_n "checking for winsock.h... " >&6; } -if ${curl_cv_header_winsock_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test "$tmp_compiler_works" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -int main (void) +int main(void) { -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINSOCK_H shall not be defined. -#else - int dummy=WSACleanup(); -#endif + int i = 1; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - curl_cv_header_winsock_h="yes" + tmp_compiler_works="yes" -else +else $as_nop - curl_cv_header_winsock_h="no" + tmp_compiler_works="no" + echo " " >&6 + sed 's/^/link-fail: /' conftest.err >&6 + echo " " >&6 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + if test "x$cross_compiling" != "xyes" && + test "$tmp_compiler_works" = "yes"; then -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_winsock_h" >&5 -$as_echo "$curl_cv_header_winsock_h" >&6; } - case "$curl_cv_header_winsock_h" in - yes) + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_WINSOCK_H 1 -_ACEOF - ;; - esac + #ifdef __STDC__ + # include + #endif +int main(void) +{ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock2.h" >&5 -$as_echo_n "checking for winsock2.h... " >&6; } -if ${curl_cv_header_winsock2_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + int i = 0; + return i; - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + tmp_compiler_works="yes" + +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + echo "run-fail: test program exited with status $ac_status" >&6 + echo " " >&6 + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include + #ifdef __STDC__ + # include + #endif -int main (void) +int main(void) { -#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) - HAVE_WINSOCK2_H shall not be defined. -#else - int dummy=2*IPPROTO_ESP; -#endif + int i = 0; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + tmp_compiler_works="yes" - curl_cv_header_winsock2_h="yes" +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + echo "run-fail: test program exited with status $ac_status" >&6 + echo " " >&6 -else +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - curl_cv_header_winsock2_h="no" + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test "$tmp_compiler_works" = "yes"; then -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_winsock2_h" >&5 -$as_echo "$curl_cv_header_winsock2_h" >&6; } - case "$curl_cv_header_winsock2_h" in - yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 +printf "%s\n" "$as_me: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&6;} -cat >>confdefs.h <<_ACEOF -#define HAVE_WINSOCK2_H 1 -_ACEOF + else - ;; - esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 +printf "%s\n" "$as_me: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&2;} + CPPFLAGS="$tmp_save_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS" + + fi + fi + # + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ws2tcpip.h" >&5 -$as_echo_n "checking for ws2tcpip.h... " >&6; } -if ${curl_cv_header_ws2tcpip_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + # + if test "$compiler_id" != "unknown"; then + # + tmp_save_CFLAGS="$CFLAGS" + tmp_save_CPPFLAGS="$CPPFLAGS" + # + tmp_options="" + tmp_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + # + if test "$want_debug" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts debug enabling options" >&5 +printf %s "checking if compiler accepts debug enabling options... " >&6; } + tmp_options="$flags_dbg_yes" + fi + # + if test "$flags_prefer_cppflags" = "yes"; then + CPPFLAGS="$tmp_CPPFLAGS $tmp_options" + CFLAGS="$tmp_CFLAGS" + else + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS $tmp_options" + fi + squeeze CPPFLAGS + squeeze CFLAGS + fi -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#include + # + if test "$compiler_id" != "unknown"; then + # + tmp_save_CFLAGS="$CFLAGS" + tmp_save_CPPFLAGS="$CPPFLAGS" + # + tmp_options="" + tmp_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + honor_optimize_option="yes" + # + # + if test "$want_optimize" = "assume_no" || + test "$want_optimize" = "assume_yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler optimizer assumed setting might be used" >&5 +printf %s "checking if compiler optimizer assumed setting might be used... " >&6; } -int main (void) -{ -#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) - HAVE_WS2TCPIP_H shall not be defined. -#else - int dummy=2*IP_PKTINFO; -#endif + ac_var_match_word="no" + for word1 in $tmp_CFLAGS; do + for word2 in $flags_opt_all; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ; - return 0; -} + if test "$ac_var_match_word" = "yes"; then -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + honor_optimize_option="no" - curl_cv_header_ws2tcpip_h="yes" -else + fi - curl_cv_header_ws2tcpip_h="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_ws2tcpip_h" >&5 -$as_echo "$curl_cv_header_ws2tcpip_h" >&6; } - case "$curl_cv_header_ws2tcpip_h" in - yes) + ac_var_match_word="no" + for word1 in $tmp_CPPFLAGS; do + for word2 in $flags_opt_all; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -cat >>confdefs.h <<_ACEOF -#define HAVE_WS2TCPIP_H 1 -_ACEOF + if test "$ac_var_match_word" = "yes"; then - ;; - esac + honor_optimize_option="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winldap.h" >&5 -$as_echo_n "checking for winldap.h... " >&6; } -if ${curl_cv_header_winldap_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $honor_optimize_option" >&5 +printf "%s\n" "$honor_optimize_option" >&6; } + if test "$honor_optimize_option" = "yes"; then + if test "$want_optimize" = "assume_yes"; then + want_optimize="yes" + fi + if test "$want_optimize" = "assume_no"; then + want_optimize="no" + fi + fi + fi + # + if test "$honor_optimize_option" = "yes"; then + + ac_var_stripped="" + for word1 in $tmp_CFLAGS; do + ac_var_strip_word="no" + for word2 in $flags_opt_all; do + if test "$word1" = "$word2"; then + ac_var_strip_word="yes" + fi + done + if test "$ac_var_strip_word" = "no"; then + ac_var_stripped="$ac_var_stripped $word1" + fi + done + tmp_CFLAGS="$ac_var_stripped" + squeeze tmp_CFLAGS + + + ac_var_stripped="" + for word1 in $tmp_CPPFLAGS; do + ac_var_strip_word="no" + for word2 in $flags_opt_all; do + if test "$word1" = "$word2"; then + ac_var_strip_word="yes" + fi + done + if test "$ac_var_strip_word" = "no"; then + ac_var_stripped="$ac_var_stripped $word1" + fi + done + tmp_CPPFLAGS="$ac_var_stripped" + squeeze tmp_CPPFLAGS + + if test "$want_optimize" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer enabling options" >&5 +printf %s "checking if compiler accepts optimizer enabling options... " >&6; } + tmp_options="$flags_opt_yes" + fi + if test "$want_optimize" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer disabling options" >&5 +printf %s "checking if compiler accepts optimizer disabling options... " >&6; } + tmp_options="$flags_opt_off" + fi + if test "$flags_prefer_cppflags" = "yes"; then + CPPFLAGS="$tmp_CPPFLAGS $tmp_options" + CFLAGS="$tmp_CFLAGS" + else + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS $tmp_options" + fi + squeeze CPPFLAGS + squeeze CFLAGS - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + tmp_compiler_works="unknown" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif -#include -int main (void) +int main(void) { -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINLDAP_H shall not be defined. -#else - LDAP *ldp = ldap_init("dummy", LDAP_PORT); - ULONG res = ldap_unbind(ldp); -#endif + int i = 1; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - curl_cv_header_winldap_h="yes" - -else + tmp_compiler_works="yes" - curl_cv_header_winldap_h="no" +else $as_nop -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + tmp_compiler_works="no" + echo " " >&6 + sed 's/^/cc-fail: /' conftest.err >&6 + echo " " >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_winldap_h" >&5 -$as_echo "$curl_cv_header_winldap_h" >&6; } - case "$curl_cv_header_winldap_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_WINLDAP_H 1 -_ACEOF - - ;; - esac - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winber.h" >&5 -$as_echo_n "checking for winber.h... " >&6; } -if ${curl_cv_header_winber_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test "$tmp_compiler_works" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#endif -#include -#include -int main (void) +int main(void) { -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINBER_H shall not be defined. -#else - BERVAL *bvp = NULL; - BerElement *bep = ber_init(bvp); - ber_free(bep, 1); -#endif + int i = 1; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - curl_cv_header_winber_h="yes" - -else + tmp_compiler_works="yes" - curl_cv_header_winber_h="no" +else $as_nop -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + tmp_compiler_works="no" + echo " " >&6 + sed 's/^/link-fail: /' conftest.err >&6 + echo " " >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_winber_h" >&5 -$as_echo "$curl_cv_header_winber_h" >&6; } - case "$curl_cv_header_winber_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_WINBER_H 1 -_ACEOF - - ;; - esac - - ;; - *) - curl_cv_header_winsock_h="no" - curl_cv_header_winsock2_h="no" - curl_cv_header_ws2tcpip_h="no" - curl_cv_header_winldap_h="no" - curl_cv_header_winber_h="no" - ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + if test "x$cross_compiling" != "xyes" && + test "$tmp_compiler_works" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build target supports WIN32 file API" >&5 -$as_echo_n "checking whether build target supports WIN32 file API... " >&6; } - curl_win32_file_api="no" - if test "$curl_cv_header_windows_h" = "yes"; then - if test x"$enable_largefile" != "xno"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef __STDC__ + # include + #endif -int main (void) +int main(void) { -#if !defined(_WIN32_WCE) && \ - (defined(__MINGW32__) || \ - (defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64)))) - int dummy=1; -#else - WIN32 large file API not supported. -#endif + int i = 0; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + tmp_compiler_works="yes" - curl_win32_file_api="win32_large_files" +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + echo "run-fail: test program exited with status $ac_status" >&6 + echo " " >&6 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "$curl_win32_file_api" = "no"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifdef __STDC__ + # include + #endif -int main (void) +int main(void) { -#if defined(_WIN32_WCE) || defined(__MINGW32__) || defined(_MSC_VER) - int dummy=1; -#else - WIN32 small file API not supported. -#endif + int i = 0; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + tmp_compiler_works="yes" - curl_win32_file_api="win32_small_files" +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + echo "run-fail: test program exited with status $ac_status" >&6 + echo " " >&6 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LD_LIBRARY_PATH=$old # restore + CC=$oldcc fi - case "$curl_win32_file_api" in - win32_large_files) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (large file enabled)" >&5 -$as_echo "yes (large file enabled)" >&6; } -cat >>confdefs.h <<_ACEOF -#define USE_WIN32_LARGE_FILES 1 -_ACEOF + fi + if test "$tmp_compiler_works" = "yes"; then - ;; - win32_small_files) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (large file disabled)" >&5 -$as_echo "yes (large file disabled)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_options" >&5 +printf "%s\n" "$as_me: compiler options added: $tmp_options" >&6;} -cat >>confdefs.h <<_ACEOF -#define USE_WIN32_SMALL_FILES 1 -_ACEOF + else - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_options" >&5 +printf "%s\n" "$as_me: WARNING: compiler options rejected: $tmp_options" >&2;} + CPPFLAGS="$tmp_save_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS" + fi + fi + # + fi - tst_cflags="no" - case $host_os in - darwin*) - tst_cflags="yes" - ;; - esac + # + if test "$compiler_id" != "unknown"; then + # + tmp_save_CPPFLAGS="$CPPFLAGS" + tmp_save_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="" + tmp_CFLAGS="" + # + case "$compiler_id" in + # + CLANG|APPLECLANG) + # + if test "$want_warnings" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS -pedantic" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good-to-use Mac CFLAGS" >&5 -$as_echo_n "checking for good-to-use Mac CFLAGS... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_cflags" >&5 -$as_echo "$tst_cflags" >&6; }; + ac_var_added_warnings="" + for warning in all extra; do - if test "$tst_cflags" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for *version-min in CFLAGS" >&5 -$as_echo_n "checking for *version-min in CFLAGS... " >&6; } - min="" - if test -z "$(echo $CFLAGS | grep m.*os.*-version-min)"; then - min="-mmacosx-version-min=10.8" - CFLAGS="$CFLAGS $min" - fi - if test -z "$min"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: set by user" >&5 -$as_echo "set by user" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $min set" >&5 -$as_echo "$min set" >&6; } - fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - old_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Werror=partial-availability" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Werror=partial-availability" >&5 -$as_echo_n "checking whether $CC accepts -Werror=partial-availability... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -int main (void) -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS=$old_CFLAGS -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi + ac_var_added_warnings="" + for warning in pointer-arith write-strings; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if the compiler supports __builtin_available()" >&5 -$as_echo_n "checking to see if the compiler supports __builtin_available()... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in shadow; do -#include + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -int main (void) -{ + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - if (__builtin_available(macOS 10.8, iOS 5.0, *)) {} - ; - return 0; -} + ac_var_added_warnings="" + for warning in nested-externs; do -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -cat >>confdefs.h <<_ACEOF -#define HAVE_BUILTIN_AVAILABLE 1 -_ACEOF + ac_var_added_warnings="" + for warning in missing-declarations; do -else + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_var_added_warnings="" + for warning in missing-prototypes; do -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support http" >&5 -$as_echo_n "checking whether to support http... " >&6; } -# Check whether --enable-http was given. -if test "${enable_http+set}" = set; then : - enableval=$enable_http; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -$as_echo "#define CURL_DISABLE_HTTP 1" >>confdefs.h + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - disable_http="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disable HTTP disables FTP over proxy and RTSP" >&5 -$as_echo "$as_me: WARNING: disable HTTP disables FTP over proxy and RTSP" >&2;} - CURL_DISABLE_HTTP=1 + tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" + ac_var_added_warnings="" + for warning in float-equal; do -$as_echo "#define CURL_DISABLE_RTSP 1" >>confdefs.h + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - CURL_DISABLE_RTSP=1 + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi + ac_var_added_warnings="" + for warning in sign-compare; do -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support ftp" >&5 -$as_echo_n "checking whether to support ftp... " >&6; } -# Check whether --enable-ftp was given. -if test "${enable_ftp+set}" = set; then : - enableval=$enable_ftp; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -$as_echo "#define CURL_DISABLE_FTP 1" >>confdefs.h + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - CURL_DISABLE_FTP=1 + tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar" - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_var_added_warnings="" + for warning in undef; do -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support file" >&5 -$as_echo_n "checking whether to support file... " >&6; } -# Check whether --enable-file was given. -if test "${enable_file+set}" = set; then : - enableval=$enable_file; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -$as_echo "#define CURL_DISABLE_FILE 1" >>confdefs.h + tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" - CURL_DISABLE_FILE=1 + ac_var_added_warnings="" + for warning in endif-labels strict-prototypes; do - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support ldap" >&5 -$as_echo_n "checking whether to support ldap... " >&6; } -# Check whether --enable-ldap was given. -if test "${enable_ldap+set}" = set; then : - enableval=$enable_ldap; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h + ac_var_added_warnings="" + for warning in declaration-after-statement; do - CURL_DISABLE_LDAP=1 + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi + ac_var_added_warnings="" + for warning in cast-align; do -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support ldaps" >&5 -$as_echo_n "checking whether to support ldaps... " >&6; } -# Check whether --enable-ldaps was given. -if test "${enable_ldaps+set}" = set; then : - enableval=$enable_ldaps; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -$as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - CURL_DISABLE_LDAPS=1 + tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" - ;; - *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: LDAP needs to be enabled to support LDAPS" >&5 -$as_echo "LDAP needs to be enabled to support LDAPS" >&6; } + ac_var_added_warnings="" + for warning in shorten-64-to-32; do -$as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - CURL_DISABLE_LDAPS=1 + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + # + if test "$compiler_num" -ge "101"; then -$as_echo "#define HAVE_LDAP_SSL 1" >>confdefs.h + ac_var_added_warnings="" + for warning in unused; do - HAVE_LDAP_SSL=1 + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - fi - ;; - esac -else + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - if test "x$CURL_DISABLE_LDAP" = "x1" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + fi + # + if test "$compiler_num" -ge "207"; then -$as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h + ac_var_added_warnings="" + for warning in address; do - CURL_DISABLE_LDAPS=1 + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -$as_echo "#define HAVE_LDAP_SSL 1" >>confdefs.h - HAVE_LDAP_SSL=1 + ac_var_added_warnings="" + for warning in attributes; do - fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support rtsp" >&5 -$as_echo_n "checking whether to support rtsp... " >&6; } -# Check whether --enable-rtsp was given. -if test "${enable_rtsp+set}" = set; then : - enableval=$enable_rtsp; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_added_warnings="" + for warning in bad-function-cast; do -$as_echo "#define CURL_DISABLE_RTSP 1" >>confdefs.h + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - CURL_DISABLE_RTSP=1 + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ;; - *) if test x$CURL_DISABLE_HTTP = x1 ; then - as_fn_error $? "HTTP support needs to be enabled in order to enable RTSP support!" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_rtsp_msg="enabled" - fi - ;; - esac -else - if test "x$CURL_DISABLE_HTTP" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_rtsp_msg="enabled" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi -fi + ac_var_added_warnings="" + for warning in conversion; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support proxies" >&5 -$as_echo_n "checking whether to support proxies... " >&6; } -# Check whether --enable-proxy was given. -if test "${enable_proxy+set}" = set; then : - enableval=$enable_proxy; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -$as_echo "#define CURL_DISABLE_PROXY 1" >>confdefs.h - CURL_DISABLE_PROXY=1 + ac_var_added_warnings="" + for warning in div-by-zero format-security; do - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support dict" >&5 -$as_echo_n "checking whether to support dict... " >&6; } -# Check whether --enable-dict was given. -if test "${enable_dict+set}" = set; then : - enableval=$enable_dict; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_added_warnings="" + for warning in empty-body; do -$as_echo "#define CURL_DISABLE_DICT 1" >>confdefs.h + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - CURL_DISABLE_DICT=1 + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi + ac_var_added_warnings="" + for warning in missing-field-initializers; do -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support telnet" >&5 -$as_echo_n "checking whether to support telnet... " >&6; } -# Check whether --enable-telnet was given. -if test "${enable_telnet+set}" = set; then : - enableval=$enable_telnet; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -$as_echo "#define CURL_DISABLE_TELNET 1" >>confdefs.h + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - CURL_DISABLE_TELNET=1 - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_var_added_warnings="" + for warning in missing-noreturn; do -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support tftp" >&5 -$as_echo_n "checking whether to support tftp... " >&6; } -# Check whether --enable-tftp was given. -if test "${enable_tftp+set}" = set; then : - enableval=$enable_tftp; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -$as_echo "#define CURL_DISABLE_TFTP 1" >>confdefs.h - CURL_DISABLE_TFTP=1 + ac_var_added_warnings="" + for warning in old-style-definition; do - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support pop3" >&5 -$as_echo_n "checking whether to support pop3... " >&6; } -# Check whether --enable-pop3 was given. -if test "${enable_pop3+set}" = set; then : - enableval=$enable_pop3; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_added_warnings="" + for warning in redundant-decls; do -$as_echo "#define CURL_DISABLE_POP3 1" >>confdefs.h + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - CURL_DISABLE_POP3=1 + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [switch-enum]) # Not used because this basically disallows default case -fi + ac_var_added_warnings="" + for warning in type-limits; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support imap" >&5 -$as_echo_n "checking whether to support imap... " >&6; } -# Check whether --enable-imap was given. -if test "${enable_imap+set}" = set; then : - enableval=$enable_imap; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unused-macros]) # Not practical + # tmp_CFLAGS="$tmp_CFLAGS -Wno-error=unused-macros" -$as_echo "#define CURL_DISABLE_IMAP 1" >>confdefs.h + ac_var_added_warnings="" + for warning in unreachable-code unused-parameter; do - CURL_DISABLE_IMAP=1 + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi + fi + # + if test "$compiler_num" -ge "208"; then + ac_var_added_warnings="" + for warning in ignored-qualifiers; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support smb" >&5 -$as_echo_n "checking whether to support smb... " >&6; } -# Check whether --enable-smb was given. -if test "${enable_smb+set}" = set; then : - enableval=$enable_smb; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -$as_echo "#define CURL_DISABLE_SMB 1" >>confdefs.h - CURL_DISABLE_SMB=1 + ac_var_added_warnings="" + for warning in vla; do - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + fi + # + if test "$compiler_num" -ge "209"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-sign-conversion" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support smtp" >&5 -$as_echo_n "checking whether to support smtp... " >&6; } -# Check whether --enable-smtp was given. -if test "${enable_smtp+set}" = set; then : - enableval=$enable_smtp; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_added_warnings="" + for warning in shift-sign-overflow; do -$as_echo "#define CURL_DISABLE_SMTP 1" >>confdefs.h + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - CURL_DISABLE_SMTP=1 + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [padded]) # Not used because we cannot change public structs + fi + # + if test "$compiler_num" -ge "300"; then -fi + ac_var_added_warnings="" + for warning in cast-qual; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support gopher" >&5 -$as_echo_n "checking whether to support gopher... " >&6; } -# Check whether --enable-gopher was given. -if test "${enable_gopher+set}" = set; then : - enableval=$enable_gopher; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -$as_echo "#define CURL_DISABLE_GOPHER 1" >>confdefs.h - CURL_DISABLE_GOPHER=1 + ac_var_added_warnings="" + for warning in language-extension-token; do - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + tmp_CFLAGS="$tmp_CFLAGS -Wformat=2" + fi + # + if test "$compiler_num" -ge "302"; then + ac_var_added_warnings="" + for warning in enum-conversion; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to provide built-in manual" >&5 -$as_echo_n "checking whether to provide built-in manual... " >&6; } -# Check whether --enable-manual was given. -if test "${enable_manual+set}" = set; then : - enableval=$enable_manual; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - USE_MANUAL="1" - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - USE_MANUAL="1" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi + ac_var_added_warnings="" + for warning in sometimes-uninitialized; do -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable generation of C code" >&5 -$as_echo_n "checking whether to enable generation of C code... " >&6; } -# Check whether --enable-libcurl_option was given. -if test "${enable_libcurl_option+set}" = set; then : - enableval=$enable_libcurl_option; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -$as_echo "#define CURL_DISABLE_LIBCURL_OPTION 1" >>confdefs.h + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - curl_libcurl_msg="no" - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + case $host_os in + cygwin* | mingw*) + ;; + *) -fi + ac_var_added_warnings="" + for warning in missing-variable-declarations; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libgcc" >&5 -$as_echo_n "checking whether to use libgcc... " >&6; } -# Check whether --enable-libgcc was given. -if test "${enable_libgcc+set}" = set; then : - enableval=$enable_libgcc; case "$enableval" in - yes) - LIBS="-lgcc $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ;; + esac + fi + # + if test "$compiler_num" -ge "304"; then -fi + ac_var_added_warnings="" + for warning in header-guard; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if X/Open network library is required" >&5 -$as_echo_n "checking if X/Open network library is required... " >&6; } - tst_lib_xnet_required="no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in unused-const-variable; do -int main (void) -{ -#if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) - return 0; -#elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) - return 0; -#else - force compilation error -#endif -} + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + fi + # + if test "$compiler_num" -ge "305"; then - tst_lib_xnet_required="yes" - LIBS="-lxnet $LIBS" + ac_var_added_warnings="" + for warning in pragmas; do -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_lib_xnet_required" >&5 -$as_echo "$tst_lib_xnet_required" >&6; } + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes; then : - HAVE_GETHOSTBYNAME="1" + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unreachable-code-break]) # Not used: Silent in "unity" builds + fi + # + if test "$compiler_num" -ge "306"; then -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in double-promotion; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nsl_gethostbyname=yes -else - ac_cv_lib_nsl_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : - HAVE_GETHOSTBYNAME="1" - LIBS="-lnsl $LIBS" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi + fi + # + if test "$compiler_num" -ge "309"; then + ac_var_added_warnings="" + for warning in comma; do -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -if test "$HAVE_GETHOSTBYNAME" != "1" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 -$as_echo_n "checking for gethostbyname in -lsocket... " >&6; } -if ${ac_cv_lib_socket_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + # avoid the varargs warning, fixed in 4.0 + # https://bugs.llvm.org/show_bug.cgi?id=29140 + if test "$compiler_num" -lt "400"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-varargs" + fi + fi + if test "$compiler_num" -ge "700"; then + ac_var_added_warnings="" + for warning in assign-enum; do -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_socket_gethostbyname=yes -else - ac_cv_lib_socket_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 -$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; } -if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then : - HAVE_GETHOSTBYNAME="1" - LIBS="-lsocket $LIBS" + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lwatt" >&5 -$as_echo_n "checking for gethostbyname in -lwatt... " >&6; } -if ${ac_cv_lib_watt_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lwatt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in extra-semi-stmt; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_watt_gethostbyname=yes -else - ac_cv_lib_watt_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_watt_gethostbyname" >&5 -$as_echo "$ac_cv_lib_watt_gethostbyname" >&6; } -if test "x$ac_cv_lib_watt_gethostbyname" = xyes; then : - HAVE_GETHOSTBYNAME="1" - CPPFLAGS="-I/dev/env/WATT_ROOT/inc" - LDFLAGS="-L/dev/env/WATT_ROOT/lib" - LIBS="-lwatt $LIBS" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi + fi + if test "$compiler_num" -ge "1000"; then + tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough" # we have silencing markup for clang 10.0 and above only -fi + ac_var_added_warnings="" + for warning in xor-used-as-pow; do -if test "$HAVE_GETHOSTBYNAME" != "1" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname with both nsl and socket libs" >&5 -$as_echo_n "checking for gethostbyname with both nsl and socket libs... " >&6; } - my_ac_save_LIBS=$LIBS - LIBS="-lnsl -lsocket $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + fi + fi + ;; + # + DEC_C) + # + if test "$want_warnings" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS -msg_enable level3" + fi + ;; + # + GNU_C) + # + if test "$want_warnings" = "yes"; then + # + if test "x$cross_compiling" != "xyes" || + test "$compiler_num" -ge "300"; then + tmp_CFLAGS="$tmp_CFLAGS -pedantic" + fi + # -int main (void) -{ + ac_var_added_warnings="" + for warning in all; do - gethostbyname(); + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ; - return 0; -} + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + tmp_CFLAGS="$tmp_CFLAGS -W" + # + if test "$compiler_num" -ge "104"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_GETHOSTBYNAME="1" + ac_var_added_warnings="" + for warning in pointer-arith write-strings; do -else + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBS=$my_ac_save_LIBS + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi + if test "x$cross_compiling" != "xyes" || + test "$compiler_num" -ge "300"; then -if test "$HAVE_GETHOSTBYNAME" != "1" -then - if test "$curl_cv_header_windows_h" = "yes"; then - if test "$curl_cv_header_winsock_h" = "yes"; then - case $host in - *-*-mingw32ce*) - winsock_LIB="-lwinsock" - ;; - *) - winsock_LIB="-lwsock32" - ;; - esac - fi - if test "$curl_cv_header_winsock2_h" = "yes"; then - winsock_LIB="-lws2_32" - fi - if test ! -z "$winsock_LIB"; then - my_ac_save_LIBS=$LIBS - LIBS="$winsock_LIB $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in $winsock_LIB" >&5 -$as_echo_n "checking for gethostbyname in $winsock_LIB... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in unused shadow; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -int main (void) -{ + fi + fi + # + if test "$compiler_num" -ge "207"; then - gethostbyname("www.dummysite.com"); + ac_var_added_warnings="" + for warning in nested-externs; do - ; - return 0; -} + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_GETHOSTBYNAME="1" + if test "x$cross_compiling" != "xyes" || + test "$compiler_num" -ge "300"; then -else + ac_var_added_warnings="" + for warning in missing-declarations; do - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - winsock_LIB="" - LIBS=$my_ac_save_LIBS + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" fi - fi -fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -if test "$HAVE_GETHOSTBYNAME" != "1" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname for Minix 3" >&5 -$as_echo_n "checking for gethostbyname for Minix 3... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in missing-prototypes; do -/* Older Minix versions may need here instead */ -#include + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -int main (void) -{ + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - gethostbyname("www.dummysite.com"); + fi + fi + # + if test "$compiler_num" -ge "295"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" - ; - return 0; -} + ac_var_added_warnings="" + for warning in bad-function-cast; do -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_GETHOSTBYNAME="1" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -else + fi + # + if test "$compiler_num" -ge "296"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_var_added_warnings="" + for warning in float-equal; do -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -if test "$HAVE_GETHOSTBYNAME" != "1" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname for eCos" >&5 -$as_echo_n "checking for gethostbyname for eCos... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar" -#include -#include + ac_var_added_warnings="" + for warning in sign-compare; do -int main (void) -{ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - gethostbyname("www.dummysite.com"); + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + ac_var_added_warnings="" + for warning in undef; do - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVE_GETHOSTBYNAME="1" + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -else + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + fi + # + if test "$compiler_num" -ge "297"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" + fi + # + if test "$compiler_num" -ge "300"; then + tmp_CFLAGS="$tmp_CFLAGS" + fi + # + if test "$compiler_num" -ge "303"; then -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi + ac_var_added_warnings="" + for warning in endif-labels strict-prototypes; do -if test "$HAVE_GETHOSTBYNAME" != "1" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnetwork" >&5 -$as_echo_n "checking for gethostbyname in -lnetwork... " >&6; } -if ${ac_cv_lib_network_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnetwork $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_network_gethostbyname=yes -else - ac_cv_lib_network_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_gethostbyname" >&5 -$as_echo "$ac_cv_lib_network_gethostbyname" >&6; } -if test "x$ac_cv_lib_network_gethostbyname" = xyes; then : - HAVE_GETHOSTBYNAME="1" - LIBS="-lnetwork $LIBS" + fi + # + if test "$compiler_num" -ge "304"; then -fi + ac_var_added_warnings="" + for warning in declaration-after-statement; do -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -if test "$HAVE_GETHOSTBYNAME" != "1" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnet" >&5 -$as_echo_n "checking for gethostbyname in -lnet... " >&6; } -if ${ac_cv_lib_net_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnet $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int main (void) -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_net_gethostbyname=yes -else - ac_cv_lib_net_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_gethostbyname" >&5 -$as_echo "$ac_cv_lib_net_gethostbyname" >&6; } -if test "x$ac_cv_lib_net_gethostbyname" = xyes; then : - HAVE_GETHOSTBYNAME="1" - LIBS="-lnet $LIBS" + ac_var_added_warnings="" + for warning in old-style-definition; do -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + fi + # + if test "$compiler_num" -ge "400"; then -if test "$HAVE_GETHOSTBYNAME" != "1"; then - as_fn_error $? "couldn't find libraries for gethostbyname()" "$LINENO" 5 -fi + ac_var_added_warnings="" + for warning in cast-qual; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -curl_includes_winsock2="\ -/* includes start */ -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# else -# ifdef HAVE_WINSOCK_H -# include -# endif -# endif -#endif -/* includes end */" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows.h" >&5 -$as_echo_n "checking for windows.h... " >&6; } -if ${curl_cv_header_windows_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" + fi + # + if test "$compiler_num" -ge "401"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in attributes; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -int main (void) -{ -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINDOWS_H shall not be defined. -#else - int dummy=2*WINVER; -#endif + ac_var_added_warnings="" + for warning in div-by-zero format-security; do - ; - return 0; -} + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - curl_cv_header_windows_h="yes" -else + ac_var_added_warnings="" + for warning in missing-field-initializers; do - curl_cv_header_windows_h="no" + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_windows_h" >&5 -$as_echo "$curl_cv_header_windows_h" >&6; } - case "$curl_cv_header_windows_h" in - yes) + case $host in + *-*-msys*) + ;; + *) -cat >>confdefs.h <<_ACEOF -#define HAVE_WINDOWS_H 1 -_ACEOF + ac_var_added_warnings="" + for warning in missing-noreturn; do - ;; - esac + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + # Seen to clash with libtool-generated stub code + ;; + esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock.h" >&5 -$as_echo_n "checking for winsock.h... " >&6; } -if ${curl_cv_header_winsock_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + ac_var_added_warnings="" + for warning in unreachable-code unused-parameter; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [padded]) # Not used because we cannot change public structs -int main (void) -{ + ac_var_added_warnings="" + for warning in pragmas; do -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINSOCK_H shall not be defined. -#else - int dummy=WSACleanup(); -#endif + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ; - return 0; -} + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - curl_cv_header_winsock_h="yes" + ac_var_added_warnings="" + for warning in redundant-decls; do -else + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - curl_cv_header_winsock_h="no" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [switch-enum]) # Not used because this basically disallows default case + # CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unused-macros]) # Not practical + # tmp_CFLAGS="$tmp_CFLAGS -Wno-error=unused-macros" + fi + # + if test "$compiler_num" -ge "402"; then -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_winsock_h" >&5 -$as_echo "$curl_cv_header_winsock_h" >&6; } - case "$curl_cv_header_winsock_h" in - yes) + ac_var_added_warnings="" + for warning in cast-align; do -cat >>confdefs.h <<_ACEOF -#define HAVE_WINSOCK_H 1 -_ACEOF + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ;; - esac + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + fi + # + if test "$compiler_num" -ge "403"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock2.h" >&5 -$as_echo_n "checking for winsock2.h... " >&6; } -if ${curl_cv_header_winsock2_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + ac_var_added_warnings="" + for warning in address; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -int main (void) -{ + ac_var_added_warnings="" + for warning in type-limits old-style-declaration; do -#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) - HAVE_WINSOCK2_H shall not be defined. -#else - int dummy=2*IPPROTO_ESP; -#endif + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ; - return 0; -} + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - curl_cv_header_winsock2_h="yes" + ac_var_added_warnings="" + for warning in missing-parameter-type empty-body; do -else + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - curl_cv_header_winsock2_h="no" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_winsock2_h" >&5 -$as_echo "$curl_cv_header_winsock2_h" >&6; } - case "$curl_cv_header_winsock2_h" in - yes) + ac_var_added_warnings="" + for warning in clobbered ignored-qualifiers; do -cat >>confdefs.h <<_ACEOF -#define HAVE_WINSOCK2_H 1 -_ACEOF + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ;; - esac + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + ac_var_added_warnings="" + for warning in conversion; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in libraries" >&5 -$as_echo_n "checking for connect in libraries... " >&6; } - tst_connect_save_LIBS="$LIBS" - tst_connect_need_LIBS="unknown" - for tst_lib in '' '-lsocket' ; do - if test "$tst_connect_need_LIBS" = "unknown"; then - LIBS="$tst_lib $tst_connect_save_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + tmp_CFLAGS="$tmp_CFLAGS -Wno-sign-conversion" - $curl_includes_winsock2 - #ifndef HAVE_WINDOWS_H - int connect(int, void*, int); - #endif + ac_var_added_warnings="" + for warning in vla; do -int main (void) -{ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - if(0 != connect(0, 0, 0)) - return 1; + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ; - return 0; -} + tmp_CFLAGS="$tmp_CFLAGS -ftree-vrp" + fi + # + if test "$compiler_num" -ge "405"; then -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + ac_var_added_warnings="" + for warning in jump-misses-init; do - tst_connect_need_LIBS="$tst_lib" + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" fi done - LIBS="$tst_connect_save_LIBS" - # - case X-"$tst_connect_need_LIBS" in - X-unknown) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find connect" >&5 -$as_echo "cannot find connect" >&6; } - as_fn_error $? "cannot find connect function in libraries." "$LINENO" 5 - ;; - X-) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_connect_need_LIBS" >&5 -$as_echo "$tst_connect_need_LIBS" >&6; } - LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS" - ;; - esac + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + if test "$curl_cv_native_windows" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format" + fi + case $host_os in + cygwin*) + tmp_CFLAGS="$tmp_CFLAGS -Wno-suggest-attribute=noreturn" + ;; + esac + fi + # + if test "$compiler_num" -ge "406"; then -CURL_NETWORK_LIBS=$LIBS + ac_var_added_warnings="" + for warning in double-promotion; do -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -int main (void) -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h -fi + ac_var_added_warnings="" + for warning in trampolines; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - for ac_header in sys/types.h sys/time.h time.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi + fi + # + if test "$compiler_num" -ge "408"; then + tmp_CFLAGS="$tmp_CFLAGS -Wformat=2" + fi + # + if test "$compiler_num" -ge "500"; then + tmp_CFLAGS="$tmp_CFLAGS -Warray-bounds=2" + fi + # + if test "$compiler_num" -ge "600"; then -done + ac_var_added_warnings="" + for warning in shift-negative-value; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for monotonic clock_gettime" >&5 -$as_echo_n "checking for monotonic clock_gettime... " >&6; } - # - if test "x$dontwant_rt" = "xno" ; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif + tmp_CFLAGS="$tmp_CFLAGS -Wshift-overflow=2" -int main (void) -{ + ac_var_added_warnings="" + for warning in null-dereference; do - struct timespec ts; - (void)clock_gettime(CLOCK_MONOTONIC, &ts); + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ; - return 0; -} + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + tmp_CFLAGS="$tmp_CFLAGS -fdelete-null-pointer-checks" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_func_clock_gettime="yes" + ac_var_added_warnings="" + for warning in duplicated-cond; do -else + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_func_clock_gettime="no" + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi + ac_var_added_warnings="" + for warning in unused-const-variable; do - # - if test "$curl_func_clock_gettime" = "yes"; then - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in libraries" >&5 -$as_echo_n "checking for clock_gettime in libraries... " >&6; } - # - curl_cv_save_LIBS="$LIBS" - curl_cv_gclk_LIBS="unknown" - # - for x_xlibs in '' '-lrt' '-lposix4' ; do - if test "$curl_cv_gclk_LIBS" = "unknown"; then - if test -z "$x_xlibs"; then - LIBS="$curl_cv_save_LIBS" - else - LIBS="$x_xlibs $curl_cv_save_LIBS" - fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif + fi + # + if test "$compiler_num" -ge "700"; then -int main (void) -{ + ac_var_added_warnings="" + for warning in duplicated-branches; do - struct timespec ts; - (void)clock_gettime(CLOCK_MONOTONIC, &ts); + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - ; - return 0; -} + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - curl_cv_gclk_LIBS="$x_xlibs" + ac_var_added_warnings="" + for warning in restrict; do -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" fi done - # - LIBS="$curl_cv_save_LIBS" - # - case X-"$curl_cv_gclk_LIBS" in - X-unknown) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find clock_gettime" >&5 -$as_echo "cannot find clock_gettime" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 -$as_echo "$as_me: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} - curl_func_clock_gettime="no" - ;; - X-) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no additional lib required" >&5 -$as_echo "no additional lib required" >&6; } - curl_func_clock_gettime="yes" - ;; - *) - if test -z "$curl_cv_save_LIBS"; then - LIBS="$curl_cv_gclk_LIBS" - else - LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_gclk_LIBS" >&5 -$as_echo "$curl_cv_gclk_LIBS" >&6; } - curl_func_clock_gettime="yes" - ;; - esac - # - if test "x$cross_compiling" != "xyes" && - test "$curl_func_clock_gettime" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if monotonic clock_gettime works" >&5 -$as_echo_n "checking if monotonic clock_gettime works... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif + done -int main (void) -{ + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - struct timespec ts; - if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) - exit(0); - else - exit(1); - ; - return 0; -} + ac_var_added_warnings="" + for warning in alloc-zero; do -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -else + tmp_CFLAGS="$tmp_CFLAGS -Wformat-truncation=2" + tmp_CFLAGS="$tmp_CFLAGS -Wimplicit-fallthrough" + fi + # + if test "$compiler_num" -ge "1000"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 -$as_echo "$as_me: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} - curl_func_clock_gettime="no" - LIBS="$curl_cv_save_LIBS" + ac_var_added_warnings="" + for warning in arith-conversion; do -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" fi - # - case "$curl_func_clock_gettime" in - yes) + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -cat >>confdefs.h <<_ACEOF -#define HAVE_CLOCK_GETTIME_MONOTONIC 1 -_ACEOF - ;; - esac - # - fi - # + ac_var_added_warnings="" + for warning in enum-conversion; do + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -CURL_NETWORK_AND_TIME_LIBS=$LIBS + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + fi + # + if test "$compiler_num" -ge "1200"; then + ac_var_added_warnings="" + for warning in array-compare; do -clean_CPPFLAGS=$CPPFLAGS -clean_LDFLAGS=$LDFLAGS -clean_LIBS=$LIBS -ZLIB_LIBS="" + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; OPT_ZLIB="$withval" -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + fi + # + if test "$compiler_num" -ge "1300"; then -if test "$OPT_ZLIB" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5 -$as_echo "$as_me: WARNING: zlib disabled" >&2;} -else - if test "$OPT_ZLIB" = "yes" ; then - OPT_ZLIB="" - fi + ac_var_added_warnings="" + for warning in enum-int-mismatch; do - if test -z "$OPT_ZLIB" ; then + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi done -IFS=$as_save_IFS + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - ;; -esac -fi -PKGCONFIG=$ac_cv_path_PKGCONFIG -if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ac_var_added_warnings="" + for warning in xor-used-as-pow; do -fi -if test -z "$ac_cv_path_PKGCONFIG"; then - ac_pt_PKGCONFIG=$PKGCONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG -if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKGCONFIG" = x; then - PKGCONFIG="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKGCONFIG=$ac_pt_PKGCONFIG - fi -else - PKGCONFIG="$ac_cv_path_PKGCONFIG" -fi + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib options with pkg-config" >&5 -$as_echo_n "checking for zlib options with pkg-config... " >&6; } - itexists=` - if test -n ""; then - PKG_CONFIG_LIBDIR="" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists zlib >/dev/null 2>&1 && echo 1` + fi + # + if test "$compiler_num" -ge "1500"; then - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + ac_var_added_warnings="" + for warning in leading-whitespace=spaces; do + + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" fi + done + done + + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - if test "$PKGCONFIG" != "no" ; then - LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS" - LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`" - CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`" - OPT_ZLIB="" - HAVE_LIBZ="1" - fi + ac_var_added_warnings="" + for warning in trailing-whitespace=any; do - if test -z "$HAVE_LIBZ"; then + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 -$as_echo_n "checking for inflateEnd in -lz... " >&6; } -if ${ac_cv_lib_z_inflateEnd+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_added_warnings="" + for warning in unterminated-string-initialization; do -#ifdef __cplusplus -extern "C" -#endif -char inflateEnd (); -int main (void) -{ -return inflateEnd (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflateEnd=yes -else - ac_cv_lib_z_inflateEnd=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 -$as_echo "$ac_cv_lib_z_inflateEnd" >&6; } -if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : - HAVE_LIBZ="1" - LIBS="-lz $LIBS" -else - OPT_ZLIB="/usr/local" -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" fi - fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS - if test -n "$OPT_ZLIB"; then - CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" - LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" - fi + fi + # + fi + # + if test "$compiler_num" -ge "300"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" + else + if test "x$cross_compiling" = "xyes"; then + if test "$compiler_num" -ge "104"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" + fi + if test "$compiler_num" -ge "207"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-declarations" + tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" + fi + fi + fi + if test "$compiler_num" -lt "405"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-shadow" + tmp_CFLAGS="$tmp_CFLAGS -Wno-unreachable-code" + fi + if test "$compiler_num" -ge "402" -a "$compiler_num" -lt "406"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-overlength-strings" + fi + if test "$compiler_num" -ge "400" -a "$compiler_num" -lt "407"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-field-initializers" + fi + if test "$compiler_num" -ge "403" -a "$compiler_num" -lt "408"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-type-limits" + fi + if test "$compiler_num" -ge "501" -a "$compiler_num" -lt "505"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-conversion" + fi + ;; + # + HP_UX_C) + # + if test "$want_warnings" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS +w1" + fi + ;; + # + IBM_C) + # + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + INTEL_UNIX_C) + # + if test "$want_warnings" = "yes"; then + if test "$compiler_num" -gt "600"; then + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcomment" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wdeprecated" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wmissing-prototypes" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wp64" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wpointer-arith" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wreturn-type" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wshadow" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wuninitialized" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wunused-function" + fi + fi + tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" + tmp_CFLAGS="$tmp_CFLAGS -fno-strict-aliasing" + tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" + ;; + # + INTEL_WINDOWS_C) + # + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + SGI_MIPS_C) + # + if test "$want_warnings" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS -fullwarn" + fi + ;; + # + SGI_MIPSPRO_C) + # + if test "$want_warnings" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS -fullwarn" + tmp_CFLAGS="$tmp_CFLAGS -woff 1209" + fi + ;; + # + SUNPRO_C) + # + if test "$want_warnings" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS -v" + fi + ;; + # + TINY_C) + # + if test "$want_warnings" = "yes"; then - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : + ac_var_added_warnings="" + for warning in all; do - HAVE_ZLIB_H="1" - if test "$HAVE_LIBZ" != "1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 -$as_echo_n "checking for gzread in -lz... " >&6; } -if ${ac_cv_lib_z_gzread+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -#ifdef __cplusplus -extern "C" -#endif -char gzread (); -int main (void) -{ -return gzread (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_gzread=yes -else - ac_cv_lib_z_gzread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 -$as_echo "$ac_cv_lib_z_gzread" >&6; } -if test "x$ac_cv_lib_z_gzread" = xyes; then : - HAVE_LIBZ="1" - LIBS="-lz $LIBS" + ac_var_added_warnings="" + for warning in write-strings; do -else - CPPFLAGS=$clean_CPPFLAGS - LDFLAGS=$clean_LDFLAGS -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS -else - CPPFLAGS=$clean_CPPFLAGS - LDFLAGS=$clean_LDFLAGS + ac_var_added_warnings="" + for warning in unsupported; do -fi + ac_var_match_word="no" + for word1 in $CFLAGS; do + for word2 in -Wno-$warning -W$warning; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done + if test "$ac_var_match_word" = "no"; then + ac_var_added_warnings="$ac_var_added_warnings -W$warning" + fi + done + tmp_CFLAGS="$tmp_CFLAGS $ac_var_added_warnings" + squeeze tmp_CFLAGS + fi + ;; + # + esac + # + squeeze tmp_CPPFLAGS + squeeze tmp_CFLAGS + # + if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts strict warning options" >&5 +printf %s "checking if compiler accepts strict warning options... " >&6; } + CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" + squeeze CPPFLAGS + squeeze CFLAGS - if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1" - then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: configure found only the libz lib, not the header file!" >&5 -$as_echo "$as_me: WARNING: configure found only the libz lib, not the header file!" >&2;} - HAVE_LIBZ="" - CPPFLAGS=$clean_CPPFLAGS - LDFLAGS=$clean_LDFLAGS - LIBS=$clean_LIBS - elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" - then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: configure found only the libz header file, not the lib!" >&5 -$as_echo "$as_me: WARNING: configure found only the libz header file, not the lib!" >&2;} - CPPFLAGS=$clean_CPPFLAGS - LDFLAGS=$clean_LDFLAGS - LIBS=$clean_LIBS - elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1" - then + tmp_compiler_works="unknown" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -$as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h +int main(void) +{ -$as_echo "#define HAVE_LIBZ 1" >>confdefs.h + int i = 1; + return i; + return 0; +} - ZLIB_LIBS="-lz" - LIBS="-lz $clean_LIBS" +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : - AMFIXLIB="1" - { $as_echo "$as_me:${as_lineno-$LINENO}: found both libz and libz.h header" >&5 -$as_echo "$as_me: found both libz and libz.h header" >&6;} - curl_zlib_msg="enabled" - fi -fi + tmp_compiler_works="yes" - if test x"$AMFIXLIB" = x1; then - HAVE_LIBZ_TRUE= - HAVE_LIBZ_FALSE='#' -else - HAVE_LIBZ_TRUE='#' - HAVE_LIBZ_FALSE= -fi +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + sed 's/^/cc-fail: /' conftest.err >&6 + echo " " >&6 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test "$tmp_compiler_works" = "yes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -LDAPLIBNAME="" -# Check whether --with-ldap-lib was given. -if test "${with_ldap_lib+set}" = set; then : - withval=$with_ldap_lib; LDAPLIBNAME="$withval" -fi +int main(void) +{ + int i = 1; + return i; -LBERLIBNAME="" + return 0; +} -# Check whether --with-lber-lib was given. -if test "${with_lber_lib+set}" = set; then : - withval=$with_lber_lib; LBERLIBNAME="$withval" -fi +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + tmp_compiler_works="yes" -if test x$CURL_DISABLE_LDAP != x1 ; then +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + sed 's/^/link-fail: /' conftest.err >&6 + echo " " >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lber.h" >&5 -$as_echo_n "checking for lber.h... " >&6; } -if ${curl_cv_header_lber_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + if test "x$cross_compiling" != "xyes" && + test "$tmp_compiler_works" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#include + #ifdef __STDC__ + # include + #endif -int main (void) +int main(void) { - BerValue *bvp = NULL; - BerElement *bep = ber_init(bvp); - ber_free(bep, 1); + int i = 0; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - curl_cv_header_lber_h="yes" - -else +if ac_fn_c_try_run "$LINENO" +then : + tmp_compiler_works="yes" - curl_cv_header_lber_h="no" +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + echo "run-fail: test program exited with status $ac_status" >&6 + echo " " >&6 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_lber_h" >&5 -$as_echo "$curl_cv_header_lber_h" >&6; } - if test "$curl_cv_header_lber_h" = "yes"; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_LBER_H 1 -_ACEOF - # - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#include + #ifdef __STDC__ + # include + #endif -int main (void) +int main(void) { - BerValue *bvp = NULL; - BerElement *bep = ber_init(bvp); - ber_free(bep, 1); + int i = 0; + return i; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - curl_cv_need_header_lber_h="no" +if ac_fn_c_try_run "$LINENO" +then : + tmp_compiler_works="yes" -else - - curl_cv_need_header_lber_h="yes" +else $as_nop + tmp_compiler_works="no" + echo " " >&6 + echo "run-fail: test program exited with status $ac_status" >&6 + echo " " >&6 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # - case "$curl_cv_need_header_lber_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define NEED_LBER_H 1 -_ACEOF +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - ;; - esac + LD_LIBRARY_PATH=$old # restore + CC=$oldcc fi + fi + if test "$tmp_compiler_works" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap.h" >&5 -$as_echo_n "checking for ldap.h... " >&6; } -if ${curl_cv_header_ldap_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#include - -int main (void) -{ - - LDAP *ldp = ldap_init("dummy", LDAP_PORT); - int res = ldap_unbind(ldp); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 +printf "%s\n" "$as_me: compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS" >&6;} - ; - return 0; -} + else -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&5 +printf "%s\n" "$as_me: WARNING: compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS" >&2;} + CPPFLAGS="$tmp_save_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS" - curl_cv_header_ldap_h="yes" + fi -else + fi + # + fi - curl_cv_header_ldap_h="no" +if test "$compiler_id" = "INTEL_UNIX_C"; then + # + if test "$compiler_num" -ge "1000"; then + CFLAGS="$CFLAGS -shared-intel" + elif test "$compiler_num" -ge "900"; then + CFLAGS="$CFLAGS -i-dynamic" + fi + # fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CURL_CFLAG_EXTRAS="" +if test X"$want_werror" = Xyes; then + CURL_CFLAG_EXTRAS="-Werror" + if test "$compiler_id" = "GNU_C"; then + if test "$compiler_num" -ge "500"; then + CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" + fi + elif test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then + CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_ldap_h" >&5 -$as_echo "$curl_cv_header_ldap_h" >&6; } - case "$curl_cv_header_ldap_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_LDAP_H 1 -_ACEOF - ;; - esac + if test X"$want_werror" = Xyes; then + CURL_WERROR_TRUE= + CURL_WERROR_FALSE='#' +else + CURL_WERROR_TRUE='#' + CURL_WERROR_FALSE= +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl.h" >&5 -$as_echo_n "checking for ldapssl.h... " >&6; } -if ${curl_cv_header_ldapssl_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler halts on compilation errors" >&5 +printf %s "checking if compiler halts on compilation errors... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif -#include -int main (void) +int main(void) { - char *cert_label = NULL; - LDAP *ldp = ldap_ssl_init("dummy", LDAPS_PORT, cert_label); + #error force compilation error - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - curl_cv_header_ldapssl_h="yes" +if ac_fn_c_try_compile "$LINENO" +then : -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "compiler does not halt on compilation errors." "$LINENO" 5 - curl_cv_header_ldapssl_h="no" +else $as_nop -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_ldapssl_h" >&5 -$as_echo "$curl_cv_header_ldapssl_h" >&6; } - case "$curl_cv_header_ldapssl_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_LDAPSSL_H 1 -_ACEOF - - ;; - esac - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_ssl.h" >&5 -$as_echo_n "checking for ldap_ssl.h... " >&6; } -if ${curl_cv_header_ldap_ssl_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler halts on negative sized arrays" >&5 +printf %s "checking if compiler halts on negative sized arrays... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif -#include + typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1]; -int main (void) +int main(void) { - LDAP *ldp = ldapssl_init("dummy", LDAPS_PORT, 1); + bad_t dummy; + (void)dummy; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - curl_cv_header_ldap_ssl_h="yes" +if ac_fn_c_try_compile "$LINENO" +then : -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "compiler does not halt on negative sized arrays." "$LINENO" 5 - curl_cv_header_ldap_ssl_h="no" +else $as_nop -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_ldap_ssl_h" >&5 -$as_echo "$curl_cv_header_ldap_ssl_h" >&6; } - case "$curl_cv_header_ldap_ssl_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_LDAP_SSL_H 1 -_ACEOF - - ;; - esac - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - if test -z "$LDAPLIBNAME" ; then - if test "$curl_cv_native_windows" = "yes"; then - LDAPLIBNAME="wldap32" - LBERLIBNAME="no" - fi - fi - if test "$LDAPLIBNAME" ; then - as_ac_Lib=`$as_echo "ac_cv_lib_"$LDAPLIBNAME"''_ldap_init" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_init in -l\"$LDAPLIBNAME\"" >&5 -$as_echo_n "checking for ldap_init in -l\"$LDAPLIBNAME\"... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l"$LDAPLIBNAME" $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler halts on function prototype mismatch" >&5 +printf %s "checking if compiler halts on function prototype mismatch... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char ldap_init (); -int main (void) -{ -return ldap_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_LIB"$LDAPLIBNAME"" | $as_tr_cpp` 1 -_ACEOF - - LIBS="-l"$LDAPLIBNAME" $LIBS" + #include + int rand(int n); + int rand(int n) + { + if(n) + return ++n; + else + return n; + } -else +int main(void) +{ - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"$LDAPLIBNAME\" is not an LDAP library: LDAP disabled" >&5 -$as_echo "$as_me: WARNING: \"$LDAPLIBNAME\" is not an LDAP library: LDAP disabled" >&2;} + int i[2]={0,0}; + int j = rand(i[0]); + if(j) + return j; -$as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h + return 0; +} - CURL_DISABLE_LDAP=1 +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "compiler does not halt on function prototype mismatch." "$LINENO" 5 -$as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h +else $as_nop - CURL_DISABLE_LDAPS=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - else - - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDAP libraries" >&5 -$as_echo_n "checking for LDAP libraries... " >&6; } - # - u_libs="" - # - # - curl_cv_save_LIBS="$LIBS" - curl_cv_ldap_LIBS="unknown" - # - for x_nlibs in '' "$u_libs" \ - '-lldap' \ - '-lldap -llber' \ - '-llber -lldap' \ - '-lldapssl -lldapx -lldapsdk' \ - '-lldapsdk -lldapx -lldapssl' ; do - if test "$curl_cv_ldap_LIBS" = "unknown"; then - if test -z "$x_nlibs"; then - LIBS="$curl_cv_save_LIBS" - else - LIBS="$x_nlibs $curl_cv_save_LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports hiding library internal symbols" >&5 +printf %s "checking if compiler supports hiding library internal symbols... " >&6; } + supports_symbol_hiding="no" + symbol_hiding_CFLAGS="" + symbol_hiding_EXTERN="" + tmp_CFLAGS="" + tmp_EXTERN="" + case "$compiler_id" in + CLANG|APPLECLANG) + tmp_EXTERN="__attribute__((__visibility__(\"default\")))" + tmp_CFLAGS="-fvisibility=hidden" + supports_symbol_hiding="yes" + ;; + GNU_C) + if test "$compiler_num" -ge "304"; then + if $CC --help --verbose 2>/dev/null | grep fvisibility= >/dev/null ; then + tmp_EXTERN="__attribute__((__visibility__(\"default\")))" + tmp_CFLAGS="-fvisibility=hidden" + supports_symbol_hiding="yes" + fi fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ;; + INTEL_UNIX_C) + if test "$compiler_num" -ge "900"; then + if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fvisibility=hidden" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#endif -#ifndef NULL -#define NULL (void *)0 -#endif -#ifndef LDAP_DEPRECATED -#define LDAP_DEPRECATED 1 -#endif -#ifdef NEED_LBER_H -#include -#endif -#ifdef HAVE_LDAP_H -#include -#endif + #include -int main (void) +int main(void) { - BerValue *bvp = NULL; - BerElement *bep = ber_init(bvp); - LDAP *ldp = ldap_init("dummy", LDAP_PORT); - int res = ldap_unbind(ldp); - ber_free(bep, 1); + printf("icc fvisibility bug test"); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - curl_cv_ldap_LIBS="$x_nlibs" + tmp_EXTERN="__attribute__((__visibility__(\"default\")))" + tmp_CFLAGS="-fvisibility=hidden" + supports_symbol_hiding="yes" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - fi - done - # - LIBS="$curl_cv_save_LIBS" - # - case X-"$curl_cv_ldap_LIBS" in - X-unknown) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find LDAP libraries" >&5 -$as_echo "cannot find LDAP libraries" >&6; } - ;; - X-) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no additional lib required" >&5 -$as_echo "no additional lib required" >&6; } + CFLAGS="$tmp_save_CFLAGS" + fi + fi ;; - *) - if test -z "$curl_cv_save_LIBS"; then - LIBS="$curl_cv_ldap_LIBS" - else - LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS" + SUNPRO_C) + if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then + tmp_EXTERN="__global" + tmp_CFLAGS="-xldscope=hidden" + supports_symbol_hiding="yes" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_ldap_LIBS" >&5 -$as_echo "$curl_cv_ldap_LIBS" >&6; } ;; esac - # - - case X-"$curl_cv_ldap_LIBS" in - X-unknown) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for LDAP support: LDAP disabled" >&5 -$as_echo "$as_me: WARNING: Cannot find libraries for LDAP support: LDAP disabled" >&2;} - -$as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h - - CURL_DISABLE_LDAP=1 - - -$as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h - - CURL_DISABLE_LDAPS=1 - - ;; - esac - fi -fi - -if test x$CURL_DISABLE_LDAP != x1 ; then - - if test "$LBERLIBNAME" ; then - if test "$LBERLIBNAME" != "no" ; then - as_ac_Lib=`$as_echo "ac_cv_lib_"$LBERLIBNAME"''_ber_free" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ber_free in -l\"$LBERLIBNAME\"" >&5 -$as_echo_n "checking for ber_free in -l\"$LBERLIBNAME\"... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l"$LBERLIBNAME" $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$supports_symbol_hiding" = "yes"; then + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" + squeeze CFLAGS + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char ber_free (); -int main (void) + $tmp_EXTERN const char *dummy(const char *buff); + const char *dummy(const char *buff) + { + if(buff) + return ++buff; + else + return buff; + } + +int main(void) { -return ber_free (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_LIB"$LBERLIBNAME"" | $as_tr_cpp` 1 -_ACEOF - LIBS="-l"$LBERLIBNAME" $LIBS" + const char *b = "example"; + const char *r = dummy(&b[0]); + if(r) + return (int)*r; -else + return 0; +} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"$LBERLIBNAME\" is not an LBER library: LDAP disabled" >&5 -$as_echo "$as_me: WARNING: \"$LBERLIBNAME\" is not an LBER library: LDAP disabled" >&2;} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -$as_echo "#define CURL_DISABLE_LDAP 1" >>confdefs.h + supports_symbol_hiding="yes" + if test -f conftest.err; then + grep 'visibility' conftest.err >/dev/null + if test "$?" -eq "0"; then + supports_symbol_hiding="no" + fi + fi - CURL_DISABLE_LDAP=1 +else $as_nop + supports_symbol_hiding="no" + echo " " >&6 + sed 's/^/cc-src: /' conftest.$ac_ext >&6 + sed 's/^/cc-err: /' conftest.err >&6 + echo " " >&6 -$as_echo "#define CURL_DISABLE_LDAPS 1" >>confdefs.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS="$tmp_save_CFLAGS" + fi + if test "$supports_symbol_hiding" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + symbol_hiding_CFLAGS="$tmp_CFLAGS" + symbol_hiding_EXTERN="$tmp_EXTERN" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi - CURL_DISABLE_LDAPS=1 +supports_unittests=yes +# cross-compilation of unit tests static library/programs fails when +# libcurl shared library is built. This might be due to a libtool or +# automake issue. In this case we disable unit tests. +if test "x$cross_compiling" != "xno" && + test "x$enable_shared" != "xno"; then + supports_unittests=no fi +# IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to +# a problem related with OpenSSL headers and library versions not matching. +# Disable unit tests while time to further investigate this is found. +case $host in + mips-sgi-irix6.5) + if test "$compiler_id" = "GNU_C"; then + supports_unittests=no fi - fi -fi + ;; +esac -if test x$CURL_DISABLE_LDAP != x1 ; then - for ac_func in ldap_url_parse ldap_init_fd -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +# All AIX autobuilds fails unit tests linking against unittests library +# due to unittests library being built with no symbols or members. Libtool ? +# Disable unit tests while time to further investigate this is found. +case $host_os in + aix*) + supports_unittests=no + ;; +esac + if test x$supports_unittests = xyes; then + BUILD_UNITTESTS_TRUE= + BUILD_UNITTESTS_FALSE='#' +else + BUILD_UNITTESTS_TRUE='#' + BUILD_UNITTESTS_FALSE= fi -done - if test "$LDAPLIBNAME" = "wldap32"; then - curl_ldap_msg="enabled (winldap)" +# In order to detect support of sendmmsg() and accept4(), we need to escape the POSIX +# jail by defining _GNU_SOURCE or will not expose it. +case $host_os in + *linux*|cygwin*|msys*) + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + ;; +esac -$as_echo "#define USE_WIN32_LDAP 1" >>confdefs.h - else - curl_ldap_msg="enabled (OpenLDAP)" - if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then -$as_echo "#define USE_OPENLDAP 1" >>confdefs.h + if test "$curl_cv_native_windows" = 'yes'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build target supports Win32 large files" >&5 +printf %s "checking whether build target supports Win32 large files... " >&6; } + if test "$curl_cv_wince" = 'yes'; then + curl_win32_has_largefile='no' + else + curl_win32_has_largefile='yes' + fi + case "$curl_win32_has_largefile" in + yes) + if test x"$enable_largefile" = 'xno'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (large file disabled)" >&5 +printf "%s\n" "yes (large file disabled)" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (large file enabled)" >&5 +printf "%s\n" "yes (large file enabled)" >&6; } - USE_OPENLDAP=1 +printf "%s\n" "#define USE_WIN32_LARGE_FILES 1" >>confdefs.h - fi + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac fi -fi -if test x$CURL_DISABLE_LDAPS != x1 ; then - curl_ldaps_msg="enabled" -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build target supports Win32 crypto API" >&5 +printf %s "checking whether build target supports Win32 crypto API... " >&6; } + curl_win32_crypto_api="no" + if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable IPv6" >&5 -$as_echo_n "checking whether to enable IPv6... " >&6; } -# Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then : - enableval=$enable_ipv6; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ipv6=no - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ipv6=yes - ;; - esac -else - if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ipv6=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - /* is AF_INET6 available? */ -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#include -#endif -#include /* for exit() */ -main() + #undef inline + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include + +int main(void) { - if (socket(AF_INET6, SOCK_STREAM, 0) < 0) - exit(1); - else - exit(0); + + HCRYPTPROV hCryptProv; + if(CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { + CryptReleaseContext(hCryptProv, 0); + } + + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ipv6=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ipv6=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +if ac_fn_c_try_compile "$LINENO" +then : + + curl_win32_crypto_api="yes" fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + case "$curl_win32_crypto_api" in + yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +printf "%s\n" "#define USE_WIN32_CRYPTO 1" >>confdefs.h -if test "$ipv6" = "yes"; then - curl_ipv6_msg="enabled" -fi + USE_WIN32_CRYPTO=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac -# Check if struct sockaddr_in6 have sin6_scope_id member -if test "$ipv6" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if struct sockaddr_in6 has sin6_scope_id member" >&5 -$as_echo_n "checking if struct sockaddr_in6 has sin6_scope_id member... " >&6; } + +curl_cv_apple='no' +case $host in + *-apple-*) curl_cv_apple='yes';; +esac + +if test "$curl_cv_apple" = 'yes'; then + + old_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror=partial-availability" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Werror=partial-availability" >&5 +printf %s "checking whether $CC accepts -Werror=partial-availability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#ifdef HAVE_WINSOCK2_H -#include -#include -#else -#include -#endif -int main (void) +int main(void) { -struct sockaddr_in6 s; s.sin6_scope_id = 0; - ; - return 0; + + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_sin6_scope_id=yes +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CFLAGS=$old_CFLAGS fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$have_sin6_scope_id" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking to see if the compiler supports __builtin_available()" >&5 +printf %s "checking to see if the compiler supports __builtin_available()... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if argv can be written to" >&5 -$as_echo_n "checking if argv can be written to... " >&6; } -if test "$cross_compiling" = yes; then : - curl_cv_writable_argv=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +int main(void) +{ + if(__builtin_available(macOS 10.12, iOS 5.0, *)) {} -int main(int argc, char ** argv) { - argv[0][0] = ' '; - return (argv[0][0] == ' ')?0:1; + return 0; } - _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - curl_cv_writable_argv=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else +printf "%s\n" "#define HAVE_BUILTIN_AVAILABLE 1" >>confdefs.h - curl_cv_writable_argv=no + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi -case $curl_cv_writable_argv in -yes) +curl_cv_cygwin='no' +case $host_os in + cygwin*|msys*) curl_cv_cygwin='yes';; +esac -$as_echo "#define HAVE_WRITABLE_ARGV 1" >>confdefs.h + if test "$curl_cv_native_windows" = "yes" && test -n "${RC}"; then + HAVE_WINDRES_TRUE= + HAVE_WINDRES_FALSE='#' +else + HAVE_WINDRES_TRUE='#' + HAVE_WINDRES_FALSE= +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; -no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the previous check could not be made default was used" >&5 -$as_echo "$as_me: WARNING: the previous check could not be made default was used" >&2;} - ;; -esac +if test "$curl_cv_native_windows" = "yes"; then + if test -z "$HAVE_WINDRES_TRUE"; then : + else + as_fn_error $? "windres not found in PATH. Windows builds require windres. Cannot continue." "$LINENO" 5 +fi +fi -GSSAPI_ROOT="/usr" +want_unity='no' +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build libcurl and curl in \"unity\" mode" >&5 +printf %s "checking whether to build libcurl and curl in \"unity\" mode... " >&6; } +# Check whether --enable-unity was given. +if test ${enable_unity+y} +then : + enableval=$enable_unity; case "$enableval" in + yes) + want_unity='yes' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -# Check whether --with-gssapi-includes was given. -if test "${with_gssapi_includes+set}" = set; then : - withval=$with_gssapi_includes; GSSAPI_INCS="-I$withval" - want_gss="yes" +fi + + if test "$want_unity" = 'yes'; then + USE_UNITY_TRUE= + USE_UNITY_FALSE='#' +else + USE_UNITY_TRUE='#' + USE_UNITY_FALSE= fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support http" >&5 +printf %s "checking whether to support http... " >&6; } +# Check whether --enable-http was given. +if test ${enable_http+y} +then : + enableval=$enable_http; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -# Check whether --with-gssapi-libs was given. -if test "${with_gssapi_libs+set}" = set; then : - withval=$with_gssapi_libs; GSSAPI_LIB_DIR="-L$withval" - want_gss="yes" +printf "%s\n" "#define CURL_DISABLE_HTTP 1" >>confdefs.h -fi + disable_http="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: disable HTTP disables FTP over proxy, IPFS and RTSP" >&5 +printf "%s\n" "$as_me: WARNING: disable HTTP disables FTP over proxy, IPFS and RTSP" >&2;} + CURL_DISABLE_HTTP=1 +printf "%s\n" "#define CURL_DISABLE_IPFS 1" >>confdefs.h + CURL_DISABLE_IPFS=1 -# Check whether --with-gssapi was given. -if test "${with_gssapi+set}" = set; then : - withval=$with_gssapi; - GSSAPI_ROOT="$withval" - if test x"$GSSAPI_ROOT" != xno; then - want_gss="yes" - if test x"$GSSAPI_ROOT" = xyes; then - GSSAPI_ROOT="/usr" - fi - fi +printf "%s\n" "#define CURL_DISABLE_RTSP 1" >>confdefs.h -fi + CURL_DISABLE_RTSP=1 +printf "%s\n" "#define CURL_DISABLE_ALTSVC 1" >>confdefs.h -: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"} -save_CPPFLAGS="$CPPFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if GSS-API support is requested" >&5 -$as_echo_n "checking if GSS-API support is requested... " >&6; } -if test x"$want_gss" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +printf "%s\n" "#define CURL_DISABLE_HSTS 1" >>confdefs.h - if test -z "$GSSAPI_INCS"; then - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then - GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` - elif test -f "$KRB5CONFIG"; then - GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` - elif test "$GSSAPI_ROOT" != "yes"; then - GSSAPI_INCS="-I$GSSAPI_ROOT/include" - fi - fi + curl_h1_msg="no (--enable-http)" + curl_altsvc_msg="no"; + curl_hsts_msg="no (--enable-hsts)"; + enable_altsvc="no" + hsts="no" + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" +fi - ac_fn_c_check_header_mongrel "$LINENO" "gss.h" "ac_cv_header_gss_h" "$ac_includes_default" -if test "x$ac_cv_header_gss_h" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support ftp" >&5 +printf %s "checking whether to support ftp... " >&6; } +# Check whether --enable-ftp was given. +if test ${enable_ftp+y} +then : + enableval=$enable_ftp; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_FTP 1" >>confdefs.h -$as_echo "#define HAVE_GSSGNU 1" >>confdefs.h + CURL_DISABLE_FTP=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - gnu_gss=yes +fi -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support file" >&5 +printf %s "checking whether to support file... " >&6; } +# Check whether --enable-file was given. +if test ${enable_file+y} +then : + enableval=$enable_file; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - for ac_header in gssapi/gssapi.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GSSAPI_GSSAPI_H 1 -_ACEOF +printf "%s\n" "#define CURL_DISABLE_FILE 1" >>confdefs.h + + CURL_DISABLE_FILE=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else - not_mit=1 fi -done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support IPFS" >&5 +printf %s "checking whether to support IPFS... " >&6; } +# Check whether --enable-ipfs was given. +if test ${enable_ipfs+y} +then : + enableval=$enable_ipfs; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - for ac_header in gssapi/gssapi_generic.h gssapi/gssapi_krb5.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " -$ac_includes_default -#ifdef HAVE_GSSAPI_GSSAPI_H -#include -#endif +printf "%s\n" "#define CURL_DISABLE_IPFS 1" >>confdefs.h -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + CURL_DISABLE_IPFS=1 + ;; + *) + if test x$CURL_DISABLE_HTTP = x1; then + as_fn_error $? "HTTP support needs to be enabled in order to enable IPFS support!" "$LINENO" 5 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_ipfs_msg="enabled" + fi + ;; + esac +else $as_nop + if test "x$CURL_DISABLE_HTTP" != "x1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_ipfs_msg="enabled" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -else - not_mit=1 fi -done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support ldap" >&5 +printf %s "checking whether to support ldap... " >&6; } +# Check whether --enable-ldap was given. +if test ${enable_ldap+y} +then : + enableval=$enable_ldap; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_LDAP 1" >>confdefs.h + + CURL_DISABLE_LDAP=1 + ;; + yes) + ldap_askedfor="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - if test "x$not_mit" = "x1"; then - ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_h" = xyes; then : +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support ldaps" >&5 +printf %s "checking whether to support ldaps... " >&6; } +# Check whether --enable-ldaps was given. +if test ${enable_ldaps+y} +then : + enableval=$enable_ldaps; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define HAVE_GSSHEIMDAL 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_LDAPS 1" >>confdefs.h + CURL_DISABLE_LDAPS=1 + ;; + *) + if test "x$CURL_DISABLE_LDAP" = "x1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: LDAP needs to be enabled to support LDAPS" >&5 +printf "%s\n" "LDAP needs to be enabled to support LDAPS" >&6; } -else +printf "%s\n" "#define CURL_DISABLE_LDAPS 1" >>confdefs.h - want_gss=no - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling GSS-API support since no header files were found" >&5 -$as_echo "$as_me: WARNING: disabling GSS-API support since no header files were found" >&2;} + CURL_DISABLE_LDAPS=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +printf "%s\n" "#define HAVE_LDAP_SSL 1" >>confdefs.h -fi + HAVE_LDAP_SSL=1 + fi + ;; + esac +else $as_nop + if test "x$CURL_DISABLE_LDAP" = "x1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - else +printf "%s\n" "#define CURL_DISABLE_LDAPS 1" >>confdefs.h -$as_echo "#define HAVE_GSSMIT 1" >>confdefs.h + CURL_DISABLE_LDAPS=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE" >&5 -$as_echo_n "checking if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +printf "%s\n" "#define HAVE_LDAP_SSL 1" >>confdefs.h + HAVE_LDAP_SSL=1 + fi -#include -#include -#include +fi -int main (void) -{ - gss_import_name( - (OM_uint32 *)0, - (gss_buffer_t)0, - GSS_C_NT_HOSTBASED_SERVICE, - (gss_name_t *)0); +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support rtsp" >&5 +printf %s "checking whether to support rtsp... " >&6; } +# Check whether --enable-rtsp was given. +if test ${enable_rtsp+y} +then : + enableval=$enable_rtsp; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - ; - return 0; -} +printf "%s\n" "#define CURL_DISABLE_RTSP 1" >>confdefs.h -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + CURL_DISABLE_RTSP=1 + ;; + *) + if test x$CURL_DISABLE_HTTP = x1; then + as_fn_error $? "HTTP support needs to be enabled in order to enable RTSP support!" "$LINENO" 5 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_rtsp_msg="enabled" + fi + ;; + esac +else $as_nop + if test "x$CURL_DISABLE_HTTP" != "x1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_rtsp_msg="enabled" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support proxies" >&5 +printf %s "checking whether to support proxies... " >&6; } +# Check whether --enable-proxy was given. +if test ${enable_proxy+y} +then : + enableval=$enable_proxy; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define HAVE_OLD_GSSMIT 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_PROXY 1" >>confdefs.h + CURL_DISABLE_PROXY=1 + https_proxy="no" + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi -fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support dict" >&5 +printf %s "checking whether to support dict... " >&6; } +# Check whether --enable-dict was given. +if test ${enable_dict+y} +then : + enableval=$enable_dict; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_DICT 1" >>confdefs.h + + CURL_DISABLE_DICT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -if test x"$want_gss" = xyes; then -$as_echo "#define HAVE_GSSAPI 1" >>confdefs.h - HAVE_GSSAPI=1 - curl_gss_msg="enabled (MIT Kerberos/Heimdal)" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support telnet" >&5 +printf %s "checking whether to support telnet... " >&6; } +# Check whether --enable-telnet was given. +if test ${enable_telnet+y} +then : + enableval=$enable_telnet; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - if test -n "$gnu_gss"; then - curl_gss_msg="enabled (GNU GSS)" - LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" - LIBS="-lgss $LIBS" - elif test -z "$GSSAPI_LIB_DIR"; then - case $host in - *-*-darwin*) - LIBS="-lgssapi_krb5 -lresolv $LIBS" - ;; - *) - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then - gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` - LIBS="$gss_libs $LIBS" - elif test -f "$KRB5CONFIG"; then - gss_libs=`$KRB5CONFIG --libs gssapi` - LIBS="$gss_libs $LIBS" - else - case $host in - *-hp-hpux*) - gss_libname="gss" - ;; - *) - gss_libname="gssapi" - ;; - esac - - if test "$GSSAPI_ROOT" != "yes"; then - LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" - LIBS="-l$gss_libname $LIBS" - else - LIBS="-l$gss_libname $LIBS" - fi - fi - ;; - esac - else - LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" - case $host in - *-hp-hpux*) - LIBS="-lgss $LIBS" - ;; - *) - LIBS="-lgssapi $LIBS" - ;; - esac - fi -else - CPPFLAGS="$save_CPPFLAGS" -fi +printf "%s\n" "#define CURL_DISABLE_TELNET 1" >>confdefs.h -build_libstubgss=no -if test x"$want_gss" = "xyes"; then - build_libstubgss=yes -fi + CURL_DISABLE_TELNET=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - if test "x$build_libstubgss" = "xyes"; then - BUILD_STUB_GSS_TRUE= - BUILD_STUB_GSS_FALSE='#' -else - BUILD_STUB_GSS_TRUE='#' - BUILD_STUB_GSS_FALSE= fi +if test "$curl_cv_winuwp" = 'yes' -o "$curl_cv_wince" = 'yes'; then -DEFAULT_SSL_BACKEND=no -VALID_DEFAULT_SSL_BACKEND= +printf "%s\n" "#define CURL_DISABLE_TELNET 1" >>confdefs.h -# Check whether --with-default-ssl-backend was given. -if test "${with_default_ssl_backend+set}" = set; then : - withval=$with_default_ssl_backend; DEFAULT_SSL_BACKEND=$withval + CURL_DISABLE_TELNET=1 fi -case "$DEFAULT_SSL_BACKEND" in +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support tftp" >&5 +printf %s "checking whether to support tftp... " >&6; } +# Check whether --enable-tftp was given. +if test ${enable_tftp+y} +then : + enableval=$enable_tftp; case "$enableval" in no) - ;; - default|yes) - as_fn_error $? "The name of the default SSL backend is required." "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_TFTP 1" >>confdefs.h + + CURL_DISABLE_TFTP=1 ;; *) - - VALID_DEFAULT_SSL_BACKEND=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; -esac + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support pop3" >&5 +printf %s "checking whether to support pop3... " >&6; } +# Check whether --enable-pop3 was given. +if test ${enable_pop3+y} +then : + enableval=$enable_pop3; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_POP3 1" >>confdefs.h -OPT_WINSSL=no + CURL_DISABLE_POP3=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -# Check whether --with-winssl was given. -if test "${with_winssl+set}" = set; then : - withval=$with_winssl; OPT_WINSSL=$withval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Windows native SSL/TLS (Windows native builds only)" >&5 -$as_echo_n "checking whether to enable Windows native SSL/TLS (Windows native builds only)... " >&6; } -if test -z "$ssl_backends" -o "x$OPT_WINSSL" != xno; then - ssl_msg= - if test "x$OPT_WINSSL" != "xno" && - test "x$curl_cv_native_windows" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support imap" >&5 +printf %s "checking whether to support imap... " >&6; } +# Check whether --enable-imap was given. +if test ${enable_imap+y} +then : + enableval=$enable_imap; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define USE_SCHANNEL 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_IMAP 1" >>confdefs.h - USE_SCHANNEL=1 + CURL_DISABLE_IMAP=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - ssl_msg="Windows-native" - test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - WINSSL_ENABLED=1 - # --with-winssl implies --enable-sspi +fi -$as_echo "#define USE_WINDOWS_SSPI 1" >>confdefs.h - USE_WINDOWS_SSPI=1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support smb" >&5 +printf %s "checking whether to support smb... " >&6; } +# Check whether --enable-smb was given. +if test ${enable_smb+y} +then : + enableval=$enable_smb; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - curl_sspi_msg="enabled" - LIBS="-lcrypt32 $LIBS" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +printf "%s\n" "#define CURL_DISABLE_SMB 1" >>confdefs.h -OPT_DARWINSSL=no + CURL_DISABLE_SMB=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -# Check whether --with-darwinssl was given. -if test "${with_darwinssl+set}" = set; then : - withval=$with_darwinssl; OPT_DARWINSSL=$withval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Apple OS native SSL/TLS" >&5 -$as_echo_n "checking whether to enable Apple OS native SSL/TLS... " >&6; } -if test -z "$ssl_backends" -o "x$OPT_DARWINSSL" != xno; then - if test "x$OPT_DARWINSSL" != "xno" && - test -d "/System/Library/Frameworks/Security.framework"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support smtp" >&5 +printf %s "checking whether to support smtp... " >&6; } +# Check whether --enable-smtp was given. +if test ${enable_smtp+y} +then : + enableval=$enable_smtp; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define USE_DARWINSSL 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_SMTP 1" >>confdefs.h - USE_DARWINSSL=1 + CURL_DISABLE_SMTP=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - ssl_msg="Apple OS-native" - test darwinssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - DARWINSSL_ENABLED=1 - LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -OPT_SSL=off -ca="no" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support gopher" >&5 +printf %s "checking whether to support gopher... " >&6; } +# Check whether --enable-gopher was given. +if test ${enable_gopher+y} +then : + enableval=$enable_gopher; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_GOPHER 1" >>confdefs.h + + CURL_DISABLE_GOPHER=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -# Check whether --with-ssl was given. -if test "${with_ssl+set}" = set; then : - withval=$with_ssl; OPT_SSL=$withval fi -if test -z "$ssl_backends" -o "x$OPT_SSL" != xno && - test X"$OPT_SSL" != Xno; then - ssl_msg= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support mqtt" >&5 +printf %s "checking whether to support mqtt... " >&6; } +# Check whether --enable-mqtt was given. +if test ${enable_mqtt+y} +then : + enableval=$enable_mqtt; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" +printf "%s\n" "#define CURL_DISABLE_MQTT 1" >>confdefs.h - case $host in - *-*-msys* | *-*-mingw*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdi32" >&5 -$as_echo_n "checking for gdi32... " >&6; } - my_ac_save_LIBS=$LIBS - LIBS="-lgdi32 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include -int main (void) -{ -GdiFlush(); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - LIBS=$my_ac_save_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + CURL_DISABLE_MQTT=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ;; - esac - case "$OPT_SSL" in - yes) - if test x$cross_compiling != xyes; then - PKGTEST="yes" - fi - PREFIX_OPENSSL=/usr/local/ssl - LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" - ;; - off) - if test x$cross_compiling != xyes; then - PKGTEST="yes" - fi - PREFIX_OPENSSL= + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to provide built-in manual" >&5 +printf %s "checking whether to provide built-in manual... " >&6; } +# Check whether --enable-manual was given. +if test ${enable_manual+y} +then : + enableval=$enable_manual; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; *) - PKGTEST="no" - PREFIX_OPENSSL=$OPT_SSL + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + USE_MANUAL="1" + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + USE_MANUAL="1" - OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig" - { $as_echo "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&5 -$as_echo "$as_me: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&6;} - if test -f "$OPENSSL_PCDIR/openssl.pc"; then - PKGTEST="yes" - fi +fi - LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" - if test "$PREFIX_OPENSSL" != "/usr" ; then - SSL_LDFLAGS="-L$LIB_OPENSSL" - SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" - fi - SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5 +printf %s "checking whether to build documentation... " >&6; } +# Check whether --enable-docs was given. +if test ${enable_docs+y} +then : + enableval=$enable_docs; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + BUILD_DOCS=0 + USE_MANUAL=0 + curl_docs_msg="no" + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + BUILD_DOCS=1 ;; esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + BUILD_DOCS=1 - if test "$PKGTEST" = "yes"; then +fi - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. - ;; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable generation of C code" >&5 +printf %s "checking whether to enable generation of C code... " >&6; } +# Check whether --enable-libcurl_option was given. +if test ${enable_libcurl_option+y} +then : + enableval=$enable_libcurl_option; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_LIBCURL_OPTION 1" >>confdefs.h + + curl_libcurl_msg="no" + ;; *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - ;; -esac -fi -PKGCONFIG=$ac_cv_path_PKGCONFIG -if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -fi -if test -z "$ac_cv_path_PKGCONFIG"; then - ac_pt_PKGCONFIG=$PKGCONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. - ;; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libgcc" >&5 +printf %s "checking whether to use libgcc... " >&6; } +# Check whether --enable-libgcc was given. +if test ${enable_libgcc+y} +then : + enableval=$enable_libgcc; case "$enableval" in + yes) + LIBS="-lgcc $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - ;; -esac -fi -ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG -if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi - if test "x$ac_pt_PKGCONFIG" = x; then - PKGCONFIG="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKGCONFIG=$ac_pt_PKGCONFIG - fi -else - PKGCONFIG="$ac_cv_path_PKGCONFIG" -fi - fi - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl options with pkg-config" >&5 -$as_echo_n "checking for openssl options with pkg-config... " >&6; } - itexists=` - if test -n "$OPENSSL_PCDIR"; then - PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists openssl >/dev/null 2>&1 && echo 1` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if X/Open network library is required" >&5 +printf %s "checking if X/Open network library is required... " >&6; } + tst_lib_xnet_required="no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi - fi + int main(void) + { + #if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600) + #elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) + #else + #error force compilation error + #endif + return 0; + } - if test "$PKGCONFIG" != "no" ; then - SSL_LIBS=` - if test -n "$OPENSSL_PCDIR"; then - PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-l openssl 2>/dev/null` - SSL_LDFLAGS=` - if test -n "$OPENSSL_PCDIR"; then - PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-L openssl 2>/dev/null` +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : - SSL_CPPFLAGS=` - if test -n "$OPENSSL_PCDIR"; then - PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --cflags-only-I openssl 2>/dev/null` + tst_lib_xnet_required="yes" + LIBS="-lxnet $LIBS" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tst_lib_xnet_required" >&5 +printf "%s\n" "$tst_lib_xnet_required" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&5 -$as_echo "$as_me: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&5 -$as_echo "$as_me: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&5 -$as_echo "$as_me: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&6;} - LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` +ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes +then : - LIBS="$SSL_LIBS $LIBS" - fi - fi + HAVE_GETHOSTBYNAME="1" - CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" - LDFLAGS="$LDFLAGS $SSL_LDFLAGS" +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_Update in -lcrypto" >&5 -$as_echo_n "checking for HMAC_Update in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_HMAC_Update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +printf %s "checking for gethostbyname in -lnsl... " >&6; } +if test ${ac_cv_lib_nsl_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" +LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22347,41 +22408,48 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char HMAC_Update (); -int main (void) +char gethostbyname (); +int main(void) { -return HMAC_Update (); - ; - return 0; +return gethostbyname (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_HMAC_Update=yes -else - ac_cv_lib_crypto_HMAC_Update=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_nsl_gethostbyname=yes +else $as_nop + ac_cv_lib_nsl_gethostbyname=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_HMAC_Update" >&5 -$as_echo "$ac_cv_lib_crypto_HMAC_Update" >&6; } -if test "x$ac_cv_lib_crypto_HMAC_Update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes +then : - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS" + HAVE_GETHOSTBYNAME="1" + LIBS="-lnsl $LIBS" -else - LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" - CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_Init_ex in -lcrypto" >&5 -$as_echo_n "checking for HMAC_Init_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_HMAC_Init_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi + + + +fi + + +if test "$HAVE_GETHOSTBYNAME" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 +printf %s "checking for gethostbyname in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" +LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22389,1097 +22457,1539 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char HMAC_Init_ex (); -int main (void) +char gethostbyname (); +int main(void) { -return HMAC_Init_ex (); - ; - return 0; +return gethostbyname (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_HMAC_Init_ex=yes -else - ac_cv_lib_crypto_HMAC_Init_ex=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_socket_gethostbyname=yes +else $as_nop + ac_cv_lib_socket_gethostbyname=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_HMAC_Init_ex" >&5 -$as_echo "$ac_cv_lib_crypto_HMAC_Init_ex" >&6; } -if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_socket_gethostbyname" >&6; } +if test "x$ac_cv_lib_socket_gethostbyname" = xyes +then : - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS" -else + HAVE_GETHOSTBYNAME="1" + LIBS="-lsocket $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL linking with -ldl" >&5 -$as_echo_n "checking OpenSSL linking with -ldl... " >&6; } - LIBS="-ldl $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi - #include +fi -int main (void) -{ +if test "$HAVE_GETHOSTBYNAME" != "1"; then + clean_CPPFLAGS=$CPPFLAGS + clean_LDFLAGS=$LDFLAGS + CPPFLAGS="-I${WATT_ROOT}/inc" + LDFLAGS="-L${WATT_ROOT}/lib" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lwatt" >&5 +printf %s "checking for gethostbyname in -lwatt... " >&6; } +if test ${ac_cv_lib_watt_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lwatt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - ERR_clear_error(); - ; - return 0; +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int main(void) +{ +return gethostbyname (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_watt_gethostbyname=yes +else $as_nop + ac_cv_lib_watt_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_watt_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_watt_gethostbyname" >&6; } +if test "x$ac_cv_lib_watt_gethostbyname" = xyes +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVECRYPTO="yes" + HAVE_GETHOSTBYNAME="1" + LIBS="-lwatt $LIBS" -else +printf "%s\n" "#define USE_WATT32 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL linking with -ldl and -lpthread" >&5 -$as_echo_n "checking OpenSSL linking with -ldl and -lpthread... " >&6; } - LIBS="-lpthread $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS + + +fi + +fi + +if test "$HAVE_GETHOSTBYNAME" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname with both nsl and socket libs" >&5 +printf %s "checking for gethostbyname with both nsl and socket libs... " >&6; } + my_ac_save_LIBS=$LIBS + LIBS="-lnsl -lsocket $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include -int main (void) + +int main(void) { - ERR_clear_error(); + gethostbyname(); - ; - return 0; + return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVECRYPTO="yes" +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_GETHOSTBYNAME="1" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LDFLAGS="$CLEANLDFLAGS" - CPPFLAGS="$CLEANCPPFLAGS" - LIBS="$CLEANLIBS" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + LIBS=$my_ac_save_LIBS fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext +fi + +if test "$HAVE_GETHOSTBYNAME" != "1"; then + if test "$curl_cv_wince" = 'yes'; then + winsock_LIB="-lws2" + if test ! -z "$winsock_LIB"; then + my_ac_save_LIBS=$LIBS + LIBS="$winsock_LIB $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in $winsock_LIB" >&5 +printf %s "checking for gethostbyname in $winsock_LIB... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #endif +int main(void) +{ -fi + gethostbyname("localhost"); + return 0; +} -fi +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_GETHOSTBYNAME="1" - if test X"$HAVECRYPTO" = X"yes"; then +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 -$as_echo_n "checking for SSL_connect in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lssl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + winsock_LIB="" + LIBS=$my_ac_save_LIBS + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + fi +fi + +# In UWP mode gethostbyname gets detected via the core libs, but some +# code (in6addr_any) still need ws2_32, so let us detect and add it. +if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then + if test "$curl_cv_native_windows" = "yes"; then + winsock_LIB="-lws2_32" + if test "$curl_cv_winuwp" != "yes"; then + winsock_LIB="$winsock_LIB -liphlpapi" + fi + if test ! -z "$winsock_LIB"; then + my_ac_save_LIBS=$LIBS + LIBS="$winsock_LIB $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in $winsock_LIB" >&5 +printf %s "checking for gethostbyname in $winsock_LIB... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char SSL_connect (); -int main (void) + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #endif + +int main(void) { -return SSL_connect (); - ; - return 0; + + gethostbyname("localhost"); + + return 0; } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ssl_SSL_connect=yes -else - ac_cv_lib_ssl_SSL_connect=no +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_GETHOSTBYNAME="1" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + winsock_LIB="" + LIBS=$my_ac_save_LIBS + fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_connect" >&6; } -if test "x$ac_cv_lib_ssl_SSL_connect" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSSL 1 -_ACEOF - LIBS="-lssl $LIBS" +if test "$HAVE_GETHOSTBYNAME" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname for Minix 3" >&5 +printf %s "checking for gethostbyname for Minix 3... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi + /* Older Minix versions may need here instead */ + #include - if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssl with RSAglue/rsaref libs in use" >&5 -$as_echo_n "checking for ssl with RSAglue/rsaref libs in use... " >&6; }; - OLIBS=$LIBS - LIBS="-lRSAglue -lrsaref $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 -$as_echo_n "checking for SSL_connect in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lssl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +int main(void) +{ + gethostbyname("localhost"); -#ifdef __cplusplus -extern "C" -#endif -char SSL_connect (); -int main (void) -{ -return SSL_connect (); - ; - return 0; + return 0; } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ssl_SSL_connect=yes -else - ac_cv_lib_ssl_SSL_connect=no +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_GETHOSTBYNAME="1" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_connect" >&6; } -if test "x$ac_cv_lib_ssl_SSL_connect" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSSL 1 -_ACEOF - LIBS="-lssl $LIBS" +if test "$HAVE_GETHOSTBYNAME" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname for eCos" >&5 +printf %s "checking for gethostbyname for eCos... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi - if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBS=$OLIBS - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi + #include + #include - else +int main(void) +{ - for ac_header in openssl/x509.h openssl/rsa.h openssl/crypto.h \ - openssl/pem.h openssl/ssl.h openssl/err.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - ssl_msg="OpenSSL" - test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - OPENSSL_ENABLED=1 + gethostbyname("localhost"); -$as_echo "#define USE_OPENSSL 1" >>confdefs.h + return 0; +} -fi +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : -done + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_GETHOSTBYNAME="1" +else $as_nop - if test $ac_cv_header_openssl_x509_h = no; then - for ac_header in x509.h rsa.h crypto.h pem.h ssl.h err.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi -done +if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname for AmigaOS bsdsocket.library" >&5 +printf %s "checking for gethostbyname for AmigaOS bsdsocket.library... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test $ac_cv_header_x509_h = yes && - test $ac_cv_header_crypto_h = yes && - test $ac_cv_header_ssl_h = yes; then - ssl_msg="OpenSSL" - OPENSSL_ENABLED=1 - fi - fi - fi + #define __USE_INLINE__ + #include + #ifdef __amigaos4__ + struct SocketIFace *ISocket = NULL; + #else + struct Library *SocketBase = NULL; + #endif - if test X"$OPENSSL_ENABLED" != X"1"; then - LIBS="$CLEANLIBS" - fi +int main(void) +{ - if test X"$OPT_SSL" != Xoff && - test "$OPENSSL_ENABLED" != "1"; then - as_fn_error $? "OpenSSL libs and/or directories were not found where specified!" "$LINENO" 5 - fi - fi + unsigned char host[] = "localhost"; + gethostbyname(host); - if test X"$OPENSSL_ENABLED" = X"1"; then - ac_fn_c_check_func "$LINENO" "ENGINE_init" "ac_cv_func_ENGINE_init" -if test "x$ac_cv_func_ENGINE_init" = xyes; then : + return 0; +} - for ac_header in openssl/engine.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/engine.h" "ac_cv_header_openssl_engine_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_engine_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_ENGINE_H 1 _ACEOF +if ac_fn_c_try_link "$LINENO" +then : -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVE_GETHOSTBYNAME="1" + HAVE_PROTO_BSDSOCKET_H="1" -done +printf "%s\n" "#define HAVE_PROTO_BSDSOCKET_H 1" >>confdefs.h - for ac_func in ENGINE_load_builtin_engines -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -fi -done +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +if test "$HAVE_GETHOSTBYNAME" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnetwork" >&5 +printf %s "checking for gethostbyname in -lnetwork... " >&6; } +if test ${ac_cv_lib_network_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnetwork $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - for ac_func in RAND_egd \ - ENGINE_cleanup \ - SSL_get_shutdown \ - SSLv2_client_method -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int main(void) +{ +return gethostbyname (); + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_network_gethostbyname=yes +else $as_nop + ac_cv_lib_network_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_gethostbyname" >&5 +printf "%s\n" "$ac_cv_lib_network_gethostbyname" >&6; } +if test "x$ac_cv_lib_network_gethostbyname" = xyes +then : + + HAVE_GETHOSTBYNAME="1" + LIBS="-lnetwork $LIBS" + fi -done +fi + + +curl_includes_winsock2="\ +/* includes start */ +#ifdef _WIN32 +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include +#endif +/* includes end */" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build target is a native Windows one" >&5 +printf %s "checking whether build target is a native Windows one... " >&6; } +if test ${curl_cv_native_windows+y} +then : + printf %s "(cached) " >&6 +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BoringSSL" >&5 -$as_echo_n "checking for BoringSSL... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include -int main (void) +int main(void) { - #ifndef OPENSSL_IS_BORINGSSL - #error not boringssl - #endif + #ifdef _WIN32 + int dummy = 1; + (void)dummy; + #else + #error Not a native Windows build target. + #endif - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + curl_cv_native_windows="yes" -cat >>confdefs.h <<_ACEOF -#define HAVE_BORINGSSL 1 -_ACEOF +else $as_nop - ssl_msg="BoringSSL" + curl_cv_native_windows="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_native_windows" >&5 +printf "%s\n" "$curl_cv_native_windows" >&6; } + if test "x$curl_cv_native_windows" = xyes; then + DOING_NATIVE_WINDOWS_TRUE= + DOING_NATIVE_WINDOWS_FALSE='#' else + DOING_NATIVE_WINDOWS_TRUE='#' + DOING_NATIVE_WINDOWS_FALSE= +fi + + - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + +curl_includes_bsdsocket="\ +/* includes start */ +#if defined(HAVE_PROTO_BSDSOCKET_H) +# define __NO_NET_API +# define __USE_INLINE__ +# include +# ifdef HAVE_SYS_IOCTL_H +# include +# endif +# ifdef __amigaos4__ +struct SocketIFace *ISocket = NULL; +# else +struct Library *SocketBase = NULL; +# endif +# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0) +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "proto/bsdsocket.h" "ac_cv_header_proto_bsdsocket_h" "$curl_includes_bsdsocket +" +if test "x$ac_cv_header_proto_bsdsocket_h" = xyes +then : + printf "%s\n" "#define HAVE_PROTO_BSDSOCKET_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libressl" >&5 -$as_echo_n "checking for libressl... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for connect in libraries" >&5 +printf %s "checking for connect in libraries... " >&6; } + tst_connect_save_LIBS="$LIBS" + tst_connect_need_LIBS="unknown" + for tst_lib in '' '-lsocket' ; do + if test "$tst_connect_need_LIBS" = "unknown"; then + LIBS="$tst_lib $tst_connect_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + $curl_includes_winsock2 + $curl_includes_bsdsocket + #if !defined(_WIN32) && !defined(HAVE_PROTO_BSDSOCKET_H) + int connect(int, void*, int); + #endif -int main (void) +int main(void) { - int dummy = LIBRESSL_VERSION_NUMBER; + if(0 != connect(0, 0, 0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + tst_connect_need_LIBS="$tst_lib" -cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRESSL 1 -_ACEOF +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + done + LIBS="$tst_connect_save_LIBS" + # + case X-"$tst_connect_need_LIBS" in + X-unknown) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cannot find connect" >&5 +printf "%s\n" "cannot find connect" >&6; } + as_fn_error $? "cannot find connect function in libraries." "$LINENO" 5 + ;; + X-) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tst_connect_need_LIBS" >&5 +printf "%s\n" "$tst_connect_need_LIBS" >&6; } + LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS" + ;; + esac - ssl_msg="libressl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "$OPENSSL_ENABLED" = "1"; then - if test -n "$LIB_OPENSSL"; then - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $LIB_OPENSSL to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $LIB_OPENSSL to LD_LIBRARY_PATH" >&6;} - fi - fi - - # - - # - tst_api="unknown" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for monotonic clock_gettime" >&5 +printf %s "checking for monotonic clock_gettime... " >&6; } # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL headers version" >&5 -$as_echo_n "checking for OpenSSL headers version... " >&6; } - - OLDCPPFLAGS=$CPPFLAGS - # CPPPFLAG comes from CURL_CPP_P - CPPFLAGS="$CPPFLAGS $CPPPFLAG" - if test -z "$SED"; then - as_fn_error $? "SED not set. Cannot continue without SED being set." "$LINENO" 5 - fi - if test -z "$GREP"; then - as_fn_error $? "GREP not set. Cannot continue without GREP being set." "$LINENO" 5 - fi - tmp_exp="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# ifdef USE_OPENSSL -# include -# else -# include -# endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include -#ifdef OPENSSL_VERSION_NUMBER -CURL_DEF_TOKEN OPENSSL_VERSION_NUMBER -#endif +int main(void) +{ + + struct timespec ts; + (void)clock_gettime(CLOCK_MONOTONIC, &ts); + (void)ts; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ - "$GREP" CURL_DEF_TOKEN 2>/dev/null | \ - "$SED" 's/.*CURL_DEF_TOKEN[ ][ ]*//' 2>/dev/null | \ - "$SED" 's/["][ ]*["]//g' 2>/dev/null` - if test -z "$tmp_exp" || test "$tmp_exp" = "OPENSSL_VERSION_NUMBER"; then - tmp_exp="" - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_func_clock_gettime="yes" -fi -rm -f conftest.err conftest.i conftest.$ac_ext - if test -z "$tmp_exp"; then - curl_cv_have_def_OPENSSL_VERSION_NUMBER=no +else $as_nop - else - curl_cv_have_def_OPENSSL_VERSION_NUMBER=yes - curl_cv_def_OPENSSL_VERSION_NUMBER=$tmp_exp + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_func_clock_gettime="no" - fi - CPPFLAGS=$OLDCPPFLAGS +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - if test "$curl_cv_have_def_OPENSSL_VERSION_NUMBER" = "yes"; then - tst_verlen=`expr "$curl_cv_def_OPENSSL_VERSION_NUMBER" : '.*'` - case "x$tst_verlen" in - x6) - tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3` - tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 4` - tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5` - tst_api=0x$tst_vermaj$tst_vermin$tst_verfix - ;; - x11|x10) - tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3` - tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5` - tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 7` - tst_api=0x$tst_vermaj$tst_vermin$tst_verfix - ;; - *) - tst_api="unknown" - ;; - esac - case $tst_api in - 0x110) tst_show="1.1.0" ;; - 0x102) tst_show="1.0.2" ;; - 0x101) tst_show="1.0.1" ;; - 0x100) tst_show="1.0.0" ;; - 0x099) tst_show="0.9.9" ;; - 0x098) tst_show="0.9.8" ;; - 0x097) tst_show="0.9.7" ;; - 0x096) tst_show="0.9.6" ;; - 0x095) tst_show="0.9.5" ;; - 0x094) tst_show="0.9.4" ;; - 0x093) tst_show="0.9.3" ;; - 0x092) tst_show="0.9.2" ;; - 0x091) tst_show="0.9.1" ;; - *) tst_show="unknown" ;; - esac - tst_show="$tst_show - $curl_cv_def_OPENSSL_VERSION_NUMBER" - else - tst_show="unknown" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_show" >&5 -$as_echo "$tst_show" >&6; } - # - curl_openssl_api_headers=$tst_api - # - tst_api="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL library version" >&5 -$as_echo_n "checking for OpenSSL library version... " >&6; } - if test "$tst_api" = "unknown"; then - case $host in - *-*-vms*) + # + if test "$curl_func_clock_gettime" = "yes"; then + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in libraries" >&5 +printf %s "checking for clock_gettime in libraries... " >&6; } + # + curl_cv_save_LIBS="$LIBS" + curl_cv_gclk_LIBS="unknown" + # + for x_xlibs in '' '-lrt' '-lposix4' ; do + if test "$curl_cv_gclk_LIBS" = "unknown"; then + if test -z "$x_xlibs"; then + LIBS="$curl_cv_save_LIBS" + else + LIBS="$x_xlibs $curl_cv_save_LIBS" + fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define SSL_CTX_set_not_resumbl_sess_cb innocuous_SSL_CTX_set_not_resumbl_sess_cb -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_CTX_set_not_resumbl_sess_cb -#ifdef __cplusplus -extern "C" -#endif -char SSL_CTX_set_not_resumbl_sess_cb (); -#if defined __stub_SSL_CTX_set_not_resumbl_sess_cb || defined __stub___SSL_CTX_set_not_resumbl_sess_cb -choke me -#endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include -int main (void) +int main(void) { -return SSL_CTX_set_not_resumbl_sess_cb (); - ; - return 0; + + struct timespec ts; + (void)clock_gettime(CLOCK_MONOTONIC, &ts); + (void)ts; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - tst_api="0x110" + curl_cv_gclk_LIBS="$x_xlibs" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext + fi + done + # + LIBS="$curl_cv_save_LIBS" + # + case X-"$curl_cv_gclk_LIBS" in + X-unknown) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cannot find clock_gettime" >&5 +printf "%s\n" "cannot find clock_gettime" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 +printf "%s\n" "$as_me: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} + curl_func_clock_gettime="no" + ;; + X-) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no additional lib required" >&5 +printf "%s\n" "no additional lib required" >&6; } + curl_func_clock_gettime="yes" ;; *) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "x$dontwant_rt" = "xyes" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: needs -lrt but asked not to use it, HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 +printf "%s\n" "$as_me: WARNING: needs -lrt but asked not to use it, HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} + curl_func_clock_gettime="no" + else + if test -z "$curl_cv_save_LIBS"; then + LIBS="$curl_cv_gclk_LIBS" + else + LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_gclk_LIBS" >&5 +printf "%s\n" "$curl_cv_gclk_LIBS" >&6; } + curl_func_clock_gettime="yes" + fi + ;; + esac + # + if test "x$cross_compiling" != "xyes" && + test "$curl_func_clock_gettime" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if monotonic clock_gettime works" >&5 +printf %s "checking if monotonic clock_gettime works... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define SSL_CTX_set_not_resumable_session_callback innocuous_SSL_CTX_set_not_resumable_session_callback -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_CTX_set_not_resumable_session_callback -#ifdef __cplusplus -extern "C" -#endif -char SSL_CTX_set_not_resumable_session_callback (); -#if defined __stub_SSL_CTX_set_not_resumable_session_callback || defined __stub___SSL_CTX_set_not_resumable_session_callback -choke me -#endif - -int main (void) + #include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include + +int main(void) { -return SSL_CTX_set_not_resumable_session_callback (); - ; - return 0; + + struct timespec ts; + if(0 == clock_gettime(CLOCK_MONOTONIC, &ts)) + return 0; + (void)ts; + return 1; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - tst_api="0x110" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 +printf "%s\n" "$as_me: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} + curl_func_clock_gettime="no" + LIBS="$curl_cv_save_LIBS" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ;; - esac - fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define SSL_CONF_CTX_new innocuous_SSL_CONF_CTX_new -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_CONF_CTX_new -#ifdef __cplusplus -extern "C" -#endif -char SSL_CONF_CTX_new (); -#if defined __stub_SSL_CONF_CTX_new || defined __stub___SSL_CONF_CTX_new -choke me -#endif + #include + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include -int main (void) +int main(void) { -return SSL_CONF_CTX_new (); - ; - return 0; + + struct timespec ts; + if(0 == clock_gettime(CLOCK_MONOTONIC, &ts)) + return 0; + (void)ts; + return 1; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - tst_api="0x102" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&5 +printf "%s\n" "$as_me: WARNING: HAVE_CLOCK_GETTIME_MONOTONIC will not be defined" >&2;} + curl_func_clock_gettime="no" + LIBS="$curl_cv_save_LIBS" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LD_LIBRARY_PATH=$old # restore + CC=$oldcc fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + fi + # + case "$curl_func_clock_gettime" in + yes) -#define SSL_renegotiate_abbreviated innocuous_SSL_renegotiate_abbreviated -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_renegotiate_abbreviated -#ifdef __cplusplus -extern "C" -#endif -char SSL_renegotiate_abbreviated (); -#if defined __stub_SSL_renegotiate_abbreviated || defined __stub___SSL_renegotiate_abbreviated -choke me -#endif +printf "%s\n" "#define HAVE_CLOCK_GETTIME_MONOTONIC 1" >>confdefs.h + + ;; + esac + # + fi + # -int main (void) -{ -return SSL_renegotiate_abbreviated (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tst_api="0x101" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for raw monotonic clock_gettime" >&5 +printf %s "checking for raw monotonic clock_gettime... " >&6; } + # + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define OBJ_add_sigid innocuous_OBJ_add_sigid -#ifdef __STDC__ -# include -#else -# include -#endif -#undef OBJ_add_sigid -#ifdef __cplusplus -extern "C" -#endif -char OBJ_add_sigid (); -#if defined __stub_OBJ_add_sigid || defined __stub___OBJ_add_sigid -choke me -#endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #ifndef _WIN32 + #include + #endif + #include -int main (void) +int main(void) { -return OBJ_add_sigid (); - ; - return 0; + + struct timespec ts; + (void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts); + (void)ts; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - tst_api="0x100" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CLOCK_GETTIME_MONOTONIC_RAW 1" >>confdefs.h + + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -#define ERR_set_mark innocuous_ERR_set_mark -#ifdef __STDC__ -# include -#else -# include -#endif -#undef ERR_set_mark -#ifdef __cplusplus -extern "C" -#endif -char ERR_set_mark (); -#if defined __stub_ERR_set_mark || defined __stub___ERR_set_mark -choke me -#endif +CURL_NETWORK_AND_TIME_LIBS=$LIBS -int main (void) -{ -return ERR_set_mark (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tst_api="0x098" +clean_CPPFLAGS=$CPPFLAGS +clean_LDFLAGS=$LDFLAGS +clean_LIBS=$LIBS +ZLIB_LIBS="" +# Check whether --with-zlib was given. +if test ${with_zlib+y} +then : + withval=$with_zlib; OPT_ZLIB="$withval" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + + +if test "$OPT_ZLIB" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5 +printf "%s\n" "$as_me: WARNING: zlib disabled" >&2;} +else + if test "$OPT_ZLIB" = "yes"; then + OPT_ZLIB="" fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test -z "$OPT_ZLIB"; then -#define ERR_peek_last_error innocuous_ERR_peek_last_error -#ifdef __STDC__ -# include -#else -# include -#endif -#undef ERR_peek_last_error -#ifdef __cplusplus -extern "C" -#endif -char ERR_peek_last_error (); -#if defined __stub_ERR_peek_last_error || defined __stub___ERR_peek_last_error -choke me -#endif + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -int main (void) -{ -return ERR_peek_last_error (); - ; - return 0; -} + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tst_api="0x097" +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi + fi -#define c2i_ASN1_OBJECT innocuous_c2i_ASN1_OBJECT -#ifdef __STDC__ -# include -#else -# include -#endif -#undef c2i_ASN1_OBJECT -#ifdef __cplusplus -extern "C" -#endif -char c2i_ASN1_OBJECT (); -#if defined __stub_c2i_ASN1_OBJECT || defined __stub___c2i_ASN1_OBJECT -choke me -#endif + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zlib options with pkg-config" >&5 +printf %s "checking for zlib options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists zlib >/dev/null 2>&1 && echo 1` -int main (void) -{ -return c2i_ASN1_OBJECT (); - ; - return 0; -} + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tst_api="0x096" + if test "$PKGCONFIG" != "no"; then + ZLIB_LIBS="`$PKGCONFIG --libs-only-l zlib`" + if test -n "$ZLIB_LIBS"; then + LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`" + else + ZLIB_LIBS="`$PKGCONFIG --libs zlib`" + fi + LIBS="$ZLIB_LIBS $LIBS" + CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags zlib`" + OPT_ZLIB="" + HAVE_LIBZ="1" + fi + + if test -z "$HAVE_LIBZ"; then -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 +printf %s "checking for inflateEnd in -lz... " >&6; } +if test ${ac_cv_lib_z_inflateEnd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define SSL_CTX_set_purpose innocuous_SSL_CTX_set_purpose -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_CTX_set_purpose #ifdef __cplusplus extern "C" #endif -char SSL_CTX_set_purpose (); -#if defined __stub_SSL_CTX_set_purpose || defined __stub___SSL_CTX_set_purpose -choke me -#endif +char inflateEnd (); +int main(void) +{ +return inflateEnd (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_z_inflateEnd=yes +else $as_nop + ac_cv_lib_z_inflateEnd=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 +printf "%s\n" "$ac_cv_lib_z_inflateEnd" >&6; } +if test "x$ac_cv_lib_z_inflateEnd" = xyes +then : -int main (void) -{ -return SSL_CTX_set_purpose (); - ; - return 0; -} + HAVE_LIBZ="1" + ZLIB_LIBS="-lz" + LIBS="$ZLIB_LIBS $LIBS" -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +else $as_nop + + OPT_ZLIB="/usr/local" - tst_api="0x095" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + + fi fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + if test -n "$OPT_ZLIB"; then + CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" + LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" + fi + + ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes +then : + + HAVE_ZLIB_H="1" + if test "$HAVE_LIBZ" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 +printf %s "checking for gzread in -lz... " >&6; } +if test ${ac_cv_lib_z_gzread+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define OBJ_obj2txt innocuous_OBJ_obj2txt -#ifdef __STDC__ -# include -#else -# include -#endif -#undef OBJ_obj2txt #ifdef __cplusplus extern "C" #endif -char OBJ_obj2txt (); -#if defined __stub_OBJ_obj2txt || defined __stub___OBJ_obj2txt -choke me -#endif - -int main (void) +char gzread (); +int main(void) { -return OBJ_obj2txt (); - ; - return 0; +return gzread (); + return 0; } - _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - tst_api="0x094" - +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_z_gzread=yes +else $as_nop + ac_cv_lib_z_gzread=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 +printf "%s\n" "$ac_cv_lib_z_gzread" >&6; } +if test "x$ac_cv_lib_z_gzread" = xyes +then : + HAVE_LIBZ="1" + ZLIB_LIBS="-lz" + LIBS="$ZLIB_LIBS $LIBS" -#define SSL_get_verify_depth innocuous_SSL_get_verify_depth -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_get_verify_depth -#ifdef __cplusplus -extern "C" -#endif -char SSL_get_verify_depth (); -#if defined __stub_SSL_get_verify_depth || defined __stub___SSL_get_verify_depth -choke me -#endif +else $as_nop -int main (void) -{ -return SSL_get_verify_depth (); - ; - return 0; -} + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tst_api="0x093" +fi + + fi + +else $as_nop + + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + + + if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: configure found only the libz lib, not the header file!" >&5 +printf "%s\n" "$as_me: WARNING: configure found only the libz lib, not the header file!" >&2;} + HAVE_LIBZ="" + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS + LIBS=$clean_LIBS + ZLIB_LIBS="" + elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: configure found only the libz header file, not the lib!" >&5 +printf "%s\n" "$as_me: WARNING: configure found only the libz header file, not the lib!" >&2;} + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS + LIBS=$clean_LIBS + ZLIB_LIBS="" + elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"; then + + +printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h + + LIBS="$ZLIB_LIBS $clean_LIBS" + + AMFIXLIB="1" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: found both libz and libz.h header" >&5 +printf "%s\n" "$as_me: found both libz and libz.h header" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE zlib" + curl_zlib_msg="enabled" fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi + + if test x"$AMFIXLIB" = x1; then + HAVE_LIBZ_TRUE= + HAVE_LIBZ_FALSE='#' +else + HAVE_LIBZ_TRUE='#' + HAVE_LIBZ_FALSE= +fi -#define SSL_library_init innocuous_SSL_library_init -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_library_init -#ifdef __cplusplus -extern "C" -#endif -char SSL_library_init (); -#if defined __stub_SSL_library_init || defined __stub___SSL_library_init -choke me -#endif -int main (void) -{ -return SSL_library_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tst_api="0x092" +OPT_BROTLI=off +# Check whether --with-brotli was given. +if test ${with_brotli+y} +then : + withval=$with_brotli; OPT_BROTLI=$withval fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "$tst_api" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define SSL_CTX_set_cipher_list innocuous_SSL_CTX_set_cipher_list -#ifdef __STDC__ -# include -#else -# include -#endif -#undef SSL_CTX_set_cipher_list -#ifdef __cplusplus -extern "C" -#endif -char SSL_CTX_set_cipher_list (); -#if defined __stub_SSL_CTX_set_cipher_list || defined __stub___SSL_CTX_set_cipher_list -choke me -#endif +if test X"$OPT_BROTLI" != Xno; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -int main (void) -{ -return SSL_CTX_set_cipher_list (); - ; - return 0; -} + case "$OPT_BROTLI" in + yes) -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - tst_api="0x091" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi - case $tst_api in - 0x110) tst_show="1.1.0" ;; - 0x102) tst_show="1.0.2" ;; - 0x101) tst_show="1.0.1" ;; - 0x100) tst_show="1.0.0" ;; - 0x099) tst_show="0.9.9" ;; - 0x098) tst_show="0.9.8" ;; - 0x097) tst_show="0.9.7" ;; - 0x096) tst_show="0.9.6" ;; - 0x095) tst_show="0.9.5" ;; - 0x094) tst_show="0.9.4" ;; - 0x093) tst_show="0.9.3" ;; - 0x092) tst_show="0.9.2" ;; - 0x091) tst_show="0.9.1" ;; - *) tst_show="unknown" ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_show" >&5 -$as_echo "$tst_show" >&6; } - # - curl_openssl_api_library=$tst_api +done + done +IFS=$as_save_IFS - # - tst_match="yes" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL headers and library versions matching" >&5 -$as_echo_n "checking for OpenSSL headers and library versions matching... " >&6; } - if test "$curl_openssl_api_headers" = "unknown" || - test "$curl_openssl_api_library" = "unknown"; then - tst_match="fail" - tst_warns="Can not compare OpenSSL headers and library versions." - elif test "$curl_openssl_api_headers" != "$curl_openssl_api_library"; then - tst_match="no" - tst_warns="OpenSSL headers and library versions do not match." + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_match" >&5 -$as_echo "$tst_match" >&6; } - if test "$tst_match" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $tst_warns" >&5 -$as_echo "$as_me: WARNING: $tst_warns" >&2;} +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi + fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbrotlidec options with pkg-config" >&5 +printf %s "checking for libbrotlidec options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR fi + $PKGCONFIG --exists libbrotlidec >/dev/null 2>&1 && echo 1` - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -fi + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -if test X"$OPENSSL_ENABLED" = X"1"; then + if test "$PKGCONFIG" != "no"; then + LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec` + LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec` + CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec` + version=`$PKGCONFIG --modversion libbrotlidec` + fi -# Check whether --with-egd-socket was given. -if test "${with_egd_socket+set}" = set; then : - withval=$with_egd_socket; EGD_SOCKET="$withval" + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test -n "$EGD_SOCKET" ; then -cat >>confdefs.h <<_ACEOF -#define EGD_SOCKET "$EGD_SOCKET" -_ACEOF +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG fi - - -# Check whether --with-random was given. -if test "${with_random+set}" = set; then : - withval=$with_random; RANDOM_FILE="$withval" -else - - if test x$cross_compiling != xyes; then - as_ac_File=`$as_echo "ac_cv_file_"/dev/urandom"" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"/dev/urandom\"" >&5 -$as_echo_n "checking for \"/dev/urandom\"... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r ""/dev/urandom""; then - eval "$as_ac_File=yes" else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - RANDOM_FILE="/dev/urandom" + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: skipped the /dev/urandom detection when cross-compiling" >&5 -$as_echo "$as_me: WARNING: skipped the /dev/urandom detection when cross-compiling" >&2;} - fi + fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbrotlicommon options with pkg-config" >&5 +printf %s "checking for libbrotlicommon options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libbrotlicommon >/dev/null 2>&1 && echo 1` -fi + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then + if test "$PKGCONFIG" != "no"; then + LIB_BROTLI="$LIB_BROTLI `$PKGCONFIG --libs-only-l libbrotlicommon`" + LD_BROTLI="$LD_BROTLI `$PKGCONFIG --libs-only-L libbrotlicommon`" + CPP_BROTLI="$CPP_BROTLI `$PKGCONFIG --cflags-only-I libbrotlicommon`" + fi -cat >>confdefs.h <<_ACEOF -#define RANDOM_FILE "$RANDOM_FILE" -_ACEOF + DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'` + ;; + off) + ;; + *) + PREFIX_BROTLI=$OPT_BROTLI + ;; + esac + if test -n "$PREFIX_BROTLI"; then + LIB_BROTLI="-lbrotlidec -lbrotlicommon" + LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff + CPP_BROTLI=-I${PREFIX_BROTLI}/include + DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff fi -fi -if test "$OPENSSL_ENABLED" = "1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SRP_Calc_client_key in -lcrypto" >&5 -$as_echo_n "checking for SRP_Calc_client_key in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SRP_Calc_client_key+:} false; then : - $as_echo_n "(cached) " >&6 -else + LDFLAGS="$LDFLAGS $LD_BROTLI" + LDFLAGSPC="$LDFLAGSPC $LD_BROTLI" + CPPFLAGS="$CPPFLAGS $CPP_BROTLI" + LIBS="$LIB_BROTLI $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BrotliDecoderDecompress in -lbrotlidec" >&5 +printf %s "checking for BrotliDecoderDecompress in -lbrotlidec... " >&6; } +if test ${ac_cv_lib_brotlidec_BrotliDecoderDecompress+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" +LIBS="-lbrotlidec $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23487,71 +23997,105 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char SRP_Calc_client_key (); -int main (void) +char BrotliDecoderDecompress (); +int main(void) { -return SRP_Calc_client_key (); - ; - return 0; +return BrotliDecoderDecompress (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_SRP_Calc_client_key=yes -else - ac_cv_lib_crypto_SRP_Calc_client_key=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_brotlidec_BrotliDecoderDecompress=yes +else $as_nop + ac_cv_lib_brotlidec_BrotliDecoderDecompress=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SRP_Calc_client_key" >&5 -$as_echo "$ac_cv_lib_crypto_SRP_Calc_client_key" >&6; } -if test "x$ac_cv_lib_crypto_SRP_Calc_client_key" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_brotlidec_BrotliDecoderDecompress" >&5 +printf "%s\n" "$ac_cv_lib_brotlidec_BrotliDecoderDecompress" >&6; } +if test "x$ac_cv_lib_brotlidec_BrotliDecoderDecompress" = xyes +then : + printf "%s\n" "#define HAVE_LIBBROTLIDEC 1" >>confdefs.h + LIBS="-lbrotlidec $LIBS" + +fi -$as_echo "#define HAVE_OPENSSL_SRP 1" >>confdefs.h - HAVE_OPENSSL_SRP=1 + for ac_header in brotli/decode.h +do : + ac_fn_c_check_header_compile "$LINENO" "brotli/decode.h" "ac_cv_header_brotli_decode_h" "$ac_includes_default" +if test "x$ac_cv_header_brotli_decode_h" = xyes +then : + printf "%s\n" "#define HAVE_BROTLI_DECODE_H 1" >>confdefs.h + curl_brotli_msg="enabled (libbrotlidec)" + HAVE_BROTLI=1 +printf "%s\n" "#define HAVE_BROTLI 1" >>confdefs.h -fi fi +done -OPT_GNUTLS=no + if test X"$OPT_BROTLI" != Xoff && + test "$HAVE_BROTLI" != "1"; then + as_fn_error $? "BROTLI libs and/or directories were not found where specified!" "$LINENO" 5 + fi + if test "$HAVE_BROTLI" = "1"; then + if test -n "$DIR_BROTLI"; then -# Check whether --with-gnutls was given. -if test "${with_gnutls+set}" = set; then : - withval=$with_gnutls; OPT_GNUTLS=$withval + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_BROTLI to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_BROTLI to CURL_LIBRARY_PATH" >&6;} + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libbrotlidec libbrotlicommon" + else + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + fi fi -if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then - ssl_msg= +OPT_ZSTD=off - if test X"$OPT_GNUTLS" != Xno; then +# Check whether --with-zstd was given. +if test ${with_zstd+y} +then : + withval=$with_zstd; OPT_ZSTD=$withval +fi - addld="" - addlib="" - gtlslib="" - version="" - addcflags="" - if test "x$OPT_GNUTLS" = "xyes"; then +if test X"$OPT_ZSTD" != Xno; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then + case "$OPT_ZSTD" in + yes) + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -23562,11 +24106,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23578,11 +24126,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -23591,11 +24139,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -23606,11 +24155,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23622,11 +24175,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -23634,8 +24187,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG @@ -23644,84 +24197,65 @@ else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - fi + fi - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls options with pkg-config" >&5 -$as_echo_n "checking for gnutls options with pkg-config... " >&6; } - itexists=` - if test -n ""; then - PKG_CONFIG_LIBDIR="" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists gnutls >/dev/null 2>&1 && echo 1` + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libzstd options with pkg-config" >&5 +printf %s "checking for libzstd options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libzstd >/dev/null 2>&1 && echo 1` - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi + fi - if test "$PKGCONFIG" != "no" ; then - addlib=`$PKGCONFIG --libs-only-l gnutls` - addld=`$PKGCONFIG --libs-only-L gnutls` - addcflags=`$PKGCONFIG --cflags-only-I gnutls` - version=`$PKGCONFIG --modversion gnutls` - gtlslib=`echo $addld | $SED -e 's/-L//'` - else - check=`libgnutls-config --version 2>/dev/null` - if test -n "$check"; then - addlib=`libgnutls-config --libs` - addcflags=`libgnutls-config --cflags` - version=`libgnutls-config --version` - gtlslib=`libgnutls-config --prefix`/lib$libsuff - fi - fi - else - cfg=$OPT_GNUTLS/bin/libgnutls-config - check=`$cfg --version 2>/dev/null` - if test -n "$check"; then - addlib=`$cfg --libs` - addcflags=`$cfg --cflags` - version=`$cfg --version` - gtlslib=`$cfg --prefix`/lib$libsuff - else - addlib=-lgnutls - addld=-L$OPT_GNUTLS/lib$libsuff - addcflags=-I$OPT_GNUTLS/include - version="" # we just don't know - gtlslib=$OPT_GNUTLS/lib$libsuff + if test "$PKGCONFIG" != "no"; then + LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd` + LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd` + CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd` + version=`$PKGCONFIG --modversion libzstd` + DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'` fi - fi - - if test -z "$version"; then - version="unknown" - fi - if test -n "$addlib"; then + ;; + off) + ;; + *) + PREFIX_ZSTD=$OPT_ZSTD + ;; + esac - CLEANLIBS="$LIBS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLDFLAGS="$LDFLAGS" + if test -n "$PREFIX_ZSTD"; then + LIB_ZSTD="-lzstd" + LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff + CPP_ZSTD=-I${PREFIX_ZSTD}/include + DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff + fi - LIBS="$addlib $LIBS" - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi + LDFLAGS="$LDFLAGS $LD_ZSTD" + LDFLAGSPC="$LDFLAGSPC $LD_ZSTD" + CPPFLAGS="$CPPFLAGS $CPP_ZSTD" + LIBS="$LIB_ZSTD $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_check_version in -lgnutls" >&5 -$as_echo_n "checking for gnutls_check_version in -lgnutls... " >&6; } -if ${ac_cv_lib_gnutls_gnutls_check_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ZSTD_createDStream in -lzstd" >&5 +printf %s "checking for ZSTD_createDStream in -lzstd... " >&6; } +if test ${ac_cv_lib_zstd_ZSTD_createDStream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lgnutls $LIBS" +LIBS="-lzstd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23729,1129 +24263,1416 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char gnutls_check_version (); -int main (void) +char ZSTD_createDStream (); +int main(void) { -return gnutls_check_version (); - ; - return 0; +return ZSTD_createDStream (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gnutls_gnutls_check_version=yes -else - ac_cv_lib_gnutls_gnutls_check_version=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_zstd_ZSTD_createDStream=yes +else $as_nop + ac_cv_lib_zstd_ZSTD_createDStream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_check_version" >&5 -$as_echo "$ac_cv_lib_gnutls_gnutls_check_version" >&6; } -if test "x$ac_cv_lib_gnutls_gnutls_check_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_createDStream" >&5 +printf "%s\n" "$ac_cv_lib_zstd_ZSTD_createDStream" >&6; } +if test "x$ac_cv_lib_zstd_ZSTD_createDStream" = xyes +then : + printf "%s\n" "#define HAVE_LIBZSTD 1" >>confdefs.h + LIBS="-lzstd $LIBS" -$as_echo "#define USE_GNUTLS 1" >>confdefs.h +fi - USE_GNUTLS=1 - GNUTLS_ENABLED=1 - USE_GNUTLS="yes" - ssl_msg="GnuTLS" - test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + for ac_header in zstd.h +do : + ac_fn_c_check_header_compile "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default" +if test "x$ac_cv_header_zstd_h" = xyes +then : + printf "%s\n" "#define HAVE_ZSTD_H 1" >>confdefs.h + curl_zstd_msg="enabled (libzstd)" + HAVE_ZSTD=1 -else +printf "%s\n" "#define HAVE_ZSTD 1" >>confdefs.h - LIBS="$CLEANLIBS" - CPPFLAGS="$CLEANCPPFLAGS" fi +done - if test "x$USE_GNUTLS" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: detected GnuTLS version $version" >&5 -$as_echo "$as_me: detected GnuTLS version $version" >&6;} - - if test -n "$gtlslib"; then - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $gtlslib to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $gtlslib to LD_LIBRARY_PATH" >&6;} - fi - fi - for ac_func in gnutls_certificate_set_x509_key_file2 gnutls_alpn_set_protocols gnutls_ocsp_req_init -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + if test X"$OPT_ZSTD" != Xoff && + test "$HAVE_ZSTD" != "1"; then + as_fn_error $? "libzstd was not found where specified!" "$LINENO" 5 + fi -fi -done + if test "$HAVE_ZSTD" = "1"; then + if test -n "$DIR_ZSTD"; then + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_ZSTD to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_ZSTD to CURL_LIBRARY_PATH" >&6;} fi - fi - + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libzstd" + else + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi -if test "$GNUTLS_ENABLED" = "1"; then - USE_GNUTLS_NETTLE= - # First check if we can detect either crypto library via transitive linking - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_MD5Init in -lgnutls" >&5 -$as_echo_n "checking for nettle_MD5Init in -lgnutls... " >&6; } -if ${ac_cv_lib_gnutls_nettle_MD5Init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgnutls $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable IPv6" >&5 +printf %s "checking whether to enable IPv6... " >&6; } +# Check whether --enable-ipv6 was given. +if test ${enable_ipv6+y} +then : + enableval=$enable_ipv6; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ipv6=no + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ipv6=yes + ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char nettle_MD5Init (); -int main (void) -{ -return nettle_MD5Init (); - ; - return 0; -} + /* are AF_INET6 and sockaddr_in6 available? */ + #include + #ifdef _WIN32 + #include + #include + #else + #include + #include + #ifdef __TANDEM + #include + #endif + #endif + int main(void) + { + int s = (int)sizeof(struct sockaddr_in6); + (void)s; + return socket(AF_INET6, SOCK_STREAM, 0) > 0; + } + + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gnutls_nettle_MD5Init=yes -else - ac_cv_lib_gnutls_nettle_MD5Init=no +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ipv6=yes +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ipv6=no + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_nettle_MD5Init" >&5 -$as_echo "$ac_cv_lib_gnutls_nettle_MD5Init" >&6; } -if test "x$ac_cv_lib_gnutls_nettle_MD5Init" = xyes; then : - USE_GNUTLS_NETTLE=1 + + +if test "$curl_cv_wince" = 'yes'; then + ipv6=no fi - if test "$USE_GNUTLS_NETTLE" = ""; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_control in -lgnutls" >&5 -$as_echo_n "checking for gcry_control in -lgnutls... " >&6; } -if ${ac_cv_lib_gnutls_gcry_control+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgnutls $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test "$ipv6" = yes; then + curl_ipv6_msg="enabled" + +printf "%s\n" "#define USE_IPV6 1" >>confdefs.h + + IPV6_ENABLED=1 + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if struct sockaddr_in6 has sin6_scope_id member" >&5 +printf %s "checking if struct sockaddr_in6 has sin6_scope_id member... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char gcry_control (); -int main (void) + #include + #ifdef _WIN32 + #include + #include + #else + #include + #ifdef __TANDEM + #include + #endif + #endif + +int main(void) { -return gcry_control (); - ; - return 0; + + struct sockaddr_in6 s; + s.sin6_scope_id = 0; + (void)s; + + return 0; } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gnutls_gcry_control=yes -else - ac_cv_lib_gnutls_gcry_control=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h + + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gcry_control" >&5 -$as_echo "$ac_cv_lib_gnutls_gcry_control" >&6; } -if test "x$ac_cv_lib_gnutls_gcry_control" = xyes; then : - USE_GNUTLS_NETTLE=0 +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi - # If not, try linking directly to both of them to see if they are available - if test "$USE_GNUTLS_NETTLE" = ""; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_MD5Init in -lnettle" >&5 -$as_echo_n "checking for nettle_MD5Init in -lnettle... " >&6; } -if ${ac_cv_lib_nettle_nettle_MD5Init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnettle $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if argv can be written to" >&5 +printf %s "checking if argv can be written to... " >&6; } -#ifdef __cplusplus -extern "C" -#endif -char nettle_MD5Init (); -int main (void) + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + curl_cv_writable_argv=cross + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int main(int argc, char **argv) { -return nettle_MD5Init (); - ; - return 0; +#ifdef _WIN32 + /* on Windows, writing to the argv does not hide the argument in + process lists so it can just be skipped */ + (void)argc; + (void)argv; + return 1; +#else + (void)argc; + argv[0][0] = ' '; + return (argv[0][0] == ' ')?0:1; +#endif } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nettle_nettle_MD5Init=yes -else - ac_cv_lib_nettle_nettle_MD5Init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if ac_fn_c_try_run "$LINENO" +then : + curl_cv_writable_argv=yes + +else $as_nop + curl_cv_writable_argv=no + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_MD5Init" >&5 -$as_echo "$ac_cv_lib_nettle_nettle_MD5Init" >&6; } -if test "x$ac_cv_lib_nettle_nettle_MD5Init" = xyes; then : - USE_GNUTLS_NETTLE=1 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi - if test "$USE_GNUTLS_NETTLE" = ""; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_control in -lgcrypt" >&5 -$as_echo_n "checking for gcry_control in -lgcrypt... " >&6; } -if ${ac_cv_lib_gcrypt_gcry_control+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgcrypt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + curl_cv_writable_argv=cross +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char gcry_control (); -int main (void) +int main(int argc, char **argv) { -return gcry_control (); - ; - return 0; +#ifdef _WIN32 + /* on Windows, writing to the argv does not hide the argument in + process lists so it can just be skipped */ + (void)argc; + (void)argv; + return 1; +#else + (void)argc; + argv[0][0] = ' '; + return (argv[0][0] == ' ')?0:1; +#endif } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gcrypt_gcry_control=yes -else - ac_cv_lib_gcrypt_gcry_control=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if ac_fn_c_try_run "$LINENO" +then : + curl_cv_writable_argv=yes + +else $as_nop + curl_cv_writable_argv=no + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_control" >&5 -$as_echo "$ac_cv_lib_gcrypt_gcry_control" >&6; } -if test "x$ac_cv_lib_gcrypt_gcry_control" = xyes; then : - USE_GNUTLS_NETTLE=0 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + LD_LIBRARY_PATH=$old # restore + CC=$oldcc fi - if test "$USE_GNUTLS_NETTLE" = ""; then - as_fn_error $? "GnuTLS found, but neither gcrypt nor nettle found" "$LINENO" 5 - fi - if test "$USE_GNUTLS_NETTLE" = "1"; then -$as_echo "#define USE_GNUTLS_NETTLE 1" >>confdefs.h +if test "$curl_cv_writable_argv" = 'cross' -a "$curl_cv_apple" = 'yes'; then + curl_cv_writable_argv=yes +fi +case $curl_cv_writable_argv in + yes) + +printf "%s\n" "#define HAVE_WRITABLE_ARGV 1" >>confdefs.h - USE_GNUTLS_NETTLE=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: the previous check could not be made default was used" >&5 +printf "%s\n" "$as_me: WARNING: the previous check could not be made default was used" >&2;} + ;; +esac - LIBS="-lnettle $LIBS" - else - LIBS="-lgcrypt $LIBS" - fi -fi -if test "$GNUTLS_ENABLED" = "1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_srp_verifier in -lgnutls" >&5 -$as_echo_n "checking for gnutls_srp_verifier in -lgnutls... " >&6; } -if ${ac_cv_lib_gnutls_gnutls_srp_verifier+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgnutls $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + +GSSAPI_ROOT="/usr" + +# Check whether --with-gssapi-includes was given. +if test ${with_gssapi_includes+y} +then : + withval=$with_gssapi_includes; + GSSAPI_INCS="-I$withval" + want_gss="yes" -#ifdef __cplusplus -extern "C" -#endif -char gnutls_srp_verifier (); -int main (void) -{ -return gnutls_srp_verifier (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gnutls_gnutls_srp_verifier=yes -else - ac_cv_lib_gnutls_gnutls_srp_verifier=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_srp_verifier" >&5 -$as_echo "$ac_cv_lib_gnutls_gnutls_srp_verifier" >&6; } -if test "x$ac_cv_lib_gnutls_gnutls_srp_verifier" = xyes; then : -$as_echo "#define HAVE_GNUTLS_SRP 1" >>confdefs.h - HAVE_GNUTLS_SRP=1 +# Check whether --with-gssapi-libs was given. +if test ${with_gssapi_libs+y} +then : + withval=$with_gssapi_libs; + GSSAPI_LIB_DIR="-L$withval" + want_gss="yes" fi -fi -OPT_POLARSSL=no +# Check whether --with-gssapi was given. +if test ${with_gssapi+y} +then : + withval=$with_gssapi; + GSSAPI_ROOT="$withval" + if test x"$GSSAPI_ROOT" != xno; then + want_gss="yes" + if test x"$GSSAPI_ROOT" = xyes; then + GSSAPI_ROOT="/usr" + fi + fi -_cppflags=$CPPFLAGS -_ldflags=$LDFLAGS -# Check whether --with-polarssl was given. -if test "${with_polarssl+set}" = set; then : - withval=$with_polarssl; OPT_POLARSSL=$withval fi -if test -z "$ssl_backends" -o "x$OPT_POLARSSL" != xno; then - ssl_msg= +: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"} - if test X"$OPT_POLARSSL" != Xno; then +save_CPPFLAGS="$CPPFLAGS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if GSS-API support is requested" >&5 +printf %s "checking if GSS-API support is requested... " >&6; } +if test x"$want_gss" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - if test "$OPT_POLARSSL" = "yes"; then - OPT_POLARSSL="" - fi + if test $GSSAPI_ROOT != "/usr"; then - if test -z "$OPT_POLARSSL" ; then + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for havege_init in -lpolarssl" >&5 -$as_echo_n "checking for havege_init in -lpolarssl... " >&6; } -if ${ac_cv_lib_polarssl_havege_init+:} false; then : - $as_echo_n "(cached) " >&6 + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpolarssl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -#ifdef __cplusplus -extern "C" -#endif -char havege_init (); -int main (void) -{ -return havege_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_polarssl_havege_init=yes -else - ac_cv_lib_polarssl_havege_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_polarssl_havege_init" >&5 -$as_echo "$ac_cv_lib_polarssl_havege_init" >&6; } -if test "x$ac_cv_lib_polarssl_havege_init" = xyes; then : - +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -$as_echo "#define USE_POLARSSL 1" >>confdefs.h + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - USE_POLARSSL=1 + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi - POLARSSL_ENABLED=1 - USE_POLARSSL="yes" - ssl_msg="PolarSSL" - test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + fi -fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mit-krb5-gssapi options with pkg-config" >&5 +printf %s "checking for mit-krb5-gssapi options with pkg-config... " >&6; } + itexists=` + if test -n "$GSSAPI_ROOT/lib/pkgconfig"; then + PKG_CONFIG_LIBDIR="$GSSAPI_ROOT/lib/pkgconfig" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists mit-krb5-gssapi >/dev/null 2>&1 && echo 1` + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi + fi - addld="" - addlib="" - addcflags="" - polarssllib="" - - if test "x$USE_POLARSSL" != "xyes"; then - addld=-L$OPT_POLARSSL/lib$libsuff - addcflags=-I$OPT_POLARSSL/include - polarssllib=$OPT_POLARSSL/lib$libsuff + else - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssl_init in -lpolarssl" >&5 -$as_echo_n "checking for ssl_init in -lpolarssl... " >&6; } -if ${ac_cv_lib_polarssl_ssl_init+:} false; then : - $as_echo_n "(cached) " >&6 + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpolarssl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -#ifdef __cplusplus -extern "C" -#endif -char ssl_init (); -int main (void) -{ -return ssl_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_polarssl_ssl_init=yes +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - ac_cv_lib_polarssl_ssl_init=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_polarssl_ssl_init" >&5 -$as_echo "$ac_cv_lib_polarssl_ssl_init" >&6; } -if test "x$ac_cv_lib_polarssl_ssl_init" = xyes; then : + fi -$as_echo "#define USE_POLARSSL 1" >>confdefs.h + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mit-krb5-gssapi options with pkg-config" >&5 +printf %s "checking for mit-krb5-gssapi options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists mit-krb5-gssapi >/dev/null 2>&1 && echo 1` - USE_POLARSSL=1 + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - POLARSSL_ENABLED=1 - USE_POLARSSL="yes" - ssl_msg="PolarSSL" - test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + fi + if test -z "$GSSAPI_INCS"; then + if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then + GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` + elif test "$PKGCONFIG" != "no"; then + GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi` + elif test -f "$KRB5CONFIG"; then + GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` + elif test "$GSSAPI_ROOT" != "yes"; then + GSSAPI_INCS="-I$GSSAPI_ROOT/include" + fi + fi -else + CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags + ac_fn_c_check_header_compile "$LINENO" "gss.h" "ac_cv_header_gss_h" "$ac_includes_default" +if test "x$ac_cv_header_gss_h" = xyes +then : -fi - fi +printf "%s\n" "#define HAVE_GSSGNU 1" >>confdefs.h - if test "x$USE_POLARSSL" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: detected PolarSSL" >&5 -$as_echo "$as_me: detected PolarSSL" >&6;} + gnu_gss=yes - LIBS="-lpolarssl $LIBS" +else $as_nop - if test -n "$polarssllib"; then - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $polarssllib to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $polarssllib to LD_LIBRARY_PATH" >&6;} - fi - fi - fi + for ac_header in gssapi/gssapi.h +do : + ac_fn_c_check_header_compile "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" +if test "x$ac_cv_header_gssapi_gssapi_h" = xyes +then : + printf "%s\n" "#define HAVE_GSSAPI_GSSAPI_H 1" >>confdefs.h - fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" +else $as_nop + not_mit=1 fi +done + for ac_header in gssapi/gssapi_generic.h gssapi/gssapi_krb5.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " + $ac_includes_default + #ifdef HAVE_GSSAPI_GSSAPI_H + #include + #endif -OPT_MBEDTLS=no - -_cppflags=$CPPFLAGS -_ldflags=$LDFLAGS +" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -# Check whether --with-mbedtls was given. -if test "${with_mbedtls+set}" = set; then : - withval=$with_mbedtls; OPT_MBEDTLS=$withval +else $as_nop + not_mit=1 fi +done + if test "x$not_mit" = "x1"; then + ac_fn_c_check_header_compile "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default" +if test "x$ac_cv_header_gssapi_h" = xyes +then : -if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then - ssl_msg= +else $as_nop - if test X"$OPT_MBEDTLS" != Xno; then + want_gss=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: disabling GSS-API support since no header files were found" >&5 +printf "%s\n" "$as_me: WARNING: disabling GSS-API support since no header files were found" >&2;} - if test "$OPT_MBEDTLS" = "yes"; then - OPT_MBEDTLS="" - fi - if test -z "$OPT_MBEDTLS" ; then +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbedtls_havege_init in -lmbedtls" >&5 -$as_echo_n "checking for mbedtls_havege_init in -lmbedtls... " >&6; } -if ${ac_cv_lib_mbedtls_mbedtls_havege_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE" >&5 +printf %s "checking if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char mbedtls_havege_init (); -int main (void) + #include + #include + #include + +int main(void) { -return mbedtls_havege_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mbedtls_mbedtls_havege_init=yes -else - ac_cv_lib_mbedtls_mbedtls_havege_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mbedtls_mbedtls_havege_init" >&5 -$as_echo "$ac_cv_lib_mbedtls_mbedtls_havege_init" >&6; } -if test "x$ac_cv_lib_mbedtls_mbedtls_havege_init" = xyes; then : + gss_import_name( + (OM_uint32 *)0, + (gss_buffer_t)0, + GSS_C_NT_HOSTBASED_SERVICE, + (gss_name_t *)0); -$as_echo "#define USE_MBEDTLS 1" >>confdefs.h + return 0; +} - USE_MBEDTLS=1 +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : - MBEDTLS_ENABLED=1 - USE_MBEDTLS="yes" - ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -fi +else $as_nop - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - addld="" - addlib="" - addcflags="" - mbedtlslib="" +printf "%s\n" "#define HAVE_OLD_GSSMIT 1" >>confdefs.h - if test "x$USE_MBEDTLS" != "xyes"; then - addld=-L$OPT_MBEDTLS/lib$libsuff - addcflags=-I$OPT_MBEDTLS/include - mbedtlslib=$OPT_MBEDTLS/lib$libsuff - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbedtls_ssl_init in -lmbedtls" >&5 -$as_echo_n "checking for mbedtls_ssl_init in -lmbedtls... " >&6; } -if ${ac_cv_lib_mbedtls_mbedtls_ssl_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi -#ifdef __cplusplus -extern "C" -#endif -char mbedtls_ssl_init (); -int main (void) -{ -return mbedtls_ssl_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mbedtls_mbedtls_ssl_init=yes else - ac_cv_lib_mbedtls_mbedtls_ssl_init=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mbedtls_mbedtls_ssl_init" >&5 -$as_echo "$ac_cv_lib_mbedtls_mbedtls_ssl_init" >&6; } -if test "x$ac_cv_lib_mbedtls_mbedtls_ssl_init" = xyes; then : +if test x"$want_gss" = xyes; then +printf "%s\n" "#define HAVE_GSSAPI 1" >>confdefs.h -$as_echo "#define USE_MBEDTLS 1" >>confdefs.h + HAVE_GSSAPI=1 + curl_gss_msg="enabled (MIT Kerberos/Heimdal)" + link_pkgconfig='' - USE_MBEDTLS=1 + if test -n "$gnu_gss"; then + curl_gss_msg="enabled (GNU GSS)" + LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" + LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR" + LIBS="-lgss $LIBS" + link_pkgconfig=1 + elif test -z "$GSSAPI_LIB_DIR"; then + if test "$curl_cv_apple" = 'yes'; then + LIBS="-lgssapi_krb5 -lresolv $LIBS" + else + if test $GSSAPI_ROOT != "/usr"; then - MBEDTLS_ENABLED=1 - USE_MBEDTLS="yes" - ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - fi + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - if test "x$USE_MBEDTLS" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: detected mbedTLS" >&5 -$as_echo "$as_me: detected mbedTLS" >&6;} + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi - LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" + fi - if test -n "$mbedtlslib"; then - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mbedtlslib" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $mbedtlslib to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $mbedtlslib to LD_LIBRARY_PATH" >&6;} - fi - fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mit-krb5-gssapi options with pkg-config" >&5 +printf %s "checking for mit-krb5-gssapi options with pkg-config... " >&6; } + itexists=` + if test -n "$GSSAPI_ROOT/lib/pkgconfig"; then + PKG_CONFIG_LIBDIR="$GSSAPI_ROOT/lib/pkgconfig" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists mit-krb5-gssapi >/dev/null 2>&1 && echo 1` + + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi + fi + + else + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -OPT_CYASSL=no +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -_cppflags=$CPPFLAGS -_ldflags=$LDFLAGS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -# Check whether --with-cyassl was given. -if test "${with_cyassl+set}" = set; then : - withval=$with_cyassl; OPT_CYASSL=$withval + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi + fi -if test -z "$ssl_backends" -o "x$OPT_CYASSL" != xno; then - ssl_msg= - - if test X"$OPT_CYASSL" != Xno; then + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mit-krb5-gssapi options with pkg-config" >&5 +printf %s "checking for mit-krb5-gssapi options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists mit-krb5-gssapi >/dev/null 2>&1 && echo 1` - if test "$OPT_CYASSL" = "yes"; then - OPT_CYASSL="" + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi + fi + fi + if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then + gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` + LIBS="$gss_libs $LIBS" + elif test "$PKGCONFIG" != "no"; then + gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi` + LIBS="$gss_libs $LIBS" + link_pkgconfig=1 + elif test -f "$KRB5CONFIG"; then + gss_libs=`$KRB5CONFIG --libs gssapi` + LIBS="$gss_libs $LIBS" + link_pkgconfig=1 + else + case $host in + *-hp-hpux*) + gss_libname="gss" + ;; + *) + gss_libname="gssapi" + ;; + esac - cyassllibname=cyassl - - if test -z "$OPT_CYASSL" ; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CyaSSL_Init in -lcyassl" >&5 -$as_echo_n "checking for CyaSSL_Init in -lcyassl... " >&6; } -if ${ac_cv_lib_cyassl_CyaSSL_Init+:} false; then : - $as_echo_n "(cached) " >&6 + if test "$GSSAPI_ROOT" != "yes"; then + LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" + LDFLAGSPC="$LDFLAGSPC -L$GSSAPI_ROOT/lib$libsuff" + LIBS="-l$gss_libname $LIBS" + else + LIBS="-l$gss_libname $LIBS" + fi + fi + fi + else + LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" + LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR" + case $host in + *-hp-hpux*) + LIBS="-lgss $LIBS" + ;; + *) + LIBS="-lgssapi $LIBS" + ;; + esac + fi + if test -n "$link_pkgconfig"; then + if test -n "$gnu_gss"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gss" + elif test "x$not_mit" = "x1"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE heimdal-gssapi" + else + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mit-krb5-gssapi" + fi + fi else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcyassl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" +fi + +if test x"$want_gss" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can link against GSS-API library" >&5 +printf %s "checking if we can link against GSS-API library... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#define gss_init_sec_context innocuous_gss_init_sec_context +#ifdef __STDC__ +# include +#else +# include +#endif +#undef gss_init_sec_context #ifdef __cplusplus extern "C" #endif -char CyaSSL_Init (); -int main (void) +char gss_init_sec_context (); +#if defined __stub_gss_init_sec_context || defined __stub___gss_init_sec_context +#error force compilation error +#endif + +int main(void) { -return CyaSSL_Init (); - ; - return 0; +return gss_init_sec_context (); + return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_cyassl_CyaSSL_Init=yes -else - ac_cv_lib_cyassl_CyaSSL_Init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cyassl_CyaSSL_Init" >&5 -$as_echo "$ac_cv_lib_cyassl_CyaSSL_Init" >&6; } -if test "x$ac_cv_lib_cyassl_CyaSSL_Init" = xyes; then : +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : -$as_echo "#define USE_CYASSL 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - USE_CYASSL=1 +else $as_nop - CYASSL_ENABLED=1 - USE_CYASSL="yes" - ssl_msg="CyaSSL" - test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "--with-gssapi was specified, but a GSS-API library was not found." "$LINENO" 5 fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi - fi - - addld="" - addlib="" - addcflags="" - cyassllib="" - - if test "x$USE_CYASSL" != "xyes"; then - addld=-L$OPT_CYASSL/lib$libsuff - addcflags=-I$OPT_CYASSL/include - cyassllib=$OPT_CYASSL/lib$libsuff - - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CyaSSL_Init in -lcyassl" >&5 -$as_echo_n "checking for CyaSSL_Init in -lcyassl... " >&6; } -if ${ac_cv_lib_cyassl_CyaSSL_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcyassl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +build_libstubgss=no +if test x"$want_gss" = "xyes"; then + build_libstubgss=yes +fi -#ifdef __cplusplus -extern "C" -#endif -char CyaSSL_Init (); -int main (void) -{ -return CyaSSL_Init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_cyassl_CyaSSL_Init=yes + if test "x$build_libstubgss" = "xyes"; then + BUILD_STUB_GSS_TRUE= + BUILD_STUB_GSS_FALSE='#' else - ac_cv_lib_cyassl_CyaSSL_Init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + BUILD_STUB_GSS_TRUE='#' + BUILD_STUB_GSS_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cyassl_CyaSSL_Init" >&5 -$as_echo "$ac_cv_lib_cyassl_CyaSSL_Init" >&6; } -if test "x$ac_cv_lib_cyassl_CyaSSL_Init" = xyes; then : -$as_echo "#define USE_CYASSL 1" >>confdefs.h - USE_CYASSL=1 +DEFAULT_SSL_BACKEND=no +VALID_DEFAULT_SSL_BACKEND= - CYASSL_ENABLED=1 - USE_CYASSL="yes" - ssl_msg="CyaSSL" - test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes +# Check whether --with-default-ssl-backend was given. +if test ${with_default_ssl_backend+y} +then : + withval=$with_default_ssl_backend; DEFAULT_SSL_BACKEND=$withval +fi -else +case "$DEFAULT_SSL_BACKEND" in + no) + ;; + default|yes) + as_fn_error $? "The name of the default SSL backend is required." "$LINENO" 5 + ;; + *) + VALID_DEFAULT_SSL_BACKEND=no + ;; +esac - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - cyassllib="" -fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable Windows native SSL/TLS" >&5 +printf %s "checking whether to enable Windows native SSL/TLS... " >&6; } +if test "x$OPT_SCHANNEL" != xno; then + ssl_msg= + if test "x$OPT_SCHANNEL" != "xno" && + test "x$curl_cv_native_windows" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - fi +printf "%s\n" "#define USE_SCHANNEL 1" >>confdefs.h - addld="" - addlib="" - addcflags="" + ssl_msg="Schannel" + test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + SCHANNEL_ENABLED=1 + # --with-schannel implies --enable-sspi - if test "x$USE_CYASSL" != "xyes"; then - addld=-L$OPT_CYASSL/lib$libsuff - addcflags=-I$OPT_CYASSL/include - cyassllib=$OPT_CYASSL/lib$libsuff +printf "%s\n" "#define USE_WINDOWS_SSPI 1" >>confdefs.h - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi + USE_WINDOWS_SSPI=1 + curl_sspi_msg="enabled" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - cyassllibname=wolfssl - my_ac_save_LIBS="$LIBS" - LIBS="-l$cyassllibname -lm $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CyaSSL_Init in -lwolfssl" >&5 -$as_echo_n "checking for CyaSSL_Init in -lwolfssl... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable Amiga native SSL/TLS (AmiSSL v5)" >&5 +printf %s "checking whether to enable Amiga native SSL/TLS (AmiSSL v5)... " >&6; } +if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then + if test "x$OPT_AMISSL" != xno; then + ssl_msg= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* These aren't needed for detection and confuse WolfSSL. - They are set up properly later if it is detected. */ -#undef SIZEOF_LONG -#undef SIZEOF_LONG_LONG -#include + #include + #include -int main (void) +int main(void) { - return CyaSSL_Init(); + #if defined(AMISSL_CURRENT_VERSION) && defined(AMISSL_V3xx) && \ + (OPENSSL_VERSION_NUMBER >= 0x30000000L) && \ + defined(PROTO_AMISSL_H) + return 0; + #else + #error not AmiSSL v5 / OpenSSL 3 + #endif - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define USE_CYASSL 1" >>confdefs.h - - USE_CYASSL=1 +if ac_fn_c_try_compile "$LINENO" +then : - CYASSL_ENABLED=1 - USE_CYASSL="yes" - ssl_msg="WolfSSL" - test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ssl_msg="AmiSSL" + test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + AMISSL_ENABLED=1 + OPENSSL_ENABLED=1 + # Use AmiSSL's built-in ca bundle + check_for_ca_bundle=1 + with_ca_fallback=yes + LIBS="-lamisslstubs -lamisslauto $LIBS" + CURL_NETWORK_AND_TIME_LIBS="-lamisslstubs -lamisslauto $CURL_NETWORK_AND_TIME_LIBS" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - cyassllib="" +printf "%s\n" "#define USE_AMISSL 1" >>confdefs.h -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$my_ac_save_LIBS" - fi - if test "x$USE_CYASSL" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: detected $cyassllibname" >&5 -$as_echo "$as_me: detected $cyassllibname" >&6;} +printf "%s\n" "#define USE_OPENSSL 1" >>confdefs.h - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + ac_fn_c_check_header_compile "$LINENO" "openssl/x509.h" "ac_cv_header_openssl_x509_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_x509_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_X509_H 1" >>confdefs.h -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long=0 - fi fi +ac_fn_c_check_header_compile "$LINENO" "openssl/rsa.h" "ac_cv_header_openssl_rsa_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_rsa_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_RSA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - - - for ac_header in cyassl/options.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "cyassl/options.h" "ac_cv_header_cyassl_options_h" "$ac_includes_default" -if test "x$ac_cv_header_cyassl_options_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CYASSL_OPTIONS_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "openssl/crypto.h" "ac_cv_header_openssl_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_crypto_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_CRYPTO_H 1" >>confdefs.h fi - -done - - - for ac_header in cyassl/error-ssl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "cyassl/error-ssl.h" "ac_cv_header_cyassl_error_ssl_h" "$ac_includes_default" -if test "x$ac_cv_header_cyassl_error_ssl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CYASSL_ERROR_SSL_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "openssl/pem.h" "ac_cv_header_openssl_pem_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_pem_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_PEM_H 1" >>confdefs.h fi - -done - - - LIBS="-l$cyassllibname -lm $LIBS" - - if test "x$cyassllibname" = "xwolfssl"; then - for ac_func in wolfSSLv3_client_method \ - wolfSSL_CTX_UseSupportedCurve \ - wolfSSL_get_peer_certificate \ - wolfSSL_UseALPN -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ssl_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_SSL_H 1" >>confdefs.h fi -done - - else - for ac_func in CyaSSL_CTX_UseSupportedCurve \ - CyaSSL_get_peer_certificate -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_err_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_ERR_H 1" >>confdefs.h fi -done - fi - if test -n "$cyassllib"; then - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $cyassllib to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $cyassllib to LD_LIBRARY_PATH" >&6;} - fi - fi +else $as_nop - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -OPT_NSS=no - -# Check whether --with-nss was given. -if test "${with_nss+set}" = set; then : - withval=$with_nss; OPT_NSS=$withval -fi - - -if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then +if test "x$OPT_OPENSSL" != xno; then ssl_msg= - if test X"$OPT_NSS" != Xno; then - - addld="" - addlib="" - addcflags="" - nssprefix="" - version="" - - if test "x$OPT_NSS" = "xyes"; then - - - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKGCONFIG=$ac_cv_path_PKGCONFIG -if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + case $host in + *-*-msys* | *-*-mingw*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gdi32" >&5 +printf %s "checking for gdi32... " >&6; } + my_ac_save_LIBS=$LIBS + LIBS="-lgdi32 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -if test -z "$ac_cv_path_PKGCONFIG"; then - ac_pt_PKGCONFIG=$PKGCONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include - ;; -esac -fi -ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG -if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +int main(void) +{ - if test "x$ac_pt_PKGCONFIG" = x; then - PKGCONFIG="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKGCONFIG=$ac_pt_PKGCONFIG - fi -else - PKGCONFIG="$ac_cv_path_PKGCONFIG" -fi + GdiFlush(); - fi + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + LIBS=$my_ac_save_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nss options with pkg-config" >&5 -$as_echo_n "checking for nss options with pkg-config... " >&6; } - itexists=` - if test -n ""; then - PKG_CONFIG_LIBDIR="" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists nss >/dev/null 2>&1 && echo 1` +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; + esac - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi - fi + case "$OPT_OPENSSL" in + yes) + PKGTEST="yes" + PREFIX_OPENSSL= + ;; + *) + PKGTEST="no" + PREFIX_OPENSSL=$OPT_OPENSSL + OPENSSL_PCDIR="$OPT_OPENSSL/lib/pkgconfig" + if test -f "$OPENSSL_PCDIR/openssl.pc"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&5 +printf "%s\n" "$as_me: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&6;} + PKGTEST="yes" + fi - if test "$PKGCONFIG" != "no" ; then - addlib=`$PKGCONFIG --libs nss` - addcflags=`$PKGCONFIG --cflags nss` - version=`$PKGCONFIG --modversion nss` - nssprefix=`$PKGCONFIG --variable=prefix nss` - else + if test "$PKGTEST" != "yes"; then + # try lib64 instead + OPENSSL_PCDIR="$OPT_OPENSSL/lib64/pkgconfig" + if test -f "$OPENSSL_PCDIR/openssl.pc"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&5 +printf "%s\n" "$as_me: PKG_CONFIG_LIBDIR will be set to \"$OPENSSL_PCDIR\"" >&6;} + PKGTEST="yes" + fi + fi - check=`nss-config --version 2>/dev/null` - if test -n "$check"; then - addlib=`nss-config --libs` - addcflags=`nss-config --cflags` - version=`nss-config --version` - nssprefix=`nss-config --prefix` - else - addlib="-lnss3" - addcflags="" - version="unknown" + if test "$PKGTEST" != "yes"; then + if test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then + as_fn_error $? "$PREFIX_OPENSSL is a bad --with-openssl prefix!" "$LINENO" 5 fi fi - else - NSS_PCDIR="$OPT_NSS/lib/pkgconfig" - if test -f "$NSS_PCDIR/nss.pc"; then - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then + LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" + if test "$PREFIX_OPENSSL" != "/usr" ; then + SSL_LDFLAGS="-L$LIB_OPENSSL" + SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" + fi + ;; + esac + + if test "$PKGTEST" = "yes"; then + + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -24862,11 +25683,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -24878,11 +25703,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -24891,11 +25716,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -24906,11 +25732,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -24922,11 +25752,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -24934,8 +25764,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG @@ -24944,91 +25774,76 @@ else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - fi + fi - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nss options with pkg-config" >&5 -$as_echo_n "checking for nss options with pkg-config... " >&6; } - itexists=` - if test -n "$NSS_PCDIR"; then - PKG_CONFIG_LIBDIR="$NSS_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists nss >/dev/null 2>&1 && echo 1` + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl options with pkg-config" >&5 +printf %s "checking for openssl options with pkg-config... " >&6; } + itexists=` + if test -n "$OPENSSL_PCDIR"; then + PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists openssl >/dev/null 2>&1 && echo 1` - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi + fi - if test "$PKGCONFIG" != "no" ; then - addld=` - if test -n "$NSS_PCDIR"; then - PKG_CONFIG_LIBDIR="$NSS_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-L nss` - addlib=` - if test -n "$NSS_PCDIR"; then - PKG_CONFIG_LIBDIR="$NSS_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-l nss` - addcflags=` - if test -n "$NSS_PCDIR"; then - PKG_CONFIG_LIBDIR="$NSS_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --cflags nss` - version=` - if test -n "$NSS_PCDIR"; then - PKG_CONFIG_LIBDIR="$NSS_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --modversion nss` - nssprefix=` - if test -n "$NSS_PCDIR"; then - PKG_CONFIG_LIBDIR="$NSS_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --variable=prefix nss` - fi - fi - fi - if test -z "$addlib"; then - # Without pkg-config, we'll kludge in some defaults - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired libraries and compilation flags for NSS." >&5 -$as_echo "$as_me: WARNING: Using hard-wired libraries and compilation flags for NSS." >&2;} - addld="-L$OPT_NSS/lib" - addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4" - addcflags="-I$OPT_NSS/include" - version="unknown" - nssprefix=$OPT_NSS - fi + if test "$PKGCONFIG" != "no" ; then + SSL_LIBS=` + if test -n "$OPENSSL_PCDIR"; then + PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-l --libs-only-other openssl 2>/dev/null` - CLEANLDFLAGS="$LDFLAGS" - CLEANLIBS="$LIBS" - CLEANCPPFLAGS="$CPPFLAGS" + SSL_LDFLAGS=` + if test -n "$OPENSSL_PCDIR"; then + PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-L openssl 2>/dev/null` + + SSL_CPPFLAGS=` + if test -n "$OPENSSL_PCDIR"; then + PKG_CONFIG_LIBDIR="$OPENSSL_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I openssl 2>/dev/null` + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&5 +printf "%s\n" "$as_me: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&6;} + + LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/^-L//'` - LDFLAGS="$addld $LDFLAGS" - LIBS="$addlib $LIBS" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" + LIBS="$SSL_LIBS $LIBS" fi + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_VersionRangeSet in -lnss3" >&5 -$as_echo_n "checking for SSL_VersionRangeSet in -lnss3... " >&6; } -if ${ac_cv_lib_nss3_SSL_VersionRangeSet+:} false; then : - $as_echo_n "(cached) " >&6 -else + CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" + LDFLAGS="$LDFLAGS $SSL_LDFLAGS" + LDFLAGSPC="$LDFLAGSPC $SSL_LDFLAGS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HMAC_Update in -lcrypto" >&5 +printf %s "checking for HMAC_Update in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_HMAC_Update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lnss3 $LIBS" +LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25036,106 +25851,171 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char SSL_VersionRangeSet (); -int main (void) +char HMAC_Update (); +int main(void) { -return SSL_VersionRangeSet (); - ; - return 0; +return HMAC_Update (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nss3_SSL_VersionRangeSet=yes -else - ac_cv_lib_nss3_SSL_VersionRangeSet=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_HMAC_Update=yes +else $as_nop + ac_cv_lib_crypto_HMAC_Update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_SSL_VersionRangeSet" >&5 -$as_echo "$ac_cv_lib_nss3_SSL_VersionRangeSet" >&6; } -if test "x$ac_cv_lib_nss3_SSL_VersionRangeSet" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_HMAC_Update" >&5 +printf "%s\n" "$ac_cv_lib_crypto_HMAC_Update" >&6; } +if test "x$ac_cv_lib_crypto_HMAC_Update" = xyes +then : + + HAVECRYPTO="yes" + LIBS="-lcrypto $LIBS" + +else $as_nop + + if test -n "$LIB_OPENSSL" ; then + LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" + LDFLAGSPC="$CLEANLDFLAGSPC -L$LIB_OPENSSL" + fi + if test "$PKGCONFIG" = "no" -a -n "$PREFIX_OPENSSL" ; then + # only set this if pkg-config wasn't used + CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include" + fi + # Linking previously failed, try extra paths from --with-openssl or + # pkg-config. Use a different function name to avoid reusing the earlier + # cached result. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HMAC_Init_ex in -lcrypto" >&5 +printf %s "checking for HMAC_Init_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_HMAC_Init_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -$as_echo "#define USE_NSS 1" >>confdefs.h +#ifdef __cplusplus +extern "C" +#endif +char HMAC_Init_ex (); +int main(void) +{ +return HMAC_Init_ex (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_HMAC_Init_ex=yes +else $as_nop + ac_cv_lib_crypto_HMAC_Init_ex=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_HMAC_Init_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_HMAC_Init_ex" >&6; } +if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes +then : - USE_NSS=1 + HAVECRYPTO="yes" + LIBS="-lcrypto $LIBS" +else $as_nop - USE_NSS="yes" - NSS_ENABLED=1 - ssl_msg="NSS" - test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking OpenSSL linking with -ldl" >&5 +printf %s "checking OpenSSL linking with -ldl... " >&6; } + LIBS="-lcrypto $CLEANLIBS -ldl" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - LDFLAGS="$CLEANLDFLAGS" - LIBS="$CLEANLIBS" - CPPFLAGS="$CLEANCPPFLAGS" + #include -fi +int main(void) +{ + ERR_clear_error(); - if test "x$USE_NSS" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: detected NSS version $version" >&5 -$as_echo "$as_me: detected NSS version $version" >&6;} + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : - NSS_LIBS=$addlib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVECRYPTO="yes" +else $as_nop - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH" >&6;} - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - fi - fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking OpenSSL linking with -ldl and -lpthread" >&5 +printf %s "checking OpenSSL linking with -ldl and -lpthread... " >&6; } + LIBS="-lcrypto $CLEANLIBS -ldl -lpthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + +int main(void) +{ + + ERR_clear_error(); -OPT_AXTLS=off + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + HAVECRYPTO="yes" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + LDFLAGS="$CLEANLDFLAGS" + LDFLAGSPC="$CLEANLDFLAGSPC" + CPPFLAGS="$CLEANCPPFLAGS" + LIBS="$CLEANLIBS" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext -# Check whether --with-axtls was given. -if test "${with_axtls+set}" = set; then : - withval=$with_axtls; OPT_AXTLS=$withval fi -if test -z "$ssl_backends" -o "x$OPT_AXTLS" != xno; then - ssl_msg= - if test X"$OPT_AXTLS" != Xno; then - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" +fi - case "$OPT_AXTLS" in - yes) - PREFIX_AXTLS=/usr/local - LIB_AXTLS="$PREFIX_AXTLS/lib" - LDFLAGS="$LDFLAGS -L$LIB_AXTLS" - CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" - ;; - off) - PREFIX_AXTLS= - ;; - *) - PREFIX_AXTLS=$OPT_AXTLS - LIB_AXTLS="$PREFIX_AXTLS/lib" - LDFLAGS="$LDFLAGS -L$LIB_AXTLS" - CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssl_version in -laxtls" >&5 -$as_echo_n "checking for ssl_version in -laxtls... " >&6; } -if ${ac_cv_lib_axtls_ssl_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test X"$HAVECRYPTO" = X"yes"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 +printf %s "checking for SSL_connect in -lssl... " >&6; } +if test ${ac_cv_lib_ssl_SSL_connect+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-laxtls $LIBS" +LIBS="-lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25143,517 +26023,447 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char ssl_version (); -int main (void) +char SSL_connect (); +int main(void) { -return ssl_version (); - ; - return 0; +return SSL_connect (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_axtls_ssl_version=yes -else - ac_cv_lib_axtls_ssl_version=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ssl_SSL_connect=yes +else $as_nop + ac_cv_lib_ssl_SSL_connect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_axtls_ssl_version" >&5 -$as_echo "$ac_cv_lib_axtls_ssl_version" >&6; } -if test "x$ac_cv_lib_axtls_ssl_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 +printf "%s\n" "$ac_cv_lib_ssl_SSL_connect" >&6; } +if test "x$ac_cv_lib_ssl_SSL_connect" = xyes +then : + printf "%s\n" "#define HAVE_LIBSSL 1" >>confdefs.h + + LIBS="-lssl $LIBS" - LIBS="-laxtls $LIBS" +fi -$as_echo "#define USE_AXTLS 1" >>confdefs.h - USE_AXTLS=1 + if test "$ac_cv_lib_ssl_SSL_connect" != yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssl with RSAglue/rsaref libs in use" >&5 +printf %s "checking for ssl with RSAglue/rsaref libs in use... " >&6; }; + OLIBS=$LIBS + LIBS="-lRSAglue -lrsaref $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 +printf %s "checking for SSL_connect in -lssl... " >&6; } +if test ${ac_cv_lib_ssl_SSL_connect+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - AXTLS_ENABLED=1 - USE_AXTLS="yes" - ssl_msg="axTLS" - test axtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $LIB_AXTLS to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $LIB_AXTLS to LD_LIBRARY_PATH" >&6;} +#ifdef __cplusplus +extern "C" +#endif +char SSL_connect (); +int main(void) +{ +return SSL_connect (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ssl_SSL_connect=yes +else $as_nop + ac_cv_lib_ssl_SSL_connect=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 +printf "%s\n" "$ac_cv_lib_ssl_SSL_connect" >&6; } +if test "x$ac_cv_lib_ssl_SSL_connect" = xyes +then : + printf "%s\n" "#define HAVE_LIBSSL 1" >>confdefs.h + + LIBS="-lssl $LIBS" + +fi + + if test "$ac_cv_lib_ssl_SSL_connect" != yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + LIBS=$OLIBS + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -else + else - LDFLAGS="$CLEANLDFLAGS" - CPPFLAGS="$CLEANCPPFLAGS" - LIBS="$CLEANLIBS" + for ac_header in openssl/x509.h openssl/rsa.h openssl/crypto.h openssl/pem.h openssl/ssl.h openssl/err.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + ssl_msg="OpenSSL" + test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + OPENSSL_ENABLED=1 + +printf "%s\n" "#define USE_OPENSSL 1" >>confdefs.h fi +done + fi + + if test X"$OPENSSL_ENABLED" != X"1"; then + LIBS="$CLEANLIBS" + fi + + if test X"$OPT_OPENSSL" != Xoff && + test "$OPENSSL_ENABLED" != "1"; then + as_fn_error $? "OpenSSL libs and/or directories were not found where specified!" "$LINENO" 5 + fi fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -fi -case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$MBEDTLS_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" in -x) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more." >&5 -$as_echo "$as_me: WARNING: SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this." >&5 -$as_echo "$as_me: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this." >&2;} - ;; -x1) - # one SSL backend is enabled + if test X"$OPENSSL_ENABLED" = X"1"; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BoringSSL" >&5 +printf %s "checking for BoringSSL... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - SSL_ENABLED="1" - { $as_echo "$as_me:${as_lineno-$LINENO}: built with one SSL backend" >&5 -$as_echo "$as_me: built with one SSL backend" >&6;} - ;; -*) - # more than one SSL backend is enabled - SSL_ENABLED="1" + #include - CURL_WITH_MULTI_SSL="1" +int main(void) +{ -$as_echo "#define CURL_WITH_MULTI_SSL 1" >>confdefs.h + #ifndef OPENSSL_IS_BORINGSSL + #error not boringssl + #endif - { $as_echo "$as_me:${as_lineno-$LINENO}: built with multiple SSL backends" >&5 -$as_echo "$as_me: built with multiple SSL backends" >&6;} - ;; -esac + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ssl_msg="BoringSSL" + OPENSSL_IS_BORINGSSL=1 + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -if test -n "$ssl_backends"; then - curl_ssl_msg="enabled ($ssl_backends)" fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -if test no = "$VALID_DEFAULT_SSL_BACKEND" -then - if test -n "$SSL_ENABLED" - then - as_fn_error $? "Default SSL backend $DEFAULT_SSL_BACKEND not enabled!" "$LINENO" 5 - else - as_fn_error $? "Default SSL backend requires SSL!" "$LINENO" 5 - fi -elif test yes = "$VALID_DEFAULT_SSL_BACKEND" -then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AWS-LC" >&5 +printf %s "checking for AWS-LC... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + +int main(void) +{ + + #ifndef OPENSSL_IS_AWSLC + #error not AWS-LC + #endif + + return 0; +} -cat >>confdefs.h <<_ACEOF -#define CURL_DEFAULT_SSL_BACKEND "$DEFAULT_SSL_BACKEND" _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ssl_msg="AWS-LC" + OPENSSL_IS_BORINGSSL=1 + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LibreSSL" >&5 +printf %s "checking for LibreSSL... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking default CA cert bundle/path" >&5 -$as_echo_n "checking default CA cert bundle/path... " >&6; } + #include -# Check whether --with-ca-bundle was given. -if test "${with_ca_bundle+set}" = set; then : - withval=$with_ca_bundle; - want_ca="$withval" - if test "x$want_ca" = "xyes"; then - as_fn_error $? "--with-ca-bundle=FILE requires a path to the CA bundle" "$LINENO" 5 - fi +int main(void) +{ -else - want_ca="unset" -fi + int dummy = LIBRESSL_VERSION_NUMBER; + (void)dummy; + return 0; +} -# Check whether --with-ca-path was given. -if test "${with_ca_path+set}" = set; then : - withval=$with_ca_path; - want_capath="$withval" - if test "x$want_capath" = "xyes"; then - as_fn_error $? "--with-ca-path=DIRECTORY requires a path to the CA path directory" "$LINENO" 5 - fi +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -else - want_capath="unset" -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ssl_msg="LibreSSL" +else $as_nop - ca_warning=" (warning: certs not found)" - capath_warning=" (warning: certs not found)" - check_capath="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \ - "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then - ca="$want_ca" - capath="$want_capath" - elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then - ca="$want_ca" - capath="no" - elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then - if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then - as_fn_error $? "--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL" "$LINENO" 5 - fi - capath="$want_capath" - ca="no" - else - ca="no" - capath="no" - if test "x$cross_compiling" != "xyes"; then - if test "x$want_ca" = "xunset"; then - if test "x$prefix" != xNONE; then - cac="${prefix}/share/curl/curl-ca-bundle.crt" - else - cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt" - fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - for a in /etc/ssl/certs/ca-certificates.crt \ - /etc/pki/tls/certs/ca-bundle.crt \ - /usr/share/ssl/certs/ca-bundle.crt \ - /usr/local/share/certs/ca-root-nss.crt \ - /etc/ssl/cert.pem \ - "$cac"; do - if test -f "$a"; then - ca="$a" - break - fi - done - fi - if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \ - "x$OPENSSL_ENABLED" = "x1"; then - check_capath="/etc/ssl/certs/" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: skipped the ca-cert path detection when cross-compiling" >&5 -$as_echo "$as_me: WARNING: skipped the ca-cert path detection when cross-compiling" >&2;} - fi - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL >= v3" >&5 +printf %s "checking for OpenSSL >= v3... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "x$ca" = "xno" || test -f "$ca"; then - ca_warning="" - fi - if test "x$capath" != "xno"; then - check_capath="$capath" - fi + #include - if test ! -z "$check_capath"; then - for a in "$check_capath"; do - if test -d "$a" && ls "$a"/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].0 >/dev/null 2>/dev/null; then - if test "x$capath" = "xno"; then - capath="$a" - fi - capath_warning="" - break - fi - done - fi +int main(void) +{ - if test "x$capath" = "xno"; then - capath_warning="" - fi + #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) + return 0; + #else + #error older than 3 + #endif - if test "x$ca" != "xno"; then - CURL_CA_BUNDLE='"'$ca'"' + return 0; +} -cat >>confdefs.h <<_ACEOF -#define CURL_CA_BUNDLE "$ca" _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ssl_msg="OpenSSL v3+" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ca" >&5 -$as_echo "$ca" >&6; } - fi - if test "x$capath" != "xno"; then - CURL_CA_PATH="\"$capath\"" +else $as_nop -cat >>confdefs.h <<_ACEOF -#define CURL_CA_PATH "$capath" -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $capath (capath)" >&5 -$as_echo "$capath (capath)" >&6; } - fi - if test "x$ca" = "xno" && test "x$capath" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use builtin CA store of SSL library" >&5 -$as_echo_n "checking whether to use builtin CA store of SSL library... " >&6; } - -# Check whether --with-ca-fallback was given. -if test "${with_ca_fallback+set}" = set; then : - withval=$with_ca_fallback; - if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then - as_fn_error $? "--with-ca-fallback only allows yes or no as parameter" "$LINENO" 5 - fi -else - with_ca_fallback="no" + for ac_func in SSL_set_quic_use_legacy_codepoint +do : + ac_fn_c_check_func "$LINENO" "SSL_set_quic_use_legacy_codepoint" "ac_cv_func_SSL_set_quic_use_legacy_codepoint" +if test "x$ac_cv_func_SSL_set_quic_use_legacy_codepoint" = xyes +then : + printf "%s\n" "#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1" >>confdefs.h + QUIC_ENABLED=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ca_fallback" >&5 -$as_echo "$with_ca_fallback" >&6; } - if test "x$with_ca_fallback" = "xyes"; then - if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1"; then - as_fn_error $? "--with-ca-fallback only works with OpenSSL or GnuTLS" "$LINENO" 5 - fi +done + if test "$QUIC_ENABLED" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenSSL fork speaks QUIC API" >&5 +printf "%s\n" "$as_me: OpenSSL fork speaks QUIC API" >&6;} + else -cat >>confdefs.h <<_ACEOF -#define CURL_CA_FALLBACK 1 -_ACEOF + for ac_func in SSL_set_quic_tls_cbs +do : + ac_fn_c_check_func "$LINENO" "SSL_set_quic_tls_cbs" "ac_cv_func_SSL_set_quic_tls_cbs" +if test "x$ac_cv_func_SSL_set_quic_tls_cbs" = xyes +then : + printf "%s\n" "#define HAVE_SSL_SET_QUIC_TLS_CBS 1" >>confdefs.h + QUIC_ENABLED=yes +fi +done + if test "$QUIC_ENABLED" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenSSL with QUIC APIv2" >&5 +printf "%s\n" "$as_me: OpenSSL with QUIC APIv2" >&6;} + OPENSSL_QUIC_API2=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OpenSSL version does not speak any known QUIC API" >&5 +printf "%s\n" "$as_me: OpenSSL version does not speak any known QUIC API" >&6;} + fi fi + if test "$OPENSSL_ENABLED" = "1"; then + if test -n "$LIB_OPENSSL"; then + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $LIB_OPENSSL to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $LIB_OPENSSL to CURL_LIBRARY_PATH" >&6;} + fi + fi + check_for_ca_bundle=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE openssl" + fi + test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" +fi - -# Check whether --with-libpsl was given. -if test "${with_libpsl+set}" = set; then : - withval=$with_libpsl; with_libpsl=$withval -else - with_libpsl=yes +if test X"$OPT_OPENSSL" != Xno && + test "$OPENSSL_ENABLED" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OPT_OPENSSL: $OPT_OPENSSL" >&5 +printf "%s\n" "$as_me: OPT_OPENSSL: $OPT_OPENSSL" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OPENSSL_ENABLED: $OPENSSL_ENABLED" >&5 +printf "%s\n" "$as_me: OPENSSL_ENABLED: $OPENSSL_ENABLED" >&6;} + as_fn_error $? "--with-openssl was given but OpenSSL could not be detected" "$LINENO" 5 fi -if test $with_libpsl != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing psl_builtin" >&5 -$as_echo_n "checking for library containing psl_builtin... " >&6; } -if ${ac_cv_search_psl_builtin+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test "$OPENSSL_ENABLED" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SRP support in OpenSSL" >&5 +printf %s "checking for SRP support in OpenSSL... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char psl_builtin (); -int main (void) + #ifndef OPENSSL_SUPPRESS_DEPRECATED + #define OPENSSL_SUPPRESS_DEPRECATED + #endif + #include + +int main(void) { -return psl_builtin (); - ; - return 0; + + SSL_CTX_set_srp_username(NULL, NULL); + SSL_CTX_set_srp_password(NULL, NULL); + + return 0; } -_ACEOF -for ac_lib in '' psl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_psl_builtin=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_psl_builtin+:} false; then : - break -fi -done -if ${ac_cv_search_psl_builtin+:} false; then : -else - ac_cv_search_psl_builtin=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_psl_builtin" >&5 -$as_echo "$ac_cv_search_psl_builtin" >&6; } -ac_res=$ac_cv_search_psl_builtin -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - curl_psl_msg="yes"; +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : -$as_echo "#define USE_LIBPSL 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +printf "%s\n" "#define HAVE_OPENSSL_SRP 1" >>confdefs.h -else - curl_psl_msg="no (libpsl not found)"; - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libpsl was not found" >&5 -$as_echo "$as_me: WARNING: libpsl was not found" >&2;} + HAVE_OPENSSL_SRP=1 +else $as_nop -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "$curl_psl_msg" = "yes"; then - USE_LIBPSL_TRUE= - USE_LIBPSL_FALSE='#' -else - USE_LIBPSL_TRUE='#' - USE_LIBPSL_FALSE= +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi +if test X"$OPENSSL_ENABLED" = X"1"; then + # Check whether --enable-openssl-auto-load-config was given. +if test ${enable_openssl_auto_load_config+y} +then : + enableval=$enable_openssl_auto_load_config; if test X"$enableval" = X"no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: automatic loading of OpenSSL configuration disabled" >&5 +printf "%s\n" "$as_me: automatic loading of OpenSSL configuration disabled" >&6;} +printf "%s\n" "#define CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG 1" >>confdefs.h -OPT_LIBMETALINK=no + fi +fi -# Check whether --with-libmetalink was given. -if test "${with_libmetalink+set}" = set; then : - withval=$with_libmetalink; OPT_LIBMETALINK=$withval fi +if test "$OPENSSL_ENABLED" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for QUIC support and OpenSSL >= 3.3" >&5 +printf %s "checking for QUIC support and OpenSSL >= 3.3... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -if test X"$OPT_LIBMETALINK" != Xno; then - addld="" - addlib="" - addcflags="" - version="" - libmetalinklib="" + #include - PKGTEST="no" - if test "x$OPT_LIBMETALINK" = "xyes"; then - PKGTEST="yes" +int main(void) +{ - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + #if (OPENSSL_VERSION_NUMBER < 0x30300000L) + #error need at least version 3.3.0 + #endif + OSSL_QUIC_client_method(); - ;; -esac -fi -PKGCONFIG=$ac_cv_path_PKGCONFIG -if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : -fi -if test -z "$ac_cv_path_PKGCONFIG"; then - ac_pt_PKGCONFIG=$PKGCONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_openssl_quic=1 + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - ;; -esac fi -ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG -if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi - if test "x$ac_pt_PKGCONFIG" = x; then - PKGCONFIG="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKGCONFIG=$ac_pt_PKGCONFIG - fi -else - PKGCONFIG="$ac_cv_path_PKGCONFIG" -fi - fi +if test "x$OPT_GNUTLS" != xno; then + ssl_msg= + + if test X"$OPT_GNUTLS" != Xno; then - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmetalink options with pkg-config" >&5 -$as_echo_n "checking for libmetalink options with pkg-config... " >&6; } - itexists=` - if test -n ""; then - PKG_CONFIG_LIBDIR="" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists libmetalink >/dev/null 2>&1 && echo 1` + addld="" + addlib="" + gtlslib="" + version="" + addcflags="" - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi - fi + if test "x$OPT_GNUTLS" = "xyes"; then + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" else - LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig" - { $as_echo "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$LIBMETALINK_PCDIR\"" >&5 -$as_echo "$as_me: PKG_CONFIG_LIBDIR will be set to \"$LIBMETALINK_PCDIR\"" >&6;} - if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then - PKGTEST="yes" - fi - if test "$PKGTEST" = "yes"; then - - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -25664,11 +26474,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25680,11 +26494,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -25693,11 +26507,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -25708,11 +26523,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25724,11 +26543,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -25736,8 +26555,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG @@ -25746,148 +26565,492 @@ else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - fi + fi + + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnutls options with pkg-config" >&5 +printf %s "checking for gnutls options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists gnutls >/dev/null 2>&1 && echo 1` - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmetalink options with pkg-config" >&5 -$as_echo_n "checking for libmetalink options with pkg-config... " >&6; } - itexists=` - if test -n "$LIBMETALINK_PCDIR"; then - PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" - export PKG_CONFIG_LIBDIR + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi - $PKGCONFIG --exists libmetalink >/dev/null 2>&1 && echo 1` + fi - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + + if test "$PKGCONFIG" != "no" ; then + addlib=`$PKGCONFIG --libs-only-l gnutls` + addld=`$PKGCONFIG --libs-only-L gnutls` + addcflags=`$PKGCONFIG --cflags-only-I gnutls` + version=`$PKGCONFIG --modversion gnutls` + gtlslib=`echo $addld | $SED -e 's/^-L//'` else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + check=`libgnutls-config --version 2>/dev/null` + if test -n "$check"; then + addlib=`libgnutls-config --libs` + addcflags=`libgnutls-config --cflags` + version=`libgnutls-config --version` + gtlslib=`libgnutls-config --prefix`/lib$libsuff + fi + fi + else + cfg=$OPT_GNUTLS/bin/libgnutls-config + check=`$cfg --version 2>/dev/null` + if test -n "$check"; then + addlib=`$cfg --libs` + addcflags=`$cfg --cflags` + version=`$cfg --version` + gtlslib=`$cfg --prefix`/lib$libsuff + else + addlib=-lgnutls + addld=-L$OPT_GNUTLS/lib$libsuff + addcflags=-I$OPT_GNUTLS/include + version="" # we just don't know + gtlslib=$OPT_GNUTLS/lib$libsuff fi fi + if test -z "$version"; then + version="unknown" fi - fi - if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then - addlib=` - if test -n "$LIBMETALINK_PCDIR"; then - PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-l libmetalink` - addld=` - if test -n "$LIBMETALINK_PCDIR"; then - PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-L libmetalink` - addcflags=` - if test -n "$LIBMETALINK_PCDIR"; then - PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --cflags-only-I libmetalink` - version=` - if test -n "$LIBMETALINK_PCDIR"; then - PKG_CONFIG_LIBDIR="$LIBMETALINK_PCDIR" - export PKG_CONFIG_LIBDIR + + if test -n "$addlib"; then + + CLEANLIBS="$LIBS" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + + LIBS="$addlib $LIBS" + LDFLAGS="$LDFLAGS $addld" + LDFLAGSPC="$LDFLAGSPC $addld" + if test "$addcflags" != "-I/usr/include"; then + CPPFLAGS="$CPPFLAGS $addcflags" + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnutls_x509_crt_get_dn2 in -lgnutls" >&5 +printf %s "checking for gnutls_x509_crt_get_dn2 in -lgnutls... " >&6; } +if test ${ac_cv_lib_gnutls_gnutls_x509_crt_get_dn2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnutls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __cplusplus +extern "C" +#endif +char gnutls_x509_crt_get_dn2 (); +int main(void) +{ +return gnutls_x509_crt_get_dn2 (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_gnutls_gnutls_x509_crt_get_dn2=yes +else $as_nop + ac_cv_lib_gnutls_gnutls_x509_crt_get_dn2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_x509_crt_get_dn2" >&5 +printf "%s\n" "$ac_cv_lib_gnutls_gnutls_x509_crt_get_dn2" >&6; } +if test "x$ac_cv_lib_gnutls_gnutls_x509_crt_get_dn2" = xyes +then : + + +printf "%s\n" "#define USE_GNUTLS 1" >>confdefs.h + + GNUTLS_ENABLED=1 + USE_GNUTLS="yes" + ssl_msg="GnuTLS" + QUIC_ENABLED=yes + test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + +else $as_nop + + LIBS="$CLEANLIBS" + CPPFLAGS="$CLEANCPPFLAGS" + +fi + + + if test "x$USE_GNUTLS" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected GnuTLS version $version" >&5 +printf "%s\n" "$as_me: detected GnuTLS version $version" >&6;} + check_for_ca_bundle=1 + if test -n "$gtlslib"; then + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$gtlslib" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $gtlslib to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $gtlslib to CURL_LIBRARY_PATH" >&6;} + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gnutls nettle" + fi + fi - $PKGCONFIG --modversion libmetalink` - libmetalinklib=`echo $addld | $SED -e 's/-L//'` + fi - if test -n "$addlib"; then + test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" +fi - clean_CPPFLAGS="$CPPFLAGS" - clean_LDFLAGS="$LDFLAGS" - clean_LIBS="$LIBS" - CPPFLAGS="$clean_CPPFLAGS $addcflags" - LDFLAGS="$clean_LDFLAGS $addld" - LIBS="$addlib $clean_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libmetalink is recent enough" >&5 -$as_echo_n "checking if libmetalink is recent enough... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +if test "$GNUTLS_ENABLED" = "1"; then + USE_GNUTLS_NETTLE= + # First check if we can detect either crypto library via transitive linking + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nettle_MD5Init in -lgnutls" >&5 +printf %s "checking for nettle_MD5Init in -lgnutls... " >&6; } +if test ${ac_cv_lib_gnutls_nettle_MD5Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnutls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __cplusplus +extern "C" +#endif +char nettle_MD5Init (); +int main(void) +{ +return nettle_MD5Init (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_gnutls_nettle_MD5Init=yes +else $as_nop + ac_cv_lib_gnutls_nettle_MD5Init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_nettle_MD5Init" >&5 +printf "%s\n" "$ac_cv_lib_gnutls_nettle_MD5Init" >&6; } +if test "x$ac_cv_lib_gnutls_nettle_MD5Init" = xyes +then : + USE_GNUTLS_NETTLE=1 +fi + + + # If not, try linking directly to both of them to see if they are available + if test "$USE_GNUTLS_NETTLE" = ""; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nettle_MD5Init in -lnettle" >&5 +printf %s "checking for nettle_MD5Init in -lnettle... " >&6; } +if test ${ac_cv_lib_nettle_nettle_MD5Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnettle $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __cplusplus +extern "C" +#endif +char nettle_MD5Init (); +int main(void) +{ +return nettle_MD5Init (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_nettle_nettle_MD5Init=yes +else $as_nop + ac_cv_lib_nettle_nettle_MD5Init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_MD5Init" >&5 +printf "%s\n" "$ac_cv_lib_nettle_nettle_MD5Init" >&6; } +if test "x$ac_cv_lib_nettle_nettle_MD5Init" = xyes +then : + USE_GNUTLS_NETTLE=1 +fi + + fi + if test "$USE_GNUTLS_NETTLE" = ""; then + as_fn_error $? "GnuTLS found, but nettle was not found" "$LINENO" 5 + fi + LIBS="-lnettle $LIBS" +fi + +if test "$GNUTLS_ENABLED" = "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnutls_srp_verifier in -lgnutls" >&5 +printf %s "checking for gnutls_srp_verifier in -lgnutls... " >&6; } +if test ${ac_cv_lib_gnutls_gnutls_srp_verifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnutls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __cplusplus +extern "C" +#endif +char gnutls_srp_verifier (); +int main(void) +{ +return gnutls_srp_verifier (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_gnutls_gnutls_srp_verifier=yes +else $as_nop + ac_cv_lib_gnutls_gnutls_srp_verifier=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_srp_verifier" >&5 +printf "%s\n" "$ac_cv_lib_gnutls_gnutls_srp_verifier" >&6; } +if test "x$ac_cv_lib_gnutls_gnutls_srp_verifier" = xyes +then : + + +printf "%s\n" "#define HAVE_GNUTLS_SRP 1" >>confdefs.h + + HAVE_GNUTLS_SRP=1 + +fi + +fi + + + + +if test "x$OPT_MBEDTLS" != xno; then + _cppflags=$CPPFLAGS + _ldflags=$LDFLAGS + _ldflagspc=$LDFLAGSPC + ssl_msg= + + if test X"$OPT_MBEDTLS" != Xno; then + + if test "$OPT_MBEDTLS" = "yes"; then + OPT_MBEDTLS="" + fi + + if test -z "$OPT_MBEDTLS" ; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbedtls_havege_init in -lmbedtls" >&5 +printf %s "checking for mbedtls_havege_init in -lmbedtls... " >&6; } +if test ${ac_cv_lib_mbedtls_mbedtls_havege_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -# include +#ifdef __cplusplus +extern "C" +#endif +char mbedtls_havege_init (); +int main(void) +{ +return mbedtls_havege_init (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_mbedtls_mbedtls_havege_init=yes +else $as_nop + ac_cv_lib_mbedtls_mbedtls_havege_init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mbedtls_mbedtls_havege_init" >&5 +printf "%s\n" "$ac_cv_lib_mbedtls_mbedtls_havege_init" >&6; } +if test "x$ac_cv_lib_mbedtls_mbedtls_havege_init" = xyes +then : + + +printf "%s\n" "#define USE_MBEDTLS 1" >>confdefs.h + + MBEDTLS_ENABLED=1 + USE_MBEDTLS="yes" + ssl_msg="mbedTLS" + test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + +fi + + fi + + addld="" + addlib="" + addcflags="" + mbedtlslib="" + + if test "x$USE_MBEDTLS" != "xyes"; then + addld=-L$OPT_MBEDTLS/lib$libsuff + addcflags=-I$OPT_MBEDTLS/include + mbedtlslib=$OPT_MBEDTLS/lib$libsuff + + LDFLAGS="$LDFLAGS $addld" + LDFLAGSPC="$LDFLAGSPC $addld" + if test "$addcflags" != "-I/usr/include"; then + CPPFLAGS="$CPPFLAGS $addcflags" + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbedtls_ssl_init in -lmbedtls" >&5 +printf %s "checking for mbedtls_ssl_init in -lmbedtls... " >&6; } +if test ${ac_cv_lib_mbedtls_mbedtls_ssl_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + -int main (void) +#ifdef __cplusplus +extern "C" +#endif +char mbedtls_ssl_init (); +int main(void) { - - if(0 != metalink_strerror(0)) /* added in 0.1.0 */ - return 1; - - ; - return 0; +return mbedtls_ssl_init (); + return 0; } - _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_mbedtls_mbedtls_ssl_init=yes +else $as_nop + ac_cv_lib_mbedtls_mbedtls_ssl_init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mbedtls_mbedtls_ssl_init" >&5 +printf "%s\n" "$ac_cv_lib_mbedtls_mbedtls_ssl_init" >&6; } +if test "x$ac_cv_lib_mbedtls_mbedtls_ssl_init" = xyes +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($version)" >&5 -$as_echo "yes ($version)" >&6; } - want_metalink="yes" -else +printf "%s\n" "#define USE_MBEDTLS 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no ($version)" >&5 -$as_echo "no ($version)" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: libmetalink library defective or too old" >&5 -$as_echo "$as_me: libmetalink library defective or too old" >&6;} - want_metalink="no" + MBEDTLS_ENABLED=1 + USE_MBEDTLS="yes" + ssl_msg="mbedTLS" + test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CPPFLAGS="$clean_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS" - LIBS="$clean_LIBS" - if test "$want_metalink" = "yes"; then +else $as_nop -$as_echo "#define USE_METALINK 1" >>confdefs.h + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + LDFLAGSPC=$_ldflagspc + +fi - LIBMETALINK_LIBS=$addlib - LIBMETALINK_LDFLAGS=$addld - LIBMETALINK_CPPFLAGS=$addcflags + fi + if test "x$USE_MBEDTLS" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected mbedTLS" >&5 +printf "%s\n" "$as_me: detected mbedTLS" >&6;} + check_for_ca_bundle=1 + LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" - curl_mtlnk_msg="enabled" + if test -n "$mbedtlslib"; then + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$mbedtlslib" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $mbedtlslib to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $mbedtlslib to CURL_LIBRARY_PATH" >&6;} + fi + fi + if false; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mbedtls mbedx509 mbedcrypto" + fi fi fi + test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi -OPT_LIBSSH2=off -# Check whether --with-libssh2 was given. -if test "${with_libssh2+set}" = set; then : - withval=$with_libssh2; OPT_LIBSSH2=$withval -fi +case "$OPT_WOLFSSL" in + yes|no) + wolfpkg="" + ;; + *) + wolfpkg="$withval/lib/pkgconfig" + ;; +esac -if test X"$OPT_LIBSSH2" != Xno; then - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" +if test "x$OPT_WOLFSSL" != xno; then + _cppflags=$CPPFLAGS + _ldflags=$LDFLAGS + _ldflagspc=$LDFLAGSPC - case "$OPT_LIBSSH2" in - yes) + ssl_msg= - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then + if test X"$OPT_WOLFSSL" != Xno; then + + if test "$OPT_WOLFSSL" = "yes"; then + OPT_WOLFSSL="" + fi + + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -25898,11 +27061,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25914,11 +27081,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -25927,11 +27094,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -25942,11 +27110,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25958,11 +27130,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -25970,8 +27142,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG @@ -25980,169 +27152,358 @@ else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - fi + fi - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2 options with pkg-config" >&5 -$as_echo_n "checking for libssh2 options with pkg-config... " >&6; } - itexists=` - if test -n ""; then - PKG_CONFIG_LIBDIR="" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists libssh2 >/dev/null 2>&1 && echo 1` + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wolfssl options with pkg-config" >&5 +printf %s "checking for wolfssl options with pkg-config... " >&6; } + itexists=` + if test -n "$wolfpkg"; then + PKG_CONFIG_LIBDIR="$wolfpkg" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists wolfssl >/dev/null 2>&1 && echo 1` - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Check dir $wolfpkg" >&5 +printf "%s\n" "$as_me: Check dir $wolfpkg" >&6;} + addld="" + addlib="" + addcflags="" if test "$PKGCONFIG" != "no" ; then - LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` - LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` - CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` - version=`$PKGCONFIG --modversion libssh2` - DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'` - fi + addlib=` + if test -n "$wolfpkg"; then + PKG_CONFIG_LIBDIR="$wolfpkg" + export PKG_CONFIG_LIBDIR + fi - ;; - off) - ;; - *) - PREFIX_SSH2=$OPT_LIBSSH2 - ;; - esac + $PKGCONFIG --libs-only-l wolfssl` + addld=` + if test -n "$wolfpkg"; then + PKG_CONFIG_LIBDIR="$wolfpkg" + export PKG_CONFIG_LIBDIR + fi - if test -n "$PREFIX_SSH2"; then - LIB_SSH2="-lssh2" - LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff - CPP_SSH2=-I${PREFIX_SSH2}/include - DIR_SSH2=${PREFIX_SSH2}/lib$libsuff + $PKGCONFIG --libs-only-L wolfssl` + addcflags=` + if test -n "$wolfpkg"; then + PKG_CONFIG_LIBDIR="$wolfpkg" + export PKG_CONFIG_LIBDIR fi - LDFLAGS="$LDFLAGS $LD_SSH2" - CPPFLAGS="$CPPFLAGS $CPP_SSH2" - LIBS="$LIB_SSH2 $LIBS" + $PKGCONFIG --cflags-only-I wolfssl` + version=` + if test -n "$wolfpkg"; then + PKG_CONFIG_LIBDIR="$wolfpkg" + export PKG_CONFIG_LIBDIR + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2_channel_open_ex in -lssh2" >&5 -$as_echo_n "checking for libssh2_channel_open_ex in -lssh2... " >&6; } -if ${ac_cv_lib_ssh2_libssh2_channel_open_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lssh2 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + $PKGCONFIG --modversion wolfssl` + wolfssllibpath=`echo $addld | $SED -e 's/^-L//'` + else + addlib=-lwolfssl + if test -n "$OPT_WOLFSSL"; then + addld=-L$OPT_WOLFSSL/lib$libsuff + addcflags=-I$OPT_WOLFSSL/include + wolfssllibpath=$OPT_WOLFSSL/lib$libsuff + fi + fi + + if test "x$USE_WOLFSSL" != "xyes"; then + + LDFLAGS="$LDFLAGS $addld" + LDFLAGSPC="$LDFLAGSPC $addld" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Add $addld to LDFLAGS" >&5 +printf "%s\n" "$as_me: Add $addld to LDFLAGS" >&6;} + if test "$addcflags" != "-I/usr/include"; then + CPPFLAGS="$CPPFLAGS $addcflags" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Add $addcflags to CPPFLAGS" >&5 +printf "%s\n" "$as_me: Add $addcflags to CPPFLAGS" >&6;} + fi + + my_ac_save_LIBS="$LIBS" + LIBS="$addlib $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Add $addlib to LIBS" >&5 +printf "%s\n" "$as_me: Add $addlib to LIBS" >&6;} + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wolfSSL_Init in -lwolfssl" >&5 +printf %s "checking for wolfSSL_Init in -lwolfssl... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __cplusplus -extern "C" -#endif -char libssh2_channel_open_ex (); -int main (void) + /* These are not needed for detection and confuse wolfSSL. + They are set up properly later if it is detected. */ + #undef SIZEOF_LONG + #undef SIZEOF_LONG_LONG + #include + #include + +int main(void) { -return libssh2_channel_open_ex (); - ; - return 0; + + return wolfSSL_Init(); + + return 0; } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ssh2_libssh2_channel_open_ex=yes -else - ac_cv_lib_ssh2_libssh2_channel_open_ex=no +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define USE_WOLFSSL 1" >>confdefs.h + + WOLFSSL_ENABLED=1 + USE_WOLFSSL="yes" + ssl_msg="wolfSSL" + test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CPPFLAGS=$_cppflags + LDFLAGS=$_ldflags + LDFLAGSPC=$_ldflagspc + wolfssllibpath="" + fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssh2_libssh2_channel_open_ex" >&5 -$as_echo "$ac_cv_lib_ssh2_libssh2_channel_open_ex" >&6; } -if test "x$ac_cv_lib_ssh2_libssh2_channel_open_ex" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSSH2 1 + LIBS="$my_ac_save_LIBS" + fi + + if test "x$USE_WOLFSSL" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected wolfSSL" >&5 +printf "%s\n" "$as_me: detected wolfSSL" >&6;} + check_for_ca_bundle=1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +printf %s "checking size of long long... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + + +int main(void) +{ + + switch(0) { + case 0: + case (sizeof(long long) == $typesize):; + } + + return 0; +} + _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : - LIBS="-lssh2 $LIBS" + r=$typesize + +else $as_nop + + r=0 fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; + fi + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of long long" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_long long" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" - for ac_header in libssh2.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" "$ac_includes_default" -if test "x$ac_cv_header_libssh2_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSSH2_H 1 -_ACEOF - curl_ssh_msg="enabled (libSSH2)" - LIBSSH2_ENABLED=1 +printf "%s\n" "#define SIZEOF_LONG_LONG $r" >>confdefs.h -$as_echo "#define USE_LIBSSH2 1" >>confdefs.h - USE_LIBSSH2=1 + LIBS="$addlib -lm $LIBS" + + + for ac_func in wolfSSL_set_quic_use_legacy_codepoint +do : + ac_fn_c_check_func "$LINENO" "wolfSSL_set_quic_use_legacy_codepoint" "ac_cv_func_wolfSSL_set_quic_use_legacy_codepoint" +if test "x$ac_cv_func_wolfSSL_set_quic_use_legacy_codepoint" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT 1" >>confdefs.h + QUIC_ENABLED=yes fi done + ac_fn_c_check_func "$LINENO" "wolfSSL_get_peer_certificate" "ac_cv_func_wolfSSL_get_peer_certificate" +if test "x$ac_cv_func_wolfSSL_get_peer_certificate" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSL_GET_PEER_CERTIFICATE 1" >>confdefs.h - if test X"$OPT_LIBSSH2" != Xoff && - test "$LIBSSH2_ENABLED" != "1"; then - as_fn_error $? "libSSH2 libs and/or directories were not found where specified!" "$LINENO" 5 - fi +fi +ac_fn_c_check_func "$LINENO" "wolfSSL_UseALPN" "ac_cv_func_wolfSSL_UseALPN" +if test "x$ac_cv_func_wolfSSL_UseALPN" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSL_USEALPN 1" >>confdefs.h - if test "$LIBSSH2_ENABLED" = "1"; then - if test -n "$DIR_SSH2"; then +fi +ac_fn_c_check_func "$LINENO" "wolfSSL_DES_ecb_encrypt" "ac_cv_func_wolfSSL_DES_ecb_encrypt" +if test "x$ac_cv_func_wolfSSL_DES_ecb_encrypt" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSL_DES_ECB_ENCRYPT 1" >>confdefs.h - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $DIR_SSH2 to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $DIR_SSH2 to LD_LIBRARY_PATH" >&6;} - fi +fi +ac_fn_c_check_func "$LINENO" "wolfSSL_BIO_new" "ac_cv_func_wolfSSL_BIO_new" +if test "x$ac_cv_func_wolfSSL_BIO_new" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSL_BIO_NEW 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wolfSSL_BIO_set_shutdown" "ac_cv_func_wolfSSL_BIO_set_shutdown" +if test "x$ac_cv_func_wolfSSL_BIO_set_shutdown" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSL_BIO_SET_SHUTDOWN 1" >>confdefs.h + +fi + + + if test "x$ac_cv_func_wolfSSL_DES_ecb_encrypt" = 'xyes'; then + HAVE_WOLFSSL_DES_ECB_ENCRYPT=1 + fi + + if test "x$ac_cv_func_wolfSSL_BIO_new" = 'xyes'; then + HAVE_WOLFSSL_BIO_NEW=1 + fi + + if test -n "$wolfssllibpath"; then + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$wolfssllibpath" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $wolfssllibpath to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $wolfssllibpath to CURL_LIBRARY_PATH" >&6;} + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE wolfssl" + else + as_fn_error $? "--with-wolfssl but wolfSSL was not found or doesn't work" "$LINENO" 5 fi - else - LDFLAGS=$CLEANLDFLAGS - CPPFLAGS=$CLEANCPPFLAGS - LIBS=$CLEANLIBS + fi + test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi -OPT_LIBRTMP=off -# Check whether --with-librtmp was given. -if test "${with_librtmp+set}" = set; then : - withval=$with_librtmp; OPT_LIBRTMP=$withval -fi +if test "x$OPT_RUSTLS" != xno; then + ssl_msg= -if test X"$OPT_LIBRTMP" != Xno; then CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" - case "$OPT_LIBRTMP" in - yes) + ## NEW CODE - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then + + case "$OPT_RUSTLS" in + yes) + PKGTEST="yes" + PREFIX_RUSTLS= + ;; + *) + PKGTEST="no" + PREFIX_RUSTLS=$OPT_RUSTLS + + + RUSTLS_PCDIR="$PREFIX_RUSTLS/lib/pkgconfig" + if test -f "$RUSTLS_PCDIR/rustls.pc"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$RUSTLS_PCDIR\"" >&5 +printf "%s\n" "$as_me: PKG_CONFIG_LIBDIR will be set to \"$RUSTLS_PCDIR\"" >&6;} + PKGTEST="yes" + fi + + if test "$PKGTEST" != "yes"; then + # try lib64 instead + RUSTLS_PCDIR="$PREFIX_RUSTLS/lib64/pkgconfig" + if test -f "$RUSTLS_PCDIR/rustls.pc"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: PKG_CONFIG_LIBDIR will be set to \"$RUSTLS_PCDIR\"" >&5 +printf "%s\n" "$as_me: PKG_CONFIG_LIBDIR will be set to \"$RUSTLS_PCDIR\"" >&6;} + PKGTEST="yes" + fi + fi + + if test "$PKGTEST" != "yes"; then + + addld=-L$PREFIX_RUSTLS/lib$libsuff + addcflags=-I$PREFIX_RUSTLS/include + + LDFLAGS="$LDFLAGS $addld" + LDFLAGSPC="$LDFLAGSPC $addld" + if test "$addcflags" != "-I/usr/include"; then + CPPFLAGS="$CPPFLAGS $addcflags" + fi + + if test "$curl_cv_apple" = 'yes'; then + RUSTLS_LDFLAGS="-framework Security -framework Foundation" + else + RUSTLS_LDFLAGS="-lpthread -ldl -lm" + fi + + LIB_RUSTLS="$PREFIX_RUSTLS/lib$libsuff" + if test "$PREFIX_RUSTLS" != "/usr" ; then + SSL_LDFLAGS="-L$LIB_RUSTLS $RUSTLS_LDFLAGS" + SSL_CPPFLAGS="-I$PREFIX_RUSTLS/include" + fi + + +printf "%s\n" "#define USE_RUSTLS 1" >>confdefs.h + + USE_RUSTLS="yes" + fi + ;; + esac + + link_pkgconfig='' + + if test "$PKGTEST" = "yes"; then + + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -26153,11 +27514,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -26169,11 +27534,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -26182,11 +27547,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -26197,11 +27563,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -26213,11 +27583,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -26225,76 +27595,116 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG fi -else - PKGCONFIG="$ac_cv_path_PKGCONFIG" -fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi + + fi + + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rustls options with pkg-config" >&5 +printf %s "checking for rustls options with pkg-config... " >&6; } + itexists=` + if test -n "$RUSTLS_PCDIR"; then + PKG_CONFIG_LIBDIR="$RUSTLS_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists rustls >/dev/null 2>&1 && echo 1` + + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi + + + if test "$PKGCONFIG" != "no" ; then + SSL_LIBS=` + if test -n "$RUSTLS_PCDIR"; then + PKG_CONFIG_LIBDIR="$RUSTLS_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-l --libs-only-other rustls 2>/dev/null` + + SSL_LDFLAGS=` + if test -n "$RUSTLS_PCDIR"; then + PKG_CONFIG_LIBDIR="$RUSTLS_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-L rustls 2>/dev/null` + + SSL_CPPFLAGS=` + if test -n "$RUSTLS_PCDIR"; then + PKG_CONFIG_LIBDIR="$RUSTLS_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I rustls 2>/dev/null` - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&5 +printf "%s\n" "$as_me: pkg-config: SSL_LIBS: \"$SSL_LIBS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: SSL_LDFLAGS: \"$SSL_LDFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: SSL_CPPFLAGS: \"$SSL_CPPFLAGS\"" >&6;} - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for librtmp options with pkg-config" >&5 -$as_echo_n "checking for librtmp options with pkg-config... " >&6; } - itexists=` - if test -n ""; then - PKG_CONFIG_LIBDIR="" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists librtmp >/dev/null 2>&1 && echo 1` + LIB_RUSTLS=`echo $SSL_LDFLAGS | sed -e 's/^-L//'` - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi - fi + LIBS="$SSL_LIBS $LIBS" + link_pkgconfig=1 + ssl_msg="rustls" +printf "%s\n" "#define USE_RUSTLS 1" >>confdefs.h - if test "$PKGCONFIG" != "no" ; then - LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` - LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` - CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` - version=`$PKGCONFIG --modversion librtmp` - DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'` + USE_RUSTLS="yes" + RUSTLS_ENABLED=1 + test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes else - as_fn_error $? "--librtmp was specified but could not find librtmp pkgconfig file." "$LINENO" 5 + as_fn_error $? "pkg-config: Could not find Rustls" "$LINENO" 5 fi - ;; - off) - LIB_RTMP="-lrtmp" - ;; - *) - LIB_RTMP="-lrtmp" - PREFIX_RTMP=$OPT_LIBRTMP - ;; - esac - - if test -n "$PREFIX_RTMP"; then - LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff - CPP_RTMP=-I${PREFIX_RTMP}/include - DIR_RTMP=${PREFIX_RTMP}/lib$libsuff + else + LIBS="-lrustls -lpthread -ldl -lm $LIBS" fi - LDFLAGS="$LDFLAGS $LD_RTMP" - CPPFLAGS="$CPPFLAGS $CPP_RTMP" - LIBS="$LIB_RTMP $LIBS" + CPPFLAGS="$CLEANCPPFLAGS $SSL_CPPFLAGS" + LDFLAGS="$CLEANLDFLAGS $SSL_LDFLAGS" + LDFLAGSPC="$CLEANLDFLAGSPC $SSL_LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTMP_Init in -lrtmp" >&5 -$as_echo_n "checking for RTMP_Init in -lrtmp... " >&6; } -if ${ac_cv_lib_rtmp_RTMP_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$USE_RUSTLS" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected Rustls" >&5 +printf "%s\n" "$as_me: detected Rustls" >&6;} + check_for_ca_bundle=1 + + if test -n "$LIB_RUSTLS"; then + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_RUSTLS" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $LIB_RUSTLS to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $LIB_RUSTLS to CURL_LIBRARY_PATH" >&6;} + fi + fi + if test -n "$link_pkgconfig"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE rustls" + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rustls_supported_hpke in -lrustls" >&5 +printf %s "checking for rustls_supported_hpke in -lrustls... " >&6; } +if test ${ac_cv_lib_rustls_rustls_supported_hpke+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lrtmp $LIBS" +LIBS="-lrustls $RUSTLS_LDFLAGS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -26302,288 +27712,399 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char RTMP_Init (); -int main (void) +char rustls_supported_hpke (); +int main(void) { -return RTMP_Init (); - ; - return 0; +return rustls_supported_hpke (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_rtmp_RTMP_Init=yes -else - ac_cv_lib_rtmp_RTMP_Init=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_rustls_rustls_supported_hpke=yes +else $as_nop + ac_cv_lib_rustls_rustls_supported_hpke=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rtmp_RTMP_Init" >&5 -$as_echo "$ac_cv_lib_rtmp_RTMP_Init" >&6; } -if test "x$ac_cv_lib_rtmp_RTMP_Init" = xyes; then : - - for ac_header in librtmp/rtmp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "librtmp/rtmp.h" "ac_cv_header_librtmp_rtmp_h" "$ac_includes_default" -if test "x$ac_cv_header_librtmp_rtmp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRTMP_RTMP_H 1 -_ACEOF - curl_rtmp_msg="enabled (librtmp)" - LIBRTMP_ENABLED=1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rustls_rustls_supported_hpke" >&5 +printf "%s\n" "$ac_cv_lib_rustls_rustls_supported_hpke" >&6; } +if test "x$ac_cv_lib_rustls_rustls_supported_hpke" = xyes +then : -$as_echo "#define USE_LIBRTMP 1" >>confdefs.h - USE_LIBRTMP=1 +printf "%s\n" "#define USE_RUSTLS 1" >>confdefs.h + RUSTLS_ENABLED=1 + USE_RUSTLS="yes" + ssl_msg="rustls" + test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes +else $as_nop + as_fn_error $? "--with-rustls was specified but could not find compatible Rustls." "$LINENO" 5 fi -done + fi + + test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" + if test X"$OPT_RUSTLS" != Xno && + test "$RUSTLS_ENABLED" != "1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: OPT_RUSTLS: $OPT_RUSTLS" >&5 +printf "%s\n" "$as_me: OPT_RUSTLS: $OPT_RUSTLS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: RUSTLS_ENABLED: $RUSTLS_ENABLED" >&5 +printf "%s\n" "$as_me: RUSTLS_ENABLED: $RUSTLS_ENABLED" >&6;} + as_fn_error $? "--with-rustls was given but Rustls could not be detected" "$LINENO" 5 + fi +fi -else - LDFLAGS=$CLEANLDFLAGS - CPPFLAGS=$CLEANCPPFLAGS - LIBS=$CLEANLIBS +if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then + LIBS="-lcrypt32 $LIBS" + if test "$curl_cv_wince" = 'no'; then + LIBS="-ladvapi32 $LIBS" + fi fi +if test "x$curl_cv_native_windows" = "xyes" -a "$curl_cv_wince" = 'no'; then + LIBS="-lbcrypt $LIBS" +fi - if test X"$OPT_LIBRTMP" != Xoff && - test "$LIBRTMP_ENABLED" != "1"; then - as_fn_error $? "librtmp libs and/or directories were not found where specified!" "$LINENO" 5 +case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$RUSTLS_ENABLED" in + x) + as_fn_error $? "TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more. +Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl or --with-rustls to address this." "$LINENO" 5 + ;; + x1) + # one SSL backend is enabled + SSL_ENABLED="1" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: built with one SSL backend" >&5 +printf "%s\n" "$as_me: built with one SSL backend" >&6;} + ;; + xD) + # explicitly built without TLS + ;; + xD*) + as_fn_error $? "--without-ssl has been set together with an explicit option to use an ssl library +(e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl, --with-rustls). +Since these are conflicting parameters, verify which is the desired one and drop the other." "$LINENO" 5 + ;; + *) + # more than one SSL backend is enabled + SSL_ENABLED="1" + CURL_WITH_MULTI_SSL="1" + +printf "%s\n" "#define CURL_WITH_MULTI_SSL 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: built with multiple SSL backends" >&5 +printf "%s\n" "$as_me: built with multiple SSL backends" >&6;} + ;; +esac + +if test -n "$ssl_backends"; then + curl_ssl_msg="enabled ($ssl_backends)" +fi + +if test no = "$VALID_DEFAULT_SSL_BACKEND"; then + if test -n "$SSL_ENABLED"; then + as_fn_error $? "Default SSL backend $DEFAULT_SSL_BACKEND not enabled!" "$LINENO" 5 + else + as_fn_error $? "Default SSL backend requires SSL!" "$LINENO" 5 fi +elif test yes = "$VALID_DEFAULT_SSL_BACKEND"; then + +printf "%s\n" "#define CURL_DEFAULT_SSL_BACKEND \"$DEFAULT_SSL_BACKEND\"" >>confdefs.h fi -versioned_symbols_flavour= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether versioned symbols are wanted" >&5 -$as_echo_n "checking whether versioned symbols are wanted... " >&6; } -# Check whether --enable-versioned-symbols was given. -if test "${enable_versioned_symbols+set}" = set; then : - enableval=$enable_versioned_symbols; case "$enableval" in - yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 -$as_echo_n "checking if libraries can be versioned... " >&6; } - GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` - if test -z "$GLD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You need an ld version supporting the --version-script option" >&5 -$as_echo "$as_me: WARNING: You need an ld version supporting the --version-script option" >&2;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test "x$CURL_WITH_MULTI_SSL" = "x1"; then - versioned_symbols_flavour="MULTISSL_" - elif test "x$OPENSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="OPENSSL_" - elif test "x$GNUTLS_ENABLED" = "x1"; then - versioned_symbols_flavour="GNUTLS_" - elif test "x$NSS_ENABLED" = "x1"; then - versioned_symbols_flavour="NSS_" - elif test "x$POLARSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="POLARSSL_" - elif test "x$CYASSL_ENABLED" = "x1"; then - versioned_symbols_flavour="CYASSL_" - elif test "x$AXTLS_ENABLED" = "x1"; then - versioned_symbols_flavour="AXTLS_" - elif test "x$WINSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="WINSSL_" - elif test "x$DARWINSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="DARWINSSL_" +if test -n "$check_for_ca_bundle"; then + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking default CA cert bundle/path" >&5 +printf %s "checking default CA cert bundle/path... " >&6; } + + +# Check whether --with-ca-bundle was given. +if test ${with_ca_bundle+y} +then : + withval=$with_ca_bundle; + want_ca="$withval" + if test "x$want_ca" = "xyes"; then + as_fn_error $? "--with-ca-bundle=FILE requires a path to the CA bundle" "$LINENO" 5 + fi + +else $as_nop + want_ca="unset" +fi + + +# Check whether --with-ca-path was given. +if test ${with_ca_path+y} +then : + withval=$with_ca_path; + want_capath="$withval" + if test "x$want_capath" = "xyes"; then + as_fn_error $? "--with-ca-path=DIRECTORY requires a path to the CA path directory" "$LINENO" 5 + fi + +else $as_nop + want_capath="unset" +fi + + + ca_warning=" (warning: certs not found)" + capath_warning=" (warning: certs not found)" + check_capath="" + + if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \ + "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then + ca="$want_ca" + capath="$want_capath" + elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then + ca="$want_ca" + capath="no" + elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then + capath="$want_capath" + ca="no" + else + ca="no" + capath="no" + if test "x$cross_compiling" != "xyes" -a \ + "x$curl_cv_native_windows" != "xyes"; then + if test "x$want_ca" = "xunset"; then + if test "x$prefix" != xNONE; then + cac="${prefix}/share/curl/curl-ca-bundle.crt" else - versioned_symbols_flavour="" + cac="$ac_default_prefix/share/curl/curl-ca-bundle.crt" fi - versioned_symbols="yes" + + for a in /etc/ssl/certs/ca-certificates.crt \ + /etc/pki/tls/certs/ca-bundle.crt \ + /usr/share/ssl/certs/ca-bundle.crt \ + /usr/local/share/certs/ca-root-nss.crt \ + /etc/ssl/cert.pem \ + "$cac"; do + if test -f "$a"; then + ca="$a" + break + fi + done + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: want $want_capath ca $ca" >&5 +printf "%s\n" "$as_me: want $want_capath ca $ca" >&6;} + if test "x$want_capath" = "xunset"; then + check_capath="/etc/ssl/certs" + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: skipped the ca-cert path detection when cross-compiling" >&5 +printf "%s\n" "$as_me: WARNING: skipped the ca-cert path detection when cross-compiling" >&2;} fi - ;; + fi - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + if test "x$ca" = "xno" || test -f "$ca"; then + ca_warning="" + fi -else + if test "x$capath" != "xno"; then + check_capath="$capath" + fi + + if test ! -z "$check_capath"; then + for a in "$check_capath"; do + if test -d "$a" && ls "$a"/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].0 >/dev/null 2>/dev/null; then + if test "x$capath" = "xno"; then + capath="$a" + fi + capath_warning="" + break + fi + done + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "x$capath" = "xno"; then + capath_warning="" + fi + if test "x$ca" != "xno"; then + CURL_CA_BUNDLE="$ca" -fi +printf "%s\n" "#define CURL_CA_BUNDLE \"$ca\"" >>confdefs.h -CURL_LT_SHLIB_VERSIONED_FLAVOUR="$versioned_symbols_flavour" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ca" >&5 +printf "%s\n" "$ca" >&6; } + fi + if test "x$capath" != "xno"; then + CURL_CA_PATH="\"$capath\"" - if test "x$versioned_symbols" = 'xyes'; then - CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE= - CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE='#' -else - CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE='#' - CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE= -fi +printf "%s\n" "#define CURL_CA_PATH \"$capath\"" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $capath (capath)" >&5 +printf "%s\n" "$capath (capath)" >&6; } + fi + if test "x$ca" = "xno" && test "x$capath" = "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use built-in CA store of SSL library" >&5 +printf %s "checking whether to use built-in CA store of SSL library... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Windows native IDN (Windows native builds only)" >&5 -$as_echo_n "checking whether to enable Windows native IDN (Windows native builds only)... " >&6; } -OPT_WINIDN="default" +# Check whether --with-ca-fallback was given. +if test ${with_ca_fallback+y} +then : + withval=$with_ca_fallback; + if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then + as_fn_error $? "--with-ca-fallback only allows yes or no as parameter" "$LINENO" 5 + fi -# Check whether --with-winidn was given. -if test "${with_winidn+set}" = set; then : - withval=$with_winidn; OPT_WINIDN=$withval +else $as_nop + with_ca_fallback="no" fi -case "$OPT_WINIDN" in - no|default) - want_winidn="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - yes) - want_winidn="yes" - want_winidn_path="default" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - *) - want_winidn="yes" - want_winidn_path="$withval" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($withval)" >&5 -$as_echo "yes ($withval)" >&6; } - ;; -esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_ca_fallback" >&5 +printf "%s\n" "$with_ca_fallback" >&6; } + if test "x$with_ca_fallback" = "xyes"; then + if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1"; then + as_fn_error $? "--with-ca-fallback only works with OpenSSL or GnuTLS" "$LINENO" 5 + fi + +printf "%s\n" "#define CURL_CA_FALLBACK 1" >>confdefs.h -if test "$want_winidn" = "yes"; then - clean_CPPFLAGS="$CPPFLAGS" - clean_LDFLAGS="$LDFLAGS" - clean_LIBS="$LIBS" - WINIDN_LIBS="-lnormaliz" - WINIDN_CPPFLAGS="-DWINVER=0x0600" - # - if test "$want_winidn_path" != "default"; then - WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" - WINIDN_CPPFLAGS="-I$want_winidn_path/include" - WINIDN_DIR="$want_winidn_path/lib$libsuff" fi - # - CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" - LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" - LIBS="$WINIDN_LIBS $LIBS" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IdnToUnicode can be linked" >&5 -$as_echo_n "checking if IdnToUnicode can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include -int main (void) -{ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CA cert bundle path to embed in the curl tool" >&5 +printf %s "checking CA cert bundle path to embed in the curl tool... " >&6; } - IdnToUnicode(0, NULL, 0, NULL, 0); - ; - return 0; -} +# Check whether --with-ca-embed was given. +if test ${with_ca_embed+y} +then : + withval=$with_ca_embed; + want_ca_embed="$withval" + if test "x$want_ca_embed" = "xyes"; then + as_fn_error $? "--with-ca-embed=FILE requires a path to the CA bundle" "$LINENO" 5 + fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +else $as_nop + want_ca_embed="unset" +fi + + + CURL_CA_EMBED='' + if test "x$want_ca_embed" != "xno" -a "x$want_ca_embed" != "xunset" -a -f "$want_ca_embed"; then + CURL_CA_EMBED="$want_ca_embed" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_winidn="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_ca_embed" >&5 +printf "%s\n" "$want_ca_embed" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + +fi + if test "x$CURL_CA_EMBED" != "x"; then + CURL_CA_EMBED_SET_TRUE= + CURL_CA_EMBED_SET_FALSE='#' else + CURL_CA_EMBED_SET_TRUE='#' + CURL_CA_EMBED_SET_FALSE= +fi + + + +if test "$curl_cv_native_windows" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable unsafe CA bundle search in PATH on Windows" >&5 +printf %s "checking whether to enable unsafe CA bundle search in PATH on Windows... " >&6; } + # Check whether --enable-ca-search was given. +if test ${enable_ca_search+y} +then : + enableval=$enable_ca_search; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_CA_SEARCH 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_winidn="no" + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_winidn" = "yes"; then -$as_echo "#define USE_WIN32_IDN 1" >>confdefs.h +fi -$as_echo "#define WANT_IDN_PROTOTYPES 1" >>confdefs.h +if test "$curl_cv_native_windows" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable safe CA bundle search (within the curl tool directory) on Windows" >&5 +printf %s "checking whether to enable safe CA bundle search (within the curl tool directory) on Windows... " >&6; } + # Check whether --enable-ca-search-safe was given. +if test ${enable_ca_search_safe+y} +then : + enableval=$enable_ca_search_safe; case "$enableval" in + yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - IDN_ENABLED=1 +printf "%s\n" "#define CURL_CA_SEARCH_SAFE 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - curl_idn_msg="enabled (Windows-native)" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for IDN support: IDN disabled" >&5 -$as_echo "$as_me: WARNING: Cannot find libraries for IDN support: IDN disabled" >&2;} - CPPFLAGS="$clean_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS" - LIBS="$clean_LIBS" - fi fi +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with libidn2" >&5 -$as_echo_n "checking whether to build with libidn2... " >&6; } -OPT_IDN="default" -# Check whether --with-libidn2 was given. -if test "${with_libidn2+set}" = set; then : - withval=$with_libidn2; OPT_IDN=$withval +OPT_LIBPSL=off + +# Check whether --with-libpsl was given. +if test ${with_libpsl+y} +then : + withval=$with_libpsl; OPT_LIBPSL=$withval fi -case "$OPT_IDN" in - no) - want_idn="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - default) - want_idn="yes" - want_idn_path="default" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 -$as_echo "(assumed) yes" >&6; } - ;; - yes) - want_idn="yes" - want_idn_path="default" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - *) - want_idn="yes" - want_idn_path="$withval" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($withval)" >&5 -$as_echo "yes ($withval)" >&6; } - ;; -esac -if test "$want_idn" = "yes"; then - clean_CPPFLAGS="$CPPFLAGS" - clean_LDFLAGS="$LDFLAGS" - clean_LIBS="$LIBS" - PKGCONFIG="no" - # - if test "$want_idn_path" != "default"; then - IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig" +if test X"$OPT_LIBPSL" != Xno; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + case "$OPT_LIBPSL" in + yes|off) - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -26594,11 +28115,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -26610,11 +28135,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -26623,11 +28148,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -26638,11 +28164,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -26654,11 +28184,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -26666,8 +28196,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG @@ -26676,67 +28206,285 @@ else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - fi + fi - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libidn2 options with pkg-config" >&5 -$as_echo_n "checking for libidn2 options with pkg-config... " >&6; } - itexists=` - if test -n "$IDN_PCDIR"; then - PKG_CONFIG_LIBDIR="$IDN_PCDIR" - export PKG_CONFIG_LIBDIR + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libpsl options with pkg-config" >&5 +printf %s "checking for libpsl options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libpsl >/dev/null 2>&1 && echo 1` + + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi - $PKGCONFIG --exists libidn2 >/dev/null 2>&1 && echo 1` + fi - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + + if test "$PKGCONFIG" != "no"; then + LIB_PSL=`$PKGCONFIG --libs-only-l libpsl` + LD_PSL=`$PKGCONFIG --libs-only-L libpsl` + CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl` else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + LIB_PSL="-lpsl" fi - fi - if test "$PKGCONFIG" != "no"; then - IDN_LIBS=` - if test -n "$IDN_PCDIR"; then - PKG_CONFIG_LIBDIR="$IDN_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-l libidn2 2>/dev/null` - IDN_LDFLAGS=` - if test -n "$IDN_PCDIR"; then - PKG_CONFIG_LIBDIR="$IDN_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --libs-only-L libidn2 2>/dev/null` - IDN_CPPFLAGS=` - if test -n "$IDN_PCDIR"; then - PKG_CONFIG_LIBDIR="$IDN_PCDIR" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --cflags-only-I libidn2 2>/dev/null` - IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` - else - IDN_LIBS="-lidn2" - IDN_LDFLAGS="-L$want_idn_path/lib$libsuff" - IDN_CPPFLAGS="-I$want_idn_path/include" - IDN_DIR="$want_idn_path/lib$libsuff" - fi + ;; + *) + LIB_PSL="-lpsl" + PREFIX_PSL=$OPT_LIBPSL + ;; + esac + + if test -n "$PREFIX_PSL"; then + LD_PSL=-L${PREFIX_PSL}/lib$libsuff + CPP_PSL=-I${PREFIX_PSL}/include + fi + + LDFLAGS="$LDFLAGS $LD_PSL" + LDFLAGSPC="$LDFLAGSPC $LD_PSL" + CPPFLAGS="$CPPFLAGS $CPP_PSL" + LIBS="$LIB_PSL $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for psl_builtin in -lpsl" >&5 +printf %s "checking for psl_builtin in -lpsl... " >&6; } +if test ${ac_cv_lib_psl_psl_builtin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __cplusplus +extern "C" +#endif +char psl_builtin (); +int main(void) +{ +return psl_builtin (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_psl_psl_builtin=yes +else $as_nop + ac_cv_lib_psl_psl_builtin=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_psl_psl_builtin" >&5 +printf "%s\n" "$ac_cv_lib_psl_psl_builtin" >&6; } +if test "x$ac_cv_lib_psl_psl_builtin" = xyes +then : + + for ac_header in libpsl.h +do : + ac_fn_c_check_header_compile "$LINENO" "libpsl.h" "ac_cv_header_libpsl_h" "$ac_includes_default" +if test "x$ac_cv_header_libpsl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBPSL_H 1" >>confdefs.h + curl_psl_msg="enabled" + +printf "%s\n" "#define USE_LIBPSL 1" >>confdefs.h + + USE_LIBPSL=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libpsl" + +fi + +done + +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + +fi + + + if test "$USE_LIBPSL" != "1"; then + as_fn_error $? "libpsl libs and/or directories were not found where specified!" "$LINENO" 5 + fi +fi + if test "$curl_psl_msg" = "enabled"; then + USE_LIBPSL_TRUE= + USE_LIBPSL_FALSE='#' +else + USE_LIBPSL_TRUE='#' + USE_LIBPSL_FALSE= +fi + + + + + +# Check whether --with-libgsasl was given. +if test ${with_libgsasl+y} +then : + withval=$with_libgsasl; with_libgsasl=$withval +else $as_nop + with_libgsasl=yes +fi + +if test $with_libgsasl != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gsasl_init" >&5 +printf %s "checking for library containing gsasl_init... " >&6; } +if test ${ac_cv_search_gsasl_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __cplusplus +extern "C" +#endif +char gsasl_init (); +int main(void) +{ +return gsasl_init (); + return 0; +} +_ACEOF +for ac_lib in '' gsasl +do + if test -z "$ac_lib"; then + ac_res="none required" else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_gsasl_init=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_gsasl_init+y} +then : + break +fi +done +if test ${ac_cv_search_gsasl_init+y} +then : - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then +else $as_nop + ac_cv_search_gsasl_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gsasl_init" >&5 +printf "%s\n" "$ac_cv_search_gsasl_init" >&6; } +ac_res=$ac_cv_search_gsasl_init +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + curl_gsasl_msg="enabled"; + +printf "%s\n" "#define USE_GSASL 1" >>confdefs.h + + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libgsasl" + +else $as_nop + curl_gsasl_msg="no (libgsasl not found)"; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libgsasl was not found" >&5 +printf "%s\n" "$as_me: WARNING: libgsasl was not found" >&2;} + + +fi + +fi + if test "$curl_gsasl_msg" = "enabled"; then + USE_GSASL_TRUE= + USE_GSASL_FALSE='#' +else + USE_GSASL_TRUE='#' + USE_GSASL_FALSE= +fi + + + +# Check whether --with-libmetalink was given. +if test ${with_libmetalink+y} +then : + withval=$with_libmetalink; as_fn_error $? "--with-libmetalink and --without-libmetalink no longer work!" "$LINENO" 5 +fi + + + +OPT_LIBSSH2=off + +# Check whether --with-libssh2 was given. +if test ${with_libssh2+y} +then : + withval=$with_libssh2; OPT_LIBSSH2=$withval +else $as_nop + OPT_LIBSSH2=no +fi + + + +OPT_LIBSSH=off + +# Check whether --with-libssh was given. +if test ${with_libssh+y} +then : + withval=$with_libssh; OPT_LIBSSH=$withval +else $as_nop + OPT_LIBSSH=no +fi + + +OPT_WOLFSSH=off + +# Check whether --with-wolfssh was given. +if test ${with_wolfssh+y} +then : + withval=$with_wolfssh; OPT_WOLFSSH=$withval +else $as_nop + OPT_WOLFSSH=no +fi + + +if test X"$OPT_LIBSSH2" != Xno; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + case "$OPT_LIBSSH2" in + yes) + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -26747,11 +28495,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -26763,11 +28515,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -26776,11 +28528,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -26791,11 +28544,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -26807,11 +28564,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -26819,8 +28576,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG @@ -26829,193 +28586,155 @@ else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - fi - - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libidn2 options with pkg-config" >&5 -$as_echo_n "checking for libidn2 options with pkg-config... " >&6; } - itexists=` - if test -n ""; then - PKG_CONFIG_LIBDIR="" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --exists libidn2 >/dev/null 2>&1 && echo 1` + fi - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - fi - fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libssh2 options with pkg-config" >&5 +printf %s "checking for libssh2 options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libssh2 >/dev/null 2>&1 && echo 1` - if test "$PKGCONFIG" != "no"; then - IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null` - IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null` - IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null` - IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - IDN_LIBS="-lidn2" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi fi - # - if test "$PKGCONFIG" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_LIBS: \"$IDN_LIBS\"" >&5 -$as_echo "$as_me: pkg-config: IDN_LIBS: \"$IDN_LIBS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&5 -$as_echo "$as_me: pkg-config: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&5 -$as_echo "$as_me: pkg-config: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_DIR: \"$IDN_DIR\"" >&5 -$as_echo "$as_me: pkg-config: IDN_DIR: \"$IDN_DIR\"" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_LIBS: \"$IDN_LIBS\"" >&5 -$as_echo "$as_me: IDN_LIBS: \"$IDN_LIBS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&5 -$as_echo "$as_me: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&5 -$as_echo "$as_me: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: IDN_DIR: \"$IDN_DIR\"" >&5 -$as_echo "$as_me: IDN_DIR: \"$IDN_DIR\"" >&6;} + + + if test "$PKGCONFIG" != "no"; then + LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` + LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` + CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` + version=`$PKGCONFIG --modversion libssh2` + DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'` + fi + + ;; + off) + ;; + *) + PREFIX_SSH2=$OPT_LIBSSH2 + ;; + esac + + if test -n "$PREFIX_SSH2"; then + LIB_SSH2="-lssh2" + LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff + CPP_SSH2=-I${PREFIX_SSH2}/include + DIR_SSH2=${PREFIX_SSH2}/lib$libsuff fi - # - CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS" - LDFLAGS="$LDFLAGS $IDN_LDFLAGS" - LIBS="$IDN_LIBS $LIBS" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if idn2_lookup_ul can be linked" >&5 -$as_echo_n "checking if idn2_lookup_ul can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + LDFLAGS="$LDFLAGS $LD_SSH2" + LDFLAGSPC="$LDFLAGSPC $LD_SSH2" + CPPFLAGS="$CPPFLAGS $CPP_SSH2" + LIBS="$LIB_SSH2 $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libssh2_free in -lssh2" >&5 +printf %s "checking for libssh2_free in -lssh2... " >&6; } +if test ${ac_cv_lib_ssh2_libssh2_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssh2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define idn2_lookup_ul innocuous_idn2_lookup_ul -#ifdef __STDC__ -# include -#else -# include -#endif -#undef idn2_lookup_ul #ifdef __cplusplus extern "C" #endif -char idn2_lookup_ul (); -#if defined __stub_idn2_lookup_ul || defined __stub___idn2_lookup_ul -choke me -#endif - -int main (void) +char libssh2_free (); +int main(void) { -return idn2_lookup_ul (); - ; - return 0; +return libssh2_free (); + return 0; } - _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_libidn="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_libidn="no" - +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ssh2_libssh2_free=yes +else $as_nop + ac_cv_lib_ssh2_libssh2_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - # - for ac_header in idn2.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - +LIBS=$ac_check_lib_save_LIBS fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssh2_libssh2_free" >&5 +printf "%s\n" "$ac_cv_lib_ssh2_libssh2_free" >&6; } +if test "x$ac_cv_lib_ssh2_libssh2_free" = xyes +then : + printf "%s\n" "#define HAVE_LIBSSH2 1" >>confdefs.h -done - - - if test "$tst_links_libidn" = "yes"; then - -$as_echo "#define HAVE_LIBIDN2 1" >>confdefs.h - - - IDN_ENABLED=1 + LIBS="-lssh2 $LIBS" - curl_idn_msg="enabled (libidn2)" - if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR" - export LD_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: Added $IDN_DIR to LD_LIBRARY_PATH" >&5 -$as_echo "$as_me: Added $IDN_DIR to LD_LIBRARY_PATH" >&6;} - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for IDN support: IDN disabled" >&5 -$as_echo "$as_me: WARNING: Cannot find libraries for IDN support: IDN disabled" >&2;} - CPPFLAGS="$clean_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS" - LIBS="$clean_LIBS" - fi fi + ac_fn_c_check_header_compile "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" "$ac_includes_default" +if test "x$ac_cv_header_libssh2_h" = xyes +then : + curl_ssh_msg="enabled (libssh2)" +printf "%s\n" "#define USE_LIBSSH2 1" >>confdefs.h + USE_LIBSSH2=1 -OPT_H2="yes" - -if test "x$disable_http" = "xyes"; then - # without HTTP, nghttp2 is no use - OPT_H2="no" fi -# Check whether --with-nghttp2 was given. -if test "${with_nghttp2+set}" = set; then : - withval=$with_nghttp2; OPT_H2=$withval -fi + if test X"$OPT_LIBSSH2" != Xoff && + test "$USE_LIBSSH2" != "1"; then + as_fn_error $? "libssh2 libs and/or directories were not found where specified!" "$LINENO" 5 + fi -case "$OPT_H2" in - no) - want_h2="no" - ;; - yes) - want_h2="default" - want_h2_path="" - ;; - *) - want_h2="yes" - want_h2_path="$withval/lib/pkgconfig" - ;; -esac + if test "$USE_LIBSSH2" = "1"; then + if test -n "$DIR_SSH2"; then -curl_h2_msg="disabled (--with-nghttp2)" -if test X"$want_h2" != Xno; then + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_SSH2 to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_SSH2 to CURL_LIBRARY_PATH" >&6;} + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh2" + else + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + fi +elif test X"$OPT_LIBSSH" != Xno; then CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" + case "$OPT_LIBSSH" in + yes) - if test -n "$PKG_CONFIG"; then - PKGCONFIG="$PKG_CONFIG" - else - if test -n "$ac_tool_prefix"; then + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. @@ -27026,11 +28745,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -27042,11 +28765,11 @@ esac fi PKGCONFIG=$ac_cv_path_PKGCONFIG if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -27055,11 +28778,12 @@ if test -z "$ac_cv_path_PKGCONFIG"; then ac_pt_PKGCONFIG=$PKGCONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKGCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. @@ -27070,11 +28794,15 @@ as_dummy="$PATH:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -27086,11 +28814,11 @@ esac fi ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG if test -n "$ac_pt_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 -$as_echo "$ac_pt_PKGCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKGCONFIG" = x; then @@ -27098,8 +28826,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKGCONFIG=$ac_pt_PKGCONFIG @@ -27108,72 +28836,159 @@ else PKGCONFIG="$ac_cv_path_PKGCONFIG" fi - fi + fi + + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libssh options with pkg-config" >&5 +printf %s "checking for libssh options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libssh >/dev/null 2>&1 && echo 1` - if test "x$PKGCONFIG" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnghttp2 options with pkg-config" >&5 -$as_echo_n "checking for libnghttp2 options with pkg-config... " >&6; } - itexists=` - if test -n "$want_h2_path"; then - PKG_CONFIG_LIBDIR="$want_h2_path" - export PKG_CONFIG_LIBDIR + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi - $PKGCONFIG --exists libnghttp2 >/dev/null 2>&1 && echo 1` + fi - if test -z "$itexists"; then - PKGCONFIG="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + + if test "$PKGCONFIG" != "no"; then + LIB_SSH=`$PKGCONFIG --libs-only-l libssh` + LD_SSH=`$PKGCONFIG --libs-only-L libssh` + CPP_SSH=`$PKGCONFIG --cflags-only-I libssh` + version=`$PKGCONFIG --modversion libssh` + DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'` fi - fi + ;; + off) + ;; + *) + PREFIX_SSH=$OPT_LIBSSH + ;; + esac + + if test -n "$PREFIX_SSH"; then + LIB_SSH="-lssh" + LD_SSH=-L${PREFIX_SSH}/lib$libsuff + CPP_SSH=-I${PREFIX_SSH}/include + DIR_SSH=${PREFIX_SSH}/lib$libsuff + fi - if test "$PKGCONFIG" != "no" ; then - LIB_H2=` - if test -n "$want_h2_path"; then - PKG_CONFIG_LIBDIR="$want_h2_path" - export PKG_CONFIG_LIBDIR - fi + LDFLAGS="$LDFLAGS $LD_SSH" + LDFLAGSPC="$LDFLAGSPC $LD_SSH" + CPPFLAGS="$CPPFLAGS $CPP_SSH" + LIBS="$LIB_SSH $LIBS" - $PKGCONFIG --libs-only-l libnghttp2` - { $as_echo "$as_me:${as_lineno-$LINENO}: -l is $LIB_H2" >&5 -$as_echo "$as_me: -l is $LIB_H2" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssh_new in -lssh" >&5 +printf %s "checking for ssh_new in -lssh... " >&6; } +if test ${ac_cv_lib_ssh_ssh_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssh $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - CPP_H2=` - if test -n "$want_h2_path"; then - PKG_CONFIG_LIBDIR="$want_h2_path" - export PKG_CONFIG_LIBDIR - fi - $PKGCONFIG --cflags-only-I libnghttp2` - { $as_echo "$as_me:${as_lineno-$LINENO}: -I is $CPP_H2" >&5 -$as_echo "$as_me: -I is $CPP_H2" >&6;} - LD_H2=` - if test -n "$want_h2_path"; then - PKG_CONFIG_LIBDIR="$want_h2_path" - export PKG_CONFIG_LIBDIR +#ifdef __cplusplus +extern "C" +#endif +char ssh_new (); +int main(void) +{ +return ssh_new (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ssh_ssh_new=yes +else $as_nop + ac_cv_lib_ssh_ssh_new=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssh_ssh_new" >&5 +printf "%s\n" "$ac_cv_lib_ssh_ssh_new" >&6; } +if test "x$ac_cv_lib_ssh_ssh_new" = xyes +then : + printf "%s\n" "#define HAVE_LIBSSH 1" >>confdefs.h + + LIBS="-lssh $LIBS" + +fi + + + ac_fn_c_check_header_compile "$LINENO" "libssh/libssh.h" "ac_cv_header_libssh_libssh_h" "$ac_includes_default" +if test "x$ac_cv_header_libssh_libssh_h" = xyes +then : + curl_ssh_msg="enabled (libssh)" + +printf "%s\n" "#define USE_LIBSSH 1" >>confdefs.h + + USE_LIBSSH=1 + +fi + + + if test X"$OPT_LIBSSH" != Xoff && + test "$USE_LIBSSH" != "1"; then + as_fn_error $? "libssh libs and/or directories were not found where specified!" "$LINENO" 5 + fi + + if test "$USE_LIBSSH" = "1"; then + if test "$curl_cv_native_windows" = "yes"; then + LIBS="-liphlpapi $LIBS" fi + if test -n "$DIR_SSH"; then - $PKGCONFIG --libs-only-L libnghttp2` - { $as_echo "$as_me:${as_lineno-$LINENO}: -L is $LD_H2" >&5 -$as_echo "$as_me: -L is $LD_H2" >&6;} + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_SSH to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_SSH to CURL_LIBRARY_PATH" >&6;} + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh" + else + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + fi +elif test X"$OPT_WOLFSSH" != Xno; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - LDFLAGS="$LDFLAGS $LD_H2" - CPPFLAGS="$CPPFLAGS $CPP_H2" - LIBS="$LIB_H2 $LIBS" + if test "$OPT_WOLFSSH" != yes; then + WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config" + WOLFSSH_LIBS=`$WOLFCONFIG --libs` + LDFLAGS="$LDFLAGS $WOLFSSH_LIBS" + LDFLAGSPC="$LDFLAGSPC $WOLFSSH_LIBS" + CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`" + fi - # use nghttp2_option_set_no_recv_client_magic to require nghttp2 - # >= 1.0.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nghttp2_option_set_no_recv_client_magic in -lnghttp2" >&5 -$as_echo_n "checking for nghttp2_option_set_no_recv_client_magic in -lnghttp2... " >&6; } -if ${ac_cv_lib_nghttp2_nghttp2_option_set_no_recv_client_magic+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wolfSSH_Init in -lwolfssh" >&5 +printf %s "checking for wolfSSH_Init in -lwolfssh... " >&6; } +if test ${ac_cv_lib_wolfssh_wolfSSH_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lnghttp2 $LIBS" +LIBS="-lwolfssh $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -27181,8158 +28996,10395 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char nghttp2_option_set_no_recv_client_magic (); -int main (void) +char wolfSSH_Init (); +int main(void) +{ +return wolfSSH_Init (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_wolfssh_wolfSSH_Init=yes +else $as_nop + ac_cv_lib_wolfssh_wolfSSH_Init=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wolfssh_wolfSSH_Init" >&5 +printf "%s\n" "$ac_cv_lib_wolfssh_wolfSSH_Init" >&6; } +if test "x$ac_cv_lib_wolfssh_wolfSSH_Init" = xyes +then : + printf "%s\n" "#define HAVE_LIBWOLFSSH 1" >>confdefs.h + + LIBS="-lwolfssh $LIBS" + +fi + + + for ac_header in wolfssh/ssh.h +do : + ac_fn_c_check_header_compile "$LINENO" "wolfssh/ssh.h" "ac_cv_header_wolfssh_ssh_h" "$ac_includes_default" +if test "x$ac_cv_header_wolfssh_ssh_h" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSH_SSH_H 1" >>confdefs.h + curl_ssh_msg="enabled (wolfSSH)" + +printf "%s\n" "#define USE_WOLFSSH 1" >>confdefs.h + + USE_WOLFSSH=1 + +fi + +done +fi + + +LDAPLIBNAME="" + +# Check whether --with-ldap-lib was given. +if test ${with_ldap_lib+y} +then : + withval=$with_ldap_lib; LDAPLIBNAME="$withval" +fi + + +LBERLIBNAME="" + +# Check whether --with-lber-lib was given. +if test ${with_lber_lib+y} +then : + withval=$with_lber_lib; LBERLIBNAME="$withval" +fi + + +clean_LDAP_CPPFLAGS=$CPPFLAGS +clean_LDAP_LDFLAGS=$LDFLAGS +clean_LDAP_LIBS=$LIBS +OPT_LDAP=off + +# Check whether --with-ldap was given. +if test ${with_ldap+y} +then : + withval=$with_ldap; OPT_LDAP=$withval +fi + + +case "$OPT_LDAP" in + no) + want_ldap="no" + ;; + yes) + want_ldap="yes" + ;; + off) + want_ldap="default" + ;; + *) + want_ldap="yes" + if test -d "$OPT_LDAP/lib$libsuff"; then + LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib$libsuff" + DIR_LDAP="$OPT_LDAP/lib$libsuff" + elif test -d "$OPT_LDAP/lib"; then + LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib" + DIR_LDAP="$OPT_LDAP/lib" + fi + if test -d "$OPT_LDAP/include"; then + CPPFLAGS="$CPPFLAGS -I$OPT_LDAP/include" + fi + ldap_askedfor="yes" + ;; +esac + +if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lber.h" >&5 +printf %s "checking for lber.h... " >&6; } +if test ${curl_cv_header_lber_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #include + +int main(void) +{ + + BerValue *bvp = NULL; + BerElement *bep = ber_init(bvp); + ber_free(bep, 1); + + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + curl_cv_header_lber_h="yes" + +else $as_nop + + curl_cv_header_lber_h="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_lber_h" >&5 +printf "%s\n" "$curl_cv_header_lber_h" >&6; } + if test "$curl_cv_header_lber_h" = "yes"; then + +printf "%s\n" "#define HAVE_LBER_H 1" >>confdefs.h + + # + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #include + +int main(void) +{ + + BerValue *bvp = NULL; + BerElement *bep = ber_init(bvp); + ber_free(bep, 1); + + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + curl_cv_need_header_lber_h="no" + +else $as_nop + + curl_cv_need_header_lber_h="yes" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + # + case "$curl_cv_need_header_lber_h" in + yes) + +printf "%s\n" "#define NEED_LBER_H 1" >>confdefs.h + + ;; + esac + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ldap.h" >&5 +printf %s "checking for ldap.h... " >&6; } +if test ${curl_cv_header_ldap_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #include + +int main(void) { -return nghttp2_option_set_no_recv_client_magic (); - ; - return 0; + + LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); + int res = ldap_unbind(ldp); + (void)res; + + return 0; } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nghttp2_nghttp2_option_set_no_recv_client_magic=yes -else - ac_cv_lib_nghttp2_nghttp2_option_set_no_recv_client_magic=no +if ac_fn_c_try_compile "$LINENO" +then : + + curl_cv_header_ldap_h="yes" + +else $as_nop + + curl_cv_header_ldap_h="no" + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nghttp2_nghttp2_option_set_no_recv_client_magic" >&5 -$as_echo "$ac_cv_lib_nghttp2_nghttp2_option_set_no_recv_client_magic" >&6; } -if test "x$ac_cv_lib_nghttp2_nghttp2_option_set_no_recv_client_magic" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_ldap_h" >&5 +printf "%s\n" "$curl_cv_header_ldap_h" >&6; } + case "$curl_cv_header_ldap_h" in + yes) - for ac_header in nghttp2/nghttp2.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "nghttp2/nghttp2.h" "ac_cv_header_nghttp2_nghttp2_h" "$ac_includes_default" -if test "x$ac_cv_header_nghttp2_nghttp2_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NGHTTP2_NGHTTP2_H 1 -_ACEOF - curl_h2_msg="enabled (nghttp2)" - NGHTTP2_ENABLED=1 +printf "%s\n" "#define HAVE_LDAP_H 1" >>confdefs.h -$as_echo "#define USE_NGHTTP2 1" >>confdefs.h + ;; + esac - USE_NGHTTP2=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ldap_ssl.h" >&5 +printf %s "checking for ldap_ssl.h... " >&6; } +if test ${curl_cv_header_ldap_ssl_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -done + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif + #include -else - LDFLAGS=$CLEANLDFLAGS - CPPFLAGS=$CLEANCPPFLAGS - LIBS=$CLEANLIBS +int main(void) +{ -fi + LDAP *ldp = ldapssl_init("0.0.0.0", LDAPS_PORT, 1); + (void)ldp; + return 0; +} - else - if test X"$want_h2" != Xdefault; then - as_fn_error $? "--with-nghttp2 was specified but could not find libnghttp2 pkg-config file." "$LINENO" 5 - fi - fi +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -fi + curl_cv_header_ldap_ssl_h="yes" +else $as_nop -OPT_ZSH_FPATH=default + curl_cv_header_ldap_ssl_h="no" -# Check whether --with-zsh-functions-dir was given. -if test "${with_zsh_functions_dir+set}" = set; then : - withval=$with_zsh_functions_dir; OPT_ZSH_FPATH=$withval fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -case "$OPT_ZSH_FPATH" in - no) - ;; - default|yes) - ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_ldap_ssl_h" >&5 +printf "%s\n" "$curl_cv_header_ldap_ssl_h" >&6; } + case "$curl_cv_header_ldap_ssl_h" in + yes) - ;; - *) - ZSH_FUNCTIONS_DIR="$withval" +printf "%s\n" "#define HAVE_LDAP_SSL_H 1" >>confdefs.h - ;; -esac + ;; + esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test -z "$LDAPLIBNAME"; then + if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then + LDAPLIBNAME="wldap32" + LBERLIBNAME="no" + fi + fi + + if test "$LDAPLIBNAME"; then + if test "$LBERLIBNAME" -a "$LBERLIBNAME" != "no"; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_"$LDAPLIBNAME"""_ldap_init" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ldap_init in -l\"$LDAPLIBNAME\"" >&5 +printf %s "checking for ldap_init in -l\"$LDAPLIBNAME\"... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l"$LDAPLIBNAME" $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include -int main (void) -{ - ; - return 0; +#ifdef __cplusplus +extern "C" +#endif +char ldap_init (); +int main(void) +{ +return ldap_init (); + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + ldap_lib_ok=yes +else $as_nop + ldap_lib_ok=no +fi + + if test "$ldap_lib_ok" = "no"; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_"$LDAPLIBNAME"""_ldap_unbind" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ldap_unbind in -l\"$LDAPLIBNAME\"" >&5 +printf %s "checking for ldap_unbind in -l\"$LDAPLIBNAME\"... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l"$LDAPLIBNAME" -l$LBERLIBNAME $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no +#ifdef __cplusplus +extern "C" +#endif +char ldap_unbind (); +int main(void) +{ +return ldap_unbind (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + ldap_lib_ok=yes +else $as_nop + ldap_lib_ok=no fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$ldap_lib_ok" = "yes"; then + LIBS="-l$LDAPLIBNAME -l$LBERLIBNAME $LIBS" + fi + else + LIBS="-l$LDAPLIBNAME $LIBS" + fi + else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_"$LDAPLIBNAME"""_ldap_init" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ldap_init in -l\"$LDAPLIBNAME\"" >&5 +printf %s "checking for ldap_init in -l\"$LDAPLIBNAME\"... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l"$LDAPLIBNAME" $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#ifdef __cplusplus +extern "C" #endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () +char ldap_init (); +int main(void) { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; +return ldap_init (); return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + ldap_lib_ok=yes; LIBS="-l$LDAPLIBNAME $LIBS" +else $as_nop + ldap_lib_ok=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + fi -fi + if test "$ldap_lib_ok" = "no"; then + if test -n "$ldap_askedfor"; then + as_fn_error $? "couldn't detect the LDAP libraries" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: \"$LDAPLIBNAME\" is not an LDAP library: LDAP disabled" >&5 +printf "%s\n" "$as_me: WARNING: \"$LDAPLIBNAME\" is not an LDAP library: LDAP disabled" >&2;} +printf "%s\n" "#define CURL_DISABLE_LDAP 1" >>confdefs.h + CURL_DISABLE_LDAP=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc.h" >&5 -$as_echo_n "checking for malloc.h... " >&6; } -if ${curl_cv_header_malloc_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +printf "%s\n" "#define CURL_DISABLE_LDAPS 1" >>confdefs.h - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CURL_DISABLE_LDAPS=1 + CPPFLAGS=$clean_LDAP_CPPFLAGS + LDFLAGS=$clean_LDAP_LDFLAGS + LIBS=$clean_LDAP_LIBS + fi + else + + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LDAP libraries" >&5 +printf %s "checking for LDAP libraries... " >&6; } + # + u_libs="" + # + + # + curl_cv_save_LIBS="$LIBS" + curl_cv_ldap_LIBS="unknown" + # + for x_nlibs in '' "$u_libs" \ + '-lldap' \ + '-lldap -llber' \ + '-llber -lldap' \ + '-lldapssl -lldapx -lldapsdk' \ + '-lldapsdk -lldapx -lldapssl' \ + '-lldap -llber -lssl -lcrypto'; do + + if test "$curl_cv_ldap_LIBS" = "unknown"; then + if test -z "$x_nlibs"; then + LIBS="$curl_cv_save_LIBS" + else + LIBS="$x_nlibs $curl_cv_save_LIBS" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #endif + #ifndef NULL + #define NULL (void *)0 + #endif + #ifndef LDAP_DEPRECATED + #define LDAP_DEPRECATED 1 + #endif + #ifdef NEED_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif -int main (void) +int main(void) { - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); + BerValue *bvp = NULL; + BerElement *bep = ber_init(bvp); + LDAP *ldp = ldap_init("0.0.0.0", LDAP_PORT); + int res = ldap_unbind(ldp); + ber_free(bep, 1); + (void)res; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - curl_cv_header_malloc_h="yes" + curl_cv_ldap_LIBS="$x_nlibs" -else +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + done + # + LIBS="$curl_cv_save_LIBS" + # + case X-"$curl_cv_ldap_LIBS" in + X-unknown) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cannot find LDAP libraries" >&5 +printf "%s\n" "cannot find LDAP libraries" >&6; } + ;; + X-) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no additional lib required" >&5 +printf "%s\n" "no additional lib required" >&6; } + ;; + *) + if test -z "$curl_cv_save_LIBS"; then + LIBS="$curl_cv_ldap_LIBS" + else + LIBS="$curl_cv_ldap_LIBS $curl_cv_save_LIBS" + fi + # FIXME: Enable when ldap was detected via pkg-config + if false; then + LIBCURL_PC_REQUIRES_PRIVATE="ldap $LIBCURL_PC_REQUIRES_PRIVATE" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_ldap_LIBS" >&5 +printf "%s\n" "$curl_cv_ldap_LIBS" >&6; } + ;; + esac + # + + case X-"$curl_cv_ldap_LIBS" in + X-unknown) + if test -n "$ldap_askedfor"; then + as_fn_error $? "couldn't detect the LDAP libraries" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for LDAP support: LDAP disabled" >&5 +printf "%s\n" "$as_me: WARNING: Cannot find libraries for LDAP support: LDAP disabled" >&2;} - curl_cv_header_malloc_h="no" +printf "%s\n" "#define CURL_DISABLE_LDAP 1" >>confdefs.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CURL_DISABLE_LDAP=1 +printf "%s\n" "#define CURL_DISABLE_LDAPS 1" >>confdefs.h + + CURL_DISABLE_LDAPS=1 + CPPFLAGS=$clean_LDAP_CPPFLAGS + LDFLAGS=$clean_LDAP_LDFLAGS + LIBS=$clean_LDAP_LIBS + ;; + esac + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_malloc_h" >&5 -$as_echo "$curl_cv_header_malloc_h" >&6; } - if test "$curl_cv_header_malloc_h" = "yes"; then -cat >>confdefs.h <<_ACEOF -#define HAVE_MALLOC_H 1 +if test x$CURL_DISABLE_LDAP != x1; then + if test -n "$DIR_LDAP"; then + + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LDAP" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_LDAP to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_LDAP to CURL_LIBRARY_PATH" >&6;} + fi + fi + + if test "$LBERLIBNAME"; then + if test "$LBERLIBNAME" != "no" -a "$ldap_lib_ok" != "yes"; then + as_ac_Lib=`printf "%s\n" "ac_cv_lib_"$LBERLIBNAME"""_ber_free" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ber_free in -l\"$LBERLIBNAME\"" >&5 +printf %s "checking for ber_free in -l\"$LBERLIBNAME\"... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l"$LBERLIBNAME" $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef __cplusplus +extern "C" +#endif +char ber_free (); +int main(void) +{ +return ber_free (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_LIB"$LBERLIBNAME"" | $as_tr_cpp` 1 _ACEOF - # - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include + LIBS="-l"$LBERLIBNAME" $LIBS" -int main (void) -{ +else $as_nop - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: \"$LBERLIBNAME\" is not an LBER library: LDAP disabled" >&5 +printf "%s\n" "$as_me: WARNING: \"$LBERLIBNAME\" is not an LBER library: LDAP disabled" >&2;} - ; - return 0; -} +printf "%s\n" "#define CURL_DISABLE_LDAP 1" >>confdefs.h -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + CURL_DISABLE_LDAP=1 - curl_cv_need_header_malloc_h="no" +printf "%s\n" "#define CURL_DISABLE_LDAPS 1" >>confdefs.h -else + CURL_DISABLE_LDAPS=1 + CPPFLAGS=$clean_LDAP_CPPFLAGS + LDFLAGS=$clean_LDAP_LDFLAGS + LIBS=$clean_LDAP_LIBS - curl_cv_need_header_malloc_h="yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # - case "$curl_cv_need_header_malloc_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define NEED_MALLOC_H 1 -_ACEOF - ;; - esac + fi fi +fi +if test x$CURL_DISABLE_LDAP != x1; then + ac_fn_c_check_func "$LINENO" "ldap_url_parse" "ac_cv_func_ldap_url_parse" +if test "x$ac_cv_func_ldap_url_parse" = xyes +then : + printf "%s\n" "#define HAVE_LDAP_URL_PARSE 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memory.h" >&5 -$as_echo_n "checking for memory.h... " >&6; } -if ${curl_cv_header_memory_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include - -int main (void) -{ +fi +ac_fn_c_check_func "$LINENO" "ldap_init_fd" "ac_cv_func_ldap_init_fd" +if test "x$ac_cv_func_ldap_init_fd" = xyes +then : + printf "%s\n" "#define HAVE_LDAP_INIT_FD 1" >>confdefs.h - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); +fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test "$LDAPLIBNAME" = "wldap32"; then + curl_ldap_msg="enabled (winldap)" - curl_cv_header_memory_h="yes" +printf "%s\n" "#define USE_WIN32_LDAP 1" >>confdefs.h -else + else + if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then + curl_ldap_msg="enabled (OpenLDAP)" - curl_cv_header_memory_h="no" +printf "%s\n" "#define USE_OPENLDAP 1" >>confdefs.h + USE_OPENLDAP=1 + else + curl_ldap_msg="enabled (ancient OpenLDAP)" + fi + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test x$CURL_DISABLE_LDAPS != x1; then + curl_ldaps_msg="enabled" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_memory_h" >&5 -$as_echo "$curl_cv_header_memory_h" >&6; } - if test "$curl_cv_header_memory_h" = "yes"; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_MEMORY_H 1 -_ACEOF - - # - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +OPT_LIBRTMP=off -int main (void) -{ +# Check whether --with-librtmp was given. +if test ${with_librtmp+y} +then : + withval=$with_librtmp; OPT_LIBRTMP=$withval +fi - void *p = malloc(10); - void *q = calloc(10,10); - free(p); - free(q); - ; - return 0; -} +if test X"$OPT_LIBRTMP" != Xno; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + case "$OPT_LIBRTMP" in + yes) - curl_cv_need_header_memory_h="no" + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - curl_cv_need_header_memory_h="yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # - case "$curl_cv_need_header_memory_h" in - yes) +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define NEED_MEMORY_H 1 -_ACEOF + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - ;; - esac + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi + fi -for ac_header in sys/types.h \ - sys/time.h \ - sys/select.h \ - sys/socket.h \ - sys/ioctl.h \ - sys/uio.h \ - assert.h \ - unistd.h \ - stdlib.h \ - limits.h \ - arpa/inet.h \ - net/if.h \ - netinet/in.h \ - sys/un.h \ - netinet/tcp.h \ - netdb.h \ - sys/sockio.h \ - sys/stat.h \ - sys/param.h \ - termios.h \ - termio.h \ - sgtty.h \ - fcntl.h \ - alloca.h \ - time.h \ - io.h \ - pwd.h \ - utime.h \ - sys/utime.h \ - sys/poll.h \ - poll.h \ - socket.h \ - sys/resource.h \ - libgen.h \ - locale.h \ - errno.h \ - stdbool.h \ - arpa/tftp.h \ - sys/filio.h \ - sys/wait.h \ - setjmp.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_SYS_UN_H -#include -#endif + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for librtmp options with pkg-config" >&5 +printf %s "checking for librtmp options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists librtmp >/dev/null 2>&1 && echo 1` + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi + if test "$PKGCONFIG" != "no"; then + LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` + LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` + CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` + version=`$PKGCONFIG --modversion librtmp` + DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'` + else + as_fn_error $? "--librtmp was specified but could not find librtmp pkgconfig file." "$LINENO" 5 + fi -done + ;; + off) + LIB_RTMP="-lrtmp" + ;; + *) + LIB_RTMP="-lrtmp" + PREFIX_RTMP=$OPT_LIBRTMP + ;; + esac + if test -n "$PREFIX_RTMP"; then + LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff + CPP_RTMP=-I${PREFIX_RTMP}/include + DIR_RTMP=${PREFIX_RTMP}/lib$libsuff + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + LDFLAGS="$LDFLAGS $LD_RTMP" + LDFLAGSPC="$LDFLAGSPC $LD_RTMP" + CPPFLAGS="$CPPFLAGS $CPP_RTMP" + LIBS="$LIB_RTMP $LIBS" -int main (void) -{ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RTMP_Init in -lrtmp" >&5 +printf %s "checking for RTMP_Init in -lrtmp... " >&6; } +if test ${ac_cv_lib_rtmp_RTMP_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrtmp $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this sort of thing. */ - typedef int charset[2]; - const charset cs = { 0, 0 }; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this sort of thing. */ - char tx; - char *t = &tx; - char const *s = 0 ? (char *) 0 : (char const *) 0; - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; } bx; - struct s *b = &bx; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; +#ifdef __cplusplus +extern "C" #endif - - ; - return 0; +char RTMP_Init (); +int main(void) +{ +return RTMP_Init (); + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_rtmp_RTMP_Init=yes +else $as_nop + ac_cv_lib_rtmp_RTMP_Init=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rtmp_RTMP_Init" >&5 +printf "%s\n" "$ac_cv_lib_rtmp_RTMP_Init" >&6; } +if test "x$ac_cv_lib_rtmp_RTMP_Init" = xyes +then : + for ac_header in librtmp/rtmp.h +do : + ac_fn_c_check_header_compile "$LINENO" "librtmp/rtmp.h" "ac_cv_header_librtmp_rtmp_h" "$ac_includes_default" +if test "x$ac_cv_header_librtmp_rtmp_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBRTMP_RTMP_H 1" >>confdefs.h + curl_rtmp_msg="enabled (librtmp)" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler support of C99 variadic macro style" >&5 -$as_echo_n "checking for compiler support of C99 variadic macro style... " >&6; } -if ${curl_cv_variadic_macros_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define c99_vmacro3(first, ...) fun3(first, __VA_ARGS__) -#define c99_vmacro2(first, ...) fun2(first, __VA_ARGS__) - int fun3(int arg1, int arg2, int arg3); - int fun2(int arg1, int arg2); - int fun3(int arg1, int arg2, int arg3) - { return arg1 + arg2 + arg3; } - int fun2(int arg1, int arg2) - { return arg1 + arg2; } - -int main (void) -{ +printf "%s\n" "#define USE_LIBRTMP 1" >>confdefs.h - int res3 = c99_vmacro3(1, 2, 3); - int res2 = c99_vmacro2(1, 2); + USE_LIBRTMP=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE librtmp" - ; - return 0; -} +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +done - curl_cv_variadic_macros_c99="yes" +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS -else +fi - curl_cv_variadic_macros_c99="no" + if test X"$OPT_LIBRTMP" != Xoff && + test "$USE_LIBRTMP" != "1"; then + as_fn_error $? "librtmp libs and/or directories were not found where specified!" "$LINENO" 5 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_variadic_macros_c99" >&5 -$as_echo "$curl_cv_variadic_macros_c99" >&6; } - case "$curl_cv_variadic_macros_c99" in - yes) -cat >>confdefs.h <<_ACEOF -#define HAVE_VARIADIC_MACROS_C99 1 -_ACEOF +versioned_symbols_flavour= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether versioned symbols are wanted" >&5 +printf %s "checking whether versioned symbols are wanted... " >&6; } +# Check whether --enable-versioned-symbols was given. +if test ${enable_versioned_symbols+y} +then : + enableval=$enable_versioned_symbols; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 +printf %s "checking if libraries can be versioned... " >&6; } + GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` + if test -z "$GLD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You need an ld version supporting the --version-script option" >&5 +printf "%s\n" "$as_me: WARNING: You need an ld version supporting the --version-script option" >&2;} + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + if test "x$enableval" != "xyes"; then + versioned_symbols_flavour="$enableval" + elif test "x$CURL_WITH_MULTI_SSL" = "x1"; then + versioned_symbols_flavour="MULTISSL_" + elif test "x$OPENSSL_ENABLED" = "x1"; then + versioned_symbols_flavour="OPENSSL_" + elif test "x$MBEDTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="MBEDTLS_" + elif test "x$WOLFSSL_ENABLED" = "x1"; then + versioned_symbols_flavour="WOLFSSL_" + elif test "x$GNUTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="GNUTLS_" + elif test "x$RUSTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="RUSTLS_" + else + versioned_symbols_flavour="" + fi + versioned_symbols="yes" + fi + ;; - ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler support of old gcc variadic macro style" >&5 -$as_echo_n "checking for compiler support of old gcc variadic macro style... " >&6; } -if ${curl_cv_variadic_macros_gcc+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define gcc_vmacro3(first, args...) fun3(first, args) -#define gcc_vmacro2(first, args...) fun2(first, args) - int fun3(int arg1, int arg2, int arg3); - int fun2(int arg1, int arg2); - int fun3(int arg1, int arg2, int arg3) - { return arg1 + arg2 + arg3; } - int fun2(int arg1, int arg2) - { return arg1 + arg2; } +else $as_nop -int main (void) -{ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - int res3 = gcc_vmacro3(1, 2, 3); - int res2 = gcc_vmacro2(1, 2); - ; - return 0; -} +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - curl_cv_variadic_macros_gcc="yes" +CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX="$versioned_symbols_flavour" +CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME="4" + if test "x$versioned_symbols" = 'xyes'; then + CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE= + CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE='#' else - - curl_cv_variadic_macros_gcc="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - + CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE='#' + CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_variadic_macros_gcc" >&5 -$as_echo "$curl_cv_variadic_macros_gcc" >&6; } - case "$curl_cv_variadic_macros_gcc" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_VARIADIC_MACROS_GCC 1 -_ACEOF - ;; - esac -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "$curl_cv_wince" = 'yes'; then + want_winuni="yes" else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF + want_winuni="no" +fi +if test "$curl_cv_native_windows" = "yes"; then + if test "$curl_cv_winuwp" = 'yes'; then + want_winuni="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable Windows Unicode (Windows native builds only)" >&5 +printf %s "checking whether to enable Windows Unicode (Windows native builds only)... " >&6; } + # Check whether --enable-windows-unicode was given. +if test ${enable_windows_unicode+y} +then : + enableval=$enable_windows_unicode; case "$enableval" in + yes) + want_winuni="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include + fi -int main (void) -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$want_winuni" = "yes"; then + CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE" + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + if test "$want_winuni" = "yes"; then + USE_UNICODE_TRUE= + USE_UNICODE_FALSE='#' +else + USE_UNICODE_TRUE='#' + USE_UNICODE_FALSE= fi - for ac_header in sys/types.h sys/time.h time.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi +tst_links_winidn='no' +if test "$curl_cv_native_windows" = 'yes'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable Windows native IDN (Windows native builds only)" >&5 +printf %s "checking whether to enable Windows native IDN (Windows native builds only)... " >&6; } + OPT_WINIDN="default" -done +# Check whether --with-winidn was given. +if test ${with_winidn+y} +then : + withval=$with_winidn; OPT_WINIDN=$withval +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 -$as_echo_n "checking for struct timeval... " >&6; } -if ${curl_cv_struct_timeval+:} false; then : - $as_echo_n "(cached) " >&6 -else + case "$OPT_WINIDN" in + no|default) + want_winidn="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + yes) + want_winidn="yes" + want_winidn_path="default" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + *) + want_winidn="yes" + want_winidn_path="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($withval)" >&5 +printf "%s\n" "yes ($withval)" >&6; } + ;; + esac + if test "$want_winidn" = "yes"; then + clean_CPPFLAGS="$CPPFLAGS" + clean_LDFLAGS="$LDFLAGS" + clean_LDFLAGSPC="$LDFLAGSPC" + clean_LIBS="$LIBS" + WINIDN_LIBS="-lnormaliz" + WINIDN_CPPFLAGS="" + # + if test "$want_winidn_path" != "default"; then + WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" + WINIDN_CPPFLAGS="-I$want_winidn_path/include" + fi + # + CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" + LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" + LDFLAGSPC="$LDFLAGSPC $WINIDN_LDFLAGS" + LIBS="$WINIDN_LIBS $LIBS" + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IdnToUnicode can be linked" >&5 +printf %s "checking if IdnToUnicode can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif + #include -int main (void) +int main(void) { - struct timeval ts; - ts.tv_sec = 0; - ts.tv_usec = 0; + #if (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600) && \ + (!defined(WINVER) || WINVER < 0x600) + WINBASEAPI int WINAPI IdnToUnicode(DWORD dwFlags, + const WCHAR *lpASCIICharStr, + int cchASCIIChar, + WCHAR *lpUnicodeCharStr, + int cchUnicodeChar); + #endif + IdnToUnicode(0, NULL, 0, NULL, 0); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - curl_cv_struct_timeval="yes" - -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_winidn="yes" - curl_cv_struct_timeval="no" +else $as_nop -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_winidn="no" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_struct_timeval" >&5 -$as_echo "$curl_cv_struct_timeval" >&6; } - case "$curl_cv_struct_timeval" in - yes) +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + # + if test "$tst_links_winidn" = "yes"; then -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TIMEVAL 1 -_ACEOF +printf "%s\n" "#define USE_WIN32_IDN 1" >>confdefs.h - ;; - esac + IDN_ENABLED=1 + curl_idn_msg="enabled (Windows-native)" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libraries for IDN support: IDN disabled" >&5 +printf "%s\n" "$as_me: WARNING: Cannot find libraries for IDN support: IDN disabled" >&2;} + CPPFLAGS="$clean_CPPFLAGS" + LDFLAGS="$clean_LDFLAGS" + LDFLAGSPC="$clean_LDFLAGSPC" + LIBS="$clean_LIBS" + fi + fi +fi +tst_links_appleidn='no' +if test "$curl_cv_apple" = 'yes'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build with Apple IDN" >&5 +printf %s "checking whether to build with Apple IDN... " >&6; } + OPT_IDN="default" - if test "x$cross_compiling" != xyes; then +# Check whether --with-apple-idn was given. +if test ${with_apple_idn+y} +then : + withval=$with_apple_idn; OPT_IDN=$withval +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking run-time libs availability" >&5 -$as_echo_n "checking run-time libs availability... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + case "$OPT_IDN" in + yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes, check" >&5 +printf "%s\n" "yes, check" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uidna_openUTS46 in -licucore" >&5 +printf %s "checking for uidna_openUTS46 in -licucore... " >&6; } +if test ${ac_cv_lib_icucore_uidna_openUTS46+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-licucore $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -main() + +#ifdef __cplusplus +extern "C" +#endif +char uidna_openUTS46 (); +int main(void) { +return uidna_openUTS46 (); return 0; } - _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: fine" >&5 -$as_echo "fine" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } - as_fn_error $? "one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS" "$LINENO" 5 - +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_icucore_uidna_openUTS46=yes +else $as_nop + ac_cv_lib_icucore_uidna_openUTS46=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_icucore_uidna_openUTS46" >&5 +printf "%s\n" "$ac_cv_lib_icucore_uidna_openUTS46" >&6; } +if test "x$ac_cv_lib_icucore_uidna_openUTS46" = xyes +then : + for ac_header in unicode/uidna.h +do : + ac_fn_c_check_header_compile "$LINENO" "unicode/uidna.h" "ac_cv_header_unicode_uidna_h" "$ac_includes_default" +if test "x$ac_cv_header_unicode_uidna_h" = xyes +then : + printf "%s\n" "#define HAVE_UNICODE_UIDNA_H 1" >>confdefs.h + curl_idn_msg="enabled (AppleIDN)" - fi - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 -$as_echo_n "checking size of size_t... " >&6; } -if ${ac_cv_sizeof_size_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : +printf "%s\n" "#define USE_APPLE_IDN 1" >>confdefs.h -else - if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (size_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_size_t=0 - fi -fi + USE_APPLE_IDN=1 + IDN_ENABLED=1 + LIBS="-licucore -liconv $LIBS" + tst_links_appleidn='yes' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 -$as_echo "$ac_cv_sizeof_size_t" >&6; } +done +fi -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t -_ACEOF + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build with libidn2" >&5 +printf %s "checking whether to build with libidn2... " >&6; } +OPT_IDN="default" -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi +# Check whether --with-libidn2 was given. +if test ${with_libidn2+y} +then : + withval=$with_libidn2; OPT_IDN=$withval fi +if test "x$tst_links_winidn" = "xyes"; then + want_idn="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (using WinIDN instead)" >&5 +printf "%s\n" "no (using WinIDN instead)" >&6; } +elif test "x$tst_links_appleidn" = "xyes"; then + want_idn="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (using AppleIDN instead)" >&5 +printf "%s\n" "no (using AppleIDN instead)" >&6; } +else + case "$OPT_IDN" in + no) + want_idn="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + default) + want_idn="yes" + want_idn_path="default" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: (assumed) yes" >&5 +printf "%s\n" "(assumed) yes" >&6; } + ;; + yes) + want_idn="yes" + want_idn_path="default" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + *) + want_idn="yes" + want_idn_path="$withval" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ($withval)" >&5 +printf "%s\n" "yes ($withval)" >&6; } + ;; + esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +if test "$want_idn" = "yes"; then + clean_CPPFLAGS="$CPPFLAGS" + clean_LDFLAGS="$LDFLAGS" + clean_LDFLAGSPC="$LDFLAGSPC" + clean_LIBS="$LIBS" + PKGCONFIG="no" + # + if test "$want_idn_path" != "default"; then + IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig" + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int=0 - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } + fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libidn2 options with pkg-config" >&5 +printf %s "checking for libidn2 options with pkg-config... " >&6; } + itexists=` + if test -n "$IDN_PCDIR"; then + PKG_CONFIG_LIBDIR="$IDN_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libidn2 >/dev/null 2>&1 && echo 1` -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi + if test "$PKGCONFIG" != "no"; then + IDN_LIBS=` + if test -n "$IDN_PCDIR"; then + PKG_CONFIG_LIBDIR="$IDN_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-l libidn2 2>/dev/null` + IDN_LDFLAGS=` + if test -n "$IDN_PCDIR"; then + PKG_CONFIG_LIBDIR="$IDN_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-L libidn2 2>/dev/null` + IDN_CPPFLAGS=` + if test -n "$IDN_PCDIR"; then + PKG_CONFIG_LIBDIR="$IDN_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libidn2 2>/dev/null` + IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'` + else + IDN_LIBS="-lidn2" + IDN_LDFLAGS="-L$want_idn_path/lib$libsuff" + IDN_CPPFLAGS="-I$want_idn_path/include" + IDN_DIR="$want_idn_path/lib$libsuff" + fi + else -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (short) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_short=0 - fi + ;; +esac fi - +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 -$as_echo_n "checking size of time_t... " >&6; } -if ${ac_cv_sizeof_time_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - if test "$ac_cv_type_time_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (time_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_time_t=0 - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 -$as_echo "$ac_cv_sizeof_time_t" >&6; } - + fi -cat >>confdefs.h <<_ACEOF -#define SIZEOF_TIME_T $ac_cv_sizeof_time_t -_ACEOF - + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libidn2 options with pkg-config" >&5 +printf %s "checking for libidn2 options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libidn2 >/dev/null 2>&1 && echo 1` -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 -$as_echo_n "checking size of off_t... " >&6; } -if ${ac_cv_sizeof_off_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -else - if test "$ac_cv_type_off_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (off_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_off_t=0 - fi -fi + if test "$PKGCONFIG" != "no"; then + IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null` + IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null` + IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null` + IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'` + else + IDN_LIBS="-lidn2" + fi + fi + # + if test "$PKGCONFIG" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_LIBS: \"$IDN_LIBS\"" >&5 +printf "%s\n" "$as_me: pkg-config: IDN_LIBS: \"$IDN_LIBS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: IDN_DIR: \"$IDN_DIR\"" >&5 +printf "%s\n" "$as_me: pkg-config: IDN_DIR: \"$IDN_DIR\"" >&6;} + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: IDN_LIBS: \"$IDN_LIBS\"" >&5 +printf "%s\n" "$as_me: IDN_LIBS: \"$IDN_LIBS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&5 +printf "%s\n" "$as_me: IDN_LDFLAGS: \"$IDN_LDFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&5 +printf "%s\n" "$as_me: IDN_CPPFLAGS: \"$IDN_CPPFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: IDN_DIR: \"$IDN_DIR\"" >&5 +printf "%s\n" "$as_me: IDN_DIR: \"$IDN_DIR\"" >&6;} + fi + # + CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS" + LDFLAGS="$LDFLAGS $IDN_LDFLAGS" + LDFLAGSPC="$LDFLAGSPC $IDN_LDFLAGS" + LIBS="$IDN_LIBS $LIBS" + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if idn2_lookup_ul can be linked" >&5 +printf %s "checking if idn2_lookup_ul can be linked... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 -$as_echo "$ac_cv_sizeof_off_t" >&6; } +#define idn2_lookup_ul innocuous_idn2_lookup_ul +#ifdef __STDC__ +# include +#else +# include +#endif +#undef idn2_lookup_ul +#ifdef __cplusplus +extern "C" +#endif +char idn2_lookup_ul (); +#if defined __stub_idn2_lookup_ul || defined __stub___idn2_lookup_ul +#error force compilation error +#endif +int main(void) +{ +return idn2_lookup_ul (); + return 0; +} -cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_libidn="yes" +else $as_nop -o=$CPPFLAGS -CPPFLAGS="-I$srcdir/include $CPPFLAGS" -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of curl_off_t" >&5 -$as_echo_n "checking size of curl_off_t... " >&6; } -if ${ac_cv_sizeof_curl_off_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (curl_off_t))" "ac_cv_sizeof_curl_off_t" " -#include - -"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_libidn="no" -else - if test "$ac_cv_type_curl_off_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (curl_off_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_curl_off_t=0 - fi fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + # + ac_fn_c_check_header_compile "$LINENO" "idn2.h" "ac_cv_header_idn2_h" "$ac_includes_default" +if test "x$ac_cv_header_idn2_h" = xyes +then : + printf "%s\n" "#define HAVE_IDN2_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_curl_off_t" >&5 -$as_echo "$ac_cv_sizeof_curl_off_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CURL_OFF_T $ac_cv_sizeof_curl_off_t -_ACEOF -CPPFLAGS=$o - -ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = xyes; then : + if test "$tst_links_libidn" = "yes"; then -$as_echo "#define HAVE_LONGLONG 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBIDN2 1" >>confdefs.h - longlong="yes" + IDN_ENABLED=1 + curl_idn_msg="enabled (libidn2)" + if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $IDN_DIR to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $IDN_DIR to CURL_LIBRARY_PATH" >&6;} + fi + LIBCURL_PC_REQUIRES_PRIVATE="libidn2 $LIBCURL_PC_REQUIRES_PRIVATE" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libidn2" >&5 +printf "%s\n" "$as_me: WARNING: Cannot find libidn2" >&2;} + CPPFLAGS="$clean_CPPFLAGS" + LDFLAGS="$clean_LDFLAGS" + LDFLAGSPC="$clean_LDFLAGSPC" + LIBS="$clean_LIBS" + want_idn="no" + fi fi -if test "xyes" = "x$longlong"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if numberLL works" >&5 -$as_echo_n "checking if numberLL works... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - -int main (void) -{ - - long long val = 1000LL; +OPT_H2="yes" - ; - return 0; -} +if test "x$disable_http" = "xyes"; then + # without HTTP nghttp2 is no use + OPT_H2="no" +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +# Check whether --with-nghttp2 was given. +if test ${with_nghttp2+y} +then : + withval=$with_nghttp2; OPT_H2=$withval +fi -$as_echo "#define HAVE_LL 1" >>confdefs.h +case "$OPT_H2" in + no) + want_nghttp2="no" + ;; + yes) + want_nghttp2="default" + want_nghttp2_path="" + want_nghttp2_pkg_config_path="" + ;; + *) + want_nghttp2="yes" + want_nghttp2_path="$withval" + want_nghttp2_pkg_config_path="$withval/lib/pkgconfig" + ;; +esac +if test X"$want_nghttp2" != Xno; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -# check for ssize_t -ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes; then : +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - -$as_echo "#define ssize_t int" >>confdefs.h - + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi -# check for bool type -ac_fn_c_check_type "$LINENO" "bool" "ac_cv_type_bool" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STDBOOL_H -#include -#endif - -" -if test "x$ac_cv_type_bool" = xyes; then : - + fi -$as_echo "#define HAVE_BOOL_T 1" >>confdefs.h + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libnghttp2 options with pkg-config" >&5 +printf %s "checking for libnghttp2 options with pkg-config... " >&6; } + itexists=` + if test -n "$want_nghttp2_pkg_config_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp2_pkg_config_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libnghttp2 >/dev/null 2>&1 && echo 1` + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -fi + if test "$PKGCONFIG" != "no"; then + LIB_H2=` + if test -n "$want_nghttp2_pkg_config_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp2_pkg_config_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-l libnghttp2` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_H2" >&5 +printf "%s\n" "$as_me: -l is $LIB_H2" >&6;} -curl_includes_ws2tcpip="\ -/* includes start */ -#ifdef HAVE_WINDOWS_H -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include -# ifdef HAVE_WINSOCK2_H -# include -# ifdef HAVE_WS2TCPIP_H -# include -# endif -# endif -#endif -/* includes end */" + CPP_H2=` + if test -n "$want_nghttp2_pkg_config_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp2_pkg_config_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libnghttp2` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_H2" >&5 +printf "%s\n" "$as_me: -I is $CPP_H2" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows.h" >&5 -$as_echo_n "checking for windows.h... " >&6; } -if ${curl_cv_header_windows_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + LD_H2=` + if test -n "$want_nghttp2_pkg_config_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp2_pkg_config_path" + export PKG_CONFIG_LIBDIR + fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + $PKGCONFIG --libs-only-L libnghttp2` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_H2" >&5 +printf "%s\n" "$as_me: -L is $LD_H2" >&6;} + + DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'` + elif test x"$want_nghttp2_path" != x; then + LIB_H2="-lnghttp2" + LD_H2=-L${want_nghttp2_path}/lib$libsuff + CPP_H2=-I${want_nghttp2_path}/include + DIR_H2=${want_nghttp2_path}/lib$libsuff + elif test X"$want_nghttp2" != Xdefault; then + as_fn_error $? "--with-nghttp2 was specified but could not find libnghttp2 pkg-config file." "$LINENO" 5 + else + LIB_H2="-lnghttp2" + fi + + LDFLAGS="$LDFLAGS $LD_H2" + LDFLAGSPC="$LDFLAGSPC $LD_H2" + CPPFLAGS="$CPPFLAGS $CPP_H2" + LIBS="$LIB_H2 $LIBS" + + # use nghttp2_session_get_stream_local_window_size to require nghttp2 + # >= 1.15.0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nghttp2_session_get_stream_local_window_size in -lnghttp2" >&5 +printf %s "checking for nghttp2_session_get_stream_local_window_size in -lnghttp2... " >&6; } +if test ${ac_cv_lib_nghttp2_nghttp2_session_get_stream_local_window_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnghttp2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN +#ifdef __cplusplus +extern "C" #endif -#include - -int main (void) +char nghttp2_session_get_stream_local_window_size (); +int main(void) { - -#if defined(__CYGWIN__) || defined(__CEGCC__) - HAVE_WINDOWS_H shall not be defined. -#else - int dummy=2*WINVER; -#endif - - ; - return 0; +return nghttp2_session_get_stream_local_window_size (); + return 0; } - _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - curl_cv_header_windows_h="yes" - -else - - curl_cv_header_windows_h="no" - +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_nghttp2_nghttp2_session_get_stream_local_window_size=yes +else $as_nop + ac_cv_lib_nghttp2_nghttp2_session_get_stream_local_window_size=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_windows_h" >&5 -$as_echo "$curl_cv_header_windows_h" >&6; } - case "$curl_cv_header_windows_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_WINDOWS_H 1 -_ACEOF - - ;; - esac - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winsock2.h" >&5 -$as_echo_n "checking for winsock2.h... " >&6; } -if ${curl_cv_header_winsock2_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nghttp2_nghttp2_session_get_stream_local_window_size" >&5 +printf "%s\n" "$ac_cv_lib_nghttp2_nghttp2_session_get_stream_local_window_size" >&6; } +if test "x$ac_cv_lib_nghttp2_nghttp2_session_get_stream_local_window_size" = xyes +then : -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include - -int main (void) -{ + for ac_header in nghttp2/nghttp2.h +do : + ac_fn_c_check_header_compile "$LINENO" "nghttp2/nghttp2.h" "ac_cv_header_nghttp2_nghttp2_h" "$ac_includes_default" +if test "x$ac_cv_header_nghttp2_nghttp2_h" = xyes +then : + printf "%s\n" "#define HAVE_NGHTTP2_NGHTTP2_H 1" >>confdefs.h + curl_h2_msg="enabled (nghttp2)" -#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) - HAVE_WINSOCK2_H shall not be defined. -#else - int dummy=2*IPPROTO_ESP; -#endif +printf "%s\n" "#define USE_NGHTTP2 1" >>confdefs.h - ; - return 0; -} + USE_NGHTTP2=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp2" -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +fi - curl_cv_header_winsock2_h="yes" +done -else + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_H2 to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_H2 to CURL_LIBRARY_PATH" >&6;} - curl_cv_header_winsock2_h="no" +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_winsock2_h" >&5 -$as_echo "$curl_cv_header_winsock2_h" >&6; } - case "$curl_cv_header_winsock2_h" in - yes) - -cat >>confdefs.h <<_ACEOF -#define HAVE_WINSOCK2_H 1 -_ACEOF - - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ws2tcpip.h" >&5 -$as_echo_n "checking for ws2tcpip.h... " >&6; } -if ${curl_cv_header_ws2tcpip_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +OPT_TCP2="no" +if test "x$disable_http" = "xyes"; then + # without HTTP, ngtcp2 is no use + OPT_TCP2="no" +fi -#undef inline -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#include -int main (void) -{ +# Check whether --with-ngtcp2 was given. +if test ${with_ngtcp2+y} +then : + withval=$with_ngtcp2; OPT_TCP2=$withval +fi -#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__) - HAVE_WS2TCPIP_H shall not be defined. -#else - int dummy=2*IP_PKTINFO; -#endif +case "$OPT_TCP2" in + no) + want_tcp2="no" + ;; + yes) + want_tcp2="default" + want_tcp2_path="" + ;; + *) + want_tcp2="yes" + want_tcp2_path="$withval/lib/pkgconfig" + ;; +esac - ; - return 0; -} +curl_tcp2_msg="no (--with-ngtcp2)" +if test X"$want_tcp2" != Xno; then -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test "$QUIC_ENABLED" != "yes"; then + as_fn_error $? "the detected TLS library does not support QUIC, making --with-ngtcp2 a no-no" "$LINENO" 5 + fi - curl_cv_header_ws2tcpip_h="yes" + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -else - curl_cv_header_ws2tcpip_h="no" + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_header_ws2tcpip_h" >&5 -$as_echo "$curl_cv_header_ws2tcpip_h" >&6; } - case "$curl_cv_header_ws2tcpip_h" in - yes) -cat >>confdefs.h <<_ACEOF -#define HAVE_WS2TCPIP_H 1 -_ACEOF - ;; +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - -curl_includes_sys_socket="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_sys_socket -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi -done - + fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libngtcp2 options with pkg-config" >&5 +printf %s "checking for libngtcp2 options with pkg-config... " >&6; } + itexists=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libngtcp2 >/dev/null 2>&1 && echo 1` -curl_preprocess_callconv="\ -/* preprocess start */ -#ifdef HAVE_WINDOWS_H -# define FUNCALLCONV __stdcall -#else -# define FUNCALLCONV -#endif -/* preprocess end */" + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - # - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_socklen_t data type" >&5 -$as_echo_n "checking for curl_socklen_t data type... " >&6; } - curl_typeof_curl_socklen_t="unknown" - for arg1 in int SOCKET; do - for arg2 in 'struct sockaddr' void; do - for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do - if test "$curl_typeof_curl_socklen_t" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$PKGCONFIG" != "no"; then + LIB_TCP2=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-l libngtcp2` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_TCP2" >&5 +printf "%s\n" "$as_me: -l is $LIB_TCP2" >&6;} - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_preprocess_callconv - extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *); + CPP_TCP2=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libngtcp2` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_TCP2" >&5 +printf "%s\n" "$as_me: -I is $CPP_TCP2" >&6;} -int main (void) -{ + LD_TCP2=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - $t *lenptr = 0; - if(0 != getpeername(0, 0, lenptr)) - return 1; + $PKGCONFIG --libs-only-L libngtcp2` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_TCP2" >&5 +printf "%s\n" "$as_me: -L is $LD_TCP2" >&6;} - ; - return 0; -} + LDFLAGS="$LDFLAGS $LD_TCP2" + LDFLAGSPC="$LDFLAGSPC $LD_TCP2" + CPPFLAGS="$CPPFLAGS $CPP_TCP2" + LIBS="$LIB_TCP2 $LIBS" -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test "x$cross_compiling" != "xyes"; then + DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_conn_client_new_versioned in -lngtcp2" >&5 +printf %s "checking for ngtcp2_conn_client_new_versioned in -lngtcp2... " >&6; } +if test ${ac_cv_lib_ngtcp2_ngtcp2_conn_client_new_versioned+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - curl_typeof_curl_socklen_t="$t" +#ifdef __cplusplus +extern "C" +#endif +char ngtcp2_conn_client_new_versioned (); +int main(void) +{ +return ngtcp2_conn_client_new_versioned (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ngtcp2_ngtcp2_conn_client_new_versioned=yes +else $as_nop + ac_cv_lib_ngtcp2_ngtcp2_conn_client_new_versioned=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - done - done - for t in socklen_t int; do - if test "$curl_typeof_curl_socklen_t" = "void"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_ngtcp2_conn_client_new_versioned" >&5 +printf "%s\n" "$ac_cv_lib_ngtcp2_ngtcp2_conn_client_new_versioned" >&6; } +if test "x$ac_cv_lib_ngtcp2_ngtcp2_conn_client_new_versioned" = xyes +then : - $curl_includes_sys_socket - typedef $t curl_socklen_t; + for ac_header in ngtcp2/ngtcp2.h +do : + ac_fn_c_check_header_compile "$LINENO" "ngtcp2/ngtcp2.h" "ac_cv_header_ngtcp2_ngtcp2_h" "$ac_includes_default" +if test "x$ac_cv_header_ngtcp2_ngtcp2_h" = xyes +then : + printf "%s\n" "#define HAVE_NGTCP2_NGTCP2_H 1" >>confdefs.h -int main (void) -{ +printf "%s\n" "#define USE_NGTCP2 1" >>confdefs.h - curl_socklen_t dummy; + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_TCP2 to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_TCP2 to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2" - ; - return 0; -} +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +done - curl_typeof_curl_socklen_t="$t" +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_typeof_curl_socklen_t" >&5 -$as_echo "$curl_typeof_curl_socklen_t" >&6; } - if test "$curl_typeof_curl_socklen_t" = "void" || - test "$curl_typeof_curl_socklen_t" = "unknown"; then - as_fn_error $? "cannot find data type for curl_socklen_t." "$LINENO" 5 - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of curl_socklen_t" >&5 -$as_echo_n "checking size of curl_socklen_t... " >&6; } - curl_sizeof_curl_socklen_t="unknown" - curl_pull_headers_socklen_t="unknown" - if test "$curl_cv_header_ws2tcpip_h" = "yes"; then - tst_pull_header_checks='none ws2tcpip' - tst_size_checks='4' - else - tst_pull_header_checks='none systypes syssocket' - tst_size_checks='4 8 2' - fi - for tst_size in $tst_size_checks; do - for tst_pull_headers in $tst_pull_header_checks; do - if test "$curl_sizeof_curl_socklen_t" = "unknown"; then - case $tst_pull_headers in - ws2tcpip) - tmp_includes="$curl_includes_ws2tcpip" - ;; - systypes) - tmp_includes="$curl_includes_sys_types" - ;; - syssocket) - tmp_includes="$curl_includes_sys_socket" - ;; - *) - tmp_includes="" - ;; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - $tmp_includes - typedef $curl_typeof_curl_socklen_t curl_socklen_t; - typedef char dummy_arr[sizeof(curl_socklen_t) == $tst_size ? 1 : -1]; + else + if test X"$want_tcp2" != Xdefault; then + as_fn_error $? "--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file." "$LINENO" 5 + fi + fi +fi -int main (void) -{ +if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ + "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" != "x1"; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - curl_socklen_t dummy; - ; - return 0; -} + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - curl_sizeof_curl_socklen_t="$tst_size" - curl_pull_headers_socklen_t="$tst_pull_headers" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_sizeof_curl_socklen_t" >&5 -$as_echo "$curl_sizeof_curl_socklen_t" >&6; } - if test "$curl_sizeof_curl_socklen_t" = "unknown"; then - as_fn_error $? "cannot find out size of curl_socklen_t." "$LINENO" 5 +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi - # - case $curl_pull_headers_socklen_t in - ws2tcpip) +done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_EOF -#define CURL_PULL_WS2TCPIP_H 1 -_EOF + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - ;; - systypes) + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi -cat >>confdefs.h <<_EOF -#define CURL_PULL_SYS_TYPES_H 1 -_EOF + fi - ;; - syssocket) + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libngtcp2_crypto_quictls options with pkg-config" >&5 +printf %s "checking for libngtcp2_crypto_quictls options with pkg-config... " >&6; } + itexists=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libngtcp2_crypto_quictls >/dev/null 2>&1 && echo 1` -cat >>confdefs.h <<_EOF -#define CURL_PULL_SYS_TYPES_H 1 -_EOF + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -cat >>confdefs.h <<_EOF -#define CURL_PULL_SYS_SOCKET_H 1 -_EOF + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_QUICTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - ;; - esac + $PKGCONFIG --libs-only-l libngtcp2_crypto_quictls` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_NGTCP2_CRYPTO_QUICTLS" >&5 +printf "%s\n" "$as_me: -l is $LIB_NGTCP2_CRYPTO_QUICTLS" >&6;} -cat >>confdefs.h <<_EOF -#define CURL_TYPEOF_CURL_SOCKLEN_T $curl_typeof_curl_socklen_t -_EOF + CPP_NGTCP2_CRYPTO_QUICTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libngtcp2_crypto_quictls` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_NGTCP2_CRYPTO_QUICTLS" >&5 +printf "%s\n" "$as_me: -I is $CPP_NGTCP2_CRYPTO_QUICTLS" >&6;} + LD_NGTCP2_CRYPTO_QUICTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi -cat >>confdefs.h <<_EOF -#define CURL_SIZEOF_CURL_SOCKLEN_T $curl_sizeof_curl_socklen_t -_EOF + $PKGCONFIG --libs-only-L libngtcp2_crypto_quictls` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_NGTCP2_CRYPTO_QUICTLS" >&5 +printf "%s\n" "$as_me: -L is $LD_NGTCP2_CRYPTO_QUICTLS" >&6;} + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_QUICTLS" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS" + LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS" + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_quictls" >&5 +printf %s "checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_quictls... " >&6; } +if test ${ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_recv_client_initial_cb+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2_crypto_quictls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -curl_includes_poll="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_POLL_H -# include -#endif -#ifdef HAVE_SYS_POLL_H -# include +#ifdef __cplusplus +extern "C" #endif -/* includes end */" - for ac_header in sys/types.h poll.h sys/poll.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_poll -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +char ngtcp2_crypto_recv_client_initial_cb (); +int main(void) +{ +return ngtcp2_crypto_recv_client_initial_cb (); + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_recv_client_initial_cb=yes +else $as_nop + ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_recv_client_initial_cb=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_recv_client_initial_cb" >&5 +printf "%s\n" "$ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_recv_client_initial_cb" >&6; } +if test "x$ac_cv_lib_ngtcp2_crypto_quictls_ngtcp2_crypto_recv_client_initial_cb" = xyes +then : + + for ac_header in ngtcp2/ngtcp2_crypto.h +do : + ac_fn_c_check_header_compile "$LINENO" "ngtcp2/ngtcp2_crypto.h" "ac_cv_header_ngtcp2_ngtcp2_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_ngtcp2_ngtcp2_crypto_h" = xyes +then : + printf "%s\n" "#define HAVE_NGTCP2_NGTCP2_CRYPTO_H 1" >>confdefs.h + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_quictls" fi done +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS +fi - # - tst_poll_events_macro_defined="unknown" - # - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + else + if test X"$want_tcp2" != Xdefault; then + as_fn_error $? "--with-ngtcp2 was specified but could not find ngtcp2_crypto_quictls pkg-config file." "$LINENO" 5 + fi + fi +fi - $curl_includes_poll +if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ + "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" = "x1"; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -int main (void) -{ -#if defined(events) || defined(revents) - return 0; -#else - force compilation error -#endif + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ; - return 0; -} + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - tst_poll_events_macro_defined="yes" +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - tst_poll_events_macro_defined="no" - + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # - if test "$tst_poll_events_macro_defined" = "yes"; then - if test "x$ac_cv_header_sys_poll_h" = "xyes"; then -cat >>confdefs.h <<_EOF -#define CURL_PULL_SYS_POLL_H 1 -_EOF + fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libngtcp2_crypto_ossl options with pkg-config" >&5 +printf %s "checking for libngtcp2_crypto_ossl options with pkg-config... " >&6; } + itexists=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libngtcp2_crypto_ossl >/dev/null 2>&1 && echo 1` + + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi fi - # + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_QUICTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" " -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif + $PKGCONFIG --libs-only-l libngtcp2_crypto_ossl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_NGTCP2_CRYPTO_QUICTLS" >&5 +printf "%s\n" "$as_me: -l is $LIB_NGTCP2_CRYPTO_QUICTLS" >&6;} -" -if test "x$ac_cv_type_in_addr_t" = xyes; then : + CPP_NGTCP2_CRYPTO_QUICTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libngtcp2_crypto_ossl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_NGTCP2_CRYPTO_QUICTLS" >&5 +printf "%s\n" "$as_me: -I is $CPP_NGTCP2_CRYPTO_QUICTLS" >&6;} -else + LD_NGTCP2_CRYPTO_QUICTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_addr_t equivalent" >&5 -$as_echo_n "checking for in_addr_t equivalent... " >&6; } -if ${curl_cv_in_addr_t_equiv+:} false; then : - $as_echo_n "(cached) " >&6 -else + $PKGCONFIG --libs-only-L libngtcp2_crypto_ossl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_NGTCP2_CRYPTO_QUICTLS" >&5 +printf "%s\n" "$as_me: -L is $LD_NGTCP2_CRYPTO_QUICTLS" >&6;} - curl_cv_in_addr_t_equiv="unknown" - for t in "unsigned long" int size_t unsigned long; do - if test "$curl_cv_in_addr_t_equiv" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_QUICTLS" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS" + LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_ossl" >&5 +printf %s "checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_ossl... " >&6; } +if test ${ac_cv_lib_ngtcp2_crypto_ossl_ngtcp2_crypto_recv_client_initial_cb+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2_crypto_ossl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif +#ifdef __cplusplus +extern "C" #endif - -int main (void) +char ngtcp2_crypto_recv_client_initial_cb (); +int main(void) { - - $t data = inet_addr ("1.2.3.4"); - - ; - return 0; +return ngtcp2_crypto_recv_client_initial_cb (); + return 0; } - _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - curl_cv_in_addr_t_equiv="$t" - +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ngtcp2_crypto_ossl_ngtcp2_crypto_recv_client_initial_cb=yes +else $as_nop + ac_cv_lib_ngtcp2_crypto_ossl_ngtcp2_crypto_recv_client_initial_cb=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - fi - done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_in_addr_t_equiv" >&5 -$as_echo "$curl_cv_in_addr_t_equiv" >&6; } - case "$curl_cv_in_addr_t_equiv" in - unknown) - as_fn_error $? "Cannot find a type to use in place of in_addr_t" "$LINENO" 5 - ;; - *) - -cat >>confdefs.h <<_ACEOF -#define in_addr_t $curl_cv_in_addr_t_equiv -_ACEOF - - ;; - esac - +LIBS=$ac_check_lib_save_LIBS fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_crypto_ossl_ngtcp2_crypto_recv_client_initial_cb" >&5 +printf "%s\n" "$ac_cv_lib_ngtcp2_crypto_ossl_ngtcp2_crypto_recv_client_initial_cb" >&6; } +if test "x$ac_cv_lib_ngtcp2_crypto_ossl_ngtcp2_crypto_recv_client_initial_cb" = xyes +then : + for ac_header in ngtcp2/ngtcp2_crypto.h +do : + ac_fn_c_check_header_compile "$LINENO" "ngtcp2/ngtcp2_crypto.h" "ac_cv_header_ngtcp2_ngtcp2_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_ngtcp2_ngtcp2_crypto_h" = xyes +then : + printf "%s\n" "#define HAVE_NGTCP2_NGTCP2_CRYPTO_H 1" >>confdefs.h + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_ossl" +printf "%s\n" "#define OPENSSL_QUIC_API2 1" >>confdefs.h - ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -#endif - -" -if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : - -$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h - fi +done - - - for ac_header in signal.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" -if test "x$ac_cv_header_signal_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SIGNAL_H 1 -_ACEOF +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS fi -done - - ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" " -#ifdef HAVE_SIGNAL_H -#include -#endif -" -if test "x$ac_cv_type_sig_atomic_t" = xyes; then : + else + if test X"$want_tcp2" != Xdefault; then + as_fn_error $? "--with-ngtcp2 was specified but could not find ngtcp2_crypto_ossl pkg-config file." "$LINENO" 5 + fi + fi +fi +if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BORINGSSL" = "x1"; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -$as_echo "#define HAVE_SIG_ATOMIC_T 1" >>confdefs.h + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - case "$ac_cv_type_sig_atomic_t" in - yes) - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sig_atomic_t is already defined as volatile" >&5 -$as_echo_n "checking if sig_atomic_t is already defined as volatile... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -#ifdef HAVE_SIGNAL_H -#include -#endif + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -int main (void) -{ + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi - static volatile sig_atomic_t dummy = 0; + fi - ; - return 0; -} + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libngtcp2_crypto_boringssl options with pkg-config" >&5 +printf %s "checking for libngtcp2_crypto_boringssl options with pkg-config... " >&6; } + itexists=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libngtcp2_crypto_boringssl >/dev/null 2>&1 && echo 1` -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_sig_atomic_t_volatile="no" -else + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_BORINGSSL=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_cv_sig_atomic_t_volatile="yes" + $PKGCONFIG --libs-only-l libngtcp2_crypto_boringssl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_NGTCP2_CRYPTO_BORINGSSL" >&5 +printf "%s\n" "$as_me: -l is $LIB_NGTCP2_CRYPTO_BORINGSSL" >&6;} -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$curl_cv_sig_atomic_t_volatile" = "yes"; then + CPP_NGTCP2_CRYPTO_BORINGSSL=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libngtcp2_crypto_boringssl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_NGTCP2_CRYPTO_BORINGSSL" >&5 +printf "%s\n" "$as_me: -I is $CPP_NGTCP2_CRYPTO_BORINGSSL" >&6;} -$as_echo "#define HAVE_SIG_ATOMIC_T_VOLATILE 1" >>confdefs.h + LD_NGTCP2_CRYPTO_BORINGSSL=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - fi - ;; - esac + $PKGCONFIG --libs-only-L libngtcp2_crypto_boringssl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_NGTCP2_CRYPTO_BORINGSSL" >&5 +printf "%s\n" "$as_me: -L is $LD_NGTCP2_CRYPTO_BORINGSSL" >&6;} + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_BORINGSSL" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_BORINGSSL" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_BORINGSSL" + LIBS="$LIB_NGTCP2_CRYPTO_BORINGSSL $LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_BORINGSSL=`echo $LD_NGTCP2_CRYPTO_BORINGSSL | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_boringssl" >&5 +printf %s "checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_boringssl... " >&6; } +if test ${ac_cv_lib_ngtcp2_crypto_boringssl_ngtcp2_crypto_recv_client_initial_cb+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2_crypto_boringssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -int main (void) + +#ifdef __cplusplus +extern "C" +#endif +char ngtcp2_crypto_recv_client_initial_cb (); +int main(void) { -return *(signal (0, 0)) (0) == 1; - ; - return 0; +return ngtcp2_crypto_recv_client_initial_cb (); + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ngtcp2_crypto_boringssl_ngtcp2_crypto_recv_client_initial_cb=yes +else $as_nop + ac_cv_lib_ngtcp2_crypto_boringssl_ngtcp2_crypto_recv_client_initial_cb=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_crypto_boringssl_ngtcp2_crypto_recv_client_initial_cb" >&5 +printf "%s\n" "$ac_cv_lib_ngtcp2_crypto_boringssl_ngtcp2_crypto_recv_client_initial_cb" >&6; } +if test "x$ac_cv_lib_ngtcp2_crypto_boringssl_ngtcp2_crypto_recv_client_initial_cb" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - - - - for ac_header in sys/select.h sys/socket.h + for ac_header in ngtcp2/ngtcp2_crypto.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "ngtcp2/ngtcp2_crypto.h" "ac_cv_header_ngtcp2_ngtcp2_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_ngtcp2_ngtcp2_crypto_h" = xyes +then : + printf "%s\n" "#define HAVE_NGTCP2_NGTCP2_CRYPTO_H 1" >>confdefs.h + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_BORINGSSL" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_NGTCP2_CRYPTO_BORINGSSL to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_NGTCP2_CRYPTO_BORINGSSL to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_boringssl" fi done - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for select" >&5 -$as_echo_n "checking for select... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif -#ifndef HAVE_WINDOWS_H -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif +fi -int main (void) -{ - select(0, 0, 0, 0, 0); + else + if test X"$want_tcp2" != Xdefault; then + as_fn_error $? "--with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file." "$LINENO" 5 + fi + fi +fi - ; - return 0; -} +if test "x$USE_NGTCP2" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_cv_select="yes" + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_select="no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$curl_cv_select" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of args and return type for select" >&5 -$as_echo_n "checking types of args and return type for select... " >&6; } -if ${curl_cv_func_select_args+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - curl_cv_func_select_args="unknown" - for sel_retv in 'int' 'ssize_t'; do - for sel_arg1 in 'int' 'ssize_t' 'size_t' 'unsigned long int' 'unsigned int'; do - for sel_arg234 in 'fd_set *' 'int *' 'void *'; do - for sel_arg5 in 'struct timeval *' 'const struct timeval *'; do - if test "$curl_cv_func_select_args" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define SELECTCALLCONV PASCAL -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#ifdef TIME_WITH_SYS_TIME -#include -#endif -#else -#ifdef HAVE_TIME_H -#include -#endif -#endif -#ifndef HAVE_WINDOWS_H -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define SELECTCALLCONV -#endif -#ifndef HAVE_STRUCT_TIMEVAL - struct timeval { - long tv_sec; - long tv_usec; - }; -#endif - extern $sel_retv SELECTCALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) -#endif - select($sel_arg1, - $sel_arg234, - $sel_arg234, - $sel_arg234, - $sel_arg5); + fi -int main (void) -{ + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libngtcp2_crypto_gnutls options with pkg-config" >&5 +printf %s "checking for libngtcp2_crypto_gnutls options with pkg-config... " >&6; } + itexists=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libngtcp2_crypto_gnutls >/dev/null 2>&1 && echo 1` - $sel_arg1 nfds=0; - $sel_arg234 rfds=0; - $sel_arg234 wfds=0; - $sel_arg234 efds=0; - $sel_retv res = select(nfds, rfds, wfds, efds, 0); + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_GNUTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - curl_cv_func_select_args="$sel_arg1,$sel_arg234,$sel_arg5,$sel_retv" + $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_NGTCP2_CRYPTO_GNUTLS" >&5 +printf "%s\n" "$as_me: -l is $LIB_NGTCP2_CRYPTO_GNUTLS" >&6;} -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - done - done - done + CPP_NGTCP2_CRYPTO_GNUTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_NGTCP2_CRYPTO_GNUTLS" >&5 +printf "%s\n" "$as_me: -I is $CPP_NGTCP2_CRYPTO_GNUTLS" >&6;} -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_select_args" >&5 -$as_echo "$curl_cv_func_select_args" >&6; } # AC-CACHE-CHECK - if test "$curl_cv_func_select_args" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find proper types to use for select args" >&5 -$as_echo "$as_me: WARNING: Cannot find proper types to use for select args" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_SELECT will not be defined" >&5 -$as_echo "$as_me: WARNING: HAVE_SELECT will not be defined" >&2;} - else - select_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_select_args" | sed 's/\*/\*/g'` - IFS=$select_prev_IFS - shift - # - sel_qual_type_arg5=$3 - # + LD_NGTCP2_CRYPTO_GNUTLS=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG1 $1 -_ACEOF + $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_NGTCP2_CRYPTO_GNUTLS" >&5 +printf "%s\n" "$as_me: -L is $LD_NGTCP2_CRYPTO_GNUTLS" >&6;} + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_GNUTLS" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS" + LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS" -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG234 $2 -_ACEOF + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_gnutls" >&5 +printf %s "checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_gnutls... " >&6; } +if test ${ac_cv_lib_ngtcp2_crypto_gnutls_ngtcp2_crypto_recv_client_initial_cb+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2_crypto_gnutls $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_RETV $4 +#ifdef __cplusplus +extern "C" +#endif +char ngtcp2_crypto_recv_client_initial_cb (); +int main(void) +{ +return ngtcp2_crypto_recv_client_initial_cb (); + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ngtcp2_crypto_gnutls_ngtcp2_crypto_recv_client_initial_cb=yes +else $as_nop + ac_cv_lib_ngtcp2_crypto_gnutls_ngtcp2_crypto_recv_client_initial_cb=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_crypto_gnutls_ngtcp2_crypto_recv_client_initial_cb" >&5 +printf "%s\n" "$ac_cv_lib_ngtcp2_crypto_gnutls_ngtcp2_crypto_recv_client_initial_cb" >&6; } +if test "x$ac_cv_lib_ngtcp2_crypto_gnutls_ngtcp2_crypto_recv_client_initial_cb" = xyes +then : - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) - ;; - *) - set -f - ;; - esac - # - case "$sel_qual_type_arg5" in - const*) - sel_qual_arg5=const - sel_type_arg5=`echo $sel_qual_type_arg5 | sed 's/^const //'` - ;; - *) - sel_qual_arg5= - sel_type_arg5=$sel_qual_type_arg5 - ;; - esac - # + for ac_header in ngtcp2/ngtcp2_crypto.h +do : + ac_fn_c_check_header_compile "$LINENO" "ngtcp2/ngtcp2_crypto.h" "ac_cv_header_ngtcp2_ngtcp2_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_ngtcp2_ngtcp2_crypto_h" = xyes +then : + printf "%s\n" "#define HAVE_NGTCP2_NGTCP2_CRYPTO_H 1" >>confdefs.h + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_gnutls" -cat >>confdefs.h <<_ACEOF -#define SELECT_QUAL_ARG5 $sel_qual_arg5 -_ACEOF +fi +done -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG5 $sel_type_arg5 -_ACEOF +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # +fi -cat >>confdefs.h <<_ACEOF -#define HAVE_SELECT 1 -_ACEOF - curl_cv_func_select="yes" + else + if test X"$want_tcp2" != Xdefault; then + as_fn_error $? "--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file." "$LINENO" 5 fi fi +fi + +if test "x$USE_NGTCP2" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - for ac_header in sys/types.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF fi - +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recv" >&5 -$as_echo_n "checking for recv... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif + fi -int main (void) -{ + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libngtcp2_crypto_wolfssl options with pkg-config" >&5 +printf %s "checking for libngtcp2_crypto_wolfssl options with pkg-config... " >&6; } + itexists=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libngtcp2_crypto_wolfssl >/dev/null 2>&1 && echo 1` - recv(0, 0, 0, 0); + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_WOLFSSL=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_cv_recv="yes" + $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_NGTCP2_CRYPTO_WOLFSSL" >&5 +printf "%s\n" "$as_me: -l is $LIB_NGTCP2_CRYPTO_WOLFSSL" >&6;} -else + CPP_NGTCP2_CRYPTO_WOLFSSL=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_NGTCP2_CRYPTO_WOLFSSL" >&5 +printf "%s\n" "$as_me: -I is $CPP_NGTCP2_CRYPTO_WOLFSSL" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_recv="no" + LD_NGTCP2_CRYPTO_WOLFSSL=` + if test -n "$want_tcp2_path"; then + PKG_CONFIG_LIBDIR="$want_tcp2_path" + export PKG_CONFIG_LIBDIR + fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$curl_cv_recv" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of args and return type for recv" >&5 -$as_echo_n "checking types of args and return type for recv... " >&6; } -if ${curl_cv_func_recv_args+:} false; then : - $as_echo_n "(cached) " >&6 -else + $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_NGTCP2_CRYPTO_WOLFSSL" >&5 +printf "%s\n" "$as_me: -L is $LD_NGTCP2_CRYPTO_WOLFSSL" >&6;} + + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_WOLFSSL" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL" + LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS" - curl_cv_func_recv_args="unknown" - for recv_retv in 'int' 'ssize_t'; do - for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do - for recv_arg2 in 'char *' 'void *'; do - for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do - for recv_arg4 in 'int' 'unsigned int'; do - if test "$curl_cv_func_recv_args" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_wolfssl" >&5 +printf %s "checking for ngtcp2_crypto_recv_client_initial_cb in -lngtcp2_crypto_wolfssl... " >&6; } +if test ${ac_cv_lib_ngtcp2_crypto_wolfssl_ngtcp2_crypto_recv_client_initial_cb+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lngtcp2_crypto_wolfssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define RECVCALLCONV PASCAL -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define RECVCALLCONV -#endif - extern $recv_retv RECVCALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) +#ifdef __cplusplus +extern "C" #endif - recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4); - -int main (void) +char ngtcp2_crypto_recv_client_initial_cb (); +int main(void) { - - $recv_arg1 s=0; - $recv_arg2 buf=0; - $recv_arg3 len=0; - $recv_arg4 flags=0; - $recv_retv res = recv(s, buf, len, flags); - - ; - return 0; +return ngtcp2_crypto_recv_client_initial_cb (); + return 0; } - _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv" - +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_ngtcp2_crypto_wolfssl_ngtcp2_crypto_recv_client_initial_cb=yes +else $as_nop + ac_cv_lib_ngtcp2_crypto_wolfssl_ngtcp2_crypto_recv_client_initial_cb=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - done - done - done - done - +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_recv_args" >&5 -$as_echo "$curl_cv_func_recv_args" >&6; } # AC-CACHE-CHECK - if test "$curl_cv_func_recv_args" = "unknown"; then - as_fn_error $? "Cannot find proper types to use for recv args" "$LINENO" 5 - else - recv_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'` - IFS=$recv_prev_IFS - shift - # - -cat >>confdefs.h <<_ACEOF -#define RECV_TYPE_ARG1 $1 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define RECV_TYPE_ARG2 $2 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define RECV_TYPE_ARG3 $3 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ngtcp2_crypto_wolfssl_ngtcp2_crypto_recv_client_initial_cb" >&5 +printf "%s\n" "$ac_cv_lib_ngtcp2_crypto_wolfssl_ngtcp2_crypto_recv_client_initial_cb" >&6; } +if test "x$ac_cv_lib_ngtcp2_crypto_wolfssl_ngtcp2_crypto_recv_client_initial_cb" = xyes +then : + for ac_header in ngtcp2/ngtcp2_crypto.h +do : + ac_fn_c_check_header_compile "$LINENO" "ngtcp2/ngtcp2_crypto.h" "ac_cv_header_ngtcp2_ngtcp2_crypto_h" "$ac_includes_default" +if test "x$ac_cv_header_ngtcp2_ngtcp2_crypto_h" = xyes +then : + printf "%s\n" "#define HAVE_NGTCP2_NGTCP2_CRYPTO_H 1" >>confdefs.h + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_wolfssl" -cat >>confdefs.h <<_ACEOF -#define RECV_TYPE_ARG4 $4 -_ACEOF +fi +done -cat >>confdefs.h <<_ACEOF -#define RECV_TYPE_RETV $5 -_ACEOF +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS - # +fi -cat >>confdefs.h <<_ACEOF -#define HAVE_RECV 1 -_ACEOF - curl_cv_func_recv="yes" - fi else - as_fn_error $? "Unable to link function recv" "$LINENO" 5 + if test X"$want_tcp2" != Xdefault; then + as_fn_error $? "--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file." "$LINENO" 5 + fi fi +fi - for ac_header in sys/types.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +OPT_OPENSSL_QUIC="no" +if test "x$disable_http" = "xyes" -o "x$OPENSSL_ENABLED" != "x1"; then + # without HTTP or without openssl, no use + OPT_OPENSSL_QUIC="no" fi -done - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for send" >&5 -$as_echo_n "checking for send... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +# Check whether --with-openssl-quic was given. +if test ${with_openssl_quic+y} +then : + withval=$with_openssl_quic; OPT_OPENSSL_QUIC=$withval +fi +case "$OPT_OPENSSL_QUIC" in + no) + want_openssl_quic="no" + ;; + yes) + want_openssl_quic="yes" + ;; +esac -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif +curl_openssl_quic_msg="no (--with-openssl-quic)" +if test "x$want_openssl_quic" = "xyes"; then -int main (void) -{ + if test "$USE_NGTCP2" = 1; then + as_fn_error $? "--with-openssl-quic and --with-ngtcp2 are mutually exclusive" "$LINENO" 5 + fi + if test "$have_openssl_quic" != 1; then + as_fn_error $? "--with-openssl-quic requires quic support and OpenSSL >= 3.3.0" "$LINENO" 5 + fi - send(0, 0, 0, 0); +printf "%s\n" "#define USE_OPENSSL_QUIC 1" >>confdefs.h - ; - return 0; -} + USE_OPENSSL_QUIC=1 +fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_cv_send="yes" +OPT_NGHTTP3="yes" -else +if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then + # without ngtcp2 or openssl quic, nghttp3 is of no use for us + OPT_NGHTTP3="no" + want_nghttp3="no" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_send="no" +# Check whether --with-nghttp3 was given. +if test ${with_nghttp3+y} +then : + withval=$with_nghttp3; OPT_NGHTTP3=$withval fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$curl_cv_send" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of args and return type for send" >&5 -$as_echo_n "checking types of args and return type for send... " >&6; } -if ${curl_cv_func_send_args+:} false; then : - $as_echo_n "(cached) " >&6 -else - curl_cv_func_send_args="unknown" - for send_retv in 'int' 'ssize_t'; do - for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do - for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do - for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do - for send_arg4 in 'int' 'unsigned int'; do - if test "$curl_cv_func_send_args" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +case "$OPT_NGHTTP3" in + no) + want_nghttp3="no" + ;; + yes) + want_nghttp3="default" + want_nghttp3_path="" + ;; + *) + want_nghttp3="yes" + want_nghttp3_path="$withval/lib/pkgconfig" + ;; +esac +curl_http3_msg="no (--with-nghttp3)" +if test X"$want_nghttp3" != Xno; then -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#define SENDCALLCONV PASCAL -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#define SENDCALLCONV -#endif - extern $send_retv SENDCALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) -#endif - send($send_arg1, $send_arg2, $send_arg3, $send_arg4); + if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then + # without ngtcp2 or openssl quic, nghttp3 is of no use for us + as_fn_error $? "nghttp3 enabled without a QUIC library; enable ngtcp2 or OpenSSL-QUIC" "$LINENO" 5 + fi -int main (void) -{ + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - $send_arg1 s=0; - $send_arg3 len=0; - $send_arg4 flags=0; - $send_retv res = send(s, 0, len, flags); - ; - return 0; -} + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv" +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - done - done - done - done + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_send_args" >&5 -$as_echo "$curl_cv_func_send_args" >&6; } # AC-CACHE-CHECK - if test "$curl_cv_func_send_args" = "unknown"; then - as_fn_error $? "Cannot find proper types to use for send args" "$LINENO" 5 - else - send_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'` - IFS=$send_prev_IFS - shift - # - send_qual_type_arg2=$2 - # -cat >>confdefs.h <<_ACEOF -#define SEND_TYPE_ARG1 $1 -_ACEOF + fi + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libnghttp3 options with pkg-config" >&5 +printf %s "checking for libnghttp3 options with pkg-config... " >&6; } + itexists=` + if test -n "$want_nghttp3_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp3_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libnghttp3 >/dev/null 2>&1 && echo 1` -cat >>confdefs.h <<_ACEOF -#define SEND_TYPE_ARG3 $3 -_ACEOF + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -cat >>confdefs.h <<_ACEOF -#define SEND_TYPE_ARG4 $4 -_ACEOF + if test "$PKGCONFIG" != "no"; then + LIB_NGHTTP3=` + if test -n "$want_nghttp3_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp3_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-l libnghttp3` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_NGHTTP3" >&5 +printf "%s\n" "$as_me: -l is $LIB_NGHTTP3" >&6;} -cat >>confdefs.h <<_ACEOF -#define SEND_TYPE_RETV $5 -_ACEOF + CPP_NGHTTP3=` + if test -n "$want_nghttp3_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp3_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libnghttp3` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_NGHTTP3" >&5 +printf "%s\n" "$as_me: -I is $CPP_NGHTTP3" >&6;} - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) - ;; - *) - set -f - ;; - esac - # - case "$send_qual_type_arg2" in - const*) - send_qual_arg2=const - send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'` - ;; - *) - send_qual_arg2= - send_type_arg2=$send_qual_type_arg2 - ;; - esac - # + LD_NGHTTP3=` + if test -n "$want_nghttp3_path"; then + PKG_CONFIG_LIBDIR="$want_nghttp3_path" + export PKG_CONFIG_LIBDIR + fi -cat >>confdefs.h <<_ACEOF -#define SEND_QUAL_ARG2 $send_qual_arg2 -_ACEOF + $PKGCONFIG --libs-only-L libnghttp3` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_NGHTTP3" >&5 +printf "%s\n" "$as_me: -L is $LD_NGHTTP3" >&6;} + LDFLAGS="$LDFLAGS $LD_NGHTTP3" + LDFLAGSPC="$LDFLAGSPC $LD_NGHTTP3" + CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3" + LIBS="$LIB_NGHTTP3 $LIBS" -cat >>confdefs.h <<_ACEOF -#define SEND_TYPE_ARG2 $send_type_arg2 -_ACEOF + if test "x$cross_compiling" != "xyes"; then + DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nghttp3_conn_client_new_versioned in -lnghttp3" >&5 +printf %s "checking for nghttp3_conn_client_new_versioned in -lnghttp3... " >&6; } +if test ${ac_cv_lib_nghttp3_nghttp3_conn_client_new_versioned+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnghttp3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # -cat >>confdefs.h <<_ACEOF -#define HAVE_SEND 1 +#ifdef __cplusplus +extern "C" +#endif +char nghttp3_conn_client_new_versioned (); +int main(void) +{ +return nghttp3_conn_client_new_versioned (); + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_nghttp3_nghttp3_conn_client_new_versioned=yes +else $as_nop + ac_cv_lib_nghttp3_nghttp3_conn_client_new_versioned=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nghttp3_nghttp3_conn_client_new_versioned" >&5 +printf "%s\n" "$ac_cv_lib_nghttp3_nghttp3_conn_client_new_versioned" >&6; } +if test "x$ac_cv_lib_nghttp3_nghttp3_conn_client_new_versioned" = xyes +then : - curl_cv_func_send="yes" - fi - else - as_fn_error $? "Unable to link function send" "$LINENO" 5 - fi + for ac_header in nghttp3/nghttp3.h +do : + ac_fn_c_check_header_compile "$LINENO" "nghttp3/nghttp3.h" "ac_cv_header_nghttp3_nghttp3_h" "$ac_includes_default" +if test "x$ac_cv_header_nghttp3_nghttp3_h" = xyes +then : + printf "%s\n" "#define HAVE_NGHTTP3_NGHTTP3_H 1" >>confdefs.h +printf "%s\n" "#define USE_NGHTTP3 1" >>confdefs.h - for ac_header in sys/types.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + USE_NGHTTP3=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp3" fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSG_NOSIGNAL" >&5 -$as_echo_n "checking for MSG_NOSIGNAL... " >&6; } -if ${curl_cv_msg_nosignal+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS +fi -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif -int main (void) -{ + else + if test X"$want_nghttp3" != Xdefault; then + as_fn_error $? "--with-nghttp3 was specified but could not find nghttp3 pkg-config file." "$LINENO" 5 + fi + fi +fi - int flag=MSG_NOSIGNAL; - ; - return 0; -} +if test "x$USE_NGTCP2" = "x1" -a "x$USE_NGHTTP3" = "x1"; then + USE_NGTCP2_H3=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HTTP3 support is experimental" >&5 +printf "%s\n" "$as_me: HTTP3 support is experimental" >&6;} + curl_h3_msg="enabled (ngtcp2 + nghttp3)" +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - curl_cv_msg_nosignal="yes" +if test "x$USE_OPENSSL_QUIC" = "x1" -a "x$USE_NGHTTP3" = "x1"; then + experimental="$experimental HTTP3" + USE_OPENSSL_H3=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HTTP3 support is experimental" >&5 +printf "%s\n" "$as_me: HTTP3 support is experimental" >&6;} + curl_h3_msg="enabled (openssl + nghttp3)" +fi -else - curl_cv_msg_nosignal="no" +OPT_QUICHE="no" +if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then + # without HTTP or with ngtcp2, quiche is no use + OPT_QUICHE="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +# Check whether --with-quiche was given. +if test ${with_quiche+y} +then : + withval=$with_quiche; OPT_QUICHE=$withval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_msg_nosignal" >&5 -$as_echo "$curl_cv_msg_nosignal" >&6; } - case "$curl_cv_msg_nosignal" in - yes) -cat >>confdefs.h <<_ACEOF -#define HAVE_MSG_NOSIGNAL 1 -_ACEOF +case "$OPT_QUICHE" in + no) + want_quiche="no" + ;; + yes) + want_quiche="default" + want_quiche_path="" + ;; + *) + want_quiche="yes" + want_quiche_path="$withval" + ;; +esac - ;; - esac +if test X"$want_quiche" != Xno; then + if test "$QUIC_ENABLED" != "yes"; then + as_fn_error $? "the detected TLS library does not support QUIC, making --with-quiche a no-no" "$LINENO" 5 + fi + if test "$NGHTTP3_ENABLED" = 1; then + as_fn_error $? "--with-quiche and --with-ngtcp2 are mutually exclusive" "$LINENO" 5 + fi -curl_includes_unistd="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_unistd -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -fi + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - # - tst_links_alarm="unknown" - tst_proto_alarm="unknown" - tst_compi_alarm="unknown" - tst_allow_alarm="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm can be linked" >&5 -$as_echo_n "checking if alarm can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define alarm innocuous_alarm -#ifdef __STDC__ -# include -#else -# include -#endif -#undef alarm -#ifdef __cplusplus -extern "C" -#endif -char alarm (); -#if defined __stub_alarm || defined __stub___alarm -choke me -#endif - -int main (void) -{ -return alarm (); - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_alarm="yes" + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_alarm="no" + fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_alarm" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm is prototyped" >&5 -$as_echo_n "checking if alarm is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for quiche options with pkg-config" >&5 +printf %s "checking for quiche options with pkg-config... " >&6; } + itexists=` + if test -n "$want_quiche_path"; then + PKG_CONFIG_LIBDIR="$want_quiche_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists quiche >/dev/null 2>&1 && echo 1` + + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - $curl_includes_unistd -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "alarm" >/dev/null 2>&1; then : + if test "$PKGCONFIG" != "no"; then + LIB_QUICHE=` + if test -n "$want_quiche_path"; then + PKG_CONFIG_LIBDIR="$want_quiche_path" + export PKG_CONFIG_LIBDIR + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_alarm="yes" + $PKGCONFIG --libs-only-l quiche` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_QUICHE" >&5 +printf "%s\n" "$as_me: -l is $LIB_QUICHE" >&6;} -else + CPP_QUICHE=` + if test -n "$want_quiche_path"; then + PKG_CONFIG_LIBDIR="$want_quiche_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I quiche` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_QUICHE" >&5 +printf "%s\n" "$as_me: -I is $CPP_QUICHE" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_alarm="no" + LD_QUICHE=` + if test -n "$want_quiche_path"; then + PKG_CONFIG_LIBDIR="$want_quiche_path" + export PKG_CONFIG_LIBDIR + fi -fi -rm -f conftest* + $PKGCONFIG --libs-only-L quiche` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_QUICHE" >&5 +printf "%s\n" "$as_me: -L is $LD_QUICHE" >&6;} - fi - # - if test "$tst_proto_alarm" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm is compilable" >&5 -$as_echo_n "checking if alarm is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + LDFLAGS="$LDFLAGS $LD_QUICHE" + LDFLAGSPC="$LDFLAGSPC $LD_QUICHE" + CPPFLAGS="$CPPFLAGS $CPP_QUICHE" + LIBS="$LIB_QUICHE $LIBS" + if test "x$cross_compiling" != "xyes"; then + DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for quiche_conn_send_ack_eliciting in -lquiche" >&5 +printf %s "checking for quiche_conn_send_ack_eliciting in -lquiche... " >&6; } +if test ${ac_cv_lib_quiche_quiche_conn_send_ack_eliciting+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lquiche $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - $curl_includes_unistd -int main (void) +#ifdef __cplusplus +extern "C" +#endif +char quiche_conn_send_ack_eliciting (); +int main(void) { +return quiche_conn_send_ack_eliciting (); + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_quiche_quiche_conn_send_ack_eliciting=yes +else $as_nop + ac_cv_lib_quiche_quiche_conn_send_ack_eliciting=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_quiche_quiche_conn_send_ack_eliciting" >&5 +printf "%s\n" "$ac_cv_lib_quiche_quiche_conn_send_ack_eliciting" >&6; } +if test "x$ac_cv_lib_quiche_quiche_conn_send_ack_eliciting" = xyes +then : - if(0 != alarm(0)) - return 1; + for ac_header in quiche.h +do : + ac_fn_c_check_header_compile "$LINENO" "quiche.h" "ac_cv_header_quiche_h" " + $ac_includes_default + #include - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +" +if test "x$ac_cv_header_quiche_h" = xyes +then : + printf "%s\n" "#define HAVE_QUICHE_H 1" >>confdefs.h + experimental="$experimental HTTP3" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HTTP3 support is experimental" >&5 +printf "%s\n" "$as_me: HTTP3 support is experimental" >&6;} + curl_h3_msg="enabled (quiche)" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_alarm="yes" +printf "%s\n" "#define USE_QUICHE 1" >>confdefs.h -else + USE_QUICHE=1 + ac_fn_c_check_func "$LINENO" "quiche_conn_set_qlog_fd" "ac_cv_func_quiche_conn_set_qlog_fd" +if test "x$ac_cv_func_quiche_conn_set_qlog_fd" = xyes +then : + printf "%s\n" "#define HAVE_QUICHE_CONN_SET_QLOG_FD 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_alarm="no" +fi + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_QUICHE to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_QUICHE to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE quiche" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_alarm" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm usage allowed" >&5 -$as_echo_n "checking if alarm usage allowed... " >&6; } - if test "x$curl_disallow_alarm" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_alarm="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_alarm="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if alarm might be used" >&5 -$as_echo_n "checking if alarm might be used... " >&6; } - if test "$tst_links_alarm" = "yes" && - test "$tst_proto_alarm" = "yes" && - test "$tst_compi_alarm" = "yes" && - test "$tst_allow_alarm" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_ALARM 1 -_ACEOF +done + +else $as_nop + as_fn_error $? "couldn't use quiche" "$LINENO" 5 + +fi - curl_cv_func_alarm="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_alarm="no" + if test X"$want_quiche" != Xdefault; then + as_fn_error $? "--with-quiche was specified but could not find quiche pkg-config file." "$LINENO" 5 + fi fi +fi -curl_includes_string="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h string.h strings.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_string -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +OPT_MSH3="no" +if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then + # without HTTP or with ngtcp2, msh3 is no use + OPT_MSH3="no" fi -done - +# Check whether --with-msh3 was given. +if test ${with_msh3+y} +then : + withval=$with_msh3; OPT_MSH3=$withval +fi -curl_includes_libgen="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_LIBGEN_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h libgen.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_libgen -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +case "$OPT_MSH3" in + no) + want_msh3="no" + ;; + yes) + want_msh3="default" + want_msh3_path="" + ;; + *) + want_msh3="yes" + want_msh3_path="$withval" + ;; +esac -fi +if test X"$want_msh3" != Xno; then -done + if test "$curl_cv_native_windows" != "yes"; then + if test "$QUIC_ENABLED" != "yes"; then + as_fn_error $? "the detected TLS library does not support QUIC, making --with-msh3 a no-no" "$LINENO" 5 + fi + if test "$OPENSSL_ENABLED" != "1"; then + as_fn_error $? "msh3/msquic requires OpenSSL" "$LINENO" 5 + fi + fi + if test "$NGHTTP3_ENABLED" = 1; then + as_fn_error $? "--with-msh3 and --with-ngtcp2 are mutually exclusive" "$LINENO" 5 + fi + if test "$USE_QUICHE" = 1; then + as_fn_error $? "--with-msh3 and --with-quiche are mutually exclusive" "$LINENO" 5 + fi + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - # - tst_links_basename="unknown" - tst_proto_basename="unknown" - tst_compi_basename="unknown" - tst_allow_basename="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename can be linked" >&5 -$as_echo_n "checking if basename can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test -n "$want_msh3_path"; then + LD_MSH3="-L$want_msh3_path/lib" + CPP_MSH3="-I$want_msh3_path/include" + DIR_MSH3="$want_msh3_path/lib" + LDFLAGS="$LDFLAGS $LD_MSH3" + LDFLAGSPC="$LDFLAGSPC $LD_MSH3" + CPPFLAGS="$CPPFLAGS $CPP_MSH3" + fi + LIBS="-lmsh3 $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MsH3ApiOpen in -lmsh3" >&5 +printf %s "checking for MsH3ApiOpen in -lmsh3... " >&6; } +if test ${ac_cv_lib_msh3_MsH3ApiOpen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmsh3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define basename innocuous_basename -#ifdef __STDC__ -# include -#else -# include -#endif -#undef basename #ifdef __cplusplus extern "C" #endif -char basename (); -#if defined __stub_basename || defined __stub___basename -choke me -#endif - -int main (void) +char MsH3ApiOpen (); +int main(void) { -return basename (); - ; - return 0; +return MsH3ApiOpen (); + return 0; } - _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_basename="yes" - -else +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_msh3_MsH3ApiOpen=yes +else $as_nop + ac_cv_lib_msh3_MsH3ApiOpen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_msh3_MsH3ApiOpen" >&5 +printf "%s\n" "$ac_cv_lib_msh3_MsH3ApiOpen" >&6; } +if test "x$ac_cv_lib_msh3_MsH3ApiOpen" = xyes +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_basename="no" + for ac_header in msh3.h +do : + ac_fn_c_check_header_compile "$LINENO" "msh3.h" "ac_cv_header_msh3_h" "$ac_includes_default" +if test "x$ac_cv_header_msh3_h" = xyes +then : + printf "%s\n" "#define HAVE_MSH3_H 1" >>confdefs.h + curl_h3_msg="enabled (msh3)" + +printf "%s\n" "#define USE_MSH3 1" >>confdefs.h + + USE_MSH3=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_MSH3 to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_MSH3 to CURL_LIBRARY_PATH" >&6;} + if false; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libmsh3" + fi + experimental="$experimental HTTP3" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_basename" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename is prototyped" >&5 -$as_echo_n "checking if basename is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - $curl_includes_string - $curl_includes_libgen - $curl_includes_unistd +done -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "basename" >/dev/null 2>&1; then : +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_basename="yes" +fi -else +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_basename="no" +OPT_LIBUV=no + +# Check whether --with-libuv was given. +if test ${with_libuv+y} +then : + withval=$with_libuv; OPT_LIBUV=$withval fi -rm -f conftest* +case "$OPT_LIBUV" in + no) + want_libuv="no" + ;; + yes) + want_libuv="default" + want_libuv_path="" + ;; + *) + want_libuv="yes" + want_libuv_path="$withval" + ;; +esac + +if test X"$want_libuv" != Xno; then + if test x$want_debug != xyes; then + as_fn_error $? "Using libuv without debug support enabled is useless" "$LINENO" 5 fi - # - if test "$tst_proto_basename" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename is compilable" >&5 -$as_echo_n "checking if basename is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - $curl_includes_string - $curl_includes_libgen - $curl_includes_unistd -int main (void) -{ + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - if(0 != basename(0)) - return 1; + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_basename="yes" + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_basename="no" + fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuv options with pkg-config" >&5 +printf %s "checking for libuv options with pkg-config... " >&6; } + itexists=` + if test -n "$want_libuv_path"; then + PKG_CONFIG_LIBDIR="$want_libuv_path" + export PKG_CONFIG_LIBDIR fi - # - if test "$tst_compi_basename" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename usage allowed" >&5 -$as_echo_n "checking if basename usage allowed... " >&6; } - if test "x$curl_disallow_basename" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_basename="yes" + $PKGCONFIG --exists libuv >/dev/null 2>&1 && echo 1` + + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_basename="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } fi fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if basename might be used" >&5 -$as_echo_n "checking if basename might be used... " >&6; } - if test "$tst_links_basename" = "yes" && - test "$tst_proto_basename" = "yes" && - test "$tst_compi_basename" = "yes" && - test "$tst_allow_basename" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_BASENAME 1 -_ACEOF - curl_cv_func_basename="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_basename="no" + if test "$PKGCONFIG" != "no"; then + LIB_LIBUV=` + if test -n "$want_libuv_path"; then + PKG_CONFIG_LIBDIR="$want_libuv_path" + export PKG_CONFIG_LIBDIR fi + $PKGCONFIG --libs-only-l libuv` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -l is $LIB_LIBUV" >&5 +printf "%s\n" "$as_me: -l is $LIB_LIBUV" >&6;} -curl_includes_socket="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SOCKET_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_socket -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi + CPP_LIBUV=` + if test -n "$want_libuv_path"; then + PKG_CONFIG_LIBDIR="$want_libuv_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --cflags-only-I libuv` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -I is $CPP_LIBUV" >&5 +printf "%s\n" "$as_me: -I is $CPP_LIBUV" >&6;} -done + LD_LIBUV=` + if test -n "$want_libuv_path"; then + PKG_CONFIG_LIBDIR="$want_libuv_path" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --libs-only-L libuv` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: -L is $LD_LIBUV" >&5 +printf "%s\n" "$as_me: -L is $LD_LIBUV" >&6;} + LDFLAGS="$LDFLAGS $LD_LIBUV" + LDFLAGSPC="$LDFLAGSPC $LD_LIBUV" + CPPFLAGS="$CPPFLAGS $CPP_LIBUV" + LIBS="$LIB_LIBUV $LIBS" - # - tst_links_closesocket="unknown" - tst_proto_closesocket="unknown" - tst_compi_closesocket="unknown" - tst_allow_closesocket="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket can be linked" >&5 -$as_echo_n "checking if closesocket can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "x$cross_compiling" != "xyes"; then + DIR_LIBUV=`echo $LD_LIBUV | $SED -e 's/^-L//'` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uv_default_loop in -luv" >&5 +printf %s "checking for uv_default_loop in -luv... " >&6; } +if test ${ac_cv_lib_uv_uv_default_loop+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_socket - -int main (void) +#ifdef __cplusplus +extern "C" +#endif +char uv_default_loop (); +int main(void) { - - if(0 != closesocket(0)) - return 1; - - ; - return 0; +return uv_default_loop (); + return 0; } - _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_closesocket="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_closesocket="no" - +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_uv_uv_default_loop=yes +else $as_nop + ac_cv_lib_uv_uv_default_loop=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_closesocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket is prototyped" >&5 -$as_echo_n "checking if closesocket is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_winsock2 - $curl_includes_socket - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "closesocket" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_closesocket="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_closesocket="no" - +LIBS=$ac_check_lib_save_LIBS fi -rm -f conftest* - - fi - # - if test "$tst_proto_closesocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket is compilable" >&5 -$as_echo_n "checking if closesocket is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uv_uv_default_loop" >&5 +printf "%s\n" "$ac_cv_lib_uv_uv_default_loop" >&6; } +if test "x$ac_cv_lib_uv_uv_default_loop" = xyes +then : + for ac_header in uv.h +do : + ac_fn_c_check_header_compile "$LINENO" "uv.h" "ac_cv_header_uv_h" "$ac_includes_default" +if test "x$ac_cv_header_uv_h" = xyes +then : + printf "%s\n" "#define HAVE_UV_H 1" >>confdefs.h - $curl_includes_winsock2 - $curl_includes_socket - -int main (void) -{ - - if(0 != closesocket(0)) - return 1; - - ; - return 0; -} +printf "%s\n" "#define USE_LIBUV 1" >>confdefs.h -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + USE_LIBUV=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LIBUV" + export CURL_LIBRARY_PATH + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Added $DIR_LIBUV to CURL_LIBRARY_PATH" >&5 +printf "%s\n" "$as_me: Added $DIR_LIBUV to CURL_LIBRARY_PATH" >&6;} + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libuv" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_closesocket="yes" +fi -else +done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_closesocket="no" +else $as_nop + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_closesocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket usage allowed" >&5 -$as_echo_n "checking if closesocket usage allowed... " >&6; } - if test "x$curl_disallow_closesocket" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_closesocket="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_closesocket="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if closesocket might be used" >&5 -$as_echo_n "checking if closesocket might be used... " >&6; } - if test "$tst_links_closesocket" = "yes" && - test "$tst_proto_closesocket" = "yes" && - test "$tst_compi_closesocket" = "yes" && - test "$tst_allow_closesocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_CLOSESOCKET 1 -_ACEOF - curl_cv_func_closesocket="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_closesocket="no" + if test X"$want_libuv" != Xdefault; then + as_fn_error $? "--with-libuv was specified but could not find libuv pkg-config file." "$LINENO" 5 + fi fi +fi - # - tst_links_closesocket_camel="unknown" - tst_proto_closesocket_camel="unknown" - tst_compi_closesocket_camel="unknown" - tst_allow_closesocket_camel="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket can be linked" >&5 -$as_echo_n "checking if CloseSocket can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_sys_socket - -int main (void) -{ - - if(0 != CloseSocket(0)) - return 1; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_closesocket_camel="yes" - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_closesocket_camel="no" +OPT_ZSH_FPATH=default +# Check whether --with-zsh-functions-dir was given. +if test ${with_zsh_functions_dir+y} +then : + withval=$with_zsh_functions_dir; OPT_ZSH_FPATH=$withval fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_closesocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket is prototyped" >&5 -$as_echo_n "checking if CloseSocket is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_sys_socket -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "CloseSocket" >/dev/null 2>&1; then : +case "$OPT_ZSH_FPATH" in + default|no) + ;; + yes) + ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_closesocket_camel="yes" + ;; + *) + ZSH_FUNCTIONS_DIR="$withval" + ;; +esac + if test x"$ZSH_FUNCTIONS_DIR" != x; then + USE_ZSH_COMPLETION_TRUE= + USE_ZSH_COMPLETION_FALSE='#' else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_closesocket_camel="no" - + USE_ZSH_COMPLETION_TRUE='#' + USE_ZSH_COMPLETION_FALSE= fi -rm -f conftest* - - fi - # - if test "$tst_proto_closesocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket is compilable" >&5 -$as_echo_n "checking if CloseSocket is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_sys_socket -int main (void) -{ - if(0 != CloseSocket(0)) - return 1; +OPT_FISH_FPATH=default - ; - return 0; -} +# Check whether --with-fish-functions-dir was given. +if test ${with_fish_functions_dir+y} +then : + withval=$with_fish_functions_dir; OPT_FISH_FPATH=$withval +fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +case "$OPT_FISH_FPATH" in + default|no) + ;; + yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_closesocket_camel="yes" + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_closesocket_camel="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_closesocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket usage allowed" >&5 -$as_echo_n "checking if CloseSocket usage allowed... " >&6; } - if test "x$curl_disallow_closesocket_camel" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_closesocket_camel="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_closesocket_camel="no" - fi +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CloseSocket might be used" >&5 -$as_echo_n "checking if CloseSocket might be used... " >&6; } - if test "$tst_links_closesocket_camel" = "yes" && - test "$tst_proto_closesocket_camel" = "yes" && - test "$tst_compi_closesocket_camel" = "yes" && - test "$tst_allow_closesocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +done + done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define HAVE_CLOSESOCKET_CAMEL 1 -_ACEOF + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - curl_cv_func_closesocket_camel="yes" + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_closesocket_camel="no" + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi + fi - # - tst_links_connect="unknown" - tst_proto_connect="unknown" - tst_compi_connect="unknown" - tst_allow_connect="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect can be linked" >&5 -$as_echo_n "checking if connect can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_winsock2 - $curl_includes_sys_socket - $curl_includes_socket - -int main (void) -{ - - if(0 != connect(0, 0, 0)) - return 1; + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fish options with pkg-config" >&5 +printf %s "checking for fish options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists fish >/dev/null 2>&1 && echo 1` - ; - return 0; -} + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + if test "$PKGCONFIG" != "no"; then + FISH_FUNCTIONS_DIR=`$PKGCONFIG --variable completionsdir fish` + else + FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_connect="yes" + ;; + *) + FISH_FUNCTIONS_DIR="$withval" + ;; +esac + if test x"$FISH_FUNCTIONS_DIR" != x; then + USE_FISH_COMPLETION_TRUE= + USE_FISH_COMPLETION_FALSE='#' else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_connect="no" - + USE_FISH_COMPLETION_TRUE='#' + USE_FISH_COMPLETION_FALSE= fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_connect" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect is prototyped" >&5 -$as_echo_n "checking if connect is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_sys_socket - $curl_includes_socket - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "connect" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_connect="yes" +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_connect="no" +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -rm -f conftest* - - fi - # - if test "$tst_proto_connect" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect is compilable" >&5 -$as_echo_n "checking if connect is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - $curl_includes_winsock2 - $curl_includes_sys_socket - $curl_includes_socket -int main (void) -{ +" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h - if(0 != connect(0, 0, 0)) - return 1; +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_connect="yes" +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_connect="no" +" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_connect" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect usage allowed" >&5 -$as_echo_n "checking if connect usage allowed... " >&6; } - if test "x$curl_disallow_connect" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_connect="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_connect="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if connect might be used" >&5 -$as_echo_n "checking if connect might be used... " >&6; } - if test "$tst_links_connect" = "yes" && - test "$tst_proto_connect" = "yes" && - test "$tst_compi_connect" = "yes" && - test "$tst_allow_connect" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_CONNECT 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - curl_cv_func_connect="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_connect="no" - fi +" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h -curl_includes_fcntl="\ -/* includes start */ +fi +ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " +#include #ifdef HAVE_SYS_TYPES_H -# include +#include #endif -#ifdef HAVE_UNISTD_H -# include +#if !defined(_WIN32) || defined(__MINGW32__) +#include #endif -#ifdef HAVE_FCNTL_H -# include +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include #endif -/* includes end */" - for ac_header in sys/types.h unistd.h fcntl.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_fcntl +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif + + " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_net_if_h" = xyes +then : + printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -done +" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in6.h" "ac_cv_header_netinet_in6_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - # - tst_links_fcntl="unknown" - tst_proto_fcntl="unknown" - tst_compi_fcntl="unknown" - tst_allow_fcntl="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl can be linked" >&5 -$as_echo_n "checking if fcntl can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +" +if test "x$ac_cv_header_netinet_in6_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN6_H 1" >>confdefs.h -#define fcntl innocuous_fcntl -#ifdef __STDC__ -# include -#else -# include +fi +ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include #endif -#undef fcntl -#ifdef __cplusplus -extern "C" +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ #endif -char fcntl (); -#if defined __stub_fcntl || defined __stub___fcntl -choke me +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ #endif -int main (void) -{ -return fcntl (); - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_fcntl="yes" - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_fcntl="no" +" +if test "x$ac_cv_header_sys_un_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_fcntl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl is prototyped" >&5 -$as_echo_n "checking if fcntl is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_fcntl - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fcntl" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_fcntl="yes" +ac_fn_c_check_header_compile "$LINENO" "linux/tcp.h" "ac_cv_header_linux_tcp_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_fcntl="no" +" +if test "x$ac_cv_header_linux_tcp_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_TCP_H 1" >>confdefs.h fi -rm -f conftest* - - fi - # - if test "$tst_proto_fcntl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl is compilable" >&5 -$as_echo_n "checking if fcntl is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - $curl_includes_fcntl -int main (void) -{ +" +if test "x$ac_cv_header_netinet_tcp_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_TCP_H 1" >>confdefs.h - if(0 != fcntl(0, 0, 0)) - return 1; +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/udp.h" "ac_cv_header_netinet_udp_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +" +if test "x$ac_cv_header_netinet_udp_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_UDP_H 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_fcntl="yes" +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_fcntl="no" +" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_fcntl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl usage allowed" >&5 -$as_echo_n "checking if fcntl usage allowed... " >&6; } - if test "x$curl_disallow_fcntl" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_fcntl="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_fcntl="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl might be used" >&5 -$as_echo_n "checking if fcntl might be used... " >&6; } - if test "$tst_links_fcntl" = "yes" && - test "$tst_proto_fcntl" = "yes" && - test "$tst_compi_fcntl" = "yes" && - test "$tst_allow_fcntl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_FCNTL 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - curl_cv_func_fcntl="yes" - # - tst_compi_fcntl_o_nonblock="unknown" - tst_allow_fcntl_o_nonblock="unknown" - # - case $host_os in - sunos4* | aix3* | beos*) - curl_disallow_fcntl_o_nonblock="yes" - ;; - esac - # - if test "$curl_cv_func_fcntl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK is compilable" >&5 -$as_echo_n "checking if fcntl O_NONBLOCK is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +" +if test "x$ac_cv_header_sys_sockio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - $curl_includes_fcntl -int main (void) -{ +" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h - int flags = 0; - if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) - return 1; +fi +ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +" +if test "x$ac_cv_header_termios_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_fcntl_o_nonblock="yes" +fi +ac_fn_c_check_header_compile "$LINENO" "termio.h" "ac_cv_header_termio_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_fcntl_o_nonblock="no" +" +if test "x$ac_cv_header_termio_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIO_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_fcntl_o_nonblock" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK usage allowed" >&5 -$as_echo_n "checking if fcntl O_NONBLOCK usage allowed... " >&6; } - if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_fcntl_o_nonblock="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_fcntl_o_nonblock="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK might be used" >&5 -$as_echo_n "checking if fcntl O_NONBLOCK might be used... " >&6; } - if test "$tst_compi_fcntl_o_nonblock" = "yes" && - test "$tst_allow_fcntl_o_nonblock" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_FCNTL_O_NONBLOCK 1 -_ACEOF - - curl_cv_func_fcntl_o_nonblock="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_fcntl_o_nonblock="no" - fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_fcntl="no" - fi +" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h -curl_includes_stdio="\ -/* includes start */ +fi +ac_fn_c_check_header_compile "$LINENO" "io.h" "ac_cv_header_io_h" " +#include #ifdef HAVE_SYS_TYPES_H -# include +#include #endif -#ifdef HAVE_STDIO_H -# include +#if !defined(_WIN32) || defined(__MINGW32__) +#include #endif -/* includes end */" - for ac_header in sys/types.h stdio.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_stdio +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif + + " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_io_h" = xyes +then : + printf "%s\n" "#define HAVE_IO_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "pwd.h" "ac_cv_header_pwd_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -done +" +if test "x$ac_cv_header_pwd_h" = xyes +then : + printf "%s\n" "#define HAVE_PWD_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - # - tst_links_fdopen="unknown" - tst_proto_fdopen="unknown" - tst_compi_fdopen="unknown" - tst_allow_fdopen="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen can be linked" >&5 -$as_echo_n "checking if fdopen can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +" +if test "x$ac_cv_header_utime_h" = xyes +then : + printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h -#define fdopen innocuous_fdopen -#ifdef __STDC__ -# include -#else -# include +fi +ac_fn_c_check_header_compile "$LINENO" "sys/utime.h" "ac_cv_header_sys_utime_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include #endif -#undef fdopen -#ifdef __cplusplus -extern "C" +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ #endif -char fdopen (); -#if defined __stub_fdopen || defined __stub___fdopen -choke me +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ #endif -int main (void) -{ -return fdopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +" +if test "x$ac_cv_header_sys_utime_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UTIME_H 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_fdopen="yes" +fi +ac_fn_c_check_header_compile "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_fdopen="no" +" +if test "x$ac_cv_header_sys_poll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_POLL_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_fdopen" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen is prototyped" >&5 -$as_echo_n "checking if fdopen is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - $curl_includes_stdio -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fdopen" >/dev/null 2>&1; then : +" +if test "x$ac_cv_header_poll_h" = xyes +then : + printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_fdopen="yes" +fi +ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_fdopen="no" +" +if test "x$ac_cv_header_sys_resource_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h fi -rm -f conftest* +ac_fn_c_check_header_compile "$LINENO" "libgen.h" "ac_cv_header_libgen_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - fi - # - if test "$tst_proto_fdopen" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen is compilable" >&5 -$as_echo_n "checking if fdopen is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +" +if test "x$ac_cv_header_libgen_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBGEN_H 1" >>confdefs.h - $curl_includes_stdio +fi +ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -int main (void) -{ - if(0 != fdopen(0, 0)) - return 1; +" +if test "x$ac_cv_header_locale_h" = xyes +then : + printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h - ; - return 0; -} +fi +ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_fdopen="yes" +" +if test "x$ac_cv_header_stdbool_h" = xyes +then : + printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_fdopen="no" +" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_fdopen" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen usage allowed" >&5 -$as_echo_n "checking if fdopen usage allowed... " >&6; } - if test "x$curl_disallow_fdopen" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_fdopen="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_fdopen="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fdopen might be used" >&5 -$as_echo_n "checking if fdopen might be used... " >&6; } - if test "$tst_links_fdopen" = "yes" && - test "$tst_proto_fdopen" = "yes" && - test "$tst_compi_fdopen" = "yes" && - test "$tst_allow_fdopen" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_FDOPEN 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" " +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif - curl_cv_func_fdopen="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_fdopen="no" - fi +" +if test "x$ac_cv_header_sys_filio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h -curl_includes_netdb="\ -/* includes start */ +fi +ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" " +#include #ifdef HAVE_SYS_TYPES_H -# include +#include #endif -#ifdef HAVE_NETDB_H -# include +#if !defined(_WIN32) || defined(__MINGW32__) +#include #endif -/* includes end */" - for ac_header in sys/types.h netdb.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_netdb +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif + + " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_sys_eventfd_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h fi -done - - # - tst_links_freeaddrinfo="unknown" - tst_proto_freeaddrinfo="unknown" - tst_compi_freeaddrinfo="unknown" - tst_allow_freeaddrinfo="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo can be linked" >&5 -$as_echo_n "checking if freeaddrinfo can be linked... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_includes_netdb - -int main (void) +int main(void) { - freeaddrinfo(0); +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; - ; - return 0; -} + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + return 0; +} _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else $as_nop + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_freeaddrinfo="yes" +printf "%s\n" "#define const /**/" >>confdefs.h -else +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_freeaddrinfo="no" +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_freeaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo is prototyped" >&5 -$as_echo_n "checking if freeaddrinfo is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +else $as_nop - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_includes_netdb +printf "%s\n" "#define size_t unsigned int" >>confdefs.h -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "freeaddrinfo" >/dev/null 2>&1; then : +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_freeaddrinfo="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_freeaddrinfo="no" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -rm -f conftest* - fi - # - if test "$tst_proto_freeaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo is compilable" >&5 -$as_echo_n "checking if freeaddrinfo is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 +printf %s "checking for struct timeval... " >&6; } +if test ${curl_cv_struct_timeval+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_includes_netdb + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #include + #include + #endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include -int main (void) +int main(void) { - freeaddrinfo(0); + struct timeval ts; + ts.tv_sec = 0; + ts.tv_usec = 0; + (void)ts; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_freeaddrinfo="yes" + curl_cv_struct_timeval="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_freeaddrinfo="no" + curl_cv_struct_timeval="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_freeaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo usage allowed" >&5 -$as_echo_n "checking if freeaddrinfo usage allowed... " >&6; } - if test "x$curl_disallow_freeaddrinfo" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_freeaddrinfo="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_freeaddrinfo="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo might be used" >&5 -$as_echo_n "checking if freeaddrinfo might be used... " >&6; } - if test "$tst_links_freeaddrinfo" = "yes" && - test "$tst_proto_freeaddrinfo" = "yes" && - test "$tst_compi_freeaddrinfo" = "yes" && - test "$tst_allow_freeaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define HAVE_FREEADDRINFO 1 -_ACEOF - - curl_cv_func_freeaddrinfo="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_freeaddrinfo="no" - fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_struct_timeval" >&5 +printf "%s\n" "$curl_cv_struct_timeval" >&6; } + case "$curl_cv_struct_timeval" in + yes) +printf "%s\n" "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h -curl_includes_ifaddrs="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_IFADDRS_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h sys/socket.h netinet/in.h ifaddrs.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_ifaddrs -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ;; + esac -fi -done + if test "x$cross_compiling" != xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking run-time libs availability" >&5 +printf %s "checking run-time libs availability... " >&6; } - # - tst_links_freeifaddrs="unknown" - tst_proto_freeifaddrs="unknown" - tst_compi_freeifaddrs="unknown" - tst_allow_freeifaddrs="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs can be linked" >&5 -$as_echo_n "checking if freeifaddrs can be linked... " >&6; } + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define freeifaddrs innocuous_freeifaddrs -#ifdef __STDC__ -# include -#else -# include -#endif -#undef freeifaddrs -#ifdef __cplusplus -extern "C" -#endif -char freeifaddrs (); -#if defined __stub_freeifaddrs || defined __stub___freeifaddrs -choke me -#endif - -int main (void) -{ -return freeifaddrs (); - ; - return 0; -} + int main(void) + { + return 0; + } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: fine" >&5 +printf "%s\n" "fine" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } + as_fn_error $? "one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS" "$LINENO" 5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_freeifaddrs="yes" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi -else + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int main(void) + { + return 0; + } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_freeifaddrs="no" +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: fine" >&5 +printf "%s\n" "fine" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } + as_fn_error $? "one or more libs available at link-time are not available run-time. Libs used at link-time: $LIBS" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_freeifaddrs" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs is prototyped" >&5 -$as_echo_n "checking if freeifaddrs is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - $curl_includes_ifaddrs + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "freeifaddrs" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_freeifaddrs="yes" + fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_freeifaddrs="no" -fi -rm -f conftest* - fi - # - if test "$tst_proto_freeifaddrs" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs is compilable" >&5 -$as_echo_n "checking if freeifaddrs is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +printf %s "checking size of size_t... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_ifaddrs + #include -int main (void) + +int main(void) { - freeifaddrs(0); + switch(0) { + case 0: + case (sizeof(size_t) == $typesize):; + } - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_freeifaddrs="yes" + r=$typesize -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_freeifaddrs="no" + r=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_freeifaddrs" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs usage allowed" >&5 -$as_echo_n "checking if freeifaddrs usage allowed... " >&6; } - if test "x$curl_disallow_freeifaddrs" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_freeifaddrs="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_freeifaddrs="no" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; fi + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of size_t" "$LINENO" 5 fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if freeifaddrs might be used" >&5 -$as_echo_n "checking if freeifaddrs might be used... " >&6; } - if test "$tst_links_freeifaddrs" = "yes" && - test "$tst_proto_freeifaddrs" = "yes" && - test "$tst_compi_freeifaddrs" = "yes" && - test "$tst_allow_freeifaddrs" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_FREEIFADDRS 1 -_ACEOF - - curl_cv_func_freeifaddrs="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_freeifaddrs="no" - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_size_t" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" -curl_includes_sys_xattr="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_XATTR_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h sys/xattr.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_sys_xattr -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +printf "%s\n" "#define SIZEOF_SIZE_T $r" >>confdefs.h -fi -done - # - tst_links_fsetxattr="unknown" - tst_proto_fsetxattr="unknown" - tst_compi_fsetxattr="unknown" - tst_allow_fsetxattr="unknown" - tst_nargs_fsetxattr="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr can be linked" >&5 -$as_echo_n "checking if fsetxattr can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define fsetxattr innocuous_fsetxattr -#ifdef __STDC__ -# include -#else -# include -#endif -#undef fsetxattr -#ifdef __cplusplus -extern "C" -#endif -char fsetxattr (); -#if defined __stub_fsetxattr || defined __stub___fsetxattr -choke me -#endif + #include + -int main (void) +int main(void) { -return fsetxattr (); - ; - return 0; + + switch(0) { + case 0: + case (sizeof(long) == $typesize):; + } + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_fsetxattr="yes" + r=$typesize -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_fsetxattr="no" + r=0 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_fsetxattr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr is prototyped" >&5 -$as_echo_n "checking if fsetxattr is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; + fi + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of long" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_long" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" - $curl_includes_sys_xattr -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fsetxattr" >/dev/null 2>&1; then : +printf "%s\n" "#define SIZEOF_LONG $r" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_fsetxattr="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_fsetxattr="no" -fi -rm -f conftest* - fi - # - if test "$tst_proto_fsetxattr" = "yes"; then - if test "$tst_nargs_fsetxattr" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr takes 5 args." >&5 -$as_echo_n "checking if fsetxattr takes 5 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +printf %s "checking size of int... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_sys_xattr + #include -int main (void) + +int main(void) { - if(0 != fsetxattr(0, 0, 0, 0, 0)) - return 1; + switch(0) { + case 0: + case (sizeof(int) == $typesize):; + } - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_fsetxattr="yes" - tst_nargs_fsetxattr="5" + r=$typesize -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_fsetxattr="no" + r=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; fi - if test "$tst_nargs_fsetxattr" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr takes 6 args." >&5 -$as_echo_n "checking if fsetxattr takes 6 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of int" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_int" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" + + +printf "%s\n" "#define SIZEOF_INT $r" >>confdefs.h + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 +printf %s "checking size of time_t... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_sys_xattr + #include + -int main (void) +int main(void) { - if(0 != fsetxattr(0, 0, 0, 0, 0, 0)) - return 1; + switch(0) { + case 0: + case (sizeof(time_t) == $typesize):; + } - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_fsetxattr="yes" - tst_nargs_fsetxattr="6" + r=$typesize -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_fsetxattr="no" + r=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr is compilable" >&5 -$as_echo_n "checking if fsetxattr is compilable... " >&6; } - if test "$tst_compi_fsetxattr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - # - if test "$tst_compi_fsetxattr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr usage allowed" >&5 -$as_echo_n "checking if fsetxattr usage allowed... " >&6; } - if test "x$curl_disallow_fsetxattr" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_fsetxattr="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_fsetxattr="no" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; fi + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of time_t" "$LINENO" 5 fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fsetxattr might be used" >&5 -$as_echo_n "checking if fsetxattr might be used... " >&6; } - if test "$tst_links_fsetxattr" = "yes" && - test "$tst_proto_fsetxattr" = "yes" && - test "$tst_compi_fsetxattr" = "yes" && - test "$tst_allow_fsetxattr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_FSETXATTR 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_time_t" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" - # - if test "$tst_nargs_fsetxattr" -eq "5"; then -$as_echo "#define HAVE_FSETXATTR_5 1" >>confdefs.h +printf "%s\n" "#define SIZEOF_TIME_T $r" >>confdefs.h - elif test "$tst_nargs_fsetxattr" -eq "6"; then -$as_echo "#define HAVE_FSETXATTR_6 1" >>confdefs.h - fi - # - curl_cv_func_fsetxattr="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_fsetxattr="no" - fi - # - tst_links_ftruncate="unknown" - tst_proto_ftruncate="unknown" - tst_compi_ftruncate="unknown" - tst_allow_ftruncate="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate can be linked" >&5 -$as_echo_n "checking if ftruncate can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +printf %s "checking size of off_t... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define ftruncate innocuous_ftruncate -#ifdef __STDC__ -# include -#else -# include -#endif -#undef ftruncate -#ifdef __cplusplus -extern "C" -#endif -char ftruncate (); -#if defined __stub_ftruncate || defined __stub___ftruncate -choke me -#endif + #include + -int main (void) +int main(void) { -return ftruncate (); - ; - return 0; + + switch(0) { + case 0: + case (sizeof(off_t) == $typesize):; + } + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_ftruncate="yes" + r=$typesize -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_ftruncate="no" + r=0 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_ftruncate" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate is prototyped" >&5 -$as_echo_n "checking if ftruncate is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; + fi + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of off_t" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_off_t" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" - $curl_includes_unistd -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "ftruncate" >/dev/null 2>&1; then : +printf "%s\n" "#define SIZEOF_OFF_T $r" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_ftruncate="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_ftruncate="no" -fi -rm -f conftest* +o=$CPPFLAGS +CPPFLAGS="-I$srcdir/include $CPPFLAGS" - fi - # - if test "$tst_proto_ftruncate" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate is compilable" >&5 -$as_echo_n "checking if ftruncate is compilable... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of curl_off_t" >&5 +printf %s "checking size of curl_off_t... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_unistd + #include -int main (void) +#include + + +int main(void) { - if(0 != ftruncate(0, 0)) - return 1; + switch(0) { + case 0: + case (sizeof(curl_off_t) == $typesize):; + } - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ftruncate="yes" + r=$typesize -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ftruncate="no" + r=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_ftruncate" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate usage allowed" >&5 -$as_echo_n "checking if ftruncate usage allowed... " >&6; } - if test "x$curl_disallow_ftruncate" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ftruncate="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ftruncate="no" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; fi + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of curl_off_t" "$LINENO" 5 fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ftruncate might be used" >&5 -$as_echo_n "checking if ftruncate might be used... " >&6; } - if test "$tst_links_ftruncate" = "yes" && - test "$tst_proto_ftruncate" = "yes" && - test "$tst_compi_ftruncate" = "yes" && - test "$tst_allow_ftruncate" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_curl_off_t" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" -cat >>confdefs.h <<_ACEOF -#define HAVE_FTRUNCATE 1 -_ACEOF - curl_cv_func_ftruncate="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ftruncate="no" - fi +printf "%s\n" "#define SIZEOF_CURL_OFF_T $r" >>confdefs.h -curl_includes_stdlib="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h stdlib.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_stdlib -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of curl_socket_t" >&5 +printf %s "checking size of curl_socket_t... " >&6; } + r=0 + for typesize in 8 4 2 16 1; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + +#include + + +int main(void) +{ + + switch(0) { + case 0: + case (sizeof(curl_socket_t) == $typesize):; + } + + return 0; +} + _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + r=$typesize + +else $as_nop + + r=0 fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $r -gt 0; then + break; + fi + done + if test $r -eq 0; then + as_fn_error $? "Failed to find size of curl_socket_t" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r" >&5 +printf "%s\n" "$r" >&6; } + tname=`echo "ac_cv_sizeof_curl_socket_t" | tr A-Z a-z | tr " " "_"` + eval "$tname=$r" -done +printf "%s\n" "#define SIZEOF_CURL_SOCKET_T $r" >>confdefs.h - # - tst_links_getaddrinfo="unknown" - tst_proto_getaddrinfo="unknown" - tst_compi_getaddrinfo="unknown" - tst_works_getaddrinfo="unknown" - tst_allow_getaddrinfo="unknown" - tst_tsafe_getaddrinfo="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo can be linked" >&5 -$as_echo_n "checking if getaddrinfo can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +CPPFLAGS=$o - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_includes_netdb +ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes +then : -int main (void) -{ +printf "%s\n" "#define HAVE_LONGLONG 1" >>confdefs.h - if(0 != getaddrinfo(0, 0, 0, 0)) - return 1; + longlong="yes" - ; - return 0; -} +fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_getaddrinfo="yes" +if test ${ac_cv_sizeof_curl_off_t} -lt 8; then + as_fn_error $? "64 bit curl_off_t is required" "$LINENO" 5 +fi -else +# check for ssize_t +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_getaddrinfo="no" +else $as_nop + +printf "%s\n" "#define ssize_t int" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_getaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is prototyped" >&5 -$as_echo_n "checking if getaddrinfo is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_includes_netdb -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getaddrinfo" >/dev/null 2>&1; then : +# check for bool type +ac_fn_c_check_type "$LINENO" "bool" "ac_cv_type_bool" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDBOOL_H +#include +#endif - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_getaddrinfo="yes" +" +if test "x$ac_cv_type_bool" = xyes +then : -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_getaddrinfo="no" +printf "%s\n" "#define HAVE_BOOL_T 1" >>confdefs.h + fi -rm -f conftest* - fi - # - if test "$tst_proto_getaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is compilable" >&5 -$as_echo_n "checking if getaddrinfo is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +# check for sa_family_t +ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " +#ifndef _WIN32 +#include +#endif - $curl_includes_ws2tcpip - $curl_includes_sys_socket - $curl_includes_netdb +" +if test "x$ac_cv_type_sa_family_t" = xyes +then : -int main (void) -{ +printf "%s\n" "#define HAVE_SA_FAMILY_T 1" >>confdefs.h - if(0 != getaddrinfo(0, 0, 0, 0)) - return 1; +else $as_nop - ; - return 0; -} + # The Windows name? + ac_fn_c_check_type "$LINENO" "ADDRESS_FAMILY" "ac_cv_type_ADDRESS_FAMILY" " +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#else +#include +#endif -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +" +if test "x$ac_cv_type_ADDRESS_FAMILY" = xyes +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_getaddrinfo="yes" +printf "%s\n" "#define HAVE_ADDRESS_FAMILY 1" >>confdefs.h -else +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_getaddrinfo="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "x$cross_compiling" != "xyes" && - test "$tst_compi_getaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo seems to work" >&5 -$as_echo_n "checking if getaddrinfo seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - $curl_includes_ws2tcpip - $curl_includes_stdlib - $curl_includes_string - $curl_includes_sys_socket - $curl_includes_netdb +# check for suseconds_t +ac_fn_c_check_type "$LINENO" "suseconds_t" "ac_cv_type_suseconds_t" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifndef _WIN32 +#include +#endif -int main (void) -{ +" +if test "x$ac_cv_type_suseconds_t" = xyes +then : - struct addrinfo hints; - struct addrinfo *ai = 0; - int error; - #ifdef HAVE_WINSOCK2_H - WSADATA wsa; - if (WSAStartup(MAKEWORD(2,2), &wsa)) - exit(2); - #endif +printf "%s\n" "#define HAVE_SUSECONDS_T 1" >>confdefs.h - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_NUMERICHOST; - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - error = getaddrinfo("127.0.0.1", 0, &hints, &ai); - if(error || !ai) - exit(1); /* fail */ - else - exit(0); - ; - return 0; -} +fi + + +case $host_os in + amigaos*|msdos*) + +printf "%s\n" "#define HAVE_TIME_T_UNSIGNED 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if time_t is unsigned" >&5 +printf %s "checking if time_t is unsigned... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + int main(void) { + time_t t = -1; + return t < 0; + } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_works_getaddrinfo="yes" +printf "%s\n" "#define HAVE_TIME_T_UNSIGNED 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_works_getaddrinfo="no" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi - # - if test "$tst_compi_getaddrinfo" = "yes" && - test "$tst_works_getaddrinfo" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo usage allowed" >&5 -$as_echo_n "checking if getaddrinfo usage allowed... " >&6; } - if test "x$curl_disallow_getaddrinfo" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_getaddrinfo="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_getaddrinfo="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo might be used" >&5 -$as_echo_n "checking if getaddrinfo might be used... " >&6; } - if test "$tst_links_getaddrinfo" = "yes" && - test "$tst_proto_getaddrinfo" = "yes" && - test "$tst_compi_getaddrinfo" = "yes" && - test "$tst_allow_getaddrinfo" = "yes" && - test "$tst_works_getaddrinfo" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define HAVE_GETADDRINFO 1 -_ACEOF + #include + int main(void) { + time_t t = -1; + return t < 0; + } - curl_cv_func_getaddrinfo="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_getaddrinfo="no" - curl_cv_func_getaddrinfo_threadsafe="no" - fi - # - if test "$curl_cv_func_getaddrinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is threadsafe" >&5 -$as_echo_n "checking if getaddrinfo is threadsafe... " >&6; } - case $host_os in - aix[1234].* | aix5.[01].*) - tst_tsafe_getaddrinfo="no" - ;; - aix*) - tst_tsafe_getaddrinfo="yes" - ;; - darwin[12345].*) - tst_tsafe_getaddrinfo="no" - ;; - darwin*) - tst_tsafe_getaddrinfo="yes" - ;; - freebsd[1234].* | freebsd5.[1234]*) - tst_tsafe_getaddrinfo="no" - ;; - freebsd*) - tst_tsafe_getaddrinfo="yes" - ;; - hpux[123456789].* | hpux10.* | hpux11.0* | hpux11.10*) - tst_tsafe_getaddrinfo="no" - ;; - hpux*) - tst_tsafe_getaddrinfo="yes" - ;; - netbsd[123].*) - tst_tsafe_getaddrinfo="no" - ;; - netbsd*) - tst_tsafe_getaddrinfo="yes" - ;; - *bsd*) - tst_tsafe_getaddrinfo="no" - ;; - solaris2*) - tst_tsafe_getaddrinfo="yes" - ;; - esac - if test "$tst_tsafe_getaddrinfo" = "unknown" && - test "$curl_cv_native_windows" = "yes"; then - tst_tsafe_getaddrinfo="yes" - fi - if test "$tst_tsafe_getaddrinfo" = "unknown"; then +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +printf "%s\n" "#define HAVE_TIME_T_UNSIGNED 1" >>confdefs.h - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - $curl_includes_sys_socket - $curl_includes_netdb +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi -int main (void) -{ -#ifdef h_errno - return 0; -#else - force compilation error -#endif -} + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi + ;; +esac -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - tst_symbol_defined="yes" + ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #endif -else +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes +then : - tst_symbol_defined="no" +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$tst_symbol_defined" = "yes"; then - curl_cv_have_def_h_errno=yes - else - curl_cv_have_def_h_errno=no - fi - if test "$curl_cv_have_def_h_errno" = "yes"; then - tst_h_errno_macro="yes" - else - tst_h_errno_macro="no" - fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h + +fi + + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for select" >&5 +printf %s "checking for select... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - $curl_includes_sys_socket - $curl_includes_netdb -int main (void) + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #include + #include + #endif + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #ifndef _WIN32 + #ifdef HAVE_SYS_SELECT_H + #include + #elif defined(HAVE_UNISTD_H) + #include + #endif + $curl_includes_bsdsocket + #endif + +int main(void) { - h_errno = 2; - if(0 != h_errno) - return 1; + select(0, 0, 0, 0, 0); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - tst_h_errno_modifiable_lvalue="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_cv_select="yes" -else +else $as_nop - tst_h_errno_modifiable_lvalue="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_select="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + # + if test "$curl_cv_select" = "yes"; then + +printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h + + curl_cv_func_select="yes" + fi + + + + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi + + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for recv" >&5 +printf %s "checking for recv... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + $curl_includes_bsdsocket + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #endif -int main (void) +int main(void) { -#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) - return 0; -#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700) - return 0; -#else - force compilation error -#endif + recv(0, 0, 0, 0); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - tst_h_errno_sbs_issue_7="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_cv_recv="yes" -else +else $as_nop - tst_h_errno_sbs_issue_7="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_recv="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$tst_h_errno_macro" = "no" && - test "$tst_h_errno_modifiable_lvalue" = "no" && - test "$tst_h_errno_sbs_issue_7" = "no"; then - tst_tsafe_getaddrinfo="no" - else - tst_tsafe_getaddrinfo="yes" - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_tsafe_getaddrinfo" >&5 -$as_echo "$tst_tsafe_getaddrinfo" >&6; } - if test "$tst_tsafe_getaddrinfo" = "yes"; then +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + # + if test "$curl_cv_recv" = "yes"; then -cat >>confdefs.h <<_ACEOF -#define HAVE_GETADDRINFO_THREADSAFE 1 -_ACEOF +printf "%s\n" "#define HAVE_RECV 1" >>confdefs.h - curl_cv_func_getaddrinfo_threadsafe="yes" - else - curl_cv_func_getaddrinfo_threadsafe="no" - fi + curl_cv_func_recv="yes" + else + as_fn_error $? "Unable to link function recv" "$LINENO" 5 fi - # - tst_links_gai_strerror="unknown" - tst_proto_gai_strerror="unknown" - tst_compi_gai_strerror="unknown" - tst_allow_gai_strerror="unknown" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi + # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror can be linked" >&5 -$as_echo_n "checking if gai_strerror can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for send" >&5 +printf %s "checking for send... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_netdb + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + $curl_includes_bsdsocket + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #endif -int main (void) +int main(void) { - if(0 != gai_strerror(0)) - return 1; + char s[] = ""; + send(0, (void *)s, 0, 0); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_gai_strerror="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_cv_send="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_gai_strerror="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_send="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_gai_strerror" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror is prototyped" >&5 -$as_echo_n "checking if gai_strerror is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_winsock2 - $curl_includes_netdb + if test "$curl_cv_send" = "yes"; then -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gai_strerror" >/dev/null 2>&1; then : +printf "%s\n" "#define HAVE_SEND 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_gai_strerror="yes" + curl_cv_func_send="yes" + else + as_fn_error $? "Unable to link function send" "$LINENO" 5 + fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_gai_strerror="no" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -rm -f conftest* - fi - # - if test "$tst_proto_gai_strerror" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror is compilable" >&5 -$as_echo_n "checking if gai_strerror is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MSG_NOSIGNAL" >&5 +printf %s "checking for MSG_NOSIGNAL... " >&6; } +if test ${curl_cv_msg_nosignal+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_netdb + #undef inline + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #else + #ifdef HAVE_SYS_TYPES_H + #include + #endif + #include + #endif -int main (void) +int main(void) { - if(0 != gai_strerror(0)) - return 1; + int flag = MSG_NOSIGNAL; + (void)flag; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gai_strerror="yes" + curl_cv_msg_nosignal="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gai_strerror="no" + curl_cv_msg_nosignal="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_gai_strerror" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror usage allowed" >&5 -$as_echo_n "checking if gai_strerror usage allowed... " >&6; } - if test "x$curl_disallow_gai_strerror" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_gai_strerror="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_gai_strerror="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gai_strerror might be used" >&5 -$as_echo_n "checking if gai_strerror might be used... " >&6; } - if test "$tst_links_gai_strerror" = "yes" && - test "$tst_proto_gai_strerror" = "yes" && - test "$tst_compi_gai_strerror" = "yes" && - test "$tst_allow_gai_strerror" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define HAVE_GAI_STRERROR 1 -_ACEOF +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_msg_nosignal" >&5 +printf "%s\n" "$curl_cv_msg_nosignal" >&6; } + case "$curl_cv_msg_nosignal" in + yes) - curl_cv_func_gai_strerror="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_gai_strerror="no" - fi +printf "%s\n" "#define HAVE_MSG_NOSIGNAL 1" >>confdefs.h + + ;; + esac - # - tst_links_gethostbyaddr="unknown" - tst_proto_gethostbyaddr="unknown" - tst_compi_gethostbyaddr="unknown" - tst_allow_gethostbyaddr="unknown" + +curl_includes_unistd="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_unistd +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$curl_includes_unistd +" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi + + + + # + tst_links_alarm="unknown" + tst_proto_alarm="unknown" + tst_compi_alarm="unknown" + tst_allow_alarm="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr can be linked" >&5 -$as_echo_n "checking if gethostbyaddr can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if alarm can be linked" >&5 +printf %s "checking if alarm can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_netdb +#define alarm innocuous_alarm +#ifdef __STDC__ +# include +#else +# include +#endif +#undef alarm +#ifdef __cplusplus +extern "C" +#endif +char alarm (); +#if defined __stub_alarm || defined __stub___alarm +#error force compilation error +#endif -int main (void) +int main(void) { - - if(0 != gethostbyaddr(0, 0, 0)) - return 1; - - ; - return 0; +return alarm (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_gethostbyaddr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_alarm="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_gethostbyaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_alarm="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_gethostbyaddr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr is prototyped" >&5 -$as_echo_n "checking if gethostbyaddr is prototyped... " >&6; } + if test "$tst_links_alarm" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if alarm is prototyped" >&5 +printf %s "checking if alarm is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_netdb + $curl_includes_unistd _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyaddr" >/dev/null 2>&1; then : + $EGREP "alarm" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_gethostbyaddr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_alarm="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_gethostbyaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_alarm="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_gethostbyaddr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr is compilable" >&5 -$as_echo_n "checking if gethostbyaddr is compilable... " >&6; } + if test "$tst_proto_alarm" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if alarm is compilable" >&5 +printf %s "checking if alarm is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_netdb + $curl_includes_unistd -int main (void) +int main(void) { - if(0 != gethostbyaddr(0, 0, 0)) + if(0 != alarm(0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyaddr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_alarm="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_alarm="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_gethostbyaddr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr usage allowed" >&5 -$as_echo_n "checking if gethostbyaddr usage allowed... " >&6; } - if test "x$curl_disallow_gethostbyaddr" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_gethostbyaddr="yes" + if test "$tst_compi_alarm" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if alarm usage allowed" >&5 +printf %s "checking if alarm usage allowed... " >&6; } + if test "x$curl_disallow_alarm" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_alarm="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_gethostbyaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_alarm="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr might be used" >&5 -$as_echo_n "checking if gethostbyaddr might be used... " >&6; } - if test "$tst_links_gethostbyaddr" = "yes" && - test "$tst_proto_gethostbyaddr" = "yes" && - test "$tst_compi_gethostbyaddr" = "yes" && - test "$tst_allow_gethostbyaddr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if alarm might be used" >&5 +printf %s "checking if alarm might be used... " >&6; } + if test "$tst_links_alarm" = "yes" && + test "$tst_proto_alarm" = "yes" && + test "$tst_compi_alarm" = "yes" && + test "$tst_allow_alarm" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_GETHOSTBYADDR 1 -_ACEOF +printf "%s\n" "#define HAVE_ALARM 1" >>confdefs.h - curl_cv_func_gethostbyaddr="yes" + curl_cv_func_alarm="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_gethostbyaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_alarm="no" fi - # - tst_links_gethostbyaddr_r="unknown" - tst_proto_gethostbyaddr_r="unknown" - tst_compi_gethostbyaddr_r="unknown" - tst_allow_gethostbyaddr_r="unknown" - tst_nargs_gethostbyaddr_r="unknown" +curl_includes_string="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#include +#ifdef HAVE_STRINGS_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_string +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$curl_includes_string +" +if test "x$ac_cv_header_strings_h" = xyes +then : + printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h + +fi + + + +curl_includes_libgen="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_LIBGEN_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_libgen +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$curl_includes_libgen +" +if test "x$ac_cv_header_libgen_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBGEN_H 1" >>confdefs.h + +fi + + + + # + tst_links_basename="unknown" + tst_proto_basename="unknown" + tst_compi_basename="unknown" + tst_allow_basename="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r can be linked" >&5 -$as_echo_n "checking if gethostbyaddr_r can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if basename can be linked" >&5 +printf %s "checking if basename can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define gethostbyaddr_r innocuous_gethostbyaddr_r +#define basename innocuous_basename #ifdef __STDC__ # include #else # include #endif -#undef gethostbyaddr_r +#undef basename #ifdef __cplusplus extern "C" #endif -char gethostbyaddr_r (); -#if defined __stub_gethostbyaddr_r || defined __stub___gethostbyaddr_r -choke me +char basename (); +#if defined __stub_basename || defined __stub___basename +#error force compilation error #endif -int main (void) +int main(void) { -return gethostbyaddr_r (); - ; - return 0; +return basename (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_gethostbyaddr_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_basename="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_gethostbyaddr_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_basename="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_gethostbyaddr_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r is prototyped" >&5 -$as_echo_n "checking if gethostbyaddr_r is prototyped... " >&6; } + if test "$tst_links_basename" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if basename is prototyped" >&5 +printf %s "checking if basename is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb + $curl_includes_string + $curl_includes_libgen + $curl_includes_unistd _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyaddr_r" >/dev/null 2>&1; then : + $EGREP "basename" >/dev/null 2>&1 +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_basename="yes" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_basename="no" + +fi +rm -rf conftest* + + fi + # + if test "$tst_proto_basename" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if basename is compilable" >&5 +printf %s "checking if basename is compilable... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_gethostbyaddr_r="yes" -else + $curl_includes_string + $curl_includes_libgen + $curl_includes_unistd + +int main(void) +{ + + if(0 != basename(0)) + return 1; + + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_basename="yes" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_basename="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + # + if test "$tst_compi_basename" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if basename usage allowed" >&5 +printf %s "checking if basename usage allowed... " >&6; } + if test "x$curl_disallow_basename" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_basename="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_basename="no" + fi + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if basename might be used" >&5 +printf %s "checking if basename might be used... " >&6; } + if test "$tst_links_basename" = "yes" && + test "$tst_proto_basename" = "yes" && + test "$tst_compi_basename" = "yes" && + test "$tst_allow_basename" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_BASENAME 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_gethostbyaddr_r="no" + curl_cv_func_basename="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_basename="no" + fi -fi -rm -f conftest* - fi + # + tst_links_closesocket="unknown" + tst_proto_closesocket="unknown" + tst_compi_closesocket="unknown" + tst_allow_closesocket="unknown" # - if test "$tst_proto_gethostbyaddr_r" = "yes"; then - if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r takes 5 args." >&5 -$as_echo_n "checking if gethostbyaddr_r takes 5 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if closesocket can be linked" >&5 +printf %s "checking if closesocket can be linked... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb + $curl_includes_winsock2 -int main (void) +int main(void) { - if(0 != gethostbyaddr_r(0, 0, 0, 0, 0)) - return 1; + if(0 != closesocket(0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyaddr_r="yes" - tst_nargs_gethostbyaddr_r="5" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_closesocket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyaddr_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_closesocket="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r takes 7 args." >&5 -$as_echo_n "checking if gethostbyaddr_r takes 7 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + # + if test "$tst_links_closesocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if closesocket is prototyped" >&5 +printf %s "checking if closesocket is prototyped... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - $curl_includes_netdb - -int main (void) -{ - - if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0)) - return 1; - - ; - return 0; -} + $curl_includes_winsock2 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "closesocket" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyaddr_r="yes" - tst_nargs_gethostbyaddr_r="7" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_closesocket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyaddr_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_closesocket="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r takes 8 args." >&5 -$as_echo_n "checking if gethostbyaddr_r takes 8 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -rf conftest* + + fi + # + if test "$tst_proto_closesocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if closesocket is compilable" >&5 +printf %s "checking if closesocket is compilable... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb + $curl_includes_winsock2 -int main (void) +int main(void) { - if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0)) - return 1; + if(0 != closesocket(0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyaddr_r="yes" - tst_nargs_gethostbyaddr_r="8" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_closesocket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyaddr_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_closesocket="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r is compilable" >&5 -$as_echo_n "checking if gethostbyaddr_r is compilable... " >&6; } - if test "$tst_compi_gethostbyaddr_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_gethostbyaddr_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r usage allowed" >&5 -$as_echo_n "checking if gethostbyaddr_r usage allowed... " >&6; } - if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_gethostbyaddr_r="yes" + if test "$tst_compi_closesocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if closesocket usage allowed" >&5 +printf %s "checking if closesocket usage allowed... " >&6; } + if test "x$curl_disallow_closesocket" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_closesocket="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_gethostbyaddr_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_closesocket="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyaddr_r might be used" >&5 -$as_echo_n "checking if gethostbyaddr_r might be used... " >&6; } - if test "$tst_links_gethostbyaddr_r" = "yes" && - test "$tst_proto_gethostbyaddr_r" = "yes" && - test "$tst_compi_gethostbyaddr_r" = "yes" && - test "$tst_allow_gethostbyaddr_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_GETHOSTBYADDR_R 1 -_ACEOF - - # - if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if closesocket might be used" >&5 +printf %s "checking if closesocket might be used... " >&6; } + if test "$tst_links_closesocket" = "yes" && + test "$tst_proto_closesocket" = "yes" && + test "$tst_compi_closesocket" = "yes" && + test "$tst_allow_closesocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_GETHOSTBYADDR_R_5 1" >>confdefs.h +printf "%s\n" "#define HAVE_CLOSESOCKET 1" >>confdefs.h - elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then + curl_cv_func_closesocket="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_closesocket="no" + fi -$as_echo "#define HAVE_GETHOSTBYADDR_R_7 1" >>confdefs.h - elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then +curl_includes_sys_socket="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifndef _WIN32 +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_sys_socket +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h -$as_echo "#define HAVE_GETHOSTBYADDR_R_8 1" >>confdefs.h +fi - fi - # - curl_cv_func_gethostbyaddr_r="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_gethostbyaddr_r="no" - fi # - tst_links_gethostbyname="unknown" - tst_proto_gethostbyname="unknown" - tst_compi_gethostbyname="unknown" - tst_allow_gethostbyname="unknown" + tst_links_closesocket_camel="unknown" + tst_compi_closesocket_camel="unknown" + tst_allow_closesocket_camel="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname can be linked" >&5 -$as_echo_n "checking if gethostbyname can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if CloseSocket can be linked" >&5 +printf %s "checking if CloseSocket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_netdb + $curl_includes_bsdsocket + $curl_includes_sys_socket -int main (void) +int main(void) { - if(0 != gethostbyname(0)) + if(0 != CloseSocket(0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_gethostbyname="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_closesocket_camel="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_gethostbyname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_closesocket_camel="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_gethostbyname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname is prototyped" >&5 -$as_echo_n "checking if gethostbyname is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_winsock2 - $curl_includes_netdb - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyname" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_gethostbyname="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_gethostbyname="no" - -fi -rm -f conftest* - - fi - # - if test "$tst_proto_gethostbyname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname is compilable" >&5 -$as_echo_n "checking if gethostbyname is compilable... " >&6; } + if test "$tst_links_closesocket_camel" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if CloseSocket is compilable" >&5 +printf %s "checking if CloseSocket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_netdb + $curl_includes_bsdsocket + $curl_includes_sys_socket -int main (void) +int main(void) { - if(0 != gethostbyname(0)) + if(0 != CloseSocket(0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyname="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_closesocket_camel="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_closesocket_camel="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_gethostbyname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname usage allowed" >&5 -$as_echo_n "checking if gethostbyname usage allowed... " >&6; } - if test "x$curl_disallow_gethostbyname" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_gethostbyname="yes" + if test "$tst_compi_closesocket_camel" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if CloseSocket usage allowed" >&5 +printf %s "checking if CloseSocket usage allowed... " >&6; } + if test "x$curl_disallow_closesocket_camel" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_closesocket_camel="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_gethostbyname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_closesocket_camel="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname might be used" >&5 -$as_echo_n "checking if gethostbyname might be used... " >&6; } - if test "$tst_links_gethostbyname" = "yes" && - test "$tst_proto_gethostbyname" = "yes" && - test "$tst_compi_gethostbyname" = "yes" && - test "$tst_allow_gethostbyname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if CloseSocket might be used" >&5 +printf %s "checking if CloseSocket might be used... " >&6; } + if test "$tst_links_closesocket_camel" = "yes" && + test "$tst_compi_closesocket_camel" = "yes" && + test "$tst_allow_closesocket_camel" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_GETHOSTBYNAME 1 -_ACEOF +printf "%s\n" "#define HAVE_CLOSESOCKET_CAMEL 1" >>confdefs.h - curl_cv_func_gethostbyname="yes" + curl_cv_func_closesocket_camel="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_gethostbyname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_closesocket_camel="no" fi +curl_includes_fcntl="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_FCNTL_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_fcntl +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$curl_includes_fcntl +" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$curl_includes_fcntl +" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h + +fi + + + # - tst_links_gethostbyname_r="unknown" - tst_proto_gethostbyname_r="unknown" - tst_compi_gethostbyname_r="unknown" - tst_allow_gethostbyname_r="unknown" - tst_nargs_gethostbyname_r="unknown" + tst_links_fcntl="unknown" + tst_proto_fcntl="unknown" + tst_compi_fcntl="unknown" + tst_allow_fcntl="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r can be linked" >&5 -$as_echo_n "checking if gethostbyname_r can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl can be linked" >&5 +printf %s "checking if fcntl can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define gethostbyname_r innocuous_gethostbyname_r +#define fcntl innocuous_fcntl #ifdef __STDC__ # include #else # include #endif -#undef gethostbyname_r +#undef fcntl #ifdef __cplusplus extern "C" #endif -char gethostbyname_r (); -#if defined __stub_gethostbyname_r || defined __stub___gethostbyname_r -choke me +char fcntl (); +#if defined __stub_fcntl || defined __stub___fcntl +#error force compilation error #endif -int main (void) +int main(void) { -return gethostbyname_r (); - ; - return 0; +return fcntl (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_gethostbyname_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_fcntl="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_gethostbyname_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_fcntl="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_gethostbyname_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r is prototyped" >&5 -$as_echo_n "checking if gethostbyname_r is prototyped... " >&6; } + if test "$tst_links_fcntl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl is prototyped" >&5 +printf %s "checking if fcntl is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb + $curl_includes_fcntl _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostbyname_r" >/dev/null 2>&1; then : + $EGREP "fcntl" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_gethostbyname_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_fcntl="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_gethostbyname_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_fcntl="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_gethostbyname_r" = "yes"; then - if test "$tst_nargs_gethostbyname_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 3 args." >&5 -$as_echo_n "checking if gethostbyname_r takes 3 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$tst_proto_fcntl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl is compilable" >&5 +printf %s "checking if fcntl is compilable... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_fcntl + +int main(void) +{ + + if(0 != fcntl(0, 0, 0)) + return 1; + + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_fcntl="yes" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_fcntl="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + # + if test "$tst_compi_fcntl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl usage allowed" >&5 +printf %s "checking if fcntl usage allowed... " >&6; } + if test "x$curl_disallow_fcntl" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_fcntl="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_fcntl="no" + fi + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl might be used" >&5 +printf %s "checking if fcntl might be used... " >&6; } + if test "$tst_links_fcntl" = "yes" && + test "$tst_proto_fcntl" = "yes" && + test "$tst_compi_fcntl" = "yes" && + test "$tst_allow_fcntl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_FCNTL 1" >>confdefs.h + + curl_cv_func_fcntl="yes" + + # + tst_compi_fcntl_o_nonblock="unknown" + tst_allow_fcntl_o_nonblock="unknown" + # + case $host_os in + sunos4* | aix3*) + curl_disallow_fcntl_o_nonblock="yes" + ;; + esac + # + if test "$curl_cv_func_fcntl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK is compilable" >&5 +printf %s "checking if fcntl O_NONBLOCK is compilable... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb + $curl_includes_fcntl -int main (void) +int main(void) { - if(0 != gethostbyname_r(0, 0, 0)) - return 1; + int flags = 0; + if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyname_r="yes" - tst_nargs_gethostbyname_r="3" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_fcntl_o_nonblock="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyname_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_fcntl_o_nonblock="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + # + if test "$tst_compi_fcntl_o_nonblock" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK usage allowed" >&5 +printf %s "checking if fcntl O_NONBLOCK usage allowed... " >&6; } + if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_fcntl_o_nonblock="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_fcntl_o_nonblock="no" fi - if test "$tst_nargs_gethostbyname_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 5 args." >&5 -$as_echo_n "checking if gethostbyname_r takes 5 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_netdb - -int main (void) -{ + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fcntl O_NONBLOCK might be used" >&5 +printf %s "checking if fcntl O_NONBLOCK might be used... " >&6; } + if test "$tst_compi_fcntl_o_nonblock" = "yes" && + test "$tst_allow_fcntl_o_nonblock" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - if(0 != gethostbyname_r(0, 0, 0, 0, 0)) - return 1; +printf "%s\n" "#define HAVE_FCNTL_O_NONBLOCK 1" >>confdefs.h - ; - return 0; -} + curl_cv_func_fcntl_o_nonblock="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_fcntl_o_nonblock="no" + fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_fcntl="no" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyname_r="yes" - tst_nargs_gethostbyname_r="5" -else +curl_includes_ws2tcpip="\ +/* includes start */ +#ifdef _WIN32 +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include +# include +#endif +/* includes end */" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyname_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build target is a native Windows one" >&5 +printf %s "checking whether build target is a native Windows one... " >&6; } +if test ${curl_cv_native_windows+y} +then : + printf %s "(cached) " >&6 +else $as_nop -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "$tst_nargs_gethostbyname_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 6 args." >&5 -$as_echo_n "checking if gethostbyname_r takes 6 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb -int main (void) +int main(void) { - if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0)) - return 1; + #ifdef _WIN32 + int dummy = 1; + (void)dummy; + #else + #error Not a native Windows build target. + #endif - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostbyname_r="yes" - tst_nargs_gethostbyname_r="6" + curl_cv_native_windows="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostbyname_r="no" + curl_cv_native_windows="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r is compilable" >&5 -$as_echo_n "checking if gethostbyname_r is compilable... " >&6; } - if test "$tst_compi_gethostbyname_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - fi - # - if test "$tst_compi_gethostbyname_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r usage allowed" >&5 -$as_echo_n "checking if gethostbyname_r usage allowed... " >&6; } - if test "x$curl_disallow_gethostbyname_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_gethostbyname_r="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_gethostbyname_r="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r might be used" >&5 -$as_echo_n "checking if gethostbyname_r might be used... " >&6; } - if test "$tst_links_gethostbyname_r" = "yes" && - test "$tst_proto_gethostbyname_r" = "yes" && - test "$tst_compi_gethostbyname_r" = "yes" && - test "$tst_allow_gethostbyname_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define HAVE_GETHOSTBYNAME_R 1 -_ACEOF +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_native_windows" >&5 +printf "%s\n" "$curl_cv_native_windows" >&6; } + if test "x$curl_cv_native_windows" = xyes; then + DOING_NATIVE_WINDOWS_TRUE= + DOING_NATIVE_WINDOWS_FALSE='#' +else + DOING_NATIVE_WINDOWS_TRUE='#' + DOING_NATIVE_WINDOWS_FALSE= +fi - # - if test "$tst_nargs_gethostbyname_r" -eq "3"; then -$as_echo "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h - elif test "$tst_nargs_gethostbyname_r" -eq "5"; then -$as_echo "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h +curl_includes_netdb="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETDB_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_netdb +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h - elif test "$tst_nargs_gethostbyname_r" -eq "6"; then +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$curl_includes_netdb +" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h -$as_echo "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h +fi - fi - # - curl_cv_func_gethostbyname_r="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_gethostbyname_r="no" - fi # - tst_links_gethostname="unknown" - tst_proto_gethostname="unknown" - tst_compi_gethostname="unknown" - tst_allow_gethostname="unknown" + tst_links_freeaddrinfo="unknown" + tst_proto_freeaddrinfo="unknown" + tst_compi_freeaddrinfo="unknown" + tst_allow_freeaddrinfo="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname can be linked" >&5 -$as_echo_n "checking if gethostname can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo can be linked" >&5 +printf %s "checking if freeaddrinfo can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_unistd + $curl_includes_ws2tcpip + $curl_includes_sys_socket + $curl_includes_netdb -int main (void) +int main(void) { - if(0 != gethostname(0, 0)) - return 1; + freeaddrinfo(0); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_gethostname="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_freeaddrinfo="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_gethostname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_freeaddrinfo="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_gethostname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname is prototyped" >&5 -$as_echo_n "checking if gethostname is prototyped... " >&6; } + if test "$tst_links_freeaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo is prototyped" >&5 +printf %s "checking if freeaddrinfo is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_unistd + $curl_includes_ws2tcpip + $curl_includes_sys_socket + $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gethostname" >/dev/null 2>&1; then : + $EGREP "freeaddrinfo" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_gethostname="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_freeaddrinfo="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_gethostname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_freeaddrinfo="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_gethostname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname is compilable" >&5 -$as_echo_n "checking if gethostname is compilable... " >&6; } + if test "$tst_proto_freeaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo is compilable" >&5 +printf %s "checking if freeaddrinfo is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_unistd + $curl_includes_ws2tcpip + $curl_includes_sys_socket + $curl_includes_netdb -int main (void) +int main(void) { - if(0 != gethostname(0, 0)) - return 1; + freeaddrinfo(0); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gethostname="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gethostname="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_gethostname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostname arg 2 data type" >&5 -$as_echo_n "checking for gethostname arg 2 data type... " >&6; } - tst_gethostname_type_arg2="unknown" - for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do - for tst_arg2 in 'int' 'unsigned int' 'size_t'; do - if test "$tst_gethostname_type_arg2" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_winsock2 - $curl_includes_unistd - $curl_preprocess_callconv - extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2); - -int main (void) -{ - - if(0 != gethostname(0, 0)) - return 1; +if ac_fn_c_try_compile "$LINENO" +then : - ; - return 0; -} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_freeaddrinfo="yes" -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +else $as_nop - tst_gethostname_type_arg2="$tst_arg2" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_freeaddrinfo="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_gethostname_type_arg2" >&5 -$as_echo "$tst_gethostname_type_arg2" >&6; } - if test "$tst_gethostname_type_arg2" != "unknown"; then - -cat >>confdefs.h <<_ACEOF -#define GETHOSTNAME_TYPE_ARG2 $tst_gethostname_type_arg2 -_ACEOF - - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_gethostname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname usage allowed" >&5 -$as_echo_n "checking if gethostname usage allowed... " >&6; } - if test "x$curl_disallow_gethostname" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_gethostname="yes" + if test "$tst_compi_freeaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo usage allowed" >&5 +printf %s "checking if freeaddrinfo usage allowed... " >&6; } + if test "x$curl_disallow_freeaddrinfo" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_freeaddrinfo="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_gethostname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_freeaddrinfo="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gethostname might be used" >&5 -$as_echo_n "checking if gethostname might be used... " >&6; } - if test "$tst_links_gethostname" = "yes" && - test "$tst_proto_gethostname" = "yes" && - test "$tst_compi_gethostname" = "yes" && - test "$tst_allow_gethostname" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if freeaddrinfo might be used" >&5 +printf %s "checking if freeaddrinfo might be used... " >&6; } + if test "$tst_links_freeaddrinfo" = "yes" && + test "$tst_proto_freeaddrinfo" = "yes" && + test "$tst_compi_freeaddrinfo" = "yes" && + test "$tst_allow_freeaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_GETHOSTNAME 1 -_ACEOF +printf "%s\n" "#define HAVE_FREEADDRINFO 1" >>confdefs.h - curl_cv_func_gethostname="yes" + curl_cv_func_freeaddrinfo="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_gethostname="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_freeaddrinfo="no" fi - # - tst_links_getifaddrs="unknown" - tst_proto_getifaddrs="unknown" - tst_compi_getifaddrs="unknown" - tst_works_getifaddrs="unknown" - tst_allow_getifaddrs="unknown" +curl_includes_sys_xattr="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_XATTR_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_sys_xattr +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$curl_includes_sys_xattr +" +if test "x$ac_cv_header_sys_xattr_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_XATTR_H 1" >>confdefs.h + +fi + + + + # + tst_links_fsetxattr="unknown" + tst_proto_fsetxattr="unknown" + tst_compi_fsetxattr="unknown" + tst_allow_fsetxattr="unknown" + tst_nargs_fsetxattr="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs can be linked" >&5 -$as_echo_n "checking if getifaddrs can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fsetxattr can be linked" >&5 +printf %s "checking if fsetxattr can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define getifaddrs innocuous_getifaddrs +#define fsetxattr innocuous_fsetxattr #ifdef __STDC__ # include #else # include #endif -#undef getifaddrs +#undef fsetxattr #ifdef __cplusplus extern "C" #endif -char getifaddrs (); -#if defined __stub_getifaddrs || defined __stub___getifaddrs -choke me +char fsetxattr (); +#if defined __stub_fsetxattr || defined __stub___fsetxattr +#error force compilation error #endif -int main (void) +int main(void) { -return getifaddrs (); - ; - return 0; +return fsetxattr (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_getifaddrs="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_fsetxattr="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_getifaddrs="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_fsetxattr="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_getifaddrs" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs is prototyped" >&5 -$as_echo_n "checking if getifaddrs is prototyped... " >&6; } + if test "$tst_links_fsetxattr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fsetxattr is prototyped" >&5 +printf %s "checking if fsetxattr is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_ifaddrs + $curl_includes_sys_xattr _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getifaddrs" >/dev/null 2>&1; then : + $EGREP "fsetxattr" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_getifaddrs="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_fsetxattr="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_getifaddrs="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_fsetxattr="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_getifaddrs" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs is compilable" >&5 -$as_echo_n "checking if getifaddrs is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$tst_proto_fsetxattr" = "yes"; then + if test "$tst_nargs_fsetxattr" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fsetxattr takes 5 args." >&5 +printf %s "checking if fsetxattr takes 5 args.... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_ifaddrs + $curl_includes_sys_xattr -int main (void) +int main(void) { - if(0 != getifaddrs(0)) - return 1; + if(0 != fsetxattr(0, "", 0, 0, 0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_getifaddrs="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_fsetxattr="yes" + tst_nargs_fsetxattr="5" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_getifaddrs="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_fsetxattr="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "x$cross_compiling" != "xyes" && - test "$tst_compi_getifaddrs" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs seems to work" >&5 -$as_echo_n "checking if getifaddrs seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test "$tst_nargs_fsetxattr" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fsetxattr takes 6 args." >&5 +printf %s "checking if fsetxattr takes 6 args.... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stdlib - $curl_includes_ifaddrs + $curl_includes_sys_xattr -int main (void) +int main(void) { - struct ifaddrs *ifa = 0; - int error; - - error = getifaddrs(&ifa); - if(error || !ifa) - exit(1); /* fail */ - else - exit(0); + if(0 != fsetxattr(0, 0, 0, 0, 0, 0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_works_getifaddrs="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_fsetxattr="yes" + tst_nargs_fsetxattr="6" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_works_getifaddrs="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_fsetxattr="no" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fsetxattr is compilable" >&5 +printf %s "checking if fsetxattr is compilable... " >&6; } + if test "$tst_compi_fsetxattr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi fi # - if test "$tst_compi_getifaddrs" = "yes" && - test "$tst_works_getifaddrs" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs usage allowed" >&5 -$as_echo_n "checking if getifaddrs usage allowed... " >&6; } - if test "x$curl_disallow_getifaddrs" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_getifaddrs="yes" + if test "$tst_compi_fsetxattr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fsetxattr usage allowed" >&5 +printf %s "checking if fsetxattr usage allowed... " >&6; } + if test "x$curl_disallow_fsetxattr" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_fsetxattr="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_getifaddrs="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_fsetxattr="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getifaddrs might be used" >&5 -$as_echo_n "checking if getifaddrs might be used... " >&6; } - if test "$tst_links_getifaddrs" = "yes" && - test "$tst_proto_getifaddrs" = "yes" && - test "$tst_compi_getifaddrs" = "yes" && - test "$tst_allow_getifaddrs" = "yes" && - test "$tst_works_getifaddrs" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if fsetxattr might be used" >&5 +printf %s "checking if fsetxattr might be used... " >&6; } + if test "$tst_links_fsetxattr" = "yes" && + test "$tst_proto_fsetxattr" = "yes" && + test "$tst_compi_fsetxattr" = "yes" && + test "$tst_allow_fsetxattr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_GETIFADDRS 1 -_ACEOF +printf "%s\n" "#define HAVE_FSETXATTR 1" >>confdefs.h - curl_cv_func_getifaddrs="yes" + # + if test "$tst_nargs_fsetxattr" -eq "5"; then + +printf "%s\n" "#define HAVE_FSETXATTR_5 1" >>confdefs.h + + elif test "$tst_nargs_fsetxattr" -eq "6"; then + +printf "%s\n" "#define HAVE_FSETXATTR_6 1" >>confdefs.h + + fi + # + curl_cv_func_fsetxattr="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_getifaddrs="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_fsetxattr="no" fi # - tst_links_getservbyport_r="unknown" - tst_proto_getservbyport_r="unknown" - tst_compi_getservbyport_r="unknown" - tst_allow_getservbyport_r="unknown" - tst_nargs_getservbyport_r="unknown" + tst_links_ftruncate="unknown" + tst_proto_ftruncate="unknown" + tst_compi_ftruncate="unknown" + tst_allow_ftruncate="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r can be linked" >&5 -$as_echo_n "checking if getservbyport_r can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ftruncate can be linked" >&5 +printf %s "checking if ftruncate can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define getservbyport_r innocuous_getservbyport_r +#define ftruncate innocuous_ftruncate #ifdef __STDC__ # include #else # include #endif -#undef getservbyport_r +#undef ftruncate #ifdef __cplusplus extern "C" #endif -char getservbyport_r (); -#if defined __stub_getservbyport_r || defined __stub___getservbyport_r -choke me +char ftruncate (); +#if defined __stub_ftruncate || defined __stub___ftruncate +#error force compilation error #endif -int main (void) +int main(void) { -return getservbyport_r (); - ; - return 0; +return ftruncate (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_getservbyport_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_ftruncate="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_getservbyport_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_ftruncate="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_getservbyport_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r is prototyped" >&5 -$as_echo_n "checking if getservbyport_r is prototyped... " >&6; } + if test "$tst_links_ftruncate" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ftruncate is prototyped" >&5 +printf %s "checking if ftruncate is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb + $curl_includes_unistd _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getservbyport_r" >/dev/null 2>&1; then : + $EGREP "ftruncate" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_getservbyport_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_ftruncate="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_getservbyport_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_ftruncate="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_getservbyport_r" = "yes"; then - if test "$tst_nargs_getservbyport_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r takes 4 args." >&5 -$as_echo_n "checking if getservbyport_r takes 4 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_netdb - -int main (void) -{ - - if(0 != getservbyport_r(0, 0, 0, 0)) - return 1; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_getservbyport_r="yes" - tst_nargs_getservbyport_r="4" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_getservbyport_r="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "$tst_nargs_getservbyport_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r takes 5 args." >&5 -$as_echo_n "checking if getservbyport_r takes 5 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_netdb - -int main (void) -{ - - if(0 != getservbyport_r(0, 0, 0, 0, 0)) - return 1; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_getservbyport_r="yes" - tst_nargs_getservbyport_r="5" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_getservbyport_r="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test "$tst_nargs_getservbyport_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r takes 6 args." >&5 -$as_echo_n "checking if getservbyport_r takes 6 args.... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$tst_proto_ftruncate" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ftruncate is compilable" >&5 +printf %s "checking if ftruncate is compilable... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_netdb + $curl_includes_unistd -int main (void) +int main(void) { - if(0 != getservbyport_r(0, 0, 0, 0, 0, 0)) - return 1; + if(0 != ftruncate(0, 0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_getservbyport_r="yes" - tst_nargs_getservbyport_r="6" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ftruncate="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_getservbyport_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ftruncate="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r is compilable" >&5 -$as_echo_n "checking if getservbyport_r is compilable... " >&6; } - if test "$tst_compi_getservbyport_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_getservbyport_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r usage allowed" >&5 -$as_echo_n "checking if getservbyport_r usage allowed... " >&6; } - if test "x$curl_disallow_getservbyport_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_getservbyport_r="yes" + if test "$tst_compi_ftruncate" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ftruncate usage allowed" >&5 +printf %s "checking if ftruncate usage allowed... " >&6; } + if test "x$curl_disallow_ftruncate" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ftruncate="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_getservbyport_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ftruncate="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getservbyport_r might be used" >&5 -$as_echo_n "checking if getservbyport_r might be used... " >&6; } - if test "$tst_links_getservbyport_r" = "yes" && - test "$tst_proto_getservbyport_r" = "yes" && - test "$tst_compi_getservbyport_r" = "yes" && - test "$tst_allow_getservbyport_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_GETSERVBYPORT_R 1 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define GETSERVBYPORT_R_ARGS $tst_nargs_getservbyport_r -_ACEOF - - if test "$tst_nargs_getservbyport_r" -eq "4"; then - -$as_echo "#define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data)" >>confdefs.h - - else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ftruncate might be used" >&5 +printf %s "checking if ftruncate might be used... " >&6; } + if test "$tst_links_ftruncate" = "yes" && + test "$tst_proto_ftruncate" = "yes" && + test "$tst_compi_ftruncate" = "yes" && + test "$tst_allow_ftruncate" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define GETSERVBYPORT_R_BUFSIZE 4096" >>confdefs.h +printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h - fi - curl_cv_func_getservbyport_r="yes" + curl_cv_func_ftruncate="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_getservbyport_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ftruncate="no" fi -curl_includes_time="\ +curl_includes_stdlib="\ /* includes start */ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_TIME_H -# include -# ifdef TIME_WITH_SYS_TIME -# include -# endif -#else -# ifdef HAVE_TIME_H -# include -# endif -#endif +#include /* includes end */" - for ac_header in sys/types.h sys/time.h time.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_time + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_stdlib " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -done - - # - tst_links_gmtime_r="unknown" - tst_proto_gmtime_r="unknown" - tst_compi_gmtime_r="unknown" - tst_works_gmtime_r="unknown" - tst_allow_gmtime_r="unknown" + # + tst_links_getaddrinfo="unknown" + tst_proto_getaddrinfo="unknown" + tst_compi_getaddrinfo="unknown" + tst_works_getaddrinfo="unknown" + tst_allow_getaddrinfo="unknown" + tst_tsafe_getaddrinfo="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r can be linked" >&5 -$as_echo_n "checking if gmtime_r can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo can be linked" >&5 +printf %s "checking if getaddrinfo can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define gmtime_r innocuous_gmtime_r -#ifdef __STDC__ -# include -#else -# include -#endif -#undef gmtime_r -#ifdef __cplusplus -extern "C" -#endif -char gmtime_r (); -#if defined __stub_gmtime_r || defined __stub___gmtime_r -choke me -#endif + $curl_includes_ws2tcpip + $curl_includes_sys_socket + $curl_includes_netdb -int main (void) +int main(void) { -return gmtime_r (); - ; - return 0; + + struct addrinfo *ai = 0; + if(0 != getaddrinfo(0, 0, 0, &ai)) + return 1; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_gmtime_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_getaddrinfo="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_gmtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_getaddrinfo="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_gmtime_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r is prototyped" >&5 -$as_echo_n "checking if gmtime_r is prototyped... " >&6; } + if test "$tst_links_getaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is prototyped" >&5 +printf %s "checking if getaddrinfo is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_time + $curl_includes_ws2tcpip + $curl_includes_sys_socket + $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gmtime_r" >/dev/null 2>&1; then : + $EGREP "getaddrinfo" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_gmtime_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_getaddrinfo="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_gmtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_getaddrinfo="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_gmtime_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r is compilable" >&5 -$as_echo_n "checking if gmtime_r is compilable... " >&6; } + if test "$tst_proto_getaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is compilable" >&5 +printf %s "checking if getaddrinfo is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_time + $curl_includes_ws2tcpip + $curl_includes_sys_socket + $curl_includes_netdb -int main (void) +int main(void) { - if(0 != gmtime_r(0, 0)) + struct addrinfo *ai = 0; + if(0 != getaddrinfo(0, 0, 0, &ai)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_gmtime_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_getaddrinfo="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_gmtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_getaddrinfo="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && - test "$tst_compi_gmtime_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r seems to work" >&5 -$as_echo_n "checking if gmtime_r seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + test "$tst_compi_getaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo seems to work" >&5 +printf %s "checking if getaddrinfo seems to work... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + $curl_includes_ws2tcpip $curl_includes_stdlib - $curl_includes_time + $curl_includes_string + $curl_includes_sys_socket + $curl_includes_netdb -int main (void) +int main(void) { - time_t local = 1170352587; - struct tm *gmt = 0; - struct tm result; - gmt = gmtime_r(&local, &result); - if(gmt) - exit(0); - else - exit(1); + struct addrinfo hints; + struct addrinfo *ai = 0; + int error; + int exitcode; + + #ifdef _WIN32 + WSADATA wsa; + if(WSAStartup(MAKEWORD(2, 2), &wsa)) + return 2; + #endif + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_NUMERICHOST; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", 0, &hints, &ai); + if(error || !ai) + exitcode = 1; /* fail */ + else { + freeaddrinfo(ai); + exitcode = 0; + } + #ifdef _WIN32 + WSACleanup(); + #endif + return exitcode; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_getaddrinfo="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_works_gmtime_r="yes" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_getaddrinfo="no" -else +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_works_gmtime_r="no" + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_ws2tcpip + $curl_includes_stdlib + $curl_includes_string + $curl_includes_sys_socket + $curl_includes_netdb + +int main(void) +{ + + struct addrinfo hints; + struct addrinfo *ai = 0; + int error; + int exitcode; + + #ifdef _WIN32 + WSADATA wsa; + if(WSAStartup(MAKEWORD(2, 2), &wsa)) + return 2; + #endif + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_NUMERICHOST; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo("127.0.0.1", 0, &hints, &ai); + if(error || !ai) + exitcode = 1; /* fail */ + else { + freeaddrinfo(ai); + exitcode = 0; + } + #ifdef _WIN32 + WSACleanup(); + #endif + return exitcode; + + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_getaddrinfo="yes" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_getaddrinfo="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi + fi # - if test "$tst_compi_gmtime_r" = "yes" && - test "$tst_works_gmtime_r" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r usage allowed" >&5 -$as_echo_n "checking if gmtime_r usage allowed... " >&6; } - if test "x$curl_disallow_gmtime_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_gmtime_r="yes" + if test "$tst_compi_getaddrinfo" = "yes" && + test "$tst_works_getaddrinfo" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo usage allowed" >&5 +printf %s "checking if getaddrinfo usage allowed... " >&6; } + if test "x$curl_disallow_getaddrinfo" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_getaddrinfo="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_gmtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_getaddrinfo="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gmtime_r might be used" >&5 -$as_echo_n "checking if gmtime_r might be used... " >&6; } - if test "$tst_links_gmtime_r" = "yes" && - test "$tst_proto_gmtime_r" = "yes" && - test "$tst_compi_gmtime_r" = "yes" && - test "$tst_allow_gmtime_r" = "yes" && - test "$tst_works_gmtime_r" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo might be used" >&5 +printf %s "checking if getaddrinfo might be used... " >&6; } + if test "$tst_proto_getaddrinfo" = "yes" && + test "$tst_compi_getaddrinfo" = "yes" && + test "$tst_allow_getaddrinfo" = "yes" && + test "$tst_works_getaddrinfo" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_GMTIME_R 1 -_ACEOF +printf "%s\n" "#define HAVE_GETADDRINFO 1" >>confdefs.h - curl_cv_func_gmtime_r="yes" + curl_cv_func_getaddrinfo="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_gmtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_getaddrinfo="no" + curl_cv_func_getaddrinfo_threadsafe="no" fi + # + if test "$curl_cv_func_getaddrinfo" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo is threadsafe" >&5 +printf %s "checking if getaddrinfo is threadsafe... " >&6; } + if test "$curl_cv_apple" = 'yes'; then + tst_tsafe_getaddrinfo="yes" + fi + case $host_os in + aix[1234].* | aix5.[01].*) + tst_tsafe_getaddrinfo="no" + ;; + aix*) + tst_tsafe_getaddrinfo="yes" + ;; + darwin[12345].*) + tst_tsafe_getaddrinfo="no" + ;; + freebsd[1234].* | freebsd5.[1234]*) + tst_tsafe_getaddrinfo="no" + ;; + freebsd*) + tst_tsafe_getaddrinfo="yes" + ;; + hpux[123456789].* | hpux10.* | hpux11.0* | hpux11.10*) + tst_tsafe_getaddrinfo="no" + ;; + hpux*) + tst_tsafe_getaddrinfo="yes" + ;; + midnightbsd*) + tst_tsafe_getaddrinfo="yes" + ;; + netbsd[123].*) + tst_tsafe_getaddrinfo="no" + ;; + netbsd*) + tst_tsafe_getaddrinfo="yes" + ;; + *bsd*) + tst_tsafe_getaddrinfo="no" + ;; + solaris2*) + tst_tsafe_getaddrinfo="yes" + ;; + esac + if test "$tst_tsafe_getaddrinfo" = "unknown" && + test "$curl_cv_native_windows" = "yes"; then + tst_tsafe_getaddrinfo="yes" + fi + if test "$tst_tsafe_getaddrinfo" = "unknown"; then + tst_tsafe_getaddrinfo="yes" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tst_tsafe_getaddrinfo" >&5 +printf "%s\n" "$tst_tsafe_getaddrinfo" >&6; } + if test "$tst_tsafe_getaddrinfo" = "yes"; then +printf "%s\n" "#define HAVE_GETADDRINFO_THREADSAFE 1" >>confdefs.h -curl_includes_arpa_inet="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif -#ifdef HAVE_WINSOCK2_H -#include -#include -#endif -/* includes end */" - for ac_header in sys/types.h sys/socket.h netinet/in.h arpa/inet.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_arpa_inet -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - + curl_cv_func_getaddrinfo_threadsafe="yes" + else + curl_cv_func_getaddrinfo_threadsafe="no" + fi + fi # - tst_links_inet_ntoa_r="unknown" - tst_proto_inet_ntoa_r="unknown" - tst_compi_inet_ntoa_r="unknown" - tst_allow_inet_ntoa_r="unknown" - tst_nargs_inet_ntoa_r="unknown" + tst_links_gethostbyname_r="unknown" + tst_proto_gethostbyname_r="unknown" + tst_compi_gethostbyname_r="unknown" + tst_allow_gethostbyname_r="unknown" + tst_nargs_gethostbyname_r="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r can be linked" >&5 -$as_echo_n "checking if inet_ntoa_r can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r can be linked" >&5 +printf %s "checking if gethostbyname_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define inet_ntoa_r innocuous_inet_ntoa_r +#define gethostbyname_r innocuous_gethostbyname_r #ifdef __STDC__ # include #else # include #endif -#undef inet_ntoa_r +#undef gethostbyname_r #ifdef __cplusplus extern "C" #endif -char inet_ntoa_r (); -#if defined __stub_inet_ntoa_r || defined __stub___inet_ntoa_r -choke me +char gethostbyname_r (); +#if defined __stub_gethostbyname_r || defined __stub___gethostbyname_r +#error force compilation error #endif -int main (void) +int main(void) { -return inet_ntoa_r (); - ; - return 0; +return gethostbyname_r (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_inet_ntoa_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_gethostbyname_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_inet_ntoa_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_gethostbyname_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_inet_ntoa_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r is prototyped" >&5 -$as_echo_n "checking if inet_ntoa_r is prototyped... " >&6; } + if test "$tst_links_gethostbyname_r" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r is prototyped" >&5 +printf %s "checking if gethostbyname_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_arpa_inet + $curl_includes_netdb _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "inet_ntoa_r" >/dev/null 2>&1; then : + $EGREP "gethostbyname_r" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_inet_ntoa_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_gethostbyname_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_inet_ntoa_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_gethostbyname_r="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_inet_ntoa_r" = "yes"; then - if test "$tst_nargs_inet_ntoa_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r takes 2 args." >&5 -$as_echo_n "checking if inet_ntoa_r takes 2 args.... " >&6; } + if test "$tst_proto_gethostbyname_r" = "yes"; then + if test "$tst_nargs_gethostbyname_r" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 3 args." >&5 +printf %s "checking if gethostbyname_r takes 3 args.... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_netdb + $curl_includes_bsdsocket + +int main(void) +{ + + if(0 != gethostbyname_r(0, 0, 0)) + return 1; + + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_gethostbyname_r="yes" + tst_nargs_gethostbyname_r="3" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_gethostbyname_r="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test "$tst_nargs_gethostbyname_r" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 5 args." >&5 +printf %s "checking if gethostbyname_r takes 5 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_arpa_inet + $curl_includes_netdb + $curl_includes_bsdsocket -int main (void) +int main(void) { - struct in_addr addr; - if(0 != inet_ntoa_r(addr, 0)) + if(0 != gethostbyname_r(0, 0, 0, 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_inet_ntoa_r="yes" - tst_nargs_inet_ntoa_r="2" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_gethostbyname_r="yes" + tst_nargs_gethostbyname_r="5" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_inet_ntoa_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_gethostbyname_r="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - if test "$tst_nargs_inet_ntoa_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r takes 3 args." >&5 -$as_echo_n "checking if inet_ntoa_r takes 3 args.... " >&6; } + if test "$tst_nargs_gethostbyname_r" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r takes 6 args." >&5 +printf %s "checking if gethostbyname_r takes 6 args.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_arpa_inet + $curl_includes_netdb + $curl_includes_bsdsocket -int main (void) +int main(void) { - struct in_addr addr; - if(0 != inet_ntoa_r(addr, 0, 0)) + if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_inet_ntoa_r="yes" - tst_nargs_inet_ntoa_r="3" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_gethostbyname_r="yes" + tst_nargs_gethostbyname_r="6" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_inet_ntoa_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_gethostbyname_r="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r is compilable" >&5 -$as_echo_n "checking if inet_ntoa_r is compilable... " >&6; } - if test "$tst_compi_inet_ntoa_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r is compilable" >&5 +printf %s "checking if gethostbyname_r is compilable... " >&6; } + if test "$tst_compi_gethostbyname_r" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi # - if test "$tst_compi_inet_ntoa_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r usage allowed" >&5 -$as_echo_n "checking if inet_ntoa_r usage allowed... " >&6; } - if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_inet_ntoa_r="yes" + if test "$tst_compi_gethostbyname_r" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r usage allowed" >&5 +printf %s "checking if gethostbyname_r usage allowed... " >&6; } + if test "x$curl_disallow_gethostbyname_r" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_gethostbyname_r="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_inet_ntoa_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_gethostbyname_r="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntoa_r might be used" >&5 -$as_echo_n "checking if inet_ntoa_r might be used... " >&6; } - if test "$tst_links_inet_ntoa_r" = "yes" && - test "$tst_proto_inet_ntoa_r" = "yes" && - test "$tst_compi_inet_ntoa_r" = "yes" && - test "$tst_allow_inet_ntoa_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostbyname_r might be used" >&5 +printf %s "checking if gethostbyname_r might be used... " >&6; } + if test "$tst_links_gethostbyname_r" = "yes" && + test "$tst_proto_gethostbyname_r" = "yes" && + test "$tst_compi_gethostbyname_r" = "yes" && + test "$tst_allow_gethostbyname_r" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_INET_NTOA_R 1 -_ACEOF +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h # - if test "$tst_nargs_inet_ntoa_r" -eq "2"; then + if test "$tst_nargs_gethostbyname_r" -eq "3"; then + +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h + + elif test "$tst_nargs_gethostbyname_r" -eq "5"; then -$as_echo "#define HAVE_INET_NTOA_R_2 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h - elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then + elif test "$tst_nargs_gethostbyname_r" -eq "6"; then -$as_echo "#define HAVE_INET_NTOA_R_3 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h fi # - curl_cv_func_inet_ntoa_r="yes" + curl_cv_func_gethostbyname_r="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_inet_ntoa_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_gethostbyname_r="no" fi - # - tst_links_inet_ntop="unknown" - tst_proto_inet_ntop="unknown" - tst_compi_inet_ntop="unknown" - tst_works_inet_ntop="unknown" - tst_allow_inet_ntop="unknown" +curl_preprocess_callconv="\ +/* preprocess start */ +#ifdef _WIN32 +# define FUNCALLCONV __stdcall +#else +# define FUNCALLCONV +#endif +/* preprocess end */" + + + # + tst_links_gethostname="unknown" + tst_proto_gethostname="unknown" + tst_compi_gethostname="unknown" + tst_allow_gethostname="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop can be linked" >&5 -$as_echo_n "checking if inet_ntop can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostname can be linked" >&5 +printf %s "checking if gethostname can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define inet_ntop innocuous_inet_ntop -#ifdef __STDC__ -# include -#else -# include -#endif -#undef inet_ntop -#ifdef __cplusplus -extern "C" -#endif -char inet_ntop (); -#if defined __stub_inet_ntop || defined __stub___inet_ntop -choke me -#endif + $curl_includes_winsock2 + $curl_includes_unistd + $curl_includes_bsdsocket -int main (void) +int main(void) { -return inet_ntop (); - ; - return 0; + + char s[1]; + if(0 != gethostname((void *)s, 0)) + return 1; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_inet_ntop="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_gethostname="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_inet_ntop="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_gethostname="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_inet_ntop" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop is prototyped" >&5 -$as_echo_n "checking if inet_ntop is prototyped... " >&6; } + if test "$tst_links_gethostname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostname is prototyped" >&5 +printf %s "checking if gethostname is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_arpa_inet + $curl_includes_winsock2 + $curl_includes_unistd + $curl_includes_bsdsocket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "inet_ntop" >/dev/null 2>&1; then : + $EGREP "gethostname" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_inet_ntop="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_gethostname="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_inet_ntop="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_gethostname="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_inet_ntop" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop is compilable" >&5 -$as_echo_n "checking if inet_ntop is compilable... " >&6; } + if test "$tst_proto_gethostname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostname is compilable" >&5 +printf %s "checking if gethostname is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_arpa_inet + $curl_includes_winsock2 + $curl_includes_unistd + $curl_includes_bsdsocket -int main (void) +int main(void) { - if(0 != inet_ntop(0, 0, 0, 0)) + char s[1]; + if(0 != gethostname((void *)s, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_inet_ntop="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_gethostname="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_inet_ntop="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_gethostname="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "x$cross_compiling" != "xyes" && - test "$tst_compi_inet_ntop" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop seems to work" >&5 -$as_echo_n "checking if inet_ntop seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$tst_compi_gethostname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostname arg 2 data type" >&5 +printf %s "checking for gethostname arg 2 data type... " >&6; } + tst_gethostname_type_arg2="unknown" + for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do + for tst_arg2 in 'int' 'unsigned int' 'size_t'; do + if test "$tst_gethostname_type_arg2" = "unknown"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stdlib - $curl_includes_arpa_inet - $curl_includes_string + $curl_includes_winsock2 + $curl_includes_unistd + $curl_includes_bsdsocket + $curl_preprocess_callconv + #if defined(_WIN32) && defined(WINSOCK_API_LINKAGE) + WINSOCK_API_LINKAGE + #else + extern + #endif + int FUNCALLCONV gethostname($tst_arg1, $tst_arg2); -int main (void) +int main(void) { - char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; - char ipv4res[sizeof "255.255.255.255"]; - unsigned char ipv6a[26]; - unsigned char ipv4a[5]; - char *ipv6ptr = 0; - char *ipv4ptr = 0; - /* - */ - ipv4res[0] = '\0'; - ipv4a[0] = 0xc0; - ipv4a[1] = 0xa8; - ipv4a[2] = 0x64; - ipv4a[3] = 0x01; - ipv4a[4] = 0x01; - /* - */ - ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res)); - if(!ipv4ptr) - exit(1); /* fail */ - if(ipv4ptr != ipv4res) - exit(1); /* fail */ - if(!ipv4ptr[0]) - exit(1); /* fail */ - if(memcmp(ipv4res, "192.168.100.1", 13) != 0) - exit(1); /* fail */ - /* - */ - ipv6res[0] = '\0'; - memset(ipv6a, 0, sizeof(ipv6a)); - ipv6a[0] = 0xfe; - ipv6a[1] = 0x80; - ipv6a[8] = 0x02; - ipv6a[9] = 0x14; - ipv6a[10] = 0x4f; - ipv6a[11] = 0xff; - ipv6a[12] = 0xfe; - ipv6a[13] = 0x0b; - ipv6a[14] = 0x76; - ipv6a[15] = 0xc8; - ipv6a[25] = 0x01; - /* - */ - ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res)); - if(!ipv6ptr) - exit(1); /* fail */ - if(ipv6ptr != ipv6res) - exit(1); /* fail */ - if(!ipv6ptr[0]) - exit(1); /* fail */ - if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0) - exit(1); /* fail */ - /* - */ - exit(0); + char s[1]; + if(0 != gethostname(($tst_arg1)s, 0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_works_inet_ntop="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_works_inet_ntop="no" + tst_gethostname_type_arg2="$tst_arg2" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + done + done + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tst_gethostname_type_arg2" >&5 +printf "%s\n" "$tst_gethostname_type_arg2" >&6; } + if test "$tst_gethostname_type_arg2" != "unknown"; then + +printf "%s\n" "#define GETHOSTNAME_TYPE_ARG2 $tst_gethostname_type_arg2" >>confdefs.h + fi fi # - if test "$tst_compi_inet_ntop" = "yes" && - test "$tst_works_inet_ntop" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop usage allowed" >&5 -$as_echo_n "checking if inet_ntop usage allowed... " >&6; } - if test "x$curl_disallow_inet_ntop" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_inet_ntop="yes" + if test "$tst_compi_gethostname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostname usage allowed" >&5 +printf %s "checking if gethostname usage allowed... " >&6; } + if test "x$curl_disallow_gethostname" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_gethostname="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_inet_ntop="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_gethostname="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop might be used" >&5 -$as_echo_n "checking if inet_ntop might be used... " >&6; } - if test "$tst_links_inet_ntop" = "yes" && - test "$tst_proto_inet_ntop" = "yes" && - test "$tst_compi_inet_ntop" = "yes" && - test "$tst_allow_inet_ntop" = "yes" && - test "$tst_works_inet_ntop" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gethostname might be used" >&5 +printf %s "checking if gethostname might be used... " >&6; } + if test "$tst_links_gethostname" = "yes" && + test "$tst_proto_gethostname" = "yes" && + test "$tst_compi_gethostname" = "yes" && + test "$tst_allow_gethostname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_INET_NTOP 1 -_ACEOF +printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h - curl_cv_func_inet_ntop="yes" + curl_cv_func_gethostname="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_inet_ntop="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_gethostname="no" fi - # - tst_links_inet_pton="unknown" - tst_proto_inet_pton="unknown" - tst_compi_inet_pton="unknown" - tst_works_inet_pton="unknown" - tst_allow_inet_pton="unknown" +curl_includes_ifaddrs="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifndef _WIN32 +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_IFADDRS_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_ifaddrs +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$curl_includes_ifaddrs +" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$curl_includes_ifaddrs +" +if test "x$ac_cv_header_ifaddrs_h" = xyes +then : + printf "%s\n" "#define HAVE_IFADDRS_H 1" >>confdefs.h + +fi + + + + # + tst_links_getifaddrs="unknown" + tst_proto_getifaddrs="unknown" + tst_compi_getifaddrs="unknown" + tst_works_getifaddrs="unknown" + tst_allow_getifaddrs="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton can be linked" >&5 -$as_echo_n "checking if inet_pton can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getifaddrs can be linked" >&5 +printf %s "checking if getifaddrs can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define inet_pton innocuous_inet_pton +#define getifaddrs innocuous_getifaddrs #ifdef __STDC__ # include #else # include #endif -#undef inet_pton +#undef getifaddrs #ifdef __cplusplus extern "C" #endif -char inet_pton (); -#if defined __stub_inet_pton || defined __stub___inet_pton -choke me +char getifaddrs (); +#if defined __stub_getifaddrs || defined __stub___getifaddrs +#error force compilation error #endif -int main (void) +int main(void) { -return inet_pton (); - ; - return 0; +return getifaddrs (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_inet_pton="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_getifaddrs="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_inet_pton="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_getifaddrs="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_inet_pton" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton is prototyped" >&5 -$as_echo_n "checking if inet_pton is prototyped... " >&6; } + if test "$tst_links_getifaddrs" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getifaddrs is prototyped" >&5 +printf %s "checking if getifaddrs is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_arpa_inet + $curl_includes_ifaddrs _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "inet_pton" >/dev/null 2>&1; then : + $EGREP "getifaddrs" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_inet_pton="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_getifaddrs="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_inet_pton="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_getifaddrs="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_inet_pton" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton is compilable" >&5 -$as_echo_n "checking if inet_pton is compilable... " >&6; } + if test "$tst_proto_getifaddrs" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getifaddrs is compilable" >&5 +printf %s "checking if getifaddrs is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_arpa_inet + $curl_includes_ifaddrs -int main (void) +int main(void) { - if(0 != inet_pton(0, 0, 0)) + if(0 != getifaddrs(0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_inet_pton="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_getifaddrs="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_inet_pton="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_getifaddrs="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "x$cross_compiling" != "xyes" && - test "$tst_compi_inet_pton" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton seems to work" >&5 -$as_echo_n "checking if inet_pton seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + test "$tst_compi_getifaddrs" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getifaddrs seems to work" >&5 +printf %s "checking if getifaddrs seems to work... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib - $curl_includes_arpa_inet - $curl_includes_string + $curl_includes_ifaddrs -int main (void) +int main(void) { - unsigned char ipv6a[16+1]; - unsigned char ipv4a[4+1]; - const char *ipv6src = "fe80::214:4fff:fe0b:76c8"; - const char *ipv4src = "192.168.100.1"; - /* - */ - memset(ipv4a, 1, sizeof(ipv4a)); - if(1 != inet_pton(AF_INET, ipv4src, ipv4a)) - exit(1); /* fail */ - /* - */ - if( (ipv4a[0] != 0xc0) || - (ipv4a[1] != 0xa8) || - (ipv4a[2] != 0x64) || - (ipv4a[3] != 0x01) || - (ipv4a[4] != 0x01) ) - exit(1); /* fail */ - /* - */ - memset(ipv6a, 1, sizeof(ipv6a)); - if(1 != inet_pton(AF_INET6, ipv6src, ipv6a)) - exit(1); /* fail */ - /* - */ - if( (ipv6a[0] != 0xfe) || - (ipv6a[1] != 0x80) || - (ipv6a[8] != 0x02) || - (ipv6a[9] != 0x14) || - (ipv6a[10] != 0x4f) || - (ipv6a[11] != 0xff) || - (ipv6a[12] != 0xfe) || - (ipv6a[13] != 0x0b) || - (ipv6a[14] != 0x76) || - (ipv6a[15] != 0xc8) || - (ipv6a[16] != 0x01) ) - exit(1); /* fail */ - /* - */ - if( (ipv6a[2] != 0x0) || - (ipv6a[3] != 0x0) || - (ipv6a[4] != 0x0) || - (ipv6a[5] != 0x0) || - (ipv6a[6] != 0x0) || - (ipv6a[7] != 0x0) ) - exit(1); /* fail */ - /* - */ - exit(0); + struct ifaddrs *ifa = 0; + int error; + + error = getifaddrs(&ifa); + if(error || !ifa) + return 1; /* fail */ + else { + freeifaddrs(ifa); + return 0; + } - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_getifaddrs="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_works_inet_pton="yes" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_getifaddrs="no" -else +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_works_inet_pton="no" + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_stdlib + $curl_includes_ifaddrs + +int main(void) +{ + + struct ifaddrs *ifa = 0; + int error; + + error = getifaddrs(&ifa); + if(error || !ifa) + return 1; /* fail */ + else { + freeifaddrs(ifa); + return 0; + } + + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_getifaddrs="yes" + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_getifaddrs="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi + fi # - if test "$tst_compi_inet_pton" = "yes" && - test "$tst_works_inet_pton" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton usage allowed" >&5 -$as_echo_n "checking if inet_pton usage allowed... " >&6; } - if test "x$curl_disallow_inet_pton" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_inet_pton="yes" + if test "$tst_compi_getifaddrs" = "yes" && + test "$tst_works_getifaddrs" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getifaddrs usage allowed" >&5 +printf %s "checking if getifaddrs usage allowed... " >&6; } + if test "x$curl_disallow_getifaddrs" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_getifaddrs="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_inet_pton="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_getifaddrs="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton might be used" >&5 -$as_echo_n "checking if inet_pton might be used... " >&6; } - if test "$tst_links_inet_pton" = "yes" && - test "$tst_proto_inet_pton" = "yes" && - test "$tst_compi_inet_pton" = "yes" && - test "$tst_allow_inet_pton" = "yes" && - test "$tst_works_inet_pton" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getifaddrs might be used" >&5 +printf %s "checking if getifaddrs might be used... " >&6; } + if test "$tst_links_getifaddrs" = "yes" && + test "$tst_proto_getifaddrs" = "yes" && + test "$tst_compi_getifaddrs" = "yes" && + test "$tst_allow_getifaddrs" = "yes" && + test "$tst_works_getifaddrs" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_INET_PTON 1 -_ACEOF +printf "%s\n" "#define HAVE_GETIFADDRS 1" >>confdefs.h - curl_cv_func_inet_pton="yes" + curl_cv_func_getifaddrs="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_inet_pton="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_getifaddrs="no" fi -curl_includes_stropts="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_SYS_IOCTL_H -# include -#endif -#ifdef HAVE_STROPTS_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_stropts -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - # - tst_links_ioctl="unknown" - tst_proto_ioctl="unknown" - tst_compi_ioctl="unknown" - tst_allow_ioctl="unknown" + # + tst_links_getpeername="unknown" + tst_proto_getpeername="unknown" + tst_compi_getpeername="unknown" + tst_allow_getpeername="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl can be linked" >&5 -$as_echo_n "checking if ioctl can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getpeername can be linked" >&5 +printf %s "checking if getpeername can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define ioctl innocuous_ioctl -#ifdef __STDC__ -# include -#else -# include -#endif -#undef ioctl -#ifdef __cplusplus -extern "C" -#endif -char ioctl (); -#if defined __stub_ioctl || defined __stub___ioctl -choke me -#endif + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket -int main (void) +int main(void) { -return ioctl (); - ; - return 0; + + if(0 != getpeername(0, (void *)0, (void *)0)) + return 1; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_ioctl="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_getpeername="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_ioctl="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_getpeername="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_ioctl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl is prototyped" >&5 -$as_echo_n "checking if ioctl is prototyped... " >&6; } + if test "$tst_links_getpeername" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getpeername is prototyped" >&5 +printf %s "checking if getpeername is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stropts + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "ioctl" >/dev/null 2>&1; then : + $EGREP "getpeername" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_ioctl="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_getpeername="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_ioctl="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_getpeername="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_ioctl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl is compilable" >&5 -$as_echo_n "checking if ioctl is compilable... " >&6; } + if test "$tst_proto_getpeername" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getpeername is compilable" >&5 +printf %s "checking if getpeername is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stropts + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket -int main (void) +int main(void) { - if(0 != ioctl(0, 0, 0)) + if(0 != getpeername(0, (void *)0, (void *)0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ioctl="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_getpeername="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ioctl="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_getpeername="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_ioctl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl usage allowed" >&5 -$as_echo_n "checking if ioctl usage allowed... " >&6; } - if test "x$curl_disallow_ioctl" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ioctl="yes" + if test "$tst_compi_getpeername" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getpeername usage allowed" >&5 +printf %s "checking if getpeername usage allowed... " >&6; } + if test "x$curl_disallow_getpeername" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_getpeername="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ioctl="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_getpeername="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl might be used" >&5 -$as_echo_n "checking if ioctl might be used... " >&6; } - if test "$tst_links_ioctl" = "yes" && - test "$tst_proto_ioctl" = "yes" && - test "$tst_compi_ioctl" = "yes" && - test "$tst_allow_ioctl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getpeername might be used" >&5 +printf %s "checking if getpeername might be used... " >&6; } + if test "$tst_links_getpeername" = "yes" && + test "$tst_proto_getpeername" = "yes" && + test "$tst_compi_getpeername" = "yes" && + test "$tst_allow_getpeername" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTL 1 -_ACEOF +printf "%s\n" "#define HAVE_GETPEERNAME 1" >>confdefs.h - curl_cv_func_ioctl="yes" + curl_cv_func_getpeername="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_getpeername="no" + fi + + # + tst_links_getsockname="unknown" + tst_proto_getsockname="unknown" + tst_compi_getsockname="unknown" + tst_allow_getsockname="unknown" # - tst_compi_ioctl_fionbio="unknown" - tst_allow_ioctl_fionbio="unknown" - # - if test "$curl_cv_func_ioctl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO is compilable" >&5 -$as_echo_n "checking if ioctl FIONBIO is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getsockname can be linked" >&5 +printf %s "checking if getsockname can be linked... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stropts + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket -int main (void) +int main(void) { - int flags = 0; - if(0 != ioctl(0, FIONBIO, &flags)) - return 1; + if(0 != getsockname(0, (void *)0, (void *)0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ioctl_fionbio="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ioctl_fionbio="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_ioctl_fionbio" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO usage allowed" >&5 -$as_echo_n "checking if ioctl FIONBIO usage allowed... " >&6; } - if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ioctl_fionbio="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ioctl_fionbio="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO might be used" >&5 -$as_echo_n "checking if ioctl FIONBIO might be used... " >&6; } - if test "$tst_compi_ioctl_fionbio" = "yes" && - test "$tst_allow_ioctl_fionbio" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTL_FIONBIO 1 -_ACEOF +if ac_fn_c_try_link "$LINENO" +then : - curl_cv_func_ioctl_fionbio="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ioctl_fionbio="no" - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_getsockname="yes" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_getsockname="no" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext # - tst_compi_ioctl_siocgifaddr="unknown" - tst_allow_ioctl_siocgifaddr="unknown" + if test "$tst_links_getsockname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getsockname is prototyped" >&5 +printf %s "checking if getsockname is prototyped... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "getsockname" >/dev/null 2>&1 +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_getsockname="yes" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_getsockname="no" + +fi +rm -rf conftest* + + fi # - if test "$curl_cv_func_ioctl" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR is compilable" >&5 -$as_echo_n "checking if ioctl SIOCGIFADDR is compilable... " >&6; } + if test "$tst_proto_getsockname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getsockname is compilable" >&5 +printf %s "checking if getsockname is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stropts - #include + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket -int main (void) +int main(void) { - struct ifreq ifr; - if(0 != ioctl(0, SIOCGIFADDR, &ifr)) + if(0 != getsockname(0, (void *)0, (void *)0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ioctl_siocgifaddr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_getsockname="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ioctl_siocgifaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_getsockname="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR usage allowed" >&5 -$as_echo_n "checking if ioctl SIOCGIFADDR usage allowed... " >&6; } - if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ioctl_siocgifaddr="yes" + if test "$tst_compi_getsockname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getsockname usage allowed" >&5 +printf %s "checking if getsockname usage allowed... " >&6; } + if test "x$curl_disallow_getsockname" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_getsockname="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ioctl_siocgifaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_getsockname="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR might be used" >&5 -$as_echo_n "checking if ioctl SIOCGIFADDR might be used... " >&6; } - if test "$tst_compi_ioctl_siocgifaddr" = "yes" && - test "$tst_allow_ioctl_siocgifaddr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getsockname might be used" >&5 +printf %s "checking if getsockname might be used... " >&6; } + if test "$tst_links_getsockname" = "yes" && + test "$tst_proto_getsockname" = "yes" && + test "$tst_compi_getsockname" = "yes" && + test "$tst_allow_getsockname" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTL_SIOCGIFADDR 1 -_ACEOF +printf "%s\n" "#define HAVE_GETSOCKNAME 1" >>confdefs.h - curl_cv_func_ioctl_siocgifaddr="yes" + curl_cv_func_getsockname="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ioctl_siocgifaddr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_getsockname="no" fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ioctl="no" - fi +curl_includes_time="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +# include +#endif +#include +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_time +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h - # - tst_links_ioctlsocket="unknown" - tst_proto_ioctlsocket="unknown" - tst_compi_ioctlsocket="unknown" - tst_allow_ioctlsocket="unknown" +fi + + + + # + tst_links_gmtime_r="unknown" + tst_proto_gmtime_r="unknown" + tst_compi_gmtime_r="unknown" + tst_works_gmtime_r="unknown" + tst_allow_gmtime_r="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket can be linked" >&5 -$as_echo_n "checking if ioctlsocket can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gmtime_r can be linked" >&5 +printf %s "checking if gmtime_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 +#define gmtime_r innocuous_gmtime_r +#ifdef __STDC__ +# include +#else +# include +#endif +#undef gmtime_r +#ifdef __cplusplus +extern "C" +#endif +char gmtime_r (); +#if defined __stub_gmtime_r || defined __stub___gmtime_r +#error force compilation error +#endif -int main (void) +int main(void) { - - if(0 != ioctlsocket(0, 0, 0)) - return 1; - - ; - return 0; +return gmtime_r (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_ioctlsocket="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_gmtime_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_ioctlsocket="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_gmtime_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_ioctlsocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket is prototyped" >&5 -$as_echo_n "checking if ioctlsocket is prototyped... " >&6; } + if test "$tst_links_gmtime_r" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gmtime_r is prototyped" >&5 +printf %s "checking if gmtime_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 + $curl_includes_time _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "ioctlsocket" >/dev/null 2>&1; then : + $EGREP "gmtime_r" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_ioctlsocket="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_gmtime_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_ioctlsocket="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_gmtime_r="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_ioctlsocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket is compilable" >&5 -$as_echo_n "checking if ioctlsocket is compilable... " >&6; } + if test "$tst_proto_gmtime_r" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gmtime_r is compilable" >&5 +printf %s "checking if gmtime_r is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 + $curl_includes_time -int main (void) +int main(void) { - if(0 != ioctlsocket(0, 0, 0)) + time_t tm = 1170352587; + struct tm result; + if(0 != gmtime_r(&tm, &result)) return 1; + (void)result; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ioctlsocket="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_gmtime_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ioctlsocket="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_gmtime_r="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_ioctlsocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket usage allowed" >&5 -$as_echo_n "checking if ioctlsocket usage allowed... " >&6; } - if test "x$curl_disallow_ioctlsocket" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ioctlsocket="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ioctlsocket="no" - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket might be used" >&5 -$as_echo_n "checking if ioctlsocket might be used... " >&6; } - if test "$tst_links_ioctlsocket" = "yes" && - test "$tst_proto_ioctlsocket" = "yes" && - test "$tst_compi_ioctlsocket" = "yes" && - test "$tst_allow_ioctlsocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "x$cross_compiling" != "xyes" && + test "$tst_compi_gmtime_r" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gmtime_r seems to work" >&5 +printf %s "checking if gmtime_r seems to work... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_stdlib + $curl_includes_time + +int main(void) +{ + + time_t local = 1170352587; + struct tm *gmt = 0; + struct tm result; + gmt = gmtime_r(&local, &result); + (void)result; + if(gmt) + return 0; + else + return 1; + + return 0; +} -cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTLSOCKET 1 _ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_gmtime_r="yes" - curl_cv_func_ioctlsocket="yes" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_gmtime_r="no" - # - tst_compi_ioctlsocket_fionbio="unknown" - tst_allow_ioctlsocket_fionbio="unknown" - # - if test "$curl_cv_func_ioctlsocket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO is compilable" >&5 -$as_echo_n "checking if ioctlsocket FIONBIO is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 + $curl_includes_stdlib + $curl_includes_time -int main (void) +int main(void) { - int flags = 0; - if(0 != ioctlsocket(0, FIONBIO, &flags)) + time_t local = 1170352587; + struct tm *gmt = 0; + struct tm result; + gmt = gmtime_r(&local, &result); + (void)result; + if(gmt) + return 0; + else return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_gmtime_r="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ioctlsocket_fionbio="yes" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_gmtime_r="no" -else +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ioctlsocket_fionbio="no" + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # - if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO usage allowed" >&5 -$as_echo_n "checking if ioctlsocket FIONBIO usage allowed... " >&6; } - if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ioctlsocket_fionbio="yes" + if test "$tst_compi_gmtime_r" = "yes" && + test "$tst_works_gmtime_r" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gmtime_r usage allowed" >&5 +printf %s "checking if gmtime_r usage allowed... " >&6; } + if test "x$curl_disallow_gmtime_r" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_gmtime_r="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ioctlsocket_fionbio="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_gmtime_r="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO might be used" >&5 -$as_echo_n "checking if ioctlsocket FIONBIO might be used... " >&6; } - if test "$tst_compi_ioctlsocket_fionbio" = "yes" && - test "$tst_allow_ioctlsocket_fionbio" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gmtime_r might be used" >&5 +printf %s "checking if gmtime_r might be used... " >&6; } + if test "$tst_links_gmtime_r" = "yes" && + test "$tst_proto_gmtime_r" = "yes" && + test "$tst_compi_gmtime_r" = "yes" && + test "$tst_allow_gmtime_r" = "yes" && + test "$tst_works_gmtime_r" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTLSOCKET_FIONBIO 1 -_ACEOF +printf "%s\n" "#define HAVE_GMTIME_R 1" >>confdefs.h - curl_cv_func_ioctlsocket_fionbio="yes" + curl_cv_func_gmtime_r="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ioctlsocket_fionbio="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_gmtime_r="no" fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ioctlsocket="no" - fi +curl_includes_stropts="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#ifndef _WIN32 +# include +#endif +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#ifdef HAVE_STROPTS_H +# include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_stropts +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$curl_includes_stropts +" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h - # - tst_links_ioctlsocket_camel="unknown" - tst_proto_ioctlsocket_camel="unknown" - tst_compi_ioctlsocket_camel="unknown" - tst_allow_ioctlsocket_camel="unknown" +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$curl_includes_stropts +" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$curl_includes_stropts +" +if test "x$ac_cv_header_stropts_h" = xyes +then : + printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h + +fi + + + + # + tst_links_ioctl="unknown" + tst_proto_ioctl="unknown" + tst_compi_ioctl="unknown" + tst_allow_ioctl="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket can be linked" >&5 -$as_echo_n "checking if IoctlSocket can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl can be linked" >&5 +printf %s "checking if ioctl can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define IoctlSocket innocuous_IoctlSocket +#define ioctl innocuous_ioctl #ifdef __STDC__ # include #else # include #endif -#undef IoctlSocket +#undef ioctl #ifdef __cplusplus extern "C" #endif -char IoctlSocket (); -#if defined __stub_IoctlSocket || defined __stub___IoctlSocket -choke me +char ioctl (); +#if defined __stub_ioctl || defined __stub___ioctl +#error force compilation error #endif -int main (void) +int main(void) { -return IoctlSocket (); - ; - return 0; +return ioctl (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_ioctlsocket_camel="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_ioctl="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_ioctlsocket_camel="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_ioctl="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_ioctlsocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket is prototyped" >&5 -$as_echo_n "checking if IoctlSocket is prototyped... " >&6; } + if test "$tst_links_ioctl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl is prototyped" >&5 +printf %s "checking if ioctl is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -35340,993 +39392,809 @@ $as_echo_n "checking if IoctlSocket is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "IoctlSocket" >/dev/null 2>&1; then : + $EGREP "ioctl" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_ioctlsocket_camel="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_ioctl="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_ioctlsocket_camel="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_ioctl="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_ioctlsocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket is compilable" >&5 -$as_echo_n "checking if IoctlSocket is compilable... " >&6; } + if test "$tst_proto_ioctl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl is compilable" >&5 +printf %s "checking if ioctl is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts -int main (void) +int main(void) { - if(0 != IoctlSocket(0, 0, 0)) + if(0 != ioctl(0, 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ioctlsocket_camel="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ioctl="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ioctlsocket_camel="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ioctl="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_ioctlsocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket usage allowed" >&5 -$as_echo_n "checking if IoctlSocket usage allowed... " >&6; } - if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ioctlsocket_camel="yes" + if test "$tst_compi_ioctl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl usage allowed" >&5 +printf %s "checking if ioctl usage allowed... " >&6; } + if test "x$curl_disallow_ioctl" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ioctl="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ioctlsocket_camel="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ioctl="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket might be used" >&5 -$as_echo_n "checking if IoctlSocket might be used... " >&6; } - if test "$tst_links_ioctlsocket_camel" = "yes" && - test "$tst_proto_ioctlsocket_camel" = "yes" && - test "$tst_compi_ioctlsocket_camel" = "yes" && - test "$tst_allow_ioctlsocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTLSOCKET_CAMEL 1 -_ACEOF - - curl_cv_func_ioctlsocket_camel="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl might be used" >&5 +printf %s "checking if ioctl might be used... " >&6; } + if test "$tst_links_ioctl" = "yes" && + test "$tst_proto_ioctl" = "yes" && + test "$tst_compi_ioctl" = "yes" && + test "$tst_allow_ioctl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + curl_cv_func_ioctl="yes" # - tst_compi_ioctlsocket_camel_fionbio="unknown" - tst_allow_ioctlsocket_camel_fionbio="unknown" + tst_compi_ioctl_fionbio="unknown" + tst_allow_ioctl_fionbio="unknown" # - if test "$curl_cv_func_ioctlsocket_camel" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO is compilable" >&5 -$as_echo_n "checking if IoctlSocket FIONBIO is compilable... " >&6; } + if test "$curl_cv_func_ioctl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO is compilable" >&5 +printf %s "checking if ioctl FIONBIO is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stropts -int main (void) +int main(void) { - long flags = 0; - if(0 != ioctlsocket(0, FIONBIO, &flags)) + int flags = 0; + if(0 != ioctl(0, FIONBIO, &flags)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_ioctlsocket_camel_fionbio="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ioctl_fionbio="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_ioctlsocket_camel_fionbio="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ioctl_fionbio="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO usage allowed" >&5 -$as_echo_n "checking if IoctlSocket FIONBIO usage allowed... " >&6; } - if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_ioctlsocket_camel_fionbio="yes" + if test "$tst_compi_ioctl_fionbio" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO usage allowed" >&5 +printf %s "checking if ioctl FIONBIO usage allowed... " >&6; } + if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ioctl_fionbio="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_ioctlsocket_camel_fionbio="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ioctl_fionbio="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO might be used" >&5 -$as_echo_n "checking if IoctlSocket FIONBIO might be used... " >&6; } - if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" && - test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTLSOCKET_CAMEL_FIONBIO 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl FIONBIO might be used" >&5 +printf %s "checking if ioctl FIONBIO might be used... " >&6; } + if test "$tst_compi_ioctl_fionbio" = "yes" && + test "$tst_allow_ioctl_fionbio" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - curl_cv_func_ioctlsocket_camel_fionbio="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ioctlsocket_camel_fionbio="no" - fi +printf "%s\n" "#define HAVE_IOCTL_FIONBIO 1" >>confdefs.h + curl_cv_func_ioctl_fionbio="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_ioctlsocket_camel="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ioctl_fionbio="no" fi - # - tst_links_localtime_r="unknown" - tst_proto_localtime_r="unknown" - tst_compi_localtime_r="unknown" - tst_works_localtime_r="unknown" - tst_allow_localtime_r="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r can be linked" >&5 -$as_echo_n "checking if localtime_r can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define localtime_r innocuous_localtime_r -#ifdef __STDC__ -# include -#else -# include -#endif -#undef localtime_r -#ifdef __cplusplus -extern "C" -#endif -char localtime_r (); -#if defined __stub_localtime_r || defined __stub___localtime_r -choke me -#endif - -int main (void) -{ -return localtime_r (); - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_localtime_r="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_localtime_r="no" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_localtime_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r is prototyped" >&5 -$as_echo_n "checking if localtime_r is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_time - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "localtime_r" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_localtime_r="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_localtime_r="no" - -fi -rm -f conftest* - - fi + tst_compi_ioctl_siocgifaddr="unknown" + tst_allow_ioctl_siocgifaddr="unknown" # - if test "$tst_proto_localtime_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r is compilable" >&5 -$as_echo_n "checking if localtime_r is compilable... " >&6; } + if test "$curl_cv_func_ioctl" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR is compilable" >&5 +printf %s "checking if ioctl SIOCGIFADDR is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_time + $curl_includes_stropts + #include -int main (void) +int main(void) { - if(0 != localtime_r(0, 0)) + struct ifreq ifr; + if(0 != ioctl(0, SIOCGIFADDR, &ifr)) return 1; - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_localtime_r="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_localtime_r="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "x$cross_compiling" != "xyes" && - test "$tst_compi_localtime_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r seems to work" >&5 -$as_echo_n "checking if localtime_r seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_stdlib - $curl_includes_time - -int main (void) -{ - - time_t clock = 1170352587; - struct tm *tmp = 0; - struct tm result; - tmp = localtime_r(&clock, &result); - if(tmp) - exit(0); - else - exit(1); - - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_works_localtime_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ioctl_siocgifaddr="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_works_localtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ioctl_siocgifaddr="no" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_localtime_r" = "yes" && - test "$tst_works_localtime_r" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r usage allowed" >&5 -$as_echo_n "checking if localtime_r usage allowed... " >&6; } - if test "x$curl_disallow_localtime_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_localtime_r="yes" + if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR usage allowed" >&5 +printf %s "checking if ioctl SIOCGIFADDR usage allowed... " >&6; } + if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ioctl_siocgifaddr="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_localtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ioctl_siocgifaddr="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if localtime_r might be used" >&5 -$as_echo_n "checking if localtime_r might be used... " >&6; } - if test "$tst_links_localtime_r" = "yes" && - test "$tst_proto_localtime_r" = "yes" && - test "$tst_compi_localtime_r" = "yes" && - test "$tst_allow_localtime_r" = "yes" && - test "$tst_works_localtime_r" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctl SIOCGIFADDR might be used" >&5 +printf %s "checking if ioctl SIOCGIFADDR might be used... " >&6; } + if test "$tst_compi_ioctl_siocgifaddr" = "yes" && + test "$tst_allow_ioctl_siocgifaddr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_LOCALTIME_R 1 -_ACEOF +printf "%s\n" "#define HAVE_IOCTL_SIOCGIFADDR 1" >>confdefs.h + + curl_cv_func_ioctl_siocgifaddr="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ioctl_siocgifaddr="no" + fi - curl_cv_func_localtime_r="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_localtime_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ioctl="no" fi # - tst_links_memrchr="unknown" - tst_macro_memrchr="unknown" - tst_proto_memrchr="unknown" - tst_compi_memrchr="unknown" - tst_allow_memrchr="unknown" + tst_links_ioctlsocket="unknown" + tst_proto_ioctlsocket="unknown" + tst_compi_ioctlsocket="unknown" + tst_allow_ioctlsocket="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr can be linked" >&5 -$as_echo_n "checking if memrchr can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket can be linked" >&5 +printf %s "checking if ioctlsocket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define memrchr innocuous_memrchr -#ifdef __STDC__ -# include -#else -# include -#endif -#undef memrchr -#ifdef __cplusplus -extern "C" -#endif -char memrchr (); -#if defined __stub_memrchr || defined __stub___memrchr -choke me -#endif - -int main (void) -{ -return memrchr (); - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_memrchr="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_memrchr="no" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_memrchr" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr seems a macro" >&5 -$as_echo_n "checking if memrchr seems a macro... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_string + $curl_includes_winsock2 -int main (void) +int main(void) { - if(0 != memrchr(0, 0, 0)) - return 1; + if(0 != ioctlsocket(0, 0, 0)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_macro_memrchr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_ioctlsocket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_macro_memrchr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_ioctlsocket="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - fi # - if test "$tst_links_memrchr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr is prototyped" >&5 -$as_echo_n "checking if memrchr is prototyped... " >&6; } + if test "$tst_links_ioctlsocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket is prototyped" >&5 +printf %s "checking if ioctlsocket is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_winsock2 _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memrchr" >/dev/null 2>&1; then : + $EGREP "ioctlsocket" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_memrchr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_ioctlsocket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_memrchr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_ioctlsocket="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_memrchr" = "yes" || - test "$tst_macro_memrchr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr is compilable" >&5 -$as_echo_n "checking if memrchr is compilable... " >&6; } + if test "$tst_proto_ioctlsocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket is compilable" >&5 +printf %s "checking if ioctlsocket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_winsock2 -int main (void) +int main(void) { - if(0 != memrchr(0, 0, 0)) + if(0 != ioctlsocket(0, 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_memrchr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ioctlsocket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_memrchr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ioctlsocket="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_memrchr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr usage allowed" >&5 -$as_echo_n "checking if memrchr usage allowed... " >&6; } - if test "x$curl_disallow_memrchr" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_memrchr="yes" + if test "$tst_compi_ioctlsocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket usage allowed" >&5 +printf %s "checking if ioctlsocket usage allowed... " >&6; } + if test "x$curl_disallow_ioctlsocket" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ioctlsocket="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_memrchr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ioctlsocket="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if memrchr might be used" >&5 -$as_echo_n "checking if memrchr might be used... " >&6; } - if (test "$tst_proto_memrchr" = "yes" || - test "$tst_macro_memrchr" = "yes") && - test "$tst_compi_memrchr" = "yes" && - test "$tst_allow_memrchr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_MEMRCHR 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket might be used" >&5 +printf %s "checking if ioctlsocket might be used... " >&6; } + if test "$tst_links_ioctlsocket" = "yes" && + test "$tst_proto_ioctlsocket" = "yes" && + test "$tst_compi_ioctlsocket" = "yes" && + test "$tst_allow_ioctlsocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - curl_cv_func_memrchr="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_memrchr="no" - fi +printf "%s\n" "#define HAVE_IOCTLSOCKET 1" >>confdefs.h + curl_cv_func_ioctlsocket="yes" - # - tst_links_poll="unknown" - tst_proto_poll="unknown" - tst_compi_poll="unknown" - tst_works_poll="unknown" - tst_allow_poll="unknown" # - case $host_os in - darwin*|interix*) - curl_disallow_poll="yes" - tst_compi_poll="no" - ;; - esac + tst_compi_ioctlsocket_fionbio="unknown" + tst_allow_ioctlsocket_fionbio="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll can be linked" >&5 -$as_echo_n "checking if poll can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$curl_cv_func_ioctlsocket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO is compilable" >&5 +printf %s "checking if ioctlsocket FIONBIO is compilable... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_poll + $curl_includes_winsock2 -int main (void) +int main(void) { - if(0 != poll(0, 0, 0)) - return 1; + unsigned long flags = 0; + if(0 != ioctlsocket(0, FIONBIO, &flags)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_poll="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ioctlsocket_fionbio="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_poll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ioctlsocket_fionbio="no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi # - if test "$tst_links_poll" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll is prototyped" >&5 -$as_echo_n "checking if poll is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO usage allowed" >&5 +printf %s "checking if ioctlsocket FIONBIO usage allowed... " >&6; } + if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ioctlsocket_fionbio="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ioctlsocket_fionbio="no" + fi + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ioctlsocket FIONBIO might be used" >&5 +printf %s "checking if ioctlsocket FIONBIO might be used... " >&6; } + if test "$tst_compi_ioctlsocket_fionbio" = "yes" && + test "$tst_allow_ioctlsocket_fionbio" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_IOCTLSOCKET_FIONBIO 1" >>confdefs.h + + curl_cv_func_ioctlsocket_fionbio="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ioctlsocket_fionbio="no" + fi + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ioctlsocket="no" + fi + + + # + tst_links_ioctlsocket_camel="unknown" + tst_compi_ioctlsocket_camel="unknown" + tst_allow_ioctlsocket_camel="unknown" + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket can be linked" >&5 +printf %s "checking if IoctlSocket can be linked... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_poll + + $curl_includes_bsdsocket + +int main(void) +{ + + if(0 != IoctlSocket(0, 0, 0)) + return 1; + + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "poll" >/dev/null 2>&1; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_poll="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_ioctlsocket_camel="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_poll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_ioctlsocket_camel="no" fi -rm -f conftest* - - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext # - if test "$tst_proto_poll" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll is compilable" >&5 -$as_echo_n "checking if poll is compilable... " >&6; } + if test "$tst_links_ioctlsocket_camel" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket is compilable" >&5 +printf %s "checking if IoctlSocket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_poll + $curl_includes_bsdsocket -int main (void) +int main(void) { - if(0 != poll(0, 0, 0)) + if(0 != IoctlSocket(0, 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_poll="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ioctlsocket_camel="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_poll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ioctlsocket_camel="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "x$cross_compiling" != "xyes" && - test "$tst_compi_poll" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll seems to work" >&5 -$as_echo_n "checking if poll seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$tst_compi_ioctlsocket_camel" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket usage allowed" >&5 +printf %s "checking if IoctlSocket usage allowed... " >&6; } + if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ioctlsocket_camel="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ioctlsocket_camel="no" + fi + fi + # + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket might be used" >&5 +printf %s "checking if IoctlSocket might be used... " >&6; } + if test "$tst_links_ioctlsocket_camel" = "yes" && + test "$tst_compi_ioctlsocket_camel" = "yes" && + test "$tst_allow_ioctlsocket_camel" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +printf "%s\n" "#define HAVE_IOCTLSOCKET_CAMEL 1" >>confdefs.h - $curl_includes_stdlib - $curl_includes_poll - $curl_includes_time + curl_cv_func_ioctlsocket_camel="yes" -int main (void) -{ + # + tst_compi_ioctlsocket_camel_fionbio="unknown" + tst_allow_ioctlsocket_camel_fionbio="unknown" + # + if test "$curl_cv_func_ioctlsocket_camel" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO is compilable" >&5 +printf %s "checking if IoctlSocket FIONBIO is compilable... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - /* detect the original poll() breakage */ - if(0 != poll(0, 0, 10)) - exit(1); /* fail */ - else { - /* detect the 10.12 poll() breakage */ - struct timeval before, after; - int rc; - size_t us; - gettimeofday(&before, NULL); - rc = poll(NULL, 0, 500); - gettimeofday(&after, NULL); + $curl_includes_bsdsocket - us = (after.tv_sec - before.tv_sec) * 1000000 + - (after.tv_usec - before.tv_usec); +int main(void) +{ - if(us < 400000) - exit(1); - } + long flags = 0; + if(0 != IoctlSocket(0, FIONBIO, &flags)) + return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_works_poll="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_ioctlsocket_camel_fionbio="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_works_poll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_ioctlsocket_camel_fionbio="no" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_poll" = "yes" && - test "$tst_works_poll" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll usage allowed" >&5 -$as_echo_n "checking if poll usage allowed... " >&6; } - if test "x$curl_disallow_poll" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_poll="yes" + if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO usage allowed" >&5 +printf %s "checking if IoctlSocket FIONBIO usage allowed... " >&6; } + if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_ioctlsocket_camel_fionbio="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_poll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_ioctlsocket_camel_fionbio="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if poll might be used" >&5 -$as_echo_n "checking if poll might be used... " >&6; } - if test "$tst_links_poll" = "yes" && - test "$tst_proto_poll" = "yes" && - test "$tst_compi_poll" = "yes" && - test "$tst_allow_poll" = "yes" && - test "$tst_works_poll" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_POLL 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IoctlSocket FIONBIO might be used" >&5 +printf %s "checking if IoctlSocket FIONBIO might be used... " >&6; } + if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" && + test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +printf "%s\n" "#define HAVE_IOCTLSOCKET_CAMEL_FIONBIO 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HAVE_POLL_FINE 1 -_ACEOF + curl_cv_func_ioctlsocket_camel_fionbio="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ioctlsocket_camel_fionbio="no" + fi - curl_cv_func_poll="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_poll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_ioctlsocket_camel="no" fi - # - tst_links_setsockopt="unknown" - tst_proto_setsockopt="unknown" - tst_compi_setsockopt="unknown" - tst_allow_setsockopt="unknown" + # + tst_links_memrchr="unknown" + tst_macro_memrchr="unknown" + tst_proto_memrchr="unknown" + tst_compi_memrchr="unknown" + tst_allow_memrchr="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt can be linked" >&5 -$as_echo_n "checking if setsockopt can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if memrchr can be linked" >&5 +printf %s "checking if memrchr can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_sys_socket +#define memrchr innocuous_memrchr +#ifdef __STDC__ +# include +#else +# include +#endif +#undef memrchr +#ifdef __cplusplus +extern "C" +#endif +char memrchr (); +#if defined __stub_memrchr || defined __stub___memrchr +#error force compilation error +#endif -int main (void) +int main(void) { - - if(0 != setsockopt(0, 0, 0, 0, 0)) - return 1; - - ; - return 0; +return memrchr (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_setsockopt="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_memrchr="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_setsockopt="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_memrchr="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_setsockopt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt is prototyped" >&5 -$as_echo_n "checking if setsockopt is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_winsock2 - $curl_includes_sys_socket - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "setsockopt" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_setsockopt="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_setsockopt="no" - -fi -rm -f conftest* - - fi - # - if test "$tst_proto_setsockopt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt is compilable" >&5 -$as_echo_n "checking if setsockopt is compilable... " >&6; } + if test "$tst_links_memrchr" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if memrchr seems a macro" >&5 +printf %s "checking if memrchr seems a macro... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_sys_socket + $curl_includes_string -int main (void) +int main(void) { - if(0 != setsockopt(0, 0, 0, 0, 0)) + if(0 != memrchr("", 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_setsockopt="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_macro_memrchr="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_setsockopt="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_macro_memrchr="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_setsockopt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt usage allowed" >&5 -$as_echo_n "checking if setsockopt usage allowed... " >&6; } - if test "x$curl_disallow_setsockopt" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_setsockopt="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_setsockopt="no" - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt might be used" >&5 -$as_echo_n "checking if setsockopt might be used... " >&6; } - if test "$tst_links_setsockopt" = "yes" && - test "$tst_proto_setsockopt" = "yes" && - test "$tst_compi_setsockopt" = "yes" && - test "$tst_allow_setsockopt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "$tst_links_memrchr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if memrchr is prototyped" >&5 +printf %s "checking if memrchr is prototyped... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + $curl_includes_string -cat >>confdefs.h <<_ACEOF -#define HAVE_SETSOCKOPT 1 _ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memrchr" >/dev/null 2>&1 +then : - curl_cv_func_setsockopt="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_memrchr="yes" +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_memrchr="no" + +fi +rm -rf conftest* + + fi # - tst_compi_setsockopt_so_nonblock="unknown" - tst_allow_setsockopt_so_nonblock="unknown" - # - if test "$curl_cv_func_setsockopt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt SO_NONBLOCK is compilable" >&5 -$as_echo_n "checking if setsockopt SO_NONBLOCK is compilable... " >&6; } + if test "$tst_proto_memrchr" = "yes" || + test "$tst_macro_memrchr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if memrchr is compilable" >&5 +printf %s "checking if memrchr is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_winsock2 - $curl_includes_sys_socket + $curl_includes_string -int main (void) +int main(void) { - if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0)) + if(0 != memrchr("", 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_setsockopt_so_nonblock="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_memrchr="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_setsockopt_so_nonblock="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_memrchr="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt SO_NONBLOCK usage allowed" >&5 -$as_echo_n "checking if setsockopt SO_NONBLOCK usage allowed... " >&6; } - if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_setsockopt_so_nonblock="yes" + if test "$tst_compi_memrchr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if memrchr usage allowed" >&5 +printf %s "checking if memrchr usage allowed... " >&6; } + if test "x$curl_disallow_memrchr" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_memrchr="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_setsockopt_so_nonblock="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_memrchr="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setsockopt SO_NONBLOCK might be used" >&5 -$as_echo_n "checking if setsockopt SO_NONBLOCK might be used... " >&6; } - if test "$tst_compi_setsockopt_so_nonblock" = "yes" && - test "$tst_allow_setsockopt_so_nonblock" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_SETSOCKOPT_SO_NONBLOCK 1 -_ACEOF + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if memrchr might be used" >&5 +printf %s "checking if memrchr might be used... " >&6; } + if (test "$tst_proto_memrchr" = "yes" || + test "$tst_macro_memrchr" = "yes") && + test "$tst_compi_memrchr" = "yes" && + test "$tst_allow_memrchr" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - curl_cv_func_setsockopt_so_nonblock="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_setsockopt_so_nonblock="no" - fi +printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h + curl_cv_func_memrchr="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_setsockopt="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_memrchr="no" fi @@ -36335,24 +40203,16 @@ curl_includes_signal="\ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SIGNAL_H -# include -#endif +#include /* includes end */" - for ac_header in sys/types.h signal.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_signal + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_signal " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -done - # @@ -36361,8 +40221,8 @@ done tst_compi_sigaction="unknown" tst_allow_sigaction="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction can be linked" >&5 -$as_echo_n "checking if sigaction can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigaction can be linked" >&5 +printf %s "checking if sigaction can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36379,36 +40239,36 @@ extern "C" #endif char sigaction (); #if defined __stub_sigaction || defined __stub___sigaction -choke me +#error force compilation error #endif -int main (void) +int main(void) { return sigaction (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_links_sigaction="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_links_sigaction="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_sigaction" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction is prototyped" >&5 -$as_echo_n "checking if sigaction is prototyped... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigaction is prototyped" >&5 +printf %s "checking if sigaction is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36416,90 +40276,89 @@ $as_echo_n "checking if sigaction is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sigaction" >/dev/null 2>&1; then : + $EGREP "sigaction" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_proto_sigaction="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_proto_sigaction="no" fi -rm -f conftest* +rm -rf conftest* fi # if test "$tst_proto_sigaction" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction is compilable" >&5 -$as_echo_n "checking if sigaction is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigaction is compilable" >&5 +printf %s "checking if sigaction is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal -int main (void) +int main(void) { if(0 != sigaction(0, 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_compi_sigaction="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_compi_sigaction="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "$tst_compi_sigaction" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction usage allowed" >&5 -$as_echo_n "checking if sigaction usage allowed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigaction usage allowed" >&5 +printf %s "checking if sigaction usage allowed... " >&6; } if test "x$curl_disallow_sigaction" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_allow_sigaction="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_allow_sigaction="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigaction might be used" >&5 -$as_echo_n "checking if sigaction might be used... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigaction might be used" >&5 +printf %s "checking if sigaction might be used... " >&6; } if test "$tst_links_sigaction" = "yes" && test "$tst_proto_sigaction" = "yes" && test "$tst_compi_sigaction" = "yes" && test "$tst_allow_sigaction" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGACTION 1 -_ACEOF +printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h curl_cv_func_sigaction="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } curl_cv_func_sigaction="no" fi @@ -36510,8 +40369,8 @@ $as_echo "no" >&6; } tst_compi_siginterrupt="unknown" tst_allow_siginterrupt="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt can be linked" >&5 -$as_echo_n "checking if siginterrupt can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if siginterrupt can be linked" >&5 +printf %s "checking if siginterrupt can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36528,36 +40387,36 @@ extern "C" #endif char siginterrupt (); #if defined __stub_siginterrupt || defined __stub___siginterrupt -choke me +#error force compilation error #endif -int main (void) +int main(void) { return siginterrupt (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_links_siginterrupt="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_links_siginterrupt="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_siginterrupt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt is prototyped" >&5 -$as_echo_n "checking if siginterrupt is prototyped... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if siginterrupt is prototyped" >&5 +printf %s "checking if siginterrupt is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36565,90 +40424,89 @@ $as_echo_n "checking if siginterrupt is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "siginterrupt" >/dev/null 2>&1; then : + $EGREP "siginterrupt" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_proto_siginterrupt="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_proto_siginterrupt="no" fi -rm -f conftest* +rm -rf conftest* fi # if test "$tst_proto_siginterrupt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt is compilable" >&5 -$as_echo_n "checking if siginterrupt is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if siginterrupt is compilable" >&5 +printf %s "checking if siginterrupt is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal -int main (void) +int main(void) { if(0 != siginterrupt(0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_compi_siginterrupt="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_compi_siginterrupt="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "$tst_compi_siginterrupt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt usage allowed" >&5 -$as_echo_n "checking if siginterrupt usage allowed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if siginterrupt usage allowed" >&5 +printf %s "checking if siginterrupt usage allowed... " >&6; } if test "x$curl_disallow_siginterrupt" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_allow_siginterrupt="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_allow_siginterrupt="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if siginterrupt might be used" >&5 -$as_echo_n "checking if siginterrupt might be used... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if siginterrupt might be used" >&5 +printf %s "checking if siginterrupt might be used... " >&6; } if test "$tst_links_siginterrupt" = "yes" && test "$tst_proto_siginterrupt" = "yes" && test "$tst_compi_siginterrupt" = "yes" && test "$tst_allow_siginterrupt" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINTERRUPT 1 -_ACEOF +printf "%s\n" "#define HAVE_SIGINTERRUPT 1" >>confdefs.h curl_cv_func_siginterrupt="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } curl_cv_func_siginterrupt="no" fi @@ -36659,8 +40517,8 @@ $as_echo "no" >&6; } tst_compi_signal="unknown" tst_allow_signal="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal can be linked" >&5 -$as_echo_n "checking if signal can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if signal can be linked" >&5 +printf %s "checking if signal can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36677,36 +40535,36 @@ extern "C" #endif char signal (); #if defined __stub_signal || defined __stub___signal -choke me +#error force compilation error #endif -int main (void) +int main(void) { return signal (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_links_signal="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_links_signal="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_signal" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal is prototyped" >&5 -$as_echo_n "checking if signal is prototyped... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if signal is prototyped" >&5 +printf %s "checking if signal is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36714,90 +40572,89 @@ $as_echo_n "checking if signal is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "signal" >/dev/null 2>&1; then : + $EGREP "signal" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_proto_signal="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_proto_signal="no" fi -rm -f conftest* +rm -rf conftest* fi # if test "$tst_proto_signal" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal is compilable" >&5 -$as_echo_n "checking if signal is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if signal is compilable" >&5 +printf %s "checking if signal is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_signal -int main (void) +int main(void) { if(0 != signal(0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_compi_signal="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_compi_signal="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "$tst_compi_signal" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal usage allowed" >&5 -$as_echo_n "checking if signal usage allowed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if signal usage allowed" >&5 +printf %s "checking if signal usage allowed... " >&6; } if test "x$curl_disallow_signal" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_allow_signal="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_allow_signal="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal might be used" >&5 -$as_echo_n "checking if signal might be used... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if signal might be used" >&5 +printf %s "checking if signal might be used... " >&6; } if test "$tst_links_signal" = "yes" && test "$tst_proto_signal" = "yes" && test "$tst_compi_signal" = "yes" && test "$tst_allow_signal" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGNAL 1 -_ACEOF +printf "%s\n" "#define HAVE_SIGNAL 1" >>confdefs.h curl_cv_func_signal="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } curl_cv_func_signal="no" fi @@ -36807,24 +40664,16 @@ curl_includes_setjmp="\ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SETJMP_H -# include -#endif +#include /* includes end */" - for ac_header in sys/types.h setjmp.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_setjmp + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_setjmp " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi -done - # @@ -36834,8 +40683,8 @@ done tst_compi_sigsetjmp="unknown" tst_allow_sigsetjmp="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp can be linked" >&5 -$as_echo_n "checking if sigsetjmp can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp can be linked" >&5 +printf %s "checking if sigsetjmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36852,74 +40701,74 @@ extern "C" #endif char sigsetjmp (); #if defined __stub_sigsetjmp || defined __stub___sigsetjmp -choke me +#error force compilation error #endif -int main (void) +int main(void) { return sigsetjmp (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_links_sigsetjmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_links_sigsetjmp="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_sigsetjmp" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp seems a macro" >&5 -$as_echo_n "checking if sigsetjmp seems a macro... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp seems a macro" >&5 +printf %s "checking if sigsetjmp seems a macro... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_setjmp -int main (void) +int main(void) { sigjmp_buf env; if(0 != sigsetjmp(env, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_macro_sigsetjmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_macro_sigsetjmp="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi # if test "$tst_links_sigsetjmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp is prototyped" >&5 -$as_echo_n "checking if sigsetjmp is prototyped... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp is prototyped" >&5 +printf %s "checking if sigsetjmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -36927,699 +40776,396 @@ $as_echo_n "checking if sigsetjmp is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sigsetjmp" >/dev/null 2>&1; then : + $EGREP "sigsetjmp" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_proto_sigsetjmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_proto_sigsetjmp="no" fi -rm -f conftest* +rm -rf conftest* fi # if test "$tst_proto_sigsetjmp" = "yes" || test "$tst_macro_sigsetjmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp is compilable" >&5 -$as_echo_n "checking if sigsetjmp is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp is compilable" >&5 +printf %s "checking if sigsetjmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_setjmp -int main (void) +int main(void) { sigjmp_buf env; if(0 != sigsetjmp(env, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_compi_sigsetjmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_compi_sigsetjmp="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "$tst_compi_sigsetjmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp usage allowed" >&5 -$as_echo_n "checking if sigsetjmp usage allowed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp usage allowed" >&5 +printf %s "checking if sigsetjmp usage allowed... " >&6; } if test "x$curl_disallow_sigsetjmp" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_allow_sigsetjmp="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_allow_sigsetjmp="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp might be used" >&5 -$as_echo_n "checking if sigsetjmp might be used... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sigsetjmp might be used" >&5 +printf %s "checking if sigsetjmp might be used... " >&6; } if (test "$tst_proto_sigsetjmp" = "yes" || test "$tst_macro_sigsetjmp" = "yes") && test "$tst_compi_sigsetjmp" = "yes" && test "$tst_allow_sigsetjmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGSETJMP 1 -_ACEOF +printf "%s\n" "#define HAVE_SIGSETJMP 1" >>confdefs.h curl_cv_func_sigsetjmp="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } curl_cv_func_sigsetjmp="no" fi - # + # tst_links_socket="unknown" tst_proto_socket="unknown" tst_compi_socket="unknown" tst_allow_socket="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket can be linked" >&5 -$as_echo_n "checking if socket can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socket can be linked" >&5 +printf %s "checking if socket can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_winsock2 + $curl_includes_bsdsocket $curl_includes_sys_socket - $curl_includes_socket -int main (void) +int main(void) { if(0 != socket(0, 0, 0)) return 1; - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_socket="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_socket="no" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_socket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket is prototyped" >&5 -$as_echo_n "checking if socket is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_winsock2 - $curl_includes_sys_socket - $curl_includes_socket - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "socket" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_socket="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_socket="no" - -fi -rm -f conftest* - - fi - # - if test "$tst_proto_socket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket is compilable" >&5 -$as_echo_n "checking if socket is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_winsock2 - $curl_includes_sys_socket - $curl_includes_socket - -int main (void) -{ - - if(0 != socket(0, 0, 0)) - return 1; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_socket="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_socket="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_socket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket usage allowed" >&5 -$as_echo_n "checking if socket usage allowed... " >&6; } - if test "x$curl_disallow_socket" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_socket="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_socket="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket might be used" >&5 -$as_echo_n "checking if socket might be used... " >&6; } - if test "$tst_links_socket" = "yes" && - test "$tst_proto_socket" = "yes" && - test "$tst_compi_socket" = "yes" && - test "$tst_allow_socket" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKET 1 -_ACEOF - - curl_cv_func_socket="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_socket="no" - fi - - - # - tst_links_socketpair="unknown" - tst_proto_socketpair="unknown" - tst_compi_socketpair="unknown" - tst_allow_socketpair="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair can be linked" >&5 -$as_echo_n "checking if socketpair can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define socketpair innocuous_socketpair -#ifdef __STDC__ -# include -#else -# include -#endif -#undef socketpair -#ifdef __cplusplus -extern "C" -#endif -char socketpair (); -#if defined __stub_socketpair || defined __stub___socketpair -choke me -#endif - -int main (void) -{ -return socketpair (); - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_socketpair="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_socketpair="no" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_socketpair" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair is prototyped" >&5 -$as_echo_n "checking if socketpair is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_sys_socket - $curl_includes_socket - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "socketpair" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_socketpair="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_socketpair="no" - -fi -rm -f conftest* - - fi - # - if test "$tst_proto_socketpair" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair is compilable" >&5 -$as_echo_n "checking if socketpair is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_sys_socket - $curl_includes_socket - -int main (void) -{ - - int sv[2]; - if(0 != socketpair(0, 0, 0, sv)) - return 1; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_socketpair="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_socketpair="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_socketpair" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair usage allowed" >&5 -$as_echo_n "checking if socketpair usage allowed... " >&6; } - if test "x$curl_disallow_socketpair" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_socketpair="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_socketpair="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socketpair might be used" >&5 -$as_echo_n "checking if socketpair might be used... " >&6; } - if test "$tst_links_socketpair" = "yes" && - test "$tst_proto_socketpair" = "yes" && - test "$tst_compi_socketpair" = "yes" && - test "$tst_allow_socketpair" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKETPAIR 1 -_ACEOF - - curl_cv_func_socketpair="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_socketpair="no" - fi - - - # - tst_links_strcasecmp="unknown" - tst_proto_strcasecmp="unknown" - tst_compi_strcasecmp="unknown" - tst_allow_strcasecmp="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp can be linked" >&5 -$as_echo_n "checking if strcasecmp can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define strcasecmp innocuous_strcasecmp -#ifdef __STDC__ -# include -#else -# include -#endif -#undef strcasecmp -#ifdef __cplusplus -extern "C" -#endif -char strcasecmp (); -#if defined __stub_strcasecmp || defined __stub___strcasecmp -choke me -#endif - -int main (void) -{ -return strcasecmp (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strcasecmp="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_socket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strcasecmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_socket="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_strcasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp is prototyped" >&5 -$as_echo_n "checking if strcasecmp is prototyped... " >&6; } + if test "$tst_links_socket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socket is prototyped" >&5 +printf %s "checking if socket is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strcasecmp" >/dev/null 2>&1; then : + $EGREP "socket" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strcasecmp="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_socket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strcasecmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_socket="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_strcasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp is compilable" >&5 -$as_echo_n "checking if strcasecmp is compilable... " >&6; } + if test "$tst_proto_socket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socket is compilable" >&5 +printf %s "checking if socket is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_winsock2 + $curl_includes_bsdsocket + $curl_includes_sys_socket -int main (void) +int main(void) { - if(0 != strcasecmp(0, 0)) + if(0 != socket(0, 0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strcasecmp="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_socket="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strcasecmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_socket="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_strcasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp usage allowed" >&5 -$as_echo_n "checking if strcasecmp usage allowed... " >&6; } - if test "x$curl_disallow_strcasecmp" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strcasecmp="yes" + if test "$tst_compi_socket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socket usage allowed" >&5 +printf %s "checking if socket usage allowed... " >&6; } + if test "x$curl_disallow_socket" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_socket="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strcasecmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_socket="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcasecmp might be used" >&5 -$as_echo_n "checking if strcasecmp might be used... " >&6; } - if test "$tst_links_strcasecmp" = "yes" && - test "$tst_proto_strcasecmp" = "yes" && - test "$tst_compi_strcasecmp" = "yes" && - test "$tst_allow_strcasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socket might be used" >&5 +printf %s "checking if socket might be used... " >&6; } + if test "$tst_links_socket" = "yes" && + test "$tst_proto_socket" = "yes" && + test "$tst_compi_socket" = "yes" && + test "$tst_allow_socket" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRCASECMP 1 -_ACEOF +printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h - curl_cv_func_strcasecmp="yes" + curl_cv_func_socket="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strcasecmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_socket="no" fi # - tst_links_strcmpi="unknown" - tst_proto_strcmpi="unknown" - tst_compi_strcmpi="unknown" - tst_allow_strcmpi="unknown" + tst_links_socketpair="unknown" + tst_proto_socketpair="unknown" + tst_compi_socketpair="unknown" + tst_allow_socketpair="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi can be linked" >&5 -$as_echo_n "checking if strcmpi can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socketpair can be linked" >&5 +printf %s "checking if socketpair can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strcmpi innocuous_strcmpi +#define socketpair innocuous_socketpair #ifdef __STDC__ # include #else # include #endif -#undef strcmpi +#undef socketpair #ifdef __cplusplus extern "C" #endif -char strcmpi (); -#if defined __stub_strcmpi || defined __stub___strcmpi -choke me +char socketpair (); +#if defined __stub_socketpair || defined __stub___socketpair +#error force compilation error #endif -int main (void) +int main(void) { -return strcmpi (); - ; - return 0; +return socketpair (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strcmpi="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_socketpair="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strcmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_socketpair="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_strcmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi is prototyped" >&5 -$as_echo_n "checking if strcmpi is prototyped... " >&6; } + if test "$tst_links_socketpair" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socketpair is prototyped" >&5 +printf %s "checking if socketpair is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_sys_socket _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strcmpi" >/dev/null 2>&1; then : + $EGREP "socketpair" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strcmpi="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_socketpair="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strcmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_socketpair="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_strcmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi is compilable" >&5 -$as_echo_n "checking if strcmpi is compilable... " >&6; } + if test "$tst_proto_socketpair" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socketpair is compilable" >&5 +printf %s "checking if socketpair is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_sys_socket -int main (void) +int main(void) { - if(0 != strcmpi(0, 0)) + int sv[2]; + if(0 != socketpair(0, 0, 0, sv)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strcmpi="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_socketpair="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strcmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_socketpair="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_strcmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi usage allowed" >&5 -$as_echo_n "checking if strcmpi usage allowed... " >&6; } - if test "x$curl_disallow_strcmpi" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strcmpi="yes" + if test "$tst_compi_socketpair" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socketpair usage allowed" >&5 +printf %s "checking if socketpair usage allowed... " >&6; } + if test "x$curl_disallow_socketpair" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_socketpair="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strcmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_socketpair="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcmpi might be used" >&5 -$as_echo_n "checking if strcmpi might be used... " >&6; } - if test "$tst_links_strcmpi" = "yes" && - test "$tst_proto_strcmpi" = "yes" && - test "$tst_compi_strcmpi" = "yes" && - test "$tst_allow_strcmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socketpair might be used" >&5 +printf %s "checking if socketpair might be used... " >&6; } + if test "$tst_links_socketpair" = "yes" && + test "$tst_proto_socketpair" = "yes" && + test "$tst_compi_socketpair" = "yes" && + test "$tst_allow_socketpair" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRCMPI 1 -_ACEOF +printf "%s\n" "#define HAVE_SOCKETPAIR 1" >>confdefs.h - curl_cv_func_strcmpi="yes" + curl_cv_func_socketpair="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strcmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_socketpair="no" fi - # + # tst_links_strdup="unknown" tst_proto_strdup="unknown" tst_compi_strdup="unknown" tst_allow_strdup="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup can be linked" >&5 -$as_echo_n "checking if strdup can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strdup can be linked" >&5 +printf %s "checking if strdup can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -37636,36 +41182,36 @@ extern "C" #endif char strdup (); #if defined __stub_strdup || defined __stub___strdup -choke me +#error force compilation error #endif -int main (void) +int main(void) { return strdup (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_links_strdup="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_links_strdup="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strdup" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup is prototyped" >&5 -$as_echo_n "checking if strdup is prototyped... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strdup is prototyped" >&5 +printf %s "checking if strdup is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -37673,90 +41219,89 @@ $as_echo_n "checking if strdup is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strdup" >/dev/null 2>&1; then : + $EGREP "strdup" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_proto_strdup="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_proto_strdup="no" fi -rm -f conftest* +rm -rf conftest* fi # if test "$tst_proto_strdup" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup is compilable" >&5 -$as_echo_n "checking if strdup is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strdup is compilable" >&5 +printf %s "checking if strdup is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string + $curl_includes_stdlib -int main (void) +int main(void) { - if(0 != strdup(0)) - return 1; + free(strdup("")); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_compi_strdup="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_compi_strdup="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "$tst_compi_strdup" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup usage allowed" >&5 -$as_echo_n "checking if strdup usage allowed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strdup usage allowed" >&5 +printf %s "checking if strdup usage allowed... " >&6; } if test "x$curl_disallow_strdup" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_allow_strdup="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_allow_strdup="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strdup might be used" >&5 -$as_echo_n "checking if strdup might be used... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strdup might be used" >&5 +printf %s "checking if strdup might be used... " >&6; } if test "$tst_links_strdup" = "yes" && test "$tst_proto_strdup" = "yes" && test "$tst_compi_strdup" = "yes" && test "$tst_allow_strdup" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRDUP 1 -_ACEOF +printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h curl_cv_func_strdup="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } curl_cv_func_strdup="no" fi @@ -37773,8 +41318,8 @@ $as_echo "no" >&6; } tst_glibc_strerror_r_type_arg3="unknown" tst_posix_strerror_r_type_arg3="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r can be linked" >&5 -$as_echo_n "checking if strerror_r can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r can be linked" >&5 +printf %s "checking if strerror_r can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -37791,36 +41336,36 @@ extern "C" #endif char strerror_r (); #if defined __stub_strerror_r || defined __stub___strerror_r -choke me +#error force compilation error #endif -int main (void) +int main(void) { return strerror_r (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_links_strerror_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_links_strerror_r="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # if test "$tst_links_strerror_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is prototyped" >&5 -$as_echo_n "checking if strerror_r is prototyped... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r is prototyped" >&5 +printf %s "checking if strerror_r is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -37828,62 +41373,64 @@ $as_echo_n "checking if strerror_r is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror_r" >/dev/null 2>&1; then : + $EGREP "strerror_r" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_proto_strerror_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_proto_strerror_r="no" fi -rm -f conftest* +rm -rf conftest* fi # if test "$tst_proto_strerror_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is compilable" >&5 -$as_echo_n "checking if strerror_r is compilable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r is compilable" >&5 +printf %s "checking if strerror_r is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string -int main (void) +int main(void) { - if(0 != strerror_r(0, 0, 0)) + char s[1]; + if(0 != strerror_r(0, s, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_compi_strerror_r="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_compi_strerror_r="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # if test "$tst_compi_strerror_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is glibc like" >&5 -$as_echo_n "checking if strerror_r is glibc like... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r is glibc like" >&5 +printf %s "checking if strerror_r is glibc like... " >&6; } tst_glibc_strerror_r_type_arg3="unknown" for arg3 in 'size_t' 'int' 'unsigned int'; do if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then @@ -37894,34 +41441,36 @@ $as_echo_n "checking if strerror_r is glibc like... " >&6; } $curl_includes_string char *strerror_r(int errnum, char *workbuf, $arg3 bufsize); -int main (void) +int main(void) { - if(0 != strerror_r(0, 0, 0)) + char s[1]; + if(0 != strerror_r(0, s, 0)) return 1; + (void)s; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : tst_glibc_strerror_r_type_arg3="$arg3" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi done case "$tst_glibc_strerror_r_type_arg3" in unknown) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_glibc_strerror_r="no" ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_glibc_strerror_r="yes" ;; esac @@ -37929,23 +41478,26 @@ $as_echo "yes" >&6; } # if test "x$cross_compiling" != "xyes" && test "$tst_glibc_strerror_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r seems to work" >&5 -$as_echo_n "checking if strerror_r seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r seems to work" >&5 +printf %s "checking if strerror_r seems to work... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_string -# include + #include -int main (void) +int main(void) { char buffer[1024]; @@ -37953,27 +41505,80 @@ int main (void) buffer[0] = '\0'; string = strerror_r(EACCES, buffer, sizeof(buffer)); if(!string) - exit(1); /* fail */ + return 1; /* fail */ if(!string[0]) - exit(1); /* fail */ + return 1; /* fail */ else - exit(0); + return 0; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_works_glibc_strerror_r="yes" -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_glibc_strerror_r="no" + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_stdlib + $curl_includes_string + #include + +int main(void) +{ + + char buffer[1024]; + char *string = 0; + buffer[0] = '\0'; + string = strerror_r(EACCES, buffer, sizeof(buffer)); + if(!string) + return 1; /* fail */ + if(!string[0]) + return 1; /* fail */ + else + return 0; + + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_glibc_strerror_r="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_works_glibc_strerror_r="no" fi @@ -37981,12 +41586,16 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi + fi # if test "$tst_compi_strerror_r" = "yes" && test "$tst_works_glibc_strerror_r" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r is POSIX like" >&5 -$as_echo_n "checking if strerror_r is POSIX like... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r is POSIX like" >&5 +printf %s "checking if strerror_r is POSIX like... " >&6; } tst_posix_strerror_r_type_arg3="unknown" for arg3 in 'size_t' 'int' 'unsigned int'; do if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then @@ -37997,34 +41606,36 @@ $as_echo_n "checking if strerror_r is POSIX like... " >&6; } $curl_includes_string int strerror_r(int errnum, char *resultbuf, $arg3 bufsize); -int main (void) +int main(void) { - if(0 != strerror_r(0, 0, 0)) + char s[1]; + if(0 != strerror_r(0, s, 0)) return 1; + (void)s; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : tst_posix_strerror_r_type_arg3="$arg3" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi done case "$tst_posix_strerror_r_type_arg3" in unknown) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_posix_strerror_r="no" ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_posix_strerror_r="yes" ;; esac @@ -38032,23 +41643,26 @@ $as_echo "yes" >&6; } # if test "x$cross_compiling" != "xyes" && test "$tst_posix_strerror_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r seems to work" >&5 -$as_echo_n "checking if strerror_r seems to work... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r seems to work" >&5 +printf %s "checking if strerror_r seems to work... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_stdlib $curl_includes_string -# include + #include -int main (void) +int main(void) { char buffer[1024]; @@ -38056,27 +41670,80 @@ int main (void) buffer[0] = '\0'; error = strerror_r(EACCES, buffer, sizeof(buffer)); if(error) - exit(1); /* fail */ + return 1; /* fail */ if(buffer[0] == '\0') - exit(1); /* fail */ + return 1; /* fail */ else - exit(0); + return 0; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_works_posix_strerror_r="yes" -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_posix_strerror_r="no" + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_stdlib + $curl_includes_string + #include + +int main(void) +{ + + char buffer[1024]; + int error = 1; + buffer[0] = '\0'; + error = strerror_r(EACCES, buffer, sizeof(buffer)); + if(error) + return 1; /* fail */ + if(buffer[0] == '\0') + return 1; /* fail */ + else + return 0; + + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_posix_strerror_r="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_works_posix_strerror_r="no" fi @@ -38084,6 +41751,10 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi + fi # if test "$tst_works_glibc_strerror_r" = "yes"; then @@ -38103,726 +41774,992 @@ fi tst_allow_strerror_r="check" fi if test "$tst_allow_strerror_r" = "check"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r usage allowed" >&5 -$as_echo_n "checking if strerror_r usage allowed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r usage allowed" >&5 +printf %s "checking if strerror_r usage allowed... " >&6; } if test "x$curl_disallow_strerror_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } tst_allow_strerror_r="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } tst_allow_strerror_r="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strerror_r might be used" >&5 -$as_echo_n "checking if strerror_r might be used... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strerror_r might be used" >&5 +printf %s "checking if strerror_r might be used... " >&6; } if test "$tst_links_strerror_r" = "yes" && test "$tst_proto_strerror_r" = "yes" && test "$tst_compi_strerror_r" = "yes" && test "$tst_allow_strerror_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } if test "$tst_glibc_strerror_r" = "yes"; then -cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_R 1 -_ACEOF +printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_GLIBC_STRERROR_R 1" >>confdefs.h + + fi + if test "$tst_posix_strerror_r" = "yes"; then + +printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_POSIX_STRERROR_R 1" >>confdefs.h + + fi + curl_cv_func_strerror_r="yes" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_strerror_r="no" + fi + # + if test "$tst_compi_strerror_r" = "yes" && + test "$tst_allow_strerror_r" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine strerror_r() style: edit lib/curl_config.h manually." >&5 +printf "%s\n" "$as_me: WARNING: cannot determine strerror_r() style: edit lib/curl_config.h manually." >&2;} + fi + # + + +case $host in + *msdosdjgpp) + ac_cv_func_pipe=no + skipcheck_pipe=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skip check for pipe on msdosdjgpp" >&5 +printf "%s\n" "$as_me: skip check for pipe on msdosdjgpp" >&6;} + ;; +esac + +ac_fn_c_check_func "$LINENO" "accept4" "ac_cv_func_accept4" +if test "x$ac_cv_func_accept4" = xyes +then : + printf "%s\n" "#define HAVE_ACCEPT4 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "eventfd" "ac_cv_func_eventfd" +if test "x$ac_cv_func_eventfd" = xyes +then : + printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fnmatch" "ac_cv_func_fnmatch" +if test "x$ac_cv_func_fnmatch" = xyes +then : + printf "%s\n" "#define HAVE_FNMATCH 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "geteuid" "ac_cv_func_geteuid" +if test "x$ac_cv_func_geteuid" = xyes +then : + printf "%s\n" "#define HAVE_GETEUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpass_r" "ac_cv_func_getpass_r" +if test "x$ac_cv_func_getpass_r" = xyes +then : + printf "%s\n" "#define HAVE_GETPASS_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getppid" "ac_cv_func_getppid" +if test "x$ac_cv_func_getppid" = xyes +then : + printf "%s\n" "#define HAVE_GETPPID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpwuid" "ac_cv_func_getpwuid" +if test "x$ac_cv_func_getpwuid" = xyes +then : + printf "%s\n" "#define HAVE_GETPWUID 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r" +if test "x$ac_cv_func_getpwuid_r" = xyes +then : + printf "%s\n" "#define HAVE_GETPWUID_R 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HAVE_GLIBC_STRERROR_R 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "getrlimit" "ac_cv_func_getrlimit" +if test "x$ac_cv_func_getrlimit" = xyes +then : + printf "%s\n" "#define HAVE_GETRLIMIT 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define STRERROR_R_TYPE_ARG3 $tst_glibc_strerror_r_type_arg3 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex" +if test "x$ac_cv_func_if_nametoindex" = xyes +then : + printf "%s\n" "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h - fi - if test "$tst_posix_strerror_r" = "yes"; then +fi +ac_fn_c_check_func "$LINENO" "mach_absolute_time" "ac_cv_func_mach_absolute_time" +if test "x$ac_cv_func_mach_absolute_time" = xyes +then : + printf "%s\n" "#define HAVE_MACH_ABSOLUTE_TIME 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_R 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "pipe" "ac_cv_func_pipe" +if test "x$ac_cv_func_pipe" = xyes +then : + printf "%s\n" "#define HAVE_PIPE 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" +if test "x$ac_cv_func_pipe2" = xyes +then : + printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define HAVE_POSIX_STRERROR_R 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" +if test "x$ac_cv_func_poll" = xyes +then : + printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "sendmmsg" "ac_cv_func_sendmmsg" +if test "x$ac_cv_func_sendmmsg" = xyes +then : + printf "%s\n" "#define HAVE_SENDMMSG 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define STRERROR_R_TYPE_ARG3 $tst_posix_strerror_r_type_arg3 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "sendmsg" "ac_cv_func_sendmsg" +if test "x$ac_cv_func_sendmsg" = xyes +then : + printf "%s\n" "#define HAVE_SENDMSG 1" >>confdefs.h - fi - curl_cv_func_strerror_r="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strerror_r="no" - fi - # - if test "$tst_compi_strerror_r" = "yes" && - test "$tst_allow_strerror_r" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine strerror_r() style: edit lib/curl_config.h manually." >&5 -$as_echo "$as_me: WARNING: cannot determine strerror_r() style: edit lib/curl_config.h manually." >&2;} - fi - # +fi +ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" +if test "x$ac_cv_func_setlocale" = xyes +then : + printf "%s\n" "#define HAVE_SETLOCALE 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "setrlimit" "ac_cv_func_setrlimit" +if test "x$ac_cv_func_setrlimit" = xyes +then : + printf "%s\n" "#define HAVE_SETRLIMIT 1" >>confdefs.h - # - tst_links_stricmp="unknown" - tst_proto_stricmp="unknown" - tst_compi_stricmp="unknown" - tst_allow_stricmp="unknown" +fi +ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "utime" "ac_cv_func_utime" +if test "x$ac_cv_func_utime" = xyes +then : + printf "%s\n" "#define HAVE_UTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "utimes" "ac_cv_func_utimes" +if test "x$ac_cv_func_utimes" = xyes +then : + printf "%s\n" "#define HAVE_UTIMES 1" >>confdefs.h + +fi + + +if test "$curl_cv_native_windows" != 'yes'; then + ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" +if test "x$ac_cv_func_realpath" = xyes +then : + printf "%s\n" "#define HAVE_REALPATH 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield" +if test "x$ac_cv_func_sched_yield" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_YIELD 1" >>confdefs.h + +fi + + +curl_includes_arpa_inet="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef _WIN32 +#include +#include +#else +#include +#endif +/* includes end */" + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$curl_includes_arpa_inet +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$curl_includes_arpa_inet +" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$curl_includes_arpa_inet +" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h + +fi + + + + # + tst_links_inet_ntop="unknown" + tst_proto_inet_ntop="unknown" + tst_compi_inet_ntop="unknown" + tst_works_inet_ntop="unknown" + tst_allow_inet_ntop="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp can be linked" >&5 -$as_echo_n "checking if stricmp can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_ntop can be linked" >&5 +printf %s "checking if inet_ntop can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define stricmp innocuous_stricmp +#define inet_ntop innocuous_inet_ntop #ifdef __STDC__ # include #else # include #endif -#undef stricmp +#undef inet_ntop #ifdef __cplusplus extern "C" #endif -char stricmp (); -#if defined __stub_stricmp || defined __stub___stricmp -choke me +char inet_ntop (); +#if defined __stub_inet_ntop || defined __stub___inet_ntop +#error force compilation error #endif -int main (void) +int main(void) { -return stricmp (); - ; - return 0; +return inet_ntop (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_stricmp="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_inet_ntop="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_stricmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_inet_ntop="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_stricmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp is prototyped" >&5 -$as_echo_n "checking if stricmp is prototyped... " >&6; } + if test "$tst_links_inet_ntop" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_ntop is prototyped" >&5 +printf %s "checking if inet_ntop is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_arpa_inet _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "stricmp" >/dev/null 2>&1; then : + $EGREP "inet_ntop" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_stricmp="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_inet_ntop="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_stricmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_inet_ntop="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_stricmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp is compilable" >&5 -$as_echo_n "checking if stricmp is compilable... " >&6; } + if test "$tst_proto_inet_ntop" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_ntop is compilable" >&5 +printf %s "checking if inet_ntop is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_arpa_inet -int main (void) +int main(void) { - if(0 != stricmp(0, 0)) + char ipv4res[sizeof("255.255.255.255")]; + unsigned char ipv4a[5] = ""; + if(0 != inet_ntop(0, ipv4a, ipv4res, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_stricmp="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_inet_ntop="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_stricmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_inet_ntop="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_stricmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp usage allowed" >&5 -$as_echo_n "checking if stricmp usage allowed... " >&6; } - if test "x$curl_disallow_stricmp" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_stricmp="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_stricmp="no" - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if stricmp might be used" >&5 -$as_echo_n "checking if stricmp might be used... " >&6; } - if test "$tst_links_stricmp" = "yes" && - test "$tst_proto_stricmp" = "yes" && - test "$tst_compi_stricmp" = "yes" && - test "$tst_allow_stricmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "x$cross_compiling" != "xyes" && + test "$tst_compi_inet_ntop" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_ntop seems to work" >&5 +printf %s "checking if inet_ntop seems to work... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + $curl_includes_stdlib + $curl_includes_arpa_inet + $curl_includes_string + +int main(void) +{ + + char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; + char ipv4res[sizeof("255.255.255.255")]; + unsigned char ipv6a[26]; + unsigned char ipv4a[5]; + const char *ipv6ptr = 0; + const char *ipv4ptr = 0; + /* - */ + ipv4res[0] = '\0'; + ipv4a[0] = 0xc0; + ipv4a[1] = 0xa8; + ipv4a[2] = 0x64; + ipv4a[3] = 0x01; + ipv4a[4] = 0x01; + /* - */ + ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res)); + if(!ipv4ptr) + return 1; /* fail */ + if(ipv4ptr != ipv4res) + return 1; /* fail */ + if(!ipv4ptr[0]) + return 1; /* fail */ + if(memcmp(ipv4res, "192.168.100.1", 13) != 0) + return 1; /* fail */ + /* - */ + ipv6res[0] = '\0'; + memset(ipv6a, 0, sizeof(ipv6a)); + ipv6a[0] = 0xfe; + ipv6a[1] = 0x80; + ipv6a[8] = 0x02; + ipv6a[9] = 0x14; + ipv6a[10] = 0x4f; + ipv6a[11] = 0xff; + ipv6a[12] = 0xfe; + ipv6a[13] = 0x0b; + ipv6a[14] = 0x76; + ipv6a[15] = 0xc8; + ipv6a[25] = 0x01; + /* - */ + ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res)); + if(!ipv6ptr) + return 1; /* fail */ + if(ipv6ptr != ipv6res) + return 1; /* fail */ + if(!ipv6ptr[0]) + return 1; /* fail */ + if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0) + return 1; /* fail */ + /* - */ + return 0; + + return 0; +} -cat >>confdefs.h <<_ACEOF -#define HAVE_STRICMP 1 _ACEOF +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_inet_ntop="yes" - curl_cv_func_stricmp="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_stricmp="no" - fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_inet_ntop="no" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - # - tst_links_strncasecmp="unknown" - tst_proto_strncasecmp="unknown" - tst_compi_strncasecmp="unknown" - tst_allow_strncasecmp="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp can be linked" >&5 -$as_echo_n "checking if strncasecmp can be linked... " >&6; } + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strncasecmp innocuous_strncasecmp -#ifdef __STDC__ -# include -#else -# include -#endif -#undef strncasecmp -#ifdef __cplusplus -extern "C" -#endif -char strncasecmp (); -#if defined __stub_strncasecmp || defined __stub___strncasecmp -choke me -#endif + $curl_includes_stdlib + $curl_includes_arpa_inet + $curl_includes_string + +int main(void) +{ + + char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; + char ipv4res[sizeof("255.255.255.255")]; + unsigned char ipv6a[26]; + unsigned char ipv4a[5]; + const char *ipv6ptr = 0; + const char *ipv4ptr = 0; + /* - */ + ipv4res[0] = '\0'; + ipv4a[0] = 0xc0; + ipv4a[1] = 0xa8; + ipv4a[2] = 0x64; + ipv4a[3] = 0x01; + ipv4a[4] = 0x01; + /* - */ + ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res)); + if(!ipv4ptr) + return 1; /* fail */ + if(ipv4ptr != ipv4res) + return 1; /* fail */ + if(!ipv4ptr[0]) + return 1; /* fail */ + if(memcmp(ipv4res, "192.168.100.1", 13) != 0) + return 1; /* fail */ + /* - */ + ipv6res[0] = '\0'; + memset(ipv6a, 0, sizeof(ipv6a)); + ipv6a[0] = 0xfe; + ipv6a[1] = 0x80; + ipv6a[8] = 0x02; + ipv6a[9] = 0x14; + ipv6a[10] = 0x4f; + ipv6a[11] = 0xff; + ipv6a[12] = 0xfe; + ipv6a[13] = 0x0b; + ipv6a[14] = 0x76; + ipv6a[15] = 0xc8; + ipv6a[25] = 0x01; + /* - */ + ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res)); + if(!ipv6ptr) + return 1; /* fail */ + if(ipv6ptr != ipv6res) + return 1; /* fail */ + if(!ipv6ptr[0]) + return 1; /* fail */ + if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0) + return 1; /* fail */ + /* - */ + return 0; -int main (void) -{ -return strncasecmp (); - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strncasecmp="yes" - -else +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_inet_ntop="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strncasecmp="no" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_inet_ntop="no" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_strncasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp is prototyped" >&5 -$as_echo_n "checking if strncasecmp is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - $curl_includes_string - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strncasecmp" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strncasecmp="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strncasecmp="no" - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest* + LD_LIBRARY_PATH=$old # restore + CC=$oldcc fi - # - if test "$tst_proto_strncasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp is compilable" >&5 -$as_echo_n "checking if strncasecmp is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_string - -int main (void) -{ - if(0 != strncasecmp(0, 0, 0)) - return 1; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strncasecmp="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strncasecmp="no" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # - if test "$tst_compi_strncasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp usage allowed" >&5 -$as_echo_n "checking if strncasecmp usage allowed... " >&6; } - if test "x$curl_disallow_strncasecmp" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strncasecmp="yes" + if test "$tst_compi_inet_ntop" = "yes" && + test "$tst_works_inet_ntop" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_ntop usage allowed" >&5 +printf %s "checking if inet_ntop usage allowed... " >&6; } + if test "x$curl_disallow_inet_ntop" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_inet_ntop="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strncasecmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_inet_ntop="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncasecmp might be used" >&5 -$as_echo_n "checking if strncasecmp might be used... " >&6; } - if test "$tst_links_strncasecmp" = "yes" && - test "$tst_proto_strncasecmp" = "yes" && - test "$tst_compi_strncasecmp" = "yes" && - test "$tst_allow_strncasecmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_ntop might be used" >&5 +printf %s "checking if inet_ntop might be used... " >&6; } + if test "$tst_links_inet_ntop" = "yes" && + test "$tst_proto_inet_ntop" = "yes" && + test "$tst_compi_inet_ntop" = "yes" && + test "$tst_allow_inet_ntop" = "yes" && + test "$tst_works_inet_ntop" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRNCASECMP 1 -_ACEOF +printf "%s\n" "#define HAVE_INET_NTOP 1" >>confdefs.h - curl_cv_func_strncasecmp="yes" + curl_cv_func_inet_ntop="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strncasecmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_inet_ntop="no" fi - # - tst_links_strncmpi="unknown" - tst_proto_strncmpi="unknown" - tst_compi_strncmpi="unknown" - tst_allow_strncmpi="unknown" + # + tst_links_inet_pton="unknown" + tst_proto_inet_pton="unknown" + tst_compi_inet_pton="unknown" + tst_works_inet_pton="unknown" + tst_allow_inet_pton="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi can be linked" >&5 -$as_echo_n "checking if strncmpi can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_pton can be linked" >&5 +printf %s "checking if inet_pton can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strncmpi innocuous_strncmpi +#define inet_pton innocuous_inet_pton #ifdef __STDC__ # include #else # include #endif -#undef strncmpi +#undef inet_pton #ifdef __cplusplus extern "C" #endif -char strncmpi (); -#if defined __stub_strncmpi || defined __stub___strncmpi -choke me +char inet_pton (); +#if defined __stub_inet_pton || defined __stub___inet_pton +#error force compilation error #endif -int main (void) +int main(void) { -return strncmpi (); - ; - return 0; +return inet_pton (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strncmpi="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_inet_pton="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strncmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_inet_pton="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_strncmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi is prototyped" >&5 -$as_echo_n "checking if strncmpi is prototyped... " >&6; } + if test "$tst_links_inet_pton" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_pton is prototyped" >&5 +printf %s "checking if inet_pton is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_arpa_inet _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strncmpi" >/dev/null 2>&1; then : + $EGREP "inet_pton" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strncmpi="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_inet_pton="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strncmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_inet_pton="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_strncmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi is compilable" >&5 -$as_echo_n "checking if strncmpi is compilable... " >&6; } + if test "$tst_proto_inet_pton" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_pton is compilable" >&5 +printf %s "checking if inet_pton is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_string + $curl_includes_arpa_inet -int main (void) +int main(void) { - if(0 != strncmpi(0, 0)) + unsigned char ipv4a[4+1] = ""; + const char *ipv4src = "192.168.100.1"; + if(0 != inet_pton(0, ipv4src, ipv4a)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strncmpi="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_inet_pton="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strncmpi="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_inet_pton="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_strncmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi usage allowed" >&5 -$as_echo_n "checking if strncmpi usage allowed... " >&6; } - if test "x$curl_disallow_strncmpi" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strncmpi="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strncmpi="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strncmpi might be used" >&5 -$as_echo_n "checking if strncmpi might be used... " >&6; } - if test "$tst_links_strncmpi" = "yes" && - test "$tst_proto_strncmpi" = "yes" && - test "$tst_compi_strncmpi" = "yes" && - test "$tst_allow_strncmpi" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRNCMPI 1 -_ACEOF - - curl_cv_func_strncmpi="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strncmpi="no" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - - - # - tst_links_strnicmp="unknown" - tst_proto_strnicmp="unknown" - tst_compi_strnicmp="unknown" - tst_allow_strnicmp="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp can be linked" >&5 -$as_echo_n "checking if strnicmp can be linked... " >&6; } + if test "x$cross_compiling" != "xyes" && + test "$tst_compi_inet_pton" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_pton seems to work" >&5 +printf %s "checking if inet_pton seems to work... " >&6; } + + if test "$curl_cv_apple" = 'yes'; then + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strnicmp innocuous_strnicmp -#ifdef __STDC__ -# include -#else -# include -#endif -#undef strnicmp -#ifdef __cplusplus -extern "C" -#endif -char strnicmp (); -#if defined __stub_strnicmp || defined __stub___strnicmp -choke me -#endif + $curl_includes_stdlib + $curl_includes_arpa_inet + $curl_includes_string -int main (void) +int main(void) { -return strnicmp (); - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strnicmp="yes" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strnicmp="no" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_strnicmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp is prototyped" >&5 -$as_echo_n "checking if strnicmp is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + unsigned char ipv6a[16+1]; + unsigned char ipv4a[4+1]; + const char *ipv6src = "fe80::214:4fff:fe0b:76c8"; + const char *ipv4src = "192.168.100.1"; + /* - */ + memset(ipv4a, 1, sizeof(ipv4a)); + if(1 != inet_pton(AF_INET, ipv4src, ipv4a)) + return 1; /* fail */ + /* - */ + if( (ipv4a[0] != 0xc0) || + (ipv4a[1] != 0xa8) || + (ipv4a[2] != 0x64) || + (ipv4a[3] != 0x01) || + (ipv4a[4] != 0x01) ) + return 1; /* fail */ + /* - */ + memset(ipv6a, 1, sizeof(ipv6a)); + if(1 != inet_pton(AF_INET6, ipv6src, ipv6a)) + return 1; /* fail */ + /* - */ + if( (ipv6a[0] != 0xfe) || + (ipv6a[1] != 0x80) || + (ipv6a[8] != 0x02) || + (ipv6a[9] != 0x14) || + (ipv6a[10] != 0x4f) || + (ipv6a[11] != 0xff) || + (ipv6a[12] != 0xfe) || + (ipv6a[13] != 0x0b) || + (ipv6a[14] != 0x76) || + (ipv6a[15] != 0xc8) || + (ipv6a[16] != 0x01) ) + return 1; /* fail */ + /* - */ + if( (ipv6a[2] != 0x0) || + (ipv6a[3] != 0x0) || + (ipv6a[4] != 0x0) || + (ipv6a[5] != 0x0) || + (ipv6a[6] != 0x0) || + (ipv6a[7] != 0x0) ) + return 1; /* fail */ + /* - */ + return 0; - $curl_includes_string + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strnicmp" >/dev/null 2>&1; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strnicmp="yes" - -else +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_inet_pton="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strnicmp="no" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_inet_pton="no" fi -rm -f conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - fi - # - if test "$tst_proto_strnicmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp is compilable" >&5 -$as_echo_n "checking if strnicmp is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + else + oldcc=$CC + old=$LD_LIBRARY_PATH + CC="sh ./run-compiler" + LD_LIBRARY_PATH=$CURL_LIBRARY_PATH:$old + export LD_LIBRARY_PATH + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + $curl_includes_stdlib + $curl_includes_arpa_inet $curl_includes_string -int main (void) +int main(void) { - if(0 != strnicmp(0, 0)) - return 1; + unsigned char ipv6a[16+1]; + unsigned char ipv4a[4+1]; + const char *ipv6src = "fe80::214:4fff:fe0b:76c8"; + const char *ipv4src = "192.168.100.1"; + /* - */ + memset(ipv4a, 1, sizeof(ipv4a)); + if(1 != inet_pton(AF_INET, ipv4src, ipv4a)) + return 1; /* fail */ + /* - */ + if( (ipv4a[0] != 0xc0) || + (ipv4a[1] != 0xa8) || + (ipv4a[2] != 0x64) || + (ipv4a[3] != 0x01) || + (ipv4a[4] != 0x01) ) + return 1; /* fail */ + /* - */ + memset(ipv6a, 1, sizeof(ipv6a)); + if(1 != inet_pton(AF_INET6, ipv6src, ipv6a)) + return 1; /* fail */ + /* - */ + if( (ipv6a[0] != 0xfe) || + (ipv6a[1] != 0x80) || + (ipv6a[8] != 0x02) || + (ipv6a[9] != 0x14) || + (ipv6a[10] != 0x4f) || + (ipv6a[11] != 0xff) || + (ipv6a[12] != 0xfe) || + (ipv6a[13] != 0x0b) || + (ipv6a[14] != 0x76) || + (ipv6a[15] != 0xc8) || + (ipv6a[16] != 0x01) ) + return 1; /* fail */ + /* - */ + if( (ipv6a[2] != 0x0) || + (ipv6a[3] != 0x0) || + (ipv6a[4] != 0x0) || + (ipv6a[5] != 0x0) || + (ipv6a[6] != 0x0) || + (ipv6a[7] != 0x0) ) + return 1; /* fail */ + /* - */ + return 0; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_works_inet_pton="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strnicmp="yes" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_works_inet_pton="no" -else +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strnicmp="no" + LD_LIBRARY_PATH=$old # restore + CC=$oldcc + fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # - if test "$tst_compi_strnicmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp usage allowed" >&5 -$as_echo_n "checking if strnicmp usage allowed... " >&6; } - if test "x$curl_disallow_strnicmp" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strnicmp="yes" + if test "$tst_compi_inet_pton" = "yes" && + test "$tst_works_inet_pton" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_pton usage allowed" >&5 +printf %s "checking if inet_pton usage allowed... " >&6; } + if test "x$curl_disallow_inet_pton" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_inet_pton="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strnicmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_inet_pton="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnicmp might be used" >&5 -$as_echo_n "checking if strnicmp might be used... " >&6; } - if test "$tst_links_strnicmp" = "yes" && - test "$tst_proto_strnicmp" = "yes" && - test "$tst_compi_strnicmp" = "yes" && - test "$tst_allow_strnicmp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_pton might be used" >&5 +printf %s "checking if inet_pton might be used... " >&6; } + if test "$tst_links_inet_pton" = "yes" && + test "$tst_proto_inet_pton" = "yes" && + test "$tst_compi_inet_pton" = "yes" && + test "$tst_allow_inet_pton" = "yes" && + test "$tst_works_inet_pton" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRNICMP 1 -_ACEOF +printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h - curl_cv_func_strnicmp="yes" + curl_cv_func_inet_pton="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strnicmp="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_inet_pton="no" fi # - tst_links_strstr="unknown" - tst_proto_strstr="unknown" - tst_compi_strstr="unknown" - tst_allow_strstr="unknown" + tst_links_strcasecmp="unknown" + tst_proto_strcasecmp="unknown" + tst_compi_strcasecmp="unknown" + tst_allow_strcasecmp="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr can be linked" >&5 -$as_echo_n "checking if strstr can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcasecmp can be linked" >&5 +printf %s "checking if strcasecmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strstr innocuous_strstr +#define strcasecmp innocuous_strcasecmp #ifdef __STDC__ # include #else # include #endif -#undef strstr +#undef strcasecmp #ifdef __cplusplus extern "C" #endif -char strstr (); -#if defined __stub_strstr || defined __stub___strstr -choke me +char strcasecmp (); +#if defined __stub_strcasecmp || defined __stub___strcasecmp +#error force compilation error #endif -int main (void) +int main(void) { -return strstr (); - ; - return 0; +return strcasecmp (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strstr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_strcasecmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strstr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_strcasecmp="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_strstr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr is prototyped" >&5 -$as_echo_n "checking if strstr is prototyped... " >&6; } + if test "$tst_links_strcasecmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcasecmp is prototyped" >&5 +printf %s "checking if strcasecmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -38830,148 +42767,147 @@ $as_echo_n "checking if strstr is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strstr" >/dev/null 2>&1; then : + $EGREP "strcasecmp" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strstr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_strcasecmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strstr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_strcasecmp="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_strstr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr is compilable" >&5 -$as_echo_n "checking if strstr is compilable... " >&6; } + if test "$tst_proto_strcasecmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcasecmp is compilable" >&5 +printf %s "checking if strcasecmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string -int main (void) +int main(void) { - if(0 != strstr(0, 0)) + if(0 != strcasecmp("", "")) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strstr="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_strcasecmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strstr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_strcasecmp="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_strstr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr usage allowed" >&5 -$as_echo_n "checking if strstr usage allowed... " >&6; } - if test "x$curl_disallow_strstr" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strstr="yes" + if test "$tst_compi_strcasecmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcasecmp usage allowed" >&5 +printf %s "checking if strcasecmp usage allowed... " >&6; } + if test "x$curl_disallow_strcasecmp" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_strcasecmp="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strstr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_strcasecmp="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strstr might be used" >&5 -$as_echo_n "checking if strstr might be used... " >&6; } - if test "$tst_links_strstr" = "yes" && - test "$tst_proto_strstr" = "yes" && - test "$tst_compi_strstr" = "yes" && - test "$tst_allow_strstr" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcasecmp might be used" >&5 +printf %s "checking if strcasecmp might be used... " >&6; } + if test "$tst_links_strcasecmp" = "yes" && + test "$tst_proto_strcasecmp" = "yes" && + test "$tst_compi_strcasecmp" = "yes" && + test "$tst_allow_strcasecmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRSTR 1 -_ACEOF +printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h - curl_cv_func_strstr="yes" + curl_cv_func_strcasecmp="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strstr="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_strcasecmp="no" fi # - tst_links_strtok_r="unknown" - tst_proto_strtok_r="unknown" - tst_compi_strtok_r="unknown" - tst_allow_strtok_r="unknown" + tst_links_strcmpi="unknown" + tst_proto_strcmpi="unknown" + tst_compi_strcmpi="unknown" + tst_allow_strcmpi="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r can be linked" >&5 -$as_echo_n "checking if strtok_r can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcmpi can be linked" >&5 +printf %s "checking if strcmpi can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strtok_r innocuous_strtok_r +#define strcmpi innocuous_strcmpi #ifdef __STDC__ # include #else # include #endif -#undef strtok_r +#undef strcmpi #ifdef __cplusplus extern "C" #endif -char strtok_r (); -#if defined __stub_strtok_r || defined __stub___strtok_r -choke me +char strcmpi (); +#if defined __stub_strcmpi || defined __stub___strcmpi +#error force compilation error #endif -int main (void) +int main(void) { -return strtok_r (); - ; - return 0; +return strcmpi (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strtok_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_strcmpi="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strtok_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_strcmpi="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_strtok_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r is prototyped" >&5 -$as_echo_n "checking if strtok_r is prototyped... " >&6; } + if test "$tst_links_strcmpi" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcmpi is prototyped" >&5 +printf %s "checking if strcmpi is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -38979,1669 +42915,2071 @@ $as_echo_n "checking if strtok_r is prototyped... " >&6; } _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtok_r" >/dev/null 2>&1; then : + $EGREP "strcmpi" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strtok_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_strcmpi="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strtok_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_strcmpi="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_strtok_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r is compilable" >&5 -$as_echo_n "checking if strtok_r is compilable... " >&6; } + if test "$tst_proto_strcmpi" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcmpi is compilable" >&5 +printf %s "checking if strcmpi is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $curl_includes_string -int main (void) +int main(void) { - if(0 != strtok_r(0, 0, 0)) + if(0 != strcmpi(0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strtok_r="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_strcmpi="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strtok_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_strcmpi="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_strtok_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r usage allowed" >&5 -$as_echo_n "checking if strtok_r usage allowed... " >&6; } - if test "x$curl_disallow_strtok_r" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strtok_r="yes" + if test "$tst_compi_strcmpi" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcmpi usage allowed" >&5 +printf %s "checking if strcmpi usage allowed... " >&6; } + if test "x$curl_disallow_strcmpi" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_strcmpi="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strtok_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_strcmpi="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtok_r might be used" >&5 -$as_echo_n "checking if strtok_r might be used... " >&6; } - if test "$tst_links_strtok_r" = "yes" && - test "$tst_proto_strtok_r" = "yes" && - test "$tst_compi_strtok_r" = "yes" && - test "$tst_allow_strtok_r" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if strcmpi might be used" >&5 +printf %s "checking if strcmpi might be used... " >&6; } + if test "$tst_links_strcmpi" = "yes" && + test "$tst_proto_strcmpi" = "yes" && + test "$tst_compi_strcmpi" = "yes" && + test "$tst_allow_strcmpi" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOK_R 1 -_ACEOF +printf "%s\n" "#define HAVE_STRCMPI 1" >>confdefs.h - curl_cv_func_strtok_r="yes" + curl_cv_func_strcmpi="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strtok_r="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_strcmpi="no" fi # - tst_links_strtoll="unknown" - tst_proto_strtoll="unknown" - tst_compi_strtoll="unknown" - tst_allow_strtoll="unknown" + tst_links_stricmp="unknown" + tst_proto_stricmp="unknown" + tst_compi_stricmp="unknown" + tst_allow_stricmp="unknown" # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll can be linked" >&5 -$as_echo_n "checking if strtoll can be linked... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if stricmp can be linked" >&5 +printf %s "checking if stricmp can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define strtoll innocuous_strtoll +#define stricmp innocuous_stricmp #ifdef __STDC__ # include #else # include #endif -#undef strtoll +#undef stricmp #ifdef __cplusplus extern "C" #endif -char strtoll (); -#if defined __stub_strtoll || defined __stub___strtoll -choke me +char stricmp (); +#if defined __stub_stricmp || defined __stub___stricmp +#error force compilation error #endif -int main (void) +int main(void) { -return strtoll (); - ; - return 0; +return stricmp (); + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_strtoll="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_links_stricmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_strtoll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_links_stricmp="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # - if test "$tst_links_strtoll" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll is prototyped" >&5 -$as_echo_n "checking if strtoll is prototyped... " >&6; } + if test "$tst_links_stricmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if stricmp is prototyped" >&5 +printf %s "checking if stricmp is prototyped... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stdlib + $curl_includes_string _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoll" >/dev/null 2>&1; then : + $EGREP "stricmp" >/dev/null 2>&1 +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_strtoll="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_proto_stricmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_strtoll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_proto_stricmp="no" fi -rm -f conftest* +rm -rf conftest* fi # - if test "$tst_proto_strtoll" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll is compilable" >&5 -$as_echo_n "checking if strtoll is compilable... " >&6; } + if test "$tst_proto_stricmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if stricmp is compilable" >&5 +printf %s "checking if stricmp is compilable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - $curl_includes_stdlib + $curl_includes_string -int main (void) +int main(void) { - if(0 != strtoll(0, 0, 0)) + if(0 != stricmp(0, 0)) return 1; - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_strtoll="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_compi_stricmp="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_strtoll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_compi_stricmp="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi # - if test "$tst_compi_strtoll" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll usage allowed" >&5 -$as_echo_n "checking if strtoll usage allowed... " >&6; } - if test "x$curl_disallow_strtoll" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_strtoll="yes" + if test "$tst_compi_stricmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if stricmp usage allowed" >&5 +printf %s "checking if stricmp usage allowed... " >&6; } + if test "x$curl_disallow_stricmp" != "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tst_allow_stricmp="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_strtoll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + tst_allow_stricmp="no" fi fi # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strtoll might be used" >&5 -$as_echo_n "checking if strtoll might be used... " >&6; } - if test "$tst_links_strtoll" = "yes" && - test "$tst_proto_strtoll" = "yes" && - test "$tst_compi_strtoll" = "yes" && - test "$tst_allow_strtoll" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if stricmp might be used" >&5 +printf %s "checking if stricmp might be used... " >&6; } + if test "$tst_links_stricmp" = "yes" && + test "$tst_proto_stricmp" = "yes" && + test "$tst_compi_stricmp" = "yes" && + test "$tst_allow_stricmp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOLL 1 -_ACEOF +printf "%s\n" "#define HAVE_STRICMP 1" >>confdefs.h - curl_cv_func_strtoll="yes" + curl_cv_func_stricmp="yes" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_strtoll="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_cv_func_stricmp="no" fi +fi -curl_includes_sys_uio="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_UIO_H -# include -#endif -/* includes end */" - for ac_header in sys/types.h sys/uio.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$curl_includes_sys_uio -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "$curl_cv_wince" = 'no'; then + ac_fn_c_check_func "$LINENO" "setmode" "ac_cv_func_setmode" +if test "x$ac_cv_func_setmode" = xyes +then : + printf "%s\n" "#define HAVE_SETMODE 1" >>confdefs.h fi -done + if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then + ac_fn_c_check_func "$LINENO" "_setmode" "ac_cv_func__setmode" +if test "x$ac_cv_func__setmode" = xyes +then : + printf "%s\n" "#define HAVE__SETMODE 1" >>confdefs.h +fi + fi +fi - # - tst_links_writev="unknown" - tst_proto_writev="unknown" - tst_compi_writev="unknown" - tst_allow_writev="unknown" - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev can be linked" >&5 -$as_echo_n "checking if writev can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +if test -z "$ssl_backends"; then + ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" +if test "x$ac_cv_func_arc4random" = xyes +then : + printf "%s\n" "#define HAVE_ARC4RANDOM 1" >>confdefs.h +fi -#define writev innocuous_writev -#ifdef __STDC__ -# include -#else -# include -#endif -#undef writev -#ifdef __cplusplus -extern "C" -#endif -char writev (); -#if defined __stub_writev || defined __stub___writev -choke me -#endif +fi + +if test "$curl_cv_native_windows" != 'yes'; then + ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko" +if test "x$ac_cv_func_fseeko" = xyes +then : + printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -int main (void) +int main(void) { -return writev (); - ; - return 0; +(void) strchr; + return 0; } +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); +int main(void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + return 0; +} _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "fseeko" "ac_cv_have_decl_fseeko" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fseeko" = xyes +then : + +printf "%s\n" "#define HAVE_DECL_FSEEKO 1" >>confdefs.h + +fi +fi + + + # + tst_method="unknown" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to set a socket into non-blocking mode" >&5 +printf %s "checking how to set a socket into non-blocking mode... " >&6; } + if test "x$curl_cv_func_fcntl_o_nonblock" = "xyes"; then + tst_method="fcntl O_NONBLOCK" + elif test "x$curl_cv_func_ioctl_fionbio" = "xyes"; then + tst_method="ioctl FIONBIO" + elif test "x$curl_cv_func_ioctlsocket_fionbio" = "xyes"; then + tst_method="ioctlsocket FIONBIO" + elif test "x$curl_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then + tst_method="IoctlSocket FIONBIO" + elif test "x$curl_cv_func_setsockopt_so_nonblock" = "xyes"; then + tst_method="setsockopt SO_NONBLOCK" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tst_method" >&5 +printf "%s\n" "$tst_method" >&6; } + if test "$tst_method" = "unknown"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine non-blocking socket method." >&5 +printf "%s\n" "$as_me: WARNING: cannot determine non-blocking socket method." >&2;} + fi + + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PERL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +printf "%s\n" "$PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_links_writev="yes" +if test "x$BUILD_DOCS" != "x0" -o "x$USE_MANUAL" != "x0" -o "x$CURL_CA_EMBED" != "x"; then + if test -z "$PERL"; then + as_fn_error $? "perl was not found, needed for docs, manual and CA embed" "$LINENO" 5 + fi +fi + if test x"$BUILD_DOCS" = x1; then + BUILD_DOCS_TRUE= + BUILD_DOCS_FALSE='#' else + BUILD_DOCS_TRUE='#' + BUILD_DOCS_FALSE= +fi + - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_links_writev="no" +if test "$USE_MANUAL" = "1"; then + curl_manual_msg="enabled" +fi + + if test x"$USE_MANUAL" = x1; then + USE_MANUAL_TRUE= + USE_MANUAL_FALSE='#' +else + USE_MANUAL_TRUE='#' + USE_MANUAL_FALSE= fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$tst_links_writev" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev is prototyped" >&5 -$as_echo_n "checking if writev is prototyped... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - $curl_includes_sys_uio -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "writev" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_proto_writev="yes" + # + if test "$want_ares" = "yes"; then + clean_CPPFLAGS="$CPPFLAGS" + clean_LDFLAGS="$LDFLAGS" + clean_LDFLAGSPC="$LDFLAGSPC" + clean_LIBS="$LIBS" + configure_runpath=`pwd` + if test -n "$want_ares_path"; then + ARES_PCDIR="$want_ares_path/lib/pkgconfig" + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_proto_writev="no" fi -rm -f conftest* - +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi - # - if test "$tst_proto_writev" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev is compilable" >&5 -$as_echo_n "checking if writev is compilable... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - $curl_includes_sys_uio - -int main (void) -{ - - if(0 != writev(0, 0, 0)) - return 1; - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_compi_writev="yes" +done + done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_compi_writev="no" - + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - # - if test "$tst_compi_writev" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev usage allowed" >&5 -$as_echo_n "checking if writev usage allowed... " >&6; } - if test "x$curl_disallow_writev" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tst_allow_writev="yes" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tst_allow_writev="no" - fi - fi - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if writev might be used" >&5 -$as_echo_n "checking if writev might be used... " >&6; } - if test "$tst_links_writev" = "yes" && - test "$tst_proto_writev" = "yes" && - test "$tst_compi_writev" = "yes" && - test "$tst_allow_writev" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_WRITEV 1 -_ACEOF - curl_cv_func_writev="yes" + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_func_writev="no" - fi - - -case $host in - *msdosdjgpp) - ac_cv_func_pipe=no - skipcheck_pipe=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: skip check for pipe on msdosdjgpp" >&5 -$as_echo "$as_me: skip check for pipe on msdosdjgpp" >&6;} - ;; + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac - -for ac_func in geteuid \ - getpass_r \ - getppid \ - getpwuid \ - getpwuid_r \ - getrlimit \ - gettimeofday \ - if_nametoindex \ - pipe \ - setlocale \ - setmode \ - setrlimit \ - utime \ - utimes - -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - - + PKGCONFIG=$ac_pt_PKGCONFIG + fi else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi - func="$ac_func" - eval skipcheck=\$skipcheck_$func - if test "x$skipcheck" != "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper for $func" >&5 -$as_echo_n "checking deeper for $func... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - + fi -int main (void) -{ + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcares options with pkg-config" >&5 +printf %s "checking for libcares options with pkg-config... " >&6; } + itexists=` + if test -n "$ARES_PCDIR"; then + PKG_CONFIG_LIBDIR="$ARES_PCDIR" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libcares >/dev/null 2>&1 && echo 1` - $func (); + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - ; - return 0; -} + if test "$PKGCONFIG" != "no" ; then + ares_LIBS=` + if test -n "$ARES_PCDIR"; then + PKG_CONFIG_LIBDIR="$ARES_PCDIR" + export PKG_CONFIG_LIBDIR + fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + $PKGCONFIG --libs-only-l libcares` + ares_LDFLAGS=` + if test -n "$ARES_PCDIR"; then + PKG_CONFIG_LIBDIR="$ARES_PCDIR" + export PKG_CONFIG_LIBDIR + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - eval "ac_cv_func_$func=yes" + $PKGCONFIG --libs-only-L libcares` + ares_CPPFLAGS=` + if test -n "$ARES_PCDIR"; then + PKG_CONFIG_LIBDIR="$ARES_PCDIR" + export PKG_CONFIG_LIBDIR + fi -cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$func" | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' | sed 's/^A-Z0-9_/_/g'` 1 -_ACEOF + $PKGCONFIG --cflags-only-I libcares` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: ares LIBS: \"$ares_LIBS\"" >&5 +printf "%s\n" "$as_me: pkg-config: ares LIBS: \"$ares_LIBS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: ares LDFLAGS: \"$ares_LDFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: ares LDFLAGS: \"$ares_LDFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: ares CPPFLAGS: \"$ares_CPPFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: ares CPPFLAGS: \"$ares_CPPFLAGS\"" >&6;} + else + ares_CPPFLAGS="-I$want_ares_path/include" + ares_LDFLAGS="-L$want_ares_path/lib" + ares_LIBS="-lcares" + fi + else + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: but still no" >&5 -$as_echo "but still no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +if test -z "$ac_cv_path_PKGCONFIG"; then + ac_pt_PKGCONFIG=$PKGCONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKGCONFIG="$ac_pt_PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/bin:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 fi - -fi done + done +IFS=$as_save_IFS - - - for ac_header in sys/types.h sys/socket.h netdb.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - + ;; +esac +fi +ac_pt_PKGCONFIG=$ac_cv_path_ac_pt_PKGCONFIG +if test -n "$ac_pt_PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKGCONFIG" >&5 +printf "%s\n" "$ac_pt_PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -done - - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo" >&5 -$as_echo_n "checking for getnameinfo... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define getnameinfo innocuous_getnameinfo -#ifdef __STDC__ -# include -#else -# include -#endif -#undef getnameinfo -#ifdef __cplusplus -extern "C" -#endif -char getnameinfo (); -#if defined __stub_getnameinfo || defined __stub___getnameinfo -choke me -#endif - -int main (void) -{ -return getnameinfo (); - ; - return 0; -} + if test "x$ac_pt_PKGCONFIG" = x; then + PKGCONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKGCONFIG=$ac_pt_PKGCONFIG + fi +else + PKGCONFIG="$ac_cv_path_PKGCONFIG" +fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_cv_getnameinfo="yes" + if test "x$PKGCONFIG" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcares options with pkg-config" >&5 +printf %s "checking for libcares options with pkg-config... " >&6; } + itexists=` + if test -n ""; then + PKG_CONFIG_LIBDIR="" + export PKG_CONFIG_LIBDIR + fi + $PKGCONFIG --exists libcares >/dev/null 2>&1 && echo 1` -else + if test -z "$itexists"; then + PKGCONFIG="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + fi + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - curl_cv_getnameinfo="no" + if test "$PKGCONFIG" != "no" ; then + ares_LIBS=`$PKGCONFIG --libs-only-l libcares` + ares_LDFLAGS=`$PKGCONFIG --libs-only-L libcares` + ares_CPPFLAGS=`$PKGCONFIG --cflags-only-I libcares` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: ares_LIBS: \"$ares_LIBS\"" >&5 +printf "%s\n" "$as_me: pkg-config: ares_LIBS: \"$ares_LIBS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: ares_LDFLAGS: \"$ares_LDFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: ares_LDFLAGS: \"$ares_LDFLAGS\"" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pkg-config: ares_CPPFLAGS: \"$ares_CPPFLAGS\"" >&5 +printf "%s\n" "$as_me: pkg-config: ares_CPPFLAGS: \"$ares_CPPFLAGS\"" >&6;} + else + ares_CPPFLAGS="" + ares_LDFLAGS="" + ares_LIBS="-lcares" + fi + fi + # + CPPFLAGS="$clean_CPPFLAGS $ares_CPPFLAGS" + LDFLAGS="$clean_LDFLAGS $ares_LDFLAGS" + LDFLAGSPC="$clean_LDFLAGSPC $ares_LDFLAGS" + LIBS="$ares_LIBS $clean_LIBS" + # -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - # - if test "$curl_cv_getnameinfo" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper for getnameinfo" >&5 -$as_echo_n "checking deeper for getnameinfo... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that c-ares is good and recent enough" >&5 +printf %s "checking that c-ares is good and recent enough... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + /* set of dummy functions in case c-ares was built with debug */ + void curl_dofree(void); void curl_dofree(void) {} + void curl_sclose(void); void curl_sclose(void) {} + void curl_domalloc(void); void curl_domalloc(void) {} + void curl_docalloc(void); void curl_docalloc(void) {} + void curl_socket(void); void curl_socket(void) {} -int main (void) +int main(void) { - getnameinfo(); + ares_channel channel; + ares_cancel(channel); /* added in 1.2.0 */ + ares_process_fd(channel, 0, 0); /* added in 1.4.0 */ + ares_dup(&channel, channel); /* added in 1.6.0 */ - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_cv_getnameinfo="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: but still no" >&5 -$as_echo "but still no" >&6; } - curl_cv_getnameinfo="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "c-ares library defective or too old" "$LINENO" 5 + CPPFLAGS="$clean_CPPFLAGS" + LDFLAGS="$clean_LDFLAGS" + LDFLAGSPC="$clean_LDFLAGSPC" + LIBS="$clean_LIBS" + # prevent usage + want_ares="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - fi - # - if test "$curl_cv_getnameinfo" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper and deeper for getnameinfo" >&5 -$as_echo_n "checking deeper and deeper for getnameinfo... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#endif -int main (void) -{ + if test "$want_ares" = "yes"; then - getnameinfo(0, 0, 0, 0, 0, 0, 0); +printf "%s\n" "#define USE_ARES 1" >>confdefs.h - ; - return 0; -} + USE_ARES=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libcares" + curl_res_msg="c-ares" + fi + fi -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - curl_cv_getnameinfo="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable the threaded resolver" >&5 +printf %s "checking whether to enable the threaded resolver... " >&6; } + OPT_THRES="default" + # Check whether --enable-threaded_resolver was given. +if test ${enable_threaded_resolver+y} +then : + enableval=$enable_threaded_resolver; OPT_THRES=$enableval +fi -else + case "$OPT_THRES" in + no) + want_threaded_resolver="no" + ;; + yes) + want_threaded_resolver="yes" + ;; + *) + case $host_os in + msdos* | amiga*) + want_threaded_resolver="no" + ;; + *) + if test "$want_ares" = "yes"; then + want_threaded_resolver="no" + else + want_threaded_resolver="yes" + fi + ;; + esac + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $want_threaded_resolver" >&5 +printf "%s\n" "$want_threaded_resolver" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: but still no" >&5 -$as_echo "but still no" >&6; } - curl_cv_getnameinfo="no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - # - if test "$curl_cv_getnameinfo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for getnameinfo" >&5 -$as_echo_n "checking types of arguments for getnameinfo... " >&6; } -if ${curl_cv_func_getnameinfo_args+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "$ipv6" = yes -a "$curl_cv_apple" = 'yes'; then - curl_cv_func_getnameinfo_args="unknown" - for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do - for gni_arg2 in 'socklen_t' 'size_t' 'int'; do - for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do - for gni_arg7 in 'int' 'unsigned int'; do - if test "$curl_cv_func_getnameinfo_args" = "unknown"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks" >&5 +printf %s "checking whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0501 -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#define GNICALLCONV WSAAPI -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#define GNICALLCONV -#endif - extern int GNICALLCONV -#ifdef __ANDROID__ -__attribute__((overloadable)) -#endif - getnameinfo($gni_arg1, $gni_arg2, - char *, $gni_arg46, - char *, $gni_arg46, - $gni_arg7); + #include + #include -int main (void) +int main(void) { - $gni_arg2 salen=0; - $gni_arg46 hostlen=0; - $gni_arg46 servlen=0; - $gni_arg7 flags=0; - int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags); + #if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) + return 0; + #else + #error Not macOS + #endif - ; - return 0; + return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : + + build_for_macos="yes" + +else $as_nop - curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7" + build_for_macos="no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - done - done - done - done +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test "x$build_for_macos" != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SYSCONFIG_LDFLAGS='-framework CoreFoundation -framework CoreServices -framework SystemConfiguration' + LDFLAGS="$LDFLAGS $SYSCONFIG_LDFLAGS" + LDFLAGSPC="$LDFLAGSPC $SYSCONFIG_LDFLAGS" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_func_getnameinfo_args" >&5 -$as_echo "$curl_cv_func_getnameinfo_args" >&6; } # AC-CACHE-CHECK - if test "$curl_cv_func_getnameinfo_args" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find proper types to use for getnameinfo args" >&5 -$as_echo "$as_me: WARNING: Cannot find proper types to use for getnameinfo args" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HAVE_GETNAMEINFO will not be defined" >&5 -$as_echo "$as_me: WARNING: HAVE_GETNAMEINFO will not be defined" >&2;} - else - gni_prev_IFS=$IFS; IFS=',' - set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'` - IFS=$gni_prev_IFS - shift - # - gni_qual_type_arg1=$1 - # -cat >>confdefs.h <<_ACEOF -#define GETNAMEINFO_TYPE_ARG2 $2 -_ACEOF +if test "$want_threaded_resolver" = "yes" && test "$curl_cv_native_windows" = "yes"; then + USE_THREADS_WIN32=1 +printf "%s\n" "#define USE_THREADS_WIN32 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define GETNAMEINFO_TYPE_ARG46 $3 -_ACEOF + curl_res_msg="Win32 threaded" +fi +if test "$want_threaded_resolver" = "yes" && test "$USE_THREADS_WIN32" != "1"; then + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define GETNAMEINFO_TYPE_ARG7 $4 -_ACEOF +printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h - # - prev_sh_opts=$- - # - case $prev_sh_opts in - *f*) + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + + LIBS= + ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" +if test "x$ac_cv_func_pthread_create" = xyes +then : + USE_THREADS_POSIX=1 +fi + + LIBS="$save_LIBS" + + case $host in + *-hp-hpux*) + USE_THREADS_POSIX="" ;; *) - set -f ;; esac - # - case "$gni_qual_type_arg1" in - const*) - gni_qual_arg1=const - gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'` - ;; - *) - gni_qual_arg1= - gni_type_arg1=$gni_qual_type_arg1 - ;; - esac - # -cat >>confdefs.h <<_ACEOF -#define GETNAMEINFO_QUAL_ARG1 $gni_qual_arg1 -_ACEOF + if test "$USE_THREADS_POSIX" != "1"; then + # assign PTHREAD for pkg-config use + PTHREAD=" -pthread" + + case $host in + *-ibm-aix*) + COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` + if test x"$COMPILER_VERSION" = "x"; then + CFLAGS="$CFLAGS -pthread" + else + CFLAGS="$CFLAGS -qthreaded" + fi + ;; + powerpc-*amigaos*) + PTHREAD=" -lpthread" + ;; + *) + CFLAGS="$CFLAGS -pthread" + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +printf %s "checking for pthread_create in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define GETNAMEINFO_TYPE_ARG1 $gni_type_arg1 +#ifdef __cplusplus +extern "C" +#endif +char pthread_create (); +int main(void) +{ +return pthread_create (); + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_pthread_pthread_create=yes +else $as_nop + ac_cv_lib_pthread_pthread_create=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes +then : + USE_THREADS_POSIX=1 +else $as_nop + CFLAGS="$save_CFLAGS" +fi - # - case $prev_sh_opts in - *f*) - ;; - *) - set +f - ;; - esac - # + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_GETNAMEINFO 1 -_ACEOF + if test "x$USE_THREADS_POSIX" = "x1"; then - curl_cv_func_getnameinfo="yes" - fi - fi +printf "%s\n" "#define USE_THREADS_POSIX 1" >>confdefs.h + + curl_res_msg="POSIX threaded" + fi +fi -if test "$ipv6" = "yes"; then - if test "$curl_cv_func_getaddrinfo" = "yes"; then +fi -$as_echo "#define ENABLE_IPV6 1" >>confdefs.h +if test "$want_threaded_resolver" != "no" -a "x$USE_THREADS_POSIX" != "x1" -a "x$USE_THREADS_WIN32" != "x1"; then + as_fn_error $? "Threaded resolver enabled but no thread library found" "$LINENO" 5 +fi - IPV6_ENABLED=1 +ac_fn_c_check_header_compile "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" +if test "x$ac_cv_header_dirent_h" = xyes +then : - fi +printf "%s\n" "#define HAVE_DIRENT_H 1" >>confdefs.h - for ac_header in stdio.h sys/types.h sys/socket.h \ - netdb.h netinet/in.h arpa/inet.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" +if test "x$ac_cv_func_opendir" = xyes +then : + +printf "%s\n" "#define HAVE_OPENDIR 1" >>confdefs.h fi -done - # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working NI_WITHSCOPEID" >&5 -$as_echo_n "checking for working NI_WITHSCOPEID... " >&6; } -if ${curl_cv_working_ni_withscopeid+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +fi - # Program is not run when cross-compiling. So we assume - # NI_WITHSCOPEID will work if we are able to compile it. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking convert -I options to -isystem" >&5 +printf %s "checking convert -I options to -isystem... " >&6; } + if test "$compiler_id" = "GNU_C" || + test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + tmp_has_include="no" + tmp_chg_FLAGS="$CFLAGS" + for word1 in $tmp_chg_FLAGS; do + case "$word1" in + -I*) + tmp_has_include="yes" + ;; + esac + done + if test "$tmp_has_include" = "yes"; then + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` + CFLAGS="$tmp_chg_FLAGS" + squeeze CFLAGS + fi + tmp_has_include="no" + tmp_chg_FLAGS="$CPPFLAGS" + for word1 in $tmp_chg_FLAGS; do + case "$word1" in + -I*) + tmp_has_include="yes" + ;; + esac + done + if test "$tmp_has_include" = "yes"; then + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` + CPPFLAGS="$tmp_chg_FLAGS" + squeeze CPPFLAGS + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -int main (void) -{ - unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable verbose strings" >&5 +printf %s "checking whether to enable verbose strings... " >&6; } +# Check whether --enable-verbose was given. +if test ${enable_verbose+y} +then : + enableval=$enable_verbose; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - ; - return 0; -} +printf "%s\n" "#define CURL_DISABLE_VERBOSE_STRINGS 1" >>confdefs.h -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + curl_verbose_msg="no" + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - curl_cv_working_ni_withscopeid="yes" +fi -else - curl_cv_working_ni_withscopeid="no" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable SSPI support (Windows native builds only)" >&5 +printf %s "checking whether to enable SSPI support (Windows native builds only)... " >&6; } +# Check whether --enable-sspi was given. +if test ${enable_sspi+y} +then : + enableval=$enable_sspi; case "$enableval" in + yes) + if test "$curl_cv_native_windows" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define USE_WINDOWS_SSPI 1" >>confdefs.h + + USE_WINDOWS_SSPI=1 + curl_sspi_msg="enabled" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --enable-sspi Ignored. Only supported on native Windows builds." >&5 +printf "%s\n" "$as_me: WARNING: --enable-sspi Ignored. Only supported on native Windows builds." >&2;} + fi + ;; + *) + if test "x$SCHANNEL_ENABLED" = "x1"; then + # --with-schannel implies --enable-sspi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + esac +else $as_nop + if test "x$SCHANNEL_ENABLED" = "x1"; then + # --with-schannel implies --enable-sspi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # AC-COMPILE-IFELSE -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +if test "x$USE_WINDOWS_SSPI" = "x1"; then + LIBS="-lsecur32 $LIBS" +fi -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable basic authentication method" >&5 +printf %s "checking whether to enable basic authentication method... " >&6; } +# Check whether --enable-basic-auth was given. +if test ${enable_basic_auth+y} +then : + enableval=$enable_basic_auth; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -int main (void) -{ +printf "%s\n" "#define CURL_DISABLE_BASIC_AUTH 1" >>confdefs.h -#if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO) -#ifdef HAVE_STRUCT_SOCKADDR_STORAGE - struct sockaddr_storage sa; -#else - unsigned char sa[256]; -#endif - char hostbuf[NI_MAXHOST]; - int rc; - GETNAMEINFO_TYPE_ARG2 salen = (GETNAMEINFO_TYPE_ARG2)sizeof(sa); - GETNAMEINFO_TYPE_ARG46 hostlen = (GETNAMEINFO_TYPE_ARG46)sizeof(hostbuf); - GETNAMEINFO_TYPE_ARG7 flags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID; - int fd = socket(AF_INET6, SOCK_STREAM, 0); - if(fd < 0) { - perror("socket()"); - return 1; /* Error creating socket */ - } - rc = getsockname(fd, (GETNAMEINFO_TYPE_ARG1)&sa, &salen); - if(rc) { - perror("getsockname()"); - return 2; /* Error retrieving socket name */ - } - rc = getnameinfo((GETNAMEINFO_TYPE_ARG1)&sa, salen, hostbuf, hostlen, NULL, 0, flags); - if(rc) { - printf("rc = %s\n", gai_strerror(rc)); - return 3; /* Error translating socket address */ - } - return 0; /* Ok, NI_WITHSCOPEID works */ -#else - return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */ -#endif + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - ; - return 0; -} # AC-LANG-PROGRAM +fi -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - # Exit code == 0. Program worked. - curl_cv_working_ni_withscopeid="yes" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable bearer authentication method" >&5 +printf %s "checking whether to enable bearer authentication method... " >&6; } +# Check whether --enable-bearer-auth was given. +if test ${enable_bearer_auth+y} +then : + enableval=$enable_bearer_auth; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -else +printf "%s\n" "#define CURL_DISABLE_BEARER_AUTH 1" >>confdefs.h - # Exit code != 0. Program failed. - curl_cv_working_ni_withscopeid="no" + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - # AC-RUN-IFELSE -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_working_ni_withscopeid" >&5 -$as_echo "$curl_cv_working_ni_withscopeid" >&6; } # AC-CACHE-CHECK - case "$curl_cv_working_ni_withscopeid" in - yes) -$as_echo "#define HAVE_NI_WITHSCOPEID 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable digest authentication method" >&5 +printf %s "checking whether to enable digest authentication method... " >&6; } +# Check whether --enable-digest-auth was given. +if test ${enable_digest_auth+y} +then : + enableval=$enable_digest_auth; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - ;; +printf "%s\n" "#define CURL_DISABLE_DIGEST_AUTH 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi - # - tst_method="unknown" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable kerberos authentication method" >&5 +printf %s "checking whether to enable kerberos authentication method... " >&6; } +# Check whether --enable-kerberos-auth was given. +if test ${enable_kerberos_auth+y} +then : + enableval=$enable_kerberos_auth; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_KERBEROS_AUTH 1" >>confdefs.h + + CURL_DISABLE_KERBEROS_AUTH=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to set a socket into non-blocking mode" >&5 -$as_echo_n "checking how to set a socket into non-blocking mode... " >&6; } - if test "x$curl_cv_func_fcntl_o_nonblock" = "xyes"; then - tst_method="fcntl O_NONBLOCK" - elif test "x$curl_cv_func_ioctl_fionbio" = "xyes"; then - tst_method="ioctl FIONBIO" - elif test "x$curl_cv_func_ioctlsocket_fionbio" = "xyes"; then - tst_method="ioctlsocket FIONBIO" - elif test "x$curl_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then - tst_method="IoctlSocket FIONBIO" - elif test "x$curl_cv_func_setsockopt_so_nonblock" = "xyes"; then - tst_method="setsockopt SO_NONBLOCK" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tst_method" >&5 -$as_echo "$tst_method" >&6; } - if test "$tst_method" = "unknown"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine non-blocking socket method." >&5 -$as_echo "$as_me: WARNING: cannot determine non-blocking socket method." >&2;} - fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable negotiate authentication method" >&5 +printf %s "checking whether to enable negotiate authentication method... " >&6; } +# Check whether --enable-negotiate-auth was given. +if test ${enable_negotiate_auth+y} +then : + enableval=$enable_negotiate_auth; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_NEGOTIATE_AUTH 1" >>confdefs.h -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; + CURL_DISABLE_NEGOTIATE_AUTH=1 + ;; *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin " -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - ;; -esac -fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable aws sig methods" >&5 +printf %s "checking whether to enable aws sig methods... " >&6; } +# Check whether --enable-aws was given. +if test ${enable_aws+y} +then : + enableval=$enable_aws; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_AWS 1" >>confdefs.h -for ac_prog in gnroff nroff -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NROFF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NROFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path. - ;; + ;; *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/bin/:/usr/local/bin " -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NROFF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - ;; -esac -fi -NROFF=$ac_cv_path_NROFF -if test -n "$NROFF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5 -$as_echo "$NROFF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi - test -n "$NROFF" && break -done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support NTLM" >&5 +printf %s "checking whether to support NTLM... " >&6; } +# Check whether --enable-ntlm was given. +if test ${enable_ntlm+y} +then : + enableval=$enable_ntlm; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_NTLM 1" >>confdefs.h + CURL_DISABLE_NTLM=1 + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -if test -n "$NROFF"; then +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to use *nroff to get plain text from man pages" >&5 -$as_echo_n "checking how to use *nroff to get plain text from man pages... " >&6; } - MANOPT="-man" - mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` - if test -z "$mancheck"; then - MANOPT="-mandoc" - mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` - if test -z "$mancheck"; then - MANOPT="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: found no *nroff option to get plaintext from man pages" >&5 -$as_echo "$as_me: WARNING: found no *nroff option to get plaintext from man pages" >&2;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANOPT" >&5 -$as_echo "$MANOPT" >&6; } - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANOPT" >&5 -$as_echo "$MANOPT" >&6; } - fi -fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable TLS-SRP authentication" >&5 +printf %s "checking whether to enable TLS-SRP authentication... " >&6; } +# Check whether --enable-tls-srp was given. +if test ${enable_tls_srp+y} +then : + enableval=$enable_tls_srp; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + want_tls_srp=no + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + want_tls_srp=yes + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + want_tls_srp=yes -if test -z "$MANOPT" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling built-in manual" >&5 -$as_echo "$as_me: WARNING: disabling built-in manual" >&2;} - USE_MANUAL="no"; fi -if test "$USE_MANUAL" = "1"; then +if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1"); then -$as_echo "#define USE_MANUAL 1" >>confdefs.h +printf "%s\n" "#define USE_TLS_SRP 1" >>confdefs.h - curl_manual_msg="enabled" + USE_TLS_SRP=1 + curl_tls_srp_msg="enabled" fi - if test x"$USE_MANUAL" = x1; then - USE_MANUAL_TRUE= - USE_MANUAL_FALSE='#' -else - USE_MANUAL_TRUE='#' - USE_MANUAL_FALSE= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable Unix domain sockets" >&5 +printf %s "checking whether to enable Unix domain sockets... " >&6; } +# Check whether --enable-unix-sockets was given. +if test ${enable_unix_sockets+y} +then : + enableval=$enable_unix_sockets; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + want_unix_sockets=no + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + want_unix_sockets=yes + ;; + esac +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: auto" >&5 +printf "%s\n" "auto" >&6; } + want_unix_sockets=auto + + fi +if test "x$want_unix_sockets" != "xno" -a "$curl_cv_wince" = 'no'; then + if test "x$curl_cv_native_windows" = "xyes"; then + USE_UNIX_SOCKETS=1 +printf "%s\n" "#define USE_UNIX_SOCKETS 1" >>confdefs.h + curl_unix_sockets_msg="enabled" + else + ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_path" "ac_cv_member_struct_sockaddr_un_sun_path" " + #include +" +if test "x$ac_cv_member_struct_sockaddr_un_sun_path" = xyes +then : - # - if test "$want_ares" = "yes"; then - clean_CPPFLAGS="$CPPFLAGS" - clean_LDFLAGS="$LDFLAGS" - clean_LIBS="$LIBS" - embedded_ares="unknown" - configure_runpath=`pwd` - embedded_ares_builddir="$configure_runpath/ares" - if test -n "$want_ares_path"; then - ares_CPPFLAGS="-I$want_ares_path/include" - ares_LDFLAGS="-L$want_ares_path/lib" - ares_LIBS="-lcares" - else - if test -d "$srcdir/ares"; then - embedded_ares="yes" - subdirs="$subdirs ares" - ares_CPPFLAGS="" - ares_LDFLAGS="-L$embedded_ares_builddir" - ares_LIBS="-lcares" - else - ares_CPPFLAGS="" - ares_LDFLAGS="" - ares_LIBS="-lcares" +printf "%s\n" "#define USE_UNIX_SOCKETS 1" >>confdefs.h + + USE_UNIX_SOCKETS=1 + curl_unix_sockets_msg="enabled" + +else $as_nop + + if test "x$want_unix_sockets" = "xyes"; then + as_fn_error $? "--enable-unix-sockets is not available on this platform!" "$LINENO" 5 fi - fi - # - CPPFLAGS="$clean_CPPFLAGS $ares_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS $ares_LDFLAGS" - LIBS="$ares_LIBS $clean_LIBS" - # - if test "$embedded_ares" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking that c-ares is good and recent enough" >&5 -$as_echo_n "checking that c-ares is good and recent enough... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi -#include - /* set of dummy functions in case c-ares was built with debug */ - void curl_dofree() { } - void curl_sclose() { } - void curl_domalloc() { } - void curl_docalloc() { } - void curl_socket() { } + fi +fi -int main (void) -{ +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support cookies" >&5 +printf %s "checking whether to support cookies... " >&6; } +# Check whether --enable-cookies was given. +if test ${enable_cookies+y} +then : + enableval=$enable_cookies; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - ares_channel channel; - ares_cancel(channel); /* added in 1.2.0 */ - ares_process_fd(channel, 0, 0); /* added in 1.4.0 */ - ares_dup(&channel, channel); /* added in 1.6.0 */ +printf "%s\n" "#define CURL_DISABLE_COOKIES 1" >>confdefs.h - ; - return 0; -} + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support socketpair" >&5 +printf %s "checking whether to support socketpair... " >&6; } +# Check whether --enable-socketpair was given. +if test ${enable_socketpair+y} +then : + enableval=$enable_socketpair; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "c-ares library defective or too old" "$LINENO" 5 - CPPFLAGS="$clean_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS" - LIBS="$clean_LIBS" - # prevent usage - want_ares="no" +printf "%s\n" "#define CURL_DISABLE_SOCKETPAIR 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - if test "$want_ares" = "yes"; then -$as_echo "#define USE_ARES 1" >>confdefs.h - USE_ARES=1 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support HTTP authentication" >&5 +printf %s "checking whether to support HTTP authentication... " >&6; } +# Check whether --enable-http-auth was given. +if test ${enable_http_auth+y} +then : + enableval=$enable_http_auth; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - curl_res_msg="c-ares" - fi - fi +printf "%s\n" "#define CURL_DISABLE_HTTP_AUTH 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - if test x$embedded_ares = xyes; then - USE_EMBEDDED_ARES_TRUE= - USE_EMBEDDED_ARES_FALSE='#' -else - USE_EMBEDDED_ARES_TRUE='#' - USE_EMBEDDED_ARES_FALSE= fi -if test "x$curl_cv_native_windows" != "xyes" && - test "x$enable_shared" = "xyes"; then - build_libhostname=yes -else - build_libhostname=no -fi - if test x$build_libhostname = xyes; then - BUILD_LIBHOSTNAME_TRUE= - BUILD_LIBHOSTNAME_FALSE='#' -else - BUILD_LIBHOSTNAME_TRUE='#' - BUILD_LIBHOSTNAME_FALSE= -fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support DoH" >&5 +printf %s "checking whether to support DoH... " >&6; } +# Check whether --enable-doh was given. +if test ${enable_doh+y} +then : + enableval=$enable_doh; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_DOH 1" >>confdefs.h -if test "x$want_ares" != xyes; then + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the threaded resolver" >&5 -$as_echo_n "checking whether to enable the threaded resolver... " >&6; } - OPT_THRES="default" - # Check whether --enable-threaded_resolver was given. -if test "${enable_threaded_resolver+set}" = set; then : - enableval=$enable_threaded_resolver; OPT_THRES=$enableval fi - case "$OPT_THRES" in - no) - want_thres="no" - ;; - *) - want_thres="yes" - ;; + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support the MIME API" >&5 +printf %s "checking whether to support the MIME API... " >&6; } +# Check whether --enable-mime was given. +if test ${enable_mime+y} +then : + enableval=$enable_mime; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_MIME 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_thres" >&5 -$as_echo "$want_thres" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use POSIX threads for threaded resolver" >&5 -$as_echo_n "checking whether to use POSIX threads for threaded resolver... " >&6; } -# Check whether --enable-pthreads was given. -if test "${enable_pthreads+set}" = set; then : - enableval=$enable_pthreads; case "$enableval" in - no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - want_pthreads=no - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - want_pthreads=yes - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto" >&5 -$as_echo "auto" >&6; } - want_pthreads=auto +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support binding connections locally" >&5 +printf %s "checking whether to support binding connections locally... " >&6; } +# Check whether --enable-bindlocal was given. +if test ${enable_bindlocal+y} +then : + enableval=$enable_bindlocal; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_BINDLOCAL 1" >>confdefs.h + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -if test "$want_pthreads" != "no"; then - if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then - as_fn_error $? "options --enable-pthreads and --disable-rt are mutually exclusive" "$LINENO" 5 - fi - if test "$dontwant_rt" != "no"; then - if test "$want_pthreads" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-pthreads Ignored since librt is disabled." >&5 -$as_echo "$as_me: WARNING: --enable-pthreads Ignored since librt is disabled." >&2;} - fi - want_pthreads=no - fi -fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support the form API" >&5 +printf %s "checking whether to support the form API... " >&6; } +# Check whether --enable-form-api was given. +if test ${enable_form_api+y} +then : + enableval=$enable_form_api; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then - want_pthreads=no -fi +printf "%s\n" "#define CURL_DISABLE_FORM_API 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + test "$enable_mime" = no && + as_fn_error $? "MIME support needs to be enabled in order to enable form API support" "$LINENO" 5 + ;; + esac +else $as_nop -if test "$want_pthreads" != "no"; then - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : + if test "$enable_mime" = no; then + enable_form_api=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_FORM_API 1" >>confdefs.h - save_CFLAGS="$CFLAGS" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + fi - ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" -if test "x$ac_cv_func_pthread_create" = xyes; then : - USE_THREADS_POSIX=1 fi - if test "$USE_THREADS_POSIX" != "1" - then - CFLAGS="$CFLAGS -pthread" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support date parsing" >&5 +printf %s "checking whether to support date parsing... " >&6; } +# Check whether --enable-dateparse was given. +if test ${enable_dateparse+y} +then : + enableval=$enable_dateparse; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_PARSEDATE 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); -int main (void) -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes -else - ac_cv_lib_pthread_pthread_create=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : - USE_THREADS_POSIX=1 -else - CFLAGS="$save_CFLAGS" fi - fi - if test "x$USE_THREADS_POSIX" = "x1" - then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support netrc parsing" >&5 +printf %s "checking whether to support netrc parsing... " >&6; } +# Check whether --enable-netrc was given. +if test ${enable_netrc+y} +then : + enableval=$enable_netrc; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define USE_THREADS_POSIX 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_NETRC 1" >>confdefs.h - curl_res_msg="POSIX threaded" - fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support progress-meter" >&5 +printf %s "checking whether to support progress-meter... " >&6; } +# Check whether --enable-progress-meter was given. +if test ${enable_progress_meter+y} +then : + enableval=$enable_progress_meter; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_PROGRESS_METER 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + fi -if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then - if test "$want_pthreads" = "yes"; then - as_fn_error $? "--enable-pthreads but pthreads was not found" "$LINENO" 5 - fi - if test "$curl_cv_native_windows" = "yes"; then - USE_THREADS_WIN32=1 -$as_echo "#define USE_THREADS_WIN32 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support the SHA-512/256 hash algorithm" >&5 +printf %s "checking whether to support the SHA-512/256 hash algorithm... " >&6; } +# Check whether --enable-sha512-256 was given. +if test ${enable_sha512_256+y} +then : + enableval=$enable_sha512_256; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +printf "%s\n" "#define CURL_DISABLE_SHA512_256 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - curl_res_msg="Win32 threaded" - else - as_fn_error $? "Threaded resolver enabled but no thread library found" "$LINENO" 5 - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable verbose strings" >&5 -$as_echo_n "checking whether to enable verbose strings... " >&6; } -# Check whether --enable-verbose was given. -if test "${enable_verbose+set}" = set; then : - enableval=$enable_verbose; case "$enableval" in + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support DNS shuffling" >&5 +printf %s "checking whether to support DNS shuffling... " >&6; } +# Check whether --enable-dnsshuffle was given. +if test ${enable_dnsshuffle+y} +then : + enableval=$enable_dnsshuffle; case "$enableval" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define CURL_DISABLE_VERBOSE_STRINGS 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_SHUFFLE_DNS 1" >>confdefs.h - curl_verbose_msg="no" - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable SSPI support (Windows native builds only)" >&5 -$as_echo_n "checking whether to enable SSPI support (Windows native builds only)... " >&6; } -# Check whether --enable-sspi was given. -if test "${enable_sspi+set}" = set; then : - enableval=$enable_sspi; case "$enableval" in - yes) - if test "$curl_cv_native_windows" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define USE_WINDOWS_SSPI 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support curl_easy_option*" >&5 +printf %s "checking whether to support curl_easy_option*... " >&6; } +# Check whether --enable-get-easy-options was given. +if test ${enable_get_easy_options+y} +then : + enableval=$enable_get_easy_options; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - USE_WINDOWS_SSPI=1 +printf "%s\n" "#define CURL_DISABLE_GETOPTIONS 1" >>confdefs.h - curl_sspi_msg="enabled" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-sspi Ignored. Only supported on native Windows builds." >&5 -$as_echo "$as_me: WARNING: --enable-sspi Ignored. Only supported on native Windows builds." >&2;} - fi - ;; + ;; *) - if test "x$WINSSL_ENABLED" = "x1"; then - # --with-winssl implies --enable-sspi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; esac -else - if test "x$WINSSL_ENABLED" = "x1"; then - # --with-winssl implies --enable-sspi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable cryptographic authentication methods" >&5 -$as_echo_n "checking whether to enable cryptographic authentication methods... " >&6; } -# Check whether --enable-crypto-auth was given. -if test "${enable_crypto_auth+set}" = set; then : - enableval=$enable_crypto_auth; case "$enableval" in +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support alt-svc" >&5 +printf %s "checking whether to support alt-svc... " >&6; } +# Check whether --enable-alt-svc was given. +if test ${enable_alt_svc+y} +then : + enableval=$enable_alt_svc; case "$enableval" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define CURL_DISABLE_CRYPTO_AUTH 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_ALTSVC 1" >>confdefs.h - CURL_DISABLE_CRYPTO_AUTH=1 - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; + curl_altsvc_msg="no"; + enable_altsvc="no" + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support headers-api" >&5 +printf %s "checking whether to support headers-api... " >&6; } +# Check whether --enable-headers-api was given. +if test ${enable_headers_api+y} +then : + enableval=$enable_headers_api; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + curl_headers_msg="no (--enable-headers-api)" + +printf "%s\n" "#define CURL_DISABLE_HEADERS_API 1" >>confdefs.h + + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - OPT_NTLM_WB="default" - # Check whether --enable-ntlm-wb was given. -if test "${enable_ntlm_wb+set}" = set; then : - enableval=$enable_ntlm_wb; OPT_NTLM_WB=$enableval fi - want_ntlm_wb_file="/usr/bin/ntlm_auth" - case "$OPT_NTLM_WB" in + +if test -n "$SSL_ENABLED"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support HSTS" >&5 +printf %s "checking whether to support HSTS... " >&6; } + # Check whether --enable-hsts was given. +if test ${enable_hsts+y} +then : + enableval=$enable_hsts; case "$enableval" in no) - want_ntlm_wb="no" - ;; - default) - want_ntlm_wb="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + hsts="no" ;; *) - want_ntlm_wb="yes" - if test -n "$enableval" && test "$enableval" != "yes"; then - want_ntlm_wb_file="$enableval" - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; - esac + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hsts" >&5 +printf "%s\n" "$hsts" >&6; } +fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: disables HSTS due to lack of SSL" >&5 +printf "%s\n" "$as_me: disables HSTS due to lack of SSL" >&6;} + hsts="no" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable NTLM delegation to winbind's helper" >&5 -$as_echo_n "checking whether to enable NTLM delegation to winbind's helper... " >&6; } - if test "$curl_cv_native_windows" = "yes" || - test "x$SSL_ENABLED" = "x"; then - want_ntlm_wb_file="" - want_ntlm_wb="no" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $want_ntlm_wb" >&5 -$as_echo "$want_ntlm_wb" >&6; } - if test "$want_ntlm_wb" = "yes"; then +if test "x$hsts" != "xyes"; then + curl_hsts_msg="no (--enable-hsts)"; -$as_echo "#define NTLM_WB_ENABLED 1" >>confdefs.h +printf "%s\n" "#define CURL_DISABLE_HSTS 1" >>confdefs.h +fi -cat >>confdefs.h <<_ACEOF -#define NTLM_WB_FILE "$want_ntlm_wb_file" -_ACEOF - NTLM_WB_ENABLED=1 - fi +if test "x$want_ech" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ECH support is available" >&5 +printf %s "checking whether ECH support is available... " >&6; } + ECH_ENABLED=0 + ECH_ENABLED_OPENSSL=0 + ECH_ENABLED_WOLFSSL=0 + ECH_ENABLED_RUSTLS=0 + ECH_SUPPORT='' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable TLS-SRP authentication" >&5 -$as_echo_n "checking whether to enable TLS-SRP authentication... " >&6; } -# Check whether --enable-tls-srp was given. -if test "${enable_tls_srp+set}" = set; then : - enableval=$enable_tls_srp; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "x$OPENSSL_ENABLED" = "x1"; then -$as_echo "#define CURL_DISABLE_TLS_SRP 1" >>confdefs.h + for ac_func in SSL_set1_ech_config_list +do : + ac_fn_c_check_func "$LINENO" "SSL_set1_ech_config_list" "ac_cv_func_SSL_set1_ech_config_list" +if test "x$ac_cv_func_SSL_set1_ech_config_list" = xyes +then : + printf "%s\n" "#define HAVE_SSL_SET1_ECH_CONFIG_LIST 1" >>confdefs.h + ECH_SUPPORT="$ECH_SUPPORT OpenSSL" + ECH_ENABLED_OPENSSL=1 +fi - want_tls_srp=no - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - want_tls_srp=yes - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - want_tls_srp=yes +done + fi + if test "x$WOLFSSL_ENABLED" = "x1"; then + for ac_func in wolfSSL_CTX_GenerateEchConfig +do : + ac_fn_c_check_func "$LINENO" "wolfSSL_CTX_GenerateEchConfig" "ac_cv_func_wolfSSL_CTX_GenerateEchConfig" +if test "x$ac_cv_func_wolfSSL_CTX_GenerateEchConfig" = xyes +then : + printf "%s\n" "#define HAVE_WOLFSSL_CTX_GENERATEECHCONFIG 1" >>confdefs.h + ECH_SUPPORT="$ECH_SUPPORT wolfSSL" + ECH_ENABLED_WOLFSSL=1 fi +done + fi + if test "x$RUSTLS_ENABLED" = "x1"; then + ECH_SUPPORT="$ECH_SUPPORT rustls-ffi" + ECH_ENABLED_RUSTLS=1 + fi -if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then + if test "x$ECH_ENABLED_OPENSSL" = "x1" -o \ + "x$ECH_ENABLED_WOLFSSL" = "x1" -o \ + "x$ECH_ENABLED_RUSTLS" = "x1"; then -$as_echo "#define USE_TLS_SRP 1" >>confdefs.h +printf "%s\n" "#define USE_ECH 1" >>confdefs.h - USE_TLS_SRP=1 - curl_tls_srp_msg="enabled" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ECH support available via:$ECH_SUPPORT" >&5 +printf "%s\n" "ECH support available via:$ECH_SUPPORT" >&6; } + experimental="$experimental ECH" + ECH_ENABLED=1 + want_httpsrr="yes" + else + as_fn_error $? "--enable-ech ignored: No ECH support found" "$LINENO" 5 + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Unix domain sockets" >&5 -$as_echo_n "checking whether to enable Unix domain sockets... " >&6; } -# Check whether --enable-unix-sockets was given. -if test "${enable_unix_sockets+set}" = set; then : - enableval=$enable_unix_sockets; case "$enableval" in - no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - want_unix_sockets=no - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - want_unix_sockets=yes - ;; - esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable HTTPS-RR support" >&5 +printf %s "checking whether to enable HTTPS-RR support... " >&6; } +if test "x$want_httpsrr" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define USE_HTTPSRR 1" >>confdefs.h + + experimental="$experimental HTTPSRR" + curl_httpsrr_msg="enabled (--disable-httpsrr)" else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + # no HTTPSRR wanted + if test "$want_threaded_resolver" = "yes"; then + # and using the threaded resolver + if test "x$USE_ARES" = "x1"; then + as_fn_error $? "without HTTPS-RR support, asking for both threaded resolver and c-ares support is ambivalent. Please drop one of them." "$LINENO" 5 + fi + fi +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto" >&5 -$as_echo "auto" >&6; } - want_unix_sockets=auto +if test "x$OPENSSL_ENABLED" = "x1"; then + ac_fn_c_check_func "$LINENO" "SSL_set0_wbio" "ac_cv_func_SSL_set0_wbio" +if test "x$ac_cv_func_SSL_set0_wbio" = xyes +then : + printf "%s\n" "#define HAVE_SSL_SET0_WBIO 1" >>confdefs.h fi -if test "x$want_unix_sockets" != "xno"; then - ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_path" "ac_cv_member_struct_sockaddr_un_sun_path" " - #include +fi -" -if test "x$ac_cv_member_struct_sockaddr_un_sun_path" = xyes; then : +if test "x$CURL_DISABLE_HTTP" != "x1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support WebSockets" >&5 +printf %s "checking whether to support WebSockets... " >&6; } + # Check whether --enable-websockets was given. +if test ${enable_websockets+y} +then : + enableval=$enable_websockets; case "$enableval" in + no) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "#define CURL_DISABLE_WEBSOCKETS 1" >>confdefs.h -$as_echo "#define USE_UNIX_SOCKETS 1" >>confdefs.h + CURL_DISABLE_WEBSOCKETS=1 + ;; + *) + if test ${ac_cv_sizeof_curl_off_t} -gt 4; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: WebSockets disabled due to lack of >32 bit curl_off_t" >&5 +printf "%s\n" "$as_me: WARNING: WebSockets disabled due to lack of >32 bit curl_off_t" >&2;} - USE_UNIX_SOCKETS=1 +printf "%s\n" "#define CURL_DISABLE_WEBSOCKETS 1" >>confdefs.h - curl_unix_sockets_msg="enabled" + CURL_DISABLE_WEBSOCKETS=1 + fi + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: WebSockets disabled because HTTP is disabled" >&5 +printf "%s\n" "$as_me: WARNING: WebSockets disabled because HTTP is disabled" >&2;} - if test "x$want_unix_sockets" = "xyes"; then - as_fn_error $? "--enable-unix-sockets is not available on this platform!" "$LINENO" 5 - fi +printf "%s\n" "#define CURL_DISABLE_WEBSOCKETS 1" >>confdefs.h + CURL_DISABLE_WEBSOCKETS=1 fi -fi +if test "x$want_ssls_export" != "xno"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether SSL session export support is available" >&5 +printf %s "checking whether SSL session export support is available... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable support for cookies" >&5 -$as_echo_n "checking whether to enable support for cookies... " >&6; } -# Check whether --enable-cookies was given. -if test "${enable_cookies+set}" = set; then : - enableval=$enable_cookies; case "$enableval" in - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + SSLS_EXPORT_ENABLED=0 + SSLS_EXPORT_SUPPORT='' -$as_echo "#define CURL_DISABLE_COOKIES 1" >>confdefs.h + if test "x$SSL_ENABLED" != "x1"; then + as_fn_error $? "--enable-ssls-export ignored: No SSL support" "$LINENO" 5 + else + SSLS_EXPORT_ENABLED=1 - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ;; - esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +printf "%s\n" "#define USE_SSLS_EXPORT 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"SSL session im-/export enabled\"" >&5 +printf "%s\n" "\"SSL session im-/export enabled\"" >&6; } + experimental="$experimental SSLS-EXPORT" + fi fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether hiding of library internal symbols will actually happen" >&5 -$as_echo_n "checking whether hiding of library internal symbols will actually happen... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether hiding of library internal symbols will actually happen" >&5 +printf %s "checking whether hiding of library internal symbols will actually happen... " >&6; } CFLAG_CURL_SYMBOL_HIDING="" doing_symbol_hiding="no" - if test x"$curl_cv_native_windows" != "xyes" && - test "$want_symbol_hiding" = "yes" && + if test "$want_symbol_hiding" = "yes" && test "$supports_symbol_hiding" = "yes"; then doing_symbol_hiding="yes" CFLAG_CURL_SYMBOL_HIDING="$symbol_hiding_CFLAGS" -cat >>confdefs.h <<_ACEOF -#define CURL_EXTERN_SYMBOL $symbol_hiding_EXTERN -_ACEOF +printf "%s\n" "#define CURL_EXTERN_SYMBOL $symbol_hiding_EXTERN" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test x$doing_symbol_hiding = xyes; then DOING_CURL_SYMBOL_HIDING_TRUE= @@ -40654,7 +44992,24 @@ fi -LIBCURL_LIBS=$LIBS +LIBCURL_PC_LDFLAGS_PRIVATE='' +set -- $INITIAL_LDFLAGS +while test -n "$1"; do + case "$1" in + -L* | --library-path=* | -F*) + LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1" + ;; + -framework) + if test -n "$2"; then + LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1 $2" + shift + fi + ;; + esac + shift +done +LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $LDFLAGSPC" +LIBCURL_PC_LIBS_PRIVATE="$LIBS$PTHREAD" @@ -40678,6 +45033,22 @@ ENABLE_SHARED="$enable_shared" ENABLE_STATIC="$enable_static" +squeeze LIBCURL_PC_REQUIRES_PRIVATE +LIBCURL_PC_REQUIRES_PRIVATE=`echo $LIBCURL_PC_REQUIRES_PRIVATE | tr ' ' ','` + + + +if test "x$enable_shared" = "xno"; then + LIBCURL_PC_REQUIRES=$LIBCURL_PC_REQUIRES_PRIVATE + LIBCURL_PC_LIBS=$LIBCURL_PC_LIBS_PRIVATE +else + LIBCURL_PC_REQUIRES= + LIBCURL_PC_LIBS= +fi + + + +rm $compilersh if test "x$OPENSSL_ENABLED" = "x1"; then @@ -40694,10 +45065,19 @@ fi if test "x$HAVE_LIBZ" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES libz" fi +if test "x$HAVE_BROTLI" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES brotli" +fi +if test "x$HAVE_ZSTD" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES zstd" +fi if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \ -o "x$USE_THREADS_WIN32" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" fi +if test "x$USE_ARES" = "x1" -a "$want_threaded_resolver" = "yes" -a "x$want_httpsrr" != "xno"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES asyn-rr" +fi if test "x$IDN_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" fi @@ -40709,30 +45089,44 @@ if test "x$HAVE_GSSAPI" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API" fi -if test "x$curl_psl_msg" = "xyes"; then +if test "x$curl_psl_msg" = "xenabled"; then SUPPORT_FEATURES="$SUPPORT_FEATURES PSL" fi -if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ +if test "x$curl_gsasl_msg" = "xenabled"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES gsasl" +fi + +if test "x$enable_altsvc" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc" +fi +if test "x$hsts" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS" +fi + +if test "x$CURL_DISABLE_NEGOTIATE_AUTH" != "x1" -a \ \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO" fi -if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ +if test "x$CURL_DISABLE_KERBEROS_AUTH" != "x1" -a \ \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos" fi -if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then - if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" +use_curl_ntlm_core=no - if test "x$CURL_DISABLE_HTTP" != "x1" -a \ - "x$NTLM_WB_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" - fi +if test "x$CURL_DISABLE_NTLM" != "x1"; then + if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ + -o "x$GNUTLS_ENABLED" = "x1" \ + -o "x$USE_WIN32_CRYPTO" = "x1" \ + -o "x$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "x1"; then + use_curl_ntlm_core=yes + fi + + if test "x$use_curl_ntlm_core" = "xyes" \ + -o "x$USE_WINDOWS_SSPI" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" fi fi @@ -40744,15 +45138,122 @@ if test "x$USE_NGHTTP2" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2" fi +if test "x$USE_NGTCP2_H3" = "x1" -o "x$USE_QUICHE" = "x1" \ + -o "x$USE_OPENSSL_H3" = "x1" -o "x$USE_MSH3" = "x1"; then + if test "x$CURL_WITH_MULTI_SSL" = "x1"; then + as_fn_error $? "MultiSSL cannot be enabled with HTTP/3 and vice versa" "$LINENO" 5 + fi + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3" +fi + if test "x$CURL_WITH_MULTI_SSL" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL" fi -if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if this build supports HTTPS-proxy" >&5 +printf %s "checking if this build supports HTTPS-proxy... " >&6; } +if test "x$CURL_DISABLE_HTTP" != "x1"; then + if test "x$https_proxy" != "xno"; then + if test "x$OPENSSL_ENABLED" = "x1" \ + -o "x$GNUTLS_ENABLED" = "x1" \ + -o "x$RUSTLS_ENABLED" = "x1" \ + -o "x$SCHANNEL_ENABLED" = "x1" \ + -o "x$GNUTLS_ENABLED" = "x1" \ + -o "x$MBEDTLS_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$HAVE_WOLFSSL_BIO_NEW" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + +if test "x$OPENSSL_ENABLED" = "x1" -o -n "$SSL_ENABLED"; then + if test "x$ECH_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES ECH" + fi +fi + +if test "x$want_httpsrr" != "xno"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPSRR" +fi + +if test "x$SSLS_EXPORT_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES SSLS-EXPORT" +fi + +if test ${ac_cv_sizeof_curl_off_t} -gt 4; then + if test ${ac_cv_sizeof_off_t} -gt 4 -o \ + "$curl_win32_file_api" = "win32_large_files"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile" + fi +fi + +if test "$tst_atomic" = "yes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" +elif test "x$USE_THREADS_POSIX" = "x1" -a \ + "x$ac_cv_header_pthread_h" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + +int main(void) +{ + + #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600) + #error + #endif + + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +if test "x$want_winuni" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Unicode" +fi +if test "x$want_debug" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Debug" +fi +if test "x$want_curldebug" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES TrackMemory" +fi +if test "x$CURL_CA_EMBED" != "x"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES CAcert" + CURL_CA_EMBED_msg="$CURL_CA_EMBED" +else + CURL_CA_EMBED_msg='no' fi +if sort -f /dev/null 2>&1; then + SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort -f | tr '\012' ' '` +else + SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '` +fi if test "x$CURL_DISABLE_HTTP" != "x1"; then @@ -40777,7 +45278,7 @@ if test "x$CURL_DISABLE_LDAP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" if test "x$CURL_DISABLE_LDAPS" != "x1"; then if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") || - (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then + (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" fi fi @@ -40790,6 +45291,12 @@ if test "x$CURL_DISABLE_TFTP" != "x1"; then fi if test "x$CURL_DISABLE_GOPHER" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER" + if test "x$SSL_ENABLED" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS" + fi +fi +if test "x$CURL_DISABLE_MQTT" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT" fi if test "x$CURL_DISABLE_POP3" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3" @@ -40804,10 +45311,7 @@ if test "x$CURL_DISABLE_IMAP" != "x1"; then fi fi if test "x$CURL_DISABLE_SMB" != "x1" \ - -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \ - -a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1" \); then + -a "x$use_curl_ntlm_core" = "xyes"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS" @@ -40823,12 +45327,28 @@ if test "x$USE_LIBSSH2" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" fi +if test "x$USE_LIBSSH" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" +fi +if test "x$USE_WOLFSSH" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" +fi +if test "x$CURL_DISABLE_IPFS" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IPFS IPNS" +fi if test "x$CURL_DISABLE_RTSP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" fi if test "x$USE_LIBRTMP" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" fi +if test "x$CURL_DISABLE_WEBSOCKETS" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS" + if test "x$SSL_ENABLED" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS" + fi +fi SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '` @@ -40841,8 +45361,8 @@ squeeze DEFS squeeze LDFLAGS squeeze LIBS -squeeze LIBCURL_LIBS -squeeze CURL_NETWORK_LIBS +squeeze LIBCURL_PC_LDFLAGS_PRIVATE +squeeze LIBCURL_PC_LIBS_PRIVATE squeeze CURL_NETWORK_AND_TIME_LIBS squeeze SUPPORT_FEATURES @@ -40862,10 +45382,10 @@ squeeze SUPPORT_PROTOCOLS esac done if test $xc_bad_var_libs = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using LIBS: $LIBS" >&5 -$as_echo "$as_me: using LIBS: $LIBS" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: LIBS note: LIBS should only be used to specify libraries (-lname)." >&5 -$as_echo "$as_me: LIBS note: LIBS should only be used to specify libraries (-lname)." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using LIBS: $LIBS" >&5 +printf "%s\n" "$as_me: using LIBS: $LIBS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: LIBS note: LIBS should only be used to specify libraries (-lname)." >&5 +printf "%s\n" "$as_me: LIBS note: LIBS should only be used to specify libraries (-lname)." >&6;} fi @@ -40887,26 +45407,26 @@ $as_echo "$as_me: LIBS note: LIBS should only be used to specify libraries (-lna esac done if test $xc_bad_var_ldflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS: $LDFLAGS" >&5 -$as_echo "$as_me: using LDFLAGS: $LDFLAGS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using LDFLAGS: $LDFLAGS" >&5 +printf "%s\n" "$as_me: using LDFLAGS: $LDFLAGS" >&6;} xc_bad_var_msg="LDFLAGS note: LDFLAGS should only be used to specify linker flags, not" for xc_word in $LDFLAGS; do case "$xc_word" in -D*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done @@ -40928,22 +45448,22 @@ $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} esac done if test $xc_bad_var_cppflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS: $CPPFLAGS" >&5 -$as_echo "$as_me: using CPPFLAGS: $CPPFLAGS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using CPPFLAGS: $CPPFLAGS" >&5 +printf "%s\n" "$as_me: using CPPFLAGS: $CPPFLAGS" >&6;} xc_bad_var_msg="CPPFLAGS note: CPPFLAGS should only be used to specify C preprocessor flags, not" for xc_word in $CPPFLAGS; do case "$xc_word" in -rpath*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done @@ -40974,34 +45494,34 @@ $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} esac done if test $xc_bad_var_cflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS: $CFLAGS" >&5 -$as_echo "$as_me: using CFLAGS: $CFLAGS" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: using CFLAGS: $CFLAGS" >&5 +printf "%s\n" "$as_me: using CFLAGS: $CFLAGS" >&6;} xc_bad_var_msg="CFLAGS note: CFLAGS should only be used to specify C compiler flags, not" for xc_word in $CFLAGS; do case "$xc_word" in -D*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word" >&6;} ;; -U*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word" >&6;} ;; -I*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word" >&6;} ;; -rpath*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word" >&6;} ;; -L* | --library-path=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word" >&6;} ;; -l* | --library=*) - { $as_echo "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 -$as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&5 +printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} ;; esac done @@ -41011,17 +45531,29 @@ $as_echo "$as_me: $xc_bad_var_msg libraries. Use LIBS for: $xc_word" >&6;} test $xc_bad_var_cflags = yes || test $xc_bad_var_ldflags = yes || test $xc_bad_var_cppflags = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Continuing even with errors mentioned immediately above this line." >&5 -$as_echo "$as_me: WARNING: Continuing even with errors mentioned immediately above this line." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Continuing even with errors mentioned immediately above this line." >&5 +printf "%s\n" "$as_me: WARNING: Continuing even with errors mentioned immediately above this line." >&2;} fi +SSL_BACKENDS=${ssl_backends} + + if test "x$want_curldebug_assumed" = "xyes" && test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then ac_configure_args="$ac_configure_args --enable-curldebug" fi -ac_config_files="$ac_config_files Makefile docs/Makefile docs/examples/Makefile docs/libcurl/Makefile docs/libcurl/opts/Makefile docs/cmdline-opts/Makefile include/Makefile include/curl/Makefile src/Makefile lib/Makefile scripts/Makefile lib/libcurl.vers tests/Makefile tests/certs/Makefile tests/certs/scripts/Makefile tests/data/Makefile tests/server/Makefile tests/libtest/Makefile tests/unit/Makefile packages/Makefile packages/Win32/Makefile packages/Win32/cygwin/Makefile packages/Linux/Makefile packages/Linux/RPM/Makefile packages/Linux/RPM/curl.spec packages/Linux/RPM/curl-ssl.spec packages/Solaris/Makefile packages/EPM/curl.list packages/EPM/Makefile packages/vms/Makefile packages/AIX/Makefile packages/AIX/RPM/Makefile packages/AIX/RPM/curl.spec curl-config libcurl.pc" + + tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null` + if test -z "$tmp_cpp"; then + tmp_cpp='cpp' + fi + CURL_CPP=$tmp_cpp + + + +ac_config_files="$ac_config_files Makefile docs/Makefile docs/examples/Makefile docs/libcurl/Makefile docs/libcurl/opts/Makefile docs/cmdline-opts/Makefile include/Makefile include/curl/Makefile src/Makefile lib/Makefile scripts/Makefile lib/libcurl.vers tests/Makefile tests/config tests/configurehelp.pm tests/certs/Makefile tests/data/Makefile tests/server/Makefile tests/libtest/Makefile tests/unit/Makefile tests/tunit/Makefile tests/client/Makefile tests/http/config.ini tests/http/Makefile packages/Makefile packages/vms/Makefile curl-config libcurl.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -41050,8 +45582,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -41081,15 +45613,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -41103,8 +45635,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -41121,7 +45653,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -41136,18 +45668,22 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then - as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. +if test -z "${DEBUGBUILD_TRUE}" && test -z "${DEBUGBUILD_FALSE}"; then + as_fn_error $? "conditional \"DEBUGBUILD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CURLDEBUG_TRUE}" && test -z "${CURLDEBUG_FALSE}"; then + as_fn_error $? "conditional \"CURLDEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -41164,6 +45700,10 @@ else am__EXEEXT_FALSE= fi +if test -z "${NOT_CURL_CI_TRUE}" && test -z "${NOT_CURL_CI_FALSE}"; then + as_fn_error $? "conditional \"NOT_CURL_CI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${CURL_LT_SHLIB_USE_VERSION_INFO_TRUE}" && test -z "${CURL_LT_SHLIB_USE_VERSION_INFO_FALSE}"; then as_fn_error $? "conditional \"CURL_LT_SHLIB_USE_VERSION_INFO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -41180,18 +45720,26 @@ if test -z "${USE_CPPFLAG_CURL_STATICLIB_TRUE}" && test -z "${USE_CPPFLAG_CURL_S as_fn_error $? "conditional \"USE_CPPFLAG_CURL_STATICLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_EXPLICIT_LIB_DEPS_TRUE}" && test -z "${USE_EXPLICIT_LIB_DEPS_FALSE}"; then - as_fn_error $? "conditional \"USE_EXPLICIT_LIB_DEPS\" was never defined. +if test -z "${DOING_NATIVE_WINDOWS_TRUE}" && test -z "${DOING_NATIVE_WINDOWS_FALSE}"; then + as_fn_error $? "conditional \"DOING_NATIVE_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${CURLDEBUG_TRUE}" && test -z "${CURLDEBUG_FALSE}"; then - as_fn_error $? "conditional \"CURLDEBUG\" was never defined. +if test -z "${CURL_WERROR_TRUE}" && test -z "${CURL_WERROR_FALSE}"; then + as_fn_error $? "conditional \"CURL_WERROR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_UNITTESTS_TRUE}" && test -z "${BUILD_UNITTESTS_FALSE}"; then as_fn_error $? "conditional \"BUILD_UNITTESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_WINDRES_TRUE}" && test -z "${HAVE_WINDRES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_WINDRES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_UNITY_TRUE}" && test -z "${USE_UNITY_FALSE}"; then + as_fn_error $? "conditional \"USE_UNITY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${DOING_NATIVE_WINDOWS_TRUE}" && test -z "${DOING_NATIVE_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"DOING_NATIVE_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -41204,24 +45752,44 @@ if test -z "${BUILD_STUB_GSS_TRUE}" && test -z "${BUILD_STUB_GSS_FALSE}"; then as_fn_error $? "conditional \"BUILD_STUB_GSS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${CURL_CA_EMBED_SET_TRUE}" && test -z "${CURL_CA_EMBED_SET_FALSE}"; then + as_fn_error $? "conditional \"CURL_CA_EMBED_SET\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${USE_LIBPSL_TRUE}" && test -z "${USE_LIBPSL_FALSE}"; then as_fn_error $? "conditional \"USE_LIBPSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${USE_GSASL_TRUE}" && test -z "${USE_GSASL_FALSE}"; then + as_fn_error $? "conditional \"USE_GSASL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_TRUE}" && test -z "${CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS_FALSE}"; then as_fn_error $? "conditional \"CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_MANUAL_TRUE}" && test -z "${USE_MANUAL_FALSE}"; then - as_fn_error $? "conditional \"USE_MANUAL\" was never defined. +if test -z "${USE_UNICODE_TRUE}" && test -z "${USE_UNICODE_FALSE}"; then + as_fn_error $? "conditional \"USE_UNICODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_EMBEDDED_ARES_TRUE}" && test -z "${USE_EMBEDDED_ARES_FALSE}"; then - as_fn_error $? "conditional \"USE_EMBEDDED_ARES\" was never defined. +if test -z "${USE_ZSH_COMPLETION_TRUE}" && test -z "${USE_ZSH_COMPLETION_FALSE}"; then + as_fn_error $? "conditional \"USE_ZSH_COMPLETION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${BUILD_LIBHOSTNAME_TRUE}" && test -z "${BUILD_LIBHOSTNAME_FALSE}"; then - as_fn_error $? "conditional \"BUILD_LIBHOSTNAME\" was never defined. +if test -z "${USE_FISH_COMPLETION_TRUE}" && test -z "${USE_FISH_COMPLETION_FALSE}"; then + as_fn_error $? "conditional \"USE_FISH_COMPLETION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DOING_NATIVE_WINDOWS_TRUE}" && test -z "${DOING_NATIVE_WINDOWS_FALSE}"; then + as_fn_error $? "conditional \"DOING_NATIVE_WINDOWS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_DOCS_TRUE}" && test -z "${BUILD_DOCS_FALSE}"; then + as_fn_error $? "conditional \"BUILD_DOCS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_MANUAL_TRUE}" && test -z "${USE_MANUAL_FALSE}"; then + as_fn_error $? "conditional \"USE_MANUAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DOING_CURL_SYMBOL_HIDING_TRUE}" && test -z "${DOING_CURL_SYMBOL_HIDING_FALSE}"; then @@ -41237,8 +45805,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -41261,14 +45829,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -41278,53 +45848,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) IFS=" "" $as_nl" +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + + + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -41333,8 +45896,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -41346,30 +45913,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -41382,13 +45929,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -41415,18 +45963,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -41438,12 +45988,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -41474,7 +46025,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -41496,6 +46047,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -41509,6 +46064,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -41550,7 +46111,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -41559,7 +46120,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -41622,7 +46183,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by curl $as_me -, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -41681,17 +46242,19 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ curl config.status - -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -41731,15 +46294,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -41747,7 +46310,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -41756,7 +46319,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -41784,7 +46347,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -41798,7 +46361,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -41806,7 +46369,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -41853,12 +46416,14 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -41952,6 +46517,48 @@ enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_sub enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +LD_RC='`$ECHO "$LD_RC" | $SED "$delay_single_quote_subst"`' +reload_flag_RC='`$ECHO "$reload_flag_RC" | $SED "$delay_single_quote_subst"`' +reload_cmds_RC='`$ECHO "$reload_cmds_RC" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_RC='`$ECHO "$old_archive_cmds_RC" | $SED "$delay_single_quote_subst"`' +compiler_RC='`$ECHO "$compiler_RC" | $SED "$delay_single_quote_subst"`' +GCC_RC='`$ECHO "$GCC_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_RC='`$ECHO "$lt_prog_compiler_no_builtin_flag_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_RC='`$ECHO "$lt_prog_compiler_pic_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_RC='`$ECHO "$lt_prog_compiler_wl_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_RC='`$ECHO "$lt_prog_compiler_static_RC" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_RC='`$ECHO "$lt_cv_prog_compiler_c_o_RC" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_RC='`$ECHO "$archive_cmds_need_lc_RC" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_RC='`$ECHO "$enable_shared_with_static_runtimes_RC" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_RC='`$ECHO "$export_dynamic_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_RC='`$ECHO "$whole_archive_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_RC='`$ECHO "$compiler_needs_object_RC" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_RC='`$ECHO "$old_archive_from_new_cmds_RC" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_RC='`$ECHO "$old_archive_from_expsyms_cmds_RC" | $SED "$delay_single_quote_subst"`' +archive_cmds_RC='`$ECHO "$archive_cmds_RC" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_RC='`$ECHO "$archive_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' +module_cmds_RC='`$ECHO "$module_cmds_RC" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_RC='`$ECHO "$module_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_RC='`$ECHO "$with_gnu_ld_RC" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_RC='`$ECHO "$allow_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_RC='`$ECHO "$no_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_RC='`$ECHO "$hardcode_libdir_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_RC='`$ECHO "$hardcode_libdir_separator_RC" | $SED "$delay_single_quote_subst"`' +hardcode_direct_RC='`$ECHO "$hardcode_direct_RC" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_RC='`$ECHO "$hardcode_direct_absolute_RC" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_RC='`$ECHO "$hardcode_minus_L_RC" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_RC='`$ECHO "$hardcode_shlibpath_var_RC" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_RC='`$ECHO "$hardcode_automatic_RC" | $SED "$delay_single_quote_subst"`' +inherit_rpath_RC='`$ECHO "$inherit_rpath_RC" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_RC='`$ECHO "$link_all_deplibs_RC" | $SED "$delay_single_quote_subst"`' +always_export_symbols_RC='`$ECHO "$always_export_symbols_RC" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_RC='`$ECHO "$export_symbols_cmds_RC" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_RC='`$ECHO "$exclude_expsyms_RC" | $SED "$delay_single_quote_subst"`' +include_expsyms_RC='`$ECHO "$include_expsyms_RC" | $SED "$delay_single_quote_subst"`' +prelink_cmds_RC='`$ECHO "$prelink_cmds_RC" | $SED "$delay_single_quote_subst"`' +postlink_cmds_RC='`$ECHO "$postlink_cmds_RC" | $SED "$delay_single_quote_subst"`' +file_list_spec_RC='`$ECHO "$file_list_spec_RC" | $SED "$delay_single_quote_subst"`' +hardcode_action_RC='`$ECHO "$hardcode_action_RC" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' @@ -41982,13 +46589,13 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -42034,7 +46641,26 @@ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ -striplib; do +striplib \ +LD_RC \ +reload_flag_RC \ +compiler_RC \ +lt_prog_compiler_no_builtin_flag_RC \ +lt_prog_compiler_pic_RC \ +lt_prog_compiler_wl_RC \ +lt_prog_compiler_static_RC \ +lt_cv_prog_compiler_c_o_RC \ +export_dynamic_flag_spec_RC \ +whole_archive_flag_spec_RC \ +compiler_needs_object_RC \ +with_gnu_ld_RC \ +allow_undefined_flag_RC \ +no_undefined_flag_RC \ +hardcode_libdir_flag_spec_RC \ +hardcode_libdir_separator_RC \ +exclude_expsyms_RC \ +include_expsyms_RC \ +file_list_spec_RC; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes @@ -42065,7 +46691,18 @@ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ -configure_time_lt_sys_library_path; do +configure_time_lt_sys_library_path \ +reload_cmds_RC \ +old_archive_cmds_RC \ +old_archive_from_new_cmds_RC \ +old_archive_from_expsyms_cmds_RC \ +archive_cmds_RC \ +archive_expsym_cmds_RC \ +module_cmds_RC \ +module_expsym_cmds_RC \ +export_symbols_cmds_RC \ +prelink_cmds_RC \ +postlink_cmds_RC; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes @@ -42093,6 +46730,8 @@ fi + + _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -42117,26 +46756,19 @@ do "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "lib/libcurl.vers") CONFIG_FILES="$CONFIG_FILES lib/libcurl.vers" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/config") CONFIG_FILES="$CONFIG_FILES tests/config" ;; + "tests/configurehelp.pm") CONFIG_FILES="$CONFIG_FILES tests/configurehelp.pm" ;; "tests/certs/Makefile") CONFIG_FILES="$CONFIG_FILES tests/certs/Makefile" ;; - "tests/certs/scripts/Makefile") CONFIG_FILES="$CONFIG_FILES tests/certs/scripts/Makefile" ;; "tests/data/Makefile") CONFIG_FILES="$CONFIG_FILES tests/data/Makefile" ;; "tests/server/Makefile") CONFIG_FILES="$CONFIG_FILES tests/server/Makefile" ;; "tests/libtest/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libtest/Makefile" ;; "tests/unit/Makefile") CONFIG_FILES="$CONFIG_FILES tests/unit/Makefile" ;; + "tests/tunit/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tunit/Makefile" ;; + "tests/client/Makefile") CONFIG_FILES="$CONFIG_FILES tests/client/Makefile" ;; + "tests/http/config.ini") CONFIG_FILES="$CONFIG_FILES tests/http/config.ini" ;; + "tests/http/Makefile") CONFIG_FILES="$CONFIG_FILES tests/http/Makefile" ;; "packages/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Makefile" ;; - "packages/Win32/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Win32/Makefile" ;; - "packages/Win32/cygwin/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Win32/cygwin/Makefile" ;; - "packages/Linux/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Linux/Makefile" ;; - "packages/Linux/RPM/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/Makefile" ;; - "packages/Linux/RPM/curl.spec") CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/curl.spec" ;; - "packages/Linux/RPM/curl-ssl.spec") CONFIG_FILES="$CONFIG_FILES packages/Linux/RPM/curl-ssl.spec" ;; - "packages/Solaris/Makefile") CONFIG_FILES="$CONFIG_FILES packages/Solaris/Makefile" ;; - "packages/EPM/curl.list") CONFIG_FILES="$CONFIG_FILES packages/EPM/curl.list" ;; - "packages/EPM/Makefile") CONFIG_FILES="$CONFIG_FILES packages/EPM/Makefile" ;; "packages/vms/Makefile") CONFIG_FILES="$CONFIG_FILES packages/vms/Makefile" ;; - "packages/AIX/Makefile") CONFIG_FILES="$CONFIG_FILES packages/AIX/Makefile" ;; - "packages/AIX/RPM/Makefile") CONFIG_FILES="$CONFIG_FILES packages/AIX/RPM/Makefile" ;; - "packages/AIX/RPM/curl.spec") CONFIG_FILES="$CONFIG_FILES packages/AIX/RPM/curl.spec" ;; "curl-config") CONFIG_FILES="$CONFIG_FILES curl-config" ;; "libcurl.pc") CONFIG_FILES="$CONFIG_FILES libcurl.pc" ;; @@ -42150,9 +46782,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -42488,7 +47120,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -42496,17 +47128,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -42523,7 +47155,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -42547,9 +47179,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -42611,8 +47243,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -42656,9 +47288,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -42674,20 +47306,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -42707,7 +47339,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -42727,8 +47359,8 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -42738,29 +47370,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -42778,53 +47416,50 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; "libtool":C) @@ -42871,7 +47506,7 @@ $as_echo X"$file" | # The names of the tagged configurations supported by this script. -available_tags='' +available_tags='RC ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} @@ -42970,6 +47605,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -42988,8 +47626,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -43357,6 +47998,7 @@ _LT_EOF esac + ltmain=$ac_aux_dir/ltmain.sh @@ -43364,396 +48006,383 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -# -# CONFIG_SUBDIRS section. -# -if test "$no_recursion" != yes; then + cat <<_LT_EOF >> "$ofile" - # Remove --cache-file, --srcdir, and --disable-option-checking arguments - # so they do not pile up. - ac_sub_configure_args= - ac_prev= - eval "set x $ac_configure_args" - shift - for ac_arg - do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case $ac_arg in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ - | --c=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - --disable-option-checking) - ;; - *) - case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_sub_configure_args " '$ac_arg'" ;; - esac - done +# ### BEGIN LIBTOOL TAG CONFIG: RC - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - ac_arg="--prefix=$prefix" - case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" +# The linker used to build libraries. +LD=$lt_LD_RC - # Pass --silent - if test "$silent" = yes; then - ac_sub_configure_args="--silent $ac_sub_configure_args" - fi +# How to create reloadable object files. +reload_flag=$lt_reload_flag_RC +reload_cmds=$lt_reload_cmds_RC - # Always prepend --disable-option-checking to silence warnings, since - # different subdirs can have different --enable and --with options. - ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_RC - ac_popdir=`pwd` - for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue +# A language specific compiler. +CC=$lt_compiler_RC - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$ac_dir" || continue +# Is the compiler the GNU compiler? +with_gcc=$GCC_RC - ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 - $as_echo "$ac_msg" >&6 - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC - cd "$ac_dir" +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - # Check for guested configure; otherwise get Cygnus style configure. - if test -f "$ac_srcdir/configure.gnu"; then - ac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 -$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - # Make the cache file name correct relative to the subdirectory. - case $cache_file in - [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; - *) # Relative name. - ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; - esac +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC - { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} - # The eval makes quoting arguments work. - eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ - --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || - as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 - fi +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - cd "$ac_popdir" - done -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_RC - tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null` - if test -z "$tmp_cpp"; then - tmp_cpp='cpp' - fi - cat >./tests/configurehelp.pm <<_EOF -# This is a generated file. Do not edit. +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC -package configurehelp; +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC -use strict; -use warnings; -use Exporter; +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC -use vars qw( - @ISA - @EXPORT_OK - \$Cpreprocessor - ); +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC -@ISA = qw(Exporter); +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_RC -@EXPORT_OK = qw( - \$Cpreprocessor - ); +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC -\$Cpreprocessor = '$tmp_cpp'; +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC -1; -_EOF +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_RC -## ---------------------------------- ## -## Start of distclean amending code ## -## ---------------------------------- ## +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_RC -for xc_subdir in lib src tests/unit tests/server tests/libtest docs/examples -do +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC -if test ! -f "$xc_subdir/Makefile"; then - echo "$xc_msg_err $xc_subdir/Makefile file not found. $xc_msg_abrt" >&2 - exit 1 -fi +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC -# Fetch dependency tracking file list from Makefile include lines. +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_RC -xc_inc_lines=`grep '^include .*(DEPDIR)' "$xc_subdir/Makefile" 2>/dev/null` -xc_cnt_words=`echo "$xc_inc_lines" | wc -w | tr -d "$xc_space$xc_tab"` +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_RC -# --disable-dependency-tracking might have been used, consequently -# there is nothing to amend without a dependency tracking file list. +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC -if test $xc_cnt_words -gt 0; then +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_RC -{ $as_echo "$as_me:${as_lineno-$LINENO}: amending $xc_subdir/Makefile" >&5 -$as_echo "$as_me: amending $xc_subdir/Makefile" >&6;} +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC -# Build Makefile specific patch hunk. +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC -xc_p="$xc_subdir/xc_patch.tmp" +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC -xc_rm_depfiles=`echo "$xc_inc_lines" \ - | $SED 's%include% -rm -f%' 2>/dev/null` +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_RC -xc_dep_subdirs=`echo "$xc_inc_lines" \ - | $SED 's%include[ ][ ]*%%' 2>/dev/null \ - | $SED 's%(DEPDIR)/.*%(DEPDIR)%' 2>/dev/null \ - | sort | uniq` +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_RC -echo "$xc_rm_depfiles" >$xc_p +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_RC -for xc_dep_dir in $xc_dep_subdirs; do - echo "${xc_tab}@xm_dep_cnt=\`ls $xc_dep_dir | wc -l 2>/dev/null\`; \\" >>$xc_p - echo "${xc_tab}if test \$\$xm_dep_cnt -eq 0 && test -d $xc_dep_dir; then \\" >>$xc_p - echo "${xc_tab} rm -rf $xc_dep_dir; \\" >>$xc_p - echo "${xc_tab}fi" >>$xc_p -done +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC -# Build Makefile patching sed scripts. +# ### END LIBTOOL TAG CONFIG: RC +_LT_EOF -xc_s1="$xc_subdir/xc_script_1.tmp" -xc_s2="$xc_subdir/xc_script_2.tmp" -xc_s3="$xc_subdir/xc_script_3.tmp" + ;; -cat >$xc_s1 <<\_EOT -/^distclean[ ]*:/,/^[^ ][^ ]*:/{ - s/^.*(DEPDIR)/___xc_depdir_line___/ -} -/^maintainer-clean[ ]*:/,/^[^ ][^ ]*:/{ - s/^.*(DEPDIR)/___xc_depdir_line___/ -} -_EOT + esac +done # for ac_tag -cat >$xc_s2 <<\_EOT -/___xc_depdir_line___$/{ - N - /___xc_depdir_line___$/D -} -_EOT -cat >$xc_s3 <<_EOT -/^___xc_depdir_line___/{ - r $xc_p - d -} -_EOT +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save -# Apply patch to Makefile and cleanup. +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 -$SED -f "$xc_s1" "$xc_subdir/Makefile" >"$xc_subdir/Makefile.tmp1" -$SED -f "$xc_s2" "$xc_subdir/Makefile.tmp1" >"$xc_subdir/Makefile.tmp2" -$SED -f "$xc_s3" "$xc_subdir/Makefile.tmp2" >"$xc_subdir/Makefile.tmp3" -if test -f "$xc_subdir/Makefile.tmp3"; then - mv -f "$xc_subdir/Makefile.tmp3" "$xc_subdir/Makefile" +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 fi - -test -f "$xc_subdir/Makefile.tmp1" && rm -f "$xc_subdir/Makefile.tmp1" -test -f "$xc_subdir/Makefile.tmp2" && rm -f "$xc_subdir/Makefile.tmp2" -test -f "$xc_subdir/Makefile.tmp3" && rm -f "$xc_subdir/Makefile.tmp3" - -test -f "$xc_p" && rm -f "$xc_p" -test -f "$xc_s1" && rm -f "$xc_s1" -test -f "$xc_s2" && rm -f "$xc_s2" -test -f "$xc_s3" && rm -f "$xc_s3" - +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -done - -## -------------------------------- ## -## End of distclean amending code ## -## -------------------------------- ## +SUPPORT_PROTOCOLS_LOWER=`echo "$SUPPORT_PROTOCOLS" | tr A-Z a-z` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Configured to build curl/libcurl: -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configured to build curl/libcurl: - - curl version: ${CURLVERSION} Host setup: ${host} Install prefix: ${prefix} Compiler: ${CC} - SSL support: ${curl_ssl_msg} - SSH support: ${curl_ssh_msg} - zlib support: ${curl_zlib_msg} - GSS-API support: ${curl_gss_msg} - TLS-SRP support: ${curl_tls_srp_msg} + CFLAGS: ${CFLAGS} + CFLAGS extras: ${CURL_CFLAG_EXTRAS} + CPPFLAGS: ${CPPFLAGS} + LDFLAGS: ${LDFLAGS} + curl-config: ${LIBCURL_PC_LDFLAGS_PRIVATE} + LIBS: ${LIBS} + + curl version: ${CURLVERSION} + SSL: ${curl_ssl_msg} + SSH: ${curl_ssh_msg} + zlib: ${curl_zlib_msg} + brotli: ${curl_brotli_msg} + zstd: ${curl_zstd_msg} + GSS-API: ${curl_gss_msg} + GSASL: ${curl_gsasl_msg} + TLS-SRP: ${curl_tls_srp_msg} resolver: ${curl_res_msg} - IPv6 support: ${curl_ipv6_msg} - Unix sockets support: ${curl_unix_sockets_msg} - IDN support: ${curl_idn_msg} + IPv6: ${curl_ipv6_msg} + Unix sockets: ${curl_unix_sockets_msg} + IDN: ${curl_idn_msg} + Build docs: ${curl_docs_msg} Build libcurl: Shared=${enable_shared}, Static=${enable_static} Built-in manual: ${curl_manual_msg} --libcurl option: ${curl_libcurl_msg} Verbose errors: ${curl_verbose_msg} - SSPI support: ${curl_sspi_msg} + Code coverage: ${curl_coverage_msg} + SSPI: ${curl_sspi_msg} ca cert bundle: ${ca}${ca_warning} ca cert path: ${capath}${capath_warning} + ca cert embed: ${CURL_CA_EMBED_msg} ca fallback: ${with_ca_fallback} - LDAP support: ${curl_ldap_msg} - LDAPS support: ${curl_ldaps_msg} - RTSP support: ${curl_rtsp_msg} - RTMP support: ${curl_rtmp_msg} - metalink support: ${curl_mtlnk_msg} - PSL support: ${curl_psl_msg} - HTTP2 support: ${curl_h2_msg} - Protocols: ${SUPPORT_PROTOCOLS} + LDAP: ${curl_ldap_msg} + LDAPS: ${curl_ldaps_msg} + IPFS/IPNS: ${curl_ipfs_msg} + RTSP: ${curl_rtsp_msg} + RTMP: ${curl_rtmp_msg} + PSL: ${curl_psl_msg} + Alt-svc: ${curl_altsvc_msg} + Headers API: ${curl_headers_msg} + HSTS: ${curl_hsts_msg} + HTTP1: ${curl_h1_msg} + HTTP2: ${curl_h2_msg} + HTTP3: ${curl_h3_msg} + ECH: ${curl_ech_msg} + HTTPS RR: ${curl_httpsrr_msg} + SSLS-EXPORT: ${curl_ssls_export_msg} + Protocols: ${SUPPORT_PROTOCOLS_LOWER} + Features: ${SUPPORT_FEATURES} " >&5 -$as_echo "$as_me: Configured to build curl/libcurl: +printf "%s\n" "$as_me: Configured to build curl/libcurl: - curl version: ${CURLVERSION} Host setup: ${host} Install prefix: ${prefix} Compiler: ${CC} - SSL support: ${curl_ssl_msg} - SSH support: ${curl_ssh_msg} - zlib support: ${curl_zlib_msg} - GSS-API support: ${curl_gss_msg} - TLS-SRP support: ${curl_tls_srp_msg} + CFLAGS: ${CFLAGS} + CFLAGS extras: ${CURL_CFLAG_EXTRAS} + CPPFLAGS: ${CPPFLAGS} + LDFLAGS: ${LDFLAGS} + curl-config: ${LIBCURL_PC_LDFLAGS_PRIVATE} + LIBS: ${LIBS} + + curl version: ${CURLVERSION} + SSL: ${curl_ssl_msg} + SSH: ${curl_ssh_msg} + zlib: ${curl_zlib_msg} + brotli: ${curl_brotli_msg} + zstd: ${curl_zstd_msg} + GSS-API: ${curl_gss_msg} + GSASL: ${curl_gsasl_msg} + TLS-SRP: ${curl_tls_srp_msg} resolver: ${curl_res_msg} - IPv6 support: ${curl_ipv6_msg} - Unix sockets support: ${curl_unix_sockets_msg} - IDN support: ${curl_idn_msg} + IPv6: ${curl_ipv6_msg} + Unix sockets: ${curl_unix_sockets_msg} + IDN: ${curl_idn_msg} + Build docs: ${curl_docs_msg} Build libcurl: Shared=${enable_shared}, Static=${enable_static} Built-in manual: ${curl_manual_msg} --libcurl option: ${curl_libcurl_msg} Verbose errors: ${curl_verbose_msg} - SSPI support: ${curl_sspi_msg} + Code coverage: ${curl_coverage_msg} + SSPI: ${curl_sspi_msg} ca cert bundle: ${ca}${ca_warning} ca cert path: ${capath}${capath_warning} + ca cert embed: ${CURL_CA_EMBED_msg} ca fallback: ${with_ca_fallback} - LDAP support: ${curl_ldap_msg} - LDAPS support: ${curl_ldaps_msg} - RTSP support: ${curl_rtsp_msg} - RTMP support: ${curl_rtmp_msg} - metalink support: ${curl_mtlnk_msg} - PSL support: ${curl_psl_msg} - HTTP2 support: ${curl_h2_msg} - Protocols: ${SUPPORT_PROTOCOLS} + LDAP: ${curl_ldap_msg} + LDAPS: ${curl_ldaps_msg} + IPFS/IPNS: ${curl_ipfs_msg} + RTSP: ${curl_rtsp_msg} + RTMP: ${curl_rtmp_msg} + PSL: ${curl_psl_msg} + Alt-svc: ${curl_altsvc_msg} + Headers API: ${curl_headers_msg} + HSTS: ${curl_hsts_msg} + HTTP1: ${curl_h1_msg} + HTTP2: ${curl_h2_msg} + HTTP3: ${curl_h3_msg} + ECH: ${curl_ech_msg} + HTTPS RR: ${curl_httpsrr_msg} + SSLS-EXPORT: ${curl_ssls_export_msg} + Protocols: ${SUPPORT_PROTOCOLS_LOWER} + Features: ${SUPPORT_FEATURES} " >&6;} + +if test -n "$experimental"; then + for a in $experimental; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $a is enabled but marked EXPERIMENTAL. Use with caution!" >&5 +printf "%s\n" "$as_me: WARNING: $a is enabled but marked EXPERIMENTAL. Use with caution!" >&2;} + done +fi + + + curl_pflags="" + if test "$curl_cv_apple" = 'yes'; then + curl_pflags="${curl_pflags} APPLE" + fi + case $host in + *-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*) + curl_pflags="${curl_pflags} UNIX";; + esac + case $host in + *-*-*bsd*) + curl_pflags="${curl_pflags} BSD";; + esac + case $host in + *-*-android*) + curl_pflags="${curl_pflags} ANDROID" + ANDROID_PLATFORM_LEVEL=`echo "$host_os" | $SED -ne 's/.*android\([0-9]*\).*/\1/p'` + if test -n "${ANDROID_PLATFORM_LEVEL}"; then + curl_pflags="${curl_pflags}-${ANDROID_PLATFORM_LEVEL}" + fi + ;; + esac + if test "$curl_cv_native_windows" = 'yes'; then + curl_pflags="${curl_pflags} WIN32" + fi + if test "$curl_cv_wince" = 'yes'; then + curl_pflags="${curl_pflags} WINCE" + fi + if test "$curl_cv_winuwp" = 'yes'; then + curl_pflags="${curl_pflags} UWP" + fi + case $host in + *-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*) + curl_pflags="${curl_pflags} UNIX";; + esac + case $host in + *-*-*bsd*) + curl_pflags="${curl_pflags} BSD";; + esac + if test "$curl_cv_cygwin" = 'yes'; then + curl_pflags="${curl_pflags} CYGWIN" + fi + case $host_os in + msdos*) curl_pflags="${curl_pflags} DOS";; + amiga*) curl_pflags="${curl_pflags} AMIGA";; + esac + if test "x$compiler_id" = 'xGNU_C'; then + curl_pflags="${curl_pflags} GCC" + fi + case $host_os in + mingw*) curl_pflags="${curl_pflags} MINGW";; + esac + if test "x$cross_compiling" = 'xyes'; then + curl_pflags="${curl_pflags} CROSS" + fi + squeeze curl_pflags + curl_buildinfo=" +buildinfo.configure.tool: configure +buildinfo.configure.args: $ac_configure_args +buildinfo.host: $build +buildinfo.host.cpu: $build_cpu +buildinfo.host.os: $build_os +buildinfo.target: $host +buildinfo.target.cpu: $host_cpu +buildinfo.target.os: $host_os +buildinfo.target.flags: $curl_pflags +buildinfo.compiler: $compiler_id +buildinfo.compiler.version: $compiler_ver +buildinfo.sysroot: $lt_sysroot" + +echo "# This is a generated file. Do not edit.${curl_buildinfo}" > ./buildinfo.txt +if test -n "$CURL_BUILDINFO$CURL_CI$CI"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${curl_buildinfo}" >&5 +printf "%s\n" "$as_me: ${curl_buildinfo}" >&6;} +fi + diff --git a/curl/configure.ac b/curl/configure.ac index 68b3a071a..bce4bf69e 100644 --- a/curl/configure.ac +++ b/curl/configure.ac @@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -18,40 +18,47 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # +# SPDX-License-Identifier: curl +# #*************************************************************************** dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.57) +AC_PREREQ(2.59) dnl We don't know the version number "statically" so we use a dash here -AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.haxx.se/mail/]) +AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/]) XC_OVR_ZZ50 XC_OVR_ZZ60 CURL_OVERRIDE_AUTOCONF dnl configure script copyright -AC_COPYRIGHT([Copyright (c) 1998 - 2017 Daniel Stenberg, +AC_COPYRIGHT([Copyright (C) Daniel Stenberg, This configure script may be copied, distributed and modified under the terms of the curl license; see COPYING for more details]) AC_CONFIG_SRCDIR([lib/urldata.h]) AC_CONFIG_HEADERS(lib/curl_config.h) +AH_TOP([/* !checksrc! disable COPYRIGHT all */]) AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) CURL_CHECK_OPTION_DEBUG +AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes) CURL_CHECK_OPTION_OPTIMIZE CURL_CHECK_OPTION_WARNINGS CURL_CHECK_OPTION_WERROR CURL_CHECK_OPTION_CURLDEBUG +AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) CURL_CHECK_OPTION_SYMBOL_HIDING CURL_CHECK_OPTION_ARES CURL_CHECK_OPTION_RT +CURL_CHECK_OPTION_HTTPSRR +CURL_CHECK_OPTION_ECH +CURL_CHECK_OPTION_SSLS_EXPORT XC_CHECK_PATH_SEPARATOR -AX_CODE_COVERAGE # # save the configure arguments @@ -59,12 +66,6 @@ AX_CODE_COVERAGE CONFIGURE_OPTIONS="\"$ac_configure_args\"" AC_SUBST(CONFIGURE_OPTIONS) -CURL_CFLAG_EXTRAS="" -if test X"$want_werror" = Xyes; then - CURL_CFLAG_EXTRAS="-Werror" -fi -AC_SUBST(CURL_CFLAG_EXTRAS) - dnl SED is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. if test -z "$SED"; then @@ -89,21 +90,22 @@ if test -z "$GREP"; then fi AC_SUBST([GREP]) -dnl EGREP is mandatory for configure process and libtool. +dnl 'grep -E' is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. if test -z "$EGREP"; then dnl allow it to be overridden + AC_MSG_CHECKING([that grep -E works]) if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then - AC_MSG_CHECKING([for egrep]) EGREP="$GREP -E" - AC_MSG_RESULT([$EGREP]) + AC_MSG_RESULT([yes]) else + AC_MSG_RESULT([no]) AC_PATH_PROG([EGREP], [egrep], [not_found], [$PATH:/usr/bin:/usr/local/bin]) fi fi if test -z "$EGREP" || test "$EGREP" = "not_found"; then - AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.]) + AC_MSG_ERROR([grep -E is not working and egrep is not found in PATH. Cannot continue.]) fi AC_SUBST([EGREP]) @@ -124,6 +126,11 @@ AC_SUBST(libext) dnl figure out the libcurl version CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h` XC_CHECK_PROG_CC +CURL_ATOMIC + +dnl for --enable-code-coverage +CURL_COVERAGE + XC_AUTOMAKE AC_MSG_CHECKING([curl version]) AC_MSG_RESULT($CURLVERSION) @@ -135,37 +142,41 @@ dnl we extract the numerical version for curl-config only VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h` AC_SUBST(VERSIONNUM) -dnl Solaris pkgadd support definitions -PKGADD_PKG="HAXXcurl" -PKGADD_NAME="curl - a client that groks URLs" -PKGADD_VENDOR="curl.haxx.se" -AC_SUBST(PKGADD_PKG) -AC_SUBST(PKGADD_NAME) -AC_SUBST(PKGADD_VENDOR) - dnl dnl initialize all the info variables - curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )" - curl_ssh_msg="no (--with-libssh2)" + curl_ssl_msg="no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,amissl,rustls} )" + curl_ssh_msg="no (--with-{libssh,libssh2})" curl_zlib_msg="no (--with-zlib)" + curl_brotli_msg="no (--with-brotli)" + curl_zstd_msg="no (--with-zstd)" curl_gss_msg="no (--with-gssapi)" + curl_gsasl_msg="no (--with-gsasl)" curl_tls_srp_msg="no (--enable-tls-srp)" - curl_res_msg="default (--enable-ares / --enable-threaded-resolver)" + curl_res_msg="blocking (--enable-ares / --enable-threaded-resolver)" curl_ipv6_msg="no (--enable-ipv6)" curl_unix_sockets_msg="no (--enable-unix-sockets)" curl_idn_msg="no (--with-{libidn2,winidn})" + curl_docs_msg="enabled (--disable-docs)" curl_manual_msg="no (--enable-manual)" curl_libcurl_msg="enabled (--disable-libcurl-option)" curl_verbose_msg="enabled (--disable-verbose)" curl_sspi_msg="no (--enable-sspi)" curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" curl_ldaps_msg="no (--enable-ldaps)" + curl_ipfs_msg="no (--enable-ipfs)" curl_rtsp_msg="no (--enable-rtsp)" curl_rtmp_msg="no (--with-librtmp)" - curl_mtlnk_msg="no (--with-libmetalink)" curl_psl_msg="no (--with-libpsl)" - + curl_altsvc_msg="enabled (--disable-alt-svc)" +curl_headers_msg="enabled (--disable-headers-api)" + curl_hsts_msg="enabled (--disable-hsts)" ssl_backends= + curl_h1_msg="enabled (internal)" + curl_h2_msg="no (--with-nghttp2)" + curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic, --with-msh3)" + +enable_altsvc="yes" +hsts="yes" dnl dnl Save some initial values the user might have provided @@ -173,15 +184,243 @@ dnl INITIAL_LDFLAGS=$LDFLAGS INITIAL_LIBS=$LIBS +dnl +dnl Generates a shell script to run the compiler with LD_LIBRARY_PATH set to +dnl the value used right now. This lets CURL_RUN_IFELSE set LD_LIBRARY_PATH to +dnl something different but only have that affect the execution of the results +dnl of the compile, not change the libraries for the compiler itself. +dnl +compilersh="run-compiler" +CURL_SAVED_CC="$CC" +export CURL_SAVED_CC +CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" +export CURL_SAVED_LD_LIBRARY_PATH +cat <<\EOF > "$compilersh" +CC="$CURL_SAVED_CC" +export CC +LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH" +export LD_LIBRARY_PATH +exec $CC "$@" +EOF + +dnl ********************************************************************** +dnl See which TLS backend(s) that are requested. Just do all the +dnl TLS AC_ARG_WITH() invokes here and do the checks later +dnl ********************************************************************** +OPT_SCHANNEL=no +AC_ARG_WITH(schannel,dnl +AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]), + OPT_SCHANNEL=$withval + TLSCHOICE="schannel") + +OPT_AMISSL=no +AC_ARG_WITH(amissl,dnl +AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[ + OPT_AMISSL=$withval + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL" +]) + +OPT_OPENSSL=no +dnl Default to no CA bundle +ca="no" +AC_ARG_WITH(ssl,dnl +AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl]) +AS_HELP_STRING([--without-ssl], [build without any TLS library]),[ + OPT_SSL=$withval + OPT_OPENSSL=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" + else + SSL_DISABLED="D" + fi +]) + +AC_ARG_WITH(openssl,dnl +AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]),[ + OPT_OPENSSL=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" + fi +]) + +OPT_GNUTLS=no +AC_ARG_WITH(gnutls,dnl +AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[ + OPT_GNUTLS=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS" + fi +]) + +OPT_MBEDTLS=no +AC_ARG_WITH(mbedtls,dnl +AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[ + OPT_MBEDTLS=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS" + fi +]) + +OPT_WOLFSSL=no +AC_ARG_WITH(wolfssl,dnl +AS_HELP_STRING([--with-wolfssl=PATH],[where to look for wolfSSL, PATH points to the installation root (default: system lib default)]),[ + OPT_WOLFSSL=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL" + fi +]) + +OPT_RUSTLS=no +AC_ARG_WITH(rustls,dnl +AS_HELP_STRING([--with-rustls=PATH],[where to look for Rustls, PATH points to the installation root]),[ + OPT_RUSTLS=$withval + if test X"$withval" != Xno; then + TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls" + experimental="$experimental rustls" + fi +]) + +TEST_NGHTTPX=nghttpx +AC_ARG_WITH(test-nghttpx,dnl +AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]), + TEST_NGHTTPX=$withval + if test X"$TEST_NGHTTPX" = "Xno"; then + TEST_NGHTTPX="" + fi +) +AC_SUBST(TEST_NGHTTPX) + +if test -x /usr/bin/caddy; then + CADDY=/usr/bin/caddy +elif test -x /usr/local/bin/caddy; then + CADDY=/usr/local/bin/caddy +elif test -x "`brew --prefix 2>/dev/null`/bin/caddy"; then + CADDY=`brew --prefix`/bin/caddy +fi +AC_ARG_WITH(test-caddy,dnl +AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]), + CADDY=$withval + if test X"$CADDY" = "Xno"; then + CADDY="" + fi +) +AC_SUBST(CADDY) + +if test -x /usr/sbin/vsftpd; then + VSFTPD=/usr/sbin/vsftpd +elif test -x /usr/local/sbin/vsftpd; then + VSFTPD=/usr/local/sbin/vsftpd +elif test -x "`brew --prefix 2>/dev/null`/sbin/vsftpd"; then + VSFTPD=`brew --prefix`/sbin/vsftpd +fi +AC_ARG_WITH(test-vsftpd,dnl +AS_HELP_STRING([--with-test-vsftpd=PATH],[where to find vsftpd for testing]), + VSFTPD=$withval + if test X"$VSFTPD" = "Xno"; then + VSFTPD="" + fi +) +AC_SUBST(VSFTPD) + +dnl we'd like a httpd as test server +dnl +HTTPD_ENABLED="maybe" +AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH], + [where to find httpd/apache2 for testing])], + [request_httpd=$withval], [request_httpd=check]) +if test x"$request_httpd" = "xcheck" -o x"$request_httpd" = "xyes"; then + if test -x "/usr/sbin/apache2"; then + # common location on distros (debian/ubuntu) + HTTPD="/usr/sbin/apache2" + AC_PATH_PROG([APXS], [apxs]) + if test "x$APXS" = "x"; then + AC_MSG_NOTICE([apache2-dev not installed, httpd tests disabled]) + HTTPD_ENABLED="no" + fi + else + AC_PATH_PROG([HTTPD], [httpd]) + if test "x$HTTPD" = "x"; then + AC_PATH_PROG([HTTPD], [apache2]) + fi + AC_PATH_PROG([APXS], [apxs]) + if test "x$HTTPD" = "x"; then + AC_MSG_NOTICE([httpd/apache2 not in PATH, http tests disabled]) + HTTPD_ENABLED="no" + fi + if test "x$APXS" = "x"; then + AC_MSG_NOTICE([apxs not in PATH, http tests disabled]) + HTTPD_ENABLED="no" + fi + fi +elif test x"$request_httpd" != "xno"; then + HTTPD="${request_httpd}/bin/httpd" + APXS="${request_httpd}/bin/apxs" + if test ! -x "${HTTPD}"; then + AC_MSG_NOTICE([httpd not found as ${HTTPD}, http tests disabled]) + HTTPD_ENABLED="no" + elif test ! -x "${APXS}"; then + AC_MSG_NOTICE([apxs not found as ${APXS}, http tests disabled]) + HTTPD_ENABLED="no" + else + AC_MSG_NOTICE([using HTTPD=$HTTPD for tests]) + fi +fi +if test x"$HTTPD_ENABLED" = "xno"; then + HTTPD="" + APXS="" +fi +AC_SUBST(HTTPD) +AC_SUBST(APXS) + +dnl the nghttpx we might use in httpd testing +if test "x$TEST_NGHTTPX" != "x" -a "x$TEST_NGHTTPX" != "xnghttpx"; then + HTTPD_NGHTTPX="$TEST_NGHTTPX" +else + AC_PATH_PROG([HTTPD_NGHTTPX], [nghttpx], [], + [$PATH:/usr/bin:/usr/local/bin]) +fi +AC_SUBST(HTTPD_NGHTTPX) + +dnl the Caddy server we might use in testing +if test "x$TEST_CADDY" != "x"; then + CADDY="$TEST_CADDY" +else + AC_PATH_PROG([CADDY], [caddy]) +fi +AC_SUBST(CADDY) + +dnl If no TLS choice has been made, check if it was explicitly disabled or +dnl error out to force the user to decide. +if test -z "$TLSCHOICE"; then + if test "x$OPT_SSL" != "xno"; then + AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl. + +Select from these: + + --with-amissl + --with-gnutls + --with-mbedtls + --with-openssl (also works for BoringSSL and LibreSSL) + --with-rustls + --with-schannel + --with-wolfssl +]) + fi +fi + +AC_ARG_WITH(darwinssl,, + AC_MSG_ERROR([--with-darwin-ssl and --without-darwin-ssl no longer work!])) + dnl dnl Detect the canonical host and target build environment dnl AC_CANONICAL_HOST dnl Get system canonical name -AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) +AC_DEFINE_UNQUOTED(CURL_OS, "${host}", [cpu-machine-OS]) -dnl Checks for programs. +# Silence warning: ar: 'u' modifier ignored since 'D' is the default +AC_SUBST(AR_FLAGS, [cr]) dnl This defines _ALL_SOURCE for AIX CURL_CHECK_AIX_ALL_SOURCE @@ -195,6 +434,10 @@ AC_SYS_LARGEFILE XC_LIBTOOL +LT_LANG([Windows Resource]) + +AM_CONDITIONAL(NOT_CURL_CI, test -z "$CURL_CI") + # # Automake conditionals based on libtool related checks # @@ -231,31 +474,34 @@ AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB], # targeting a static library and not building its shared counterpart. # -CPPFLAG_CURL_STATICLIB= -if test "x$xc_lt_build_static_only" = 'xyes'; then - CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB' -fi -AC_SUBST([CPPFLAG_CURL_STATICLIB]) - +LIBCURL_PC_CFLAGS_PRIVATE='-DCURL_STATICLIB' +AC_SUBST(LIBCURL_PC_CFLAGS_PRIVATE) -# Determine whether all dependent libraries must be specified when linking -if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" -then - REQUIRE_LIB_DEPS=no -else - REQUIRE_LIB_DEPS=yes +LIBCURL_PC_CFLAGS= +if test "x$xc_lt_build_static_only" = 'xyes'; then + LIBCURL_PC_CFLAGS="${LIBCURL_PC_CFLAGS_PRIVATE}" fi -AC_SUBST(REQUIRE_LIB_DEPS) -AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes) +AC_SUBST([LIBCURL_PC_CFLAGS]) -dnl check if there's a way to force code inline -AC_C_INLINE dnl ********************************************************************** dnl platform/compiler/architecture specific checks/flags dnl ********************************************************************** CURL_CHECK_COMPILER +CURL_CHECK_NATIVE_WINDOWS + +curl_cv_wince='no' +curl_cv_winuwp='no' +if test "$curl_cv_native_windows" = "yes"; then + case $host_os in + mingw32ce*) curl_cv_wince='yes';; + esac + case "$CPPFLAGS" in + *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';; + esac +fi + CURL_SET_COMPILER_BASIC_OPTS CURL_SET_COMPILER_DEBUG_OPTS CURL_SET_COMPILER_OPTIMIZE_OPTS @@ -273,14 +519,27 @@ if test "$compiler_id" = "INTEL_UNIX_C"; then # fi +CURL_CFLAG_EXTRAS="" +if test X"$want_werror" = Xyes; then + CURL_CFLAG_EXTRAS="-Werror" + if test "$compiler_id" = "GNU_C"; then + dnl enable -pedantic-errors for GCC 5 and later, + dnl as before that it was the same as -Werror=pedantic + if test "$compiler_num" -ge "500"; then + CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" + fi + elif test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then + CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" + fi +fi +AC_SUBST(CURL_CFLAG_EXTRAS) +AM_CONDITIONAL(CURL_WERROR, test X"$want_werror" = Xyes) + CURL_CHECK_COMPILER_HALT_ON_ERROR CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH CURL_CHECK_COMPILER_SYMBOL_HIDING -CURL_CHECK_CURLDEBUG -AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) - supports_unittests=yes # cross-compilation of unit tests static library/programs fails when # libcurl shared library is built. This might be due to a libtool or @@ -310,359 +569,483 @@ case $host_os in ;; esac -dnl Build unit tests when option --enable-debug is given. -if test "x$want_debug" = "xyes" && - test "x$supports_unittests" = "xyes"; then - want_unittests=yes -else - want_unittests=no -fi -AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes) +AM_CONDITIONAL(BUILD_UNITTESTS, test x$supports_unittests = xyes) + +# In order to detect support of sendmmsg() and accept4(), we need to escape the POSIX +# jail by defining _GNU_SOURCE or will not expose it. +case $host_os in + *linux*|cygwin*|msys*) + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + ;; +esac dnl ********************************************************************** dnl Compilation based checks should not be done before this point. dnl ********************************************************************** -dnl ********************************************************************** -dnl Make sure that our checks for headers windows.h winsock.h winsock2.h -dnl and ws2tcpip.h take precedence over any other further checks which -dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for -dnl this specific header files. And do them before its results are used. -dnl ********************************************************************** +CURL_CHECK_WIN32_LARGEFILE +CURL_CHECK_WIN32_CRYPTO -CURL_CHECK_HEADER_WINDOWS -CURL_CHECK_NATIVE_WINDOWS -case X-"$curl_cv_native_windows" in - X-yes) - CURL_CHECK_HEADER_WINSOCK - CURL_CHECK_HEADER_WINSOCK2 - CURL_CHECK_HEADER_WS2TCPIP - CURL_CHECK_HEADER_WINLDAP - CURL_CHECK_HEADER_WINBER +curl_cv_apple='no' +case $host in + *-apple-*) curl_cv_apple='yes';; +esac + +if test "$curl_cv_apple" = 'yes'; then + CURL_DARWIN_CFLAGS + CURL_SUPPORTS_BUILTIN_AVAILABLE +fi + +curl_cv_cygwin='no' +case $host_os in + cygwin*|msys*) curl_cv_cygwin='yes';; +esac + +AM_CONDITIONAL([HAVE_WINDRES], + [test "$curl_cv_native_windows" = "yes" && test -n "${RC}"]) + +if test "$curl_cv_native_windows" = "yes"; then + AM_COND_IF([HAVE_WINDRES],, + [AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])]) +fi + +dnl ---------------------------------------- +dnl whether use "unity" mode for lib and src +dnl ---------------------------------------- + +want_unity='no' +AC_MSG_CHECKING([whether to build libcurl and curl in "unity" mode]) +AC_ARG_ENABLE(unity, +AS_HELP_STRING([--enable-unity],[Enable unity mode]) +AS_HELP_STRING([--disable-unity],[Disable unity (default)]), +[ case "$enableval" in + yes) + want_unity='yes' + AC_MSG_RESULT([yes]) ;; *) - curl_cv_header_winsock_h="no" - curl_cv_header_winsock2_h="no" - curl_cv_header_ws2tcpip_h="no" - curl_cv_header_winldap_h="no" - curl_cv_header_winber_h="no" + AC_MSG_RESULT([no]) ;; -esac -CURL_CHECK_WIN32_LARGEFILE + esac ], + AC_MSG_RESULT([no]) +) -CURL_MAC_CFLAGS -CURL_SUPPORTS_BUILTIN_AVAILABLE +AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = 'yes']) dnl ************************************************************ dnl switch off particular protocols dnl AC_MSG_CHECKING([whether to support http]) AC_ARG_ENABLE(http, -AC_HELP_STRING([--enable-http],[Enable HTTP support]) -AC_HELP_STRING([--disable-http],[Disable HTTP support]), +AS_HELP_STRING([--enable-http],[Enable HTTP support]) +AS_HELP_STRING([--disable-http],[Disable HTTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) - disable_http="yes" - AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP]) - AC_SUBST(CURL_DISABLE_HTTP, [1]) - AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) - AC_SUBST(CURL_DISABLE_RTSP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) + disable_http="yes" + AC_MSG_WARN([disable HTTP disables FTP over proxy, IPFS and RTSP]) + CURL_DISABLE_HTTP=1 + AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS]) + CURL_DISABLE_IPFS=1 + AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) + CURL_DISABLE_RTSP=1 + dnl toggle off alt-svc too when HTTP is disabled + AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) + AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS]) + curl_h1_msg="no (--enable-http)" + curl_altsvc_msg="no"; + curl_hsts_msg="no (--enable-hsts)"; + enable_altsvc="no" + hsts="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support ftp]) AC_ARG_ENABLE(ftp, -AC_HELP_STRING([--enable-ftp],[Enable FTP support]) -AC_HELP_STRING([--disable-ftp],[Disable FTP support]), +AS_HELP_STRING([--enable-ftp],[Enable FTP support]) +AS_HELP_STRING([--disable-ftp],[Disable FTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) - AC_SUBST(CURL_DISABLE_FTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) + CURL_DISABLE_FTP=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support file]) AC_ARG_ENABLE(file, -AC_HELP_STRING([--enable-file],[Enable FILE support]) -AC_HELP_STRING([--disable-file],[Disable FILE support]), +AS_HELP_STRING([--enable-file],[Enable FILE support]) +AS_HELP_STRING([--disable-file],[Disable FILE support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) + CURL_DISABLE_FILE=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) +AC_MSG_CHECKING([whether to support IPFS]) +AC_ARG_ENABLE(ipfs, +AS_HELP_STRING([--enable-ipfs],[Enable IPFS support]) +AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) - AC_SUBST(CURL_DISABLE_FILE, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS]) + CURL_DISABLE_IPFS=1 + ;; + *) + if test x$CURL_DISABLE_HTTP = x1; then + AC_MSG_ERROR(HTTP support needs to be enabled in order to enable IPFS support!) + else + AC_MSG_RESULT(yes) + curl_ipfs_msg="enabled" + fi + ;; esac ], - AC_MSG_RESULT(yes) + if test "x$CURL_DISABLE_HTTP" != "x1"; then + AC_MSG_RESULT(yes) + curl_ipfs_msg="enabled" + else + AC_MSG_RESULT(no) + fi ) AC_MSG_CHECKING([whether to support ldap]) AC_ARG_ENABLE(ldap, -AC_HELP_STRING([--enable-ldap],[Enable LDAP support]) -AC_HELP_STRING([--disable-ldap],[Disable LDAP support]), +AS_HELP_STRING([--enable-ldap],[Enable LDAP support]) +AS_HELP_STRING([--disable-ldap],[Disable LDAP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) - AC_SUBST(CURL_DISABLE_LDAP, [1]) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) + CURL_DISABLE_LDAP=1 + ;; + yes) + ldap_askedfor="yes" + AC_MSG_RESULT(yes) + ;; *) - AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(yes) + ;; esac ],[ - AC_MSG_RESULT(yes) ] + AC_MSG_RESULT(yes) ] ) AC_MSG_CHECKING([whether to support ldaps]) AC_ARG_ENABLE(ldaps, -AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support]) -AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), +AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support]) +AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1]) - ;; - *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then - AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1]) - else - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) - AC_SUBST(HAVE_LDAP_SSL, [1]) - fi - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + CURL_DISABLE_LDAPS=1 + ;; + *) + if test "x$CURL_DISABLE_LDAP" = "x1"; then + AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + CURL_DISABLE_LDAPS=1 + else + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) + HAVE_LDAP_SSL=1 + fi + ;; esac ],[ - if test "x$CURL_DISABLE_LDAP" = "x1" ; then - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1]) - else - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) - AC_SUBST(HAVE_LDAP_SSL, [1]) - fi ] + if test "x$CURL_DISABLE_LDAP" = "x1"; then + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + CURL_DISABLE_LDAPS=1 + else + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) + HAVE_LDAP_SSL=1 + fi ] ) AC_MSG_CHECKING([whether to support rtsp]) AC_ARG_ENABLE(rtsp, -AC_HELP_STRING([--enable-rtsp],[Enable RTSP support]) -AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]), -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) - AC_SUBST(CURL_DISABLE_RTSP, [1]) - ;; - *) if test x$CURL_DISABLE_HTTP = x1 ; then - AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!) - else - AC_MSG_RESULT(yes) - curl_rtsp_msg="enabled" - fi - ;; - esac ], - if test "x$CURL_DISABLE_HTTP" != "x1"; then - AC_MSG_RESULT(yes) - curl_rtsp_msg="enabled" - else - AC_MSG_RESULT(no) - fi +AS_HELP_STRING([--enable-rtsp],[Enable RTSP support]) +AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]), + [ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) + CURL_DISABLE_RTSP=1 + ;; + *) + if test x$CURL_DISABLE_HTTP = x1; then + AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!) + else + AC_MSG_RESULT(yes) + curl_rtsp_msg="enabled" + fi + ;; + esac ], + if test "x$CURL_DISABLE_HTTP" != "x1"; then + AC_MSG_RESULT(yes) + curl_rtsp_msg="enabled" + else + AC_MSG_RESULT(no) + fi ) AC_MSG_CHECKING([whether to support proxies]) AC_ARG_ENABLE(proxy, -AC_HELP_STRING([--enable-proxy],[Enable proxy support]) -AC_HELP_STRING([--disable-proxy],[Disable proxy support]), +AS_HELP_STRING([--enable-proxy],[Enable proxy support]) +AS_HELP_STRING([--disable-proxy],[Disable proxy support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) - AC_SUBST(CURL_DISABLE_PROXY, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) + CURL_DISABLE_PROXY=1 + https_proxy="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support dict]) AC_ARG_ENABLE(dict, -AC_HELP_STRING([--enable-dict],[Enable DICT support]) -AC_HELP_STRING([--disable-dict],[Disable DICT support]), +AS_HELP_STRING([--enable-dict],[Enable DICT support]) +AS_HELP_STRING([--disable-dict],[Disable DICT support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) - AC_SUBST(CURL_DISABLE_DICT, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) + CURL_DISABLE_DICT=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) + AC_MSG_CHECKING([whether to support telnet]) AC_ARG_ENABLE(telnet, -AC_HELP_STRING([--enable-telnet],[Enable TELNET support]) -AC_HELP_STRING([--disable-telnet],[Disable TELNET support]), +AS_HELP_STRING([--enable-telnet],[Enable TELNET support]) +AS_HELP_STRING([--disable-telnet],[Disable TELNET support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) - AC_SUBST(CURL_DISABLE_TELNET, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) + CURL_DISABLE_TELNET=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) + +if test "$curl_cv_winuwp" = 'yes' -o "$curl_cv_wince" = 'yes'; then + AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) + CURL_DISABLE_TELNET=1 +fi + AC_MSG_CHECKING([whether to support tftp]) AC_ARG_ENABLE(tftp, -AC_HELP_STRING([--enable-tftp],[Enable TFTP support]) -AC_HELP_STRING([--disable-tftp],[Disable TFTP support]), +AS_HELP_STRING([--enable-tftp],[Enable TFTP support]) +AS_HELP_STRING([--disable-tftp],[Disable TFTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) - AC_SUBST(CURL_DISABLE_TFTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) + CURL_DISABLE_TFTP=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support pop3]) AC_ARG_ENABLE(pop3, -AC_HELP_STRING([--enable-pop3],[Enable POP3 support]) -AC_HELP_STRING([--disable-pop3],[Disable POP3 support]), +AS_HELP_STRING([--enable-pop3],[Enable POP3 support]) +AS_HELP_STRING([--disable-pop3],[Disable POP3 support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3]) - AC_SUBST(CURL_DISABLE_POP3, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3]) + CURL_DISABLE_POP3=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) - AC_MSG_CHECKING([whether to support imap]) AC_ARG_ENABLE(imap, -AC_HELP_STRING([--enable-imap],[Enable IMAP support]) -AC_HELP_STRING([--disable-imap],[Disable IMAP support]), +AS_HELP_STRING([--enable-imap],[Enable IMAP support]) +AS_HELP_STRING([--disable-imap],[Disable IMAP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP]) - AC_SUBST(CURL_DISABLE_IMAP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP]) + CURL_DISABLE_IMAP=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) - AC_MSG_CHECKING([whether to support smb]) AC_ARG_ENABLE(smb, -AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support]) -AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]), +AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support]) +AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS]) - AC_SUBST(CURL_DISABLE_SMB, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS]) + CURL_DISABLE_SMB=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support smtp]) AC_ARG_ENABLE(smtp, -AC_HELP_STRING([--enable-smtp],[Enable SMTP support]) -AC_HELP_STRING([--disable-smtp],[Disable SMTP support]), +AS_HELP_STRING([--enable-smtp],[Enable SMTP support]) +AS_HELP_STRING([--disable-smtp],[Disable SMTP support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP]) - AC_SUBST(CURL_DISABLE_SMTP, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP]) + CURL_DISABLE_SMTP=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) AC_MSG_CHECKING([whether to support gopher]) AC_ARG_ENABLE(gopher, -AC_HELP_STRING([--enable-gopher],[Enable Gopher support]) -AC_HELP_STRING([--disable-gopher],[Disable Gopher support]), +AS_HELP_STRING([--enable-gopher],[Enable Gopher support]) +AS_HELP_STRING([--disable-gopher],[Disable Gopher support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher]) - AC_SUBST(CURL_DISABLE_GOPHER, [1]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher]) + CURL_DISABLE_GOPHER=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) - -dnl ********************************************************************** -dnl Check for built-in manual +AC_MSG_CHECKING([whether to support mqtt]) +AC_ARG_ENABLE(mqtt, +AS_HELP_STRING([--enable-mqtt],[Enable MQTT support]) +AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT]) + CURL_DISABLE_MQTT=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(no) +) + +dnl ********************************************************************** +dnl Check for built-in manual dnl ********************************************************************** AC_MSG_CHECKING([whether to provide built-in manual]) AC_ARG_ENABLE(manual, -AC_HELP_STRING([--enable-manual],[Enable built-in manual]) -AC_HELP_STRING([--disable-manual],[Disable built-in manual]), +AS_HELP_STRING([--enable-manual],[Enable built-in manual]) +AS_HELP_STRING([--disable-manual],[Disable built-in manual]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - ;; - *) AC_MSG_RESULT(yes) - USE_MANUAL="1" - ;; + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + USE_MANUAL="1" + ;; esac ], - AC_MSG_RESULT(yes) - USE_MANUAL="1" + AC_MSG_RESULT(yes) + USE_MANUAL="1" ) dnl The actual use of the USE_MANUAL variable is done much later in this dnl script to allow other actions to disable it as well. +dnl ********************************************************************** +dnl Check whether to build documentation +dnl ********************************************************************** + +AC_MSG_CHECKING([whether to build documentation]) +AC_ARG_ENABLE(docs, +AS_HELP_STRING([--enable-docs],[Enable documentation]) +AS_HELP_STRING([--disable-docs],[Disable documentation]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + BUILD_DOCS=0 + dnl disable manual too because it needs built documentation + USE_MANUAL=0 + curl_docs_msg="no" + ;; + *) + AC_MSG_RESULT(yes) + BUILD_DOCS=1 + ;; + esac ], + AC_MSG_RESULT(yes) + BUILD_DOCS=1 +) + + dnl ************************************************************ dnl disable C code generation support dnl AC_MSG_CHECKING([whether to enable generation of C code]) AC_ARG_ENABLE(libcurl_option, -AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support]) -AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]), +AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support]) +AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option]) - curl_libcurl_msg="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option]) + curl_libcurl_msg="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ********************************************************************** @@ -671,54 +1054,68 @@ dnl ********************************************************************** AC_MSG_CHECKING([whether to use libgcc]) AC_ARG_ENABLE(libgcc, -AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]), +AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]), [ case "$enableval" in yes) - LIBS="-lgcc $LIBS" - AC_MSG_RESULT(yes) - ;; - *) AC_MSG_RESULT(no) - ;; + LIBS="-lgcc $LIBS" + AC_MSG_RESULT(yes) + ;; + *) + AC_MSG_RESULT(no) + ;; esac ], - AC_MSG_RESULT(no) + AC_MSG_RESULT(no) ) CURL_CHECK_LIB_XNET dnl gethostbyname without lib or in the nsl lib? AC_CHECK_FUNC(gethostbyname, - [HAVE_GETHOSTBYNAME="1" - ], - [ AC_CHECK_LIB(nsl, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="-lnsl $LIBS" - ]) - ]) - -if test "$HAVE_GETHOSTBYNAME" != "1" -then + [ + HAVE_GETHOSTBYNAME="1" + ], + [ + AC_CHECK_LIB(nsl, gethostbyname, + [ + HAVE_GETHOSTBYNAME="1" + LIBS="-lnsl $LIBS" + ] + ) + ] +) + +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl gethostbyname in the socket lib? AC_CHECK_LIB(socket, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="-lsocket $LIBS" - ]) + [ + HAVE_GETHOSTBYNAME="1" + LIBS="-lsocket $LIBS" + ] + ) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl gethostbyname in the watt lib? + clean_CPPFLAGS=$CPPFLAGS + clean_LDFLAGS=$LDFLAGS + CPPFLAGS="-I${WATT_ROOT}/inc" + LDFLAGS="-L${WATT_ROOT}/lib" AC_CHECK_LIB(watt, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - CPPFLAGS="-I/dev/env/WATT_ROOT/inc" - LDFLAGS="-L/dev/env/WATT_ROOT/lib" - LIBS="-lwatt $LIBS" - ]) + [ + HAVE_GETHOSTBYNAME="1" + LIBS="-lwatt $LIBS" + AC_DEFINE(USE_WATT32, 1, [if Watt-32 is in use]) + ], + [ + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS + ] + ) fi dnl At least one system has been identified to require BOTH nsl and socket dnl libs at the same time to link properly. -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) my_ac_save_LIBS=$LIBS LIBS="-lnsl -lsocket $LIBS" @@ -736,22 +1133,45 @@ then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl This is for winsock systems - if test "$curl_cv_header_windows_h" = "yes"; then - if test "$curl_cv_header_winsock_h" = "yes"; then - case $host in - *-*-mingw32ce*) - winsock_LIB="-lwinsock" - ;; - *) - winsock_LIB="-lwsock32" - ;; - esac +if test "$HAVE_GETHOSTBYNAME" != "1"; then + if test "$curl_cv_wince" = 'yes'; then + dnl This is for Windows CE systems + winsock_LIB="-lws2" + if test ! -z "$winsock_LIB"; then + my_ac_save_LIBS=$LIBS + LIBS="$winsock_LIB $LIBS" + AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #endif + ]],[[ + gethostbyname("localhost"); + ]]) + ],[ + AC_MSG_RESULT([yes]) + HAVE_GETHOSTBYNAME="1" + ],[ + AC_MSG_RESULT([no]) + winsock_LIB="" + LIBS=$my_ac_save_LIBS + ]) fi - if test "$curl_cv_header_winsock2_h" = "yes"; then - winsock_LIB="-lws2_32" + fi +fi + +# In UWP mode gethostbyname gets detected via the core libs, but some +# code (in6addr_any) still need ws2_32, so let us detect and add it. +if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then + if test "$curl_cv_native_windows" = "yes"; then + dnl This is for Winsock systems + winsock_LIB="-lws2_32" + if test "$curl_cv_winuwp" != "yes"; then + winsock_LIB="$winsock_LIB -liphlpapi" fi if test ! -z "$winsock_LIB"; then my_ac_save_LIBS=$LIBS @@ -759,21 +1179,14 @@ then AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif + #ifdef _WIN32 + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #endif ]],[[ - gethostbyname("www.dummysite.com"); + gethostbyname("localhost"); ]]) ],[ AC_MSG_RESULT([yes]) @@ -787,16 +1200,15 @@ then fi fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl This is for Minix 3.1 AC_MSG_CHECKING([for gethostbyname for Minix 3]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -/* Older Minix versions may need here instead */ -#include + /* Older Minix versions may need here instead */ + #include ]],[[ - gethostbyname("www.dummysite.com"); + gethostbyname("localhost"); ]]) ],[ AC_MSG_RESULT([yes]) @@ -806,16 +1218,15 @@ then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then +if test "$HAVE_GETHOSTBYNAME" != "1"; then dnl This is for eCos with a stubbed DNS implementation AC_MSG_CHECKING([for gethostbyname for eCos]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include + #include + #include ]],[[ - gethostbyname("www.dummysite.com"); + gethostbyname("localhost"); ]]) ],[ AC_MSG_RESULT([yes]) @@ -825,39 +1236,53 @@ then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl gethostbyname in the network lib - for Haiku OS - AC_CHECK_LIB(network, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="-lnetwork $LIBS" - ]) -fi - -if test "$HAVE_GETHOSTBYNAME" != "1" -then - dnl gethostbyname in the net lib - for BeOS - AC_CHECK_LIB(net, gethostbyname, - [HAVE_GETHOSTBYNAME="1" - LIBS="-lnet $LIBS" - ]) +if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set; then + dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet + AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + #define __USE_INLINE__ + #include + #ifdef __amigaos4__ + struct SocketIFace *ISocket = NULL; + #else + struct Library *SocketBase = NULL; + #endif + ]],[[ + unsigned char host[] = "localhost"; + gethostbyname(host); + ]]) + ],[ + AC_MSG_RESULT([yes]) + HAVE_GETHOSTBYNAME="1" + HAVE_PROTO_BSDSOCKET_H="1" + AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use]) + ],[ + AC_MSG_RESULT([no]) + ]) fi - if test "$HAVE_GETHOSTBYNAME" != "1"; then - AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) + dnl gethostbyname in the network lib - for Haiku OS + AC_CHECK_LIB(network, gethostbyname, + [ + HAVE_GETHOSTBYNAME="1" + LIBS="-lnetwork $LIBS" + ] + ) fi CURL_CHECK_LIBS_CONNECT -CURL_NETWORK_LIBS=$LIBS - dnl ********************************************************************** dnl In case that function clock_gettime with monotonic timer is available, dnl check for additional required libraries. dnl ********************************************************************** CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC +dnl Check for even better option +CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW + dnl ********************************************************************** dnl The preceding library checks are all potentially useful for test dnl servers and libtest cases which require networking and clock_gettime @@ -877,24 +1302,29 @@ clean_LDFLAGS=$LDFLAGS clean_LIBS=$LIBS ZLIB_LIBS="" AC_ARG_WITH(zlib, -AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) -AC_HELP_STRING([--without-zlib],[disable use of zlib]), - [OPT_ZLIB="$withval"]) +AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) +AS_HELP_STRING([--without-zlib],[disable use of zlib]), + [OPT_ZLIB="$withval"]) -if test "$OPT_ZLIB" = "no" ; then - AC_MSG_WARN([zlib disabled]) +if test "$OPT_ZLIB" = "no"; then + AC_MSG_WARN([zlib disabled]) else - if test "$OPT_ZLIB" = "yes" ; then + if test "$OPT_ZLIB" = "yes"; then OPT_ZLIB="" fi - if test -z "$OPT_ZLIB" ; then + if test -z "$OPT_ZLIB"; then CURL_CHECK_PKGCONFIG(zlib) - if test "$PKGCONFIG" != "no" ; then - LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS" - LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`" - CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`" + if test "$PKGCONFIG" != "no"; then + ZLIB_LIBS="`$PKGCONFIG --libs-only-l zlib`" + if test -n "$ZLIB_LIBS"; then + LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`" + else + ZLIB_LIBS="`$PKGCONFIG --libs zlib`" + fi + LIBS="$ZLIB_LIBS $LIBS" + CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags zlib`" OPT_ZLIB="" HAVE_LIBZ="1" fi @@ -905,35 +1335,45 @@ else dnl people have it in the default path AC_CHECK_LIB(z, inflateEnd, - dnl libz found, set the variable - [HAVE_LIBZ="1" - LIBS="-lz $LIBS"], - dnl if no lib found, try /usr/local - [OPT_ZLIB="/usr/local"]) + dnl libz found, set the variable + [ + HAVE_LIBZ="1" + ZLIB_LIBS="-lz" + LIBS="$ZLIB_LIBS $LIBS" + ], + dnl if no lib found, try /usr/local + [ + OPT_ZLIB="/usr/local" + ] + ) fi fi dnl Add a nonempty path to the compiler flags if test -n "$OPT_ZLIB"; then - CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" - LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" + CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" + LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" fi AC_CHECK_HEADER(zlib.h, [ - dnl zlib.h was found - HAVE_ZLIB_H="1" - dnl if the lib wasn't found already, try again with the new paths - if test "$HAVE_LIBZ" != "1"; then - AC_CHECK_LIB(z, gzread, - [ - dnl the lib was found! - HAVE_LIBZ="1" - LIBS="-lz $LIBS" - ], - [ CPPFLAGS=$clean_CPPFLAGS - LDFLAGS=$clean_LDFLAGS]) - fi + dnl zlib.h was found + HAVE_ZLIB_H="1" + dnl if the lib wasn't found already, try again with the new paths + if test "$HAVE_LIBZ" != "1"; then + AC_CHECK_LIB(z, gzread, + [ + dnl the lib was found! + HAVE_LIBZ="1" + ZLIB_LIBS="-lz" + LIBS="$ZLIB_LIBS $LIBS" + ], + [ + CPPFLAGS=$clean_CPPFLAGS + LDFLAGS=$clean_LDFLAGS + ] + ) + fi ], [ dnl zlib.h was not found, restore the flags @@ -941,32 +1381,29 @@ else LDFLAGS=$clean_LDFLAGS] ) - if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1" - then + if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"; then AC_MSG_WARN([configure found only the libz lib, not the header file!]) HAVE_LIBZ="" CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS - elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" - then + ZLIB_LIBS="" + elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"; then AC_MSG_WARN([configure found only the libz header file, not the lib!]) CPPFLAGS=$clean_CPPFLAGS LDFLAGS=$clean_LDFLAGS LIBS=$clean_LIBS - elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1" - then + ZLIB_LIBS="" + elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"; then dnl both header and lib were found! AC_SUBST(HAVE_LIBZ) - AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file]) AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available]) - - ZLIB_LIBS="-lz" - LIBS="-lz $clean_LIBS" + LIBS="$ZLIB_LIBS $clean_LIBS" dnl replace 'HAVE_LIBZ' in the automake makefile.ams AMFIXLIB="1" AC_MSG_NOTICE([found both libz and libz.h header]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE zlib" curl_zlib_msg="enabled" fi fi @@ -976,89 +1413,192 @@ AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1) AC_SUBST(ZLIB_LIBS) dnl ********************************************************************** -dnl Check for LDAP +dnl Check for the presence of BROTLI decoder libraries and headers dnl ********************************************************************** -LDAPLIBNAME="" -AC_ARG_WITH(ldap-lib, -AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]), - [LDAPLIBNAME="$withval"]) +dnl Brotli project home page: https://github.com/google/brotli -LBERLIBNAME="" -AC_ARG_WITH(lber-lib, -AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]), - [LBERLIBNAME="$withval"]) +dnl Default to compiler & linker defaults for BROTLI files & libraries. +OPT_BROTLI=off +AC_ARG_WITH(brotli,dnl +AS_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--without-brotli], [disable BROTLI]), + OPT_BROTLI=$withval) -if test x$CURL_DISABLE_LDAP != x1 ; then +if test X"$OPT_BROTLI" != Xno; then + dnl backup the pre-brotli variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - CURL_CHECK_HEADER_LBER - CURL_CHECK_HEADER_LDAP - CURL_CHECK_HEADER_LDAPSSL - CURL_CHECK_HEADER_LDAP_SSL + case "$OPT_BROTLI" in + yes) + dnl --with-brotli (without path) used + CURL_CHECK_PKGCONFIG(libbrotlidec) + + if test "$PKGCONFIG" != "no"; then + LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec` + LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec` + CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec` + version=`$PKGCONFIG --modversion libbrotlidec` + fi - if test -z "$LDAPLIBNAME" ; then - if test "$curl_cv_native_windows" = "yes"; then - dnl Windows uses a single and unique LDAP library name - LDAPLIBNAME="wldap32" - LBERLIBNAME="no" - fi + CURL_CHECK_PKGCONFIG(libbrotlicommon) + + if test "$PKGCONFIG" != "no"; then + LIB_BROTLI="$LIB_BROTLI `$PKGCONFIG --libs-only-l libbrotlicommon`" + LD_BROTLI="$LD_BROTLI `$PKGCONFIG --libs-only-L libbrotlicommon`" + CPP_BROTLI="$CPP_BROTLI `$PKGCONFIG --cflags-only-I libbrotlicommon`" + fi + + DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'` + ;; + off) + dnl no --with-brotli option given, just check default places + ;; + *) + dnl use the given --with-brotli spot + PREFIX_BROTLI=$OPT_BROTLI + ;; + esac + + dnl if given with a prefix, we set -L and -I based on that + if test -n "$PREFIX_BROTLI"; then + LIB_BROTLI="-lbrotlidec -lbrotlicommon" + LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff + CPP_BROTLI=-I${PREFIX_BROTLI}/include + DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff fi - if test "$LDAPLIBNAME" ; then - AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [ - AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled]) - AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) - AC_SUBST(CURL_DISABLE_LDAP, [1]) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1])]) - else - dnl Try to find the right ldap libraries for this system - CURL_CHECK_LIBS_LDAP - case X-"$curl_cv_ldap_LIBS" in - X-unknown) - AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled]) - AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) - AC_SUBST(CURL_DISABLE_LDAP, [1]) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1]) - ;; - esac + LDFLAGS="$LDFLAGS $LD_BROTLI" + LDFLAGSPC="$LDFLAGSPC $LD_BROTLI" + CPPFLAGS="$CPPFLAGS $CPP_BROTLI" + LIBS="$LIB_BROTLI $LIBS" + + AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress) + + AC_CHECK_HEADERS(brotli/decode.h, + curl_brotli_msg="enabled (libbrotlidec)" + HAVE_BROTLI=1 + AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use]) + ) + + if test X"$OPT_BROTLI" != Xoff && + test "$HAVE_BROTLI" != "1"; then + AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!]) fi -fi -if test x$CURL_DISABLE_LDAP != x1 ; then + if test "$HAVE_BROTLI" = "1"; then + if test -n "$DIR_BROTLI"; then + dnl when the brotli shared libs were found in a path that the run-time + dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl to prevent further configure tests to fail due to this - if test "$LBERLIBNAME" ; then - dnl If name is "no" then don't define this library at all - dnl (it's only needed if libldap.so's dependencies are broken). - if test "$LBERLIBNAME" != "no" ; then - AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ - AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled]) - AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) - AC_SUBST(CURL_DISABLE_LDAP, [1]) - AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) - AC_SUBST(CURL_DISABLE_LDAPS, [1])]) + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH]) + fi fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libbrotlidec libbrotlicommon" + else + dnl no brotli, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS fi fi -if test x$CURL_DISABLE_LDAP != x1 ; then - AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd]) +dnl ********************************************************************** +dnl Check for libzstd +dnl ********************************************************************** - if test "$LDAPLIBNAME" = "wldap32"; then - curl_ldap_msg="enabled (winldap)" - AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation]) - else - curl_ldap_msg="enabled (OpenLDAP)" - if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then - AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code]) - AC_SUBST(USE_OPENLDAP, [1]) - fi +dnl Default to compiler & linker defaults for libzstd +OPT_ZSTD=off +AC_ARG_WITH(zstd,dnl +AS_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--without-zstd], [disable libzstd]), + OPT_ZSTD=$withval) + +if test X"$OPT_ZSTD" != Xno; then + dnl backup the pre-zstd variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + case "$OPT_ZSTD" in + yes) + dnl --with-zstd (without path) used + CURL_CHECK_PKGCONFIG(libzstd) + + if test "$PKGCONFIG" != "no"; then + LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd` + LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd` + CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd` + version=`$PKGCONFIG --modversion libzstd` + DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'` + fi + + ;; + off) + dnl no --with-zstd option given, just check default places + ;; + *) + dnl use the given --with-zstd spot + PREFIX_ZSTD=$OPT_ZSTD + ;; + esac + + dnl if given with a prefix, we set -L and -I based on that + if test -n "$PREFIX_ZSTD"; then + LIB_ZSTD="-lzstd" + LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff + CPP_ZSTD=-I${PREFIX_ZSTD}/include + DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff fi -fi -if test x$CURL_DISABLE_LDAPS != x1 ; then - curl_ldaps_msg="enabled" + LDFLAGS="$LDFLAGS $LD_ZSTD" + LDFLAGSPC="$LDFLAGSPC $LD_ZSTD" + CPPFLAGS="$CPPFLAGS $CPP_ZSTD" + LIBS="$LIB_ZSTD $LIBS" + + AC_CHECK_LIB(zstd, ZSTD_createDStream) + + AC_CHECK_HEADERS(zstd.h, + curl_zstd_msg="enabled (libzstd)" + HAVE_ZSTD=1 + AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use]) + ) + + if test X"$OPT_ZSTD" != Xoff && + test "$HAVE_ZSTD" != "1"; then + AC_MSG_ERROR([libzstd was not found where specified!]) + fi + + if test "$HAVE_ZSTD" = "1"; then + if test -n "$DIR_ZSTD"; then + dnl when the zstd shared lib were found in a path that the run-time + dnl linker doesn't search through, we need to add it to + dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to + dnl this + + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH]) + fi + fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libzstd" + else + dnl no zstd, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + fi fi dnl ********************************************************************** @@ -1067,64 +1607,81 @@ dnl ********************************************************************** AC_MSG_CHECKING([whether to enable IPv6]) AC_ARG_ENABLE(ipv6, -AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support]) -AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), +AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support]) +AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - ipv6=no - ;; - *) AC_MSG_RESULT(yes) - ipv6=yes - ;; + AC_MSG_RESULT(no) + ipv6=no + ;; + *) + AC_MSG_RESULT(yes) + ipv6=yes + ;; esac ], - AC_TRY_RUN([ /* is AF_INET6 available? */ -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#include -#endif -#include /* for exit() */ -main() -{ - if (socket(AF_INET6, SOCK_STREAM, 0) < 0) - exit(1); - else - exit(0); -} -], - AC_MSG_RESULT(yes) - ipv6=yes, - AC_MSG_RESULT(no) - ipv6=no, - AC_MSG_RESULT(yes) - ipv6=yes -)) + AC_COMPILE_IFELSE([ + AC_LANG_SOURCE([[ + /* are AF_INET6 and sockaddr_in6 available? */ + #include + #ifdef _WIN32 + #include + #include + #else + #include + #include + #ifdef __TANDEM + #include + #endif + #endif + int main(void) + { + int s = (int)sizeof(struct sockaddr_in6); + (void)s; + return socket(AF_INET6, SOCK_STREAM, 0) > 0; + } + ]]) + ], + AC_MSG_RESULT(yes) + ipv6=yes, + AC_MSG_RESULT(no) + ipv6=no + ) +) -if test "$ipv6" = "yes"; then - curl_ipv6_msg="enabled" +if test "$curl_cv_wince" = 'yes'; then + ipv6=no fi -# Check if struct sockaddr_in6 have sin6_scope_id member if test "$ipv6" = yes; then + curl_ipv6_msg="enabled" + AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support]) + IPV6_ENABLED=1 + AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) - AC_TRY_COMPILE([ -#include -#ifdef HAVE_WINSOCK2_H -#include -#include -#else -#include -#endif] , - struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes) - if test "$have_sin6_scope_id" = yes; then + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include + #ifdef _WIN32 + #include + #include + #else + #include + #ifdef __TANDEM + #include + #endif + #endif + ]], [[ + struct sockaddr_in6 s; + s.sin6_scope_id = 0; + (void)s; + ]]) + ],[ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) - else + ],[ AC_MSG_RESULT([no]) - fi + ]) fi dnl ********************************************************************** @@ -1132,32 +1689,43 @@ dnl Check if the operating system allows programs to write to their own argv[] dnl ********************************************************************** AC_MSG_CHECKING([if argv can be written to]) -AC_RUN_IFELSE([ - AC_LANG_SOURCE([[ -int main(int argc, char ** argv) { - argv[0][0] = ' '; - return (argv[0][0] == ' ')?0:1; +CURL_RUN_IFELSE([[ +int main(int argc, char **argv) +{ +#ifdef _WIN32 + /* on Windows, writing to the argv does not hide the argument in + process lists so it can just be skipped */ + (void)argc; + (void)argv; + return 1; +#else + (void)argc; + argv[0][0] = ' '; + return (argv[0][0] == ' ')?0:1; +#endif } - ]]) -],[ +]],[ curl_cv_writable_argv=yes ],[ curl_cv_writable_argv=no ],[ curl_cv_writable_argv=cross ]) +if test "$curl_cv_writable_argv" = 'cross' -a "$curl_cv_apple" = 'yes'; then + curl_cv_writable_argv=yes +fi case $curl_cv_writable_argv in -yes) - AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) - AC_MSG_RESULT(yes) - ;; -no) - AC_MSG_RESULT(no) - ;; -*) - AC_MSG_RESULT(no) - AC_MSG_WARN([the previous check could not be made default was used]) - ;; + yes) + AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) + AC_MSG_RESULT(yes) + ;; + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(no) + AC_MSG_WARN([the previous check could not be made default was used]) + ;; esac dnl ********************************************************************** @@ -1168,31 +1736,31 @@ dnl check for GSS-API stuff in the /usr as default GSSAPI_ROOT="/usr" AC_ARG_WITH(gssapi-includes, - AC_HELP_STRING([--with-gssapi-includes=DIR], - [Specify location of GSS-API headers]), - [ GSSAPI_INCS="-I$withval" - want_gss="yes" ] + AS_HELP_STRING([--with-gssapi-includes=DIR], [Specify location of GSS-API headers]), [ + GSSAPI_INCS="-I$withval" + want_gss="yes" + ] ) AC_ARG_WITH(gssapi-libs, - AC_HELP_STRING([--with-gssapi-libs=DIR], - [Specify location of GSS-API libs]), - [ GSSAPI_LIB_DIR="-L$withval" - want_gss="yes" ] + AS_HELP_STRING([--with-gssapi-libs=DIR], [Specify location of GSS-API libs]), [ + GSSAPI_LIB_DIR="-L$withval" + want_gss="yes" + ] ) AC_ARG_WITH(gssapi, - AC_HELP_STRING([--with-gssapi=DIR], - [Where to look for GSS-API]), [ - GSSAPI_ROOT="$withval" - if test x"$GSSAPI_ROOT" != xno; then - want_gss="yes" - if test x"$GSSAPI_ROOT" = xyes; then - dnl if yes, then use default root - GSSAPI_ROOT="/usr" + AS_HELP_STRING([--with-gssapi=DIR], [Where to look for GSS-API]), [ + GSSAPI_ROOT="$withval" + if test x"$GSSAPI_ROOT" != xno; then + want_gss="yes" + if test x"$GSSAPI_ROOT" = xyes; then + dnl if yes, then use default root + GSSAPI_ROOT="/usr" + fi fi - fi -]) + ] +) : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"} @@ -1201,14 +1769,21 @@ AC_MSG_CHECKING([if GSS-API support is requested]) if test x"$want_gss" = xyes; then AC_MSG_RESULT(yes) + if test $GSSAPI_ROOT != "/usr"; then + CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig) + else + CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) + fi if test -z "$GSSAPI_INCS"; then - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then - GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` - elif test -f "$KRB5CONFIG"; then - GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` - elif test "$GSSAPI_ROOT" != "yes"; then - GSSAPI_INCS="-I$GSSAPI_ROOT/include" - fi + if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then + GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` + elif test "$PKGCONFIG" != "no"; then + GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi` + elif test -f "$KRB5CONFIG"; then + GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` + elif test "$GSSAPI_ROOT" != "yes"; then + GSSAPI_INCS="-I$GSSAPI_ROOT/include" + fi fi CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" @@ -1227,34 +1802,30 @@ if test x"$want_gss" = xyes; then [], [not_mit=1], [ -AC_INCLUDES_DEFAULT -#ifdef HAVE_GSSAPI_GSSAPI_H -#include -#endif + AC_INCLUDES_DEFAULT + #ifdef HAVE_GSSAPI_GSSAPI_H + #include + #endif ]) if test "x$not_mit" = "x1"; then dnl MIT not found, check for Heimdal AC_CHECK_HEADER(gssapi.h, - [ - dnl found - AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal]) - ], - [ - dnl no header found, disabling GSS - want_gss=no - AC_MSG_WARN(disabling GSS-API support since no header files were found) - ] - ) + [], + [ + dnl no header found, disabling GSS + want_gss=no + AC_MSG_WARN(disabling GSS-API support since no header files were found) + ] + ) else dnl MIT found - AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos]) dnl check if we have a really old MIT Kerberos version (<= 1.2) AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include -#include + #include + #include + #include ]],[[ gss_import_name( (OM_uint32 *)0, @@ -1279,61 +1850,94 @@ if test x"$want_gss" = xyes; then AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries]) HAVE_GSSAPI=1 curl_gss_msg="enabled (MIT Kerberos/Heimdal)" + link_pkgconfig='' if test -n "$gnu_gss"; then curl_gss_msg="enabled (GNU GSS)" LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" + LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR" LIBS="-lgss $LIBS" + link_pkgconfig=1 elif test -z "$GSSAPI_LIB_DIR"; then - case $host in - *-*-darwin*) - LIBS="-lgssapi_krb5 -lresolv $LIBS" - ;; - *) - if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then - dnl krb5-config doesn't have --libs-only-L or similar, put everything - dnl into LIBS - gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` - LIBS="$gss_libs $LIBS" - elif test -f "$KRB5CONFIG"; then - dnl krb5-config doesn't have --libs-only-L or similar, put everything - dnl into LIBS - gss_libs=`$KRB5CONFIG --libs gssapi` - LIBS="$gss_libs $LIBS" + if test "$curl_cv_apple" = 'yes'; then + LIBS="-lgssapi_krb5 -lresolv $LIBS" + else + if test $GSSAPI_ROOT != "/usr"; then + CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig) + else + CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) + fi + if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then + dnl krb5-config doesn't have --libs-only-L or similar, put everything + dnl into LIBS + gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` + LIBS="$gss_libs $LIBS" + elif test "$PKGCONFIG" != "no"; then + gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi` + LIBS="$gss_libs $LIBS" + link_pkgconfig=1 + elif test -f "$KRB5CONFIG"; then + dnl krb5-config doesn't have --libs-only-L or similar, put everything + dnl into LIBS + gss_libs=`$KRB5CONFIG --libs gssapi` + LIBS="$gss_libs $LIBS" + link_pkgconfig=1 + else + case $host in + *-hp-hpux*) + gss_libname="gss" + ;; + *) + gss_libname="gssapi" + ;; + esac + + if test "$GSSAPI_ROOT" != "yes"; then + LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" + LDFLAGSPC="$LDFLAGSPC -L$GSSAPI_ROOT/lib$libsuff" + LIBS="-l$gss_libname $LIBS" else - case $host in - *-hp-hpux*) - gss_libname="gss" - ;; - *) - gss_libname="gssapi" - ;; - esac - - if test "$GSSAPI_ROOT" != "yes"; then - LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" - LIBS="-l$gss_libname $LIBS" - else - LIBS="-l$gss_libname $LIBS" - fi + LIBS="-l$gss_libname $LIBS" fi - ;; - esac + fi + fi else - LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" - case $host in - *-hp-hpux*) + LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" + LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR" + case $host in + *-hp-hpux*) LIBS="-lgss $LIBS" ;; - *) + *) LIBS="-lgssapi $LIBS" ;; - esac + esac + fi + if test -n "$link_pkgconfig"; then + if test -n "$gnu_gss"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gss" + elif test "x$not_mit" = "x1"; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE heimdal-gssapi" + else + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mit-krb5-gssapi" + fi fi else CPPFLAGS="$save_CPPFLAGS" fi +if test x"$want_gss" = xyes; then + AC_MSG_CHECKING([if we can link against GSS-API library]) + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([gss_init_sec_context]) + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.]) + ]) +fi + build_libstubgss=no if test x"$want_gss" = "xyes"; then build_libstubgss=yes @@ -1348,8 +1952,8 @@ dnl ------------------------------------------------------------- DEFAULT_SSL_BACKEND=no VALID_DEFAULT_SSL_BACKEND= AC_ARG_WITH(default-ssl-backend, -AC_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend]) -AC_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]), +AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend]) +AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]), [DEFAULT_SSL_BACKEND=$withval]) case "$DEFAULT_SSL_BACKEND" in no) @@ -1361,1603 +1965,960 @@ case "$DEFAULT_SSL_BACKEND" in ;; *) dnl --with-default-ssl-backend option used with name - AC_SUBST(DEFAULT_SSL_BACKEND) dnl needs to be validated below VALID_DEFAULT_SSL_BACKEND=no ;; esac -dnl ********************************************************************** - -dnl ------------------------------------------------- -dnl check winssl option before other SSL libraries -dnl ------------------------------------------------- - -OPT_WINSSL=no -AC_ARG_WITH(winssl,dnl -AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS]) -AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]), - OPT_WINSSL=$withval) - -AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)]) -if test -z "$ssl_backends" -o "x$OPT_WINSSL" != xno; then - ssl_msg= - if test "x$OPT_WINSSL" != "xno" && - test "x$curl_cv_native_windows" = "xyes"; then - AC_MSG_RESULT(yes) - AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support]) - AC_SUBST(USE_SCHANNEL, [1]) - ssl_msg="Windows-native" - test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - WINSSL_ENABLED=1 - # --with-winssl implies --enable-sspi - AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) - AC_SUBST(USE_WINDOWS_SSPI, [1]) - curl_sspi_msg="enabled" - LIBS="-lcrypt32 $LIBS" - else - AC_MSG_RESULT(no) +CURL_WITH_SCHANNEL +CURL_WITH_AMISSL +CURL_WITH_OPENSSL +CURL_WITH_GNUTLS +CURL_WITH_MBEDTLS +CURL_WITH_WOLFSSL +CURL_WITH_RUSTLS + +dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED +if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then + LIBS="-lcrypt32 $LIBS" + if test "$curl_cv_wince" = 'no'; then + LIBS="-ladvapi32 $LIBS" fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -else - AC_MSG_RESULT(no) fi -OPT_DARWINSSL=no -AC_ARG_WITH(darwinssl,dnl -AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS]) -AC_HELP_STRING([--without-darwinssl], [disable Apple OS native SSL/TLS]), - OPT_DARWINSSL=$withval) +dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer) +if test "x$curl_cv_native_windows" = "xyes" -a "$curl_cv_wince" = 'no'; then + LIBS="-lbcrypt $LIBS" +fi -AC_MSG_CHECKING([whether to enable Apple OS native SSL/TLS]) -if test -z "$ssl_backends" -o "x$OPT_DARWINSSL" != xno; then - if test "x$OPT_DARWINSSL" != "xno" && - test -d "/System/Library/Frameworks/Security.framework"; then - AC_MSG_RESULT(yes) - AC_DEFINE(USE_DARWINSSL, 1, [to enable Apple OS native SSL/TLS support]) - AC_SUBST(USE_DARWINSSL, [1]) - ssl_msg="Apple OS-native" - test darwinssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - DARWINSSL_ENABLED=1 - LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security" +case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$RUSTLS_ENABLED" in + x) + AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more. +Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl or --with-rustls to address this.]) + ;; + x1) + # one SSL backend is enabled + SSL_ENABLED="1" + AC_MSG_NOTICE([built with one SSL backend]) + ;; + xD) + # explicitly built without TLS + ;; + xD*) + AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library +(e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl, --with-rustls). +Since these are conflicting parameters, verify which is the desired one and drop the other.]) + ;; + *) + # more than one SSL backend is enabled + SSL_ENABLED="1" + CURL_WITH_MULTI_SSL="1" + AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends]) + AC_MSG_NOTICE([built with multiple SSL backends]) + ;; +esac + +if test -n "$ssl_backends"; then + curl_ssl_msg="enabled ($ssl_backends)" +fi + +if test no = "$VALID_DEFAULT_SSL_BACKEND"; then + if test -n "$SSL_ENABLED"; then + AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!]) else - AC_MSG_RESULT(no) + AC_MSG_ERROR([Default SSL backend requires SSL!]) fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -else - AC_MSG_RESULT(no) +elif test yes = "$VALID_DEFAULT_SSL_BACKEND"; then + AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend]) fi dnl ********************************************************************** -dnl Check for the presence of SSL libraries and headers +dnl Check for the CA bundle dnl ********************************************************************** -dnl Default to compiler & linker defaults for SSL files & libraries. -OPT_SSL=off -dnl Default to no CA bundle -ca="no" -AC_ARG_WITH(ssl,dnl -AC_HELP_STRING([--with-ssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) -AC_HELP_STRING([--without-ssl], [disable OpenSSL]), - OPT_SSL=$withval) +if test -n "$check_for_ca_bundle"; then + CURL_CHECK_CA_BUNDLE + CURL_CHECK_CA_EMBED +fi -if test -z "$ssl_backends" -o "x$OPT_SSL" != xno && - test X"$OPT_SSL" != Xno; then - ssl_msg= +AM_CONDITIONAL(CURL_CA_EMBED_SET, test "x$CURL_CA_EMBED" != "x") - dnl backup the pre-ssl variables - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" +dnl ---------------------- +dnl check unsafe CA search +dnl ---------------------- - dnl This is for Msys/Mingw - case $host in - *-*-msys* | *-*-mingw*) - AC_MSG_CHECKING([for gdi32]) - my_ac_save_LIBS=$LIBS - LIBS="-lgdi32 $LIBS" - AC_TRY_LINK([#include - #include ], - [GdiFlush();], - [ dnl worked! - AC_MSG_RESULT([yes])], - [ dnl failed, restore LIBS - LIBS=$my_ac_save_LIBS - AC_MSG_RESULT(no)] - ) +if test "$curl_cv_native_windows" = "yes"; then + AC_MSG_CHECKING([whether to enable unsafe CA bundle search in PATH on Windows]) + AC_ARG_ENABLE(ca-search, +AS_HELP_STRING([--enable-ca-search],[Enable unsafe CA bundle search in PATH on Windows (default)]) +AS_HELP_STRING([--disable-ca-search],[Disable unsafe CA bundle search in PATH on Windows]), + [ case "$enableval" in + no) + AC_MSG_RESULT([no]) + AC_DEFINE(CURL_DISABLE_CA_SEARCH, 1, [If unsafe CA bundle search in PATH on Windows is disabled]) ;; - esac + *) + AC_MSG_RESULT([yes]) + ;; + esac ], + AC_MSG_RESULT([yes]) + ) +fi - case "$OPT_SSL" in - yes) - dnl --with-ssl (without path) used - if test x$cross_compiling != xyes; then - dnl only do pkg-config magic when not cross-compiling - PKGTEST="yes" - fi - PREFIX_OPENSSL=/usr/local/ssl - LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" - ;; - off) - dnl no --with-ssl option given, just check default places - if test x$cross_compiling != xyes; then - dnl only do pkg-config magic when not cross-compiling - PKGTEST="yes" - fi - PREFIX_OPENSSL= - ;; - *) - dnl check the given --with-ssl spot - PKGTEST="no" - PREFIX_OPENSSL=$OPT_SSL +dnl -------------------- +dnl check safe CA search +dnl -------------------- - dnl Try pkg-config even when cross-compiling. Since we - dnl specify PKG_CONFIG_LIBDIR we're only looking where - dnl the user told us to look - OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig" - AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"]) - if test -f "$OPENSSL_PCDIR/openssl.pc"; then - PKGTEST="yes" - fi +if test "$curl_cv_native_windows" = "yes"; then + AC_MSG_CHECKING([whether to enable safe CA bundle search (within the curl tool directory) on Windows]) + AC_ARG_ENABLE(ca-search-safe, +AS_HELP_STRING([--enable-ca-search-safe],[Enable safe CA bundle search]) +AS_HELP_STRING([--disable-ca-search-safe],[Disable safe CA bundle search (default)]), + [ case "$enableval" in + yes) + AC_MSG_RESULT([yes]) + AC_DEFINE(CURL_CA_SEARCH_SAFE, 1, [If safe CA bundle search is enabled]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac ], + AC_MSG_RESULT([no]) + ) +fi - dnl in case pkg-config comes up empty, use what we got - dnl via --with-ssl - LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" - if test "$PREFIX_OPENSSL" != "/usr" ; then - SSL_LDFLAGS="-L$LIB_OPENSSL" - SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" - fi - SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl" - ;; - esac +dnl ********************************************************************** +dnl Check for libpsl +dnl ********************************************************************** - if test "$PKGTEST" = "yes"; then - - CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR]) - - if test "$PKGCONFIG" != "no" ; then - SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl - $PKGCONFIG --libs-only-l openssl 2>/dev/null` - - SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl - $PKGCONFIG --libs-only-L openssl 2>/dev/null` - - SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl - $PKGCONFIG --cflags-only-I openssl 2>/dev/null` - - AC_SUBST(SSL_LIBS) - AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"]) - AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"]) - AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"]) - - LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` - - dnl use the values pkg-config reported. This is here - dnl instead of below with CPPFLAGS and LDFLAGS because we only - dnl learn about this via pkg-config. If we only have - dnl the argument to --with-ssl we don't know what - dnl additional libs may be necessary. Hope that we - dnl don't need any. - LIBS="$SSL_LIBS $LIBS" - fi - fi - - dnl finally, set flags to use SSL - CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" - LDFLAGS="$LDFLAGS $SSL_LDFLAGS" - - AC_CHECK_LIB(crypto, HMAC_Update,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS" - ],[ - LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" - CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include" - AC_CHECK_LIB(crypto, HMAC_Init_ex,[ - HAVECRYPTO="yes" - LIBS="-lcrypto $LIBS"], [ - - dnl still no, but what about with -ldl? - AC_MSG_CHECKING([OpenSSL linking with -ldl]) - LIBS="-ldl $LIBS" - AC_TRY_LINK( - [ - #include - ], - [ - ERR_clear_error(); - ], - [ - AC_MSG_RESULT(yes) - HAVECRYPTO="yes" - ], - [ - AC_MSG_RESULT(no) - dnl ok, so what about bouth -ldl and -lpthread? - - AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread]) - LIBS="-lpthread $LIBS" - AC_TRY_LINK( - [ - #include - ], - [ - ERR_clear_error(); - ], - [ - AC_MSG_RESULT(yes) - HAVECRYPTO="yes" - ], - [ - AC_MSG_RESULT(no) - LDFLAGS="$CLEANLDFLAGS" - CPPFLAGS="$CLEANCPPFLAGS" - LIBS="$CLEANLIBS" - - ]) - - ]) - - ]) - ]) +dnl Default to compiler & linker defaults for LIBPSL files & libraries. +OPT_LIBPSL=off +AC_ARG_WITH(libpsl,dnl +AS_HELP_STRING([--with-libpsl=PATH],[Where to look for libpsl, PATH points to the LIBPSL installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--without-libpsl], [disable LIBPSL]), + OPT_LIBPSL=$withval) - if test X"$HAVECRYPTO" = X"yes"; then - dnl This is only reasonable to do if crypto actually is there: check for - dnl SSL libs NOTE: it is important to do this AFTER the crypto lib - - AC_CHECK_LIB(ssl, SSL_connect) - - if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff - AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use); - OLIBS=$LIBS - LIBS="-lRSAglue -lrsaref $LIBS" - AC_CHECK_LIB(ssl, SSL_connect) - if test "$ac_cv_lib_ssl_SSL_connect" != yes; then - dnl still no SSL_connect - AC_MSG_RESULT(no) - LIBS=$OLIBS - else - AC_MSG_RESULT(yes) - fi +if test X"$OPT_LIBPSL" != Xno; then + dnl backup the pre-libpsl variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - else + case "$OPT_LIBPSL" in + yes|off) + dnl --with-libpsl (without path) used + CURL_CHECK_PKGCONFIG(libpsl) - dnl Have the libraries--check for OpenSSL headers - AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ - openssl/pem.h openssl/ssl.h openssl/err.h, - ssl_msg="OpenSSL" - test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - OPENSSL_ENABLED=1 - AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])) - - if test $ac_cv_header_openssl_x509_h = no; then - dnl we don't use the "action" part of the AC_CHECK_HEADERS macro - dnl since 'err.h' might in fact find a krb4 header with the same - dnl name - AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h) - - if test $ac_cv_header_x509_h = yes && - test $ac_cv_header_crypto_h = yes && - test $ac_cv_header_ssl_h = yes; then - dnl three matches - ssl_msg="OpenSSL" - OPENSSL_ENABLED=1 - fi + if test "$PKGCONFIG" != "no"; then + LIB_PSL=`$PKGCONFIG --libs-only-l libpsl` + LD_PSL=`$PKGCONFIG --libs-only-L libpsl` + CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl` + else + dnl no libpsl pkg-config found + LIB_PSL="-lpsl" fi - fi - if test X"$OPENSSL_ENABLED" != X"1"; then - LIBS="$CLEANLIBS" - fi + ;; + *) + dnl use the given --with-libpsl spot + LIB_PSL="-lpsl" + PREFIX_PSL=$OPT_LIBPSL + ;; + esac - if test X"$OPT_SSL" != Xoff && - test "$OPENSSL_ENABLED" != "1"; then - AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!]) - fi + dnl if given with a prefix, we set -L and -I based on that + if test -n "$PREFIX_PSL"; then + LD_PSL=-L${PREFIX_PSL}/lib$libsuff + CPP_PSL=-I${PREFIX_PSL}/include fi - if test X"$OPENSSL_ENABLED" = X"1"; then - dnl If the ENGINE library seems to be around, check for the OpenSSL engine - dnl stuff, it is kind of "separated" from the main SSL check - AC_CHECK_FUNC(ENGINE_init, - [ - AC_CHECK_HEADERS(openssl/engine.h) - AC_CHECK_FUNCS( ENGINE_load_builtin_engines ) - ]) - - dnl These can only exist if OpenSSL exists - dnl Older versions of Cyassl (some time before 2.9.4) don't have - dnl SSL_get_shutdown (but this check won't actually detect it there - dnl as it's a macro that needs the header files be included) - - AC_CHECK_FUNCS( RAND_egd \ - ENGINE_cleanup \ - SSL_get_shutdown \ - SSLv2_client_method ) - - AC_MSG_CHECKING([for BoringSSL]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - #ifndef OPENSSL_IS_BORINGSSL - #error not boringssl - #endif - ]]) - ],[ - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1, - [Define to 1 if using BoringSSL.]) - ssl_msg="BoringSSL" - ],[ - AC_MSG_RESULT([no]) - ]) + LDFLAGS="$LDFLAGS $LD_PSL" + LDFLAGSPC="$LDFLAGSPC $LD_PSL" + CPPFLAGS="$CPPFLAGS $CPP_PSL" + LIBS="$LIB_PSL $LIBS" - AC_MSG_CHECKING([for libressl]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include - ]],[[ - int dummy = LIBRESSL_VERSION_NUMBER; - ]]) - ],[ - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1, - [Define to 1 if using libressl.]) - ssl_msg="libressl" - ],[ - AC_MSG_RESULT([no]) - ]) - fi + AC_CHECK_LIB(psl, psl_builtin, + [ + AC_CHECK_HEADERS(libpsl.h, + curl_psl_msg="enabled" + AC_DEFINE(USE_LIBPSL, 1, [if libpsl is in use]) + USE_LIBPSL=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libpsl" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) - if test "$OPENSSL_ENABLED" = "1"; then - if test -n "$LIB_OPENSSL"; then - dnl when the ssl shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH - dnl to prevent further configure tests to fail due to this - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH]) - fi - fi - CURL_CHECK_OPENSSL_API + if test "$USE_LIBPSL" != "1"; then + AC_MSG_ERROR([libpsl libs and/or directories were not found where specified!]) fi - - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" fi +AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"]) + dnl ********************************************************************** -dnl Check for the random seed preferences +dnl Check for libgsasl dnl ********************************************************************** -if test X"$OPENSSL_ENABLED" = X"1"; then - AC_ARG_WITH(egd-socket, - AC_HELP_STRING([--with-egd-socket=FILE], - [Entropy Gathering Daemon socket pathname]), - [ EGD_SOCKET="$withval" ] - ) - if test -n "$EGD_SOCKET" ; then - AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET", - [your Entropy Gathering Daemon socket pathname] ) - fi - - dnl Check for user-specified random device - AC_ARG_WITH(random, - AC_HELP_STRING([--with-random=FILE], - [read randomness from FILE (default=/dev/urandom)]), - [ RANDOM_FILE="$withval" ], - [ - if test x$cross_compiling != xyes; then - dnl Check for random device - AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) - else - AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling]) - fi - ] +AC_ARG_WITH(libgsasl, + AS_HELP_STRING([--without-libgsasl], + [disable libgsasl support for SCRAM]), + with_libgsasl=$withval, + with_libgsasl=yes) +if test $with_libgsasl != "no"; then + AC_SEARCH_LIBS(gsasl_init, gsasl, + [curl_gsasl_msg="enabled"; + AC_DEFINE([USE_GSASL], [1], [GSASL support enabled]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libgsasl" + ], + [curl_gsasl_msg="no (libgsasl not found)"; + AC_MSG_WARN([libgsasl was not found]) + ] ) - if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then - AC_SUBST(RANDOM_FILE) - AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE", - [a suitable file to read random data from]) - fi -fi - -dnl --- -dnl We require OpenSSL with SRP support. -dnl --- -if test "$OPENSSL_ENABLED" = "1"; then - AC_CHECK_LIB(crypto, SRP_Calc_client_key, - [ - AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key]) - AC_SUBST(HAVE_OPENSSL_SRP, [1]) - ]) fi +AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"]) -dnl ---------------------------------------------------- -dnl check for GnuTLS -dnl ---------------------------------------------------- +AC_ARG_WITH(libmetalink,, + AC_MSG_ERROR([--with-libmetalink and --without-libmetalink no longer work!])) -dnl Default to compiler & linker defaults for GnuTLS files & libraries. -OPT_GNUTLS=no +dnl ********************************************************************** +dnl Check for the presence of libssh2 libraries and headers +dnl ********************************************************************** -AC_ARG_WITH(gnutls,dnl -AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]) -AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]), - OPT_GNUTLS=$withval) - -if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then - ssl_msg= - - if test X"$OPT_GNUTLS" != Xno; then - - addld="" - addlib="" - gtlslib="" - version="" - addcflags="" - - if test "x$OPT_GNUTLS" = "xyes"; then - dnl this is with no partiular path given - CURL_CHECK_PKGCONFIG(gnutls) - - if test "$PKGCONFIG" != "no" ; then - addlib=`$PKGCONFIG --libs-only-l gnutls` - addld=`$PKGCONFIG --libs-only-L gnutls` - addcflags=`$PKGCONFIG --cflags-only-I gnutls` - version=`$PKGCONFIG --modversion gnutls` - gtlslib=`echo $addld | $SED -e 's/-L//'` - else - dnl without pkg-config, we try libgnutls-config as that was how it - dnl used to be done - check=`libgnutls-config --version 2>/dev/null` - if test -n "$check"; then - addlib=`libgnutls-config --libs` - addcflags=`libgnutls-config --cflags` - version=`libgnutls-config --version` - gtlslib=`libgnutls-config --prefix`/lib$libsuff - fi - fi - else - dnl this is with a given path, first check if there's a libgnutls-config - dnl there and if not, make an educated guess - cfg=$OPT_GNUTLS/bin/libgnutls-config - check=`$cfg --version 2>/dev/null` - if test -n "$check"; then - addlib=`$cfg --libs` - addcflags=`$cfg --cflags` - version=`$cfg --version` - gtlslib=`$cfg --prefix`/lib$libsuff - else - dnl without pkg-config and libgnutls-config, we guess a lot! - addlib=-lgnutls - addld=-L$OPT_GNUTLS/lib$libsuff - addcflags=-I$OPT_GNUTLS/include - version="" # we just don't know - gtlslib=$OPT_GNUTLS/lib$libsuff - fi - fi +dnl Default to compiler & linker defaults for libssh2 files & libraries. +OPT_LIBSSH2=off +AC_ARG_WITH(libssh2,dnl +AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--with-libssh2], [enable libssh2]), + OPT_LIBSSH2=$withval, OPT_LIBSSH2=no) - if test -z "$version"; then - dnl lots of efforts, still no go - version="unknown" - fi - if test -n "$addlib"; then +OPT_LIBSSH=off +AC_ARG_WITH(libssh,dnl +AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--with-libssh], [enable libssh]), + OPT_LIBSSH=$withval, OPT_LIBSSH=no) - CLEANLIBS="$LIBS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLDFLAGS="$LDFLAGS" +OPT_WOLFSSH=off +AC_ARG_WITH(wolfssh,dnl +AS_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--with-wolfssh], [enable wolfssh]), + OPT_WOLFSSH=$withval, OPT_WOLFSSH=no) - LIBS="$addlib $LIBS" - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi +if test X"$OPT_LIBSSH2" != Xno; then + dnl backup the pre-libssh2 variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - AC_CHECK_LIB(gnutls, gnutls_check_version, - [ - AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) - AC_SUBST(USE_GNUTLS, [1]) - GNUTLS_ENABLED=1 - USE_GNUTLS="yes" - ssl_msg="GnuTLS" - test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - LIBS="$CLEANLIBS" - CPPFLAGS="$CLEANCPPFLAGS" - ]) - - if test "x$USE_GNUTLS" = "xyes"; then - AC_MSG_NOTICE([detected GnuTLS version $version]) - - if test -n "$gtlslib"; then - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to - dnl LD_LIBRARY_PATH to prevent further configure tests to fail - dnl due to this - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH]) - fi - fi - AC_CHECK_FUNCS([gnutls_certificate_set_x509_key_file2 gnutls_alpn_set_protocols gnutls_ocsp_req_init]) + case "$OPT_LIBSSH2" in + yes) + dnl --with-libssh2 (without path) used + CURL_CHECK_PKGCONFIG(libssh2) + + if test "$PKGCONFIG" != "no"; then + LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` + LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` + CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` + version=`$PKGCONFIG --modversion libssh2` + DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'` fi - fi - - fi dnl GNUTLS not disabled - - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -fi - -dnl --- -dnl Check which crypto backend GnuTLS uses -dnl --- + ;; + off) + dnl no --with-libssh2 option given, just check default places + ;; + *) + dnl use the given --with-libssh2 spot + PREFIX_SSH2=$OPT_LIBSSH2 + ;; + esac -if test "$GNUTLS_ENABLED" = "1"; then - USE_GNUTLS_NETTLE= - # First check if we can detect either crypto library via transitive linking - AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) - if test "$USE_GNUTLS_NETTLE" = ""; then - AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ]) - fi - # If not, try linking directly to both of them to see if they are available - if test "$USE_GNUTLS_NETTLE" = ""; then - AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) - fi - if test "$USE_GNUTLS_NETTLE" = ""; then - AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ]) - fi - if test "$USE_GNUTLS_NETTLE" = ""; then - AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found]) - fi - if test "$USE_GNUTLS_NETTLE" = "1"; then - AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend]) - AC_SUBST(USE_GNUTLS_NETTLE, [1]) - LIBS="-lnettle $LIBS" - else - LIBS="-lgcrypt $LIBS" + dnl if given with a prefix, we set -L and -I based on that + if test -n "$PREFIX_SSH2"; then + LIB_SSH2="-lssh2" + LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff + CPP_SSH2=-I${PREFIX_SSH2}/include + DIR_SSH2=${PREFIX_SSH2}/lib$libsuff fi -fi - -dnl --- -dnl We require GnuTLS with SRP support. -dnl --- -if test "$GNUTLS_ENABLED" = "1"; then - AC_CHECK_LIB(gnutls, gnutls_srp_verifier, - [ - AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier]) - AC_SUBST(HAVE_GNUTLS_SRP, [1]) - ]) -fi - -dnl ---------------------------------------------------- -dnl check for PolarSSL -dnl ---------------------------------------------------- - -dnl Default to compiler & linker defaults for PolarSSL files & libraries. -OPT_POLARSSL=no - -_cppflags=$CPPFLAGS -_ldflags=$LDFLAGS -AC_ARG_WITH(polarssl,dnl -AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root]) -AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]), - OPT_POLARSSL=$withval) -if test -z "$ssl_backends" -o "x$OPT_POLARSSL" != xno; then - ssl_msg= - - if test X"$OPT_POLARSSL" != Xno; then - - if test "$OPT_POLARSSL" = "yes"; then - OPT_POLARSSL="" - fi - - if test -z "$OPT_POLARSSL" ; then - dnl check for lib first without setting any new path + LDFLAGS="$LDFLAGS $LD_SSH2" + LDFLAGSPC="$LDFLAGSPC $LD_SSH2" + CPPFLAGS="$CPPFLAGS $CPP_SSH2" + LIBS="$LIB_SSH2 $LIBS" - AC_CHECK_LIB(polarssl, havege_init, - dnl libpolarssl found, set the variable - [ - AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled]) - AC_SUBST(USE_POLARSSL, [1]) - POLARSSL_ENABLED=1 - USE_POLARSSL="yes" - ssl_msg="PolarSSL" - test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ]) - fi + dnl check for function added in libssh2 version 1.2.8 + AC_CHECK_LIB(ssh2, libssh2_free) - addld="" - addlib="" - addcflags="" - polarssllib="" + AC_CHECK_HEADER(libssh2.h, + curl_ssh_msg="enabled (libssh2)" + AC_DEFINE(USE_LIBSSH2, 1, [if libssh2 is in use]) + USE_LIBSSH2=1 + ) - if test "x$USE_POLARSSL" != "xyes"; then - dnl add the path and test again - addld=-L$OPT_POLARSSL/lib$libsuff - addcflags=-I$OPT_POLARSSL/include - polarssllib=$OPT_POLARSSL/lib$libsuff + if test X"$OPT_LIBSSH2" != Xoff && + test "$USE_LIBSSH2" != "1"; then + AC_MSG_ERROR([libssh2 libs and/or directories were not found where specified!]) + fi - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi + if test "$USE_LIBSSH2" = "1"; then + if test -n "$DIR_SSH2"; then + dnl when the libssh2 shared libs were found in a path that the run-time + dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl to prevent further configure tests to fail due to this - AC_CHECK_LIB(polarssl, ssl_init, - [ - AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled]) - AC_SUBST(USE_POLARSSL, [1]) - POLARSSL_ENABLED=1 - USE_POLARSSL="yes" - ssl_msg="PolarSSL" - test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - ]) - fi - - if test "x$USE_POLARSSL" = "xyes"; then - AC_MSG_NOTICE([detected PolarSSL]) - - LIBS="-lpolarssl $LIBS" - - if test -n "$polarssllib"; then - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to - dnl LD_LIBRARY_PATH to prevent further configure tests to fail - dnl due to this - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH]) - fi + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH]) fi fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh2" + else + dnl no libssh2, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + fi +elif test X"$OPT_LIBSSH" != Xno; then + dnl backup the pre-libssh variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - fi dnl PolarSSL not disabled - - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -fi - -dnl ---------------------------------------------------- -dnl check for mbedTLS -dnl ---------------------------------------------------- + case "$OPT_LIBSSH" in + yes) + dnl --with-libssh (without path) used + CURL_CHECK_PKGCONFIG(libssh) + + if test "$PKGCONFIG" != "no"; then + LIB_SSH=`$PKGCONFIG --libs-only-l libssh` + LD_SSH=`$PKGCONFIG --libs-only-L libssh` + CPP_SSH=`$PKGCONFIG --cflags-only-I libssh` + version=`$PKGCONFIG --modversion libssh` + DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'` + fi -OPT_MBEDTLS=no + ;; + off) + dnl no --with-libssh option given, just check default places + ;; + *) + dnl use the given --with-libssh spot + PREFIX_SSH=$OPT_LIBSSH + ;; + esac -_cppflags=$CPPFLAGS -_ldflags=$LDFLAGS -AC_ARG_WITH(mbedtls,dnl -AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]) -AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]), - OPT_MBEDTLS=$withval) + dnl if given with a prefix, we set -L and -I based on that + if test -n "$PREFIX_SSH"; then + LIB_SSH="-lssh" + LD_SSH=-L${PREFIX_SSH}/lib$libsuff + CPP_SSH=-I${PREFIX_SSH}/include + DIR_SSH=${PREFIX_SSH}/lib$libsuff + fi -if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then - ssl_msg= + LDFLAGS="$LDFLAGS $LD_SSH" + LDFLAGSPC="$LDFLAGSPC $LD_SSH" + CPPFLAGS="$CPPFLAGS $CPP_SSH" + LIBS="$LIB_SSH $LIBS" - if test X"$OPT_MBEDTLS" != Xno; then + AC_CHECK_LIB(ssh, ssh_new) - if test "$OPT_MBEDTLS" = "yes"; then - OPT_MBEDTLS="" - fi + AC_CHECK_HEADER(libssh/libssh.h, + curl_ssh_msg="enabled (libssh)" + AC_DEFINE(USE_LIBSSH, 1, [if libssh is in use]) + USE_LIBSSH=1 + ) - if test -z "$OPT_MBEDTLS" ; then - dnl check for lib first without setting any new path + if test X"$OPT_LIBSSH" != Xoff && + test "$USE_LIBSSH" != "1"; then + AC_MSG_ERROR([libssh libs and/or directories were not found where specified!]) + fi - AC_CHECK_LIB(mbedtls, mbedtls_havege_init, - dnl libmbedtls found, set the variable - [ - AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) - AC_SUBST(USE_MBEDTLS, [1]) - MBEDTLS_ENABLED=1 - USE_MBEDTLS="yes" - ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], [], -lmbedx509 -lmbedcrypto) + if test "$USE_LIBSSH" = "1"; then + if test "$curl_cv_native_windows" = "yes"; then + dnl for if_nametoindex + LIBS="-liphlpapi $LIBS" fi + if test -n "$DIR_SSH"; then + dnl when the libssh shared libs were found in a path that the run-time + dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH + dnl to prevent further configure tests to fail due to this - addld="" - addlib="" - addcflags="" - mbedtlslib="" - - if test "x$USE_MBEDTLS" != "xyes"; then - dnl add the path and test again - addld=-L$OPT_MBEDTLS/lib$libsuff - addcflags=-I$OPT_MBEDTLS/include - mbedtlslib=$OPT_MBEDTLS/lib$libsuff - - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi - - AC_CHECK_LIB(mbedtls, mbedtls_ssl_init, - [ - AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) - AC_SUBST(USE_MBEDTLS, [1]) - MBEDTLS_ENABLED=1 - USE_MBEDTLS="yes" - ssl_msg="mbedTLS" - test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - ], -lmbedx509 -lmbedcrypto) - fi - - if test "x$USE_MBEDTLS" = "xyes"; then - AC_MSG_NOTICE([detected mbedTLS]) - - LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" - - if test -n "$mbedtlslib"; then - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to - dnl LD_LIBRARY_PATH to prevent further configure tests to fail - dnl due to this - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mbedtlslib" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $mbedtlslib to LD_LIBRARY_PATH]) - fi + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH]) fi fi + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh" + else + dnl no libssh, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + fi +elif test X"$OPT_WOLFSSH" != Xno; then + dnl backup the pre-wolfssh variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - fi dnl mbedTLS not disabled - - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -fi - -dnl ---------------------------------------------------- -dnl check for CyaSSL -dnl ---------------------------------------------------- + if test "$OPT_WOLFSSH" != yes; then + WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config" + WOLFSSH_LIBS=`$WOLFCONFIG --libs` + LDFLAGS="$LDFLAGS $WOLFSSH_LIBS" + LDFLAGSPC="$LDFLAGSPC $WOLFSSH_LIBS" + CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`" + fi -dnl Default to compiler & linker defaults for CyaSSL files & libraries. -OPT_CYASSL=no + AC_CHECK_LIB(wolfssh, wolfSSH_Init) -_cppflags=$CPPFLAGS -_ldflags=$LDFLAGS -AC_ARG_WITH(cyassl,dnl -AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)]) -AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]), - OPT_CYASSL=$withval) + AC_CHECK_HEADERS(wolfssh/ssh.h, + curl_ssh_msg="enabled (wolfSSH)" + AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use]) + USE_WOLFSSH=1 + ) +fi -if test -z "$ssl_backends" -o "x$OPT_CYASSL" != xno; then - ssl_msg= +dnl ********************************************************************** +dnl Check for LDAP (after the SSL libraries) +dnl ********************************************************************** - if test X"$OPT_CYASSL" != Xno; then +LDAPLIBNAME="" +AC_ARG_WITH(ldap-lib, +AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]), + [LDAPLIBNAME="$withval"]) - if test "$OPT_CYASSL" = "yes"; then - OPT_CYASSL="" +LBERLIBNAME="" +AC_ARG_WITH(lber-lib, +AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]), + [LBERLIBNAME="$withval"]) + +dnl Handle argument to --with-ldap. +clean_LDAP_CPPFLAGS=$CPPFLAGS +clean_LDAP_LDFLAGS=$LDFLAGS +clean_LDAP_LIBS=$LIBS +OPT_LDAP=off +AC_ARG_WITH(ldap, +AS_HELP_STRING([--with-ldap=PATH],[Where to look for LDAP, PATH points to the LDAP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--without-ldap], [disable LDAP]), + OPT_LDAP=$withval) + +case "$OPT_LDAP" in + no) + dnl --without-ldap option used + want_ldap="no" + ;; + yes) + dnl --with-ldap option used without path + want_ldap="yes" + ;; + off) + dnl no --with-ldap option given, don't change anything + want_ldap="default" + ;; + *) + dnl --with-ldap option used with path + want_ldap="yes" + if test -d "$OPT_LDAP/lib$libsuff"; then + LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib$libsuff" + DIR_LDAP="$OPT_LDAP/lib$libsuff" + elif test -d "$OPT_LDAP/lib"; then + LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib" + DIR_LDAP="$OPT_LDAP/lib" fi - - dnl This should be reworked to use pkg-config instead - - cyassllibname=cyassl - - if test -z "$OPT_CYASSL" ; then - dnl check for lib in system default first - - AC_CHECK_LIB(cyassl, CyaSSL_Init, - dnl libcyassl found, set the variable - [ - AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled]) - AC_SUBST(USE_CYASSL, [1]) - CYASSL_ENABLED=1 - USE_CYASSL="yes" - ssl_msg="CyaSSL" - test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ]) + if test -d "$OPT_LDAP/include"; then + CPPFLAGS="$CPPFLAGS -I$OPT_LDAP/include" fi + ldap_askedfor="yes" + ;; +esac - addld="" - addlib="" - addcflags="" - cyassllib="" - - if test "x$USE_CYASSL" != "xyes"; then - dnl add the path and test again - addld=-L$OPT_CYASSL/lib$libsuff - addcflags=-I$OPT_CYASSL/include - cyassllib=$OPT_CYASSL/lib$libsuff - - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi +if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then - AC_CHECK_LIB(cyassl, CyaSSL_Init, - [ - AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled]) - AC_SUBST(USE_CYASSL, [1]) - CYASSL_ENABLED=1 - USE_CYASSL="yes" - ssl_msg="CyaSSL" - test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - cyassllib="" - ]) - fi - - addld="" - addlib="" - addcflags="" - - if test "x$USE_CYASSL" != "xyes"; then - dnl libcyassl renamed to libwolfssl as of 3.4.0 - addld=-L$OPT_CYASSL/lib$libsuff - addcflags=-I$OPT_CYASSL/include - cyassllib=$OPT_CYASSL/lib$libsuff - - LDFLAGS="$LDFLAGS $addld" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi + CURL_CHECK_HEADER_LBER + CURL_CHECK_HEADER_LDAP + CURL_CHECK_HEADER_LDAP_SSL - cyassllibname=wolfssl - my_ac_save_LIBS="$LIBS" - LIBS="-l$cyassllibname -lm $LIBS" + if test -z "$LDAPLIBNAME"; then + if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then + dnl Windows uses a single and unique LDAP library name + LDAPLIBNAME="wldap32" + LBERLIBNAME="no" + fi + fi - AC_MSG_CHECKING([for CyaSSL_Init in -lwolfssl]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ -/* These aren't needed for detection and confuse WolfSSL. - They are set up properly later if it is detected. */ -#undef SIZEOF_LONG -#undef SIZEOF_LONG_LONG -#include - ]],[[ - return CyaSSL_Init(); - ]]) - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(USE_CYASSL, 1, [if CyaSSL/WolfSSL is enabled]) - AC_SUBST(USE_CYASSL, [1]) - CYASSL_ENABLED=1 - USE_CYASSL="yes" - ssl_msg="WolfSSL" - test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - AC_MSG_RESULT(no) - CPPFLAGS=$_cppflags - LDFLAGS=$_ldflags - cyassllib="" - ]) - LIBS="$my_ac_save_LIBS" - fi - - if test "x$USE_CYASSL" = "xyes"; then - AC_MSG_NOTICE([detected $cyassllibname]) - - dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined! - AC_CHECK_SIZEOF(long long) - - dnl Versions since at least 2.6.0 may have options.h - AC_CHECK_HEADERS(cyassl/options.h) - - dnl Versions since at least 2.9.4 renamed error.h to error-ssl.h - AC_CHECK_HEADERS(cyassl/error-ssl.h) - - LIBS="-l$cyassllibname -lm $LIBS" - - if test "x$cyassllibname" = "xwolfssl"; then - dnl Recent WolfSSL versions build without SSLv3 by default - dnl WolfSSL needs configure --enable-opensslextra to have *get_peer* - AC_CHECK_FUNCS(wolfSSLv3_client_method \ - wolfSSL_CTX_UseSupportedCurve \ - wolfSSL_get_peer_certificate \ - wolfSSL_UseALPN) + if test "$LDAPLIBNAME"; then + dnl If we have both LDAP and LBER library names, check if we need both + if test "$LBERLIBNAME" -a "$LBERLIBNAME" != "no"; then + dnl Try LDAP first, then with LBER if needed + AC_CHECK_LIB("$LDAPLIBNAME", ldap_init, [ldap_lib_ok=yes], [ldap_lib_ok=no]) + if test "$ldap_lib_ok" = "no"; then + dnl LDAP alone failed, try with LBER using a different function + AC_CHECK_LIB("$LDAPLIBNAME", ldap_unbind, [ldap_lib_ok=yes], [ldap_lib_ok=no], [-l$LBERLIBNAME]) + if test "$ldap_lib_ok" = "yes"; then + dnl We need both libraries + LIBS="-l$LDAPLIBNAME -l$LBERLIBNAME $LIBS" + fi else - dnl Cyassl needs configure --enable-opensslextra to have *get_peer* - AC_CHECK_FUNCS(CyaSSL_CTX_UseSupportedCurve \ - CyaSSL_get_peer_certificate) + dnl LDAP alone is sufficient + LIBS="-l$LDAPLIBNAME $LIBS" fi + else + dnl Only check LDAP library + AC_CHECK_LIB("$LDAPLIBNAME", ldap_init, [ldap_lib_ok=yes; LIBS="-l$LDAPLIBNAME $LIBS"], [ldap_lib_ok=no]) + fi - if test -n "$cyassllib"; then - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to - dnl LD_LIBRARY_PATH to prevent further configure tests to fail - dnl due to this - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH]) - fi + if test "$ldap_lib_ok" = "no"; then + if test -n "$ldap_askedfor"; then + AC_MSG_ERROR([couldn't detect the LDAP libraries]) fi - + AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled]) + AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) + CURL_DISABLE_LDAP=1 + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + CURL_DISABLE_LDAPS=1 + dnl restore original flags + CPPFLAGS=$clean_LDAP_CPPFLAGS + LDFLAGS=$clean_LDAP_LDFLAGS + LIBS=$clean_LDAP_LIBS fi - - fi dnl CyaSSL not disabled - - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" + else + dnl Try to find the right ldap libraries for this system + CURL_CHECK_LIBS_LDAP + case X-"$curl_cv_ldap_LIBS" in + X-unknown) + if test -n "$ldap_askedfor"; then + AC_MSG_ERROR([couldn't detect the LDAP libraries]) + fi + AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled]) + AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) + CURL_DISABLE_LDAP=1 + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + CURL_DISABLE_LDAPS=1 + dnl restore original flags + CPPFLAGS=$clean_LDAP_CPPFLAGS + LDFLAGS=$clean_LDAP_LDFLAGS + LIBS=$clean_LDAP_LIBS + ;; + esac + fi fi -dnl ---------------------------------------------------- -dnl NSS. Only check if GnuTLS and OpenSSL are not enabled -dnl ---------------------------------------------------- - -dnl Default to compiler & linker defaults for NSS files & libraries. -OPT_NSS=no - -AC_ARG_WITH(nss,dnl -AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]) -AC_HELP_STRING([--without-nss], [disable NSS detection]), - OPT_NSS=$withval) - -if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then - ssl_msg= - - if test X"$OPT_NSS" != Xno; then - - addld="" - addlib="" - addcflags="" - nssprefix="" - version="" +if test x$CURL_DISABLE_LDAP != x1; then + dnl Add to library path if needed + if test -n "$DIR_LDAP"; then + dnl when the ldap shared lib were found in a path that the run-time + dnl linker doesn't search through, we need to add it to + dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to + dnl this + + if test "x$cross_compiling" != "xyes"; then + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LDAP" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_LDAP to CURL_LIBRARY_PATH]) + fi + fi - if test "x$OPT_NSS" = "xyes"; then + if test "$LBERLIBNAME"; then + dnl If name is "no" then don't define this library at all + dnl (it's only needed if libldap.so's dependencies are broken). + dnl Skip this check if we already determined we need both libraries above + if test "$LBERLIBNAME" != "no" -a "$ldap_lib_ok" != "yes"; then + AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ + AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled]) + AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) + CURL_DISABLE_LDAP=1 + AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) + CURL_DISABLE_LDAPS=1 + dnl restore original flags + CPPFLAGS=$clean_LDAP_CPPFLAGS + LDFLAGS=$clean_LDAP_LDFLAGS + LIBS=$clean_LDAP_LIBS + ] + ) + fi + fi +fi - CURL_CHECK_PKGCONFIG(nss) +if test x$CURL_DISABLE_LDAP != x1; then + AC_CHECK_FUNCS([ldap_url_parse \ + ldap_init_fd]) - if test "$PKGCONFIG" != "no" ; then - addlib=`$PKGCONFIG --libs nss` - addcflags=`$PKGCONFIG --cflags nss` - version=`$PKGCONFIG --modversion nss` - nssprefix=`$PKGCONFIG --variable=prefix nss` - else - dnl Without pkg-config, we check for nss-config - - check=`nss-config --version 2>/dev/null` - if test -n "$check"; then - addlib=`nss-config --libs` - addcflags=`nss-config --cflags` - version=`nss-config --version` - nssprefix=`nss-config --prefix` - else - addlib="-lnss3" - addcflags="" - version="unknown" - fi - fi + if test "$LDAPLIBNAME" = "wldap32"; then + curl_ldap_msg="enabled (winldap)" + AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation]) + else + if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then + curl_ldap_msg="enabled (OpenLDAP)" + AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code]) + USE_OPENLDAP=1 else - NSS_PCDIR="$OPT_NSS/lib/pkgconfig" - if test -f "$NSS_PCDIR/nss.pc"; then - CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR]) - if test "$PKGCONFIG" != "no" ; then - addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss` - addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss` - addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss` - version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss` - nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss` - fi - fi + curl_ldap_msg="enabled (ancient OpenLDAP)" fi + fi +fi - if test -z "$addlib"; then - # Without pkg-config, we'll kludge in some defaults - AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.]) - addld="-L$OPT_NSS/lib" - addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4" - addcflags="-I$OPT_NSS/include" - version="unknown" - nssprefix=$OPT_NSS - fi - - CLEANLDFLAGS="$LDFLAGS" - CLEANLIBS="$LIBS" - CLEANCPPFLAGS="$CPPFLAGS" - - LDFLAGS="$addld $LDFLAGS" - LIBS="$addlib $LIBS" - if test "$addcflags" != "-I/usr/include"; then - CPPFLAGS="$CPPFLAGS $addcflags" - fi - - dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0 - AC_CHECK_LIB(nss3, SSL_VersionRangeSet, - [ - AC_DEFINE(USE_NSS, 1, [if NSS is enabled]) - AC_SUBST(USE_NSS, [1]) - USE_NSS="yes" - NSS_ENABLED=1 - ssl_msg="NSS" - test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes - ], - [ - LDFLAGS="$CLEANLDFLAGS" - LIBS="$CLEANLIBS" - CPPFLAGS="$CLEANCPPFLAGS" - ]) - - if test "x$USE_NSS" = "xyes"; then - AC_MSG_NOTICE([detected NSS version $version]) - - dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS - NSS_LIBS=$addlib - AC_SUBST([NSS_LIBS]) - - dnl when shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to - dnl LD_LIBRARY_PATH to prevent further configure tests to fail - dnl due to this - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH]) - fi - - fi dnl NSS found - - fi dnl NSS not disabled - - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" +if test x$CURL_DISABLE_LDAPS != x1; then + curl_ldaps_msg="enabled" fi -OPT_AXTLS=off +dnl ********************************************************************** +dnl Check for the presence of LIBRTMP libraries and headers +dnl ********************************************************************** -AC_ARG_WITH(axtls,dnl -AC_HELP_STRING([--with-axtls=PATH],[Where to look for axTLS, PATH points to the axTLS installation prefix (default: /usr/local). Ignored if another SSL engine is selected.]) -AC_HELP_STRING([--without-axtls], [disable axTLS]), - OPT_AXTLS=$withval) +dnl Default to compiler & linker defaults for LIBRTMP files & libraries. +OPT_LIBRTMP=off +AC_ARG_WITH(librtmp,dnl +AS_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) +AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]), + OPT_LIBRTMP=$withval) -if test -z "$ssl_backends" -o "x$OPT_AXTLS" != xno; then - ssl_msg= - if test X"$OPT_AXTLS" != Xno; then - dnl backup the pre-axtls variables - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" +if test X"$OPT_LIBRTMP" != Xno; then + dnl backup the pre-librtmp variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" - case "$OPT_AXTLS" in + case "$OPT_LIBRTMP" in yes) - dnl --with-axtls (without path) used - PREFIX_AXTLS=/usr/local - LIB_AXTLS="$PREFIX_AXTLS/lib" - LDFLAGS="$LDFLAGS -L$LIB_AXTLS" - CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" + dnl --with-librtmp (without path) used + CURL_CHECK_PKGCONFIG(librtmp) + + if test "$PKGCONFIG" != "no"; then + LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` + LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` + CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` + version=`$PKGCONFIG --modversion librtmp` + DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'` + else + dnl To avoid link errors, we do not allow --librtmp without + dnl a pkgconfig file + AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) + fi + ;; off) - dnl no --with-axtls option given, just check default places - PREFIX_AXTLS= + dnl no --with-librtmp option given, just check default places + LIB_RTMP="-lrtmp" ;; *) - dnl check the given --with-axtls spot - PREFIX_AXTLS=$OPT_AXTLS - LIB_AXTLS="$PREFIX_AXTLS/lib" - LDFLAGS="$LDFLAGS -L$LIB_AXTLS" - CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include" + dnl use the given --with-librtmp spot + LIB_RTMP="-lrtmp" + PREFIX_RTMP=$OPT_LIBRTMP ;; - esac - - AC_CHECK_LIB(axtls, ssl_version,[ - LIBS="-laxtls $LIBS" - AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled]) - AC_SUBST(USE_AXTLS, [1]) - AXTLS_ENABLED=1 - USE_AXTLS="yes" - ssl_msg="axTLS" - test axtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes + esac - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $LIB_AXTLS to LD_LIBRARY_PATH]) - fi - ],[ - LDFLAGS="$CLEANLDFLAGS" - CPPFLAGS="$CLEANCPPFLAGS" - LIBS="$CLEANLIBS" - ]) + dnl if given with a prefix, we set -L and -I based on that + if test -n "$PREFIX_RTMP"; then + LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff + CPP_RTMP=-I${PREFIX_RTMP}/include + DIR_RTMP=${PREFIX_RTMP}/lib$libsuff fi - test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" -fi - -case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$MBEDTLS_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" in -x) - AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.]) - AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.]) - ;; -x1) - # one SSL backend is enabled - AC_SUBST(SSL_ENABLED) - SSL_ENABLED="1" - AC_MSG_NOTICE([built with one SSL backend]) - ;; -*) - # more than one SSL backend is enabled - AC_SUBST(SSL_ENABLED) - SSL_ENABLED="1" - AC_SUBST(CURL_WITH_MULTI_SSL) - CURL_WITH_MULTI_SSL="1" - AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends]) - AC_MSG_NOTICE([built with multiple SSL backends]) - ;; -esac -if test -n "$ssl_backends"; then - curl_ssl_msg="enabled ($ssl_backends)" -fi + LDFLAGS="$LDFLAGS $LD_RTMP" + LDFLAGSPC="$LDFLAGSPC $LD_RTMP" + CPPFLAGS="$CPPFLAGS $CPP_RTMP" + LIBS="$LIB_RTMP $LIBS" -if test no = "$VALID_DEFAULT_SSL_BACKEND" -then - if test -n "$SSL_ENABLED" - then - AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!]) - else - AC_MSG_ERROR([Default SSL backend requires SSL!]) + AC_CHECK_LIB(rtmp, RTMP_Init, + [ + AC_CHECK_HEADERS(librtmp/rtmp.h, + curl_rtmp_msg="enabled (librtmp)" + AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use]) + USE_LIBRTMP=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE librtmp" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + + if test X"$OPT_LIBRTMP" != Xoff && + test "$USE_LIBRTMP" != "1"; then + AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) fi -elif test yes = "$VALID_DEFAULT_SSL_BACKEND" -then - AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend]) fi dnl ********************************************************************** -dnl Check for the CA bundle +dnl Check for linker switch for versioned symbols dnl ********************************************************************** -CURL_CHECK_CA_BUNDLE +versioned_symbols_flavour= +AC_MSG_CHECKING([whether versioned symbols are wanted]) +AC_ARG_ENABLE(versioned-symbols, +AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library]) +AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([if libraries can be versioned]) + GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` + if test -z "$GLD"; then + AC_MSG_RESULT(no) + AC_MSG_WARN([You need an ld version supporting the --version-script option]) + else + AC_MSG_RESULT(yes) + if test "x$enableval" != "xyes"; then + versioned_symbols_flavour="$enableval" + elif test "x$CURL_WITH_MULTI_SSL" = "x1"; then + versioned_symbols_flavour="MULTISSL_" + elif test "x$OPENSSL_ENABLED" = "x1"; then + versioned_symbols_flavour="OPENSSL_" + elif test "x$MBEDTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="MBEDTLS_" + elif test "x$WOLFSSL_ENABLED" = "x1"; then + versioned_symbols_flavour="WOLFSSL_" + elif test "x$GNUTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="GNUTLS_" + elif test "x$RUSTLS_ENABLED" = "x1"; then + versioned_symbols_flavour="RUSTLS_" + else + versioned_symbols_flavour="" + fi + versioned_symbols="yes" + fi + ;; -dnl ********************************************************************** -dnl Check for libpsl -dnl ********************************************************************** + esac +], [ + AC_MSG_RESULT(no) +] +) -AC_ARG_WITH(libpsl, - AS_HELP_STRING([--without-libpsl], - [disable support for libpsl cookie checking]), - with_libpsl=$withval, - with_libpsl=yes) -if test $with_libpsl != "no"; then - AC_SEARCH_LIBS(psl_builtin, psl, - [curl_psl_msg="yes"; - AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled]) - ], - [curl_psl_msg="no (libpsl not found)"; - AC_MSG_WARN([libpsl was not found]) - ] - ) -fi -AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "yes"]) +AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX], ["$versioned_symbols_flavour"]) +AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME], ["4"]) dnl Keep in sync with VERSIONCHANGE - VERSIONDEL in lib/Makefile.soname +AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS], + [test "x$versioned_symbols" = 'xyes']) -dnl ********************************************************************** -dnl Check for libmetalink -dnl ********************************************************************** +dnl ---------------------------- +dnl check Windows Unicode option +dnl ---------------------------- -OPT_LIBMETALINK=no +if test "$curl_cv_wince" = 'yes'; then + want_winuni="yes" +else + want_winuni="no" +fi +if test "$curl_cv_native_windows" = "yes"; then + if test "$curl_cv_winuwp" = 'yes'; then + want_winuni="yes" + else + AC_MSG_CHECKING([whether to enable Windows Unicode (Windows native builds only)]) + AC_ARG_ENABLE(windows-unicode, +AS_HELP_STRING([--enable-windows-unicode],[Enable Windows Unicode]) +AS_HELP_STRING([--disable-windows-unicode],[Disable Windows Unicode (default)]), + [ case "$enableval" in + yes) + want_winuni="yes" + AC_MSG_RESULT([yes]) + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac ], + AC_MSG_RESULT([no]) + ) + fi -AC_ARG_WITH(libmetalink,dnl -AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root]) -AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]), - OPT_LIBMETALINK=$withval) + if test "$want_winuni" = "yes"; then + CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE" + fi +fi -if test X"$OPT_LIBMETALINK" != Xno; then +AM_CONDITIONAL([USE_UNICODE], [test "$want_winuni" = "yes"]) - addld="" - addlib="" - addcflags="" - version="" - libmetalinklib="" +dnl ------------------------------------------------- +dnl check WinIDN option before other IDN libraries +dnl ------------------------------------------------- - PKGTEST="no" - if test "x$OPT_LIBMETALINK" = "xyes"; then - dnl this is with no partiular path given - PKGTEST="yes" - CURL_CHECK_PKGCONFIG(libmetalink) - else - dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path. - LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig" - AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"]) - if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then - PKGTEST="yes" - fi - if test "$PKGTEST" = "yes"; then - CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR]) - fi - fi - if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then - addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl - $PKGCONFIG --libs-only-l libmetalink` - addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl - $PKGCONFIG --libs-only-L libmetalink` - addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl - $PKGCONFIG --cflags-only-I libmetalink` - version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl - $PKGCONFIG --modversion libmetalink` - libmetalinklib=`echo $addld | $SED -e 's/-L//'` - fi - if test -n "$addlib"; then +tst_links_winidn='no' +if test "$curl_cv_native_windows" = 'yes'; then + AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)]) + OPT_WINIDN="default" + AC_ARG_WITH(winidn, +AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN]) +AS_HELP_STRING([--without-winidn], [disable Windows native IDN]), + OPT_WINIDN=$withval) + case "$OPT_WINIDN" in + no|default) + dnl --without-winidn option used or configure option not specified + want_winidn="no" + AC_MSG_RESULT([no]) + ;; + yes) + dnl --with-winidn option used without path + want_winidn="yes" + want_winidn_path="default" + AC_MSG_RESULT([yes]) + ;; + *) + dnl --with-winidn option used with path + want_winidn="yes" + want_winidn_path="$withval" + AC_MSG_RESULT([yes ($withval)]) + ;; + esac + if test "$want_winidn" = "yes"; then + dnl WinIDN library support has been requested clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" + clean_LDFLAGSPC="$LDFLAGSPC" clean_LIBS="$LIBS" - CPPFLAGS="$clean_CPPFLAGS $addcflags" - LDFLAGS="$clean_LDFLAGS $addld" - LIBS="$addlib $clean_LIBS" - AC_MSG_CHECKING([if libmetalink is recent enough]) + WINIDN_LIBS="-lnormaliz" + WINIDN_CPPFLAGS="" + # + if test "$want_winidn_path" != "default"; then + dnl path has been specified + dnl pkg-config not available or provides no info + WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" + WINIDN_CPPFLAGS="-I$want_winidn_path/include" + fi + # + CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" + LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" + LDFLAGSPC="$LDFLAGSPC $WINIDN_LDFLAGS" + LIBS="$WINIDN_LIBS $LIBS" + # + AC_MSG_CHECKING([if IdnToUnicode can be linked]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -# include + #include ]],[[ - if(0 != metalink_strerror(0)) /* added in 0.1.0 */ - return 1; + #if (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600) && \ + (!defined(WINVER) || WINVER < 0x600) + WINBASEAPI int WINAPI IdnToUnicode(DWORD dwFlags, + const WCHAR *lpASCIICharStr, + int cchASCIIChar, + WCHAR *lpUnicodeCharStr, + int cchUnicodeChar); + #endif + IdnToUnicode(0, NULL, 0, NULL, 0); ]]) ],[ - AC_MSG_RESULT([yes ($version)]) - want_metalink="yes" + AC_MSG_RESULT([yes]) + tst_links_winidn="yes" ],[ - AC_MSG_RESULT([no ($version)]) - AC_MSG_NOTICE([libmetalink library defective or too old]) - want_metalink="no" + AC_MSG_RESULT([no]) + tst_links_winidn="no" ]) - CPPFLAGS="$clean_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS" - LIBS="$clean_LIBS" - if test "$want_metalink" = "yes"; then - dnl finally libmetalink will be used - AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support]) - LIBMETALINK_LIBS=$addlib - LIBMETALINK_LDFLAGS=$addld - LIBMETALINK_CPPFLAGS=$addcflags - AC_SUBST([LIBMETALINK_LIBS]) - AC_SUBST([LIBMETALINK_LDFLAGS]) - AC_SUBST([LIBMETALINK_CPPFLAGS]) - curl_mtlnk_msg="enabled" - fi - - fi -fi - -dnl ********************************************************************** -dnl Check for the presence of LIBSSH2 libraries and headers -dnl ********************************************************************** - -dnl Default to compiler & linker defaults for LIBSSH2 files & libraries. -OPT_LIBSSH2=off -AC_ARG_WITH(libssh2,dnl -AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) -AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]), - OPT_LIBSSH2=$withval) - -if test X"$OPT_LIBSSH2" != Xno; then - dnl backup the pre-libssh2 variables - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" - - case "$OPT_LIBSSH2" in - yes) - dnl --with-libssh2 (without path) used - CURL_CHECK_PKGCONFIG(libssh2) - - if test "$PKGCONFIG" != "no" ; then - LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` - LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` - CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` - version=`$PKGCONFIG --modversion libssh2` - DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'` - fi - - ;; - off) - dnl no --with-libssh2 option given, just check default places - ;; - *) - dnl use the given --with-libssh2 spot - PREFIX_SSH2=$OPT_LIBSSH2 - ;; - esac - - dnl if given with a prefix, we set -L and -I based on that - if test -n "$PREFIX_SSH2"; then - LIB_SSH2="-lssh2" - LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff - CPP_SSH2=-I${PREFIX_SSH2}/include - DIR_SSH2=${PREFIX_SSH2}/lib$libsuff - fi - - LDFLAGS="$LDFLAGS $LD_SSH2" - CPPFLAGS="$CPPFLAGS $CPP_SSH2" - LIBS="$LIB_SSH2 $LIBS" - - AC_CHECK_LIB(ssh2, libssh2_channel_open_ex) - - AC_CHECK_HEADERS(libssh2.h, - curl_ssh_msg="enabled (libSSH2)" - LIBSSH2_ENABLED=1 - AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use]) - AC_SUBST(USE_LIBSSH2, [1]) - ) - - if test X"$OPT_LIBSSH2" != Xoff && - test "$LIBSSH2_ENABLED" != "1"; then - AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!]) - fi - - if test "$LIBSSH2_ENABLED" = "1"; then - if test -n "$DIR_SSH2"; then - dnl when the libssh2 shared libs were found in a path that the run-time - dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH - dnl to prevent further configure tests to fail due to this - - if test "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH]) - fi - fi - else - dnl no libssh2, revert back to clean variables - LDFLAGS=$CLEANLDFLAGS - CPPFLAGS=$CLEANCPPFLAGS - LIBS=$CLEANLIBS - fi -fi - -dnl ********************************************************************** -dnl Check for the presence of LIBRTMP libraries and headers -dnl ********************************************************************** - -dnl Default to compiler & linker defaults for LIBRTMP files & libraries. -OPT_LIBRTMP=off -AC_ARG_WITH(librtmp,dnl -AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) -AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]), - OPT_LIBRTMP=$withval) - -if test X"$OPT_LIBRTMP" != Xno; then - dnl backup the pre-librtmp variables - CLEANLDFLAGS="$LDFLAGS" - CLEANCPPFLAGS="$CPPFLAGS" - CLEANLIBS="$LIBS" - - case "$OPT_LIBRTMP" in - yes) - dnl --with-librtmp (without path) used - CURL_CHECK_PKGCONFIG(librtmp) - - if test "$PKGCONFIG" != "no" ; then - LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` - LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` - CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` - version=`$PKGCONFIG --modversion librtmp` - DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'` + # + if test "$tst_links_winidn" = "yes"; then + AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).]) + IDN_ENABLED=1 + curl_idn_msg="enabled (Windows-native)" else - dnl To avoid link errors, we do not allow --librtmp without - dnl a pkgconfig file - AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) + AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) + CPPFLAGS="$clean_CPPFLAGS" + LDFLAGS="$clean_LDFLAGS" + LDFLAGSPC="$clean_LDFLAGSPC" + LIBS="$clean_LIBS" fi - - ;; - off) - dnl no --with-librtmp option given, just check default places - LIB_RTMP="-lrtmp" - ;; - *) - dnl use the given --with-librtmp spot - LIB_RTMP="-lrtmp" - PREFIX_RTMP=$OPT_LIBRTMP - ;; - esac - - dnl if given with a prefix, we set -L and -I based on that - if test -n "$PREFIX_RTMP"; then - LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff - CPP_RTMP=-I${PREFIX_RTMP}/include - DIR_RTMP=${PREFIX_RTMP}/lib$libsuff - fi - - LDFLAGS="$LDFLAGS $LD_RTMP" - CPPFLAGS="$CPPFLAGS $CPP_RTMP" - LIBS="$LIB_RTMP $LIBS" - - AC_CHECK_LIB(rtmp, RTMP_Init, - [ - AC_CHECK_HEADERS(librtmp/rtmp.h, - curl_rtmp_msg="enabled (librtmp)" - LIBRTMP_ENABLED=1 - AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use]) - AC_SUBST(USE_LIBRTMP, [1]) - ) - ], - dnl not found, revert back to clean variables - LDFLAGS=$CLEANLDFLAGS - CPPFLAGS=$CLEANCPPFLAGS - LIBS=$CLEANLIBS - ) - - if test X"$OPT_LIBRTMP" != Xoff && - test "$LIBRTMP_ENABLED" != "1"; then - AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) fi - fi dnl ********************************************************************** -dnl Check for linker switch for versioned symbols +dnl Check for the presence of AppleIDN dnl ********************************************************************** -versioned_symbols_flavour= -AC_MSG_CHECKING([whether versioned symbols are wanted]) -AC_ARG_ENABLE(versioned-symbols, -AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library]) -AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]), -[ case "$enableval" in - yes) AC_MSG_RESULT(yes) - AC_MSG_CHECKING([if libraries can be versioned]) - GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` - if test -z "$GLD"; then - AC_MSG_RESULT(no) - AC_MSG_WARN([You need an ld version supporting the --version-script option]) - else - AC_MSG_RESULT(yes) - if test "x$CURL_WITH_MULTI_SSL" = "x1"; then - versioned_symbols_flavour="MULTISSL_" - elif test "x$OPENSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="OPENSSL_" - elif test "x$GNUTLS_ENABLED" = "x1"; then - versioned_symbols_flavour="GNUTLS_" - elif test "x$NSS_ENABLED" = "x1"; then - versioned_symbols_flavour="NSS_" - elif test "x$POLARSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="POLARSSL_" - elif test "x$CYASSL_ENABLED" = "x1"; then - versioned_symbols_flavour="CYASSL_" - elif test "x$AXTLS_ENABLED" = "x1"; then - versioned_symbols_flavour="AXTLS_" - elif test "x$WINSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="WINSSL_" - elif test "x$DARWINSSL_ENABLED" = "x1"; then - versioned_symbols_flavour="DARWINSSL_" - else - versioned_symbols_flavour="" - fi - versioned_symbols="yes" - fi - ;; - - *) AC_MSG_RESULT(no) - ;; +tst_links_appleidn='no' +if test "$curl_cv_apple" = 'yes'; then + AC_MSG_CHECKING([whether to build with Apple IDN]) + OPT_IDN="default" + AC_ARG_WITH(apple-idn, +AS_HELP_STRING([--with-apple-idn],[Enable AppleIDN]) +AS_HELP_STRING([--without-apple-idn],[Disable AppleIDN]), + [OPT_IDN=$withval]) + case "$OPT_IDN" in + yes) + dnl --with-apple-idn option used + AC_MSG_RESULT([yes, check]) + AC_CHECK_LIB(icucore, uidna_openUTS46, + [ + AC_CHECK_HEADERS(unicode/uidna.h, + curl_idn_msg="enabled (AppleIDN)" + AC_DEFINE(USE_APPLE_IDN, 1, [if AppleIDN]) + USE_APPLE_IDN=1 + IDN_ENABLED=1 + LIBS="-licucore -liconv $LIBS" + tst_links_appleidn='yes' + ) + ]) + ;; + *) + AC_MSG_RESULT([no]) + ;; esac -], [ -AC_MSG_RESULT(no) -] -) - -AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR], - ["$versioned_symbols_flavour"]) -AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS], - [test "x$versioned_symbols" = 'xyes']) - -dnl ------------------------------------------------- -dnl check winidn option before other IDN libraries -dnl ------------------------------------------------- - -AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)]) -OPT_WINIDN="default" -AC_ARG_WITH(winidn, -AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN]) -AC_HELP_STRING([--without-winidn], [disable Windows native IDN]), - OPT_WINIDN=$withval) -case "$OPT_WINIDN" in - no|default) - dnl --without-winidn option used or configure option not specified - want_winidn="no" - AC_MSG_RESULT([no]) - ;; - yes) - dnl --with-winidn option used without path - want_winidn="yes" - want_winidn_path="default" - AC_MSG_RESULT([yes]) - ;; - *) - dnl --with-winidn option used with path - want_winidn="yes" - want_winidn_path="$withval" - AC_MSG_RESULT([yes ($withval)]) - ;; -esac - -if test "$want_winidn" = "yes"; then - dnl winidn library support has been requested - clean_CPPFLAGS="$CPPFLAGS" - clean_LDFLAGS="$LDFLAGS" - clean_LIBS="$LIBS" - WINIDN_LIBS="-lnormaliz" - WINIDN_CPPFLAGS="-DWINVER=0x0600" - # - if test "$want_winidn_path" != "default"; then - dnl path has been specified - dnl pkg-config not available or provides no info - WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" - WINIDN_CPPFLAGS="-I$want_winidn_path/include" - WINIDN_DIR="$want_winidn_path/lib$libsuff" - fi - # - CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" - LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" - LIBS="$WINIDN_LIBS $LIBS" - # - AC_MSG_CHECKING([if IdnToUnicode can be linked]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #include - ]],[[ - IdnToUnicode(0, NULL, 0, NULL, 0); - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_winidn="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_winidn="no" - ]) - # - if test "$tst_links_winidn" = "yes"; then - AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).]) - AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.]) - AC_SUBST([IDN_ENABLED], [1]) - curl_idn_msg="enabled (Windows-native)" - else - AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) - CPPFLAGS="$clean_CPPFLAGS" - LDFLAGS="$clean_LDFLAGS" - LIBS="$clean_LIBS" - fi fi dnl ********************************************************************** -dnl Check for the presence of IDN libraries and headers +dnl Check for the presence of libidn2 dnl ********************************************************************** AC_MSG_CHECKING([whether to build with libidn2]) OPT_IDN="default" AC_ARG_WITH(libidn2, -AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage]) -AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]), +AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage]) +AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]), [OPT_IDN=$withval]) -case "$OPT_IDN" in - no) - dnl --without-libidn2 option used - want_idn="no" - AC_MSG_RESULT([no]) - ;; - default) - dnl configure option not specified - want_idn="yes" - want_idn_path="default" - AC_MSG_RESULT([(assumed) yes]) - ;; - yes) - dnl --with-libidn2 option used without path - want_idn="yes" - want_idn_path="default" - AC_MSG_RESULT([yes]) - ;; - *) - dnl --with-libidn2 option used with path - want_idn="yes" - want_idn_path="$withval" - AC_MSG_RESULT([yes ($withval)]) - ;; -esac +if test "x$tst_links_winidn" = "xyes"; then + want_idn="no" + AC_MSG_RESULT([no (using WinIDN instead)]) +elif test "x$tst_links_appleidn" = "xyes"; then + want_idn="no" + AC_MSG_RESULT([no (using AppleIDN instead)]) +else + case "$OPT_IDN" in + no) + dnl --without-libidn2 option used + want_idn="no" + AC_MSG_RESULT([no]) + ;; + default) + dnl configure option not specified + want_idn="yes" + want_idn_path="default" + AC_MSG_RESULT([(assumed) yes]) + ;; + yes) + dnl --with-libidn2 option used without path + want_idn="yes" + want_idn_path="default" + AC_MSG_RESULT([yes]) + ;; + *) + dnl --with-libidn2 option used with path + want_idn="yes" + want_idn_path="$withval" + AC_MSG_RESULT([yes ($withval)]) + ;; + esac +fi if test "$want_idn" = "yes"; then dnl idn library support has been requested clean_CPPFLAGS="$CPPFLAGS" clean_LDFLAGS="$LDFLAGS" + clean_LDFLAGSPC="$LDFLAGSPC" clean_LIBS="$LIBS" PKGCONFIG="no" # @@ -2972,7 +2933,7 @@ if test "$want_idn" = "yes"; then $PKGCONFIG --libs-only-L libidn2 2>/dev/null` IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl $PKGCONFIG --cflags-only-I libidn2 2>/dev/null` - IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` + IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'` else dnl pkg-config not available or provides no info IDN_LIBS="-lidn2" @@ -2987,7 +2948,7 @@ if test "$want_idn" = "yes"; then IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null` IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null` IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null` - IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` + IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'` else dnl pkg-config not available or provides no info IDN_LIBS="-lidn2" @@ -3008,6 +2969,7 @@ if test "$want_idn" = "yes"; then # CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS" LDFLAGS="$LDFLAGS $IDN_LDFLAGS" + LDFLAGSPC="$LDFLAGSPC $IDN_LDFLAGS" LIBS="$IDN_LIBS $LIBS" # AC_MSG_CHECKING([if idn2_lookup_ul can be linked]) @@ -3027,27 +2989,24 @@ if test "$want_idn" = "yes"; then AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).]) dnl different versions of libidn have different setups of these: - AC_SUBST([IDN_ENABLED], [1]) + IDN_ENABLED=1 curl_idn_msg="enabled (libidn2)" if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH]) + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH]) fi + LIBCURL_PC_REQUIRES_PRIVATE="libidn2 $LIBCURL_PC_REQUIRES_PRIVATE" else - AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) + AC_MSG_WARN([Cannot find libidn2]) CPPFLAGS="$clean_CPPFLAGS" LDFLAGS="$clean_LDFLAGS" + LDFLAGSPC="$clean_LDFLAGSPC" LIBS="$clean_LIBS" + want_idn="no" fi fi - -dnl Let's hope this split URL remains working: -dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \ -dnl genprogc/thread_quick_ref.htm - - dnl ********************************************************************** dnl Check for nghttp2 dnl ********************************************************************** @@ -3055,685 +3014,2099 @@ dnl ********************************************************************** OPT_H2="yes" if test "x$disable_http" = "xyes"; then - # without HTTP, nghttp2 is no use + # without HTTP nghttp2 is no use OPT_H2="no" fi AC_ARG_WITH(nghttp2, -AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage]) -AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]), +AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage]) +AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]), [OPT_H2=$withval]) case "$OPT_H2" in no) dnl --without-nghttp2 option used - want_h2="no" + want_nghttp2="no" ;; yes) dnl --with-nghttp2 option used without path - want_h2="default" - want_h2_path="" + want_nghttp2="default" + want_nghttp2_path="" + want_nghttp2_pkg_config_path="" ;; *) dnl --with-nghttp2 option used with path - want_h2="yes" - want_h2_path="$withval/lib/pkgconfig" + want_nghttp2="yes" + want_nghttp2_path="$withval" + want_nghttp2_pkg_config_path="$withval/lib/pkgconfig" ;; esac -curl_h2_msg="disabled (--with-nghttp2)" -if test X"$want_h2" != Xno; then +if test X"$want_nghttp2" != Xno; then dnl backup the pre-nghttp2 variables CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" CLEANCPPFLAGS="$CPPFLAGS" CLEANLIBS="$LIBS" - CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path) + CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path) - if test "$PKGCONFIG" != "no" ; then - LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) + if test "$PKGCONFIG" != "no"; then + LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) $PKGCONFIG --libs-only-l libnghttp2` AC_MSG_NOTICE([-l is $LIB_H2]) - CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl + CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl $PKGCONFIG --cflags-only-I libnghttp2` AC_MSG_NOTICE([-I is $CPP_H2]) - LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) + LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) $PKGCONFIG --libs-only-L libnghttp2` AC_MSG_NOTICE([-L is $LD_H2]) - LDFLAGS="$LDFLAGS $LD_H2" - CPPFLAGS="$CPPFLAGS $CPP_H2" - LIBS="$LIB_H2 $LIBS" - - # use nghttp2_option_set_no_recv_client_magic to require nghttp2 - # >= 1.0.0 - AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic, - [ - AC_CHECK_HEADERS(nghttp2/nghttp2.h, - curl_h2_msg="enabled (nghttp2)" - NGHTTP2_ENABLED=1 - AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use]) - AC_SUBST(USE_NGHTTP2, [1]) - ) - ], - dnl not found, revert back to clean variables - LDFLAGS=$CLEANLDFLAGS - CPPFLAGS=$CLEANCPPFLAGS - LIBS=$CLEANLIBS - ) - + DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'` + elif test x"$want_nghttp2_path" != x; then + LIB_H2="-lnghttp2" + LD_H2=-L${want_nghttp2_path}/lib$libsuff + CPP_H2=-I${want_nghttp2_path}/include + DIR_H2=${want_nghttp2_path}/lib$libsuff + elif test X"$want_nghttp2" != Xdefault; then + dnl no nghttp2 pkg-config found and no custom directory specified, + dnl deal with it + AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.]) else - dnl no nghttp2 pkg-config found, deal with it - if test X"$want_h2" != Xdefault; then - dnl To avoid link errors, we do not allow --with-nghttp2 without - dnl a pkgconfig file - AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.]) - fi + LIB_H2="-lnghttp2" fi + LDFLAGS="$LDFLAGS $LD_H2" + LDFLAGSPC="$LDFLAGSPC $LD_H2" + CPPFLAGS="$CPPFLAGS $CPP_H2" + LIBS="$LIB_H2 $LIBS" + + # use nghttp2_session_get_stream_local_window_size to require nghttp2 + # >= 1.15.0 + AC_CHECK_LIB(nghttp2, nghttp2_session_get_stream_local_window_size, + [ + AC_CHECK_HEADERS(nghttp2/nghttp2.h, + curl_h2_msg="enabled (nghttp2)" + AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use]) + USE_NGHTTP2=1 + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp2" + ) + + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH]) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) fi dnl ********************************************************************** -dnl Check for zsh completion path +dnl Check for ngtcp2 (QUIC) dnl ********************************************************************** -OPT_ZSH_FPATH=default -AC_ARG_WITH(zsh-functions-dir, -AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH]) -AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]), - [OPT_ZSH_FPATH=$withval]) -case "$OPT_ZSH_FPATH" in +OPT_TCP2="no" + +if test "x$disable_http" = "xyes"; then + # without HTTP, ngtcp2 is no use + OPT_TCP2="no" +fi + +AC_ARG_WITH(ngtcp2, +AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage]) +AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]), + [OPT_TCP2=$withval]) +case "$OPT_TCP2" in no) - dnl --without-zsh-functions-dir option used + dnl --without-ngtcp2 option used + want_tcp2="no" ;; - default|yes) - dnl --with-zsh-functions-dir option used without path - ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions" - AC_SUBST(ZSH_FUNCTIONS_DIR) + yes) + dnl --with-ngtcp2 option used without path + want_tcp2="default" + want_tcp2_path="" ;; *) - dnl --with-zsh-functions-dir option used with path - ZSH_FUNCTIONS_DIR="$withval" - AC_SUBST(ZSH_FUNCTIONS_DIR) + dnl --with-ngtcp2 option used with path + want_tcp2="yes" + want_tcp2_path="$withval/lib/pkgconfig" ;; esac -dnl ********************************************************************** -dnl Back to "normal" configuring -dnl ********************************************************************** +curl_tcp2_msg="no (--with-ngtcp2)" +if test X"$want_tcp2" != Xno; then -dnl Checks for header files. -AC_HEADER_STDC + if test "$QUIC_ENABLED" != "yes"; then + AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-ngtcp2 a no-no]) + fi -CURL_CHECK_HEADER_MALLOC -CURL_CHECK_HEADER_MEMORY + dnl backup the pre-ngtcp2 variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -dnl Now check for the very most basic headers. Then we can use these -dnl ones as default-headers when checking for the rest! -AC_CHECK_HEADERS( - sys/types.h \ - sys/time.h \ - sys/select.h \ - sys/socket.h \ - sys/ioctl.h \ - sys/uio.h \ - assert.h \ - unistd.h \ - stdlib.h \ - limits.h \ - arpa/inet.h \ - net/if.h \ - netinet/in.h \ - sys/un.h \ - netinet/tcp.h \ - netdb.h \ - sys/sockio.h \ - sys/stat.h \ - sys/param.h \ - termios.h \ - termio.h \ - sgtty.h \ - fcntl.h \ - alloca.h \ - time.h \ - io.h \ - pwd.h \ - utime.h \ - sys/utime.h \ - sys/poll.h \ - poll.h \ - socket.h \ - sys/resource.h \ - libgen.h \ - locale.h \ - errno.h \ - stdbool.h \ - arpa/tftp.h \ - sys/filio.h \ - sys/wait.h \ - setjmp.h, -dnl to do if not found -[], -dnl to do if found -[], -dnl default includes -[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_SYS_UN_H -#include -#endif -] -) + CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path) -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -CURL_CHECK_VARIADIC_MACROS -AC_TYPE_SIZE_T -AC_HEADER_TIME -CURL_CHECK_STRUCT_TIMEVAL -CURL_VERIFY_RUNTIMELIBS + if test "$PKGCONFIG" != "no"; then + LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-l libngtcp2` + AC_MSG_NOTICE([-l is $LIB_TCP2]) -AC_CHECK_SIZEOF(size_t) -AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(short) -AC_CHECK_SIZEOF(time_t) -AC_CHECK_SIZEOF(off_t) + CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl + $PKGCONFIG --cflags-only-I libngtcp2` + AC_MSG_NOTICE([-I is $CPP_TCP2]) -o=$CPPFLAGS -CPPFLAGS="-I$srcdir/include $CPPFLAGS" -AC_CHECK_SIZEOF(curl_off_t, unused , [ -#include -]) -CPPFLAGS=$o + LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-L libngtcp2` + AC_MSG_NOTICE([-L is $LD_TCP2]) -AC_CHECK_TYPE(long long, - [AC_DEFINE(HAVE_LONGLONG, 1, - [Define to 1 if the compiler supports the 'long long' data type.])] - longlong="yes" -) + LDFLAGS="$LDFLAGS $LD_TCP2" + LDFLAGSPC="$LDFLAGSPC $LD_TCP2" + CPPFLAGS="$CPPFLAGS $CPP_TCP2" + LIBS="$LIB_TCP2 $LIBS" -if test "xyes" = "x$longlong"; then - AC_MSG_CHECKING([if numberLL works]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ - long long val = 1000LL; - ]]) - ],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL]) - ],[ - AC_MSG_RESULT([no]) - ]) + if test "x$cross_compiling" != "xyes"; then + DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned, + [ + AC_CHECK_HEADERS(ngtcp2/ngtcp2.h, + AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use]) + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + + else + dnl no ngtcp2 pkg-config found, deal with it + if test X"$want_tcp2" != Xdefault; then + dnl To avoid link errors, we do not allow --with-ngtcp2 without + dnl a pkgconfig file + AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.]) + fi + fi fi +if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ + "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" != "x1"; then + dnl backup the pre-ngtcp2_crypto_quictls variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -# check for ssize_t -AC_CHECK_TYPE(ssize_t, , - AC_DEFINE(ssize_t, int, [the signed version of size_t])) + CURL_CHECK_PKGCONFIG(libngtcp2_crypto_quictls, $want_tcp2_path) -# check for bool type -AC_CHECK_TYPE([bool],[ - AC_DEFINE(HAVE_BOOL_T, 1, - [Define to 1 if bool is an available type.]) -], ,[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STDBOOL_H -#include -#endif -]) + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-l libngtcp2_crypto_quictls` + AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_QUICTLS]) -CURL_CONFIGURE_CURL_SOCKLEN_T + CPP_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl + $PKGCONFIG --cflags-only-I libngtcp2_crypto_quictls` + AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_QUICTLS]) -CURL_CONFIGURE_PULL_SYS_POLL + LD_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-L libngtcp2_crypto_quictls` + AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_QUICTLS]) -TYPE_IN_ADDR_T + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_QUICTLS" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS" + LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS" -TYPE_SOCKADDR_STORAGE + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(ngtcp2_crypto_quictls, ngtcp2_crypto_recv_client_initial_cb, + [ + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_quictls" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) -TYPE_SIG_ATOMIC_T + else + dnl no ngtcp2_crypto_quictls pkg-config found, deal with it + if test X"$want_tcp2" != Xdefault; then + dnl To avoid link errors, we do not allow --with-ngtcp2 without + dnl a pkgconfig file + AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_quictls pkg-config file.]) + fi + fi +fi -AC_TYPE_SIGNAL +if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ + "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" = "x1"; then + dnl backup the pre-ngtcp2_crypto_ossl variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -CURL_CHECK_FUNC_SELECT + CURL_CHECK_PKGCONFIG(libngtcp2_crypto_ossl, $want_tcp2_path) -CURL_CHECK_FUNC_RECV -CURL_CHECK_FUNC_SEND -CURL_CHECK_MSG_NOSIGNAL + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-l libngtcp2_crypto_ossl` + AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_QUICTLS]) -CURL_CHECK_FUNC_ALARM -CURL_CHECK_FUNC_BASENAME -CURL_CHECK_FUNC_CLOSESOCKET -CURL_CHECK_FUNC_CLOSESOCKET_CAMEL -CURL_CHECK_FUNC_CONNECT -CURL_CHECK_FUNC_FCNTL -CURL_CHECK_FUNC_FDOPEN -CURL_CHECK_FUNC_FREEADDRINFO -CURL_CHECK_FUNC_FREEIFADDRS -CURL_CHECK_FUNC_FSETXATTR -CURL_CHECK_FUNC_FTRUNCATE -CURL_CHECK_FUNC_GETADDRINFO -CURL_CHECK_FUNC_GAI_STRERROR -CURL_CHECK_FUNC_GETHOSTBYADDR -CURL_CHECK_FUNC_GETHOSTBYADDR_R -CURL_CHECK_FUNC_GETHOSTBYNAME -CURL_CHECK_FUNC_GETHOSTBYNAME_R -CURL_CHECK_FUNC_GETHOSTNAME -CURL_CHECK_FUNC_GETIFADDRS -CURL_CHECK_FUNC_GETSERVBYPORT_R -CURL_CHECK_FUNC_GMTIME_R -CURL_CHECK_FUNC_INET_NTOA_R -CURL_CHECK_FUNC_INET_NTOP -CURL_CHECK_FUNC_INET_PTON -CURL_CHECK_FUNC_IOCTL -CURL_CHECK_FUNC_IOCTLSOCKET -CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL -CURL_CHECK_FUNC_LOCALTIME_R -CURL_CHECK_FUNC_MEMRCHR -CURL_CHECK_FUNC_POLL -CURL_CHECK_FUNC_SETSOCKOPT -CURL_CHECK_FUNC_SIGACTION -CURL_CHECK_FUNC_SIGINTERRUPT -CURL_CHECK_FUNC_SIGNAL -CURL_CHECK_FUNC_SIGSETJMP -CURL_CHECK_FUNC_SOCKET -CURL_CHECK_FUNC_SOCKETPAIR -CURL_CHECK_FUNC_STRCASECMP -CURL_CHECK_FUNC_STRCMPI -CURL_CHECK_FUNC_STRDUP -CURL_CHECK_FUNC_STRERROR_R -CURL_CHECK_FUNC_STRICMP -CURL_CHECK_FUNC_STRNCASECMP -CURL_CHECK_FUNC_STRNCMPI -CURL_CHECK_FUNC_STRNICMP -CURL_CHECK_FUNC_STRSTR -CURL_CHECK_FUNC_STRTOK_R -CURL_CHECK_FUNC_STRTOLL -CURL_CHECK_FUNC_WRITEV + CPP_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl + $PKGCONFIG --cflags-only-I libngtcp2_crypto_ossl` + AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_QUICTLS]) -case $host in - *msdosdjgpp) - ac_cv_func_pipe=no - skipcheck_pipe=yes - AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) - ;; -esac + LD_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-L libngtcp2_crypto_ossl` + AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_QUICTLS]) -AC_CHECK_FUNCS([geteuid \ - getpass_r \ - getppid \ - getpwuid \ - getpwuid_r \ - getrlimit \ - gettimeofday \ - if_nametoindex \ - pipe \ - setlocale \ - setmode \ - setrlimit \ - utime \ - utimes -],[ -],[ - func="$ac_func" - eval skipcheck=\$skipcheck_$func - if test "x$skipcheck" != "xyes"; then - AC_MSG_CHECKING([deeper for $func]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ - $func (); - ]]) - ],[ - AC_MSG_RESULT([yes]) - eval "ac_cv_func_$func=yes" - AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1], - [Define to 1 if you have the $func function.]) - ],[ - AC_MSG_RESULT([but still no]) - ]) + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_QUICTLS" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS" + LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(ngtcp2_crypto_ossl, ngtcp2_crypto_recv_client_initial_cb, + [ + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_ossl" + AC_DEFINE(OPENSSL_QUIC_API2, 1, [openssl with new QUIC API]) + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + + else + dnl no ngtcp2_crypto_ossl pkg-config found, deal with it + if test X"$want_tcp2" != Xdefault; then + dnl To avoid link errors, we do not allow --with-ngtcp2 without + dnl a pkgconfig file + AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_ossl pkg-config file.]) + fi fi -]) +fi + +if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BORINGSSL" = "x1"; then + dnl backup the pre-ngtcp2_crypto_boringssl variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + CURL_CHECK_PKGCONFIG(libngtcp2_crypto_boringssl, $want_tcp2_path) + + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-l libngtcp2_crypto_boringssl` + AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_BORINGSSL]) + + CPP_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl + $PKGCONFIG --cflags-only-I libngtcp2_crypto_boringssl` + AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_BORINGSSL]) + + LD_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-L libngtcp2_crypto_boringssl` + AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_BORINGSSL]) -dnl Check if the getnameinfo function is available -dnl and get the types of five of its arguments. -CURL_CHECK_FUNC_GETNAMEINFO + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_BORINGSSL" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_BORINGSSL" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_BORINGSSL" + LIBS="$LIB_NGTCP2_CRYPTO_BORINGSSL $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_BORINGSSL=`echo $LD_NGTCP2_CRYPTO_BORINGSSL | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(ngtcp2_crypto_boringssl, ngtcp2_crypto_recv_client_initial_cb, + [ + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_BORINGSSL" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_BORINGSSL to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_boringssl" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) -if test "$ipv6" = "yes"; then - if test "$curl_cv_func_getaddrinfo" = "yes"; then - AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) - IPV6_ENABLED=1 - AC_SUBST(IPV6_ENABLED) + else + dnl no ngtcp2_crypto_boringssl pkg-config found, deal with it + if test X"$want_tcp2" != Xdefault; then + dnl To avoid link errors, we do not allow --with-ngtcp2 without + dnl a pkgconfig file + AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file.]) + fi fi - CURL_CHECK_NI_WITHSCOPEID fi -CURL_CHECK_NONBLOCKING_SOCKET +if test "x$USE_NGTCP2" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then + dnl backup the pre-ngtcp2_crypto_gnutls variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" -dnl ************************************************************ -dnl nroff tool stuff -dnl + CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path) -AC_PATH_PROG( PERL, perl, , - $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin ) -AC_SUBST(PERL) + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls` + AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS]) -AC_PATH_PROGS( NROFF, gnroff nroff, , - $PATH:/usr/bin/:/usr/local/bin ) -AC_SUBST(NROFF) - -if test -n "$NROFF"; then - dnl only check for nroff options if an nroff command was found - - AC_MSG_CHECKING([how to use *nroff to get plain text from man pages]) - MANOPT="-man" - mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` - if test -z "$mancheck"; then - MANOPT="-mandoc" - mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` - if test -z "$mancheck"; then - MANOPT="" - AC_MSG_RESULT([failed]) - AC_MSG_WARN([found no *nroff option to get plaintext from man pages]) - else - AC_MSG_RESULT([$MANOPT]) + CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl + $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls` + AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS]) + + LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls` + AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS]) + + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_GNUTLS" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS" + LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'` fi + AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb, + [ + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_gnutls" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + else - AC_MSG_RESULT([$MANOPT]) + dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it + if test X"$want_tcp2" != Xdefault; then + dnl To avoid link errors, we do not allow --with-ngtcp2 without + dnl a pkgconfig file + AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.]) + fi fi - AC_SUBST(MANOPT) fi -if test -z "$MANOPT" -then - dnl if no nroff tool was found, or no option that could convert man pages - dnl was found, then disable the built-in manual stuff - AC_MSG_WARN([disabling built-in manual]) - USE_MANUAL="no"; +if test "x$USE_NGTCP2" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then + dnl backup the pre-ngtcp2_crypto_wolfssl variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path) + + if test "$PKGCONFIG" != "no"; then + LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl` + AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL]) + + CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl + $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl` + AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL]) + + LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) + $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl` + AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL]) + + LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL" + LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_WOLFSSL" + CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL" + LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb, + [ + AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, + USE_NGTCP2=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_wolfssl" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + + else + dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it + if test X"$want_tcp2" != Xdefault; then + dnl To avoid link errors, we do not allow --with-ngtcp2 without + dnl a pkgconfig file + AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.]) + fi + fi fi -dnl ************************************************************************* -dnl If the manual variable still is set, then we go with providing a built-in -dnl manual +dnl ********************************************************************** +dnl Check for OpenSSL QUIC +dnl ********************************************************************** -if test "$USE_MANUAL" = "1"; then - AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual]) - curl_manual_msg="enabled" +OPT_OPENSSL_QUIC="no" + +if test "x$disable_http" = "xyes" -o "x$OPENSSL_ENABLED" != "x1"; then + # without HTTP or without openssl, no use + OPT_OPENSSL_QUIC="no" fi -dnl set variable for use in automakefile(s) -AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) +AC_ARG_WITH(openssl-quic, +AS_HELP_STRING([--with-openssl-quic],[Enable OpenSSL QUIC usage]) +AS_HELP_STRING([--without-openssl-quic],[Disable OpenSSL QUIC usage]), + [OPT_OPENSSL_QUIC=$withval]) +case "$OPT_OPENSSL_QUIC" in + no) + dnl --without-openssl-quic option used + want_openssl_quic="no" + ;; + yes) + dnl --with-openssl-quic option used + want_openssl_quic="yes" + ;; +esac -CURL_CHECK_LIB_ARES -AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes) +curl_openssl_quic_msg="no (--with-openssl-quic)" +if test "x$want_openssl_quic" = "xyes"; then -if test "x$curl_cv_native_windows" != "xyes" && - test "x$enable_shared" = "xyes"; then - build_libhostname=yes -else - build_libhostname=no + if test "$USE_NGTCP2" = 1; then + AC_MSG_ERROR([--with-openssl-quic and --with-ngtcp2 are mutually exclusive]) + fi + if test "$have_openssl_quic" != 1; then + AC_MSG_ERROR([--with-openssl-quic requires quic support and OpenSSL >= 3.3.0]) + fi + AC_DEFINE(USE_OPENSSL_QUIC, 1, [if openssl QUIC is in use]) + USE_OPENSSL_QUIC=1 fi -AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes) -if test "x$want_ares" != xyes; then - CURL_CHECK_OPTION_THREADED_RESOLVER +dnl ********************************************************************** +dnl Check for nghttp3 (HTTP/3 with ngtcp2) +dnl ********************************************************************** + +OPT_NGHTTP3="yes" + +if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then + # without ngtcp2 or openssl quic, nghttp3 is of no use for us + OPT_NGHTTP3="no" + want_nghttp3="no" fi +AC_ARG_WITH(nghttp3, +AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage]) +AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]), + [OPT_NGHTTP3=$withval]) +case "$OPT_NGHTTP3" in + no) + dnl --without-nghttp3 option used + want_nghttp3="no" + ;; + yes) + dnl --with-nghttp3 option used without path + want_nghttp3="default" + want_nghttp3_path="" + ;; + *) + dnl --with-nghttp3 option used with path + want_nghttp3="yes" + want_nghttp3_path="$withval/lib/pkgconfig" + ;; +esac + +curl_http3_msg="no (--with-nghttp3)" +if test X"$want_nghttp3" != Xno; then + + if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then + # without ngtcp2 or openssl quic, nghttp3 is of no use for us + AC_MSG_ERROR([nghttp3 enabled without a QUIC library; enable ngtcp2 or OpenSSL-QUIC]) + fi + + dnl backup the pre-nghttp3 variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path) + + if test "$PKGCONFIG" != "no"; then + LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) + $PKGCONFIG --libs-only-l libnghttp3` + AC_MSG_NOTICE([-l is $LIB_NGHTTP3]) + + CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl + $PKGCONFIG --cflags-only-I libnghttp3` + AC_MSG_NOTICE([-I is $CPP_NGHTTP3]) + + LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) + $PKGCONFIG --libs-only-L libnghttp3` + AC_MSG_NOTICE([-L is $LD_NGHTTP3]) + + LDFLAGS="$LDFLAGS $LD_NGHTTP3" + LDFLAGSPC="$LDFLAGSPC $LD_NGHTTP3" + CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3" + LIBS="$LIB_NGHTTP3 $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned, + [ + AC_CHECK_HEADERS(nghttp3/nghttp3.h, + AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use]) + USE_NGHTTP3=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp3" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + + else + dnl no nghttp3 pkg-config found, deal with it + if test X"$want_nghttp3" != Xdefault; then + dnl To avoid link errors, we do not allow --with-nghttp3 without + dnl a pkgconfig file + AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.]) + fi + fi +fi + +dnl ********************************************************************** +dnl Check for ngtcp2 and nghttp3 (HTTP/3 with ngtcp2 + nghttp3) +dnl ********************************************************************** + +if test "x$USE_NGTCP2" = "x1" -a "x$USE_NGHTTP3" = "x1"; then + USE_NGTCP2_H3=1 + AC_MSG_NOTICE([HTTP3 support is experimental]) + curl_h3_msg="enabled (ngtcp2 + nghttp3)" +fi + +dnl ********************************************************************** +dnl Check for OpenSSL and nghttp3 (HTTP/3 with nghttp3 using OpenSSL QUIC) +dnl ********************************************************************** + +if test "x$USE_OPENSSL_QUIC" = "x1" -a "x$USE_NGHTTP3" = "x1"; then + experimental="$experimental HTTP3" + USE_OPENSSL_H3=1 + AC_MSG_NOTICE([HTTP3 support is experimental]) + curl_h3_msg="enabled (openssl + nghttp3)" +fi + +dnl ********************************************************************** +dnl Check for quiche (QUIC) +dnl ********************************************************************** + +OPT_QUICHE="no" + +if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then + # without HTTP or with ngtcp2, quiche is no use + OPT_QUICHE="no" +fi + +AC_ARG_WITH(quiche, +AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage]) +AS_HELP_STRING([--without-quiche],[Disable quiche usage]), + [OPT_QUICHE=$withval]) +case "$OPT_QUICHE" in + no) + dnl --without-quiche option used + want_quiche="no" + ;; + yes) + dnl --with-quiche option used without path + want_quiche="default" + want_quiche_path="" + ;; + *) + dnl --with-quiche option used with path + want_quiche="yes" + want_quiche_path="$withval" + ;; +esac + +if test X"$want_quiche" != Xno; then + + if test "$QUIC_ENABLED" != "yes"; then + AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-quiche a no-no]) + fi + + if test "$NGHTTP3_ENABLED" = 1; then + AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive]) + fi + + dnl backup the pre-quiche variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path) + + if test "$PKGCONFIG" != "no"; then + LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) + $PKGCONFIG --libs-only-l quiche` + AC_MSG_NOTICE([-l is $LIB_QUICHE]) + + CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl + $PKGCONFIG --cflags-only-I quiche` + AC_MSG_NOTICE([-I is $CPP_QUICHE]) + + LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) + $PKGCONFIG --libs-only-L quiche` + AC_MSG_NOTICE([-L is $LD_QUICHE]) + + LDFLAGS="$LDFLAGS $LD_QUICHE" + LDFLAGSPC="$LDFLAGSPC $LD_QUICHE" + CPPFLAGS="$CPPFLAGS $CPP_QUICHE" + LIBS="$LIB_QUICHE $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting, + [ + AC_CHECK_HEADERS(quiche.h, + experimental="$experimental HTTP3" + AC_MSG_NOTICE([HTTP3 support is experimental]) + curl_h3_msg="enabled (quiche)" + AC_DEFINE(USE_QUICHE, 1, [if quiche is in use]) + USE_QUICHE=1 + AC_CHECK_FUNCS([quiche_conn_set_qlog_fd]) + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE quiche", + [], + [ + AC_INCLUDES_DEFAULT + #include + ] + ) + ], + dnl not found, revert back to clean variables + AC_MSG_ERROR([couldn't use quiche]) + ) + else + dnl no quiche pkg-config found, deal with it + if test X"$want_quiche" != Xdefault; then + dnl To avoid link errors, we do not allow --with-quiche without + dnl a pkgconfig file + AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.]) + fi + fi +fi + +dnl ********************************************************************** +dnl Check for msh3/msquic (QUIC) +dnl ********************************************************************** + +OPT_MSH3="no" + +if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then + # without HTTP or with ngtcp2, msh3 is no use + OPT_MSH3="no" +fi + +AC_ARG_WITH(msh3, +AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage]) +AS_HELP_STRING([--without-msh3],[Disable msh3 usage]), + [OPT_MSH3=$withval]) +case "$OPT_MSH3" in + no) + dnl --without-msh3 option used + want_msh3="no" + ;; + yes) + dnl --with-msh3 option used without path + want_msh3="default" + want_msh3_path="" + ;; + *) + dnl --with-msh3 option used with path + want_msh3="yes" + want_msh3_path="$withval" + ;; +esac + +if test X"$want_msh3" != Xno; then + + dnl msh3 on non-Windows needs an OpenSSL with the QUIC API + if test "$curl_cv_native_windows" != "yes"; then + if test "$QUIC_ENABLED" != "yes"; then + AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-msh3 a no-no]) + fi + if test "$OPENSSL_ENABLED" != "1"; then + AC_MSG_ERROR([msh3/msquic requires OpenSSL]) + fi + fi + + if test "$NGHTTP3_ENABLED" = 1; then + AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive]) + fi + if test "$USE_QUICHE" = 1; then + AC_MSG_ERROR([--with-msh3 and --with-quiche are mutually exclusive]) + fi + + dnl backup the pre-msh3 variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + if test -n "$want_msh3_path"; then + LD_MSH3="-L$want_msh3_path/lib" + CPP_MSH3="-I$want_msh3_path/include" + DIR_MSH3="$want_msh3_path/lib" + LDFLAGS="$LDFLAGS $LD_MSH3" + LDFLAGSPC="$LDFLAGSPC $LD_MSH3" + CPPFLAGS="$CPPFLAGS $CPP_MSH3" + fi + LIBS="-lmsh3 $LIBS" + + AC_CHECK_LIB(msh3, MsH3ApiOpen, + [ + AC_CHECK_HEADERS(msh3.h, + curl_h3_msg="enabled (msh3)" + AC_DEFINE(USE_MSH3, 1, [if msh3 is in use]) + USE_MSH3=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]) + dnl FIXME: Enable when msh3 was detected via pkg-config + if false; then + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libmsh3" + fi + experimental="$experimental HTTP3" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) +fi + +dnl ********************************************************************** +dnl libuv is only ever used for debug purposes +dnl ********************************************************************** + +OPT_LIBUV=no +AC_ARG_WITH(libuv, +AS_HELP_STRING([--with-libuv=PATH],[Enable libuv]) +AS_HELP_STRING([--without-libuv],[Disable libuv]), + [OPT_LIBUV=$withval]) +case "$OPT_LIBUV" in + no) + dnl --without-libuv option used + want_libuv="no" + ;; + yes) + dnl --with-libuv option used without path + want_libuv="default" + want_libuv_path="" + ;; + *) + dnl --with-libuv option used with path + want_libuv="yes" + want_libuv_path="$withval" + ;; +esac + +if test X"$want_libuv" != Xno; then + if test x$want_debug != xyes; then + AC_MSG_ERROR([Using libuv without debug support enabled is useless]) + fi + + dnl backup the pre-libuv variables + CLEANLDFLAGS="$LDFLAGS" + CLEANLDFLAGSPC="$LDFLAGSPC" + CLEANCPPFLAGS="$CPPFLAGS" + CLEANLIBS="$LIBS" + + CURL_CHECK_PKGCONFIG(libuv, $want_libuv_path) + + if test "$PKGCONFIG" != "no"; then + LIB_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) + $PKGCONFIG --libs-only-l libuv` + AC_MSG_NOTICE([-l is $LIB_LIBUV]) + + CPP_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) dnl + $PKGCONFIG --cflags-only-I libuv` + AC_MSG_NOTICE([-I is $CPP_LIBUV]) + + LD_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) + $PKGCONFIG --libs-only-L libuv` + AC_MSG_NOTICE([-L is $LD_LIBUV]) + + LDFLAGS="$LDFLAGS $LD_LIBUV" + LDFLAGSPC="$LDFLAGSPC $LD_LIBUV" + CPPFLAGS="$CPPFLAGS $CPP_LIBUV" + LIBS="$LIB_LIBUV $LIBS" + + if test "x$cross_compiling" != "xyes"; then + DIR_LIBUV=`echo $LD_LIBUV | $SED -e 's/^-L//'` + fi + AC_CHECK_LIB(uv, uv_default_loop, + [ + AC_CHECK_HEADERS(uv.h, + AC_DEFINE(USE_LIBUV, 1, [if libuv is in use]) + USE_LIBUV=1 + CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LIBUV" + export CURL_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_LIBUV to CURL_LIBRARY_PATH]) + LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libuv" + ) + ], + dnl not found, revert back to clean variables + LDFLAGS=$CLEANLDFLAGS + LDFLAGSPC=$CLEANLDFLAGSPC + CPPFLAGS=$CLEANCPPFLAGS + LIBS=$CLEANLIBS + ) + + else + dnl no libuv pkg-config found, deal with it + if test X"$want_libuv" != Xdefault; then + dnl To avoid link errors, we do not allow --with-libuv without + dnl a pkgconfig file + AC_MSG_ERROR([--with-libuv was specified but could not find libuv pkg-config file.]) + fi + fi + +fi + +dnl ********************************************************************** +dnl Check for zsh completion path +dnl ********************************************************************** + +OPT_ZSH_FPATH=default +AC_ARG_WITH(zsh-functions-dir, +AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH]) +AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]), + [OPT_ZSH_FPATH=$withval]) +case "$OPT_ZSH_FPATH" in + default|no) + dnl --without-zsh-functions-dir option used + ;; + yes) + dnl --with-zsh-functions-dir option used without path + ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions" + AC_SUBST(ZSH_FUNCTIONS_DIR) + ;; + *) + dnl --with-zsh-functions-dir option used with path + ZSH_FUNCTIONS_DIR="$withval" + AC_SUBST(ZSH_FUNCTIONS_DIR) + ;; +esac +AM_CONDITIONAL(USE_ZSH_COMPLETION, test x"$ZSH_FUNCTIONS_DIR" != x) + +dnl ********************************************************************** +dnl Check for fish completion path +dnl ********************************************************************** + +OPT_FISH_FPATH=default +AC_ARG_WITH(fish-functions-dir, +AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH]) +AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]), + [OPT_FISH_FPATH=$withval]) +case "$OPT_FISH_FPATH" in + default|no) + dnl --without-fish-functions-dir option used + ;; + yes) + dnl --with-fish-functions-dir option used without path + CURL_CHECK_PKGCONFIG(fish) + if test "$PKGCONFIG" != "no"; then + FISH_FUNCTIONS_DIR=`$PKGCONFIG --variable completionsdir fish` + else + FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d" + fi + AC_SUBST(FISH_FUNCTIONS_DIR) + ;; + *) + dnl --with-fish-functions-dir option used with path + FISH_FUNCTIONS_DIR="$withval" + AC_SUBST(FISH_FUNCTIONS_DIR) + ;; +esac +AM_CONDITIONAL(USE_FISH_COMPLETION, test x"$FISH_FUNCTIONS_DIR" != x) + +dnl Now check for the very most basic headers. Then we can use these +dnl ones as default-headers when checking for the rest! +AC_CHECK_HEADERS( + sys/types.h \ + sys/select.h \ + sys/ioctl.h \ + unistd.h \ + arpa/inet.h \ + net/if.h \ + netinet/in.h \ + netinet/in6.h \ + sys/un.h \ + linux/tcp.h \ + netinet/tcp.h \ + netinet/udp.h \ + netdb.h \ + sys/sockio.h \ + sys/param.h \ + termios.h \ + termio.h \ + fcntl.h \ + io.h \ + pwd.h \ + utime.h \ + sys/utime.h \ + sys/poll.h \ + poll.h \ + sys/resource.h \ + libgen.h \ + locale.h \ + stdbool.h \ + stdint.h \ + sys/filio.h \ + sys/eventfd.h, +dnl to do if not found +[], +dnl to do if found +[], +dnl default includes +[ +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#if !defined(_WIN32) || defined(__MINGW32__) +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#elif defined(HAVE_UNISTD_H) +#include +#endif +#ifndef _WIN32 +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN6_H +#include /* is this really required to detect other headers? */ +#endif +#ifdef HAVE_SYS_UN_H +#include /* is this really required to detect other headers? */ +#endif +] +) + + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T + +CURL_CHECK_STRUCT_TIMEVAL +CURL_VERIFY_RUNTIMELIBS + +CURL_SIZEOF(size_t) +CURL_SIZEOF(long) +CURL_SIZEOF(int) +CURL_SIZEOF(time_t) +CURL_SIZEOF(off_t) + +o=$CPPFLAGS +CPPFLAGS="-I$srcdir/include $CPPFLAGS" +CURL_SIZEOF(curl_off_t, [ +#include +]) +CURL_SIZEOF(curl_socket_t, [ +#include +]) +CPPFLAGS=$o + +AC_CHECK_TYPE(long long, + [AC_DEFINE(HAVE_LONGLONG, 1, + [Define to 1 if the compiler supports the 'long long' data type.])] + longlong="yes" +) + +if test ${ac_cv_sizeof_curl_off_t} -lt 8; then + AC_MSG_ERROR([64 bit curl_off_t is required]) +fi + +# check for ssize_t +AC_CHECK_TYPE(ssize_t, , + AC_DEFINE(ssize_t, int, [the signed version of size_t])) + +# check for bool type +AC_CHECK_TYPE([bool],[ + AC_DEFINE(HAVE_BOOL_T, 1, + [Define to 1 if bool is an available type.]) +], ,[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDBOOL_H +#include +#endif +]) + +# check for sa_family_t +AC_CHECK_TYPE(sa_family_t, + AC_DEFINE(HAVE_SA_FAMILY_T, 1, [Define to 1 if symbol `sa_family_t' exists]), + [ + # The Windows name? + AC_CHECK_TYPE(ADDRESS_FAMILY, + AC_DEFINE(HAVE_ADDRESS_FAMILY, 1, [Define to 1 if symbol `ADDRESS_FAMILY' exists]), + [], + [ +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#else +#include +#endif + ]) + ], +[ +#ifndef _WIN32 +#include +#endif +]) + +# check for suseconds_t +AC_CHECK_TYPE([suseconds_t],[ + AC_DEFINE(HAVE_SUSECONDS_T, 1, + [Define to 1 if suseconds_t is an available type.]) +], ,[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifndef _WIN32 +#include +#endif +]) + +case $host_os in + amigaos*|msdos*) + AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned]) + ;; + *) + AC_MSG_CHECKING([if time_t is unsigned]) + CURL_RUN_IFELSE( + [ + #include + int main(void) { + time_t t = -1; + return t < 0; + } + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned]) + ],[ + AC_MSG_RESULT([no]) + ],[ + dnl cross-compiling, most systems are signed + AC_MSG_RESULT([no]) + ]) + ;; +esac + +TYPE_SOCKADDR_STORAGE + +CURL_CHECK_FUNC_SELECT + +CURL_CHECK_FUNC_RECV +CURL_CHECK_FUNC_SEND +CURL_CHECK_MSG_NOSIGNAL + +CURL_CHECK_FUNC_ALARM +CURL_CHECK_FUNC_BASENAME +CURL_CHECK_FUNC_CLOSESOCKET +CURL_CHECK_FUNC_CLOSESOCKET_CAMEL +CURL_CHECK_FUNC_FCNTL +CURL_CHECK_FUNC_FREEADDRINFO +CURL_CHECK_FUNC_FSETXATTR +CURL_CHECK_FUNC_FTRUNCATE +CURL_CHECK_FUNC_GETADDRINFO +CURL_CHECK_FUNC_GETHOSTBYNAME_R +CURL_CHECK_FUNC_GETHOSTNAME +CURL_CHECK_FUNC_GETIFADDRS +CURL_CHECK_FUNC_GETPEERNAME +CURL_CHECK_FUNC_GETSOCKNAME +CURL_CHECK_FUNC_GMTIME_R +CURL_CHECK_FUNC_IOCTL +CURL_CHECK_FUNC_IOCTLSOCKET +CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL +CURL_CHECK_FUNC_MEMRCHR +CURL_CHECK_FUNC_SIGACTION +CURL_CHECK_FUNC_SIGINTERRUPT +CURL_CHECK_FUNC_SIGNAL +CURL_CHECK_FUNC_SIGSETJMP +CURL_CHECK_FUNC_SOCKET +CURL_CHECK_FUNC_SOCKETPAIR +CURL_CHECK_FUNC_STRDUP +CURL_CHECK_FUNC_STRERROR_R + +case $host in + *msdosdjgpp) + ac_cv_func_pipe=no + skipcheck_pipe=yes + AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) + ;; +esac + +AC_CHECK_FUNCS([\ + accept4 \ + eventfd \ + fnmatch \ + geteuid \ + getpass_r \ + getppid \ + getpwuid \ + getpwuid_r \ + getrlimit \ + gettimeofday \ + if_nametoindex \ + mach_absolute_time \ + pipe \ + pipe2 \ + poll \ + sendmmsg \ + sendmsg \ + setlocale \ + setrlimit \ + snprintf \ + utime \ + utimes \ +]) + +if test "$curl_cv_native_windows" != 'yes'; then + AC_CHECK_FUNCS([\ + realpath \ + sched_yield \ + ]) + CURL_CHECK_FUNC_INET_NTOP + CURL_CHECK_FUNC_INET_PTON + CURL_CHECK_FUNC_STRCASECMP + CURL_CHECK_FUNC_STRCMPI + CURL_CHECK_FUNC_STRICMP +fi + +if test "$curl_cv_wince" = 'no'; then + AC_CHECK_FUNCS([setmode]) + if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then + AC_CHECK_FUNCS([_setmode]) + fi +fi + +if test -z "$ssl_backends"; then + AC_CHECK_FUNCS([arc4random]) +fi + +if test "$curl_cv_native_windows" != 'yes'; then + AC_CHECK_FUNCS([fseeko]) + + dnl On Android, the only way to know if fseeko can be used is to see if it is + dnl declared or not (for this API level), as the symbol always exists in the + dnl lib. + AC_CHECK_DECL([fseeko], + [AC_DEFINE([HAVE_DECL_FSEEKO], [1], + [Define to 1 if you have the fseeko declaration])], + [], + [[#include ]]) +fi + +CURL_CHECK_NONBLOCKING_SOCKET + +AC_PATH_PROG(PERL, perl,, + $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin) +AC_SUBST(PERL) + +if test "x$BUILD_DOCS" != "x0" -o "x$USE_MANUAL" != "x0" -o "x$CURL_CA_EMBED" != "x"; then + if test -z "$PERL"; then + AC_MSG_ERROR([perl was not found, needed for docs, manual and CA embed]) + fi +fi + +dnl set variable for use in automakefile(s) +AM_CONDITIONAL(BUILD_DOCS, test x"$BUILD_DOCS" = x1) + +dnl ************************************************************************* +dnl If the manual variable still is set, then we go with providing a built-in +dnl manual + +if test "$USE_MANUAL" = "1"; then + curl_manual_msg="enabled" +fi + +dnl set variable for use in automakefile(s) +AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) + +CURL_CHECK_LIB_ARES +CURL_CHECK_OPTION_THREADED_RESOLVER + +if test "$ipv6" = yes -a "$curl_cv_apple" = 'yes'; then + CURL_DARWIN_SYSTEMCONFIGURATION +fi + +dnl Windows threaded resolver check +if test "$want_threaded_resolver" = "yes" && test "$curl_cv_native_windows" = "yes"; then + USE_THREADS_WIN32=1 + AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup]) + curl_res_msg="Win32 threaded" +fi + +dnl detect pthreads +if test "$want_threaded_resolver" = "yes" && test "$USE_THREADS_WIN32" != "1"; then + AC_CHECK_HEADER(pthread.h, + [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have ]) + save_CFLAGS="$CFLAGS" + dnl When statically linking against BoringSSL, -lpthread is added to LIBS. + dnl Make sure to that this does not pass the check below, we really want + dnl -pthread in CFLAGS as recommended for GCC. This also ensures that + dnl lib1541 and lib1565 tests are built with these options. Otherwise + dnl they fail the build since tests/libtest/Makefile.am clears LIBS. + save_LIBS="$LIBS" + + LIBS= + dnl Check for libc variants without a separate pthread lib like bionic + AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] ) + LIBS="$save_LIBS" + + dnl on HP-UX, life is more complicated... + case $host in + *-hp-hpux*) + dnl it doesn't actually work without -lpthread + USE_THREADS_POSIX="" + ;; + *) + ;; + esac + + dnl if it wasn't found without lib, search for it in pthread lib + if test "$USE_THREADS_POSIX" != "1"; then + # assign PTHREAD for pkg-config use + PTHREAD=" -pthread" + + case $host in + *-ibm-aix*) + dnl Check if compiler is xlC + COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` + if test x"$COMPILER_VERSION" = "x"; then + CFLAGS="$CFLAGS -pthread" + else + CFLAGS="$CFLAGS -qthreaded" + fi + ;; + powerpc-*amigaos*) + dnl No -pthread option, but link with -lpthread + PTHREAD=" -lpthread" + ;; + *) + CFLAGS="$CFLAGS -pthread" + ;; + esac + AC_CHECK_LIB(pthread, pthread_create, + [USE_THREADS_POSIX=1], + [ CFLAGS="$save_CFLAGS"]) + fi + + if test "x$USE_THREADS_POSIX" = "x1"; then + AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup]) + curl_res_msg="POSIX threaded" + fi + ]) +fi + +dnl Did we find a threading option? +if test "$want_threaded_resolver" != "no" -a "x$USE_THREADS_POSIX" != "x1" -a "x$USE_THREADS_WIN32" != "x1"; then + AC_MSG_ERROR([Threaded resolver enabled but no thread library found]) +fi + +AC_CHECK_HEADER(dirent.h, + [ AC_DEFINE(HAVE_DIRENT_H, 1, [if you have ]) + AC_CHECK_FUNC(opendir, AC_DEFINE(HAVE_OPENDIR, 1, [if you have opendir]) ) + ] +) + +CURL_CONVERT_INCLUDE_TO_ISYSTEM + +dnl ************************************************************ +dnl disable verbose text strings +dnl +AC_MSG_CHECKING([whether to enable verbose strings]) +AC_ARG_ENABLE(verbose, +AS_HELP_STRING([--enable-verbose],[Enable verbose strings]) +AS_HELP_STRING([--disable-verbose],[Disable verbose strings]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) + curl_verbose_msg="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl enable SSPI support +dnl +AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)]) +AC_ARG_ENABLE(sspi, +AS_HELP_STRING([--enable-sspi],[Enable SSPI]) +AS_HELP_STRING([--disable-sspi],[Disable SSPI]), +[ case "$enableval" in + yes) + if test "$curl_cv_native_windows" = "yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) + USE_WINDOWS_SSPI=1 + curl_sspi_msg="enabled" + else + AC_MSG_RESULT(no) + AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) + fi + ;; + *) + if test "x$SCHANNEL_ENABLED" = "x1"; then + # --with-schannel implies --enable-sspi + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + ;; + esac ], + if test "x$SCHANNEL_ENABLED" = "x1"; then + # --with-schannel implies --enable-sspi + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +) + +if test "x$USE_WINDOWS_SSPI" = "x1"; then + LIBS="-lsecur32 $LIBS" +fi + +dnl ************************************************************ +dnl disable basic authentication +dnl +AC_MSG_CHECKING([whether to enable basic authentication method]) +AC_ARG_ENABLE(basic-auth, +AS_HELP_STRING([--enable-basic-auth],[Enable basic authentication (default)]) +AS_HELP_STRING([--disable-basic-auth],[Disable basic authentication]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_BASIC_AUTH, 1, [to disable basic authentication]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable bearer authentication +dnl +AC_MSG_CHECKING([whether to enable bearer authentication method]) +AC_ARG_ENABLE(bearer-auth, +AS_HELP_STRING([--enable-bearer-auth],[Enable bearer authentication (default)]) +AS_HELP_STRING([--disable-bearer-auth],[Disable bearer authentication]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_BEARER_AUTH, 1, [to disable bearer authentication]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable digest authentication +dnl +AC_MSG_CHECKING([whether to enable digest authentication method]) +AC_ARG_ENABLE(digest-auth, +AS_HELP_STRING([--enable-digest-auth],[Enable digest authentication (default)]) +AS_HELP_STRING([--disable-digest-auth],[Disable digest authentication]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_DIGEST_AUTH, 1, [to disable digest authentication]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable kerberos authentication +dnl +AC_MSG_CHECKING([whether to enable kerberos authentication method]) +AC_ARG_ENABLE(kerberos-auth, +AS_HELP_STRING([--enable-kerberos-auth],[Enable kerberos authentication (default)]) +AS_HELP_STRING([--disable-kerberos-auth],[Disable kerberos authentication]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_KERBEROS_AUTH, 1, [to disable kerberos authentication]) + CURL_DISABLE_KERBEROS_AUTH=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable negotiate authentication +dnl +AC_MSG_CHECKING([whether to enable negotiate authentication method]) +AC_ARG_ENABLE(negotiate-auth, +AS_HELP_STRING([--enable-negotiate-auth],[Enable negotiate authentication (default)]) +AS_HELP_STRING([--disable-negotiate-auth],[Disable negotiate authentication]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_NEGOTIATE_AUTH, 1, [to disable negotiate authentication]) + CURL_DISABLE_NEGOTIATE_AUTH=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable aws +dnl +AC_MSG_CHECKING([whether to enable aws sig methods]) +AC_ARG_ENABLE(aws, +AS_HELP_STRING([--enable-aws],[Enable AWS sig support (default)]) +AS_HELP_STRING([--disable-aws],[Disable AWS sig support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_AWS, 1, [to disable AWS sig support]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable NTLM support +dnl +AC_MSG_CHECKING([whether to support NTLM]) +AC_ARG_ENABLE(ntlm, +AS_HELP_STRING([--enable-ntlm],[Enable NTLM support]) +AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support]) + CURL_DISABLE_NTLM=1 + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable TLS-SRP authentication +dnl +AC_MSG_CHECKING([whether to enable TLS-SRP authentication]) +AC_ARG_ENABLE(tls-srp, +AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication]) +AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + want_tls_srp=no + ;; + *) + AC_MSG_RESULT(yes) + want_tls_srp=yes + ;; + esac ], + AC_MSG_RESULT(yes) + want_tls_srp=yes +) + +if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1"); then + AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) + USE_TLS_SRP=1 + curl_tls_srp_msg="enabled" +fi + +dnl ************************************************************ +dnl disable Unix domain sockets support +dnl +AC_MSG_CHECKING([whether to enable Unix domain sockets]) +AC_ARG_ENABLE(unix-sockets, +AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets]) +AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + want_unix_sockets=no + ;; + *) + AC_MSG_RESULT(yes) + want_unix_sockets=yes + ;; + esac ], [ + AC_MSG_RESULT(auto) + want_unix_sockets=auto + ] +) +if test "x$want_unix_sockets" != "xno" -a "$curl_cv_wince" = 'no'; then + if test "x$curl_cv_native_windows" = "xyes"; then + USE_UNIX_SOCKETS=1 + AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) + curl_unix_sockets_msg="enabled" + else + AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [ + AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) + USE_UNIX_SOCKETS=1 + curl_unix_sockets_msg="enabled" + ], [ + if test "x$want_unix_sockets" = "xyes"; then + AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!]) + fi + ], [ + #include + ]) + fi +fi + +dnl ************************************************************ +dnl disable cookies support +dnl +AC_MSG_CHECKING([whether to support cookies]) +AC_ARG_ENABLE(cookies, +AS_HELP_STRING([--enable-cookies],[Enable cookies support]) +AS_HELP_STRING([--disable-cookies],[Disable cookies support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable socketpair +dnl +AC_MSG_CHECKING([whether to support socketpair]) +AC_ARG_ENABLE(socketpair, +AS_HELP_STRING([--enable-socketpair],[Enable socketpair support]) +AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable HTTP authentication support +dnl +AC_MSG_CHECKING([whether to support HTTP authentication]) +AC_ARG_ENABLE(http-auth, +AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support]) +AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable DoH support +dnl +AC_MSG_CHECKING([whether to support DoH]) +AC_ARG_ENABLE(doh, +AS_HELP_STRING([--enable-doh],[Enable DoH support]) +AS_HELP_STRING([--disable-doh],[Disable DoH support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable mime API support +dnl +AC_MSG_CHECKING([whether to support the MIME API]) +AC_ARG_ENABLE(mime, +AS_HELP_STRING([--enable-mime],[Enable mime API support]) +AS_HELP_STRING([--disable-mime],[Disable mime API support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable bindlocal +dnl +AC_MSG_CHECKING([whether to support binding connections locally]) +AC_ARG_ENABLE(bindlocal, +AS_HELP_STRING([--enable-bindlocal],[Enable local binding support]) +AS_HELP_STRING([--disable-bindlocal],[Disable local binding support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_BINDLOCAL, 1, [disable local binding support]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) + +dnl ************************************************************ +dnl disable form API support +dnl +AC_MSG_CHECKING([whether to support the form API]) +AC_ARG_ENABLE(form-api, +AS_HELP_STRING([--enable-form-api],[Enable form API support]) +AS_HELP_STRING([--disable-form-api],[Disable form API support]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API]) + ;; + *) + AC_MSG_RESULT(yes) + test "$enable_mime" = no && + AC_MSG_ERROR(MIME support needs to be enabled in order to enable form API support) + ;; + esac ], +[ + if test "$enable_mime" = no; then + enable_form_api=no + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API]) + else + AC_MSG_RESULT(yes) + fi ] +) + dnl ************************************************************ -dnl disable POSIX threads +dnl disable date parsing dnl -AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver]) -AC_ARG_ENABLE(pthreads, -AC_HELP_STRING([--enable-pthreads], - [Enable POSIX threads (default for threaded resolver)]) -AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]), +AC_MSG_CHECKING([whether to support date parsing]) +AC_ARG_ENABLE(dateparse, +AS_HELP_STRING([--enable-dateparse],[Enable date parsing]) +AS_HELP_STRING([--disable-dateparse],[Disable date parsing]), [ case "$enableval" in - no) AC_MSG_RESULT(no) - want_pthreads=no - ;; - *) AC_MSG_RESULT(yes) - want_pthreads=yes - ;; - esac ], [ - AC_MSG_RESULT(auto) - want_pthreads=auto - ] + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) ) -dnl turn off pthreads if rt is disabled -if test "$want_pthreads" != "no"; then - if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then - AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive]) - fi - if test "$dontwant_rt" != "no"; then - dnl if --enable-pthreads was explicit then warn it's being ignored - if test "$want_pthreads" = "yes"; then - AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.]) - fi - want_pthreads=no - fi -fi - -dnl turn off pthreads if no threaded resolver -if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then - want_pthreads=no -fi - -dnl detect pthreads -if test "$want_pthreads" != "no"; then - AC_CHECK_HEADER(pthread.h, - [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have ]) - save_CFLAGS="$CFLAGS" - - dnl first check for function without lib - AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] ) - - dnl if it wasn't found without lib, search for it in pthread lib - if test "$USE_THREADS_POSIX" != "1" - then - CFLAGS="$CFLAGS -pthread" - AC_CHECK_LIB(pthread, pthread_create, - [USE_THREADS_POSIX=1], - [ CFLAGS="$save_CFLAGS"]) - fi - - if test "x$USE_THREADS_POSIX" = "x1" - then - AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup]) - curl_res_msg="POSIX threaded" - fi - ]) -fi - -dnl threaded resolver check -if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then - if test "$want_pthreads" = "yes"; then - AC_MSG_ERROR([--enable-pthreads but pthreads was not found]) - fi - dnl If native Windows fallback on Win32 threads since no POSIX threads - if test "$curl_cv_native_windows" = "yes"; then - USE_THREADS_WIN32=1 - AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup]) - curl_res_msg="Win32 threaded" - else - AC_MSG_ERROR([Threaded resolver enabled but no thread library found]) - fi -fi - dnl ************************************************************ -dnl disable verbose text strings +dnl disable netrc dnl -AC_MSG_CHECKING([whether to enable verbose strings]) -AC_ARG_ENABLE(verbose, -AC_HELP_STRING([--enable-verbose],[Enable verbose strings]) -AC_HELP_STRING([--disable-verbose],[Disable verbose strings]), +AC_MSG_CHECKING([whether to support netrc parsing]) +AC_ARG_ENABLE(netrc, +AS_HELP_STRING([--enable-netrc],[Enable netrc parsing]) +AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) - curl_verbose_msg="no" - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) dnl ************************************************************ -dnl enable SSPI support +dnl disable progress-meter dnl -AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)]) -AC_ARG_ENABLE(sspi, -AC_HELP_STRING([--enable-sspi],[Enable SSPI]) -AC_HELP_STRING([--disable-sspi],[Disable SSPI]), +AC_MSG_CHECKING([whether to support progress-meter]) +AC_ARG_ENABLE(progress-meter, +AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter]) +AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]), [ case "$enableval" in - yes) - if test "$curl_cv_native_windows" = "yes"; then - AC_MSG_RESULT(yes) - AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) - AC_SUBST(USE_WINDOWS_SSPI, [1]) - curl_sspi_msg="enabled" - else - AC_MSG_RESULT(no) - AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) - fi - ;; + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter]) + ;; *) - if test "x$WINSSL_ENABLED" = "x1"; then - # --with-winssl implies --enable-sspi - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - ;; + AC_MSG_RESULT(yes) + ;; esac ], - if test "x$WINSSL_ENABLED" = "x1"; then - # --with-winssl implies --enable-sspi - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi + AC_MSG_RESULT(yes) ) dnl ************************************************************ -dnl disable cryptographic authentication +dnl disable SHA-512/256 hash algorithm dnl -AC_MSG_CHECKING([whether to enable cryptographic authentication methods]) -AC_ARG_ENABLE(crypto-auth, -AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication]) -AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]), +AC_MSG_CHECKING([whether to support the SHA-512/256 hash algorithm]) +AC_ARG_ENABLE(sha512-256, +AS_HELP_STRING([--enable-sha512-256],[Enable SHA-512/256 hash algorithm (default)]) +AS_HELP_STRING([--disable-sha512-256],[Disable SHA-512/256 hash algorithm]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication]) - CURL_DISABLE_CRYPTO_AUTH=1 - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SHA512_256, 1, [disable SHA-512/256 hash algorithm]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) -CURL_CHECK_OPTION_NTLM_WB - -CURL_CHECK_NTLM_WB - dnl ************************************************************ -dnl disable TLS-SRP authentication +dnl disable shuffle DNS support dnl -AC_MSG_CHECKING([whether to enable TLS-SRP authentication]) -AC_ARG_ENABLE(tls-srp, -AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication]) -AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), +AC_MSG_CHECKING([whether to support DNS shuffling]) +AC_ARG_ENABLE(dnsshuffle, +AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling]) +AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication]) - want_tls_srp=no - ;; - *) AC_MSG_RESULT(yes) - want_tls_srp=yes - ;; + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) - want_tls_srp=yes + AC_MSG_RESULT(yes) ) -if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then - AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) - USE_TLS_SRP=1 - curl_tls_srp_msg="enabled" -fi +dnl ************************************************************ +dnl disable the curl_easy_options API +dnl +AC_MSG_CHECKING([whether to support curl_easy_option*]) +AC_ARG_ENABLE(get-easy-options, +AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options]) +AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]), +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options]) + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) +) dnl ************************************************************ -dnl disable Unix domain sockets support +dnl switch on/off alt-svc dnl -AC_MSG_CHECKING([whether to enable Unix domain sockets]) -AC_ARG_ENABLE(unix-sockets, -AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets]) -AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), +AC_MSG_CHECKING([whether to support alt-svc]) +AC_ARG_ENABLE(alt-svc, +AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support]) +AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]), [ case "$enableval" in - no) AC_MSG_RESULT(no) - want_unix_sockets=no - ;; - *) AC_MSG_RESULT(yes) - want_unix_sockets=yes - ;; - esac ], [ - AC_MSG_RESULT(auto) - want_unix_sockets=auto - ] + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) + curl_altsvc_msg="no"; + enable_altsvc="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT(yes) ) -if test "x$want_unix_sockets" != "xno"; then - AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [ - AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) - AC_SUBST(USE_UNIX_SOCKETS, [1]) - curl_unix_sockets_msg="enabled" - ], [ - if test "x$want_unix_sockets" = "xyes"; then - AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!]) - fi - ], [ - #include - ]) -fi dnl ************************************************************ -dnl disable cookies support +dnl switch on/off headers-api dnl -AC_MSG_CHECKING([whether to enable support for cookies]) -AC_ARG_ENABLE(cookies, -AC_HELP_STRING([--enable-cookies],[Enable cookies support]) -AC_HELP_STRING([--disable-cookies],[Disable cookies support]), +AC_MSG_CHECKING([whether to support headers-api]) +AC_ARG_ENABLE(headers-api, +AS_HELP_STRING([--enable-headers-api],[Enable headers-api support]) +AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]), [ case "$enableval" in no) - AC_MSG_RESULT(no) - AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) - ;; - *) AC_MSG_RESULT(yes) - ;; + AC_MSG_RESULT(no) + curl_headers_msg="no (--enable-headers-api)" + AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api]) + ;; + *) + AC_MSG_RESULT(yes) + ;; esac ], - AC_MSG_RESULT(yes) + AC_MSG_RESULT(yes) ) +dnl only check for HSTS if there's SSL present +if test -n "$SSL_ENABLED"; then + dnl ************************************************************ + dnl switch on/off hsts + dnl + AC_MSG_CHECKING([whether to support HSTS]) + AC_ARG_ENABLE(hsts, +AS_HELP_STRING([--enable-hsts],[Enable HSTS support]) +AS_HELP_STRING([--disable-hsts],[Disable HSTS support]), + [ case "$enableval" in + no) + AC_MSG_RESULT(no) + hsts="no" + ;; + *) + AC_MSG_RESULT(yes) + ;; + esac ], + AC_MSG_RESULT($hsts) + ) +else + AC_MSG_NOTICE([disables HSTS due to lack of SSL]) + hsts="no" +fi + +if test "x$hsts" != "xyes"; then + curl_hsts_msg="no (--enable-hsts)"; + AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc]) +fi + + +dnl ************************************************************* +dnl check whether ECH support, if desired, is actually available +dnl +if test "x$want_ech" != "xno"; then + AC_MSG_CHECKING([whether ECH support is available]) + + dnl assume NOT and look for sufficient condition + ECH_ENABLED=0 + ECH_ENABLED_OPENSSL=0 + ECH_ENABLED_WOLFSSL=0 + ECH_ENABLED_RUSTLS=0 + ECH_SUPPORT='' + + dnl check for OpenSSL equivalent + if test "x$OPENSSL_ENABLED" = "x1"; then + AC_CHECK_FUNCS(SSL_set1_ech_config_list, + ECH_SUPPORT="$ECH_SUPPORT OpenSSL" + ECH_ENABLED_OPENSSL=1) + fi + if test "x$WOLFSSL_ENABLED" = "x1"; then + AC_CHECK_FUNCS(wolfSSL_CTX_GenerateEchConfig, + ECH_SUPPORT="$ECH_SUPPORT wolfSSL" + ECH_ENABLED_WOLFSSL=1) + fi + if test "x$RUSTLS_ENABLED" = "x1"; then + ECH_SUPPORT="$ECH_SUPPORT rustls-ffi" + ECH_ENABLED_RUSTLS=1 + fi + + dnl now deal with whatever we found + if test "x$ECH_ENABLED_OPENSSL" = "x1" -o \ + "x$ECH_ENABLED_WOLFSSL" = "x1" -o \ + "x$ECH_ENABLED_RUSTLS" = "x1"; then + AC_DEFINE(USE_ECH, 1, [if ECH support is available]) + AC_MSG_RESULT(ECH support available via:$ECH_SUPPORT) + experimental="$experimental ECH" + ECH_ENABLED=1 + dnl ECH wants HTTPSRR + want_httpsrr="yes" + else + AC_MSG_ERROR([--enable-ech ignored: No ECH support found]) + fi +fi + +AC_MSG_CHECKING([whether to enable HTTPS-RR support]) +dnl ************************************************************* +dnl check whether HTTPSRR support if desired +dnl +if test "x$want_httpsrr" != "xno"; then + AC_MSG_RESULT([yes]) + AC_DEFINE(USE_HTTPSRR, 1, [enable HTTPS RR support]) + experimental="$experimental HTTPSRR" + curl_httpsrr_msg="enabled (--disable-httpsrr)" +else + AC_MSG_RESULT([no]) + # no HTTPSRR wanted + if test "$want_threaded_resolver" = "yes"; then + # and using the threaded resolver + if test "x$USE_ARES" = "x1"; then + AC_MSG_ERROR([without HTTPS-RR support, asking for both threaded resolver and c-ares support is ambivalent. Please drop one of them.]) + fi + fi +fi + + +dnl ************************************************************* +dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio +dnl +if test "x$OPENSSL_ENABLED" = "x1"; then + AC_CHECK_FUNCS([SSL_set0_wbio]) +fi + +if test "x$CURL_DISABLE_HTTP" != "x1"; then + dnl ************************************************************* + dnl WebSockets + dnl + AC_MSG_CHECKING([whether to support WebSockets]) + AC_ARG_ENABLE(websockets, + AS_HELP_STRING([--enable-websockets],[Enable WebSockets support]) + AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]), + [ case "$enableval" in + no) + AC_MSG_RESULT(no) + AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) + CURL_DISABLE_WEBSOCKETS=1 + ;; + *) + if test ${ac_cv_sizeof_curl_off_t} -gt 4; then + AC_MSG_RESULT(yes) + else + dnl WebSockets requires >32 bit curl_off_t + AC_MSG_RESULT(no) + AC_MSG_WARN([WebSockets disabled due to lack of >32 bit curl_off_t]) + AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) + CURL_DISABLE_WEBSOCKETS=1 + fi + ;; + esac ], + AC_MSG_RESULT(yes) + ) +else + AC_MSG_WARN([WebSockets disabled because HTTP is disabled]) + AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) + CURL_DISABLE_WEBSOCKETS=1 +fi + +dnl ************************************************************* +dnl check whether experimental SSL Session Im-/Export is enabled +dnl +if test "x$want_ssls_export" != "xno"; then + AC_MSG_CHECKING([whether SSL session export support is available]) + + dnl assume NOT and look for sufficient condition + SSLS_EXPORT_ENABLED=0 + SSLS_EXPORT_SUPPORT='' + + if test "x$SSL_ENABLED" != "x1"; then + AC_MSG_ERROR([--enable-ssls-export ignored: No SSL support]) + else + SSLS_EXPORT_ENABLED=1 + AC_DEFINE(USE_SSLS_EXPORT, 1, [if SSL session export support is available]) + AC_MSG_RESULT("SSL session im-/export enabled") + experimental="$experimental SSLS-EXPORT" + fi +fi + dnl ************************************************************ dnl hiding of library internal symbols dnl @@ -3742,10 +5115,28 @@ CURL_CONFIGURE_SYMBOL_HIDING dnl dnl All the library dependencies put into $LIB apply to libcurl only. dnl -LIBCURL_LIBS=$LIBS +LIBCURL_PC_LDFLAGS_PRIVATE='' +dnl Do not quote $INITIAL_LDFLAGS +set -- $INITIAL_LDFLAGS +while test -n "$1"; do + case "$1" in + -L* | --library-path=* | -F*) + LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1" + ;; + -framework) + if test -n "$2"; then + LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1 $2" + shift + fi + ;; + esac + shift +done +LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $LDFLAGSPC" +LIBCURL_PC_LIBS_PRIVATE="$LIBS$PTHREAD" -AC_SUBST(LIBCURL_LIBS) -AC_SUBST(CURL_NETWORK_LIBS) +AC_SUBST(LIBCURL_PC_LDFLAGS_PRIVATE) +AC_SUBST(LIBCURL_PC_LIBS_PRIVATE) AC_SUBST(CURL_NETWORK_AND_TIME_LIBS) dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank @@ -3765,6 +5156,23 @@ dnl to let curl-config output the static libraries correctly ENABLE_STATIC="$enable_static" AC_SUBST(ENABLE_STATIC) +squeeze LIBCURL_PC_REQUIRES_PRIVATE +LIBCURL_PC_REQUIRES_PRIVATE=`echo $LIBCURL_PC_REQUIRES_PRIVATE | tr ' ' ','` + +AC_SUBST(LIBCURL_PC_REQUIRES_PRIVATE) + +dnl Merge pkg-config private fields into public ones when static-only +if test "x$enable_shared" = "xno"; then + LIBCURL_PC_REQUIRES=$LIBCURL_PC_REQUIRES_PRIVATE + LIBCURL_PC_LIBS=$LIBCURL_PC_LIBS_PRIVATE +else + LIBCURL_PC_REQUIRES= + LIBCURL_PC_LIBS= +fi +AC_SUBST(LIBCURL_PC_REQUIRES) +AC_SUBST(LIBCURL_PC_LIBS) + +rm $compilersh dnl dnl For keeping supported features and protocols also in pkg-config file @@ -3785,10 +5193,19 @@ fi if test "x$HAVE_LIBZ" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES libz" fi +if test "x$HAVE_BROTLI" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES brotli" +fi +if test "x$HAVE_ZSTD" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES zstd" +fi if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \ -o "x$USE_THREADS_WIN32" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" fi +if test "x$USE_ARES" = "x1" -a "$want_threaded_resolver" = "yes" -a "x$want_httpsrr" != "xno"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES asyn-rr" +fi if test "x$IDN_ENABLED" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" fi @@ -3800,30 +5217,44 @@ if test "x$HAVE_GSSAPI" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API" fi -if test "x$curl_psl_msg" = "xyes"; then +if test "x$curl_psl_msg" = "xenabled"; then SUPPORT_FEATURES="$SUPPORT_FEATURES PSL" fi -if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ +if test "x$curl_gsasl_msg" = "xenabled"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES gsasl" +fi + +if test "x$enable_altsvc" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc" +fi +if test "x$hsts" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS" +fi + +if test "x$CURL_DISABLE_NEGOTIATE_AUTH" != "x1" -a \ \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO" fi -if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ +if test "x$CURL_DISABLE_KERBEROS_AUTH" != "x1" -a \ \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos" fi -if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then - if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" +use_curl_ntlm_core=no - if test "x$CURL_DISABLE_HTTP" != "x1" -a \ - "x$NTLM_WB_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" - fi +if test "x$CURL_DISABLE_NTLM" != "x1"; then + if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ + -o "x$GNUTLS_ENABLED" = "x1" \ + -o "x$USE_WIN32_CRYPTO" = "x1" \ + -o "x$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "x1"; then + use_curl_ntlm_core=yes + fi + + if test "x$use_curl_ntlm_core" = "xyes" \ + -o "x$USE_WINDOWS_SSPI" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" fi fi @@ -3835,15 +5266,108 @@ if test "x$USE_NGHTTP2" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2" fi +if test "x$USE_NGTCP2_H3" = "x1" -o "x$USE_QUICHE" = "x1" \ + -o "x$USE_OPENSSL_H3" = "x1" -o "x$USE_MSH3" = "x1"; then + if test "x$CURL_WITH_MULTI_SSL" = "x1"; then + AC_MSG_ERROR([MultiSSL cannot be enabled with HTTP/3 and vice versa]) + fi + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3" +fi + if test "x$CURL_WITH_MULTI_SSL" = "x1"; then SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL" fi -if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1"; then - SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" +AC_MSG_CHECKING([if this build supports HTTPS-proxy]) +dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends +if test "x$CURL_DISABLE_HTTP" != "x1"; then + if test "x$https_proxy" != "xno"; then + if test "x$OPENSSL_ENABLED" = "x1" \ + -o "x$GNUTLS_ENABLED" = "x1" \ + -o "x$RUSTLS_ENABLED" = "x1" \ + -o "x$SCHANNEL_ENABLED" = "x1" \ + -o "x$GNUTLS_ENABLED" = "x1" \ + -o "x$MBEDTLS_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" + AC_MSG_RESULT([yes]) + elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$HAVE_WOLFSSL_BIO_NEW" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + else + AC_MSG_RESULT([no]) + fi +else + AC_MSG_RESULT([no]) +fi + +if test "x$OPENSSL_ENABLED" = "x1" -o -n "$SSL_ENABLED"; then + if test "x$ECH_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES ECH" + fi +fi + +if test "x$want_httpsrr" != "xno"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPSRR" +fi + +if test "x$SSLS_EXPORT_ENABLED" = "x1"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES SSLS-EXPORT" +fi + +if test ${ac_cv_sizeof_curl_off_t} -gt 4; then + if test ${ac_cv_sizeof_off_t} -gt 4 -o \ + "$curl_win32_file_api" = "win32_large_files"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile" + fi +fi + +if test "$tst_atomic" = "yes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" +elif test "x$USE_THREADS_POSIX" = "x1" -a \ + "x$ac_cv_header_pthread_h" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" +else + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include + ]],[[ + #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600) + #error + #endif + ]]) + ],[ + SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" + ],[ + ]) +fi + +if test "x$want_winuni" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Unicode" +fi +if test "x$want_debug" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES Debug" +fi +if test "x$want_curldebug" = "xyes"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES TrackMemory" +fi +if test "x$CURL_CA_EMBED" != "x"; then + SUPPORT_FEATURES="$SUPPORT_FEATURES CAcert" + CURL_CA_EMBED_msg="$CURL_CA_EMBED" +else + CURL_CA_EMBED_msg='no' fi +dnl replace spaces with newlines +dnl sort the lines +dnl replace the newlines back to spaces +if sort -f /dev/null 2>&1; then + SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort -f | tr '\012' ' '` +else + SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '` +fi AC_SUBST(SUPPORT_FEATURES) dnl For supported protocols in pkg-config file @@ -3869,7 +5393,7 @@ if test "x$CURL_DISABLE_LDAP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" if test "x$CURL_DISABLE_LDAPS" != "x1"; then if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") || - (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then + (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" fi fi @@ -3882,6 +5406,12 @@ if test "x$CURL_DISABLE_TFTP" != "x1"; then fi if test "x$CURL_DISABLE_GOPHER" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER" + if test "x$SSL_ENABLED" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS" + fi +fi +if test "x$CURL_DISABLE_MQTT" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT" fi if test "x$CURL_DISABLE_POP3" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3" @@ -3896,10 +5426,7 @@ if test "x$CURL_DISABLE_IMAP" != "x1"; then fi fi if test "x$CURL_DISABLE_SMB" != "x1" \ - -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \ - -a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ - -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ - -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1" \); then + -a "x$use_curl_ntlm_core" = "xyes"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB" if test "x$SSL_ENABLED" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS" @@ -3915,12 +5442,28 @@ if test "x$USE_LIBSSH2" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" fi +if test "x$USE_LIBSSH" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" +fi +if test "x$USE_WOLFSSH" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" +fi +if test "x$CURL_DISABLE_IPFS" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IPFS IPNS" +fi if test "x$CURL_DISABLE_RTSP" != "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" fi if test "x$USE_LIBRTMP" = "x1"; then SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" fi +if test "x$CURL_DISABLE_WEBSOCKETS" != "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS" + if test "x$SSL_ENABLED" = "x1"; then + SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS" + fi +fi dnl replace spaces with newlines dnl sort the lines @@ -3937,8 +5480,8 @@ squeeze DEFS squeeze LDFLAGS squeeze LIBS -squeeze LIBCURL_LIBS -squeeze CURL_NETWORK_LIBS +squeeze LIBCURL_PC_LDFLAGS_PRIVATE +squeeze LIBCURL_PC_LIBS_PRIVATE squeeze CURL_NETWORK_AND_TIME_LIBS squeeze SUPPORT_FEATURES @@ -3946,82 +5489,113 @@ squeeze SUPPORT_PROTOCOLS XC_CHECK_BUILD_FLAGS +SSL_BACKENDS=${ssl_backends} +AC_SUBST(SSL_BACKENDS) + if test "x$want_curldebug_assumed" = "xyes" && test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then ac_configure_args="$ac_configure_args --enable-curldebug" fi -AC_CONFIG_FILES([Makefile \ - docs/Makefile \ - docs/examples/Makefile \ - docs/libcurl/Makefile \ - docs/libcurl/opts/Makefile \ - docs/cmdline-opts/Makefile \ - include/Makefile \ - include/curl/Makefile \ - src/Makefile \ - lib/Makefile \ - scripts/Makefile \ - lib/libcurl.vers \ - tests/Makefile \ - tests/certs/Makefile \ - tests/certs/scripts/Makefile \ - tests/data/Makefile \ - tests/server/Makefile \ - tests/libtest/Makefile \ - tests/unit/Makefile \ - packages/Makefile \ - packages/Win32/Makefile \ - packages/Win32/cygwin/Makefile \ - packages/Linux/Makefile \ - packages/Linux/RPM/Makefile \ - packages/Linux/RPM/curl.spec \ - packages/Linux/RPM/curl-ssl.spec \ - packages/Solaris/Makefile \ - packages/EPM/curl.list \ - packages/EPM/Makefile \ - packages/vms/Makefile \ - packages/AIX/Makefile \ - packages/AIX/RPM/Makefile \ - packages/AIX/RPM/curl.spec \ - curl-config \ - libcurl.pc +CURL_PREPARE_CONFIGUREHELP_PM + +AC_CONFIG_FILES([\ + Makefile \ + docs/Makefile \ + docs/examples/Makefile \ + docs/libcurl/Makefile \ + docs/libcurl/opts/Makefile \ + docs/cmdline-opts/Makefile \ + include/Makefile \ + include/curl/Makefile \ + src/Makefile \ + lib/Makefile \ + scripts/Makefile \ + lib/libcurl.vers \ + tests/Makefile \ + tests/config \ + tests/configurehelp.pm \ + tests/certs/Makefile \ + tests/data/Makefile \ + tests/server/Makefile \ + tests/libtest/Makefile \ + tests/unit/Makefile \ + tests/tunit/Makefile \ + tests/client/Makefile \ + tests/http/config.ini \ + tests/http/Makefile \ + packages/Makefile \ + packages/vms/Makefile \ + curl-config \ + libcurl.pc ]) AC_OUTPUT -CURL_GENERATE_CONFIGUREHELP_PM - -XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples]) +SUPPORT_PROTOCOLS_LOWER=`echo "$SUPPORT_PROTOCOLS" | tr A-Z a-z` AC_MSG_NOTICE([Configured to build curl/libcurl: - curl version: ${CURLVERSION} Host setup: ${host} Install prefix: ${prefix} Compiler: ${CC} - SSL support: ${curl_ssl_msg} - SSH support: ${curl_ssh_msg} - zlib support: ${curl_zlib_msg} - GSS-API support: ${curl_gss_msg} - TLS-SRP support: ${curl_tls_srp_msg} + CFLAGS: ${CFLAGS} + CFLAGS extras: ${CURL_CFLAG_EXTRAS} + CPPFLAGS: ${CPPFLAGS} + LDFLAGS: ${LDFLAGS} + curl-config: ${LIBCURL_PC_LDFLAGS_PRIVATE} + LIBS: ${LIBS} + + curl version: ${CURLVERSION} + SSL: ${curl_ssl_msg} + SSH: ${curl_ssh_msg} + zlib: ${curl_zlib_msg} + brotli: ${curl_brotli_msg} + zstd: ${curl_zstd_msg} + GSS-API: ${curl_gss_msg} + GSASL: ${curl_gsasl_msg} + TLS-SRP: ${curl_tls_srp_msg} resolver: ${curl_res_msg} - IPv6 support: ${curl_ipv6_msg} - Unix sockets support: ${curl_unix_sockets_msg} - IDN support: ${curl_idn_msg} + IPv6: ${curl_ipv6_msg} + Unix sockets: ${curl_unix_sockets_msg} + IDN: ${curl_idn_msg} + Build docs: ${curl_docs_msg} Build libcurl: Shared=${enable_shared}, Static=${enable_static} Built-in manual: ${curl_manual_msg} --libcurl option: ${curl_libcurl_msg} Verbose errors: ${curl_verbose_msg} - SSPI support: ${curl_sspi_msg} + Code coverage: ${curl_coverage_msg} + SSPI: ${curl_sspi_msg} ca cert bundle: ${ca}${ca_warning} ca cert path: ${capath}${capath_warning} + ca cert embed: ${CURL_CA_EMBED_msg} ca fallback: ${with_ca_fallback} - LDAP support: ${curl_ldap_msg} - LDAPS support: ${curl_ldaps_msg} - RTSP support: ${curl_rtsp_msg} - RTMP support: ${curl_rtmp_msg} - metalink support: ${curl_mtlnk_msg} - PSL support: ${curl_psl_msg} - HTTP2 support: ${curl_h2_msg} - Protocols: ${SUPPORT_PROTOCOLS} + LDAP: ${curl_ldap_msg} + LDAPS: ${curl_ldaps_msg} + IPFS/IPNS: ${curl_ipfs_msg} + RTSP: ${curl_rtsp_msg} + RTMP: ${curl_rtmp_msg} + PSL: ${curl_psl_msg} + Alt-svc: ${curl_altsvc_msg} + Headers API: ${curl_headers_msg} + HSTS: ${curl_hsts_msg} + HTTP1: ${curl_h1_msg} + HTTP2: ${curl_h2_msg} + HTTP3: ${curl_h3_msg} + ECH: ${curl_ech_msg} + HTTPS RR: ${curl_httpsrr_msg} + SSLS-EXPORT: ${curl_ssls_export_msg} + Protocols: ${SUPPORT_PROTOCOLS_LOWER} + Features: ${SUPPORT_FEATURES} ]) + +if test -n "$experimental"; then + for a in $experimental; do + AC_MSG_WARN([$a is enabled but marked EXPERIMENTAL. Use with caution!]) + done +fi + +CURL_PREPARE_BUILDINFO +echo "[@%:@] This is a generated file. Do not edit.${curl_buildinfo}" > ./buildinfo.txt +if test -n "$CURL_BUILDINFO$CURL_CI$CI"; then + AC_MSG_NOTICE([${curl_buildinfo}]) +fi diff --git a/curl/curl-config.in b/curl/curl-config.in index af484b445..31ea30b24 100644 --- a/curl/curl-config.in +++ b/curl/curl-config.in @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh #*************************************************************************** # _ _ ____ _ # Project ___| | | | _ \| | @@ -6,11 +6,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 2001 - 2012, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -19,160 +19,171 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # +# SPDX-License-Identifier: curl +# ########################################################################### -prefix=@prefix@ -exec_prefix=@exec_prefix@ -includedir=@includedir@ -cppflag_curl_staticlib=@CPPFLAG_CURL_STATICLIB@ +# shellcheck disable=SC2006 + +prefix='@prefix@' +# Used in 'libdir' +# shellcheck disable=SC2034 +exec_prefix="@exec_prefix@" +# shellcheck disable=SC2034 +includedir="@includedir@" usage() { - cat <&2 - exit 1 - fi - ;; - - --configure) - echo @CONFIGURE_OPTIONS@ - ;; - - *) - echo "unknown option: $1" - usage 1 - ;; - esac - shift + fi + fi + + echo "requested version $checkfor is newer than existing @CURLVERSION@" + exit 1 + ;; + + --vernum) + echo '@VERSIONNUM@' + exit 0 + ;; + + --help) + usage 0 + ;; + + --cflags) + if test "X@includedir@" = 'X/usr/include'; then + echo '@LIBCURL_PC_CFLAGS@' + else + echo "@LIBCURL_PC_CFLAGS@ -I@includedir@" + fi + ;; + + --libs) + if test "X@libdir@" != 'X/usr/lib' -a "X@libdir@" != 'X/usr/lib64'; then + curllibdir="-L@libdir@ " + else + curllibdir='' + fi + if test 'X@ENABLE_SHARED@' = 'Xno'; then + echo "${curllibdir}-lcurl @LIBCURL_PC_LIBS_PRIVATE@" + else + echo "${curllibdir}-lcurl" + fi + ;; + + --ssl-backends) + echo '@SSL_BACKENDS@' + ;; + + --static-libs) + if test 'X@ENABLE_STATIC@' != 'Xno'; then + echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@" + else + echo 'curl was built with static libraries disabled' >&2 + exit 1 + fi + ;; + + --configure) + echo @CONFIGURE_OPTIONS@ + ;; + + *) + echo "unknown option: $1" + usage 1 + ;; + esac + shift done exit 0 diff --git a/curl/depcomp b/curl/depcomp index b39f98f9a..715e34311 100644 --- a/curl/depcomp +++ b/curl/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,7 +783,7 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/curl/docs/ALTSVC.md b/curl/docs/ALTSVC.md new file mode 100644 index 000000000..bcdf56507 --- /dev/null +++ b/curl/docs/ALTSVC.md @@ -0,0 +1,43 @@ + + +# Alt-Svc + +curl features support for the Alt-Svc: HTTP header. + +## Enable Alt-Svc in build + +`./configure --enable-alt-svc` + +(enabled by default since 7.73.0) + +## Standard + +[RFC 7838](https://datatracker.ietf.org/doc/html/rfc7838) + +# Alt-Svc cache file format + +This is a text based file with one line per entry and each line consists of nine +space separated fields. + +## Example + + h2 quic.tech 8443 h3-22 quic.tech 8443 "20190808 06:18:37" 0 0 + +## Fields + +1. The ALPN id for the source origin +2. The hostname for the source origin +3. The port number for the source origin +4. The ALPN id for the destination host +5. The hostname for the destination host +6. The port number for the destination host +7. The expiration date and time of this entry within double quotes. The date format is "YYYYMMDD HH:MM:SS" and the time zone is GMT. +8. Boolean (1 or 0) if "persist" was set for this entry +9. Integer priority value (not currently used) + +If the hostname is an IPv6 numerical address, it is stored with brackets such +as `[::1]`. diff --git a/curl/docs/BINDINGS.md b/curl/docs/BINDINGS.md index 0c6534800..e6287761b 100644 --- a/curl/docs/BINDINGS.md +++ b/curl/docs/BINDINGS.md @@ -1,3 +1,9 @@ + + libcurl bindings ================ @@ -10,109 +16,133 @@ libcurl bindings The bindings listed below are not part of the curl/libcurl distribution archives, but must be downloaded and installed separately. -[Ada95](http://www.almroth.com/adacurl/index.html) Written by Andreas Almroth + -[Basic](http://scriptbasic.com/) ScriptBasic bindings written by Peter Verhas +[Ada95](https://web.archive.org/web/20070403105909/www.almroth.com/adacurl/index.html) Written by Andreas Almroth -C++: [curlpp](http://curlpp.org/) Written by Jean-Philippe Barrette-LaPierre, +[Basic](https://scriptbasic.com/) ScriptBasic bindings written by Peter Verhas + +C++: [curlpp](https://github.com/jpbarrette/curlpp/) Written by Jean-Philippe Barrette-LaPierre, [curlcpp](https://github.com/JosephP91/curlcpp) by Giuseppe Persico and [C++ -Requests](https://github.com/whoshuu/cpr) by Huu Nguyen +Requests](https://github.com/libcpr/cpr) by Huu Nguyen -[Ch](https://chcurl.sourceforge.io/) Written by Stephen Nestinger and Jonathan Rogado +[Ch](https://chcurl.sourceforge.net/) Written by Stephen Nestinger and Jonathan Rogado -Cocoa: [BBHTTP](https://github.com/brunodecarvalho/BBHTTP) written by Bruno de Carvalho +Cocoa: [BBHTTP](https://github.com/biasedbit/BBHTTP) written by Bruno de Carvalho [curlhandle](https://github.com/karelia/curlhandle) Written by Dan Wood +Clojure: [clj-curl](https://github.com/lsevero/clj-curl) by Lucas Severo + [D](https://dlang.org/library/std/net/curl.html) Written by Kenneth Bogert [Delphi](https://github.com/Mercury13/curl4delphi) Written by Mikhail Merkuryev -[Dylan](https://dylanlibs.sourceforge.io/) Written by Chris Double +[Dylan](https://dylanlibs.sourceforge.net/) Written by Chris Double -[Eiffel](https://room.eiffel.com/library/curl) Written by Eiffel Software +[Eiffel](https://iron.eiffel.com/repository/20.11/package/ABEF6975-37AC-45FD-9C67-52D10BA0669B) Written by Eiffel Software -[Euphoria](http://rays-web.com/eulibcurl.htm) Written by Ray Smith +[Euphoria](https://web.archive.org/web/20050204080544/rays-web.com/eulibcurl.htm) Written by Ray Smith -[Falcon](http://www.falconpl.org/index.ftd?page_id=prjs&prj_id=curl) +[Falcon](http://www.falconpl.org/project_docs/curl/) -[Ferite](http://www.ferite.org/) Written by Paul Querna +[Ferite](https://web.archive.org/web/20150102192018/ferite.org/) Written by Paul Querna -[Gambas](https://gambas.sourceforge.io/) +[Fortran](https://github.com/interkosmos/fortran-curl) Written by Philipp Engel -[glib/GTK+](http://atterer.net/glibcurl/) Written by Richard Atterer +[Gambas](https://gambas.sourceforge.net/) + +[glib/GTK+](https://web.archive.org/web/20100526203452/atterer.net/glibcurl) Written by Richard Atterer Go: [go-curl](https://github.com/andelf/go-curl) by ShuYu Wang -[Guile](http://www.lonelycactus.com/guile-curl.html) Written by Michael L. Gran +[Guile](https://github.com/spk121/guile-curl) Written by Michael L. Gran + +[Harbour](https://github.com/vszakats/hb/tree/main/contrib/hbcurl) Written by Viktor Szakats -[Harbour](https://github.com/vszakats/harbour-core/tree/master/contrib/hbcurl) Written by Viktor Szakáts +[Haskell](https://hackage.haskell.org/package/curl) Written by Galois, Inc -[Haskell](https://hackage.haskell.org/cgi-bin/hackage-scripts/package/curl) Written by Galois, Inc +[Hollywood](https://www.hollywood-mal.com/download.html) hURL by Andreas Falkenhahn -[Java](https://github.com/pjlegato/curl-java) +[Java](https://github.com/covers1624/curl4j) -[Julia](https://github.com/forio/Curl.jl) Written by Paul Howe +[Julia](https://github.com/JuliaWeb/LibCURL.jl) Written by Amit Murthy + +[Kapito](https://github.com/puzza007/katipo) is an Erlang HTTP library around libcurl. [Lisp](https://common-lisp.net/project/cl-curl/) Written by Liam Healy -Lua: [luacurl](http://luacurl.luaforge.net/) by Alexander Marinov, [Lua-cURL](https://github.com/Lua-cURL) by Jürgen Hötzel +Lua: [luacurl](https://web.archive.org/web/20201205052437/luacurl.luaforge.net/) by Alexander Marinov, [Lua-cURL](https://github.com/Lua-cURL) by Jürgen Hötzel -[Mono](https://forge.novell.com/modules/xfmod/project/?libcurl-mono) Written by Jeffrey Phillips +[Mono](https://web.archive.org/web/20070606064500/https://forge.novell.com/modules/xfmod/project/?libcurl-mono) Written by Jeffrey Phillips [.NET](https://sourceforge.net/projects/libcurl-net/) libcurl-net by Jeffrey Phillips +[Nim](https://nimble.directory/pkg/libcurl) wrapper for libcurl + [node.js](https://github.com/JCMais/node-libcurl) node-libcurl by Jonathan Cardoso Machado -[Object-Pascal](http://www.tekool.com/opcurl) Free Pascal, Delphi and Kylix binding written by Christophe Espern. +[Object-Pascal](https://web.archive.org/web/20020610214926/www.tekool.com/opcurl) Free Pascal, Delphi and Kylix binding written by Christophe Espern. [OCaml](https://opam.ocaml.org/packages/ocurl/) Written by Lars Nilsson and ygrek -[Pascal](http://houston.quik.com/jkp/curlpas/) Free Pascal, Delphi and Kylix binding written by Jeffrey Pohlmeyer. +[Pascal](https://web.archive.org/web/20030804091414/houston.quik.com/jkp/curlpas/) Free Pascal, Delphi and Kylix binding written by Jeffrey Pohlmeyer. -Perl: [WWW--Curl](https://github.com/szbalint/WWW--Curl) Maintained by Cris +Perl: [WWW::Curl](https://github.com/szbalint/WWW--Curl) Maintained by Cris Bailiff and Bálint Szilakszi, [perl6-net-curl](https://github.com/azawawi/perl6-net-curl) by Ahmad M. Zawawi +[NET::Curl](https://metacpan.org/pod/Net::Curl) by Przemyslaw Iskra [PHP](https://php.net/curl) Originally written by Sterling Hughes -[PostgreSQL](http://gborg.postgresql.org/project/pgcurl/projdisplay.php) Written by Gian Paolo Ciceri +[PostgreSQL](https://github.com/pramsey/pgsql-http) - HTTP client for PostgreSQL + +[PostgreSQL](https://github.com/RekGRpth/pg_curl) - cURL client for PostgreSQL + +[PureBasic](https://www.purebasic.com/documentation/http/index.html) uses libcurl in its "native" HTTP subsystem [Python](http://pycurl.io/) PycURL by Kjetil Jacobsen +[Python](https://pypi.org/project/pymcurl/) mcurl by Ganesh Viswanathan + +[Q](https://q-lang.sourceforge.net/) The libcurl module is part of the default install + [R](https://cran.r-project.org/package=curl) -[Rexx](https://rexxcurl.sourceforge.io/) Written Mark Hessling +[Rexx](https://rexxcurl.sourceforge.net/) Written Mark Hessling [Ring](https://ring-lang.sourceforge.io/doc1.3/libcurl.html) RingLibCurl by Mahmoud Fayed RPG, support for ILE/RPG on OS/400 is included in source distribution -Ruby: [curb](http://curb.rubyforge.org/) written by Ross Bamford, [ruby-curl-multi](http://curl-multi.rubyforge.org/) written by Kristjan Petursson and Keith Rarick +Ruby: [curb](https://github.com/taf2/curb) written by Ross Bamford, +[ruby-curl-multi](https://github.com/kball/curl_multi.rb) by Kristjan Petursson and Keith Rarick -[Rust](https://github.com/carllerche/curl-rust) curl-rust - by Carl Lerche +[Rust](https://github.com/alexcrichton/curl-rust) curl-rust - by Carl Lerche [Scheme](https://www.metapaper.net/lisovsky/web/curl/) Bigloo binding by Kirill Lisovsky [Scilab](https://help.scilab.org/docs/current/fr_FR/getURL.html) binding by Sylvestre Ledru -[S-Lang](http://www.jedsoft.org/slang/modules/curl.html) by John E Davis +[S-Lang](https://www.jedsoft.org/slang/modules/curl.html) by John E Davis -[Smalltalk](http://www.squeaksource.com/CurlPlugin/) Written by Danil Osipchuk +[Smalltalk](https://www.squeaksource.com/CurlPlugin/) Written by Danil Osipchuk [SP-Forth](https://sourceforge.net/p/spf/spf/ci/master/tree/devel/~ac/lib/lin/curl/) Written by Andrey Cherezov -[SPL](http://www.clifford.at/spl/) Written by Clifford Wolf +[SPL](https://web.archive.org/web/20210203022158/www.clifford.at/spl/spldoc/curl.html) Written by Clifford Wolf -[Tcl](http://mirror.yellow5.com/tclcurl/) Tclcurl by Andrés García +[Tcl](https://web.archive.org/web/20160826011806/mirror.yellow5.com/tclcurl/) Tclcurl by Andrés García -[Visual Basic](https://sourceforge.net/projects/libcurl-vb/) libcurl-vb by Jeffrey Phillips +[Vibe](https://github.com/ttytm/vibe) HTTP requests through libcurl in V -[Visual Foxpro](http://www.ctl32.com.ar/libcurl.asp) by Carlos Alloatti +[Visual Basic](https://sourceforge.net/projects/libcurl-vb/) libcurl-vb by Jeffrey Phillips -[Q](https://q-lang.sourceforge.io/) The libcurl module is part of the default install +[Visual Foxpro](https://web.archive.org/web/20130730181523/www.ctl32.com.ar/libcurl.asp) by Carlos Alloatti -[wxWidgets](https://wxcode.sourceforge.io/components/wxcurl/) Written by Casey O'Donnell +[wxWidgets](https://wxcode.sourceforge.net/components/wxcurl/) Written by Casey O'Donnell -[XBLite](http://perso.wanadoo.fr/xblite/libraries.html) Written by David Szafranski +[XBLite](https://web.archive.org/web/20060426150418/perso.wanadoo.fr/xblite/libraries.html) Written by David Szafranski [Xojo](https://github.com/charonn0/RB-libcURL) Written by Andrew Lambert + +[Zig](https://github.com/jiacai2050/zig-curl) Written by Jiacai Liu, both easy and multi API are supported. diff --git a/curl/docs/BUG-BOUNTY.md b/curl/docs/BUG-BOUNTY.md new file mode 100644 index 000000000..6933c61b3 --- /dev/null +++ b/curl/docs/BUG-BOUNTY.md @@ -0,0 +1,93 @@ + + +# The curl bug bounty + +The curl project runs a bug bounty program in association with +[HackerOne](https://www.hackerone.com) and the [Internet Bug +Bounty](https://internetbugbounty.org). + +## How does it work? + +Start out by posting your suspected security vulnerability directly to [curl's +HackerOne program](https://hackerone.com/curl). + +After you have reported a security issue, it has been deemed credible, and a +patch and advisory has been made public, you may be eligible for a bounty from +this program. See the [Security Process](https://curl.se/dev/secprocess.html) +document for how we work with security issues. + +## What are the reward amounts? + +The curl project offers monetary compensation for reported and published +security vulnerabilities. The amount of money that is rewarded depends on how +serious the flaw is determined to be. + +Since 2021, the Bug Bounty is managed in association with the Internet Bug +Bounty and they set the reward amounts. If it would turn out that they set +amounts that are way lower than we can accept, the curl project intends to +"top up" rewards. + +In 2025, typical "Medium" rated vulnerabilities are rewarded 2,500 USD each. + +## Who is eligible for a reward? + +Everyone and anyone who reports a security problem in a released curl version +that has not already been reported can ask for a bounty. + +Dedicated - paid for - security audits that are performed in collaboration +with curl developers are not eligible for bounties. + +Vulnerabilities in features that are off by default and documented as +experimental are not eligible for a reward. + +The vulnerability has to be fixed and publicly announced (by the curl project) +before a bug bounty is considered. + +Once the vulnerability has been published by curl, the researcher can request +their bounty from the [Internet Bug Bounty](https://hackerone.com/ibb). + +Bounties need to be requested within twelve months from the publication of the +vulnerability. + +The curl security team reserves themselves the right to deny or allow bug +bounty payouts on its own discretion. There is no appeals process. + +## Product vulnerabilities only + +This bug bounty only concerns the curl and libcurl products and thus their +respective source codes - when running on existing hardware. It does not +include curl documentation, curl websites, or other curl related +infrastructure. + +The curl security team is the sole arbiter if a reported flaw is subject to a +bounty or not. + +## Third parties + +The curl bug bounty does not cover flaws in third party dependencies +(libraries) used by curl or libcurl. If the bug triggers because of curl +behaving wrongly or abusing a third party dependency, the problem is rather in +curl and not in the dependency and then the bounty might cover the problem. + +## How are vulnerabilities graded? + +The grading of each reported vulnerability that makes a reward claim is +performed by the curl security team. The grading is based on the CVSS (Common +Vulnerability Scoring System) 3.0. + +## How are reward amounts determined? + +The curl security team gives the vulnerability a score or severity level, as +mentioned above. The actual monetary reward amount is decided and paid by the +Internet Bug Bounty.. + +## Regarding taxes, etc. on the bounties + +In the event that the individual receiving a bug bounty needs to pay taxes on +the reward money, the responsibility lies with the receiver. The curl project +or its security team never actually receive any of this money, hold the money, +or pay out the money. diff --git a/curl/docs/BUGS b/curl/docs/BUGS deleted file mode 100644 index 3c8fa9fcc..000000000 --- a/curl/docs/BUGS +++ /dev/null @@ -1,297 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -BUGS - - 1. Bugs - 1.1 There are still bugs - 1.2 Where to report - 1.3 Security bugs - 1.4 What to report - 1.5 libcurl problems - 1.6 Who will fix the problems - 1.7 How to get a stack trace - 1.8 Bugs in libcurl bindings - 1.9 Bugs in old versions - - 2. Bug fixing procedure - 2.1 What happens on first filing - 2.2 First response - 2.3 Not reproducible - 2.4 Unresponsive - 2.5 Lack of time/interest - 2.6 KNOWN_BUGS - 2.7 TODO - 2.8 Closing off stalled bugs - -============================================================================== - -1.1 There are still bugs - - Curl and libcurl keep being developed. Adding features and changing code - means that bugs will sneak in, no matter how hard we try not to. - - Of course there are lots of bugs left. And lots of misfeatures. - - To help us make curl the stable and solid product we want it to be, we need - bug reports and bug fixes. - -1.2 Where to report - - If you can't fix a bug yourself and submit a fix for it, try to report an as - detailed report as possible to a curl mailing list to allow one of us to - have a go at a solution. You can optionally also post your bug/problem at - curl's bug tracking system over at - - https://github.com/curl/curl/issues - - Please read the rest of this document below first before doing that! - - If you feel you need to ask around first, find a suitable mailing list and - post there. The lists are available on https://curl.haxx.se/mail/ - -1.3 Security bugs - - If you find a bug or problem in curl or libcurl that you think has a - security impact, for example a bug that can put users in danger or make them - vulnerable if the bug becomes public knowledge, then please report that bug - using our security development process. - - Security related bugs or bugs that are suspected to have a security impact, - should be reported by email to curl-security@haxx.se so that they first can - be dealt with away from the public to minimize the harm and impact it will - have on existing users out there who might be using the vulernable versions. - - The curl project's process for handling security related issues is - documented here: - - https://curl.haxx.se/dev/security.html - -1.4 What to report - - When reporting a bug, you should include all information that will help us - understand what's wrong, what you expected to happen and how to repeat the - bad behavior. You therefore need to tell us: - - - your operating system's name and version number - - - what version of curl you're using (curl -V is fine) - - - versions of the used libraries that libcurl is built to use - - - what URL you were working with (if possible), at least which protocol - - and anything and everything else you think matters. Tell us what you - expected to happen, tell use what did happen, tell us how you could make it - work another way. Dig around, try out, test. Then include all the tiny bits - and pieces in your report. You will benefit from this yourself, as it will - enable us to help you quicker and more accurately. - - Since curl deals with networks, it often helps us if you include a protocol - debug dump with your bug report. The output you get by using the -v or - --trace options. - - If curl crashed, causing a core dump (in unix), there is hardly any use to - send that huge file to anyone of us. Unless we have an exact same system - setup as you, we can't do much with it. Instead we ask you to get a stack - trace and send that (much smaller) output to us instead! - - The address and how to subscribe to the mailing lists are detailed in the - MANUAL file. - -1.5 libcurl problems - - When you've written your own application with libcurl to perform transfers, - it is even more important to be specific and detailed when reporting bugs. - - Tell us the libcurl version and your operating system. Tell us the name and - version of all relevant sub-components like for example the SSL library - you're using and what name resolving your libcurl uses. If you use SFTP or - SCP, the libssh2 version is relevant etc. - - Showing us a real source code example repeating your problem is the best way - to get our attention and it will greatly increase our chances to understand - your problem and to work on a fix (if we agree it truly is a problem). - - Lots of problems that appear to be libcurl problems are actually just abuses - of the libcurl API or other malfunctions in your applications. It is advised - that you run your problematic program using a memory debug tool like - valgrind or similar before you post memory-related or "crashing" problems to - us. - -1.6 Who will fix the problems - - If the problems or bugs you describe are considered to be bugs, we want to - have the problems fixed. - - There are no developers in the curl project that are paid to work on bugs. - All developers that take on reported bugs do this on a voluntary basis. We - do it out of an ambition to keep curl and libcurl excellent products and out - of pride. - - But please do not assume that you can just lump over something to us and it - will then magically be fixed after some given time. Most often we need - feedback and help to understand what you've experienced and how to repeat a - problem. Then we may only be able to assist YOU to debug the problem and to - track down the proper fix. - - We get reports from many people every month and each report can take a - considerable amount of time to really go to the bottom with. - -1.7 How to get a stack trace - - First, you must make sure that you compile all sources with -g and that you - don't 'strip' the final executable. Try to avoid optimizing the code as - well, remove -O, -O2 etc from the compiler options. - - Run the program until it cores. - - Run your debugger on the core file, like ' curl core'. - should be replaced with the name of your debugger, in most cases that will - be 'gdb', but 'dbx' and others also occur. - - When the debugger has finished loading the core file and presents you a - prompt, enter 'where' (without the quotes) and press return. - - The list that is presented is the stack trace. If everything worked, it is - supposed to contain the chain of functions that were called when curl - crashed. Include the stack trace with your detailed bug report. It'll help a - lot. - -1.8 Bugs in libcurl bindings - - There will of course pop up bugs in libcurl bindings. You should then - primarily approach the team that works on that particular binding and see - what you can do to help them fix the problem. - - If you suspect that the problem exists in the underlying libcurl, then - please convert your program over to plain C and follow the steps outlined - above. - -1.9 Bugs in old versions - - The curl project typically releases new versions every other month, and we - fix several hundred bugs per year. For a huge table of releases, number of - bug fixes and more, see: https://curl.haxx.se/docs/releases.html - - The developers in the curl project do not have bandwidth or energy enough to - maintain several branches or to spend much time on hunting down problems in - old versions when chances are we already fixed them or at least that they've - changed nature and appearance in later versions. - - When you experience a problem and want to report it, you really SHOULD - include the version number of the curl you're using when you experience the - issue. If that version number shows us that you're using an out-of-date - curl, you should also try out a modern curl version to see if the problem - persists or how/if it has changed in apperance. - - Even if you cannot immediately upgrade your application/system to run the - latest curl version, you can most often at least run a test version or - experimental build or similar, to get this confirmed or not. - - At times people insist that they cannot upgrade to a modern curl version, - but instead they "just want the bug fixed". That's fine, just don't count on - us spending many cycles on trying to identify which single commit, if that's - even possible, that at some point in the past fixed the problem you're now - experiencing. - - Security wise, it is almost always a bad idea to lag behind the current curl - versions by a lot. We keeping discovering and reporting security problems - over time see you can see in this table: - https://curl.haxx.se/docs/vulnerabilities.html - -2. Bug fixing procedure - -2.1 What happens on first filing - - When a new issue is posted in the issue tracker or on the mailing list, the - team of developers first need to see the report. Maybe they took the day - off, maybe they're off in the woods hunting. Have patience. Allow at least a - few days before expecting someone to have responded. - - In the issue tracker you can expect that some labels will be set on the - issue to help categorize it. - -2.2 First response - - If your issue/bug report wasn't perfect at once (and few are), chances are - that someone will ask follow-up questions. Which version did you use? Which - options did you use? How often does the problem occur? How can we reproduce - this problem? Which protocols does it involve? Or perhaps much more specific - and deep diving questions. It all depends on your specific issue. - - You should then respond to these follow-up questions and provide more info - about the problem, so that we can help you figure it out. Or maybe you can - help us figure it out. An active back-and-forth communication is important - and the key for finding a cure and landing a fix. - -2.3 Not reproducible - - For problems that we can't reproduce and can't understand even after having - gotten all the info we need and having studied the source code over again, - are really hard to solve so then we may require further work from you who - actually see or experience the problem. - -2.4 Unresponsive - - If the problem haven't been understood or reproduced, and there's nobody - responding to follow-up questions or questions asking for clarifications or - for discussing possible ways to move forward with the task, we take that as - a strong suggestion that the bug is not important. - - Unimportant issues will be closed as inactive sooner or later as they can't - be fixed. The inactivity period (waiting for responses) should not be - shorter than two weeks but may extend months. - -2.5 Lack of time/interest - - Bugs that are filed and are understood can unfortunately end up in the - "nobody cares enough about it to work on it" category. Such bugs are - perfectly valid problems that *should* get fixed but apparently aren't. We - try to mark such bugs as "KNOWN_BUGS material" after a time of inactivity - and if no activity is noticed after yet some time those bugs are added to - KNOWN_BUGS and are closed in the issue tracker. - -2.6 KNOWN_BUGS - - This is a list of known bugs. Bugs we know exist and that have been pointed - out but that haven't yet been fixed. The reasons for why they haven't been - fixed can involve anything really, but the primary reason is that nobody has - considered these problems to be important enough to spend the necessary time - and effort to have them fixed. - - The KNOWN_BUGS are always up for grabs and we will always love the ones who - bring one of them back to live and offers solutions to them. - - The KNOWN_BUGS document has a sibling document known as TODO. - -2.7 TODO - - Issues that are filed or reported that aren't really bugs but more missing - features or ideas for future improvements and so on are marked as - 'enhancement' or 'feature-request' and will be added to the TODO document - instead and the issue is closed. We don't keep TODO items in the issue - tracker. - - The TODO document is full of ideas and suggestions of what we can add or fix - one day. You're always encouraged and free to grab one of those items and - take up a discussion with the curl development team on how that could be - implemented or provided in the project so that you can work on ticking it - odd that document. - - If the issue is rather a bug and not a missing feature or functionality, it - is listed in KNOWN_BUGS instead. - -2.8 Closing off stalled bugs - - The issue and pull request trackers on https://github.com/curl/curl will - only hold "active" entries (using a non-precise definition of what active - actually is, but they're at least not completely dead). Those that are - abandonded or in other ways dormant will be closed and sometimes added to - TODO and KNOWN_BUGS instead. - - This way, we only have "active" issues open on github. Irrelevant issues and - pull requests will not distract developes or casual visitors. diff --git a/curl/docs/BUGS.md b/curl/docs/BUGS.md new file mode 100644 index 000000000..68d7fc347 --- /dev/null +++ b/curl/docs/BUGS.md @@ -0,0 +1,270 @@ + + +# BUGS + +## There are still bugs + + curl and libcurl keep being developed. Adding features and changing code + means that bugs sneak in, no matter how hard we try to keep them out. + + Of course there are lots of bugs left. Not to mention misfeatures. + + To help us make curl the stable and solid product we want it to be, we need + bug reports and bug fixes. + +## Where to report + + If you cannot fix a bug yourself and submit a fix for it, try to report an as + detailed report as possible to a curl mailing list to allow one of us to have + a go at a solution. You can optionally also submit your problem in [curl's + bug tracking system](https://github.com/curl/curl/issues). + + Please read the rest of this document below first before doing that. + + If you feel you need to ask around first, find a suitable [mailing + list](https://curl.se/mail/) and post your questions there. + +## Security bugs + + If you find a bug or problem in curl or libcurl that you think has a security + impact, for example a bug that can put users in danger or make them + vulnerable if the bug becomes public knowledge, then please report that bug + using our security development process. + + Security related bugs or bugs that are suspected to have a security impact, + should be reported on the [curl security tracker at + HackerOne](https://hackerone.com/curl). + + This ensures that the report reaches the curl security team so that they + first can deal with the report away from the public to minimize the harm and + impact it has on existing users out there who might be using the vulnerable + versions. + + The curl project's process for handling security related issues is + [documented separately](https://curl.se/dev/secprocess.html). + +## What to report + + When reporting a bug, you should include all information to help us + understand what is wrong, what you expected to happen and how to repeat the + bad behavior. You therefore need to tell us: + + - your operating system's name and version number + + - what version of curl you are using (`curl -V` is fine) + + - versions of the used libraries that libcurl is built to use + + - what URL you were working with (if possible), at least which protocol + + and anything and everything else you think matters. Tell us what you expected + to happen, tell us what did happen, tell us how you could make it work + another way. Dig around, try out, test. Then include all the tiny bits and + pieces in your report. You benefit from this yourself, as it enables us to + help you quicker and more accurately. + + Since curl deals with networks, it often helps us if you include a protocol + debug dump with your bug report. The output you get by using the `-v` or + `--trace` options. + + If curl crashed, causing a core dump (in Unix), there is hardly any use to + send that huge file to anyone of us. Unless we have the same system setup as + you, we cannot do much with it. Instead, we ask you to get a stack trace and + send that (much smaller) output to us instead. + + The address and how to subscribe to the mailing lists are detailed in the + `MANUAL.md` file. + +## libcurl problems + + When you have written your own application with libcurl to perform transfers, + it is even more important to be specific and detailed when reporting bugs. + + Tell us the libcurl version and your operating system. Tell us the name and + version of all relevant sub-components like for example the SSL library + you are using and what name resolving your libcurl uses. If you use SFTP or + SCP, the libssh2 version is relevant etc. + + Showing us a real source code example repeating your problem is the best way + to get our attention and it greatly increases our chances to understand your + problem and to work on a fix (if we agree it truly is a problem). + + Lots of problems that appear to be libcurl problems are actually just abuses + of the libcurl API or other malfunctions in your applications. It is advised + that you run your problematic program using a memory debug tool like valgrind + or similar before you post memory-related or "crashing" problems to us. + +## Who fixes the problems + + If the problems or bugs you describe are considered to be bugs, we want to + have the problems fixed. + + There are no developers in the curl project that are paid to work on bugs. + All developers that take on reported bugs do this on a voluntary basis. We do + it out of an ambition to keep curl and libcurl excellent products and out of + pride. + + Please do not assume that you can just lump over something to us and it then + magically gets fixed after some given time. Most often we need feedback and + help to understand what you have experienced and how to repeat a problem. + Then we may only be able to assist YOU to debug the problem and to track down + the proper fix. + + We get reports from many people every month and each report can take a + considerable amount of time to really go to the bottom with. + +## How to get a stack trace + + First, you must make sure that you compile all sources with `-g` and that you + do not 'strip' the final executable. Try to avoid optimizing the code as well, + remove `-O`, `-O2` etc from the compiler options. + + Run the program until it cores. + + Run your debugger on the core file, like ` curl core`. `` + should be replaced with the name of your debugger, in most cases that is + `gdb`, but `dbx` and others also occur. + + When the debugger has finished loading the core file and presents you a + prompt, enter `where` (without quotes) and press return. + + The list that is presented is the stack trace. If everything worked, it is + supposed to contain the chain of functions that were called when curl + crashed. Include the stack trace with your detailed bug report, it helps a + lot. + +## Bugs in libcurl bindings + + There are of course bugs in libcurl bindings. You should then primarily + approach the team that works on that particular binding and see what you can + do to help them fix the problem. + + If you suspect that the problem exists in the underlying libcurl, then please + convert your program over to plain C and follow the steps outlined above. + +## Bugs in old versions + + The curl project typically releases new versions every other month, and we + fix several hundred bugs per year. For a huge table of releases, number of + bug fixes and more, see: https://curl.se/docs/releases.html + + The developers in the curl project do not have bandwidth or energy enough to + maintain several branches or to spend much time on hunting down problems in + old versions when chances are we already fixed them or at least that they have + changed nature and appearance in later versions. + + When you experience a problem and want to report it, you really SHOULD + include the version number of the curl you are using when you experience the + issue. If that version number shows us that you are using an out-of-date curl, + you should also try out a modern curl version to see if the problem persists + or how/if it has changed in appearance. + + Even if you cannot immediately upgrade your application/system to run the + latest curl version, you can most often at least run a test version or + experimental build or similar, to get this confirmed or not. + + At times people insist that they cannot upgrade to a modern curl version, but + instead, they "just want the bug fixed". That is fine, just do not count on us + spending many cycles on trying to identify which single commit, if that is + even possible, that at some point in the past fixed the problem you are now + experiencing. + + Security wise, it is almost always a bad idea to lag behind the current curl + versions by a lot. We keep discovering and reporting security problems + over time see you can see in [this + table](https://curl.se/docs/vulnerabilities.html) + +# Bug fixing procedure + +## What happens on first filing + + When a new issue is posted in the issue tracker or on the mailing list, the + team of developers first needs to see the report. Maybe they took the day off, + maybe they are off in the woods hunting. Have patience. Allow at least a few + days before expecting someone to have responded. + + In the issue tracker, you can expect that some labels are set on the issue to + help categorize it. + +## First response + + If your issue/bug report was not perfect at once (and few are), chances are + that someone asks follow-up questions. Which version did you use? Which + options did you use? How often does the problem occur? How can we reproduce + this problem? Which protocols does it involve? Or perhaps much more specific + and deep diving questions. It all depends on your specific issue. + + You should then respond to these follow-up questions and provide more info + about the problem, so that we can help you figure it out. Or maybe you can + help us figure it out. An active back-and-forth communication is important + and the key for finding a cure and landing a fix. + +## Not reproducible + + We may require further work from you who actually see or experience the + problem if we cannot reproduce it and cannot understand it even after having + gotten all the info we need and having studied the source code over again. + +## Unresponsive + + If the problem have not been understood or reproduced, and there is nobody + responding to follow-up questions or questions asking for clarifications or + for discussing possible ways to move forward with the task, we take that as a + strong suggestion that the bug is unimportant. + + Unimportant issues are closed as inactive sooner or later as they cannot be + fixed. The inactivity period (waiting for responses) should not be shorter + than two weeks but may extend months. + +## Lack of time/interest + + Bugs that are filed and are understood can unfortunately end up in the + "nobody cares enough about it to work on it" category. Such bugs are + perfectly valid problems that *should* get fixed but apparently are not. We + try to mark such bugs as `KNOWN_BUGS material` after a time of inactivity and + if no activity is noticed after yet some time those bugs are added to the + `KNOWN_BUGS` document and are closed in the issue tracker. + +## `KNOWN_BUGS` + + This is a list of known bugs. Bugs we know exist and that have been pointed + out but that have not yet been fixed. The reasons for why they have not been + fixed can involve anything really, but the primary reason is that nobody has + considered these problems to be important enough to spend the necessary time + and effort to have them fixed. + + The `KNOWN_BUGS` items are always up for grabs and we love the ones who bring + one of them back to life and offer solutions to them. + + The `KNOWN_BUGS` document has a sibling document known as `TODO`. + +## `TODO` + + Issues that are filed or reported that are not really bugs but more missing + features or ideas for future improvements and so on are marked as + *enhancement* or *feature-request* and get added to the `TODO` document and + the issues are closed. We do not keep TODO items open in the issue tracker. + + The `TODO` document is full of ideas and suggestions of what we can add or + fix one day. You are always encouraged and free to grab one of those items and + take up a discussion with the curl development team on how that could be + implemented or provided in the project so that you can work on ticking it odd + that document. + + If an issue is rather a bug and not a missing feature or functionality, it is + listed in `KNOWN_BUGS` instead. + +## Closing off stalled bugs + + The [issue and pull request trackers](https://github.com/curl/curl) only hold + "active" entries open (using a non-precise definition of what active actually + is, but they are at least not completely dead). Those that are abandoned or + in other ways dormant are closed and sometimes added to `TODO` and + `KNOWN_BUGS` instead. + + This way, we only have "active" issues open on GitHub. Irrelevant issues and + pull requests do not distract developers or casual visitors. diff --git a/curl/docs/CHECKSRC.md b/curl/docs/CHECKSRC.md deleted file mode 100644 index b42de8470..000000000 --- a/curl/docs/CHECKSRC.md +++ /dev/null @@ -1,124 +0,0 @@ -# checksrc - -This is the tool we use within the curl project to scan C source code and -check that it adheres to our [Source Code Style guide](CODE_STYLE.md). - -## Usage - - checksrc.pl [options] [file1] [file2] ... - -## Command line options - -`-W[file]` whitelists that file and excludes it from being checked. Helpful -when, for example, one of the files is generated. - -`-D[dir]` directory name to prepend to file names when accessing them. - -`-h` shows the help output, that also lists all recognized warnings - -## What does checksrc warn for? - -checksrc does not check and verify the code against the entire style guide, -but the script is instead an effort to detect the most common mistakes and -syntax mistakes that contributors make before they get accustomed to our code -style. Heck, many of us regulars do the mistakes too and this script helps us -keep the code in shape. - - checksrc.pl -h - -Lists how to use the script and it lists all existing warnings it has and -problems it detects. At the time of this writing, the existing checksrc -warnings are: - -- `BADCOMMAND`: There's a bad !checksrc! instruction in the code. See the - **Ignore certain warnings** section below for details. - -- `BANNEDFUNC`: A banned function was used. The functions sprintf, vsprintf, - strcat, strncat, gets are **never** allowed in curl source code. - -- `BRACEELSE`: '} else' on the same line. The else is supposed to be on the - following line. - -- `BRACEPOS`: wrong position for an open brace (`{`). - -- `COMMANOSPACE`: a comma without following space - -- `COPYRIGHT`: the file is missing a copyright statement! - -- `CPPCOMMENTS`: `//` comment detected, that's not C89 compliant - -- `FOPENMODE`: `fopen()` needs a macro for the mode string, use it - -- `INDENTATION`: detected a wrong start column for code. Note that this warning - only checks some specific places and will certainly miss many bad - indentations. - -- `LONGLINE`: A line is longer than 79 columns. - -- `PARENBRACE`: `){` was used without sufficient space in between. - -- `RETURNNOSPACE`: `return` was used without space between the keyword and the - following value. - -- `SPACEAFTERPAREN`: there was a space after open parenthesis, `( text`. - -- `SPACEBEFORECLOSE`: there was a space before a close parenthesis, `text )`. - -- `SPACEBEFORECOMMA`: there was a space before a comma, `one , two`. - -- `SPACEBEFOREPAREN`: there was a space before an open parenthesis, `if (`, - where one was not expected - -- `SPACESEMILCOLON`: there was a space before semicolon, ` ;`. - -- `TABS`: TAB characters are not allowed! - -- `TRAILINGSPACE`: Trailing white space on the line - -- `UNUSEDIGNORE`: a checksrc inlined warning ignore was asked for but not used, - that's an ignore that should be removed or changed to get used. - -## Ignore certain warnings - -Due to the nature of the source code and the flaws of the checksrc tool, there -is sometimes a need to ignore specific warnings. checksrc allows a few -different ways to do this. - -### Inline ignore - -You can control what to ignore within a specific source file by providing -instructions to checksrc in the source code itself. You need a magic marker -that is `!checksrc!` followed by the instruction. The instruction can ask to -ignore a specific warning N number of times or you ignore all of them until -you mark the end of the ignored section. - -Inline ignores are only done for that single specific source code file. - -Example - - /* !checksrc! disable LONGLINE all */ - -This will ignore the warning for overly long lines until it is re-enabled with: - - /* !checksrc! enable LONGLINE */ - -If the enabling isn't performed before the end of the file, it will be enabled -automatically for the next file. - -You can also opt to ignore just N violations so that if you have a single long -line you just can't shorten and is agreed to be fine anyway: - - /* !checksrc! disable LONGLINE 1 */ - -... and the warning for long lines will be enabled again automatically after -it has ignored that single warning. The number `1` can of course be changed to -any other integer number. It can be used to make sure only the exact intended -instances are ignored and nothing extra. - -### Directory wide ignore patterns - -This is a method we've transitioned away from. Use inline ignores as far as -possible. - -Make a `checksrc.whitelist` file in the directory of the source code with the -false positive, and include the full offending line into this file. diff --git a/curl/docs/CIPHERS-TLS12.md b/curl/docs/CIPHERS-TLS12.md new file mode 100644 index 000000000..d67c62ba7 --- /dev/null +++ b/curl/docs/CIPHERS-TLS12.md @@ -0,0 +1,336 @@ + + +# TLS 1.2 cipher suites + +| Id | IANA name | OpenSSL name | RFC | +|--------|-----------------------------------------------|------------------------------------|--------------------| +| 0x0001 | TLS_RSA_WITH_NULL_MD5 | NULL-MD5 | [RFC5246] | +| 0x0002 | TLS_RSA_WITH_NULL_SHA | NULL-SHA | [RFC5246] | +| 0x0003 | TLS_RSA_EXPORT_WITH_RC4_40_MD5 | EXP-RC4-MD5 | [RFC4346][RFC6347] | +| 0x0004 | TLS_RSA_WITH_RC4_128_MD5 | RC4-MD5 | [RFC5246][RFC6347] | +| 0x0005 | TLS_RSA_WITH_RC4_128_SHA | RC4-SHA | [RFC5246][RFC6347] | +| 0x0006 | TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 | EXP-RC2-CBC-MD5 | [RFC4346] | +| 0x0007 | TLS_RSA_WITH_IDEA_CBC_SHA | IDEA-CBC-SHA | [RFC8996] | +| 0x0008 | TLS_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DES-CBC-SHA | [RFC4346] | +| 0x0009 | TLS_RSA_WITH_DES_CBC_SHA | DES-CBC-SHA | [RFC8996] | +| 0x000A | TLS_RSA_WITH_3DES_EDE_CBC_SHA | DES-CBC3-SHA | [RFC5246] | +| 0x000B | TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA | EXP-DH-DSS-DES-CBC-SHA | [RFC4346] | +| 0x000C | TLS_DH_DSS_WITH_DES_CBC_SHA | DH-DSS-DES-CBC-SHA | [RFC8996] | +| 0x000D | TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA | DH-DSS-DES-CBC3-SHA | [RFC5246] | +| 0x000E | TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DH-RSA-DES-CBC-SHA | [RFC4346] | +| 0x000F | TLS_DH_RSA_WITH_DES_CBC_SHA | DH-RSA-DES-CBC-SHA | [RFC8996] | +| 0x0010 | TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA | DH-RSA-DES-CBC3-SHA | [RFC5246] | +| 0x0011 | TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA | EXP-DHE-DSS-DES-CBC-SHA | [RFC4346] | +| 0x0012 | TLS_DHE_DSS_WITH_DES_CBC_SHA | DHE-DSS-DES-CBC-SHA | [RFC8996] | +| 0x0013 | TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA | DHE-DSS-DES-CBC3-SHA | [RFC5246] | +| 0x0014 | TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA | EXP-DHE-RSA-DES-CBC-SHA | [RFC4346] | +| 0x0015 | TLS_DHE_RSA_WITH_DES_CBC_SHA | DHE-RSA-DES-CBC-SHA | [RFC8996] | +| 0x0016 | TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA | DHE-RSA-DES-CBC3-SHA | [RFC5246] | +| 0x0017 | TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 | EXP-ADH-RC4-MD5 | [RFC4346][RFC6347] | +| 0x0018 | TLS_DH_anon_WITH_RC4_128_MD5 | ADH-RC4-MD5 | [RFC5246][RFC6347] | +| 0x0019 | TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA | EXP-ADH-DES-CBC-SHA | [RFC4346] | +| 0x001A | TLS_DH_anon_WITH_DES_CBC_SHA | ADH-DES-CBC-SHA | [RFC8996] | +| 0x001B | TLS_DH_anon_WITH_3DES_EDE_CBC_SHA | ADH-DES-CBC3-SHA | [RFC5246] | +| 0x001C | | FZA-NULL-SHA | | +| 0x001D | | FZA-FZA-CBC-SHA | | +| 0x001E | TLS_KRB5_WITH_DES_CBC_SHA | KRB5-DES-CBC-SHA | [RFC2712] | +| 0x001F | TLS_KRB5_WITH_3DES_EDE_CBC_SHA | KRB5-DES-CBC3-SHA | [RFC2712] | +| 0x0020 | TLS_KRB5_WITH_RC4_128_SHA | KRB5-RC4-SHA | [RFC2712][RFC6347] | +| 0x0021 | TLS_KRB5_WITH_IDEA_CBC_SHA | KRB5-IDEA-CBC-SHA | [RFC2712] | +| 0x0022 | TLS_KRB5_WITH_DES_CBC_MD5 | KRB5-DES-CBC-MD5 | [RFC2712] | +| 0x0023 | TLS_KRB5_WITH_3DES_EDE_CBC_MD5 | KRB5-DES-CBC3-MD5 | [RFC2712] | +| 0x0024 | TLS_KRB5_WITH_RC4_128_MD5 | KRB5-RC4-MD5 | [RFC2712][RFC6347] | +| 0x0025 | TLS_KRB5_WITH_IDEA_CBC_MD5 | KRB5-IDEA-CBC-MD5 | [RFC2712] | +| 0x0026 | TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA | EXP-KRB5-DES-CBC-SHA | [RFC2712] | +| 0x0027 | TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA | EXP-KRB5-RC2-CBC-SHA | [RFC2712] | +| 0x0028 | TLS_KRB5_EXPORT_WITH_RC4_40_SHA | EXP-KRB5-RC4-SHA | [RFC2712][RFC6347] | +| 0x0029 | TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 | EXP-KRB5-DES-CBC-MD5 | [RFC2712] | +| 0x002A | TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 | EXP-KRB5-RC2-CBC-MD5 | [RFC2712] | +| 0x002B | TLS_KRB5_EXPORT_WITH_RC4_40_MD5 | EXP-KRB5-RC4-MD5 | [RFC2712][RFC6347] | +| 0x002C | TLS_PSK_WITH_NULL_SHA | PSK-NULL-SHA | [RFC4785] | +| 0x002D | TLS_DHE_PSK_WITH_NULL_SHA | DHE-PSK-NULL-SHA | [RFC4785] | +| 0x002E | TLS_RSA_PSK_WITH_NULL_SHA | RSA-PSK-NULL-SHA | [RFC4785] | +| 0x002F | TLS_RSA_WITH_AES_128_CBC_SHA | AES128-SHA | [RFC5246] | +| 0x0030 | TLS_DH_DSS_WITH_AES_128_CBC_SHA | DH-DSS-AES128-SHA | [RFC5246] | +| 0x0031 | TLS_DH_RSA_WITH_AES_128_CBC_SHA | DH-RSA-AES128-SHA | [RFC5246] | +| 0x0032 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA | DHE-DSS-AES128-SHA | [RFC5246] | +| 0x0033 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA | DHE-RSA-AES128-SHA | [RFC5246] | +| 0x0034 | TLS_DH_anon_WITH_AES_128_CBC_SHA | ADH-AES128-SHA | [RFC5246] | +| 0x0035 | TLS_RSA_WITH_AES_256_CBC_SHA | AES256-SHA | [RFC5246] | +| 0x0036 | TLS_DH_DSS_WITH_AES_256_CBC_SHA | DH-DSS-AES256-SHA | [RFC5246] | +| 0x0037 | TLS_DH_RSA_WITH_AES_256_CBC_SHA | DH-RSA-AES256-SHA | [RFC5246] | +| 0x0038 | TLS_DHE_DSS_WITH_AES_256_CBC_SHA | DHE-DSS-AES256-SHA | [RFC5246] | +| 0x0039 | TLS_DHE_RSA_WITH_AES_256_CBC_SHA | DHE-RSA-AES256-SHA | [RFC5246] | +| 0x003A | TLS_DH_anon_WITH_AES_256_CBC_SHA | ADH-AES256-SHA | [RFC5246] | +| 0x003B | TLS_RSA_WITH_NULL_SHA256 | NULL-SHA256 | [RFC5246] | +| 0x003C | TLS_RSA_WITH_AES_128_CBC_SHA256 | AES128-SHA256 | [RFC5246] | +| 0x003D | TLS_RSA_WITH_AES_256_CBC_SHA256 | AES256-SHA256 | [RFC5246] | +| 0x003E | TLS_DH_DSS_WITH_AES_128_CBC_SHA256 | DH-DSS-AES128-SHA256 | [RFC5246] | +| 0x003F | TLS_DH_RSA_WITH_AES_128_CBC_SHA256 | DH-RSA-AES128-SHA256 | [RFC5246] | +| 0x0040 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 | DHE-DSS-AES128-SHA256 | [RFC5246] | +| 0x0041 | TLS_RSA_WITH_CAMELLIA_128_CBC_SHA | CAMELLIA128-SHA | [RFC5932] | +| 0x0042 | TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA | DH-DSS-CAMELLIA128-SHA | [RFC5932] | +| 0x0043 | TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA | DH-RSA-CAMELLIA128-SHA | [RFC5932] | +| 0x0044 | TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA | DHE-DSS-CAMELLIA128-SHA | [RFC5932] | +| 0x0045 | TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA | DHE-RSA-CAMELLIA128-SHA | [RFC5932] | +| 0x0046 | TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA | ADH-CAMELLIA128-SHA | [RFC5932] | +| 0x0060 | | EXP1024-RC4-MD5 | | +| 0x0061 | | EXP1024-RC2-CBC-MD5 | | +| 0x0062 | | EXP1024-DES-CBC-SHA | | +| 0x0063 | | EXP1024-DHE-DSS-DES-CBC-SHA | | +| 0x0064 | | EXP1024-RC4-SHA | | +| 0x0065 | | EXP1024-DHE-DSS-RC4-SHA | | +| 0x0066 | | DHE-DSS-RC4-SHA | | +| 0x0067 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 | DHE-RSA-AES128-SHA256 | [RFC5246] | +| 0x0068 | TLS_DH_DSS_WITH_AES_256_CBC_SHA256 | DH-DSS-AES256-SHA256 | [RFC5246] | +| 0x0069 | TLS_DH_RSA_WITH_AES_256_CBC_SHA256 | DH-RSA-AES256-SHA256 | [RFC5246] | +| 0x006A | TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 | DHE-DSS-AES256-SHA256 | [RFC5246] | +| 0x006B | TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 | DHE-RSA-AES256-SHA256 | [RFC5246] | +| 0x006C | TLS_DH_anon_WITH_AES_128_CBC_SHA256 | ADH-AES128-SHA256 | [RFC5246] | +| 0x006D | TLS_DH_anon_WITH_AES_256_CBC_SHA256 | ADH-AES256-SHA256 | [RFC5246] | +| 0x0080 | | GOST94-GOST89-GOST89 | | +| 0x0081 | | GOST2001-GOST89-GOST89 | | +| 0x0082 | | GOST94-NULL-GOST94 | | +| 0x0083 | | GOST2001-NULL-GOST94 | | +| 0x0084 | TLS_RSA_WITH_CAMELLIA_256_CBC_SHA | CAMELLIA256-SHA | [RFC5932] | +| 0x0085 | TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA | DH-DSS-CAMELLIA256-SHA | [RFC5932] | +| 0x0086 | TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA | DH-RSA-CAMELLIA256-SHA | [RFC5932] | +| 0x0087 | TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA | DHE-DSS-CAMELLIA256-SHA | [RFC5932] | +| 0x0088 | TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA | DHE-RSA-CAMELLIA256-SHA | [RFC5932] | +| 0x0089 | TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA | ADH-CAMELLIA256-SHA | [RFC5932] | +| 0x008A | TLS_PSK_WITH_RC4_128_SHA | PSK-RC4-SHA | [RFC4279][RFC6347] | +| 0x008B | TLS_PSK_WITH_3DES_EDE_CBC_SHA | PSK-3DES-EDE-CBC-SHA | [RFC4279] | +| 0x008C | TLS_PSK_WITH_AES_128_CBC_SHA | PSK-AES128-CBC-SHA | [RFC4279] | +| 0x008D | TLS_PSK_WITH_AES_256_CBC_SHA | PSK-AES256-CBC-SHA | [RFC4279] | +| 0x008E | TLS_DHE_PSK_WITH_RC4_128_SHA | DHE-PSK-RC4-SHA | [RFC4279][RFC6347] | +| 0x008F | TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA | DHE-PSK-3DES-EDE-CBC-SHA | [RFC4279] | +| 0x0090 | TLS_DHE_PSK_WITH_AES_128_CBC_SHA | DHE-PSK-AES128-CBC-SHA | [RFC4279] | +| 0x0091 | TLS_DHE_PSK_WITH_AES_256_CBC_SHA | DHE-PSK-AES256-CBC-SHA | [RFC4279] | +| 0x0092 | TLS_RSA_PSK_WITH_RC4_128_SHA | RSA-PSK-RC4-SHA | [RFC4279][RFC6347] | +| 0x0093 | TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA | RSA-PSK-3DES-EDE-CBC-SHA | [RFC4279] | +| 0x0094 | TLS_RSA_PSK_WITH_AES_128_CBC_SHA | RSA-PSK-AES128-CBC-SHA | [RFC4279] | +| 0x0095 | TLS_RSA_PSK_WITH_AES_256_CBC_SHA | RSA-PSK-AES256-CBC-SHA | [RFC4279] | +| 0x0096 | TLS_RSA_WITH_SEED_CBC_SHA | SEED-SHA | [RFC4162] | +| 0x0097 | TLS_DH_DSS_WITH_SEED_CBC_SHA | DH-DSS-SEED-SHA | [RFC4162] | +| 0x0098 | TLS_DH_RSA_WITH_SEED_CBC_SHA | DH-RSA-SEED-SHA | [RFC4162] | +| 0x0099 | TLS_DHE_DSS_WITH_SEED_CBC_SHA | DHE-DSS-SEED-SHA | [RFC4162] | +| 0x009A | TLS_DHE_RSA_WITH_SEED_CBC_SHA | DHE-RSA-SEED-SHA | [RFC4162] | +| 0x009B | TLS_DH_anon_WITH_SEED_CBC_SHA | ADH-SEED-SHA | [RFC4162] | +| 0x009C | TLS_RSA_WITH_AES_128_GCM_SHA256 | AES128-GCM-SHA256 | [RFC5288] | +| 0x009D | TLS_RSA_WITH_AES_256_GCM_SHA384 | AES256-GCM-SHA384 | [RFC5288] | +| 0x009E | TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 | DHE-RSA-AES128-GCM-SHA256 | [RFC5288] | +| 0x009F | TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 | DHE-RSA-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A0 | TLS_DH_RSA_WITH_AES_128_GCM_SHA256 | DH-RSA-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A1 | TLS_DH_RSA_WITH_AES_256_GCM_SHA384 | DH-RSA-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A2 | TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 | DHE-DSS-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A3 | TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 | DHE-DSS-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A4 | TLS_DH_DSS_WITH_AES_128_GCM_SHA256 | DH-DSS-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A5 | TLS_DH_DSS_WITH_AES_256_GCM_SHA384 | DH-DSS-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A6 | TLS_DH_anon_WITH_AES_128_GCM_SHA256 | ADH-AES128-GCM-SHA256 | [RFC5288] | +| 0x00A7 | TLS_DH_anon_WITH_AES_256_GCM_SHA384 | ADH-AES256-GCM-SHA384 | [RFC5288] | +| 0x00A8 | TLS_PSK_WITH_AES_128_GCM_SHA256 | PSK-AES128-GCM-SHA256 | [RFC5487] | +| 0x00A9 | TLS_PSK_WITH_AES_256_GCM_SHA384 | PSK-AES256-GCM-SHA384 | [RFC5487] | +| 0x00AA | TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 | DHE-PSK-AES128-GCM-SHA256 | [RFC5487] | +| 0x00AB | TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 | DHE-PSK-AES256-GCM-SHA384 | [RFC5487] | +| 0x00AC | TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 | RSA-PSK-AES128-GCM-SHA256 | [RFC5487] | +| 0x00AD | TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 | RSA-PSK-AES256-GCM-SHA384 | [RFC5487] | +| 0x00AE | TLS_PSK_WITH_AES_128_CBC_SHA256 | PSK-AES128-CBC-SHA256 | [RFC5487] | +| 0x00AF | TLS_PSK_WITH_AES_256_CBC_SHA384 | PSK-AES256-CBC-SHA384 | [RFC5487] | +| 0x00B0 | TLS_PSK_WITH_NULL_SHA256 | PSK-NULL-SHA256 | [RFC5487] | +| 0x00B1 | TLS_PSK_WITH_NULL_SHA384 | PSK-NULL-SHA384 | [RFC5487] | +| 0x00B2 | TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 | DHE-PSK-AES128-CBC-SHA256 | [RFC5487] | +| 0x00B3 | TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 | DHE-PSK-AES256-CBC-SHA384 | [RFC5487] | +| 0x00B4 | TLS_DHE_PSK_WITH_NULL_SHA256 | DHE-PSK-NULL-SHA256 | [RFC5487] | +| 0x00B5 | TLS_DHE_PSK_WITH_NULL_SHA384 | DHE-PSK-NULL-SHA384 | [RFC5487] | +| 0x00B6 | TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 | RSA-PSK-AES128-CBC-SHA256 | [RFC5487] | +| 0x00B7 | TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 | RSA-PSK-AES256-CBC-SHA384 | [RFC5487] | +| 0x00B8 | TLS_RSA_PSK_WITH_NULL_SHA256 | RSA-PSK-NULL-SHA256 | [RFC5487] | +| 0x00B9 | TLS_RSA_PSK_WITH_NULL_SHA384 | RSA-PSK-NULL-SHA384 | [RFC5487] | +| 0x00BA | TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 | CAMELLIA128-SHA256 | [RFC5932] | +| 0x00BD | TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 | DHE-DSS-CAMELLIA128-SHA256 | [RFC5932] | +| 0x00BE | TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 | DHE-RSA-CAMELLIA128-SHA256 | [RFC5932] | +| 0x00BF | TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 | ADH-CAMELLIA128-SHA256 | [RFC5932] | +| 0x00C0 | TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 | CAMELLIA256-SHA256 | [RFC5932] | +| 0x00C3 | TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 | DHE-DSS-CAMELLIA256-SHA256 | [RFC5932] | +| 0x00C4 | TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 | DHE-RSA-CAMELLIA256-SHA256 | [RFC5932] | +| 0x00C5 | TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 | ADH-CAMELLIA256-SHA256 | [RFC5932] | +| 0x00FF | TLS_EMPTY_RENEGOTIATION_INFO_SCSV | | [RFC5746] | +| 0x5600 | TLS_FALLBACK_SCSV | | [RFC7507] | +| 0xC001 | TLS_ECDH_ECDSA_WITH_NULL_SHA | ECDH-ECDSA-NULL-SHA | [RFC8422] | +| 0xC002 | TLS_ECDH_ECDSA_WITH_RC4_128_SHA | ECDH-ECDSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC003 | TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA | ECDH-ECDSA-DES-CBC3-SHA | [RFC8422] | +| 0xC004 | TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA | ECDH-ECDSA-AES128-SHA | [RFC8422] | +| 0xC005 | TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA | ECDH-ECDSA-AES256-SHA | [RFC8422] | +| 0xC006 | TLS_ECDHE_ECDSA_WITH_NULL_SHA | ECDHE-ECDSA-NULL-SHA | [RFC8422] | +| 0xC007 | TLS_ECDHE_ECDSA_WITH_RC4_128_SHA | ECDHE-ECDSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC008 | TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA | ECDHE-ECDSA-DES-CBC3-SHA | [RFC8422] | +| 0xC009 | TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA | ECDHE-ECDSA-AES128-SHA | [RFC8422] | +| 0xC00A | TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA | ECDHE-ECDSA-AES256-SHA | [RFC8422] | +| 0xC00B | TLS_ECDH_RSA_WITH_NULL_SHA | ECDH-RSA-NULL-SHA | [RFC8422] | +| 0xC00C | TLS_ECDH_RSA_WITH_RC4_128_SHA | ECDH-RSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC00D | TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA | ECDH-RSA-DES-CBC3-SHA | [RFC8422] | +| 0xC00E | TLS_ECDH_RSA_WITH_AES_128_CBC_SHA | ECDH-RSA-AES128-SHA | [RFC8422] | +| 0xC00F | TLS_ECDH_RSA_WITH_AES_256_CBC_SHA | ECDH-RSA-AES256-SHA | [RFC8422] | +| 0xC010 | TLS_ECDHE_RSA_WITH_NULL_SHA | ECDHE-RSA-NULL-SHA | [RFC8422] | +| 0xC011 | TLS_ECDHE_RSA_WITH_RC4_128_SHA | ECDHE-RSA-RC4-SHA | [RFC8422][RFC6347] | +| 0xC012 | TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA | ECDHE-RSA-DES-CBC3-SHA | [RFC8422] | +| 0xC013 | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA | ECDHE-RSA-AES128-SHA | [RFC8422] | +| 0xC014 | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA | ECDHE-RSA-AES256-SHA | [RFC8422] | +| 0xC015 | TLS_ECDH_anon_WITH_NULL_SHA | AECDH-NULL-SHA | [RFC8422] | +| 0xC016 | TLS_ECDH_anon_WITH_RC4_128_SHA | AECDH-RC4-SHA | [RFC8422][RFC6347] | +| 0xC017 | TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA | AECDH-DES-CBC3-SHA | [RFC8422] | +| 0xC018 | TLS_ECDH_anon_WITH_AES_128_CBC_SHA | AECDH-AES128-SHA | [RFC8422] | +| 0xC019 | TLS_ECDH_anon_WITH_AES_256_CBC_SHA | AECDH-AES256-SHA | [RFC8422] | +| 0xC01A | TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA | SRP-3DES-EDE-CBC-SHA | [RFC5054] | +| 0xC01B | TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA | SRP-RSA-3DES-EDE-CBC-SHA | [RFC5054] | +| 0xC01C | TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA | SRP-DSS-3DES-EDE-CBC-SHA | [RFC5054] | +| 0xC01D | TLS_SRP_SHA_WITH_AES_128_CBC_SHA | SRP-AES-128-CBC-SHA | [RFC5054] | +| 0xC01E | TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA | SRP-RSA-AES-128-CBC-SHA | [RFC5054] | +| 0xC01F | TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA | SRP-DSS-AES-128-CBC-SHA | [RFC5054] | +| 0xC020 | TLS_SRP_SHA_WITH_AES_256_CBC_SHA | SRP-AES-256-CBC-SHA | [RFC5054] | +| 0xC021 | TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA | SRP-RSA-AES-256-CBC-SHA | [RFC5054] | +| 0xC022 | TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA | SRP-DSS-AES-256-CBC-SHA | [RFC5054] | +| 0xC023 | TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | ECDHE-ECDSA-AES128-SHA256 | [RFC5289] | +| 0xC024 | TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 | ECDHE-ECDSA-AES256-SHA384 | [RFC5289] | +| 0xC025 | TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 | ECDH-ECDSA-AES128-SHA256 | [RFC5289] | +| 0xC026 | TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 | ECDH-ECDSA-AES256-SHA384 | [RFC5289] | +| 0xC027 | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 | ECDHE-RSA-AES128-SHA256 | [RFC5289] | +| 0xC028 | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 | ECDHE-RSA-AES256-SHA384 | [RFC5289] | +| 0xC029 | TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 | ECDH-RSA-AES128-SHA256 | [RFC5289] | +| 0xC02A | TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 | ECDH-RSA-AES256-SHA384 | [RFC5289] | +| 0xC02B | TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | ECDHE-ECDSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC02C | TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 | ECDHE-ECDSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC02D | TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 | ECDH-ECDSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC02E | TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 | ECDH-ECDSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC02F | TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | ECDHE-RSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC030 | TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | ECDHE-RSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC031 | TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 | ECDH-RSA-AES128-GCM-SHA256 | [RFC5289] | +| 0xC032 | TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 | ECDH-RSA-AES256-GCM-SHA384 | [RFC5289] | +| 0xC033 | TLS_ECDHE_PSK_WITH_RC4_128_SHA | ECDHE-PSK-RC4-SHA | [RFC5489][RFC6347] | +| 0xC034 | TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA | ECDHE-PSK-3DES-EDE-CBC-SHA | [RFC5489] | +| 0xC035 | TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA | ECDHE-PSK-AES128-CBC-SHA | [RFC5489] | +| 0xC036 | TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA | ECDHE-PSK-AES256-CBC-SHA | [RFC5489] | +| 0xC037 | TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 | ECDHE-PSK-AES128-CBC-SHA256 | [RFC5489] | +| 0xC038 | TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 | ECDHE-PSK-AES256-CBC-SHA384 | [RFC5489] | +| 0xC039 | TLS_ECDHE_PSK_WITH_NULL_SHA | ECDHE-PSK-NULL-SHA | [RFC5489] | +| 0xC03A | TLS_ECDHE_PSK_WITH_NULL_SHA256 | ECDHE-PSK-NULL-SHA256 | [RFC5489] | +| 0xC03B | TLS_ECDHE_PSK_WITH_NULL_SHA384 | ECDHE-PSK-NULL-SHA384 | [RFC5489] | +| 0xC03C | TLS_RSA_WITH_ARIA_128_CBC_SHA256 | ARIA128-SHA256 | [RFC6209] | +| 0xC03D | TLS_RSA_WITH_ARIA_256_CBC_SHA384 | ARIA256-SHA384 | [RFC6209] | +| 0xC044 | TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 | DHE-RSA-ARIA128-SHA256 | [RFC6209] | +| 0xC045 | TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 | DHE-RSA-ARIA256-SHA384 | [RFC6209] | +| 0xC048 | TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 | ECDHE-ECDSA-ARIA128-SHA256 | [RFC6209] | +| 0xC049 | TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 | ECDHE-ECDSA-ARIA256-SHA384 | [RFC6209] | +| 0xC04A | TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 | ECDH-ECDSA-ARIA128-SHA256 | [RFC6209] | +| 0xC04B | TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 | ECDH-ECDSA-ARIA256-SHA384 | [RFC6209] | +| 0xC04C | TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 | ECDHE-ARIA128-SHA256 | [RFC6209] | +| 0xC04D | TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 | ECDHE-ARIA256-SHA384 | [RFC6209] | +| 0xC04E | TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 | ECDH-ARIA128-SHA256 | [RFC6209] | +| 0xC04F | TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 | ECDH-ARIA256-SHA384 | [RFC6209] | +| 0xC050 | TLS_RSA_WITH_ARIA_128_GCM_SHA256 | ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC051 | TLS_RSA_WITH_ARIA_256_GCM_SHA384 | ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC052 | TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 | DHE-RSA-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC053 | TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 | DHE-RSA-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC056 | TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 | DHE-DSS-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC057 | TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 | DHE-DSS-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC05C | TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 | ECDHE-ECDSA-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC05D | TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 | ECDHE-ECDSA-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC05E | TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 | ECDH-ECDSA-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC05F | TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 | ECDH-ECDSA-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC060 | TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 | ECDHE-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC061 | TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 | ECDHE-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC062 | TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 | ECDH-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC063 | TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 | ECDH-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC064 | TLS_PSK_WITH_ARIA_128_CBC_SHA256 | PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC065 | TLS_PSK_WITH_ARIA_256_CBC_SHA384 | PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC066 | TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 | DHE-PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC067 | TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 | DHE-PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC068 | TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 | RSA-PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC069 | TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 | RSA-PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC06A | TLS_PSK_WITH_ARIA_128_GCM_SHA256 | PSK-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC06B | TLS_PSK_WITH_ARIA_256_GCM_SHA384 | PSK-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC06C | TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 | DHE-PSK-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC06D | TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 | DHE-PSK-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC06E | TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 | RSA-PSK-ARIA128-GCM-SHA256 | [RFC6209] | +| 0xC06F | TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 | RSA-PSK-ARIA256-GCM-SHA384 | [RFC6209] | +| 0xC070 | TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 | ECDHE-PSK-ARIA128-SHA256 | [RFC6209] | +| 0xC071 | TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 | ECDHE-PSK-ARIA256-SHA384 | [RFC6209] | +| 0xC072 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-ECDSA-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC073 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-ECDSA-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC074 | TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDH-ECDSA-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC075 | TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDH-ECDSA-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC076 | TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-RSA-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC077 | TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-RSA-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC078 | TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 | ECDH-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC079 | TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 | ECDH-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC07A | TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 | CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC07B | TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 | CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC07C | TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 | DHE-RSA-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC07D | TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 | DHE-RSA-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC086 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDHE-ECDSA-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC087 | TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDHE-ECDSA-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC088 | TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDH-ECDSA-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC089 | TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDH-ECDSA-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC08A | TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDHE-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC08B | TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDHE-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC08C | TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 | ECDH-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC08D | TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 | ECDH-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC08E | TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 | PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC08F | TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 | PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC090 | TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 | DHE-PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC091 | TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 | DHE-PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC092 | TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 | RSA-PSK-CAMELLIA128-GCM-SHA256 | [RFC6367] | +| 0xC093 | TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 | RSA-PSK-CAMELLIA256-GCM-SHA384 | [RFC6367] | +| 0xC094 | TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 | PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC095 | TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 | PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC096 | TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 | DHE-PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC097 | TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 | DHE-PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC098 | TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 | RSA-PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC099 | TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 | RSA-PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC09A | TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 | ECDHE-PSK-CAMELLIA128-SHA256 | [RFC6367] | +| 0xC09B | TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 | ECDHE-PSK-CAMELLIA256-SHA384 | [RFC6367] | +| 0xC09C | TLS_RSA_WITH_AES_128_CCM | AES128-CCM | [RFC6655] | +| 0xC09D | TLS_RSA_WITH_AES_256_CCM | AES256-CCM | [RFC6655] | +| 0xC09E | TLS_DHE_RSA_WITH_AES_128_CCM | DHE-RSA-AES128-CCM | [RFC6655] | +| 0xC09F | TLS_DHE_RSA_WITH_AES_256_CCM | DHE-RSA-AES256-CCM | [RFC6655] | +| 0xC0A0 | TLS_RSA_WITH_AES_128_CCM_8 | AES128-CCM8 | [RFC6655] | +| 0xC0A1 | TLS_RSA_WITH_AES_256_CCM_8 | AES256-CCM8 | [RFC6655] | +| 0xC0A2 | TLS_DHE_RSA_WITH_AES_128_CCM_8 | DHE-RSA-AES128-CCM8 | [RFC6655] | +| 0xC0A3 | TLS_DHE_RSA_WITH_AES_256_CCM_8 | DHE-RSA-AES256-CCM8 | [RFC6655] | +| 0xC0A4 | TLS_PSK_WITH_AES_128_CCM | PSK-AES128-CCM | [RFC6655] | +| 0xC0A5 | TLS_PSK_WITH_AES_256_CCM | PSK-AES256-CCM | [RFC6655] | +| 0xC0A6 | TLS_DHE_PSK_WITH_AES_128_CCM | DHE-PSK-AES128-CCM | [RFC6655] | +| 0xC0A7 | TLS_DHE_PSK_WITH_AES_256_CCM | DHE-PSK-AES256-CCM | [RFC6655] | +| 0xC0A8 | TLS_PSK_WITH_AES_128_CCM_8 | PSK-AES128-CCM8 | [RFC6655] | +| 0xC0A9 | TLS_PSK_WITH_AES_256_CCM_8 | PSK-AES256-CCM8 | [RFC6655] | +| 0xC0AA | TLS_PSK_DHE_WITH_AES_128_CCM_8 | DHE-PSK-AES128-CCM8 | [RFC6655] | +| 0xC0AB | TLS_PSK_DHE_WITH_AES_256_CCM_8 | DHE-PSK-AES256-CCM8 | [RFC6655] | +| 0xC0AC | TLS_ECDHE_ECDSA_WITH_AES_128_CCM | ECDHE-ECDSA-AES128-CCM | [RFC7251] | +| 0xC0AD | TLS_ECDHE_ECDSA_WITH_AES_256_CCM | ECDHE-ECDSA-AES256-CCM | [RFC7251] | +| 0xC0AE | TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 | ECDHE-ECDSA-AES128-CCM8 | [RFC7251] | +| 0xC0AF | TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 | ECDHE-ECDSA-AES256-CCM8 | [RFC7251] | +| 0xC100 | TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC | GOST2012-KUZNYECHIK-KUZNYECHIKOMAC | [RFC9189] | +| 0xC101 | TLS_GOSTR341112_256_WITH_MAGMA_CTR_OMAC | GOST2012-MAGMA-MAGMAOMAC | [RFC9189] | +| 0xC102 | TLS_GOSTR341112_256_WITH_28147_CNT_IMIT | IANA-GOST2012-GOST8912-GOST8912 | [RFC9189] | +| 0xCC13 | | ECDHE-RSA-CHACHA20-POLY1305-OLD | | +| 0xCC14 | | ECDHE-ECDSA-CHACHA20-POLY1305-OLD | | +| 0xCC15 | | DHE-RSA-CHACHA20-POLY1305-OLD | | +| 0xCCA8 | TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-RSA-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCA9 | TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-ECDSA-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAA | TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | DHE-RSA-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAB | TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 | PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAC | TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 | ECDHE-PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAD | TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 | DHE-PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xCCAE | TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 | RSA-PSK-CHACHA20-POLY1305 | [RFC7905] | +| 0xD001 | TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 | ECDHE-PSK-AES128-GCM-SHA256 | [RFC8442] | +| 0xE011 | | ECDHE-ECDSA-SM4-CBC-SM3 | | +| 0xE051 | | ECDHE-ECDSA-SM4-GCM-SM3 | | +| 0xE052 | | ECDHE-ECDSA-SM4-CCM-SM3 | | +| 0xFF00 | | GOST-MD5 | | +| 0xFF01 | | GOST-GOST94 | | +| 0xFF02 | | GOST-GOST89MAC | | +| 0xFF03 | | GOST-GOST89STREAM | | diff --git a/curl/docs/CIPHERS.md b/curl/docs/CIPHERS.md index e09533b0d..8ce938d9c 100644 --- a/curl/docs/CIPHERS.md +++ b/curl/docs/CIPHERS.md @@ -1,426 +1,270 @@ -# Ciphers - -With curl's options `CURLOPT_SSL_CIPHER_LIST` and `--ciphers` users can -control which ciphers to consider when negotiating TLS connections. - -The names of the known ciphers differ depending on which TLS backend that -libcurl was built to use. This is an attempt to list known cipher names. - -## OpenSSL - -(based on [OpenSSL docs](https://www.openssl.org/docs/man1.1.0/apps/ciphers.html)) - -### SSL3 cipher suites - -`NULL-MD5` -`NULL-SHA` -`RC4-MD5` -`RC4-SHA` -`IDEA-CBC-SHA` -`DES-CBC3-SHA` -`DH-DSS-DES-CBC3-SHA` -`DH-RSA-DES-CBC3-SHA` -`DHE-DSS-DES-CBC3-SHA` -`DHE-RSA-DES-CBC3-SHA` -`ADH-RC4-MD5` -`ADH-DES-CBC3-SHA` - -### TLS v1.0 cipher suites - -`NULL-MD5` -`NULL-SHA` -`RC4-MD5` -`RC4-SHA` -`IDEA-CBC-SHA` -`DES-CBC3-SHA` -`DHE-DSS-DES-CBC3-SHA` -`DHE-RSA-DES-CBC3-SHA` -`ADH-RC4-MD5` -`ADH-DES-CBC3-SHA` - -### AES ciphersuites from RFC3268, extending TLS v1.0 - -`AES128-SHA` -`AES256-SHA` -`DH-DSS-AES128-SHA` -`DH-DSS-AES256-SHA` -`DH-RSA-AES128-SHA` -`DH-RSA-AES256-SHA` -`DHE-DSS-AES128-SHA` -`DHE-DSS-AES256-SHA` -`DHE-RSA-AES128-SHA` -`DHE-RSA-AES256-SHA` -`ADH-AES128-SHA` -`ADH-AES256-SHA` - -### SEED ciphersuites from RFC4162, extending TLS v1.0 - -`SEED-SHA` -`DH-DSS-SEED-SHA` -`DH-RSA-SEED-SHA` -`DHE-DSS-SEED-SHA` -`DHE-RSA-SEED-SHA` -`ADH-SEED-SHA` - -### GOST ciphersuites, extending TLS v1.0 - -`GOST94-GOST89-GOST89` -`GOST2001-GOST89-GOST89` -`GOST94-NULL-GOST94` -`GOST2001-NULL-GOST94` - -### Elliptic curve cipher suites - -`ECDHE-RSA-NULL-SHA` -`ECDHE-RSA-RC4-SHA` -`ECDHE-RSA-DES-CBC3-SHA` -`ECDHE-RSA-AES128-SHA` -`ECDHE-RSA-AES256-SHA` -`ECDHE-ECDSA-NULL-SHA` -`ECDHE-ECDSA-RC4-SHA` -`ECDHE-ECDSA-DES-CBC3-SHA` -`ECDHE-ECDSA-AES128-SHA` -`ECDHE-ECDSA-AES256-SHA` -`AECDH-NULL-SHA` -`AECDH-RC4-SHA` -`AECDH-DES-CBC3-SHA` -`AECDH-AES128-SHA` -`AECDH-AES256-SHA` - -### TLS v1.2 cipher suites - -`NULL-SHA256` -`AES128-SHA256` -`AES256-SHA256` -`AES128-GCM-SHA256` -`AES256-GCM-SHA384` -`DH-RSA-AES128-SHA256` -`DH-RSA-AES256-SHA256` -`DH-RSA-AES128-GCM-SHA256` -`DH-RSA-AES256-GCM-SHA384` -`DH-DSS-AES128-SHA256` -`DH-DSS-AES256-SHA256` -`DH-DSS-AES128-GCM-SHA256` -`DH-DSS-AES256-GCM-SHA384` -`DHE-RSA-AES128-SHA256` -`DHE-RSA-AES256-SHA256` -`DHE-RSA-AES128-GCM-SHA256` -`DHE-RSA-AES256-GCM-SHA384` -`DHE-DSS-AES128-SHA256` -`DHE-DSS-AES256-SHA256` -`DHE-DSS-AES128-GCM-SHA256` -`DHE-DSS-AES256-GCM-SHA384` -`ECDHE-RSA-AES128-SHA256` -`ECDHE-RSA-AES256-SHA384` -`ECDHE-RSA-AES128-GCM-SHA256` -`ECDHE-RSA-AES256-GCM-SHA384` -`ECDHE-ECDSA-AES128-SHA256` -`ECDHE-ECDSA-AES256-SHA384` -`ECDHE-ECDSA-AES128-GCM-SHA256` -`ECDHE-ECDSA-AES256-GCM-SHA384` -`ADH-AES128-SHA256` -`ADH-AES256-SHA256` -`ADH-AES128-GCM-SHA256` -`ADH-AES256-GCM-SHA384` -`AES128-CCM` -`AES256-CCM` -`DHE-RSA-AES128-CCM` -`DHE-RSA-AES256-CCM` -`AES128-CCM8` -`AES256-CCM8` -`DHE-RSA-AES128-CCM8` -`DHE-RSA-AES256-CCM8` -`ECDHE-ECDSA-AES128-CCM` -`ECDHE-ECDSA-AES256-CCM` -`ECDHE-ECDSA-AES128-CCM8` -`ECDHE-ECDSA-AES256-CCM8` - -### Camellia HMAC-Based ciphersuites from RFC6367, extending TLS v1.2 - -`ECDHE-ECDSA-CAMELLIA128-SHA256` -`ECDHE-ECDSA-CAMELLIA256-SHA384` -`ECDHE-RSA-CAMELLIA128-SHA256` -`ECDHE-RSA-CAMELLIA256-SHA384` - -## NSS - -### Totally insecure - -`rc4` -`rc4-md5` -`rc4export` -`rc2` -`rc2export` -`des` -`desede3` - -### SSL3/TLS cipher suites - -`rsa_rc4_128_md5` -`rsa_rc4_128_sha` -`rsa_3des_sha` -`rsa_des_sha` -`rsa_rc4_40_md5` -`rsa_rc2_40_md5` -`rsa_null_md5` -`rsa_null_sha` -`fips_3des_sha` -`fips_des_sha` -`fortezza` -`fortezza_rc4_128_sha` -`fortezza_null` - -### TLS 1.0 Exportable 56-bit Cipher Suites - -`rsa_des_56_sha` -`rsa_rc4_56_sha` - -### AES ciphers - -`dhe_dss_aes_128_cbc_sha` -`dhe_dss_aes_256_cbc_sha` -`dhe_rsa_aes_128_cbc_sha` -`dhe_rsa_aes_256_cbc_sha` -`rsa_aes_128_sha` -`rsa_aes_256_sha` - -### ECC ciphers - -`ecdh_ecdsa_null_sha` -`ecdh_ecdsa_rc4_128_sha` -`ecdh_ecdsa_3des_sha` -`ecdh_ecdsa_aes_128_sha` -`ecdh_ecdsa_aes_256_sha` -`ecdhe_ecdsa_null_sha` -`ecdhe_ecdsa_rc4_128_sha` -`ecdhe_ecdsa_3des_sha` -`ecdhe_ecdsa_aes_128_sha` -`ecdhe_ecdsa_aes_256_sha` -`ecdh_rsa_null_sha` -`ecdh_rsa_128_sha` -`ecdh_rsa_3des_sha` -`ecdh_rsa_aes_128_sha` -`ecdh_rsa_aes_256_sha` -`ecdhe_rsa_null` -`ecdhe_rsa_rc4_128_sha` -`ecdhe_rsa_3des_sha` -`ecdhe_rsa_aes_128_sha` -`ecdhe_rsa_aes_256_sha` -`ecdh_anon_null_sha` -`ecdh_anon_rc4_128sha` -`ecdh_anon_3des_sha` -`ecdh_anon_aes_128_sha` -`ecdh_anon_aes_256_sha` - -### HMAC-SHA256 cipher suites - -`rsa_null_sha_256` -`rsa_aes_128_cbc_sha_256` -`rsa_aes_256_cbc_sha_256` -`dhe_rsa_aes_128_cbc_sha_256` -`dhe_rsa_aes_256_cbc_sha_256` -`ecdhe_ecdsa_aes_128_cbc_sha_256` -`ecdhe_rsa_aes_128_cbc_sha_256` - -### AES GCM cipher suites in RFC 5288 and RFC 5289 - -`rsa_aes_128_gcm_sha_256` -`dhe_rsa_aes_128_gcm_sha_256` -`dhe_dss_aes_128_gcm_sha_256` -`ecdhe_ecdsa_aes_128_gcm_sha_256` -`ecdh_ecdsa_aes_128_gcm_sha_256` -`ecdhe_rsa_aes_128_gcm_sha_256` -`ecdh_rsa_aes_128_gcm_sha_256` - -### cipher suites using SHA384 - -`rsa_aes_256_gcm_sha_384` -`dhe_rsa_aes_256_gcm_sha_384` -`dhe_dss_aes_256_gcm_sha_384` -`ecdhe_ecdsa_aes_256_sha_384` -`ecdhe_rsa_aes_256_sha_384` -`ecdhe_ecdsa_aes_256_gcm_sha_384` -`ecdhe_rsa_aes_256_gcm_sha_384` - -### chacha20-poly1305 cipher suites - -`ecdhe_rsa_chacha20_poly1305_sha_256` -`ecdhe_ecdsa_chacha20_poly1305_sha_256` -`dhe_rsa_chacha20_poly1305_sha_256` - -## GSKit - -Ciphers are internally defined as numeric codes (https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/apis/gsk_attribute_set_buffer.htm), -but libcurl maps them to the following case-insensitive names. - -### SSL2 cipher suites (insecure: disabled by default) - -`rc2-md5` -`rc4-md5` -`exp-rc2-md5` -`exp-rc4-md5` -`des-cbc-md5` -`des-cbc3-md5` - -### SSL3 cipher suites - -`null-md5` -`null-sha` -`rc4-md5` -`rc4-sha` -`exp-rc2-cbc-md5` -`exp-rc4-md5` -`exp-des-cbc-sha` -`des-cbc3-sha` - -### TLS v1.0 cipher suites - -`null-md5` -`null-sha` -`rc4-md5` -`rc4-sha` -`exp-rc2-cbc-md5` -`exp-rc4-md5` -`exp-des-cbc-sha` -`des-cbc3-sha` -`aes128-sha` -`aes256-sha` - -### TLS v1.1 cipher suites - -`null-md5` -`null-sha` -`rc4-md5` -`rc4-sha` -`exp-des-cbc-sha` -`des-cbc3-sha` -`aes128-sha` -`aes256-sha` - -### TLS v1.2 cipher suites - -`null-md5` -`null-sha` -`null-sha256` -`rc4-md5` -`rc4-sha` -`des-cbc3-sha` -`aes128-sha` -`aes256-sha` -`aes128-sha256` -`aes256-sha256` -`aes128-gcm-sha256` -`aes256-gcm-sha384` - -## WolfSSL - -`RC4-SHA`, -`RC4-MD5`, -`DES-CBC3-SHA`, -`AES128-SHA`, -`AES256-SHA`, -`NULL-SHA`, -`NULL-SHA256`, -`DHE-RSA-AES128-SHA`, -`DHE-RSA-AES256-SHA`, -`DHE-PSK-AES256-GCM-SHA384`, -`DHE-PSK-AES128-GCM-SHA256`, -`PSK-AES256-GCM-SHA384`, -`PSK-AES128-GCM-SHA256`, -`DHE-PSK-AES256-CBC-SHA384`, -`DHE-PSK-AES128-CBC-SHA256`, -`PSK-AES256-CBC-SHA384`, -`PSK-AES128-CBC-SHA256`, -`PSK-AES128-CBC-SHA`, -`PSK-AES256-CBC-SHA`, -`DHE-PSK-AES128-CCM`, -`DHE-PSK-AES256-CCM`, -`PSK-AES128-CCM`, -`PSK-AES256-CCM`, -`PSK-AES128-CCM-8`, -`PSK-AES256-CCM-8`, -`DHE-PSK-NULL-SHA384`, -`DHE-PSK-NULL-SHA256`, -`PSK-NULL-SHA384`, -`PSK-NULL-SHA256`, -`PSK-NULL-SHA`, -`HC128-MD5`, -`HC128-SHA`, -`HC128-B2B256`, -`AES128-B2B256`, -`AES256-B2B256`, -`RABBIT-SHA`, -`NTRU-RC4-SHA`, -`NTRU-DES-CBC3-SHA`, -`NTRU-AES128-SHA`, -`NTRU-AES256-SHA`, -`AES128-CCM-8`, -`AES256-CCM-8`, -`ECDHE-ECDSA-AES128-CCM`, -`ECDHE-ECDSA-AES128-CCM-8`, -`ECDHE-ECDSA-AES256-CCM-8`, -`ECDHE-RSA-AES128-SHA`, -`ECDHE-RSA-AES256-SHA`, -`ECDHE-ECDSA-AES128-SHA`, -`ECDHE-ECDSA-AES256-SHA`, -`ECDHE-RSA-RC4-SHA`, -`ECDHE-RSA-DES-CBC3-SHA`, -`ECDHE-ECDSA-RC4-SHA`, -`ECDHE-ECDSA-DES-CBC3-SHA`, -`AES128-SHA256`, -`AES256-SHA256`, -`DHE-RSA-AES128-SHA256`, -`DHE-RSA-AES256-SHA256`, -`ECDH-RSA-AES128-SHA`, -`ECDH-RSA-AES256-SHA`, -`ECDH-ECDSA-AES128-SHA`, -`ECDH-ECDSA-AES256-SHA`, -`ECDH-RSA-RC4-SHA`, -`ECDH-RSA-DES-CBC3-SHA`, -`ECDH-ECDSA-RC4-SHA`, -`ECDH-ECDSA-DES-CBC3-SHA`, -`AES128-GCM-SHA256`, -`AES256-GCM-SHA384`, -`DHE-RSA-AES128-GCM-SHA256`, -`DHE-RSA-AES256-GCM-SHA384`, -`ECDHE-RSA-AES128-GCM-SHA256`, -`ECDHE-RSA-AES256-GCM-SHA384`, -`ECDHE-ECDSA-AES128-GCM-SHA256`, -`ECDHE-ECDSA-AES256-GCM-SHA384`, -`ECDH-RSA-AES128-GCM-SHA256`, -`ECDH-RSA-AES256-GCM-SHA384`, -`ECDH-ECDSA-AES128-GCM-SHA256`, -`ECDH-ECDSA-AES256-GCM-SHA384`, -`CAMELLIA128-SHA`, -`DHE-RSA-CAMELLIA128-SHA`, -`CAMELLIA256-SHA`, -`DHE-RSA-CAMELLIA256-SHA`, -`CAMELLIA128-SHA256`, -`DHE-RSA-CAMELLIA128-SHA256`, -`CAMELLIA256-SHA256`, -`DHE-RSA-CAMELLIA256-SHA256`, -`ECDHE-RSA-AES128-SHA256`, -`ECDHE-ECDSA-AES128-SHA256`, -`ECDH-RSA-AES128-SHA256`, -`ECDH-ECDSA-AES128-SHA256`, -`ECDHE-RSA-AES256-SHA384`, -`ECDHE-ECDSA-AES256-SHA384`, -`ECDH-RSA-AES256-SHA384`, -`ECDH-ECDSA-AES256-SHA384`, -`ECDHE-RSA-CHACHA20-POLY1305`, -`ECDHE-ECDSA-CHACHA20-POLY1305`, -`DHE-RSA-CHACHA20-POLY1305`, -`ECDHE-RSA-CHACHA20-POLY1305-OLD`, -`ECDHE-ECDSA-CHACHA20-POLY1305-OLD`, -`DHE-RSA-CHACHA20-POLY1305-OLD`, -`ADH-AES128-SHA`, -`QSH`, -`RENEGOTIATION-INFO`, -`IDEA-CBC-SHA`, -`ECDHE-ECDSA-NULL-SHA`, -`ECDHE-PSK-NULL-SHA256`, -`ECDHE-PSK-AES128-CBC-SHA256`, -`PSK-CHACHA20-POLY1305`, -`ECDHE-PSK-CHACHA20-POLY1305`, -`DHE-PSK-CHACHA20-POLY1305`, -`EDH-RSA-DES-CBC3-SHA`, + + +## curl cipher options + +A TLS handshake involves many parameters which take part in the negotiation +between client and server in order to agree on the TLS version and set of +algorithms to use for a connection. + +What has become known as a "cipher" or better "cipher suite" in TLS +are names for specific combinations of +[key exchange](https://en.wikipedia.org/wiki/Key_exchange), +[bulk encryption](https://en.wikipedia.org/wiki/Link_encryption), +[message authentication code](https://en.wikipedia.org/wiki/Message_authentication_code) +and with TLSv1.3 the +[authenticated encryption](https://en.wikipedia.org/wiki/Authenticated_encryption). +In addition, there are other parameters that influence the TLS handshake, like +[DHE](https://en.wikipedia.org/wiki/Diffie%e2%80%93Hellman_key_exchange) "groups" +and [ECDHE](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%e2%80%93Hellman) +with its "curves". + +### History + +curl's way of letting users configure these settings closely followed OpenSSL +in its API. TLS learned new parameters, OpenSSL added new API functions and +curl added command line options. + +Several other TLS backends followed the OpenSSL approach, more or less closely, +and curl maps the command line options to these TLS backends. Some TLS +backends do not support all of it and command line options are either +ignored or lead to an error. + +Many examples below show the OpenSSL-like use of these options. GnuTLS +however chose a different approach. These are described in a separate +section further below. + +## ciphers, the OpenSSL way + +With curl's option +[`--tls13-ciphers`](https://curl.se/docs/manpage.html#--tls13-ciphers) +or +[`CURLOPT_TLS13_CIPHERS`](https://curl.se/libcurl/c/CURLOPT_TLS13_CIPHERS.html) +users can control which cipher suites to consider when negotiating TLS 1.3 +connections. With option +[`--ciphers`](https://curl.se/docs/manpage.html#--ciphers) +or +[`CURLOPT_SSL_CIPHER_LIST`](https://curl.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html) +users can control which cipher suites to consider when negotiating +TLS 1.2 (1.1, 1.0) connections. + +By default, curl may negotiate TLS 1.3 and TLS 1.2 connections, so the cipher +suites considered when negotiating a TLS connection are a union of the TLS 1.3 +and TLS 1.2 cipher suites. If you want curl to consider only TLS 1.3 cipher +suites for the connection, you have to set the minimum TLS version to 1.3 by +using [`--tlsv1.3`](https://curl.se/docs/manpage.html#--tlsv13) +or [`CURLOPT_SSLVERSION`](https://curl.se/libcurl/c/CURLOPT_SSLVERSION.html) +with `CURL_SSLVERSION_TLSv1_3`. + +Both the TLS 1.3 and TLS 1.2 cipher options expect a list of cipher suites +separated by colons (`:`). This list is parsed opportunistically, cipher suites +that are not recognized or implemented are ignored. As long as there is at +least one recognized cipher suite in the list, the list is considered valid. + +For both the TLS 1.3 and TLS 1.2 cipher options, the order in which the +cipher suites are specified determine the preference of them. When negotiating +a TLS connection the server picks a cipher suite from the intersection of the +cipher suites supported by the server and the cipher suites sent by curl. If +the server is configured to honor the client's cipher preference, the first +common cipher suite in the list sent by curl is chosen. + +### TLS 1.3 cipher suites + +Setting TLS 1.3 cipher suites is supported by curl with +OpenSSL (1.1.1+, curl 7.61.0+), LibreSSL (3.4.1+, curl 8.3.0+), +wolfSSL (curl 8.10.0+) and mbedTLS (3.6.0+, curl 8.10.0+). + +The list of cipher suites that can be used for the `--tls13-ciphers` option: +``` +TLS_AES_128_GCM_SHA256 +TLS_AES_256_GCM_SHA384 +TLS_CHACHA20_POLY1305_SHA256 +TLS_AES_128_CCM_SHA256 +TLS_AES_128_CCM_8_SHA256 +``` + +#### wolfSSL notes + +In addition to above list the following cipher suites can be used: +`TLS_SM4_GCM_SM3` `TLS_SM4_CCM_SM3` `TLS_SHA256_SHA256` `TLS_SHA384_SHA384`. +Usage of these cipher suites is not recommended. (The last two cipher suites +are NULL ciphers, offering no encryption whatsoever.) + +### TLS 1.2 (1.1, 1.0) cipher suites + +Setting TLS 1.2 cipher suites is supported by curl with OpenSSL, LibreSSL, +BoringSSL, mbedTLS (curl 8.8.0+), wolfSSL (curl 7.53.0+). Schannel does not +support setting cipher suites directly, but does support setting algorithms +(curl 7.61.0+), see Schannel notes below. + +For TLS 1.2 cipher suites there are multiple naming schemes, the two most used +are with OpenSSL names (e.g. `ECDHE-RSA-AES128-GCM-SHA256`) and IANA names +(e.g. `TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256`). IANA names of TLS 1.2 cipher +suites look similar to TLS 1.3 cipher suite names, to distinguish them note +that TLS 1.2 names contain `_WITH_`, while TLS 1.3 names do not. When setting +TLS 1.2 cipher suites with curl it is recommended that you use OpenSSL names +as these are most widely recognized by the supported SSL backends. + +The complete list of cipher suites that may be considered for the `--ciphers` +option is extensive, it consists of more than 300 ciphers suites. However, +nowadays for most of them their usage is discouraged, and support for a lot of +them have been removed from the various SSL backends, if ever implemented at +all. + +A shortened list (based on [recommendations by +Mozilla](https://wiki.mozilla.org/Security/Server_Side_TLS)) of cipher suites, +which are (mostly) supported by all SSL backends, that can be used for the +`--ciphers` option: +``` +ECDHE-ECDSA-AES128-GCM-SHA256 +ECDHE-RSA-AES128-GCM-SHA256 +ECDHE-ECDSA-AES256-GCM-SHA384 +ECDHE-RSA-AES256-GCM-SHA384 +ECDHE-ECDSA-CHACHA20-POLY1305 +ECDHE-RSA-CHACHA20-POLY1305 +DHE-RSA-AES128-GCM-SHA256 +DHE-RSA-AES256-GCM-SHA384 +DHE-RSA-CHACHA20-POLY1305 +ECDHE-ECDSA-AES128-SHA256 +ECDHE-RSA-AES128-SHA256 +ECDHE-ECDSA-AES128-SHA +ECDHE-RSA-AES128-SHA +ECDHE-ECDSA-AES256-SHA384 +ECDHE-RSA-AES256-SHA384 +ECDHE-ECDSA-AES256-SHA +ECDHE-RSA-AES256-SHA +DHE-RSA-AES128-SHA256 +DHE-RSA-AES256-SHA256 +AES128-GCM-SHA256 +AES256-GCM-SHA384 +AES128-SHA256 +AES256-SHA256 +AES128-SHA +AES256-SHA +DES-CBC3-SHA +``` + +See this [list](https://github.com/curl/curl/blob/master/docs/CIPHERS-TLS12.md) +for a complete list of TLS 1.2 cipher suites. + +#### OpenSSL notes + +In addition to specifying a list of cipher suites, OpenSSL also accepts a +format with specific cipher strings (like `TLSv1.2`, `AESGCM`, `CHACHA20`) and +`!`, `-` and `+` operators. Refer to the +[OpenSSL cipher documentation](https://docs.openssl.org/master/man1/openssl-ciphers/#cipher-list-format) +for further information on that format. + +#### Schannel notes + +Schannel does not support setting individual TLS 1.2 cipher suites directly. +It only allows the enabling and disabling of encryption algorithms. These are +in the form of `CALG_xxx`, see the [Schannel `ALG_ID` +documentation](https://docs.microsoft.com/windows/desktop/SecCrypto/alg-id) +for a list of these algorithms. Also, (since curl 7.77.0) +`SCH_USE_STRONG_CRYPTO` can be given to pass that flag to Schannel, lookup the +[documentation for the Windows version in +use](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel) +to see how that affects the cipher suite selection. When not specifying the +`--ciphers` and `--tls13-ciphers` options curl passes this flag by default. + +### Examples + +```sh +curl \ + --tls13-ciphers TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256 \ + --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\ +ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305 \ + https://example.com/ +``` +Restrict ciphers to `aes128-gcm` and `chacha20`. Works with OpenSSL, LibreSSL, +mbedTLS and wolfSSL. + +```sh +curl \ + --tlsv1.3 \ + --tls13-ciphers TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256 \ + https://example.com/ +``` +Restrict to only TLS 1.3 with `aes128-gcm` and `chacha20` ciphers. Works with +OpenSSL, LibreSSL, mbedTLS, wolfSSL and Schannel. + +```sh +curl \ + --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\ +ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305 \ + https://example.com/ +``` +Restrict TLS 1.2 ciphers to `aes128-gcm` and `chacha20`, use default TLS 1.3 +ciphers (if TLS 1.3 is available). Works with OpenSSL, LibreSSL, BoringSSL, +mbedTLS and wolfSSL. + +## ciphers, the GnuTLS way + +With GnuTLS, curl allows configuration of all TLS parameters via option +[`--ciphers`](https://curl.se/docs/manpage.html#--ciphers) +or +[`CURLOPT_SSL_CIPHER_LIST`](https://curl.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html) +only. The option +[`--tls13-ciphers`](https://curl.se/docs/manpage.html#--tls13-ciphers) +or +[`CURLOPT_TLS13_CIPHERS`](https://curl.se/libcurl/c/CURLOPT_TLS13_CIPHERS.html) +is being ignored. + +`--ciphers` is used to set the GnuTLS **priority string** in +the following way: + +* When the set string starts with '+', '-' or '!' it is *appended* to the + priority string libcurl itself generates (separated by ':'). This initial + priority depends other settings such as CURLOPT_SSLVERSION(3), + CURLOPT_TLSAUTH_USERNAME(3) (for SRP) or if HTTP/3 (QUIC) + is being negotiated. +* Otherwise, the set string fully *replaces* the libcurl generated one. While + giving full control to the application, the set priority needs to + provide for everything the transfer may need to negotiate. Example: if + the set priority only allows TLSv1.2, all HTTP/3 attempts fail. + +Users may specify via `--ciphers` anything that GnuTLS supports: ciphers, +key exchange, MAC, compression, TLS versions, signature algorithms, groups, +elliptic curves, certificate types. In addition, GnuTLS has a variety of +other keywords that tweak its operations. Applications or a system +may define new alias names for priority strings that can then be used here. + +Since the order of items in priority strings is significant, it makes no +sense for curl to puzzle other ssl options somehow together. `--ciphers` +is the single way to change priority. + +### Examples + +```sh +curl \ + --ciphers '-CIPHER_ALL:+AES-128-GCM:+CHACHA20-POLY1305' \ + https://example.com/ +``` +Restrict ciphers to `aes128-gcm` and `chacha20` in GnuTLS. + +```sh +curl \ + --ciphers 'NORMAL:-VERS-ALL:+TLS1.3:-AES-256-GCM' \ + https://example.com/ +``` +Restrict to only TLS 1.3 without the `aes256-gcm` cipher. + +```sh +curl \ + --ciphers 'NORMAL:-VERS-ALL:+TLS1.2:-CIPHER_ALL:+CAMELLIA-128-GCM' \ + https://example.com/ +``` +Restrict to only TLS 1.2 with the `CAMELLIA-128-GCM` cipher. + +## Further reading +- [OpenSSL cipher suite names documentation](https://docs.openssl.org/master/man1/openssl-ciphers/#cipher-suite-names) +- [wolfSSL cipher support documentation](https://www.wolfssl.com/documentation/manuals/wolfssl/chapter04.html#cipher-support) +- [mbedTLS cipher suites reference](https://mbed-tls.readthedocs.io/projects/api/en/development/api/file/ssl__ciphersuites_8h/) +- [Schannel cipher suites documentation](https://learn.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel) +- [IANA cipher suites list](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4) +- [Wikipedia cipher suite article](https://en.wikipedia.org/wiki/Cipher_suite) +- [GnuTLS Priority Strings](https://gnutls.org/manual/html_node/Priority-Strings.html) diff --git a/curl/docs/CMakeLists.txt b/curl/docs/CMakeLists.txt index 694861725..5f342954c 100644 --- a/curl/docs/CMakeLists.txt +++ b/curl/docs/CMakeLists.txt @@ -1,3 +1,46 @@ -#add_subdirectory(examples) -add_subdirectory(libcurl) -add_subdirectory(cmdline-opts) +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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(BUILD_LIBCURL_DOCS) + add_subdirectory(libcurl) +endif() +if(ENABLE_CURL_MANUAL AND BUILD_CURL_EXE) + add_subdirectory(cmdline-opts) +endif() + +if(BUILD_MISC_DOCS) + foreach(_man_misc IN ITEMS "curl-config" "mk-ca-bundle" "wcurl" "runtests" "testcurl") + set(_man_target "${CMAKE_CURRENT_BINARY_DIR}/${_man_misc}.1") + add_custom_command(OUTPUT "${_man_target}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" "${_man_misc}.md" > "${_man_target}" + DEPENDS "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" "${_man_misc}.md" + VERBATIM + ) + add_custom_target("curl-generate-${_man_misc}.1" ALL DEPENDS "${_man_target}") + if(NOT CURL_DISABLE_INSTALL AND NOT _man_misc STREQUAL "mk-ca-bundle") + install(FILES "${_man_target}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + endif() + endforeach() +endif() diff --git a/curl/docs/CODE_OF_CONDUCT.md b/curl/docs/CODE_OF_CONDUCT.md index 1f71c387b..5c8878189 100644 --- a/curl/docs/CODE_OF_CONDUCT.md +++ b/curl/docs/CODE_OF_CONDUCT.md @@ -1,3 +1,9 @@ + + Contributor Code of Conduct =========================== diff --git a/curl/docs/CODE_REVIEW.md b/curl/docs/CODE_REVIEW.md new file mode 100644 index 000000000..da7bb2c9d --- /dev/null +++ b/curl/docs/CODE_REVIEW.md @@ -0,0 +1,175 @@ + + +# How to do code reviews for curl + +Anyone and everyone is encouraged and welcome to review code submissions in +curl. This is a guide on what to check for and how to perform a successful +code review. + +## All submissions should get reviewed + +All pull requests and patches submitted to the project should be reviewed by +at least one experienced curl maintainer before that code is accepted and +merged. + +## Let the tools and tests take the first rounds + +On initial pull requests, let the tools and tests do their job first and then +start out by helping the submitter understand the test failures and tool +alerts. + +## How to provide feedback to author + +Be nice. Ask questions. Provide examples or suggestions of improvements. +Assume the best intentions. Remember language barriers. + +All first-time contributors can become regulars. Let's help them go there. + +## Is this a change we want? + +If this is not a change that seems to be aligned with the project's path +forward and as such cannot be accepted, inform the author about this sooner +rather than later. Do it gently and explain why and possibly what could be +done to make it more acceptable. + +## API/ABI stability or changed behavior + +Changing the API and the ABI may be fine in a change but it needs to be done +deliberately and carefully. If not, a reviewer must help the author to realize +the mistake. + +curl and libcurl are similarly strict on not modifying existing behavior. API +and ABI stability is not enough, the behavior should also remain intact as far +as possible. + +## Code style + +Most code style nits are detected by checksrc but not all. Only leave remarks +on style deviation once checksrc does not find anymore. + +Minor nits from fresh submitters can also be handled by the maintainer when +merging, in case it seems like the submitter is not clear on what to do. We +want to make the process fun and exciting for new contributors. + +## Encourage consistency + +Make sure new code is written in a similar style as existing code. Naming, +logic, conditions, etc. + +## Are pointers always non-NULL? + +If a function or code rely on pointers being non-NULL, take an extra look if +that seems to be a fair assessment. + +## Asserts + +Conditions that should never be false can be verified with `DEBUGASSERT()` +calls to get caught in tests and debugging easier, while not having an impact +on final or release builds. + +## Memory allocation + +Can the mallocs be avoided? Do not introduce mallocs in any hot paths. If +there are (new) mallocs, can they be combined into fewer calls? + +Are all allocations handled in error paths to avoid leaks and crashes? + +## Thread-safety + +We do not like static variables as they break thread-safety and prevent +functions from being reentrant. + +## Should features be `#ifdef`ed? + +Features and functionality may not be present everywhere and should therefore +be `#ifdef`ed. Additionally, some features should be possible to switch on/off +in the build. + +Write `#ifdef`s to be as little of a "maze" as possible. + +## Does it look portable enough? + +curl runs "everywhere". Does the code take a reasonable stance and enough +precautions to be possible to build and run on most platforms? + +Remember that we live by C89 restrictions. + +## Tests and testability + +New features should be added in conjunction with one or more test cases. +Ideally, functions should also be written so that unit tests can be done to +test individual functions. + +## Documentation + +New features or changes to existing functionality **must** be accompanied by +updated documentation. Submitting that in a separate follow-up pull request is +not OK. A code review must also verify that the submitted documentation update +matches the code submission. + +English is not everyone's first language, be mindful of this and help the +submitter improve the text if it needs a rewrite to read better. + +## Code should not be hard to understand + +Source code should be written to maximize readability and be easy to +understand. + +## Functions should not be large + +A single function should never be large as that makes it hard to follow and +understand all the exit points and state changes. Some existing functions in +curl certainly violate this ground rule but when reviewing new code we should +propose splitting into smaller functions. + +## Duplication is evil + +Anything that looks like duplicated code is a red flag. Anything that seems to +introduce code that we *should* already have or provide needs a closer check. + +## Sensitive data + +When credentials are involved, take an extra look at what happens with this +data. Where it comes from and where it goes. + +## Variable types differ + +`size_t` is not a fixed size. `time_t` can be signed or unsigned and have +different sizes. Relying on variable sizes is a red flag. + +Also remember that endianness and >= 32-bit accesses to unaligned addresses +are problematic areas. + +## Integer overflows + +Be careful about integer overflows. Some variable types can be either 32-bit +or 64-bit. Integer overflows must be detected and acted on *before* they +happen. + +## Dangerous use of functions + +Maybe use of `realloc()` should rather use the dynbuf functions? + +Do not allow new code that grows buffers without using dynbuf. + +Use of C functions that rely on a terminating zero must only be used on data +that really do have a null-terminating zero. + +## Dangerous "data styles" + +Make extra precautions and verify that memory buffers that need a terminating +zero always have exactly that. Buffers *without* a null-terminator must not be +used as input to string functions. + +# Commit messages + +Tightly coupled with a code review is making sure that the commit message is +good. It is the responsibility of the person who merges the code to make sure +that the commit message follows our standard (detailed in the +[CONTRIBUTE](https://curl.se/dev/contribute.html) document). This includes +making sure the PR identifies related issues and giving credit to reporters +and helpers. diff --git a/curl/docs/CODE_STYLE.md b/curl/docs/CODE_STYLE.md deleted file mode 100644 index ba5f71026..000000000 --- a/curl/docs/CODE_STYLE.md +++ /dev/null @@ -1,238 +0,0 @@ -# curl C code style - -Source code that has a common style is easier to read than code that uses -different styles in different places. It helps making the code feel like one -single code base. Easy-to-read is a very important property of code and helps -making it easier to review when new things are added and it helps debugging -code when developers are trying to figure out why things go wrong. A unified -style is more important than individual contributors having their own personal -tastes satisfied. - -Our C code has a few style rules. Most of them are verified and upheld by the -`lib/checksrc.pl` script. Invoked with `make checksrc` or even by default by -the build system when built after `./configure --enable-debug` has been used. - -It is normally not a problem for anyone to follow the guidelines, as you just -need to copy the style already used in the source code and there are no -particularly unusual rules in our set of rules. - -We also work hard on writing code that are warning-free on all the major -platforms and in general on as many platforms as possible. Code that obviously -will cause warnings will not be accepted as-is. - -## Naming - -Try using a non-confusing naming scheme for your new functions and variable -names. It doesn't necessarily have to mean that you should use the same as in -other places of the code, just that the names should be logical, -understandable and be named according to what they're used for. File-local -functions should be made static. We like lower case names. - -See the [INTERNALS](INTERNALS.md) document on how we name non-exported -library-global symbols. - -## Indenting - -We use only spaces for indentation, never TABs. We use two spaces for each new -open brace. - - if(something_is_true) { - while(second_statement == fine) { - moo(); - } - } - -## Comments - -Since we write C89 code, `//` comments are not allowed. They weren't -introduced in the C standard until C99. We use only `/*` and `*/` comments: - - /* this is a comment */ - -## Long lines - -Source code in curl may never be wider than 79 columns and there are two -reasons for maintaining this even in the modern era of very large and high -resolution screens: - -1. Narrower columns are easier to read than very wide ones. There's a reason - newspapers have used columns for decades or centuries. - -2. Narrower columns allow developers to easier show multiple pieces of code - next to each other in different windows. I often have two or three source - code windows next to each other on the same screen - as well as multiple - terminal and debugging windows. - -## Braces - -In if/while/do/for expressions, we write the open brace on the same line as -the keyword and we then set the closing brace on the same indentation level as -the initial keyword. Like this: - - if(age < 40) { - /* clearly a youngster */ - } - -You may omit the braces if they would contain only a one-line statement: - - if(!x) - continue; - -For functions the opening brace should be on a separate line: - - int main(int argc, char **argv) - { - return 1; - } - -## 'else' on the following line - -When adding an `else` clause to a conditional expression using braces, we add -it on a new line after the closing brace. Like this: - - if(age < 40) { - /* clearly a youngster */ - } - else { - /* probably grumpy */ - } - -## No space before parentheses - -When writing expressions using if/while/do/for, there shall be no space -between the keyword and the open parenthesis. Like this: - - while(1) { - /* loop forever */ - } - -## Use boolean conditions - -Rather than test a conditional value such as a bool against TRUE or FALSE, a -pointer against NULL or != NULL and an int against zero or not zero in -if/while conditions we prefer: - - result = do_something(); - if(!result) { - /* something went wrong */ - return result; - } - -## No assignments in conditions - -To increase readability and reduce complexity of conditionals, we avoid -assigning variables within if/while conditions. We frown upon this style: - - if((ptr = malloc(100)) == NULL) - return NULL; - -and instead we encourage the above version to be spelled out more clearly: - - ptr = malloc(100); - if(!ptr) - return NULL; - -## New block on a new line - -We never write multiple statements on the same source line, even for very -short if() conditions. - - if(a) - return TRUE; - else if(b) - return FALSE; - -and NEVER: - - if(a) return TRUE; - else if(b) return FALSE; - -## Space around operators - -Please use spaces on both sides of operators in C expressions. Postfix `(), -[], ->, ., ++, --` and Unary `+, - !, ~, &` operators excluded they should -have no space. - -Examples: - - bla = func(); - who = name[0]; - age += 1; - true = !false; - size += -2 + 3 * (a + b); - ptr->member = a++; - struct.field = b--; - ptr = &address; - contents = *pointer; - complement = ~bits; - empty = (!*string) ? TRUE : FALSE; - -## Column alignment - -Some statements cannot be completed on a single line because the line would -be too long, the statement too hard to read, or due to other style guidelines -above. In such a case the statement will span multiple lines. - -If a continuation line is part of an expression or sub-expression then you -should align on the appropriate column so that it's easy to tell what part of -the statement it is. Operators should not start continuation lines. In other -cases follow the 2-space indent guideline. Here are some examples from libcurl: - -~~~c - if(Curl_pipeline_wanted(handle->multi, CURLPIPE_HTTP1) && - (handle->set.httpversion != CURL_HTTP_VERSION_1_0) && - (handle->set.httpreq == HTTPREQ_GET || - handle->set.httpreq == HTTPREQ_HEAD)) - /* didn't ask for HTTP/1.0 and a GET or HEAD */ - return TRUE; -~~~ - -~~~c - case CURLOPT_KEEP_SENDING_ON_ERROR: - data->set.http_keep_sending_on_error = (0 != va_arg(param, long)) ? - TRUE : FALSE; - break; -~~~ - -~~~c - data->set.http_disable_hostname_check_before_authentication = - (0 != va_arg(param, long)) ? TRUE : FALSE; -~~~ - -~~~c - if(option) { - result = parse_login_details(option, strlen(option), - (userp ? &user : NULL), - (passwdp ? &passwd : NULL), - NULL); - } -~~~ - -~~~c - DEBUGF(infof(data, "Curl_pp_readresp_ %d bytes of trailing " - "server response left\n", - (int)clipamount)); -~~~ - -## Platform dependent code - -Use `#ifdef HAVE_FEATURE` to do conditional code. We avoid checking for -particular operating systems or hardware in the #ifdef lines. The HAVE_FEATURE -shall be generated by the configure script for unix-like systems and they are -hard-coded in the config-[system].h files for the others. - -We also encourage use of macros/functions that possibly are empty or defined -to constants when libcurl is built without that feature, to make the code -seamless. Like this style where the `magic()` function works differently -depending on a build-time conditional: - - #ifdef HAVE_MAGIC - void magic(int a) - { - return a + 2; - } - #else - #define magic(x) 1 - #endif - - int content = magic(3); diff --git a/curl/docs/CONTRIBUTE.md b/curl/docs/CONTRIBUTE.md index 536a9ceb3..710b3a1ef 100644 --- a/curl/docs/CONTRIBUTE.md +++ b/curl/docs/CONTRIBUTE.md @@ -1,76 +1,80 @@ + + # Contributing to the curl project This document is intended to offer guidelines on how to best contribute to the curl project. This concerns new features as well as corrections to existing flaws or bugs. -## Learning curl +## Join the Community -### Join the Community - -Skip over to [https://curl.haxx.se/mail/](https://curl.haxx.se/mail/) and join -the appropriate mailing list(s). Read up on details before you post -questions. Read this file before you start sending patches! We prefer +Skip over to [https://curl.se/mail/](https://curl.se/mail/) and join +the appropriate mailing list(s). Read up on details before you post +questions. Read this file before you start sending patches. We prefer questions sent to and discussions being held on the mailing list(s), not sent to individuals. Before posting to one of the curl mailing lists, please read up on the -[mailing list etiquette](https://curl.haxx.se/mail/etiquette.html). +[mailing list etiquette](https://curl.se/mail/etiquette.html). -We also hang out on IRC in #curl on irc.freenode.net +We also hang out on IRC in #curl on libera.chat -If you're at all interested in the code side of things, consider clicking -'watch' on the [curl repo on github](https://github.com/curl/curl) to get -notified on pull requests and new issues posted there. +If you are at all interested in the code side of things, consider clicking +'watch' on the [curl repository on GitHub](https://github.com/curl/curl) to be +notified of pull requests and new issues posted there. -### License and copyright +## License and copyright When contributing with code, you agree to put your changes and new code under the same license curl and libcurl is already using unless stated and agreed otherwise. If you add a larger piece of code, you can opt to make that file or set of -files to use a different license as long as they don't enforce any changes to +files to use a different license as long as they do not enforce any changes to the rest of the package and they make sense. Such "separate parts" can not be -GPL licensed (as we don't want copyleft to affect users of libcurl) but they +GPL licensed (as we do not want copyleft to affect users of libcurl) but they must use "GPL compatible" licenses (as we want to allow users to use libcurl properly in GPL licensed environments). When changing existing source code, you do not alter the copyright of the -original file(s). The copyright will still be owned by the original creator(s) -or those who have been assigned copyright by the original author(s). +original file(s). The copyright is still owned by the original creator(s) or +those who have been assigned copyright by the original author(s). By submitting a patch to the curl project, you are assumed to have the right to the code and to be allowed by your employer or whatever to hand over that -patch/code to us. We will credit you for your changes as far as possible, to -give credit but also to keep a trace back to who made what changes. Please -always provide us with your full real name when contributing! +patch/code to us. We credit you for your changes as far as possible, to give +credit but also to keep a trace back to who made what changes. Please always +provide us with your full real name when contributing, -### What To Read +## What To Read Source code, the man pages, the [INTERNALS -document](https://curl.haxx.se/dev/internals.html), -[TODO](https://curl.haxx.se/docs/todo.html), -[KNOWN_BUGS](https://curl.haxx.se/docs/knownbugs.html) and the [most recent -changes](https://curl.haxx.se/dev/sourceactivity.html) in git. Just lurking on -the [curl-library mailing -list](https://curl.haxx.se/mail/list.cgi?list=curl-library) will give you a -lot of insights on what's going on right now. Asking there is a good idea too. +document](https://curl.se/dev/internals.html), +[TODO](https://curl.se/docs/todo.html), +[KNOWN_BUGS](https://curl.se/docs/knownbugs.html) and the [most recent +changes](https://curl.se/dev/sourceactivity.html) in git. Just lurking on the +[curl-library mailing list](https://curl.se/mail/list.cgi?list=curl-library) +gives you a lot of insights on what's going on right now. Asking there is a +good idea too. ## Write a good patch ### Follow code style When writing C code, follow the -[CODE_STYLE](https://curl.haxx.se/dev/code-style.html) already established in +[CODE_STYLE](https://curl.se/dev/code-style.html) already established in the project. Consistent style makes code easier to read and mistakes less likely to happen. Run `make checksrc` before you submit anything, to make sure -you follow the basic style. That script doesn't verify everything, but if it +you follow the basic style. That script does not verify everything, but if it complains you know you have work to do. ### Non-clobbering All Over -When you write new functionality or fix bugs, it is important that you don't +When you write new functionality or fix bugs, it is important that you do not fiddle all over the source files and functions. Remember that it is likely that other people have done changes in the same source files as you have and possibly even in the same functions. If you bring completely new @@ -79,11 +83,11 @@ fix one bug at a time and send them as separate patches. ### Write Separate Changes -It is annoying when you get a huge patch from someone that is said to fix 511 -odd problems, but discussions and opinions don't agree with 510 of them - or -509 of them were already fixed in a different way. Then the person merging -this change needs to extract the single interesting patch from somewhere -within the huge pile of source, and that creates a lot of extra work. +It is annoying when you get a huge patch from someone that is said to fix 11 +odd problems, but discussions and opinions do not agree with 10 of them - or 9 +of them were already fixed in a different way. Then the person merging this +change needs to extract the single interesting patch from somewhere within the +huge pile of source, and that creates a lot of extra work. Preferably, each fix that corrects a problem should be in its own patch/commit with its own description/commit message stating exactly what they correct so @@ -96,172 +100,268 @@ and regression in the future. ### Patch Against Recent Sources Please try to get the latest available sources to make your patches against. -It makes the lives of the developers so much easier. The very best is if you -get the most up-to-date sources from the git repository, but the latest -release archive is quite OK as well! +It makes the lives of the developers so much easier. The best is if you get +the most up-to-date sources from the git repository, but the latest release +archive is quite OK as well. ### Documentation Writing docs is dead boring and one of the big problems with many open source -projects. But someone's gotta do it! It makes things a lot easier if you -submit a small description of your fix or your new features with every -contribution so that it can be swiftly added to the package documentation. +projects but someone's gotta do it. It makes things a lot easier if you submit +a small description of your fix or your new features with every contribution +so that it can be swiftly added to the package documentation. -The documentation is always made in man pages (nroff formatted) or plain -ASCII files. All HTML files on the web site and in the release archives are -generated from the nroff/ASCII versions. +Documentation is mostly provided as manpages or plain ASCII files. The +manpages are rendered from their source files that are usually written using +markdown. Most HTML files on the website and in the release archives are +generated from corresponding markdown and ASCII files. ### Test Cases Since the introduction of the test suite, we can quickly verify that the main -features are working as they're supposed to. To maintain this situation and -improve it, all new features and functions that are added need to be tested -in the test suite. Every feature that is added should get at least one valid -test case that verifies that it works as documented. If every submitter also -posts a few test cases, it won't end up as a heavy burden on a single person! - -If you don't have test cases or perhaps you have done something that is very -hard to write tests for, do explain exactly how you have otherwise tested and +features are working as they are supposed to. To maintain this situation and +improve it, all new features and functions that are added need to be tested in +the test suite. Every feature that is added should get at least one valid test +case that verifies that it works as documented. If every submitter also posts +a few test cases, it does not end up a heavy burden on a single person. + +If you do not have test cases or perhaps you have done something that is hard +to write tests for, do explain exactly how you have otherwise tested and verified your changes. -## Sharing Your Changes +# Submit Your Changes -### How to get your changes into the main sources +## Get your changes merged Ideally you file a [pull request on -github](https://github.com/curl/curl/pulls), but you can also send your plain +GitHub](https://github.com/curl/curl/pulls), but you can also send your plain patch to [the curl-library mailing -list](https://curl.haxx.se/mail/list.cgi?list=curl-library). +list](https://curl.se/mail/list.cgi?list=curl-library). + +If you opt to post a patch on the mailing list, chances are someone converts +it into a pull request for you, to have the CI jobs verify it proper before it +can be merged. Be prepared that some feedback on the proposed change might +then come on GitHub. -Either way, your change will be reviewed and discussed there and you will be -expected to correct flaws pointed out and update accordingly, or the change -risks stalling and eventually just getting deleted without action. As a -submitter of a change, you are the owner of that change until it has been merged. +Your changes be reviewed and discussed and you are expected to correct flaws +pointed out and update accordingly, or the change risks stalling and +eventually just getting deleted without action. As a submitter of a change, +you are the owner of that change until it has been merged. -Respond on the list or on github about the change and answer questions and/or -fix nits/flaws. This is very important. We will take lack of replies as a -sign that you're not very anxious to get your patch accepted and we tend to -simply drop such changes. +Respond on the list or on GitHub about the change and answer questions and/or +fix nits/flaws. This is important. We take lack of replies as a sign that you +are not anxious to get your patch accepted and we tend to simply drop such +changes. -### About pull requests +## About pull requests -With github it is easy to send a [pull +With GitHub it is easy to send a [pull request](https://github.com/curl/curl/pulls) to the curl project to have changes merged. We strongly prefer pull requests to mailed patches, as it makes it a proper git commit that is easy to merge and they are easy to track and not that easy -to loose in the flood of many emails, like they sometimes do on the mailing +to lose in the flood of many emails, like they sometimes do on the mailing lists. -Every pull request submitted will automatically be tested in several different -ways. Every pull request is verfied that: +Every pull request submitted is automatically tested in several different +ways. [See the CI document for more +information](https://github.com/curl/curl/blob/master/docs/tests/CI.md). - - ... it still builds, warning-free, on Linux and macOS, with both - clang and gcc - - ... it still builds fine on Windows with several MSVC versions - - ... it still builds with cmake on Linux, with gcc and clang - - ... it follows rudimentary code style rules - - ... the test suite still runs 100% fine - - ... the release tarball (the "dist") still works - - ... it builds fine in-tree as well as out-of-tree - - ... code coverage doesn't shrink drastically +Sometimes the tests fail due to a dependency service temporarily being offline +or otherwise unavailable, e.g. package downloads. In this case you can just +try to update your pull requests to rerun the tests later as described below. -If the pull-request fails one of these tests, it will show up as a red X and -you are expected to fix the problem. If you don't understand whan the issue is -or have other problems to fix the complaint, just ask and other project -members will likely be able to help out. +You can update your pull requests by pushing new commits or force-pushing +changes to existing commits. Force-pushing an amended commit without any +actual content changed also allows you to retrigger the tests for that commit. When you adjust your pull requests after review, consider squashing the commits so that we can review the full updated version more easily. -### Making quality patches +A pull request sent to the project might get labeled `needs-votes` by a +project maintainer. This label means that in addition to meeting all other +checks and qualifications this pull request must also receive more "votes" of +user support. More signs that people want this to happen. It could be in the +form of messages saying so, or thumbs-up reactions on GitHub. + +## When the pull request is approved + +If it does not seem to get approved when you think it is ready - feel free to +ask for approval. + +Once your pull request has been approved it can be merged by a maintainer. + +For new features, or changes, we require that the *feature window* is open for +the pull request to be merged. This is typically a three week period that +starts ten days after a previous release. New features submitted as pull +requests while the window is closed simply have to wait until it opens to get +merged. + +If time passes without your approved pull request gets merged: feel free to +ask what more you can do to make it happen. + +## Making quality changes Make the patch against as recent source versions as possible. -If you've followed the tips in this document and your patch still hasn't been -incorporated or responded to after some weeks, consider resubmitting it to the -list or better yet: change it to a pull request. +If you have followed the tips in this document and your patch still has not +been incorporated or responded to after some weeks, consider resubmitting it +to the list or better yet: change it to a pull request. -### Write good commit messages +## Commit messages -A short guide to how to write commit messages in the curl project. +How to write git commit messages in the curl project. ---- start ---- [area]: [short line describing the main effect] -- empty line -- - [full description, no wider than 72 columns that describe as much as + [full description, no wider than 72 columns that describes as much as possible as to why this change is made, and possibly what things - it fixes and everything else that is related] - -- empty line -- - [Closes/Fixes #1234 - if this closes or fixes a github issue] - [Bug: URL to source of the report or more related discussion] - [Reported-by: John Doe - credit the reporter] - [whatever-else-by: credit all helpers, finders, doers] - ---- stop ---- + it fixes and everything else that is related, + -- end -- + +The first line is a succinct description of the change and should ideally work +as a single line in the RELEASE NOTES. + + - use the imperative, present tense: **change** not "changed" nor "changes" + - do not capitalize the first letter + - no period (.) at the end + +The `[area]` in the first line can be `http2`, `cookies`, `openssl` or +similar. There is no fixed list to select from but using the same "area" as +other related changes could make sense. + +## Commit message keywords + +Use the following ways to improve the message and provide pointers to related +work. + +- `Follow-up to {shorthash}` - if this fixes or continues a previous commit; +add a `Ref:` that commit's PR or issue if it is not a small, obvious fix; +followed by an empty line + +- `Bug: URL` to the source of the report or more related discussion; use +`Fixes` for GitHub issues instead when that is appropriate. + +- `Approved-by: John Doe` - credit someone who approved the PR. + +- `Authored-by: John Doe` - credit the original author of the code; only use +this if you cannot use `git commit --author=...`. + +- `Signed-off-by: John Doe` - we do not use this, but do not bother removing + it. + +- `whatever-else-by:` credit all helpers, finders, doers; try to use one of +the following keywords if at all possible, for consistency: `Acked-by:`, +`Assisted-by:`, `Co-authored-by:`, `Found-by:`, `Reported-by:`, +`Reviewed-by:`, `Suggested-by:`, `Tested-by:`. + +- `Ref: #1234` - if this is related to a GitHub issue or PR, possibly one that +has already been closed. + +- `Ref: URL` to more information about the commit; use `Bug:` instead for a +reference to a bug on another bug tracker] + +- `Fixes #1234` - if this fixes a GitHub issue; GitHub closes the issue once +this commit is merged. + +- `Closes #1234` - if this merges a GitHub PR; GitHub closes the PR once this +commit is merged. + +Do not forget to use commit with `--author` if you commit someone else's work, +and make sure that you have your own user and email setup correctly in git +before you commit. -Don't forget to use commit --author="" if you commit someone else's work, and -make sure that you have your own user and email setup correctly in git before -you commit +Add whichever header lines as appropriate, with one line per person if more +than one person was involved. There is no need to credit yourself unless you +are using `--author` which hides your identity. Do not include people's email +addresses in headers to avoid spam, unless they are already public from a +previous commit; saying `{userid} on github` is OK. -### Write Access to git Repository +## Push Access -If you are a very frequent contributor, you may be given push access to the -git repository and then you'll be able to push your changes straight into the -git repo instead of sending changes as pull requests or by mail as patches. +If you are a frequent contributor, you may be given push access to the git +repository and then you are able to push your changes straight into the git +repository instead of sending changes as pull requests or by mail as patches. -Just ask if this is what you'd want. You will be required to have posted +Just ask if this is what you would want. You are required to have posted several high quality patches first, before you can be granted push access. -### How To Make a Patch with git +## Useful resources + - [Webinar on getting code into cURL](https://www.youtube.com/watch?v=QmZ3W1d6LQI) -You need to first checkout the repository: +# Update copyright and license information - git clone https://github.com/curl/curl.git +There is a CI job called **REUSE compliance / check** that runs on every pull +request and commit to verify that the *REUSE state* of all files are still +fine. -You then proceed and edit all the files you like and you commit them to your -local repository: +This means that all files need to have their license and copyright information +clearly stated. Ideally by having the standard curl source code header, with +the `SPDX-License-Identifier` included. If the header does not work, you can +use a smaller header or add the information for a specific file to the +`REUSE.toml` file. - git commit [file] +You can manually verify the copyright and compliance status by running the +[REUSE helper tool](https://github.com/fsfe/reuse-tool): `reuse lint` -As usual, group your commits so that you commit all changes at once that -constitute a logical change. +# On AI use in curl -Once you have done all your commits and you're happy with what you see, you -can make patches out of your changes that are suitable for mailing: +Guidelines for AI use when contributing to curl. - git format-patch remotes/origin/master +## For security reports and other issues -This creates files in your local directory named NNNN-[name].patch for each -commit. +If you asked an AI tool to find problems in curl, you **must** make sure to +reveal this fact in your report. -Now send those patches off to the curl-library list. You can of course opt to -do that with the 'git send-email' command. +You must also double-check the findings carefully before reporting them to us +to validate that the issues are indeed existing and working exactly as the AI +says. AI-based tools frequently generate inaccurate or fabricated results. -### How To Make a Patch without git +Further: it is *rarely* a good idea to just copy and paste an AI generated +report to the project. Those generated reports typically are too wordy and +rarely to the point (in addition to the common fabricated details). If you +actually find a problem with an AI and you have verified it yourself to be +true: write the report yourself and explain the problem as you have learned +it. This makes sure the AI-generated inaccuracies and invented issues are +filtered out early before they waste more people's time. -Keep a copy of the unmodified curl sources. Make your changes in a separate -source tree. When you think you have something that you want to offer the -curl community, use GNU diff to generate patches. +As we take security reports seriously, we investigate each report with +priority. This work is both time and energy consuming and pulls us away from +doing other meaningful work. Fake and otherwise made up security problems +effectively prevent us from doing real project work and make us waste time and +resources. -If you have modified a single file, try something like: +We ban users immediately who submit made up fake reports to the project. - diff -u unmodified-file.c my-changed-one.c > my-fixes.diff +## For pull requests -If you have modified several files, possibly in different directories, you -can use diff recursively: +When contributing content to the curl project, you give us permission to use +it as-is and you must make sure you are allowed to distribute it to us. By +submitting a change to us, you agree that the changes can and should be +adopted by curl and get redistributed under the curl license. Authors should +be explicitly aware that the burden is on them to ensure no unlicensed code is +submitted to the project. - diff -ur curl-original-dir curl-modified-sources-dir > my-fixes.diff +This is independent if AI is used or not. -The GNU diff and GNU patch tools exist for virtually all platforms, including -all kinds of Unixes and Windows: +When contributing a pull request you should of course always make sure that +the proposal is good quality and a best effort that follows our guidelines. A +basic rule of thumb is that if someone can spot that the contribution was made +with the help of AI, you have more work to do. -For unix-like operating systems: +We can accept code written with the help of AI into the project, but the code +must still follow coding standards, be written clearly, be documented, feature +test cases and adhere to all the normal requirements we have. - - [https://savannah.gnu.org/projects/patch/](https://savannah.gnu.org/projects/patch/) - - [https://www.gnu.org/software/diffutils/](https://www.gnu.org/software/diffutils/) +## For translation -For Windows: +Translation services help users write reports, texts and documentation in +non-native languages and we encourage and welcome such contributors and +contributions. - - [https://gnuwin32.sourceforge.io/packages/patch.htm](https://gnuwin32.sourceforge.io/packages/patch.htm) - - [https://gnuwin32.sourceforge.io/packages/diffutils.htm](https://gnuwin32.sourceforge.io/packages/diffutils.htm) +As AI-based translation tools sometimes have a way to make the output sound a +little robotic and add an "AI tone" to the text, you may want to consider +mentioning that you used such a tool. Failing to do so risks that maintainers +wrongly dismiss translated texts as AI slop. diff --git a/curl/docs/CURL-DISABLE.md b/curl/docs/CURL-DISABLE.md new file mode 100644 index 000000000..63de4026a --- /dev/null +++ b/curl/docs/CURL-DISABLE.md @@ -0,0 +1,191 @@ + + +# Code defines to disable features and protocols + +## `CURL_DISABLE_ALTSVC` + +Disable support for Alt-Svc: HTTP headers. + +## `CURL_DISABLE_BINDLOCAL` + +Disable support for binding the local end of connections. + +## `CURL_DISABLE_COOKIES` + +Disable support for HTTP cookies. + +## `CURL_DISABLE_BASIC_AUTH` + +Disable support for the Basic authentication methods. + +## `CURL_DISABLE_BEARER_AUTH` + +Disable support for the Bearer authentication methods. + +## `CURL_DISABLE_DIGEST_AUTH` + +Disable support for the Digest authentication methods. + +## `CURL_DISABLE_KERBEROS_AUTH` + +Disable support for the Kerberos authentication methods. + +## `CURL_DISABLE_NEGOTIATE_AUTH` + +Disable support for the negotiate authentication methods. + +## `CURL_DISABLE_AWS` + +Disable **aws-sigv4** support. + +## `CURL_DISABLE_CA_SEARCH` + +Disable unsafe CA bundle search in PATH on Windows. + +## `CURL_DISABLE_DICT` + +Disable the DICT protocol + +## `CURL_DISABLE_DOH` + +Disable DNS-over-HTTPS + +## `CURL_DISABLE_FILE` + +Disable the FILE protocol + +## `CURL_DISABLE_FORM_API` + +Disable the form API + +## `CURL_DISABLE_FTP` + +Disable the FTP (and FTPS) protocol + +## `CURL_DISABLE_GETOPTIONS` + +Disable the `curl_easy_options` API calls that lets users get information +about existing options to `curl_easy_setopt`. + +## `CURL_DISABLE_GOPHER` + +Disable the GOPHER protocol. + +## `CURL_DISABLE_HEADERS_API` + +Disable the HTTP header API. + +## `CURL_DISABLE_HSTS` + +Disable the HTTP Strict Transport Security support. + +## `CURL_DISABLE_HTTP` + +Disable the HTTP(S) protocols. Note that this then also disable HTTP proxy +support. + +## `CURL_DISABLE_HTTP_AUTH` + +Disable support for all HTTP authentication methods. + +## `CURL_DISABLE_IMAP` + +Disable the IMAP(S) protocols. + +## `CURL_DISABLE_LDAP` + +Disable the LDAP(S) protocols. + +## `CURL_DISABLE_LDAPS` + +Disable the LDAPS protocol. + +## `CURL_DISABLE_LIBCURL_OPTION` + +Disable the --libcurl option from the curl tool. + +## `CURL_DISABLE_MIME` + +Disable MIME support. + +## `CURL_DISABLE_MQTT` + +Disable MQTT support. + +## `CURL_DISABLE_NETRC` + +Disable the netrc parser. + +## `CURL_DISABLE_NTLM` + +Disable support for NTLM. + +## `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG` + +Disable the auto load config support in the OpenSSL backend. + +## `CURL_DISABLE_PARSEDATE` + +Disable date parsing + +## `CURL_DISABLE_POP3` + +Disable the POP3 protocol + +## `CURL_DISABLE_PROGRESS_METER` + +Disable the built-in progress meter + +## `CURL_DISABLE_PROXY` + +Disable support for proxies + +## `CURL_DISABLE_IPFS` + +Disable the IPFS/IPNS protocols. This affects the curl tool only, where +IPFS/IPNS protocol support is implemented. + +## `CURL_DISABLE_RTSP` + +Disable the RTSP protocol. + +## `CURL_DISABLE_SHA512_256` + +Disable the SHA-512/256 hash algorithm. + +## `CURL_DISABLE_SHUFFLE_DNS` + +Disable the shuffle DNS feature + +## `CURL_DISABLE_SMB` + +Disable the SMB(S) protocols + +## `CURL_DISABLE_SMTP` + +Disable the SMTP(S) protocols + +## `CURL_DISABLE_SOCKETPAIR` + +Disable the use of `socketpair()` internally to allow waking up and canceling +`curl_multi_poll()`. + +## `CURL_DISABLE_TELNET` + +Disable the TELNET protocol + +## `CURL_DISABLE_TFTP` + +Disable the TFTP protocol + +## `CURL_DISABLE_VERBOSE_STRINGS` + +Disable verbose strings and error messages. + +## `CURL_DISABLE_WEBSOCKETS` + +Disable the WebSocket protocols. diff --git a/curl/docs/CURLDOWN.md b/curl/docs/CURLDOWN.md new file mode 100644 index 000000000..6726b3946 --- /dev/null +++ b/curl/docs/CURLDOWN.md @@ -0,0 +1,166 @@ + + +# curldown + +A markdown-like syntax for libcurl man pages. + +## Purpose + +A text format for writing libcurl documentation in the shape of man pages. + +Make it easier for users to contribute and write documentation. A format that +is easier on the eye in its source format. + +Make it harder to do syntactical mistakes. + +Use a format that allows creating man pages that end up looking exactly like +the man pages did when we wrote them in nroff format. + +Take advantage of the fact that people these days are accustomed to markdown +by using a markdown-like syntax. + +This allows us to fix issues in the nroff format easier since now we generate +them. For example: escaping minus to prevent them from being turned into +Unicode by man. + +Generate nroff output that looks (next to) *identical* to the previous files, +so that the look, existing test cases, HTML conversions, existing +infrastructure etc remain mostly intact. + +Contains meta-data in a structured way to allow better output (for example the +see also information) and general awareness of what the file is about. + +## File extension + +Since curldown looks similar to markdown, we use `.md` extensions on the +files. + +## Conversion + +Convert **from curldown to nroff** with `cd2nroff`. Generates nroff man pages. + +Convert **from nroff to curldown** with `nroff2cd`. This is only meant to be +used for the initial conversion to curldown and should ideally never be needed +again. + +Convert, check or clean up an existing curldown to nicer, better, cleaner +curldown with **cd2cd**. + +Mass-convert all curldown files to nroff in specified directories with +`cdall`: + + cdall [dir1] [dir2] [dir3] .. + +## Known issues + +The `cd2nroff` tool does not yet handle *italics* or **bold** where the start +and the end markers are used on separate lines. + +The `nroff2cd` tool generates code style quotes for all `.fi` sections since +the nroff format does not carry a distinction. + +# Format + +Each curldown starts with a header with meta-data: + + --- + c: Copyright (C) Daniel Stenberg, , et al. + SPDX-License-Identifier: curl + Title: CURLOPT_AWS_SIGV4 + Section: 3 + Source: libcurl + Protocol: + - HTTP + See-also: + - CURLOPT_HEADEROPT (3) + - CURLOPT_HTTPAUTH (3) + TLS-backend: + - [name] + Added-in: [version or "n/a"] + --- + +All curldown files *must* have all the headers present and at least one +`See-also:` entry specified. + +If the man page is for section 3 (library related). The `Protocol` list must +contain at least one protocol, which can be `*` if the option is virtually for +everything. If `*` is used, it must be the only listed protocol. Recognized +protocols are either URL schemes (in uppercase), `TLS` or `TCP`. + +If the `Protocol` list contains `TLS`, then there must also be a `TLS-backend` +list, specifying `All` or a list of what TLS backends that work with this +option. The available TLS backends are: + +- `GnuTLS` +- `mbedTLS` +- `OpenSSL` (also covers BoringSSL, LibreSSL, quictls, AWS-LC and AmiSSL) +- `rustls` +- `Schannel` +- `wolfSSL` +- `All`: all TLS backends + +Following the header in the file, is the manual page using markdown-like +syntax: + +~~~ + # NAME + a page - this is a page describing something + + # SYNOPSIS + ~~~c + #include + + CURLcode curl_easy_setopt(CURL *handle, CURLOPT_AWS_SIGV4, char *param); + ~~~ +~~~ + +Quoted source code should start with `~~~c` and end with `~~~` while regular +quotes can start with `~~~` or just be indented with 4 spaces. + +Headers at top-level `#` get converted to `.SH`. + +`nroff2cd` supports the `##` next level header which gets converted to `.IP`. + +Write bold words or phrases within `**` like: + + This is a **bold** word. + +Write italics like: + + This is *italics*. + +Due to how man pages do not support backticks especially formatted, such +occurrences in the source are instead just using italics in the generated +output: + + This `word` appears in italics. + +When generating the nroff output, the tooling removes superfluous newlines, +meaning they can be used freely in the source file to make the text more +readable. + +To make sure curldown documents render correctly as markdown, all literal +occurrences of `<` or `>` need to be escaped by a leading backslash. + +## Generating contents + +`# %PROTOCOLS%` - inserts a **PROTOCOLS** section based on the metadata +provided in the header. + +`# %AVAILABILITY%` - inserts an **AVAILABILITY** section based on the metadata +provided in the header. + +## Symbols + +All mentioned curl symbols that have their own man pages, like +`curl_easy_perform(3)` are automatically rendered using italics in the output +without having to enclose it with asterisks. This helps ensuring that they get +converted to links properly later in the HTML version on the website, as +converted with `roffit`. This makes the curldown text easier to read even when +mentioning many curl symbols. + +This auto-linking works for patterns matching `(lib|)curl[^ ]*(3)`. diff --git a/curl/docs/DEPRECATE.md b/curl/docs/DEPRECATE.md new file mode 100644 index 000000000..c7cb97d9d --- /dev/null +++ b/curl/docs/DEPRECATE.md @@ -0,0 +1,73 @@ + + +# Items to be removed from future curl releases + +If any of these deprecated features is a cause for concern for you, please +email the +[curl-library mailing list](https://lists.haxx.se/listinfo/curl-library) +as soon as possible and explain to us why this is a problem for you and +how your use case cannot be satisfied properly using a workaround. + +## Nothing + +Nothing is currently scheduled to be removed. + +## msh3 support + +The msh3 backed for QUIC and HTTP/3 was introduced in April 2022 but has never +been made to work properly. It has seen no visible traction or developer +activity from the msh3 main author (or anyone else seemingly interested) in +two years. As a non-functional backend, it only adds friction and "weight" to +the development and maintenance. + +Meanwhile, we have a fully working backend in the ngtcp2 one and we have two +fully working backends in OpenSSL-QUIC and quiche well on their way of ending +their experimental status in a future. + +We remove msh3 support from the curl source tree in July 2025. + +## winbuild build system + +curl drops support for the winbuild build method after September 2025. + +We recommend migrating to CMake. See the migration guide in +`docs/INSTALL-CMAKE.md`. + +## Windows CE + +Windows CE "mainstream support" ended on October 9, 2018, and "Extended +Support" ended on October 10, 2023. + +curl drops all support in November 2025. + +## VS2008 + +curl drops support for getting built with Microsoft Visual Studio 2008 in +November 2025. + +The only reason we kept support for this version is for Windows CE - and we +intend to remove support for that Operating System in this time frame as well. +Bumping the minimum to VS2010. VS2008 is a pain to support. + +Previous discussion and details: https://github.com/curl/curl/discussions/15972 + +## Past removals + + - axTLS (removed in 7.63.0) + - Pipelining (removed in 7.65.0) + - PolarSSL (removed in 7.69.0) + - NPN (removed in 7.86.0) + - Support for systems without 64-bit data types (removed in 8.0.0) + - NSS (removed in 8.3.0) + - gskit (removed in 8.3.0) + - MinGW v1 (removed in 8.4.0) + - NTLM_WB (removed in 8.8.0) + - space-separated `NOPROXY` patterns (removed in 8.9.0) + - hyper (removed in 8.12.0) + - Support for Visual Studio 2005 and older (removed in 8.13.0) + - Secure Transport (removed in 8.15.0) + - BearSSL (removed in 8.15.0) diff --git a/curl/docs/DISTROS.md b/curl/docs/DISTROS.md new file mode 100644 index 000000000..2da86d1eb --- /dev/null +++ b/curl/docs/DISTROS.md @@ -0,0 +1,286 @@ + + +# curl distros + + + +Lots of organizations distribute curl packages to end users. This is a +collection of pointers to where to learn more about curl on and with each +distro. Those marked *Rolling Release* typically run the latest version of curl +and are therefore less likely to have back-ported patches to older versions. + +We discuss curl distro issues, patches and collaboration on the [curl-distros +mailing list](https://lists.haxx.se/listinfo/curl-distros) ([list +archives](https://curl.se/mail/list.cgi?list=curl-distros)). + +## AlmaLinux + +- curl package source and patches: https://git.almalinux.org/rpms/curl/ +- curl issues: https://bugs.almalinux.org/view_all_bug_page.php click Category and choose curl +- curl security: https://errata.almalinux.org/ search for curl + +## Alpine Linux + +- curl: https://pkgs.alpinelinux.org/package/edge/main/x86_64/curl +- curl issues: https://gitlab.alpinelinux.org/alpine/aports/-/issues +- curl security: https://security.alpinelinux.org/srcpkg/curl +- curl package source and patches: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/curl + +## Alt Linux + +- curl: https://packages.altlinux.org/en/search/?q=curl +- curl issues: https://packages.altlinux.org/en/sisyphus/srpms/curl/issues/ +- curl patches: https://git.altlinux.org/gears/c/curl.git?p=curl.git;a=tree;f=.gear + +## Arch Linux + +*Rolling Release* + +- curl: https://archlinux.org/packages/core/x86_64/curl/ +- curl issues: https://gitlab.archlinux.org/archlinux/packaging/packages/curl/-/issues +- curl security: https://security.archlinux.org/package/curl +- curl wiki: https://wiki.archlinux.org/title/CURL + +## Buildroot + +*Rolling Release* + +- curl package source and patches: https://git.buildroot.net/buildroot/tree/package/libcurl +- curl issues: https://bugs.buildroot.org/buglist.cgi?quicksearch=curl + +## Chimera + +- curl package source and patches: https://github.com/chimera-linux/cports/tree/master/main/curl + +## Clear Linux + +*Rolling Release* + +- curl: https://github.com/clearlinux-pkgs/curl +- curl issues: https://github.com/clearlinux/distribution/issues + +## Conary + +- curl: https://github.com/conan-io/conan-center-index/tree/master/recipes/libcurl +- curl issues: https://github.com/conan-io/conan-center-index/issues +- curl patches: https://github.com/conan-io/conan-center-index/tree/master/recipes/libcurl (in `all/patches/*`, if any) + +## conda-forge + +- curl: https://github.com/conda-forge/curl-feedstock +- curl issues: https://github.com/conda-forge/curl-feedstock/issues + +## CRUX + +- curl: https://crux.nu/portdb/?a=search&q=curl +- curl issues: https://git.crux.nu/ports/core/issues/?type=all&state=open&q=curl + +## curl-for-win + +(this is the official curl binaries for Windows shipped by the curl project) + +*Rolling Release* + +- curl: https://curl.se/windows/ +- curl patches: https://github.com/curl/curl-for-win/blob/main/curl.patch (if any) +- build-specific issues: https://github.com/curl/curl-for-win/issues + +Issues and patches for this are managed in the main curl project. + +## Cygwin + +- curl: https://cygwin.com/cgit/cygwin-packages/curl/tree/curl.cygport +- curl patches: https://cygwin.com/cgit/cygwin-packages/curl/tree +- curl issues: https://inbox.sourceware.org/cygwin/?q=s%3Acurl + +## Cygwin (cross mingw64) + +- mingw64-x86_64-curl: https://cygwin.com/cgit/cygwin-packages/mingw64-x86_64-curl/tree/mingw64-x86_64-curl.cygport +- mingw64-x86_64-curl patches: https://cygwin.com/cgit/cygwin-packages/mingw64-x86_64-curl/tree +- mingw64-x86_64-curl issues: https://inbox.sourceware.org/cygwin/?q=s%3Amingw64-x86_64-curl + +## Debian + +- curl: https://tracker.debian.org/pkg/curl +- curl issues: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=curl +- curl patches: https://udd.debian.org/patches.cgi?src=curl +- curl patches: https://salsa.debian.org/debian/curl (in debian/* branches, inside the folder debian/patches) + +## Fedora + +- curl: https://src.fedoraproject.org/rpms/curl +- curl issues: [bugzilla](https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&classification=Fedora&product=Fedora&product=Fedora%20EPEL&component=curl) +- curl patches: [list of patches in package git](https://src.fedoraproject.org/rpms/curl/tree/rawhide) + +## FreeBSD + +- curl: https://cgit.freebsd.org/ports/tree/ftp/curl +- curl patches: https://cgit.freebsd.org/ports/tree/ftp/curl +- curl issues: https://bugs.freebsd.org/bugzilla/buglist.cgi?bug_status=__open__&order=Importance&product=Ports%20%26%20Packages&query_format=advanced&short_desc=curl&short_desc_type=allwordssubstr + +## Gentoo Linux + +*Rolling Release* + +- curl: https://packages.gentoo.org/packages/net-misc/curl +- curl issues: https://bugs.gentoo.org/buglist.cgi?quicksearch=net-misc/curl +- curl package sources and patches: https://gitweb.gentoo.org/repo/gentoo.git/tree/net-misc/curl/ + +## GNU Guix + +*Rolling Release* + +- curl: https://git.savannah.gnu.org/gitweb/?p=guix.git;a=blob;f=gnu/packages/curl.scm;hb=HEAD +- curl issues: https://issues.guix.gnu.org/search?query=curl + +## Homebrew + +*Rolling Release* + +- curl: https://formulae.brew.sh/formula/curl + +Homebrew's policy is that all patches and issues should be submitted upstream +unless it is specific to Homebrew's way of packaging software. + +## MacPorts + +*Rolling Release* + +- curl: https://github.com/macports/macports-ports/tree/master/net/curl +- curl issues: https://trac.macports.org/query?0_port=curl&0_port_mode=%7E&0_status=%21closed +- curl patches: https://github.com/macports/macports-ports/tree/master/net/curl/files + +## Mageia + +- curl: https://svnweb.mageia.org/packages/cauldron/curl/current/SPECS/curl.spec?view=markup +- curl issues: https://bugs.mageia.org/buglist.cgi?bug_status=NEW&bug_status=UNCONFIRMED&bug_status=NEEDINFO&bug_status=UPSTREAM&bug_status=ASSIGNED&component=RPM%20Packages&f1=cf_rpmpkg&list_id=176576&o1=casesubstring&product=Mageia&query_format=advanced&v1=curl +- curl patches: https://svnweb.mageia.org/packages/cauldron/curl/current/SOURCES/ +- curl patches in stable distro releases: https://svnweb.mageia.org/packages/updates//curl/current/SOURCES/ +- curl security: https://advisories.mageia.org/src_curl.html + +## MSYS2 + +*Rolling Release* + +- curl: https://github.com/msys2/MSYS2-packages/tree/master/curl +- curl issues: https://github.com/msys2/MSYS2-packages/issues +- curl patches: https://github.com/msys2/MSYS2-packages/tree/master/curl (`*.patch`) + +## MSYS2 (mingw-w64) + +*Rolling Release* + +- curl: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-curl +- curl issues: https://github.com/msys2/MINGW-packages/issues +- curl patches: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-curl (`*.patch`) + +## Muldersoft + +*Rolling Release* + +- curl: https://github.com/lordmulder/cURL-build-win32 +- curl issues: https://github.com/lordmulder/cURL-build-win32/issues +- curl patches: https://github.com/lordmulder/cURL-build-win32/tree/master/patch + +## NixOS + +- curl: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/cu/curlMinimal/package.nix +- curl issues: https://github.com/NixOS/nixpkgs + +nixpkgs is the package repository used by the NixOS Linux distribution, but +can also be used on other distributions + +## OmniOS + +- curl: https://github.com/omniosorg/omnios-build/tree/master/build/curl +- curl issues: https://github.com/omniosorg/omnios-build/issues +- curl patches: https://github.com/omniosorg/omnios-build/tree/master/build/curl/patches + +## OpenIndiana + +- curl: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/web/curl +- curl issues: https://www.illumos.org/projects/openindiana/issues +- curl patches: https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/web/curl/patches + +## OpenSUSE + +- curl source and patches: https://build.opensuse.org/package/show/openSUSE%3AFactory/curl + +## Oracle Solaris + +- curl: https://github.com/oracle/solaris-userland/tree/master/components/curl +- curl issues: https://support.oracle.com/ (requires support contract) +- curl patches: https://github.com/oracle/solaris-userland/tree/master/components/curl/patches + +## OpenEmbedded / Yocto Project + +*Rolling Release* + +- curl: https://layers.openembedded.org/layerindex/recipe/5765/ +- curl issues: https://bugzilla.yoctoproject.org/ +- curl patches: https://git.openembedded.org/openembedded-core/tree/meta/recipes-support/curl + +## PLD Linux + +- curl package source and patches: https://github.com/pld-linux/curl +- curl issues: https://bugs.launchpad.net/pld-linux?field.searchtext=curl&search=Search&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field.assignee=&field.bug_reporter=&field.omit_dupes=on&field.has_patch=&field.has_no_package= + +## pkgsrc + +- curl: https://github.com/NetBSD/pkgsrc/tree/trunk/www/curl +- curl issues: https://github.com/NetBSD/pkgsrc/issues +- curl patches: https://github.com/NetBSD/pkgsrc/tree/trunk/www/curl/patches + +## Red Hat Enterprise Linux / CentOS Stream + +- curl: https://kojihub.stream.centos.org/koji/packageinfo?packageID=217 +- curl issues: https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12332745&issuetype=1&components=12377466&priority=10300 +- curl patches: https://gitlab.com/redhat/centos-stream/rpms/curl + +## Rocky Linux + +- curl: https://git.rockylinux.org/staging/rpms/curl/-/blob/r9/SPECS/curl.spec +- curl issues: https://bugs.rockylinux.org +- curl patches: https://git.rockylinux.org/staging/rpms/curl/-/tree/r9/SOURCES + +## SerenityOS + +- curl: https://github.com/SerenityOS/serenity/tree/master/Ports/curl +- curl issues: https://github.com/SerenityOS/serenity/issues?q=label%3Aports +- curl patches: https://github.com/SerenityOS/serenity/tree/master/Ports/curl/patches + +## SmartOS + +- curl: https://github.com/TritonDataCenter/illumos-extra/tree/master/curl +- curl issues: https://github.com/TritonDataCenter/illumos-extra/issues +- curl patches: https://github.com/TritonDataCenter/illumos-extra/tree/master/curl/Patches + +## SPACK + +- curl package source and patches: https://github.com/spack/spack/tree/develop/var/spack/repos/builtin/packages/curl + +## vcpkg + +*Rolling Release* + +- curl: https://github.com/microsoft/vcpkg/tree/master/ports/curl +- curl issues: https://github.com/microsoft/vcpkg/issues +- curl patches: https://github.com/microsoft/vcpkg/tree/master/ports/curl (`*.patch`) + +## Void Linux + +*Rolling Release* + +- curl: https://github.com/void-linux/void-packages/tree/master/srcpkgs/curl +- curl issues: https://github.com/void-linux/void-packages/issues +- curl patches: https://github.com/void-linux/void-packages/tree/master/srcpkgs/curl/patches + +## Wolfi + +*Rolling Release* + +- curl: https://github.com/wolfi-dev/os/blob/main/curl.yaml diff --git a/curl/docs/EARLY-RELEASE.md b/curl/docs/EARLY-RELEASE.md new file mode 100644 index 000000000..e66dbbd44 --- /dev/null +++ b/curl/docs/EARLY-RELEASE.md @@ -0,0 +1,73 @@ + + +# How to determine if an early patch release is warranted + +In the curl project we do releases every 8 weeks. Unless we break the cycle +and do an early patch release. + +We do frequent releases partly to always have the next release "not too far +away". + +## Bugfix + +During the release cycle, and especially in the beginning of a new cycle (the +so-called "cool down" period), there are times when a bug is reported and +after it has been subsequently fixed correctly, the question might be asked: +is this bug and associated fix important enough for an early patch release? + +The question can only be properly asked when a fix has been created and landed +in the git master branch. + +## Early release + +An early patch release means that we ship a new, complete and full release +called `major.minor.patch` where the `patch` part is increased by one since +the previous release. A curl release is a curl release. There is no small or +big and we never release just a patch. There is only "release". + +## Questions to ask + + - Is there a security advisory rated high or critical? + - Is there a data corruption bug? + - Did the bug cause an API/ABI breakage? + - Does the problem annoy a significant share of the user population? + +If the answer is yes to one or more of the above, an early release might be +warranted. + +More questions to ask ourselves when doing the assessment if the answers to +the three ones above are all 'no'. + + - Does the bug cause curl to prematurely terminate? + - How common is the affected buggy option/feature/protocol/platform to get + used? + - How large is the estimated impacted user base? + - Does the bug block something crucial for applications or other adoption of + curl "out there" ? + - Does the bug cause problems for curl developers or others on "the curl + team" ? + - Is the bug limited to the curl tool only? That might have a smaller impact + than a bug also present in libcurl. + - Is there a (decent) workaround? + - Is it a regression? Is the bug introduced in this release? + - Can the bug be fixed "easily" by applying a patch? + - Does the bug break the build? Most users do not build curl themselves. + - How long is it until the already scheduled next release? + - Can affected users safely rather revert to a former release until the next + scheduled release? + - Is it a performance regression with no functionality side-effects? If so it + has to be substantial. + +## If an early release is deemed necessary + +Unless done for security or similarly important reasons, an early release +should not be done within a week of the previous release. + +This, to enable us to collect and bundle more fixes into the same release to +make the release more worthwhile for everyone and to allow more time for fixes +to settle and things to get tested. Getting a release in shape and done in +style is work that should not be rushed. diff --git a/curl/docs/ECH.md b/curl/docs/ECH.md new file mode 100644 index 000000000..969bbfa27 --- /dev/null +++ b/curl/docs/ECH.md @@ -0,0 +1,496 @@ + + +# Building curl with HTTPS-RR and ECH support + +We have added support for ECH to curl. It can use HTTPS RRs published in the +DNS if curl uses DoH, or else can accept the relevant ECHConfigList values +from the command line. This works with OpenSSL, wolfSSL, BoringSSL, AWS-LC +or rustls-ffi as the TLS provider. + +This feature is EXPERIMENTAL. DO NOT USE IN PRODUCTION. + +This should however provide enough of a proof-of-concept to prompt an informed +discussion about a good path forward for ECH support in curl. + +## OpenSSL Build + +To build the OpenSSL project's ECH feature branch: + +```bash + cd $HOME/code + git clone https://github.com/openssl/openssl + cd openssl + git checkout feature/ech + ./config --libdir=lib --prefix=$HOME/code/openssl-local-inst + ...stuff... + make -j8 + ...more stuff... + make install_sw + ...a little bit of stuff... +``` + +To build curl ECH-enabled, making use of the above: + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + autoreconf -fi + LDFLAGS="-Wl,-rpath,$HOME/code/openssl-local-inst/lib/" ./configure --with-ssl=$HOME/code/openssl-local-inst --enable-ech + ...lots of output... + WARNING: ECH HTTPSRR enabled but marked EXPERIMENTAL... + make + ...lots more output... +``` + +If you do not get that WARNING at the end of the ``configure`` command, then +ECH is not enabled, so go back some steps and re-do whatever needs re-doing:-) +If you want to debug curl then you should add ``--enable-debug`` to the +``configure`` command. + +In a recent (2024-05-20) build on one machine, configure failed to find the +ECH-enabled SSL library, apparently due to the existence of +``$HOME/code/openssl-local-inst/lib/pkgconfig`` as a directory containing +various settings. Deleting that directory worked around the problem but may +not be the best solution. + +## Using ECH and DoH + +curl supports using DoH for A/AAAA lookups so it was relatively easy to add +retrieval of HTTPS RRs in that situation. To use ECH and DoH together: + +```bash + cd $HOME/code/curl + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl --ech true --doh-url https://one.one.one.one/dns-query https://defo.ie/ech-check.php + ... + SSL_ECH_STATUS: success good
+ ... +``` + +The output snippet above is within the HTML for the webpage, when things work. + +The above works for these test sites: + +```bash + https://defo.ie/ech-check.php + https://draft-13.esni.defo.ie:8413/stats + https://draft-13.esni.defo.ie:8414/stats + https://crypto.cloudflare.com/cdn-cgi/trace + https://tls-ech.dev +``` + +The list above has 4 different server technologies, implemented by 3 different +parties, and includes a case (the port 8414 server) where HelloRetryRequest +(HRR) is forced. + +We currently support the following new curl command line arguments/options: + +- ``--ech `` - the ``config`` value can be one of: + - ``false`` says to not attempt ECH + - ``true`` says to attempt ECH, if possible + - ``grease`` if attempting ECH is not possible, then send a GREASE ECH extension + - ``hard`` hard-fail the connection if ECH cannot be attempted + - ``ecl:`` a base64 encoded ECHConfigList, rather than one accessed from the DNS + - ``pn:`` override the ``public_name`` from an ECHConfigList + +Note that in the above "attempt ECH" means the client emitting a TLS +ClientHello with a "real" ECH extension, but that does not mean that the +relevant server can succeed in decrypting, as things can fail for other +reasons. + +## Supplying an ECHConfigList on the command line + +To supply the ECHConfigList on the command line, you might need a bit of +cut-and-paste, e.g.: + +```bash + dig +short https defo.ie + 1 . ipv4hint=213.108.108.101 ech=AED+DQA8PAAgACD8WhlS7VwEt5bf3lekhHvXrQBGDrZh03n/LsNtAodbUAAEAAEAAQANY292ZXIuZGVmby5pZQAA ipv6hint=2a00:c6c0:0:116:5::10 +``` + +Then paste the base64 encoded ECHConfigList onto the curl command line: + +```bash + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl --ech ecl:AED+DQA8PAAgACD8WhlS7VwEt5bf3lekhHvXrQBGDrZh03n/LsNtAodbUAAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php + ... + SSL_ECH_STATUS: success good
+ ... +``` + +The output snippet above is within the HTML for the webpage. + +If you paste in the wrong ECHConfigList (it changes hourly for ``defo.ie``) you +should get an error like this: + +```bash + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl -vvv --ech ecl:AED+DQA8yAAgACDRMQo+qYNsNRNj+vfuQfFIkrrUFmM4vogucxKj/4nzYgAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php + ... + * OpenSSL/3.3.0: error:0A00054B:SSL routines::ech required + ... +``` + +There is a reason to want this command line option - for use before publishing +an ECHConfigList in the DNS as per the Internet-draft [A well-known URI for +publishing ECHConfigList values](https://datatracker.ietf.org/doc/draft-ietf-tls-wkech/). + +If you do use a wrong ECHConfigList value, then the server might return a +good value, via the ``retry_configs`` mechanism. You can see that value in +the verbose output, e.g.: + +```bash + LD_LIBRARY_PATH=$HOME/code/openssl ./src/curl -vvv --ech ecl:AED+DQA8yAAgACDRMQo+qYNsNRNj+vfuQfFIkrrUFmM4vogucxKj/4nzYgAEAAEAAQANY292ZXIuZGVmby5pZQAA https://defo.ie/ech-check.php + ... +* ECH: retry_configs AQD+DQA8DAAgACBvYqJy+Hgk33wh/ZLBzKSPgwxeop7gvojQzfASq7zeZQAEAAEAAQANY292ZXIuZGVmby5pZQAA/g0APEMAIAAgXkT5r4cYs8z19q5rdittyIX8gfQ3ENW4wj1fVoiJZBoABAABAAEADWNvdmVyLmRlZm8uaWUAAP4NADw2ACAAINXSE9EdXzEQIJZA7vpwCIQsWqsFohZARXChgPsnfI1kAAQAAQABAA1jb3Zlci5kZWZvLmllAAD+DQA8cQAgACASeiD5F+UoSnVoHvA2l1EifUVMFtbVZ76xwDqmMPraHQAEAAEAAQANY292ZXIuZGVmby5pZQAA +* ECH: retry_configs for defo.ie from cover.defo.ie, 319 + ... +``` + +At that point, you could copy the base64 encoded value above and try again. +For now, this only works for the OpenSSL and BoringSSL/AWS-LC builds. + +## Default settings + +curl has various ways to configure default settings, e.g. in ``$HOME/.curlrc``, +so one can set the DoH URL and enable ECH that way: + +```bash + cat ~/.curlrc + doh-url=https://one.one.one.one/dns-query + silent + ech=true +``` + +Note that when you use the system's curl command (rather than our ECH-enabled +build), it is liable to warn that ``ech`` is an unknown option. If that is an +issue (e.g. if some script re-directs stdout and stderr somewhere) then adding +the ``silent`` line above seems to be a good enough fix. (Though of +course, yet another script could depend on non-silent behavior, so you may have +to figure out what you prefer yourself.) That seems to have changed with the +latest build, previously ``silent=TRUE`` was what I used in ``~/.curlrc`` but +now that seems to cause a problem, so that the following line(s) are ignored. + +If you want to always use our OpenSSL build you can set ``LD_LIBRARY_PATH`` +in the environment: + +```bash + export LD_LIBRARY_PATH=$HOME/code/openssl +``` + +When you do the above, there can be a mismatch between OpenSSL versions +for applications that check that. A ``git push`` for example fails so you +should unset ``LD_LIBRARY_PATH`` before doing that or use a different shell. + +```bash + git push + OpenSSL version mismatch. Built against 30000080, you have 30200000 + ... +``` + +With all that setup as above the command line gets simpler: + +```bash + ./src/curl https://defo.ie/ech-check.php + ... + SSL_ECH_STATUS: success good
+ ... +``` + +The ``--ech true`` option is opportunistic, so tries to do ECH but does not fail if +the client for example cannot find any ECHConfig values. The ``--ech hard`` +option hard-fails if there is no ECHConfig found in DNS, so for now, that is not +a good option to set as a default. Once ECH has really been attempted by +the client, if decryption on the server side fails, then curl fails. + +## Code changes for ECH support when using DoH + +Code changes are ``#ifdef`` protected via ``USE_ECH`` or ``USE_HTTPSRR``: + +- ``USE_HTTPSRR`` is used for HTTPS RR retrieval code that could be generically + used should non-ECH uses for HTTPS RRs be identified, e.g. use of ALPN values + or IP address hints. + +- ``USE_ECH`` protects ECH specific code. + +There are various obvious code blocks for handling the new command line +arguments which are not described here, but should be fairly clear. + +As shown in the ``configure`` usage above, there are ``configure.ac`` changes +that allow separately dis/enabling ``USE_HTTPSRR`` and ``USE_ECH``. If ``USE_ECH`` +is enabled, then ``USE_HTTPSRR`` is forced. In both cases ``CURL_DISABLE_DOH`` +must not be enabled. (There may be some configuration conflicts available for the +determined :-) + +The main functional change, as you would expect, is in ``lib/vtls/openssl.c`` +where an ECHConfig, if available from command line or DNS cache, is fed into +the OpenSSL library via the new APIs implemented in our OpenSSL fork for that +purpose. This code also implements the opportunistic (``--ech true``) or hard-fail +(``--ech hard``) logic. + +Other than that, the main additions are in ``lib/doh.c`` +where we reuse ``dohprobe()`` to retrieve an HTTPS RR value for the target +domain. If such a value is found, that is stored using a new ``doh_store_https()`` +function in a new field in the ``dohentry`` structure. + +The qname for the DoH query is modified if the port number is not 443, as +defined in the SVCB specification. + +When the DoH process has worked, ``Curl_doh_is_resolved()`` now also returns +the relevant HTTPS RR value data in the ``Curl_dns_entry`` structure. +That is later accessed when the TLS session is being established, if ECH is +enabled (from ``lib/vtls/openssl.c`` as described above). + +## Limitations + +Things that need fixing, but that can probably be ignored for the +moment: + +- We could easily add code to make use of an ``alpn=`` value found in an HTTPS + RR, passing that on to OpenSSL for use as the "inner" ALPN value, but have +yet to do that. + +Current limitations (more interesting than the above): + +- Only the first HTTPS RR value retrieved is actually processed as described + above, that could be extended in future, though picking the "right" HTTPS RR +could be non-trivial if multiple RRs are published - matching IP address hints +versus A/AAAA values might be a good basis for that. Last I checked though, +browsers supporting ECH did not handle multiple HTTPS RRs well, though that +needs re-checking as it has been a while. + +- It is unclear how one should handle any IP address hints found in an HTTPS RR. + It may be that a bit of consideration of how "multi-CDN" deployments might +emerge would provide good answers there, but for now, it is not clear how best +curl might handle those values when present in the DNS. + +- The SVCB/HTTPS RR specification supports a new "CNAME at apex" indirection + ("aliasMode") - the current code takes no account of that at all. One could +envisage implementing the equivalent of following CNAMEs in such cases, but +it is not clear if that'd be a good plan. (As of now, chrome browsers do not seem +to have any support for that "aliasMode" and we have not checked Firefox for that +recently.) + +- We have not investigated what related changes or additions might be needed + for applications using libcurl, as opposed to use of curl as a command line +tool. + +- We have not yet implemented tests as part of the usual curl test harness as +doing so would seem to require re-implementing an ECH-enabled server as part +of the curl test harness. For now, we have a ``./tests/ech_test.sh`` script +that attempts ECH with various test servers and with many combinations of the +allowed command line options. While that is a useful test and has find issues, +it is not comprehensive and we are not (as yet) sure what would be the right +level of coverage. When running that script you should not have a +``$HOME/.curlrc`` file that affects ECH or some of the negative tests could +produce spurious failures. + +## Building with cmake + +To build with cmake, assuming our ECH-enabled OpenSSL is as before: + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + mkdir build + cd build + cmake -DOPENSSL_ROOT_DIR=$HOME/code/openssl -DUSE_ECH=1 .. + ... + make + ... + [100%] Built target curl +``` + +The binary produced by the cmake build does not need any ECH-specific +``LD_LIBRARY_PATH`` setting. + +## BoringSSL build + +BoringSSL is also supported by curl and also supports ECH, so to build +with that, instead of our ECH-enabled OpenSSL: + +```bash + cd $HOME/code + git clone https://boringssl.googlesource.com/boringssl + cd boringssl + cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/code/boringssl/inst -DBUILD_SHARED_LIBS=1 + make + ... + make install +``` + +Then: + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + autoreconf -fi + LDFLAGS="-Wl,-rpath,$HOME/code/boringssl/inst/lib" ./configure --with-ssl=$HOME/code/boringssl/inst --enable-ech + ...lots of output... + WARNING: ECH HTTPSRR enabled but marked EXPERIMENTAL. Use with caution. + make +``` + +The BoringSSL/AWS-LC APIs are fairly similar to those in our ECH-enabled +OpenSSL fork, so code changes are also in ``lib/vtls/openssl.c``, protected +via ``#ifdef OPENSSL_IS_BORINGSSL`` and are mostly obvious API variations. + +The BoringSSL/AWS-LC APIs however do not support the ``--ech pn:`` command +line variant as of now. + +## wolfSSL build + +wolfSSL also supports ECH and can be used by curl, so here's how: + +```bash + cd $HOME/code + git clone https://github.com/wolfSSL/wolfssl + cd wolfssl + ./autogen.sh + ./configure --prefix=$HOME/code/wolfssl/inst --enable-ech --enable-debug --enable-opensslextra + make + make install +``` + +The install prefix (``inst``) in the above causes wolfSSL to be installed there +and we seem to need that for the curl configure command to work out. The +``--enable-opensslextra`` turns out (after much faffing about;-) to be +important or else we get build problems with curl below. + +```bash + cd $HOME/code + git clone https://github.com/curl/curl + cd curl + autoreconf -fi + ./configure --with-wolfssl=$HOME/code/wolfssl/inst --enable-ech + make +``` + +There are some known issues with the ECH implementation in wolfSSL: + +- The main issue is that the client currently handles HelloRetryRequest + incorrectly. [HRR issue](https://github.com/wolfSSL/wolfssl/issues/6802).) + The HRR issue means that the client does not work for + [this ECH test web site](https://tls-ech.dev) and any other similarly configured + sites. +- There is also an issue related to so-called middlebox compatibility mode. + [middlebox compatibility issue](https://github.com/wolfSSL/wolfssl/issues/6774) + +### Code changes to support wolfSSL + +There are what seem like oddball differences: + +- The DoH URL in``$HOME/.curlrc`` can use `1.1.1.1` for OpenSSL but has to be + `one.one.one.one` for wolfSSL. The latter works for both, so OK, we us that. +- There seems to be some difference in CA databases too - the wolfSSL version + does not like ``defo.ie``, whereas the system and OpenSSL ones do. We can + ignore that for our purposes via ``--insecure``/``-k`` but would need to fix + for a real setup. (Browsers do like those certificates though.) + +Then there are some functional code changes: + +- tweak to ``configure.ac`` to check if wolfSSL has ECH or not +- added code to ``lib/vtls/wolfssl.c`` mirroring what's done in the + OpenSSL equivalent above. +- wolfSSL does not support ``--ech false`` or the ``--ech pn:`` command line + argument. + +The lack of support for ``--ech false`` is because wolfSSL has decided to +always at least GREASE if built to support ECH. In other words, GREASE is +a compile time choice for wolfSSL, but a runtime choice for OpenSSL or +BoringSSL/AWS-LC. (Both are reasonable.) + +## Additional notes + +### Supporting ECH without DoH + +All of the above only applies if DoH is being used. There should be a use-case +for ECH when DoH is not used by curl - if a system stub resolver supports DoT +or DoH, then, considering only ECH and the network threat model, it would make +sense for curl to support ECH without curl itself using DoH. The author for +example uses a combination of stubby+unbound as the system resolver listening +on localhost:53, so would fit this use-case. That said, it is unclear if +this is a niche that is worth trying to address. (The author is just as happy to +let curl use DoH to talk to the same public recursive that stubby might use:-) + +Assuming for the moment this is a use-case we would like to support, then if +DoH is not being used by curl, it is not clear at this time how to provide +support for ECH. One option would seem to be to extend the ``c-ares`` library +to support HTTPS RRs, but in that case it is not now clear whether such +changes would be attractive to the ``c-ares`` maintainers, nor whether the +"tag=value" extensibility inherent in the HTTPS/SVCB specification is a good +match for the ``c-ares`` approach of defining structures specific to decoded +answers for each supported RRtype. We are also not sure how many downstream +curl deployments actually make use of the ``c-ares`` library, which would +affect the utility of such changes. Another option might be to consider using +some other generic DNS library that does support HTTPS RRs, but it is unclear +if such a library could or would be used by all or almost all curl builds and +downstream releases of curl. + +Our current conclusion is that doing the above is likely best left until we +have some experience with the "using DoH" approach, so we are going to punt on +this for now. + +### Debugging + +Just a note to self as remembering this is a nuisance: + +```bash +LD_LIBRARY_PATH=$HOME/code/openssl:./lib/.libs gdb ./src/.libs/curl +``` + +### Localhost testing + +It can be useful to be able to run against a localhost OpenSSL ``s_server`` +for testing. We have published instructions for such +[localhost tests](https://github.com/defo-project/ech-dev-utils/blob/main/howtos/localhost-tests.md) +in another repository. Once you have that set up, you can start a server +and then run curl against that: + +```bash + cd $HOME/code/ech-dev-utils + ./scripts/echsvr.sh -d + ... +``` + +The ``echsvr.sh`` script supports many ECH-related options. Use ``echsvr.sh -h`` +for details. + +In another window: + +```bash + cd $HOME/code/curl/ + ./src/curl -vvv --insecure --connect-to foo.example.com:8443:localhost:8443 --ech ecl:AD7+DQA6uwAgACBix2B78sX+EQhEbxMspDOc8Z3xVS5aQpYP0Cxpc2AWPAAEAAEAAQALZXhhbXBsZS5jb20AAA== +``` + +### Automated use of ``retry_configs`` not supported so far... + +As of now we have not added support for using ``retry_config`` handling in the +application - for a command line tool, one can just use ``dig`` (or ``kdig``) +to get the HTTPS RR and pass the ECHConfigList from that on the command line, +if needed, or one can access the value from command line output in verbose more +and then reuse that in another invocation. + +Both our OpenSSL fork and BoringSSL/AWS-LC have APIs for both controlling GREASE +and accessing and logging ``retry_configs``, it seems wolfSSL has neither. + +### Testing ECH + +We have yet to add a robust test setup for ECH as that requires an ECH-enabled +test server. + +We have added two basic tests though, aiming to ensure that the client sends a +GREASE or real ECH extension when requested, and reacts correctly to the +failure of ECH in the latter case. (Given that `stunnel` has no ECH support.) + +As with other similar tests, those tests require the `stunnel` tool be +installed. On Ubuntu `sudo apt install stunnel4` achieves that. + +The test cases are: + +- data/test4000: GREASE ECH, expected result: connection succeeds +- data/test4001: real ECH, connection fails with error 101 (ECH required) diff --git a/curl/docs/EXPERIMENTAL.md b/curl/docs/EXPERIMENTAL.md new file mode 100644 index 000000000..43fc0fdee --- /dev/null +++ b/curl/docs/EXPERIMENTAL.md @@ -0,0 +1,90 @@ + + +# Experimental + +Some features and functionality in curl and libcurl are considered +**EXPERIMENTAL**. + +Experimental support in curl means: + +1. Experimental features are provided to allow users to try them out and + provide feedback on functionality and API etc before they ship and get + "carved in stone". +2. You must enable the feature when invoking configure as otherwise curl is + not built with the feature present. +3. We strongly advise against using this feature in production. +4. **We reserve the right to change behavior** of the feature without sticking + to our API/ABI rules as we do for regular features, as long as it is marked + experimental. +5. Experimental features are clearly marked so in documentation. Beware. + +## Graduation + +1. Each experimental feature should have a set of documented requirements of + what is needed for that feature to graduate. Graduation means being removed + from the list of experiments. +2. An experiment should NOT graduate if it needs test cases to be disabled, + unless they are for minor features that are clearly documented as not + provided by the experiment and then the disabling should be managed inside + each affected test case. + +## Experimental features right now + +### HTTP/3 support (non-ngtcp2 backends) + +Graduation requirements: + +- The used libraries should be considered out-of-beta with a reasonable + expectation of a stable API going forward. + +- Using HTTP/3 with the given build should perform without risking busy-loops + +### The Rustls backend + +Graduation requirements: + +- a reasonable expectation of a stable API going forward. + +## ECH + +Use of the HTTPS resource record and Encrypted Client Hello (ECH) when using +DoH + +Graduation requirements: + +- ECH support exists in at least one widely used TLS library apart from + BoringSSL and wolfSSL. + +- feedback from users saying that ECH works for their use cases + +- it has been given time to mature, so no earlier than April 2025 (twelve + months after being added here) + +## SSL session import/export + +Import/Export of SSL sessions tickets in libcurl and curl command line +option '--ssl-session ' for faster TLS handshakes and use +of TLSv1.3/QUIC Early Data (0-RTT). + +Graduation requirements: + +- the implementation is considered safe + +- feedback from users saying that session export works for their use cases + +## HTTPS RR + +HTTPS records support is a requirement for ECH but is provided as a +stand-alone feature that is itself considered EXPERIMENTAL. + +Graduation requirements: + +- HTTPS records work for DoH, c-ares and the threaded resolver + +- HTTPS records can control ALPN and port number, at least + +- There are options to control HTTPS use diff --git a/curl/docs/FAQ b/curl/docs/FAQ index 7ed5fa0ce..63614be17 100644 --- a/curl/docs/FAQ +++ b/curl/docs/FAQ @@ -14,27 +14,25 @@ FAQ 1.5 Who makes curl? 1.6 What do you get for making curl? 1.7 What about CURL from curl.com? - 1.8 I have a problem who do I mail? + 1.8 I have a problem, who do I mail? 1.9 Where do I buy commercial support for curl? 1.10 How many are using curl? - 1.11 Why don't you update ca-bundle.crt - 1.12 I have a problem who can I chat with? + 1.11 Why do you not update ca-bundle.crt + 1.12 I have a problem, who can I chat with? 1.13 curl's ECCN number? 1.14 How do I submit my patch? 1.15 How do I port libcurl to my OS? 2. Install Related Problems - 2.1 configure doesn't find OpenSSL even when it is installed - 2.1.1 native linker doesn't find OpenSSL - 2.1.2 only the libssl lib is missing + 2.1 configure fails when using static libraries 2.2 Does curl work/build with other SSL libraries? - 2.3 Where can I find a copy of LIBEAY32.DLL? + 2.3 How do I upgrade curl.exe in Windows? 2.4 Does curl support SOCKS (RFC 1928) ? 3. Usage Problems 3.1 curl: (1) SSL is disabled, https: not supported 3.2 How do I tell curl to resume a transfer? - 3.3 Why doesn't my posting using -F work? + 3.3 Why does my posting using -F not work? 3.4 How do I tell curl to run custom FTP commands? 3.5 How can I disable the Accept: */* header? 3.6 Does curl support ASP, XML, XHTML or HTML version Y? @@ -43,12 +41,12 @@ FAQ 3.9 How do I use curl in my favorite programming language? 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? 3.11 How do I POST with a different Content-Type? - 3.12 Why do FTP specific features over HTTP proxy fail? - 3.13 Why does my single/double quotes fail? - 3.14 Does curl support Javascript or PAC (automated proxy config)? + 3.12 Why do FTP-specific features over HTTP proxy fail? + 3.13 Why do my single/double quotes fail? + 3.14 Does curl support JavaScript or PAC (automated proxy config)? 3.15 Can I do recursive fetches with curl? 3.16 What certificates do I need when I use SSL? - 3.17 How do I list the root dir of an FTP server? + 3.17 How do I list the root directory of an FTP server? 3.18 Can I use curl to send a POST/PUT and not wait for a response? 3.19 How do I get HTTP from a host using a specific IP address? 3.20 How to SFTP from my user's home directory? @@ -56,11 +54,10 @@ FAQ 3.22 curl -X gives me HTTP problems 4. Running Problems - 4.1 Problems connecting to SSL servers. 4.2 Why do I get problems when I use & or % in the URL? 4.3 How can I use {, }, [ or ] to specify multiple URLs? - 4.4 Why do I get downloaded data even though the web page doesn't exist? - 4.5 Why do I get return code XXX from a HTTP server? + 4.4 Why do I get downloaded data even though the webpage does not exist? + 4.5 Why do I get return code XXX from an HTTP server? 4.5.1 "400 Bad Request" 4.5.2 "401 Unauthorized" 4.5.3 "403 Forbidden" @@ -68,39 +65,38 @@ FAQ 4.5.5 "405 Method Not Allowed" 4.5.6 "301 Moved Permanently" 4.6 Can you tell me what error code 142 means? - 4.7 How do I keep user names and passwords secret in Curl command lines? - 4.8 I found a bug! - 4.9 Curl can't authenticate to the server that requires NTLM? - 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work! - 4.11 Why does my HTTP range requests return the full document? + 4.7 How do I keep usernames and passwords secret in curl command lines? + 4.8 I found a bug + 4.9 curl cannot authenticate to a server that requires NTLM? + 4.10 My HTTP request using HEAD, PUT or DELETE does not work + 4.11 Why do my HTTP range requests return the full document? 4.12 Why do I get "certificate verify failed" ? 4.13 Why is curl -R on Windows one hour off? - 4.14 Redirects work in browser but not with curl! - 4.15 FTPS doesn't work - 4.16 My HTTP POST or PUT requests are slow! + 4.14 Redirects work in browser but not with curl + 4.15 FTPS does not work + 4.16 My HTTP POST or PUT requests are slow 4.17 Non-functional connect timeouts on Windows 4.18 file:// URLs containing drive letters (Windows, NetWare) - 4.19 Why doesn't curl return an error when the network cable is unplugged? - 4.20 curl doesn't return error for HTTP non-200 responses! - 4.21 Why is there a HTTP/1.1 in my HTTP/2 request? + 4.19 Why does not curl return an error when the network cable is unplugged? + 4.20 curl does not return error for HTTP non-200 responses 5. libcurl Issues 5.1 Is libcurl thread-safe? 5.2 How can I receive all data into a large memory chunk? 5.3 How do I fetch multiple files with libcurl? - 5.4 Does libcurl do Winsock initing on win32 systems? - 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ? + 5.4 Does libcurl do Winsock initialization on Win32 systems? + 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on Win32 ? 5.6 What about Keep-Alive or persistent connections? - 5.7 Link errors when building libcurl on Windows! + 5.7 Link errors when building libcurl on Windows 5.8 libcurl.so.X: open failed: No such file or directory - 5.9 How does libcurl resolve host names? + 5.9 How does libcurl resolve hostnames? 5.10 How do I prevent libcurl from writing the response to stdout? 5.11 How do I make libcurl not receive the whole HTTP response? 5.12 Can I make libcurl fake or hide my real IP address? 5.13 How do I stop an ongoing transfer? 5.14 Using C++ non-static functions for callbacks? 5.15 How do I get an FTP directory listing? - 5.16 I want a different time-out! + 5.16 I want a different time-out 5.17 Can I write a server with libcurl? 5.18 Does libcurl use threads? @@ -119,6 +115,10 @@ FAQ 7.3 Can I perform multiple requests using the same handle? 7.4 Does PHP/CURL have dependencies? + 8. Development + 8.1 Why does curl use C89? + 8.2 Will curl be rewritten? + ============================================================================== 1. Philosophy @@ -127,34 +127,35 @@ FAQ cURL is the name of the project. The name is a play on 'Client for URLs', originally with URL spelled in uppercase to make it obvious it deals with - URLs. The fact it can also be pronounced 'see URL' also helped, it works as + URLs. The fact it can also be read as 'see URL' also helped, it works as an abbreviation for "Client URL Request Library" or why not the recursive - version: "Curl URL Request Library". + version: "curl URL Request Library". The cURL project produces two products: libcurl - A free and easy-to-use client-side URL transfer library, supporting DICT, - FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, - POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. + A client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, + GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, + RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS + and WSS. libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, Kerberos, SPNEGO, HTTP form based upload, proxies, cookies, user+password - authentication, file transfer resume, http proxy tunneling and more! + authentication, file transfer resume, http proxy tunneling and more. libcurl is highly portable, it builds and works identically on numerous platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HP-UX, - IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, BeOS, Mac - OS X, Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS, Symbian, OSF, - Android, Minix, IBM TPF and more... + IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, macOS, + Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS, Symbian, OSF, Android, + Minix, IBM TPF and more... libcurl is free, thread-safe, IPv6 compatible, feature rich, well supported and fast. curl - A command line tool for getting or sending files using URL syntax. + A command line tool for getting or sending data using URL syntax. Since curl uses libcurl, curl supports the same wide range of common Internet protocols that libcurl does. @@ -172,10 +173,10 @@ FAQ 1.2 What is libcurl? - libcurl is a reliable and portable library which provides you with an easy - interface to a range of common Internet protocols. + libcurl is a reliable and portable library for doing Internet data transfers + using one or more of its supported Internet protocols. - You can use libcurl for free in your application, be it open source, + You can use libcurl freely in your application, be it open source, commercial or closed-source. libcurl is most probably the most portable, most powerful and most often @@ -184,25 +185,25 @@ FAQ 1.3 What is curl not? - Curl is not a wget clone. That is a common misconception. Never, during + curl is not a wget clone. That is a common misconception. Never, during curl's development, have we intended curl to replace wget or compete on its - market. Curl is targeted at single-shot file transfers. + market. curl is targeted at single-shot file transfers. - Curl is not a web site mirroring program. If you want to use curl to mirror - something: fine, go ahead and write a script that wraps around curl to make - it reality (like curlmirror.pl does). + curl is not a website mirroring program. If you want to use curl to mirror + something: fine, go ahead and write a script that wraps around curl or use + libcurl to make it reality. - Curl is not an FTP site mirroring program. Sure, get and send FTP with curl + curl is not an FTP site mirroring program. Sure, get and send FTP with curl but if you want systematic and sequential behavior you should write a script (or write a new program that interfaces libcurl) and do it. - Curl is not a PHP tool, even though it works perfectly well when used from + curl is not a PHP tool, even though it works perfectly well when used from or with PHP (when using the PHP/CURL module). - Curl is not a program for a single operating system. Curl exists, compiles, + curl is not a program for a single operating system. curl exists, compiles, builds and runs under a wide range of operating systems, including all - modern Unixes (and a bunch of older ones too), Windows, Amiga, BeOS, OS/2, - OS X, QNX etc. + modern Unixes (and a bunch of older ones too), Windows, Amiga, OS/2, macOS, + QNX etc. 1.4 When will you make curl do XXXX ? @@ -210,23 +211,23 @@ FAQ better. We do however believe in a few rules when it comes to the future of curl: - Curl -- the command line tool -- is to remain a non-graphical command line + curl -- the command line tool -- is to remain a non-graphical command line tool. If you want GUIs or fancy scripting capabilities, you should look for another tool that uses libcurl. We do not add things to curl that other small and available tools already do - very well at the side. Curl's output can be piped into another program or + well at the side. curl's output can be piped into another program or redirected to another file for the next program to interpret. - We focus on protocol related issues and improvements. If you wanna do more - magic with the supported protocols than curl currently does, chances are good - we will agree. If you wanna add more protocols, we may very well agree. + We focus on protocol related issues and improvements. If you want to do more + magic with the supported protocols than curl currently does, chances are + good we will agree. If you want to add more protocols, we may agree. If you want someone else to do all the work while you wait for us to - implement it for you, that is not a very friendly attitude. We spend a + implement it for you, that is not a friendly attitude. We spend a considerable time already on maintaining and developing curl. In order to get more out of us, you should consider trading in some of your time and - effort in return. Simply go to the GitHub repo which resides at + effort in return. Simply go to the GitHub repository which resides at https://github.com/curl/curl, fork the project, and create pull requests with your proposed changes. @@ -246,22 +247,21 @@ FAQ 1.6 What do you get for making curl? - Project cURL is entirely free and open. No person gets paid for developing - curl full time. We do this voluntarily, mostly in our spare time. - Occasionally companies pay individual developers to work on curl, but that's - up to each company and developer. This is not controlled by nor supervised in - any way by the project. + Project cURL is entirely free and open. We do this voluntarily, mostly in + our spare time. Companies may pay individual developers to work on curl. + This is not controlled by nor supervised in any way by the curl project. - We still get help from companies. Haxx provides web site, bandwidth, mailing - lists etc, sourceforge.net hosts project services we take advantage from, - like the bug tracker, and GitHub hosts the primary git repository at - https://github.com/curl/curl. Also again, some companies have sponsored - certain parts of the development in the past and I hope some will continue to - do so in the future. + We get help from companies. Haxx provides website, bandwidth, mailing lists + etc, GitHub hosts the primary git repository and other services like the bug + tracker at https://github.com/curl/curl. Also again, some companies have + sponsored certain parts of the development in the past and I hope some will + continue to do so in the future. If you want to support our project, consider a donation or a banner-program or even better: by helping us with coding, documenting or testing etc. + See also: https://curl.se/sponsors.html + 1.7 What about CURL from curl.com? During the summer of 2001, curl.com was busy advertising their client-side @@ -277,12 +277,12 @@ FAQ We recognize that we will be living in parallel with curl.com and wish them every success. - 1.8 I have a problem whom do I mail? + 1.8 I have a problem, who do I mail? Please do not mail any single individual unless you really need to. Keep curl-related questions on a suitable mailing list. All available mailing lists are listed in the MANUAL document and online at - https://curl.haxx.se/mail/ + https://curl.se/mail/ Keeping curl-related questions and discussions on mailing lists allows others to join in and help, to share their ideas, to contribute their @@ -292,47 +292,44 @@ FAQ from having to repeat ourselves even more. Thanks for respecting this. If you have found or simply suspect a security problem in curl or libcurl, - mail curl-security at haxx.se (closed list of receivers, mails are not - disclosed) and tell. Then we can produce a fix in a timely manner before the - flaw is announced to the world, thus lessen the impact the problem will have - on existing users. + submit all the details at https://hackerone.one/curl. On there we keep the + issue private while we investigate, confirm it, work and validate a fix and + agree on a time schedule for publication etc. That way we produce a fix in a + timely manner before the flaw is announced to the world, reducing the impact + the problem risks having on existing users. + + Security issues can also be taking to the curl security team by emailing + security at curl.se (closed list of receivers, mails are not disclosed). 1.9 Where do I buy commercial support for curl? curl is fully open source. It means you can hire any skilled engineer to fix your curl-related problems. - We list available alternatives on the curl web site: - https://curl.haxx.se/support.html + We list available alternatives on the curl website: + https://curl.se/support.html 1.10 How many are using curl? It is impossible to tell. - We don't know how many users that knowingly have installed and use curl. + We do not know how many users that knowingly have installed and use curl. - We don't know how many users that use curl without knowing that they are in + We do not know how many users that use curl without knowing that they are in fact using it. - We don't know how many users that downloaded or installed curl and then + We do not know how many users that downloaded or installed curl and then never use it. - In May 2012 Daniel did a counting game and came up with a number that may - be completely wrong or somewhat accurate. Over 500 million! - - See https://daniel.haxx.se/blog/2012/05/16/300m-users/ - - 1.11 Why don't you update ca-bundle.crt + In 2020, we estimate that curl runs in roughly ten billion installations + world wide. - The ca cert bundle that used to be shipped with curl was very outdated and - must be replaced with an up-to-date version by anyone who wants to verify - peers. It is no longer provided by curl. The last curl release that ever - shipped a ca cert bundle was curl 7.18.0. + 1.11 Why do you not update ca-bundle.crt - In the cURL project we've decided not to attempt to keep this file updated - (or even present anymore) since deciding what to add to a ca cert bundle is - an undertaking we've not been ready to accept, and the one we can get from - Mozilla is perfectly fine so there's no need to duplicate that work. + In the cURL project we have decided not to attempt to keep this file updated + (or even present) since deciding what to add to a ca cert bundle is an + undertaking we have not been ready to accept, and the one we can get from + Mozilla is perfectly fine so there is no need to duplicate that work. Today, with many services performed over HTTPS, every operating system should come with a default ca cert bundle that can be deemed somewhat @@ -342,13 +339,13 @@ FAQ If you want the most recent collection of ca certs that Mozilla Firefox uses, we recommend that you extract the collection yourself from Mozilla Firefox (by running 'make ca-bundle), or by using our online service setup - for this purpose: https://curl.haxx.se/docs/caextract.html + for this purpose: https://curl.se/docs/caextract.html - 1.12 I have a problem who can I chat with? + 1.12 I have a problem who, can I chat with? - There's a bunch of friendly people hanging out in the #curl channel on the - IRC network irc.freenode.net. If you're polite and nice, chances are good - that you can get -- or provide -- help instantly. + There is a bunch of friendly people hanging out in the #curl channel on the + IRC network libera.chat. If you are polite and nice, chances are good that + you can get -- or provide -- help instantly. 1.13 curl's ECCN number? @@ -370,22 +367,20 @@ FAQ https://www.bis.doc.gov/licensing/do_i_needaneccn.html An incomprehensible description of the two numbers above is here - http://www.access.gpo.gov/bis/ear/pdf/ccl5-pt2.pdf + https://www.bis.doc.gov/index.php/documents/new-encryption/1653-ccl5-pt2-3 1.14 How do I submit my patch? - When you have made a patch or a change of whatever sort, and want to submit - that to the project, there are a few different ways we prefer: + We strongly encourage you to submit changes and improvements directly as + "pull requests" on GitHub: https://github.com/curl/curl/pulls - o send a patch to the curl-library mailing list. We're many subscribers - there and there are lots of people who can review patches, comment on them - and "receive" them properly. + If you for any reason cannot or will not deal with GitHub, send your patch to + the curl-library mailing list. We are many subscribers there and there are + lots of people who can review patches, comment on them and "receive" them + properly. - o if your patch changes or fixes a bug, you can also opt to submit a bug - report in the bug tracker and attach your patch there. There are less - people involved there. - - Lots of more details are found in the CONTRIBUTE and INTERNALS docs. + Lots of more details are found in the CONTRIBUTE.md and INTERNALS.md + documents. 1.15 How do I port libcurl to my OS? @@ -403,108 +398,94 @@ FAQ 2. Install Related Problems - 2.1 configure doesn't find OpenSSL even when it is installed - - This may be because of several reasons. - - 2.1.1 native linker doesn't find openssl - - Affected platforms: - Solaris (native cc compiler) - HPUX (native cc compiler) - SGI IRIX (native cc compiler) - SCO UNIX (native cc compiler) - - When configuring curl, I specify --with-ssl. OpenSSL is installed in - /usr/local/ssl Configure reports SSL in /usr/local/ssl, but fails to find - CRYPTO_lock in -lcrypto + 2.1 configure fails when using static libraries - Cause: The cc for this test places the -L/usr/local/ssl/lib AFTER - -lcrypto, so ld can't find the library. This is due to a bug in the GNU - autoconf tool. + You may find that configure fails to properly detect the entire dependency + chain of libraries when you provide static versions of the libraries that + configure checks for. - Workaround: Specifying "LDFLAGS=-L/usr/local/ssl/lib" in front of - ./configure places the -L/usr/local/ssl/lib early enough in the command - line to make things work + The reason why static libraries is much harder to deal with is that for them + we do not get any help but the script itself must know or check what more + libraries that are needed (with shared libraries, that dependency "chain" is + handled automatically). This is an error-prone process and one that also + tends to vary over time depending on the release versions of the involved + components and may also differ between operating systems. - 2.1.2 only the libssl lib is missing + For that reason, configure does few attempts to actually figure this out and + you are instead encouraged to set LIBS and LDFLAGS accordingly when you + invoke configure, and point out the needed libraries and set the necessary + flags yourself. - If all include files and the libcrypto lib is present, with only the - libssl being missing according to configure, this is most likely because - a few functions are left out from the libssl. + 2.2 Does curl work with other SSL libraries? - If the function names missing include RSA or RSAREF you can be certain - that this is because libssl requires the RSA and RSAREF libs to build. - - See the INSTALL file section that explains how to add those libs to - configure. Make sure that you remove the config.cache file before you - rerun configure with the new flags. - - 2.2 Does curl work/build with other SSL libraries? - - Curl has been written to use a generic SSL function layer internally, and + curl has been written to use a generic SSL function layer internally, and that SSL functionality can then be provided by one out of many different SSL backends. curl can be built to use one of the following SSL alternatives: OpenSSL, - GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X), - WinSSL (native Windows) or GSKit (native IBM i). They all have their pros - and cons, and we try to maintain a comparison of them here: - https://curl.haxx.se/docs/ssl-compared.html + LibreSSL, BoringSSL, AWS-LC, GnuTLS, wolfSSL, mbedTLS, Schannel (native + Windows) or Rustls. They all have their pros and cons, and we try to + maintain a comparison of them here: https://curl.se/docs/ssl-compared.html + + 2.3 How do I upgrade curl.exe in Windows? - 2.3 Where can I find a copy of LIBEAY32.DLL? + The curl tool that is shipped as an integrated component of Windows 10 and + Windows 11 is managed by Microsoft. If you were to delete the file or + replace it with a newer version downloaded from https://curl.se/windows, + then Windows Update will cease to work on your system. - That is an OpenSSL binary built for Windows. + There is no way to independently force an upgrade of the curl.exe that is + part of Windows other than through the regular Windows update process. There + is also nothing the curl project itself can do about this, since this is + managed and controlled entirely by Microsoft as owners of the operating + system. - Curl can be built with OpenSSL to do the SSL stuff. The LIBEAY32.DLL is then - what curl needs on a windows machine to do https:// etc. Check out the curl - web site to find accurate and up-to-date pointers to recent OpenSSL DLLs and - other binary packages. + You can always download and install the latest version of curl for Windows + from https://curl.se/windows into a separate location. 2.4 Does curl support SOCKS (RFC 1928) ? Yes, SOCKS 4 and 5 are supported. - 3. Usage problems 3.1 curl: (1) SSL is disabled, https: not supported - If you get this output when trying to get anything from a https:// server, - it means that the instance of curl/libcurl that you're using was built - without support for this protocol. + If you get this output when trying to get anything from an HTTPS server, it + means that the instance of curl/libcurl that you are using was built without + support for this protocol. - This could've happened if the configure script that was run at build time - couldn't find all libs and include files curl requires for SSL to work. If + This could have happened if the configure script that was run at build time + could not find all libs and include files curl requires for SSL to work. If the configure script fails to find them, curl is simply built without SSL support. - To get the https:// support into a curl that was previously built but that - reports that https:// is not supported, you should dig through the document - and logs and check out why the configure script doesn't find the SSL libs - and/or include files. + To get HTTPS support into a curl that was previously built but that reports + that HTTPS is not supported, you should dig through the document and logs + and check out why the configure script does not find the SSL libs and/or + include files. - Also, check out the other paragraph in this FAQ labelled "configure doesn't + Also, check out the other paragraph in this FAQ labeled "configure does not find OpenSSL even when it is installed". 3.2 How do I tell curl to resume a transfer? - Curl supports resumed transfers both ways on both FTP and HTTP. + curl supports resumed transfers both ways on both FTP and HTTP. Try the -C option. - 3.3 Why doesn't my posting using -F work? + 3.3 Why does my posting using -F not work? - You can't arbitrarily use -F or -d, the choice between -F or -d depends on the - HTTP operation you need curl to do and what the web server that will receive - your post expects. + You cannot arbitrarily use -F or -d, the choice between -F or -d depends on + the HTTP operation you need curl to do and what the web server that will + receive your post expects. - If the form you're trying to submit uses the type 'multipart/form-data', then - and only then you must use the -F type. In all the most common cases, you - should use -d which then causes a posting with the type + If the form you are trying to submit uses the type 'multipart/form-data', + then and only then you must use the -F type. In all the most common cases, + you should use -d which then causes a posting with the type 'application/x-www-form-urlencoded'. This is described in some detail in the MANUAL and TheArtOfHttpScripting - documents, and if you don't understand it the first time, read it again + documents, and if you do not understand it the first time, read it again before you post questions about this to the mailing list. Also, try reading through the mailing list archives for old postings and questions regarding this. @@ -514,7 +495,7 @@ FAQ You can tell curl to perform optional commands both before and/or after a file transfer. Study the -Q/--quote option. - Since curl is used for file transfers, you don't normally use curl to + Since curl is used for file transfers, you do not normally use curl to perform FTP commands without transferring anything. Therefore you must always specify a URL to transfer to/from even when doing custom FTP commands, or use -I which implies the "no body" option sent to libcurl. @@ -527,12 +508,12 @@ FAQ 3.6 Does curl support ASP, XML, XHTML or HTML version Y? - To curl, all contents are alike. It doesn't matter how the page was + To curl, all contents are alike. It does not matter how the page was generated. It may be ASP, PHP, Perl, shell-script, SSI or plain HTML - files. There's no difference to curl and it doesn't even know what kind of + files. There is no difference to curl and it does not even know what kind of language that generated the page. - See also item 3.14 regarding javascript. + See also item 3.14 regarding JavaScript. 3.7 Can I use curl to delete/rename a file through FTP? @@ -540,55 +521,55 @@ FAQ One example would be to delete a file after you have downloaded it: - curl -O ftp://download.com/coolfile -Q '-DELE coolfile' + curl -O ftp://example.com/coolfile -Q '-DELE coolfile' or rename a file after upload: - curl -T infile ftp://upload.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname" + curl -T infile ftp://example.com/dir/ -Q "-RNFR infile" -Q "-RNTO newname" 3.8 How do I tell curl to follow HTTP redirects? - Curl does not follow so-called redirects by default. The Location: header - that informs the client about this is only interpreted if you're using the + curl does not follow so-called redirects by default. The Location: header + that informs the client about this is only interpreted if you are using the -L/--location option. As in: - curl -L http://redirector.com + curl -L http://example.com Not all redirects are HTTP ones, see 4.14 3.9 How do I use curl in my favorite programming language? - There exist many language interfaces/bindings for curl that integrates it - better with various languages. If you are fluid in a script language, you - may very well opt to use such an interface instead of using the command line - tool. + Many programming languages have interfaces/bindings that allow you to use + curl without having to use the command line tool. If you are fluent in such + a language, you may prefer to use one of these interfaces instead. Find out more about which languages that support curl directly, and how to - install and use them, in the libcurl section of the curl web site: - https://curl.haxx.se/libcurl/ + install and use them, in the libcurl section of the curl website: + https://curl.se/libcurl/ All the various bindings to libcurl are made by other projects and people, outside of the cURL project. The cURL project itself only produces libcurl - with its plain C API. If you don't find anywhere else to ask you can ask + with its plain C API. If you do not find anywhere else to ask you can ask about bindings on the curl-library list too, but be prepared that people on that list may not know anything about bindings. - In October 2009, there were interfaces available for the following - languages: Ada95, Basic, C, C++, Ch, Cocoa, D, Dylan, Eiffel, Euphoria, - Ferite, Gambas, glib/GTK+, Haskell, ILE/RPG, Java, Lisp, Lua, Mono, .NET, - Object-Pascal, OCaml, Pascal, Perl, PHP, PostgreSQL, Python, R, Rexx, Ruby, - Scheme, S-Lang, Smalltalk, SP-Forth, SPL, Tcl, Visual Basic, Visual FoxPro, - Q, wxwidgets and XBLite. By the time you read this, additional ones may have - appeared! + In December 2021, there were interfaces available for the following + languages: Ada95, Basic, C, C++, Ch, Cocoa, D, Delphi, Dylan, Eiffel, + Euphoria, Falcon, Ferite, Gambas, glib/GTK+, Go, Guile, Harbour, Haskell, + Java, Julia, Lisp, Lua, Mono, .NET, node.js, Object-Pascal, OCaml, Pascal, + Perl, PHP, PostgreSQL, Python, R, Rexx, Ring, RPG, Ruby, Rust, Scheme, + Scilab, S-Lang, Smalltalk, SP-Forth, SPL, Tcl, Visual Basic, Visual FoxPro, + Q, wxwidgets, XBLite and Xoho. By the time you read this, additional ones + may have appeared. 3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP? - Curl adheres to the HTTP spec, which basically means you can play with *any* - protocol that is built on top of HTTP. Protocols such as SOAP, WEBDAV and + curl adheres to the HTTP spec, which basically means you can play with *any* + protocol that is built on top of HTTP. Protocols such as SOAP, WebDAV and XML-RPC are all such ones. You can use -X to set custom requests and -H to set custom headers (or replace internally generated ones). - Using libcurl is of course just as good and you'd just use the proper + Using libcurl is of course just as good and you would just use the proper library options to do the same. 3.11 How do I POST with a different Content-Type? @@ -598,11 +579,11 @@ FAQ curl -d "datatopost" -H "Content-Type: text/xml" [URL] - 3.12 Why do FTP specific features over HTTP proxy fail? + 3.12 Why do FTP-specific features over HTTP proxy fail? - Because when you use a HTTP proxy, the protocol spoken on the network will - be HTTP, even if you specify a FTP URL. This effectively means that you - normally can't use FTP specific features such as FTP upload and FTP quote + Because when you use an HTTP proxy, the protocol spoken on the network will + be HTTP, even if you specify an FTP URL. This effectively means that you + normally cannot use FTP-specific features such as FTP upload and FTP quote etc. There is one exception to this rule, and that is if you can "tunnel through" @@ -610,21 +591,28 @@ FAQ and is generally not available as proxy admins usually disable tunneling to ports other than 443 (which is used for HTTPS access through proxies). - 3.13 Why does my single/double quotes fail? + 3.13 Why do my single/double quotes fail? To specify a command line option that includes spaces, you might need to put the entire option within quotes. Like in: - curl -d " with spaces " url.com + curl -d " with spaces " example.com or perhaps - curl -d ' with spaces ' url.com + curl -d ' with spaces ' example.com Exactly what kind of quotes and how to do this is entirely up to the shell - or command line interpreter that you are using. For most unix shells, you + or command line interpreter that you are using. For most Unix shells, you can more or less pick either single (') or double (") quotes. For - Windows/DOS prompts I believe you're forced to use double (") quotes. + Windows/DOS command prompts you must use double (") quotes, and if the + option string contains inner double quotes you can escape them with a + backslash. + + For Windows powershell the arguments are not always passed on as expected + because curl is not a powershell script. You may or may not be able to use + single quotes. To escape inner double quotes seems to require a + backslash-backtick escape sequence and the outer quotes as double quotes. Please study the documentation for your particular environment. Examples in the curl docs will use a mix of both of these as shown above. You must @@ -633,27 +621,27 @@ FAQ Remember that curl works and runs on more operating systems than most single individuals have ever tried. - 3.14 Does curl support Javascript or PAC (automated proxy config)? + 3.14 Does curl support JavaScript or PAC (automated proxy config)? - Many web pages do magic stuff using embedded Javascript. Curl and libcurl + Many webpages do magic stuff using embedded JavaScript. curl and libcurl have no built-in support for that, so it will be treated just like any other contents. - .pac files are a netscape invention and are sometimes used by organizations + .pac files are a Netscape invention and are sometimes used by organizations to allow them to differentiate which proxies to use. The .pac contents is - just a Javascript program that gets invoked by the browser and that returns - the name of the proxy to connect to. Since curl doesn't support Javascript, - it can't support .pac proxy configuration either. + just a JavaScript program that gets invoked by the browser and that returns + the name of the proxy to connect to. Since curl does not support JavaScript, + it cannot support .pac proxy configuration either. - Some workarounds usually suggested to overcome this Javascript dependency: + Some workarounds usually suggested to overcome this JavaScript dependency: - Depending on the Javascript complexity, write up a script that translates it + Depending on the JavaScript complexity, write up a script that translates it to another language and execute that. - Read the Javascript code and rewrite the same logic in another language. + Read the JavaScript code and rewrite the same logic in another language. - Implement a Javascript interpreter, people have successfully used the - Mozilla Javascript engine in the past. + Implement a JavaScript interpreter, people have successfully used the + Mozilla JavaScript engine in the past. Ask your admins to stop this, for a static proxy setup or similar. @@ -674,8 +662,8 @@ FAQ CLIENT CERTIFICATE The server you communicate with may require that you can provide this in - order to prove that you actually are who you claim to be. If the server - doesn't require this, you don't need a client certificate. + order to prove that you actually are who you claim to be. If the server + does not require this, you do not need a client certificate. A client certificate is always used together with a private key, and the private key has a pass phrase that protects it. @@ -698,33 +686,33 @@ FAQ certificate. Server certificate verification is enabled by default in curl and libcurl and is often the reason for problems as explained in FAQ entry 4.12 and the SSLCERTS document - (https://curl.haxx.se/docs/sslcerts.html). Server certificates that are + (https://curl.se/docs/sslcerts.html). Server certificates that are "self-signed" or otherwise signed by a CA that you do not have a CA cert for, cannot be verified. If the verification during a connect fails, you are refused access. You then need to explicitly disable the verification to connect to the server. - 3.17 How do I list the root dir of an FTP server? + 3.17 How do I list the root directory of an FTP server? There are two ways. The way defined in the RFC is to use an encoded slash - in the first path part. List the "/tmp" dir like this: + in the first path part. List the "/tmp" directory like this: - curl ftp://ftp.sunet.se/%2ftmp/ + curl ftp://ftp.example.com/%2ftmp/ or the not-quite-kosher-but-more-readable way, by simply starting the path section of the URL with a slash: - curl ftp://ftp.sunet.se//tmp/ + curl ftp://ftp.example.com//tmp/ 3.18 Can I use curl to send a POST/PUT and not wait for a response? No. - But you could easily write your own program using libcurl to do such stunts. + You can easily write your own program using libcurl to do such stunts. 3.19 How do I get HTTP from a host using a specific IP address? - For example, you may be trying out a web site installation that isn't yet in + For example, you may be trying out a website installation that is not yet in the DNS. Or you have a site using multiple IP addresses for a given host name and you want to address a specific one out of the set. @@ -733,7 +721,7 @@ FAQ curl --header "Host: www.example.com" http://127.0.0.1/ - You can also opt to add faked host name entries to curl with the --resolve + You can also opt to add faked hostname entries to curl with the --resolve option. That has the added benefit that things like redirects will also work properly. The above operation would instead be done as: @@ -742,11 +730,11 @@ FAQ 3.20 How to SFTP from my user's home directory? Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to - work with. It means that if you don't specify that you want the user's home + work with. It means that if you do not specify that you want the user's home directory, you get the actual root directory. To specify a file in your user's home directory, you need to use the correct - URL syntax which for sftp might look similar to: + URL syntax which for SFTP might look similar to: curl -O -u user:password sftp://example.com/~/file.txt @@ -758,7 +746,7 @@ FAQ When passing on a URL to curl to use, it may respond that the particular protocol is not supported or disabled. The particular way this error message - is phrased is because curl doesn't make a distinction internally of whether + is phrased is because curl does not make a distinction internally of whether a particular protocol is not supported (i.e. never got any code added that knows how to speak that protocol) or if it was explicitly disabled. curl can be built to only support a given set of protocols, and the rest would then @@ -773,22 +761,21 @@ FAQ In normal circumstances, -X should hardly ever be used. By default you use curl without explicitly saying which request method to - use when the URL identifies a HTTP transfer. If you just pass in a URL like + use when the URL identifies an HTTP transfer. If you just pass in a URL like "curl http://example.com" it will use GET. If you use -d or -F curl will use POST, -I will cause a HEAD and -T will make it a PUT. - If for whatever reason you're not happy with these default choices that curl + If for whatever reason you are not happy with these default choices that curl does for you, you can override those request methods by specifying -X [WHATEVER]. This way you can for example send a DELETE by doing "curl -X DELETE [URL]". - It is thus pointless to do "curl -XGET [URL]" as GET would be used - anyway. In the same vein it is pointless to do "curl -X POST -d data - [URL]"... But you can make a fun and somewhat rare request that sends a - request-body in a GET request with something like "curl -X GET -d data - [URL]" + It is thus pointless to do "curl -XGET [URL]" as GET would be used anyway. + In the same vein it is pointless to do "curl -X POST -d data [URL]". You can + make a fun and somewhat rare request that sends a request-body in a GET + request with something like "curl -X GET -d data [URL]" - Note that -X doesn't actually change curl's behavior as it only modifies the + Note that -X does not actually change curl's behavior as it only modifies the actual string sent in the request, but that may of course trigger a different set of events. @@ -799,32 +786,17 @@ FAQ 4. Running Problems - 4.1 Problems connecting to SSL servers. - - It took a very long time before we could sort out why curl had problems to - connect to certain SSL servers when using SSLeay or OpenSSL v0.9+. The - error sometimes showed up similar to: - - 16570:error:1407D071:SSL routines:SSL2_READ:bad mac decode:s2_pkt.c:233: - - It turned out to be because many older SSL servers don't deal with SSLv3 - requests properly. To correct this problem, tell curl to select SSLv2 from - the command line (-2/--sslv2). - - There have also been examples where the remote server didn't like the SSLv2 - request and instead you had to force curl to use SSLv3 with -3/--sslv3. - 4.2 Why do I get problems when I use & or % in the URL? - In general unix shells, the & symbol is treated specially and when used, it + In general Unix shells, the & symbol is treated specially and when used, it runs the specified command in the background. To safely send the & as a part of a URL, you should quote the entire URL by using single (') or double (") quotes around it. Similar problems can also occur on some shells with other - characters, including ?*!$~(){}<>\|;`. When in doubt, quote the URL. + characters, including ?*!$~(){}<>\|;`. When in doubt, quote the URL. An example that would invoke a remote CGI that uses &-symbols could be: - curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl' + curl 'http://www.example.com/cgi-bin/query?text=yes&q=curl' In Windows, the standard DOS shell treats the percent sign specially and you need to use TWO percent signs for each single one you want to use in the @@ -846,21 +818,21 @@ FAQ To be able to use those characters as actual parts of the URL (without using them for the curl URL "globbing" system), use the -g/--globoff option: - curl -g 'www.site.com/weirdname[].html' + curl -g 'www.example.com/weirdname[].html' - 4.4 Why do I get downloaded data even though the web page doesn't exist? + 4.4 Why do I get downloaded data even though the webpage does not exist? - Curl asks remote servers for the page you specify. If the page doesn't exist + curl asks remote servers for the page you specify. If the page does not exist at the server, the HTTP protocol defines how the server should respond and - that means that headers and a "page" will be returned. That's simply how + that means that headers and a "page" will be returned. That is simply how HTTP works. By using the --fail option you can tell curl explicitly to not get any data - if the HTTP return code doesn't say success. + if the HTTP return code does not say success. - 4.5 Why do I get return code XXX from a HTTP server? + 4.5 Why do I get return code XXX from an HTTP server? - RFC2616 clearly explains the return codes. This is a short transcript. Go + RFC 2616 clearly explains the return codes. This is a short transcript. Go read the RFC for exact details: 4.5.1 "400 Bad Request" @@ -874,13 +846,13 @@ FAQ 4.5.3 "403 Forbidden" - The server understood the request, but is refusing to fulfil it. + The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. 4.5.4 "404 Not Found" The server has not found anything matching the Request-URI. No indication - is given of whether the condition is temporary or permanent. + is given as to whether the condition is temporary or permanent. 4.5.5 "405 Method Not Allowed" @@ -895,7 +867,7 @@ FAQ

Moved Permanently

The document has moved
here. - it might be because you request a directory URL but without the trailing + it might be because you requested a directory URL but without the trailing slash. Try the same operation again _with_ the trailing URL, or use the -L/--location option to follow the redirection. @@ -907,18 +879,18 @@ FAQ Error codes that are larger than the highest documented error code means that curl has exited due to a crash. This is a serious error, and we appreciate a detailed bug report from you that describes how we could go - ahead and repeat this! + ahead and repeat this. - 4.7 How do I keep user names and passwords secret in Curl command lines? + 4.7 How do I keep usernames and passwords secret in curl command lines? This problem has two sides: The first part is to avoid having clear-text passwords in the command line - so that they don't appear in 'ps' outputs and similar. That is easily + so that they do not appear in 'ps' outputs and similar. That is easily avoided by using the "-K" option to tell curl to read parameters from a file or stdin to which you can pass the secret info. curl itself will also attempt to "hide" the given password by blanking out the option - this - doesn't work on all platforms. + does not work on all platforms. To keep the passwords in your account secret from the rest of the world is not a task that curl addresses. You could of course encrypt them somehow to @@ -926,32 +898,29 @@ FAQ anyone would call security. Also note that regular HTTP (using Basic authentication) and FTP passwords - are sent in clear across the network. All it takes for anyone to fetch them - is to listen on the network. Eavesdropping is very easy. Use more secure + are sent as cleartext across the network. All it takes for anyone to fetch + them is to listen on the network. Eavesdropping is easy. Use more secure authentication methods (like Digest, Negotiate or even NTLM) or consider the SSL-based alternatives HTTPS and FTPS. - 4.8 I found a bug! + 4.8 I found a bug It is not a bug if the behavior is documented. Read the docs first. - Especially check out the KNOWN_BUGS file, it may be a documented bug! + Especially check out the KNOWN_BUGS file, it may be a documented bug. - If it is a problem with a binary you've downloaded or a package for your + If it is a problem with a binary you have downloaded or a package for your particular platform, try contacting the person who built the package/archive you have. If there is a bug, read the BUGS document first. Then report it as described in there. - 4.9 Curl can't authenticate to the server that requires NTLM? - - NTLM support requires OpenSSL, GnuTLS, mbedTLS, NSS, Secure Transport, or - Microsoft Windows libraries at build-time to provide this functionality. + 4.9 curl cannot authenticate to a server that requires NTLM? - NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You - should not use such ones. + NTLM support requires OpenSSL, GnuTLS, mbedTLS or Microsoft Windows + libraries at build-time to provide this functionality. - 4.10 My HTTP request using HEAD, PUT or DELETE doesn't work! + 4.10 My HTTP request using HEAD, PUT or DELETE does not work Many web servers allow or demand that the administrator configures the server properly for these requests to work on the web server. @@ -959,37 +928,42 @@ FAQ Some servers seem to support HEAD only on certain kinds of URLs. To fully grasp this, try the documentation for the particular server - software you're trying to interact with. This is not anything curl can do + software you are trying to interact with. This is not anything curl can do anything about. - 4.11 Why does my HTTP range requests return the full document? + 4.11 Why do my HTTP range requests return the full document? Because the range may not be supported by the server, or the server may choose to ignore it and return the full document anyway. 4.12 Why do I get "certificate verify failed" ? - You invoke curl 7.10 or later to communicate on a https:// URL and get an - error back looking something similar to this: - - curl: (35) SSL: error:14090086:SSL routines: - SSL3_GET_SERVER_CERTIFICATE:certificate verify failed - - Then it means that curl couldn't verify that the server's certificate was - good. Curl verifies the certificate using the CA cert bundle that comes with - the curl installation. - - To disable the verification (which makes it act like curl did before 7.10), - use -k. This does however enable man-in-the-middle attacks. - - If you get this failure but are having a CA cert bundle installed and used, - the server's certificate is not signed by one of the CA's in the bundle. It - might for example be self-signed. You then correct this problem by obtaining - a valid CA cert for the server. Or again, decrease the security by disabling - this check. - - Details are also in the SSLCERTS file in the release archives, found online - here: https://curl.haxx.se/docs/sslcerts.html + When you invoke curl and get an error 60 error back it means that curl + could not verify that the server's certificate was good. curl verifies the + certificate using the CA cert bundle and verifying for which names the + certificate has been granted. + + To completely disable the certificate verification, use -k. This does + however enable man-in-the-middle attacks and makes the transfer INSECURE. + We strongly advise against doing this for more than experiments. + + If you get this failure with a CA cert bundle installed and used, the + server's certificate might not be signed by one of the CA's in your CA + store. It might for example be self-signed. You then correct this problem by + obtaining a valid CA cert for the server. Or again, decrease the security by + disabling this check. + + At times, you find that the verification works in your favorite browser but + fails in curl. When this happens, the reason is usually that the server + sends an incomplete cert chain. The server is mandated to send all + "intermediate certificates" but does not. This typically works with browsers + anyway since they A) cache such certs and B) supports AIA which downloads + such missing certificates on demand. This is a server misconfiguration. A + good way to figure out if this is the case it to use the SSL Labs server + test and check the certificate chain: https://www.ssllabs.com/ssltest/ + + Details are also in the SSLCERTS.md document, found online here: + https://curl.se/docs/sslcerts.html 4.13 Why is curl -R on Windows one hour off? @@ -998,24 +972,24 @@ FAQ compilers or prior curl versions it may set a time that appears one hour off. This happens due to a flaw in how Windows stores and uses file modification times and it is not easily worked around. For more details read this: - http://www.codeproject.com/datetime/dstbugs.asp + https://www.codeproject.com/Articles/1144/Beating-the-Daylight-Savings-Time-bug-and-getting - 4.14 Redirects work in browser but not with curl! + 4.14 Redirects work in browser but not with curl curl supports HTTP redirects well (see item 3.8). Browsers generally support at least two other ways to perform redirects that curl does not: - Meta tags. You can write a HTML tag that will cause the browser to redirect + Meta tags. You can write an HTML tag that will cause the browser to redirect to another given URL after a certain time. - Javascript. You can write a Javascript program embedded in a HTML page that + JavaScript. You can write a JavaScript program embedded in an HTML page that redirects the browser to another given URL. There is no way to make curl follow these redirects. You must either - manually figure out what the page is set to do, or you write a script that - parses the results and fetches the new URL. + manually figure out what the page is set to do, or write a script that parses + the results and fetches the new URL. - 4.15 FTPS doesn't work + 4.15 FTPS does not work curl supports FTPS (sometimes known as FTP-SSL) both implicit and explicit mode. @@ -1024,21 +998,20 @@ FAQ the control connection and will therefore immediately connect and try to speak SSL. FTPS:// connections default to port 990. - To use explicit FTPS, you use a FTP:// URL and the --ftp-ssl option (or one - of its related flavours). This is the most common method, and the one - mandated by RFC4217. This kind of connection will then of course use the + To use explicit FTPS, you use an FTP:// URL and the --ssl-reqd option (or one + of its related flavors). This is the most common method, and the one + mandated by RFC 4217. This kind of connection will then of course use the standard FTP port 21 by default. - 4.16 My HTTP POST or PUT requests are slow! + 4.16 My HTTP POST or PUT requests are slow - libcurl makes all POST and PUT requests (except for POST requests with a - very tiny request body) use the "Expect: 100-continue" header. This header - allows the server to deny the operation early so that libcurl can bail out - before having to send any data. This is useful in authentication - cases and others. + libcurl makes all POST and PUT requests (except for requests with a small + request body) use the "Expect: 100-continue" header. This header allows the + server to deny the operation early so that libcurl can bail out before having + to send any data. This is useful in authentication cases and others. - However, many servers don't implement the Expect: stuff properly and if the - server doesn't respond (positively) within 1 second libcurl will continue + However, many servers do not implement the Expect: stuff properly and if the + server does not respond (positively) within 1 second libcurl will continue and send off the data anyway. You can disable libcurl's use of the Expect: header the same way you disable @@ -1049,7 +1022,7 @@ FAQ In most Windows setups having a timeout longer than 21 seconds make no difference, as it will only send 3 TCP SYN packets and no more. The second packet sent three seconds after the first and the third six seconds after - the second. No more than three packets are sent, no matter how long the + the second. No more than three packets are sent, no matter how long the timeout is set. See option TcpMaxConnectRetransmissions on this page: @@ -1058,7 +1031,7 @@ FAQ Also, even on non-Windows systems there may run a firewall or anti-virus software or similar that accepts the connection but does not actually do anything else. This will make (lib)curl to consider the connection connected - and thus the connect timeout won't trigger. + and thus the connect timeout will not trigger. 4.18 file:// URLs containing drive letters (Windows, NetWare) @@ -1067,7 +1040,7 @@ FAQ file://D:/blah.txt - You'll find that even if D:\blah.txt does exist, curl returns a 'file + you will find that even if D:\blah.txt does exist, curl returns a 'file not found' error. According to RFC 1738 (https://www.ietf.org/rfc/rfc1738.txt), @@ -1075,7 +1048,7 @@ FAQ most implementations. In the above example, 'D:' is treated as the host component, and is taken away. Thus, curl tries to open '/blah.txt'. If your system is installed to drive C:, that will resolve to 'C:\blah.txt', - and if that doesn't exist you will get the not found error. + and if that does not exist you will get the not found error. To fix this problem, use file:// URLs with *three* leading slashes: @@ -1088,50 +1061,50 @@ FAQ In either case, curl should now be looking for the correct file. - 4.19 Why doesn't curl return an error when the network cable is unplugged? + 4.19 Why does not curl return an error when the network cable is unplugged? Unplugging a cable is not an error situation. The TCP/IP protocol stack was designed to be fault tolerant, so even though there may be a physical - break somewhere the connection shouldn't be affected, just possibly - delayed. Eventually, the physical break will be fixed or the data will be + break somewhere the connection should not be affected, just possibly + delayed. Eventually, the physical break will be fixed or the data will be re-routed around the physical problem through another path. In such cases, the TCP/IP stack is responsible for detecting when the network connection is irrevocably lost. Since with some protocols it is perfectly legal for the client to wait indefinitely for data, the stack may never report a problem, and even when it does, it can take up to 20 minutes - for it to detect an issue. The curl option --keepalive-time enables + for it to detect an issue. The curl option --keepalive-time enables keep-alive support in the TCP/IP stack which makes it periodically probe the connection to make sure it is still available to send data. That should reliably detect any TCP/IP network failure. - But even that won't detect the network going down before the TCP/IP + TCP keep alive will not detect the network going down before the TCP/IP connection is established (e.g. during a DNS lookup) or using protocols that - don't use TCP. To handle those situations, curl offers a number of timeouts + do not use TCP. To handle those situations, curl offers a number of timeouts on its own. --speed-limit/--speed-time will abort if the data transfer rate falls too low, and --connect-timeout and --max-time can be used to put an overall timeout on the connection phase or the entire transfer. A libcurl-using application running in a known physical environment (e.g. an embedded device with only a single network connection) may want to act - immediately if its lone network connection goes down. That can be achieved + immediately if its lone network connection goes down. That can be achieved by having the application monitor the network connection on its own using an - OS-specific mechanism, then signalling libcurl to abort (see also item 5.13). + OS-specific mechanism, then signaling libcurl to abort (see also item 5.13). - 4.20 curl doesn't return error for HTTP non-200 responses! + 4.20 curl does not return error for HTTP non-200 responses Correct. Unless you use -f (--fail). - When doing HTTP transfers, curl will perform exactly what you're asking it + When doing HTTP transfers, curl will perform exactly what you are asking it to do and if successful it will not return an error. You can use curl to test your web server's "file not found" page (that gets 404 back), you can - use it to check your authentication protected web pages (that gets a 401 + use it to check your authentication protected webpages (that gets a 401 back) and so on. The specific HTTP response code does not constitute a problem or error for curl. It simply sends and delivers HTTP as you asked and if that worked, everything is fine and dandy. The response code is generally providing more - higher level error information that curl doesn't care about. The error was + higher level error information that curl does not care about. The error was not in the HTTP transfer. If you want your command line to treat error codes in the 400 and up range @@ -1142,17 +1115,6 @@ FAQ You can also use the -w option and the variable %{response_code} to extract the exact response code that was returned in the response. - 4.21 Why is there a HTTP/1.1 in my HTTP/2 request? - - If you use verbose to see the HTTP request when you send off a HTTP/2 - request, it will still say 1.1. - - The reason for this is that we first generate the request to send using the - old 1.1 style and show that request in the verbose output, and then we - convert it over to the binary header-compressed HTTP/2 style. The actual - "1.1" part from that request is then not actually used in the transfer. - The binary HTTP/2 headers are not human readable. - 5. libcurl Issues 5.1 Is libcurl thread-safe? @@ -1161,12 +1123,12 @@ FAQ We have written the libcurl code specifically adjusted for multi-threaded programs. libcurl will use thread-safe functions instead of non-safe ones if - your system has such. Note that you must never share the same handle in + your system has such. Note that you must never share the same handle in multiple threads. There may be some exceptions to thread safety depending on how libcurl was built. Please review the guidelines for thread safety to learn more: - https://curl.haxx.se/libcurl/c/threadsafe.html + https://curl.se/libcurl/c/threadsafe.html 5.2 How can I receive all data into a large memory chunk? @@ -1208,14 +1170,14 @@ FAQ libcurl has excellent support for transferring multiple files. You should just repeatedly set new URLs with curl_easy_setopt() and then transfer it with curl_easy_perform(). The handle you get from curl_easy_init() is not - only reusable, but you're even encouraged to reuse it if you can, as that + only reusable, but you are even encouraged to reuse it if you can, as that will enable libcurl to use persistent connections. - 5.4 Does libcurl do Winsock initialization on win32 systems? + 5.4 Does libcurl do Winsock initialization on Win32 systems? Yes, if told to in the curl_global_init() call. - 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ? + 5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on Win32 ? Yes, but you cannot open a FILE * and pass the pointer to a DLL and have that DLL use the FILE * (as the DLL and the client application cannot access @@ -1228,7 +1190,7 @@ FAQ 5.6 What about Keep-Alive or persistent connections? curl and libcurl have excellent support for persistent connections when - transferring several files from the same server. Curl will attempt to reuse + transferring several files from the same server. curl will attempt to reuse connections for all URLs specified on the same command line/config file, and libcurl will reuse connections for all transfers that are made using the same libcurl handle. @@ -1238,7 +1200,7 @@ FAQ kept within the multi handle and will be shared among all the easy handles that are used within the same multi handle. - 5.7 Link errors when building libcurl on Windows! + 5.7 Link errors when building libcurl on Windows You need to make sure that your project, and all the libraries (both static and dynamic) that it links against, are compiled/linked against the same run @@ -1250,18 +1212,18 @@ FAQ When building an application that uses the static libcurl library, you must add -DCURL_STATICLIB to your CFLAGS. Otherwise the linker will look for - dynamic import symbols. If you're using Visual Studio, you need to instead + dynamic import symbols. If you are using Visual Studio, you need to instead add CURL_STATICLIB in the "Preprocessor Definitions" section. - If you get linker error like "unknown symbol __imp__curl_easy_init ..." you - have linked against the wrong (static) library. If you want to use the - libcurl.dll and import lib, you don't need any extra CFLAGS, but use one of + If you get a linker error like "unknown symbol __imp__curl_easy_init ..." you + have linked against the wrong (static) library. If you want to use the + libcurl.dll and import lib, you do not need any extra CFLAGS, but use one of the import libraries below. These are the libraries produced by the various lib/Makefile.* files: Target: static lib. import lib for libcurl*.dll. ----------------------------------------------------------- - MingW: libcurl.a libcurldll.a + MinGW: libcurl.a libcurldll.a MSVC (release): libcurl.lib libcurl_imp.lib MSVC (debug): libcurld.lib libcurld_imp.lib Borland: libcurl.lib libcurl_imp.lib @@ -1269,33 +1231,33 @@ FAQ 5.8 libcurl.so.X: open failed: No such file or directory This is an error message you might get when you try to run a program linked - with a shared version of libcurl and your run-time linker (ld.so) couldn't + with a shared version of libcurl and your runtime linker (ld.so) could not find the shared library named libcurl.so.X. (Where X is the number of the current libcurl ABI, typically 3 or 4). You need to make sure that ld.so finds libcurl.so.X. You can do that - multiple ways, and it differs somewhat between different operating systems, - but they are usually: + multiple ways, and it differs somewhat between different operating systems. + They are usually: * Add an option to the linker command line that specify the hard-coded path - the run-time linker should check for the lib (usually -R) + the runtime linker should check for the lib (usually -R) * Set an environment variable (LD_LIBRARY_PATH for example) where ld.so should check for libs - * Adjust the system's config to check for libs in the directory where you've - put the dir (like Linux's /etc/ld.so.conf) + * Adjust the system's config to check for libs in the directory where you have + put the library (like Linux's /etc/ld.so.conf) 'man ld.so' and 'man ld' will tell you more details - 5.9 How does libcurl resolve host names? + 5.9 How does libcurl resolve hostnames? - libcurl supports a large a number of different name resolve functions. One - of them is picked at build-time and will be used unconditionally. Thus, if - you want to change name resolver function you must rebuild libcurl and tell - it to use a different function. + libcurl supports a large number of name resolve functions. One of them is + picked at build-time and will be used unconditionally. Thus, if you want to + change name resolver function you must rebuild libcurl and tell it to use a + different function. - - The non-IPv6 resolver that can use one of four different host name resolve + - The non-IPv6 resolver that can use one of four different hostname resolve calls (depending on what your system supports): A - gethostbyname() @@ -1332,7 +1294,7 @@ FAQ No. libcurl operates on a higher level. Besides, faking IP address would imply sending IP packets with a made-up source address, and then you normally get a problem with receiving the packet sent back as they would then not be - routed to you! + routed to you. If you use a proxy to access remote sites, the sites will not see your local IP address but instead the address of the proxy. @@ -1348,17 +1310,17 @@ FAQ one of the callbacks, but none of them are instant. There is no function you can call from another thread or similar that will stop it immediately. Instead, you need to make sure that one of the callbacks you use returns an - appropriate value that will stop the transfer. Suitable callbacks that you + appropriate value that will stop the transfer. Suitable callbacks that you can do this with include the progress callback, the read callback and the write callback. - If you're using the multi interface, you can also stop a transfer by + If you are using the multi interface, you can also stop a transfer by removing the particular easy handle from the multi stack at any moment you think the transfer is done or when you wish to abort the transfer. 5.14 Using C++ non-static functions for callbacks? - libcurl is a C library, it doesn't know anything about C++ member functions. + libcurl is a C library, it does not know anything about C++ member functions. You can overcome this "limitation" with relative ease using a static member function that is passed a pointer to the class: @@ -1382,15 +1344,16 @@ FAQ to list the files. The follow-up question tends to be how is a program supposed to parse the - directory listing. How does it know what's a file and what's a dir and what's - a symlink etc. If the FTP server supports the MLSD command then it will - return data in a machine-readable format that can be parsed for type. The - types are specified by RFC3659 section 7.5.1. If MLSD is not supported then - you have to work with what you're given. The LIST output format is entirely - at the server's own liking and the NLST output doesn't reveal any types and - in many cases doesn't even include all the directory entries. Also, both LIST - and NLST tend to hide unix-style hidden files (those that start with a dot) - by default so you need to do "LIST -a" or similar to see them. + directory listing. How does it know what's a file and what's a directory and + what's a symlink etc. If the FTP server supports the MLSD command then it + will return data in a machine-readable format that can be parsed for type. + The types are specified by RFC 3659 section 7.5.1. If MLSD is not supported + then you have to work with what you are given. The LIST output format is + entirely at the server's own liking and the NLST output does not reveal any + types and in many cases does not even include all the directory entries. + Also, both LIST and NLST tend to hide Unix-style hidden files (those that + start with a dot) by default so you need to do "LIST -a" or similar to see + them. Example - List only directories. ftp.funet.fi supports MLSD and ftp.kernel.org does not: @@ -1406,11 +1369,11 @@ FAQ libcurl since 7.21.0 also provide the ability to specify a wildcard to download multiple files from one FTP directory. - 5.16 I want a different time-out! + 5.16 I want a different time-out - Time and time again users realize that CURLOPT_TIMEOUT and - CURLOPT_CONNECTIMEOUT are not sufficiently advanced or flexible to cover all - the various use cases and scenarios applications end up with. + Sometimes users realize that CURLOPT_TIMEOUT and CURLOPT_CONNECTIMEOUT are + not sufficiently advanced or flexible to cover all the various use cases and + scenarios applications end up with. libcurl offers many more ways to time-out operations. A common alternative is to use the CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME options to @@ -1425,11 +1388,11 @@ FAQ 5.17 Can I write a server with libcurl? No. libcurl offers no functions or building blocks to build any kind of - internet protocol server. libcurl is only a client-side library. For server + Internet protocol server. libcurl is only a client-side library. For server libraries, you need to continue your search elsewhere but there exist many - good open source ones out there for most protocols you could possibly want a - server for. And there are really good stand-alone ones that have been tested - and proven for many years. There's no need for you to reinvent them! + good open source ones out there for most protocols you could want a server + for. There are also really good stand-alone servers that have been tested + and proven for many years. There is no need for you to reinvent them. 5.18 Does libcurl use threads? @@ -1437,20 +1400,20 @@ FAQ callbacks will be called in the same thread as the one you call libcurl in. If you want to avoid your thread to be blocked by the libcurl call, you make - sure you use the non-blocking API which will do transfers asynchronously - - but still in the same single thread. + sure you use the non-blocking multi API which will do transfers + asynchronously - still in the same single thread. libcurl will potentially internally use threads for name resolving, if it - was built to work like that, but in those cases it'll create the child + was built to work like that, but in those cases it will create the child threads by itself and they will only be used and then killed internally by libcurl and never exposed to the outside. 6. License Issues - Curl and libcurl are released under a MIT/X derivate license. The license is - very liberal and should not impose a problem for your project. This section - is just a brief summary for the cases we get the most questions. (Parts of - this section was much enhanced by Bjorn Reese.) + curl and libcurl are released under an MIT/X derivative license. The license + is liberal and should not impose a problem for your project. This section is + just a brief summary for the cases we get the most questions. (Parts of this + section was much enhanced by Bjorn Reese.) We are not lawyers and this is not legal advice. You should probably consult one if you want true and accurate legal insights without our prejudice. Note @@ -1460,36 +1423,36 @@ FAQ 6.1 I have a GPL program, can I use the libcurl library? - Yes! + Yes - Since libcurl may be distributed under the MIT/X derivate license, it can be - used together with GPL in any software. + Since libcurl may be distributed under the MIT/X derivative license, it can + be used together with GPL in any software. 6.2 I have a closed-source program, can I use the libcurl library? - Yes! + Yes libcurl does not put any restrictions on the program that uses the library. 6.3 I have a BSD licensed program, can I use the libcurl library? - Yes! + Yes libcurl does not put any restrictions on the program that uses the library. 6.4 I have a program that uses LGPL libraries, can I use libcurl? - Yes! + Yes - The LGPL license doesn't clash with other licenses. + The LGPL license does not clash with other licenses. 6.5 Can I modify curl/libcurl for my program and keep the changes secret? - Yes! + Yes - The MIT/X derivate license practically allows you to do almost anything with - the sources, on the condition that the copyright texts in the sources are - left intact. + The MIT/X derivative license practically allows you to do almost anything + with the sources, on the condition that the copyright texts in the sources + are left intact. 6.6 Can you please change the curl/libcurl license to XXXX? @@ -1521,7 +1484,7 @@ FAQ notice" somewhere. Most probably like in the documentation or in the section where other third party dependencies already are mentioned and acknowledged. - As can be seen here: https://curl.haxx.se/docs/companies.html and elsewhere, + As can be seen here: https://curl.se/docs/companies.html and elsewhere, more and more companies are discovering the power of libcurl and take advantage of it even in commercial environments. @@ -1550,10 +1513,47 @@ FAQ unknown to me). After a transfer, you just set new options in the handle and make another - transfer. This will make libcurl re-use the same connection if it can. + transfer. This will make libcurl reuse the same connection if it can. 7.4 Does PHP/CURL have dependencies? PHP/CURL is a module that comes with the regular PHP package. It depends on and uses libcurl, so you need to have libcurl installed properly before PHP/CURL can be used. + +8. Development + + 8.1 Why does curl use C89? + + As with everything in curl, there is a history and we keep using what we have + used before until someone brings up the subject and argues for and works on + changing it. + + We started out using C89 in the 1990s because that was the only way to write + a truly portable C program and have it run as widely as possible. C89 was for + a long time even necessary to make things work on otherwise considered modern + platforms such as Windows. Today, we do not really know how many users that + still require the use of a C89 compiler. + + We will continue to use C89 for as long as nobody brings up a strong enough + reason for us to change our minds. The core developers of the project do not + feel restricted by this and we are not convinced that going C99 will offer us + enough of a benefit to warrant the risk of cutting off a share of users. + + 8.2 Will curl be rewritten? + + In one go: no. Little by little over time? Maybe. + + Over the years, new languages and clever operating environments come and go. + Every now and then the urge apparently arises to request that we rewrite curl + in another language. + + Some the most important properties in curl are maintaining the API and ABI + for libcurl and keeping the behavior for the command line tool. As long as we + can do that, everything else is up for discussion. To maintain the ABI, we + probably have to maintain a certain amount of code in C, and to remain rock + stable, we will never risk anything by rewriting a lot of things in one go. + That said, we can certainly offer more and more optional backends written in + other languages, as long as those backends can be plugged in at build-time. + Backends can be written in any language, but should probably provide APIs + usable from C to ease integration and transition. diff --git a/curl/docs/FEATURES b/curl/docs/FEATURES deleted file mode 100644 index 39ac39040..000000000 --- a/curl/docs/FEATURES +++ /dev/null @@ -1,206 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -FEATURES - -curl tool - - config file support - - multiple URLs in a single command line - - range "globbing" support: [0-13], {one,two,three} - - multiple file upload on a single command line - - custom maximum transfer rate - - redirectable stderr - - metalink support (*13) - -libcurl - - full URL syntax with no length limit - - custom maximum download time - - custom least download speed acceptable - - custom output result after completion - - guesses protocol from host name unless specified - - uses .netrc - - progress bar with time statistics while downloading - - "standard" proxy environment variables support - - compiles on win32 (reported builds on 40+ operating systems) - - selectable network interface for outgoing traffic - - IPv6 support on unix and Windows - - persistent connections - - socks 4 + 5 support, with or without local name resolving - - supports user name and password in proxy environment variables - - operations through proxy "tunnel" (using CONNECT) - - support for large files (>2GB and >4GB) during upload and download - - replaceable memory functions (malloc, free, realloc, etc) - - asynchronous name resolving (*6) - - both a push and a pull style interface - - international domain names (*11) - -HTTP - - HTTP/1.1 compliant (optionally uses 1.0) - - GET - - PUT - - HEAD - - POST - - Pipelining - - multipart formpost (RFC1867-style) - - authentication: Basic, Digest, NTLM (*9) and Negotiate (SPNEGO) (*3) - to server and proxy - - resume (both GET and PUT) - - follow redirects - - maximum amount of redirects to follow - - custom HTTP request - - cookie get/send fully parsed - - reads/writes the netscape cookie file format - - custom headers (replace/remove internally generated headers) - - custom user-agent string - - custom referrer string - - range - - proxy authentication - - time conditions - - via http-proxy - - retrieve file modification date - - Content-Encoding support for deflate and gzip - - "Transfer-Encoding: chunked" support in uploads - - data compression (*12) - - HTTP/2 (*5) - -HTTPS (*1) - - (all the HTTP features) - - using client certificates - - verify server certificate - - via http-proxy - - select desired encryption - - force usage of a specific SSL version (SSLv2 (*7), SSLv3 (*10) or TLSv1) - -FTP - - download - - authentication - - Kerberos 5 (*14) - - active/passive using PORT, EPRT, PASV or EPSV - - single file size information (compare to HTTP HEAD) - - 'type=' URL support - - dir listing - - dir listing names-only - - upload - - upload append - - upload via http-proxy as HTTP PUT - - download resume - - upload resume - - custom ftp commands (before and/or after the transfer) - - simple "range" support - - via http-proxy - - all operations can be tunneled through a http-proxy - - customizable to retrieve file modification date - - no dir depth limit - -FTPS (*1) - - implicit ftps:// support that use SSL on both connections - - explicit "AUTH TLS" and "AUTH SSL" usage to "upgrade" plain ftp:// - connection to use SSL for both or one of the connections - -SCP (*8) - - both password and public key auth - -SFTP (*8) - - both password and public key auth - - with custom commands sent before/after the transfer - -TFTP - - download - - upload - -TELNET - - connection negotiation - - custom telnet options - - stdin/stdout I/O - -LDAP (*2) - - full LDAP URL support - -DICT - - extended DICT URL support - -FILE - - URL support - - upload - - resume - -SMB - - SMBv1 over TCP and SSL - - download - - upload - - authentication with NTLMv1 - -SMTP - - authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9), Kerberos 5 - (*4) and External. - - send e-mails - - mail from support - - mail size support - - mail auth support for trusted server-to-server relaying - - multiple recipients - - via http-proxy - -SMTPS (*1) - - implicit smtps:// support - - explicit "STARTTLS" usage to "upgrade" plain smtp:// connections to use SSL - - via http-proxy - -POP3 - - authentication: Clear Text, APOP and SASL - - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9), - Kerberos 5 (*4) and External. - - list e-mails - - retrieve e-mails - - enhanced command support for: CAPA, DELE, TOP, STAT, UIDL and NOOP via - custom requests - - via http-proxy - -POP3S (*1) - - implicit pop3s:// support - - explicit "STLS" usage to "upgrade" plain pop3:// connections to use SSL - - via http-proxy - -IMAP - - authentication: Clear Text and SASL - - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9), - Kerberos 5 (*4) and External. - - list the folders of a mailbox - - select a mailbox with support for verifying the UIDVALIDITY - - fetch e-mails with support for specifying the UID and SECTION - - upload e-mails via the append command - - enhanced command support for: EXAMINE, CREATE, DELETE, RENAME, STATUS, - STORE, COPY and UID via custom requests - - via http-proxy - -IMAPS (*1) - - implicit imaps:// support - - explicit "STARTTLS" usage to "upgrade" plain imap:// connections to use SSL - - via http-proxy - -FOOTNOTES -========= - - *1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL, WinSSL (native - Windows), Secure Transport (native iOS/OS X) or GSKit (native IBM i) - *2 = requires OpenLDAP or WinLDAP - *3 = requires a GSS-API implementation (such as Heimdal or MIT Kerberos) or - SSPI (native Windows) - *4 = requires a GSS-API implementation, however, only Windows SSPI is - currently supported - *5 = requires nghttp2 and possibly a recent TLS library - *6 = requires c-ares - *7 = requires OpenSSL, NSS, GSKit, WinSSL or Secure Transport; GnuTLS, for - example, only supports SSLv3 and TLSv1 - *8 = requires libssh2 - *9 = requires OpenSSL, GnuTLS, mbedTLS, NSS, yassl, Secure Transport or SSPI - (native Windows) - *10 = requires any of the SSL libraries in (*1) above other than axTLS, which - does not support SSLv3 - *11 = requires libidn or Windows - *12 = requires libz - *13 = requires libmetalink, and either an Apple or Microsoft operating - system, or OpenSSL, or GnuTLS, or NSS - *14 = requires a GSS-API implementation (such as Heimdal or MIT Kerberos) diff --git a/curl/docs/FEATURES.md b/curl/docs/FEATURES.md new file mode 100644 index 000000000..f36615494 --- /dev/null +++ b/curl/docs/FEATURES.md @@ -0,0 +1,249 @@ + + +# Features -- what curl can do + +## curl tool + + - config file support + - multiple URLs in a single command line + - range "globbing" support: [0-13], {one,two,three} + - multiple file upload on a single command line + - redirect stderr + - parallel transfers + +## libcurl + + - URL RFC 3986 syntax + - custom maximum download time + - custom lowest download speed acceptable + - custom output result after completion + - guesses protocol from hostname unless specified + - supports .netrc + - progress bar with time statistics while downloading + - standard proxy environment variables support + - have run on 101 operating systems and 28 CPU architectures + - selectable network interface for outgoing traffic + - IPv6 support on Unix and Windows + - happy eyeballs dual-stack IPv4 + IPv6 connects + - persistent connections + - SOCKS 4 + 5 support, with or without local name resolving + - *pre-proxy* support, for *proxy chaining* + - supports username and password in proxy environment variables + - operations through HTTP proxy "tunnel" (using CONNECT) + - replaceable memory functions (malloc, free, realloc, etc) + - asynchronous name resolving + - both a push and a pull style interface + - international domain names (IDN) + - transfer rate limiting + - stable API and ABI + - TCP keep alive + - TCP Fast Open + - DNS cache (that can be shared between transfers) + - non-blocking single-threaded parallel transfers + - Unix domain sockets to server or proxy + - DNS-over-HTTPS + - uses non-blocking name resolves + - selectable name resolver backend + +## URL API + + - parses RFC 3986 URLs + - generates URLs from individual components + - manages "redirects" + +## Header API + + - easy access to HTTP response headers, from all contexts + - named headers + - iterate over headers + +## TLS + + - selectable TLS backend(s) + - TLS False Start + - TLS version control + - TLS session resumption + - key pinning + - mutual authentication + - Use dedicated CA cert bundle + - Use OS-provided CA store + - separate TLS options for HTTPS proxy + +## HTTP + + - HTTP/0.9 responses are optionally accepted + - HTTP/1.0 + - HTTP/1.1 + - HTTP/2, including multiplexing and server push + - GET + - PUT + - HEAD + - POST + - multipart formpost (RFC 1867-style) + - authentication: Basic, Digest, NTLM (9) and Negotiate (SPNEGO) + to server and proxy + - resume transfers + - follow redirects + - maximum amount of redirects to follow + - custom HTTP request + - cookie get/send fully parsed + - reads/writes the Netscape cookie file format + - custom headers (replace/remove internally generated headers) + - custom user-agent string + - custom referrer string + - range + - proxy authentication + - time conditions + - via HTTP proxy, HTTPS proxy or SOCKS proxy + - HTTP/2 or HTTP/1.1 to HTTPS proxy + - retrieve file modification date + - Content-Encoding support for deflate, gzip, brotli and zstd + - "Transfer-Encoding: chunked" support in uploads + - HSTS + - alt-svc + - ETags + - HTTP/1.1 trailers, both sending and getting + +## HTTPS + + - HTTP/3 + - using client certificates + - verify server certificate + - via HTTP proxy, HTTPS proxy or SOCKS proxy + - select desired encryption + - select usage of a specific TLS version + - ECH + +## FTP + + - download + - authentication + - Kerberos 5 + - active/passive using PORT, EPRT, PASV or EPSV + - single file size information (compare to HTTP HEAD) + - 'type=' URL support + - directory listing + - directory listing names-only + - upload + - upload append + - upload via http-proxy as HTTP PUT + - download resume + - upload resume + - custom ftp commands (before and/or after the transfer) + - simple "range" support + - via HTTP proxy, HTTPS proxy or SOCKS proxy + - all operations can be tunneled through proxy + - customizable to retrieve file modification date + - no directory depth limit + +## FTPS + + - implicit `ftps://` support that use SSL on both connections + - explicit "AUTH TLS" and "AUTH SSL" usage to "upgrade" plain `ftp://` + connection to use SSL for both or one of the connections + +## SSH (both SCP and SFTP) + + - selectable SSH backend + - known hosts support + - public key fingerprinting + - both password and public key auth + +## SFTP + + - both password and public key auth + - with custom commands sent before/after the transfer + - directory listing + +## TFTP + + - download + - upload + +## TELNET + + - connection negotiation + - custom telnet options + - stdin/stdout I/O + +## LDAP + + - full LDAP URL support + +## DICT + + - extended DICT URL support + +## FILE + + - URL support + - upload + - resume + +## SMB + + - SMBv1 over TCP and SSL + - download + - upload + - authentication with NTLMv1 + +## SMTP + + - authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM, Kerberos 5 and + External + - send emails + - mail from support + - mail size support + - mail auth support for trusted server-to-server relaying + - multiple recipients + - via http-proxy + +## SMTPS + + - implicit `smtps://` support + - explicit "STARTTLS" usage to "upgrade" plain `smtp://` connections to use SSL + - via http-proxy + +## POP3 + + - authentication: Clear Text, APOP and SASL + - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM, + Kerberos 5 and External + - list emails + - retrieve emails + - enhanced command support for: CAPA, DELE, TOP, STAT, UIDL and NOOP via + custom requests + - via http-proxy + +## POP3S + + - implicit `pop3s://` support + - explicit `STLS` usage to "upgrade" plain `pop3://` connections to use SSL + - via http-proxy + +## IMAP + + - authentication: Clear Text and SASL + - SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM, + Kerberos 5 and External + - list the folders of a mailbox + - select a mailbox with support for verifying the `UIDVALIDITY` + - fetch emails with support for specifying the UID and SECTION + - upload emails via the append command + - enhanced command support for: EXAMINE, CREATE, DELETE, RENAME, STATUS, + STORE, COPY and UID via custom requests + - via http-proxy + +## IMAPS + + - implicit `imaps://` support + - explicit "STARTTLS" usage to "upgrade" plain `imap://` connections to use SSL + - via http-proxy + +## MQTT + + - Subscribe to and publish topics using URL scheme `mqtt://broker/topic` diff --git a/curl/docs/GOVERNANCE.md b/curl/docs/GOVERNANCE.md new file mode 100644 index 000000000..4ab52a9a0 --- /dev/null +++ b/curl/docs/GOVERNANCE.md @@ -0,0 +1,202 @@ + + +# Decision making in the curl project + +A rough guide to how we make decisions and who does what. + +## BDFL + +This project was started by and has to some extent been pushed forward over +the years with Daniel Stenberg as the driving force. It matches a standard +BDFL (Benevolent Dictator For Life) style project. + +This setup has been used due to convenience and the fact that it has worked +fine this far. It is not because someone thinks of it as a superior project +leadership model. It also only works as long as Daniel manages to listen in to +what the project and the general user population wants and expects from us. + +## Legal entity + +There is no legal entity. The curl project is just a bunch of people scattered +around the globe with the common goal to produce source code that creates +great products. We are not part of any umbrella organization and we are not +located in any specific country. We are totally independent. + +The copyrights in the project are owned by the individuals and organizations +that wrote those parts of the code. + +## Decisions + +The curl project is not a democracy, but everyone is entitled to state their +opinion and may argue for their sake within the community. + +All and any changes that have been done or are done are eligible to bring up +for discussion, to object to or to praise. Ideally, we find consensus for the +appropriate way forward in any given situation or challenge. + +If there is no obvious consensus, a maintainer who's knowledgeable in the +specific area takes an "executive" decision that they think is the right for +the project. + +## Donations + +Donating plain money to curl is best done to curl's [Open Collective +fund](https://opencollective.com/curl). Open Collective is a US based +non-profit organization that holds on to funds for us. This fund is then used +for paying the curl security bug bounties, to reimburse project related +expenses etc. + +Donations to the project can also come in the form of server hosting, providing +services and paying for people to work on curl related code etc. Usually, such +donations are services paid for directly by the sponsors. + +We grade sponsors in a few different levels and if they meet the criteria, +they can be mentioned on the Sponsors page on the curl website. + +## Commercial Support + +The curl project does not do or offer commercial support. It only hosts +mailing lists, runs bug trackers etc to facilitate communication and work. + +However, Daniel works for wolfSSL and we offer commercial curl support there. + +# Key roles + +## User + +Someone who uses or has used curl or libcurl. + +## Contributor + +Someone who has helped the curl project, who has contributed to bring it +forward. Contributing could be to provide advice, debug a problem, file a bug +report, run test infrastructure or writing code etc. + +## Commit author + +Sometimes also called 'committer'. Someone who has authored a commit in the +curl source code repository. Committers are recorded as `Author` in git. + +## Maintainers + +A maintainer in the curl project is an individual who has been given +permissions to push commits to one of the git repositories. + +Maintainers are free to push commits to the repositories at they see fit. +Maintainers are however expected to listen to feedback from users and any +change that is non-trivial in size or nature *should* be brought to the +project as a Pull-Request (PR) to allow others to comment/object before merge. + +## Former maintainers + +A maintainer who stops being active in the project gets their push permissions +removed at some point. We do this for security reasons but also to make sure +that we always have the list of maintainers as "the team that push stuff to +curl". + +Getting push permissions removed is not a punishment. Everyone who ever worked +on maintaining curl is considered a hero, for all time hereafter. + +## Security team members + +We have a security team. That is the team of people who are subscribed to the +curl-security mailing list; the receivers of security reports from users and +developers. This list of people varies over time but they are all skilled +developers familiar with the curl project. + +The security team works best when it consists of a small set of active +persons. We invite new members when the team seems to need it, and we also +expect to retire security team members as they "drift off" from the project or +just find themselves unable to perform their duties there. + +## Core team + +There is a curl core team. It currently has the same set of members as the +security team. It can also be reached on the security email address. + +The core team nominates and invites new members to the team when it sees fit. +There is no open member voting or formal ways to be a candidate. Active +participants in the curl project who want to join the core team can ask to +join. + +The core team is a board of advisors. It deals with project management +subjects that need confidentiality or for other reasons cannot be dealt with +and discussed in the open (for example reports of code of conduct violations). +Project matters should always as far as possible be discussed on open mailing +lists. + +## Server admins + +We run a web server, a mailing list and more on the curl project's primary +server. That physical machine is owned and run by Haxx. Daniel is the primary +admin of all things curl related server stuff, but Björn Stenberg and Linus +Feltzing serve as backup admins for when Daniel is gone or unable. + +The primary server is paid for by Haxx. The machine is physically located in a +server bunker in Stockholm Sweden, operated by the company Glesys. + +The website contents are served to the web via Fastly and Daniel is the +primary curl contact with Fastly. + +## BDFL + +That is Daniel. + +# Maintainers + +A curl maintainer is a project volunteer who has the authority and rights to +merge changes into a git repository in the curl project. + +Anyone can aspire to become a curl maintainer. + +### Duties + +There are no mandatory duties. We hope and wish that maintainers consider +reviewing patches and help merging them, especially when the changes are +within the area of personal expertise and experience. + +### Requirements + +- only merge code that meets our quality and style guide requirements. +- *never* merge code without doing a PR first, unless the change is "trivial" +- if in doubt, ask for input/feedback from others + +### Recommendations + +- we require two-factor authentication enabled on your GitHub account to + reduce risk of malicious source code tampering +- consider enabling signed git commits for additional verification of changes + +### Merge advice + +When you are merging patches/pull requests... + +- make sure the commit messages follow our template +- squash patch sets into a few logical commits even if the PR did not, if + necessary +- avoid the "merge" button on GitHub, do it "manually" instead to get full + control and full audit trail (GitHub leaves out you as "Committer:") +- remember to credit the reporter and the helpers. + +## Who are maintainers? + +The [list of maintainers](https://github.com/orgs/curl/people). Be aware that +the level of presence and activity in the project vary greatly between +different individuals and over time. + +### Become a maintainer? + +If you think you can help making the project better by shouldering some +maintaining responsibilities, then please get in touch. + +You are expected to be familiar with the curl project and its ways of working. +You need to have gotten a few quality patches merged as a proof of this. + +### Stop being a maintainer + +If you (appear to) not be active in the project anymore, you may be removed as +a maintainer. Thank you for your service. diff --git a/curl/docs/HELP-US.md b/curl/docs/HELP-US.md index d37ad9480..0619aec53 100644 --- a/curl/docs/HELP-US.md +++ b/curl/docs/HELP-US.md @@ -1,12 +1,20 @@ + + # How to get started helping out in the curl project We are always in need of more help. If you are new to the project and are looking for ways to contribute and help out, this document aims to give a few good starting points. -A good idea is to start by subscribing to the [curl-library mailing -list](https://cool.haxx.se/mailman/listinfo/curl-library) to keep track of the -current discussion topics. +You may subscribe to the [curl-library mailing +list](https://lists.haxx.se/listinfo/curl-library) to keep track of the +current discussion topics; or if you are registered on GitHub, you can use the +[Discussions section](https://github.com/curl/curl/discussions) on the main +curl repository. ## Scratch your own itch @@ -15,39 +23,56 @@ found yourself or perhaps got annoyed at in the past. It can be a spelling error in an error text or a weirdly phrased section in a man page. Hunt it down and report the bug. Or make your first pull request with a fix for that. -## PR-welcome +## Smaller tasks + +Some projects mark small issues as "beginner friendly", "bite-sized" or +similar. We do not do that in curl since such issues never linger around long +enough. Simple issues get handled fast. + +If you are looking for a smaller or simpler task in the project to help out +with as an entry-point into the project, perhaps because you are a newcomer or +even maybe not a terribly experienced developer, here's our advice: + + - Read through this document to get a grasp on a general approach to use + - Consider adding a test case for something not currently tested (correctly) + - Consider updating or adding documentation + - One way to get started gently in the project, is to participate in an + existing issue/PR and help out by reproducing the issue, review the code in + the PR etc. + +## Help wanted In the issue tracker we occasionally mark bugs with [help wanted](https://github.com/curl/curl/labels/help%20wanted), as a sign that the -bug is acknowledged to exist and that there's nobody known to work on this +bug is acknowledged to exist and that there is nobody known to work on this issue for the moment. Those are bugs that are fine to "grab" and provide a -pull request for. The complexity level of these will of course vary, so pick -one that piques your interest. +pull request for. The complexity level of these of course varies, so pick one +that piques your interest. ## Work on known bugs -Some bugs are known and haven't yet received attention and work enough to get +Some bugs are known and have not yet received attention and work enough to get fixed. We collect such known existing flaws in the -[KNOWN_BUGS](https://curl.haxx.se/docs/knownbugs.html) page. Many of them link +[KNOWN_BUGS](https://curl.se/docs/knownbugs.html) page. Many of them link to the original bug report with some additional details, but some may also have aged a bit and may require some verification that the bug still exists in the same way and that what was said about it in the past is still valid. ## Fix autobuild problems -On the [autobuilds page](https://curl.haxx.se/dev/builds.html) we show a +On the [autobuilds page](https://curl.se/dev/builds.html) we show a collection of test results from the automatic curl build and tests that are performed by volunteers. Fixing compiler warnings and errors shown there is something we value greatly. Also, if you own or run systems or architectures -that aren't already tested in the autobuilds, we also appreciate more +that are not already tested in the autobuilds, we also appreciate more volunteers running builds automatically to help us keep curl portable. ## TODO items Ideas for features and functions that we have considered worthwhile to implement and provide are kept in the -[TODO](https://curl.haxx.se/docs/todo.html) file. Some of the ideas are -rough. Some are well thought out. Some probably aren't really suitable +[TODO](https://curl.se/docs/todo.html) file. Some of the ideas are +rough. Some are well thought out. Some probably are not really suitable anymore. Before you invest a lot of time on a TODO item, do bring it up for discussion @@ -58,13 +83,12 @@ brainstorming on specific ways to do the implementation etc. You can also come up with a completely new thing you think we should do. Or not do. Or fix. Or add to the project. You then either bring it to the mailing -list first to see if people will shoot down the idea at once, or you bring a -first draft of the idea as a pull request and take the discussion there around -the specific implementation. Either way is fine. +list first to see if people shoot down the idea at once, or you bring a first +draft of the idea as a pull request and take the discussion there around the +specific implementation. Either way is fine. ## CONTRIBUTE -We offer [guidelines](https://curl.haxx.se/dev/contribute.html) that are -suitable to be familiar with before you decide to contribute to curl. If -you're used to open source development, you'll probably not find many -surprises in there. +We offer [guidelines](https://curl.se/dev/contribute.html) that are suitable +to be familiar with before you decide to contribute to curl. If you are used +to open source development, you probably do not find many surprises there. diff --git a/curl/docs/HISTORY.md b/curl/docs/HISTORY.md index a84ad8f1b..21df56f85 100644 --- a/curl/docs/HISTORY.md +++ b/curl/docs/HISTORY.md @@ -1,3 +1,9 @@ + + How curl Became Like This ========================= @@ -7,26 +13,48 @@ currency-exchange calculations available to Internet Relay Chat (IRC) users. All the necessary data were published on the Web; he just needed to automate their retrieval. -Daniel simply adopted an existing command-line open-source tool, httpget, that -Brazilian Rafael Sagula had written and recently released version 0.1 of. After -a few minor adjustments, it did just what he needed. +1996 +---- + +On November 11, 1996 the Brazilian developer Rafael Sagula wrote and released +HttpGet version 0.1. + +Daniel extended this existing command-line open-source tool. After a few minor +adjustments, it did just what he needed. The first release with Daniel's +additions was 0.2, released on December 17, 1996. Daniel quickly became the +new maintainer of the project. 1997 ---- -HttpGet 1.0 was released on April 8th 1997 with brand new HTTP proxy support. +HttpGet 0.3 was released in January 1997 and now it accepted HTTP URLs on the +command line. + +HttpGet 1.0 was released on April 8 1997 with brand new HTTP proxy support. -We soon found and fixed support for getting currencies over GOPHER. Once FTP +We soon found and fixed support for getting currencies over GOPHER. Once FTP download support was added, the name of the project was changed and urlget 2.0 was released in August 1997. The http-only days were already passed. +Version 2.2 was released on August 14 1997 and introduced support to build for +and run on Windows and Solaris. + +November 24 1997: Version 3.1 added FTP upload support. + +Version 3.5 added support for HTTP POST. + 1998 ---- -The project slowly grew bigger. When upload capabilities were added and the -name once again was misleading, a second name change was made and on March 20, -1998 curl 4 was released. (The version numbering from the previous names was -kept.) +February 4: urlget 3.10 + +February 9: urlget 3.11 + +March 14: urlget 3.12 added proxy authentication. + +The project slowly grew bigger. With upload capabilities, the name was once +again misleading and a second name change was made. On March 20, 1998 curl 4 +was released. (The version numbering from the previous names was kept.) (Unrelated to this project a company called Curl Corporation registered a US trademark on the name "CURL" on May 18 1998. That company had then already @@ -38,7 +66,7 @@ SSL support was added, powered by the SSLeay library. August: first announcement of curl on freshmeat.net. October: with the curl 4.9 release and the introduction of cookie support, -curl was no longer released under the GPL license. Now we're at 4000 lines of +curl was no longer released under the GPL license. Now we are at 4000 lines of code, we switched over to the MPL license to restrict the effects of "copyleft". @@ -46,7 +74,7 @@ November: configure script and reported successful compiles on several major operating systems. The never-quite-understood -F option was added and curl could now simulate quite a lot of a browser. TELNET support was added. -Curl 5 was released in December 1998 and introduced the first ever curl man +curl 5 was released in December 1998 and introduced the first ever curl man page. People started making Linux RPM packages out of it. 1999 @@ -58,7 +86,7 @@ OpenSSL took over and SSLeay was abandoned. May: first Debian package. -August: LDAP:// and FILE:// support added. The curl web site gets 1300 visits +August: LDAP:// and FILE:// support added. The curl website gets 1300 visits weekly. Moved site to curl.haxx.nu. September: Released curl 6.0. 15000 lines of code. @@ -77,7 +105,7 @@ other software and programs to be based on and powered by libcurl. Almost June: the curl site moves to "curl.haxx.se" -August, the curl web site gets 4000 visits weekly. +August, the curl website gets 4000 visits weekly. The PHP guys adopted libcurl already the same month, when the first ever third party libcurl binding showed up. CURL has been a supported module in PHP since @@ -104,44 +132,48 @@ also introduced libcurl's ability to do persistent connections. 24000 lines of code. The libcurl major SONAME number was bumped to 2 due to this overhaul. The first experimental ftps:// support was added. -August: curl is bundled in Mac OS X, 10.1. It was already becoming more and -more of a standard utility of Linux distributions and a regular in the BSD -ports collections. The curl web site gets 8000 visits weekly. Curl Corporation -contacted Daniel to discuss "the name issue". After Daniel's reply, they have -never since got back in touch again. +August: The curl website gets 8000 visits weekly. Curl Corporation contacted +Daniel to discuss "the name issue". After Daniel's reply, they have never +since got back in touch again. -September: libcurl 7.9 introduces cookie jar and curl_formadd(). During the +September: libcurl 7.9 introduces cookie jar and `curl_formadd()`. During the forthcoming 7.9.x releases, we introduced the multi interface slowly and without many whistles. +September 25: curl (7.7.2) is bundled in Mac OS X (10.1) for the first time. It was +already becoming more and more of a standard utility of Linux distributions +and a regular in the BSD ports collections. + 2002 ---- -June: the curl web site gets 13000 visits weekly. curl and libcurl is +June: the curl website gets 13000 visits weekly. curl and libcurl is 35000 lines of code. Reported successful compiles on more than 40 combinations of CPUs and operating systems. -To estimate number of users of the curl tool or libcurl library is next to +To estimate the number of users of the curl tool or libcurl library is next to impossible. Around 5000 downloaded packages each week from the main site gives a hint, but the packages are mirrored extensively, bundled with numerous OS distributions and otherwise retrieved as part of other software. -September: with the release of curl 7.10 it is released under the MIT license +October 1: with the release of curl 7.10 it is released under the MIT license only. +Starting with 7.10, curl verifies SSL server certificates by default. + 2003 ---- January: Started working on the distributed curl tests. The autobuilds. February: the curl site averages at 20000 visits weekly. At any given moment, -there's an average of 3 people browsing the curl.haxx.se site. +there is an average of 3 people browsing the website. Multiple new authentication schemes are supported: Digest (May), NTLM (June) and Negotiate (June). November: curl 7.10.8 is released. 45000 lines of code. ~55000 unique visitors -to the curl.haxx.se site. Five official web mirrors. +to the website. Five official web mirrors. December: full-fledged SSL for FTP is supported. @@ -153,16 +185,16 @@ January: curl 7.11.0 introduced large file support. June: curl 7.12.0 introduced IDN support. 10 official web mirrors. This release bumped the major SONAME to 3 due to the removal of the -curl_formparse() function +`curl_formparse()` function -August: Curl and libcurl 7.12.1 +August: curl and libcurl 7.12.1 Public curl release number: 82 - Releases counted from the very beginning: 109 + Releases counted from the beginning: 109 Available command line options: 96 Available curl_easy_setopt() options: 120 Number of public functions in libcurl: 36 - Amount of public web site mirrors: 12 + Amount of public website mirrors: 12 Number of known libcurl bindings: 26 2005 @@ -175,7 +207,7 @@ April: Added the multi_socket() API September: TFTP support was added. -More than 100,000 unique visitors of the curl web site. 25 mirrors. +More than 100,000 unique visitors of the curl website. 25 mirrors. December: security vulnerability: libcurl URL Buffer Overflow @@ -218,6 +250,8 @@ November: March: security vulnerability: libcurl Arbitrary File Access +April: added CMake support + August: security vulnerability: libcurl embedded zero in cert name December: Added support for IMAP, POP3 and SMTP @@ -229,7 +263,7 @@ January: Added support for RTSP February: security vulnerability: libcurl data callback excessive length -March: The project switched over to use git (hosted by github) instead of CVS +March: The project switched over to use git (hosted by GitHub) instead of CVS for source code control May: Added support for RTMP @@ -247,13 +281,20 @@ August: Gopher support added (re-added actually, see January 2006) +2011 +---- + +February: added support for the axTLS backend + +April: added the cyassl backend (later renamed to wolfSSL) + 2012 ---- July: Added support for Schannel (native Windows TLS backend) and Darwin SSL (Native Mac OS X and iOS TLS backend). - Supports metalink + Supports Metalink October: SSH-agent support. @@ -274,22 +315,172 @@ August: March: first real release supporting HTTP/2 - September: Web site had 245,000 unique visitors and served 236GB data + September: Website had 245,000 unique visitors and served 236GB data + + SMB and SMBS support + +2015 +---- + + June: support for multiplexing with HTTP/2 + + August: support for HTTP/2 server push + + December: Public Suffix List 2016 ---- - December: curl 7.52.0 introduced support for HTTPS-proxy! + January: the curl tool defaults to HTTP/2 for HTTPS URLs + + December: curl 7.52.0 introduced support for HTTPS-proxy + + First TLS 1.3 support 2017 ---- - September: Added Multi-SSL support + July: OSS-Fuzz started fuzzing libcurl + + September: Added MultiSSL support - The web site serves 3100 GB/month + The website serves 3100 GB/month Public curl releases: 169 Command line options: 211 curl_easy_setopt() options: 249 Public functions in libcurl: 74 Contributors: 1609 + + October: SSLKEYLOGFILE support, new MIME API + + October: Daniel received the Polhem Prize for his work on curl + + November: brotli + +2018 +---- + + January: new SSH backend powered by libssh + + March: starting with the 1803 release of Windows 10, curl is shipped bundled + with Microsoft's operating system. + + July: curl shows headers using bold type face + + October: added DNS-over-HTTPS (DoH) and the URL API + + MesaLink is a new supported TLS backend + + libcurl now does HTTP/2 (and multiplexing) by default on HTTPS URLs + + curl and libcurl are installed in an estimated 5 *billion* instances + world-wide. + + October 31: curl and libcurl 7.62.0 + + Public curl releases: 177 + Command line options: 219 + curl_easy_setopt() options: 261 + Public functions in libcurl: 80 + Contributors: 1808 + + December: removed axTLS support + +2019 +---- + + March: added experimental alt-svc support + + August: the first HTTP/3 requests with curl. + + September: 7.66.0 is released and the tool offers parallel downloads + +2020 +---- + + curl and libcurl are installed in an estimated 10 *billion* instances + world-wide. + + January: added BearSSL support + + March: removed support for PolarSSL, added wolfSSH support + + April: experimental MQTT support + + August: zstd support + + November: the website moves to curl.se. The website serves 10TB data monthly. + + December: alt-svc support + +2021 +---- + + February 3: curl 7.75.0 ships with support for Hyper as an HTTP backend + + March 31: curl 7.76.0 ships with support for Rustls + + July: HSTS is supported + +2022 +---- + +March: added --json, removed mesalink support + + Public curl releases: 206 + Command line options: 245 + curl_easy_setopt() options: 295 + Public functions in libcurl: 86 + Contributors: 2601 + + The curl.se website serves 16,500 GB/month over 462M requests, the + official docker image has been pulled 4,098,015,431 times. + +October: initial WebSocket support + +2023 +---- + +March: remove support for curl_off_t < 8 bytes + +March 31: we started working on a new command line tool for URL parsing and +manipulations: trurl. + +May: added support for HTTP/2 over HTTPS proxy. Refuse to resolve .onion. + +August: Dropped support for the NSS library + +September: added "variable" support in the command line tool. Dropped support +for the gskit TLS library. + +October: added support for IPFS via HTTP gateway + +December: HTTP/3 support with ngtcp2 is no longer experimental + +2024 +---- + +January: switched to "curldown" for all documentation + +April 24: the curl container has been pulled more than six billion times + +May: experimental support for ECH, dropped NTLM_WB + +August 9: we adopted the wcurl tool into the curl organization + +September 11: --help [option] + +November 6: TLS 1.3 early data, WebSocket is official + +December 21: dropped hyper + +2025 +---- + +February 5: first 0RTT for QUIC, ssl session import/export + +February: experimental HTTPS RR support + +February 22: The website served 62.95 TB/month; 12.43 billion requests + The docker image has been pulled 6373501745 times. diff --git a/curl/docs/HSTS.md b/curl/docs/HSTS.md new file mode 100644 index 000000000..85140ab30 --- /dev/null +++ b/curl/docs/HSTS.md @@ -0,0 +1,48 @@ + + +# HSTS support + +HTTP Strict-Transport-Security. Added as experimental in curl +7.74.0. Supported "for real" since 7.77.0. + +## Standard + +[HTTP Strict Transport Security](https://datatracker.ietf.org/doc/html/rfc6797) + +## Behavior + +libcurl features an in-memory cache for HSTS hosts, so that subsequent +HTTP-only requests to a hostname present in the cache gets internally +"redirected" to the HTTPS version. + +## `curl_easy_setopt()` options: + + - `CURLOPT_HSTS_CTRL` - enable HSTS for this easy handle + - `CURLOPT_HSTS` - specify filename where to store the HSTS cache on close + (and possibly read from at startup) + +## curl command line options + + - `--hsts [filename]` - enable HSTS, use the file as HSTS cache. If filename + is `""` (no length) then no file is used, only in-memory cache. + +## HSTS cache file format + +Lines starting with `#` are ignored. + +For each hsts entry: + + [host name] "YYYYMMDD HH:MM:SS" + +The `[host name]` is dot-prefixed if it includes subdomains. + +The time stamp is when the entry expires. + +## Possible future additions + + - `CURLOPT_HSTS_PRELOAD` - provide a set of HSTS hostnames to load first + - ability to save to something else than a file diff --git a/curl/docs/HTTP-COOKIES.md b/curl/docs/HTTP-COOKIES.md index a1b283454..62905dbc6 100644 --- a/curl/docs/HTTP-COOKIES.md +++ b/curl/docs/HTTP-COOKIES.md @@ -1,24 +1,63 @@ + + # HTTP Cookies ## Cookie overview - Cookies are `name=contents` pairs that a HTTP server tells the client to + Cookies are `name=contents` pairs that an HTTP server tells the client to hold and then the client sends back those to the server on subsequent requests to the same domains and paths for which the cookies were set. Cookies are either "session cookies" which typically are forgotten when the session is over which is often translated to equal when browser quits, or - the cookies aren't session cookies they have expiration dates after which - the client will throw them away. + the cookies are not session cookies they have expiration dates after which + the client throws them away. Cookies are set to the client with the Set-Cookie: header and are sent to servers with the Cookie: header. - For a very long time, the only spec explaining how to use cookies was the - original [Netscape spec from 1994](https://curl.haxx.se/rfc/cookie_spec.html). - - In 2011, [RFC6265](https://www.ietf.org/rfc/rfc6265.txt) was finally - published and details how cookies work within HTTP. + For a long time, the only spec explaining how to use cookies was the + original [Netscape spec from 1994](https://curl.se/rfc/cookie_spec.html). + + In 2011, [RFC 6265](https://www.ietf.org/rfc/rfc6265.txt) was finally + published and details how cookies work within HTTP. In 2016, an update which + added support for prefixes was + [proposed](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00), + and in 2017, another update was + [drafted](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-alone-01) + to deprecate modification of 'secure' cookies from non-secure origins. Both + of these drafts have been incorporated into a proposal to + [replace](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-11) + RFC 6265. Cookie prefixes and secure cookie modification protection has been + implemented by curl. + + curl considers `http://localhost` to be a *secure context*, meaning that it + allows and uses cookies marked with the `secure` keyword even when done over + plain HTTP for this host. curl does this to match how popular browsers work + with secure cookies. + +## Super cookies + + A single cookie can be set for a domain that matches multiple hosts. Like if + set for `example.com` it gets sent to both `aa.example.com` as well as + `bb.example.com`. + + A challenge with this concept is that there are certain domains for which + cookies should not be allowed at all, because they are *Public + Suffixes*. Similarly, a client never accepts cookies set directly for the + top-level domain like for example `.com`. Cookies set for *too broad* + domains are generally referred to as *super cookies*. + + If curl is built with PSL (**Public Suffix List**) support, it detects and + discards cookies that are specified for such suffix domains that should not + be allowed to have cookies. + + if curl is *not* built with PSL support, it has no ability to stop super + cookies. ## Cookies saved to disk @@ -27,12 +66,35 @@ sharing the cookies with browsers, only to see browsers move away from that format. Modern browsers no longer use it, while curl still does. - The netscape cookie file format stores one cookie per physical line in the + The Netscape cookie file format stores one cookie per physical line in the file with a bunch of associated meta data, each field separated with - TAB. That file is called the cookiejar in curl terminology. + TAB. That file is called the cookie jar in curl terminology. + + When libcurl saves a cookie jar, it creates a file header of its own in + which there is a URL mention that links to the web version of this document. + +## Cookie file format + + The cookie file format is text based and stores one cookie per line. Lines + that start with `#` are treated as comments. An exception is lines that + start with `#HttpOnly_`, which is a prefix for cookies that have the + `HttpOnly` attribute set. - When libcurl saves a cookiejar, it creates a file header of its own in which - there is a URL mention that will link to the web version of this document. + Each line that specifies a single cookie consists of seven text fields + separated with TAB characters. A valid line must end with a newline + character. + +### Fields in the file + + Field number, what type and example data and the meaning of it: + + 0. string `example.com` - the domain name + 1. boolean `FALSE` - include subdomains + 2. string `/foobar/` - path + 3. boolean `TRUE` - send/receive over HTTPS only + 4. number `1462299217` - expires at - seconds since Jan 1st 1970, or 0 + 5. string `person` - name of the cookie + 6. string `daniel` - value of the cookie ## Cookies with curl the command line tool @@ -41,64 +103,69 @@ Command line options: - `-b, --cookie` + [`-b, --cookie`](https://curl.se/docs/manpage.html#-b) tell curl a file to read cookies from and start the cookie engine, or if it - isn't a file it will pass on the given string. -b name=var works and so does - -b cookiefile. + is not a file it passes on the given string. `-b name=var` works and so does + `-b cookiefile`. - `-j, --junk-session-cookies` + [`-j, --junk-session-cookies`](https://curl.se/docs/manpage.html#-j) - when used in combination with -b, it will skip all "session cookies" on load - so as to appear to start a new cookie session. + when used in combination with -b, it skips all "session cookies" on load so + as to appear to start a new cookie session. - `-c, --cookie-jar` + [`-c, --cookie-jar`](https://curl.se/docs/manpage.html#-c) tell curl to start the cookie engine and write cookies to the given file after the request(s) ## Cookies with libcurl - libcurl offers several ways to enable and interface the cookie engine. These - options are the ones provided by the native API. libcurl bindings may offer - access to them using other means. +libcurl offers several ways to enable and interface the cookie engine. These +options are the ones provided by the native API. libcurl bindings may offer +access to them using other means. + +[`CURLOPT_COOKIE`](https://curl.se/libcurl/c/CURLOPT_COOKIE.html) + +Is used when you want to specify the exact contents of a cookie header to +send to the server. - `CURLOPT_COOKIE` +[`CURLOPT_COOKIEFILE`](https://curl.se/libcurl/c/CURLOPT_COOKIEFILE.html) - Is used when you want to specify the exact contents of a cookie header to - send to the server. +Tell libcurl to activate the cookie engine, and to read the initial set of +cookies from the given file. Read-only. - `CURLOPT_COOKIEFILE` +[`CURLOPT_COOKIEJAR`](https://curl.se/libcurl/c/CURLOPT_COOKIEJAR.html) - Tell libcurl to activate the cookie engine, and to read the initial set of - cookies from the given file. Read-only. +Tell libcurl to activate the cookie engine, and when the easy handle is +closed save all known cookies to the given cookie jar file. Write-only. - `CURLOPT_COOKIEJAR` +[`CURLOPT_COOKIELIST`](https://curl.se/libcurl/c/CURLOPT_COOKIELIST.html) - Tell libcurl to activate the cookie engine, and when the easy handle is - closed save all known cookies to the given cookiejar file. Write-only. +Provide detailed information about a single cookie to add to the internal +storage of cookies. Pass in the cookie as an HTTP header with all the +details set, or pass in a line from a Netscape cookie file. This option can +also be used to flush the cookies etc. - `CURLOPT_COOKIELIST` +[`CURLOPT_COOKIESESSION`](https://curl.se/libcurl/c/CURLOPT_COOKIESESSION.html) - Provide detailed information about a single cookie to add to the internal - storage of cookies. Pass in the cookie as a HTTP header with all the details - set, or pass in a line from a netscape cookie file. This option can also be - used to flush the cookies etc. +Tell libcurl to ignore all cookies it is about to load that are session +cookies. - `CURLINFO_COOKIELIST` +[`CURLINFO_COOKIELIST`](https://curl.se/libcurl/c/CURLINFO_COOKIELIST.html) - Extract cookie information from the internal cookie storage as a linked - list. +Extract cookie information from the internal cookie storage as a linked +list. -## Cookies with javascript +## Cookies with JavaScript - These days a lot of the web is built up by javascript. The webbrowser loads - complete programs that render the page you see. These javascript programs - can also set and access cookies. +These days a lot of the web is built up by JavaScript. The web browser loads +complete programs that render the page you see. These JavaScript programs +can also set and access cookies. - Since curl and libcurl are plain HTTP clients without any knowledge of or - capability to handle javascript, such cookies will not be detected or used. +Since curl and libcurl are plain HTTP clients without any knowledge of or +capability to handle JavaScript, such cookies are not detected or used. - Often, if you want to mimic what a browser does on such web sites, you can - record web browser HTTP traffic when using such a site and then repeat the - cookie operations using curl or libcurl. +Often, if you want to mimic what a browser does on such websites, you can +record web browser HTTP traffic when using such a site and then repeat the +cookie operations using curl or libcurl. diff --git a/curl/docs/HTTP2.md b/curl/docs/HTTP2.md deleted file mode 100644 index efbe69991..000000000 --- a/curl/docs/HTTP2.md +++ /dev/null @@ -1,126 +0,0 @@ -HTTP/2 with curl -================ - -[HTTP/2 Spec](https://www.rfc-editor.org/rfc/rfc7540.txt) -[http2 explained](https://daniel.haxx.se/http2/) - -Build prerequisites -------------------- - - nghttp2 - - OpenSSL, libressl, BoringSSL, NSS, GnutTLS, mbedTLS, wolfSSL or SChannel - with a new enough version. - -[nghttp2](https://nghttp2.org/) -------------------------------- - -libcurl uses this 3rd party library for the low level protocol handling -parts. The reason for this is that HTTP/2 is much more complex at that layer -than HTTP/1.1 (which we implement on our own) and that nghttp2 is an already -existing and well functional library. - -We require at least version 1.0.0. - -Over an http:// URL -------------------- - -If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will -include an upgrade header in the initial request to the host to allow -upgrading to HTTP/2. - -Possibly we can later introduce an option that will cause libcurl to fail if -not possible to upgrade. Possibly we introduce an option that makes libcurl -use HTTP/2 at once over http:// - -Over an https:// URL --------------------- - -If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will use -ALPN (or NPN) to negotiate which protocol to continue with. Possibly introduce -an option that will cause libcurl to fail if not possible to use HTTP/2. - -`CURL_HTTP_VERSION_2TLS` was added in 7.47.0 as a way to ask libcurl to prefer -HTTP/2 for HTTPS but stick to 1.1 by default for plain old HTTP connections. - -ALPN is the TLS extension that HTTP/2 is expected to use. The NPN extension is -for a similar purpose, was made prior to ALPN and is used for SPDY so early -HTTP/2 servers are implemented using NPN before ALPN support is widespread. - -`CURLOPT_SSL_ENABLE_ALPN` and `CURLOPT_SSL_ENABLE_NPN` are offered to allow -applications to explicitly disable ALPN or NPN. - -SSL libs --------- - -The challenge is the ALPN and NPN support and all our different SSL -backends. You may need a fairly updated SSL library version for it to provide -the necessary TLS features. Right now we support: - - - OpenSSL: ALPN and NPN - - libressl: ALPN and NPN - - BoringSSL: ALPN and NPN - - NSS: ALPN and NPN - - GnuTLS: ALPN - - mbedTLS: ALPN - - SChannel: ALPN - - wolfSSL: ALPN - -Multiplexing ------------- - -Starting in 7.43.0, libcurl fully supports HTTP/2 multiplexing, which is the -term for doing multiple independent transfers over the same physical TCP -connection. - -To take advantage of multiplexing, you need to use the multi interface and set -`CURLMOPT_PIPELINING` to `CURLPIPE_MULTIPLEX`. With that bit set, libcurl will -attempt to re-use existing HTTP/2 connections and just add a new stream over -that when doing subsequent parallel requests. - -While libcurl sets up a connection to a HTTP server there is a period during -which it doesn't know if it can pipeline or do multiplexing and if you add new -transfers in that period, libcurl will default to start new connections for -those transfers. With the new option `CURLOPT_PIPEWAIT` (added in 7.43.0), you -can ask that a transfer should rather wait and see in case there's a -connection for the same host in progress that might end up being possible to -multiplex on. It favours keeping the number of connections low to the cost of -slightly longer time to first byte transferred. - -Applications ------------- - -We hide HTTP/2's binary nature and convert received HTTP/2 traffic to headers -in HTTP 1.1 style. This allows applications to work unmodified. - -curl tool ---------- - -curl offers the `--http2` command line option to enable use of HTTP/2. - -curl offers the `--http2-prior-knowledge` command line option to enable use of -HTTP/2 without HTTP/1.1 Upgrade. - -Since 7.47.0, the curl tool enables HTTP/2 by default for HTTPS connections. - -curl tool limitations ---------------------- - -The command line tool won't do any HTTP/2 multiplexing even though libcurl -supports it, simply because the curl tool is not written to take advantage of -the libcurl API that's necessary for this (the multi interface). We have an -outstanding TODO item for this and **you** can help us make it happen. - -The command line tool also doesn't support HTTP/2 server push for the same -reason it doesn't do multiplexing: it needs to use the multi interface for -that so that multiplexing is supported. - -HTTP Alternative Services -------------------------- - -Alt-Svc is an extension with a corresponding frame (ALTSVC) in HTTP/2 that -tells the client about an alternative "route" to the same content for the same -origin server that you get the response from. A browser or long-living client -can use that hint to create a new connection asynchronously. For libcurl, we -may introduce a way to bring such clues to the application and/or let a -subsequent request use the alternate route automatically. - -[Detailed in RFC 7838](https://tools.ietf.org/html/rfc7838) diff --git a/curl/docs/HTTP3.md b/curl/docs/HTTP3.md new file mode 100644 index 000000000..b75daa43a --- /dev/null +++ b/curl/docs/HTTP3.md @@ -0,0 +1,481 @@ + + +# HTTP3 (and QUIC) + +## Resources + +[HTTP/3 Explained](https://http3-explained.haxx.se/en/) - the online free +book describing the protocols involved. + +[quicwg.org](https://quicwg.org/) - home of the official protocol drafts + +## QUIC libraries + +QUIC libraries we are using: + +[ngtcp2](https://github.com/ngtcp2/ngtcp2) + +[quiche](https://github.com/cloudflare/quiche) - **EXPERIMENTAL** + +[OpenSSL 3.2+ QUIC](https://github.com/openssl/openssl) - **EXPERIMENTAL** + +[msh3](https://github.com/nibanks/msh3) (with [msquic](https://github.com/microsoft/msquic)) - **EXPERIMENTAL** + +## Experimental + +HTTP/3 support in curl is considered **EXPERIMENTAL** until further notice +when built to use *quiche* or *msh3*. Only the *ngtcp2* backend is not +experimental. + +Further development and tweaking of the HTTP/3 support in curl happens in the +master branch using pull-requests, just like ordinary changes. + +To fix before we remove the experimental label: + + - the used QUIC library needs to consider itself non-beta + - it is fine to "leave" individual backends as experimental if necessary + +# ngtcp2 version + +Building curl with ngtcp2 involves 3 components: `ngtcp2` itself, `nghttp3` and a QUIC supporting TLS library. The supported TLS libraries are covered below. + +While any version of `ngtcp2` and `nghttp3` from v1.0.0 on are expected to +work, using the latest versions often brings functional and performance +improvements. + +The build examples use `$NGHTTP3_VERSION` and `$NGTCP2_VERSION` as placeholders +for the version you build. + +## Build with OpenSSL + +OpenSSL v3.5.0+ offers APIs for integration with *ngtcp2* v1.12.0+. Earlier +versions do not work. + +Build OpenSSL (version 3.5.0 or newer): + + % git clone --quiet --depth=1 -b openssl-$OPENSSL_VERSION https://github.com/openssl/openssl + % cd openssl + % ./config --prefix= --libdir=lib + % make + % make install + +Build nghttp3: + + % cd .. + % git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3 + % cd nghttp3 + % git submodule update --init + % autoreconf -fi + % ./configure --prefix= --enable-lib-only + % make + % make install + +Build ngtcp2: + + % cd .. + % git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2 + % cd ngtcp2 + % autoreconf -fi + % ./configure PKG_CONFIG_PATH=/lib/pkgconfig:/lib/pkgconfig LDFLAGS="-Wl,-rpath,/lib" --prefix= --enable-lib-only --with-openssl + % make + % make install + +Build curl: + + % cd .. + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % LDFLAGS="-Wl,-rpath,/lib" ./configure --with-openssl= --with-nghttp3= --with-ngtcp2= + % make + % make install + +## Build with quictls + +OpenSSL does not offer the required APIs for building a QUIC client. You need +to use a TLS library that has such APIs and that works with *ngtcp2*. + +Build quictls (any `+quic` tagged version works): + + % git clone --depth 1 -b openssl-3.1.4+quic https://github.com/quictls/openssl + % cd openssl + % ./config enable-tls1_3 --prefix= --libdir=lib + % make + % make install + +Build nghttp3: + + % cd .. + % git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3 + % cd nghttp3 + % git submodule update --init + % autoreconf -fi + % ./configure --prefix= --enable-lib-only + % make + % make install + +Build ngtcp2: + + % cd .. + % git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2 + % cd ngtcp2 + % autoreconf -fi + % ./configure PKG_CONFIG_PATH=/lib/pkgconfig:/lib/pkgconfig LDFLAGS="-Wl,-rpath,/lib" --prefix= --enable-lib-only + % make + % make install + +Build curl: + + % cd .. + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % LDFLAGS="-Wl,-rpath,/lib" ./configure --with-openssl= --with-nghttp3= --with-ngtcp2= + % make + % make install + +## Build with GnuTLS + +Build GnuTLS: + + % git clone --depth 1 https://gitlab.com/gnutls/gnutls.git + % cd gnutls + % ./bootstrap + % ./configure --prefix= + % make + % make install + +Build nghttp3: + + % cd .. + % git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3 + % cd nghttp3 + % git submodule update --init + % autoreconf -fi + % ./configure --prefix= --enable-lib-only + % make + % make install + +Build ngtcp2: + + % cd .. + % git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2 + % cd ngtcp2 + % autoreconf -fi + % ./configure PKG_CONFIG_PATH=/lib/pkgconfig:/lib/pkgconfig LDFLAGS="-Wl,-rpath,/lib" --prefix= --enable-lib-only --with-gnutls + % make + % make install + +Build curl: + + % cd .. + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % ./configure --with-gnutls= --with-nghttp3= --with-ngtcp2= + % make + % make install + +## Build with wolfSSL + +Build wolfSSL: + + % git clone https://github.com/wolfSSL/wolfssl.git + % cd wolfssl + % autoreconf -fi + % ./configure --prefix= --enable-quic --enable-session-ticket --enable-earlydata --enable-psk --enable-harden --enable-altcertchains + % make + % make install + +Build nghttp3: + + % cd .. + % git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3 + % cd nghttp3 + % git submodule update --init + % autoreconf -fi + % ./configure --prefix= --enable-lib-only + % make + % make install + +Build ngtcp2: + + % cd .. + % git clone -b $NGTCP2_VERSION https://github.com/ngtcp2/ngtcp2 + % cd ngtcp2 + % autoreconf -fi + % ./configure PKG_CONFIG_PATH=/lib/pkgconfig:/lib/pkgconfig LDFLAGS="-Wl,-rpath,/lib" --prefix= --enable-lib-only --with-wolfssl + % make + % make install + +Build curl: + + % cd .. + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % ./configure --with-wolfssl= --with-nghttp3= --with-ngtcp2= + % make + % make install + +# quiche version + +quiche support is **EXPERIMENTAL** + +Since the quiche build manages its dependencies, curl can be built against the latest version. You are *probably* able to build against their main branch, but in case of problems, we recommend their latest release tag. + +## Build + +Build quiche and BoringSSL: + + % git clone --recursive -b 0.22.0 https://github.com/cloudflare/quiche + % cd quiche + % cargo build --package quiche --release --features ffi,pkg-config-meta,qlog + % ln -s libquiche.so target/release/libquiche.so.0 + % mkdir quiche/deps/boringssl/src/lib + % ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/ + +Build curl: + + % cd .. + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" --with-openssl=$PWD/../quiche/quiche/deps/boringssl/src --with-quiche=$PWD/../quiche/target/release + % make + % make install + + If `make install` results in `Permission denied` error, you need to prepend + it with `sudo`. + +# OpenSSL version + +QUIC support is **EXPERIMENTAL** + +Use OpenSSL 3.3.1 or newer (QUIC support was added in 3.3.0, with +shortcomings on some platforms like macOS). 3.4.1 or newer is recommended. +Build via: + + % cd .. + % git clone -b $OPENSSL_VERSION https://github.com/openssl/openssl + % cd openssl + % ./config enable-tls1_3 --prefix= --libdir=lib + % make + % make install + +Build nghttp3: + + % cd .. + % git clone -b $NGHTTP3_VERSION https://github.com/ngtcp2/nghttp3 + % cd nghttp3 + % git submodule update --init + % autoreconf -fi + % ./configure --prefix= --enable-lib-only + % make + % make install + +Build curl: + + % cd .. + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % LDFLAGS="-Wl,-rpath,/lib" ./configure --with-openssl= --with-openssl-quic --with-nghttp3= + % make + % make install + +You can build curl with cmake: + + % cd .. + % git clone https://github.com/curl/curl + % cd curl + % cmake -B bld -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON + % cmake --build bld + % cmake --install bld + + If `make install` results in `Permission denied` error, you need to prepend + it with `sudo`. + +# msh3 (msquic) version + +**Note**: The msquic HTTP/3 backend is immature and is not properly functional +one as of September 2023. Feel free to help us test it and improve it, but +there is no point in filing bugs about it just yet. + +msh3 support is **EXPERIMENTAL** + +## Build Linux (with quictls fork of OpenSSL) + +Build msh3: + + % git clone -b v0.6.0 --depth 1 --recursive https://github.com/nibanks/msh3 + % cd msh3 && mkdir build && cd build + % cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo .. + % cmake --build . + % cmake --install . + +Build curl: + + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % ./configure LDFLAGS="-Wl,-rpath,/usr/local/lib" --with-msh3=/usr/local --with-openssl + % make + % make install + +Run from `/usr/local/bin/curl`. + +## Build Windows + +Build msh3: + + % git clone -b v0.6.0 --depth 1 --recursive https://github.com/nibanks/msh3 + % cd msh3 && mkdir build && cd build + % cmake -G 'Visual Studio 17 2022' -DCMAKE_BUILD_TYPE=RelWithDebInfo .. + % cmake --build . --config Release + % cmake --install . --config Release + +**Note** - On Windows, Schannel is used for TLS support by default. If you +with to use (the quictls fork of) OpenSSL, specify the `-DQUIC_TLS=openssl` +option to the generate command above. Also note that OpenSSL brings with it an +additional set of build dependencies not specified here. + +Build curl (in [Visual Studio Command +prompt](../winbuild/README.md#open-a-command-prompt)): + + % git clone https://github.com/curl/curl + % cd curl/winbuild + % nmake /f Makefile.vc mode=dll WITH_MSH3=dll MSH3_PATH="C:/Program Files/msh3" MACHINE=x64 + +Run in the `C:/Program Files/msh3/lib` directory, copy `curl.exe` to that +directory, or copy `msquic.dll` and `msh3.dll` from that directory to the +`curl.exe` directory. For example: + + % C:\Program Files\msh3\lib> F:\curl\builds\libcurl-vc-x64-release-dll-ipv6-sspi-schannel-msh3\bin\curl.exe --http3 https://curl.se/ + +# `--http3` + +Use only HTTP/3: + + % curl --http3-only https://example.org:4433/ + +Use HTTP/3 with fallback to HTTP/2 or HTTP/1.1 (see "HTTPS eyeballing" below): + + % curl --http3 https://example.org:4433/ + +Upgrade via Alt-Svc: + + % curl --alt-svc altsvc.cache https://curl.se/ + +See this [list of public HTTP/3 servers](https://bagder.github.io/HTTP3-test/) + +### HTTPS eyeballing + +With option `--http3` curl attempts earlier HTTP versions as well should the +connect attempt via HTTP/3 not succeed "fast enough". This strategy is similar +to IPv4/6 happy eyeballing where the alternate address family is used in +parallel after a short delay. + +The IPv4/6 eyeballing has a default of 200ms and you may override that via +`--happy-eyeballs-timeout-ms value`. Since HTTP/3 is still relatively new, we +decided to use this timeout also for the HTTP eyeballing - with a slight +twist. + +The `happy-eyeballs-timeout-ms` value is the **hard** timeout, meaning after +that time expired, a TLS connection is opened in addition to negotiate HTTP/2 +or HTTP/1.1. At half of that value - currently - is the **soft** timeout. The +soft timeout fires, when there has been **no data at all** seen from the +server on the HTTP/3 connection. + +So, without you specifying anything, the hard timeout is 200ms and the soft is 100ms: + + * Ideally, the whole QUIC handshake happens and curl has an HTTP/3 connection + in less than 100ms. + * When QUIC is not supported (or UDP does not work for this network path), no + reply is seen and the HTTP/2 TLS+TCP connection starts 100ms later. + * In the worst case, UDP replies start before 100ms, but drag on. This starts + the TLS+TCP connection after 200ms. + * When the QUIC handshake fails, the TLS+TCP connection is attempted right + away. For example, when the QUIC server presents the wrong certificate. + +The whole transfer only fails, when **both** QUIC and TLS+TCP fail to +handshake or time out. + +Note that all this happens in addition to IP version happy eyeballing. If the +name resolution for the server gives more than one IP address, curl tries all +those until one succeeds - just as with all other protocols. If those IP +addresses contain both IPv6 and IPv4, those attempts happen, delayed, in +parallel (the actual eyeballing). + +## Known Bugs + +Check out the [list of known HTTP3 bugs](https://curl.se/docs/knownbugs.html#HTTP3). + +# HTTP/3 Test server + +This is not advice on how to run anything in production. This is for +development and experimenting. + +## Prerequisite(s) + +An existing local HTTP/1.1 server that hosts files. Preferably also a few huge +ones. You can easily create huge local files like `truncate -s=8G 8GB` - they +are huge but do not occupy that much space on disk since they are just big +holes. + +In a Debian setup you can install apache2. It runs on port 80 and has a +document root in `/var/www/html`. Download the 8GB file from apache with `curl +localhost/8GB -o dev/null` + +In this description we setup and run an HTTP/3 reverse-proxy in front of the +HTTP/1 server. + +## Setup + +You can select either or both of these server solutions. + +### nghttpx + +Get, build and install quictls, nghttp3 and ngtcp2 as described +above. + +Get, build and install nghttp2: + + % git clone https://github.com/nghttp2/nghttp2.git + % cd nghttp2 + % autoreconf -fi + % PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/daniel/build-quictls/lib/pkgconfig:/home/daniel/build-nghttp3/lib/pkgconfig:/home/daniel/build-ngtcp2/lib/pkgconfig LDFLAGS=-L/home/daniel/build-quictls/lib CFLAGS=-I/home/daniel/build-quictls/include ./configure --enable-maintainer-mode --prefix=/home/daniel/build-nghttp2 --disable-shared --enable-app --enable-http3 --without-jemalloc --without-libxml2 --without-systemd + % make && make install + +Run the local h3 server on port 9443, make it proxy all traffic through to +HTTP/1 on localhost port 80. For local toying, we can just use the test cert +that exists in curl's test dir. + + % CERT=/path/to/stunnel.pem + % $HOME/bin/nghttpx $CERT $CERT --backend=localhost,80 \ + --frontend="localhost,9443;quic" + +### Caddy + +[Install Caddy](https://caddyserver.com/docs/install). For easiest use, the binary +should be either in your PATH or your current directory. + +Create a `Caddyfile` with the following content: +~~~ +localhost:7443 { + respond "Hello, world! you are using {http.request.proto}" +} +~~~ + +Then run Caddy: + + % ./caddy start + +Making requests to `https://localhost:7443` should tell you which protocol is being used. + +You can change the hard-coded response to something more useful by replacing `respond` +with `reverse_proxy` or `file_server`, for example: `reverse_proxy localhost:80` diff --git a/curl/docs/HTTPSRR.md b/curl/docs/HTTPSRR.md new file mode 100644 index 000000000..22184a253 --- /dev/null +++ b/curl/docs/HTTPSRR.md @@ -0,0 +1,100 @@ + + +# HTTPS RR + +[RFC 9460](https://www.rfc-editor.org/rfc/rfc9460.html) documents the HTTPS +DNS Resource Record. + +curl features **experimental** support for HTTPS RR. + +- The ALPN list from the record is parsed and used +- The ECH field is stored - and used if ECH is enabled in the build +- The port number is not used (Firefox supports it, Chrome does not) +- The target name is not used +- The IP addresses (`Ipv6hints`, `Ipv4hints`) from the HTTPS RR are not used +- It only supports a single HTTPS RR per hostname +- Hostnames without A/AAAA records but *with* HTTPS RR fails +- consider service profiles where the RR provides different addresses for TCP + vs QUIC etc + +`HTTPSRR` is listed as a feature in the `curl -V` output if curl contains +HTTPS RR support. If c-ares is not included in the build, the HTTPS RR support +is limited to DoH. + +`asyn-rr` is listed as a feature in the `curl -V` output if c-ares is used for +additional resolves in addition to a "normal" resolve done with the threaded +resolver. + +The data extracted from the HTTPS RR is stored in the in-memory DNS cache to +be reused on subsequent uses of the same hostnames. + +## limitations + +We have decided to work on the HTTPS RR support by following what seems to be +(widely) used, and simply wait with implementing the details of the record +that do not seem to be deployed. HTTPS RR is a DNS field with many odd corners +and complexities and we might as well avoid them if no one seems to want them. + +## build + + ./configure --enable-httpsrr + +or + + cmake -DUSE_HTTPSRR=ON + +## ALPN + +The list of ALPN IDs is parsed but may not be completely respected because of +what the HTTP version preference is set to, which is a problem we are working +on. Also, getting an `HTTP/1.1` ALPN in the HTTPS RR field for an HTTP:// +transfer should imply switching to HTTPS, HSTS style. Which curl currently +does not. + +## DoH + +When HTTPS RR is enabled in the curl build, The DoH code asks for an HTTPS +record in addition to the A and AAAA records, and if an HTTPS RR answer is +returned, curl parses it and stores the retrieved information. + +## Non-DoH + +If DoH is not used for name resolving in an HTTPS RR enabled build, we must +provide the ability using the regular resolver backends. We use the c-ares DNS +library for the HTTPS RR lookup. Version 1.28.0 or later. + +### c-ares + +If curl is built to use the c-ares library for name resolves, an HTTPS RR +enabled build makes a request for the HTTPS RR in addition to the regular +lookup. + +### Threaded resolver + +When built to use the threaded resolver, which is the default, an HTTPS RR +build still needs a c-ares installation provided so that a separate request +for the HTTPS record can be done in parallel to the regular getaddrinfo() +call. + +This is done by specifying both c-ares and threaded resolver to configure: + + ./configure --enable-ares=... --enable-threaded-resolver + +or to cmake: + + cmake -DENABLE_ARES=ON -DENABLE_THREADED_RESOLVER=ON + +Because the HTTPS record is handled separately from the A/AAAA record +retrieval, by a separate library, there is a small risk for discrepancies. + +When building curl using the threaded resolver with HTTPS RR support (using +c-ares), the `curl -V` output looks exactly like a c-ares resolver build. + +## HTTPS RR Options + +Because curl is a low level transfer tool for which users sometimes want +detailed control, we need to offer options to control HTTPS RR use. diff --git a/curl/docs/INFRASTRUCTURE.md b/curl/docs/INFRASTRUCTURE.md new file mode 100644 index 000000000..13240b31b --- /dev/null +++ b/curl/docs/INFRASTRUCTURE.md @@ -0,0 +1,209 @@ + + +# Infrastructure in the curl project + +Overview of infrastructure we maintain, host and run in the project for the +project. + +## git repository + +Since 2010, the main curl git repository has been hosted by GitHub, available +at https://github.com/curl/curl. + +We also use the issue tracker, pull requests and discussions on GitHub. + +curl has an "enterprise account" on GitHub and is an "organization" on the +site. + +We accept sponsorship via GitHub Sponsors. + +## CI services + +For every pull request and git push to the master repository, a number of +build and testing jobs are run on a set of different CI services. The exact +services vary over time. GitHub Actions and AppVeyor are the primary ones +these days. + +## Test Clutch + +A [Test Clutch](https://github.com/dfandrich/testclutch) instance generates +regular reports on curl CI test results at https://testclutch.curl.se/ as well +as writing comments on curl pull requests whose tests have failed. The jobs +are hosted on a Virtuozzo Application Platform PaaS instance and is managed by +Dan Fandrich. The configuration code is available and managed at +https://github.com/dfandrich/testclutch-curl-web + +## Autobuilds + +The curl autobuild system is a set of scripts that build and test curl and +send all output logs back to the autobuild server. The results are +continuously collected and visualized on the curl website at +. + +The autobuild system and server is maintained by Daniel Stenberg. + +## OSS-Fuzz + +Google runs the [OSS-Fuzz](https://google.github.io/oss-fuzz/) project which +also runs fuzzing on curl code, non-stop, in their infrastructure and they +send us emails in the rare instances they actually find something. + +OSS-Fuzz notifies those that are members in the "curl team". Any curl +maintainer who wants to is welcome to participate. It requires a Google +account. + +## Coverity + +We regularly run our code through the [Coverity static code +analyzer](https://scan.coverity.com/) thanks to them offering this service to +us for free. + +## CodeSonar + +[CodeSonar](https://codesecure.com/our-products/codesonar/) analyzes the curl +source code daily and emails Daniel Stenberg whenever it finds suspected +problems in the source code. I hope and expect that we can invite other +maintainers to access these reports soon. + +## Domain names + +The project runs services and website using a few different curl related +domain names, including `curl.se` and `curl.dev`. Daniel Stenberg owns these +domain names. + +Until a few years ago, the curl website was present at `curl.haxx.se`. The +`haxx.se` domain is owned by Haxx AB, administrated by Daniel Stenberg. The +curl.haxx.se name is meant to keep working and be redirecting to curl.se for +the foreseeable future. + +## Websites + +The main curl website at `curl.se` is maintained by curl maintainers and the +content is available and managed at https://github.com/curl/curl-www. The site +updates from git and runs make every 20 minutes. Any change pushed to git can +thus take up to 20 minutes until it takes effect on the origin server. + +The content on `curl.dev` is available and managed at +https://github.com/curl/curl.dev/ + +The content on `everything-curl.dev` is available and managed at +https://github.com/curl/everything-curl/ + +The machine hosting the website contents for these three sites is owned by +Haxx AB and is primarily managed by Daniel Stenberg (co-owner of the Haxx +company). The machine is physically located in Sweden. + +curl release tarballs are hosted on https://curl.se/download.html. They are +uploaded there at release-time by the release manager. + +curl-for-win downloads are hosted on https://curl.se/windows and are uploaded +to the server by Viktor Szakats. + +curl-for-QNX downloads are hosted on and are uploaded to +the server by Daniel Stenberg. + +Daily release tarball-like snapshots are generated automatically and are +provided for download at . + +CA certificate bundles are extracted from the Firefox source code, hosted by +Mozilla and converted to PEM file format and is offered for download. The +conversion checks for updates daily. The bundle is provided for download at +. + +There is an automated "download check bot" that runs twice daily to scan for +available curl downloads to populate the curl download page appropriately with +the correct updated information. The bot uses URLs and patterns for all +download packages and is maintained in a database, maintained by Daniel +Stenberg and Dan Fandrich. + +The TLS certificate for the origin curl web server is automatically updated +from Let's Encrypt. + +## CDN + +Fastly runs the Content Delivery Network (CDN) that fronts all the curl +websites. The CDN caches content that it gets from the origin server. +Recently, roughly 99.99% of web requests are satisfied by the CDN without +having to reach the origin. + +The CDN caches different content at different lengths depending on the +content-type. The caching thus adds to the time for a change to have an effect +on the site from the moment it gets pushed to the git repository. + +Using this setup, we provide four IPv4 addresses and eight IPv6 addresses for +anycast access to the site. Should be snappy from virtually everywhere across +the globe. + +The CDN servers support HTTP/1, HTTP/2 and HTTP/3. They set HSTS for a year. +The `HTTP://` version of the site redirects to `HTTPS://`. + +Fastly manages the TLS certificates from Let's Encrypt for the servers they +run on the behalf of curl. + +## Containers + +The curl project offer container builds of curl. The source repository for +them is located at . + +Container images are hosted at and + + +## DNS + +The primary domain name, `curl.se` is managed by Kirei and is offered over +fault-tolerant anycast servers. High availability and fast access for +everyone. + +The actual physical DNS files and origin bind instance is managed by Daniel +Stenberg. + +## Mailing lists + +The curl related mailing lists are hosted by Haxx AB on `lists.haxx.se` and +are maintained by Daniel Stenberg. This includes the mailman2 and Postfix +instances used for this. + +## Email + +We use a few rare additional curl related email aliases in the curl domains. +They go through the mail server `mail.haxx.se` maintained by Daniel Stenberg + +## Bug-bounty + +We run a [bug-bounty](https://curl.se/docs/bugbounty.html) on HackerOne. The +setup runs entirely at https://hackerone.com/curl. + +The money part for the bug bounty is sponsored by the [Internet Bug +Bounty](https://hackerone.com/ibb). + +## Open Collective + +We use [Open Collective](https://opencollective.com/curl) as our "fiscal +host". All money sent to and received by the curl project is managed by Open +Collective. + +## Merchandise + +We have stickers, coffee mugs and coasters. They are managed by Daniel who +sits on the inventory. The best way to get your hands on curl merchandise is +to attend events where Daniel is physically. + +## Chat + +Some curl developers, maintainers, users and enthusiasts use IRC for real-time +chat about curl and related topics. This done in the `#curl` channel on the +`libra.chat` IRC network. **Daniel Stenberg** (`bagder`) is registered owner +of the channel. We do not run any IRC servers or services ourselves. + +`curelbot` is a service in the channel that shows details about GitHub issues +and pull requests when publicly mentioned using #[number]. The bot is run by +user `TheAssassin`. + +There is a Matrix bridge to the IRC channel called `matrix.curl.se`. The +bridge is setup and run by **Sergio Durigan Junior** and **Daniel Stenberg**. + +[curl online chat documentation](https://curl.se/docs/irc.html) diff --git a/curl/docs/INSTALL-CMAKE.md b/curl/docs/INSTALL-CMAKE.md new file mode 100644 index 000000000..6f8a914d7 --- /dev/null +++ b/curl/docs/INSTALL-CMAKE.md @@ -0,0 +1,607 @@ + + +# Building with CMake + +This document describes how to configure, build and install curl and libcurl +from source code using the CMake build tool. To build with CMake, you of +course first have to install CMake. The minimum required version of CMake is +specified in the file `CMakeLists.txt` found in the top of the curl source +tree. Once the correct version of CMake is installed you can follow the +instructions below for the platform you are building on. + +CMake builds can be configured either from the command line, or from one of +CMake's GUIs. + +# Configuring + +A CMake configuration of curl is similar to the autotools build of curl. +It consists of the following steps after you have unpacked the source. + +We recommend building with CMake on Windows. For instructions on migrating +from the `projects/Windows` Visual Studio solution files, see +[this section](#migrating-from-visual-studio-ide-project-files). For +instructions on migrating from the winbuild builds, see +[the following section](#migrating-from-winbuild-builds). + +## Using `cmake` + +You can configure for in source tree builds or for a build tree +that is apart from the source tree. + + - Build in the source tree. + + $ cmake -B . + + - Build in a separate directory (parallel to the curl source tree in this + example). The build directory is created for you. This is recommended over + building in the source tree to separate source and build artifacts. + + $ cmake -B ../curl-build + +For the full list of CMake build configuration variables see +[the corresponding section](#cmake-build-options). + +### Fallback for CMake before version 3.13 + +CMake before version 3.13 does not support the `-B` option. In that case, +you must create the build directory yourself, `cd` to it and run `cmake` +from there: + + $ mkdir ../curl-build + $ cd ../curl-build + $ cmake ../curl + +If you want to build in the source tree, it is enough to do this: + + $ cmake . + +### Build system generator selection + +You can override CMake's default by using `-G `. For example +on Windows with multiple build systems if you have MinGW-w64 then you could use +`-G "MinGW Makefiles"`. +[List of generator names](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html). + +## Using `ccmake` + +CMake comes with a curses based interface called `ccmake`. To run `ccmake` +on a curl use the instructions for the command line cmake, but substitute +`ccmake` for `cmake`. + +This brings up a curses interface with instructions on the bottom of the +screen. You can press the "c" key to configure the project, and the "g" key to +generate the project. After the project is generated, you can run make. + +## Using `cmake-gui` + +CMake also comes with a Qt based GUI called `cmake-gui`. To configure with +`cmake-gui`, you run `cmake-gui` and follow these steps: + + 1. Fill in the "Where is the source code" combo box with the path to + the curl source tree. + 2. Fill in the "Where to build the binaries" combo box with the path to + the directory for your build tree, ideally this should not be the same + as the source tree, but a parallel directory called curl-build or + something similar. + 3. Once the source and binary directories are specified, press the + "Configure" button. + 4. Select the native build tool that you want to use. + 5. At this point you can change any of the options presented in the GUI. + Once you have selected all the options you want, click the "Generate" + button. + +# Building + +Build (you have to specify the build directory). + + $ cmake --build ../curl-build + +## Static builds + +The CMake build setup is primarily done to work with shared/dynamic third +party dependencies. When linking with shared libraries, the dependency "chain" +is handled automatically by the library loader - on all modern systems. + +If you instead link with a static library, you need to provide all the +dependency libraries already at the link command line. + +Figuring out all the dependency libraries for a given library is hard, as it +might involve figuring out the dependencies of the dependencies and they vary +between platforms and can change between versions. + +When using static dependencies, the build scripts mostly assume that you, the +user, provide all the necessary additional dependency libraries as additional +arguments in the build. + +Building statically is not for the faint of heart. + +### Fallback for CMake before version 3.13 + +CMake before version 3.13 does not support the `--build` option. In that +case, you have to `cd` to the build directory and use the building tool that +corresponds to the build files that CMake generated for you. This example +assumes that CMake generates `Makefile`: + + $ cd ../curl-build + $ make + +# Testing + +(The test suite does not yet work with the cmake build) + +# Installing + +Install to default location (you have to specify the build directory). + + $ cmake --install ../curl-build + +Do not use `--prefix` to change the installation prefix as the output produced +by the `curl-config` script is determined at CMake configure time. If you want +to set a custom install prefix for curl, set +[`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) +when configuring the CMake build. + +### Fallback for CMake before version 3.15 + +CMake before version 3.15 does not support the `--install` option. In that +case, you have to `cd` to the build directory and use the building tool that +corresponds to the build files that CMake generated for you. This example +assumes that CMake generates `Makefile`: + + $ cd ../curl-build + $ make install + +# CMake usage + +Just as curl can be built and installed using CMake, it can also be used from +CMake. + +## Using `find_package` + +To locate libcurl from CMake, one can use the standard +[`find_package`](https://cmake.org/cmake/help/latest/command/find_package.html) +command in the typical fashion: + +```cmake +find_package(CURL 8.12.0 REQUIRED) # FATAL_ERROR if CURL is not found +``` + +This invokes the CMake-provided +[FindCURL](https://cmake.org/cmake/help/latest/module/FindCURL.html) find module, +which first performs a search using the `find_package` +[config mode](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure). +This is supported by the `CURLConfig.cmake` CMake config script which is +available if the given CURL was built and installed using CMake. + +### Detecting CURL features/protocols + +Since version 8.12.0, `CURLConfig.cmake` publishes the supported CURL features +and protocols (see [release notes](https://curl.se/ch/8.12.0.html)). These can +be specified using the `find_package` keywords `COMPONENTS` and +`OPTIONAL_COMPONENTS`, with protocols in all caps, e.g. `HTTPS`, `LDAP`, while +features should be in their original sentence case, e.g. `AsynchDNS`, +`UnixSockets`. If any of the `COMPONENTS` are missing, then CURL is considered +as *not* found. + +Here is an example of using `COMPONENTS` and `OPTIONAL_COMPONENTS` in +`find_package` with CURL: + +```cmake +# CURL_FOUND is FALSE if no HTTPS but brotli and zstd can be missing +find_package(CURL 8.12.0 COMPONENTS HTTPS OPTIONAL_COMPONENTS brotli zstd) +``` + +One can also check the defined `CURL_SUPPORTS_` variables +if a particular feature/protocol is supported. For example: + +```cmake +# check HTTPS +if(CURL_SUPPORTS_HTTPS) + message(STATUS "CURL supports HTTPS") +else() + message(STATUS "CURL does NOT support HTTPS") +endif() +``` + +### Linking against libcurl + +To link a CMake target against libcurl one can use +[`target_link_libraries`](https://cmake.org/cmake/help/latest/command/target_link_libraries.html) +as usual: + +```cmake +target_link_libraries(my_target PRIVATE CURL::libcurl) +``` + +# CMake build options + +- `BUILD_CURL_EXE`: Build curl executable. Default: `ON` +- `BUILD_EXAMPLES`: Build libcurl examples. Default: `ON` +- `BUILD_LIBCURL_DOCS`: Build libcurl man pages. Default: `ON` +- `BUILD_MISC_DOCS`: Build misc man pages (e.g. `curl-config` and `mk-ca-bundle`). Default: `ON` +- `BUILD_SHARED_LIBS`: Build shared libraries. Default: `ON` +- `BUILD_STATIC_CURL`: Build curl executable with static libcurl. Default: `OFF` +- `BUILD_STATIC_LIBS`: Build static libraries. Default: `OFF` +- `BUILD_TESTING`: Build tests. Default: `ON` +- `CURL_CLANG_TIDY`: Run the build through `clang-tidy`. Default: `OFF` +- `CURL_CLANG_TIDYFLAGS`: Custom options to pass to `clang-tidy`. Default: (empty) +- `CURL_COMPLETION_FISH`: Install fish completions. Default: `OFF` +- `CURL_COMPLETION_FISH_DIR`: Custom fish completion install directory. +- `CURL_COMPLETION_ZSH`: Install zsh completions. Default: `OFF` +- `CURL_COMPLETION_ZSH_DIR`: Custom zsh completion install directory. +- `CURL_DEFAULT_SSL_BACKEND`: Override default TLS backend in MultiSSL builds. + Accepted values in order of default priority: + `wolfssl`, `gnutls`, `mbedtls`, `openssl`, `schannel`, `rustls` +- `CURL_ENABLE_EXPORT_TARGET`: Enable CMake export target. Default: `ON` +- `CURL_HIDDEN_SYMBOLS`: Hide libcurl internal symbols (=hide all symbols that are not officially external). Default: `ON` +- `CURL_LIBCURL_SOVERSION`: Enable libcurl SOVERSION. Default: `ON` for supported platforms +- `CURL_LIBCURL_VERSIONED_SYMBOLS`: Enable libcurl versioned symbols. Default: `OFF` +- `CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX`: Override default versioned symbol prefix. Default: `_` or `MULTISSL_` +- `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF` +- `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`) (requires UCRT, static libcurl or no curl executable). Default: `OFF` +- `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string. +- `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF` +- `ENABLE_CURLDEBUG`: Enable TrackMemory debug feature. Default: =`ENABLE_DEBUG` +- `ENABLE_CURL_MANUAL`: Build the man page for curl and enable its `-M`/`--manual` option. Default: `ON` +- `ENABLE_DEBUG`: Enable curl debug features (for developing curl itself). Default: `OFF` +- `IMPORT_LIB_SUFFIX`: Import library suffix. Default: `_imp` for MSVC-like toolchains, otherwise empty. +- `LIBCURL_OUTPUT_NAME`: Basename of the curl library. Default: `libcurl` +- `PICKY_COMPILER`: Enable picky compiler options. Default: `ON` +- `SHARE_LIB_OBJECT`: Build shared and static libcurl in a single pass (requires CMake 3.12 or newer). Default: `ON` for Windows +- `STATIC_LIB_SUFFIX`: Static library suffix. Default: (empty) + +## CA bundle options + +- `CURL_CA_BUNDLE`: Path to the CA bundle. Set `none` to disable or `auto` for auto-detection. Default: `auto` +- `CURL_CA_EMBED`: Path to the CA bundle to embed in the curl tool. Default: (disabled) +- `CURL_CA_FALLBACK`: Use built-in CA store of TLS backend. Default: `OFF` +- `CURL_CA_PATH`: Location of default CA path. Set `none` to disable or `auto` for auto-detection. Default: `auto` +- `CURL_CA_SEARCH_SAFE`: Enable safe CA bundle search (within the curl tool directory) on Windows. Default: `OFF` + +## Enabling features + +- `CURL_ENABLE_SSL`: Enable SSL support. Default: `ON` +- `CURL_WINDOWS_SSPI`: Enable SSPI on Windows. Default: =`CURL_USE_SCHANNEL` +- `ENABLE_IPV6`: Enable IPv6 support. Default: `ON` if target supports IPv6. +- `ENABLE_THREADED_RESOLVER`: Enable threaded DNS lookup. Default: `ON` if c-ares is not enabled and target supports threading. +- `ENABLE_UNICODE`: Use the Unicode version of the Windows API functions. Default: `OFF` +- `ENABLE_UNIX_SOCKETS`: Enable Unix domain sockets support. Default: `ON` +- `USE_ECH`: Enable ECH support. Default: `OFF` +- `USE_HTTPSRR`: Enable HTTPS RR support. Default: `OFF` +- `USE_OPENSSL_QUIC`: Use OpenSSL and nghttp3 libraries for HTTP/3 support. Default: `OFF` +- `USE_SSLS_EXPORT`: Enable experimental SSL session import/export. Default: `OFF` + +## Disabling features + +- `CURL_DISABLE_ALTSVC`: Disable alt-svc support. Default: `OFF` +- `CURL_DISABLE_AWS`: Disable **aws-sigv4**. Default: `OFF` +- `CURL_DISABLE_BASIC_AUTH`: Disable Basic authentication. Default: `OFF` +- `CURL_DISABLE_BEARER_AUTH`: Disable Bearer authentication. Default: `OFF` +- `CURL_DISABLE_BINDLOCAL`: Disable local binding support. Default: `OFF` +- `CURL_DISABLE_CA_SEARCH`: Disable unsafe CA bundle search in PATH on Windows. Default: `OFF` +- `CURL_DISABLE_COOKIES`: Disable cookies support. Default: `OFF` +- `CURL_DISABLE_DICT`: Disable DICT. Default: `OFF` +- `CURL_DISABLE_DIGEST_AUTH`: Disable Digest authentication. Default: `OFF` +- `CURL_DISABLE_DOH`: Disable DNS-over-HTTPS. Default: `OFF` +- `CURL_DISABLE_FILE`: Disable FILE. Default: `OFF` +- `CURL_DISABLE_FORM_API`: Disable **form-api**. Default: =`CURL_DISABLE_MIME` +- `CURL_DISABLE_FTP`: Disable FTP. Default: `OFF` +- `CURL_DISABLE_GETOPTIONS`: Disable `curl_easy_options` API for existing options to `curl_easy_setopt`. Default: `OFF` +- `CURL_DISABLE_GOPHER`: Disable Gopher. Default: `OFF` +- `CURL_DISABLE_HEADERS_API`: Disable **headers-api** support. Default: `OFF` +- `CURL_DISABLE_HSTS`: Disable HSTS support. Default: `OFF` +- `CURL_DISABLE_HTTP`: Disable HTTP. Default: `OFF` +- `CURL_DISABLE_HTTP_AUTH`: Disable all HTTP authentication methods. Default: `OFF` +- `CURL_DISABLE_IMAP`: Disable IMAP. Default: `OFF` +- `CURL_DISABLE_INSTALL`: Disable installation targets. Default: `OFF` +- `CURL_DISABLE_IPFS`: Disable IPFS. Default: `OFF` +- `CURL_DISABLE_KERBEROS_AUTH`: Disable Kerberos authentication. Default: `OFF` +- `CURL_DISABLE_LDAP`: Disable LDAP. Default: `OFF` +- `CURL_DISABLE_LDAPS`: Disable LDAPS. Default: =`CURL_DISABLE_LDAP` +- `CURL_DISABLE_LIBCURL_OPTION`: Disable `--libcurl` option from the curl tool. Default: `OFF` +- `CURL_DISABLE_MIME`: Disable MIME support. Default: `OFF` +- `CURL_DISABLE_MQTT`: Disable MQTT. Default: `OFF` +- `CURL_DISABLE_NEGOTIATE_AUTH`: Disable negotiate authentication. Default: `OFF` +- `CURL_DISABLE_NETRC`: Disable netrc parser. Default: `OFF` +- `CURL_DISABLE_NTLM`: Disable NTLM support. Default: `OFF` +- `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG`: Disable automatic loading of OpenSSL configuration. Default: `OFF` +- `CURL_DISABLE_PARSEDATE`: Disable date parsing. Default: `OFF` +- `CURL_DISABLE_POP3`: Disable POP3. Default: `OFF` +- `CURL_DISABLE_PROGRESS_METER`: Disable built-in progress meter. Default: `OFF` +- `CURL_DISABLE_PROXY`: Disable proxy support. Default: `OFF` +- `CURL_DISABLE_RTSP`: Disable RTSP. Default: `OFF` +- `CURL_DISABLE_SHA512_256`: Disable SHA-512/256 hash algorithm. Default: `OFF` +- `CURL_DISABLE_SHUFFLE_DNS`: Disable shuffle DNS feature. Default: `OFF` +- `CURL_DISABLE_SMB`: Disable SMB. Default: `OFF` +- `CURL_DISABLE_SMTP`: Disable SMTP. Default: `OFF` +- `CURL_DISABLE_SOCKETPAIR`: Disable use of socketpair for curl_multi_poll. Default: `OFF` +- `CURL_DISABLE_SRP`: Disable TLS-SRP support. Default: `OFF` +- `CURL_DISABLE_TELNET`: Disable Telnet. Default: `OFF` +- `CURL_DISABLE_TFTP`: Disable TFTP. Default: `OFF` +- `CURL_DISABLE_VERBOSE_STRINGS`: Disable verbose strings. Default: `OFF` +- `CURL_DISABLE_WEBSOCKETS`: Disable WebSocket. Default: `OFF` +- `HTTP_ONLY`: Disable all protocols except HTTP (This overrides all `CURL_DISABLE_*` options). Default: `OFF` + +## Environment + +- `CI`: Assume running under CI if set. +- `CURL_BUILDINFO`: Print `buildinfo.txt` if set. +- `CURL_CI`: Assume running under CI if set. + +## CMake options + +- `CMAKE_BUILD_TYPE`: (see CMake) +- `CMAKE_DEBUG_POSTFIX`: Default: `-d` +- `CMAKE_IMPORT_LIBRARY_SUFFIX` (see CMake) +- `CMAKE_INSTALL_BINDIR` (see CMake) +- `CMAKE_INSTALL_INCLUDEDIR` (see CMake) +- `CMAKE_INSTALL_LIBDIR` (see CMake) +- `CMAKE_INSTALL_PREFIX` (see CMake) +- `CMAKE_STATIC_LIBRARY_SUFFIX` (see CMake) +- `CMAKE_UNITY_BUILD_BATCH_SIZE`: Set the number of sources in a "unity" unit. Default: `0` (all) +- `CMAKE_UNITY_BUILD`: Enable "unity" (aka jumbo) builds. Default: `OFF` + +Details via CMake +[variables](https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html) and +[install directories](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html). + +## Dependencies + +- `CURL_BROTLI`: Use brotli (`ON`, `OFF` or `AUTO`). Default: `AUTO` +- `CURL_USE_GNUTLS`: Enable GnuTLS for SSL/TLS. Default: `OFF` +- `CURL_USE_GSASL`: Use libgsasl. Default: `OFF` +- `CURL_USE_GSSAPI`: Use GSSAPI implementation. Default: `OFF` +- `CURL_USE_LIBPSL`: Use libpsl. Default: `ON` +- `CURL_USE_LIBSSH2`: Use libssh2. Default: `ON` +- `CURL_USE_LIBSSH`: Use libssh. Default: `OFF` +- `CURL_USE_LIBUV`: Use libuv for event-based tests. Default: `OFF` +- `CURL_USE_MBEDTLS`: Enable mbedTLS for SSL/TLS. Default: `OFF` +- `CURL_USE_OPENSSL`: Enable OpenSSL for SSL/TLS. Default: `ON` if no other TLS backend was enabled. +- `CURL_USE_PKGCONFIG`: Enable `pkg-config` to detect dependencies. Default: `ON` for Unix (except Android, Apple devices), vcpkg, MinGW if not cross-compiling. +- `CURL_USE_RUSTLS`: Enable Rustls for SSL/TLS. Default: `OFF` +- `CURL_USE_SCHANNEL`: Enable Windows native SSL/TLS (Schannel). Default: `OFF` +- `CURL_USE_WOLFSSH`: Use wolfSSH. Default: `OFF` +- `CURL_USE_WOLFSSL`: Enable wolfSSL for SSL/TLS. Default: `OFF` +- `CURL_ZLIB`: Use zlib (`ON`, `OFF` or `AUTO`). Default: `AUTO` +- `CURL_ZSTD`: Use zstd (`ON`, `OFF` or `AUTO`). Default: `AUTO` +- `ENABLE_ARES`: Enable c-ares support. Default: `OFF` +- `USE_APPLE_IDN`: Use Apple built-in IDN support. Default: `OFF` +- `USE_LIBIDN2`: Use libidn2 for IDN support. Default: `ON` +- `USE_LIBRTMP`: Enable librtmp from rtmpdump. Default: `OFF` +- `USE_MSH3`: Use msh3/msquic library for HTTP/3 support. Default: `OFF` +- `USE_NGHTTP2`: Use nghttp2 library. Default: `ON` +- `USE_NGTCP2`: Use ngtcp2 and nghttp3 libraries for HTTP/3 support. Default: `OFF` +- `USE_QUICHE`: Use quiche library for HTTP/3 support. Default: `OFF` +- `USE_WIN32_IDN`: Use WinIDN for IDN support. Default: `OFF` +- `USE_WIN32_LDAP`: Use Windows LDAP implementation. Default: `ON` + +## Dependency options (via CMake) + +- `OPENSSL_ROOT_DIR`: Set this variable to the root installation of OpenSSL (and forks). +- `OPENSSL_INCLUDE_DIR`: The OpenSSL include directory. +- `OPENSSL_SSL_LIBRARY`: Path to `ssl` library. With MSVC, CMake uses variables `SSL_EAY_DEBUG`/`SSL_EAY_RELEASE` instead. +- `OPENSSL_CRYPTO_LIBRARY`: Path to `crypto` library. With MSVC, CMake uses variables `LIB_EAY_DEBUG`/`LIB_EAY_RELEASE` instead. +- `OPENSSL_USE_STATIC_LIBS`: Look for static OpenSSL libraries. +- `ZLIB_INCLUDE_DIR`: The zlib include directory. +- `ZLIB_LIBRARY`: Path to `zlib` library. +- `ZLIB_USE_STATIC_LIBS`: Look for static ZLIB library (requires CMake v3.24). + +## Dependency options (tools) + +- `CLANG_TIDY`: `clang-tidy` tool used with `CURL_CLANG_TIDY=ON`. Default: `clang-tidy` +- `PERL_EXECUTABLE`: Perl binary used throughout the build and tests. + +## Dependency options (libraries) + +- `AMISSL_INCLUDE_DIR`: The AmiSSL include directory. +- `AMISSL_STUBS_LIBRARY`: Path to `amisslstubs` library. +- `AMISSL_AUTO_LIBRARY`: Path to `amisslauto` library. +- `BROTLI_INCLUDE_DIR`: The brotli include directory. +- `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library. +- `BROTLIDEC_LIBRARY`: Path to `brotlidec` library. +- `CARES_INCLUDE_DIR`: The c-ares include directory. +- `CARES_LIBRARY`: Path to `cares` library. +- `DL_LIBRARY`: Path to `dl` library. (for Rustls) +- `GSS_ROOT_DIR`: Set this variable to the root installation of GSS. (also supported as environment) +- `LDAP_LIBRARY`: Name or full path to `ldap` library. Default: `ldap` +- `LDAP_LBER_LIBRARY`: Name or full path to `lber` library. Default: `lber` +- `LDAP_INCLUDE_DIR`: Path to LDAP include directory. +- `LIBGSASL_INCLUDE_DIR`: The libgsasl include directory. +- `LIBGSASL_LIBRARY`: Path to `libgsasl` library. +- `LIBIDN2_INCLUDE_DIR`: The libidn2 include directory. +- `LIBIDN2_LIBRARY`: Path to `libidn2` library. +- `LIBPSL_INCLUDE_DIR`: The libpsl include directory. +- `LIBPSL_LIBRARY`: Path to `libpsl` library. +- `LIBRTMP_INCLUDE_DIR`: The librtmp include directory. +- `LIBRTMP_LIBRARY`: Path to `librtmp` library. +- `LIBSSH_INCLUDE_DIR`: The libssh include directory. +- `LIBSSH_LIBRARY`: Path to `libssh` library. +- `LIBSSH2_INCLUDE_DIR`: The libssh2 include directory. +- `LIBSSH2_LIBRARY`: Path to `libssh2` library. +- `LIBUV_INCLUDE_DIR`: The libuv include directory. +- `LIBUV_LIBRARY`: Path to `libuv` library. +- `MATH_LIBRARY`: Path to `m` library. (for Rustls, wolfSSL) +- `MBEDTLS_INCLUDE_DIR`: The mbedTLS include directory. +- `MBEDTLS_LIBRARY`: Path to `mbedtls` library. +- `MBEDX509_LIBRARY`: Path to `mbedx509` library. +- `MBEDCRYPTO_LIBRARY`: Path to `mbedcrypto` library. +- `MSH3_INCLUDE_DIR`: The msh3 include directory. +- `MSH3_LIBRARY`: Path to `msh3` library. +- `NGHTTP2_INCLUDE_DIR`: The nghttp2 include directory. +- `NGHTTP2_LIBRARY`: Path to `nghttp2` library. +- `NGHTTP3_INCLUDE_DIR`: The nghttp3 include directory. +- `NGHTTP3_LIBRARY`: Path to `nghttp3` library. +- `NGTCP2_INCLUDE_DIR`: The ngtcp2 include directory. +- `NGTCP2_LIBRARY`: Path to `ngtcp2` library. +- `NGTCP2_CRYPTO_BORINGSSL_LIBRARY`: Path to `ngtcp2_crypto_boringssl` library. +- `NGTCP2_CRYPTO_GNUTLS_LIBRARY`: Path to `ngtcp2_crypto_gnutls` library. +- `NGTCP2_CRYPTO_OSSL_LIBRARY`: Path to `ngtcp2_crypto_ossl` library. +- `NGTCP2_CRYPTO_QUICTLS_LIBRARY`: Path to `ngtcp2_crypto_quictls` library. +- `NGTCP2_CRYPTO_WOLFSSL_LIBRARY`: Path to `ngtcp2_crypto_wolfssl` library. +- `NETTLE_INCLUDE_DIR`: The nettle include directory. +- `NETTLE_LIBRARY`: Path to `nettle` library. +- `PTHREAD_LIBRARY`: Path to `pthread` library. (for Rustls) +- `QUICHE_INCLUDE_DIR`: The quiche include directory. +- `QUICHE_LIBRARY`: Path to `quiche` library. +- `RUSTLS_INCLUDE_DIR`: The Rustls include directory. +- `RUSTLS_LIBRARY`: Path to `rustls` library. +- `WATT_ROOT`: Set this variable to the root installation of Watt-32. +- `WOLFSSH_INCLUDE_DIR`: The wolfSSH include directory. +- `WOLFSSH_LIBRARY`: Path to `wolfssh` library. +- `WOLFSSL_INCLUDE_DIR`: The wolfSSL include directory. +- `WOLFSSL_LIBRARY`: Path to `wolfssl` library. +- `ZSTD_INCLUDE_DIR`: The zstd include directory. +- `ZSTD_LIBRARY`: Path to `zstd` library. + +## Test tools + +- `APXS`: Default: `apxs` +- `CADDY`: Default: `caddy` +- `HTTPD_NGHTTPX`: Default: `nghttpx` +- `HTTPD`: Default: `apache2` +- `TEST_NGHTTPX`: Default: `nghttpx` +- `VSFTPD`: Default: `vsftps` + +## Feature detection variables + +By default this CMake build script detects the version of some dependencies +using `check_symbol_exists`. Those checks do not work in the case that both +CURL and its dependency are included as sub-projects in a larger build using +`FetchContent`. To support that case, additional variables may be defined by +the parent project, ideally in the "extra" find package redirect file: + + +Available variables: + +- `HAVE_GNUTLS_SRP`: `gnutls_srp_verifier` present in GnuTLS. +- `HAVE_GSS_C_NT_HOSTBASED_SERVICE`: `GSS_C_NT_HOSTBASED_SERVICE` present in GSS/Heimdal/Kerberos. +- `HAVE_LDAP_INIT_FD`: `ldap_init_fd` present in LDAP library. +- `HAVE_LDAP_URL_PARSE`: `ldap_url_parse` present in LDAP library. +- `HAVE_OPENSSL_SRP`: `SSL_CTX_set_srp_username` present in OpenSSL (or fork). +- `HAVE_QUICHE_CONN_SET_QLOG_FD`: `quiche_conn_set_qlog_fd` present in quiche. +- `HAVE_RUSTLS_SUPPORTED_HPKE`: `rustls_supported_hpke` present in Rustls (unused if Rustls is detected via `pkg-config`). +- `HAVE_SSL_SET0_WBIO`: `SSL_set0_wbio` present in OpenSSL (or fork). +- `HAVE_SSL_SET1_ECH_CONFIG_LIST`: `SSL_set1_ech_config_list` present in OpenSSL (or fork). +- `HAVE_SSL_SET_QUIC_TLS_CBS`: `SSL_set_quic_tls_cbs` in OpenSSL. +- `HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT`: `SSL_set_quic_use_legacy_codepoint` in OpenSSL fork. +- `HAVE_WOLFSSL_BIO_NEW`: `wolfSSL_BIO_new` present in wolfSSL. +- `HAVE_WOLFSSL_BIO_SET_SHUTDOWN`: `wolfSSL_BIO_set_shutdown` present in wolfSSL. +- `HAVE_WOLFSSL_CTX_GENERATEECHCONFIG`: `wolfSSL_CTX_GenerateEchConfig` present in wolfSSL. +- `HAVE_WOLFSSL_DES_ECB_ENCRYPT`: `wolfSSL_DES_ecb_encrypt` present in wolfSSL. +- `HAVE_WOLFSSL_GET_PEER_CERTIFICATE`: `wolfSSL_get_peer_certificate` present in wolfSSL. +- `HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT`: + `wolfSSL_set_quic_use_legacy_codepoint` present in wolfSSL. +- `HAVE_WOLFSSL_USEALPN`: `wolfSSL_UseALPN` present in wolfSSL. + +For each of the above variables, if the variable is *defined* (either to `ON` +or `OFF`), the symbol detection is skipped. If the variable is *not defined*, +the feature detection is performed. + +Note: These variables are internal and subject to change. + +# Migrating from Visual Studio IDE Project Files + +We recommend using CMake to build curl with MSVC. + +The project build files reside in project/Windows/VC\* for VS2010, VS2012 and +VS2013. + +These CMake Visual Studio generators require CMake v3.24 or older. You can +download them from . + +You can also use `-G "NMake Makefiles"`, which is supported by all CMake +versions. + +Configuration element | Equivalent CMake options +:-------------------------------- | :-------------------------------- +`VC10` | `-G "Visual Studio 10 2010"` +`VC11` | `-G "Visual Studio 11 2012"` +`VC12` | `-G "Visual Studio 12 2013"` +`x64` | `-A x64` +`Win32` | `-A Win32` +`DLL` | `BUILD_SHARED_LIBS=ON`, `BUILD_STATIC_LIBS=OFF`, (default) +`LIB` | `BUILD_SHARED_LIBS=OFF`, `BUILD_STATIC_LIBS=ON` +`Debug` | `CMAKE_BUILD_TYPE=Debug` (`-G "NMake Makefiles"` only) +`Release` | `CMAKE_BUILD_TYPE=Release` (`-G "NMake Makefiles"` only) +`DLL Windows SSPI` | `CURL_USE_SCHANNEL=ON` (with SSPI enabled by default) +`DLL OpenSSL` | `CURL_USE_OPENSSL=ON`, optional: `OPENSSL_ROOT_DIR`, `OPENSSL_USE_STATIC_LIBS=ON` +`DLL libssh2` | `CURL_USE_LIBSSH2=ON`, optional: `LIBSSH2_INCLUDE_DIR`, `LIBSSH2_LIBRARY` +`DLL WinIDN` | `USE_WIN32_IDN=ON` + +For example these commands: + + > cd projects + > ./generate.bat VC12 + > msbuild "-property:Configuration=DLL Debug - DLL Windows SSPI - DLL WinIDN" Windows/VC12/curl-all.sln + +translate to: + + > cmake . -G "Visual Studio 12 2013" -A x64 -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON -DCURL_USE_LIBPSL=OFF + > cmake --build . --config Debug --parallel + +We do *not* specify `-DCMAKE_BUILD_TYPE=Debug` here as we might do for the +`"NMake Makefiles"` generator because the Visual Studio generators are +[multi-config generators](https://cmake.org/cmake/help/latest/prop_gbl/GENERATOR_IS_MULTI_CONFIG.html) +and therefore ignore the value of `CMAKE_BUILD_TYPE`. + +# Migrating from winbuild builds + +We recommend CMake to build curl with MSVC. The winbuild build system is +deprecated and is going to be removed in September 2025 in favor of the CMake +build system. + +In CMake you can customize the path of dependencies by passing the absolute +header path and the full path of the library via `*_INCLUDE_DIR` and +`*_LIBRARY` options (see the complete list in the option listing above). +The full path to the library can point to a static library or an import +library, which defines if the dependency is linked as a dll or statically. +For OpenSSL this works +[differently](https://cmake.org/cmake/help/latest/module/FindOpenSSL.html): +You can pass the root directory of the OpenSSL installation via +`OPENSSL_ROOT_DIR`, then pass `OPENSSL_USE_STATIC_LIBS=ON` to select static +libs. + +winbuild options | Equivalent CMake options +:-------------------------------- | :-------------------------------- +`DEBUG` | `CMAKE_BUILD_TYPE=Debug` +`GEN_PDB` | `CMAKE_EXE_LINKER_FLAGS=/Fd`, `CMAKE_SHARED_LINKER_FLAGS=/Fd` +`LIB_NAME_DLL`, `LIB_NAME_STATIC` | `IMPORT_LIB_SUFFIX`, `LIBCURL_OUTPUT_NAME`, `STATIC_LIB_SUFFIX` +`VC`: `` | see the CMake [Visual Studio generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) +`MACHINE`: `x64`, `x86` | `-A x64`, `-A Win32` +`MODE`: `dll`, `static` | `BUILD_SHARED_LIBS=ON/OFF`, `BUILD_STATIC_LIBS=ON/OFF`, `BUILD_STATIC_CURL=ON/OFF` (default: dll) +`RTLIBCFG`: `static` | `CURL_STATIC_CRT=ON` +`ENABLE_IDN` | `USE_WIN32_IDN=ON` +`ENABLE_IPV6` | `ENABLE_IPV6=ON` +`ENABLE_MSH3` | `USE_MSH3=ON` +`ENABLE_NGHTTP2` | `USE_NGHTTP2=ON` +`ENABLE_OPENSSL_AUTO_LOAD_CONFIG` | `CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=OFF` (default) +`ENABLE_SCHANNEL` | `CURL_USE_SCHANNEL=ON` +`ENABLE_SSPI` | `CURL_WINDOWS_SSPI=ON` (default with Schannel) +`ENABLE_UNICODE` | `ENABLE_UNICODE=ON` +`WITH_PREFIX` | `CMAKE_INSTALL_PREFIX=` +`WITH_DEVEL` | see individual `*_INCLUDE_DIR` and `*_LIBRARY` options and `OPENSSL_ROOT_DIR` +`WITH_CARES`, `CARES_PATH` | `ENABLE_ARES=ON`, optional: `CARES_INCLUDE_DIR`, `CARES_LIBRARY` +`WITH_MBEDTLS`, `MBEDTLS_PATH` | `CURL_USE_MBEDTLS=ON`, optional: `MBEDTLS_INCLUDE_DIR`, `MBEDTLS_LIBRARY`, `MBEDX509_LIBRARY`, `MBEDCRYPTO_LIBRARY` +`WITH_MSH3`, `MSH_PATH` | `USE_MSH3=ON`, optional: `MSH3_INCLUDE_DIR`, `MSH3_LIBRARY` +`WITH_NGHTTP2`, `NGHTTP2_PATH` | `USE_NGHTTP2=ON`, optional: `NGHTTP2_INCLUDE_DIR`, `NGHTTP2_LIBRARY` +`WITH_SSH`, `SSH_PATH` | `CURL_USE_LIBSSH=ON`, optional: `LIBSSH_INCLUDE_DIR`, `LIBSSH_LIBRARY` +`WITH_SSH2`, `SSH2_PATH` | `CURL_USE_LIBSSH2=ON`, optional: `LIBSSH2_INCLUDE_DIR`, `LIBSSH2_LIBRARY` +`WITH_SSL`, `SSL_PATH` | `CURL_USE_OPENSSL=ON`, optional: `OPENSSL_ROOT_DIR`, `OPENSSL_USE_STATIC_LIBS=ON` +`WITH_WOLFSSL`, `WOLFSSL_PATH` | `CURL_USE_WOLFSSL=ON`, optional: `WOLFSSL_INCLUDE_DIR`, `WOLFSSL_LIBRARY` +`WITH_ZLIB`, `ZLIB_PATH` | `CURL_ZLIB=ON`, optional: `ZLIB_INCLUDE_DIR`, `ZLIB_LIBRARY` + +For example this command-line: + + > nmake -f Makefile.vc VC=17 MACHINE=x64 DEBUG=ON mode=dll SSL_PATH=C:\OpenSSL WITH_SSL=dll ENABLE_UNICODE=ON + +translates to: + + > cmake . -G "Visual Studio 17 2022" -A x64 -DBUILD_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=C:\OpenSSL -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=ON -DCURL_USE_LIBPSL=OFF + > cmake --build . --config Debug + +We use `--config` with `cmake --build` because the Visual Studio CMake +generators are multi-config and therefore ignore `CMAKE_BUILD_TYPE`. diff --git a/curl/docs/INSTALL.cmake b/curl/docs/INSTALL.cmake deleted file mode 100644 index abdfb46b2..000000000 --- a/curl/docs/INSTALL.cmake +++ /dev/null @@ -1,91 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - How To Compile with CMake - -Building with CMake -========================== - This document describes how to compile, build and install curl and libcurl - from source code using the CMake build tool. To build with CMake, you will - of course have to first install CMake. The minimum required version of - CMake is specified in the file CMakeLists.txt found in the top of the curl - source tree. Once the correct version of CMake is installed you can follow - the instructions below for the platform you are building on. - - CMake builds can be configured either from the command line, or from one - of CMake's GUI's. - -Current flaws in the curl CMake build -===================================== - - Missing features in the cmake build: - - - Builds libcurl without large file support - - Does not support all SSL libraries (only OpenSSL, WinSSL, DarwinSSL, and - mbed TLS) - - Doesn't build with SCP and SFTP support (libssh2) (see issue #1155) - - Doesn't allow different resolver backends (no c-ares build support) - - No RTMP support built - - Doesn't allow build curl and libcurl debug enabled - - Doesn't allow a custom CA bundle path - - Doesn't allow you to disable specific protocols from the build - - Doesn't find or use krb4 or GSS - - Rebuilds test files too eagerly, but still can't run the tests - - Does't detect the correct strerror_r flavor when cross-compiling (issue #1123) - - -Command Line CMake -================== - A CMake build of curl is similar to the autotools build of curl. It - consists of the following steps after you have unpacked the source. - - 1. Create an out of source build tree parallel to the curl source - tree and change into that directory - - $ mkdir curl-build - $ cd curl-build - - 2. Run CMake from the build tree, giving it the path to the top of - the curl source tree. CMake will pick a compiler for you. If you - want to specify the compile, you can set the CC environment - variable prior to running CMake. - - $ cmake ../curl - $ make - - 3. Install to default location: - - $ make install - - (The test suite does not work with the cmake build) - -ccmake -========= - CMake comes with a curses based interface called ccmake. To run ccmake on - a curl use the instructions for the command line cmake, but substitute - ccmake ../curl for cmake ../curl. This will bring up a curses interface - with instructions on the bottom of the screen. You can press the "c" key - to configure the project, and the "g" key to generate the project. After - the project is generated, you can run make. - -cmake-gui -========= - CMake also comes with a Qt based GUI called cmake-gui. To configure with - cmake-gui, you run cmake-gui and follow these steps: - 1. Fill in the "Where is the source code" combo box with the path to - the curl source tree. - 2. Fill in the "Where to build the binaries" combo box with the path - to the directory for your build tree, ideally this should not be the - same as the source tree, but a parallel directory called curl-build or - something similar. - 3. Once the source and binary directories are specified, press the - "Configure" button. - 4. Select the native build tool that you want to use. - 5. At this point you can change any of the options presented in the - GUI. Once you have selected all the options you want, click the - "Generate" button. - 6. Run the native build tool that you used CMake to generate. - diff --git a/curl/docs/INSTALL.md b/curl/docs/INSTALL.md index 67a9378ff..410fba07d 100644 --- a/curl/docs/INSTALL.md +++ b/curl/docs/INSTALL.md @@ -1,28 +1,50 @@ -# how to install curl and libcurl + + +# How to install curl and libcurl ## Installing Binary Packages Lots of people download binary distributions of curl and libcurl. This document does not describe how to install curl or libcurl using such a binary package. This document describes how to compile, build and install curl and -libcurl from source code. +libcurl from [source code](https://curl.se/download.html). + +## Building using vcpkg + +You can download and install curl and libcurl using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + vcpkg install curl[tool] + +The curl port in vcpkg is kept up to date by Microsoft team members and +community contributors. If the version is out of date, please [create an issue +or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. ## Building from git If you get your code off a git repository instead of a release tarball, see -the `GIT-INFO` file in the root directory for specific instructions on how to -proceed. +the [GIT-INFO.md](https://github.com/curl/curl/blob/master/GIT-INFO.md) file in the root directory for specific instructions on how +to proceed. # Unix -A normal Unix installation is made in three or four steps (after you've +A normal Unix installation is made in three or four steps (after you have unpacked the source archive): - ./configure + ./configure --with-openssl [--with-gnutls --with-wolfssl] make make test (optional) make install +(Adjust the configure line accordingly to use the TLS library you want.) + You probably need to be root when doing the last command. Get a full listing of all available configure options by invoking it like: @@ -44,186 +66,272 @@ your own home directory: The configure script always tries to find a working SSL library unless explicitly told not to. If you have OpenSSL installed in the default search -path for your compiler/linker, you don't need to do anything special. If you -have OpenSSL installed in /usr/local/ssl, you can run configure like: +path for your compiler/linker, you do not need to do anything special. If you +have OpenSSL installed in `/usr/local/ssl`, you can run configure like: - ./configure --with-ssl + ./configure --with-openssl -If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL) and +If you have OpenSSL installed somewhere else (for example, `/opt/OpenSSL`) and you have pkg-config installed, set the pkg-config path first, like this: - env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-ssl + env PKG_CONFIG_PATH=/opt/OpenSSL/lib/pkgconfig ./configure --with-openssl Without pkg-config installed, use this: - ./configure --with-ssl=/opt/OpenSSL + ./configure --with-openssl=/opt/OpenSSL -If you insist on forcing a build without SSL support, even though you may -have OpenSSL installed in your system, you can run configure like this: +If you insist on forcing a build without SSL support, you can run configure +like this: - ./configure --without-ssl + ./configure --without-ssl If you have OpenSSL installed, but with the libraries in one place and the -header files somewhere else, you have to set the LDFLAGS and CPPFLAGS -environment variables prior to running configure. Something like this should +header files somewhere else, you have to set the `LDFLAGS` and `CPPFLAGS` +environment variables prior to running configure. Something like this should work: CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" ./configure -If you have shared SSL libs installed in a directory where your run-time -linker doesn't find them (which usually causes configure failures), you can -provide the -R option to ld on some operating systems to set a hard-coded -path to the run-time linker: +If you have shared SSL libs installed in a directory where your runtime +linker does not find them (which usually causes configure failures), you can +provide this option to gcc to set a hard-coded path to the runtime linker: - LDFLAGS=-R/usr/local/ssl/lib ./configure --with-ssl + LDFLAGS=-Wl,-R/usr/local/ssl/lib ./configure --with-openssl -## More Options +## Static builds To force a static library compile, disable the shared library creation by running configure like: ./configure --disable-shared -To tell the configure script to skip searching for thread-safe functions, add -an option like: - - ./configure --disable-thread - -If you're a curl developer and use gcc, you might want to enable more debug -options with the `--enable-debug` option. - -curl can be built to use a whole range of libraries to provide various useful -services, and configure will try to auto-detect a decent default. But if you -want to alter it, you can select how to deal with each individual library. - -## Select TLS backend - -The default OpenSSL configure check will also detect and use BoringSSL or -libressl. - - - GnuTLS: `--without-ssl --with-gnutls`. - - Cyassl: `--without-ssl --with-cyassl` - - NSS: `--without-ssl --with-nss` - - PolarSSL: `--without-ssl --with-polarssl` - - mbedTLS: `--without-ssl --with-mbedtls` - - axTLS: `--without-ssl --with-axtls` - - schannel: `--without-ssl --with-winssl` - - secure transport: `--without-ssl --with-darwinssl` - -# Windows +The configure script is primarily done to work with shared/dynamic third party +dependencies. When linking with shared libraries, the dependency "chain" is +handled automatically by the library loader - on all modern systems. -## Building Windows DLLs and C run-time (CRT) linkage issues +If you instead link with a static library, you need to provide all the +dependency libraries already at the link command line. - As a general rule, building a DLL with static CRT linkage is highly - discouraged, and intermixing CRTs in the same app is something to avoid at - any cost. +Figuring out all the dependency libraries for a given library is hard, as it +might involve figuring out the dependencies of the dependencies and they vary +between platforms and change between versions. - Reading and comprehending Microsoft Knowledge Base articles KB94248 and - KB140584 is a must for any Windows developer. Especially important is full - understanding if you are not going to follow the advice given above. +When using static dependencies, the build scripts mostly assume that you, the +user, provide all the necessary additional dependency libraries as additional +arguments in the build. With configure, by setting `LIBS` or `LDFLAGS` on the +command line. - - [How To Use the C Run-Time](https://support.microsoft.com/kb/94248/en-us) - - [How to link with the correct C Run-Time CRT library](https://support.microsoft.com/kb/140584/en-us) - - [Potential Errors Passing CRT Objects Across DLL Boundaries](https://msdn.microsoft.com/en-us/library/ms235460) +Building statically is not for the faint of heart. -If your app is misbehaving in some strange way, or it is suffering from -memory corruption, before asking for further help, please try first to -rebuild every single library your app uses as well as your app using the -debug multithreaded dynamic C runtime. - - If you get linkage errors read section 5.7 of the FAQ document. +## Debug -## MingW32 - -Make sure that MinGW32's bin dir is in the search path, for example: - - set PATH=c:\mingw32\bin;%PATH% - -then run `mingw32-make mingw32` in the root dir. There are other -make targets available to build libcurl with more features, use: - - - `mingw32-make mingw32-zlib` to build with Zlib support; - - `mingw32-make mingw32-ssl-zlib` to build with SSL and Zlib enabled; - - `mingw32-make mingw32-ssh2-ssl-zlib` to build with SSH2, SSL, Zlib; - - `mingw32-make mingw32-ssh2-ssl-sspi-zlib` to build with SSH2, SSL, Zlib - and SSPI support. +If you are a curl developer and use gcc, you might want to enable more debug +options with the `--enable-debug` option. -If you have any problems linking libraries or finding header files, be sure -to verify that the provided "Makefile.m32" files use the proper paths, and -adjust as necessary. It is also possible to override these paths with -environment variables, for example: +curl can be built to use a whole range of libraries to provide various useful +services, and configure tries to auto-detect a decent default. If you want to +alter it, you can select how to deal with each individual library. - set ZLIB_PATH=c:\zlib-1.2.8 - set OPENSSL_PATH=c:\openssl-1.0.2c - set LIBSSH2_PATH=c:\libssh2-1.6.0 +## Select TLS backend -It is also possible to build with other LDAP SDKs than MS LDAP; currently -it is possible to build with native Win32 OpenLDAP, or with the Novell CLDAP -SDK. If you want to use these you need to set these vars: +These options are provided to select the TLS backend to use. - set LDAP_SDK=c:\openldap - set USE_LDAP_OPENLDAP=1 + - AmiSSL: `--with-amissl` + - GnuTLS: `--with-gnutls`. + - mbedTLS: `--with-mbedtls` + - OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, LibreSSL, and quictls) + - rustls: `--with-rustls` + - Schannel: `--with-schannel` + - wolfSSL: `--with-wolfssl` -or for using the Novell SDK: +You can build curl with *multiple* TLS backends at your choice, but some TLS +backends cannot be combined: if you build with an OpenSSL fork (or wolfSSL), +you cannot add another OpenSSL fork (or wolfSSL) simply because they have +conflicting identical symbol names. - set USE_LDAP_NOVELL=1 +When you build with multiple TLS backends, you can select the active one at +runtime when curl starts up. -If you want to enable LDAPS support then set LDAPS=1. +## MultiSSL and HTTP/3 -## Cygwin +HTTP/3 needs QUIC and QUIC needs TLS. Building libcurl with HTTP/3 and QUIC +support is not compatible with the MultiSSL feature: they are mutually +exclusive. If you need MultiSSL in your build, you cannot have HTTP/3 support +and vice versa. -Almost identical to the unix installation. Run the configure script in the -curl source tree root with `sh configure`. Make sure you have the sh -executable in /bin/ or you'll see the configure fail toward the end. +libcurl can only use a single TLS library with QUIC and that *same* TLS +library needs to be used for the other TLS using protocols. -Run `make` +## Configure finding libs in wrong directory -## Borland C++ compiler +When the configure script checks for third-party libraries, it adds those +directories to the `LDFLAGS` variable and then tries linking to see if it +works. When successful, the found directory is kept in the `LDFLAGS` variable +when the script continues to execute and do more tests and possibly check for +more libraries. -Ensure that your build environment is properly set up to use the compiler and -associated tools. PATH environment variable must include the path to bin -subdirectory of your compiler installation, eg: `c:\Borland\BCC55\bin` +This can make subsequent checks for libraries wrongly detect another +installation in a directory that was previously added to `LDFLAGS` by another +library check. -It is advisable to set environment variable BCCDIR to the base path of the -compiler installation. - - set BCCDIR=c:\Borland\BCC55 +# Windows -In order to build a plain vanilla version of curl and libcurl run the -following command from curl's root directory: +Building for Windows XP is required as a minimum. - make borland +You can build curl with: -To build curl and libcurl with zlib and OpenSSL support set environment -variables `ZLIB_PATH` and `OPENSSL_PATH` to the base subdirectories of the -already built zlib and OpenSSL libraries and from curl's root directory run -command: +- Microsoft Visual Studio 2008 v9.0 or later (`_MSC_VER >= 1500`) +- MinGW-w64 - make borland-ssl-zlib +## Building Windows DLLs and C runtime (CRT) linkage issues -libcurl library will be built in 'lib' subdirectory while curl tool is built -in 'src' subdirectory. In order to use libcurl library it is advisable to -modify compiler's configuration file bcc32.cfg located in -`c:\Borland\BCC55\bin` to reflect the location of libraries include paths for -example the '-I' line could result in something like: + As a general rule, building a DLL with static CRT linkage is highly + discouraged, and intermixing CRTs in the same app is something to avoid at + any cost. - -I"c:\Borland\BCC55\include;c:\curl\include;c:\openssl\inc32" + Reading and comprehending Microsoft Knowledge Base articles KB94248 and + KB140584 is a must for any Windows developer. Especially important is full + understanding if you are not going to follow the advice given above. -bcc3.cfg `-L` line could also be modified to reflect the location of of -libcurl library resulting for example: + - [How To Use the C Runtime](https://support.microsoft.com/help/94248/how-to-use-the-c-run-time) + - [Runtime Library Compiler Options](https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library) + - [Potential Errors Passing CRT Objects Across DLL Boundaries](https://docs.microsoft.com/cpp/c-runtime-library/potential-errors-passing-crt-objects-across-dll-boundaries) - -L"c:\Borland\BCC55\lib;c:\curl\lib;c:\openssl\out32" +If your app is misbehaving in some strange way, or it is suffering from memory +corruption, before asking for further help, please try first to rebuild every +single library your app uses as well as your app using the debug +multi-threaded dynamic C runtime. -In order to build sample program `simple.c` from the docs\examples -subdirectory run following command from mentioned subdirectory: + If you get linkage errors read section 5.7 of the FAQ document. - bcc32 simple.c libcurl.lib cw32mt.lib +## Cygwin -In order to build sample program simplessl.c an SSL enabled libcurl is -required, as well as the OpenSSL libeay32.lib and ssleay32.lib libraries. +Almost identical to the Unix installation. Essentially run the configure script in the +curl source tree root with `sh configure`, then run `make`. -In order to build sample program `sslbackend.c`, an SSL enabled libcurl -is required. +To expand on building with `cygwin` first ensure it is in your path, and there are no +conflicting tools (*i.e. Chocolatey with sed package*). If so move `cygwin` ahead of any items +in your path that would conflict with `cygwin` commands, making sure you have the `sh` +executable in `/bin/` or you see the configure fail toward the end. + +Download the setup installer from +[`cygwin`](https://cygwin.com/) to begin. Additional `cygwin` +packages are needed for the install. For more on installing packages visit +[`cygwin setup`](https://www.cygwin.com/faq/faq.html#faq.setup.cli). + +Either run setup-x86_64.exe, then search and select packages individually, or try: + + setup-x86_64.exe -P binutils -P gcc-core -P libpsl-devel -P libtool -P perl -P make + +If the latter, matching packages should appear in the install rows (*is fickle though*) after selecting +the download site i.e. `https://mirrors.kernel.org`. In either case, follow the GUI prompts +until you reach the "Select Packages" window; then select packages, click next, and finish +the `cygwin` package installation. + +Download the latest version of the `cygwin` packages required (*and suggested*) for a successful install: + +
+ Package List + +``` + binutil - required + gcc-core - required + libpsl-devel - required + libtool - required + perl - required + make - required + - NOTE - if there is an error regarding make, open the cygwin terminal, and run: + ln -s /usr/bin/make /usr/bin/gmake +``` + +
+ +Once all the packages have been installed, begin the process of installing curl from the source code: + +
+ configure_options + +``` + --with-gnutls + --with-mbedtls + --with-openssl (also works for OpenSSL forks) + --with-rustls + --with-wolfssl + --without-ssl +``` + +
+ + 1. `sh configure ` + 2. `make` + +If any error occurs during curl installation, try: + - reinstalling the required `cygwin` packages from the list above + - temporarily move `cygwin` to the top of your path + - install all of the suggested `cygwin` packages + +## MS-DOS + +You can use either autotools or cmake: + + ./configure \ + CC=/path/to/djgpp/bin/i586-pc-msdosdjgpp-gcc \ + AR=/path/to/djgpp/bin/i586-pc-msdosdjgpp-ar \ + RANLIB=/path/to/djgpp/bin/i586-pc-msdosdjgpp-ranlib \ + WATT_ROOT=/path/to/djgpp/net/watt \ + --host=i586-pc-msdosdjgpp \ + --with-openssl=/path/to/djgpp \ + --with-zlib=/path/to/djgpp \ + --without-libpsl \ + --disable-shared + + cmake . \ + -DCMAKE_SYSTEM_NAME=DOS \ + -DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \ + -DCMAKE_C_COMPILER=/path/to/djgpp/bin/i586-pc-msdosdjgpp-gcc \ + -DWATT_ROOT=/path/to/djgpp/net/watt \ + -DOPENSSL_INCLUDE_DIR=/path/to/djgpp/include \ + -DOPENSSL_SSL_LIBRARY=/path/to/djgpp/lib/libssl.a \ + -DOPENSSL_CRYPTO_LIBRARY=/path/to/djgpp/lib/libcrypto.a \ + -DZLIB_INCLUDE_DIR=/path/to/djgpp/include \ + -DZLIB_LIBRARY=/path/to/djgpp/lib/libz.a \ + -DCURL_USE_LIBPSL=OFF + +Notes: + + - Requires DJGPP 2.04 or upper. + + - Compile Watt-32 (and OpenSSL) with the same version of DJGPP. Otherwise + things go wrong because things like FS-extensions and `errno` values have + been changed between releases. + +## AmigaOS + +You can use either autotools or cmake: + + ./configure \ + CC=/opt/amiga/bin/m68k-amigaos-gcc \ + AR=/opt/amiga/bin/m68k-amigaos-ar \ + RANLIB=/opt/amiga/bin/m68k-amigaos-ranlib \ + --host=m68k-amigaos \ + --with-amissl \ + CFLAGS='-O0 -msoft-float -mcrt=clib2' \ + CPPFLAGS=-I/path/to/AmiSSL/Developer/include \ + LDFLAGS=-L/path/to/AmiSSL/Developer/lib/AmigaOS3 \ + LIBS='-lnet -lm -latomic' \ + --without-libpsl \ + --disable-shared + + cmake . \ + -DAMIGA=1 \ + -DCMAKE_SYSTEM_NAME=Generic \ + -DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \ + -DCMAKE_C_COMPILER=/opt/amiga/bin/m68k-amigaos-gcc \ + -DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \ + -DAMISSL_INCLUDE_DIR=/path/to/AmiSSL/Developer/include \ + -DAMISSL_STUBS_LIBRARY=/path/to/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \ + -DAMISSL_AUTO_LIBRARY=/path/to/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a \ + -DCURL_USE_LIBPSL=OFF ## Disabling Specific Protocols in Windows builds @@ -231,48 +339,35 @@ The configure utility, unfortunately, is not available for the Windows environment, therefore, you cannot use the various disable-protocol options of the configure utility on this platform. -However, you can use the following defines to disable specific -protocols: - - - `HTTP_ONLY` disables all protocols except HTTP - - `CURL_DISABLE_FTP` disables FTP - - `CURL_DISABLE_LDAP` disables LDAP - - `CURL_DISABLE_TELNET` disables TELNET - - `CURL_DISABLE_DICT` disables DICT - - `CURL_DISABLE_FILE` disables FILE - - `CURL_DISABLE_TFTP` disables TFTP - - `CURL_DISABLE_HTTP` disables HTTP - - `CURL_DISABLE_IMAP` disables IMAP - - `CURL_DISABLE_POP3` disables POP3 - - `CURL_DISABLE_SMTP` disables SMTP +You can use specific defines to disable specific protocols and features. See +[CURL-DISABLE](https://github.com/curl/curl/blob/master/docs/CURL-DISABLE.md) +for the full list. If you want to set any of these defines you have the following options: - - Modify lib/config-win32.h - - Modify lib/curl_setup.h - - Modify winbuild/Makefile.vc + - Modify `lib/config-win32.h` + - Modify `lib/curl_setup.h` + - Modify `winbuild/Makefile.vc` - Modify the "Preprocessor Definitions" in the libcurl project Note: The pre-processor settings can be found using the Visual Studio IDE -under "Project -> Settings -> C/C++ -> General" in VC6 and "Project -> -Properties -> Configuration Properties -> C/C++ -> Preprocessor" in later -versions. +under "Project -> Properties -> Configuration Properties -> C/C++ -> +Preprocessor". -## Using BSD-style lwIP instead of Winsock TCP/IP stack in Win32 builds +## Using BSD-style lwIP instead of Winsock TCP/IP stack in Windows builds In order to compile libcurl and curl using BSD-style lwIP TCP/IP stack it is -necessary to make definition of preprocessor symbol USE_LWIPSOCK visible to -libcurl and curl compilation processes. To set this definition you have the -following alternatives: +necessary to make the definition of the preprocessor symbol `USE_LWIPSOCK` +visible to libcurl and curl compilation processes. To set this definition you +have the following alternatives: - - Modify lib/config-win32.h and src/config-win32.h - - Modify winbuild/Makefile.vc + - Modify `lib/config-win32.h` + - Modify `winbuild/Makefile.vc` - Modify the "Preprocessor Definitions" in the libcurl project Note: The pre-processor settings can be found using the Visual Studio IDE -under "Project -> Settings -> C/C++ -> General" in VC6 and "Project -> -Properties -> Configuration Properties -> C/C++ -> Preprocessor" in later -versions. +under "Project -> Properties -> Configuration Properties -> C/C++ -> +Preprocessor". Once that libcurl has been built with BSD-style lwIP TCP/IP stack support, in order to use it with your program it is mandatory that your program includes @@ -280,92 +375,146 @@ lwIP header file `` (or another lwIP header that includes this) before including any libcurl header. Your program does not need the `USE_LWIPSOCK` preprocessor definition which is for libcurl internals only. -Compilation has been verified with [lwIP -1.4.0](https://download.savannah.gnu.org/releases/lwip/lwip-1.4.0.zip) and -[contrib-1.4.0](https://download.savannah.gnu.org/releases/lwip/contrib-1.4.0.zip). +Compilation has been verified with lwIP 1.4.0. This BSD-style lwIP TCP/IP stack support must be considered experimental given that it has been verified that lwIP 1.4.0 still needs some polish, and libcurl -might yet need some additional adjustment, caveat emptor. +might yet need some additional adjustment. ## Important static libcurl usage note When building an application that uses the static libcurl library on Windows, -you must add `-DCURL_STATICLIB` to your `CFLAGS`. Otherwise the linker will -look for dynamic import symbols. +you must add `-DCURL_STATICLIB` to your `CFLAGS`. Otherwise the linker looks +for dynamic import symbols. ## Legacy Windows and SSL -WinSSL (specifically SChannel from Windows SSPI), is the native SSL library in -Windows. However, WinSSL in Windows <= XP is unable to connect to servers that -no longer support the legacy handshakes and algorithms used by those -versions. If you will be using curl in one of those earlier versions of -Windows you should choose another SSL backend such as OpenSSL. - -# Apple iOS and Mac OS X - -On modern Apple operating systems, curl can be built to use Apple's SSL/TLS -implementation, Secure Transport, instead of OpenSSL. To build with Secure -Transport for SSL/TLS, use the configure option `--with-darwinssl`. (It is not -necessary to use the option `--without-ssl`.) This feature requires iOS 5.0 or -later, or OS X 10.5 ("Leopard") or later. - -When Secure Transport is in use, the curl options `--cacert` and `--capath` -and their libcurl equivalents, will be ignored, because Secure Transport uses -the certificates stored in the Keychain to evaluate whether or not to trust -the server. This, of course, includes the root certificates that ship with the -OS. The `--cert` and `--engine` options, and their libcurl equivalents, are -currently unimplemented in curl with Secure Transport. - -For OS X users: In OS X 10.8 ("Mountain Lion"), Apple made a major overhaul to -the Secure Transport API that, among other things, added support for the newer -TLS 1.1 and 1.2 protocols. To get curl to support TLS 1.1 and 1.2, you must -build curl on Mountain Lion or later, or by using the equivalent SDK. If you -set the `MACOSX_DEPLOYMENT_TARGET` environmental variable to an earlier -version of OS X prior to building curl, then curl will use the new Secure -Transport API on Mountain Lion and later, and fall back on the older API when -the same curl binary is executed on older cats. For example, running these -commands in curl's directory in the shell will build the code such that it -will run on cats as old as OS X 10.6 ("Snow Leopard") (using bash): - - export MACOSX_DEPLOYMENT_TARGET="10.6" - ./configure --with-darwinssl - make +Schannel (from Windows SSPI), is the native SSL library in Windows. However, +Schannel in Windows <= XP is unable to connect to servers that no longer +support the legacy handshakes and algorithms used by those versions. If you +are using curl in one of those earlier versions of Windows you should choose +another SSL backend such as OpenSSL. + +# Android + +When building curl for Android you can you CMake or curl's `configure` script. + +Before you can build curl for Android, you need to install the Android NDK +first. This can be done using the SDK Manager that is part of Android Studio. +Once you have installed the Android NDK, you need to figure out where it has +been installed and then set up some environment variables before launching +the build. + +Examples to compile for `aarch64` and API level 29: + +with CMake, where `ANDROID_NDK_HOME` points into your NDK: + + cmake . \ + -DANDROID_ABI=arm64-v8a \ + -DANDROID_PLATFORM=android-29 \ + -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake" \ + -DCURL_ENABLE_SSL=OFF \ + -DCURL_USE_LIBPSL=OFF + +with `configure`, on macOS: + +```bash +export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk/25.1.8937393 # Point into your NDK. +export HOST_TAG=darwin-x86_64 # Same tag for Apple Silicon. Other OS values here: https://developer.android.com/ndk/guides/other_build_systems#overview +export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$HOST_TAG +export AR=$TOOLCHAIN/bin/llvm-ar +export AS=$TOOLCHAIN/bin/llvm-as +export CC=$TOOLCHAIN/bin/aarch64-linux-android29-clang +export CXX=$TOOLCHAIN/bin/aarch64-linux-android29-clang++ +export LD=$TOOLCHAIN/bin/ld +export RANLIB=$TOOLCHAIN/bin/llvm-ranlib +export STRIP=$TOOLCHAIN/bin/llvm-strip +``` + +When building on Linux or targeting other API levels or architectures, you need +to adjust those variables accordingly. After that you can build curl like this: + + ./configure --host aarch64-linux-android --with-pic --disable-shared + +Note that this does not give you SSL/TLS support. If you need SSL/TLS, you +have to build curl with an SSL/TLS library, e.g. OpenSSL, because it is +impossible for curl to access Android's native SSL/TLS layer. To build curl +for Android using OpenSSL, follow the OpenSSL build instructions and then +install `libssl.a` and `libcrypto.a` to `$TOOLCHAIN/sysroot/usr/lib` and copy +`include/openssl` to `$TOOLCHAIN/sysroot/usr/include`. Now you can build curl +for Android using OpenSSL like this: + +```bash +LIBS="-lssl -lcrypto -lc++" # For OpenSSL/BoringSSL. In general, you need to the SSL/TLS layer's transitive dependencies if you are linking statically. +./configure --host aarch64-linux-android --with-pic --disable-shared --with-openssl="$TOOLCHAIN/sysroot/usr" +``` + +# IBM i + +For IBM i (formerly OS/400), you can use curl in two different ways: + +- Natively, running in the **ILE**. The obvious use is being able to call curl + from ILE C or RPG applications. +- You need to build this from source. See `packages/OS400/README` for the ILE + specific build instructions. +- In the **PASE** environment, which runs AIX programs. curl is built as it + would be on AIX. +- IBM provides builds of curl in their Yum repository for PASE software. +- To build from source, follow the Unix instructions. + +There are some additional limitations and quirks with curl on this platform; +they affect both environments. + +## Multi-threading notes + +By default, jobs in IBM i does not start with threading enabled. (Exceptions +include interactive PASE sessions started by `QP2TERM` or SSH.) If you use +curl in an environment without threading when options like asynchronous DNS +were enabled, you get messages like: + +``` +getaddrinfo() thread failed to start +``` + +Do not panic. curl and your program are not broken. You can fix this by: + +- Set the environment variable `QIBM_MULTI_THREADED` to `Y` before starting + your program. This can be done at whatever scope you feel is appropriate. +- Alternatively, start the job with the `ALWMLTTHD` parameter set to `*YES`. # Cross compile Download and unpack the curl package. -'cd' to the new directory. (e.g. `cd curl-7.12.3`) +`cd` to the new directory. (e.g. `cd curl-7.12.3`) Set environment variables to point to the cross-compile toolchain and call -configure with any options you need. Be sure and specify the `--host` and -`--build` parameters at configuration time. The following script is an -example of cross-compiling for the IBM 405GP PowerPC processor using the -toolchain from MonteVista for Hardhat Linux. - - #! /bin/sh - - export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin - export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include" - export AR=ppc_405-ar - export AS=ppc_405-as - export LD=ppc_405-ld - export RANLIB=ppc_405-ranlib - export CC=ppc_405-gcc - export NM=ppc_405-nm - - ./configure --target=powerpc-hardhat-linux - --host=powerpc-hardhat-linux - --build=i586-pc-linux-gnu - --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local - --exec-prefix=/usr/local - -You may also need to provide a parameter like `--with-random=/dev/urandom` to -configure as it cannot detect the presence of a random number generating -device for a target system. The `--prefix` parameter specifies where curl -will be installed. If `configure` completes successfully, do `make` and `make -install` as usual. +configure with any options you need. Be sure and specify the `--host` and +`--build` parameters at configuration time. The following script is an example +of cross-compiling for the IBM 405GP PowerPC processor using the toolchain on +Linux. + +```bash +#! /bin/sh + +export PATH=$PATH:/opt/hardhat/devkit/ppc/405/bin +export CPPFLAGS="-I/opt/hardhat/devkit/ppc/405/target/usr/include" +export AR=ppc_405-ar +export AS=ppc_405-as +export LD=ppc_405-ld +export RANLIB=ppc_405-ranlib +export CC=ppc_405-gcc +export NM=ppc_405-nm + +./configure --target=powerpc-hardhat-linux + --host=powerpc-hardhat-linux + --build=i586-pc-linux-gnu + --prefix=/opt/hardhat/devkit/ppc/405/target/usr/local + --exec-prefix=/usr/local +``` + +The `--prefix` parameter specifies where curl gets installed. If `configure` +completes successfully, do `make` and `make install` as usual. In some cases, you may be able to simplify the above commands to as little as: @@ -375,142 +524,120 @@ In some cases, you may be able to simplify the above commands to as little as: There are a number of configure options that can be used to reduce the size of libcurl for embedded applications where binary size is an important factor. -First, be sure to set the CFLAGS variable when configuring with any relevant -compiler optimization flags to reduce the size of the binary. For gcc, this -would mean at minimum the -Os option, and potentially the `-march=X`, -`-mdynamic-no-pic` and `-flto` options as well, e.g. +First, be sure to set the `CFLAGS` variable when configuring with any relevant +compiler optimization flags to reduce the size of the binary. For gcc, this +would mean at minimum the `-Os` option, and others like the following that +may be relevant in some environments: `-march=X`, `-mthumb`, `-m32`, +`-mdynamic-no-pic`, `-flto`, `-fdata-sections`, `-ffunction-sections`, +`-fno-unwind-tables`, `-fno-asynchronous-unwind-tables`, +`-fno-record-gcc-switches`, `-fsection-anchors`, `-fno-plt`, +`-Wl,--gc-sections`, `-Wl,-Bsymbolic`, `-Wl,-s`, + +For example, this is how to combine a few of these options: - ./configure CFLAGS='-Os' LDFLAGS='-Wl,-Bsymbolic'... + ./configure CC=gcc CFLAGS='-Os -ffunction-sections' LDFLAGS='-Wl,--gc-sections'... Note that newer compilers often produce smaller code than older versions due to improved optimization. Be sure to specify as many `--disable-` and `--without-` flags on the configure command-line as you can to disable all the libcurl features that you -know your application is not going to need. Besides specifying the -`--disable-PROTOCOL` flags for all the types of URLs your application will not -use, here are some other flags that can reduce the size of the library: - - - `--disable-ares` (disables support for the C-ARES DNS library) - - `--disable-cookies` (disables support for HTTP cookies) - - `--disable-crypto-auth` (disables HTTP cryptographic authentication) - - `--disable-ipv6` (disables support for IPv6) - - `--disable-manual` (disables support for the built-in documentation) - - `--disable-proxy` (disables support for HTTP and SOCKS proxies) - - `--disable-unix-sockets` (disables support for UNIX sockets) +know your application is not going to need. Besides specifying the +`--disable-PROTOCOL` flags for all the types of URLs your application do not +use, here are some other flags that can reduce the size of the library by +disabling support for some features (run `./configure --help` to see them all): + + - `--disable-aws` (cryptographic authentication) + - `--disable-basic-auth` (cryptographic authentication) + - `--disable-bearer-auth` (cryptographic authentication) + - `--disable-digest-auth` (cryptographic authentication) + - `--disable-http-auth` (all HTTP authentication) + - `--disable-kerberos-auth` (cryptographic authentication) + - `--disable-negotiate-auth` (cryptographic authentication) + - `--disable-ntlm` (NTLM authentication) + - `--disable-alt-svc` (HTTP Alt-Svc) + - `--disable-ares` (the C-ARES DNS library) + - `--disable-cookies` (HTTP cookies) + - `--disable-dateparse` (date parsing for time conditionals) + - `--disable-dnsshuffle` (internal server load spreading) + - `--disable-doh` (DNS-over-HTTP) + - `--disable-form-api` (POST form API) + - `--disable-get-easy-options` (lookup easy options at runtime) + - `--disable-headers-api` (API to access headers) + - `--disable-hsts` (HTTP Strict Transport Security) + - `--disable-ipv6` (IPv6) + - `--disable-libcurl-option` (--libcurl C code generation support) + - `--disable-manual` (--manual built-in documentation) + - `--disable-mime` (MIME API) + - `--disable-netrc` (.netrc file) + - `--disable-progress-meter` (graphical progress meter in library) + - `--disable-proxy` (HTTP and SOCKS proxies) + - `--disable-socketpair` (socketpair for asynchronous name resolving) + - `--disable-threaded-resolver` (threaded name resolver) + - `--disable-tls-srp` (Secure Remote Password authentication for TLS) + - `--disable-unix-sockets` (Unix sockets) - `--disable-verbose` (eliminates debugging strings and error code strings) - - `--disable-versioned-symbols` (disables support for versioned symbols) - - `--enable-hidden-symbols` (eliminates unneeded symbols in the shared library) - - `--without-libidn` (disables support for the libidn DNS library) - - `--without-librtmp` (disables support for RTMP) - - `--without-ssl` (disables support for SSL/TLS) - - `--without-zlib` (disables support for on-the-fly decompression) - -The GNU compiler and linker have a number of options that can reduce the -size of the libcurl dynamic libraries on some platforms even further. -Specify them by providing appropriate CFLAGS and LDFLAGS variables on the -configure command-line, e.g. - - CFLAGS="-Os -ffunction-sections -fdata-sections - -fno-unwind-tables -fno-asynchronous-unwind-tables -flto" - LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections" + - `--disable-versioned-symbols` (versioned symbols) + - `--enable-symbol-hiding` (eliminates unneeded symbols in the shared library) + - `--without-brotli` (Brotli on-the-fly decompression) + - `--without-libpsl` (Public Suffix List in cookies) + - `--without-nghttp2` (HTTP/2 using nghttp2) + - `--without-ngtcp2` (HTTP/2 using ngtcp2) + - `--without-zstd` (Zstd on-the-fly decompression) + - `--without-libidn2` (internationalized domain names) + - `--without-librtmp` (RTMP) + - `--without-ssl` (SSL/TLS) + - `--without-zlib` (gzip/deflate on-the-fly decompression) Be sure also to strip debugging symbols from your binaries after compiling -using 'strip' (or the appropriate variant if cross-compiling). If space is -really tight, you may be able to remove some unneeded sections of the shared -library using the -R option to objcopy (e.g. the .comment section). +using 'strip' or an option like `-s`. If space is really tight, you may be able +to gain a few bytes by removing some unneeded sections of the shared library +using the -R option to objcopy (e.g. the .comment section). -Using these techniques it is possible to create a basic HTTP-only shared -libcurl library for i386 Linux platforms that is only 113 KiB in size, and an -FTP-only library that is 113 KiB in size (as of libcurl version 7.50.3, using -gcc 5.4.0). +Using these techniques it is possible to create a basic HTTP-only libcurl +shared library for i386 Linux platforms that is only 137 KiB in size +(as of libcurl version 8.13.0, using gcc 14.2.0). -You may find that statically linking libcurl to your application will result -in a lower total size than dynamically linking. +You may find that statically linking libcurl to your application results in a +lower total size than dynamically linking. -Note that the curl test harness can detect the use of some, but not all, of -the `--disable` statements suggested above. Use will cause tests relying on -those features to fail. The test harness can be manually forced to skip the -relevant tests by specifying certain key words on the runtests.pl command -line. Following is a list of appropriate key words: +The curl test harness can detect the use of some, but not all, of the +`--disable` statements suggested above. Use of these can cause tests relying +on those features to fail. The test harness can be manually forced to skip the +relevant tests by specifying certain key words on the `runtests.pl` command +line. Following is a list of appropriate key words for those configure options +that are not automatically detected: - `--disable-cookies` !cookies - - `--disable-manual` !--manual - - `--disable-proxy` !HTTP\ proxy !proxytunnel !SOCKS4 !SOCKS5 - -# PORTS - -This is a probably incomplete list of known hardware and operating systems -that curl has been compiled for. If you know a system curl compiles and -runs on, that isn't listed, please let us know! - - - Alpha DEC OSF 4 - - Alpha Digital UNIX v3.2 - - Alpha FreeBSD 4.1, 4.5 - - Alpha Linux 2.2, 2.4 - - Alpha NetBSD 1.5.2 - - Alpha OpenBSD 3.0 - - Alpha OpenVMS V7.1-1H2 - - Alpha Tru64 v5.0 5.1 - - AVR32 Linux - - ARM Android 1.5, 2.1, 2.3, 3.2, 4.x - - ARM INTEGRITY - - ARM iOS - - Cell Linux - - Cell Cell OS - - HP-PA HP-UX 9.X 10.X 11.X - - HP-PA Linux - - HP3000 MPE/iX - - MicroBlaze uClinux - - MIPS IRIX 6.2, 6.5 - - MIPS Linux - - OS/400 - - Pocket PC/Win CE 3.0 - - Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2 - - PowerPC Darwin 1.0 - - PowerPC INTEGRITY - - PowerPC Linux - - PowerPC Mac OS 9 - - PowerPC Mac OS X - - SH4 Linux 2.6.X - - SH4 OS21 - - SINIX-Z v5 - - Sparc Linux - - Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10 - - Sparc SunOS 4.1.X - - StrongARM (and other ARM) RISC OS 3.1, 4.02 - - StrongARM/ARM7/ARM9 Linux 2.4, 2.6 - - StrongARM NetBSD 1.4.1 - - Symbian OS (P.I.P.S.) 9.x - - TPF - - Ultrix 4.3a - - UNICOS 9.0 - - i386 BeOS - - i386 DOS - - i386 eCos 1.3.1 - - i386 Esix 4.1 - - i386 FreeBSD - - i386 HURD - - i386 Haiku OS - - i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6 - - i386 Mac OS X - - i386 MINIX 3.1 - - i386 NetBSD - - i386 Novell NetWare - - i386 OS/2 - - i386 OpenBSD - - i386 QNX 6 - - i386 SCO unix - - i386 Solaris 2.7 - - i386 Windows 95, 98, ME, NT, 2000, XP, 2003 - - i486 ncr-sysv4.3.03 (NCR MP-RAS) - - ia64 Linux 2.3.99 - - m68k AmigaOS 3 - - m68k Linux - - m68k uClinux - - m68k OpenBSD - - m88k dg-dgux5.4R3.00 - - s390 Linux - - x86_64 Linux - - XScale/PXA250 Linux 2.4 - - Nios II uClinux + - `--disable-dateparse` !RETRY-AFTER !`CURLOPT_TIMECONDITION` !`CURLINFO_FILETIME` !`If-Modified-Since` !`curl_getdate` !`-z` + - `--disable-libcurl-option` !`--libcurl` + - `--disable-verbose` !verbose\ logs + +# Ports + +This is a probably incomplete list of known CPU architectures and operating +systems that curl has been compiled for. If you know a system curl compiles +and runs on, that is not listed, please let us know. + +## 104 Operating Systems + + AIX, AmigaOS, Android, ArcoOS, Aros, Atari FreeMiNT, BeOS, Blackberry + 10, Blackberry Tablet OS, Cell OS, CheriBSD, Chrome OS, Cisco IOS, + DG/UX, DR DOS, Dragonfly BSD, eCOS, FreeBSD, FreeDOS, FreeRTOS, Fuchsia, + Garmin OS, Genode, Haiku, HardenedBSD, HP-UX, Hurd, IBM I, illumos, + Integrity, iOS, ipadOS, IRIX, Linux, Lua RTOS, Mac OS 9, macOS, Maemo, + Mbed, Meego, Micrium, MINIX, Minoca, Moblin, MorphOS, MPE/iX, MS-DOS, + NCR MP-RAS, NetBSD, Netware, NextStep, Nintendo 3DS Nintendo Switch, + NonStop OS, NuttX, OpenBSD, OpenStep, Orbis OS, OS/2, OS21, Plan 9, + PlayStation Portable, QNX, Qubes OS, ReactOS, Redox, RISC OS, ROS, + RTEMS, Sailfish OS, SCO Unix, Serenity, SINIX-Z, SkyOS, software, + Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, tvOS, + ucLinux, Ultrix, UNICOS, UnixWare, VMS, vxWorks, watchOS, Wear OS, + WebOS, Wii system Wii U, Windows CE, Windows, Xbox System, Xenix, z/OS, + z/TPF, z/VM, z/VSE, Zephyr + +## 28 CPU Architectures + + Alpha, ARC, ARM, AVR32, C-SKY, CompactRISC, Elbrus, ETRAX, HP-PA, Itanium, + LoongArch, m68k, m88k, MicroBlaze, MIPS, Nios, OpenRISC, POWER, PowerPC, + RISC-V, s390, SH4, SPARC, Tilera, VAX, x86, Xtensa, z/arch diff --git a/curl/docs/INTERNALS.md b/curl/docs/INTERNALS.md index 2e273a9dc..a0b1adc9e 100644 --- a/curl/docs/INTERNALS.md +++ b/curl/docs/INTERNALS.md @@ -1,1093 +1,63 @@ -curl internals -============== + - -Intro -===== +# curl internals - This project is split in two. The library and the client. The client part - uses the library, but the library is designed to allow other applications to - use it. +The canonical libcurl internals documentation is now in the [everything +curl](https://everything.curl.dev/internals) book. This file lists supported +versions of libs and build tools. - The largest amount of code and complexity is in the library part. +## Portability - - -git -=== - - All changes to the sources are committed to the git repository as soon as - they're somewhat verified to work. Changes shall be committed as independently - as possible so that individual changes can be easily spotted and tracked - afterwards. - - Tagging shall be used extensively, and by the time we release new archives we - should tag the sources with a name similar to the released version number. - - -Portability -=========== - - We write curl and libcurl to compile with C89 compilers. On 32bit and up - machines. Most of libcurl assumes more or less POSIX compliance but that's + We write curl and libcurl to compile with C89 compilers on 32-bit and up + machines. Most of libcurl assumes more or less POSIX compliance but that is not a requirement. We write libcurl to build and work with lots of third party tools, and we want it to remain functional and buildable with these and later versions (older versions may still work but is not what we work hard to maintain): -Dependencies ------------- +## Dependencies + + We aim to support these or later versions. - - OpenSSL 0.9.7 - - GnuTLS 1.2 - - zlib 1.1.4 - - libssh2 0.16 + - OpenSSL 1.0.2a + - LibreSSL 2.9.1 + - GnuTLS 3.1.10 + - zlib 1.2.5.2 + - libssh2 1.2.8 - c-ares 1.6.0 - - libidn 0.4.1 - - cyassl 2.0.0 - - openldap 2.0 + - libssh 0.9.0 + - libidn2 2.0.0 + - wolfSSL 3.4.6 + - OpenLDAP 2.0 - MIT Kerberos 1.2.4 - - GSKit V5R3M0 - - NSS 3.14.x - - axTLS 2.1.0 - - PolarSSL 1.3.0 - Heimdal ? - - nghttp2 1.0.0 - -Operating Systems ------------------ - - On systems where configure runs, we aim at working on them all - if they have - a suitable C compiler. On systems that don't run configure, we strive to keep - curl running correctly on: + - nghttp2 1.15.0 + - Winsock 2.2 (on Windows 95+ and Windows CE .NET 4.1+) - - Windows 98 - - AS/400 V5R3M0 - - Symbian 9.1 - - Windows CE ? - - TPF ? - -Build tools ------------ +## Build tools When writing code (mostly for generating stuff included in release tarballs) we use a few "build tools" and we make sure that we remain functional with these versions: - GNU Libtool 1.4.2 - - GNU Autoconf 2.57 + - GNU Autoconf 2.59 - GNU Automake 1.7 - GNU M4 1.4 - - perl 5.004 + - perl 5.8 - roffit 0.5 - - groff ? (any version that supports "groff -Tps -man [in] [out]") - - ps2pdf (gs) ? - - -Windows vs Unix -=============== - - There are a few differences in how to program curl the Unix way compared to - the Windows way. Perhaps the four most notable details are: - - 1. Different function names for socket operations. - - In curl, this is solved with defines and macros, so that the source looks - the same in all places except for the header file that defines them. The - macros in use are sclose(), sread() and swrite(). - - 2. Windows requires a couple of init calls for the socket stuff. - - That's taken care of by the `curl_global_init()` call, but if other libs - also do it etc there might be reasons for applications to alter that - behaviour. - - 3. The file descriptors for network communication and file operations are - not as easily interchangeable as in Unix. - - We avoid this by not trying any funny tricks on file descriptors. - - 4. When writing data to stdout, Windows makes end-of-lines the DOS way, thus - destroying binary data, although you do want that conversion if it is - text coming through... (sigh) - - We set stdout to binary under windows - - Inside the source code, We make an effort to avoid `#ifdef [Your OS]`. All - conditionals that deal with features *should* instead be in the format - `#ifdef HAVE_THAT_WEIRD_FUNCTION`. Since Windows can't run configure scripts, - we maintain a `curl_config-win32.h` file in lib directory that is supposed to - look exactly like a `curl_config.h` file would have looked like on a Windows - machine! - - Generally speaking: always remember that this will be compiled on dozens of - operating systems. Don't walk on the edge! - - -Library -======= - - (See [Structs in libcurl](#structs) for the separate section describing all - major internal structs and their purposes.) - - There are plenty of entry points to the library, namely each publicly defined - function that libcurl offers to applications. All of those functions are - rather small and easy-to-follow. All the ones prefixed with `curl_easy` are - put in the lib/easy.c file. - - `curl_global_init()` and `curl_global_cleanup()` should be called by the - application to initialize and clean up global stuff in the library. As of - today, it can handle the global SSL initing if SSL is enabled and it can init - the socket layer on windows machines. libcurl itself has no "global" scope. - - All printf()-style functions use the supplied clones in lib/mprintf.c. This - makes sure we stay absolutely platform independent. - - [ `curl_easy_init()`][2] allocates an internal struct and makes some - initializations. The returned handle does not reveal internals. This is the - `Curl_easy` struct which works as an "anchor" struct for all `curl_easy` - functions. All connections performed will get connect-specific data allocated - that should be used for things related to particular connections/requests. - - [`curl_easy_setopt()`][1] takes three arguments, where the option stuff must - be passed in pairs: the parameter-ID and the parameter-value. The list of - options is documented in the man page. This function mainly sets things in - the `Curl_easy` struct. - - `curl_easy_perform()` is just a wrapper function that makes use of the multi - API. It basically calls `curl_multi_init()`, `curl_multi_add_handle()`, - `curl_multi_wait()`, and `curl_multi_perform()` until the transfer is done - and then returns. - - Some of the most important key functions in url.c are called from multi.c - when certain key steps are to be made in the transfer operation. - - -Curl_connect() --------------- - - Analyzes the URL, it separates the different components and connects to the - remote host. This may involve using a proxy and/or using SSL. The - `Curl_resolv()` function in lib/hostip.c is used for looking up host names - (it does then use the proper underlying method, which may vary between - platforms and builds). - - When `Curl_connect` is done, we are connected to the remote site. Then it - is time to tell the server to get a document/file. `Curl_do()` arranges - this. - - This function makes sure there's an allocated and initiated 'connectdata' - struct that is used for this particular connection only (although there may - be several requests performed on the same connect). A bunch of things are - inited/inherited from the `Curl_easy` struct. - - -Curl_do() ---------- - - `Curl_do()` makes sure the proper protocol-specific function is called. The - functions are named after the protocols they handle. - - The protocol-specific functions of course deal with protocol-specific - negotiations and setup. They have access to the `Curl_sendf()` (from - lib/sendf.c) function to send printf-style formatted data to the remote - host and when they're ready to make the actual file transfer they call the - `Curl_Transfer()` function (in lib/transfer.c) to setup the transfer and - returns. - - If this DO function fails and the connection is being re-used, libcurl will - then close this connection, setup a new connection and re-issue the DO - request on that. This is because there is no way to be perfectly sure that - we have discovered a dead connection before the DO function and thus we - might wrongly be re-using a connection that was closed by the remote peer. - - Some time during the DO function, the `Curl_setup_transfer()` function must - be called with some basic info about the upcoming transfer: what socket(s) - to read/write and the expected file transfer sizes (if known). - - -Curl_readwrite() ----------------- - - Called during the transfer of the actual protocol payload. - - During transfer, the progress functions in lib/progress.c are called at - frequent intervals (or at the user's choice, a specified callback might get - called). The speedcheck functions in lib/speedcheck.c are also used to - verify that the transfer is as fast as required. - - -Curl_done() ------------ - - Called after a transfer is done. This function takes care of everything - that has to be done after a transfer. This function attempts to leave - matters in a state so that `Curl_do()` should be possible to call again on - the same connection (in a persistent connection case). It might also soon - be closed with `Curl_disconnect()`. - - -Curl_disconnect() ------------------ - - When doing normal connections and transfers, no one ever tries to close any - connections so this is not normally called when `curl_easy_perform()` is - used. This function is only used when we are certain that no more transfers - are going to be made on the connection. It can be also closed by force, or - it can be called to make sure that libcurl doesn't keep too many - connections alive at the same time. - - This function cleans up all resources that are associated with a single - connection. - - -HTTP(S) -======= - - HTTP offers a lot and is the protocol in curl that uses the most lines of - code. There is a special file (lib/formdata.c) that offers all the multipart - post functions. - - base64-functions for user+password stuff (and more) is in (lib/base64.c) and - all functions for parsing and sending cookies are found in (lib/cookie.c). - - HTTPS uses in almost every case the same procedure as HTTP, with only two - exceptions: the connect procedure is different and the function used to read - or write from the socket is different, although the latter fact is hidden in - the source by the use of `Curl_read()` for reading and `Curl_write()` for - writing data to the remote server. - - `http_chunks.c` contains functions that understands HTTP 1.1 chunked transfer - encoding. - - An interesting detail with the HTTP(S) request, is the `Curl_add_buffer()` - series of functions we use. They append data to one single buffer, and when - the building is finished the entire request is sent off in one single write. This is done this way to overcome problems with flawed firewalls and lame servers. - - -FTP -=== - - The `Curl_if2ip()` function can be used for getting the IP number of a - specified network interface, and it resides in lib/if2ip.c. - - `Curl_ftpsendf()` is used for sending FTP commands to the remote server. It - was made a separate function to prevent us programmers from forgetting that - they must be CRLF terminated. They must also be sent in one single write() to - make firewalls and similar happy. - - -Kerberos --------- - - Kerberos support is mainly in lib/krb5.c and lib/security.c but also - `curl_sasl_sspi.c` and `curl_sasl_gssapi.c` for the email protocols and - `socks_gssapi.c` and `socks_sspi.c` for SOCKS5 proxy specifics. - - -TELNET -====== - - Telnet is implemented in lib/telnet.c. - - -FILE -==== - - The file:// protocol is dealt with in lib/file.c. - - -SMB -=== + - cmake 3.7 - The smb:// protocol is dealt with in lib/smb.c. - - -LDAP -==== - - Everything LDAP is in lib/ldap.c and lib/openldap.c - - -E-mail -====== - - The e-mail related source code is in lib/imap.c, lib/pop3.c and lib/smtp.c. - - -General -======= - - URL encoding and decoding, called escaping and unescaping in the source code, - is found in lib/escape.c. - - While transferring data in Transfer() a few functions might get used. - `curl_getdate()` in lib/parsedate.c is for HTTP date comparisons (and more). - - lib/getenv.c offers `curl_getenv()` which is for reading environment - variables in a neat platform independent way. That's used in the client, but - also in lib/url.c when checking the proxy environment variables. Note that - contrary to the normal unix getenv(), this returns an allocated buffer that - must be free()ed after use. - - lib/netrc.c holds the .netrc parser - - lib/timeval.c features replacement functions for systems that don't have - gettimeofday() and a few support functions for timeval conversions. - - A function named `curl_version()` that returns the full curl version string - is found in lib/version.c. - - -Persistent Connections -====================== - - The persistent connection support in libcurl requires some considerations on - how to do things inside of the library. - - - The `Curl_easy` struct returned in the [`curl_easy_init()`][2] call - must never hold connection-oriented data. It is meant to hold the root data - as well as all the options etc that the library-user may choose. - - - The `Curl_easy` struct holds the "connection cache" (an array of - pointers to 'connectdata' structs). - - - This enables the 'curl handle' to be reused on subsequent transfers. - - - When libcurl is told to perform a transfer, it first checks for an already - existing connection in the cache that we can use. Otherwise it creates a - new one and adds that to the cache. If the cache is full already when a new - connection is added, it will first close the oldest unused one. - - - When the transfer operation is complete, the connection is left - open. Particular options may tell libcurl not to, and protocols may signal - closure on connections and then they won't be kept open, of course. - - - When `curl_easy_cleanup()` is called, we close all still opened connections, - unless of course the multi interface "owns" the connections. - - The curl handle must be re-used in order for the persistent connections to - work. - - -multi interface/non-blocking -============================ - - The multi interface is a non-blocking interface to the library. To make that - interface work as well as possible, no low-level functions within libcurl - must be written to work in a blocking manner. (There are still a few spots - violating this rule.) - - One of the primary reasons we introduced c-ares support was to allow the name - resolve phase to be perfectly non-blocking as well. - - The FTP and the SFTP/SCP protocols are examples of how we adapt and adjust - the code to allow non-blocking operations even on multi-stage command- - response protocols. They are built around state machines that return when - they would otherwise block waiting for data. The DICT, LDAP and TELNET - protocols are crappy examples and they are subject for rewrite in the future - to better fit the libcurl protocol family. - - -SSL libraries -============= - - Originally libcurl supported SSLeay for SSL/TLS transports, but that was then - extended to its successor OpenSSL but has since also been extended to several - other SSL/TLS libraries and we expect and hope to further extend the support - in future libcurl versions. - - To deal with this internally in the best way possible, we have a generic SSL - function API as provided by the vtls/vtls.[ch] system, and they are the only - SSL functions we must use from within libcurl. vtls is then crafted to use - the appropriate lower-level function calls to whatever SSL library that is in - use. For example vtls/openssl.[ch] for the OpenSSL library. - - Library Symbols =============== - All symbols used internally in libcurl must use a `Curl_` prefix if they're + All symbols used internally in libcurl must use a `Curl_` prefix if they are used in more than a single file. Single-file symbols must be made static. - Public ("exported") symbols must use a `curl_` prefix. (There are exceptions, - but they are to be changed to follow this pattern in future versions.) Public - API functions are marked with `CURL_EXTERN` in the public header files so - that all others can be hidden on platforms where this is possible. - - -Return Codes and Informationals -=============================== - - I've made things simple. Almost every function in libcurl returns a CURLcode, - that must be `CURLE_OK` if everything is OK or otherwise a suitable error - code as the curl/curl.h include file defines. The very spot that detects an - error must use the `Curl_failf()` function to set the human-readable error - description. - - In aiding the user to understand what's happening and to debug curl usage, we - must supply a fair number of informational messages by using the - `Curl_infof()` function. Those messages are only displayed when the user - explicitly asks for them. They are best used when revealing information that - isn't otherwise obvious. - - -API/ABI -======= - - We make an effort to not export or show internals or how internals work, as - that makes it easier to keep a solid API/ABI over time. See docs/libcurl/ABI - for our promise to users. - - -Client -====== - - main() resides in `src/tool_main.c`. - - `src/tool_hugehelp.c` is automatically generated by the mkhelp.pl perl script - to display the complete "manual" and the `src/tool_urlglob.c` file holds the - functions used for the URL-"globbing" support. Globbing in the sense that the - {} and [] expansion stuff is there. - - The client mostly sets up its 'config' struct properly, then - it calls the `curl_easy_*()` functions of the library and when it gets back - control after the `curl_easy_perform()` it cleans up the library, checks - status and exits. - - When the operation is done, the ourWriteOut() function in src/writeout.c may - be called to report about the operation. That function is using the - `curl_easy_getinfo()` function to extract useful information from the curl - session. - - It may loop and do all this several times if many URLs were specified on the - command line or config file. - - -Memory Debugging -================ - - The file lib/memdebug.c contains debug-versions of a few functions. Functions - such as malloc, free, fopen, fclose, etc that somehow deal with resources - that might give us problems if we "leak" them. The functions in the memdebug - system do nothing fancy, they do their normal function and then log - information about what they just did. The logged data can then be analyzed - after a complete session, - - memanalyze.pl is the perl script present in tests/ that analyzes a log file - generated by the memory tracking system. It detects if resources are - allocated but never freed and other kinds of errors related to resource - management. - - Internally, definition of preprocessor symbol DEBUGBUILD restricts code which - is only compiled for debug enabled builds. And symbol CURLDEBUG is used to - differentiate code which is _only_ used for memory tracking/debugging. - - Use -DCURLDEBUG when compiling to enable memory debugging, this is also - switched on by running configure with --enable-curldebug. Use -DDEBUGBUILD - when compiling to enable a debug build or run configure with --enable-debug. - - curl --version will list 'Debug' feature for debug enabled builds, and - will list 'TrackMemory' feature for curl debug memory tracking capable - builds. These features are independent and can be controlled when running - the configure script. When --enable-debug is given both features will be - enabled, unless some restriction prevents memory tracking from being used. - - -Test Suite -========== - - The test suite is placed in its own subdirectory directly off the root in the - curl archive tree, and it contains a bunch of scripts and a lot of test case - data. - - The main test script is runtests.pl that will invoke test servers like - httpserver.pl and ftpserver.pl before all the test cases are performed. The - test suite currently only runs on Unix-like platforms. - - You'll find a description of the test suite in the tests/README file, and the - test case data files in the tests/FILEFORMAT file. - - The test suite automatically detects if curl was built with the memory - debugging enabled, and if it was, it will detect memory leaks, too. - - -Asynchronous name resolves -========================== - - libcurl can be built to do name resolves asynchronously, using either the - normal resolver in a threaded manner or by using c-ares. - - -[c-ares][3] ------- - -### Build libcurl to use a c-ares - -1. ./configure --enable-ares=/path/to/ares/install -2. make - -### c-ares on win32 - - First I compiled c-ares. I changed the default C runtime library to be the - single-threaded rather than the multi-threaded (this seems to be required to - prevent linking errors later on). Then I simply build the areslib project - (the other projects adig/ahost seem to fail under MSVC). - - Next was libcurl. I opened lib/config-win32.h and I added a: - `#define USE_ARES 1` - - Next thing I did was I added the path for the ares includes to the include - path, and the libares.lib to the libraries. - - Lastly, I also changed libcurl to be single-threaded rather than - multi-threaded, again this was to prevent some duplicate symbol errors. I'm - not sure why I needed to change everything to single-threaded, but when I - didn't I got redefinition errors for several CRT functions (malloc, stricmp, - etc.) - - -`curl_off_t` -========== - - `curl_off_t` is a data type provided by the external libcurl include - headers. It is the type meant to be used for the [`curl_easy_setopt()`][1] - options that end with LARGE. The type is 64bit large on most modern - platforms. - -curlx -===== - - The libcurl source code offers a few functions by source only. They are not - part of the official libcurl API, but the source files might be useful for - others so apps can optionally compile/build with these sources to gain - additional functions. - - We provide them through a single header file for easy access for apps: - "curlx.h" - -`curlx_strtoofft()` -------------------- - A macro that converts a string containing a number to a `curl_off_t` number. - This might use the `curlx_strtoll()` function which is provided as source - code in strtoofft.c. Note that the function is only provided if no - strtoll() (or equivalent) function exist on your platform. If `curl_off_t` - is only a 32 bit number on your platform, this macro uses strtol(). - -`curlx_tvnow()` ---------------- - returns a struct timeval for the current time. - -`curlx_tvdiff()` --------------- - returns the difference between two timeval structs, in number of - milliseconds. - -`curlx_tvdiff_secs()` ---------------------- - returns the same as `curlx_tvdiff` but with full usec resolution (as a - double) - -Future ------- - - Several functions will be removed from the public `curl_` name space in a - future libcurl release. They will then only become available as `curlx_` - functions instead. To make the transition easier, we already today provide - these functions with the `curlx_` prefix to allow sources to be built - properly with the new function names. The concerned functions are: - - - `curlx_getenv` - - `curlx_strequal` - - `curlx_strnequal` - - `curlx_mvsnprintf` - - `curlx_msnprintf` - - `curlx_maprintf` - - `curlx_mvaprintf` - - `curlx_msprintf` - - `curlx_mprintf` - - `curlx_mfprintf` - - `curlx_mvsprintf` - - `curlx_mvprintf` - - `curlx_mvfprintf` - - -Content Encoding -================ - -## About content encodings - - [HTTP/1.1][4] specifies that a client may request that a server encode its - response. This is usually used to compress a response using one of a set of - commonly available compression techniques. These schemes are 'deflate' (the - zlib algorithm), 'gzip' and 'compress'. A client requests that the server - perform an encoding by including an Accept-Encoding header in the request - document. The value of the header should be one of the recognized tokens - 'deflate', ... (there's a way to register new schemes/tokens, see sec 3.5 of - the spec). A server MAY honor the client's encoding request. When a response - is encoded, the server includes a Content-Encoding header in the - response. The value of the Content-Encoding header indicates which scheme was - used to encode the data. - - A client may tell a server that it can understand several different encoding - schemes. In this case the server may choose any one of those and use it to - encode the response (indicating which one using the Content-Encoding header). - It's also possible for a client to attach priorities to different schemes so - that the server knows which it prefers. See sec 14.3 of RFC 2616 for more - information on the Accept-Encoding header. - -## Supported content encodings - - The 'deflate' and 'gzip' content encoding are supported by libcurl. Both - regular and chunked transfers work fine. The zlib library is required for - this feature. - -## The libcurl interface - - To cause libcurl to request a content encoding use: - - [`curl_easy_setopt`][1](curl, [`CURLOPT_ACCEPT_ENCODING`][5], string) - - where string is the intended value of the Accept-Encoding header. - - Currently, libcurl only understands how to process responses that use the - "deflate" or "gzip" Content-Encoding, so the only values for - [`CURLOPT_ACCEPT_ENCODING`][5] that will work (besides "identity," which does - nothing) are "deflate" and "gzip" If a response is encoded using the - "compress" or methods, libcurl will return an error indicating that the - response could not be decoded. If is NULL no Accept-Encoding header - is generated. If is a zero-length string, then an Accept-Encoding - header containing all supported encodings will be generated. - - The [`CURLOPT_ACCEPT_ENCODING`][5] must be set to any non-NULL value for - content to be automatically decoded. If it is not set and the server still - sends encoded content (despite not having been asked), the data is returned - in its raw form and the Content-Encoding type is not checked. - -## The curl interface - - Use the [--compressed][6] option with curl to cause it to ask servers to - compress responses using any format supported by curl. - - -hostip.c explained -================== - - The main compile-time defines to keep in mind when reading the host*.c source - file are these: - -## `CURLRES_IPV6` - - this host has getaddrinfo() and family, and thus we use that. The host may - not be able to resolve IPv6, but we don't really have to take that into - account. Hosts that aren't IPv6-enabled have `CURLRES_IPV4` defined. - -## `CURLRES_ARES` - - is defined if libcurl is built to use c-ares for asynchronous name - resolves. This can be Windows or *nix. - -## `CURLRES_THREADED` - - is defined if libcurl is built to use threading for asynchronous name - resolves. The name resolve will be done in a new thread, and the supported - asynch API will be the same as for ares-builds. This is the default under - (native) Windows. - - If any of the two previous are defined, `CURLRES_ASYNCH` is defined too. If - libcurl is not built to use an asynchronous resolver, `CURLRES_SYNCH` is - defined. - -## host*.c sources - - The host*.c sources files are split up like this: - - - hostip.c - method-independent resolver functions and utility functions - - hostasyn.c - functions for asynchronous name resolves - - hostsyn.c - functions for synchronous name resolves - - asyn-ares.c - functions for asynchronous name resolves using c-ares - - asyn-thread.c - functions for asynchronous name resolves using threads - - hostip4.c - IPv4 specific functions - - hostip6.c - IPv6 specific functions - - The hostip.h is the single united header file for all this. It defines the - `CURLRES_*` defines based on the config*.h and `curl_setup.h` defines. - - -Track Down Memory Leaks -======================= - -## Single-threaded - - Please note that this memory leak system is not adjusted to work in more - than one thread. If you want/need to use it in a multi-threaded app. Please - adjust accordingly. - - -## Build - - Rebuild libcurl with -DCURLDEBUG (usually, rerunning configure with - --enable-debug fixes this). 'make clean' first, then 'make' so that all - files are actually rebuilt properly. It will also make sense to build - libcurl with the debug option (usually -g to the compiler) so that debugging - it will be easier if you actually do find a leak in the library. - - This will create a library that has memory debugging enabled. - -## Modify Your Application - - Add a line in your application code: - - `curl_memdebug("dump");` - - This will make the malloc debug system output a full trace of all resource - using functions to the given file name. Make sure you rebuild your program - and that you link with the same libcurl you built for this purpose as - described above. - -## Run Your Application - - Run your program as usual. Watch the specified memory trace file grow. - - Make your program exit and use the proper libcurl cleanup functions etc. So - that all non-leaks are returned/freed properly. - -## Analyze the Flow - - Use the tests/memanalyze.pl perl script to analyze the dump file: - - tests/memanalyze.pl dump - - This now outputs a report on what resources that were allocated but never - freed etc. This report is very fine for posting to the list! - - If this doesn't produce any output, no leak was detected in libcurl. Then - the leak is mostly likely to be in your code. - - -`multi_socket` -============== - - Implementation of the `curl_multi_socket` API - - The main ideas of this API are simply: - - 1 - The application can use whatever event system it likes as it gets info - from libcurl about what file descriptors libcurl waits for what action - on. (The previous API returns `fd_sets` which is very select()-centric). - - 2 - When the application discovers action on a single socket, it calls - libcurl and informs that there was action on this particular socket and - libcurl can then act on that socket/transfer only and not care about - any other transfers. (The previous API always had to scan through all - the existing transfers.) - - The idea is that [`curl_multi_socket_action()`][7] calls a given callback - with information about what socket to wait for what action on, and the - callback only gets called if the status of that socket has changed. - - We also added a timer callback that makes libcurl call the application when - the timeout value changes, and you set that with [`curl_multi_setopt()`][9] - and the [`CURLMOPT_TIMERFUNCTION`][10] option. To get this to work, - Internally, there's an added struct to each easy handle in which we store - an "expire time" (if any). The structs are then "splay sorted" so that we - can add and remove times from the linked list and yet somewhat swiftly - figure out both how long there is until the next nearest timer expires - and which timer (handle) we should take care of now. Of course, the upside - of all this is that we get a [`curl_multi_timeout()`][8] that should also - work with old-style applications that use [`curl_multi_perform()`][11]. - - We created an internal "socket to easy handles" hash table that given - a socket (file descriptor) returns the easy handle that waits for action on - that socket. This hash is made using the already existing hash code - (previously only used for the DNS cache). - - To make libcurl able to report plain sockets in the socket callback, we had - to re-organize the internals of the [`curl_multi_fdset()`][12] etc so that - the conversion from sockets to `fd_sets` for that function is only done in - the last step before the data is returned. I also had to extend c-ares to - get a function that can return plain sockets, as that library too returned - only `fd_sets` and that is no longer good enough. The changes done to c-ares - are available in c-ares 1.3.1 and later. - - -Structs in libcurl -================== - -This section should cover 7.32.0 pretty accurately, but will make sense even -for older and later versions as things don't change drastically that often. - -## Curl_easy - - The `Curl_easy` struct is the one returned to the outside in the external API - as a "CURL *". This is usually known as an easy handle in API documentations - and examples. - - Information and state that is related to the actual connection is in the - 'connectdata' struct. When a transfer is about to be made, libcurl will - either create a new connection or re-use an existing one. The particular - connectdata that is used by this handle is pointed out by - `Curl_easy->easy_conn`. - - Data and information that regard this particular single transfer is put in - the SingleRequest sub-struct. - - When the `Curl_easy` struct is added to a multi handle, as it must be in - order to do any transfer, the ->multi member will point to the `Curl_multi` - struct it belongs to. The ->prev and ->next members will then be used by the - multi code to keep a linked list of `Curl_easy` structs that are added to - that same multi handle. libcurl always uses multi so ->multi *will* point to - a `Curl_multi` when a transfer is in progress. - - ->mstate is the multi state of this particular `Curl_easy`. When - `multi_runsingle()` is called, it will act on this handle according to which - state it is in. The mstate is also what tells which sockets to return for a - specific `Curl_easy` when [`curl_multi_fdset()`][12] is called etc. - - The libcurl source code generally use the name 'data' for the variable that - points to the `Curl_easy`. - - When doing multiplexed HTTP/2 transfers, each `Curl_easy` is associated with - an individual stream, sharing the same connectdata struct. Multiplexing - makes it even more important to keep things associated with the right thing! - -## connectdata - - A general idea in libcurl is to keep connections around in a connection - "cache" after they have been used in case they will be used again and then - re-use an existing one instead of creating a new as it creates a significant - performance boost. - - Each 'connectdata' identifies a single physical connection to a server. If - the connection can't be kept alive, the connection will be closed after use - and then this struct can be removed from the cache and freed. - - Thus, the same `Curl_easy` can be used multiple times and each time select - another connectdata struct to use for the connection. Keep this in mind, as - it is then important to consider if options or choices are based on the - connection or the `Curl_easy`. - - Functions in libcurl will assume that connectdata->data points to the - `Curl_easy` that uses this connection (for the moment). - - As a special complexity, some protocols supported by libcurl require a - special disconnect procedure that is more than just shutting down the - socket. It can involve sending one or more commands to the server before - doing so. Since connections are kept in the connection cache after use, the - original `Curl_easy` may no longer be around when the time comes to shut down - a particular connection. For this purpose, libcurl holds a special dummy - `closure_handle` `Curl_easy` in the `Curl_multi` struct to use when needed. - - FTP uses two TCP connections for a typical transfer but it keeps both in - this single struct and thus can be considered a single connection for most - internal concerns. - - The libcurl source code generally use the name 'conn' for the variable that - points to the connectdata. - -## Curl_multi - - Internally, the easy interface is implemented as a wrapper around multi - interface functions. This makes everything multi interface. - - `Curl_multi` is the multi handle struct exposed as "CURLM *" in external - APIs. - - This struct holds a list of `Curl_easy` structs that have been added to this - handle with [`curl_multi_add_handle()`][13]. The start of the list is - `->easyp` and `->num_easy` is a counter of added `Curl_easy`s. - - `->msglist` is a linked list of messages to send back when - [`curl_multi_info_read()`][14] is called. Basically a node is added to that - list when an individual `Curl_easy`'s transfer has completed. - - `->hostcache` points to the name cache. It is a hash table for looking up - name to IP. The nodes have a limited life time in there and this cache is - meant to reduce the time for when the same name is wanted within a short - period of time. - - `->timetree` points to a tree of `Curl_easy`s, sorted by the remaining time - until it should be checked - normally some sort of timeout. Each `Curl_easy` - has one node in the tree. - - `->sockhash` is a hash table to allow fast lookups of socket descriptor for - which `Curl_easy` uses that descriptor. This is necessary for the - `multi_socket` API. - - `->conn_cache` points to the connection cache. It keeps track of all - connections that are kept after use. The cache has a maximum size. - - `->closure_handle` is described in the 'connectdata' section. - - The libcurl source code generally use the name 'multi' for the variable that - points to the `Curl_multi` struct. - -## Curl_handler - - Each unique protocol that is supported by libcurl needs to provide at least - one `Curl_handler` struct. It defines what the protocol is called and what - functions the main code should call to deal with protocol specific issues. - In general, there's a source file named [protocol].c in which there's a - "struct `Curl_handler` `Curl_handler_[protocol]`" declared. In url.c there's - then the main array with all individual `Curl_handler` structs pointed to - from a single array which is scanned through when a URL is given to libcurl - to work with. - - `->scheme` is the URL scheme name, usually spelled out in uppercase. That's - "HTTP" or "FTP" etc. SSL versions of the protocol need their own `Curl_handler` setup so HTTPS separate from HTTP. - - `->setup_connection` is called to allow the protocol code to allocate - protocol specific data that then gets associated with that `Curl_easy` for - the rest of this transfer. It gets freed again at the end of the transfer. - It will be called before the 'connectdata' for the transfer has been - selected/created. Most protocols will allocate its private - 'struct [PROTOCOL]' here and assign `Curl_easy->req.protop` to point to it. - - `->connect_it` allows a protocol to do some specific actions after the TCP - connect is done, that can still be considered part of the connection phase. - - Some protocols will alter the `connectdata->recv[]` and - `connectdata->send[]` function pointers in this function. - - `->connecting` is similarly a function that keeps getting called as long as - the protocol considers itself still in the connecting phase. - - `->do_it` is the function called to issue the transfer request. What we call - the DO action internally. If the DO is not enough and things need to be kept - getting done for the entire DO sequence to complete, `->doing` is then - usually also provided. Each protocol that needs to do multiple commands or - similar for do/doing need to implement their own state machines (see SCP, - SFTP, FTP). Some protocols (only FTP and only due to historical reasons) has - a separate piece of the DO state called `DO_MORE`. - - `->doing` keeps getting called while issuing the transfer request command(s) - - `->done` gets called when the transfer is complete and DONE. That's after the - main data has been transferred. - - `->do_more` gets called during the `DO_MORE` state. The FTP protocol uses - this state when setting up the second connection. - - ->`proto_getsock` - ->`doing_getsock` - ->`domore_getsock` - ->`perform_getsock` - Functions that return socket information. Which socket(s) to wait for which - action(s) during the particular multi state. - - ->disconnect is called immediately before the TCP connection is shutdown. - - ->readwrite gets called during transfer to allow the protocol to do extra - reads/writes - - ->defport is the default report TCP or UDP port this protocol uses - - ->protocol is one or more bits in the `CURLPROTO_*` set. The SSL versions - have their "base" protocol set and then the SSL variation. Like - "HTTP|HTTPS". - - ->flags is a bitmask with additional information about the protocol that will - make it get treated differently by the generic engine: - - - `PROTOPT_SSL` - will make it connect and negotiate SSL - - - `PROTOPT_DUAL` - this protocol uses two connections - - - `PROTOPT_CLOSEACTION` - this protocol has actions to do before closing the - connection. This flag is no longer used by code, yet still set for a bunch - of protocol handlers. - - - `PROTOPT_DIRLOCK` - "direction lock". The SSH protocols set this bit to - limit which "direction" of socket actions that the main engine will - concern itself with. - - - `PROTOPT_NONETWORK` - a protocol that doesn't use network (read file:) - - - `PROTOPT_NEEDSPWD` - this protocol needs a password and will use a default - one unless one is provided - - - `PROTOPT_NOURLQUERY` - this protocol can't handle a query part on the URL - (?foo=bar) - -## conncache - - Is a hash table with connections for later re-use. Each `Curl_easy` has a - pointer to its connection cache. Each multi handle sets up a connection - cache that all added `Curl_easy`s share by default. - -## Curl_share - - The libcurl share API allocates a `Curl_share` struct, exposed to the - external API as "CURLSH *". - - The idea is that the struct can have a set of its own versions of caches and - pools and then by providing this struct in the `CURLOPT_SHARE` option, those - specific `Curl_easy`s will use the caches/pools that this share handle - holds. - - Then individual `Curl_easy` structs can be made to share specific things - that they otherwise wouldn't, such as cookies. - - The `Curl_share` struct can currently hold cookies, DNS cache and the SSL - session cache. - -## CookieInfo - - This is the main cookie struct. It holds all known cookies and related - information. Each `Curl_easy` has its own private CookieInfo even when - they are added to a multi handle. They can be made to share cookies by using - the share API. - - -[1]: https://curl.haxx.se/libcurl/c/curl_easy_setopt.html -[2]: https://curl.haxx.se/libcurl/c/curl_easy_init.html -[3]: https://c-ares.haxx.se/ -[4]: https://tools.ietf.org/html/rfc7230 "RFC 7230" -[5]: https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html -[6]: https://curl.haxx.se/docs/manpage.html#--compressed -[7]: https://curl.haxx.se/libcurl/c/curl_multi_socket_action.html -[8]: https://curl.haxx.se/libcurl/c/curl_multi_timeout.html -[9]: https://curl.haxx.se/libcurl/c/curl_multi_setopt.html -[10]: https://curl.haxx.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html -[11]: https://curl.haxx.se/libcurl/c/curl_multi_perform.html -[12]: https://curl.haxx.se/libcurl/c/curl_multi_fdset.html -[13]: https://curl.haxx.se/libcurl/c/curl_multi_add_handle.html -[14]: https://curl.haxx.se/libcurl/c/curl_multi_info_read.html + Public ("exported") symbols must use a `curl_` prefix. Public API functions + are marked with `CURL_EXTERN` in the public header files so that all others + can be hidden on platforms where this is possible. diff --git a/curl/docs/IPFS.md b/curl/docs/IPFS.md new file mode 100644 index 000000000..82dae9439 --- /dev/null +++ b/curl/docs/IPFS.md @@ -0,0 +1,133 @@ + + +# IPFS +For an overview about IPFS, visit the [IPFS project site](https://ipfs.tech/). + +In IPFS there are two protocols. IPFS and IPNS (their workings are explained in detail [here](https://docs.ipfs.tech/concepts/)). The ideal way to access data on the IPFS network is through those protocols. For example to access the Big Buck Bunny video the ideal way to access it is like: `ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi` + +## IPFS Gateways + +IPFS Gateway acts as a bridge between traditional HTTP clients and IPFS. +IPFS Gateway specifications of HTTP semantics can be found [here](https://specs.ipfs.tech/http-gateways/). + +### Deserialized responses + +By default, a gateway acts as a bridge between traditional HTTP clients and IPFS and performs necessary hash verification and deserialization. Through such gateway, users can download files, directories, and other content-addressed data stored with IPFS or IPNS as if they were stored in a traditional web server. + +### Verifiable responses + +By explicitly requesting [application/vnd.ipld.raw](https://www.iana.org/assignments/media-types/application/vnd.ipld.raw) or [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car) responses, by means defined in [Trustless Gateway Specification](https://specs.ipfs.tech/http-gateways/trustless-gateway/), the user is able to fetch raw content-addressed data and [perform hash verification themselves](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval). + +This enables users to use untrusted, public gateways without worrying they might return invalid/malicious bytes. + +## IPFS and IPNS protocol handling + +There are various ways to access data from the IPFS network. One such way is +through the concept of public +"[gateways](https://docs.ipfs.tech/concepts/ipfs-gateway/#overview)". The +short version is that entities can offer gateway services. An example here +that is hosted by Protocol Labs (who also makes IPFS) is `dweb.link` and +`ipfs.io`. Both sites expose gateway functionality. Getting a file through +`ipfs.io` looks like this: +`https://ipfs.io/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi` + +If you were to be [running your own IPFS +node](https://docs.ipfs.tech/how-to/command-line-quick-start/) then you, by +default, also have a [local gateway](https://specs.ipfs.tech/http-gateways/) +running. In its default configuration the earlier example would then also work +in this link: + +`http://127.0.0.1:8080/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi` + +## cURL handling of the IPFS protocols + +The IPFS integration in cURL hides this gateway logic for you. Instead of +providing a full URL to a file on IPFS like this: + +``` +curl http://127.0.0.1:8080/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi +``` + +You can provide it with the IPFS protocol instead: +``` +curl ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi +``` + +With the IPFS protocol way of asking a file, cURL still needs to know the +gateway. curl essentially just rewrites the IPFS based URL to a gateway URL. + +### IPFS_GATEWAY environment variable + +If the `IPFS_GATEWAY` environment variable is found, its value is used as +gateway. + +### Automatic gateway detection + +When you provide no additional details to cURL then it: + +1. First looks for the `IPFS_GATEWAY` environment variable and use that if it + is set. +2. Looks for the file: `~/.ipfs/gateway`. If it can find that file then it + means that you have a local gateway running and that file contains the URL + to your local gateway. + +If cURL fails, you are presented with an error message and a link to this page +to the option most applicable to solving the issue. + +### `--ipfs-gateway` argument + +You can also provide a `--ipfs-gateway` argument to cURL. This overrules any +other gateway setting. curl does not fallback to the other options if the +provided gateway did not work. + +## Gateway redirects + +A gateway could redirect to another place. For example, `dweb.link` redirects +[path based](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#path-gateway) +requests to [subdomain +based](https://docs.ipfs.tech/how-to/address-ipfs-on-web/#subdomain-gateway) +ones. A request using: + + curl ipfs://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi --ipfs-gateway https://dweb.link + +Which would be translated to: + + https://dweb.link/ipfs/bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi + +redirects to: + + https://bafybeigagd5nmnn2iys2f3doro7ydrevyr2mzarwidgadawmamiteydbzi.ipfs.dweb.link + +If you trust this behavior from your gateway of choice then passing the `-L` +option follows the redirect. + +## Error messages and hints + +Depending on the arguments, cURL could present the user with an error. + +### Gateway file and environment variable + +cURL tried to look for the file: `~/.ipfs/gateway` but could not find it. It +also tried to look for the `IPFS_GATEWAY` environment variable but could not +find that either. This happens when no extra arguments are passed to cURL and +letting it try to figure it out [automatically](#automatic-gateway-detection). + +Any IPFS implementation that has gateway support should expose its URL in +`~/.ipfs/gateway`. If you are already running a gateway, make sure it exposes +the file where cURL expects to find it. + +Alternatively you could set the `IPFS_GATEWAY` environment variable or pass +the `--ipfs-gateway` flag to the cURL command. + +### Malformed gateway URL + +The command executed evaluates in an invalid URL. This could be anywhere in +the URL, but a likely point is a wrong gateway URL. + +Inspect the URL set via the `IPFS_GATEWAY` environment variable or passed with +the `--ipfs-gateway` flag. Alternatively opt to go for the +[automatic](#automatic-gateway-detection) gateway detection. diff --git a/curl/docs/KNOWN_BUGS b/curl/docs/KNOWN_BUGS index 961a62814..ec5c67391 100644 --- a/curl/docs/KNOWN_BUGS +++ b/curl/docs/KNOWN_BUGS @@ -7,567 +7,522 @@ Known Bugs These are problems and bugs known to exist at the time of this release. Feel -free to join in and help us correct one or more of these! Also be sure to +free to join in and help us correct one or more of these. Also be sure to check the changelog of the current development status, as one or more of these -problems may have been fixed or changed somewhat since this was written! +problems may have been fixed or changed somewhat since this was written. 1. HTTP - 1.1 CURLFORM_CONTENTLEN in an array - 1.2 Disabling HTTP Pipelining - 1.3 STARTTRANSFER time is wrong for HTTP POSTs - 1.4 multipart formposts file name encoding - 1.5 Expect-100 meets 417 - 1.6 Unnecessary close when 401 received waiting for 100 - 1.9 HTTP/2 frames while in the connection pool kill reuse - 1.10 Strips trailing dot from host name - 1.11 CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM 2. TLS - 2.1 CURLINFO_SSL_VERIFYRESULT has limited support - 2.2 DER in keychain - 2.3 GnuTLS backend skips really long certificate fields - 2.4 DarwinSSL won't import PKCS#12 client certificates without a password + 2.1 IMAPS connection fails with Rustls error + 2.5 Client cert handling with Issuer DN differs between backends + 2.7 Client cert (MTLS) issues with Schannel + 2.11 Schannel TLS 1.2 handshake bug in old Windows versions + 2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel + 2.14 mbedTLS and CURLE_AGAIN handling 3. Email protocols 3.1 IMAP SEARCH ALL truncated response 3.2 No disconnect command - 3.3 SMTP to multiple recipients - 3.4 POP3 expects "CRLF.CRLF" eob for some single-line responses + 3.4 AUTH PLAIN for SMTP is not working on all servers + 3.5 APOP authentication fails on POP3 + 3.6 POP3 issue when reading small chunks 4. Command line - 4.1 -J with %-encoded file nameas - 4.2 -J with -C - fails - 4.3 --retry and transfer timeouts + 4.1 -T /dev/stdin may upload with an incorrect content length + 4.2 -T - always uploads chunked 5. Build and portability issues - 5.1 Windows Borland compiler + 5.1 OS400 port requires deprecated IBM library 5.2 curl-config --libs contains private details - 5.4 AIX shared build with c-ares fails - 5.5 can't handle Unicode arguments in Windows - 5.6 cmake support gaps - 5.7 Visual Studio project gaps - 5.8 configure finding libs in wrong directory - 5.9 Utilize Requires.private directives in libcurl.pc + 5.3 LDFLAGS passed too late making libs linked incorrectly + 5.6 Cygwin: make install installs curl-config.1 twice + 5.11 configure --with-gssapi with Heimdal is ignored on macOS + 5.12 flaky CI builds + 5.13 long paths are not fully supported on Windows + 5.15 Unicode on Windows 6. Authentication - 6.1 NTLM authentication and unicode 6.2 MIT Kerberos for Windows build 6.3 NTLM in system context uses wrong name - 6.4 Negotiate and Kerberos V5 need a fake user name + 6.5 NTLM does not support password with Unicode 'SECTION SIGN' character + 6.6 libcurl can fail to try alternatives with --proxy-any + 6.7 Do not clear digest for single realm + 6.8 Heimdal memory leaks + 6.9 SHA-256 digest not supported in Windows SSPI builds + 6.10 curl never completes Negotiate over HTTP + 6.11 Negotiate on Windows fails + 6.13 Negotiate against Hadoop HDFS 7. FTP - 7.1 FTP without or slow 220 response - 7.2 FTP with CONNECT and slow server - 7.3 FTP with NOBODY and FAILONERROR 7.4 FTP with ACCT - 7.5 ASCII FTP - 7.6 FTP with NULs in URL parts - 7.7 FTP and empty path parts in the URL - 7.8 Premature transfer end but healthy control channel - - 8. TELNET - 8.1 TELNET and time limtiations don't work - 8.2 Microsoft telnet server + 7.12 FTPS directory listing hangs on Windows with Schannel 9. SFTP and SCP - 9.1 SFTP doesn't do CURLOPT_POSTQUOTE correct + 9.1 SFTP does not do CURLOPT_POSTQUOTE correct + 9.2 wolfssh: publickey auth does not work + 9.3 Remote recursive folder creation with SFTP + 9.4 libssh blocking and infinite loop problem + 9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" + 9.6 wolfssh: all tests fail - 10. SOCKS - 10.1 SOCKS proxy connections are done blocking - 10.2 SOCKS don't support timeouts - 10.3 FTPS over SOCKS - 10.4 active FTP over a SOCKS + 10. Connection + 10.1 --interface with link-scoped IPv6 address + 10.2 Does not acknowledge getaddrinfo sorting policy 11. Internals - 11.1 Curl leaks .onion hostnames in DNS + 11.1 gssapi library name + version is missing in curl_version_info() 11.2 error buffer not set if connection to multiple addresses fails - 11.3 c-ares deviates from stock resolver on http://1346569778 11.4 HTTP test server 'connection-monitor' problems + 11.5 Connection information when using TCP Fast Open + 11.6 test cases sometimes timeout + 11.7 CURLOPT_CONNECT_TO does not work for HTTPS proxy + 11.8 WinIDN test failures + 11.9 setting a disabled option should return CURLE_NOT_BUILT_IN - 12. LDAP and OpenLDAP + 12. LDAP 12.1 OpenLDAP hangs after returning results + 12.2 LDAP on Windows does authentication wrong? + 12.3 LDAP on Windows does not work + 12.4 LDAPS requests to ActiveDirectory server hang 13. TCP/IP - 13.1 --interface for ipv6 binds to unusable IP address + 13.2 Trying local ports fails on Windows + + 15. CMake + 15.1 cmake outputs: no version information available + 15.6 uses -lpthread instead of Threads::Threads + 15.7 generated .pc file contains strange entries + 15.13 CMake build with MIT Kerberos does not work + + 16. aws-sigv4 + 16.2 aws-sigv4 does not handle multipart/form-data correctly + + 17. HTTP/2 + 17.1 HTTP/2 prior knowledge over proxy + 17.2 HTTP/2 frames while in the connection pool kill reuse + 17.3 ENHANCE_YOUR_CALM causes infinite retries + 17.4 HTTP/2 + TLS spends a lot of time in recv + 18. HTTP/3 + 18.1 connection migration does not work + 18.2 quiche: QUIC connection is draining + + 19. RTSP + 19.1 Some methods do not support response bodies ============================================================================== 1. HTTP -1.1 CURLFORM_CONTENTLEN in an array +2. TLS - It is not possible to pass a 64-bit value using CURLFORM_CONTENTLEN with - CURLFORM_ARRAY, when compiled on 32-bit platforms that support 64-bit - integers. This is because the underlying structure 'curl_forms' uses a dual - purpose char* for storing these values in via casting. For more information - see the now closed related issue: - https://github.com/curl/curl/issues/608 +2.1 IMAPS connection fails with Rustls error -1.2 Disabling HTTP Pipelining + https://github.com/curl/curl/issues/10457 - Disabling HTTP Pipelining when there are ongoing transfers can lead to - heap corruption and crash. https://curl.haxx.se/bug/view.cgi?id=1411 +2.5 Client cert handling with Issuer DN differs between backends -1.3 STARTTRANSFER time is wrong for HTTP POSTs + When the specified client certificate does not match any of the + server-specified DNs, the OpenSSL and GnuTLS backends behave differently. + The github discussion may contain a solution. - Wrong STARTTRANSFER timer accounting for POST requests Timer works fine with - GET requests, but while using POST the time for CURLINFO_STARTTRANSFER_TIME - is wrong. While using POST CURLINFO_STARTTRANSFER_TIME minus - CURLINFO_PRETRANSFER_TIME is near to zero every time. + See https://github.com/curl/curl/issues/1411 - https://github.com/curl/curl/issues/218 - https://curl.haxx.se/bug/view.cgi?id=1213 +2.7 Client cert (MTLS) issues with Schannel -1.4 multipart formposts file name encoding + See https://github.com/curl/curl/issues/3145 - When creating multipart formposts. The file name part can be encoded with - something beyond ascii but currently libcurl will only pass in the verbatim - string the app provides. There are several browsers that already do this - encoding. The key seems to be the updated draft to RFC2231: - https://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02 +2.11 Schannel TLS 1.2 handshake bug in old Windows versions -1.5 Expect-100 meets 417 + In old versions of Windows such as 7 and 8.1 the Schannel TLS 1.2 handshake + implementation likely has a bug that can rarely cause the key exchange to + fail, resulting in error SEC_E_BUFFER_TOO_SMALL or SEC_E_MESSAGE_ALTERED. - If an upload using Expect: 100-continue receives an HTTP 417 response, it - ought to be automatically resent without the Expect:. A workaround is for - the client application to redo the transfer after disabling Expect:. - https://curl.haxx.se/mail/archive-2008-02/0043.html + https://github.com/curl/curl/issues/5488 -1.6 Unnecessary close when 401 received waiting for 100 +2.13 CURLOPT_CERTINFO results in CURLE_OUT_OF_MEMORY with Schannel - libcurl closes the connection if an HTTP 401 reply is received while it is - waiting for the the 100-continue response. - https://curl.haxx.se/mail/lib-2008-08/0462.html + https://github.com/curl/curl/issues/8741 -1.9 HTTP/2 frames while in the connection pool kill reuse +2.14 mbedTLS and CURLE_AGAIN handling - If the server sends HTTP/2 frames (like for example an HTTP/2 PING frame) to - curl while the connection is held in curl's connection pool, the socket will - be found readable when considered for reuse and that makes curl think it is - dead and then it will be closed and a new connection gets created instead. + https://github.com/curl/curl/issues/15801 - This is *best* fixed by adding monitoring to connections while they are kept - in the pool so that pings can be responded to appropriately. +3. Email protocols -1.10 Strips trailing dot from host name +3.1 IMAP SEARCH ALL truncated response - When given a URL with a trailing dot for the host name part: - "https://example.com./", libcurl will strip off the dot and use the name - without a dot internally and send it dot-less in HTTP Host: headers and in - the TLS SNI field. + IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the + code reveals that pingpong.c contains some truncation code, at line 408, when + it deems the server response to be too large truncating it to 40 characters" + https://curl.se/bug/view.cgi?id=1366 - The HTTP part violates RFC 7230 section 5.4 but the SNI part is accordance - with RFC 6066 section 3. +3.2 No disconnect command - URLs using these trailing dots are very rare in the wild and we have not seen - or gotten any real-world problems with such URLs reported. The popular - browsers seem to have stayed with not stripping the dot for both uses (thus - they violate RFC 6066 instead of RFC 7230). + The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3 and + SMTP if a failure occurs during the authentication phase of a connection. - Daniel took the discussion to the HTTPbis mailing list in March 2016: - https://lists.w3.org/Archives/Public/ietf-http-wg/2016JanMar/0430.html but - there was not major rush or interest to fix this. The impression I get is - that most HTTP people rather not rock the boat now and instead prioritize web - compatibility rather than to strictly adhere to these RFCs. +3.4 AUTH PLAIN for SMTP is not working on all servers - Our current approach allows a knowing client to send a custom HTTP header - with the dot added. + Specifying "--login-options AUTH=PLAIN" on the command line does not seem to + work correctly. - It can also be noted that while adding a trailing dot to the host name in - most (all?) cases will make the name resolve to the same set of IP addresses, - many HTTP servers will not happily accept the trailing dot there unless that - has been specifically configured to be a fine virtual host. + See https://github.com/curl/curl/issues/4080 - If URLs with trailing dots for host names become more popular or even just - used more than for just plain fun experiments, I'm sure we will have reason - to go back and reconsider. +3.5 APOP authentication fails on POP3 - See https://github.com/curl/curl/issues/716 for the discussion. + See https://github.com/curl/curl/issues/10073 -1.11 CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM +3.6 POP3 issue when reading small chunks - I'm using libcurl to POST form data using a FILE* with the CURLFORM_STREAM - option of curl_formadd(). I've noticed that if the connection drops at just - the right time, the POST is reattempted without the data from the file. It - seems like the file stream position isn't getting reset to the beginning of - the file. I found the CURLOPT_SEEKFUNCTION option and set that with a - function that performs an fseek() on the FILE*. However, setting that didn't - seem to fix the issue or even get called. See - https://github.com/curl/curl/issues/768 + CURL_DBG_SOCK_RMAX=4 ./runtests.pl -v 982 + See https://github.com/curl/curl/issues/12063 -2. TLS +4. Command line -2.1 CURLINFO_SSL_VERIFYRESULT has limited support +4.1 -T /dev/stdin may upload with an incorrect content length - CURLINFO_SSL_VERIFYRESULT is only implemented for the OpenSSL and NSS - backends, so relying on this information in a generic app is flaky. + -T stats the path to figure out its size in bytes to use it as Content-Length + if it is a regular file. -2.2 DER in keychain + The problem with that is that, on BSDs and some other UNIXes (not Linux), + open(path) may not give you a file descriptor with a 0 offset from the start + of the file. - Curl doesn't recognize certificates in DER format in keychain, but it works - with PEM. https://curl.haxx.se/bug/view.cgi?id=1065 + See https://github.com/curl/curl/issues/12177 -2.3 GnuTLS backend skips really long certificate fields +4.2 -T - always uploads chunked - libcurl calls gnutls_x509_crt_get_dn() with a fixed buffer size and if the - field is too long in the cert, it'll just return an error and the field will - be displayed blank. + When the `<` shell operator is used. curl should realise that stdin is a + regular file in this case, and that it can do a non-chunked upload, like it + would do if you used -T file. -2.4 DarwinSSL won't import PKCS#12 client certificates without a password + See https://github.com/curl/curl/issues/12171 - libcurl calls SecPKCS12Import with the PKCS#12 client certificate, but that - function rejects certificates that do not have a password. - https://github.com/curl/curl/issues/1308 +5. Build and portability issues +5.1 OS400 port requires deprecated IBM library -3. Email protocols + curl for OS400 requires QADRT to build, which provides ASCII wrappers for + libc/POSIX functions in the ILE, but IBM no longer supports or even offers + this library to download. -3.1 IMAP SEARCH ALL truncated response + See https://github.com/curl/curl/issues/5176 - IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the - code reveals that pingpong.c contains some truncation code, at line 408, when - it deems the server response to be too large truncating it to 40 characters" - https://curl.haxx.se/bug/view.cgi?id=1366 +5.2 curl-config --libs contains private details -3.2 No disconnect command + "curl-config --libs" include details set in LDFLAGS when configure is run + that might be needed only for building libcurl. Further, curl-config --cflags + suffers from the same effects with CFLAGS/CPPFLAGS. - The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3 and - SMTP if a failure occurs during the authentication phase of a connection. +5.3 LDFLAGS passed too late making libs linked incorrectly -3.3 SMTP to multiple recipients + Compiling latest curl on HP-UX and linking against a custom OpenSSL (which is + on the default loader/linker path), fails because the generated Makefile has + LDFLAGS passed on after LIBS. - When sending data to multiple recipients, curl will abort and return failure - if one of the recipients indicate failure (on the "RCPT TO" - command). Ordinary mail programs would proceed and still send to the ones - that can receive data. This is subject for change in the future. - https://curl.haxx.se/bug/view.cgi?id=1116 + See https://github.com/curl/curl/issues/14893 -3.4 POP3 expects "CRLF.CRLF" eob for some single-line responses +5.6 Cygwin: make install installs curl-config.1 twice - You have to tell libcurl not to expect a body, when dealing with one line - response commands. Please see the POP3 examples and test cases which show - this for the NOOP and DELE commands. https://curl.haxx.se/bug/?i=740 + https://github.com/curl/curl/issues/8839 +5.11 configure --with-gssapi with Heimdal is ignored on macOS -4. Command line + ... unless you also pass --with-gssapi-libs -4.1 -J with %-encoded file nameas + https://github.com/curl/curl/issues/3841 - -J/--remote-header-name doesn't decode %-encoded file names. RFC6266 details - how it should be done. The can of worm is basically that we have no charset - handling in curl and ascii >=128 is a challenge for us. Not to mention that - decoding also means that we need to check for nastiness that is attempted, - like "../" sequences and the like. Probably everything to the left of any - embedded slashes should be cut off. - https://curl.haxx.se/bug/view.cgi?id=1294 +5.12 flaky CI builds -4.2 -J with -C - fails + We run many CI builds for each commit and PR on github, and especially a + number of the Windows builds are flaky. This means that we rarely get all CI + builds go green and complete without errors. This is unfortunate as it makes + us sometimes miss actual build problems and it is surprising to newcomers to + the project who (rightfully) do not expect this. - When using -J (with -O), automatically resumed downloading together with "-C - -" fails. Without -J the same command line works! This happens because the - resume logic is worked out before the target file name (and thus its - pre-transfer size) has been figured out! - https://curl.haxx.se/bug/view.cgi?id=1169 + See https://github.com/curl/curl/issues/6972 -4.3 --retry and transfer timeouts +5.13 long paths are not fully supported on Windows - If using --retry and the transfer timeouts (possibly due to using -m or - -y/-Y) the next attempt doesn't resume the transfer properly from what was - downloaded in the previous attempt but will truncate and restart at the - original position where it was at before the previous failed attempt. See - https://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report - https://qa.mandriva.com/show_bug.cgi?id=22565 + curl on Windows cannot access long paths (paths longer than 260 characters). + However, as a workaround, the Windows path prefix \\?\ which disables all + path interpretation may work to allow curl to access the path. For example: + \\?\c:\longpath. + See https://github.com/curl/curl/issues/8361 -5. Build and portability issues +5.15 Unicode on Windows -5.1 Windows Borland compiler + Passing in a Unicode filename with -o: - When building with the Windows Borland compiler, it fails because the "tlib" - tool doesn't support hyphens (minus signs) in file names and we have such in - the build. https://curl.haxx.se/bug/view.cgi?id=1222 + https://github.com/curl/curl/issues/11461 -5.2 curl-config --libs contains private details + Passing in Unicode character with -d: - "curl-config --libs" will include details set in LDFLAGS when configure is - run that might be needed only for building libcurl. Further, curl-config - --cflags suffers from the same effects with CFLAGS/CPPFLAGS. + https://github.com/curl/curl/issues/12231 -5.4 AIX shared build with c-ares fails + Windows Unicode builds use homedir in current locale - curl version 7.12.2 fails on AIX if compiled with --enable-ares. The - workaround is to combine --enable-ares with --disable-shared + The Windows Unicode builds of curl use the current locale, but expect Unicode + UTF-8 encoded paths for internal use such as open, access and stat. The + user's home directory is retrieved via curl_getenv in the current locale and + not as UTF-8 encoded Unicode. -5.5 can't handle Unicode arguments in Windows + See https://github.com/curl/curl/pull/7252 and + https://github.com/curl/curl/pull/7281 - If a URL or filename can't be encoded using the user's current codepage then + Cannot handle Unicode arguments in non-Unicode builds on Windows + + If a URL or filename cannot be encoded using the user's current codepage then it can only be encoded properly in the Unicode character set. Windows uses UTF-16 encoding for Unicode and stores it in wide characters, however curl - and libcurl are not equipped for that at the moment. And, except for Cygwin, - Windows can't use UTF-8 as a locale. + and libcurl are not equipped for that at the moment except when built with + _UNICODE and UNICODE defined. Except for Cygwin, Windows cannot use UTF-8 as + a locale. - https://curl.haxx.se/bug/?i=345 - https://curl.haxx.se/bug/?i=731 + https://curl.se/bug/?i=345 + https://curl.se/bug/?i=731 + https://curl.se/bug/?i=3747 -5.6 cmake support gaps + NTLM authentication and Unicode - The cmake build setup lacks several features that the autoconf build - offers. This includes: + NTLM authentication involving Unicode username or password only works + properly if built with UNICODE defined together with the Schannel backend. + The original problem was mentioned in: + https://curl.se/mail/lib-2009-10/0024.html + https://curl.se/bug/view.cgi?id=896 - - use of correct soname for the shared library build - - support for several TLS backends are missing - - the unit tests cause link failures in regular non-static builds - - no nghttp2 check + The Schannel version verified to work as mentioned in + https://curl.se/mail/lib-2012-07/0073.html -5.7 Visual Studio project gaps +6. Authentication - The Visual Studio projects lack some features that the autoconf and nmake - builds offer, such as the following: +6.2 MIT Kerberos for Windows build - - support for zlib and nghttp2 - - use of static runtime libraries - - add the test suite components + libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's + library header files exporting symbols/macros that should be kept private to + the KfW library. See ticket #5601 at https://krbdev.mit.edu/rt/ - In addition to this the following could be implemented: +6.3 NTLM in system context uses wrong name - - support for other development IDEs - - add PATH environment variables for third-party DLLs + NTLM authentication using SSPI (on Windows) when (lib)curl is running in + "system context" makes it use wrong(?) username - at least when compared to + what winhttp does. See https://curl.se/bug/view.cgi?id=535 -5.8 configure finding libs in wrong directory +6.5 NTLM does not support password with Unicode 'SECTION SIGN' character - When the configure script checks for third-party libraries, it adds those - directories to the LDFLAGS variable and then tries linking to see if it - works. When successful, the found directory is kept in the LDFLAGS variable - when the script continues to execute and do more tests and possibly check for - more libraries. + https://en.wikipedia.org/wiki/Section_sign + https://codepoints.net/U+00A7 SECTION SIGN + https://github.com/curl/curl/issues/2120 - This can make subsequent checks for libraries wrongly detect another - installation in a directory that was previously added to LDFLAGS by another - library check! +6.6 libcurl can fail to try alternatives with --proxy-any - A possibly better way to do these checks would be to keep the pristine LDFLAGS - even after successful checks and instead add those verified paths to a - separate variable that only after all library checks have been performed gets - appended to LDFLAGS. + When connecting via a proxy using --proxy-any, a failure to establish an + authentication causes libcurl to abort trying other options if the failed + method has a higher preference than the alternatives. As an example, + --proxy-any against a proxy which advertise Negotiate and NTLM, but which + fails to set up Kerberos authentication does not proceed to try + authentication using NTLM. -5.9 Utilize Requires.private directives in libcurl.pc + https://github.com/curl/curl/issues/876 - https://github.com/curl/curl/issues/864 +6.7 Do not clear digest for single realm -6. Authentication + https://github.com/curl/curl/issues/3267 -6.1 NTLM authentication and unicode +6.8 Heimdal memory leaks - NTLM authentication involving unicode user name or password only works - properly if built with UNICODE defined together with the WinSSL/schannel - backend. The original problem was mentioned in: - https://curl.haxx.se/mail/lib-2009-10/0024.html - https://curl.haxx.se/bug/view.cgi?id=896 + Running test 2077 and 2078 with curl built to do GSS with Heimdal causes + valgrind errors (memory leak). - The WinSSL/schannel version verified to work as mentioned in - https://curl.haxx.se/mail/lib-2012-07/0073.html + https://github.com/curl/curl/issues/14446 -6.2 MIT Kerberos for Windows build +6.9 SHA-256 digest not supported in Windows SSPI builds - libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's - library header files exporting symbols/macros that should be kept private to - the KfW library. See ticket #5601 at https://krbdev.mit.edu/rt/ + Windows builds of curl that have SSPI enabled use the native Windows API calls + to create authentication strings. The call to InitializeSecurityContext fails + with SEC_E_QOP_NOT_SUPPORTED which causes curl to fail with CURLE_AUTH_ERROR. -6.3 NTLM in system context uses wrong name - - NTLM authentication using SSPI (on Windows) when (lib)curl is running in - "system context" will make it use wrong(?) user name - at least when compared - to what winhttp does. See https://curl.haxx.se/bug/view.cgi?id=535 + Microsoft does not document supported digest algorithms and that SEC_E error + code is not a documented error for InitializeSecurityContext (digest). -6.4 Negotiate and Kerberos V5 need a fake user name + https://github.com/curl/curl/issues/6302 - In order to get Negotiate (SPNEGO) authentication to work in HTTP or Kerberos - V5 in the e-mail protocols, you need to provide a (fake) user name (this - concerns both curl and the lib) because the code wrongly only considers - authentication if there's a user name provided by setting - conn->bits.user_passwd in url.c https://curl.haxx.se/bug/view.cgi?id=440 How? - https://curl.haxx.se/mail/lib-2004-08/0182.html A possible solution is to - either modify this variable to be set or introduce a variable such as - new conn->bits.want_authentication which is set when any of the authentication - options are set. +6.10 curl never completes Negotiate over HTTP + Apparently it is not working correctly...? -7. FTP + See https://github.com/curl/curl/issues/5235 -7.1 FTP without or slow 220 response +6.11 Negotiate on Windows fails - If a connection is made to a FTP server but the server then just never sends - the 220 response or otherwise is dead slow, libcurl will not acknowledge the - connection timeout during that phase but only the "real" timeout - which may - surprise users as it is probably considered to be the connect phase to most - people. Brought up (and is being misunderstood) in: - https://curl.haxx.se/bug/view.cgi?id=856 + When using --negotiate (or NTLM) with curl on Windows, SSL/TLS handshake + fails despite having a valid kerberos ticket cached. Works without any issue + in Unix/Linux. -7.2 FTP with CONNECT and slow server + https://github.com/curl/curl/issues/5881 - When doing FTP over a socks proxy or CONNECT through HTTP proxy and the multi - interface is used, libcurl will fail if the (passive) TCP connection for the - data transfer isn't more or less instant as the code does not properly wait - for the connect to be confirmed. See test case 564 for a first shot at a test - case. +6.13 Negotiate authentication against Hadoop HDFS -7.3 FTP with NOBODY and FAILONERROR + https://github.com/curl/curl/issues/8264 - It seems sensible to be able to use CURLOPT_NOBODY and CURLOPT_FAILONERROR - with FTP to detect if a file exists or not, but it is not working: - https://curl.haxx.se/mail/lib-2008-07/0295.html +7. FTP 7.4 FTP with ACCT When doing an operation over FTP that requires the ACCT command (but not when - logging in), the operation will fail since libcurl doesn't detect this and - thus fails to issue the correct command: - https://curl.haxx.se/bug/view.cgi?id=635 - -7.5 ASCII FTP + logging in), the operation fails since libcurl does not detect this and thus + fails to issue the correct command: https://curl.se/bug/view.cgi?id=635 - FTP ASCII transfers do not follow RFC959. They don't convert the data - accordingly (not for sending nor for receiving). RFC 959 section 3.1.1.1 - clearly describes how this should be done: +7.12 FTPS server compatibility on Windows with Schannel - The sender converts the data from an internal character representation to - the standard 8-bit NVT-ASCII representation (see the Telnet - specification). The receiver will convert the data from the standard - form to his own internal form. + FTPS is not widely used with the Schannel TLS backend and so there may be + more bugs compared to other TLS backends such as OpenSSL. In the past users + have reported hanging and failed connections. It is likely some changes to + curl since then fixed the issues. None of the reported issues can be + reproduced any longer. - Since 7.15.4 at least line endings are converted. + If you encounter an issue connecting to your server via FTPS with the latest + curl and Schannel then please search for open issues or file a new issue. -7.6 FTP with NULs in URL parts +9. SFTP and SCP - FTP URLs passed to curl may contain NUL (0x00) in the RFC 1738 , - , and components, encoded as "%00". The problem is that - curl_unescape does not detect this, but instead returns a shortened C string. - From a strict FTP protocol standpoint, NUL is a valid character within RFC - 959 , so the way to handle this correctly in curl would be to use a - data structure other than a plain C string, one that can handle embedded NUL - characters. From a practical standpoint, most FTP servers would not - meaningfully support NUL characters within RFC 959 , anyway (e.g., - Unix pathnames may not contain NUL). +9.1 SFTP does not do CURLOPT_POSTQUOTE correct -7.7 FTP and empty path parts in the URL + When libcurl sends CURLOPT_POSTQUOTE commands when connected to an SFTP + server using the multi interface, the commands are not being sent correctly + and instead the connection is "cancelled" (the operation is considered done) + prematurely. There is a half-baked (busy-looping) patch provided in the bug + report but it cannot be accepted as-is. See + https://curl.se/bug/view.cgi?id=748 - libcurl ignores empty path parts in FTP URLs, whereas RFC1738 states that - such parts should be sent to the server as 'CWD ' (without an argument). The - only exception to this rule, is that we knowingly break this if the empty - part is first in the path, as then we use the double slashes to indicate that - the user wants to reach the root dir (this exception SHALL remain even when - this bug is fixed). +9.2 wolfssh: publickey auth does not work -7.8 Premature transfer end but healthy control channel + When building curl to use the wolfSSH backend for SFTP, the publickey + authentication does not work. This is simply functionality not written for curl + yet, the necessary API for make this work is provided by wolfSSH. - When 'multi_done' is called before the transfer has been completed the normal - way, it is considered a "premature" transfer end. In this situation, libcurl - closes the connection assuming it doesn't know the state of the connection so - it can't be reused for subsequent requests. + See https://github.com/curl/curl/issues/4820 - With FTP however, this isn't necessarily true but there are a bunch of - situations (listed in the ftp_done code) where it *could* keep the connection - alive even in this situation - but the current code doesn't. Fixing this would - allow libcurl to reuse FTP connections better. +9.3 Remote recursive folder creation with SFTP -8. TELNET + On this servers, the curl fails to create directories on the remote server + even when the CURLOPT_FTP_CREATE_MISSING_DIRS option is set. -8.1 TELNET and time limtiations don't work + See https://github.com/curl/curl/issues/5204 - When using telnet, the time limitation options don't work. - https://curl.haxx.se/bug/view.cgi?id=846 +9.4 libssh blocking and infinite loop problem -8.2 Microsoft telnet server + In the SSH_SFTP_INIT state for libssh, the ssh session working mode is set to + blocking mode. If the network is suddenly disconnected during sftp + transmission, curl is stuck, even if curl is configured with a timeout. - There seems to be a problem when connecting to the Microsoft telnet server. - https://curl.haxx.se/bug/view.cgi?id=649 + https://github.com/curl/curl/issues/8632 +9.5 Cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!" -9. SFTP and SCP + Running SCP and SFTP tests on Cygwin makes this warning message appear. -9.1 SFTP doesn't do CURLOPT_POSTQUOTE correct + https://github.com/curl/curl/issues/11244 - When libcurl sends CURLOPT_POSTQUOTE commands when connected to a SFTP server - using the multi interface, the commands are not being sent correctly and - instead the connection is "cancelled" (the operation is considered done) - prematurely. There is a half-baked (busy-looping) patch provided in the bug - report but it cannot be accepted as-is. See - https://curl.haxx.se/bug/view.cgi?id=748 +9.6 wolfssh: all tests fail + Something fundamental stops them all from working properly. -10. SOCKS + https://github.com/curl/curl/issues/16794 -10.1 SOCKS proxy connections are done blocking +10. Connection - Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very bad - when used with the multi interface. +10.1 --interface with link-scoped IPv6 address -10.2 SOCKS don't support timeouts + When you give the `--interface` option telling curl to use a specific + interface for its outgoing traffic in combination with an IPv6 address in the + URL that uses a link-local scope, curl might pick the wrong address from the + named interface and the subsequent transfer fails. - The SOCKS4 connection codes don't properly acknowledge (connect) timeouts. - According to bug #1556528, even the SOCKS5 connect code does not do it right: - https://curl.haxx.se/bug/view.cgi?id=604 + Example command line: - When connecting to a SOCK proxy, the (connect) timeout is not properly - acknowledged after the actual TCP connect (during the SOCKS "negotiate" - phase). + curl --interface eth0 'http://[fe80:928d:xxff:fexx:xxxx]/' -10.3 FTPS over SOCKS + The fact that the given IP address is link-scoped should probably be used as + input to somehow make curl make a better choice for this. - libcurl doesn't support FTPS over a SOCKS proxy. + https://github.com/curl/curl/issues/14782 -10.4 active FTP over a SOCKS +10.2 Does not acknowledge getaddrinfo sorting policy - libcurl doesn't support active FTP over a SOCKS proxy + Even if a user edits /etc/gai.conf to prefer IPv4, curl still prefers and + tries IPv6 addresses first. + https://github.com/curl/curl/issues/16718 11. Internals -11.1 Curl leaks .onion hostnames in DNS +11.1 gssapi library name + version is missing in curl_version_info() - Curl sends DNS requests for hostnames with a .onion TLD. This leaks - information about what the user is attempting to access, and violates this - requirement of RFC7686: https://tools.ietf.org/html/rfc7686 + The struct needs to be expanded and code added to store this info. - Issue: https://github.com/curl/curl/issues/543 + See https://github.com/curl/curl/issues/13492 11.2 error buffer not set if connection to multiple addresses fails If you ask libcurl to resolve a hostname like example.com to IPv6 addresses - only. But you only have IPv4 connectivity. libcurl will correctly fail with - CURLE_COULDNT_CONNECT. But the error buffer set by CURLOPT_ERRORBUFFER + when you only have IPv4 connectivity. libcurl fails with + CURLE_COULDNT_CONNECT, but the error buffer set by CURLOPT_ERRORBUFFER remains empty. Issue: https://github.com/curl/curl/issues/544 -11.3 c-ares deviates from stock resolver on http://1346569778 +11.4 HTTP test server 'connection-monitor' problems - When using the socket resolvers, that URL becomes: + The 'connection-monitor' feature of the sws HTTP test server does not work + properly if some tests are run in unexpected order. Like 1509 and then 1525. - * Rebuilt URL to: http://1346569778/ - * Trying 80.67.6.50... + See https://github.com/curl/curl/issues/868 - but with c-ares it instead says "Could not resolve: 1346569778 (Domain name - not found)" +11.5 Connection information when using TCP Fast Open - See https://github.com/curl/curl/issues/893 + CURLINFO_LOCAL_PORT (and possibly a few other) fails when TCP Fast Open is + enabled. -11.4 HTTP test server 'connection-monitor' problems + See https://github.com/curl/curl/issues/1332 and + https://github.com/curl/curl/issues/4296 - The 'connection-monitor' feature of the sws HTTP test server doesn't work - properly if some tests are run in unexpected order. Like 1509 and then 1525. +11.6 test cases sometimes timeout - See https://github.com/curl/curl/issues/868 + Occasionally, one of the tests timeouts. Inexplicably. + + See https://github.com/curl/curl/issues/13350 + +11.7 CURLOPT_CONNECT_TO does not work for HTTPS proxy + + It is unclear if the same option should even cover the proxy connection or if + if requires a separate option. + + See https://github.com/curl/curl/issues/14481 +11.8 WinIDN test failures -12. LDAP and OpenLDAP + Test 165 disabled when built with WinIDN. + +11.9 setting a disabled option should return CURLE_NOT_BUILT_IN + + When curl has been built with specific features or protocols disabled, + setting such options with curl_easy_setopt() should rather return + CURLE_NOT_BUILT_IN instead of CURLE_UNKNOWN_OPTION to signal the difference + to the application + + See https://github.com/curl/curl/issues/15472 + +12. LDAP 12.1 OpenLDAP hangs after returning results - By configuration defaults, openldap automatically chase referrals on + By configuration defaults, OpenLDAP automatically chase referrals on secondary socket descriptors. The OpenLDAP backend is asynchronous and thus should monitor all socket descriptors involved. Currently, these secondary - descriptors are not monitored, causing openldap library to never receive + descriptors are not monitored, causing OpenLDAP library to never receive data from them. As a temporary workaround, disable referrals chasing by configuration. @@ -579,15 +534,120 @@ problems may have been fixed or changed somewhat since this was written! Generic LDAP is synchronous: OK. See https://github.com/curl/curl/issues/622 and - https://curl.haxx.se/mail/lib-2016-01/0101.html + https://curl.se/mail/lib-2016-01/0101.html + +12.2 LDAP on Windows does authentication wrong? + + https://github.com/curl/curl/issues/3116 + +12.3 LDAP on Windows does not work + A simple curl command line getting "ldap://ldap.forumsys.com" returns an + error that says "no memory" ! + + https://github.com/curl/curl/issues/4261 + +12.4 LDAPS requests to ActiveDirectory server hang + + https://github.com/curl/curl/issues/9580 13. TCP/IP -13.1 --interface for ipv6 binds to unusable IP address +13.2 Trying local ports fails on Windows + + This makes '--local-port [range]' to not work since curl cannot properly + detect if a port is already in use, so it tries the first port, uses that and + then subsequently fails anyway if that was actually in use. + + https://github.com/curl/curl/issues/8112 + +15. CMake + +15.1 cmake outputs: no version information available + + Something in the SONAME generation seems to be wrong in the cmake build. + + https://github.com/curl/curl/issues/11158 + +15.6 uses -lpthread instead of Threads::Threads + + See https://github.com/curl/curl/issues/6166 + +15.7 generated .pc file contains strange entries + + The Libs.private field of the generated .pc file contains -lgcc -lgcc_s -lc + -lgcc -lgcc_s + + See https://github.com/curl/curl/issues/6167 + +15.13 CMake build with MIT Kerberos does not work + + Minimum CMake version was bumped in curl 7.71.0 (#5358) Since CMake 3.2 + try_compile started respecting the CMAKE_EXE_FLAGS. The code dealing with + MIT Kerberos detection sets few variables to potentially weird mix of space, + and ;-separated flags. It had to blow up at some point. All the CMake checks + that involve compilation are doomed from that point, the configured tree + cannot be built. + + https://github.com/curl/curl/issues/6904 + +16. aws-sigv4 + +16.2 aws-sigv4 does not handle multipart/form-data correctly + + https://github.com/curl/curl/issues/13351 + +17. HTTP/2 + +17.1 HTTP/2 prior knowledge over proxy + + https://github.com/curl/curl/issues/12641 + +17.2 HTTP/2 frames while in the connection pool kill reuse + + If the server sends HTTP/2 frames (like for example an HTTP/2 PING frame) to + curl while the connection is held in curl's connection pool, the socket is + found readable when considered for reuse and that makes curl think it is dead + and then it is closed and a new connection gets created instead. + + This is *best* fixed by adding monitoring to connections while they are kept + in the pool so that pings can be responded to appropriately. + +17.3 ENHANCE_YOUR_CALM causes infinite retries + + Infinite retries with 2 parallel requests on one connection receiving GOAWAY + with ENHANCE_YOUR_CALM error code. + + See https://github.com/curl/curl/issues/5119 + +17.4 HTTP/2 + TLS spends a lot of time in recv + + It has been observed that by making the speed limit less accurate we could + improve this performance. (by reverting + https://github.com/curl/curl/commit/db5c9f4f9e0779b49624752b135281a0717b277b) + Can we find a golden middle ground? + + See https://curl.se/mail/lib-2024-05/0026.html and + https://github.com/curl/curl/issues/13416 + +18. HTTP/3 + +18.1 connection migration does not work + + https://github.com/curl/curl/issues/7695 + +18.2 quiche: QUIC connection is draining + + The transfer ends with error "QUIC connection is draining". + + https://github.com/curl/curl/issues/12037 + +19. RTSP + +19.1 Some methods do not support response bodies - Since IPv6 provides a lot of addresses with different scope, binding to an - IPv6 address needs to take the proper care so that it doesn't bind to a - locally scoped address as that is bound to fail. + The RTSP implementation is written to assume that a number of RTSP methods + always get responses without bodies, even though there seems to be no + indication in the RFC that this is always the case. - https://github.com/curl/curl/issues/686 + https://github.com/curl/curl/issues/12414 diff --git a/curl/docs/LICENSE-MIXING.md b/curl/docs/LICENSE-MIXING.md deleted file mode 100644 index 5376bdb70..000000000 --- a/curl/docs/LICENSE-MIXING.md +++ /dev/null @@ -1,127 +0,0 @@ -License Mixing -============== - -libcurl can be built to use a fair amount of various third party libraries, -libraries that are written and provided by other parties that are distributed -using their own licenses. Even libcurl itself contains code that may cause -problems to some. This document attempts to describe what licenses libcurl and -the other libraries use and what possible dilemmas linking and mixing them all -can lead to for end users. - -I am not a lawyer and this is not legal advice! - -One common dilemma is that [GPL](https://www.gnu.org/licenses/gpl.html) -licensed code is not allowed to be linked with code licensed under the -[Original BSD license](https://spdx.org/licenses/BSD-4-Clause.html) (with the -announcement clause). You may still build your own copies that use them all, -but distributing them as binaries would be to violate the GPL license - unless -you accompany your license with an -[exception](https://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs). This -particular problem was addressed when the [Modified BSD -license](https://opensource.org/licenses/BSD-3-Clause) was created, which does -not have the announcement clause that collides with GPL. - -## libcurl - - Uses an [MIT style license](https://curl.haxx.se/docs/copyright.html) that is - very liberal. - -## OpenSSL - - (May be used for SSL/TLS support) Uses an Original BSD-style license with an - announcement clause that makes it "incompatible" with GPL. You are not - allowed to ship binaries that link with OpenSSL that includes GPL code - (unless that specific GPL code includes an exception for OpenSSL - a habit - that is growing more and more common). If OpenSSL's licensing is a problem - for you, consider using another TLS library. - -## GnuTLS - - (May be used for SSL/TLS support) Uses the - [LGPL](https://www.gnu.org/licenses/lgpl.html) license. If this is a problem - for you, consider using another TLS library. Also note that GnuTLS itself - depends on and uses other libs (libgcrypt and libgpg-error) and they too are - LGPL- or GPL-licensed. - -## WolfSSL - - (May be used for SSL/TLS support) Uses the GPL license or a proprietary - license. If this is a problem for you, consider using another TLS library. - -## NSS - - (May be used for SSL/TLS support) Is covered by the - [MPL](https://www.mozilla.org/MPL/) license, the GPL license and the LGPL - license. You may choose to license the code under MPL terms, GPL terms, or - LGPL terms. These licenses grant you different permissions and impose - different obligations. You should select the license that best meets your - needs. - -## axTLS - - (May be used for SSL/TLS support) Uses a Modified BSD-style license. - -## mbedTLS - - (May be used for SSL/TLS support) Uses the [Apache 2.0 - license](https://opensource.org/licenses/Apache-2.0) or the GPL license. - You may choose to license the code under Apache 2.0 terms or GPL terms. - These licenses grant you different permissions and impose different - obligations. You should select the license that best meets your needs. - -## BoringSSL - - (May be used for SSL/TLS support) As an OpenSSL fork, it has the same - license as that. - -## libressl - - (May be used for SSL/TLS support) As an OpenSSL fork, it has the same - license as that. - -## c-ares - - (Used for asynchronous name resolves) Uses an MIT license that is very - liberal and imposes no restrictions on any other library or part you may link - with. - -## zlib - - (Used for compressed Transfer-Encoding support) Uses an MIT-style license - that shouldn't collide with any other library. - -## MIT Kerberos - - (May be used for GSS support) MIT licensed, that shouldn't collide with any - other parts. - -## Heimdal - - (May be used for GSS support) Heimdal is Original BSD licensed with the - announcement clause. - -## GNU GSS - - (May be used for GSS support) GNU GSS is GPL licensed. Note that you may not - distribute binary curl packages that uses this if you build curl to also link - and use any Original BSD licensed libraries! - -## libidn - - (Used for IDNA support) Uses the GNU Lesser General Public License [3]. LGPL - is a variation of GPL with slightly less aggressive "copyleft". This license - requires more requirements to be met when distributing binaries, see the - license for details. Also note that if you distribute a binary that includes - this library, you must also include the full LGPL license text. Please - properly point out what parts of the distributed package that the license - addresses. - -## OpenLDAP - - (Used for LDAP support) Uses a Modified BSD-style license. Since libcurl uses - OpenLDAP as a shared library only, I have not heard of anyone that ships - OpenLDAP linked with libcurl in an app. - -## libssh2 - - (Used for scp and sftp support) libssh2 uses a Modified BSD-style license. diff --git a/curl/docs/MAIL-ETIQUETTE b/curl/docs/MAIL-ETIQUETTE deleted file mode 100644 index 54f1090b7..000000000 --- a/curl/docs/MAIL-ETIQUETTE +++ /dev/null @@ -1,285 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -MAIL ETIQUETTE - - 1. About the lists - 1.1 Mailing Lists - 1.2 Netiquette - 1.3 Do Not Mail a Single Individual - 1.4 Subscription Required - 1.5 Moderation of new posters - 1.6 Handling trolls and spam - 1.7 How to unsubscribe - 1.8 I posted, now what? - 1.9 Your emails are public - - 2. Sending mail - 2.1 Reply or New Mail - 2.2 Reply to the List - 2.3 Use a Sensible Subject - 2.4 Do Not Top-Post - 2.5 HTML is not for mails - 2.6 Quoting - 2.7 Digest - 2.8 Please Tell Us How You Solved The Problem! - -============================================================================== - -1. About the lists - - 1.1 Mailing Lists - - The mailing lists we have are all listed and described at - https://curl.haxx.se/mail/ - - Each mailing list is targeted to a specific set of users and subjects, - please use the one or the ones that suit you the most. - - Each mailing list has hundreds up to thousands of readers, meaning that - each mail sent will be received and read by a very large number of people. - People from various cultures, regions, religions and continents. - - 1.2 Netiquette - - Netiquette is a common term for how to behave on the internet. Of course, in - each particular group and subculture there will be differences in what is - acceptable and what is considered good manners. - - This document outlines what we in the curl project consider to be good - etiquette, and primarily this focus on how to behave on and how to use our - mailing lists. - - 1.3 Do Not Mail a Single Individual - - Many people send one question to one person. One person gets many mails, and - there is only one person who can give you a reply. The question may be - something that other people would also like to ask. These other people have - no way to read the reply, but to ask the one person the question. The one - person consequently gets overloaded with mail. - - If you really want to contact an individual and perhaps pay for his or her - services, by all means go ahead, but if it's just another curl question, - take it to a suitable list instead. - - 1.4 Subscription Required - - All curl mailing lists require that you are subscribed to allow a mail to go - through to all the subscribers. - - If you post without being subscribed (or from a different mail address than - the one you are subscribed with), your mail will simply be silently - discarded. You have to subscribe first, then post. - - The reason for this unfortunate and strict subscription policy is of course - to stop spam from pestering the lists. - - 1.5 Moderation of new posters - - Several of the curl mailing lists automatically make all posts from new - subscribers be moderated. This means that after you've subscribed and - sent your first mail to a list, that mail will not be let through to the - list until a mailing list administrator has verified that it is OK and - permits it to get posted. - - Once a first post has been made that proves the sender is actually talking - about curl-related subjects, the moderation "flag" will be switched off and - future posts will go through without being moderated. - - The reason for this moderation policy is that we do suffer from spammers who - actually subscribe and send spam to our lists. - - 1.6 Handling trolls and spam - - Despite our good intentions and hard work to keep spam off the lists and to - maintain a friendly and positive atmosphere, there will be times when spam - and or trolls get through. - - Troll - "someone who posts inflammatory, extraneous, or off-topic messages - in an online community" - - Spam - "use of electronic messaging systems to send unsolicited bulk - messages" - - No matter what, we NEVER EVER respond to trolls or spammers on the list. If - you believe the list admin should do something in particular, contact him/her - off-list. The subject will be taken care of as much as possible to prevent - repeated offenses, but responding on the list to such messages never leads to - anything good and only puts the light even more on the offender: which was - the entire purpose of it getting sent to the list in the first place. - - Don't feed the trolls! - - 1.7 How to unsubscribe - - You can unsubscribe the same way you subscribed in the first place. You go - to the page for the particular mailing list you're subscribed to and you enter - your email address and password and press the unsubscribe button. - - Also, the instructions to unsubscribe are included in the headers of every - mail that is sent out to all curl related mailing lists and there's a footer - in each mail that links to the "admin" page on which you can unsubscribe and - change other options. - - You NEVER EVER email the mailing list requesting someone else to take you off - the list. - - 1.8 I posted, now what? - - If you aren't subscribed with the exact same email address that you used to - send the email, your post will just be silently discarded. - - If you posted for the first time to the mailing list, you first need to wait - for an administrator to allow your email to go through (moderated). This normally - happens very quickly but in case we're asleep, you may have to wait a few - hours. - - Once your email goes through it is sent out to several hundred or even - thousands of recipients. Your email may cover an area that not that many people - know about or are interested in. Or possibly the person who knows about it - is on vacation or under a very heavy work load right now. You may have to wait - for a response and you should not expect to get a response at all, but - hopefully you get an answer within a couple of days. - - You do yourself and all of us a service when you include as many details as - possible already in your first email. Mention your operating system and - environment. Tell us which curl version you're using and tell us what you - did, what happened and what you expected would happen. Preferably, show us - what you did with details enough to allow others to help point out the problem - or repeat the same steps in their locations. - - Failing to include details will only delay responses and make people respond - and ask for more details and you will have to send a follow-up email that - includes them. - - Expect the responses to primarily help YOU debug the issue, or ask YOU - questions that can lead you or others towards a solution or explanation to - whatever you experience. - - If you are a repeat offender to the guidelines outlined in this document, - chances are that people will ignore you at will and your chances to get - responses in the future will greatly diminish. - - 1.9 Your emails are public - - Your email, its contents and all its headers and the details in those - headers will be received by every subscriber of the mailing list that you - send your email to. - - Your email as sent to a curl mailing list will end up in mail archives, on - the curl web site and elsewhere, for others to see and read. Today and in - the future. In addition to the archives, the mail is sent out to thousands - of individuals. There is no way to undo a sent email. - - When sending emails to a curl mailing list, do not include sensitive - information such as user names and passwords; use fake ones, temporary ones - or just remove them completely from the mail. Note that this includes base64 - encoded HTTP Basic auth headers. - - This public nature of the curl mailing lists makes automaticly inserted mail - footers about mails being "private" or "only meant for the receipient" or - similar even more silly than usual. Because they are absolutely not private - when sent to a public mailing list. - - -2. Sending mail - - 2.1 Reply or New Mail - - Please do not reply to an existing message as a short-cut to post a message - to the lists. - - Many mail programs and web archivers use information within mails to keep - them together as "threads", as collections of posts that discuss a certain - subject. If you don't intend to reply on the same or similar subject, don't - just hit reply on an existing mail and change subject, create a new mail. - - 2.2 Reply to the List - - When replying to a message from the list, make sure that you do "group - reply" or "reply to all", and not just reply to the author of the single - mail you reply to. - - We're actively discouraging replying back to the single person by setting - the Reply-To: field in outgoing mails back to the mailing list address, - making it harder for people to mail the author directly, if only by mistake. - - 2.3 Use a Sensible Subject - - Please use a subject of the mail that makes sense and that is related to the - contents of your mail. It makes it a lot easier to find your mail afterwards - and it makes it easier to track mail threads and topics. - - 2.4 Do Not Top-Post - - If you reply to a message, don't use top-posting. Top-posting is when you - write the new text at the top of a mail and you insert the previous quoted - mail conversation below. It forces users to read the mail in a backwards - order to properly understand it. - - This is why top posting is so bad (in top posting order): - - A: Because it messes up the order in which people normally read text. - Q: Why is top-posting such a bad thing? - A: Top-posting. - Q: What is the most annoying thing in e-mail? - - Apart from the screwed up read order (especially when mixed together in a - thread when someone responds using the mandated bottom-posting style), it - also makes it impossible to quote only parts of the original mail. - - When you reply to a mail. You let the mail client insert the previous mail - quoted. Then you put the cursor on the first line of the mail and you move - down through the mail, deleting all parts of the quotes that don't add - context for your comments. When you want to add a comment you do so, inline, - right after the quotes that relate to your comment. Then you continue - downwards again. - - When most of the quotes have been removed and you've added your own words, - you're done! - - 2.5 HTML is not for mails - - Please switch off those HTML encoded messages. You can mail all those funny - mails to your friends. We speak plain text mails. - - 2.6 Quoting - - Quote as little as possible. Just enough to provide the context you cannot - leave out. A lengthy description can be found here: - - https://www.netmeister.org/news/learn2quote.html - - 2.7 Digest - - We allow subscribers to subscribe to the "digest" version of the mailing - lists. A digest is a collection of mails lumped together in one single mail. - - Should you decide to reply to a mail sent out as a digest, there are two - things you MUST consider if you really really cannot subscribe normally - instead: - - Cut off all mails and chatter that is not related to the mail you want to - reply to. - - Change the subject name to something sensible and related to the subject, - preferably even the actual subject of the single mail you wanted to reply to - - 2.8 Please Tell Us How You Solved The Problem! - - Many people mail questions to the list, people spend some of their time and - make an effort in providing good answers to these questions. - - If you are the one who asks, please consider responding once more in case - one of the hints was what solved your problems. The guys who write answers - feel good to know that they provided a good answer and that you fixed the - problem. Far too often, the person who asked the question is never heard from - again, and we never get to know if he/she is gone because the problem was - solved or perhaps because the problem was unsolvable! - - Getting the solution posted also helps other users that experience the same - problem(s). They get to see (possibly in the web archives) that the - suggested fixes actually has helped at least one person. diff --git a/curl/docs/MAIL-ETIQUETTE.md b/curl/docs/MAIL-ETIQUETTE.md new file mode 100644 index 000000000..3de77b17b --- /dev/null +++ b/curl/docs/MAIL-ETIQUETTE.md @@ -0,0 +1,258 @@ + + +# Mail etiquette + +## About the lists + +### Mailing Lists + +The mailing lists we have are all listed and described on the [curl +website](https://curl.se/mail/). + +Each mailing list is targeted to a specific set of users and subjects, please +use the one or the ones that suit you the most. + +Each mailing list has hundreds up to thousands of readers, meaning that each +mail sent is received and read by a large number of people. People from +various cultures, regions, religions and continents. + +### Netiquette + +Netiquette is a common term for how to behave on the Internet. Of course, in +each particular group and subculture there are differences in what is +acceptable and what is considered good manners. + +This document outlines what we in the curl project consider to be good +etiquette, and primarily this focus on how to behave on and how to use our +mailing lists. + +### Do Not Mail a Single Individual + +Many people send one question to one person. One person gets many mails, and +there is only one person who can give you a reply. The question may be +something that other people would also like to ask. These other people have no +way to read the reply, but to ask the one person the question. The one person +consequently gets overloaded with mail. + +If you really want to contact an individual and perhaps pay for his or her +services, by all means go ahead, but if it is just another curl question, take +it to a suitable list instead. + +### Subscription Required + +All curl mailing lists require that you are subscribed to allow a mail to go +through to all the subscribers. + +If you post without being subscribed (or from a different mail address than +the one you are subscribed with), your mail is simply silently discarded. You +have to subscribe first, then post. + +The reason for this unfortunate and strict subscription policy is of course to +stop spam from pestering the lists. + +### Moderation of new posters + +Several of the curl mailing lists automatically make all posts from new +subscribers be moderated. After you have subscribed and sent your first mail +to a list, that mail is not let through to the list until a mailing list +administrator has verified that it is OK and permits it to get posted. + +Once a first post has been made that proves the sender is actually talking +about curl-related subjects, the moderation "flag" is switched off and future +posts go through without being moderated. + +The reason for this moderation policy is that we do suffer from spammers who +actually subscribe and send spam to our lists. + +### Handling trolls and spam + +Despite our good intentions and hard work to keep spam off the lists and to +maintain a friendly and positive atmosphere, there are times when spam and or +trolls get through. + +Troll - "someone who posts inflammatory, extraneous, or off-topic messages in +an online community" + +Spam - "use of electronic messaging systems to send unsolicited bulk messages" + +No matter what, we NEVER EVER respond to trolls or spammers on the list. If +you believe the list admin should do something in particular, contact them +off-list. The subject is taken care of as much as possible to prevent repeated +offenses, but responding on the list to such messages never leads to anything +good and only puts the light even more on the offender: which was the entire +purpose of it getting sent to the list in the first place. + +Do not feed the trolls. + +### How to unsubscribe + +You can unsubscribe the same way you subscribed in the first place. You go to +the page for the particular mailing list you are subscribed to and you enter +your email address and password and press the unsubscribe button. + +Also, the instructions to unsubscribe are included in the headers of every +mail that is sent out to all curl related mailing lists and there is a footer +in each mail that links to the "admin" page on which you can unsubscribe and +change other options. + +You NEVER EVER email the mailing list requesting someone else to take you off +the list. + +### I posted, now what? + +If you are not subscribed with the same email address that you used to send +the email, your post is silently discarded. + +If you posted for the first time to the mailing list, you first need to wait +for an administrator to allow your email to go through (moderated). This +normally happens quickly but in case we are asleep, you may have to wait a few +hours. + +Once your email goes through it is sent out to several hundred or even +thousands of recipients. Your email may cover an area that not that many +people know about or are interested in. Or possibly the person who knows about +it is on vacation or under a heavy work load right now. You may have to wait +for a response and you should not expect to get a response at all. Ideally, +you get an answer within a couple of days. + +You do yourself and all of us a service when you include as many details as +possible already in your first email. Mention your operating system and +environment. Tell us which curl version you are using and tell us what you +did, what happened and what you expected would happen. Preferably, show us +what you did with details enough to allow others to help point out the problem +or repeat the steps in their locations. + +Failing to include details only delays responses and make people respond and +ask for more details and you have to send follow-up emails that include them. + +Expect the responses to primarily help YOU debug the issue, or ask YOU +questions that can lead you or others towards a solution or explanation to +whatever you experience. + +If you are a repeat offender to the guidelines outlined in this document, +chances are that people ignore you and your chances to get responses in the +future greatly diminish. + +### Your emails are public + +Your email, its contents and all its headers and the details in those headers +are received by every subscriber of the mailing list that you send your email +to. + +Your email as sent to a curl mailing list ends up in mail archives, on the +curl website and elsewhere, for others to see and read. Today and in the +future. In addition to the archives, the mail is sent out to thousands of +individuals. There is no way to undo a sent email. + +When sending emails to a curl mailing list, do not include sensitive +information such as usernames and passwords; use fake ones, temporary ones or +just remove them completely from the mail. Note that this includes base64 +encoded HTTP Basic auth headers. + +This public nature of the curl mailing lists makes automatically inserted mail +footers about mails being "private" or "only meant for the recipient" or +similar even more silly than usual. Because they are absolutely not private +when sent to a public mailing list. + +## Sending mail + +### Reply or New Mail + +Please do not reply to an existing message as a short-cut to post a message to +the lists. + +Many mail programs and web archivers use information within mails to keep them +together as "threads", as collections of posts that discuss a certain subject. +If you do not intend to reply on the same or similar subject, do not just hit +reply on an existing mail and change the subject, create a new mail. + +### Reply to the List + +When replying to a message from the list, make sure that you do "group reply" +or "reply to all", and not just reply to the author of the single mail you +reply to. + +We are actively discouraging replying to the single person by setting the +correct field in outgoing mails back asking for replies to get sent to the +mailing list address, making it harder for people to reply to the author only +by mistake. + +### Use a Sensible Subject + +Please use a subject of the mail that makes sense and that is related to the +contents of your mail. It makes it a lot easier to find your mail afterwards +and it makes it easier to track mail threads and topics. + +### Do Not Top-Post + +If you reply to a message, do not use top-posting. Top-posting is when you +write the new text at the top of a mail and you insert the previous quoted +mail conversation below. It forces users to read the mail in a backwards order +to properly understand it. + +This is why top posting is so bad (in top posting order): + + A: Because it messes up the order in which people normally read text. + Q: Why is top-posting such a bad thing? + A: Top-posting. + Q: What is the most annoying thing in email? + +Apart from the screwed up read order (especially when mixed together in a +thread when someone responds using the mandated bottom-posting style), it also +makes it impossible to quote only parts of the original mail. + +When you reply to a mail. You let the mail client insert the previous mail +quoted. Then you put the cursor on the first line of the mail and you move +down through the mail, deleting all parts of the quotes that do not add +context for your comments. When you want to add a comment you do so, inline, +right after the quotes that relate to your comment. Then you continue +downwards again. + +When most of the quotes have been removed and you have added your own words, +you are done. + +### HTML is not for mails + +Please switch off those HTML encoded messages. You can mail all those funny +mails to your friends. We speak plain text mails. + +### Quoting + +Quote as little as possible. Just enough to provide the context you cannot +eave out. A lengthy description can be found +[here](https://www.netmeister.org/news/learn2quote.html). + +### Digest + +We allow subscribers to subscribe to the "digest" version of the mailing +lists. A digest is a collection of mails lumped together in one single mail. + +Should you decide to reply to a mail sent out as a digest, there are two +things you MUST consider if you really, really cannot subscribe normally +instead: + +Cut off all mails and chatter that is not related to the mail you want to +reply to. + +Change the subject name to something sensible and related to the subject, +preferably even the actual subject of the single mail you wanted to reply to + +### Please Tell Us How You Solved The Problem + +Many people mail questions to the list, people spend some of their time and +make an effort in providing good answers to these questions. + +If you are the one who asks, please consider responding once more in case one +of the hints was what solved your problems. The guys who write answers feel +good to know that they provided a good answer and that you fixed the problem. +Far too often, the person who asked the question is never heard from again, +and we never get to know if they are gone because the problem was solved or +perhaps because the problem was unsolvable. + +Getting the solution posted also helps other users that experience the same +problem(s). They get to see (possibly in the web archives) that the suggested +fixes actually have helped at least one person. diff --git a/curl/docs/MANUAL b/curl/docs/MANUAL deleted file mode 100644 index 0e3db0ffb..000000000 --- a/curl/docs/MANUAL +++ /dev/null @@ -1,1059 +0,0 @@ -LATEST VERSION - - You always find news about what's going on as well as the latest versions - from the curl web pages, located at: - - https://curl.haxx.se - -SIMPLE USAGE - - Get the main page from Netscape's web-server: - - curl http://www.netscape.com/ - - Get the README file the user's home directory at funet's ftp-server: - - curl ftp://ftp.funet.fi/README - - Get a web page from a server using port 8000: - - curl http://www.weirdserver.com:8000/ - - Get a directory listing of an FTP site: - - curl ftp://cool.haxx.se/ - - Get the definition of curl from a dictionary: - - curl dict://dict.org/m:curl - - Fetch two documents at once: - - curl ftp://cool.haxx.se/ http://www.weirdserver.com:8000/ - - Get a file off an FTPS server: - - curl ftps://files.are.secure.com/secrets.txt - - or use the more appropriate FTPS way to get the same file: - - curl --ftp-ssl ftp://files.are.secure.com/secrets.txt - - Get a file from an SSH server using SFTP: - - curl -u username sftp://example.com/etc/issue - - Get a file from an SSH server using SCP using a private key - (not password-protected) to authenticate: - - curl -u username: --key ~/.ssh/id_rsa \ - scp://example.com/~/file.txt - - Get a file from an SSH server using SCP using a private key - (password-protected) to authenticate: - - curl -u username: --key ~/.ssh/id_rsa --pass private_key_password \ - scp://example.com/~/file.txt - - Get the main page from an IPv6 web server: - - curl "http://[2001:1890:1112:1::20]/" - - Get a file from an SMB server: - - curl -u "domain\username:passwd" smb://server.example.com/share/file.txt - -DOWNLOAD TO A FILE - - Get a web page and store in a local file with a specific name: - - curl -o thatpage.html http://www.netscape.com/ - - Get a web page and store in a local file, make the local file get the name - of the remote document (if no file name part is specified in the URL, this - will fail): - - curl -O http://www.netscape.com/index.html - - Fetch two files and store them with their remote names: - - curl -O www.haxx.se/index.html -O curl.haxx.se/download.html - -USING PASSWORDS - - FTP - - To ftp files using name+passwd, include them in the URL like: - - curl ftp://name:passwd@machine.domain:port/full/path/to/file - - or specify them with the -u flag like - - curl -u name:passwd ftp://machine.domain:port/full/path/to/file - - FTPS - - It is just like for FTP, but you may also want to specify and use - SSL-specific options for certificates etc. - - Note that using FTPS:// as prefix is the "implicit" way as described in the - standards while the recommended "explicit" way is done by using FTP:// and - the --ftp-ssl option. - - SFTP / SCP - - This is similar to FTP, but you can use the --key option to specify a - private key to use instead of a password. Note that the private key may - itself be protected by a password that is unrelated to the login password - of the remote system; this password is specified using the --pass option. - Typically, curl will automatically extract the public key from the private - key file, but in cases where curl does not have the proper library support, - a matching public key file must be specified using the --pubkey option. - - HTTP - - Curl also supports user and password in HTTP URLs, thus you can pick a file - like: - - curl http://name:passwd@machine.domain/full/path/to/file - - or specify user and password separately like in - - curl -u name:passwd http://machine.domain/full/path/to/file - - HTTP offers many different methods of authentication and curl supports - several: Basic, Digest, NTLM and Negotiate (SPNEGO). Without telling which - method to use, curl defaults to Basic. You can also ask curl to pick the - most secure ones out of the ones that the server accepts for the given URL, - by using --anyauth. - - NOTE! According to the URL specification, HTTP URLs can not contain a user - and password, so that style will not work when using curl via a proxy, even - though curl allows it at other times. When using a proxy, you _must_ use - the -u style for user and password. - - HTTPS - - Probably most commonly used with private certificates, as explained below. - -PROXY - - curl supports both HTTP and SOCKS proxy servers, with optional authentication. - It does not have special support for FTP proxy servers since there are no - standards for those, but it can still be made to work with many of them. You - can also use both HTTP and SOCKS proxies to transfer files to and from FTP - servers. - - Get an ftp file using an HTTP proxy named my-proxy that uses port 888: - - curl -x my-proxy:888 ftp://ftp.leachsite.com/README - - Get a file from an HTTP server that requires user and password, using the - same proxy as above: - - curl -u user:passwd -x my-proxy:888 http://www.get.this/ - - Some proxies require special authentication. Specify by using -U as above: - - curl -U user:passwd -x my-proxy:888 http://www.get.this/ - - A comma-separated list of hosts and domains which do not use the proxy can - be specified as: - - curl --noproxy localhost,get.this -x my-proxy:888 http://www.get.this/ - - If the proxy is specified with --proxy1.0 instead of --proxy or -x, then - curl will use HTTP/1.0 instead of HTTP/1.1 for any CONNECT attempts. - - curl also supports SOCKS4 and SOCKS5 proxies with --socks4 and --socks5. - - See also the environment variables Curl supports that offer further proxy - control. - - Most FTP proxy servers are set up to appear as a normal FTP server from the - client's perspective, with special commands to select the remote FTP server. - curl supports the -u, -Q and --ftp-account options that can be used to - set up transfers through many FTP proxies. For example, a file can be - uploaded to a remote FTP server using a Blue Coat FTP proxy with the - options: - - curl -u "Remote-FTP-Username@remote.ftp.server Proxy-Username:Remote-Pass" \ - --ftp-account Proxy-Password --upload-file local-file \ - ftp://my-ftp.proxy.server:21/remote/upload/path/ - - See the manual for your FTP proxy to determine the form it expects to set up - transfers, and curl's -v option to see exactly what curl is sending. - -RANGES - - HTTP 1.1 introduced byte-ranges. Using this, a client can request - to get only one or more subparts of a specified document. Curl supports - this with the -r flag. - - Get the first 100 bytes of a document: - - curl -r 0-99 http://www.get.this/ - - Get the last 500 bytes of a document: - - curl -r -500 http://www.get.this/ - - Curl also supports simple ranges for FTP files as well. Then you can only - specify start and stop position. - - Get the first 100 bytes of a document using FTP: - - curl -r 0-99 ftp://www.get.this/README - -UPLOADING - - FTP / FTPS / SFTP / SCP - - Upload all data on stdin to a specified server: - - curl -T - ftp://ftp.upload.com/myfile - - Upload data from a specified file, login with user and password: - - curl -T uploadfile -u user:passwd ftp://ftp.upload.com/myfile - - Upload a local file to the remote site, and use the local file name at the remote - site too: - - curl -T uploadfile -u user:passwd ftp://ftp.upload.com/ - - Upload a local file to get appended to the remote file: - - curl -T localfile -a ftp://ftp.upload.com/remotefile - - Curl also supports ftp upload through a proxy, but only if the proxy is - configured to allow that kind of tunneling. If it does, you can run curl in - a fashion similar to: - - curl --proxytunnel -x proxy:port -T localfile ftp.upload.com - -SMB / SMBS - - curl -T file.txt -u "domain\username:passwd" - smb://server.example.com/share/ - - HTTP - - Upload all data on stdin to a specified HTTP site: - - curl -T - http://www.upload.com/myfile - - Note that the HTTP server must have been configured to accept PUT before - this can be done successfully. - - For other ways to do HTTP data upload, see the POST section below. - -VERBOSE / DEBUG - - If curl fails where it isn't supposed to, if the servers don't let you in, - if you can't understand the responses: use the -v flag to get verbose - fetching. Curl will output lots of info and what it sends and receives in - order to let the user see all client-server interaction (but it won't show - you the actual data). - - curl -v ftp://ftp.upload.com/ - - To get even more details and information on what curl does, try using the - --trace or --trace-ascii options with a given file name to log to, like - this: - - curl --trace trace.txt www.haxx.se - - -DETAILED INFORMATION - - Different protocols provide different ways of getting detailed information - about specific files/documents. To get curl to show detailed information - about a single file, you should use -I/--head option. It displays all - available info on a single file for HTTP and FTP. The HTTP information is a - lot more extensive. - - For HTTP, you can get the header information (the same as -I would show) - shown before the data by using -i/--include. Curl understands the - -D/--dump-header option when getting files from both FTP and HTTP, and it - will then store the headers in the specified file. - - Store the HTTP headers in a separate file (headers.txt in the example): - - curl --dump-header headers.txt curl.haxx.se - - Note that headers stored in a separate file can be very useful at a later - time if you want curl to use cookies sent by the server. More about that in - the cookies section. - -POST (HTTP) - - It's easy to post data using curl. This is done using the -d - option. The post data must be urlencoded. - - Post a simple "name" and "phone" guestbook. - - curl -d "name=Rafael%20Sagula&phone=3320780" \ - http://www.where.com/guest.cgi - - How to post a form with curl, lesson #1: - - Dig out all the tags in the form that you want to fill in. (There's - a perl program called formfind.pl on the curl site that helps with this). - - If there's a "normal" post, you use -d to post. -d takes a full "post - string", which is in the format - - =&=&... - - The 'variable' names are the names set with "name=" in the tags, and - the data is the contents you want to fill in for the inputs. The data *must* - be properly URL encoded. That means you replace space with + and that you - replace weird letters with %XX where XX is the hexadecimal representation of - the letter's ASCII code. - - Example: - - (page located at http://www.formpost.com/getthis/ - -
- - - - -
- - We want to enter user 'foobar' with password '12345'. - - To post to this, you enter a curl command line like: - - curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" (continues) - http://www.formpost.com/getthis/post.cgi - - - While -d uses the application/x-www-form-urlencoded mime-type, generally - understood by CGI's and similar, curl also supports the more capable - multipart/form-data type. This latter type supports things like file upload. - - -F accepts parameters like -F "name=contents". If you want the contents to - be read from a file, use <@filename> as contents. When specifying a file, - you can also specify the file content type by appending ';type=' - to the file name. You can also post the contents of several files in one - field. For example, the field name 'coolfiles' is used to send three files, - with different content types using the following syntax: - - curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html" \ - http://www.post.com/postit.cgi - - If the content-type is not specified, curl will try to guess from the file - extension (it only knows a few), or use the previously specified type (from - an earlier file if several files are specified in a list) or else it will - use the default type 'application/octet-stream'. - - Emulate a fill-in form with -F. Let's say you fill in three fields in a - form. One field is a file name which to post, one field is your name and one - field is a file description. We want to post the file we have written named - "cooltext.txt". To let curl do the posting of this data instead of your - favourite browser, you have to read the HTML source of the form page and - find the names of the input fields. In our example, the input field names - are 'file', 'yourname' and 'filedescription'. - - curl -F "file=@cooltext.txt" -F "yourname=Daniel" \ - -F "filedescription=Cool text file with cool text inside" \ - http://www.post.com/postit.cgi - - To send two files in one post you can do it in two ways: - - 1. Send multiple files in a single "field" with a single field name: - - curl -F "pictures=@dog.gif,cat.gif" - - 2. Send two fields with two field names: - - curl -F "docpicture=@dog.gif" -F "catpicture=@cat.gif" - - To send a field value literally without interpreting a leading '@' - or '<', or an embedded ';type=', use --form-string instead of - -F. This is recommended when the value is obtained from a user or - some other unpredictable source. Under these circumstances, using - -F instead of --form-string would allow a user to trick curl into - uploading a file. - -REFERRER - - An HTTP request has the option to include information about which address - referred it to the actual page. Curl allows you to specify the - referrer to be used on the command line. It is especially useful to - fool or trick stupid servers or CGI scripts that rely on that information - being available or contain certain data. - - curl -e www.coolsite.com http://www.showme.com/ - - NOTE: The Referer: [sic] field is defined in the HTTP spec to be a full URL. - -USER AGENT - - An HTTP request has the option to include information about the browser - that generated the request. Curl allows it to be specified on the command - line. It is especially useful to fool or trick stupid servers or CGI - scripts that only accept certain browsers. - - Example: - - curl -A 'Mozilla/3.0 (Win95; I)' http://www.nationsbank.com/ - - Other common strings: - 'Mozilla/3.0 (Win95; I)' Netscape Version 3 for Windows 95 - 'Mozilla/3.04 (Win95; U)' Netscape Version 3 for Windows 95 - 'Mozilla/2.02 (OS/2; U)' Netscape Version 2 for OS/2 - 'Mozilla/4.04 [en] (X11; U; AIX 4.2; Nav)' NS for AIX - 'Mozilla/4.05 [en] (X11; U; Linux 2.0.32 i586)' NS for Linux - - Note that Internet Explorer tries hard to be compatible in every way: - 'Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)' MSIE for W95 - - Mozilla is not the only possible User-Agent name: - 'Konqueror/1.0' KDE File Manager desktop client - 'Lynx/2.7.1 libwww-FM/2.14' Lynx command line browser - -COOKIES - - Cookies are generally used by web servers to keep state information at the - client's side. The server sets cookies by sending a response line in the - headers that looks like 'Set-Cookie: ' where the data part then - typically contains a set of NAME=VALUE pairs (separated by semicolons ';' - like "NAME1=VALUE1; NAME2=VALUE2;"). The server can also specify for what - path the "cookie" should be used for (by specifying "path=value"), when the - cookie should expire ("expire=DATE"), for what domain to use it - ("domain=NAME") and if it should be used on secure connections only - ("secure"). - - If you've received a page from a server that contains a header like: - Set-Cookie: sessionid=boo123; path="/foo"; - - it means the server wants that first pair passed on when we get anything in - a path beginning with "/foo". - - Example, get a page that wants my name passed in a cookie: - - curl -b "name=Daniel" www.sillypage.com - - Curl also has the ability to use previously received cookies in following - sessions. If you get cookies from a server and store them in a file in a - manner similar to: - - curl --dump-header headers www.example.com - - ... you can then in a second connect to that (or another) site, use the - cookies from the 'headers' file like: - - curl -b headers www.example.com - - While saving headers to a file is a working way to store cookies, it is - however error-prone and not the preferred way to do this. Instead, make curl - save the incoming cookies using the well-known netscape cookie format like - this: - - curl -c cookies.txt www.example.com - - Note that by specifying -b you enable the "cookie awareness" and with -L - you can make curl follow a location: (which often is used in combination - with cookies). So that if a site sends cookies and a location, you can - use a non-existing file to trigger the cookie awareness like: - - curl -L -b empty.txt www.example.com - - The file to read cookies from must be formatted using plain HTTP headers OR - as netscape's cookie file. Curl will determine what kind it is based on the - file contents. In the above command, curl will parse the header and store - the cookies received from www.example.com. curl will send to the server the - stored cookies which match the request as it follows the location. The - file "empty.txt" may be a nonexistent file. - - To read and write cookies from a netscape cookie file, you can set both -b - and -c to use the same file: - - curl -b cookies.txt -c cookies.txt www.example.com - -PROGRESS METER - - The progress meter exists to show a user that something actually is - happening. The different fields in the output have the following meaning: - - % Total % Received % Xferd Average Speed Time Curr. - Dload Upload Total Current Left Speed - 0 151M 0 38608 0 0 9406 0 4:41:43 0:00:04 4:41:39 9287 - - From left-to-right: - % - percentage completed of the whole transfer - Total - total size of the whole expected transfer - % - percentage completed of the download - Received - currently downloaded amount of bytes - % - percentage completed of the upload - Xferd - currently uploaded amount of bytes - Average Speed - Dload - the average transfer speed of the download - Average Speed - Upload - the average transfer speed of the upload - Time Total - expected time to complete the operation - Time Current - time passed since the invoke - Time Left - expected time left to completion - Curr.Speed - the average transfer speed the last 5 seconds (the first - 5 seconds of a transfer is based on less time of course.) - - The -# option will display a totally different progress bar that doesn't - need much explanation! - -SPEED LIMIT - - Curl allows the user to set the transfer speed conditions that must be met - to let the transfer keep going. By using the switch -y and -Y you - can make curl abort transfers if the transfer speed is below the specified - lowest limit for a specified time. - - To have curl abort the download if the speed is slower than 3000 bytes per - second for 1 minute, run: - - curl -Y 3000 -y 60 www.far-away-site.com - - This can very well be used in combination with the overall time limit, so - that the above operation must be completed in whole within 30 minutes: - - curl -m 1800 -Y 3000 -y 60 www.far-away-site.com - - Forcing curl not to transfer data faster than a given rate is also possible, - which might be useful if you're using a limited bandwidth connection and you - don't want your transfer to use all of it (sometimes referred to as - "bandwidth throttle"). - - Make curl transfer data no faster than 10 kilobytes per second: - - curl --limit-rate 10K www.far-away-site.com - - or - - curl --limit-rate 10240 www.far-away-site.com - - Or prevent curl from uploading data faster than 1 megabyte per second: - - curl -T upload --limit-rate 1M ftp://uploadshereplease.com - - When using the --limit-rate option, the transfer rate is regulated on a - per-second basis, which will cause the total transfer speed to become lower - than the given number. Sometimes of course substantially lower, if your - transfer stalls during periods. - -CONFIG FILE - - Curl automatically tries to read the .curlrc file (or _curlrc file on win32 - systems) from the user's home dir on startup. - - The config file could be made up with normal command line switches, but you - can also specify the long options without the dashes to make it more - readable. You can separate the options and the parameter with spaces, or - with = or :. Comments can be used within the file. If the first letter on a - line is a '#'-symbol the rest of the line is treated as a comment. - - If you want the parameter to contain spaces, you must enclose the entire - parameter within double quotes ("). Within those quotes, you specify a - quote as \". - - NOTE: You must specify options and their arguments on the same line. - - Example, set default time out and proxy in a config file: - - # We want a 30 minute timeout: - -m 1800 - # ... and we use a proxy for all accesses: - proxy = proxy.our.domain.com:8080 - - White spaces ARE significant at the end of lines, but all white spaces - leading up to the first characters of each line are ignored. - - Prevent curl from reading the default file by using -q as the first command - line parameter, like: - - curl -q www.thatsite.com - - Force curl to get and display a local help page in case it is invoked - without URL by making a config file similar to: - - # default url to get - url = "http://help.with.curl.com/curlhelp.html" - - You can specify another config file to be read by using the -K/--config - flag. If you set config file name to "-" it'll read the config from stdin, - which can be handy if you want to hide options from being visible in process - tables etc: - - echo "user = user:passwd" | curl -K - http://that.secret.site.com - -EXTRA HEADERS - - When using curl in your own very special programs, you may end up needing - to pass on your own custom headers when getting a web page. You can do - this by using the -H flag. - - Example, send the header "X-you-and-me: yes" to the server when getting a - page: - - curl -H "X-you-and-me: yes" www.love.com - - This can also be useful in case you want curl to send a different text in a - header than it normally does. The -H header you specify then replaces the - header curl would normally send. If you replace an internal header with an - empty one, you prevent that header from being sent. To prevent the Host: - header from being used: - - curl -H "Host:" www.server.com - -FTP and PATH NAMES - - Do note that when getting files with the ftp:// URL, the given path is - relative the directory you enter. To get the file 'README' from your home - directory at your ftp site, do: - - curl ftp://user:passwd@my.site.com/README - - But if you want the README file from the root directory of that very same - site, you need to specify the absolute file name: - - curl ftp://user:passwd@my.site.com//README - - (I.e with an extra slash in front of the file name.) - -SFTP and SCP and PATH NAMES - - With sftp: and scp: URLs, the path name given is the absolute name on the - server. To access a file relative to the remote user's home directory, - prefix the file with /~/ , such as: - - curl -u $USER sftp://home.example.com/~/.bashrc - -FTP and firewalls - - The FTP protocol requires one of the involved parties to open a second - connection as soon as data is about to get transferred. There are two ways to - do this. - - The default way for curl is to issue the PASV command which causes the - server to open another port and await another connection performed by the - client. This is good if the client is behind a firewall that doesn't allow - incoming connections. - - curl ftp.download.com - - If the server, for example, is behind a firewall that doesn't allow connections - on ports other than 21 (or if it just doesn't support the PASV command), the - other way to do it is to use the PORT command and instruct the server to - connect to the client on the given IP number and port (as parameters to the - PORT command). - - The -P flag to curl supports a few different options. Your machine may have - several IP-addresses and/or network interfaces and curl allows you to select - which of them to use. Default address can also be used: - - curl -P - ftp.download.com - - Download with PORT but use the IP address of our 'le0' interface (this does - not work on windows): - - curl -P le0 ftp.download.com - - Download with PORT but use 192.168.0.10 as our IP address to use: - - curl -P 192.168.0.10 ftp.download.com - -NETWORK INTERFACE - - Get a web page from a server using a specified port for the interface: - - curl --interface eth0:1 http://www.netscape.com/ - - or - - curl --interface 192.168.1.10 http://www.netscape.com/ - -HTTPS - - Secure HTTP requires SSL libraries to be installed and used when curl is - built. If that is done, curl is capable of retrieving and posting documents - using the HTTPS protocol. - - Example: - - curl https://www.secure-site.com - - Curl is also capable of using your personal certificates to get/post files - from sites that require valid certificates. The only drawback is that the - certificate needs to be in PEM-format. PEM is a standard and open format to - store certificates with, but it is not used by the most commonly used - browsers (Netscape and MSIE both use the so called PKCS#12 format). If you - want curl to use the certificates you use with your (favourite) browser, you - may need to download/compile a converter that can convert your browser's - formatted certificates to PEM formatted ones. This kind of converter is - included in recent versions of OpenSSL, and for older versions Dr Stephen - N. Henson has written a patch for SSLeay that adds this functionality. You - can get his patch (that requires an SSLeay installation) from his site at: - http://www.drh-consultancy.demon.co.uk/ - - Example on how to automatically retrieve a document using a certificate with - a personal password: - - curl -E /path/to/cert.pem:password https://secure.site.com/ - - If you neglect to specify the password on the command line, you will be - prompted for the correct password before any data can be received. - - Many older SSL-servers have problems with SSLv3 or TLS, which newer versions - of OpenSSL etc use, therefore it is sometimes useful to specify what - SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL - version to use (for SSLv3, SSLv2 or TLSv1 respectively): - - curl -2 https://secure.site.com/ - - Otherwise, curl will first attempt to use v3 and then v2. - - To use OpenSSL to convert your favourite browser's certificate into a PEM - formatted one that curl can use, do something like this: - - In Netscape, you start with hitting the 'Security' menu button. - - Select 'certificates->yours' and then pick a certificate in the list - - Press the 'Export' button - - enter your PIN code for the certs - - select a proper place to save it - - Run the 'openssl' application to convert the certificate. If you cd to the - openssl installation, you can do it like: - - # ./apps/openssl pkcs12 -in [file you saved] -clcerts -out [PEMfile] - - In Firefox, select Options, then Advanced, then the Encryption tab, - View Certificates. This opens the Certificate Manager, where you can - Export. Be sure to select PEM for the Save as type. - - In Internet Explorer, select Internet Options, then the Content tab, then - Certificates. Then you can Export, and depending on the format you may - need to convert to PEM. - - In Chrome, select Settings, then Show Advanced Settings. Under HTTPS/SSL - select Manage Certificates. - -RESUMING FILE TRANSFERS - - To continue a file transfer where it was previously aborted, curl supports - resume on HTTP(S) downloads as well as FTP uploads and downloads. - - Continue downloading a document: - - curl -C - -o file ftp://ftp.server.com/path/file - - Continue uploading a document(*1): - - curl -C - -T file ftp://ftp.server.com/path/file - - Continue downloading a document from a web server(*2): - - curl -C - -o file http://www.server.com/ - - (*1) = This requires that the FTP server supports the non-standard command - SIZE. If it doesn't, curl will say so. - - (*2) = This requires that the web server supports at least HTTP/1.1. If it - doesn't, curl will say so. - -TIME CONDITIONS - - HTTP allows a client to specify a time condition for the document it - requests. It is If-Modified-Since or If-Unmodified-Since. Curl allows you to - specify them with the -z/--time-cond flag. - - For example, you can easily make a download that only gets performed if the - remote file is newer than a local copy. It would be made like: - - curl -z local.html http://remote.server.com/remote.html - - Or you can download a file only if the local file is newer than the remote - one. Do this by prepending the date string with a '-', as in: - - curl -z -local.html http://remote.server.com/remote.html - - You can specify a "free text" date as condition. Tell curl to only download - the file if it was updated since January 12, 2012: - - curl -z "Jan 12 2012" http://remote.server.com/remote.html - - Curl will then accept a wide range of date formats. You always make the date - check the other way around by prepending it with a dash '-'. - -DICT - - For fun try - - curl dict://dict.org/m:curl - curl dict://dict.org/d:heisenbug:jargon - curl dict://dict.org/d:daniel:web1913 - - Aliases for 'm' are 'match' and 'find', and aliases for 'd' are 'define' - and 'lookup'. For example, - - curl dict://dict.org/find:curl - - Commands that break the URL description of the RFC (but not the DICT - protocol) are - - curl dict://dict.org/show:db - curl dict://dict.org/show:strat - - Authentication is still missing (but this is not required by the RFC) - -LDAP - - If you have installed the OpenLDAP library, curl can take advantage of it - and offer ldap:// support. - On Windows, curl will use WinLDAP from Platform SDK by default. - - Default protocol version used by curl is LDAPv3. LDAPv2 will be used as - fallback mechanism in case if LDAPv3 will fail to connect. - - LDAP is a complex thing and writing an LDAP query is not an easy task. I do - advise you to dig up the syntax description for that elsewhere. One such - place might be: - - RFC 2255, "The LDAP URL Format" https://curl.haxx.se/rfc/rfc2255.txt - - To show you an example, this is how I can get all people from my local LDAP - server that has a certain sub-domain in their email address: - - curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se" - - If I want the same info in HTML format, I can get it by not using the -B - (enforce ASCII) flag. - - You also can use authentication when accessing LDAP catalog: - - curl -u user:passwd "ldap://ldap.frontec.se/o=frontec??sub?mail=*" - curl "ldap://user:passwd@ldap.frontec.se/o=frontec??sub?mail=*" - - By default, if user and password provided, OpenLDAP/WinLDAP will use basic - authentication. On Windows you can control this behavior by providing - one of --basic, --ntlm or --digest option in curl command line - - curl --ntlm "ldap://user:passwd@ldap.frontec.se/o=frontec??sub?mail=*" - - On Windows, if no user/password specified, auto-negotiation mechanism will - be used with current logon credentials (SSPI/SPNEGO). - -ENVIRONMENT VARIABLES - - Curl reads and understands the following environment variables: - - http_proxy, HTTPS_PROXY, FTP_PROXY - - They should be set for protocol-specific proxies. General proxy should be - set with - - ALL_PROXY - - A comma-separated list of host names that shouldn't go through any proxy is - set in (only an asterisk, '*' matches all hosts) - - NO_PROXY - - If the host name matches one of these strings, or the host is within the - domain of one of these strings, transactions with that node will not be - proxied. When a domain is used, it needs to start with a period. A user can - specify that both www.example.com and foo.example.com should not uses a - proxy by setting NO_PROXY to ".example.com". By including the full name you - can exclude specific host names, so to make www.example.com not use a proxy - but still have foo.example.com do it, set NO_PROXY to "www.example.com" - - The usage of the -x/--proxy flag overrides the environment variables. - -NETRC - - Unix introduced the .netrc concept a long time ago. It is a way for a user - to specify name and password for commonly visited FTP sites in a file so - that you don't have to type them in each time you visit those sites. You - realize this is a big security risk if someone else gets hold of your - passwords, so therefore most unix programs won't read this file unless it is - only readable by yourself (curl doesn't care though). - - Curl supports .netrc files if told to (using the -n/--netrc and - --netrc-optional options). This is not restricted to just FTP, - so curl can use it for all protocols where authentication is used. - - A very simple .netrc file could look something like: - - machine curl.haxx.se login iamdaniel password mysecret - -CUSTOM OUTPUT - - To better allow script programmers to get to know about the progress of - curl, the -w/--write-out option was introduced. Using this, you can specify - what information from the previous transfer you want to extract. - - To display the amount of bytes downloaded together with some text and an - ending newline: - - curl -w 'We downloaded %{size_download} bytes\n' www.download.com - -KERBEROS FTP TRANSFER - - Curl supports kerberos4 and kerberos5/GSSAPI for FTP transfers. You need - the kerberos package installed and used at curl build time for it to be - available. - - First, get the krb-ticket the normal way, like with the kinit/kauth tool. - Then use curl in way similar to: - - curl --krb private ftp://krb4site.com -u username:fakepwd - - There's no use for a password on the -u switch, but a blank one will make - curl ask for one and you already entered the real password to kinit/kauth. - -TELNET - - The curl telnet support is basic and very easy to use. Curl passes all data - passed to it on stdin to the remote server. Connect to a remote telnet - server using a command line similar to: - - curl telnet://remote.server.com - - And enter the data to pass to the server on stdin. The result will be sent - to stdout or to the file you specify with -o. - - You might want the -N/--no-buffer option to switch off the buffered output - for slow connections or similar. - - Pass options to the telnet protocol negotiation, by using the -t option. To - tell the server we use a vt100 terminal, try something like: - - curl -tTTYPE=vt100 telnet://remote.server.com - - Other interesting options for it -t include: - - - XDISPLOC= Sets the X display location. - - - NEW_ENV= Sets an environment variable. - - NOTE: The telnet protocol does not specify any way to login with a specified - user and password so curl can't do that automatically. To do that, you need - to track when the login prompt is received and send the username and - password accordingly. - -PERSISTENT CONNECTIONS - - Specifying multiple files on a single command line will make curl transfer - all of them, one after the other in the specified order. - - libcurl will attempt to use persistent connections for the transfers so that - the second transfer to the same host can use the same connection that was - already initiated and was left open in the previous transfer. This greatly - decreases connection time for all but the first transfer and it makes a far - better use of the network. - - Note that curl cannot use persistent connections for transfers that are used - in subsequence curl invokes. Try to stuff as many URLs as possible on the - same command line if they are using the same host, as that'll make the - transfers faster. If you use an HTTP proxy for file transfers, practically - all transfers will be persistent. - -MULTIPLE TRANSFERS WITH A SINGLE COMMAND LINE - - As is mentioned above, you can download multiple files with one command line - by simply adding more URLs. If you want those to get saved to a local file - instead of just printed to stdout, you need to add one save option for each - URL you specify. Note that this also goes for the -O option (but not - --remote-name-all). - - For example: get two files and use -O for the first and a custom file - name for the second: - - curl -O http://url.com/file.txt ftp://ftp.com/moo.exe -o moo.jpg - - You can also upload multiple files in a similar fashion: - - curl -T local1 ftp://ftp.com/moo.exe -T local2 ftp://ftp.com/moo2.txt - -IPv6 - - curl will connect to a server with IPv6 when a host lookup returns an IPv6 - address and fall back to IPv4 if the connection fails. The --ipv4 and --ipv6 - options can specify which address to use when both are available. IPv6 - addresses can also be specified directly in URLs using the syntax: - - http://[2001:1890:1112:1::20]/overview.html - - When this style is used, the -g option must be given to stop curl from - interpreting the square brackets as special globbing characters. Link local - and site local addresses including a scope identifier, such as fe80::1234%1, - may also be used, but the scope portion must be numeric or match an existing - network interface on Linux and the percent character must be URL escaped. The - previous example in an SFTP URL might look like: - - sftp://[fe80::1234%251]/ - - IPv6 addresses provided other than in URLs (e.g. to the --proxy, --interface - or --ftp-port options) should not be URL encoded. - -METALINK - - Curl supports Metalink (both version 3 and 4 (RFC 5854) are supported), a way - to list multiple URIs and hashes for a file. Curl will make use of the mirrors - listed within for failover if there are errors (such as the file or server not - being available). It will also verify the hash of the file after the download - completes. The Metalink file itself is downloaded and processed in memory and - not stored in the local file system. - - Example to use a remote Metalink file: - - curl --metalink http://www.example.com/example.metalink - - To use a Metalink file in the local file system, use FILE protocol (file://): - - curl --metalink file://example.metalink - - Please note that if FILE protocol is disabled, there is no way to use a local - Metalink file at the time of this writing. Also note that if --metalink and - --include are used together, --include will be ignored. This is because including - headers in the response will break Metalink parser and if the headers are included - in the file described in Metalink file, hash check will fail. - -MAILING LISTS - - For your convenience, we have several open mailing lists to discuss curl, - its development and things relevant to this. Get all info at - https://curl.haxx.se/mail/. Some of the lists available are: - - curl-users - - Users of the command line tool. How to use it, what doesn't work, new - features, related tools, questions, news, installations, compilations, - running, porting etc. - - curl-library - - Developers using or developing libcurl. Bugs, extensions, improvements. - - curl-announce - - Low-traffic. Only receives announcements of new public versions. At worst, - that makes something like one or two mails per month, but usually only one - mail every second month. - - curl-and-php - - Using the curl functions in PHP. Everything curl with a PHP angle. Or PHP - with a curl angle. - - curl-and-python - - Python hackers using curl with or without the python binding pycurl. - - Please direct curl questions, feature requests and trouble reports to one of - these mailing lists instead of mailing any individual. diff --git a/curl/docs/MANUAL.md b/curl/docs/MANUAL.md new file mode 100644 index 000000000..9ff5c097c --- /dev/null +++ b/curl/docs/MANUAL.md @@ -0,0 +1,1008 @@ + + +# curl tutorial + +## Simple Usage + +Get the main page from a web-server: + + curl https://www.example.com/ + +Get a README file from an FTP server: + + curl ftp://ftp.example.com/README + +Get a webpage from a server using port 8000: + + curl http://www.example.com:8000/ + +Get a directory listing of an FTP site: + + curl ftp://ftp.example.com/ + +Get the all terms matching curl from a dictionary: + + curl dict://dict.example.com/m:curl + +Get the definition of curl from a dictionary: + + curl dict://dict.example.com/d:curl + +Fetch two documents at once: + + curl ftp://ftp.example.com/ http://www.example.com:8000/ + +Get a file off an FTPS server: + + curl ftps://files.are.example.com/secrets.txt + +or use the more appropriate FTPS way to get the same file: + + curl --ssl-reqd ftp://files.are.example.com/secrets.txt + +Get a file from an SSH server using SFTP: + + curl -u username sftp://example.com/etc/issue + +Get a file from an SSH server using SCP using a private key (not +password-protected) to authenticate: + + curl -u username: --key ~/.ssh/id_rsa scp://example.com/~/file.txt + +Get a file from an SSH server using SCP using a private key +(password-protected) to authenticate: + + curl -u username: --key ~/.ssh/id_rsa --pass private_key_password + scp://example.com/~/file.txt + +Get the main page from an IPv6 web server: + + curl "http://[2001:1890:1112:1::20]/" + +Get a file from an SMB server: + + curl -u "domain\username:passwd" smb://server.example.com/share/file.txt + +## Download to a File + +Get a webpage and store in a local file with a specific name: + + curl -o thatpage.html http://www.example.com/ + +Get a webpage and store in a local file, make the local file get the name of +the remote document (if no filename part is specified in the URL, this fails): + + curl -O http://www.example.com/index.html + +Fetch two files and store them with their remote names: + + curl -O www.haxx.se/index.html -O curl.se/download.html + +## Using Passwords + +### FTP + +To ftp files using name and password, include them in the URL like: + + curl ftp://name:passwd@ftp.server.example:port/full/path/to/file + +or specify them with the `-u` flag like + + curl -u name:passwd ftp://ftp.server.example:port/full/path/to/file + +### FTPS + +It is just like for FTP, but you may also want to specify and use SSL-specific +options for certificates etc. + +Note that using `FTPS://` as prefix is the *implicit* way as described in the +standards while the recommended *explicit* way is done by using `FTP://` and +the `--ssl-reqd` option. + +### SFTP / SCP + +This is similar to FTP, but you can use the `--key` option to specify a +private key to use instead of a password. Note that the private key may itself +be protected by a password that is unrelated to the login password of the +remote system; this password is specified using the `--pass` option. +Typically, curl automatically extracts the public key from the private key +file, but in cases where curl does not have the proper library support, a +matching public key file must be specified using the `--pubkey` option. + +### HTTP + +curl also supports user and password in HTTP URLs, thus you can pick a file +like: + + curl http://name:passwd@http.server.example/full/path/to/file + +or specify user and password separately like in + + curl -u name:passwd http://http.server.example/full/path/to/file + +HTTP offers many different methods of authentication and curl supports +several: Basic, Digest, NTLM and Negotiate (SPNEGO). Without telling which +method to use, curl defaults to Basic. You can also ask curl to pick the most +secure ones out of the ones that the server accepts for the given URL, by +using `--anyauth`. + +**Note**! According to the URL specification, HTTP URLs can not contain a user +and password, so that style does not work when using curl via a proxy, even +though curl allows it at other times. When using a proxy, you _must_ use the +`-u` style for user and password. + +### HTTPS + +Probably most commonly used with private certificates, as explained below. + +## Proxy + +curl supports both HTTP and SOCKS proxy servers, with optional authentication. +It does not have special support for FTP proxy servers since there are no +standards for those, but it can still be made to work with many of them. You +can also use both HTTP and SOCKS proxies to transfer files to and from FTP +servers. + +Get an ftp file using an HTTP proxy named my-proxy that uses port 888: + + curl -x my-proxy:888 ftp://ftp.example.com/README + +Get a file from an HTTP server that requires user and password, using the +same proxy as above: + + curl -u user:passwd -x my-proxy:888 http://www.example.com/ + +Some proxies require special authentication. Specify by using -U as above: + + curl -U user:passwd -x my-proxy:888 http://www.example.com/ + +A comma-separated list of hosts and domains which do not use the proxy can be +specified as: + + curl --noproxy example.com -x my-proxy:888 http://www.example.com/ + +If the proxy is specified with `--proxy1.0` instead of `--proxy` or `-x`, then +curl uses HTTP/1.0 instead of HTTP/1.1 for any `CONNECT` attempts. + +curl also supports SOCKS4 and SOCKS5 proxies with `--socks4` and `--socks5`. + +See also the environment variables curl supports that offer further proxy +control. + +Most FTP proxy servers are set up to appear as a normal FTP server from the +client's perspective, with special commands to select the remote FTP server. +curl supports the `-u`, `-Q` and `--ftp-account` options that can be used to +set up transfers through many FTP proxies. For example, a file can be uploaded +to a remote FTP server using a Blue Coat FTP proxy with the options: + + curl -u "username@ftp.server.example Proxy-Username:Remote-Pass" + --ftp-account Proxy-Password --upload-file local-file + ftp://my-ftp.proxy.example:21/remote/upload/path/ + +See the manual for your FTP proxy to determine the form it expects to set up +transfers, and curl's `-v` option to see exactly what curl is sending. + +## Piping + +Get a key file and add it with `apt-key` (when on a system that uses `apt` for +package management): + + curl -L https://apt.example.org/llvm-snapshot.gpg.key | sudo apt-key add - + +The '|' pipes the output to STDIN. `-` tells `apt-key` that the key file +should be read from STDIN. + +## Ranges + +HTTP 1.1 introduced byte-ranges. Using this, a client can request to get only +one or more sub-parts of a specified document. curl supports this with the +`-r` flag. + +Get the first 100 bytes of a document: + + curl -r 0-99 http://www.example.com/ + +Get the last 500 bytes of a document: + + curl -r -500 http://www.example.com/ + +curl also supports simple ranges for FTP files as well. Then you can only +specify start and stop position. + +Get the first 100 bytes of a document using FTP: + + curl -r 0-99 ftp://www.example.com/README + +## Uploading + +### FTP / FTPS / SFTP / SCP + +Upload all data on stdin to a specified server: + + curl -T - ftp://ftp.example.com/myfile + +Upload data from a specified file, login with user and password: + + curl -T uploadfile -u user:passwd ftp://ftp.example.com/myfile + +Upload a local file to the remote site, and use the local filename at the +remote site too: + + curl -T uploadfile -u user:passwd ftp://ftp.example.com/ + +Upload a local file to get appended to the remote file: + + curl -T localfile -a ftp://ftp.example.com/remotefile + +curl also supports ftp upload through a proxy, but only if the proxy is +configured to allow that kind of tunneling. If it does, you can run curl in a +fashion similar to: + + curl --proxytunnel -x proxy:port -T localfile ftp.example.com + +### SMB / SMBS + + curl -T file.txt -u "domain\username:passwd" + smb://server.example.com/share/ + +### HTTP + +Upload all data on stdin to a specified HTTP site: + + curl -T - http://www.example.com/myfile + +Note that the HTTP server must have been configured to accept PUT before this +can be done successfully. + +For other ways to do HTTP data upload, see the POST section below. + +## Verbose / Debug + +If curl fails where it is not supposed to, if the servers do not let you in, +if you cannot understand the responses: use the `-v` flag to get verbose +fetching. curl outputs lots of info and what it sends and receives in order to +let the user see all client-server interaction (but it does not show you the +actual data). + + curl -v ftp://ftp.example.com/ + +To get even more details and information on what curl does, try using the +`--trace` or `--trace-ascii` options with a given filename to log to, like +this: + + curl --trace my-trace.txt www.haxx.se + + +## Detailed Information + +Different protocols provide different ways of getting detailed information +about specific files/documents. To get curl to show detailed information about +a single file, you should use `-I`/`--head` option. It displays all available +info on a single file for HTTP and FTP. The HTTP information is a lot more +extensive. + +For HTTP, you can get the header information (the same as `-I` would show) +shown before the data by using `-i`/`--include`. curl understands the +`-D`/`--dump-header` option when getting files from both FTP and HTTP, and it +then stores the headers in the specified file. + +Store the HTTP headers in a separate file (headers.txt in the example): + + curl --dump-header headers.txt curl.se + +Note that headers stored in a separate file can be useful at a later time if +you want curl to use cookies sent by the server. More about that in the +cookies section. + +## POST (HTTP) + +It is easy to post data using curl. This is done using the `-d ` option. +The post data must be urlencoded. + +Post a simple `name` and `phone` guestbook. + + curl -d "name=Rafael%20Sagula&phone=3320780" http://www.example.com/guest.cgi + +Or automatically [URL encode the data](https://everything.curl.dev/http/post/url-encode). + + curl --data-urlencode "name=Rafael Sagula&phone=3320780" + http://www.example.com/guest.cgi + +How to post a form with curl, lesson #1: + +Dig out all the `` tags in the form that you want to fill in. + +If there is a normal post, you use `-d` to post. `-d` takes a full post +string, which is in the format + + =&=&... + +The variable names are the names set with `"name="` in the `` tags, and +the data is the contents you want to fill in for the inputs. The data *must* +be properly URL encoded. That means you replace space with + and that you +replace weird letters with `%XX` where `XX` is the hexadecimal representation +of the letter's ASCII code. + +Example: + +(say if `http://example.com` had the following html) + +```html +
+ + + + +
+``` + +We want to enter user `foobar` with password `12345`. + +To post to this, you would enter a curl command line like: + + curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" + http://example.com/post.cgi + +While `-d` uses the application/x-www-form-urlencoded mime-type, generally +understood by CGI's and similar, curl also supports the more capable +multipart/form-data type. This latter type supports things like file upload. + +`-F` accepts parameters like `-F "name=contents"`. If you want the contents to +be read from a file, use `@filename` as contents. When specifying a file, you +can also specify the file content type by appending `;type=` to the +filename. You can also post the contents of several files in one field. For +example, the field name `coolfiles` is used to send three files, with +different content types using the following syntax: + + curl -F "coolfiles=@fil1.gif;type=image/gif,fil2.txt,fil3.html" + http://www.example.com/postit.cgi + +If the content-type is not specified, curl tries to guess from the file +extension (it only knows a few), or use the previously specified type (from an +earlier file if several files are specified in a list) or else it uses the +default type `application/octet-stream`. + +Emulate a fill-in form with `-F`. Let's say you fill in three fields in a +form. One field is a filename which to post, one field is your name and one +field is a file description. We want to post the file we have written named +`cooltext.txt`. To let curl do the posting of this data instead of your +favorite browser, you have to read the HTML source of the form page and find +the names of the input fields. In our example, the input field names are +`file`, `yourname` and `filedescription`. + + curl -F "file=@cooltext.txt" -F "yourname=Daniel" + -F "filedescription=Cool text file with cool text inside" + http://www.example.com/postit.cgi + +To send two files in one post you can do it in two ways: + +Send multiple files in a single field with a single field name: + + curl -F "pictures=@dog.gif,cat.gif" $URL + +Send two fields with two field names + + curl -F "docpicture=@dog.gif" -F "catpicture=@cat.gif" $URL + +To send a field value literally without interpreting a leading `@` or `<`, or +an embedded `;type=`, use `--form-string` instead of `-F`. This is recommended +when the value is obtained from a user or some other unpredictable +source. Under these circumstances, using `-F` instead of `--form-string` could +allow a user to trick curl into uploading a file. + +## Referrer + +An HTTP request has the option to include information about which address +referred it to the actual page. curl allows you to specify the referrer to be +used on the command line. It is especially useful to fool or trick stupid +servers or CGI scripts that rely on that information being available or +contain certain data. + + curl -e www.example.org http://www.example.com/ + +## User Agent + +An HTTP request has the option to include information about the browser that +generated the request. curl allows it to be specified on the command line. It +is especially useful to fool or trick stupid servers or CGI scripts that only +accept certain browsers. + +Example: + + curl -A 'Mozilla/3.0 (Win95; I)' http://www.bank.example.com/ + +Other common strings: + +- `Mozilla/3.0 (Win95; I)` - Netscape Version 3 for Windows 95 +- `Mozilla/3.04 (Win95; U)` - Netscape Version 3 for Windows 95 +- `Mozilla/2.02 (OS/2; U)` - Netscape Version 2 for OS/2 +- `Mozilla/4.04 [en] (X11; U; AIX 4.2; Nav)` - Netscape for AIX +- `Mozilla/4.05 [en] (X11; U; Linux 2.0.32 i586)` - Netscape for Linux + +Note that Internet Explorer tries hard to be compatible in every way: + +- `Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)` - MSIE for W95 + +Mozilla is not the only possible User-Agent name: + +- `Konqueror/1.0` - KDE File Manager desktop client +- `Lynx/2.7.1 libwww-FM/2.14` - Lynx command line browser + +## Cookies + +Cookies are generally used by web servers to keep state information at the +client's side. The server sets cookies by sending a response line in the +headers that looks like `Set-Cookie: ` where the data part then +typically contains a set of `NAME=VALUE` pairs (separated by semicolons `;` +like `NAME1=VALUE1; NAME2=VALUE2;`). The server can also specify for what path +the cookie should be used for (by specifying `path=value`), when the cookie +should expire (`expire=DATE`), for what domain to use it (`domain=NAME`) and +if it should be used on secure connections only (`secure`). + +If you have received a page from a server that contains a header like: + +```http +Set-Cookie: sessionid=boo123; path="/foo"; +``` + +it means the server wants that first pair passed on when we get anything in a +path beginning with `/foo`. + +Example, get a page that wants my name passed in a cookie: + + curl -b "name=Daniel" www.example.com + +curl also has the ability to use previously received cookies in following +sessions. If you get cookies from a server and store them in a file in a +manner similar to: + + curl --dump-header headers www.example.com + +... you can then in a second connect to that (or another) site, use the +cookies from the `headers.txt` file like: + + curl -b headers.txt www.example.com + +While saving headers to a file is a working way to store cookies, it is +however error-prone and not the preferred way to do this. Instead, make curl +save the incoming cookies using the well-known Netscape cookie format like +this: + + curl -c cookies.txt www.example.com + +Note that by specifying `-b` you enable the cookie engine and with `-L` you +can make curl follow a `location:` (which often is used in combination with +cookies). If a site sends cookies and a location field, you can use a +non-existing file to trigger the cookie awareness like: + + curl -L -b empty.txt www.example.com + +The file to read cookies from must be formatted using plain HTTP headers OR as +Netscape's cookie file. curl determines what kind it is based on the file +contents. In the above command, curl parses the header and store the cookies +received from www.example.com. curl sends the stored cookies which match the +request to the server as it follows the location. The file `empty.txt` may be +a nonexistent file. + +To read and write cookies from a Netscape cookie file, you can set both `-b` +and `-c` to use the same file: + + curl -b cookies.txt -c cookies.txt www.example.com + +## Progress Meter + +The progress meter exists to show a user that something actually is +happening. The different fields in the output have the following meaning: + + % Total % Received % Xferd Average Speed Time Curr. + Dload Upload Total Current Left Speed + 0 151M 0 38608 0 0 9406 0 4:41:43 0:00:04 4:41:39 9287 + +From left-to-right: + + - `%` - percentage completed of the whole transfer + - `Total` - total size of the whole expected transfer + - `%` - percentage completed of the download + - `Received` - currently downloaded amount of bytes + - `%` - percentage completed of the upload + - `Xferd` - currently uploaded amount of bytes + - `Average Speed Dload` - the average transfer speed of the download + - `Average Speed Upload` - the average transfer speed of the upload + - `Time Total` - expected time to complete the operation + - `Time Current` - time passed since the invoke + - `Time Left` - expected time left to completion + - `Curr.Speed` - the average transfer speed the last 5 seconds (the first + 5 seconds of a transfer is based on less time of course.) + +The `-#` option displays a totally different progress bar that does not need +much explanation! + +## Speed Limit + +curl allows the user to set the transfer speed conditions that must be met to +let the transfer keep going. By using the switch `-y` and `-Y` you can make +curl abort transfers if the transfer speed is below the specified lowest limit +for a specified time. + +To have curl abort the download if the speed is slower than 3000 bytes per +second for 1 minute, run: + + curl -Y 3000 -y 60 www.far-away.example.com + +This can be used in combination with the overall time limit, so that the above +operation must be completed in whole within 30 minutes: + + curl -m 1800 -Y 3000 -y 60 www.far-away.example.com + +Forcing curl not to transfer data faster than a given rate is also possible, +which might be useful if you are using a limited bandwidth connection and you +do not want your transfer to use all of it (sometimes referred to as +*bandwidth throttle*). + +Make curl transfer data no faster than 10 kilobytes per second: + + curl --limit-rate 10K www.far-away.example.com + +or + + curl --limit-rate 10240 www.far-away.example.com + +Or prevent curl from uploading data faster than 1 megabyte per second: + + curl -T upload --limit-rate 1M ftp://uploads.example.com + +When using the `--limit-rate` option, the transfer rate is regulated on a +per-second basis, which causes the total transfer speed to become lower than +the given number. Sometimes of course substantially lower, if your transfer +stalls during periods. + +## Config File + +curl automatically tries to read the `.curlrc` file (or `_curlrc` file on +Microsoft Windows systems) from the user's home directory on startup. + +The config file could be made up with normal command line switches, but you +can also specify the long options without the dashes to make it more +readable. You can separate the options and the parameter with spaces, or with +`=` or `:`. Comments can be used within the file. If the first letter on a +line is a `#`-symbol the rest of the line is treated as a comment. + +If you want the parameter to contain spaces, you must enclose the entire +parameter within double quotes (`"`). Within those quotes, you specify a quote +as `\"`. + +NOTE: You must specify options and their arguments on the same line. + +Example, set default time out and proxy in a config file: + + # We want a 30 minute timeout: + -m 1800 + # ... and we use a proxy for all accesses: + proxy = proxy.our.domain.example.com:8080 + +Whitespaces ARE significant at the end of lines, but all whitespace leading +up to the first characters of each line are ignored. + +Prevent curl from reading the default file by using -q as the first command +line parameter, like: + + curl -q www.example.org + +Force curl to get and display a local help page in case it is invoked without +URL by making a config file similar to: + + # default url to get + url = "http://help.with.curl.example.com/curlhelp.html" + +You can specify another config file to be read by using the `-K`/`--config` +flag. If you set config filename to `-` it reads the config from stdin, which +can be handy if you want to hide options from being visible in process tables +etc: + + echo "user = user:passwd" | curl -K - http://that.secret.example.com + +## Extra Headers + +When using curl in your own programs, you may end up needing to pass on your +own custom headers when getting a webpage. You can do this by using the `-H` +flag. + +Example, send the header `X-you-and-me: yes` to the server when getting a +page: + + curl -H "X-you-and-me: yes" love.example.com + +This can also be useful in case you want curl to send a different text in a +header than it normally does. The `-H` header you specify then replaces the +header curl would normally send. If you replace an internal header with an +empty one, you prevent that header from being sent. To prevent the `Host:` +header from being used: + + curl -H "Host:" server.example.com + +## FTP and Path Names + +Do note that when getting files with a `ftp://` URL, the given path is +relative to the directory you enter. To get the file `README` from your home +directory at your ftp site, do: + + curl ftp://user:passwd@my.example.com/README + +If you want the README file from the root directory of that same site, you +need to specify the absolute filename: + + curl ftp://user:passwd@my.example.com//README + +(I.e with an extra slash in front of the filename.) + +## SFTP and SCP and Path Names + +With sftp: and scp: URLs, the path name given is the absolute name on the +server. To access a file relative to the remote user's home directory, prefix +the file with `/~/` , such as: + + curl -u $USER sftp://home.example.com/~/.bashrc + +## FTP and Firewalls + +The FTP protocol requires one of the involved parties to open a second +connection as soon as data is about to get transferred. There are two ways to +do this. + +The default way for curl is to issue the PASV command which causes the server +to open another port and await another connection performed by the +client. This is good if the client is behind a firewall that does not allow +incoming connections. + + curl ftp.example.com + +If the server, for example, is behind a firewall that does not allow +connections on ports other than 21 (or if it just does not support the `PASV` +command), the other way to do it is to use the `PORT` command and instruct the +server to connect to the client on the given IP number and port (as parameters +to the PORT command). + +The `-P` flag to curl supports a few different options. Your machine may have +several IP-addresses and/or network interfaces and curl allows you to select +which of them to use. Default address can also be used: + + curl -P - ftp.example.com + +Download with `PORT` but use the IP address of our `le0` interface (this does +not work on Windows): + + curl -P le0 ftp.example.com + +Download with `PORT` but use 192.168.0.10 as our IP address to use: + + curl -P 192.168.0.10 ftp.example.com + +## Network Interface + +Get a webpage from a server using a specified port for the interface: + + curl --interface eth0:1 http://www.example.com/ + +or + + curl --interface 192.168.1.10 http://www.example.com/ + +## HTTPS + +Secure HTTP requires a TLS library to be installed and used when curl is +built. If that is done, curl is capable of retrieving and posting documents +using the HTTPS protocol. + +Example: + + curl https://secure.example.com + +curl is also capable of using client certificates to get/post files from sites +that require valid certificates. The only drawback is that the certificate +needs to be in PEM-format. PEM is a standard and open format to store +certificates with, but it is not used by the most commonly used browsers. If +you want curl to use the certificates you use with your favorite browser, you +may need to download/compile a converter that can convert your browser's +formatted certificates to PEM formatted ones. + +Example on how to automatically retrieve a document using a certificate with a +personal password: + + curl -E /path/to/cert.pem:password https://secure.example.com/ + +If you neglect to specify the password on the command line, you are prompted +for the correct password before any data can be received. + +Many older HTTPS servers have problems with specific SSL or TLS versions, +which newer versions of OpenSSL etc use, therefore it is sometimes useful to +specify what TLS version curl should use.: + + curl --tlv1.0 https://secure.example.com/ + +Otherwise, curl attempts to use a sensible TLS default version. + +## Resuming File Transfers + +To continue a file transfer where it was previously aborted, curl supports +resume on HTTP(S) downloads as well as FTP uploads and downloads. + +Continue downloading a document: + + curl -C - -o file ftp://ftp.example.com/path/file + +Continue uploading a document: + + curl -C - -T file ftp://ftp.example.com/path/file + +Continue downloading a document from a web server + + curl -C - -o file http://www.example.com/ + +## Time Conditions + +HTTP allows a client to specify a time condition for the document it requests. +It is `If-Modified-Since` or `If-Unmodified-Since`. curl allows you to specify +them with the `-z`/`--time-cond` flag. + +For example, you can easily make a download that only gets performed if the +remote file is newer than a local copy. It would be made like: + + curl -z local.html http://remote.example.com/remote.html + +Or you can download a file only if the local file is newer than the remote +one. Do this by prepending the date string with a `-`, as in: + + curl -z -local.html http://remote.example.com/remote.html + +You can specify a plain text date as condition. Tell curl to only download the +file if it was updated since January 12, 2012: + + curl -z "Jan 12 2012" http://remote.example.com/remote.html + +curl accepts a wide range of date formats. You always make the date check the +other way around by prepending it with a dash (`-`). + +## DICT + +For fun try + + curl dict://dict.org/m:curl + curl dict://dict.org/d:heisenbug:jargon + curl dict://dict.org/d:daniel:gcide + +Aliases for `m` are `match` and `find`, and aliases for `d` are `define` and +`lookup`. For example, + + curl dict://dict.org/find:curl + +Commands that break the URL description of the RFC (but not the DICT +protocol) are + + curl dict://dict.org/show:db + curl dict://dict.org/show:strat + +Authentication support is still missing + +## LDAP + +If you have installed the OpenLDAP library, curl can take advantage of it and +offer `ldap://` support. On Windows, curl uses WinLDAP from Platform SDK by +default. + +Default protocol version used by curl is LDAP version 3. Version 2 is used as +a fallback mechanism in case version 3 fails to connect. + +LDAP is a complex thing and writing an LDAP query is not an easy +task. Familiarize yourself with the exact syntax description elsewhere. One +such place might be: [RFC 2255, The LDAP URL +Format](https://curl.se/rfc/rfc2255.txt) + +To show you an example, this is how to get all people from an LDAP server that +has a certain subdomain in their email address: + + curl -B "ldap://ldap.example.com/o=frontec??sub?mail=*sth.example.com" + +You also can use authentication when accessing LDAP catalog: + + curl -u user:passwd "ldap://ldap.example.com/o=frontec??sub?mail=*" + curl "ldap://user:passwd@ldap.example.com/o=frontec??sub?mail=*" + +By default, if user and password are provided, OpenLDAP/WinLDAP uses basic +authentication. On Windows you can control this behavior by providing one of +`--basic`, `--ntlm` or `--digest` option in curl command line + + curl --ntlm "ldap://user:passwd@ldap.example.com/o=frontec??sub?mail=*" + +On Windows, if no user/password specified, auto-negotiation mechanism is used +with current logon credentials (SSPI/SPNEGO). + +## Environment Variables + +curl reads and understands the following proxy related environment variables: + + http_proxy, HTTPS_PROXY, FTP_PROXY + +They should be set for protocol-specific proxies. General proxy should be set +with + + ALL_PROXY + +A comma-separated list of hostnames that should not go through any proxy is +set in (only an asterisk, `*` matches all hosts) + + NO_PROXY + +If the hostname matches one of these strings, or the host is within the domain +of one of these strings, transactions with that node is not done over the +proxy. When a domain is used, it needs to start with a period. A user can +specify that both www.example.com and foo.example.com should not use a proxy +by setting `NO_PROXY` to `.example.com`. By including the full name you can +exclude specific hostnames, so to make `www.example.com` not use a proxy but +still have `foo.example.com` do it, set `NO_PROXY` to `www.example.com`. + +The usage of the `-x`/`--proxy` flag overrides the environment variables. + +## Netrc + +Unix introduced the `.netrc` concept a long time ago. It is a way for a user +to specify name and password for commonly visited FTP sites in a file so that +you do not have to type them in each time you visit those sites. You realize +this is a big security risk if someone else gets hold of your passwords, +therefore most Unix programs do not read this file unless it is only readable +by yourself (curl does not care though). + +curl supports `.netrc` files if told to (using the `-n`/`--netrc` and +`--netrc-optional` options). This is not restricted to just FTP, so curl can +use it for all protocols where authentication is used. + +A simple `.netrc` file could look something like: + + machine curl.se login iamdaniel password mysecret + +## Custom Output + +To better allow script programmers to get to know about the progress of curl, +the `-w`/`--write-out` option was introduced. Using this, you can specify what +information from the previous transfer you want to extract. + +To display the amount of bytes downloaded together with some text and an +ending newline: + + curl -w 'We downloaded %{size_download} bytes\n' www.example.com + +## Kerberos FTP Transfer + +curl supports kerberos4 and kerberos5/GSSAPI for FTP transfers. You need the +kerberos package installed and used at curl build time for it to be available. + +First, get the krb-ticket the normal way, like with the `kinit`/`kauth` tool. +Then use curl in way similar to: + + curl --krb private ftp://krb4site.example.com -u username:fakepwd + +There is no use for a password on the `-u` switch, but a blank one makes curl +ask for one and you already entered the real password to `kinit`/`kauth`. + +## TELNET + +The curl telnet support is basic and easy to use. curl passes all data passed +to it on stdin to the remote server. Connect to a remote telnet server using a +command line similar to: + + curl telnet://remote.example.com + +Enter the data to pass to the server on stdin. The result is sent to stdout or +to the file you specify with `-o`. + +You might want the `-N`/`--no-buffer` option to switch off the buffered output +for slow connections or similar. + +Pass options to the telnet protocol negotiation, by using the `-t` option. To +tell the server we use a vt100 terminal, try something like: + + curl -tTTYPE=vt100 telnet://remote.example.com + +Other interesting options for it `-t` include: + + - `XDISPLOC=` Sets the X display location. + - `NEW_ENV=` Sets an environment variable. + +NOTE: The telnet protocol does not specify any way to login with a specified +user and password so curl cannot do that automatically. To do that, you need to +track when the login prompt is received and send the username and password +accordingly. + +## Persistent Connections + +Specifying multiple files on a single command line makes curl transfer all of +them, one after the other in the specified order. + +libcurl attempts to use persistent connections for the transfers so that the +second transfer to the same host can use the same connection that was already +initiated and was left open in the previous transfer. This greatly decreases +connection time for all but the first transfer and it makes a far better use +of the network. + +Note that curl cannot use persistent connections for transfers that are used +in subsequent curl invokes. Try to stuff as many URLs as possible on the same +command line if they are using the same host, as that makes the transfers +faster. If you use an HTTP proxy for file transfers, practically all transfers +are persistent. + +## Multiple Transfers With A Single Command Line + +As is mentioned above, you can download multiple files with one command line +by simply adding more URLs. If you want those to get saved to a local file +instead of just printed to stdout, you need to add one save option for each +URL you specify. Note that this also goes for the `-O` option (but not +`--remote-name-all`). + +For example: get two files and use `-O` for the first and a custom file +name for the second: + + curl -O http://example.com/file.txt ftp://example.com/moo.exe -o moo.jpg + +You can also upload multiple files in a similar fashion: + + curl -T local1 ftp://example.com/moo.exe -T local2 ftp://example.com/moo2.txt + +## IPv6 + +curl connects to a server with IPv6 when a host lookup returns an IPv6 address +and fall back to IPv4 if the connection fails. The `--ipv4` and `--ipv6` +options can specify which address to use when both are available. IPv6 +addresses can also be specified directly in URLs using the syntax: + + http://[2001:1890:1112:1::20]/overview.html + +When this style is used, the `-g` option must be given to stop curl from +interpreting the square brackets as special globbing characters. Link local +and site local addresses including a scope identifier, such as `fe80::1234%1`, +may also be used, but the scope portion must be numeric or match an existing +network interface on Linux and the percent character must be URL escaped. The +previous example in an SFTP URL might look like: + + sftp://[fe80::1234%251]/ + +IPv6 addresses provided other than in URLs (e.g. to the `--proxy`, +`--interface` or `--ftp-port` options) should not be URL encoded. + +## Mailing Lists + +For your convenience, we have several open mailing lists to discuss curl, its +development and things relevant to this. Get all info at +https://curl.se/mail/. + +Please direct curl questions, feature requests and trouble reports to one of +these mailing lists instead of mailing any individual. + +Available lists include: + +### `curl-users` + +Users of the command line tool. How to use it, what does not work, new +features, related tools, questions, news, installations, compilations, +running, porting etc. + +### `curl-library` + +Developers using or developing libcurl. Bugs, extensions, improvements. + +### `curl-announce` + +Low-traffic. Only receives announcements of new public versions. At worst, +that makes something like one or two mails per month, but usually only one +mail every second month. + +### `curl-and-php` + +Using the curl functions in PHP. Everything curl with a PHP angle. Or PHP with +a curl angle. + +### `curl-and-python` + +Python hackers using curl with or without the python binding pycurl. diff --git a/curl/docs/Makefile.am b/curl/docs/Makefile.am index 17b3909ca..554657e88 100644 --- a/curl/docs/Makefile.am +++ b/curl/docs/Makefile.am @@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -18,66 +18,133 @@ # 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 no-dependencies -# EXTRA_DIST breaks with $(abs_builddir) so build it using this variable -# but distribute it (using the relative file name) in the next variable -man_MANS = $(abs_builddir)/curl.1 -noinst_man_MANS = curl.1 mk-ca-bundle.1 -dist_man_MANS = curl-config.1 -GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html -PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf -MANDISTPAGES = curl.1.dist curl-config.1.dist +if BUILD_DOCS +# if we disable man page building, ignore these +MK_CA_DOCS = mk-ca-bundle.1 +CURLCONF_DOCS = curl-config.1 +TEST_DOCS = runtests.1 testcurl.1 +man_MANS = curl-config.1 wcurl.1 +endif -HTMLPAGES = $(GENHTMLPAGES) index.html +CURLPAGES = curl-config.md mk-ca-bundle.md wcurl.md runtests.md testcurl.md -# Build targets in this file (.) before cmdline-opts to ensure that -# the curl.1 rule below runs first -SUBDIRS = . cmdline-opts -DIST_SUBDIRS = $(SUBDIRS) examples libcurl +SUBDIRS = . cmdline-opts libcurl +DIST_SUBDIRS = $(SUBDIRS) examples -CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES) $(MANDISTPAGES) curl.1 +if BUILD_DOCS +CLEANFILES = $(MK_CA_DOCS) $(man_MANS) $(TEST_DOCS) +endif -EXTRA_DIST = MANUAL BUGS CONTRIBUTE.md FAQ FEATURES INTERNALS.md SSLCERTS.md \ - README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS KNOWN_BUGS \ - BINDINGS.md HISTORY.md INSTALL INSTALL.md LICENSE-MIXING.md \ - README.netware MAIL-ETIQUETTE HTTP-COOKIES.md SECURITY.md RELEASE-PROCEDURE \ - SSL-PROBLEMS.md HTTP2.md ROADMAP.md CODE_OF_CONDUCT.md CODE_STYLE.md \ - CHECKSRC.md CMakeLists.txt README.md CIPHERS.md INSTALL.cmake README.cmake \ - $(noinst_man_MANS) HELP-US.md +TESTDOCS = \ + tests/CI.md \ + tests/FILEFORMAT.md \ + tests/HTTP.md \ + tests/TEST-SUITE.md -MAN2HTML= roffit $< >$@ +INTERNALDOCS = \ + internals/BUFQ.md \ + internals/BUFREF.md \ + internals/CHECKSRC.md \ + internals/CLIENT-READERS.md \ + internals/CLIENT-WRITERS.md \ + internals/CODE_STYLE.md \ + internals/CONNECTION-FILTERS.md \ + internals/CURLX.md \ + internals/DYNBUF.md \ + internals/HASH.md \ + internals/LLIST.md \ + internals/MID.md \ + internals/MQTT.md \ + internals/MULTI-EV.md \ + internals/NEW-PROTOCOL.md \ + internals/PORTING.md \ + internals/README.md \ + internals/SCORECARD.md \ + internals/SPLAY.md \ + internals/STRPARSE.md \ + internals/TLS-SESSIONS.md \ + internals/UINT_SETS.md \ + internals/WEBSOCKET.md -SUFFIXES = .1 .html .pdf +EXTRA_DIST = \ + $(CURLPAGES) \ + $(INTERNALDOCS) \ + $(TESTDOCS) \ + ALTSVC.md \ + BINDINGS.md \ + BUG-BOUNTY.md \ + BUGS.md \ + CIPHERS.md \ + CIPHERS-TLS12.md \ + CMakeLists.txt \ + CODE_OF_CONDUCT.md \ + CODE_REVIEW.md \ + CONTRIBUTE.md \ + CURL-DISABLE.md \ + CURLDOWN.md \ + DEPRECATE.md \ + DISTROS.md \ + EARLY-RELEASE.md \ + ECH.md \ + EXPERIMENTAL.md \ + FAQ \ + FEATURES.md \ + GOVERNANCE.md \ + HELP-US.md \ + HISTORY.md \ + HSTS.md \ + HTTP-COOKIES.md \ + HTTP3.md \ + HTTPSRR.md \ + INFRASTRUCTURE.md \ + INSTALL \ + INSTALL-CMAKE.md \ + INSTALL.md \ + INTERNALS.md \ + IPFS.md \ + KNOWN_BUGS \ + MAIL-ETIQUETTE.md \ + MANUAL.md \ + options-in-versions \ + README.md \ + RELEASE-PROCEDURE.md \ + RUSTLS.md \ + ROADMAP.md \ + SECURITY-ADVISORY.md \ + SPONSORS.md \ + SSL-PROBLEMS.md \ + SSLCERTS.md \ + THANKS TODO \ + TheArtOfHttpScripting.md \ + URL-SYNTAX.md \ + VERSIONS.md \ + VULN-DISCLOSURE-POLICY.md -# $(abs_builddir) is to disable VPATH when searching for this file, which -# would otherwise find the copy in $(srcdir) which breaks the $(HUGE) -# rule in src/Makefile.am in out-of-tree builds that references the file in the -# build directory. -# -# First, seed the used copy of curl.1 with the prebuilt copy (in an out-of-tree -# build), then run make recursively to rebuild it only if its dependencies -# have changed. -$(abs_builddir)/curl.1: - if test "$(top_builddir)x" != "$(top_srcdir)x" -a -e "$(srcdir)/curl.1"; then \ - cp -fp "$(srcdir)/curl.1" $@; fi - cd cmdline-opts && $(MAKE) - -html: $(HTMLPAGES) - cd libcurl && $(MAKE) html - -pdf: $(PDFPAGES) - cd libcurl && $(MAKE) pdf - -.1.html: - $(MAN2HTML) - -.1.pdf: - @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ - groff -Tps -man $< >$$foo.ps; \ - ps2pdf $$foo.ps $@; \ - rm $$foo.ps; \ - echo "converted $< to $@") +CD2NROFF = $(top_srcdir)/scripts/cd2nroff $< >$@ + +CD2 = $(CD2_$(V)) +CD2_0 = @echo " RENDER " $@; +CD2_1 = +CD2_ = $(CD2_0) + +SUFFIXES = .1 .md + +all: $(MK_CA_DOCS) $(CURLCONF_DOCS) $(TEST_DOCS) + +.md.1: + $(CD2)$(CD2NROFF) + +curl-config.1: curl-config.md + +mk-ca-bundle.1: mk-ca-bundle.md + +wcurl.1: wcurl.md +distclean: + rm -f $(CLEANFILES) diff --git a/curl/docs/Makefile.in b/curl/docs/Makefile.in index 50d259689..3c6290cce 100644 --- a/curl/docs/Makefile.in +++ b/curl/docs/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,11 +21,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -34,6 +34,8 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # +# SPDX-License-Identifier: curl +# ########################################################################### VPATH = @srcdir@ am__is_gnu_make = { \ @@ -111,19 +113,24 @@ build_triplet = @build@ host_triplet = @host@ subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/curl-amissl.m4 \ $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ + $(top_srcdir)/m4/curl-gnutls.m4 \ + $(top_srcdir)/m4/curl-mbedtls.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ - $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/curl-reentrant.m4 \ + $(top_srcdir)/m4/curl-rustls.m4 \ + $(top_srcdir)/m4/curl-schannel.m4 \ + $(top_srcdir)/m4/curl-sysconfig.m4 \ + $(top_srcdir)/m4/curl-wolfssl.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ - $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ @@ -149,7 +156,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = -am__depfiles_maybe = +am__maybe_remake_depfiles = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ @@ -194,7 +201,8 @@ am__uninstall_files_from_dir = { \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" -MANS = $(dist_man_MANS) $(man_MANS) +NROFF = nroff +MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -202,7 +210,7 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir + distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -220,10 +228,7 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in INSTALL \ - THANKS TODO +am__DIST_COMMON = $(srcdir)/Makefile.in INSTALL README.md THANKS TODO DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -253,51 +258,34 @@ am__relativize = \ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APXS = @APXS@ AR = @AR@ +AR_FLAGS = @AR_FLAGS@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ +CADDY = @CADDY@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ +CURL_CA_EMBED = @CURL_CA_EMBED@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ -CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ -CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ -CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ -CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ -CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ -CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ -CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ -CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ -CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ -CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ -CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ -CURL_DISABLE_SMB = @CURL_DISABLE_SMB@ -CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ -CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ -CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ -CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ +CURL_CPP = @CURL_CPP@ +CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX = @CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX@ +CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME = @CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ -CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ -CURL_WITH_MULTI_SSL = @CURL_WITH_MULTI_SSL@ CYGPATH_W = @CYGPATH_W@ -DEFAULT_SSL_BACKEND = @DEFAULT_SSL_BACKEND@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -309,29 +297,31 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ +FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@ GCOV = @GCOV@ -GENHTML = @GENHTML@ GREP = @GREP@ -HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ -HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ -HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@ -IDN_ENABLED = @IDN_ENABLED@ +HTTPD = @HTTPD@ +HTTPD_NGHTTPX = @HTTPD_NGHTTPX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -IPV6_ENABLED = @IPV6_ENABLED@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LIBCURL_LIBS = @LIBCURL_LIBS@ -LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ -LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ -LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ +LIBCURL_PC_CFLAGS = @LIBCURL_PC_CFLAGS@ +LIBCURL_PC_CFLAGS_PRIVATE = @LIBCURL_PC_CFLAGS_PRIVATE@ +LIBCURL_PC_LDFLAGS_PRIVATE = @LIBCURL_PC_LDFLAGS_PRIVATE@ +LIBCURL_PC_LIBS = @LIBCURL_PC_LIBS@ +LIBCURL_PC_LIBS_PRIVATE = @LIBCURL_PC_LIBS_PRIVATE@ +LIBCURL_PC_REQUIRES = @LIBCURL_PC_REQUIRES@ +LIBCURL_PC_REQUIRES_PRIVATE = @LIBCURL_PC_REQUIRES_PRIVATE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -342,12 +332,9 @@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ -MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ -NROFF = @NROFF@ -NSS_LIBS = @NSS_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ @@ -361,39 +348,20 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PKGADD_NAME = @PKGADD_NAME@ -PKGADD_PKG = @PKGADD_PKG@ -PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ -RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ -REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ +RC = @RC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ -SSL_ENABLED = @SSL_ENABLED@ -SSL_LIBS = @SSL_LIBS@ +SSL_BACKENDS = @SSL_BACKENDS@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ -USE_ARES = @USE_ARES@ -USE_AXTLS = @USE_AXTLS@ -USE_CYASSL = @USE_CYASSL@ -USE_DARWINSSL = @USE_DARWINSSL@ -USE_GNUTLS = @USE_GNUTLS@ -USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ -USE_LIBRTMP = @USE_LIBRTMP@ -USE_LIBSSH2 = @USE_LIBSSH2@ -USE_MBEDTLS = @USE_MBEDTLS@ -USE_NGHTTP2 = @USE_NGHTTP2@ -USE_NSS = @USE_NSS@ -USE_OPENLDAP = @USE_OPENLDAP@ -USE_POLARSSL = @USE_POLARSSL@ -USE_SCHANNEL = @USE_SCHANNEL@ -USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@ -USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ +TEST_NGHTTPX = @TEST_NGHTTPX@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ +VSFTPD = @VSFTPD@ ZLIB_LIBS = @ZLIB_LIBS@ ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@ abs_builddir = @abs_builddir@ @@ -445,7 +413,6 @@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -453,35 +420,110 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies -# EXTRA_DIST breaks with $(abs_builddir) so build it using this variable -# but distribute it (using the relative file name) in the next variable -man_MANS = $(abs_builddir)/curl.1 -noinst_man_MANS = curl.1 mk-ca-bundle.1 -dist_man_MANS = curl-config.1 -GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html -PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf -MANDISTPAGES = curl.1.dist curl-config.1.dist -HTMLPAGES = $(GENHTMLPAGES) index.html - -# Build targets in this file (.) before cmdline-opts to ensure that -# the curl.1 rule below runs first -SUBDIRS = . cmdline-opts -DIST_SUBDIRS = $(SUBDIRS) examples libcurl -CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES) $(MANDISTPAGES) curl.1 -EXTRA_DIST = MANUAL BUGS CONTRIBUTE.md FAQ FEATURES INTERNALS.md SSLCERTS.md \ - README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS KNOWN_BUGS \ - BINDINGS.md HISTORY.md INSTALL INSTALL.md LICENSE-MIXING.md \ - README.netware MAIL-ETIQUETTE HTTP-COOKIES.md SECURITY.md RELEASE-PROCEDURE \ - SSL-PROBLEMS.md HTTP2.md ROADMAP.md CODE_OF_CONDUCT.md CODE_STYLE.md \ - CHECKSRC.md CMakeLists.txt README.md CIPHERS.md INSTALL.cmake README.cmake \ - $(noinst_man_MANS) HELP-US.md - -MAN2HTML = roffit $< >$@ -SUFFIXES = .1 .html .pdf +# if we disable man page building, ignore these +@BUILD_DOCS_TRUE@MK_CA_DOCS = mk-ca-bundle.1 +@BUILD_DOCS_TRUE@CURLCONF_DOCS = curl-config.1 +@BUILD_DOCS_TRUE@TEST_DOCS = runtests.1 testcurl.1 +@BUILD_DOCS_TRUE@man_MANS = curl-config.1 wcurl.1 +CURLPAGES = curl-config.md mk-ca-bundle.md wcurl.md runtests.md testcurl.md +SUBDIRS = . cmdline-opts libcurl +DIST_SUBDIRS = $(SUBDIRS) examples +@BUILD_DOCS_TRUE@CLEANFILES = $(MK_CA_DOCS) $(man_MANS) $(TEST_DOCS) +TESTDOCS = \ + tests/CI.md \ + tests/FILEFORMAT.md \ + tests/HTTP.md \ + tests/TEST-SUITE.md + +INTERNALDOCS = \ + internals/BUFQ.md \ + internals/BUFREF.md \ + internals/CHECKSRC.md \ + internals/CLIENT-READERS.md \ + internals/CLIENT-WRITERS.md \ + internals/CODE_STYLE.md \ + internals/CONNECTION-FILTERS.md \ + internals/CURLX.md \ + internals/DYNBUF.md \ + internals/HASH.md \ + internals/LLIST.md \ + internals/MID.md \ + internals/MQTT.md \ + internals/MULTI-EV.md \ + internals/NEW-PROTOCOL.md \ + internals/PORTING.md \ + internals/README.md \ + internals/SCORECARD.md \ + internals/SPLAY.md \ + internals/STRPARSE.md \ + internals/TLS-SESSIONS.md \ + internals/UINT_SETS.md \ + internals/WEBSOCKET.md + +EXTRA_DIST = \ + $(CURLPAGES) \ + $(INTERNALDOCS) \ + $(TESTDOCS) \ + ALTSVC.md \ + BINDINGS.md \ + BUG-BOUNTY.md \ + BUGS.md \ + CIPHERS.md \ + CIPHERS-TLS12.md \ + CMakeLists.txt \ + CODE_OF_CONDUCT.md \ + CODE_REVIEW.md \ + CONTRIBUTE.md \ + CURL-DISABLE.md \ + CURLDOWN.md \ + DEPRECATE.md \ + DISTROS.md \ + EARLY-RELEASE.md \ + ECH.md \ + EXPERIMENTAL.md \ + FAQ \ + FEATURES.md \ + GOVERNANCE.md \ + HELP-US.md \ + HISTORY.md \ + HSTS.md \ + HTTP-COOKIES.md \ + HTTP3.md \ + HTTPSRR.md \ + INFRASTRUCTURE.md \ + INSTALL \ + INSTALL-CMAKE.md \ + INSTALL.md \ + INTERNALS.md \ + IPFS.md \ + KNOWN_BUGS \ + MAIL-ETIQUETTE.md \ + MANUAL.md \ + options-in-versions \ + README.md \ + RELEASE-PROCEDURE.md \ + RUSTLS.md \ + ROADMAP.md \ + SECURITY-ADVISORY.md \ + SPONSORS.md \ + SSL-PROBLEMS.md \ + SSLCERTS.md \ + THANKS TODO \ + TheArtOfHttpScripting.md \ + URL-SYNTAX.md \ + VERSIONS.md \ + VULN-DISCLOSURE-POLICY.md + +CD2NROFF = $(top_srcdir)/scripts/cd2nroff $< >$@ +CD2 = $(CD2_$(V)) +CD2_0 = @echo " RENDER " $@; +CD2_1 = +CD2_ = $(CD2_0) +SUFFIXES = .1 .md all: all-recursive .SUFFIXES: -.SUFFIXES: .1 .html .pdf +.SUFFIXES: .1 .md $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -499,8 +541,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -517,10 +559,10 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -install-man1: $(dist_man_MANS) $(man_MANS) +install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ - list2='$(dist_man_MANS) $(man_MANS)'; \ + list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ @@ -555,7 +597,7 @@ uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ @@ -659,8 +701,10 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -758,14 +802,14 @@ clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am -distclean: distclean-recursive - -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: +html: html-recursive + html-am: info: info-recursive @@ -808,6 +852,8 @@ mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool +pdf: pdf-recursive + pdf-am: ps: ps-recursive @@ -837,34 +883,19 @@ uninstall-man: uninstall-man1 .PRECIOUS: Makefile -# $(abs_builddir) is to disable VPATH when searching for this file, which -# would otherwise find the copy in $(srcdir) which breaks the $(HUGE) -# rule in src/Makefile.am in out-of-tree builds that references the file in the -# build directory. -# -# First, seed the used copy of curl.1 with the prebuilt copy (in an out-of-tree -# build), then run make recursively to rebuild it only if its dependencies -# have changed. -$(abs_builddir)/curl.1: - if test "$(top_builddir)x" != "$(top_srcdir)x" -a -e "$(srcdir)/curl.1"; then \ - cp -fp "$(srcdir)/curl.1" $@; fi - cd cmdline-opts && $(MAKE) - -html: $(HTMLPAGES) - cd libcurl && $(MAKE) html - -pdf: $(PDFPAGES) - cd libcurl && $(MAKE) pdf - -.1.html: - $(MAN2HTML) - -.1.pdf: - @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ - groff -Tps -man $< >$$foo.ps; \ - ps2pdf $$foo.ps $@; \ - rm $$foo.ps; \ - echo "converted $< to $@") +all: $(MK_CA_DOCS) $(CURLCONF_DOCS) $(TEST_DOCS) + +.md.1: + $(CD2)$(CD2NROFF) + +curl-config.1: curl-config.md + +mk-ca-bundle.1: mk-ca-bundle.md + +wcurl.1: wcurl.md + +distclean: + rm -f $(CLEANFILES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/curl/docs/README.cmake b/curl/docs/README.cmake deleted file mode 100644 index 084c1de6d..000000000 --- a/curl/docs/README.cmake +++ /dev/null @@ -1,16 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -README.cmake - Read the README file first. - - Curl contains CMake build files that provide a way to build Curl with the - CMake build tool (www.cmake.org). CMake is a cross platform meta build tool - that generates native makefiles and IDE project files. The CMake build - system can be used to build Curl on any of its supported platforms. - - Read the INSTALL.cmake file for instructions on how to compile curl with - CMake. diff --git a/curl/docs/README.md b/curl/docs/README.md index 56691fc4e..22d96ea9b 100644 --- a/curl/docs/README.md +++ b/curl/docs/README.md @@ -1,12 +1,18 @@ -![curl logo](https://cdn.rawgit.com/curl/curl-www/master/logo/curl-logo.svg) + + +![curl logo](https://curl.se/logo/curl-logo.svg) # Documentation -You'll find a mix of various documentation in this directory and -subdirectories, using several different formats. Some of them are not ideal -for reading directly in your browser. +You find a mix of various documentation in this directory and subdirectories, +using several different formats. Some of them are not ideal for reading +directly in your browser. -If you'd rather see the rendered version of the documentation, check out the -curl web site's [documentation section](https://curl.haxx.se/docs/) for -general curl stuff or the [libcurl section](https://curl.haxx.se/libcurl/) for +If you would rather see the rendered version of the documentation, check out the +curl website's [documentation section](https://curl.se/docs/) for +general curl stuff or the [libcurl section](https://curl.se/libcurl/) for libcurl related documentation. diff --git a/curl/docs/README.netware b/curl/docs/README.netware deleted file mode 100644 index 9028963f6..000000000 --- a/curl/docs/README.netware +++ /dev/null @@ -1,26 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -README.netware - - Read the README file first. - - Curl has been successfully compiled with gcc / nlmconv on different flavours - of Linux as well as with the official Metrowerks CodeWarrior compiler. - While not being the main development target, a continuously growing share of - curl users are NetWare-based, especially also consuming the lib from PHP. - - The unix-style man pages are tricky to read on windows, so therefore all - those pages are also provided as web pages on the curl web site. - - The main curl.1 man page is also "built-in" in the command line tool. Use a - command line similar to this in order to extract a separate text file: - - curl -M >manual.txt - - Read the INSTALL file for instructions on how to compile curl self. - - diff --git a/curl/docs/README.win32 b/curl/docs/README.win32 deleted file mode 100644 index 00ca197fe..000000000 --- a/curl/docs/README.win32 +++ /dev/null @@ -1,25 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - -README.win32 - - Read the README file first. - - Curl has been compiled, built and run on all sorts of Windows and win32 - systems. While not being the main develop target, a fair share of curl users - are win32-based. - - The unix-style man pages are tricky to read on windows, so therefore all - those pages are also provided as web pages on the curl web site. - - The main curl.1 man page is also "built-in" in the command line tool. Use a - command line similar to this in order to extract a separate text file: - - curl -M >manual.txt - - Read the INSTALL file for instructions on how to compile curl self. - - diff --git a/curl/docs/RELEASE-PROCEDURE b/curl/docs/RELEASE-PROCEDURE deleted file mode 100644 index b7f8fcda0..000000000 --- a/curl/docs/RELEASE-PROCEDURE +++ /dev/null @@ -1,95 +0,0 @@ -curl release procedure - how to do a release -============================================ - -in the source code repo ------------------------ - -- edit `RELEASE-NOTES` to be accurate - -- update `docs/THANKS` - -- make sure all relevant changes are committed on the master branch - -- tag the git repo in this style: `git tag -a curl-7_34_0`. -a annotates the - tag and we use underscores instead of dots in the version number. - -- run "./maketgz 7.34.0" to build the release tarballs. It is important that - you run this on a machine with the correct set of autotools etc installed - as this is what then will be shipped and used by most users on *nix like - systems. - -- push the git commits and the new tag - -- gpg sign the 4 tarballs as maketgz suggests - -- upload the 8 resulting files to the primary download directory - -in the curl-www repo --------------------- - -- edit `Makefile` (version number and date), - -- edit `_newslog.html` (announce the new release) and - -- edit `_changes.html` (insert changes+bugfixes from RELEASE-NOTES) - -- commit all local changes - -- tag the repo with the same tag as used for the source repo - -- make sure all relevant changes are committed and pushed on the master branch - - (the web site then updates its contents automatically) - -on github ---------- - -- edit the newly made release tag so that it is listed as the latest release - -inform ------- - -- send an email to curl-users, curl-announce and curl-library. Insert the - RELEASE-NOTES into the mail. - -celebrate ---------- - -- suitable beverage intake is encouraged for the festivities - -curl release scheduling -======================= - -Basics ------- - -We do releases every 8 weeks on Wednesdays. If critical problems arise, we can -insert releases outside of the schedule or we can move the release date - but -this is very rare. - -Each 8 week release cycle is split in two 4-week periods. - -- During the first 4 weeks after a release, we allow new features and changes - to curl and libcurl. If we accept any such changes, we bump the minor number - used for the next release. - -- During the second 4-week period we do not merge any features or changes, we - then only focus on fixing bugs and polishing things to make a solid coming - release. - -Coming dates ------------- - -Based on the description above, here are some planned release dates (at the -time of this writing): - -- November 29, 2017 -- January 24, 2018 -- March 21, 2018 -- May 16, 2018 -- July 11, 2018 -- September 5, 2018 -- October 31, 2018 -- December 26, 2018 -- February 20, 2019 -- April 17, 2019 diff --git a/curl/docs/RELEASE-PROCEDURE.md b/curl/docs/RELEASE-PROCEDURE.md new file mode 100644 index 000000000..45b0704ae --- /dev/null +++ b/curl/docs/RELEASE-PROCEDURE.md @@ -0,0 +1,147 @@ + + +curl release procedure - how to do a release +============================================ + +in the source code repo +----------------------- + +- edit `RELEASE-NOTES` to be accurate + +- update `docs/THANKS` + +- update the "past releases" section in `docs/VERSIONS.md` + +- make sure all relevant changes are committed on the master branch + +- tag the git repo in this style: `git tag -a curl-7_34_0`. -a annotates the + tag and we use underscores instead of dots in the version number. Make sure + the tag is GPG signed (using -s). + +- run `./scripts/dmaketgz 7.34.0` to build the release tarballs. + +- push the git commits and the new tag + +- GPG sign the 4 tarballs as `maketgz` suggests + +- upload the 8 resulting files to the primary download directory + +in the curl-www repo +-------------------- + +- edit `Makefile` (version number and date), + +- edit `_newslog.html` (announce the new release) and + +- edit `_changes.html` (insert changes+bugfixes from RELEASE-NOTES) + +- commit all local changes + +- tag the repo with the same name as used for the source repo. + +- make sure all relevant changes are committed and pushed on the master branch + + (the website then updates its contents automatically) + +on GitHub +--------- + +- edit the newly made release tag so that it is listed as the latest release + +inform +------ + +- send an email to curl-users, curl-announce and curl-library. Insert the + RELEASE-NOTES into the mail. + +- if there are any advisories associated with the release, send each markdown + file to the above lists as well as to `oss-security@lists.openwall.com` + (unless the problem is unique to the non-open operating systems) + +celebrate +--------- + +- suitable beverage intake is encouraged for the festivities + +curl release scheduling +======================= + +Release Cycle +------------- + +We normally do releases every 8 weeks on Wednesdays. If important problems +arise, we can insert releases outside the schedule or we can move the release +date. + +Each 8 week (56 days) release cycle is divided into three distinct periods: + +- During the first 10 calendar days after a release, we are in "cool down". We + do not merge features but only bug-fixes. If a regression is reported, we + might do a follow-up patch release. + +- During the following 3 weeks (21 days) there is a feature window: we allow + new features and changes to curl and libcurl. If we accept any such changes, + we bump the minor number used for the next release. + +- During the next 25 days we are in feature freeze. We do not merge any + features or changes, and we only focus on fixing bugs and polishing things + to make the pending release a solid one. + +If a future release date happens to end up on a "bad date", like in the middle +of common public holidays or when the lead release manager is unavailable, the +release date can be moved forwards or backwards a full week. This is then +advertised well in advance. + +Release Candidates +------------------ + +We ship release candidate tarballs on three occasions in preparation for the +pending release: + +- Release candidate one (**rc1**) ships the same Saturday the feature freeze + starts. Twenty-five days before the release. Tagged like `rc-7_34_0-1`. + +- Release candidate two (**rc2**) ships nine days later, sixteen days before + the release. On a Monday. Tagged like `rc-7_34_0-2`. + +- Release candidate tree (**rc3**) ships nine days later, seven days before + the release. On a Wednesday. Tagged like `rc-7_34_0-3`. + +Release candidate tarballs are ephemeral and each such tarball is only kept +around for a few weeks. They are provided on their dedicated webpage at: +https://curl.se/rc/ + +The git tags for release candidate are temporary and remain set only for a +limited period of time. + +**Do not use release candidates in production**. They are work in progress. +Use them for testing and verification only. Use actual releases in production. + +Critical problems +----------------- + +We can break the release cycle and do a patch release at any point if a +critical enough problem is reported. There is no exact definition of how to +assess such criticality, but if an issue is highly disturbing or has a +security impact on a large enough share of the user population it might +qualify. + +If you think an issue qualifies, bring it to the curl-library mailing list and +push for it. + +Coming dates +------------ + +Based on the description above, here are some planned future release dates: + +- May 28, 2025 +- July 16, 2025 +- September 10, 2025 +- November 5, 2025 +- January 7, 2026 +- March 4, 2026 +- April 29, 2026 diff --git a/curl/docs/RELEASE-TOOLS.md b/curl/docs/RELEASE-TOOLS.md new file mode 100644 index 000000000..5c9fdb56f --- /dev/null +++ b/curl/docs/RELEASE-TOOLS.md @@ -0,0 +1,28 @@ +# Release tools used for curl 8.15.0 + +The following tools and their Debian package version numbers were used to +produce this release tarball. + +- autoconf: 2.71-3 +- automake: 1:1.16.5-1.3 +- libtool: 2.4.7-7~deb12u1 +- make: 4.3-4.1 +- perl: 5.36.0-7+deb12u2 +- git: 1:2.39.5-0+deb12u2 + +# Reproduce the tarball + +- Clone the repo and checkout the tag/commit: curl-8_15_0 +- Install the same set of tools + versions as listed above + +## Do a standard build + +- autoreconf -fi +- ./configure [...] +- make + +## Generate the tarball with the same timestamp + +- export SOURCE_DATE_EPOCH=1752646924 +- ./scripts/maketgz [version] + diff --git a/curl/docs/RESOURCES b/curl/docs/RESOURCES deleted file mode 100644 index 1ad8aac31..000000000 --- a/curl/docs/RESOURCES +++ /dev/null @@ -1,83 +0,0 @@ - _ _ ____ _ - Project ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - -This document lists documents and standards used by curl. - - RFC 959 - The FTP protocol - - RFC 1635 - How to Use Anonymous FTP - - RFC 1738 - Uniform Resource Locators - - RFC 1777 - defines the LDAP protocol - - RFC 1808 - Relative Uniform Resource Locators - - RFC 1867 - Form-based File Upload in HTML - - RFC 1950 - ZLIB Compressed Data Format Specification - - RFC 1951 - DEFLATE Compressed Data Format Specification - - RFC 1952 - gzip compression format - - RFC 1959 - LDAP URL syntax - - RFC 2045-2049 - Everything you need to know about MIME! (needed for form - based upload) - - RFC 2068 - HTTP 1.1 (obsoleted by RFC 2616) - - RFC 2104 - Keyed-Hashing for Message Authentication - - RFC 2109 - HTTP State Management Mechanism (cookie stuff) - - Also, read Netscape's specification at - https://curl.haxx.se/rfc/cookie_spec.html - - RFC 2183 - The Content-Disposition Header Field - - RFC 2195 - CRAM-MD5 authentication - - RFC 2229 - A Dictionary Server Protocol - - RFC 2255 - Newer LDAP URL syntax document. - - RFC 2231 - MIME Parameter Value and Encoded Word Extensions: - Character Sets, Languages, and Continuations - - RFC 2388 - "Returning Values from Forms: multipart/form-data" - Use this as an addition to the RFC1867 - - RFC 2396 - "Uniform Resource Identifiers: Generic Syntax and Semantics" This - one obsoletes RFC 1738, but since RFC 1738 is often mentioned - I've left it in this list. - - RFC 2428 - FTP Extensions for IPv6 and NATs - - RFC 2577 - FTP Security Considerations - - RFC 2616 - HTTP 1.1, the latest - - RFC 2617 - HTTP Authentication - - RFC 2718 - Guidelines for new URL Schemes - - RFC 2732 - Format for Literal IPv6 Addresses in URL's - - RFC 2818 - HTTP Over TLS (TLS is the successor to SSL) - - RFC 2821 - SMTP protocol - - RFC 2964 - Use of HTTP State Management - - RFC 2965 - HTTP State Management Mechanism. Cookies. Obsoletes RFC2109 - - RFC 3207 - SMTP over TLS - - RFC 4616 - PLAIN authentication - - RFC 4954 - SMTP Authentication diff --git a/curl/docs/ROADMAP.md b/curl/docs/ROADMAP.md index 1007ccb02..abf306b33 100644 --- a/curl/docs/ROADMAP.md +++ b/curl/docs/ROADMAP.md @@ -1,118 +1,17 @@ -curl the next few years - perhaps -================================= + -QUIC ----- +# curl the next few years - perhaps -The standardization process of QUIC has been taken to the IETF and can be -followed on the [IETF QUIC Mailing -list](https://www.ietf.org/mailman/listinfo/quic). I'd like us to get on the -bandwagon. Ideally, this would be done with a separate library/project to -handle the binary/framing layer in a similar fashion to how HTTP/2 is -implemented. This, to allow other projects to benefit from the work and to -thus broaden the interest and chance of others to participate. +Roadmap of things Daniel Stenberg wants to work on next. It is intended to +serve as a guideline for others for information, feedback and possible +participation. -HTTP cookies ------------- +## WebSocket -Two cookie drafts have been adopted by the httpwg in IETF and we should -support them as the popular browsers will as well: +Agree that it is a good enough API and remove the EXPERIMENTAL label. -[Deprecate modification of 'secure' cookies from non-secure -origins](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-00) - -[Cookie Prefixes](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-prefixes-00) - -[Firefox bug report about secure cookies](https://bugzilla.mozilla.org/show_bug.cgi?id=976073) - -SRV records ------------ - -How to find services for specific domains/hosts. - -curl_formadd() --------------- - -make sure there's an easy handle passed in to `curl_formadd()`, -`curl_formget()` and `curl_formfree()` by adding replacement functions and -deprecating the old ones to allow custom mallocs and more. - -Or perhaps even better: revamp the formpost API completely while we're at it -and making something that is easier to use and understand: - - https://github.com/curl/curl/wiki/formpost-API-redesigned - -Third-party SASL ----------------- - -Add support for third-party SASL libraries such as Cyrus SASL. - -SASL authentication in LDAP ---------------------------- - -... - -Simplify the SMTP email ------------------------ - -Simplify the SMTP email interface so that programmers don't have to -construct the body of an email that contains all the headers, alternative -content, images and attachments - maintain raw interface so that -programmers that want to do this can - -email capabilities ------------------- - -Allow the email protocols to return the capabilities before -authenticating. This will allow an application to decide on the best -authentication mechanism - -Win32 pthreads --------------- - -Allow Windows threading model to be replaced by Win32 pthreads port - -dynamic buffer size -------------------- - -Implement a dynamic buffer size to allow SFTP to use much larger buffers and -possibly allow the size to be customizable by applications. Use less memory -when handles are not in use? - -New stuff - curl ----------------- - -1. Embed a language interpreter (lua?). For that middle ground where curl - isn’t enough and a libcurl binding feels “too much”. Build-time conditional - of course. - -2. Simplify the SMTP command line so that the headers and multi-part content - don't have to be constructed before calling curl - -Improve -------- - -1. build for windows (considered hard by many users) - -2. curl -h output (considered overwhelming to users) - -3. we have > 200 command line options, is there a way to redo things to - simplify or improve the situation as we are likely to keep adding - features/options in the future too - -4. authentication framework (consider merging HTTP and SASL authentication to - give one API for protocols to call) - -5. Perform some of the clean up from the TODO document, removing old - definitions and such like that are currently earmarked to be removed years - ago - -Remove ------- - -1. makefile.vc files as there is no point in maintaining two sets of Windows - makefiles. Note: These are currently being used by the Windows autobuilds +## diff --git a/curl/docs/RUSTLS.md b/curl/docs/RUSTLS.md new file mode 100644 index 000000000..e46e1d802 --- /dev/null +++ b/curl/docs/RUSTLS.md @@ -0,0 +1,85 @@ + + +# Rustls + +[Rustls is a TLS backend written in Rust](https://docs.rs/rustls/). curl can +be built to use it as an alternative to OpenSSL or other TLS backends. We use +the [rustls-ffi C bindings](https://github.com/rustls/rustls-ffi/). This +version of curl is compatible with `rustls-ffi` v0.15.x. + +## Getting rustls-ffi + +To build `curl` with `rustls` support you need to have `rustls-ffi` available first. +There are three options for this: + +1. Install it from your package manager, if available. +2. Download pre-built binaries. +3. Build it from source. + +### Installing rustls-ffi from a package manager + +See the [rustls-ffi README] for packaging status. Availability and details for installation +differ between distributions. + +Once installed, build `curl` using `--with-rustls`. + + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % ./configure --with-rustls + % make + +[rustls-ffi README]: https://github.com/rustls/rustls-ffi?tab=readme-ov-file + +### Downloading pre-built rustls-ffi binaries + +Pre-built binaries are available on the [releases page] on GitHub for releases since 0.15.0. +Download the appropriate archive for your platform and extract it to a directory of your choice +(e.g. `${HOME}/rustls-ffi-built`). + +Once downloaded, build `curl` using `--with-rustls` and the path to the extracted binaries. + + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % ./configure --with-rustls=${HOME}/rustls-ffi-built + % make + +[releases page]: https://github.com/rustls/rustls-ffi/releases + +### Building rustls-ffi from source + +Building `rustls-ffi` from source requires both a rust compiler, and the [cargo-c] cargo plugin. + +To install a Rust compiler, use [rustup] or your package manager to install +the **1.73+** or newer toolchain. + +To install `cargo-c`, use your [package manager][cargo-c pkg], download +[a pre-built archive][cargo-c prebuilt], or build it from source with `cargo install cargo-c`. + +Next, check out, build, and install the appropriate version of `rustls-ffi` using `cargo`: + + % git clone https://github.com/rustls/rustls-ffi -b v0.15.0 + % cd rustls-ffi + % cargo capi install --release --prefix=${HOME}/rustls-ffi-built + +Now configure and build `curl` using `--with-rustls`: + + % git clone https://github.com/curl/curl + % cd curl + % autoreconf -fi + % ./configure --with-rustls=${HOME}/rustls-ffi-built + % make + +See the [rustls-ffi README][cryptography provider] for more information on cryptography providers and +their build/platform requirements. + +[cargo-c]: https://github.com/lu-zero/cargo-c +[rustup]: https://rustup.rs/ +[cargo-c pkg]: https://github.com/lu-zero/cargo-c?tab=readme-ov-file#availability +[cargo-c prebuilt]: https://github.com/lu-zero/cargo-c/releases +[cryptography provider]: https://github.com/cpu/rustls-ffi?tab=readme-ov-file#cryptography-provider diff --git a/curl/docs/SECURITY-ADVISORY.md b/curl/docs/SECURITY-ADVISORY.md new file mode 100644 index 000000000..efb0e0493 --- /dev/null +++ b/curl/docs/SECURITY-ADVISORY.md @@ -0,0 +1,135 @@ + + +# Anatomy of a curl security advisory + +As described in the [Security Process](https://curl.se/dev/secprocess.html) +document, when a security vulnerability has been reported to the project and +confirmed, we author an advisory document for the issue. It should ideally +be written in cooperation with the reporter to make sure all the angles and +details of the problem are gathered and described correctly and succinctly. + +## New document + +A security advisory for curl is created in the `docs/` folder in the +[curl-www](https://github.com/curl/curl-www) repository. It should be named +`$CVEID.md` where `$CVEID` is the full CVE Id that has been registered for the +flaw. Like `CVE-2016-0755`. The `.md` extension of course means that the +document is written using markdown. + +The standard way to go about this is to first write the `VULNERABILITY` +section for the document, so that there is description of the flaw available, +then paste this description into the CVE Id request. + +### `vuln.pm` + +The new issue should be entered at the top of the list in the file `vuln.pm` +in the same directory. It holds a large array with all published curl +vulnerabilities. All fields should be filled in accordingly, separated by a +pipe character (`|`). + +The eleven fields for each CVE in `vuln.pm` are, in order: + + HTML page name, first vulnerable version, last vulnerable version, name of + the issue, CVE Id, announce date (`YYYYMMDD`), report to the project date + (`YYYYMMDD`), CWE, awarded reward amount (USD), area (single word), C-issue + (`-` if not a C issue at all, `OVERFLOW` , `OVERREAD`, `DOUBLE_FREE`, + `USE_AFTER_FREE`, `NULL_MISTAKE`, `UNINIT`) + +### `Makefile` + +The new CVE webpage filename needs to be added in the `Makefile`'s `CVELIST` +macro. + +When the markdown is in place and the `Makefile` and `vuln.pm` are updated, +all other files and metadata for all curl advisories and versions get +generated automatically using those files. + +## Document format + +The easy way is to start with a recent previously published advisory and just +blank out old texts and save it using a new name. Save the subtitles and +general layout. + +Some details and metadata are extracted from this document so it is important +to stick to the existing format. + +The first list must be the title of the issue. + +### VULNERABILITY + +The first subtitle should be `VULNERABILITY`. That should then include a +through and detailed description of the flaw. Including how it can be +triggered and maybe something about what might happen if triggered or +exploited. + +### INFO + +The next section is `INFO` which adds meta data information about the flaw. It +specifically mentions the official CVE Id for the issue and it must list the +CWE Id, starting on its own line. We write CWE identifiers in advisories with +the full (official) explanation on the right side of a colon. Like this: + +`CWE-305: Authentication Bypass by Primary Weakness` + +### AFFECTED VERSIONS + +The third section first lists what versions that are affected, then adds +clarity by stressing what versions that are *not* affected. A third line adds +information about which specific git commit that introduced the vulnerability. + +The `Introduced-in` commit should be a full URL that displays the commit, but +should work as a stand-alone commit hash if everything up to the last slash is +cut out. + +An example using the correct syntax: + +~~~ +- Affected versions: curl 7.16.1 to and including 7.88.1 +- Not affected versions: curl < 7.16.1 and curl >= 8.0.0 +- Introduced-in: https://github.com/curl/curl/commit/2147284cad +~~~ + +### THE SOLUTION + +This section describes and discusses the fix. The only mandatory information +here is the link to the git commit that fixes the problem. + +The `Fixed-in` value should be a full URL that displays the commit, but should +work as a stand-alone commit hash if everything up to the last slash is cut +out. + +Example: + +`- Fixed-in: https://github.com/curl/curl/commit/af369db4d3833272b8ed` + +### RECOMMENDATIONS + +This section lists the recommended actions for the users in a top to bottom +priority order and should ideally contain three items but no less than two. + +The top two are almost always `upgrade curl to version XXX` and `apply the +patch to your local version`. + +### TIMELINE + +Detail when this report was received in the project. When package distributors +were notified (via the distros mailing list or similar) + +When the advisory and fixed version are released. + +### CREDITS + +Mention the reporter and patch author at least, then everyone else involved +you think deserves a mention. + +If you want to mention more than one name, separate the names with comma +(`,`). + +~~~ +- Reported-by: Full Name +- Patched-by: Full Name +~~~ diff --git a/curl/docs/SECURITY.md b/curl/docs/SECURITY.md deleted file mode 100644 index c88cc9c81..000000000 --- a/curl/docs/SECURITY.md +++ /dev/null @@ -1,116 +0,0 @@ -curl security for developers -============================ - -This document is intended to provide guidance to curl developers on how -security vulnerabilities should be handled. - -Publishing Information ----------------------- - -All known and public curl or libcurl related vulnerabilities are listed on -[the curl web site security page](https://curl.haxx.se/docs/security.html). - -Security vulnerabilities should not be entered in the project's public bug -tracker unless the necessary configuration is in place to limit access to the -issue to only the reporter and the project's security team. - -Vulnerability Handling ----------------------- - -The typical process for handling a new security vulnerability is as follows. - -No information should be made public about a vulnerability until it is -formally announced at the end of this process. That means, for example that a -bug tracker entry must NOT be created to track the issue since that will make -the issue public and it should not be discussed on any of the project's public -mailing lists. Also messages associated with any commits should not make -any reference to the security nature of the commit if done prior to the public -announcement. - -- The person discovering the issue, the reporter, reports the vulnerability - privately to `curl-security@haxx.se`. That's an email alias that reaches a - handful of selected and trusted people. - -- Messages that do not relate to the reporting or managing of an undisclosed - security vulnerability in curl or libcurl are ignored and no further action - is required. - -- A person in the security team sends an e-mail to the original reporter to - acknowledge the report. - -- The security team investigates the report and either rejects it or accepts - it. - -- If the report is rejected, the team writes to the reporter to explain why. - -- If the report is accepted, the team writes to the reporter to let him/her - know it is accepted and that they are working on a fix. - -- The security team discusses the problem, works out a fix, considers the - impact of the problem and suggests a release schedule. This discussion - should involve the reporter as much as possible. - -- The release of the information should be "as soon as possible" and is most - often synced with an upcoming release that contains the fix. If the - reporter, or anyone else, thinks the next planned release is too far away - then a separate earlier release for security reasons should be considered. - -- Write a security advisory draft about the problem that explains what the - problem is, its impact, which versions it affects, solutions or - workarounds, when the release is out and make sure to credit all - contributors properly. - -- Request a CVE number from - [distros@openwall](http://oss-security.openwall.org/wiki/mailing-lists/distros) - when also informing and preparing them for the upcoming public security - vulnerability announcement - attach the advisory draft for information. Note - that 'distros' won't accept an embargo longer than 19 days and they do not - care for Windows-specific flaws. For windows-specific flaws, request CVE - directly from MITRE. - -- Update the "security advisory" with the CVE number. - -- The security team commits the fix in a private branch. The commit message - should ideally contain the CVE number. This fix is usually also distributed - to the 'distros' mailing list to allow them to use the fix prior to the - public announcement. - -- No more than 48 hours before the release, the private branch is merged into - the master branch and pushed. Once pushed, the information is accessible to - the public and the actual release should follow suit immediately afterwards. - The time between the push and the release is used for final tests and - reviews. - -- The project team creates a release that includes the fix. - -- The project team announces the release and the vulnerability to the world in - the same manner we always announce releases. It gets sent to the - curl-announce, curl-library and curl-users mailing lists. - -- The security web page on the web site should get the new vulnerability - mentioned. - -Pre-notification ----------------- - -If you think you are or should be eligible for a pre-notification about -upcoming security announcements for curl, we urge OS distros and similar -vendors to primarily join the distros@openwall list as that is one of the -purposes of that list - and not just for curl of course. - -If you are not a distro or otherwise not suitable for distros@openwall and yet -want pre-notifications from us, contact the curl security team with a detailed -and clear explanation why this is the case. - -curl-security (at haxx dot se) ------------------------------- - -Who is on this list? There are a couple of criteria you must meet, and then we -might ask you to join the list or you can ask to join it. It really isn't very -formal. We basically only require that you have a long-term presence in the -curl project and you have shown an understanding for the project and its way -of working. You must've been around for a good while and you should have no -plans in vanishing in the near future. - -We do not make the list of participants public mostly because it tends to vary -somewhat over time and a list somewhere will only risk getting outdated. diff --git a/curl/docs/SPONSORS.md b/curl/docs/SPONSORS.md new file mode 100644 index 000000000..e4f61db6a --- /dev/null +++ b/curl/docs/SPONSORS.md @@ -0,0 +1,55 @@ + + +# curl sponsors + +A sponsor is someone who donates money or resources to the curl project for no +specific service in return. + +curl accepts donations via [GitHub sponsors](https://github.com/sponsors/curl) +and [Open Collective](https://opencollective.com/curl). + +An even better way to contribute to the project might be to pay an engineer or +two to spend work hours on curl related tasks. + +We promise to use donated funds for things and activities that we believe are +beneficial for the project and its development. That includes but is not +limited to bug-bounties, developer conferences, infrastructure, development, +services and hardware. + +Recurring donations above a certain amount of money puts the sponsor at a +named sponsor level: **Silver**, **Gold**, **Platinum** or **Top**. + +Sponsors on a named level can provide their logo image and preferred URL and +get recognition on the curl website's [sponsor +page](https://curl.se/sponsors.html), assuming they meet the project's +standards and requirements. + +- **Silver Sponsor** at least 100 USD/month +- **Gold Sponsor** at least 500 USD/month +- **Platinum Sponsor** at least 1000 USD/month +- **Top Sponsor** outstanding extra valuable help + +## Sponsor requirements + +A named level sponsor is entitled a logo and link on the curl website assuming +the company, brand and link are not deemed unsuitable. The curl team reserves +the right to make that decision at its own discretion. + +Sponsors may be denied a website presence for example if involved with drugs, +gambling, pornography, social media manipulation etc. + +## Past Sponsors + +Sponsors that stop paying are considered *Past Sponsors* and are not displayed +on the sponsor page anymore. We thank you for your contributions. + +## Donations + +Please note that sponsorship and donations are exactly that: donations to the +curl project. They are used to help and further the project as the project +leadership deems best. No goods or services are expected or promised in +return. Requests for refunds for such purposes are rejected. diff --git a/curl/docs/SSL-PROBLEMS.md b/curl/docs/SSL-PROBLEMS.md index 91803e22d..301ce7e87 100644 --- a/curl/docs/SSL-PROBLEMS.md +++ b/curl/docs/SSL-PROBLEMS.md @@ -1,8 +1,8 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| + # SSL problems @@ -11,36 +11,47 @@ ago. There are several known reasons why a connection that involves SSL might - fail. This is a document that attempts to details the most common ones and + fail. This is a document that attempts to detail the most common ones and how to mitigate them. ## CA certs CA certs are used to digitally verify the server's certificate. You need a - "ca bundle" for this. See lots of more details on this in the SSLCERTS + "ca bundle" for this. See lots of more details on this in the `SSLCERTS` document. ## CA bundle missing intermediate certificates - When using said CA bundle to verify a server cert, you will experience - problems if your CA cert does not have the certificates for the - intermediates in the whole trust chain. + When using said CA bundle to verify a server cert, you may experience + problems if your CA store does not contain the certificates for the + intermediates if the server does not provide them. + + The TLS protocol mandates that the intermediate certificates are sent in the + handshake, but as browsers have ways to survive or work around such + omissions, missing intermediates in TLS handshakes still happen that browser + users do not notice. + + Browsers work around this problem in two ways: they cache intermediate + certificates from previous transfers and some implement the TLS "AIA" + extension that lets the client explicitly download such certificates on + demand. ## Protocol version Some broken servers fail to support the protocol negotiation properly that SSL servers are supposed to handle. This may cause the connection to fail - completely. Sometimes you may need to explicitly select a SSL version to use - when connecting to make the connection succeed. + completely. Sometimes you may need to explicitly select an SSL version to + use when connecting to make the connection succeed. An additional complication can be that modern SSL libraries sometimes are - built with support for older SSL and TLS versions disabled! + built with support for older SSL and TLS versions disabled. - All versions of SSL are considered insecure and should be avoided. Use TLS. + All versions of SSL and the TLS versions before 1.2 are considered insecure + and should be avoided. Use TLS 1.2 or later. ## Ciphers - Clients give servers a list of ciphers to select from. If the list doesn't + Clients give servers a list of ciphers to select from. If the list does not include any ciphers the server wants/can use, the connection handshake fails. @@ -48,24 +59,23 @@ ciphers from its default set (slightly depending on SSL backend in use). You may have to explicitly provide an alternative list of ciphers for curl - to use to allow the server to use a WEAK cipher for you. + to use to allow the server to use a weak cipher for you. Note that these weak ciphers are identified as flawed. For example, this includes symmetric ciphers with less than 128 bit keys and RC4. - WinSSL in Windows XP is not able to connect to servers that no longer + Schannel in Windows XP is not able to connect to servers that no longer support the legacy handshakes and algorithms used by those versions, so we - advice against building curl to use WinSSL on really old Windows versions. - - References: + advise against building curl to use Schannel on really old Windows versions. - https://tools.ietf.org/html/draft-popov-tls-prohibiting-rc4-01 + Reference: [Prohibiting RC4 Cipher + Suites](https://datatracker.ietf.org/doc/html/draft-popov-tls-prohibiting-rc4-01) ## Allow BEAST BEAST is the name of a TLS 1.0 attack that surfaced 2011. When adding means to mitigate this attack, it turned out that some broken servers out there in - the wild didn't work properly with the BEAST mitigation in place. + the wild did not work properly with the BEAST mitigation in place. To make such broken servers work, the --ssl-allow-beast option was introduced. Exactly as it sounds, it re-introduces the BEAST vulnerability @@ -77,11 +87,11 @@ Some SSL backends may do certificate revocation checks (CRL, OCSP, etc) depending on the OS or build configuration. The --ssl-no-revoke option was introduced in 7.44.0 to disable revocation checking but currently is only - supported for WinSSL (the native Windows SSL library), with an exception in - the case of Windows' Untrusted Publishers blacklist which it seems can't be - bypassed. This option may have broader support to accommodate other SSL + supported for Schannel (the native Windows SSL library), with an exception + in the case of Windows' Untrusted Publishers block list which it seems cannot + be bypassed. This option may have broader support to accommodate other SSL backends in the future. References: - https://curl.haxx.se/docs/ssl-compared.html + https://curl.se/docs/ssl-compared.html diff --git a/curl/docs/SSLCERTS.md b/curl/docs/SSLCERTS.md index 3fcd345b0..4efb9cf00 100644 --- a/curl/docs/SSLCERTS.md +++ b/curl/docs/SSLCERTS.md @@ -1,173 +1,120 @@ -SSL Certificate Verification -============================ + -SSL is the old name. It is called TLS these days. +# TLS Certificate Verification +## Native vs file based -Native SSL ----------- +If curl was built with Schannel support, then curl uses the system native CA +store for verification. All other TLS libraries use a file based CA store by +default. -If libcurl was built with Schannel or Secure Transport support (the native SSL -libraries included in Windows and Mac OS X), then this does not apply to -you. Scroll down for details on how the OS-native engines handle SSL -certificates. If you're not sure, then run "curl -V" and read the results. If -the version string says "WinSSL" in it, then it was built with Schannel -support. +## Verification -It is about trust ------------------ +Every trusted server certificate is digitally signed by a Certificate +Authority, a CA. -This system is about trust. In your local CA certificate store you have certs -from *trusted* Certificate Authorities that you then can use to verify that the -server certificates you see are valid. They're signed by one of the CAs you -trust. +In your local CA store you have a collection of certificates from *trusted* +certificate authorities that TLS clients like curl use to verify servers. -Which CAs do you trust? You can decide to trust the same set of companies your -operating system trusts, or the set one of the known browsers trust. That's -basically trust via someone else you trust. You should just be aware that -modern operating systems and browsers are setup to trust *hundreds* of -companies and recent years several such CAs have been found untrustworthy. - -Certificate Verification ------------------------- - -libcurl performs peer SSL certificate verification by default. This is done -by using a CA certificate store that the SSL library can use to make sure the -peer's server certificate is valid. +curl does certificate verification by default. This is done by verifying the +signature and making sure the certificate was crafted for the server name +provided in the URL. If you communicate with HTTPS, FTPS or other TLS-using servers using -certificates that are signed by CAs present in the store, you can be sure -that the remote server really is the one it claims to be. +certificates signed by a CA whose certificate is present in the store, you can +be sure that the remote server really is the one it claims to be. -If the remote server uses a self-signed certificate, if you don't install a CA -cert store, if the server uses a certificate signed by a CA that isn't +If the remote server uses a self-signed certificate, if you do not install a +CA cert store, if the server uses a certificate signed by a CA that is not included in the store you use or if the remote host is an impostor -impersonating your favorite site, and you want to transfer files from this -server, do one of the following: - - 1. Tell libcurl to *not* verify the peer. With libcurl you disable this with - `curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);` - - With the curl command line tool, you disable this with -k/--insecure. - - 2. Get a CA certificate that can verify the remote server and use the proper - option to point out this CA cert for verification when connecting. For - libcurl hackers: `curl_easy_setopt(curl, CURLOPT_CAPATH, capath);` - - With the curl command line tool: --cacert [file] - - 3. Add the CA cert for your server to the existing default CA certificate - store. The default CA certificate store can changed at compile time with the - following configure options: - - --with-ca-bundle=FILE: use the specified file as CA certificate store. CA - certificates need to be concatenated in PEM format into this file. - - --with-ca-path=PATH: use the specified path as CA certificate store. CA - certificates need to be stored as individual PEM files in this directory. - You may need to run c_rehash after adding files there. - - If neither of the two options is specified, configure will try to auto-detect - a setting. It's also possible to explicitly not hardcode any default store - but rely on the built in default the crypto library may provide instead. - You can achieve that by passing both --without-ca-bundle and - --without-ca-path to the configure script. - - If you use Internet Explorer, this is one way to get extract the CA cert - for a particular server: - - - View the certificate by double-clicking the padlock - - Find out where the CA certificate is kept (Certificate> - Authority Information Access>URL) - - Get a copy of the crt file using curl - - Convert it from crt to PEM using the openssl tool: - openssl x509 -inform DES -in yourdownloaded.crt \ - -out outcert.pem -text - - Add the 'outcert.pem' to the CA certificate store or use it stand-alone - as described below. - - If you use the 'openssl' tool, this is one way to get extract the CA cert - for a particular server: - - - `openssl s_client -connect xxxxx.com:443 |tee logfile` - - type "QUIT", followed by the "ENTER" key - - The certificate will have "BEGIN CERTIFICATE" and "END CERTIFICATE" - markers. - - If you want to see the data in the certificate, you can do: "openssl - x509 -inform PEM -in certfile -text -out certdata" where certfile is - the cert you extracted from logfile. Look in certdata. - - If you want to trust the certificate, you can add it to your CA - certificate store or use it stand-alone as described. Just remember that - the security is no better than the way you obtained the certificate. - - 4. If you're using the curl command line tool, you can specify your own CA - cert path by setting the environment variable `CURL_CA_BUNDLE` to the path - of your choice. - - If you're using the curl command line tool on Windows, curl will search - for a CA cert file named "curl-ca-bundle.crt" in these directories and in - this order: - 1. application's directory - 2. current working directory - 3. Windows System directory (e.g. C:\windows\system32) - 4. Windows Directory (e.g. C:\windows) - 5. all directories along %PATH% - - 5. Get a better/different/newer CA cert bundle! One option is to extract the - one a recent Firefox browser uses by running 'make ca-bundle' in the curl - build tree root, or possibly download a version that was generated this - way for you: [CA Extract](https://curl.haxx.se/docs/caextract.html) - -Neglecting to use one of the above methods when dealing with a server using a -certificate that isn't signed by one of the certificates in the installed CA -certificate store, will cause SSL to report an error ("certificate verify -failed") during the handshake and SSL will then refuse further communication -with that server. - -Certificate Verification with NSS ---------------------------------- - -If libcurl was built with NSS support, then depending on the OS distribution, -it is probably required to take some additional steps to use the system-wide -CA cert db. RedHat ships with an additional module, libnsspem.so, which -enables NSS to read the OpenSSL PEM CA bundle. On openSUSE you can install -p11-kit-nss-trust which makes NSS use the system wide CA certificate store. NSS -also has a new [database format](https://wiki.mozilla.org/NSS_Shared_DB). - -Starting with version 7.19.7, libcurl automatically adds the 'sql:' prefix to -the certdb directory (either the hardcoded default /etc/pki/nssdb or the -directory configured with SSL_DIR environment variable). To check which certdb -format your distribution provides, examine the default certdb location: -/etc/pki/nssdb; the new certdb format can be identified by the filenames -cert9.db, key4.db, pkcs11.txt; filenames of older versions are cert8.db, -key3.db, secmod.db. - -Certificate Verification with Schannel and Secure Transport ------------------------------------------------------------ - -If libcurl was built with Schannel (Microsoft's native TLS engine) or Secure -Transport (Apple's native TLS engine) support, then libcurl will still perform -peer certificate verification, but instead of using a CA cert bundle, it will -use the certificates that are built into the OS. These are the same +impersonating your favorite site, the certificate check fails and reports an +error. + +If you think it wrongly failed the verification, consider one of the following +sections. + +### Skip verification + +Tell curl to *not* verify the peer with `-k`/`--insecure`. + +We **strongly** recommend this is avoided and that even if you end up doing +this for experimentation or development, **never** skip verification in +production. + +### Use a custom CA store + +Get a CA certificate that can verify the remote server and use the proper +option to point out this CA cert for verification when connecting - for this +specific transfer only. + +With the curl command line tool: `--cacert [file]` + +If you use the curl command line tool without a native CA store, then you can +specify your own CA cert file by setting the environment variable +`CURL_CA_BUNDLE` to the path of your choice. `SSL_CERT_FILE` and `SSL_CERT_DIR` +are also supported. + +If you are using the curl command line tool on Windows, curl searches for a CA +cert file named `curl-ca-bundle.crt` in these directories and in this order: + 1. application's directory + 2. current working directory + 3. Windows System directory (e.g. C:\Windows\System32) + 4. Windows Directory (e.g. C:\Windows) + 5. all directories along %PATH% + +curl 8.11.0 added a build-time option to disable this search behavior, and +another option to restrict search to the application's directory. + +### Use the native store + +In several environments, in particular on Windows, you can ask curl to use the +system's native CA store when verifying the certificate. + +With the curl command line tool: `--ca-native`. + +### Modify the CA store + +Add the CA cert for your server to the existing default CA certificate store. + +Usually you can figure out the path to the local CA store by looking at the +verbose output that `curl -v` shows when you connect to an HTTPS site. + +### Change curl's default CA store + +The default CA certificate store curl uses is set at build time. When you +build curl you can point out your preferred path. + +### Extract CA cert from a server + + curl -w %{certs} https://example.com > cacert.pem + +The certificate has `BEGIN CERTIFICATE` and `END CERTIFICATE` markers. + +### Get the Mozilla CA store + +Download a version of the Firefox CA store converted to PEM format on the [CA +Extract](https://curl.se/docs/caextract.html) page. It always features the +latest Firefox bundle. + +## Native CA store + +If curl was built with Schannel or was instructed to use the native CA Store, +then curl uses the certificates that are built into the OS. These are the same certificates that appear in the Internet Options control panel (under Windows) -or Keychain Access application (under OS X). Any custom security rules for -certificates will be honored. +or Keychain Access application (under macOS). Any custom security rules for +certificates are honored. -Schannel will run CRL checks on certificates unless peer verification is -disabled. Secure Transport on iOS will run OCSP checks on certificates unless -peer verification is disabled. Secure Transport on OS X will run either OCSP -or CRL checks on certificates if those features are enabled, and this behavior -can be adjusted in the preferences of Keychain Access. +Schannel runs CRL checks on certificates unless peer verification is disabled. -HTTPS proxy ------------ +## HTTPS proxy -Since version 7.52.0, curl can do HTTPS to the proxy separately from the -connection to the server. This TLS connection is handled separately from the -server connection so instead of `--insecure` and `--cacert` to control the +curl can do HTTPS to the proxy separately from the connection to the server. +This TLS connection is handled and verified separately from the server +connection so instead of `--insecure` and `--cacert` to control the certificate verification, you use `--proxy-insecure` and `--proxy-cacert`. With these options, you make sure that the TLS connection and the trust of the proxy can be kept totally separate from the TLS connection to the server. diff --git a/curl/docs/THANKS b/curl/docs/THANKS index 14a131938..553506c88 100644 --- a/curl/docs/THANKS +++ b/curl/docs/THANKS @@ -4,235 +4,529 @@ If you have contributed but are missing here, please let us know! -"Captain Basil" -"Spoon Man" +0xee on github +0xflotus on github +12932 on github +1337vt on github +1ocalhost on github +3dyd on github +3eka on github +4lan.m +5533asdg on github +8U61ife on github +9cel +a1346054 on github Aaro Koskinen Aaron Oneal Aaron Orenstein +Aaron Scarisbrick +aasivov on github +Abdullah Alyan +Abhinav Singh +Abhinav Singhal Abram Pousada +accountantM on github +AceCrow on github +ad0p on github +Adam Averay +Adam Barclay +Adam Brown +Adam Coyne Adam D. Moss Adam Langley Adam Light +Adam Marcionek Adam Piggott +Adam Rosenfield Adam Sampson Adam Tkac -Adrian Schuur +ad-chaos on github +Aditya Garg +Ádler Jonas Gross +Adnan Khan +adnn on github +Adrian Burcea Adriano Meirelles +Adrian Peniak +Adrian Schuur +afengsoft on github +afrind on github +Aftab Alam +ahodesuka on github +ajak in #curl Ajit Dhumale +Akhilesh Nema Akhil Kedia Aki Koskinen +Aki Sakurai Akos Pasztory Akshay Vernekar Alain Danteny +Alain Miniussi +Alan Coopersmith Alan Jenkins Alan Pinstein Albert Chin-A-Young Albert Choy -Ale Vesely +Alberto Leiva Popper +Albin Vass +albrechtd on github Alejandro Alvarez Ayllon +Alejandro Colomar +Alejandro R. Sedeño Aleksandar Milivojevic +Aleksander Mazur +Aleksandr Krotov Aleksey Tulinov +alervd on github Ales Mlakar Ales Novak Alessandro Ghedini Alessandro Vesely -Alex Bligh -Alex Chan -Alex Fishman -Alex Gruz -Alex McLellan -Alex Neblett -Alex Potapenko -Alex Rousskov -Alex Suykov -Alex Vinnik Alex aka WindEagle +Alexander Bartel Alexander Beedie +Alexander Chuykov Alexander Dyagilev Alexander Elgert +Alexander Jaeger +Alexander Kanavin Alexander Klauer Alexander Kourakos Alexander Krasnostavsky Alexander Lazic Alexander Pepper Alexander Peslyak +Alexander Shtuchkin Alexander Sinditskiy Alexander Traud +Alexander V. Tikhonov Alexander Zhuravlev +Alexandre Bury +Alexandre Ferrieux +Alexandre Pion +Alex Baines +Alex Bligh +Alex Bozarth +Alex Chan +Alex Crichton Alexey Borzov +Alexey Eremikhin +Alexey Larikov Alexey Melnichuk Alexey Pesternikov +Alexey Savchuk Alexey Simak Alexey Zakhlestin +Alex Fishman +Alex Gaynor +Alex Grebenschikov +Alex Gruz Alexis Carvalho Alexis La Goutte +Alexis Savin +Alexis Vachette +Alex Kiernan +Alex Klyubin +Alex Konev +Alex Malinovich +Alex Mayorga +Alex McLellan +Alex Neblett +Alex Nichols +Alex Potapenko +Alex Rousskov +Alex Samorukov +Alex Snast +Alex Suykov +Alex Vinnik +Alex Xu +Alfonso Martone Alfred Gebert +Ali Khodkar +ALittleDruid on github +Ali Utku Selen Allen Pulsifer +Alois Klink Alona Rossen +Amaury Denoyelle +Ameda Amahru +amishmm on github +Amit Katyal +Ammar Faizi Amol Pattekar Amr Shahin Anatol Belski Anatoli Tubman Anders Bakken +Anders Berg Anders Gustafsson Anders Havn +Anderson Sasaki +Anderson Toshiyuki Sasaki Anders Roxell Andi Jahja -Andre Guibert de Bruet -Andre Heinecke +Andrea Pappacoda Andreas Damm -Andreas Faerber +Andreas Falkenhahn Andreas Farber +Andreas Fischer +Andreas Huebner +Andreas Kiefer +Andreas Kostyrka Andreas Malzahn Andreas Ntaflos Andreas Olsson Andreas Rieke Andreas Roth +Andreas Schneider Andreas Schuldei +Andreas Sommer Andreas Streichardt +Andreas Westin Andreas Wurf +Andre Guibert de Bruet +Andre Heinecke Andrei Benea +Andrei Bica Andrei Cipu +Andrei Florea Andrei Karas +Andrei Korshikov Andrei Kurushin +Andrei Neculau +Andrei Rybak Andrei Sedoi +Andrei Valeriu BICA +Andrei Virtosu Andrej E Baranov +Andrés García +Andrew +Andrew Ayer +Andrew Barnert +Andrew Barnes Andrew Benham Andrew Biggs Andrew Bushnell +Andrew de los Reyes Andrew Francis Andrew Fuller +Andrew Ishchuk +Andrew Kaster +Andrew Kirillov Andrew Krieger Andrew Kurushin +Andrew Lambert Andrew Moise +Andrew Potter Andrew Robbins Andrew Wansink -Andrew de los Reyes +Andrey Alifanov +Andrey Gursky Andrey Labunets Andrii Moiseiev -Andrés García +Andrius Merkys +Andy Alt Andy Cedilnik +Andy Fiddaman +Andy Pan +Andy Reitz Andy Serpa +Andy Stamp Andy Tsouladze Angus Mackay +anio on github +annalee +anon00000000 on github +anshnd on github +Anssi Kolehmainen +Antarpreet Singh Anthon Pang Anthony Avina Anthony Bryan Anthony G. Basile +Anthony Hu +Anthony Ramine +Anthony Shaw Antoine Aubert +Antoine Bollengier Antoine Calando +Antoine du Hamel +Antoine Pietri +Antoine Pitrou Anton Bychkov +Anton Gerasimov +Antonio Larrosa +Antoni Villalonga Anton Kalmykov Anton Malov -Anton Yabchinskiy -Antonio Larrosa Antony74 on github +Anton Yabchinskiy Antti Hätälä +antypanty on hackerone +Anubhav Rai +apparentorder on github +April King +Aquila Macedo +arainchik on github +Archangel_SDY on github +Arian van Putten +Arjan van de Ven Arkadiusz Miskiewicz +arlt on github Armel Asselin Arnaud Compan Arnaud Ebalard +Arnaud Rebillout +Arne Soete +Aron Bergman +Aron Rotteveel Artak Galoyan Arthur Murray +Artur Sinila Arve Knudsen Arvid Norberg +arvids-kokins-bidstack on github +asavah on github +Asger Hautop Drewsen Ashish Shukla -Ask Bjørn Hansen +Ashwin Metpalli Askar Safin +Ask Bjørn Hansen +AtariDreams on github Ates Goral +atjg on github Augustus Saunders +Aurélien Pierre +Austin Green +Austin Moore +av223119 on github Avery Fay +awesomekosm on github +awesomenode on github +Axel Chong +Axel Morawietz Axel Tillequin +Ayesh Karunaratne +Ayoub Boudhar +Ayushman Singh Chauhan +b9a1 on github +Bachue Zhou +Baitinq on github Balaji Parasuram Balaji Salunke +Balaji S Rao +Balakrishnan Balasubramanian +Balazs Kovacsics +balikalina on github Balint Szilakszi +baranyaib90 on github Barry Abrahamson +Barry Pollard +Bartosz Ruszczak Bart Whiteley +Baruch Siach Bas Mevissen +Bastian Krause +Bastien Bouclet +Basuke Suzuki +Bas van Schaik +baumanj on github +bdry on github +beckenc on github +behindtheblackwall on hackerone +Ben +Benau on github +Ben Bodenmiller Ben Boeckel +Benbuck Nason Ben Darnell +Ben Fritz Ben Greear -Ben Madsen -Ben Noordhuis -Ben Van Hof -Ben Winslow -Benbuck Nason Benjamin Gerard Benjamin Gilbert Benjamin Johnson Benjamin Kircher +Benjamin Loison +Benjamin Riefenstahl +Benjamin Ritcey Benjamin Sergeant +Ben Kohler +Ben Madsen +Ben Noordhuis Benoit Neil +Benoit Pierre Benoit Sigoure +Ben Van Hof +Ben Voris +Ben Winslow +Ben Zanin Bernard Leak Bernard Spil +Bernat Mut +Bernd Mueller +Bernhard Iselborn Bernhard M. Wiedemann Bernhard Reutner-Fischer +Bernhard Walle Bert Huijben Bertrand Demiddelaer Bertrand Simonnet +beslick5 on github +Bevan Weiss +Bhanu Prakash Bill Doyle Bill Egert Bill Hoffman +billionai on github Bill Middlecamp Bill Nagel Bill Pyne +Billyzou0741326 on github +Bin Lan +Bin Meng +Biswapriyo Nath +Bjarni Ingi Gislason +Bjoern Franke Bjoern Sikora Bjorn Augustsson Bjorn Reese Björn Stenberg +black-desk on github Blaise Potard +Blake Burkhart +blankie +bnfp on github +bo0tzz on github +Bo Anderson +bobmitchell1956 on github Bob Relyea Bob Richmond Bob Schader +Bodo Bergmann Bogdan Nicula +boilingoden +Boris Kuschel +Boris Okunskiy +Boris Rasin +Boris Verkhovskiy Brad Burdick Brad Fitzpatrick +Bradford Bruce +Brad Forschinger Brad Harder Brad Hards +Brad House Brad King Brad Spencer -Bradford Bruce +bramus on github Brandon Casey +Brandon Dong Brandon Wang +BratSinot on github +Brendan Dolan-Gavitt Brendan Jurd +Brendon Smith +Brennan Kinney Brent Beardsley +Brett Buddin Brian Akins +Brian Bergeron Brian Carpenter +Brian Chaplin Brian Childs Brian Chrisman +Brian Chrzanowski +Brian Clemens Brian Dessent +Brian E. Gallew +Brian Green +Brian Harris +Brian Inglis Brian J. Murrell +Brian Lund +brian m. carlson +Brian Nixon Brian Prodoehl Brian R Duffy Brian Ulm Brock Noland -Bru Rom Bruce Mitchener Bruce Stephens -Bruno Thomsen +bruce.yoon +BrumBrum on hackerone +Bruno Baguette Bruno de Carvalho +Bruno Grasselli +Bruno Henrique Batista Cruz da Silva +Bruno Thomsen +Bru Rom Bryan Henderson Bryan Kemp +bsammon on github +bsergean on github +bsr13 on hackerone +bubbleguuum on github +Bubu on github +buzo-ffm on github +bxac on github +Bylon2 on github Byrial Jensen +Cajus Pollmeier +Caleb Raitto +calvin2021y on github +Calvin Buckley +Calvin Ruocco +Cameron Blomquist +Cameron Cawley Cameron Kaiser Cameron MacMinn +Cameron Will Camille Moncelier Caolan McNamara +Cao ZhenXiang +Captain Basil +Carie Pointer +Carlo Alberto +Carlo Cabrera Carlo Cannas +Carlo Marcelo Arenas Belón +Carlos Henrique Lima Melara +Carlos ORyan Carlo Teubner Carlo Wood +Carl Zogheib Carsten Lange +Casey Bodley Casey O'Donnell Catalin Patulea +Catena cyber +causal-agent on github +cbartl on github +cclauss on github +Cédric Connes +Cédric Deltheil +Cering on github +Cesar Eduardo Barros +Ch40zz on github Chad Monroe Chandrakant Bagul +Chara White +Charles Cazabon Charles Kerr Charles Romestant +Charlie C +chemodax Chen Prog +chensong1211 on github +Cherish98 on github +Chester Liu Chih-Chung Chang -Chris "Bob Bob" +Chih-Hsuan Yen +Chilledheart on github +Chloe Kudryavtsev Chris Araman +Chris "Bob Bob" Chris Carlmar Chris Combes Chris Conlon @@ -242,12 +536,19 @@ Chris Flerackers Chris Gaukroger Chris Maltby Chris Mumford +Chris Paulson-Ellis +Chris Roberts +Chris Sauer Chris Smowton -Chris Young +Chris Stubbs +Chris Swan +Chris Talbot Christian Fillion Christian Grothoff -Christian Heimes Christian Hägele +Christian Heimes +Christian Hesse +Christian Heusel Christian Krause Christian Kurz Christian Robottom Reis @@ -256,84 +557,161 @@ Christian Stewart Christian Vogt Christian Weisgerber Christophe Demory +Christophe Dervieux Christophe Legry +Christopher Boyd Christopher Conroy +Christopher Dannemiller +Christopher Degawa +Christopher Head Christopher Palow +Christopher Reid Christopher R. Palmer +Christopher Sauer Christopher Stone +Christoph Jabs +Christoph Krey +Christoph M. Becker +Christoph Reiter +Chris Webb +Chris Young +chrysos349 on github Chungtsun Li Ciprian Badescu +civodul on github Claes Jakobsson Clarence Gardner +Claudio Neves +claudiusaiz on github +clbr on github Clemens Gruber +Clément Notin +Cliff Crosland Clifford Wolf Clint Clayton +Cloudogu Siebels +CMD +cmfrolick on github +codesniffer13 on github Cody Jones Cody Mack +COFFEETALES on github +coinhubs on github Colby Ranger +Cole Helbling Colin Blair +Colin Cross Colin Hogben +Colin Leroy +Colin Leroy-Mira +Colin O'Dell Colin Watson +Colman Mbuya Colm Buckley +Colton Willey Constantine Sapuntzakis +consulion on github +coralw on github +Corinna Brandt +correctmost on github Cory Benfield Cory Nelson +Costya Shulyupin +Craig Andrews Craig A West Craig Davison +Craig de Stigter Craig Markwardt +crazydef on github Cris Bailiff +Cristian Greco +Cristian Morales Vega Cristian Rodríguez +CueXXIII on github Curt Bogmine +Cynthia Coan +Cyril B Cyrill Osterwalder -Cédric Connes -Cédric Deltheil -D. Flinkmann -Da-Yoon Chung +d4d on hackerone +d912e3 on github +daboul on github Dag Ekengren +Dagfinn Ilmari Mannsåker Dagobert Michelsen +Daiki Ueno +Dair Grant Dambaev Alexander Damian Dixon Damien Adant Damien Vielpeau +Damien Walsh Dan Becker -Dan C Dan Cristian Dan Donahue Dan Fandrich -Dan Jacobson -Dan Locks -Dan McNulty -Dan Nelson -Dan Petitt -Dan Torop -Dan Zitter +Daniel at touchtunes +Dániel Bakai +Daniel Bankhead Daniel Black +Daniel Carpenter Daniel Cater Daniel Egger +Daniel Engberg +Daniel Faust +Daniel Fosco Daniel Gustafsson +Daniel Hallberg Daniel Hwang +Daniel Jeliński +Daniel J. H. Daniel Johnson Daniel Kahn Gillmor +Daniel Katz Daniel Krügler +Daniel Kurečka Daniel Lee Hwang +Daniel Lublin +Daniel Marjamäki +Daniel McCarney Daniel Melani Daniel Mentz +Daniel Pouzzner Daniel Romero Daniel Schauenberg Daniel Seither Daniel Shahaf +Daniel Silverstone Daniel Steinberg Daniel Stenberg +Daniel Szmulewicz Daniel Theron -Daniel at touchtunes +Daniel Valenzuela +Daniel Woelfel +Dan Johnson +Dan Kenigsberg +Dan Locks +Dan McDonald +Dan McNulty +Dan Nelson +Dan Petitt +Dan Rosser +Dan Torop +Dan Zitter Daphne Luong +Darío Hereñú +Dario Nieuwenhuis +Dario Weißer +Darren Banfi Darryl House Darshan Mody -Darío Hereñú +dasimx on github +DasKutti on github +Dave Cottlehuber Dave Dribin Dave Halbakken Dave Hamilton Dave May +Dave Nicolson Dave Reisner Dave Thompson Dave Vasilevsky @@ -342,158 +720,348 @@ David Bau David Benjamin David Binderman David Blaikie +David Bohman David Byron +David Carlier David Cohen +David Cook +David Demelier +David Earl +Davide Cassioli +davidedec on github +Davide Masserut David E. Narváez David Eriksson +David Garske +David Goerger David Houlder +David Hu David Hull -David J Meyer David James +David J Meyer David Kalnischkies David Kierznowski David Kimdon +David L. David Lang David LeBlanc +David Lopes David Lord David McCreedy -David Meyer +David McLaughlin David Odin David Phillips David Rosenstrauch David Ryskalczyk +David Sanderson +David Sardari David Schweikert David Shaw David Strauss +David Suter David Tarendash David Thiel David Walser David Woodhouse David Wright David Yan +Da-Yoon Chung +dbrowndan on github +dEajL3kA on github +Deal(一线灵) +defnull +dekerser on github +deliciouslytyped on github +delogicsreal on github +Demi Marie Obenour +denandz on github +dengjfzh on github Dengminwen +Denis Baručić +Denis Chaplygin Denis Feklushkin +Denis Goleshchikhin +Denis Laxalde +Denis Ollier +Deniz Sökmen Dennis Clarke +Dennis Felsing +dependabot[bot] Derek Higgins +Derek Huang +Derzsi Dániel Desmond O. Chang +destman on github Detlef Schmier +Dexter Gerig +dfdity on github +D. Flinkmann +Dheeraj Sangamkar Didier Brisebourg Diego Bes Diego Casorran +Dietmar Hauser Dilyan Palauzov Dima Barsky +Dima Pasechnik Dima Tisnek Dimitar Boevski Dimitre Dimitrov +Dimitrios Apostolou Dimitrios Siganos Dimitris Sarris Dinar +Diogo Teles Sant'Anna +Dion Williams Dirk Eddelbuettel Dirk Feytons +Dirk Hünniger +Dirkjan Bussink Dirk Manske +Dirk Rosenkranz +Dirk Wetter +Diven Qi +divinity76 on github +Divy Le Ray +dkjjr89 on github +dkwolfe4 on github Dmitri Shubin +Dmitri Tikhonov Dmitriy Sergeyev +dmitrmax on github +Dmitry Atamanov Dmitry Bartsevich Dmitry Eremin-Solenikov Dmitry Falko +Dmitry Karpov Dmitry Kostjuchenko Dmitry Kurochkin +Dmitry Mikhirev Dmitry Popov Dmitry Rechkin Dmitry S. Baikov +Dmitry Tretyakov +Dmitry Wagin +dnivras on github +dogma +DoI Dolbneff A.V Domenico Andreoli +Domen Kožar Dominick Meglio Dominik Hölzl +Dominik Klemba +Dominik Piątkowski +Dominik Thalhammer Dominique Leuenberger +Dongliang Mu +Donguk Kim +Don J Olmstead +Dorian Craps +Doron Behar Doug Kaufman -Doug Porter Douglas Creager Douglas E. Wegscheid Douglas Kilpatrick +Douglas Mencken Douglas R. Horner +Douglas R. Reno Douglas Steinwand +Doug Porter Dov Murik +dpull on github Drake Arconis +dtmsecurity on github Duane Cathey Duncan Mac-Vicar Prett +Duncan Wilcox Dustin Boswell +Dustin Howett Dusty Mabe +Duy Phan Thanh Dwarakanath Yadavalli +dwickr +Dylam De La Torre +Dylan Anthony Dylan Ellicott Dylan Salisbury -Dániel Bakai +eaglegai on github Early Ehlinger +Earnestly on github +Eason-Yu on github +Ebe Janchivdorj +ebejan on github Ebenezer Ikonne -Ed Morley +ed0d2b2ce19451f2 +Eddie Lumpkin +Edgaras Janušauskas Edin Kadribasic +edmcln on github +Edmond Yu +Ed Morley +Edoardo Lolletti Eduard Bloch +Eduard Strehlau Edward Kimmel Edward Rudd Edward Sheldrake Edward Thomson +Edwin Török Eelco Dolstra Eetu Ojanen +eeverettrbx on github Egon Eckert +Egor Pugin +Ehren Bendler Eldar Zaitov +elelel on github +elephoenix on github +Elia Tufarolo +Eli Schwartz +Elliot Killick +Elliot Saba +Elliott Balsley Ellis Pritchard Elmira A Semenova +Elms +Eloy Degen +elsamuko on github +elvinasp on github +emanruse on github Emanuele Bovisio +Emanuele Torre +Emanuel Komínek +Emil Engler +Emiliano Ida +Emilio Cobos Álvarez +Emilio López Emil Lerner +Emil Österlund Emil Romanus -Emiliano Ida Emmanuel Tychon +Enno Boland Enrico Scholz Enrik Berkhan +enWILLYado on github +epicmkirzinger on github +eppesuig Eramoto Masaya Eric Cooper +Eric Curtin +Eric Gallager Eric Hu +Eric Knibbe +Erick Nuwendam Eric Landes Eric Lavigne Eric Lubin Eric Melville Eric Mertens +Eric Murphy +Eric Musser +Eric Norris +Érico Nogueira +Érico Nogueira Rolim Eric Rautman Eric Rescorla Eric Ridge +Eric Rosenquist +Eric Sauvageau Eric S. Raymond Eric Thelin Eric Vergnaud +Eric Vigeant Eric Wong +Eric Wu Eric Young -Erick Nuwendam +Erik Jacobsen Erik Janssen Erik Johansson +Erik Minekus +Erik Olsson +Erik Schnetter +Erik Stenlund Ernest Beinrohr +Ernst Sjöstrand Erwan Legrand Erwin Authried +Esdras de Morais da Silva +Eshan Kelkar +Estanislau Augé-Pujadas +Ethan Alker +Ethan Everett Ethan Glasser Camp +Ethan Wilkes +Etienne Simard Eugene Kotlyarov +Evangelos Foutras Evan Jordan Even Rouault Evert Pot -Evgeny Grin +Evgeny Grin (Karlson2k) Evgeny Turnaev +eXeC64 on github +extrimexxx on github Eygene Ryabinkin +Eylem Ugurel +Fabian Fischer Fabian Frank Fabian Hiernaux Fabian Keil Fabian Ruff +Fabian Vogt +Fabian Yamaguchi +Fabrice Fontaine +Fabrício Canedo Fabrizio Ammollo Fahim Chandurwala +Faizur Rahman +Faraz Fallahi +farazrbx on github +Farzin on github +Fata Nugraha +Fawad Mirza +Fay Stegerman +FC Stegerman +fds242 on github +Federico Bianchi +Federico Pellegrin Fedor Karpelevitch +Fedor Korotkov +feelingseas on github +FeignClaims on github Feist Josselin +Felipe Gasper +Felix Hädicke Felix Kaiser -Felix Yan Felix von Leitner +Felix Yan Feng Tu Fernando Muñoz +Filip Lundgren +Filip Salomonsson +finkjsc on github +Firefox OS +fjaell on github +Flameborn on github Flavio Medeiros +Florian Eckert +Florian Kohnhäuser +Florian Pritz Florian Schoppmann +Florian Van Heghe Florian Weimer +Florin Petriuc Forrest Cahoon Francisco Moraes +Francisco Munoz +Francisco Olarte +Francisco Sedano +François Charlier +François Michel Francois Petitjean +François Rigault +Francois Rivard Frank Denis Frank Gevaerts Frank Hempel @@ -503,25 +1071,48 @@ Frank Meier Frank Ticheler Frank Van Uffelen František Kučera -François Charlier +Frazer Smith +Frederic Lepied +Frederik B +Frederik Wedel-Heinen Fred Machado Fred New Fred Noz -Fred Stluka -Frederic Lepied -Frederik B Fredrik Thulin +Fred Stluka +FuccDucc on github +Fujii Hironori +fullincome on github +fundawang on github +fuzzard +Gabe +Gabriel Corona Gabriel Kuri +Gabriel Marin +Gabriel Simmer Gabriel Sjoberg +Gaelan Steele +Gaël Portay +galen11 on github +Gambit Communications +Ganesh Kamath +Ganesh Viswanathan +gaoxingwang on github Garrett Holmstrom +Garrett Squire Gary Maxwell Gaurav Malhotra Gautam Kachroo Gautam Mani +Gavin Wong Gavrie Philipson Gaz Iqbal -Gaël Portay +gclinch on github +Gealber Morales +Geeknik Labs Geoff Beier +Georeth Zhou +George Liu Georg Horn Georg Huettenegger Georg Lippitsch @@ -529,176 +1120,357 @@ Georg Wicherski Gerd v. Egidy Gergely Nagy Gerhard Herre +Gerome Fournier Gerrit Bruchhäuser +Gerrit Renker Ghennadi Procopciuc Giancarlo Formicuccia Giaslas Georgios -Gil Weber Gilad Gilbert Ramirez Jr. Gilles Blanc +Gilles Vollant +Gil Weber +Giorgos Oikonomou Gisle Vanem +git-bruh on github +GitYuanQu on github Giuseppe Attardi Giuseppe D'Ambrosio Giuseppe Persico +gkarracer on github +Gleb Ivanovsky Glen A Johnson Jr. Glen Nakamura -Glen Scott +Glenn de boer Glenn Sheridan +Glenn Strauss +Glen Scott +godmar on github +Godwin Stewart +Gökhan Şengün +Gonçalo Carvalho Google Inc. Gordon Marler +Gordon Parke Gorilla Maguila +Goro FUJI +Götz Babin-Ebell Gou Lingfeng +Graham Campbell +Graham Christensen Grant Erickson Grant Pannell +graywolf on github Greg Hewgill Greg Morse Greg Onufer +Gregor Jasny +Gregory Jefferis +Gregory Muchka +Gregory Nicholls +Gregory Panakkal +Gregory Szorc Greg Pratt Greg Rowe Greg Zavertnik -Gregory Szorc +Griffin Downs Grigory Entin +Grisha Levit +Gruber Glass Guenole Bescon -Guenter Knauf Guido Berhoerster +Guilherme Puida +Guillaume Algis Guillaume Arluison +guitared on github +Gunamoi Software Gunter Knauf +guoxinvmware on github Gustaf Hui Gustavo Grieco +Gusted +Guy Poizat GwanYeong Kim Gwenole Beauchesne -Gökhan Şengün -Götz Babin-Ebell +Gwen Shapira +h1zzz on github +H3RSKO on github +Hagai Auro +Haibo Huang +Hakan Sunay Halil Hamish Mackenzie -Han Qiao +hammlee96 on github +hamstergene on github Hang Kin Lau Hang Su +Han Han +Hannah Schierling Hannes Magnusson Hanno Böck Hanno Kranzhoff -Hans Steegers +Han Qiao +Hans-Christian Egtvedt +Hans-Christian Noren Egtvedt Hans-Jurgen May +Hans Steegers +Hao Wu Hardeep Singh Haris Okanovic +Harmen Stoppels Harold Stuart +Harry Mallon +Harry Sarson +Harry Sintonen Harshal Pradhan Hauke Duden -He Qin +Haydar Alaidrus +Hayden Roche Heikki Korpela Heinrich Ko Heinrich Schaefer +Helge Klein +Helmut Grohne Helmut K. C. Tessarek Helwing Lutz Hendrik Visage +Henning Schild +Henri Gomez Henrik Gaßmann +Henrik Holst +henrikjehgmti on github Henrik Storner Henry Ludemann +Henry Roeland +He Qin +Hermes Zhang Herve Amblard +HexTheDragon +hgdagon on github +Hide Ishikawa Hidemoto Nakada +highmtworks on github +hiimmat on github +Himanshu Gupta +Hind Montassif +Hiroki Kurosawa +Hirotaka Tagawa Ho-chi Chen Hoi-Ho Chan +Hongfei Li Hongli Lai +Hongyi Zhao +Howard Blaise Howard Chu +hsiao yi +HsiehYuho on github +htasta on github Hubert Kario +Hugh Macdonald +Hugo van Kemenade +humbleacolyte +Huzaifa Sidhpurwala +huzunhao on github +hydra3333 on github Hzhijun +iammrtau on github +Ian Blanes Ian D Allen Ian Fette Ian Ford Ian Gulliver Ian Lynagh +Ian Spence Ian Turner Ian Wilkes +iAroc on github +IcedCoffeee on github +iconoclasthero +icy17 on github Ignacio Vazquez-Abrams Igor Franchuk +Igor Khristophorov +Igor Makarov Igor Novoseltsev Igor Polyakov +Igor Todorovski +Ihor Karpenko +ihsinme on github Iida Yosiaki +Ikko Ashimine Ilguiz Latypov Ilja van Sprundel +Illarion Taev +illusory-dream on github +Ilmari Lauhakangas +Ilya Kosarev +imilli on github Immanuel Gregoire +ImpatientHippo on github Inca R +infinnovation-dev on github Ingmar Runge Ingo Ralf Blum Ingo Wilken +Inho Oh +Int64x86 on github +Ionuț-Francisc Oancea Irfan Adilovic +Ironbars13 on github +Irving Wolfe Isaac Boukris +Isaiah Norton Ishan SinghLevett +İsmail Dönmez +Ithubg on github +Ivan Ivan Avdeev +ivanfywang +Ivan Kuchin +IvanoG on github +Ivan Tsybulin Ivo Bellin Salarin -Jack Zhang +iz8mbw on github Jackarain on github +JackBoosY on github +Jack Boos Yu Jacky Lam +Jack Zhang +Jacob Barthelmeh +Jacob Champion +Jacob Hoffman-Andrews +Jacob Mealey Jacob Meuser Jacob Moshenko +Jacob Tolar Jactry Zeng Jad Chamcham Jaime Fullaondo +Jake Yuesong Li +jakirkham on github +Jakob Hirsch +Jakub Bochenski +Jakub Jelen Jakub Wilk Jakub Zakrzewski +James Abbatiello James Atwill +James Brown James Bursa James Cheng James Clancy James Cone James Dury +James Fuller James Gallagher James Griffiths James Housley +James Keast +James Knight +James Le Cuirot +James Lucas James MacMillan James Slaughter Jamie Lokier Jamie Newton Jamie Wilkinson Jan Alexander Steffens +JanB on github +Jan Chren +janedenone on github Jan Ehrhardt +Jan Engelhardt Jan Koen Annot +janko-js on github Jan Kunder +Jan Macku +Jan Mazur +Janne Blomqvist +Janne Johansson +János Fekete +Jan-Piet Mens Jan Schaumann Jan Schmidt Jan Van Boghout +Jan Venekamp +Jan Verbeek Jared Jennings Jared Lundell Jari Aalto Jari Sundell +jasal82 on github +Jason Baietto Jason Glasgow +Jason Hood +Jason Juang +Jason Lee Jason Liu Jason McDonald Jason S. Priebe Javier Barroso +Javier Blazquez Javier G. Sogo +Javier Navarro Javier Sixto Jay Austin +Jay Dommaschk Jayesh A Shah +Jay Guerette +Jay Wu Jaz Fresh -Jean Gressmann -Jean Jacques Drouin +JazJas on github +jbgoog on github +J. Bromley +Jean-Christophe Amiel Jean-Claude Chauve +Jean Fabrice Jean-Francois Bertrand Jean-Francois Durand +Jean Gressmann +Jean Jacques Drouin Jean-Louis Lemaire Jean-Marc Ranger Jean-Noël Rouvignac Jean-Philippe Barrette-LaPierre +Jean-Philippe Menil Jeff Connelly Jeff Hodges Jeff Johnson Jeff King Jeff Lawson +Jeff Luszcz +Jeff Mears Jeff Phillips Jeff Pohlmeyer -Jeff Weber +Jeffrey Tolar Jeffrey Walton +jeffrson on github +Jeff Weber +Jelle van der Waa +Jenny Heino +Jens Finkhaeuser Jens Rantil +Jens Schleusener +Jeremie Rapin +Jeremy Drake +Jeremy Falcon Jeremy Friesner Jeremy Huddleston +Jeremy Lainé Jeremy Lin +Jeremy Maitin-Shepard Jeremy Pearson +Jérémy Rabasco +Jérémy Rocher Jeremy Tan +Jeremy Thibault Jeroen Koekkoek Jeroen Ooms +Jérôme Leclercq +Jerome Mao Jerome Muffat-Meridol Jerome Robert +Jerome St-Louis Jerome Vouillon Jerry Krinock Jerry Wu @@ -707,37 +1479,80 @@ Jesper Jensen Jesse Chisholm Jesse Noller Jesse Tan +Jess Lowe +Jesus Malo Poyatos +jethrogb on github +jhoyla on github +Jiacai Liu +Jiang Wenjian +Jiawen Geng Jie He +Jiehong on github +Jilayne Lovejoy +Jim Beveridge Jim Drash Jim Freeman +Jim Fuller Jim Hollinger +Jim King Jim Meyering +Jimmy Gaussen +Jimmy Sjölund +Jiří Bok Jiri Dvorak Jiri Hruska Jiri Jaburek Jiří Malák +Jiri Stary +Jishan Shaikh +Jiwoo Park +Jixinqi +jkamp-aws on github +jmdavitt on github +jnbr on github Jocelyn Jaubert +Jochem Broekhoff +Jochen Sprickerhof +Joe Birr-Pixton +Joe Cise Joe Halpin -Joe Malicki -Joe Mason +JoelAtWisetech on github Joel Chen Joel Depooter +Joel Jakobsson +Joel Teichroeb +Joe Malicki +Joe Mason +joey-l-us on github Jofell Gallardo Johan Anderson +Johan Eliasson Johan Lantz -Johan Nilsson -Johan van Selst +Johann150 on github Johannes Bauer Johannes Ernst +Johannes G. Kristinsson +Johannes Lesr Johannes Schindelin +Johan Nilsson +Johann Sebastian Schicho +Johan van Selst +John A. Bristor +John Bampton John Bradshaw +John Butterfield John Coffey John Crow John David Anglin +John DeHelian John Dennis John Dunn John E. Malmberg John Gardiner Myers +John Hascall +John Haugabook +John Hawthorn +John H. Ayad John Janssen John Joseph Bachir John Kelly @@ -746,518 +1561,1118 @@ John Lask John Levon John Lightsey John Marino +John-Mark Bell John Marshall John McGowan +Johnny Luong John P. McCaskey +John Porter +John Schroeder +John Sherrill +John Simpson +John Starks John Suprock +John V. Chow +John Walker John Wanghui +John Weismiller John Wilkinson -John-Mark Bell -Johnny Luong -Jon DeVree -Jon Grubbs -Jon Nelson -Jon Sargeant -Jon Seymour -Jon Spencer -Jon Torrey -Jon Travis -Jon Turner +Jojojov on github +Jonas Bülow Jonas Forsman +Jonas Haag Jonas Minnberg Jonas Schnelli +Jonas 'Sortie' Termansen +Jonas Vautherin Jonatan Lander Jonatan Vela Jonathan Cardoso Machado -Jonathan Cardoso Machado Machado Jonathan Hseu +Jonathan Matthews +Jonathan Moerman Jonathan Nieder +Jonathan Perkin +Jonathan Rosa +Jonathan Watt +Jonathan Wernberg +Jon DeVree Jongki Suwandi +Jon Grubbs +Jon Johnson Jr +Jon Nelson +jonny112 on github +Jon Rumsey +Jon Sargeant +Jon Seymour +Jon Spencer +Jon Torrey +Jon Travis +Jon Turner +Jon Wilkes +Joombalaya on github Joonas Kuorilehto +Jordan Brown +Jörg Mueller-Tolk +Jörn Hartroth Jose Alf -Jose Kahan Josef Wolf +José Joaquín Atria +Jose Kahan +Joseph Chen +Joseph Tharayil +Josh Bialkowski +Josh Brobst +joshhe on github +Joshix-1 on github Josh Kapell +Josh McCullough +Josh Soref Joshua Kwan +Joshua Root +Joshua Swink +Josie Huddleston +Josip Medved Josue Andrade Gomes Jozef Kralik Juan Barreto +Juan Cruz Viotti Juan F. Codagnone Juan Ignacio Hervás Juan RP Judson Bishop +Juergen Hoetzel Juergen Wilke Jukka Pihl +Julian K. +Julian Montes Julian Noble Julian Ospald +Julian Romero Nieto Julian Taylor +Julian Z Julien Chaffraix Julien Nabet Julien Royer +Juliusz Sosinowicz +jungle-boogie on github +Junho Choi Jun-ichiro itojun Hagino +junsik on github +Jun Tseng +Jun-ya Kato +Jürgen Gmach Jurij Smakov +jurisuk on github +Juro Bystricky +JustAnotherArchivist on github +justchen1369 on github Justin Clift Justin Ehlert Justin Fletcher Justin Karneges Justin Maggard -János Fekete -Jörg Mueller-Tolk -Jörn Hartroth -K. R. Walker +Justin Steventon +jveazey on github +jvreelanda on github +jvvprasad78 on github +jzinn on github +ka7 on github +Kadambini Nema +Kael1117 on github Kai Engert +Kailun Qin Kai Noda +Kai Pastor Kai Sommerfeld Kai-Uwe Rommel Kalle Vahlman +kalvdans on github Kamil Dudka -Kang Lin +Kane York Kang-Jin Lee +Kang Lin +Kantanat Wannapaka +Kareem +Kari Pahula +Karl Chen Karl Moerder Karol Pietrzak +Kartatz on github +Karthik Dasari +Karthikdasari0423 on github +Kartik Mahajan Kaspar Brand Katie Wang +Katsuhiko YOSHIDA +kayrus on github Kazuho Oku +kchow-FTNT on github +Keerthi Timmaraju Kees Cook +Kees Dekker +Keitagit-kun on github Keith MacDonald Keith McGuigan Keith Mok +Kelly Kaoudis +Ken Brown Ken Hirsch -Ken Rastatter +Kenneth Davidson +Kenneth Myhra Kenny To +Keno Fischer +Ken Rastatter Kent Boortz +Kerem Kat Keshav Krity +Kevin Adler Kevin Baughman +Kevin Burke +Kevin Daudt Kevin Fisk Kevin Ji Kevin Lussier +Kevin R. Bulgrien Kevin Reed Kevin Roth +Kevin Ryan Kevin Smith +Kevin Sun +Kevin Ushey +Kev Jackson Kim Minjoong +Kimmo Kinnunen Kim Rinnewitz Kim Vandry -Kimmo Kinnunen +kirbyn17 on hackerone +Kirill Efimov +Kirill Marchuk +Kirill Obukhov +kit-ty-kate on github Kjell Ericson Kjetil Jacobsen +kkalganov on github +Klaus Crusius +Klaus Stein Klevtsov Vadim +Kobi Gurkan +Koen Dergent +Koichi Shiraishi +kokke on github Konstantin Isakov -Kris Kennaway +Konstantin Kushnir +Konstantin Kuzov +Konstantin Vlasov +KotlinIsland on github +kotoriのねこ +koujaz on github +kouzhudong on github +Kovalkov Dmitrii +kpcyrd on github +kreshano on github Krishnendu Majumdar +Kris Kennaway Krister Johansen Kristian Gunstone Kristian Köhntopp +Kristian Mide Kristiyan Tsaklev +Kristoffer Gleditsch +kriztalz +K. R. Walker +Kuan-Wei Chiu +Kunal Chandarana +Kunal Ekawde Kurt Fankhauser +Kushal Das +Kvarec Lezki +kwind on github +Kwon-Young Choi +Kyle Abramowitz +kyled-dell on github +Kyle Edwards Kyle J. McKay Kyle L. Huff Kyle Sallee +Kyohei Kadota Kyselgov E.N +l00p3r on Hackerone Lachlan O'Dea +Ladar Levison +Lance Ware +Laramie Leavitt Larry Campbell Larry Fahnoe Larry Lin Larry Stefani Larry Stone Lars Buitinck +Lars Francke Lars Gustafsson Lars J. Aas Lars Johannesen +Lars Karlitski +Lars Kellogg-Stedman Lars Nilsson Lars Torben Wilson -Lau Hang Kin +Lau +Laurent Bonnans +Laurent Dufresne +Laurențiu Nicola Laurent Rabret +Laurie Clark-Michalek Lauri Kasanen +Lawrence Gripper +Lawrence Matthews Lawrence Wagerfield +Leah Neukirchen +Lealem Amedie +Leandro Coutinho +Lee Li +LeeRiva Legoff Vincent Lehel Bernadt Leif W +Leigh Purdie Leith Bade -Len Krause Lenaic Lefever +Len Krause +Len Marinaccio Lenny Rachitsky -Leon Winter Leonardo Rosati +Leonardo Taccari +Leon Breedt +Leo Neat +Leon Timmermans +Leon Winter +Leszek Kubik +lf- on github Liam Healy +Liam Warfield +LigH-de on github +lijian996 on github Lijo Antony +lilongyan-huawei on github Linas Vepstas Lindley French Ling Thio +Linos Giannopoulos +Lin Sun +Linus Lewandowski Linus Nielsen Feltzing Linus Nordberg Lior Kaplan Lisa Xu +Litter White Liviu Chircu +Li Xinwei Liza Alenchery +lizhuang0630 on github +lkordos on github +lllaffer on github Lloyd Fournier Lluís Batlle i Rossell +locpyl-tidnyd on github +Loganaden Velvindron +Logan Buth Loic Dachary +Loïc Yhuel +lolbinarycat on github +lomberd2 on github +LoRd_MuldeR Loren Kirkby +Lorenzo Miniero +Louis Solofrizzo +lRoccoon on github Luan Cestari +Luật Nguyễn Luca Altea +Luca Boccassi +Luca Kellermann +Luca Niccoli Lucas Adamski +Lucas Clemente Vella +Lucas Holt +Lucas Nussbaum Lucas Pardue +Lucas Servén Marín +Lucas Severo +Lucien Zürcher Ludek Finstrle Ludovico Cavedon Ludwig Nussel Lukas Ruzicka +Lukas Tribus +Lukáš Zaoral Lukasz Czekierda +Łukasz Domeradzki +lukaszgn on github Luke Amery Luke Call Luke Dashjr +Luke Granger-Brown +Luke Hamburg +Luke Wilde +luminixinc on github Luo Jinghua Luong Dinh Dung -Luật Nguyễn +Luz Paz +lwthiker on github +Lyman Epp Lyndon Hill +Maarten Billemont +Maciej Domanski Maciej Karpiuk Maciej Puzio Maciej W. Rozycki +MacKenzie +madblobfish on github +MaeIsBad on github +magisterquis on hackerone Mahmoud Samir Fayed -Maks Naumov +Maksim Arhipov Maksim Kuzevanov +Maksim Ściepanienka Maksim Stsepanenka +Maks Naumov +Maksymilian Arciemowicz +Malik Idrees Hasan Khan Mamoru Tasaka +Mamta Upadhyay Mandy Wu Manfred Schwarb +Manuel Einfalt Manuel Massing +Manuel Strehl +Manuj Bhatia Marc Aldorasi +Marc-Antoine Perennou Marc Boucher Marc Deslauriers Marc Doughty -Marc Hesse -Marc Hörsken -Marc Kleine-Budde -Marc Renault -Marc-Antoine Perennou -Marcel Raad -Marcel Roelofs +Marcel Hernandez +Marcel Lang Marcelo Echeverria Marcelo Juchem +Marcel Raad +Marcel Roelofs +marc-groundctl on github +Marc Hesse +Marc Hörsken Marcin Adamski Marcin Gryszkalis Marcin Konicki +Marcin Rataj +Marc Kleine-Budde Marco Deckel Marco G. Salvagno +Marco Kamner Marco Maggi +Marcos Diazr +marcos-ng on github +Marc Renault +Marc Schlatter Marcus Hoffmann +Marcus Klein +Marcus Müller Marcus Sundberg +Marcus T Marcus Webster +Margu +Marian Klymov +Marin Hannache Mario Schroeder +Marius Albrecht +Marius Kleidl Mark Brand Mark Butler Mark Davies -Mark Eichin +Mark Dodgson +Mark Gaiser Mark Hamilton +Mark Huang Mark Incley +Mark Itzcovitz Mark Karpeles Mark Lentczner Mark Nottingham +Mark Phillips +Mark Roszko Mark Salisbury +Mark Seuffert +Mark Sinkovics Mark Snelling +Mark Swaanenburg Mark Tully Markus Duft Markus Elfring Markus Koetter Markus Moeller Markus Oberhumer +Markus Olsson +Markus Sommer +Markus Unterwaditzer Markus Westerlind +Mark W. Eichin +Mark Wotton +Maros Priputen Marquis de Muesli +marski on github Martijn Koster +Martin Ågren +Martin Ankerl +Martin Bašti Martin C. Martin +Martin D'Aloia +Martin Dorey Martin Drasar +Martin Dreher +martinevsky Martin Frodl +Martin Galvan +Martin Gartner Martin Hager +Martin Halle +Martin Harrigan Martin Hedenfalk +Martin Howarth Martin Jansen +Martin Kammerhofer Martin Kepplinger Martin Lemke +Martin Peck +Martin Schmatz Martin Skinner +Martin Staael Martin Storsjö +Martin Strunz +Martin V Martin Vejnár +Martin Waleczek +Martxel Marty Kuhrt Maruko +Marwan Yassini +Masaya Suzuki +masbug on github +Massimiliano Fantuzzi Massimiliano Ziccardi Massimo Callegari +MasterInQuestion on github +Master Inspire Mateusz Loskot +Mathew Benson Mathias Axelsson +Mathias Fuchs +Mathias Gumz +Mathieu Carbonneaux +Mathieu Garaud +Mathieu Legare +Matias N. Goldberg Mats Lidell +Mats Lindestam Matt Arsenault -Matt Ford -Matt Kraai -Matt Veenstra -Matt Witherspoon -Matt Wixson -Matteo B. +Matteo Baccan +Matteo Bignotti +Matteo Bignottignotti Matteo Rocco +Matt Ford Matthew Blain Matthew Clarke Matthew Hall +Matthew Kerwin +Matthew Thompson +Matthew Whitehead Matthias Bolte +Matthias Gatto +Matthias Naegler +Matthieu Baerts +Matt Holt +Mattias Fornander +Matt Jolly +Matt Kraai +Matt McClure +Matt Veenstra +Matt Witherspoon +Matt Wixson +Matus Uzak +mauke Maurice Barnum +Maurício Meneghini Fauth +Mauricio Scheffer Mauro Iorio Mauro Rappa Max Dymond -Max Katsev -Max Khon +Max Eliaser +Max Faxälv +Maxim Dzhura +Maxime Larocque +Maxime Legros Maxim Ivanov Maxim Perenesenko Maxim Prohorov -Maxime Larocque +Max Katsev +Max Kellermann +Max Khon +Max Mehl +Max Peal +Max Savenkov +Max Zettlmeißl +mbeifuss on github +mccormickt12 on github +Median Median Stride +mehatzri on github Mehmet Bozkurt Mekonikum Melissa Mears +Melroy van den Berg +Mel Zuser +Mert Yazıcıoğlu Mettgut Jamalla +Micah Snyder +Michael Afanasiev +Michael Anti +Michael Baentsch Michael Benedict +Michael Brehm +Michael Brown Michael Calmer Michael Cronenworth Michael Curtis Michael Day +Michael Drake +Michael Felt +Michael Forney +Michael Gmelin Michael Goffioul +Michael Heimpold +Michael Hordijk Michael Jahn Michael Jerris Michael Kalinin Michael Kaufmann +Michael Kilburn +Michael Kolechkin Michael König +Michael Kujawa +Michael Lee +Michael Litwak Michael Maltese Michael Mealling Michael Mueller +Michael Musset +Michael O'Farrell +Michael Olbrich Michael Osipov +Michael Schmid +Michael Schuster Michael Smith Michael Stapelberg +Michael Steuer Michael Stillwell +Michael Trebilcock +Michael Vittiglio Michael Wallner +Michał Antoniak Michal Bonino -Michal Marek +Michal Čaplygin Michał Fita Michał Górny +Michał Janiszewski Michał Kowalczyk +Michal Marek +Michał Petryka Michał Piechowski -Michel Promonet +Michal Rus +Michal Trybus Michele Bini +Michel Promonet Miguel Angel Miguel Diaz +migueljcrum on github Mihai Ionescu Mikael Johansson Mikael Sennerholm +Mikalai Ananenka Mike Bytnar Mike Crowe Mike Dobbs +Mike Dowell +Mike Duglas +Mike Frysinger +Mike Gelfand Mike Giancola Mike Hasselberg Mike Henshaw Mike Hommey Mike Mio +Mike Norton Mike Power Mike Protts Mike Revi +Mike Tzou +Mikhail Kuznetsov Miklos Nemeth +Milon Renatus Miloš Ljumović Mingliang Zhu +Mingtao Yang Miroslav Franc Miroslav Spousta +Mischa Salle Mitz Wark +mkzero on github +modbw on github +Mohamed Daahir Mohamed Lrhazi +Mohamed Osama Mohammad AlSaleh +Mohammad Hasbini +Mohammadreza Hendiani +Mohammed Naser +Mohammed Sadiq Mohun Biswas +momala454 on github +Momoka Yamamoto +MonkeybreadSoftware on github +Montg0mery on github +moohoorama on github +Morgan Willcock +Moritz +Moritz Buhl +Moritz Knüsel +Morten Minde Neergaard Mostyn Bramley-Moore Moti Avrahami +MrdUkk on github +MrSorcus on github +M.R.T on github +mschroeder-fzj on github +Muhammad Herdiansyah +Muhammad Hussein Ammari +Muhammed Yavuz Nuzumlalı +Murugan Balraj +musvaage on github +Muz Dima Myk Taylor +n0name321 on github Nach M. S. Nagai H -Nathan Coulter -Nathan O'Sullivan +naost3rn on github +Nao Yonashiro +Natanael Copa +Nate Prewitt Nathanael Nerode +Nathan Coulter +Nathaniel J. Smith +Nathaniel R. Lewis Nathaniel Waisbrot +Nathan Moinvaziri +Nathan O'Sullivan +na-trium-144 on github Naveen Chandran Naveen Noel +Neal McBurnett Neal Poole +nedres on github +neex on github Nehal J Wani +neheb on github Neil Bowers Neil Dunbar +Neil Horman +Neil Johari Neil Kolban Neil Spring -Nic Roets +NeimadTL +nekopsykose on github +Nemos2024 on github +neutric on github +nevv on HackerOne/curl +newfunction +newfunction on hackerone +Niall McGee +Niall O'Reilly +nian6324 on github +nianxuejie on github Nicholas Maniscalco +Nicholas Nethercote +Nick Banks +Nick Coghlan Nick Draffen Nick Gimbrone Nick Humfrey +Nicklas Avén Nick Miyake +nick-telia on github Nick Zitzmann +nico-abram on github Nico Baggus Nicolas Berloquin Nicolas Croiset +Nicolas F. Nicolas François +Nicolas George +Nicolas Grekas +Nicolas Guillier Nicolas Morey-Chaisemartin +Nicolas Noben +Nicolás Ojeda Bär +Nicolás San Martín +Nicolas Sterchele +Nico Rieck +Nic Roets +Niels Martignène Niels van Tongeren +Nigel Brittain Nikita Schmidt +Nikita Taranov Nikitinskit Dmitriy Niklas Angebrand +Niklas Hambüchen Nikolai Kondrashov Nikos Mavrogiannopoulos +Nikos Tsipinakis +Nils Goroll +nimaje on github +niner on github Ning Dong +NINIKA +Niracler Li +Niranjan Hasabnis Nir Soffer Nis Jorgensen +nk +Noam Moshe +nobedee on github +NobodyXu on github Nobuhiro Ban Nodak Sodak +nono303 on github +nopjmp on github Norbert Frese Norbert Kett +norbertmm on github Norbert Novotny +nosajsnikta on github +NTMan on github +Nuru on github Octavio Schroeder +odek86 on github Ofer +ohyeaah on github Okhin Vasilij -Ola Mork Olaf Flebbe +Olaf Hering Olaf Stüben +Ola Mork +Oleg Jukovec Oleg Pudeyev +Oleguer Llopart +Olen Andoni +olesteban on github Oli Kingshott +Oliver Chang Oliver Gondža Oliver Graute Oliver Kuckertz +oliverpool on github +Oliver Roberts Oliver Schindler +Oliver Urbann Olivier Berger +Olivier Bonaventure Olivier Brunel +Omar Ramadan +omau on github +Ondřej Hlavatý +Ondřej Koláček +opensignature on github +opensslonzos-github on github +Ophir Lojkine Orange Tsai Oren Souroujon Oren Tirosh Orgad Shaneh Ori Avtalion +orycho on github +osabc on github +Osaila on github +Osama Albahrani Oscar Koeroo Oscar Norlander -P R Schaffner +Oskar Liljeblad +Oskar Sigvardsson +Oumph on github +Outvi V +ovidiu-benea on github +Ozan Cansel +Pablo Busse Palo Markovic +pandada8 on github +Paolo Mossino Paolo Piacentini Paras Sethia +parazyd on github Pascal Gaudette Pascal Terjan Pasha Kuznetsov Pasi Karkkainen +patelvivekv1993 on github +patnyb on github Pat Ray Patrice Guerin Patricia Muscalu Patrick Bihan-Faou +Patrick Dawson Patrick McManus Patrick Monnerat Patrick Rapin +Patrick Schlangen Patrick Scott Patrick Smith +Patrick Steinhardt +Patrick Stoeckle Patrick Watson Patrik Thunstrom Pau Garcia i Quiles +Paul B. Omta Paul Donohue +Paul Dreik +Paul Gilmartin +Paul Groke Paul Harrington Paul Harris +Paul Hoffman Paul Howarth +Paul Johnson Paul Joyce Paul Marks Paul Marquis Paul Moore Paul Nolan Paul Oliver +Paulo Roberto Tomasi Paul Querna Paul Saab +Paul Seligman +Paul Vixie +Paul Wise Pavel Cenek +Pavel Gushchin +Pavel Kalyugin +Pavel Kropachev +Pavel Löbl +Pavel Mayorov Pavel Orehov -Pavel P +Pavel Pavlov Pavel Raiskup Pavel Rochnyak +Pavel Volgarev +Pavol Markovic Pawel A. Gajda Pawel Kierski +Paweł Kowalski +Paweł Wegner +Paweł Witas +PBudmark on github +Pedro Henrique Pedro Larroy +Pedro Monreal Pedro Neves +pendrek at hackerone +Peng Li +Peng-Yu Chen +Per Jensen +Per Lundberg Per Malmberg +Per Nilsson +Pete Cordell +Pete Lomax Peter Bray Peter Forret Peter Frühberger Peter Gal +Peter Goodman Peter Heuchert Peter Hjalmarsson +Pēteris Caune +Peteris Krumins +Peter Kokot +Peter Körner Peter Korsgaard +Peter Krefting Peter Lamare Peter Lamberg Peter Laser +Peter Marko Peter O'Gorman Peter Pentchev +Peter Piekarski Peter Silva +Peter Simonyi Peter Su +Peter Sumatra Peter Sylvester Peter Todd +Peter Varga Peter Verhas Peter Wang Peter Wu Peter Wullinger -Peteris Krumins Petr Bahula Petr Novak Petr Pisar +Petr Štetiar +Petr Voytsik Phil Blundell Phil Crump -Phil Karn -Phil Lisiecki -Phil Pellouchoud +Phil E. Taylor +Philip Chan Philip Craig Philip Gladstone +Philip Heiduck Philip Langdale +Philippe Antoine +Philippe Antoine on HackerOne Philippe Hameau +Philippe Marguinaud +Philipp Engel Philippe Raoult Philippe Vaucher +Philipp Klaus Krause +Philip Prindeville +Philipp Waehnert +Philip Sanetra +Phil Karn +Phil Lisiecki +Phil Pellouchoud Pierre Pierre Brico Pierre Chapuis +Pierre-Etienne Meunier Pierre Joye +Pierre Yager Pierre Ynard +Pierre-Yves Bigourdan +Pierrick Charron Piotr Dobrogost +Piotr Komborski +Piotr Nakraszewicz +PleaseJustDont +Po-Chuan Hsieh +Pontakorn Prasertsuk +Pontus Lundkvist Pooyan McSporran +Poul T Lomholt Pramod Sharma Prash Dush Praveen Pvs +Prithvi MK +privetryan on github Priyanka Shah +ProceduralMan on github +promptfuzz_ on hackerone +Pronyushkin Petr +prpr19xx on github +P R Schaffner +Przemysław Tomaszewski +pszemus on github +pszlazak on github +puckipedia on github Puneet Pawaia +qhill +qhill on github +qiandu2006 on github +Qriist on github Quagmire Quanah Gibson-Mount +Quentin Balland Quinn Slack -R. Dennis Steed +Radek Brich +Radek Zajic +Radoslav Georgiev +Radu Hociung Radu Simionescu -Rafa Muyo Rafael Antonio +Rafaël Carré Rafael Sagula +Rafał Mikrut +Rafa Muyo Rafayel Mkrtchyan -Rafaël Carré +Rahul Krishna M Rainer Canavan Rainer Jung Rainer Koenig Rainer Müller +RainRat +Raito Bezarius Rajesh Naganathan Rajkumar Mandal +Ralf A. Timmermann +ralfjunker on github Ralf S. Engelschall Ralph Beckmann +Ralph Langendam Ralph Mitchell -Ramana Mokkapati +Ralph Sennhauser +Ramiro Garcia +Ram Krushna Mishra +rampageX on github +ramsay-jones on github +RanBarLavie on github +Randall S. Becker +Randolf J Randy Armstrong Randy McMurchy +Ran Mozes +Raphael Gozzo +r-a-sattarov on github +Rasmus Melchior Jacobsen +Rasmus Thomsen +Raul Onitza-Klugman Ravi Pratap Ray Dassen Ray Pekowski Ray Satiro Razvan Cojocaru +Razvan Pricope +rcombs on github +R. Dennis Steed +Red Hat Product Security +Reed Loden Reinhard Max Reinout van Schouwen +RekGRpth on github +Remco van Hooff Remi Gacogne Remo E +Rémy Léone Renato Botelho +Renaud Allard Renaud Chaillat Renaud Duhaut Renaud Guillard Renaud Lehoux Rene Bernhardt Rene Rebe +renovate[bot] +renovate[bot] Reuven Wachtfogel +RevaliQaQ on github Reza Arbab +Rianov Viacheslav +riastradh on github Ricardo Cadime -Rich Burridge -Rich Gray -Rich Rauenzahn +Ricardo Gomes +Ricardo Martins +Ricardo M. Correia +Richard Adams +Richard Alcock Richard Archer Richard Atterer +Richard Bowker Richard Bramante Richard Clayton Richard Cooper @@ -1265,197 +2680,451 @@ Richard Gorton Richard Gray Richard Hosking Richard Hsu +Richard Levitte +Richard Marion Richard Michael Richard Moore Richard Prescott Richard Silverman Richard van den Berg +Richard Whitehouse +Richard W.M. Jones +Rich Burridge +Rich FitzJohn +Rich Gray +Rich Mirch +Rich Rauenzahn +Rich Salz +Rich Turner Richy Kim +Rici Lake +Rickard Hallerbäck +Rick Deist +Ricki Hirner Rick Jones +Rick Lane Rick Richardson -Ricki Hirner +Rick Welykochy +Ricky Leverence +Ricky-Tigg on github +RiderALT on github Rider Linden +Rikard Falkeborn +rilysh +Rinku Das +rl1987 on github +rmg-x on github +Rob Boeckermann +RobBotic1 on github +Robby Simpson +Rob Cotrone Rob Crittenden Rob Davies -Rob Jones -Rob Sanders -Rob Stanzel -Rob Ward +Rob de Wit Robert A. Monat Robert B. Harris +Robert Brose +Robert Charles Muir +Robert Dunaj Robert D. Young Robert Foreman Robert Iakobashvili +Robert Kolcun +Robert Linden +Robert Maynard +Robert Moreton Robert Olson +Robert Prag +Robert Ronto Robert Schumann +Robert Simpson +Robert Southee Robert Weaver Robert Wruck +Robin A. Meade Robin Cornelius +Robin Douine Robin Johnson Robin Kay +Robin Marx +Rob Jones +Rob Sanders Robson Braga Araujo -Rod Widdowson +Rob Stanzel +Rob Ward +Rodger Combs Rodney Simmons Rodric Glaser Rodrigo Silva +Rod Widdowson Roger Leigh +Roger Orr +Roger Young Roland Blom +Roland Hieber Roland Krikava Roland Zimmermann +Rolf Eike Beer Rolland Dudemaine Romain Coltel +Romain Fliedel +Romain Geissler +romamik om github Roman Koifman Roman Mamedov +Roman Zharkov Romulo A. Ceccon +Ronald Crane +Ronan Pigott Ron Eldor +Ronnie Mose Ron Parker Ron Zapp -Ronnie Mose +Rosen Penev Rosimildo da Silva +Ross Burton +roughtex on github +Roy Bellingan +Roy Li Roy Shan +RubisetCie on github +Rudi Heitbaum +Rui LIU +Rui Pinheiro Rune Kleveland +Ruslan Baratov Ruslan Gazizov +Rutger Broekhoff Rutger Hofman +Ruurd Beerstra +rwmjones on github +Ryan Beck-Buysse Ryan Braud +ryancaicse on github +Ryan Carsten Schmidt Ryan Chan +Ryan Hooper +Ryan Mast Ryan Nelson Ryan Schmidt Ryan Scott +Ryan Sleevi Ryan Winograd Ryuichi KAWAMATA -Rémy Léone -S. Moonesamy -SBKarr on github +rzrymiak on github +s0urc3_ on hackerone +saimen +Sai Ram Kunala Salah-Eddin Shaban +Saleem Abdulrasool +SaltyMilk Salvador Dávila Salvatore Sorrentino +Samanta Navarro Sam Deane Sam Hurst +Sam James +Sam Jessup +Sampo Kellomaki Sam Roth Sam Schanken -Sampo Kellomaki +Samuel Chiang Samuel Díaz García +Samuel Dionne-Riel +Samuel Henrique Samuel Listopad +Samuel Marks +Samuel Surtees Samuel Thibault +Samuel Tranchet +SandakovMM on github Sander Gates Sandor Feldi +Sandro Jaeckel +Sanjay Pujare Santhana Todatry +Santino Keupp Saqib Ali Sara Golemon +Sarah Gooding Saran Neti Sascha Swiercy +Sascha Zengler +Satadru Pramanik +Satana de Sant'Ana Saul good +saurabhsingh-dev on github Saurav Babu +sayrer on github +sbernatsky on github +SBKarr on github +SC404 +Scarlett McAllister Scott Bailey Scott Barrett Scott Cantor Scott Davis Scott McCreary +Scott Mutter +Scott Talbert +sd0 on hackerone Sean Boudreau Sean Burford +Sean MacLennan +Sean McArthur +Sean Miller +Sean Molenaar +Sebastiaan van Erk +Sebastian Andersson +Sebastian Haglund Sebastian Mundry +Sebastian Neubauer Sebastian Pohlschmidt Sebastian Rasmussen +Sebastian Sterk +Sebastian Walz +Sébastien Helleu +Sébastien Willemijns +selmelc on hackerone +SendSonS on github Senthil Raja Velu Sergei Kuzmin Sergei Nikulov +Sergey +Sergey Alirzaev +Sergey Bronnikov +Sergey Fionov +Sergey Markelov +Sergey Ogryzkov +Sergey Ryabinin Sergey Tatarincev +Sergii Kavunenko Sergii Pylypenko Sergio Ballestrero +Sergio Barresi +Sergio Borghese +Sergio Durigan Junior +Sergio-IME on github +Sergio Mijatovic +sergio-nsk on github Serj Kalichev +Sertonix +SerusDev on github Seshubabu Pasam Seth Mos -Sh Diao +Sevan Janiyan +sfan5 on github +Sgharat on github Shachaf Ben-Kiki +ShadowZzj on github +Shailesh Kapse +Shankar Jadhavar Shao Shuchao Sharad Gupta Shard +Sharon Brizinov +Shaun Jackman +Shaun Mirani Shawn Landden Shawn Poulson +Sh Diao +Sheshadri.V +Shikha Sharma Shine Fan +Shiraz Kanga +shithappens2016 on github +Shlomi Fish Shmulik Regev +Shohei Maeda Siddhartha Prakash Jain +siddharthchhabrap on github Sidney San Martín Siegfried Gyuricsko +silveja1 on github +Simon Berger +Simon Chalifoux Simon Dick Simon H. Simon Josefsson +Simon K +Simon Legner Simon Liu Simon Warta +simplerobot on github +Sinkevich Artem +Siva Sivaraman +Slaven Rezić +SLDiggie on github +Smackd0wn on github +S. Moonesamy +smuellerDD on github +sn on hackerone +sofaboss on github +Sohom Datta +Somnath Kundu Song Ma Sonia Subramanian +Sören Tempel +southernedge on github Spacen Jasset +Spezifant on github Spiridonoff A.V +Spoon Man Spork Schivago +ssdbest on github +sspiri on github +sstruchtrup on github Stadler Stephan -Stan van de Burgt +Stan Hu Stanislav Ivochkin +Stanislav Lange +Stanislav Zidek +Stanley Wucw +Stan van de Burgt +Stathis Kapnidis +Stav Nir +steelman on github +Stefan Agner Stefan Bühler Stefan Eissing Stefan Esser +Stefan Grether +Stefan Huber Stefan Kanthak +Stefan Karpinski Stefan Krause +Štefan Kremeň Stefan Neis +Stefano Simonelli +Stefan Strogin +Stefan Talpalaru Stefan Teleman Stefan Tomanek Stefan Ulrich +Stefan Yohansson +Steffen Kieß Steinar H. Gunderson +steini2000 on github +Stepan Broz +Stepan Efremov Stephan Bergmann +Stephane Pellegrino +Stephan Guilloux +Stephan Lagerholm +Stephan Mühlstrasser +Stephan Szabo +Stephen Boost Stephen Brokenshire Stephen Collyer +Stephen Farrell Stephen Kick +Stephen M. Coakley Stephen More Stephen Toub Sterling Hughes -Steve Brokenshire Steve Green -Steve H Truong Steve Havelka +Steve Herrell Steve Holme +Steve H Truong Steve Lhomme Steve Little Steve Marx -Steve Oliphant -Steve Roskowski +Steven Allen Steven Bazyl Steven G. Johnson Steven Gu Steven M. Schweda +stevenpackardblp on github Steven Parkes +Steven Penny +Steve Oliphant +Steve Roskowski +Steve Walch +Stewart Gebbie +Stian Soiland-Reyes Stoned Elipot +stootill on github Stuart Henderson +Sukanya Hanumanthu +SumatraPeter on github Sune Ahlgren +Sunny Bean +Sunny Purushe +SuperIlu on github +SuperStormer on github Sven Anders +Sven Blumenstein Sven Neuhaus Sven Wegener Svyatoslav Mishyn +swalkaus at yahoo.com +sylgal on github Sylvestre Ledru Symeon Paraschoudis -Sébastien Willemijns -T. Bharath -T. Yamada -TJ Saunders +T200proX7 on github +Tadej Vengust Tae Hyoung Ahn +Taiyu Len +Tal Regev +Tamás Bálint Misius +Tamir Duberstein Taneli Vähäkangas Tanguy Fautre +Taras Kushnir +tarek112 on github +Tatsuhiko Miyagawa Tatsuhiro Tsujikawa +tawmoto on github +T. Bharath +tbugfinder on github +Ted Lyngmo +Teemu Yli-Elsila +Teh Kok How Temprimus +Terence Eden Terri Oda -TheAssassin at github +Terry Wu +thanhchungbtc on github +TheAssassin on github +The Infinnovation team +TheKnarf on github +Theo +Theodore A. Roth Theodore Dubois +therealhirudo on github +Thiago Suchorski +thisisgk on github +tholin on github +Thomas +Thomas1664 on github +Thomas Bouzerar Thomas Braun +Thomas Danielsson +Thomas Ferguson +Thomas Gamper Thomas Glanzmann +Thomas Guillem Thomas J. Moore Thomas Klausner -Thomas L. Shinnick Thomas Lopatic +Thomas L. Shinnick +Thomas M. DuBuisson Thomas Petazzoni +Thomas Pyle Thomas Ruecker Thomas Schwinge +Thomas Taylor Thomas Tonino +Thomas van Hesteren +Thomas Vegas +Thomas Weißschuh +Thorsten Klein Thorsten Schöning +Tianyi Song Tiit Pikma Till Maas +Till Wegmüller Tim Ansell Tim Baker Tim Bartley @@ -1463,170 +3132,335 @@ Tim Chen Tim Costello Tim Harder Tim Heckman +Tim Hill +Tim Mcdonough +Timmy Schierling Tim Newsome -Tim Rühsen -Tim Sneddon -Tim Stack -Tim Starling +Timo Lange Timo Sirainen Timotej Lazar Timothe Litt +Timothy Gu Timothy Polich +Timo Tijhof +Tim Rühsen +Tim Sedlmeyer +Tim Sneddon +Tim Stack +Tim Starling +Tim Tassonis +Timur Artikov +Tim Verhoeven +Tim Yuer Tinus van den Berg +tinyboxvk +tiymat +TJ Saunders +Tk Xiong +tkzv on github +tlahn on github +tmkk on github +Tobias Blomberg +Tobias Bora +Tobias Gabriel +Tobias Hieta +Tobias Hintze +Tobias Lindgren Tobias Markus +Tobias Nießen +Tobias Nygren +Tobias Nyholm Tobias Rundström +Tobias Schaefer Tobias Stoeckmann +Tobias Wendorff Toby Peterson Todd A Ouska +Todd Kaufmann Todd Kulesza Todd Short Todd Vierling +Tomas Berger +Tomas Hoger +Tomas Jakobsson +Tomas Mlcoch +Tomas Mraz +Tomas Pospisek +Tomas Szepe +Tomas Tomecek +Tomas Volf +Tomasz Kojm +Tomasz Lacki Tom Benoist Tom Donovan +Tom Eccles +Tom G. Christensen Tom Grace +Tom Greenslade Tom Lee Tom Mattison +Tommie Gannert +tommink[at]post.pl Tom Moers Tom Mueller +Tommy Chiang +Tommy Odom +Tommy Petty +Tommy Tam Tom Regner +Tom Seddon Tom Sparrow +Tom van der Woerdt Tom Wright +tomy2105 on github Tom Zerucha -Tomas Hoger -Tomas Jakobsson -Tomas Mlcoch -Tomas Pospisek -Tomas Szepe -Tomas Tomecek -Tomasz Kojm -Tomasz Lacki -Tommie Gannert -Tommy Tam -Ton Voon Toni Moreno +Ton Voon Tony Kelman +tonystz on github +Toon Claes Toon Verwaest Tor Arntsen Torben Dannhauer +Torben Dury +Török Edwin Torsten Foertsch Toshio Kuratomi Toshiyuki Maezawa +tpaukrt on github Traian Nicolescu +Trail of Bits +tranzystorekk on github Travis Burtrum +Travis Lane Travis Obenhaus +Tristan Perrault +Trivikram Kamat Troels Walsted Hansen Troy Engel +trrui-huawei +Trumeet on github +Trzik on github +Tseng Jun +Tuomas Siipola +Tuomo Rinne Tupone Alfredo +Turiiya +T. Yamada Tyler Hall -Török Edwin +u20221022 on github Ulf Härnhammar Ulf Samuelsson Ulrich Doehner Ulrich Telle Ulrich Zadow +UnicornZhang on github +updatede on github +UrsusArctos on github +User Sg +ustcqidi on github +Vadim Grinshpun Valentin David +Valentín Gutiérrez +Valentin Richter +Valentyn Korniienko +Valerii Zapodovnikov +vanillajonathan on github +Varnavas Papaioannou +Vasiliy Faronov +Vasiliy Ulyanov +Vasily Lobaskin Vasy Okhin Venkat Akella Venkataramana Mokkapati +Venkat Krishna R +Vicente Garcia +Victor Kislov +Victor Magierski Victor Snezhko +VictorVG on github +Victor Vieux Vijay Panghal Vikram Saxena -Viktor Szakáts +Viktor Petersson +Viktor Szakats +Vilhelm Prytz Ville Skyttä Vilmos Nebehaj Vincas Razma Vincent Bronner +Vincent Grande Vincent Le Normand Vincent Penquerc'h Vincent Sanders Vincent Torri +violetlige on github +vitaha85 on github +Vitaly Varyvdin +Vítor Galvão +vl409 on github Vlad Grachov -Vlad Ureche Vladimir Grishchenko +Vladimir Kotal Vladimir Lazarenko +Vladimir Panteleev +Vladimir Varlamov +Vladislavs Sokurenko +Vlad Ureche +Vlastimil Ovčáčík +vlkl-sap on github +vlubart on github Vojtech Janota -Vojtech Minarik Vojtěch Král +Vojtech Minarik +Volker Schmid +Vollstrecker on github Vsevolod Novikov -W. Mark Kubacki +vshmuk on hackerone +vulnerabilityspotter on hackerone +Vulpes Vulpes +vuonganh1993 on github +vvb2060 on github +Vyron Tsingaras +w0x42 on hackerone Waldek Kozba Walter J. Mack +wangzhikun Ward Willats -Warp Kawada Warren Menzer Wayne Haigh +Wei Chong Tan +Wenchao Li +Weng Xuetian +Wenxiang Qian Werner Koch +Werner Stolz +Wes Hinsley +wesinator on github Wesley Laxton Wesley Miaw Wez Furlong Wham Bang Wilfredo Sanchez +Wilhelm von Thiele Will Dietz +Willem Hoek Willem Sparreboom William Ahern +William A. Rowe Jr +William Desportes +William Tang +Will Roberts +Winni Neessen +W. Mark Kubacki +wmsch on github +wncboy on github Wojciech Zwiefka +wolfsage on hackerone +Wolf Vollprecht Wouter Van Rooy Wu Yongzheng +Wu Zheng +wxiaoguang on github Wyatt O'Day +Wyatt OʼDay +x1sc0 on github +x2018 on github Xavier Bouchoux +XhmikosR on github +XhstormR on github +xiadnoring on github Xiangbin Li +xianghongai on github +Xiang Xiao +xiaofeng +Xiaoke Wang +Xiaoyin Liu +Xì Gà +Xi Ruoyao +XmiliaH on github +xnynx on github +xtonik on github +xwxbug on github +x-xiang on github +XYenon Yaakov Selkowitz -Yamada Yasuharu +Yadhu Krishna M +Yair Lenga Yang Tse +Yaobin Wen Yarram Sunil Yasuharu Yamada +Yasuhiro Matsumoto +Yechiel Kalmenson +Yedaya Katsman Yehezkel Horowitz Yehoshua Hershberg +ygthien on github +Yifei Kong +Yihang Zhou Yi Huang +Yiming Jing Yingwei Liu +yiyuaner on github +Ymir1711 on github Yonggang Luo +Yongkang Huang +Yoshimasa Ohno +Younes El-karama +youngchopin on github Yousuke Kimoto Yukihiro Kawada Yun SangHo +Yurii Rashkovskii +Yuri Slobodyanyuk +Yuriy Chernyshov Yuriy Sosov +yushicheng7788 on github +Yusuke Nakamura +Yu Xin +Yuyi Wang Yves Arrouye Yves Lejeune +YX Hao +z2_ +Zachary Seguin Zdenek Pavlas Zekun Ni +zelinchen on github +zengwei +zengwei2000 Zenju on github +Zero King +Zespre Schmidt +zhanghu on xiaomi +Zhang Wen +Zhang Xiuhua +Zhaoming Luo +Zhaoyang Wu +Zhao Yisha +zhengqwe on github +Zhibiao Wu +zhihaoy on github +Zhouyihai Ding +ZimCodes on github +zjyhjqs +zloi-user on github +zmcx16 on github Zmey Petroff +zopsicle on github Zvi Har'El -afrind on github -asavah on github -baumanj on github -bsammon on github -canavan on github -destman on github -dkjjr89 on github -eXeC64 on github -imilli on github -jonrumsey on github -joshhe on github -jveazey on github -ka7 on github -kreshano on github -lijian996 on github -lukaszgn on github -madblobfish on github -marc-groundctl on github -mccormickt12 on github -mkzero on github -neex on github -neheb on github -nk -nopjmp on github -olesteban on github -ovidiu-benea on github -paulharris on github -silveja1 on github -stootill on github -swalkaus at yahoo.com -tarek112 on github -tommink[at]post.pl -vanillajonathan on github -wmsch on github -wyattoday on github -zelinchen on github -İsmail Dönmez -Štefan Kremeň +zzq1015 on github +Борис Верховский +Коваленко Анатолий Викторович +наб Никита Дорохин +ウさん +不确定 +加藤郁之 +南宫雪珊 +左潇峰 +李四 +梦终无痕 +積丹尼 Dan Jacobson +罗朝辉 diff --git a/curl/docs/TODO b/curl/docs/TODO index 264d559ad..a350e1421 100644 --- a/curl/docs/TODO +++ b/curl/docs/TODO @@ -7,36 +7,45 @@ Things that could be nice to do in the future Things to do in project curl. Please tell us what you think, contribute and - send us patches that improve things! + send us patches that improve things. Be aware that these are things that we could do, or have once been considered things we could do. If you want to work on any of these areas, please consider bringing it up for discussions first on the mailing list so that we - all agree it is still a good idea for the project! + all agree it is still a good idea for the project. - All bugs documented in the KNOWN_BUGS document are subject for fixing! + All bugs documented in the KNOWN_BUGS document are subject for fixing. 1. libcurl - 1.2 More data sharing + 1.1 TFO support on Windows + 1.2 Consult %APPDATA% also for .netrc 1.3 struct lifreq - 1.4 signal-based resolver timeouts + 1.4 alt-svc sharing 1.5 get rid of PATH_MAX - 1.6 Modified buffer size approach - 1.7 Detect when called from within callbacks + 1.6 thread-safe sharing 1.8 CURLOPT_RESOLVE for any port number 1.9 Cache negative name resolves 1.10 auto-detect proxy 1.11 minimize dependencies with dynamically loaded modules - 1.14 Typesafe curl_easy_setopt() + 1.12 updated DNS server while running + 1.13 c-ares and CURLOPT_OPENSOCKETFUNCTION + 1.14 connect to multiple IPs in parallel 1.15 Monitor connections in the connection pool 1.16 Try to URL encode given URL 1.17 Add support for IRIs - 1.18 try next proxy if one doesn't work - 1.19 Timeout idle connections from the pool + 1.18 try next proxy if one does not work + 1.19 provide timing info for each redirect 1.20 SRV and URI DNS records - 1.21 API for URL parsing/splitting + 1.21 netrc caching and sharing + 1.22 CURLINFO_PAUSE_STATE 1.23 Offer API to flush the connection pool - 1.24 TCP Fast Open for windows + 1.25 Expose tried IP addresses that failed + 1.28 FD_CLOEXEC + 1.29 WebSocket read callback + 1.30 config file parsing + 1.31 erase secrets from heap/stack after use + 1.32 add asynch getaddrinfo support + 1.33 make DoH inherit more transfer properties 2. libcurl - multi interface 2.1 More non-blocking @@ -44,42 +53,40 @@ 2.3 Non-blocking curl_multi_remove_handle() 2.4 Split connect and authentication process 2.5 Edge-triggered sockets should work + 2.6 multi upkeep + 2.7 Virtual external sockets + 2.8 dynamically decide to use socketpair 3. Documentation - 3.2 Provide cmake config-file + 3.1 Improve documentation about fork safety 4. FTP 4.1 HOST - 4.2 Alter passive/active on failure and retry - 4.3 Earlier bad letter detection - 4.4 REST for large files - 4.5 ASCII support 4.6 GSSAPI via Windows SSPI 4.7 STAT for LIST without data connection + 4.8 Passive transfer could try other IP addresses 5. HTTP - 5.1 Better persistency for HTTP 1.0 - 5.2 support FF3 sqlite cookie files + 5.1 Provide the error body from a CONNECT response + 5.2 Obey Retry-After in redirects 5.3 Rearrange request header order - 5.4 HTTP Digest using SHA-256 + 5.4 Allow SAN names in HTTP/2 server push 5.5 auth= in URLs - 5.6 Refuse "downgrade" redirects - 5.7 Brotli compression - 5.8 QUIC - 5.10 Leave secure cookies alone + 5.6 alt-svc should fallback if alt-svc does not work + 5.7 Require HTTP version X or higher 6. TELNET 6.1 ditch stdin 6.2 ditch telnet-specific select 6.3 feature negotiation debug data + 6.4 exit immediately upon connection if stdin is /dev/null 7. SMTP - 7.1 Pipelining + 7.1 Passing NOTIFY option to CURLOPT_MAIL_RCPT 7.2 Enhanced capability support 7.3 Add CURLOPT_MAIL_CLIENT option 8. POP3 - 8.1 Pipelining 8.2 Enhanced capability support 9. IMAP @@ -87,6 +94,9 @@ 10. LDAP 10.1 SASL based authentication mechanisms + 10.2 CURLOPT_SSL_CTX_FUNCTION for LDAPS + 10.3 Paged searches on LDAP server + 10.4 Certificate-Based Authentication 11. SMB 11.1 File listing support @@ -94,96 +104,118 @@ 11.3 Use NTLMv2 11.4 Create remote directories - 12. New protocols - 12.1 RSYNC + 12. FILE + 12.1 Directory listing on non-POSIX - 13. SSL - 13.1 Disable specific versions - 13.2 Provide mutex locking API - 13.3 Evaluate SSL patches - 13.4 Cache/share OpenSSL contexts + 13. TLS + 13.1 TLS-PSK with OpenSSL + 13.2 TLS channel binding + 13.3 Defeat TLS fingerprinting + 13.4 Consider OCSP stapling by default 13.5 Export session ids 13.6 Provide callback for cert verification - 13.7 improve configure --with-ssl + 13.7 Less memory massaging with Schannel 13.8 Support DANE - 13.10 Support SSLKEYLOGFILE - 13.11 Support intermediate & root pinning for PINNEDPUBLICKEY - 13.12 Support HSTS - 13.13 Support HPKP - - 14. GnuTLS - 14.1 SSL engine stuff - 14.2 check connection - - 15. WinSSL/SChannel - 15.1 Add support for client certificate authentication - 15.2 Add support for custom server certificate validation - 15.3 Add support for the --ciphers option + 13.9 TLS record padding + 13.10 Support Authority Information Access certificate extension (AIA) + 13.11 Some TLS options are not offered for HTTPS proxies + 13.13 Make sure we forbid TLS 1.3 post-handshake authentication + 13.14 Support the clienthello extension + 13.16 Share the CA cache + 13.17 Add missing features to TLS backends + + 14. Proxy + 14.1 Retry SOCKS handshake on address type not supported + + 15. Schannel + 15.1 Extend support for client certificate authentication + 15.2 Extend support for the --ciphers option + 15.4 Add option to allow abrupt server closure 16. SASL 16.1 Other authentication mechanisms 16.2 Add QOP support to GSSAPI authentication - 16.3 Support binary messages (i.e.: non-base64) 17. SSH protocols 17.1 Multiplexing - 17.2 SFTP performance - 17.3 Support better than MD5 hostkey hash + 17.2 Handle growing SFTP files + 17.3 Read keys from ~/.ssh/id_ecdsa, id_ed25519 17.4 Support CURLOPT_PREQUOTE + 17.5 SSH over HTTPS proxy with more backends + 17.6 SFTP with SCP:// 18. Command line tool 18.1 sync 18.2 glob posts - 18.3 prevent file overwriting - 18.4 simultaneous parallel transfers - 18.6 warning when setting an option - 18.8 offer color-coded HTTP header output + 18.4 --proxycommand + 18.5 UTF-8 filenames in Content-Disposition + 18.6 Option to make -Z merge lined based outputs on stdout + 18.7 specify which response codes that make -f/--fail return error 18.9 Choose the name of file in braces for complex URLs - 18.10 improve how curl works in a windows console window - 18.11 -w output to stderr + 18.10 improve how curl works in a Windows console window + 18.11 Windows: set attribute 'archive' for completed downloads 18.12 keep running, read instructions from pipe/socket - 18.13 support metalink in http headers - 18.14 --fail without --location should treat 3xx as a failure + 18.13 Acknowledge Ratelimit headers + 18.14 --dry-run 18.15 --retry should resume - 18.16 send only part of --data - 18.17 consider file name from the redirected URL with -O ? + 18.17 consider filename from the redirected URL with -O ? + 18.18 retry on network is unreachable + 18.19 expand ~/ in config files + 18.20 hostname sections in config files + 18.21 retry on the redirected-to URL + 18.23 Set the modification date on an uploaded file + 18.24 Use multiple parallel transfers for a single download + 18.25 Prevent terminal injection when writing to terminal + 18.26 Custom progress meter update interval + 18.27 -J and -O with %-encoded filenames + 18.28 -J with -C - + 18.29 --retry and transfer timeouts 19. Build - 19.1 roffit 19.2 Enable PIE and RELRO by default + 19.3 Do not use GNU libtool on OpenBSD + 19.4 Package curl for Windows in a signed installer + 19.5 make configure use --cache-file more and better 20. Test suite 20.1 SSL tunnel - 20.2 nicer lacking perl message - 20.3 more protocols supported - 20.4 more platforms supported - 20.5 Add support for concurrent connections - 20.6 Use the RFC6265 test suite - - 21. Next SONAME bump - 21.1 http-style HEAD output for FTP - 21.2 combine error codes - 21.3 extend CURLOPT_SOCKOPTFUNCTION prototype - - 22. Next major release - 22.1 cleanup return codes - 22.2 remove obsolete defines - 22.3 size_t - 22.4 remove several functions - 22.5 remove CURLOPT_FAILONERROR - 22.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE - 22.7 remove progress meter from libcurl - 22.8 remove 'curl_httppost' from public + 20.2 more protocols supported + 20.3 more platforms supported + 20.4 write an SMB test server to replace impacket + 20.5 Use the RFC 6265 test suite + 20.6 Run web-platform-tests URL tests + + 21. MQTT + 21.1 Support rate-limiting + 21.2 Support MQTTS + 21.3 Handle network blocks + + 22. TFTP + 22.1 TFTP does not convert LF to CRLF for mode=netascii + + 23. Gopher + 23.1 Handle network blocks ============================================================================== 1. libcurl -1.2 More data sharing +1.1 TFO support on Windows + + libcurl supports the CURLOPT_TCP_FASTOPEN option since 7.49.0 for Linux and + macOS. Windows supports TCP Fast Open starting with Windows 10, version 1607 + and we should add support for it. + + TCP Fast Open is supported on several platforms but not on Windows. Work on + this was once started but never finished. + + See https://github.com/curl/curl/pull/3378 + +1.2 Consult %APPDATA% also for .netrc - curl_share_* functions already exist and work, and they can be extended to - share more. For example, enable sharing of the ares channel and the - connection cache. + %APPDATA%\.netrc is not considered when running on Windows. should not it? + + See https://github.com/curl/curl/issues/4016 1.3 struct lifreq @@ -191,59 +223,43 @@ SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete. To support IPv6 interface addresses for network interfaces properly. -1.4 signal-based resolver timeouts - - libcurl built without an asynchronous resolver library uses alarm() to time - out DNS lookups. When a timeout occurs, this causes libcurl to jump from the - signal handler back into the library with a sigsetjmp, which effectively - causes libcurl to continue running within the signal handler. This is - non-portable and could cause problems on some platforms. A discussion on the - problem is available at https://curl.haxx.se/mail/lib-2008-09/0197.html - - Also, alarm() provides timeout resolution only to the nearest second. alarm - ought to be replaced by setitimer on systems that support it. +1.4 alt-svc sharing -1.5 get rid of PATH_MAX + The share interface could benefit from allowing the alt-svc cache to be + possible to share between easy handles. - Having code use and rely on PATH_MAX is not nice: - https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html + See https://github.com/curl/curl/issues/4476 - Currently the SSH based code uses it a bit, but to remove PATH_MAX from there - we need libssh2 to properly tell us when we pass in a too small buffer and - its current API (as of libssh2 1.2.7) doesn't. + The share interface offers CURL_LOCK_DATA_CONNECT to have multiple easy + handle share a connection cache, but due to how connections are used they are + still not thread-safe when used shared. -1.6 Modified buffer size approach + See https://github.com/curl/curl/issues/4915 and lib1541.c - Current libcurl allocates a fixed 16K size buffer for download and an - additional 16K for upload. They are always unconditionally part of the easy - handle. If CRLF translations are requested, an additional 32K "scratch - buffer" is allocated. A total of 64K transfer buffers in the worst case. + The share interface offers CURL_LOCK_DATA_HSTS to have multiple easy handle + share an HSTS cache, but this is not thread-safe. - First, while the handles are not actually in use these buffers could be freed - so that lingering handles just kept in queues or whatever waste less memory. +1.5 get rid of PATH_MAX - Secondly, SFTP is a protocol that needs to handle many ~30K blocks at once - since each need to be individually acked and therefore libssh2 must be - allowed to send (or receive) many separate ones in parallel to achieve high - transfer speeds. A current libcurl build with a 16K buffer makes that - impossible, but one with a 512K buffer will reach MUCH faster transfers. But - allocating 512K unconditionally for all buffers just in case they would like - to do fast SFTP transfers at some point is not a good solution either. + Having code use and rely on PATH_MAX is not nice: + https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html - Dynamically allocate buffer size depending on protocol in use in combination - with freeing it after each individual transfer? Other suggestions? + Currently the libssh2 SSH based code uses it, but to remove PATH_MAX from + there we need libssh2 to properly tell us when we pass in a too small buffer + and its current API (as of libssh2 1.2.7) does not. -1.7 Detect when called from within callbacks +1.6 thread-safe sharing - We should set a state variable before calling callbacks, so that we - subsequently can add code within libcurl that returns error if called within - callbacks for when that's not supported. + Using the share interface users can share some data between easy handles but + several of the sharing options are documented as not safe and supported to + share between multiple concurrent threads. Fixing this would enable more + users to share data in more powerful ways. 1.8 CURLOPT_RESOLVE for any port number This option allows applications to set a replacement IP address for a given host + port pair. Consider making support for providing a replacement address - for the host name on all port numbers. + for the hostname on all port numbers. See https://github.com/curl/curl/issues/1264 @@ -269,25 +285,40 @@ We can create a system with loadable modules/plug-ins, where these modules would be the ones that link to 3rd party libs. That would allow us to avoid having to load ALL dependencies since only the necessary ones for this - app/invoke/used protocols would be necessary to load. See + app/invoke/used protocols would be necessary to load. See https://github.com/curl/curl/issues/349 -1.14 Typesafe curl_easy_setopt() +1.12 updated DNS server while running - One of the most common problems in libcurl using applications is the lack of - type checks for curl_easy_setopt() which happens because it accepts varargs - and thus can take any type. + If /etc/resolv.conf gets updated while a program using libcurl is running, it + is may cause name resolves to fail unless res_init() is called. We should + consider calling res_init() + retry once unconditionally on all name resolve + failures to mitigate against this. Firefox works like that. Note that Windows + does not have res_init() or an alternative. - One possible solution to this is to introduce a few different versions of the - setopt version for the different kinds of data you can set. + https://github.com/curl/curl/issues/2251 - curl_easy_set_num() - sets a long value +1.13 c-ares and CURLOPT_OPENSOCKETFUNCTION - curl_easy_set_large() - sets a curl_off_t value + curl creates most sockets via the CURLOPT_OPENSOCKETFUNCTION callback and + close them with the CURLOPT_CLOSESOCKETFUNCTION callback. However, c-ares + does not use those functions and instead opens and closes the sockets itself. + This means that when curl passes the c-ares socket to the + CURLMOPT_SOCKETFUNCTION it is not owned by the application like other + sockets. - curl_easy_set_ptr() - sets a pointer + See https://github.com/curl/curl/issues/2734 - curl_easy_set_cb() - sets a callback PLUS its callback data +1.14 connect to multiple IPs in parallel + + curl currently implements the happy eyeball algorithm for connecting to the + IPv4 and IPv6 alternatives for a host in parallel, sticking with the + connection that "wins". We could implement a similar algorithm per individual + IP family as well when there are multiple available addresses: start with the + first address, then start a second attempt N milliseconds after and then a + third another N milliseconds later. That way there would be less waiting when + the first IP has problems. It also improves the connection timeout value + handling for multiple address situations. 1.15 Monitor connections in the connection pool @@ -298,10 +329,11 @@ reuse purpose it is verified that it is still alive. Those connections may get closed by the server side for idleness or they may - get a HTTP/2 ping from the peer to verify that they're still alive. By adding - monitoring of the connections while in the pool, libcurl can detect dead - connections (and close them) better and earlier, and it can handle HTTP/2 - pings to keep such ones alive even when not actively doing transfers on them. + get an HTTP/2 ping from the peer to verify that they are still alive. By + adding monitoring of the connections while in the pool, libcurl can detect + dead connections (and close them) better and earlier, and it can handle + HTTP/2 pings to keep such ones alive even when not actively doing transfers + on them. 1.16 Try to URL encode given URL @@ -314,14 +346,14 @@ 1.17 Add support for IRIs - IRIs (RFC 3987) allow localized, non-ascii, names in the URL. To properly + IRIs (RFC 3987) allow localized, non-ASCII, names in the URL. To properly support this, curl/libcurl would need to translate/encode the given input from the input string encoding into percent encoded output "over the wire". To make that work smoothly for curl users even on Windows, curl would probably need to be able to convert from several input encodings. -1.18 try next proxy if one doesn't work +1.18 try next proxy if one does not work Allow an application to specify a list of proxies to try, and failing to connect to the first go on and try the next instead until the list is @@ -330,27 +362,31 @@ https://github.com/curl/curl/issues/896 -1.19 Timeout idle connections from the pool +1.19 provide timing info for each redirect - libcurl currently keeps connections in its connection pool for an indefinite - period of time, until it either gets reused, gets noticed that it has been - closed by the server or gets pruned to make room for a new connection. + curl and libcurl provide timing information via a set of different + time-stamps (CURLINFO_*_TIME). When curl is following redirects, those + returned time value are the accumulated sums. An improvement could be to + offer separate timings for each redirect. - To reduce overhead (especially for when we add monitoring of the connections - in the pool), we should introduce a timeout so that connections that have - been idle for N seconds get closed. + https://github.com/curl/curl/issues/6743 1.20 SRV and URI DNS records Offer support for resolving SRV and URI DNS records for libcurl to know which - server to connect to for various protocols (including HTTP!). + server to connect to for various protocols (including HTTP). + +1.21 netrc caching and sharing -1.21 API for URL parsing/splitting + The netrc file is read and parsed each time a connection is setup, which + means that if a transfer needs multiple connections for authentication or + redirects, the file might be reread (and parsed) multiple times. This makes + it impossible to provide the file as a pipe. - libcurl has always parsed URLs internally and never exposed any API or - features to allow applications to do it. Still most or many applications - using libcurl need that ability. In polls to users, we've learned that many - libcurl users would like to see and use such an API. +1.22 CURLINFO_PAUSE_STATE + + Return information about the transfer's current pause state, in both + directions. https://github.com/curl/curl/issues/2588 1.23 Offer API to flush the connection pool @@ -358,25 +394,95 @@ An API could allow a forced flush or just a forced loop that would properly close all connections that have been closed by the server already. -1.24 TCP Fast Open for windows +1.25 Expose tried IP addresses that failed - libcurl supports the CURLOPT_TCP_FASTOPEN option since 7.49.0 for Linux and - Mac OS. Windows supports TCP Fast Open starting with Windows 10, version 1607 - and we should add support for it. + When libcurl fails to connect to a host, it could offer the application the + addresses that were used in the attempt. Source + dest IP, source + dest port + and protocol (UDP or TCP) for each failure. Possibly as a callback. Perhaps + also provide "reason". + + https://github.com/curl/curl/issues/2126 + +1.28 FD_CLOEXEC + + It sets the close-on-exec flag for the file descriptor, which causes the file + descriptor to be automatically (and atomically) closed when any of the + exec-family functions succeed. Should probably be set by default? + + https://github.com/curl/curl/issues/2252 + +1.29 WebSocket read callback + + Call the read callback once the connection is established to allow sending + the first message in the connection. + + https://github.com/curl/curl/issues/11402 + +1.30 config file parsing + + Consider providing an API, possibly in a separate companion library, for + parsing a config file like curl's -K/--config option to allow applications to + get the same ability to read curl options from files. + + See https://github.com/curl/curl/issues/3698 + +1.31 erase secrets from heap/stack after use + + Introducing a concept and system to erase secrets from memory after use, it + could help mitigate and lessen the impact of (future) security problems etc. + However: most secrets are passed to libcurl as clear text from the + application and then clearing them within the library adds nothing... + + https://github.com/curl/curl/issues/7268 + +1.32 add asynch getaddrinfo support + + Use getaddrinfo_a() to provide an asynch name resolver backend to libcurl + that does not use threads and does not depend on c-ares. The getaddrinfo_a + function is (probably?) glibc specific but that is a widely used libc among + our users. + + https://github.com/curl/curl/pull/6746 + +1.33 make DoH inherit more transfer properties + + Some options are not inherited because they are not relevant for the DoH SSL + connections, or inheriting the option may result in unexpected behavior. For + example the user's debug function callback is not inherited because it would + be unexpected for internal handles (ie DoH handles) to be passed to that + callback. + + If an option is not inherited then it is not possible to set it separately + for DoH without a DoH-specific option. For example: + CURLOPT_DOH_SSL_VERIFYHOST, CURLOPT_DOH_SSL_VERIFYPEER and + CURLOPT_DOH_SSL_VERIFYSTATUS. + + See https://github.com/curl/curl/issues/6605 2. libcurl - multi interface 2.1 More non-blocking - Make sure we don't ever loop because of non-blocking sockets returning + Make sure we do not ever loop because of non-blocking sockets returning EWOULDBLOCK or similar. Blocking cases include: - - Name resolves on non-windows unless c-ares or the threaded resolver is used - - SOCKS proxy handshakes + - Name resolves on non-Windows unless c-ares or the threaded resolver is used. + + - The threaded resolver may block on cleanup: + https://github.com/curl/curl/issues/4852 + - file:// transfers + - TELNET transfers + + - GSSAPI authentication for FTP transfers + - The "DONE" operation (post transfer protocol-specific actions) for the - protocols SFTP, SMTP, FTP. Fixing Curl_done() for this is a worthy task. + protocols SFTP, SMTP, FTP. Fixing multi_done() for this is a worthy task. + + - curl_multi_remove_handle for any of the above. See section 2.3. + + - Calling curl_ws_send() from a callback 2.2 Better support for same name resolves @@ -398,8 +504,8 @@ 2.4 Split connect and authentication process The multi interface treats the authentication process as part of the connect - phase. As such any failures during authentication won't trigger the relevant - QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP. + phase. As such any failures during authentication does not trigger the + relevant QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP. 2.5 Edge-triggered sockets should work @@ -407,76 +513,94 @@ the internal actions that need to be improved for this to work perfectly is the 'maxloops' handling in transfer.c:readwrite_data(). -3. Documentation +2.6 multi upkeep -3.2 Provide cmake config-file + In libcurl 7.62.0 we introduced curl_easy_upkeep. It unfortunately only works + on easy handles. We should introduces a version of that for the multi handle, + and also consider doing "upkeep" automatically on connections in the + connection pool when the multi handle is in used. - A config-file package is a set of files provided by us to allow applications - to write cmake scripts to find and use libcurl easier. See - https://github.com/curl/curl/issues/885 + See https://github.com/curl/curl/issues/3199 -4. FTP +2.7 Virtual external sockets -4.1 HOST + libcurl performs operations on the given file descriptor that presumes it is + a socket and an application cannot replace them at the moment. Allowing an + application to fully replace those would allow a larger degree of freedom and + flexibility. - HOST is a command for a client to tell which host name to use, to offer FTP - servers named-based virtual hosting: + See https://github.com/curl/curl/issues/5835 - https://tools.ietf.org/html/rfc7151 +2.8 dynamically decide to use socketpair -4.2 Alter passive/active on failure and retry + For users who do not use curl_multi_wait() or do not care for + curl_multi_wakeup(), we could introduce a way to make libcurl NOT + create a socketpair in the multi handle. - When trying to connect passively to a server which only supports active - connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the - connection. There could be a way to fallback to an active connection (and - vice versa). https://curl.haxx.se/bug/feature.cgi?id=1754793 + See https://github.com/curl/curl/issues/4829 -4.3 Earlier bad letter detection +3. Documentation - Make the detection of (bad) %0d and %0a codes in FTP URL parts earlier in the - process to avoid doing a resolve and connect in vain. +3.1 Improve documentation about fork safety -4.4 REST for large files + See https://github.com/curl/curl/issues/6968 - REST fix for servers not behaving well on >2GB requests. This should fail if - the server doesn't set the pointer to the requested index. The tricky - (impossible?) part is to figure out if the server did the right thing or not. +4. FTP -4.5 ASCII support +4.1 HOST - FTP ASCII transfers do not follow RFC959. They don't convert the data - accordingly. + HOST is a command for a client to tell which hostname to use, to offer FTP + servers named-based virtual hosting: + + https://datatracker.ietf.org/doc/html/rfc7151 4.6 GSSAPI via Windows SSPI -In addition to currently supporting the SASL GSSAPI mechanism (Kerberos V5) -via third-party GSS-API libraries, such as Heimdal or MIT Kerberos, also add -support for GSSAPI authentication via Windows SSPI. + In addition to currently supporting the SASL GSSAPI mechanism (Kerberos V5) + via third-party GSS-API libraries, such as Heimdal or MIT Kerberos, also add + support for GSSAPI authentication via Windows SSPI. 4.7 STAT for LIST without data connection -Some FTP servers allow STAT for listing directories instead of using LIST, and -the response is then sent over the control connection instead of as the -otherwise usedw data connection: http://www.nsftools.com/tips/RawFTP.htm#STAT + Some FTP servers allow STAT for listing directories instead of using LIST, + and the response is then sent over the control connection instead of as the + otherwise usedw data connection: https://www.nsftools.com/tips/RawFTP.htm#STAT + + This is not detailed in any FTP specification. + +4.8 Passive transfer could try other IP addresses + + When doing FTP operations through a proxy at localhost, the reported spotted + that curl only tried to connect once to the proxy, while it had multiple + addresses and a failed connect on one address should make it try the next. + + After switching to passive mode (EPSV), curl could try all IP addresses for + "localhost". Currently it tries ::1, but it should also try 127.0.0.1. -This is not detailed in any FTP specification. + See https://github.com/curl/curl/issues/1508 5. HTTP -5.1 Better persistency for HTTP 1.0 +5.1 Provide the error body from a CONNECT response - "Better" support for persistent connections over HTTP 1.0 - https://curl.haxx.se/bug/feature.cgi?id=1089001 + When curl receives a body response from a CONNECT request to a proxy, it + always just reads and ignores it. It would make some users happy if curl + instead optionally would be able to make that responsible available. Via a + new callback? Through some other means? -5.2 support FF3 sqlite cookie files + See https://github.com/curl/curl/issues/9513 - Firefox 3 is changing from its former format to a a sqlite database instead. - We should consider how (lib)curl can/should support this. - https://curl.haxx.se/bug/feature.cgi?id=1871388 +5.2 Obey Retry-After in redirects + + The Retry-After is said to dicate "the minimum time that the user agent is + asked to wait before issuing the redirected request" and libcurl does not + obey this. + + See https://github.com/curl/curl/issues/11447 5.3 Rearrange request header order - Server implementors often make an effort to detect browser and to reject + Server implementers often make an effort to detect browser and to reject clients it can detect to not match. One of the last details we cannot yet control in libcurl's HTTP requests, which also can be exploited to detect that libcurl is in fact used even when it tries to impersonate a browser, is @@ -486,14 +610,14 @@ This is not detailed in any FTP specification. headers use a default value so only headers that need to be moved have to be specified. -5.4 HTTP Digest using SHA-256 +5.4 Allow SAN names in HTTP/2 server push - RFC 7616 introduces an update to the HTTP Digest authentication - specification, which amongst other thing defines how new digest algorithms - can be used instead of MD5 which is considered old and not recommended. + curl only allows HTTP/2 push promise if the provided :authority header value + exactly matches the hostname given in the URL. It could be extended to allow + any name that would match the Subject Alternative Names in the server's TLS + certificate. - See https://tools.ietf.org/html/rfc7616 and - https://github.com/curl/curl/issues/1018 + See https://github.com/curl/curl/pull/3581 5.5 auth= in URLs @@ -502,66 +626,62 @@ This is not detailed in any FTP specification. For example: - http://test:pass;auth=NTLM@example.com would be equivalent to specifying --user - test:pass;auth=NTLM or --user test:pass --ntlm from the command line. + http://test:pass;auth=NTLM@example.com would be equivalent to specifying + --user test:pass;auth=NTLM or --user test:pass --ntlm from the command line. Additionally this should be implemented for proxy base URLs as well. -5.6 Refuse "downgrade" redirects - - See https://github.com/curl/curl/issues/226 - - Consider a way to tell curl to refuse to "downgrade" protocol with a redirect - and/or possibly a bit that refuses redirect to change protocol completely. - -5.7 Brotli compression - - Brotli compression performs better than gzip and is being implemented by - browsers and servers widely. The algorithm: https://github.com/google/brotli - The Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=366559 +5.6 alt-svc should fallback if alt-svc does not work -5.8 QUIC + The alt-svc: header provides a set of alternative services for curl to use + instead of the original. If the first attempted one fails, it should try the + next etc and if all alternatives fail go back to the original. - The standardization process of QUIC has been taken to the IETF and can be - followed on the [IETF QUIC Mailing - list](https://www.ietf.org/mailman/listinfo/quic). I'd like us to get on the - bandwagon. Ideally, this would be done with a separate library/project to - handle the binary/framing layer in a similar fashion to how HTTP/2 is - implemented. This, to allow other projects to benefit from the work and to - thus broaden the interest and chance of others to participate. + See https://github.com/curl/curl/issues/4908 -5.10 Leave secure cookies alone +5.7 Require HTTP version X or higher - Non-secure origins (HTTP sites) should not be allowed to set or modify - cookies with the 'secure' property: - - https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-01 + curl and libcurl provide options for trying higher HTTP versions (for example + HTTP/2) but then still allows the server to pick version 1.1. We could + consider adding a way to require a minimum version. + See https://github.com/curl/curl/issues/7980 6. TELNET 6.1 ditch stdin -Reading input (to send to the remote server) on stdin is a crappy solution for -library purposes. We need to invent a good way for the application to be able -to provide the data to send. + Reading input (to send to the remote server) on stdin is a crappy solution + for library purposes. We need to invent a good way for the application to be + able to provide the data to send. 6.2 ditch telnet-specific select Move the telnet support's network select() loop go away and merge the code - into the main transfer loop. Until this is done, the multi interface won't + into the main transfer loop. Until this is done, the multi interface does not work for telnet. 6.3 feature negotiation debug data - Add telnet feature negotiation data to the debug callback as header data. + Add telnet feature negotiation data to the debug callback as header data. + +6.4 exit immediately upon connection if stdin is /dev/null + + If it did, curl could be used to probe if there is an server there listening + on a specific port. That is, the following command would exit immediately + after the connection is established with exit code 0: + curl -s --connect-timeout 2 telnet://example.com:80 NOTIFY=SUCCESS,FAILURE" ); + + https://github.com/curl/curl/issues/8232 7.2 Enhanced capability support @@ -576,15 +696,11 @@ to provide the data to send. hack ;-) Please see the following thread for more information: - https://curl.haxx.se/mail/lib-2012-05/0178.html + https://curl.se/mail/lib-2012-05/0178.html 8. POP3 -8.1 Pipelining - - Add support for pipelining commands. - 8.2 Enhanced capability support Add the ability, for an application that uses libcurl, to obtain the list of @@ -607,66 +723,94 @@ to provide the data to send. be possible to use ldap_bind_s() instead specifying the security context information ourselves. +10.2 CURLOPT_SSL_CTX_FUNCTION for LDAPS + + CURLOPT_SSL_CTX_FUNCTION works perfectly for HTTPS and email protocols, but + it has no effect for LDAPS connections. + + https://github.com/curl/curl/issues/4108 + +10.3 Paged searches on LDAP server + + https://github.com/curl/curl/issues/4452 + +10.4 Certificate-Based Authentication + + LDAPS not possible with macOS and Windows with Certificate-Based Authentication + + https://github.com/curl/curl/issues/9641 + 11. SMB 11.1 File listing support -Add support for listing the contents of a SMB share. The output should probably -be the same as/similar to FTP. + Add support for listing the contents of an SMB share. The output should + probably be the same as/similar to FTP. 11.2 Honor file timestamps -The timestamp of the transferred file should reflect that of the original file. + The timestamp of the transferred file should reflect that of the original + file. 11.3 Use NTLMv2 -Currently the SMB authentication uses NTLMv1. + Currently the SMB authentication uses NTLMv1. 11.4 Create remote directories -Support for creating remote directories when uploading a file to a directory -that doesn't exist on the server, just like --ftp-create-dirs. + Support for creating remote directories when uploading a file to a directory + that does not exist on the server, just like --ftp-create-dirs. + -12. New protocols +12. FILE -12.1 RSYNC +12.1 Directory listing on non-POSIX - There's no RFC for the protocol or an URI/URL format. An implementation - should most probably use an existing rsync library, such as librsync. + Listing the contents of a directory accessed with FILE only works on + platforms with opendir. Support could be added for more systems, like + Windows. -13. SSL +13. TLS -13.1 Disable specific versions +13.1 TLS-PSK with OpenSSL - Provide an option that allows for disabling specific SSL versions, such as - SSLv2 https://curl.haxx.se/bug/feature.cgi?id=1767276 + Transport Layer Security pre-shared key ciphersuites (TLS-PSK) is a set of + cryptographic protocols that provide secure communication based on pre-shared + keys (PSKs). These pre-shared keys are symmetric keys shared in advance among + the communicating parties. -13.2 Provide mutex locking API + https://github.com/curl/curl/issues/5081 - Provide a libcurl API for setting mutex callbacks in the underlying SSL - library, so that the same application code can use mutex-locking - independently of OpenSSL or GnutTLS being used. +13.2 TLS channel binding -13.3 Evaluate SSL patches + TLS 1.2 and 1.3 provide the ability to extract some secret data from the TLS + connection and use it in the client request (usually in some sort of + authentication) to ensure that the data sent is bound to the specific TLS + connection and cannot be successfully intercepted by a proxy. This + functionality can be used in a standard authentication mechanism such as + GSS-API or SCRAM, or in custom approaches like custom HTTP Authentication + headers. - Evaluate/apply Gertjan van Wingerde's SSL patches: - https://curl.haxx.se/mail/lib-2004-03/0087.html + For TLS 1.2, the binding type is usually tls-unique, and for TLS 1.3 it is + tls-exporter. -13.4 Cache/share OpenSSL contexts + https://datatracker.ietf.org/doc/html/rfc5929 + https://datatracker.ietf.org/doc/html/rfc9266 + https://github.com/curl/curl/issues/9226 - "Look at SSL cafile - quick traces look to me like these are done on every - request as well, when they should only be necessary once per SSL context (or - once per handle)". The major improvement we can rather easily do is to make - sure we don't create and kill a new SSL "context" for every request, but - instead make one for every connection and re-use that SSL context in the same - style connections are re-used. It will make us use slightly more memory but - it will libcurl do less creations and deletions of SSL contexts. +13.3 Defeat TLS fingerprinting - Technically, the "caching" is probably best implemented by getting added to - the share interface so that easy handles who want to and can reuse the - context specify that by sharing with the right properties set. + By changing the order of TLS extensions provided in the TLS handshake, it is + sometimes possible to circumvent TLS fingerprinting by servers. The TLS + extension order is of course not the only way to fingerprint a client. - https://github.com/curl/curl/issues/1110 +13.4 Consider OCSP stapling by default + + Treat a negative response a reason for aborting the connection. Since OCSP + stapling is presumed to get used much less in the future when Let's Encrypt + drops the OCSP support, the benefit of this might however be limited. + + https://github.com/curl/curl/issues/15483 13.5 Export session ids @@ -679,13 +823,15 @@ that doesn't exist on the server, just like --ftp-create-dirs. 13.6 Provide callback for cert verification OpenSSL supports a callback for customised verification of the peer - certificate, but this doesn't seem to be exposed in the libcurl APIs. Could - it be? There's so much that could be done if it were! + certificate, but this does not seem to be exposed in the libcurl APIs. Could + it be? There is so much that could be done if it were. -13.7 improve configure --with-ssl +13.7 Less memory massaging with Schannel - make the configure --with-ssl option first check for OpenSSL, then GnuTLS, - then NSS... + The Schannel backend does a lot of custom memory management we would rather + avoid: the repeated alloc + free in sends and the custom memory + realloc + system for encrypted and decrypted data. That should be avoided and reduced + for 1) efficiency and 2) safety. 13.8 Support DANE @@ -694,106 +840,113 @@ that doesn't exist on the server, just like --ftp-create-dirs. https://www.rfc-editor.org/rfc/rfc6698.txt An initial patch was posted by Suresh Krishnaswamy on March 7th 2013 - (https://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple + (https://curl.se/mail/lib-2013-03/0075.html) but it was a too simple approach. See Daniel's comments: - https://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the + https://curl.se/mail/lib-2013-03/0103.html . libunbound may be the correct library to base this development on. Björn Stenberg wrote a separate initial take on DANE that was never completed. -13.10 Support SSLKEYLOGFILE +13.9 TLS record padding - When used, Firefox and Chrome dumps their master TLS keys to the file name - this environment variable specifies. This allows tools like for example - Wireshark to capture and decipher TLS traffic to/from those clients. libcurl - could be made to support this more widely (presumably this already works when - built with NSS). Peter Wu made a OpenSSL preload to make possible that can be - used as inspiration and guidance - https://git.lekensteyn.nl/peter/wireshark-notes/tree/src/sslkeylog.c + TLS (1.3) offers optional record padding and OpenSSL provides an API for it. + I could make sense for libcurl to offer this ability to applications to make + traffic patterns harder to figure out by network traffic observers. -13.11 Support intermediate & root pinning for PINNEDPUBLICKEY + See https://github.com/curl/curl/issues/5398 - CURLOPT_PINNEDPUBLICKEY does not consider the hashes of intermediate & root - certificates when comparing the pinned keys. Therefore it is not compatible - with "HTTP Public Key Pinning" as there also intermediate and root certificates - can be pinned. This is very useful as it prevents webadmins from "locking - themself out of their servers". +13.10 Support Authority Information Access certificate extension (AIA) - Adding this feature would make curls pinning 100% compatible to HPKP and allow - more flexible pinning. + AIA can provide various things like CRLs but more importantly information + about intermediate CA certificates that can allow validation path to be + fulfilled when the HTTPS server does not itself provide them. -13.12 Support HSTS + Since AIA is about downloading certs on demand to complete a TLS handshake, + it is probably a bit tricky to get done right. - "HTTP Strict Transport Security" is TOFU (trust on first use), time-based - features indicated by a HTTP header send by the webserver. It is widely used - in browsers and it's purpose is to prevent insecure HTTP connections after - a previous HTTPS connection. It protects against SSLStripping attacks. + See https://github.com/curl/curl/issues/2793 - Doc: https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security - RFC 6797: https://tools.ietf.org/html/rfc6797 +13.11 Some TLS options are not offered for HTTPS proxies -13.13 Support HPKP + Some TLS related options to the command line tool and libcurl are only + provided for the server and not for HTTPS proxies. --proxy-tls-max, + --proxy-tlsv1.3, --proxy-curves and a few more. + For more Documentation on this see: + https://curl.se/libcurl/c/tls-options.html - "HTTP Public Key Pinning" is TOFU (trust on first use), time-based - features indicated by a HTTP header send by the webserver. It's purpose is - to prevent Man-in-the-middle attacks by trusted CAs by allowing webadmins - to specify which CAs/certificates/public keys to trust when connection to - their websites. + https://github.com/curl/curl/issues/12286 - It can be build based on PINNEDPUBLICKEY. +13.13 Make sure we forbid TLS 1.3 post-handshake authentication - Wikipedia: https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning - OWASP: https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning - Doc: https://developer.mozilla.org/de/docs/Web/Security/Public_Key_Pinning - RFC: https://tools.ietf.org/html/draft-ietf-websec-key-pinning-21 + RFC 8740 explains how using HTTP/2 must forbid the use of TLS 1.3 + post-handshake authentication. We should make sure to live up to that. -14. GnuTLS + See https://github.com/curl/curl/issues/5396 -14.1 SSL engine stuff +13.14 Support the clienthello extension - Is this even possible? + Certain stupid networks and middle boxes have a problem with SSL handshake + packets that are within a certain size range because how that sets some bits + that previously (in older TLS version) were not set. The clienthello + extension adds padding to avoid that size range. -14.2 check connection + https://datatracker.ietf.org/doc/html/rfc7685 + https://github.com/curl/curl/issues/2299 - Add a way to check if the connection seems to be alive, to correspond to the - SSL_peak() way we use with OpenSSL. +13.16 Share the CA cache -15. WinSSL/SChannel + For TLS backends that supports CA caching, it makes sense to allow the share + object to be used to store the CA cache as well via the share API. Would + allow multiple easy handles to reuse the CA cache and save themselves from a + lot of extra processing overhead. -15.1 Add support for client certificate authentication +13.17 Add missing features to TLS backends - WinSSL/SChannel currently makes use of the OS-level system and user - certificate and private key stores. This does not allow the application - or the user to supply a custom client certificate using curl or libcurl. + The feature matrix at https://curl.se/libcurl/c/tls-options.html shows which + features are supported by which TLS backends, and thus also where there are + feature gaps. - Therefore support for the existing -E/--cert and --key options should be - implemented by supplying a custom certificate to the SChannel APIs, see: - - Getting a Certificate for Schannel - https://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx +14. Proxy + +14.1 Retry SOCKS handshake on address type not supported + + When curl resolves a hostname, it might get a mix of IPv6 and IPv4 returned. + curl might then use an IPv6 address with a SOCKS5 proxy, which - if it does + not support IPv6 - returns "Address type not supported" and curl exits with + that error. -15.2 Add support for custom server certificate validation + Perhaps it is preferred if curl would in this situation instead first retry + the SOCKS handshake again for this case and then use one of the IPv4 + addresses for the target host. - WinSSL/SChannel currently makes use of the OS-level system and user - certificate trust store. This does not allow the application or user to - customize the server certificate validation process using curl or libcurl. + See https://github.com/curl/curl/issues/17222 - Therefore support for the existing --cacert or --capath options should be - implemented by supplying a custom certificate to the SChannel APIs, see: +15. Schannel + +15.1 Extend support for client certificate authentication + + The existing support for the -E/--cert and --key options could be + extended by supplying a custom certificate and key in PEM format, see: - Getting a Certificate for Schannel https://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx -15.3 Add support for the --ciphers option - - The cipher suites used by WinSSL/SChannel are configured on an OS-level - instead of an application-level. This does not allow the application or - the user to customize the configured cipher suites using curl or libcurl. +15.2 Extend support for the --ciphers option - Therefore support for the existing --ciphers option should be implemented - by mapping the OpenSSL/GnuTLS cipher suites to the SChannel APIs, see + The existing support for the --ciphers option could be extended + by mapping the OpenSSL/GnuTLS cipher suites to the Schannel APIs, see - Specifying Schannel Ciphers and Cipher Strengths https://msdn.microsoft.com/en-us/library/windows/desktop/aa380161.aspx +15.4 Add option to allow abrupt server closure + + libcurl with Schannel errors without a known termination point from the server + (such as length of transfer, or SSL "close notify" alert) to prevent against + a truncation attack. Really old servers may neglect to send any termination + point. An option could be added to ignore such abrupt closures. + + https://github.com/curl/curl/issues/4427 + 16. SASL 16.1 Other authentication mechanisms @@ -808,10 +961,6 @@ that doesn't exist on the server, just like --ftp-create-dirs. with integrity protection) and auth-conf (Authentication with integrity and privacy protection). -16.3 Support binary messages (i.e.: non-base64) - - Mandatory to support LDAP SASL authentication. - 17. SSH protocols @@ -820,30 +969,47 @@ that doesn't exist on the server, just like --ftp-create-dirs. SSH is a perfectly fine multiplexed protocols which would allow libcurl to do multiple parallel transfers from the same host using the same connection, much in the same spirit as HTTP/2 does. libcurl however does not take - advantage of that ability but will instead always create a new connection for + advantage of that ability but does instead always create a new connection for new transfers even if an existing connection already exists to the host. To fix this, libcurl would have to detect an existing connection and "attach" the new transfer to the existing one. -17.2 SFTP performance +17.2 Handle growing SFTP files - libcurl's SFTP transfer performance is sub par and can be improved, mostly by - the approach mentioned in "1.6 Modified buffer size approach". + The SFTP code in libcurl checks the file size *before* a transfer starts and + then proceeds to transfer exactly that amount of data. If the remote file + grows while the transfer is in progress libcurl does not notice and does not + adapt. The OpenSSH SFTP command line tool does and libcurl could also just + attempt to download more to see if there is more to get... -17.3 Support better than MD5 hostkey hash + https://github.com/curl/curl/issues/4344 - libcurl offers the CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 option for verifying the - server's key. MD5 is generally being deprecated so we should implement - support for stronger hashing algorithms. libssh2 itself is what provides this - underlying functionality and it supports at least SHA-1 as an alternative. - SHA-1 is also being deprecated these days so we should consider workign with - libssh2 to instead offer support for SHA-256 or similar. +17.3 Read keys from ~/.ssh/id_ecdsa, id_ed25519 + + The libssh2 backend in curl is limited to only reading keys from id_rsa and + id_dsa, which makes it fail connecting to servers that use more modern key + types. + + https://github.com/curl/curl/issues/8586 17.4 Support CURLOPT_PREQUOTE The two other QUOTE options are supported for SFTP, but this was left out for - unknown reasons! + unknown reasons. + +17.5 SSH over HTTPS proxy with more backends + + The SSH based protocols SFTP and SCP did not work over HTTPS proxy at + all until PR https://github.com/curl/curl/pull/6021 brought the + functionality with the libssh2 backend. Presumably, this support + can/could be added for the other backends as well. + +17.6 SFTP with SCP:// + + OpenSSH 9 switched their 'scp' tool to speak SFTP under the hood. Going + forward it might be worth having curl or libcurl attempt SFTP if SCP fails to + follow suite. 18. Command line tool @@ -861,35 +1027,35 @@ that doesn't exist on the server, just like --ftp-create-dirs. Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'. This is easily scripted though. -18.3 prevent file overwriting +18.4 --proxycommand + + Allow the user to make curl run a command and use its stdio to make requests + and not do any network connection by itself. Example: + + curl --proxycommand 'ssh pi@raspberrypi.local -W 10.1.1.75 80' \ + http://some/otherwise/unavailable/service.php - Add an option that prevents curl from overwriting existing local files. When - used, and there already is an existing file with the target file name - (either -O or -o), a number should be appended (and increased if already - existing). So that index.html becomes first index.html.1 and then - index.html.2 etc. + See https://github.com/curl/curl/issues/4941 -18.4 simultaneous parallel transfers +18.5 UTF-8 filenames in Content-Disposition - The client could be told to use maximum N simultaneous parallel transfers and - then just make sure that happens. It should of course not make more than one - connection to the same remote host. This would require the client to use the - multi interface. https://curl.haxx.se/bug/feature.cgi?id=1558595 + RFC 6266 documents how UTF-8 names can be passed to a client in the + Content-Disposition header, and curl does not support this. - Using the multi interface would also allow properly using parallel transfers - with HTTP/2 and supporting HTTP/2 server push from the command line. + https://github.com/curl/curl/issues/1888 -18.6 warning when setting an option +18.6 Option to make -Z merge lined based outputs on stdout - Display a warning when libcurl returns an error when setting an option. - This can be useful to tell when support for a particular feature hasn't been - compiled into the library. + When a user requests multiple lined based files using -Z and sends them to + stdout, curl does not "merge" and send complete lines fine but may send + partial lines from several sources. -18.8 offer color-coded HTTP header output + https://github.com/curl/curl/issues/5175 - By offering different color output on the header name and the header - contents, they could be made more readable and thus help users working on - HTTP services. +18.7 specify which response codes that make -f/--fail return error + + Allows a user to better specify exactly which error code(s) that are fine + and which are errors for their specific uses cases 18.9 Choose the name of file in braces for complex URLs @@ -903,19 +1069,22 @@ that doesn't exist on the server, just like --ftp-create-dirs. See https://github.com/curl/curl/issues/221 -18.10 improve how curl works in a windows console window +18.10 improve how curl works in a Windows console window If you pull the scrollbar when transferring with curl in a Windows console window, the transfer is interrupted and can get disconnected. This can probably be improved. See https://github.com/curl/curl/issues/322 -18.11 -w output to stderr +18.11 Windows: set attribute 'archive' for completed downloads + + The archive bit (FILE_ATTRIBUTE_ARCHIVE, 0x20) separates files that shall be + backed up from those that are either not ready or have not changed. + + Downloads in progress are neither ready to be backed up, nor should they be + opened by a different process. Only after a download has been completed it is + sensible to include it in any integer snapshot or backup of the system. - -w is quite useful, but not to those of us who use curl without -o or -O - (such as for scripting through a higher level language). It would be nice to - have an option that is exactly like -w but sends it to stderr - instead. Proposed name: --write-stderr. See - https://github.com/curl/curl/issues/613 + See https://github.com/curl/curl/issues/3354 18.12 keep running, read instructions from pipe/socket @@ -925,235 +1094,274 @@ that doesn't exist on the server, just like --ftp-create-dirs. invoke can talk to the still running instance and ask for transfers to get done, and thus maintain its connection pool, DNS cache and more. -18.13 support metalink in http headers +18.13 Acknowledge Ratelimit headers - Curl has support for downloading a metalink xml file, processing it, and then - downloading the target of the metalink. This is done via the --metalink option. - It would be nice if metalink also supported downloading via metalink - information that is stored in HTTP headers (RFC 6249). Theoretically this could - also be supported with the --metalink option. + Consider a command line option that can make curl do multiple serial requests + while acknowledging server specified rate limits: + https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/ - See https://tools.ietf.org/html/rfc6249 + See https://github.com/curl/curl/issues/5406 - See also https://lists.gnu.org/archive/html/bug-wget/2015-06/msg00034.html for - an implematation of this in wget. +18.14 --dry-run -18.14 --fail without --location should treat 3xx as a failure + A command line option that makes curl show exactly what it would do and send + if it would run for real. - To allow a command line like this to detect a redirect and consider it a - failure: - - curl -v --fail -O https://example.com/curl-7.48.0.tar.gz - - ... --fail must treat 3xx responses as failures too. The least problematic - way to implement this is probably to add that new logic in the command line - tool only and not in the underlying CURLOPT_FAILONERROR logic. + See https://github.com/curl/curl/issues/5426 18.15 --retry should resume When --retry is used and curl actually retries transfer, it should use the already transferred data and do a resumed transfer for the rest (when - possible) so that it doesn't have to transfer the same data again that was + possible) so that it does not have to transfer the same data again that was already transferred before the retry. See https://github.com/curl/curl/issues/1084 -18.16 send only part of --data - - When the user only wants to send a small piece of the data provided with - --data or --data-binary, like when that data is a huge file, consider a way - to specify that curl should only send a piece of that. One suggested syntax - would be: "--data-binary @largefile.zip!1073741823-2147483647". - - See https://github.com/curl/curl/issues/1200 - -18.17 consider file name from the redirected URL with -O ? +18.17 consider filename from the redirected URL with -O ? When a user gives a URL and uses -O, and curl follows a redirect to a new - URL, the file name is not extracted and used from the newly redirected-to URL - even if the new URL may have a much more sensible file name. + URL, the filename is not extracted and used from the newly redirected-to URL + even if the new URL may have a much more sensible filename. - This is clearly documented and helps for security since there's no surprise - to users which file name that might get overwritten. But maybe a new option + This is clearly documented and helps for security since there is no surprise + to users which filename that might get overwritten, but maybe a new option could allow for this or maybe -J should imply such a treatment as well as -J - already allows for the server to decide what file name to use so it already + already allows for the server to decide what filename to use so it already provides the "may overwrite any file" risk. - This is extra tricky if the original URL has no file name part at all since - then the current code path will error out with an error message, and we can't - *know* already at that point if curl will be redirected to a URL that has a - file name... + This is extra tricky if the original URL has no filename part at all since + then the current code path does error out with an error message, and we + cannot *know* already at that point if curl is redirected to a URL that has a + filename... See https://github.com/curl/curl/issues/1241 -19. Build +18.18 retry on network is unreachable -19.1 roffit + The --retry option retries transfers on "transient failures". We later added + --retry-connrefused to also retry for "connection refused" errors. - Consider extending 'roffit' to produce decent ASCII output, and use that - instead of (g)nroff when building src/tool_hugehelp.c + Suggestions have been brought to also allow retry on "network is unreachable" + errors and while totally reasonable, maybe we should consider a way to make + this more configurable than to add a new option for every new error people + want to retry for? -19.2 Enable PIE and RELRO by default + https://github.com/curl/curl/issues/1603 - Especially when having programs that execute curl via the command line, PIE - renders the exploitation of memory corruption vulnerabilities a lot more - difficult. This can be attributed to the additional information leaks being - required to conduct a successful attack. RELRO, on the other hand, masks - different binary sections like the GOT as read-only and thus kills a handful - of techniques that come in handy when attackers are able to arbitrarily - overwrite memory. A few tests showed that enabling these features had close - to no impact, neither on the performance nor on the general functionality of - curl. +18.19 expand ~/ in config files + For example .curlrc could benefit from being able to do this. -20. Test suite + See https://github.com/curl/curl/issues/2317 -20.1 SSL tunnel +18.20 hostname sections in config files - Make our own version of stunnel for simple port forwarding to enable HTTPS - and FTP-SSL tests without the stunnel dependency, and it could allow us to - provide test tools built with either OpenSSL or GnuTLS + config files would be more powerful if they could set different + configurations depending on used URLs, hostname or possibly origin. Then a + default .curlrc could a specific user-agent only when doing requests against + a certain site. -20.2 nicer lacking perl message +18.21 retry on the redirected-to URL - If perl wasn't found by the configure script, don't attempt to run the tests - but explain something nice why it doesn't. + When curl is told to --retry a failed transfer and follows redirects, it + might get an HTTP 429 response from the redirected-to URL and not the + original one, which then could make curl decide to rather retry the transfer + on that URL only instead of the original operation to the original URL. -20.3 more protocols supported + Perhaps extra emphasized if the original transfer is a large POST that + redirects to a separate GET, and that GET is what gets the 529 - Extend the test suite to include more protocols. The telnet could just do FTP - or http operations (for which we have test servers). + See https://github.com/curl/curl/issues/5462 -20.4 more platforms supported +18.23 Set the modification date on an uploaded file - Make the test suite work on more platforms. OpenBSD and Mac OS. Remove - fork()s and it should become even more portable. + For SFTP and possibly FTP, curl could offer an option to set the + modification time for the uploaded file. -20.5 Add support for concurrent connections + See https://github.com/curl/curl/issues/5768 - Tests 836, 882 and 938 were designed to verify that separate connections aren't - used when using different login credentials in protocols that shouldn't re-use - a connection under such circumstances. +18.24 Use multiple parallel transfers for a single download - Unfortunately, ftpserver.pl doesn't appear to support multiple concurrent - connections. The read while() loop seems to loop until it receives a disconnect - from the client, where it then enters the waiting for connections loop. When - the client opens a second connection to the server, the first connection hasn't - been dropped (unless it has been forced - which we shouldn't do in these tests) - and thus the wait for connections loop is never entered to receive the second - connection. + To enhance transfer speed, downloading a single URL can be split up into + multiple separate range downloads that get combined into a single final + result. -20.6 Use the RFC6265 test suite + An ideal implementation would not use a specified number of parallel + transfers, but curl could: + - First start getting the full file as transfer A + - If after N seconds have passed and the transfer is expected to continue for + M seconds or more, add a new transfer (B) that asks for the second half of + A's content (and stop A at the middle). + - If splitting up the work improves the transfer rate, it could then be done + again. Then again, etc up to a limit. - A test suite made for HTTP cookies (RFC 6265) by Adam Barth is available at - https://github.com/abarth/http-state/tree/master/tests + This way, if transfer B fails (because Range: is not supported) it lets + transfer A remain the single one. N and M could be set to some sensible + defaults. - It'd be really awesome if someone would write a script/setup that would run - curl with that test suite and detect deviances. Ideally, that would even be - incorporated into our regular test suite. + See https://github.com/curl/curl/issues/5774 +18.25 Prevent terminal injection when writing to terminal -21. Next SONAME bump + curl could offer an option to make escape sequence either non-functional or + avoid cursor moves or similar to reduce the risk of a user getting tricked by + clever tricks. -21.1 http-style HEAD output for FTP + See https://github.com/curl/curl/issues/6150 - #undef CURL_FTP_HTTPSTYLE_HEAD in lib/ftp.c to remove the HTTP-style headers - from being output in NOBODY requests over FTP +18.26 Custom progress meter update interval -21.2 combine error codes + Users who are for example doing large downloads in CI or remote setups might + want the occasional progress meter update to see that the transfer is + progressing and has not stuck, but they may not appreciate the + many-times-a-second frequency curl can end up doing it with now. - Combine some of the error codes to remove duplicates. The original - numbering should not be changed, and the old identifiers would be - macroed to the new ones in an CURL_NO_OLDIES section to help with - backward compatibility. +18.27 -J and -O with %-encoded filenames - Candidates for removal and their replacements: + -J/--remote-header-name does not decode %-encoded filenames. RFC 6266 details + how it should be done. The can of worm is basically that we have no charset + handling in curl and ASCII >=128 is a challenge for us. Not to mention that + decoding also means that we need to check for nastiness that is attempted, + like "../" sequences and the like. Probably everything to the left of any + embedded slashes should be cut off. + https://curl.se/bug/view.cgi?id=1294 - CURLE_FILE_COULDNT_READ_FILE => CURLE_REMOTE_FILE_NOT_FOUND + -O also does not decode %-encoded names, and while it has even less + information about the charset involved the process is similar to the -J case. - CURLE_FTP_COULDNT_RETR_FILE => CURLE_REMOTE_FILE_NOT_FOUND + Note that we do not decode -O without the user asking for it with some other + means, since -O has always been documented to use the name exactly as + specified in the URL. - CURLE_FTP_COULDNT_USE_REST => CURLE_RANGE_ERROR +18.28 -J with -C - - CURLE_FUNCTION_NOT_FOUND => CURLE_FAILED_INIT + When using -J (with -O), automatically resumed downloading together with "-C + -" fails. Without -J the same command line works. This happens because the + resume logic is worked out before the target filename (and thus its + pre-transfer size) has been figured out. This can be improved. - CURLE_LDAP_INVALID_URL => CURLE_URL_MALFORMAT + https://curl.se/bug/view.cgi?id=1169 - CURLE_TFTP_NOSUCHUSER => CURLE_TFTP_ILLEGAL +18.29 --retry and transfer timeouts - CURLE_TFTP_NOTFOUND => CURLE_REMOTE_FILE_NOT_FOUND + If using --retry and the transfer timeouts (possibly due to using -m or + -y/-Y) the next attempt does not resume the transfer properly from what was + downloaded in the previous attempt but truncates and restarts at the original + position where it was at before the previous failed attempt. See + https://curl.se/mail/lib-2008-01/0080.html and Mandriva bug report + https://qa.mandriva.com/show_bug.cgi?id=22565 - CURLE_TFTP_PERM => CURLE_REMOTE_ACCESS_DENIED -21.3 extend CURLOPT_SOCKOPTFUNCTION prototype +19. Build + +19.2 Enable PIE and RELRO by default - The current prototype only provides 'purpose' that tells what the - connection/socket is for, but not any protocol or similar. It makes it hard - for applications to differentiate on TCP vs UDP and even HTTP vs FTP and - similar. + Especially when having programs that execute curl via the command line, PIE + renders the exploitation of memory corruption vulnerabilities a lot more + difficult. This can be attributed to the additional information leaks being + required to conduct a successful attack. RELRO, on the other hand, masks + different binary sections like the GOT as read-only and thus kills a handful + of techniques that come in handy when attackers are able to arbitrarily + overwrite memory. A few tests showed that enabling these features had close + to no impact, neither on the performance nor on the general functionality of + curl. -22. Next major release +19.3 Do not use GNU libtool on OpenBSD -22.1 cleanup return codes + When compiling curl on OpenBSD with "--enable-debug" it gives linking errors + when you use GNU libtool. This can be fixed by using the libtool provided by + OpenBSD itself. However for this the user always needs to invoke make with + "LIBTOOL=/usr/bin/libtool". It would be nice if the script could have some + magic to detect if this system is an OpenBSD host and then use the OpenBSD + libtool instead. - curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a - CURLMcode. These should be changed to be the same. + See https://github.com/curl/curl/issues/5862 -22.2 remove obsolete defines +19.4 Package curl for Windows in a signed installer - remove obsolete defines from curl/curl.h + See https://github.com/curl/curl/issues/5424 -22.3 size_t +19.5 make configure use --cache-file more and better - make several functions use size_t instead of int in their APIs + The configure script can be improved to cache more values so that repeated + invokes run much faster. -22.4 remove several functions + See https://github.com/curl/curl/issues/7753 - remove the following functions from the public API: +20. Test suite - curl_getenv +20.1 SSL tunnel + + Make our own version of stunnel for simple port forwarding to enable HTTPS + and FTP-SSL tests without the stunnel dependency, and it could allow us to + provide test tools built with either OpenSSL or GnuTLS + +20.2 more protocols supported + + Extend the test suite to include more protocols. The telnet could just do FTP + or http operations (for which we have test servers). + +20.3 more platforms supported + + Make the test suite work on more platforms. OpenBSD and macOS. Remove + fork()s and it should become even more portable. + +20.4 write an SMB test server to replace impacket + + This would allow us to run SMB tests on more platforms and do better and more + covering tests. + + See https://github.com/curl/curl/issues/15697 + +20.5 Use the RFC 6265 test suite + + A test suite made for HTTP cookies (RFC 6265) by Adam Barth is available at + https://github.com/abarth/http-state/tree/master/tests + + It would be good if someone would write a script/setup that would run curl + with that test suite and detect deviances. Ideally, that would even be + incorporated into our regular test suite. - curl_mprintf (and variations) +20.6 Run web-platform-tests URL tests - curl_strequal + Run web-platform-tests URL tests and compare results with browsers on wpt.fyi - curl_strnequal + It would help us find issues to fix and help us document where our parser + differs from the WHATWG URL spec parsers. - They will instead become curlx_ - alternatives. That makes the curl app - still capable of using them, by building with them from source. + See https://github.com/curl/curl/issues/4477 - These functions have no purpose anymore: +21. MQTT - curl_multi_socket +21.1 Support rate-limiting - curl_multi_socket_all + The rate-limiting logic is done in the PERFORMING state in multi.c but MQTT + is not (yet) implemented to use that. -22.5 remove CURLOPT_FAILONERROR +21.2 Support MQTTS - Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird - internally. Let the app judge success or not for itself. +21.3 Handle network blocks -22.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE + Running test suite with + `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a mqtt` makes several + MQTT test cases fail where they should not. - Remove support for a global DNS cache. Anything global is silly, and we - already offer the share interface for the same functionality but done - "right". +22. TFTP -22.7 remove progress meter from libcurl +22.1 TFTP does not convert LF to CRLF for mode=netascii - The internally provided progress meter output doesn't belong in the library. - Basically no application wants it (apart from curl) but instead applications - can and should do their own progress meters using the progress callback. + RFC 3617 defines that an TFTP transfer can be done using "netascii" + mode. curl does not support extracting that mode from the URL nor does it treat + such transfers specifically. It should probably do LF to CRLF translations + for them. - The progress callback should then be bumped as well to get proper 64bit - variable types passed to it instead of doubles so that big files work - correctly. + See https://github.com/curl/curl/issues/12655 -22.8 remove 'curl_httppost' from public +23. Gopher - curl_formadd() was made to fill in a public struct, but the fact that the - struct is public is never really used by application for their own advantage - but instead often restricts how the form functions can or can't be modified. +23.1 Handle network blocks - Changing them to return a private handle will benefit the implementation and - allow us much greater freedoms while still maintaining a solid API and ABI. + Running test suite with + `CURL_DBG_SOCK_WBLOCK=90 ./runtests.pl -a 1200 to 1300` makes several + Gopher test cases fail where they should not. diff --git a/curl/docs/TheArtOfHttpScripting b/curl/docs/TheArtOfHttpScripting deleted file mode 100644 index b2bd9db7a..000000000 --- a/curl/docs/TheArtOfHttpScripting +++ /dev/null @@ -1,758 +0,0 @@ - _ _ ____ _ - ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - -The Art Of Scripting HTTP Requests Using Curl - - 1. HTTP Scripting - 1.1 Background - 1.2 The HTTP Protocol - 1.3 See the Protocol - 1.4 See the Timing - 1.5 See the Response - 2. URL - 2.1 Spec - 2.2 Host - 2.3 Port number - 2.4 User name and password - 2.5 Path part - 3. Fetch a page - 3.1 GET - 3.2 HEAD - 3.3 Multiple URLs in a single command line - 3.4 Multiple HTTP methods in a single command line - 4. HTML forms - 4.1 Forms explained - 4.2 GET - 4.3 POST - 4.4 File Upload POST - 4.5 Hidden Fields - 4.6 Figure Out What A POST Looks Like - 5. HTTP upload - 5.1 PUT - 6. HTTP Authentication - 6.1 Basic Authentication - 6.2 Other Authentication - 6.3 Proxy Authentication - 6.4 Hiding credentials - 7. More HTTP Headers - 7.1 Referer - 7.2 User Agent - 8. Redirects - 8.1 Location header - 8.2 Other redirects - 9. Cookies - 9.1 Cookie Basics - 9.2 Cookie options - 10. HTTPS - 10.1 HTTPS is HTTP secure - 10.2 Certificates - 11. Custom Request Elements - 11.1 Modify method and headers - 11.2 More on changed methods - 12. Web Login - 12.1 Some login tricks - 13. Debug - 13.1 Some debug tricks - 14. References - 14.1 Standards - 14.2 Sites - -============================================================================== - -1. HTTP Scripting - - 1.1 Background - - This document assumes that you're familiar with HTML and general networking. - - The increasing amount of applications moving to the web has made "HTTP - Scripting" more frequently requested and wanted. To be able to automatically - extract information from the web, to fake users, to post or upload data to - web servers are all important tasks today. - - Curl is a command line tool for doing all sorts of URL manipulations and - transfers, but this particular document will focus on how to use it when - doing HTTP requests for fun and profit. I'll assume that you know how to - invoke 'curl --help' or 'curl --manual' to get basic information about it. - - Curl is not written to do everything for you. It makes the requests, it gets - the data, it sends data and it retrieves the information. You probably need - to glue everything together using some kind of script language or repeated - manual invokes. - - 1.2 The HTTP Protocol - - HTTP is the protocol used to fetch data from web servers. It is a very simple - protocol that is built upon TCP/IP. The protocol also allows information to - get sent to the server from the client using a few different methods, as will - be shown here. - - HTTP is plain ASCII text lines being sent by the client to a server to - request a particular action, and then the server replies a few text lines - before the actual requested content is sent to the client. - - The client, curl, sends a HTTP request. The request contains a method (like - GET, POST, HEAD etc), a number of request headers and sometimes a request - body. The HTTP server responds with a status line (indicating if things went - well), response headers and most often also a response body. The "body" part - is the plain data you requested, like the actual HTML or the image etc. - - 1.3 See the Protocol - - Using curl's option --verbose (-v as a short option) will display what kind - of commands curl sends to the server, as well as a few other informational - texts. - - --verbose is the single most useful option when it comes to debug or even - understand the curl<->server interaction. - - Sometimes even --verbose is not enough. Then --trace and --trace-ascii offer - even more details as they show EVERYTHING curl sends and receives. Use it - like this: - - curl --trace-ascii debugdump.txt http://www.example.com/ - - 1.4 See the Timing - - Many times you may wonder what exactly is taking all the time, or you just - want to know the amount of milliseconds between two points in a - transfer. For those, and other similar situations, the --trace-time option - is what you need. It'll prepend the time to each trace output line: - - curl --trace-ascii d.txt --trace-time http://example.com/ - - 1.5 See the Response - - By default curl sends the response to stdout. You need to redirect it - somewhere to avoid that, most often that is done with -o or -O. - -2. URL - - 2.1 Spec - - The Uniform Resource Locator format is how you specify the address of a - particular resource on the Internet. You know these, you've seen URLs like - https://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the - canonical spec. And yeah, the formal name is not URL, it is URI. - - 2.2 Host - - The host name is usually resolved using DNS or your /etc/hosts file to an IP - address and that's what curl will communicate with. Alternatively you specify - the IP address directly in the URL instead of a name. - - For development and other trying out situations, you can point to a different - IP address for a host name than what would otherwise be used, by using curl's - --resolve option: - - curl --resolve www.example.org:80:127.0.0.1 http://www.example.org/ - - 2.3 Port number - - Each protocol curl supports operates on a default port number, be it over TCP - or in some cases UDP. Normally you don't have to take that into - consideration, but at times you run test servers on other ports or - similar. Then you can specify the port number in the URL with a colon and a - number immediately following the host name. Like when doing HTTP to port - 1234: - - curl http://www.example.org:1234/ - - The port number you specify in the URL is the number that the server uses to - offer its services. Sometimes you may use a local proxy, and then you may - need to specify that proxy's port number separately for what curl needs to - connect to locally. Like when using a HTTP proxy on port 4321: - - curl --proxy http://proxy.example.org:4321 http://remote.example.org/ - - 2.4 User name and password - - Some services are setup to require HTTP authentication and then you need to - provide name and password which is then transferred to the remote site in - various ways depending on the exact authentication protocol used. - - You can opt to either insert the user and password in the URL or you can - provide them separately: - - curl http://user:password@example.org/ - - or - - curl -u user:password http://example.org/ - - You need to pay attention that this kind of HTTP authentication is not what - is usually done and requested by user-oriented web sites these days. They - tend to use forms and cookies instead. - - 2.5 Path part - - The path part is just sent off to the server to request that it sends back - the associated response. The path is what is to the right side of the slash - that follows the host name and possibly port number. - -3. Fetch a page - - 3.1 GET - - The simplest and most common request/operation made using HTTP is to GET a - URL. The URL could itself refer to a web page, an image or a file. The client - issues a GET request to the server and receives the document it asked for. - If you issue the command line - - curl https://curl.haxx.se - - you get a web page returned in your terminal window. The entire HTML document - that that URL holds. - - All HTTP replies contain a set of response headers that are normally hidden, - use curl's --include (-i) option to display them as well as the rest of the - document. - - 3.2 HEAD - - You can ask the remote server for ONLY the headers by using the --head (-I) - option which will make curl issue a HEAD request. In some special cases - servers deny the HEAD method while others still work, which is a particular - kind of annoyance. - - The HEAD method is defined and made so that the server returns the headers - exactly the way it would do for a GET, but without a body. It means that you - may see a Content-Length: in the response headers, but there must not be an - actual body in the HEAD response. - - 3.3 Multiple URLs in a single command line - - A single curl command line may involve one or many URLs. The most common case - is probably to just use one, but you can specify any amount of URLs. Yes - any. No limits. You'll then get requests repeated over and over for all the - given URLs. - - Example, send two GETs: - - curl http://url1.example.com http://url2.example.com - - If you use --data to POST to the URL, using multiple URLs means that you send - that same POST to all the given URLs. - - Example, send two POSTs: - - curl --data name=curl http://url1.example.com http://url2.example.com - - - 3.4 Multiple HTTP methods in a single command line - - Sometimes you need to operate on several URLs in a single command line and do - different HTTP methods on each. For this, you'll enjoy the --next option. It - is basically a separator that separates a bunch of options from the next. All - the URLs before --next will get the same method and will get all the POST - data merged into one. - - When curl reaches the --next on the command line, it'll sort of reset the - method and the POST data and allow a new set. - - Perhaps this is best shown with a few examples. To send first a HEAD and then - a GET: - - curl -I http://example.com --next http://example.com - - To first send a POST and then a GET: - - curl -d score=10 http://example.com/post.cgi --next http://example.com/results.html - - -4. HTML forms - - 4.1 Forms explained - - Forms are the general way a web site can present a HTML page with fields for - the user to enter data in, and then press some kind of 'OK' or 'Submit' - button to get that data sent to the server. The server then typically uses - the posted data to decide how to act. Like using the entered words to search - in a database, or to add the info in a bug tracking system, display the entered - address on a map or using the info as a login-prompt verifying that the user - is allowed to see what it is about to see. - - Of course there has to be some kind of program on the server end to receive - the data you send. You cannot just invent something out of the air. - - 4.2 GET - - A GET-form uses the method GET, as specified in HTML like: - -
- - -
- - In your favorite browser, this form will appear with a text box to fill in - and a press-button labeled "OK". If you fill in '1905' and press the OK - button, your browser will then create a new URL to get for you. The URL will - get "junk.cgi?birthyear=1905&press=OK" appended to the path part of the - previous URL. - - If the original form was seen on the page "www.hotmail.com/when/birth.html", - the second page you'll get will become - "www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK". - - Most search engines work this way. - - To make curl do the GET form post for you, just enter the expected created - URL: - - curl "http://www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK" - - 4.3 POST - - The GET method makes all input field names get displayed in the URL field of - your browser. That's generally a good thing when you want to be able to - bookmark that page with your given data, but it is an obvious disadvantage - if you entered secret information in one of the fields or if there are a - large amount of fields creating a very long and unreadable URL. - - The HTTP protocol then offers the POST method. This way the client sends the - data separated from the URL and thus you won't see any of it in the URL - address field. - - The form would look very similar to the previous one: - -
- - -
- - And to use curl to post this form with the same data filled in as before, we - could do it like: - - curl --data "birthyear=1905&press=%20OK%20" \ - http://www.example.com/when.cgi - - This kind of POST will use the Content-Type - application/x-www-form-urlencoded and is the most widely used POST kind. - - The data you send to the server MUST already be properly encoded, curl will - not do that for you. For example, if you want the data to contain a space, - you need to replace that space with %20 etc. Failing to comply with this - will most likely cause your data to be received wrongly and messed up. - - Recent curl versions can in fact url-encode POST data for you, like this: - - curl --data-urlencode "name=I am Daniel" http://www.example.com - - If you repeat --data several times on the command line, curl will - concatenate all the given data pieces - and put a '&' symbol between each - data segment. - - 4.4 File Upload POST - - Back in late 1995 they defined an additional way to post data over HTTP. It - is documented in the RFC 1867, why this method sometimes is referred to as - RFC1867-posting. - - This method is mainly designed to better support file uploads. A form that - allows a user to upload a file could be written like this in HTML: - -
- - -
- - This clearly shows that the Content-Type about to be sent is - multipart/form-data. - - To post to a form like this with curl, you enter a command line like: - - curl --form upload=@localfilename --form press=OK [URL] - - 4.5 Hidden Fields - - A very common way for HTML based applications to pass state information - between pages is to add hidden fields to the forms. Hidden fields are - already filled in, they aren't displayed to the user and they get passed - along just as all the other fields. - - A similar example form with one visible field, one hidden field and one - submit button could look like: - -
- - - -
- - To POST this with curl, you won't have to think about if the fields are - hidden or not. To curl they're all the same: - - curl --data "birthyear=1905&press=OK&person=daniel" [URL] - - 4.6 Figure Out What A POST Looks Like - - When you're about fill in a form and send to a server by using curl instead - of a browser, you're of course very interested in sending a POST exactly the - way your browser does. - - An easy way to get to see this, is to save the HTML page with the form on - your local disk, modify the 'method' to a GET, and press the submit button - (you could also change the action URL if you want to). - - You will then clearly see the data get appended to the URL, separated with a - '?'-letter as GET forms are supposed to. - -5. HTTP upload - - 5.1 PUT - - Perhaps the best way to upload data to a HTTP server is to use PUT. Then - again, this of course requires that someone put a program or script on the - server end that knows how to receive a HTTP PUT stream. - - Put a file to a HTTP server with curl: - - curl --upload-file uploadfile http://www.example.com/receive.cgi - -6. HTTP Authentication - - 6.1 Basic Authentication - - HTTP Authentication is the ability to tell the server your username and - password so that it can verify that you're allowed to do the request you're - doing. The Basic authentication used in HTTP (which is the type curl uses by - default) is *plain* *text* based, which means it sends username and password - only slightly obfuscated, but still fully readable by anyone that sniffs on - the network between you and the remote server. - - To tell curl to use a user and password for authentication: - - curl --user name:password http://www.example.com - - 6.2 Other Authentication - - The site might require a different authentication method (check the headers - returned by the server), and then --ntlm, --digest, --negotiate or even - --anyauth might be options that suit you. - - 6.3 Proxy Authentication - - Sometimes your HTTP access is only available through the use of a HTTP - proxy. This seems to be especially common at various companies. A HTTP proxy - may require its own user and password to allow the client to get through to - the Internet. To specify those with curl, run something like: - - curl --proxy-user proxyuser:proxypassword curl.haxx.se - - If your proxy requires the authentication to be done using the NTLM method, - use --proxy-ntlm, if it requires Digest use --proxy-digest. - - If you use any one of these user+password options but leave out the password - part, curl will prompt for the password interactively. - - 6.4 Hiding credentials - - Do note that when a program is run, its parameters might be possible to see - when listing the running processes of the system. Thus, other users may be - able to watch your passwords if you pass them as plain command line - options. There are ways to circumvent this. - - It is worth noting that while this is how HTTP Authentication works, very - many web sites will not use this concept when they provide logins etc. See - the Web Login chapter further below for more details on that. - -7. More HTTP Headers - - 7.1 Referer - - A HTTP request may include a 'referer' field (yes it is misspelled), which - can be used to tell from which URL the client got to this particular - resource. Some programs/scripts check the referer field of requests to verify - that this wasn't arriving from an external site or an unknown page. While - this is a stupid way to check something so easily forged, many scripts still - do it. Using curl, you can put anything you want in the referer-field and - thus more easily be able to fool the server into serving your request. - - Use curl to set the referer field with: - - curl --referer http://www.example.come http://www.example.com - - 7.2 User Agent - - Very similar to the referer field, all HTTP requests may set the User-Agent - field. It names what user agent (client) that is being used. Many - applications use this information to decide how to display pages. Silly web - programmers try to make different pages for users of different browsers to - make them look the best possible for their particular browsers. They usually - also do different kinds of javascript, vbscript etc. - - At times, you will see that getting a page with curl will not return the same - page that you see when getting the page with your browser. Then you know it - is time to set the User Agent field to fool the server into thinking you're - one of those browsers. - - To make curl look like Internet Explorer 5 on a Windows 2000 box: - - curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL] - - Or why not look like you're using Netscape 4.73 on an old Linux box: - - curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL] - -8. Redirects - - 8.1 Location header - - When a resource is requested from a server, the reply from the server may - include a hint about where the browser should go next to find this page, or a - new page keeping newly generated output. The header that tells the browser - to redirect is Location:. - - Curl does not follow Location: headers by default, but will simply display - such pages in the same manner it displays all HTTP replies. It does however - feature an option that will make it attempt to follow the Location: pointers. - - To tell curl to follow a Location: - - curl --location http://www.example.com - - If you use curl to POST to a site that immediately redirects you to another - page, you can safely use --location (-L) and --data/--form together. Curl will - only use POST in the first request, and then revert to GET in the following - operations. - - 8.2 Other redirects - - Browser typically support at least two other ways of redirects that curl - doesn't: first the html may contain a meta refresh tag that asks the browser - to load a specific URL after a set number of seconds, or it may use - javascript to do it. - -9. Cookies - - 9.1 Cookie Basics - - The way the web browsers do "client side state control" is by using - cookies. Cookies are just names with associated contents. The cookies are - sent to the client by the server. The server tells the client for what path - and host name it wants the cookie sent back, and it also sends an expiration - date and a few more properties. - - When a client communicates with a server with a name and path as previously - specified in a received cookie, the client sends back the cookies and their - contents to the server, unless of course they are expired. - - Many applications and servers use this method to connect a series of requests - into a single logical session. To be able to use curl in such occasions, we - must be able to record and send back cookies the way the web application - expects them. The same way browsers deal with them. - - 9.2 Cookie options - - The simplest way to send a few cookies to the server when getting a page with - curl is to add them on the command line like: - - curl --cookie "name=Daniel" http://www.example.com - - Cookies are sent as common HTTP headers. This is practical as it allows curl - to record cookies simply by recording headers. Record cookies with curl by - using the --dump-header (-D) option like: - - curl --dump-header headers_and_cookies http://www.example.com - - (Take note that the --cookie-jar option described below is a better way to - store cookies.) - - Curl has a full blown cookie parsing engine built-in that comes in use if you - want to reconnect to a server and use cookies that were stored from a - previous connection (or hand-crafted manually to fool the server into - believing you had a previous connection). To use previously stored cookies, - you run curl like: - - curl --cookie stored_cookies_in_file http://www.example.com - - Curl's "cookie engine" gets enabled when you use the --cookie option. If you - only want curl to understand received cookies, use --cookie with a file that - doesn't exist. Example, if you want to let curl understand cookies from a - page and follow a location (and thus possibly send back cookies it received), - you can invoke it like: - - curl --cookie nada --location http://www.example.com - - Curl has the ability to read and write cookie files that use the same file - format that Netscape and Mozilla once used. It is a convenient way to share - cookies between scripts or invokes. The --cookie (-b) switch automatically - detects if a given file is such a cookie file and parses it, and by using the - --cookie-jar (-c) option you'll make curl write a new cookie file at the end - of an operation: - - curl --cookie cookies.txt --cookie-jar newcookies.txt \ - http://www.example.com - -10. HTTPS - - 10.1 HTTPS is HTTP secure - - There are a few ways to do secure HTTP transfers. By far the most common - protocol for doing this is what is generally known as HTTPS, HTTP over - SSL. SSL encrypts all the data that is sent and received over the network and - thus makes it harder for attackers to spy on sensitive information. - - SSL (or TLS as the latest version of the standard is called) offers a - truckload of advanced features to allow all those encryptions and key - infrastructure mechanisms encrypted HTTP requires. - - Curl supports encrypted fetches when built to use a TLS library and it can be - built to use one out of a fairly large set of libraries - "curl -V" will show - which one your curl was built to use (if any!). To get a page from a HTTPS - server, simply run curl like: - - curl https://secure.example.com - - 10.2 Certificates - - In the HTTPS world, you use certificates to validate that you are the one - you claim to be, as an addition to normal passwords. Curl supports client- - side certificates. All certificates are locked with a pass phrase, which you - need to enter before the certificate can be used by curl. The pass phrase - can be specified on the command line or if not, entered interactively when - curl queries for it. Use a certificate with curl on a HTTPS server like: - - curl --cert mycert.pem https://secure.example.com - - curl also tries to verify that the server is who it claims to be, by - verifying the server's certificate against a locally stored CA cert - bundle. Failing the verification will cause curl to deny the connection. You - must then use --insecure (-k) in case you want to tell curl to ignore that - the server can't be verified. - - More about server certificate verification and ca cert bundles can be read - in the SSLCERTS document, available online here: - - https://curl.haxx.se/docs/sslcerts.html - - At times you may end up with your own CA cert store and then you can tell - curl to use that to verify the server's certificate: - - curl --cacert ca-bundle.pem https://example.com/ - - -11. Custom Request Elements - -11.1 Modify method and headers - - Doing fancy stuff, you may need to add or change elements of a single curl - request. - - For example, you can change the POST request to a PROPFIND and send the data - as "Content-Type: text/xml" (instead of the default Content-Type) like this: - - curl --data "" --header "Content-Type: text/xml" \ - --request PROPFIND url.com - - You can delete a default header by providing one without content. Like you - can ruin the request by chopping off the Host: header: - - curl --header "Host:" http://www.example.com - - You can add headers the same way. Your server may want a "Destination:" - header, and you can add it: - - curl --header "Destination: http://nowhere" http://example.com - - 11.2 More on changed methods - - It should be noted that curl selects which methods to use on its own - depending on what action to ask for. -d will do POST, -I will do HEAD and so - on. If you use the --request / -X option you can change the method keyword - curl selects, but you will not modify curl's behavior. This means that if you - for example use -d "data" to do a POST, you can modify the method to a - PROPFIND with -X and curl will still think it sends a POST. You can change - the normal GET to a POST method by simply adding -X POST in a command line - like: - - curl -X POST http://example.org/ - - ... but curl will still think and act as if it sent a GET so it won't send any - request body etc. - - -12. Web Login - - 12.1 Some login tricks - - While not strictly just HTTP related, it still causes a lot of people problems - so here's the executive run-down of how the vast majority of all login forms - work and how to login to them using curl. - - It can also be noted that to do this properly in an automated fashion, you - will most certainly need to script things and do multiple curl invokes etc. - - First, servers mostly use cookies to track the logged-in status of the - client, so you will need to capture the cookies you receive in the - responses. Then, many sites also set a special cookie on the login page (to - make sure you got there through their login page) so you should make a habit - of first getting the login-form page to capture the cookies set there. - - Some web-based login systems feature various amounts of javascript, and - sometimes they use such code to set or modify cookie contents. Possibly they - do that to prevent programmed logins, like this manual describes how to... - Anyway, if reading the code isn't enough to let you repeat the behavior - manually, capturing the HTTP requests done by your browsers and analyzing the - sent cookies is usually a working method to work out how to shortcut the - javascript need. - - In the actual
tag for the login, lots of sites fill-in random/session - or otherwise secretly generated hidden tags and you may need to first capture - the HTML code for the login form and extract all the hidden fields to be able - to do a proper login POST. Remember that the contents need to be URL encoded - when sent in a normal POST. - -13. Debug - - 13.1 Some debug tricks - - Many times when you run curl on a site, you'll notice that the site doesn't - seem to respond the same way to your curl requests as it does to your - browser's. - - Then you need to start making your curl requests more similar to your - browser's requests: - - * Use the --trace-ascii option to store fully detailed logs of the requests - for easier analyzing and better understanding - - * Make sure you check for and use cookies when needed (both reading with - --cookie and writing with --cookie-jar) - - * Set user-agent to one like a recent popular browser does - - * Set referer like it is set by the browser - - * If you use POST, make sure you send all the fields and in the same order as - the browser does it. - - A very good helper to make sure you do this right, is the LiveHTTPHeader tool - that lets you view all headers you send and receive with Mozilla/Firefox - (even when using HTTPS). Chrome features similar functionality out of the box - among the developer's tools. - - A more raw approach is to capture the HTTP traffic on the network with tools - such as ethereal or tcpdump and check what headers that were sent and - received by the browser. (HTTPS makes this technique inefficient.) - -14. References - - 14.1 Standards - - RFC 7230 is a must to read if you want in-depth understanding of the HTTP - protocol - - RFC 3986 explains the URL syntax - - RFC 1867 defines the HTTP post upload format - - RFC 6525 defines how HTTP cookies work - - 14.2 Sites - - https://curl.haxx.se is the home of the curl project diff --git a/curl/docs/TheArtOfHttpScripting.md b/curl/docs/TheArtOfHttpScripting.md new file mode 100644 index 000000000..46369d6ea --- /dev/null +++ b/curl/docs/TheArtOfHttpScripting.md @@ -0,0 +1,712 @@ + + +# The Art Of Scripting HTTP Requests Using curl + +## Background + + This document assumes that you are familiar with HTML and general networking. + + The increasing amount of applications moving to the web has made "HTTP + Scripting" more frequently requested and wanted. To be able to automatically + extract information from the web, to fake users, to post or upload data to + web servers are all important tasks today. + + curl is a command line tool for doing all sorts of URL manipulations and + transfers, but this particular document focuses on how to use it when doing + HTTP requests for fun and profit. This documents assumes that you know how to + invoke `curl --help` or `curl --manual` to get basic information about it. + + curl is not written to do everything for you. It makes the requests, it gets + the data, it sends data and it retrieves the information. You probably need + to glue everything together using some kind of script language or repeated + manual invokes. + +## The HTTP Protocol + + HTTP is the protocol used to fetch data from web servers. It is a simple + protocol that is built upon TCP/IP. The protocol also allows information to + get sent to the server from the client using a few different methods, as is + shown here. + + HTTP is plain ASCII text lines being sent by the client to a server to + request a particular action, and then the server replies a few text lines + before the actual requested content is sent to the client. + + The client, curl, sends an HTTP request. The request contains a method (like + GET, POST, HEAD etc), a number of request headers and sometimes a request + body. The HTTP server responds with a status line (indicating if things went + well), response headers and most often also a response body. The "body" part + is the plain data you requested, like the actual HTML or the image etc. + +## See the Protocol + + Using curl's option [`--verbose`](https://curl.se/docs/manpage.html#-v) (`-v` + as a short option) displays what kind of commands curl sends to the server, + as well as a few other informational texts. + + `--verbose` is the single most useful option when it comes to debug or even + understand the curl<->server interaction. + + Sometimes even `--verbose` is not enough. Then + [`--trace`](https://curl.se/docs/manpage.html#-trace) and + [`--trace-ascii`](https://curl.se/docs/manpage.html#--trace-ascii) + offer even more details as they show **everything** curl sends and + receives. Use it like this: + + curl --trace-ascii debugdump.txt http://www.example.com/ + +## See the Timing + + Many times you may wonder what exactly is taking all the time, or you just + want to know the amount of milliseconds between two points in a transfer. For + those, and other similar situations, the + [`--trace-time`](https://curl.se/docs/manpage.html#--trace-time) option is + what you need. It prepends the time to each trace output line: + + curl --trace-ascii d.txt --trace-time http://example.com/ + +## See which Transfer + + When doing parallel transfers, it is relevant to see which transfer is doing + what. When response headers are received (and logged) you need to know which + transfer these are for. + [`--trace-ids`](https://curl.se/docs/manpage.html#--trace-ids) option is what + you need. It prepends the transfer and connection identifier to each trace + output line: + + curl --trace-ascii d.txt --trace-ids http://example.com/ + +## See the Response + + By default curl sends the response to stdout. You need to redirect it + somewhere to avoid that, most often that is done with `-o` or `-O`. + +# URL + +## Spec + + The Uniform Resource Locator format is how you specify the address of a + particular resource on the Internet. You know these, you have seen URLs like + https://curl.se or https://example.com a million times. RFC 3986 is the + canonical spec. The formal name is not URL, it is **URI**. + +## Host + + The hostname is usually resolved using DNS or your /etc/hosts file to an IP + address and that is what curl communicates with. Alternatively you specify + the IP address directly in the URL instead of a name. + + For development and other trying out situations, you can point to a different + IP address for a hostname than what would otherwise be used, by using curl's + [`--resolve`](https://curl.se/docs/manpage.html#--resolve) option: + + curl --resolve www.example.org:80:127.0.0.1 http://www.example.org/ + +## Port number + + Each protocol curl supports operates on a default port number, be it over TCP + or in some cases UDP. Normally you do not have to take that into + consideration, but at times you run test servers on other ports or + similar. Then you can specify the port number in the URL with a colon and a + number immediately following the hostname. Like when doing HTTP to port + 1234: + + curl http://www.example.org:1234/ + + The port number you specify in the URL is the number that the server uses to + offer its services. Sometimes you may use a proxy, and then you may + need to specify that proxy's port number separately from what curl needs to + connect to the server. Like when using an HTTP proxy on port 4321: + + curl --proxy http://proxy.example.org:4321 http://remote.example.org/ + +## Username and password + + Some services are setup to require HTTP authentication and then you need to + provide name and password which is then transferred to the remote site in + various ways depending on the exact authentication protocol used. + + You can opt to either insert the user and password in the URL or you can + provide them separately: + + curl http://user:password@example.org/ + + or + + curl -u user:password http://example.org/ + + You need to pay attention that this kind of HTTP authentication is not what + is usually done and requested by user-oriented websites these days. They tend + to use forms and cookies instead. + +## Path part + + The path part is just sent off to the server to request that it sends back + the associated response. The path is what is to the right side of the slash + that follows the hostname and possibly port number. + +# Fetch a page + +## GET + + The simplest and most common request/operation made using HTTP is to GET a + URL. The URL could itself refer to a webpage, an image or a file. The client + issues a GET request to the server and receives the document it asked for. + If you issue the command line + + curl https://curl.se + + you get a webpage returned in your terminal window. The entire HTML document + this URL identifies. + + All HTTP replies contain a set of response headers that are normally hidden, + use curl's [`--include`](https://curl.se/docs/manpage.html#-i) (`-i`) + option to display them as well as the rest of the document. + +## HEAD + + You can ask the remote server for ONLY the headers by using the + [`--head`](https://curl.se/docs/manpage.html#-I) (`-I`) option which makes + curl issue a HEAD request. In some special cases servers deny the HEAD method + while others still work, which is a particular kind of annoyance. + + The HEAD method is defined and made so that the server returns the headers + exactly the way it would do for a GET, but without a body. It means that you + may see a `Content-Length:` in the response headers, but there must not be an + actual body in the HEAD response. + +## Multiple URLs in a single command line + + A single curl command line may involve one or many URLs. The most common case + is probably to just use one, but you can specify any amount of URLs. Yes any. + No limits. You then get requests repeated over and over for all the given + URLs. + + Example, send two GET requests: + + curl http://url1.example.com http://url2.example.com + + If you use [`--data`](https://curl.se/docs/manpage.html#-d) to POST to + the URL, using multiple URLs means that you send that same POST to all the + given URLs. + + Example, send two POSTs: + + curl --data name=curl http://url1.example.com http://url2.example.com + + +## Multiple HTTP methods in a single command line + + Sometimes you need to operate on several URLs in a single command line and do + different HTTP methods on each. For this, you might enjoy the + [`--next`](https://curl.se/docs/manpage.html#-:) option. It is basically a + separator that separates a bunch of options from the next. All the URLs + before `--next` get the same method and get all the POST data merged into + one. + + When curl reaches the `--next` on the command line, it resets the method and + the POST data and allow a new set. + + Perhaps this is best shown with a few examples. To send first a HEAD and then + a GET: + + curl -I http://example.com --next http://example.com + + To first send a POST and then a GET: + + curl -d score=10 http://example.com/post.cgi --next http://example.com/results.html + +# HTML forms + +## Forms explained + + Forms are the general way a website can present an HTML page with fields for + the user to enter data in, and then press some kind of 'OK' or 'Submit' + button to get that data sent to the server. The server then typically uses + the posted data to decide how to act. Like using the entered words to search + in a database, or to add the info in a bug tracking system, display the + entered address on a map or using the info as a login-prompt verifying that + the user is allowed to see what it is about to see. + + Of course there has to be some kind of program on the server end to receive + the data you send. You cannot just invent something out of the air. + +## GET + + A GET-form uses the method GET, as specified in HTML like: + +```html + + + +
+``` + + In your favorite browser, this form appears with a text box to fill in and a + press-button labeled "OK". If you fill in '1905' and press the OK button, + your browser then creates a new URL to get for you. The URL gets + `junk.cgi?birthyear=1905&press=OK` appended to the path part of the previous + URL. + + If the original form was seen on the page `www.example.com/when/birth.html`, + the second page you get becomes + `www.example.com/when/junk.cgi?birthyear=1905&press=OK`. + + Most search engines work this way. + + To make curl do the GET form post for you, just enter the expected created + URL: + + curl "http://www.example.com/when/junk.cgi?birthyear=1905&press=OK" + +## POST + + The GET method makes all input field names get displayed in the URL field of + your browser. That is generally a good thing when you want to be able to + bookmark that page with your given data, but it is an obvious disadvantage if + you entered secret information in one of the fields or if there are a large + amount of fields creating a long and unreadable URL. + + The HTTP protocol then offers the POST method. This way the client sends the + data separated from the URL and thus you do not see any of it in the URL + address field. + + The form would look similar to the previous one: + +```html +
+ + +
+``` + + And to use curl to post this form with the same data filled in as before, we + could do it like: + + curl --data "birthyear=1905&press=%20OK%20" http://www.example.com/when/junk.cgi + + This kind of POST uses the Content-Type `application/x-www-form-urlencoded` + and is the most widely used POST kind. + + The data you send to the server MUST already be properly encoded, curl does + not do that for you. For example, if you want the data to contain a space, + you need to replace that space with `%20`, etc. Failing to comply with this + most likely causes your data to be received wrongly and messed up. + + Recent curl versions can in fact url-encode POST data for you, like this: + + curl --data-urlencode "name=I am Daniel" http://www.example.com + + If you repeat `--data` several times on the command line, curl concatenates + all the given data pieces - and put a `&` symbol between each data segment. + +## File Upload POST + + Back in late 1995 they defined an additional way to post data over HTTP. It + is documented in the RFC 1867, why this method sometimes is referred to as + RFC 1867-posting. + + This method is mainly designed to better support file uploads. A form that + allows a user to upload a file could be written like this in HTML: + +
+ + +
+ + This clearly shows that the Content-Type about to be sent is + `multipart/form-data`. + + To post to a form like this with curl, you enter a command line like: + + curl --form upload=@localfilename --form press=OK [URL] + +## Hidden Fields + + A common way for HTML based applications to pass state information between + pages is to add hidden fields to the forms. Hidden fields are already filled + in, they are not displayed to the user and they get passed along just as all + the other fields. + + A similar example form with one visible field, one hidden field and one + submit button could look like: + +```html +
+ + + +
+``` + + To POST this with curl, you do not have to think about if the fields are + hidden or not. To curl they are all the same: + + curl --data "birthyear=1905&press=OK&person=daniel" [URL] + +## Figure Out What A POST Looks Like + + When you are about to fill in a form and send it to a server by using curl + instead of a browser, you are of course interested in sending a POST exactly + the way your browser does. + + An easy way to get to see this, is to save the HTML page with the form on + your local disk, modify the 'method' to a GET, and press the submit button + (you could also change the action URL if you want to). + + You then clearly see the data get appended to the URL, separated with a + `?`-letter as GET forms are supposed to. + +# HTTP upload + +## PUT + + Perhaps the best way to upload data to an HTTP server is to use PUT. Then + again, this of course requires that someone put a program or script on the + server end that knows how to receive an HTTP PUT stream. + + Put a file to an HTTP server with curl: + + curl --upload-file uploadfile http://www.example.com/receive.cgi + +# HTTP Authentication + +## Basic Authentication + + HTTP Authentication is the ability to tell the server your username and + password so that it can verify that you are allowed to do the request you are + doing. The Basic authentication used in HTTP (which is the type curl uses by + default) is **plain text** based, which means it sends username and password + only slightly obfuscated, but still fully readable by anyone that sniffs on + the network between you and the remote server. + + To tell curl to use a user and password for authentication: + + curl --user name:password http://www.example.com + +## Other Authentication + + The site might require a different authentication method (check the headers + returned by the server), and then + [`--ntlm`](https://curl.se/docs/manpage.html#--ntlm), + [`--digest`](https://curl.se/docs/manpage.html#--digest), + [`--negotiate`](https://curl.se/docs/manpage.html#--negotiate) or even + [`--anyauth`](https://curl.se/docs/manpage.html#--anyauth) might be + options that suit you. + +## Proxy Authentication + + Sometimes your HTTP access is only available through the use of an HTTP + proxy. This seems to be especially common at various companies. An HTTP proxy + may require its own user and password to allow the client to get through to + the Internet. To specify those with curl, run something like: + + curl --proxy-user proxyuser:proxypassword curl.se + + If your proxy requires the authentication to be done using the NTLM method, + use [`--proxy-ntlm`](https://curl.se/docs/manpage.html#--proxy-ntlm), if + it requires Digest use + [`--proxy-digest`](https://curl.se/docs/manpage.html#--proxy-digest). + + If you use any one of these user+password options but leave out the password + part, curl prompts for the password interactively. + +## Hiding credentials + + Do note that when a program is run, its parameters might be possible to see + when listing the running processes of the system. Thus, other users may be + able to watch your passwords if you pass them as plain command line + options. There are ways to circumvent this. + + It is worth noting that while this is how HTTP Authentication works, many + websites do not use this concept when they provide logins etc. See the Web + Login chapter further below for more details on that. + +# More HTTP Headers + +## Referer + + An HTTP request may include a 'referer' field (yes it is misspelled), which + can be used to tell from which URL the client got to this particular + resource. Some programs/scripts check the referer field of requests to verify + that this was not arriving from an external site or an unknown page. While + this is a stupid way to check something so easily forged, many scripts still + do it. Using curl, you can put anything you want in the referer-field and + thus more easily be able to fool the server into serving your request. + + Use curl to set the referer field with: + + curl --referer http://www.example.come http://www.example.com + +## User Agent + + Similar to the referer field, all HTTP requests may set the User-Agent + field. It names what user agent (client) that is being used. Many + applications use this information to decide how to display pages. Silly web + programmers try to make different pages for users of different browsers to + make them look the best possible for their particular browsers. They usually + also do different kinds of JavaScript etc. + + At times, you may learn that getting a page with curl does not return the + same page that you see when getting the page with your browser. Then you know + it is time to set the User Agent field to fool the server into thinking you + are one of those browsers. + + By default, curl uses curl/VERSION, such as User-Agent: curl/8.11.0. + + To make curl look like Internet Explorer 5 on a Windows 2000 box: + + curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL] + + Or why not look like you are using Netscape 4.73 on an old Linux box: + + curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL] + +## Redirects + +## Location header + + When a resource is requested from a server, the reply from the server may + include a hint about where the browser should go next to find this page, or a + new page keeping newly generated output. The header that tells the browser to + redirect is `Location:`. + + curl does not follow `Location:` headers by default, but simply displays such + pages in the same manner it displays all HTTP replies. It does however + feature an option that makes it attempt to follow the `Location:` pointers. + + To tell curl to follow a Location: + + curl --location http://www.example.com + + If you use curl to POST to a site that immediately redirects you to another + page, you can safely use [`--location`](https://curl.se/docs/manpage.html#-L) + (`-L`) and `--data`/`--form` together. curl only uses POST in the first + request, and then revert to GET in the following operations. + +## Other redirects + + Browsers typically support at least two other ways of redirects that curl + does not: first the html may contain a meta refresh tag that asks the browser + to load a specific URL after a set number of seconds, or it may use + JavaScript to do it. + +# Cookies + +## Cookie Basics + + The way the web browsers do "client side state control" is by using + cookies. Cookies are just names with associated contents. The cookies are + sent to the client by the server. The server tells the client for what path + and hostname it wants the cookie sent back, and it also sends an expiration + date and a few more properties. + + When a client communicates with a server with a name and path as previously + specified in a received cookie, the client sends back the cookies and their + contents to the server, unless of course they are expired. + + Many applications and servers use this method to connect a series of requests + into a single logical session. To be able to use curl in such occasions, we + must be able to record and send back cookies the way the web application + expects them. The same way browsers deal with them. + +## Cookie options + + The simplest way to send a few cookies to the server when getting a page with + curl is to add them on the command line like: + + curl --cookie "name=Daniel" http://www.example.com + + Cookies are sent as common HTTP headers. This is practical as it allows curl + to record cookies simply by recording headers. Record cookies with curl by + using the [`--dump-header`](https://curl.se/docs/manpage.html#-D) (`-D`) + option like: + + curl --dump-header headers_and_cookies http://www.example.com + + (Take note that the + [`--cookie-jar`](https://curl.se/docs/manpage.html#-c) option described + below is a better way to store cookies.) + + curl has a full blown cookie parsing engine built-in that comes in use if you + want to reconnect to a server and use cookies that were stored from a + previous connection (or hand-crafted manually to fool the server into + believing you had a previous connection). To use previously stored cookies, + you run curl like: + + curl --cookie stored_cookies_in_file http://www.example.com + + curl's "cookie engine" gets enabled when you use the + [`--cookie`](https://curl.se/docs/manpage.html#-b) option. If you only + want curl to understand received cookies, use `--cookie` with a file that + does not exist. Example, if you want to let curl understand cookies from a + page and follow a location (and thus possibly send back cookies it received), + you can invoke it like: + + curl --cookie nada --location http://www.example.com + + curl has the ability to read and write cookie files that use the same file + format that Netscape and Mozilla once used. It is a convenient way to share + cookies between scripts or invokes. The `--cookie` (`-b`) switch + automatically detects if a given file is such a cookie file and parses it, + and by using the `--cookie-jar` (`-c`) option you make curl write a new + cookie file at the end of an operation: + + curl --cookie cookies.txt --cookie-jar newcookies.txt \ + http://www.example.com + +# HTTPS + +## HTTPS is HTTP secure + + There are a few ways to do secure HTTP transfers. By far the most common + protocol for doing this is what is generally known as HTTPS, HTTP over + SSL. SSL encrypts all the data that is sent and received over the network and + thus makes it harder for attackers to spy on sensitive information. + + SSL (or TLS as the current version of the standard is called) offers a set of + advanced features to do secure transfers over HTTP. + + curl supports encrypted fetches when built to use a TLS library and it can be + built to use one out of a fairly large set of libraries - `curl -V` shows + which one your curl was built to use (if any). To get a page from an HTTPS + server, simply run curl like: + + curl https://secure.example.com + +## Certificates + + In the HTTPS world, you use certificates to validate that you are the one you + claim to be, as an addition to normal passwords. curl supports client- side + certificates. All certificates are locked with a passphrase, which you need + to enter before the certificate can be used by curl. The passphrase can be + specified on the command line or if not, entered interactively when curl + queries for it. Use a certificate with curl on an HTTPS server like: + + curl --cert mycert.pem https://secure.example.com + + curl also tries to verify that the server is who it claims to be, by + verifying the server's certificate against a locally stored CA cert bundle. + Failing the verification causes curl to deny the connection. You must then + use [`--insecure`](https://curl.se/docs/manpage.html#-k) (`-k`) in case you + want to tell curl to ignore that the server cannot be verified. + + More about server certificate verification and ca cert bundles can be read in + the [`SSLCERTS` document](https://curl.se/docs/sslcerts.html). + + At times you may end up with your own CA cert store and then you can tell + curl to use that to verify the server's certificate: + + curl --cacert ca-bundle.pem https://example.com/ + +# Custom Request Elements + +## Modify method and headers + + Doing fancy stuff, you may need to add or change elements of a single curl + request. + + For example, you can change the POST method to `PROPFIND` and send the data + as `Content-Type: text/xml` (instead of the default `Content-Type`) like + this: + + curl --data "" --header "Content-Type: text/xml" \ + --request PROPFIND example.com + + You can delete a default header by providing one without content. Like you + can ruin the request by chopping off the `Host:` header: + + curl --header "Host:" http://www.example.com + + You can add headers the same way. Your server may want a `Destination:` + header, and you can add it: + + curl --header "Destination: http://nowhere" http://example.com + +## More on changed methods + + It should be noted that curl selects which methods to use on its own + depending on what action to ask for. `-d` makes a POST, `-I` makes a HEAD and + so on. If you use the [`--request`](https://curl.se/docs/manpage.html#-X) / + `-X` option you can change the method keyword curl selects, but you do not + modify curl's behavior. This means that if you for example use -d "data" to + do a POST, you can modify the method to a `PROPFIND` with `-X` and curl still + thinks it sends a POST. You can change the normal GET to a POST method by + simply adding `-X POST` in a command line like: + + curl -X POST http://example.org/ + + curl however still acts as if it sent a GET so it does not send any request + body etc. + +# Web Login + +## Some login tricks + + While not strictly just HTTP related, it still causes a lot of people + problems so here's the executive run-down of how the vast majority of all + login forms work and how to login to them using curl. + + It can also be noted that to do this properly in an automated fashion, you + most certainly need to script things and do multiple curl invokes etc. + + First, servers mostly use cookies to track the logged-in status of the + client, so you need to capture the cookies you receive in the responses. + Then, many sites also set a special cookie on the login page (to make sure + you got there through their login page) so you should make a habit of first + getting the login-form page to capture the cookies set there. + + Some web-based login systems feature various amounts of JavaScript, and + sometimes they use such code to set or modify cookie contents. Possibly they + do that to prevent programmed logins, like this manual describes how to... + Anyway, if reading the code is not enough to let you repeat the behavior + manually, capturing the HTTP requests done by your browsers and analyzing the + sent cookies is usually a working method to work out how to shortcut the + JavaScript need. + + In the actual `
` tag for the login, lots of sites fill-in + random/session or otherwise secretly generated hidden tags and you may need + to first capture the HTML code for the login form and extract all the hidden + fields to be able to do a proper login POST. Remember that the contents need + to be URL encoded when sent in a normal POST. + +# Debug + +## Some debug tricks + + Many times when you run curl on a site, you notice that the site does not + seem to respond the same way to your curl requests as it does to your + browser's. + + Then you need to start making your curl requests more similar to your + browser's requests: + + - Use the `--trace-ascii` option to store fully detailed logs of the requests + for easier analyzing and better understanding + + - Make sure you check for and use cookies when needed (both reading with + `--cookie` and writing with `--cookie-jar`) + + - Set user-agent (with [`-A`](https://curl.se/docs/manpage.html#-A)) to + one like a recent popular browser does + + - Set referer (with [`-E`](https://curl.se/docs/manpage.html#-E)) like + it is set by the browser + + - If you use POST, make sure you send all the fields and in the same order as + the browser does it. + +## Check what the browsers do + + A good helper to make sure you do this right, is the web browsers' developers + tools that let you view all headers you send and receive (even when using + HTTPS). + + A more raw approach is to capture the HTTP traffic on the network with tools + such as Wireshark or tcpdump and check what headers that were sent and + received by the browser. (HTTPS forces you to use `SSLKEYLOGFILE` to do + that.) diff --git a/curl/docs/URL-SYNTAX.md b/curl/docs/URL-SYNTAX.md new file mode 100644 index 000000000..44412b4eb --- /dev/null +++ b/curl/docs/URL-SYNTAX.md @@ -0,0 +1,396 @@ + + +# URL syntax and their use in curl + +## Specifications + +The official "URL syntax" is primarily defined in these two different +specifications: + + - [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) (although URL is called + "URI" in there) + - [The WHATWG URL Specification](https://url.spec.whatwg.org/) + +RFC 3986 is the earlier one, and curl has always tried to adhere to that one +(since it shipped in January 2005). + +The WHATWG URL spec was written later, is incompatible with the RFC 3986 and +changes over time. + +## Variations + +URL parsers as implemented in browsers, libraries and tools usually opt to +support one of the mentioned specifications. Bugs, differences in +interpretations and the moving nature of the WHATWG spec does however make it +unlikely that multiple parsers treat URLs the same way. + +## Security + +Due to the inherent differences between URL parser implementations, it is +considered a security risk to mix different implementations and assume the +same behavior. + +For example, if you use one parser to check if a URL uses a good hostname or +the correct auth field, and then pass on that same URL to a *second* parser, +there is always a risk it treats the same URL differently. There is no right +and wrong in URL land, only differences of opinions. + +libcurl offers a separate API to its URL parser for this reason, among others. + +Applications may at times find it convenient to allow users to specify URLs +for various purposes and that string would then end up fed to curl. Getting a +URL from an external untrusted party and using it with curl brings several +security concerns: + +1. If you have an application that runs as or in a server application, getting + an unfiltered URL can trick your application to access a local resource + instead of a remote resource. Protecting yourself against localhost accesses + is hard when accepting user provided URLs. + +2. Such custom URLs can access other ports than you planned as port numbers + are part of the regular URL format. The combination of a local host and a + custom port number can allow external users to play tricks with your local + services. + +3. Such a URL might use other schemes than you thought of or planned for. + +## "RFC 3986 plus" + +curl recognizes a URL syntax that we call "RFC 3986 plus". It is grounded on +the well established RFC 3986 to make sure previously written command lines +and curl using scripts remain working. + +curl's URL parser allows a few deviations from the spec in order to +inter-operate better with URLs that appear in the wild. + +### Spaces + +A URL provided to curl cannot contain spaces. They need to be provided URL +encoded to be accepted in a URL by curl. + +An exception to this rule: `Location:` response headers that indicate to a +client where a resource has been redirected to, sometimes contain spaces. This +is a violation of RFC 3986 but is fine in the WHATWG spec. curl handles these +by re-encoding them to `%20`. + +### Non-ASCII + +Byte values in a provided URL that are outside of the printable ASCII range +are percent-encoded by curl. + +### Multiple slashes + +An absolute URL always starts with a "scheme" followed by a colon. For all the +schemes curl supports, the colon must be followed by two slashes according to +RFC 3986 but not according to the WHATWG spec - which allows one to infinity +amount. + +curl allows one, two or three slashes after the colon to still be considered a +valid URL. + +### "scheme-less" + +curl supports "URLs" that do not start with a scheme. This is not supported by +any of the specifications. This is a shortcut to entering URLs that was +supported by browsers early on and has been mimicked by curl. + +Based on what the hostname starts with, curl "guesses" what protocol to use: + + - `ftp.` means FTP + - `dict.` means DICT + - `ldap.` means LDAP + - `imap.` means IMAP + - `smtp.` means SMTP + - `pop3.` means POP3 + - all other means HTTP + +### Globbing letters + +The curl command line tool supports "globbing" of URLs. It means that you can +create ranges and lists using `[N-M]` and `{one,two,three}` sequences. The +letters used for this (`[]{}`) are reserved in RFC 3986 and can therefore not +legitimately be part of such a URL. + +They are however not reserved or special in the WHATWG specification, so +globbing can mess up such URLs. Globbing can be turned off for such occasions +(using `--globoff`). + +# URL syntax details + +A URL may consist of the following components - many of them are optional: + + [scheme][divider][userinfo][hostname][port number][path][query][fragment] + +Each component is separated from the following component with a divider +character or string. + +For example, this could look like: + + http://user:password@www.example.com:80/index.html?foo=bar#top + +## Scheme + +The scheme specifies the protocol to use. A curl build can support a few or +many different schemes. You can limit what schemes curl should accept. + +curl supports the following schemes on URLs specified to transfer. They are +matched case insensitively: + +`dict`, `file`, `ftp`, `ftps`, `gopher`, `gophers`, `http`, `https`, `imap`, +`imaps`, `ldap`, `ldaps`, `mqtt`, `pop3`, `pop3s`, `rtmp`, `rtmpe`, `rtmps`, +`rtmpt`, `rtmpte`, `rtmpts`, `rtsp`, `smb`, `smbs`, `smtp`, `smtps`, `telnet`, +`tftp` + +When the URL is specified to identify a proxy, curl recognizes the following +schemes: + +`http`, `https`, `socks4`, `socks4a`, `socks5`, `socks5h`, `socks` + +## Userinfo + +The userinfo field can be used to set username and password for +authentication purposes in this transfer. The use of this field is discouraged +since it often means passing around the password in plain text and is thus a +security risk. + +URLs for IMAP, POP3 and SMTP also support *login options* as part of the +userinfo field. They are provided as a semicolon after the password and then +the options. + +## Hostname + +The hostname part of the URL contains the address of the server that you want +to connect to. This can be the fully qualified domain name of the server, the +local network name of the machine on your network or the IP address of the +server or machine represented by either an IPv4 or IPv6 address (within +brackets). For example: + + http://www.example.com/ + + http://hostname/ + + http://192.168.0.1/ + + http://[2001:1890:1112:1::20]/ + +### "localhost" + +Starting in curl 7.77.0, curl uses loopback IP addresses for the name +`localhost`: `127.0.0.1` and `::1`. It does not resolve the name using the +resolver functions. + +This is done to make sure the host accessed is truly the localhost - the local +machine. + +### IDNA + +If curl was built with International Domain Name (IDN) support, it can also +handle hostnames using non-ASCII characters. + +When built with libidn2, curl uses the IDNA 2008 standard. This is equivalent +to the WHATWG URL spec, but differs from certain browsers that use IDNA 2003 +Transitional Processing. The two standards have a huge overlap but differ +slightly, perhaps most famously in how they deal with the +[German "double s"](https://en.wikipedia.org/wiki/%c3%9f) +([LATIN SMALL LETTER SHARP S](https://codepoints.net/U+00DF)). + +When WinIDN is used, curl uses IDNA 2003 Transitional Processing, like the rest +of Windows. + +## Port number + +If there is a colon after the hostname, that should be followed by the port +number to use. 1 - 65535. curl also supports a blank port number field - but +only if the URL starts with a scheme. + +If the port number is not specified in the URL, curl uses a default port +number based on the provide scheme: + +DICT 2628, FTP 21, FTPS 990, GOPHER 70, GOPHERS 70, HTTP 80, HTTPS 443, +IMAP 132, IMAPS 993, LDAP 369, LDAPS 636, MQTT 1883, POP3 110, POP3S 995, +RTMP 1935, RTMPS 443, RTMPT 80, RTSP 554, SCP 22, SFTP 22, SMB 445, SMBS 445, +SMTP 25, SMTPS 465, TELNET 23, TFTP 69 + +# Scheme specific behaviors + +## FTP + +The path part of an FTP request specifies the file to retrieve and from which +directory. If the file part is omitted then libcurl downloads the directory +listing for the directory specified. If the directory is omitted then the +directory listing for the root / home directory is returned. + +FTP servers typically put the user in its "home directory" after login, which +then differs between users. To explicitly specify the root directory of an FTP +server, start the path with double slash `//` or `/%2f` (2F is the hexadecimal +value of the ASCII code for the slash). + +## FILE + +When a `FILE://` URL is accessed on Windows systems, it can be crafted in a +way so that Windows attempts to connect to a (remote) machine when curl wants +to read or write such a path. + +curl only allows the hostname part of a FILE URL to be one out of these three +alternatives: `localhost`, `127.0.0.1` or blank ("", zero characters). +Anything else makes curl fail to parse the URL. + +### Windows-specific FILE details + +curl accepts that the FILE URL's path starts with a "drive letter". That is a +single letter `a` to `z` followed by a colon or a pipe character (`|`). + +The Windows operating system itself converts some file accesses to perform +network accesses over SMB/CIFS, through several different file path patterns. +This way, a `file://` URL passed to curl *might* be converted into a network +access inadvertently and unknowingly to curl. This is a Windows feature curl +cannot control or disable. + +## IMAP + +The path part of an IMAP request not only specifies the mailbox to list or +select, but can also be used to check the `UIDVALIDITY` of the mailbox, to +specify the `UID`, `SECTION` and `PARTIAL` octets of the message to fetch and +to specify what messages to search for. + +A top level folder list: + + imap://user:password@mail.example.com + +A folder list on the user's inbox: + + imap://user:password@mail.example.com/INBOX + +Select the user's inbox and fetch message with `uid = 1`: + + imap://user:password@mail.example.com/INBOX/;UID=1 + +Select the user's inbox and fetch the first message in the mail box: + + imap://user:password@mail.example.com/INBOX/;MAILINDEX=1 + +Select the user's inbox, check the `UIDVALIDITY` of the mailbox is 50 and +fetch message 2 if it is: + + imap://user:password@mail.example.com/INBOX;UIDVALIDITY=50/;UID=2 + +Select the user's inbox and fetch the text portion of message 3: + + imap://user:password@mail.example.com/INBOX/;UID=3/;SECTION=TEXT + +Select the user's inbox and fetch the first 1024 octets of message 4: + + imap://user:password@mail.example.com/INBOX/;UID=4/;PARTIAL=0.1024 + +Select the user's inbox and check for NEW messages: + + imap://user:password@mail.example.com/INBOX?NEW + +Select the user's inbox and search for messages containing "shadows" in the +subject line: + + imap://user:password@mail.example.com/INBOX?SUBJECT%20shadows + +Searching via the query part of the URL `?` is a search request for the +results to be returned as message sequence numbers (`MAILINDEX`). It is +possible to make a search request for results to be returned as unique ID +numbers (`UID`) by using a custom curl request via `-X`. `UID` numbers are +unique per session (and multiple sessions when `UIDVALIDITY` is the same). For +example, if you are searching for `"foo bar"` in header+body (`TEXT`) and you +want the matching `MAILINDEX` numbers returned then you could search via URL: + + imap://user:password@mail.example.com/INBOX?TEXT%20%22foo%20bar%22 + +If you want matching `UID` numbers you have to use a custom request: + + imap://user:password@mail.example.com/INBOX -X "UID SEARCH TEXT \"foo bar\"" + +For more information about IMAP commands please see RFC 9051. For more +information about the individual components of an IMAP URL please see RFC 5092. + +* Note old curl versions would `FETCH` by message sequence number when `UID` +was specified in the URL. That was a bug fixed in 7.62.0, which added +`MAILINDEX` to `FETCH` by mail sequence number. + +## LDAP + +The path part of an LDAP request can be used to specify the: Distinguished +Name, Attributes, Scope, Filter and Extension for an LDAP search. Each field +is separated by a question mark and when that field is not required an empty +string with the question mark separator should be included. + +Search for the `DN` as `My Organization`: + + ldap://ldap.example.com/o=My%20Organization + +the same search but only return `postalAddress` attributes: + + ldap://ldap.example.com/o=My%20Organization?postalAddress + +Search for an empty `DN` and request information about the +`rootDomainNamingContext` attribute for an Active Directory server: + + ldap://ldap.example.com/?rootDomainNamingContext + +For more information about the individual components of an LDAP URL please see +[RFC 4516](https://datatracker.ietf.org/doc/html/rfc4516). + +## POP3 + +The path part of a POP3 request specifies the message ID to retrieve. If the +ID is not specified then a list of waiting messages is returned instead. + +## SCP + +The path part of an SCP URL specifies the path and file to retrieve or +upload. The file is taken as an absolute path from the root directory on the +server. + +To specify a path relative to the user's home directory on the server, prepend +`~/` to the path portion. + +## SFTP + +The path part of an SFTP URL specifies the file to retrieve or upload. If the +path ends with a slash (`/`) then a directory listing is returned instead of a +file. If the path is omitted entirely then the directory listing for the root +/ home directory is returned. + +## SMB +The path part of an SMB request specifies the file to retrieve and from what +share and directory or the share to upload to and as such, may not be omitted. +If the username is embedded in the URL then it must contain the domain name +and as such, the backslash must be URL encoded as %2f. + +When uploading to SMB, the size of the file needs to be known ahead of time, +meaning that you can upload a file passed to curl over a pipe like stdin. + +curl supports SMB version 1 (only) + +## SMTP + +The path part of an SMTP request specifies the hostname to present during +communication with the mail server. If the path is omitted, then libcurl +attempts to resolve the local computer's hostname. However, this may not +return the fully qualified domain name that is required by some mail servers +and specifying this path allows you to set an alternative name, such as your +machine's fully qualified domain name, which you might have obtained from an +external function such as gethostname or getaddrinfo. + +The default smtp port is 25. Some servers use port 587 as an alternative. + +## RTMP + +There is no official URL spec for RTMP so libcurl uses the URL syntax supported +by the underlying librtmp library. It has a syntax where it wants a +traditional URL, followed by a space and a series of space-separated +`name=value` pairs. + +While space is not typically a "legal" letter, libcurl accepts them. When a +user wants to pass in a `#` (hash) character it is treated as a fragment and +it gets cut off by libcurl if provided literally. You have to escape it by +providing it as backslash and its ASCII value in hexadecimal: `\23`. diff --git a/curl/docs/VERSIONS b/curl/docs/VERSIONS deleted file mode 100644 index 72a45474d..000000000 --- a/curl/docs/VERSIONS +++ /dev/null @@ -1,56 +0,0 @@ -Version Numbers and Releases -============================ - - Curl is not only curl. Curl is also libcurl. They're actually individually - versioned, but they mostly follow each other rather closely. - - The version numbering is always built up using the same system: - - X.Y.Z - - - X is main version number - - Y is release number - - Z is patch number - -## Bumping numbers - - One of these numbers will get bumped in each new release. The numbers to the - right of a bumped number will be reset to zero. If Z is zero, it may not be - included in the version number. - - The main version number will get bumped when *really* big, world colliding - changes are made. The release number is bumped when changes are performed or - things/features are added. The patch number is bumped when the changes are - mere bugfixes. - - It means that after release 1.2.3, we can release 2.0 if something really big - has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs - were fixed. - - Bumping, as in increasing the number with 1, is unconditionally only - affecting one of the numbers (except the ones to the right of it, that may be - set to zero). 1 becomes 2, 3 becomes 4, 9 becomes 10, 88 becomes 89 and 99 - becomes 100. So, after 1.2.9 comes 1.2.10. After 3.99.3, 3.100 might come. - - All original curl source release archives are named according to the libcurl - version (not according to the curl client version that, as said before, might - differ). - - As a service to any application that might want to support new libcurl - features while still being able to build with older versions, all releases - have the libcurl version stored in the curl/curlver.h file using a static - numbering scheme that can be used for comparison. The version number is - defined as: - - #define LIBCURL_VERSION_NUM 0xXXYYZZ - - Where XX, YY and ZZ are the main version, release and patch numbers in - hexadecimal. All three number fields are always represented using two digits - (eight bits each). 1.2 would appear as "0x010200" while version 9.11.7 - appears as "0x090b07". - - This 6-digit hexadecimal number is always a greater number in a more recent - release. It makes comparisons with greater than and less than work. - - This number is also available as three separate defines: - `LIBCURL_VERSION_MAJOR`, `LIBCURL_VERSION_MINOR` and `LIBCURL_VERSION_PATCH`. diff --git a/curl/docs/VERSIONS.md b/curl/docs/VERSIONS.md new file mode 100644 index 000000000..00ea99e2c --- /dev/null +++ b/curl/docs/VERSIONS.md @@ -0,0 +1,341 @@ + + +Version Numbers and Releases +============================ + + The command line tool curl and the library libcurl are individually + versioned, but they usually follow each other closely. + + The version numbering is always built up using the same system: + + X.Y.Z + + - X is main version number + - Y is release number + - Z is patch number + +## Bumping numbers + + One of these numbers get bumped in each new release. The numbers to the right + of a bumped number are reset to zero. + + The main version number is bumped when *really* big, world colliding changes + are made. The release number is bumped when changes are performed or + things/features are added. The patch number is bumped when the changes are + mere bugfixes. + + It means that after release 1.2.3, we can release 2.0.0 if something really + big has been made, 1.3.0 if not that big changes were made or 1.2.4 if only + bugs were fixed. + + Bumping, as in increasing the number with 1, is unconditionally only + affecting one of the numbers (except the ones to the right of it, that may be + set to zero). 1 becomes 2, 3 becomes 4, 9 becomes 10, 88 becomes 89 and 99 + becomes 100. So, after 1.2.9 comes 1.2.10. After 3.99.3, 3.100.0 might come. + + All original curl source release archives are named according to the libcurl + version (not according to the curl client version that, as said before, might + differ). + + As a service to any application that might want to support new libcurl + features while still being able to build with older versions, all releases + have the libcurl version stored in the `curl/curlver.h` file using a static + numbering scheme that can be used for comparison. The version number is + defined as: + +```c +#define LIBCURL_VERSION_NUM 0xXXYYZZ +``` + + Where `XX`, `YY` and `ZZ` are the main version, release and patch numbers in + hexadecimal. All three number fields are always represented using two digits + (eight bits each). 1.2 would appear as "0x010200" while version 9.11.7 + appears as `0x090b07`. + + This 6-digit hexadecimal number is always a greater number in a more recent + release. It makes comparisons with greater than and less than work. + + This number is also available as three separate defines: + `LIBCURL_VERSION_MAJOR`, `LIBCURL_VERSION_MINOR` and `LIBCURL_VERSION_PATCH`. + +## Past releases + +This is a list of all public releases with their version numbers and release +dates. The tool was called `httpget` before 2.0, `urlget` before 4.0 then +`curl` since 4.0. `libcurl` and `curl` are always released in sync, using the +same version numbers. + +- 8.16.0: pending +- 8.15.0: July 16, 2025 +- 8.14.1: June 4 2025 +- 8.14.0: May 28 2025 +- 8.13.0: April 2 2025 +- 8.12.1: February 13 2025 +- 8.12.0: February 5 2025 +- 8.11.1: December 11 2024 +- 8.11.0: November 6 2024 +- 8.10.1: September 18 2024 +- 8.10.0: September 11 2024 +- 8.9.1: July 31 2024 +- 8.9.0: July 24 2024 +- 8.8.0: May 22 2024 +- 8.7.1: March 27 2024 +- 8.7.0: March 27 2024 +- 8.6.0: January 31 2024 +- 8.5.0: December 6 2023 +- 8.4.0: October 11 2023 +- 8.3.0: September 13 2023 +- 8.2.1: July 26 2023 +- 8.2.0: July 19 2023 +- 8.1.2: May 30 2023 +- 8.1.1: May 23 2023 +- 8.1.0: May 17 2023 +- 8.0.1: March 20 2023 +- 8.0.0: March 20 2023 +- 7.88.1: February 20 2023 +- 7.88.0: February 15 2023 +- 7.87.0: December 21 2022 +- 7.86.0: October 26 2022 +- 7.85.0: August 31 2022 +- 7.84.0: June 27 2022 +- 7.83.1: May 11 2022 +- 7.83.0: April 27 2022 +- 7.82.0: March 5 2022 +- 7.81.0: January 5 2022 +- 7.80.0: November 10 2021 +- 7.79.1: September 22 2021 +- 7.79.0: September 15 2021 +- 7.78.0: July 21 2021 +- 7.77.0: May 26 2021 +- 7.76.1: April 14 2021 +- 7.76.0: March 31 2021 +- 7.75.0: February 3 2021 +- 7.74.0: December 9 2020 +- 7.73.0: October 14 2020 +- 7.72.0: August 19 2020 +- 7.71.1: July 1 2020 +- 7.71.0: June 24 2020 +- 7.70.0: April 29 2020 +- 7.69.1: March 11 2020 +- 7.69.0: March 4 2020 +- 7.68.0: January 8 2020 +- 7.67.0: November 6 2019 +- 7.66.0: September 11 2019 +- 7.65.3: July 19 2019 +- 7.65.2: July 17 2019 +- 7.65.1: June 5 2019 +- 7.65.0: May 22 2019 +- 7.64.1: March 27 2019 +- 7.64.0: February 6 2019 +- 7.63.0: December 12 2018 +- 7.62.0: October 31 2018 +- 7.61.1: September 5 2018 +- 7.61.0: July 11 2018 +- 7.60.0: May 16 2018 +- 7.59.0: March 14 2018 +- 7.58.0: January 24 2018 +- 7.57.0: November 29 2017 +- 7.56.1: October 23 2017 +- 7.56.0: October 4 2017 +- 7.55.1: August 14 2017 +- 7.55.0: August 9 2017 +- 7.54.1: June 14 2017 +- 7.54.0: April 19 2017 +- 7.53.1: February 24 2017 +- 7.53.0: February 22 2017 +- 7.52.1: December 23 2016 +- 7.52.0: December 21 2016 +- 7.51.0: November 2 2016 +- 7.50.3: September 14 2016 +- 7.50.2: September 7 2016 +- 7.50.1: August 3 2016 +- 7.50.0: July 21 2016 +- 7.49.1: May 30 2016 +- 7.49.0: May 18 2016 +- 7.48.0: March 23 2016 +- 7.47.1: February 8 2016 +- 7.47.0: January 27 2016 +- 7.46.0: December 2 2015 +- 7.45.0: October 7 2015 +- 7.44.0: August 12 2015 +- 7.43.0: June 17 2015 +- 7.42.1: April 29 2015 +- 7.42.0: April 22 2015 +- 7.41.0: February 25 2015 +- 7.40.0: January 8 2015 +- 7.39.0: November 5 2014 +- 7.38.0: September 10 2014 +- 7.37.1: July 16 2014 +- 7.37.0: May 21 2014 +- 7.36.0: March 26 2014 +- 7.35.0: January 29 2014 +- 7.34.0: December 17 2013 +- 7.33.0: October 14 2013 +- 7.32.0: August 12 2013 +- 7.31.0: June 22 2013 +- 7.30.0: April 12 2013 +- 7.29.0: February 6 2013 +- 7.28.1: November 20 2012 +- 7.28.0: October 10 2012 +- 7.27.0: July 27 2012 +- 7.26.0: May 24 2012 +- 7.25.0: March 22 2012 +- 7.24.0: January 24 2012 +- 7.23.1: November 17 2011 +- 7.23.0: November 15 2011 +- 7.22.0: September 13 2011 +- 7.21.7: June 23 2011 +- 7.21.6: April 22 2011 +- 7.21.5: April 17 2011 +- 7.21.4: February 17 2011 +- 7.21.3: December 15 2010 +- 7.21.2: October 13 2010 +- 7.21.1: August 11 2010 +- 7.21.0: June 16 2010 +- 7.20.1: April 14 2010 +- 7.20.0: February 9 2010 +- 7.19.7: November 4 2009 +- 7.19.6: August 12 2009 +- 7.19.5: May 18 2009 +- 7.19.4: March 3 2009 +- 7.19.3: January 19 2009 +- 7.19.2: November 13 2008 +- 7.19.1: November 5 2008 +- 7.19.0: September 1 2008 +- 7.18.2: June 4 2008 +- 7.18.1: March 30 2008 +- 7.18.0: January 28 2008 +- 7.17.1: October 29 2007 +- 7.17.0: September 13 2007 +- 7.16.4: July 10 2007 +- 7.16.3: June 25 2007 +- 7.16.2: April 11 2007 +- 7.16.1: January 29 2007 +- 7.16.0: October 30 2006 +- 7.15.5: August 7 2006 +- 7.15.4: June 12 2006 +- 7.15.3: March 20 2006 +- 7.15.2: February 27 2006 +- 7.15.1: December 7 2005 +- 7.15.0: October 13 2005 +- 7.14.1: September 1 2005 +- 7.14.0: May 16 2005 +- 7.13.2: April 4 2005 +- 7.13.1: March 4 2005 +- 7.13.0: February 1 2005 +- 7.12.3: December 20 2004 +- 7.12.2: October 18 2004 +- 7.12.1: August 10 2004 +- 7.12.0: June 2 2004 +- 7.11.2: April 26 2004 +- 7.11.1: March 19 2004 +- 7.11.0: January 22 2004 +- 7.10.8: November 1 2003 +- 7.10.7: August 15 2003 +- 7.10.6: July 28 2003 +- 7.10.5: May 19 2003 +- 7.10.4: April 2 2003 +- 7.10.3: January 14 2003 +- 7.10.2: November 18 2002 +- 7.10.1: October 11 2002 +- 7.10: October 1 2002 +- 7.9.8: June 13 2002 +- 7.9.7: May 10 2002 +- 7.9.6: April 14 2002 +- 7.9.5: March 7 2002 +- 7.9.4: March 4 2002 +- 7.9.3: January 23 2002 +- 7.9.2: December 5 2001 +- 7.9.1: November 4 2001 +- 7.9: September 23 2001 +- 7.8.1: August 20 2001 +- 7.8: June 7 2001 +- 7.7.3: May 4 2001 +- 7.7.2: April 22 2001 +- 7.7.1: April 3 2001 +- 7.7: March 22 2001 +- 7.6.1: February 9 2001 +- 7.6: January 26 2001 +- 7.5.2: January 4 2001 +- 7.5.1: December 11 2000 +- 7.5: December 1 2000 +- 7.4.2: November 15 2000 +- 7.4.1: October 16 2000 +- 7.4: October 16 2000 +- 7.3: September 28 2000 +- 7.2.1: August 31 2000 +- 7.2: August 30 2000 +- 7.1.1: August 21 2000 +- 7.1: August 7 2000 +- 6.5.2: March 21 2000 +- 6.5.1: March 20 2000 +- 6.5: March 13 2000 +- 6.4: January 17 2000 +- 6.3.1: November 23 1999 +- 6.3: November 10 1999 +- 6.2: October 21 1999 +- 6.1: October 17 1999 +- 6.0: September 13 1999 +- 5.11: August 25 1999 +- 5.10: August 13 1999 +- 5.9.1: July 30 1999 +- 5.9: May 22 1999 +- 5.8: May 5 1999 +- 5.7.1: April 23 1999 +- 5.7: April 20 1999 +- 5.5.1: January 27 1999 +- 5.5: January 15 1999 +- 5.4: January 7 1999 +- 5.3: December 21 1998 +- 5.2.1: December 14 1998 +- 5.2: December 14 1998 +- 5.0: December 1 1998 +- 4.10: October 26 1998 +- 4.9: October 7 1998 +- 4.8.4: September 20 1998 +- 4.8.3: September 7 1998 +- 4.8.2: August 14 1998 +- 4.8.1: August 7 1998 +- 4.8: July 30 1998 +- 4.7: July 20 1998 +- 4.6: July 3 1998 +- 4.5.1: June 12 1998 +- 4.5: May 30 1998 +- 4.4: May 13 1998 +- 4.3: April 30 1998 +- 4.2: April 15 1998 +- 4.1: April 3 1998 +- 4.0: March 20 1998 +- 3.12: March 14 1998 +- 3.11: February 9 1998 +- 3.10: February 4 1998 +- 3.9: February 4 1998 +- 3.7: January 15 1998 +- 3.6: January 1 1998 +- 3.5: December 15 1997 +- 3.2: December 1 1997 +- 3.1: November 24 1997 +- 3.0: November 1 1997 +- 2.9: October 15 1997 +- 2.8: October 1 1997 +- 2.7: September 20 1997 +- 2.6: September 10 1997 +- 2.5: September 1 1997 +- 2.4: August 27 1997 +- 2.3: August 21 1997 +- 2.2: August 14 1997 +- 2.1: August 10 1997 +- 2.0: August 1 1997 +- 1.5: July 21 1997 +- 1.4: July 15 1997 +- 1.3: June 1 1997 +- 1.2: May 1 1997 +- 1.1: April 20 1997 +- 1.0: April 8 1997 +- 0.3: February 1 1997 +- 0.2: December 17 1996 +- 0.1: November 11 1996 diff --git a/curl/docs/VULN-DISCLOSURE-POLICY.md b/curl/docs/VULN-DISCLOSURE-POLICY.md new file mode 100644 index 000000000..00cdf86ec --- /dev/null +++ b/curl/docs/VULN-DISCLOSURE-POLICY.md @@ -0,0 +1,355 @@ + + +# curl vulnerability disclosure policy + +This document describes how security vulnerabilities are handled in the curl +project. + +## Publishing Information + +All known and public curl or libcurl related vulnerabilities are listed on +[the curl website security page](https://curl.se/docs/security.html). + +Security vulnerabilities **should not** be entered in the project's public bug +tracker. + +## Vulnerability Handling + +The typical process for handling a new security vulnerability is as follows. + +No information should be made public about a vulnerability until it is +formally announced at the end of this process. That means, for example, that a +bug tracker entry must NOT be created to track the issue since that makes the +issue public and it should not be discussed on any of the project's public +mailing lists. Messages associated with any commits should not make any +reference to the security nature of the commit if done prior to the public +announcement. + +- The person discovering the issue, the reporter, reports the vulnerability on + [HackerOne](https://hackerone.com/curl). Issues filed there reach a handful + of selected and trusted people. + +- Messages that do not relate to the reporting or managing of an undisclosed + security vulnerability in curl or libcurl are ignored and no further action + is required. + +- A person in the security team responds to the original report to acknowledge + that a human has seen the report. + +- The security team investigates the report and either rejects it or accepts + it. See below for examples of problems that are not considered + vulnerabilities. + +- If the report is rejected, the team writes to the reporter to explain why. + +- If the report is accepted, the team writes to the reporter to let them + know it is accepted and that they are working on a fix. + +- The security team discusses the problem, works out a fix, considers the + impact of the problem and suggests a release schedule. This discussion + should involve the reporter as much as possible. + +- The release of the information should be "as soon as possible" and is most + often synchronized with an upcoming release that contains the fix. If the + reporter, or anyone else involved, thinks the next planned release is too + far away, then a separate earlier release should be considered. + +- Write a security advisory draft about the problem that explains what the + problem is, its impact, which versions it affects, solutions or workarounds, + when the release is out and make sure to credit all contributors properly. + Figure out the CWE (Common Weakness Enumeration) number for the flaw. See + [SECURITY-ADVISORY](https://curl.se/dev/advisory.html) for help on creating + the advisory. + +- Request a CVE Id for the issue. curl is a CNA (CVE Numbering Authority) and + can request its own numbers. + +- Update the "security advisory" with the CVE number. + +- The security team commits the fix in a private branch. The commit message + should ideally contain the CVE number. If the severity level of the issue is + set to Low or Medium, the fix is allowed to get merged into the master + repository via a normal PR - but without mentioning it being a security + vulnerability. + +- The monetary reward part of the bug-bounty is managed by the Internet Bug + Bounty team and the reporter is asked to request the reward from them after + the issue has been completely handled and published by curl. + +- No more than seven days before release, inform + [distros@openwall](https://oss-security.openwall.org/wiki/mailing-lists/distros) + to prepare them about the upcoming public security vulnerability + announcement - attach the advisory draft for information with CVE and + current patch. 'distros' does not accept an embargo longer than 7 days and + they do not care for Windows-specific flaws. + +- No more than 48 hours before the release, the private branch is merged into + the master branch and pushed. Once pushed, the information is accessible to + the public and the actual release should follow suit immediately afterwards. + The time between the push and the release is used for final tests and + reviews. + +- The project team creates a release that includes the fix. + +- The project team announces the release and the vulnerability to the world in + the same manner we always announce releases. It gets sent to the + curl-announce, curl-library and curl-users mailing lists. + +- The security webpage on the website should get the new vulnerability + mentioned. + +## security (at curl dot se) + +This is a private mailing list for discussions on and about curl security +issues. + +Who is on this list? There are a couple of criteria you must meet, and then we +might ask you to join the list or you can ask to join it. It really is not a +formal process. We basically only require that you have a long-term presence +in the curl project and you have shown an understanding for the project and +its way of working. You must have been around for a good while and you should +have no plans of vanishing in the near future. + +We do not make the list of participants public mostly because it tends to vary +somewhat over time and a list somewhere only risks getting outdated. + +## Publishing Security Advisories + +1. Write up the security advisory, using markdown syntax. Use the same + subtitles as last time to maintain consistency. + +2. Name the advisory file after the allocated CVE id. + +3. Add a line on the top of the array in `curl-www/docs/vuln.pm`. + +4. Put the new advisory markdown file in the `curl-www/docs/` directory. Add it + to the git repository. + +5. Run `make` in your local web checkout and verify that things look fine. + +6. On security advisory release day, push the changes on the curl-www + repository's remote master branch. + +## Disclose the report + +Request the issue to be disclosed. If there are sensitive details present in +the report and discussion, those should be redacted from the disclosure. The +default policy is to disclose as much as possible as soon as the vulnerability +has been published. + +*All* reports submitted to the project, valid or not, should be disclosed and +made public. + +## Bug Bounty + +See [BUG-BOUNTY](https://curl.se/docs/bugbounty.html) for details on the +bug bounty program. + +# Severity levels + +The curl project's security team rates security problems using four severity +levels depending how serious we consider the problem to be. We use **Low**, +**Medium**, **High** and **Critical**. We refrain from using numerical scoring +of vulnerabilities. + +We do not support CVSS as a method to grade security vulnerabilities, so we do +not set them for CVE records published by the curl project. We believe CVSS is +a broken system that often does not properly evaluate to suitable severity +levels that reflect all dimensions and factors involved. Other organizations +however set and provide CVSS scores for curl vulnerabilities. You need to +decide for yourself if you believe they know enough about the subjects +involved to make reasonable assessments. Deciding between four different +severity levels is hard enough for us. + +When deciding severity level on a particular issue, we take all the factors +into account: attack vector, attack complexity, required privileges, necessary +build configuration, protocols involved, platform specifics and also what +effects a possible exploit or trigger of the issue can lead to, including +confidentiality, integrity or availability problems. + +## Low + +This is a security problem that is truly hard or unlikely to exploit or +trigger. Due to timing, platform requirements or the fact that options or +protocols involved are rare etc. [Past +example](https://curl.se/docs/CVE-2022-43552.html) + +## Medium + +This is a security problem that is less hard than **Low** to exploit or +trigger. Less strict timing, wider platform availability or involving more +widely used options or protocols. A problem that usually needs something else +to also happen to become serious. [Past +example](https://curl.se/docs/CVE-2022-32206.html) + +## High + +This issue is in itself a serious problem with real world impact. Flaws that +can easily compromise the confidentiality, integrity or availability of +resources. Exploiting or triggering this problem is not hard. [Past +example](https://curl.se/docs/CVE-2019-3822.html) + +## Critical + +Easily exploitable by a remote unauthenticated attacker and lead to system +compromise (arbitrary code execution) without requiring user interaction, with +a common configuration on a popular platform. This issue has few restrictions +and requirements and can be exploited easily using most curl configurations. +[Past example](https://curl.se/docs/CVE-2000-0973.html) + +# Not security issues + +This is an incomplete list of issues that are not considered vulnerabilities. + +## Small memory leaks + +We do not consider a small memory leak a security problem; even if the amount +of allocated memory grows by a small amount every now and then. Long-living +applications and services already need to have countermeasures and deal with +growing memory usage, be it leaks or just increased use. A small memory or +resource leak is then expected to *not* cause a security problem. + +Of course there can be a discussion if a leak is small or not. A large leak +can be considered a security problem due to the DOS risk. If leaked memory +contains sensitive data it might also qualify as a security problem. + +## Never-ending transfers + +We do not consider flaws that cause a transfer to never end to be a security +problem. There are already several benign and likely reasons for transfers to +stall and never end, so applications that cannot deal with never-ending +transfers already need to have counter-measures established. + +If the problem avoids the regular counter-measures when it causes a never- +ending transfer, it might be a security problem. + +## Not practically possible + +If the flaw or vulnerability cannot practically get executed on existing +hardware it is not a security problem. + +## API misuse + +If a reported issue only triggers by an application using the API in a way +that is not documented to work or even documented to not work, it is probably +not going to be considered a security problem. We only guarantee secure and +proper functionality when the APIs are used as expected and documented. + +There can be a discussion about what the documentation actually means and how +to interpret the text, which might end up with us still agreeing that it is a +security problem. + +## Local attackers already present + +When an issue can only be attacked or misused by an attacker present on the +local system or network, the bar is raised. If a local user wrongfully has +elevated rights on your system enough to attack curl, they can probably +already do much worse harm and the problem is not really in curl. + +## Debug & Experiments + +Vulnerabilities in features which are off by default (in the build) and +documented as experimental, or exist only in debug mode, are not eligible for a +reward and we do not consider them security problems. + +The same applies to scripts and software which are not installed by default +through the make install rule. + +## URL inconsistencies + +URL parser inconsistencies between browsers and curl are expected and are not +considered security vulnerabilities. The WHATWG URL Specification and RFC +3986+ (the plus meaning that it is an extended version) [are not completely +interoperable](https://github.com/bagder/docs/blob/master/URL-interop.md). + +Obvious parser bugs can still be vulnerabilities of course. + +## Visible command line arguments + +The curl command blanks the contents of a number of command line arguments to +prevent them from appearing in process listings. It does not blank all +arguments, even though some that are not blanked might contain sensitive +data. We consider this functionality a best-effort and omissions are not +security vulnerabilities. + + - not all systems allow the arguments to be blanked in the first place + - since curl blanks the argument itself they are readable for a short moment + no matter what + - virtually every argument can contain sensitive data, depending on use + - blanking all arguments would make it impractical for users to differentiate + curl command lines in process listings + +## Busy-loops + +Busy-loops that consume 100% CPU time but eventually end (perhaps due to a set +timeout value or otherwise) are not considered security problems. Applications +are supposed to already handle situations when the transfer loop legitimately +consumes 100% CPU time, so while a prolonged such busy-loop is a nasty bug, we +do not consider it a security problem. + +## Saving files + +curl cannot protect against attacks where an attacker has write access to the +same directory where curl is directed to save files. + +## Tricking a user to run a command line + +A creative, misleading or funny looking command line is not a security +problem. The curl command line tool takes options and URLs on the command line +and if an attacker can trick the user to run a specifically crafted curl +command line, all bets are off. Such an attacker can just as well have the +user run a much worse command that can do something fatal (like +`sudo rm -rf /`). + +## Terminal output and escape sequences + +Content that is transferred from a server and gets displayed in a terminal by +curl may contain escape sequences or use other tricks to fool the user. This +is curl working as designed and is not a curl security problem. Escape +sequences, moving cursor, changing color etc, is also frequently used for +good. To reduce the risk of getting fooled, save files and browse them after +download using a display method that minimizes risks. + +## NULL dereferences and crashes + +If a malicious server can trigger a NULL dereference in curl or otherwise +cause curl to crash (and nothing worse), chances are big that we do not +consider that a security problem. + +Malicious servers can already cause considerable harm and denial of service +like scenarios without having to trigger such code paths. For example by +stalling, being terribly slow or by delivering enormous amounts of data. +Additionally, applications are expected to handle "normal" crashes without +that being the end of the world. + +There need to be more and special circumstances to treat such problems as +security issues. + +## Legacy dependencies + +Problems that can be triggered only by the use of a *legacy dependency* are +not considered security problems. + +A *legacy dependency* is here defined as: + +- the legacy version was released over ten years ago AND + +- the legacy version is no longer in use by any existing still supported + operating system or distribution AND + +- there are modern versions of equivalent or better functionality offered and + in common use + +## weak algorithms required for functionality + +curl supports several algorithms that are considered weak, like DES and MD5. +These algorithms are still not curl security vulnerabilities or security +problems as they are only used when the users explicitly ask for their use by +using the protocols or options that require the use of those algorithms. + +When servers upgrade to use secure alternatives, curl users should use those +options/protocols. diff --git a/curl/docs/cmdline-opts/CMakeLists.txt b/curl/docs/cmdline-opts/CMakeLists.txt index 5aa20dfdb..745caf047 100644 --- a/curl/docs/cmdline-opts/CMakeLists.txt +++ b/curl/docs/cmdline-opts/CMakeLists.txt @@ -1,12 +1,42 @@ -set(MANPAGE "${CMAKE_BINARY_DIR}/docs/curl.1") - -# Load DPAGES and OTHERPAGES from shared file -transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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 +# +########################################################################### +# Get SUPPORT, DPAGES variables +curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -add_custom_command(OUTPUT "${MANPAGE}" - COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/gen.pl" mainpage "${CMAKE_CURRENT_SOURCE_DIR}" > "${MANPAGE}" - DEPENDS ${DPAGES} ${OTHERPAGES} +add_custom_command(OUTPUT "${CURL_MANPAGE}" "${CURL_ASCIIPAGE}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/managen" mainpage ${DPAGES} > "${CURL_MANPAGE}" + COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/managen" ascii ${DPAGES} > "${CURL_ASCIIPAGE}" + DEPENDS "${PROJECT_SOURCE_DIR}/scripts/managen" ${DPAGES} ${SUPPORT} + "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" + "${CMAKE_CURRENT_SOURCE_DIR}/mainpage.idx" VERBATIM ) -add_custom_target(generate-curl.1 DEPENDS "${MANPAGE}") + +add_custom_target(generate-curl.1 ALL DEPENDS "${CURL_MANPAGE}") + +if(NOT CURL_DISABLE_INSTALL) + install(FILES "${CURL_MANPAGE}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") +endif() diff --git a/curl/docs/cmdline-opts/MANPAGE.md b/curl/docs/cmdline-opts/MANPAGE.md index 3a8270b03..3e2e7151f 100644 --- a/curl/docs/cmdline-opts/MANPAGE.md +++ b/curl/docs/cmdline-opts/MANPAGE.md @@ -1,52 +1,118 @@ + + # curl man page generator -This is the curl man page generator. It generates a single nroff man page +`managen` is the curl man page generator. It generates a single nroff man page output from the set of sources files in this directory. -There is one source file for each supported command line option. The format is -described below. +The `mainpage.idx` file lists all files that are rendered in that order to +produce the output. The magic `%options` keyword inserts all command line +options documented. + +The `%options` documentation is created with one source file for each +supported command line option. + +The documentation file format is described below. It is meant to look similar +to markdown which is why it uses `.md` file extensions. ## Option files Each command line option is described in a file named `.d`, where -option name is written without any prefixing dashes. Like the file name for -the -v, --verbose option is named `verbose.d`. +option name is written without any prefixing dashes. Like the filename for the +`-v, --verbose` option is named `verbose.d`. -Each file has a set of meta-data and a body of text. +Each file has a set of meta-data in the top of the file, followed by a body of +text. + +The documentation files that do not document options have no meta-data part. + +A line that starts with ``. ### Meta-data - Short: (single letter, without dash) - Long: (long form name, without dashes) + --- (start of meta-data) + Added: (version number in which this was added) Arg: (the argument the option takes) + c: (copyright line) + Example: + - (an example command line, without "curl" and can use `$URL`) + - (another example) + Experimental: yes (if so) + Help: (short text for the --help output for this option) + Long: (long form name, without dashes) Magic: (description of "magic" options) - Tags: (space separated list) - Protocols: (space separated list for which protocols this option works) - Added: (version number in which this was added) + Multi: single/append/boolean/mutex/custom/per-URL (if used more than once) Mutexed: (space separated list of options this overrides, no dashes) + Protocols: (space separated list for which protocols this option works) Requires: (space separated list of features this requires, no dashes) - See-also: (space separated list of related options, no dashes) - Help: (short text for the --help output for this option) + Scope: global (if the option is global) + See-also: + - (a related option, no dashes) + - (another related option, no dashes) + Short: (single letter, without dash) + SPDX-License-Identifier: curl + Tags: (space separated list) --- (end of meta-data) ### Body The body of the description. Only refer to options with their long form option -version, like --verbose. The output generator will replace such with the +version, like `--verbose`. The output generator replaces such option with the correct markup that shows both short and long version. -## Header +Text written within `*asterisks*` is shown using italics. Text within two +`**asterisks**` is shown using bold. + +Text that is prefixed with a space is treated like an "example" and gets +output in monospace. + +Within the body, describe a list of items like this: + + ## item 1 + description + + ## item 2 + second description + +The list is automatically terminated at end of file, or you can do it +explicitly with an empty "header": + + ## -`page-header` is the nroff formatted file that will be output before the -generated options output for the master man page. +Angle brackets (`<>`) need to be escaped when used in text like `\<` and +`\>`. This, to ensure that the text renders nicely as markdown. + +### Headers + +The `#` header can be used by non-option files and it produces a +`.SH` output. + +If the `#` header is used for a command line option file, that header is +simply ignored in the generated output. It can still serve a purpose in the +source file as it helps the user identify what option the file is for. + +### Variables + +There are three different "variables" that can be used when creating the +output. They need to be written within backticks in the source file (to escape +getting spellchecked by CI jobs): `%DATE`, `%VERSION` and `%GLOBALS`. ## Generate -`./gen.pl mainpage` +`managen mainpage [list of markdown option file names]` This command outputs a single huge nroff file, meant to become `curl.1`. The full curl man page. -`./gen.pl listhelp` +`managen ascii [list of markdown option file names]` + +This command outputs a single text file, meant to become `curl.txt`. The full +curl man page in text format, used to build `tool_hugehelp.c`. + +`managen listhelp` Generates a full `curl --help` output for all known command line options. diff --git a/curl/docs/cmdline-opts/Makefile.am b/curl/docs/cmdline-opts/Makefile.am index e6ecf7a6b..e016be286 100644 --- a/curl/docs/cmdline-opts/Makefile.am +++ b/curl/docs/cmdline-opts/Makefile.am @@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -18,17 +18,47 @@ # 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 no-dependencies -MANPAGE = $(top_builddir)/docs/curl.1 +MANPAGE = curl.1 +ASCIIPAGE = curl.txt +# Get SUPPORT, DPAGES variables include Makefile.inc -EXTRA_DIST = $(DPAGES) MANPAGE.md gen.pl $(OTHERPAGES) CMakeLists.txt +EXTRA_DIST = $(DPAGES) MANPAGE.md $(SUPPORT) CMakeLists.txt mainpage.idx + +GEN = $(GN_$(V)) +GN_0 = @echo " GENERATE" $@; +GN_1 = +GN_ = $(GN_0) + +MANAGEN=$(top_srcdir)/scripts/managen +MAXLINE=$(top_srcdir)/scripts/maxline + +# Maximum number of columns accepted in the ASCII version of the manpage +INCDIR=$(top_srcdir)/include + +if BUILD_DOCS +CLEANFILES = $(MANPAGE) $(ASCIIPAGE) +man_MANS = $(MANPAGE) + +all: $(MANPAGE) $(ASCIIPAGE) + +endif + +$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN) + $(GEN)(rm -f $(MANPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) mainpage $(DPAGES) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE)) + +$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN) + $(GEN)(rm -f $(ASCIIPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) ascii $(DPAGES) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE)) -all: $(MANPAGE) +listhelp: + $(MANAGEN) -d $(srcdir) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c -$(MANPAGE): $(DPAGES) $(OTHERPAGES) Makefile.inc - @PERL@ $(srcdir)/gen.pl mainpage $(srcdir) > $(MANPAGE) +listcats: + @$(MANAGEN) listcats $(DPAGES) diff --git a/curl/docs/cmdline-opts/Makefile.in b/curl/docs/cmdline-opts/Makefile.in index 75c897b77..35d9f7a46 100644 --- a/curl/docs/cmdline-opts/Makefile.in +++ b/curl/docs/cmdline-opts/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,11 +21,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) Daniel Stenberg, , 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.haxx.se/docs/copyright.html. +# 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 @@ -34,9 +34,34 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # +# SPDX-License-Identifier: curl +# ########################################################################### -# Shared between Makefile.am and CMakeLists.txt +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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 +# +########################################################################### +# Shared between CMakeLists.txt and Makefile.am VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -113,19 +138,24 @@ build_triplet = @build@ host_triplet = @host@ subdir = docs/cmdline-opts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/curl-amissl.m4 \ $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/m4/curl-confopts.m4 \ $(top_srcdir)/m4/curl-functions.m4 \ + $(top_srcdir)/m4/curl-gnutls.m4 \ + $(top_srcdir)/m4/curl-mbedtls.m4 \ $(top_srcdir)/m4/curl-openssl.m4 \ $(top_srcdir)/m4/curl-override.m4 \ - $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/curl-reentrant.m4 \ + $(top_srcdir)/m4/curl-rustls.m4 \ + $(top_srcdir)/m4/curl-schannel.m4 \ + $(top_srcdir)/m4/curl-sysconfig.m4 \ + $(top_srcdir)/m4/curl-wolfssl.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/xc-am-iface.m4 \ $(top_srcdir)/m4/xc-cc-check.m4 \ $(top_srcdir)/m4/xc-lt-iface.m4 \ - $(top_srcdir)/m4/xc-translit.m4 \ $(top_srcdir)/m4/xc-val-flgs.m4 \ $(top_srcdir)/m4/zz40-xc-ovr.m4 \ $(top_srcdir)/m4/zz50-xc-ovr.m4 \ @@ -151,7 +181,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = -am__depfiles_maybe = +am__maybe_remake_depfiles = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ @@ -159,57 +189,71 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.inc DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APXS = @APXS@ AR = @AR@ +AR_FLAGS = @AR_FLAGS@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@ +CADDY = @CADDY@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ -CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CURLVERSION = @CURLVERSION@ CURL_CA_BUNDLE = @CURL_CA_BUNDLE@ +CURL_CA_EMBED = @CURL_CA_EMBED@ CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@ -CURL_DISABLE_DICT = @CURL_DISABLE_DICT@ -CURL_DISABLE_FILE = @CURL_DISABLE_FILE@ -CURL_DISABLE_FTP = @CURL_DISABLE_FTP@ -CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@ -CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@ -CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@ -CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@ -CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@ -CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@ -CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@ -CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@ -CURL_DISABLE_SMB = @CURL_DISABLE_SMB@ -CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@ -CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@ -CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@ -CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@ +CURL_CPP = @CURL_CPP@ +CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX = @CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX@ +CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME = @CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME@ CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@ -CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@ -CURL_WITH_MULTI_SSL = @CURL_WITH_MULTI_SSL@ CYGPATH_W = @CYGPATH_W@ -DEFAULT_SSL_BACKEND = @DEFAULT_SSL_BACKEND@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -221,29 +265,31 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_SHARED = @ENABLE_SHARED@ ENABLE_STATIC = @ENABLE_STATIC@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ +FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@ GCOV = @GCOV@ -GENHTML = @GENHTML@ GREP = @GREP@ -HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ -HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ -HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@ -IDN_ENABLED = @IDN_ENABLED@ +HTTPD = @HTTPD@ +HTTPD_NGHTTPX = @HTTPD_NGHTTPX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -IPV6_ENABLED = @IPV6_ENABLED@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LIBCURL_LIBS = @LIBCURL_LIBS@ -LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@ -LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@ -LIBMETALINK_LIBS = @LIBMETALINK_LIBS@ +LIBCURL_PC_CFLAGS = @LIBCURL_PC_CFLAGS@ +LIBCURL_PC_CFLAGS_PRIVATE = @LIBCURL_PC_CFLAGS_PRIVATE@ +LIBCURL_PC_LDFLAGS_PRIVATE = @LIBCURL_PC_LDFLAGS_PRIVATE@ +LIBCURL_PC_LIBS = @LIBCURL_PC_LIBS@ +LIBCURL_PC_LIBS_PRIVATE = @LIBCURL_PC_LIBS_PRIVATE@ +LIBCURL_PC_REQUIRES = @LIBCURL_PC_REQUIRES@ +LIBCURL_PC_REQUIRES_PRIVATE = @LIBCURL_PC_REQUIRES_PRIVATE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -254,12 +300,9 @@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ -MANOPT = @MANOPT@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ -NROFF = @NROFF@ -NSS_LIBS = @NSS_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ @@ -273,39 +316,20 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PKGADD_NAME = @PKGADD_NAME@ -PKGADD_PKG = @PKGADD_PKG@ -PKGADD_VENDOR = @PKGADD_VENDOR@ PKGCONFIG = @PKGCONFIG@ -RANDOM_FILE = @RANDOM_FILE@ RANLIB = @RANLIB@ -REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@ +RC = @RC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ -SSL_ENABLED = @SSL_ENABLED@ -SSL_LIBS = @SSL_LIBS@ +SSL_BACKENDS = @SSL_BACKENDS@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ -USE_ARES = @USE_ARES@ -USE_AXTLS = @USE_AXTLS@ -USE_CYASSL = @USE_CYASSL@ -USE_DARWINSSL = @USE_DARWINSSL@ -USE_GNUTLS = @USE_GNUTLS@ -USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@ -USE_LIBRTMP = @USE_LIBRTMP@ -USE_LIBSSH2 = @USE_LIBSSH2@ -USE_MBEDTLS = @USE_MBEDTLS@ -USE_NGHTTP2 = @USE_NGHTTP2@ -USE_NSS = @USE_NSS@ -USE_OPENLDAP = @USE_OPENLDAP@ -USE_POLARSSL = @USE_POLARSSL@ -USE_SCHANNEL = @USE_SCHANNEL@ -USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@ -USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ +TEST_NGHTTPX = @TEST_NGHTTPX@ VERSION = @VERSION@ VERSIONNUM = @VERSIONNUM@ +VSFTPD = @VSFTPD@ ZLIB_LIBS = @ZLIB_LIBS@ ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@ abs_builddir = @abs_builddir@ @@ -357,62 +381,320 @@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ -subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies -MANPAGE = $(top_builddir)/docs/curl.1 -DPAGES = abstract-unix-socket.d anyauth.d append.d basic.d cacert.d capath.d cert.d \ - cert-status.d cert-type.d ciphers.d compressed.d compressed-ssh.d \ - config.d \ - connect-timeout.d connect-to.d continue-at.d cookie.d cookie-jar.d \ - create-dirs.d crlf.d crlfile.d data-ascii.d data-binary.d data.d \ - data-raw.d data-urlencode.d delegation.d digest.d disable.d \ - disable-eprt.d disable-epsv.d dns-interface.d dns-ipv4-addr.d \ - dns-ipv6-addr.d dns-servers.d dump-header.d egd-file.d engine.d \ - expect100-timeout.d fail.d fail-early.d false-start.d \ - form.d form-string.d ftp-account.d ftp-alternative-to-user.d \ - ftp-create-dirs.d ftp-method.d ftp-pasv.d ftp-port.d ftp-pret.d \ - ftp-skip-pasv-ip.d ftp-ssl-ccc.d ftp-ssl-ccc-mode.d ftp-ssl-control.d \ - get.d globoff.d head.d header.d help.d hostpubmd5.d http1.0.d \ - http1.1.d http2.d http2-prior-knowledge.d ignore-content-length.d \ - include.d insecure.d interface.d ipv4.d ipv6.d junk-session-cookies.d \ - keepalive-time.d key.d key-type.d krb.d libcurl.d limit-rate.d \ - list-only.d local-port.d location.d location-trusted.d \ - login-options.d mail-auth.d mail-from.d mail-rcpt.d manual.d \ - max-filesize.d max-redirs.d max-time.d metalink.d negotiate.d netrc.d \ - netrc-file.d netrc-optional.d next.d no-alpn.d no-buffer.d \ - no-keepalive.d no-npn.d noproxy.d no-sessionid.d ntlm.d ntlm-wb.d \ - oauth2-bearer.d output.d pass.d path-as-is.d pinnedpubkey.d post301.d \ - post302.d post303.d preproxy.d progress-bar.d proto.d proto-default.d \ - proto-redir.d proxy1.0.d proxy-anyauth.d proxy-basic.d proxy-cacert.d \ - proxy-capath.d proxy-cert.d proxy-cert-type.d proxy-ciphers.d \ - proxy-crlfile.d proxy.d proxy-digest.d proxy-header.d \ - proxy-insecure.d proxy-key.d proxy-key-type.d proxy-negotiate.d \ - proxy-ntlm.d proxy-pass.d proxy-service-name.d \ - proxy-ssl-allow-beast.d proxy-tlsauthtype.d proxy-tlspassword.d \ - proxy-tlsuser.d proxy-tlsv1.d proxytunnel.d proxy-user.d pubkey.d \ - quote.d random-file.d range.d raw.d referer.d remote-header-name.d \ - remote-name-all.d remote-name.d remote-time.d request.d resolve.d \ - retry-connrefused.d retry.d retry-delay.d retry-max-time.d sasl-ir.d \ - service-name.d show-error.d silent.d socks4a.d socks4.d socks5.d \ - socks5-basic.d socks5-gssapi.d \ - socks5-gssapi-nec.d socks5-gssapi-service.d socks5-hostname.d \ - speed-limit.d speed-time.d ssl-allow-beast.d ssl.d ssl-no-revoke.d \ - ssl-reqd.d sslv2.d sslv3.d stderr.d suppress-connect-headers.d \ - tcp-fastopen.d tcp-nodelay.d \ - telnet-option.d tftp-blksize.d tftp-no-options.d time-cond.d \ - tls-max.d \ - tlsauthtype.d tlspassword.d tlsuser.d tlsv1.0.d tlsv1.1.d tlsv1.2.d \ - tlsv1.3.d tlsv1.d trace-ascii.d trace.d trace-time.d tr-encoding.d \ - unix-socket.d upload-file.d url.d use-ascii.d user-agent.d user.d \ - verbose.d version.d write-out.d xattr.d request-target.d - -OTHERPAGES = page-footer page-header -EXTRA_DIST = $(DPAGES) MANPAGE.md gen.pl $(OTHERPAGES) CMakeLists.txt +MANPAGE = curl.1 +ASCIIPAGE = curl.txt +SUPPORT = \ + _AUTHORS.md \ + _BUGS.md \ + _DESCRIPTION.md \ + _ENVIRONMENT.md \ + _EXITCODES.md \ + _FILES.md \ + _GLOBBING.md \ + _NAME.md \ + _OPTIONS.md \ + _OUTPUT.md \ + _PROGRESS.md \ + _PROTOCOLS.md \ + _PROXYPREFIX.md \ + _SEEALSO.md \ + _SYNOPSIS.md \ + _URL.md \ + _VARIABLES.md \ + _VERSION.md \ + _WWW.md + +DPAGES = \ + abstract-unix-socket.md \ + alt-svc.md \ + anyauth.md \ + append.md \ + aws-sigv4.md \ + basic.md \ + ca-native.md \ + cacert.md \ + capath.md \ + cert-status.md \ + cert-type.md \ + cert.md \ + ciphers.md \ + compressed-ssh.md \ + compressed.md \ + config.md \ + connect-timeout.md \ + connect-to.md \ + continue-at.md \ + cookie-jar.md \ + cookie.md \ + create-dirs.md \ + create-file-mode.md \ + crlf.md \ + crlfile.md \ + curves.md \ + data-ascii.md \ + data-binary.md \ + data-raw.md \ + data-urlencode.md \ + data.md \ + delegation.md \ + digest.md \ + disable-eprt.md \ + disable-epsv.md \ + disable.md \ + disallow-username-in-url.md \ + dns-interface.md \ + dns-ipv4-addr.md \ + dns-ipv6-addr.md \ + dns-servers.md \ + doh-cert-status.md \ + doh-insecure.md \ + doh-url.md \ + dump-ca-embed.md \ + dump-header.md \ + ech.md \ + egd-file.md \ + engine.md \ + etag-compare.md \ + etag-save.md \ + expect100-timeout.md \ + fail-early.md \ + fail-with-body.md \ + fail.md \ + false-start.md \ + form-escape.md \ + form-string.md \ + form.md \ + ftp-account.md \ + ftp-alternative-to-user.md \ + ftp-create-dirs.md \ + ftp-method.md \ + ftp-pasv.md \ + ftp-port.md \ + ftp-pret.md \ + ftp-skip-pasv-ip.md \ + ftp-ssl-ccc-mode.md \ + ftp-ssl-ccc.md \ + ftp-ssl-control.md \ + get.md \ + globoff.md \ + happy-eyeballs-timeout-ms.md \ + haproxy-protocol.md \ + haproxy-clientip.md \ + head.md \ + header.md \ + help.md \ + hostpubmd5.md \ + hostpubsha256.md \ + hsts.md \ + http0.9.md \ + http1.0.md \ + http1.1.md \ + http2-prior-knowledge.md \ + http2.md \ + http3.md \ + http3-only.md \ + ignore-content-length.md \ + insecure.md \ + interface.md \ + ip-tos.md \ + ipfs-gateway.md \ + ipv4.md \ + ipv6.md \ + json.md \ + junk-session-cookies.md \ + keepalive-cnt.md \ + keepalive-time.md \ + key-type.md \ + key.md \ + krb.md \ + libcurl.md \ + limit-rate.md \ + list-only.md \ + local-port.md \ + location-trusted.md \ + location.md \ + login-options.md \ + mail-auth.md \ + mail-from.md \ + mail-rcpt-allowfails.md \ + mail-rcpt.md \ + manual.md \ + max-filesize.md \ + max-redirs.md \ + max-time.md \ + metalink.md \ + mptcp.md \ + negotiate.md \ + netrc-file.md \ + netrc-optional.md \ + netrc.md \ + next.md \ + no-alpn.md \ + no-buffer.md \ + no-clobber.md \ + no-keepalive.md \ + no-npn.md \ + no-progress-meter.md \ + no-sessionid.md \ + noproxy.md \ + ntlm-wb.md \ + ntlm.md \ + oauth2-bearer.md \ + output-dir.md \ + output.md \ + parallel-immediate.md \ + parallel-max.md \ + parallel.md \ + pass.md \ + path-as-is.md \ + pinnedpubkey.md \ + post301.md \ + post302.md \ + post303.md \ + preproxy.md \ + progress-bar.md \ + proto-default.md \ + proto-redir.md \ + proto.md \ + proxy-anyauth.md \ + proxy-basic.md \ + proxy-ca-native.md \ + proxy-cacert.md \ + proxy-capath.md \ + proxy-cert-type.md \ + proxy-cert.md \ + proxy-ciphers.md \ + proxy-crlfile.md \ + proxy-digest.md \ + proxy-header.md \ + proxy-http2.md \ + proxy-insecure.md \ + proxy-key-type.md \ + proxy-key.md \ + proxy-negotiate.md \ + proxy-ntlm.md \ + proxy-pass.md \ + proxy-pinnedpubkey.md \ + proxy-service-name.md \ + proxy-ssl-allow-beast.md \ + proxy-ssl-auto-client-cert.md \ + proxy-tls13-ciphers.md \ + proxy-tlsauthtype.md \ + proxy-tlspassword.md \ + proxy-tlsuser.md \ + proxy-tlsv1.md \ + proxy-user.md \ + proxy.md \ + proxy1.0.md \ + proxytunnel.md \ + pubkey.md \ + quote.md \ + random-file.md \ + range.md \ + rate.md \ + raw.md \ + referer.md \ + remote-header-name.md \ + remote-name-all.md \ + remote-name.md \ + remote-time.md \ + remove-on-error.md \ + request-target.md \ + request.md \ + resolve.md \ + retry-all-errors.md \ + retry-connrefused.md \ + retry-delay.md \ + retry-max-time.md \ + retry.md \ + sasl-authzid.md \ + sasl-ir.md \ + service-name.md \ + show-error.md \ + show-headers.md \ + silent.md \ + sigalgs.md \ + skip-existing.md \ + socks4.md \ + socks4a.md \ + socks5-basic.md \ + socks5-gssapi-nec.md \ + socks5-gssapi-service.md \ + socks5-gssapi.md \ + socks5-hostname.md \ + socks5.md \ + speed-limit.md \ + speed-time.md \ + ssl-allow-beast.md \ + ssl-auto-client-cert.md \ + ssl-no-revoke.md \ + ssl-reqd.md \ + ssl-revoke-best-effort.md \ + ssl-sessions.md \ + ssl.md \ + sslv2.md \ + sslv3.md \ + stderr.md \ + styled-output.md \ + suppress-connect-headers.md \ + tcp-fastopen.md \ + tcp-nodelay.md \ + telnet-option.md \ + tftp-blksize.md \ + tftp-no-options.md \ + time-cond.md \ + tls-earlydata.md \ + tls-max.md \ + tls13-ciphers.md \ + tlsauthtype.md \ + tlspassword.md \ + tlsuser.md \ + tlsv1.0.md \ + tlsv1.1.md \ + tlsv1.2.md \ + tlsv1.3.md \ + tlsv1.md \ + tr-encoding.md \ + trace-ascii.md \ + trace-config.md \ + trace-ids.md \ + trace-time.md \ + trace.md \ + unix-socket.md \ + upload-file.md \ + upload-flags.md \ + url.md \ + url-query.md \ + use-ascii.md \ + user-agent.md \ + user.md \ + variable.md \ + verbose.md \ + version.md \ + vlan-priority.md \ + write-out.md \ + xattr.md + + +# Get SUPPORT, DPAGES variables +EXTRA_DIST = $(DPAGES) MANPAGE.md $(SUPPORT) CMakeLists.txt mainpage.idx +GEN = $(GN_$(V)) +GN_0 = @echo " GENERATE" $@; +GN_1 = +GN_ = $(GN_0) +MANAGEN = $(top_srcdir)/scripts/managen +MAXLINE = $(top_srcdir)/scripts/maxline + +# Maximum number of columns accepted in the ASCII version of the manpage +INCDIR = $(top_srcdir)/include +@BUILD_DOCS_TRUE@CLEANFILES = $(MANPAGE) $(ASCIIPAGE) +@BUILD_DOCS_TRUE@man_MANS = $(MANPAGE) all: all-am .SUFFIXES: @@ -433,8 +715,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(srcdir)/Makefile.inc $(am__empty): @@ -452,14 +734,59 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am -distdir: $(DISTFILES) +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -491,8 +818,11 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile +all-am: Makefile $(MANS) installdirs: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -515,6 +845,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -543,7 +874,7 @@ info: info-am info-am: -install-data-am: +install-data-am: install-man install-dvi: install-dvi-am @@ -559,7 +890,7 @@ install-info: install-info-am install-info-am: -install-man: +install-man: install-man1 install-pdf: install-pdf-am @@ -587,7 +918,9 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 .MAKE: install-am install-strip @@ -597,19 +930,29 @@ uninstall-am: install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags-am uninstall uninstall-am uninstall-man \ + uninstall-man1 .PRECIOUS: Makefile -all: $(MANPAGE) +@BUILD_DOCS_TRUE@all: $(MANPAGE) $(ASCIIPAGE) + +$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN) + $(GEN)(rm -f $(MANPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) mainpage $(DPAGES) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE)) + +$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN) + $(GEN)(rm -f $(ASCIIPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) ascii $(DPAGES) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE)) + +listhelp: + $(MANAGEN) -d $(srcdir) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c -$(MANPAGE): $(DPAGES) $(OTHERPAGES) Makefile.inc - @PERL@ $(srcdir)/gen.pl mainpage $(srcdir) > $(MANPAGE) +listcats: + @$(MANAGEN) listcats $(DPAGES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/curl/docs/cmdline-opts/Makefile.inc b/curl/docs/cmdline-opts/Makefile.inc index e8f46410b..6e7f0aafa 100644 --- a/curl/docs/cmdline-opts/Makefile.inc +++ b/curl/docs/cmdline-opts/Makefile.inc @@ -1,49 +1,316 @@ -# Shared between Makefile.am and CMakeLists.txt +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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 +# +########################################################################### +# Shared between CMakeLists.txt and Makefile.am -DPAGES = abstract-unix-socket.d anyauth.d append.d basic.d cacert.d capath.d cert.d \ - cert-status.d cert-type.d ciphers.d compressed.d compressed-ssh.d \ - config.d \ - connect-timeout.d connect-to.d continue-at.d cookie.d cookie-jar.d \ - create-dirs.d crlf.d crlfile.d data-ascii.d data-binary.d data.d \ - data-raw.d data-urlencode.d delegation.d digest.d disable.d \ - disable-eprt.d disable-epsv.d dns-interface.d dns-ipv4-addr.d \ - dns-ipv6-addr.d dns-servers.d dump-header.d egd-file.d engine.d \ - expect100-timeout.d fail.d fail-early.d false-start.d \ - form.d form-string.d ftp-account.d ftp-alternative-to-user.d \ - ftp-create-dirs.d ftp-method.d ftp-pasv.d ftp-port.d ftp-pret.d \ - ftp-skip-pasv-ip.d ftp-ssl-ccc.d ftp-ssl-ccc-mode.d ftp-ssl-control.d \ - get.d globoff.d head.d header.d help.d hostpubmd5.d http1.0.d \ - http1.1.d http2.d http2-prior-knowledge.d ignore-content-length.d \ - include.d insecure.d interface.d ipv4.d ipv6.d junk-session-cookies.d \ - keepalive-time.d key.d key-type.d krb.d libcurl.d limit-rate.d \ - list-only.d local-port.d location.d location-trusted.d \ - login-options.d mail-auth.d mail-from.d mail-rcpt.d manual.d \ - max-filesize.d max-redirs.d max-time.d metalink.d negotiate.d netrc.d \ - netrc-file.d netrc-optional.d next.d no-alpn.d no-buffer.d \ - no-keepalive.d no-npn.d noproxy.d no-sessionid.d ntlm.d ntlm-wb.d \ - oauth2-bearer.d output.d pass.d path-as-is.d pinnedpubkey.d post301.d \ - post302.d post303.d preproxy.d progress-bar.d proto.d proto-default.d \ - proto-redir.d proxy1.0.d proxy-anyauth.d proxy-basic.d proxy-cacert.d \ - proxy-capath.d proxy-cert.d proxy-cert-type.d proxy-ciphers.d \ - proxy-crlfile.d proxy.d proxy-digest.d proxy-header.d \ - proxy-insecure.d proxy-key.d proxy-key-type.d proxy-negotiate.d \ - proxy-ntlm.d proxy-pass.d proxy-service-name.d \ - proxy-ssl-allow-beast.d proxy-tlsauthtype.d proxy-tlspassword.d \ - proxy-tlsuser.d proxy-tlsv1.d proxytunnel.d proxy-user.d pubkey.d \ - quote.d random-file.d range.d raw.d referer.d remote-header-name.d \ - remote-name-all.d remote-name.d remote-time.d request.d resolve.d \ - retry-connrefused.d retry.d retry-delay.d retry-max-time.d sasl-ir.d \ - service-name.d show-error.d silent.d socks4a.d socks4.d socks5.d \ - socks5-basic.d socks5-gssapi.d \ - socks5-gssapi-nec.d socks5-gssapi-service.d socks5-hostname.d \ - speed-limit.d speed-time.d ssl-allow-beast.d ssl.d ssl-no-revoke.d \ - ssl-reqd.d sslv2.d sslv3.d stderr.d suppress-connect-headers.d \ - tcp-fastopen.d tcp-nodelay.d \ - telnet-option.d tftp-blksize.d tftp-no-options.d time-cond.d \ - tls-max.d \ - tlsauthtype.d tlspassword.d tlsuser.d tlsv1.0.d tlsv1.1.d tlsv1.2.d \ - tlsv1.3.d tlsv1.d trace-ascii.d trace.d trace-time.d tr-encoding.d \ - unix-socket.d upload-file.d url.d use-ascii.d user-agent.d user.d \ - verbose.d version.d write-out.d xattr.d request-target.d +SUPPORT = \ + _AUTHORS.md \ + _BUGS.md \ + _DESCRIPTION.md \ + _ENVIRONMENT.md \ + _EXITCODES.md \ + _FILES.md \ + _GLOBBING.md \ + _NAME.md \ + _OPTIONS.md \ + _OUTPUT.md \ + _PROGRESS.md \ + _PROTOCOLS.md \ + _PROXYPREFIX.md \ + _SEEALSO.md \ + _SYNOPSIS.md \ + _URL.md \ + _VARIABLES.md \ + _VERSION.md \ + _WWW.md -OTHERPAGES = page-footer page-header +DPAGES = \ + abstract-unix-socket.md \ + alt-svc.md \ + anyauth.md \ + append.md \ + aws-sigv4.md \ + basic.md \ + ca-native.md \ + cacert.md \ + capath.md \ + cert-status.md \ + cert-type.md \ + cert.md \ + ciphers.md \ + compressed-ssh.md \ + compressed.md \ + config.md \ + connect-timeout.md \ + connect-to.md \ + continue-at.md \ + cookie-jar.md \ + cookie.md \ + create-dirs.md \ + create-file-mode.md \ + crlf.md \ + crlfile.md \ + curves.md \ + data-ascii.md \ + data-binary.md \ + data-raw.md \ + data-urlencode.md \ + data.md \ + delegation.md \ + digest.md \ + disable-eprt.md \ + disable-epsv.md \ + disable.md \ + disallow-username-in-url.md \ + dns-interface.md \ + dns-ipv4-addr.md \ + dns-ipv6-addr.md \ + dns-servers.md \ + doh-cert-status.md \ + doh-insecure.md \ + doh-url.md \ + dump-ca-embed.md \ + dump-header.md \ + ech.md \ + egd-file.md \ + engine.md \ + etag-compare.md \ + etag-save.md \ + expect100-timeout.md \ + fail-early.md \ + fail-with-body.md \ + fail.md \ + false-start.md \ + form-escape.md \ + form-string.md \ + form.md \ + ftp-account.md \ + ftp-alternative-to-user.md \ + ftp-create-dirs.md \ + ftp-method.md \ + ftp-pasv.md \ + ftp-port.md \ + ftp-pret.md \ + ftp-skip-pasv-ip.md \ + ftp-ssl-ccc-mode.md \ + ftp-ssl-ccc.md \ + ftp-ssl-control.md \ + get.md \ + globoff.md \ + happy-eyeballs-timeout-ms.md \ + haproxy-protocol.md \ + haproxy-clientip.md \ + head.md \ + header.md \ + help.md \ + hostpubmd5.md \ + hostpubsha256.md \ + hsts.md \ + http0.9.md \ + http1.0.md \ + http1.1.md \ + http2-prior-knowledge.md \ + http2.md \ + http3.md \ + http3-only.md \ + ignore-content-length.md \ + insecure.md \ + interface.md \ + ip-tos.md \ + ipfs-gateway.md \ + ipv4.md \ + ipv6.md \ + json.md \ + junk-session-cookies.md \ + keepalive-cnt.md \ + keepalive-time.md \ + key-type.md \ + key.md \ + krb.md \ + libcurl.md \ + limit-rate.md \ + list-only.md \ + local-port.md \ + location-trusted.md \ + location.md \ + login-options.md \ + mail-auth.md \ + mail-from.md \ + mail-rcpt-allowfails.md \ + mail-rcpt.md \ + manual.md \ + max-filesize.md \ + max-redirs.md \ + max-time.md \ + metalink.md \ + mptcp.md \ + negotiate.md \ + netrc-file.md \ + netrc-optional.md \ + netrc.md \ + next.md \ + no-alpn.md \ + no-buffer.md \ + no-clobber.md \ + no-keepalive.md \ + no-npn.md \ + no-progress-meter.md \ + no-sessionid.md \ + noproxy.md \ + ntlm-wb.md \ + ntlm.md \ + oauth2-bearer.md \ + output-dir.md \ + output.md \ + parallel-immediate.md \ + parallel-max.md \ + parallel.md \ + pass.md \ + path-as-is.md \ + pinnedpubkey.md \ + post301.md \ + post302.md \ + post303.md \ + preproxy.md \ + progress-bar.md \ + proto-default.md \ + proto-redir.md \ + proto.md \ + proxy-anyauth.md \ + proxy-basic.md \ + proxy-ca-native.md \ + proxy-cacert.md \ + proxy-capath.md \ + proxy-cert-type.md \ + proxy-cert.md \ + proxy-ciphers.md \ + proxy-crlfile.md \ + proxy-digest.md \ + proxy-header.md \ + proxy-http2.md \ + proxy-insecure.md \ + proxy-key-type.md \ + proxy-key.md \ + proxy-negotiate.md \ + proxy-ntlm.md \ + proxy-pass.md \ + proxy-pinnedpubkey.md \ + proxy-service-name.md \ + proxy-ssl-allow-beast.md \ + proxy-ssl-auto-client-cert.md \ + proxy-tls13-ciphers.md \ + proxy-tlsauthtype.md \ + proxy-tlspassword.md \ + proxy-tlsuser.md \ + proxy-tlsv1.md \ + proxy-user.md \ + proxy.md \ + proxy1.0.md \ + proxytunnel.md \ + pubkey.md \ + quote.md \ + random-file.md \ + range.md \ + rate.md \ + raw.md \ + referer.md \ + remote-header-name.md \ + remote-name-all.md \ + remote-name.md \ + remote-time.md \ + remove-on-error.md \ + request-target.md \ + request.md \ + resolve.md \ + retry-all-errors.md \ + retry-connrefused.md \ + retry-delay.md \ + retry-max-time.md \ + retry.md \ + sasl-authzid.md \ + sasl-ir.md \ + service-name.md \ + show-error.md \ + show-headers.md \ + silent.md \ + sigalgs.md \ + skip-existing.md \ + socks4.md \ + socks4a.md \ + socks5-basic.md \ + socks5-gssapi-nec.md \ + socks5-gssapi-service.md \ + socks5-gssapi.md \ + socks5-hostname.md \ + socks5.md \ + speed-limit.md \ + speed-time.md \ + ssl-allow-beast.md \ + ssl-auto-client-cert.md \ + ssl-no-revoke.md \ + ssl-reqd.md \ + ssl-revoke-best-effort.md \ + ssl-sessions.md \ + ssl.md \ + sslv2.md \ + sslv3.md \ + stderr.md \ + styled-output.md \ + suppress-connect-headers.md \ + tcp-fastopen.md \ + tcp-nodelay.md \ + telnet-option.md \ + tftp-blksize.md \ + tftp-no-options.md \ + time-cond.md \ + tls-earlydata.md \ + tls-max.md \ + tls13-ciphers.md \ + tlsauthtype.md \ + tlspassword.md \ + tlsuser.md \ + tlsv1.0.md \ + tlsv1.1.md \ + tlsv1.2.md \ + tlsv1.3.md \ + tlsv1.md \ + tr-encoding.md \ + trace-ascii.md \ + trace-config.md \ + trace-ids.md \ + trace-time.md \ + trace.md \ + unix-socket.md \ + upload-file.md \ + upload-flags.md \ + url.md \ + url-query.md \ + use-ascii.md \ + user-agent.md \ + user.md \ + variable.md \ + verbose.md \ + version.md \ + vlan-priority.md \ + write-out.md \ + xattr.md diff --git a/curl/docs/cmdline-opts/_AUTHORS.md b/curl/docs/cmdline-opts/_AUTHORS.md new file mode 100644 index 000000000..0c9bfb953 --- /dev/null +++ b/curl/docs/cmdline-opts/_AUTHORS.md @@ -0,0 +1,5 @@ + + +# AUTHORS +Daniel Stenberg is the main author, but the whole list of contributors is +found in the separate THANKS file. diff --git a/curl/docs/cmdline-opts/_BUGS.md b/curl/docs/cmdline-opts/_BUGS.md new file mode 100644 index 000000000..45630d435 --- /dev/null +++ b/curl/docs/cmdline-opts/_BUGS.md @@ -0,0 +1,5 @@ + + +# BUGS +If you experience any problems with curl, submit an issue in the project's bug +tracker on GitHub: https://github.com/curl/curl/issues diff --git a/curl/docs/cmdline-opts/_DESCRIPTION.md b/curl/docs/cmdline-opts/_DESCRIPTION.md new file mode 100644 index 000000000..3e06c1b38 --- /dev/null +++ b/curl/docs/cmdline-opts/_DESCRIPTION.md @@ -0,0 +1,11 @@ + + +# DESCRIPTION + +**curl** is a 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, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, +SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. + +curl is powered by libcurl for all transfer-related features. See +*libcurl(3)* for details. diff --git a/curl/docs/cmdline-opts/_ENVIRONMENT.md b/curl/docs/cmdline-opts/_ENVIRONMENT.md new file mode 100644 index 000000000..a37e074d0 --- /dev/null +++ b/curl/docs/cmdline-opts/_ENVIRONMENT.md @@ -0,0 +1,114 @@ + + +# ENVIRONMENT +The environment variables can be specified in lower case or upper case. The +lower case version has precedence. `http_proxy` is an exception as it is only +available in lower case. + +Using an environment variable to set the proxy has the same effect as using +the --proxy option. + +## `http_proxy` [protocol://][:port] +Sets the proxy server to use for HTTP. + +## `HTTPS_PROXY` [protocol://][:port] +Sets the proxy server to use for HTTPS. + +## `[url-protocol]_PROXY` [protocol://][:port] +Sets the proxy server to use for [url-protocol], where the protocol is a +protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, +SMTP, LDAP, etc. + +## `ALL_PROXY` [protocol://][:port] +Sets the proxy server to use if no protocol-specific proxy is set. + +## `NO_PROXY` +list of hostnames that should not go through any proxy. If set to an asterisk +'*' only, it matches all hosts. Each name in this list is matched as either a +domain name which contains the hostname, or the hostname itself. + +This environment variable disables use of the proxy even when specified with +the --proxy option. That is + + NO_PROXY=direct.example.com curl -x http://proxy.example.com + http://direct.example.com + +accesses the target URL directly, and + + NO_PROXY=direct.example.com curl -x http://proxy.example.com + http://somewhere.example.com + +accesses the target URL through the proxy. + +The list of hostnames can also include numerical IP addresses, and IPv6 +versions should then be given without enclosing brackets. + +IP addresses can be specified using CIDR notation: an appended slash and +number specifies the number of "network bits" out of the address to use in the +comparison (added in 7.86.0). For example "192.168.0.0/16" would match all +addresses starting with "192.168". + +## `APPDATA` +On Windows, this variable is used when trying to find the home directory. If +the primary home variables are all unset. + +## `COLUMNS` +If set, the specified number of characters is used as the terminal width when +the alternative progress-bar is shown. If not set, curl tries to figure it out +using other ways. + +## `CURL_CA_BUNDLE` +If set, it is used as the --cacert value. This environment variable is ignored +if Schannel is used as the TLS backend. + +## `CURL_HOME` +If set, is the first variable curl checks when trying to find its home +directory. If not set, it continues to check *XDG_CONFIG_HOME* + +## `CURL_SSL_BACKEND` +If curl was built with support for "MultiSSL", meaning that it has built-in +support for more than one TLS backend, this environment variable can be set to +the case insensitive name of the particular backend to use when curl is +invoked. Setting a name that is not a built-in alternative makes curl stay +with the default. + +SSL backend names (case-insensitive): **gnutls**, **mbedtls**, **openssl**, +**rustls**, **schannel**, **wolfssl** + +## `HOME` +If set, this is used to find the home directory when that is needed. Like when +looking for the default .curlrc. *CURL_HOME* and *XDG_CONFIG_HOME* +have preference. + +## `QLOGDIR` +If curl was built with HTTP/3 support, setting this environment variable to a +local directory makes curl produce **qlogs** in that directory, using file +names named after the destination connection id (in hex). Do note that these +files can become rather large. Works with the ngtcp2 and quiche QUIC backends. + +## `SHELL` +Used on VMS when trying to detect if using a **DCL** or a **Unix** shell. + +## `SSL_CERT_DIR` +If set, it is used as the --capath value. This environment variable is ignored +if Schannel is used as the TLS backend. + +## `SSL_CERT_FILE` +If set, it is used as the --cacert value. This environment variable is ignored +if Schannel is used as the TLS backend. + +## `SSLKEYLOGFILE` +If you set this environment variable to a filename, curl stores TLS secrets +from its connections in that file when invoked to enable you to analyze the +TLS traffic in real time using network analyzing tools such as Wireshark. This +works with the following TLS backends: OpenSSL, LibreSSL (TLS 1.2 max), +BoringSSL, GnuTLS, wolfSSL and Rustls. + +## `USERPROFILE` +On Windows, this variable is used when trying to find the home directory. If +the other, primary, variables are all unset. If set, curl uses the path +**"$USERPROFILE\Application Data"**. + +## `XDG_CONFIG_HOME` +If *CURL_HOME* is not set, this variable is checked when looking for a +default .curlrc file. diff --git a/curl/docs/cmdline-opts/_EXITCODES.md b/curl/docs/cmdline-opts/_EXITCODES.md new file mode 100644 index 000000000..20c9ff1e7 --- /dev/null +++ b/curl/docs/cmdline-opts/_EXITCODES.md @@ -0,0 +1,203 @@ + + +# EXIT CODES +There are a bunch of different error codes and their corresponding error +messages that may appear under error conditions. At the time of this writing, +the exit codes are: +## 0 +Success. The operation completed successfully according to the instructions. +## 1 +Unsupported protocol. This build of curl has no support for this protocol. +## 2 +Failed to initialize. +## 3 +URL malformed. The syntax was not correct. +## 4 +A feature or option that was needed to perform the desired request was not +enabled or was explicitly disabled at build-time. To make curl able to do +this, you probably need another build of libcurl. +## 5 +Could not resolve proxy. The given proxy host could not be resolved. +## 6 +Could not resolve host. The given remote host could not be resolved. +## 7 +Failed to connect to host. +## 8 +Weird server reply. The server sent data curl could not parse. +## 9 +FTP access denied. The server denied login or denied access to the particular +resource or directory you wanted to reach. Most often you tried to change to a +directory that does not exist on the server. +## 10 +FTP accept failed. While waiting for the server to connect back when an active +FTP session is used, an error code was sent over the control connection or +similar. +## 11 +FTP weird PASS reply. curl could not parse the reply sent to the PASS request. +## 12 +During an active FTP session while waiting for the server to connect back to +curl, the timeout expired. +## 13 +FTP weird PASV reply, curl could not parse the reply sent to the PASV request. +## 14 +FTP weird 227 format. curl could not parse the 227-line the server sent. +## 15 +FTP cannot use host. Could not resolve the host IP we got in the 227-line. +## 16 +HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is +somewhat generic and can be one out of several problems, see the error message +for details. +## 17 +FTP could not set binary. Could not change transfer method to binary. +## 18 +Partial file. Only a part of the file was transferred. +## 19 +FTP could not download/access the given file, the RETR (or similar) command +failed. +## 21 +FTP quote error. A quote command returned error from the server. +## 22 +HTTP page not retrieved. The requested URL was not found or returned another +error with the HTTP error code being 400 or above. This return code only +appears if --fail is used. +## 23 +Write error. curl could not write data to a local filesystem or similar. +## 25 +Failed starting the upload. For FTP, the server typically denied the STOR +command. +## 26 +Read error. Various reading problems. +## 27 +Out of memory. A memory allocation request failed. +## 28 +Operation timeout. The specified time-out period was reached according to the +conditions. +## 30 +FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT +command, try doing a transfer using PASV instead. +## 31 +FTP could not use REST. The REST command failed. This command is used for +resumed FTP transfers. +## 33 +HTTP range error. The range "command" did not work. +## 34 +HTTP post error. Internal post-request generation error. +## 35 +SSL connect error. The SSL handshaking failed. +## 36 +Bad download resume. Could not continue an earlier aborted download. +## 37 +FILE could not read file. Failed to open the file. Permissions? +## 38 +LDAP cannot bind. LDAP bind operation failed. +## 39 +LDAP search failed. +## 41 +Function not found. A required LDAP function was not found. +## 42 +Aborted by callback. An application told curl to abort the operation. +## 43 +Internal error. A function was called with a bad parameter. +## 45 +Interface error. A specified outgoing interface could not be used. +## 47 +Too many redirects. When following redirects, curl hit the maximum amount. +## 48 +Unknown option specified to libcurl. This indicates that you passed a weird +option to curl that was passed on to libcurl and rejected. Read up in the +manual. +## 49 +Malformed telnet option. +## 52 +The server did not reply anything, which here is considered an error. +## 53 +SSL crypto engine not found. +## 54 +Cannot set SSL crypto engine as default. +## 55 +Failed sending network data. +## 56 +Failure in receiving network data. +## 58 +Problem with the local certificate. +## 59 +Could not use specified SSL cipher. +## 60 +Peer certificate cannot be authenticated with known CA certificates. +## 61 +Unrecognized transfer encoding. +## 63 +Maximum file size exceeded. +## 64 +Requested FTP SSL level failed. +## 65 +Sending the data requires a rewind that failed. +## 66 +Failed to initialize SSL Engine. +## 67 +The username, password, or similar was not accepted and curl failed to log in. +## 68 +File not found on TFTP server. +## 69 +Permission problem on TFTP server. +## 70 +Out of disk space on TFTP server. +## 71 +Illegal TFTP operation. +## 72 +Unknown TFTP transfer ID. +## 73 +File already exists (TFTP). +## 74 +No such user (TFTP). +## 77 +Problem reading the SSL CA cert (path? access rights?). +## 78 +The resource referenced in the URL does not exist. +## 79 +An unspecified error occurred during the SSH session. +## 80 +Failed to shut down the SSL connection. +## 82 +Could not load CRL file, missing or wrong format (added in 7.19.0). +## 83 +Issuer check failed (added in 7.19.0). +## 84 +The FTP PRET command failed. +## 85 +Mismatch of RTSP CSeq numbers. +## 86 +Mismatch of RTSP Session Identifiers. +## 87 +Unable to parse FTP file list. +## 88 +FTP chunk callback reported error. +## 89 +No connection available, the session is queued. +## 90 +SSL public key does not match pinned public key. +## 91 +Invalid SSL certificate status. +## 92 +Stream error in HTTP/2 framing layer. +## 93 +An API function was called from inside a callback. +## 94 +An authentication function returned an error. +## 95 +A problem was detected in the HTTP/3 layer. This is somewhat generic and can +be one out of several problems, see the error message for details. +## 96 +QUIC connection error. This error may be caused by an SSL library error. QUIC +is the protocol used for HTTP/3 transfers. +## 97 +Proxy handshake error. +## 98 +A client-side certificate is required to complete the TLS handshake. +## 99 +Poll or select returned fatal error. +## 100 +A value or data field grew larger than allowed. +## XX +More error codes might appear here in future releases. The existing ones are +meant to never change. diff --git a/curl/docs/cmdline-opts/_FILES.md b/curl/docs/cmdline-opts/_FILES.md new file mode 100644 index 000000000..8c5d3faa7 --- /dev/null +++ b/curl/docs/cmdline-opts/_FILES.md @@ -0,0 +1,6 @@ + + +# FILES +*~/.curlrc* + +Default config file, see --config for details. diff --git a/curl/docs/cmdline-opts/_GLOBBING.md b/curl/docs/cmdline-opts/_GLOBBING.md new file mode 100644 index 000000000..282356c3e --- /dev/null +++ b/curl/docs/cmdline-opts/_GLOBBING.md @@ -0,0 +1,40 @@ + + +# GLOBBING +You can specify multiple URLs or parts of URLs by writing lists within braces +or ranges within brackets. We call this "globbing". + +Provide a list with three different names like this: + + "http://site.{one,two,three}.com" + +Do sequences of alphanumeric series by using [] as in: + + "ftp://ftp.example.com/file[1-100].txt" + +With leading zeroes: + + "ftp://ftp.example.com/file[001-100].txt" + +With letters through the alphabet: + + "ftp://ftp.example.com/file[a-z].txt" + +Nested sequences are not supported, but you can use several ones next to each +other: + + "http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html" + +You can specify a step counter for the ranges to get every Nth number or +letter: + + "http://example.com/file[1-100:10].txt" + + "http://example.com/file[a-z:2].txt" + +When using [] or {} sequences when invoked from a command line prompt, you +probably have to put the full URL within double quotes to avoid the shell from +interfering with it. This also goes for other characters treated special, like +for example '&', '?' and '*'. + +Switch off globbing with --globoff. diff --git a/curl/docs/cmdline-opts/_NAME.md b/curl/docs/cmdline-opts/_NAME.md new file mode 100644 index 000000000..b0d891614 --- /dev/null +++ b/curl/docs/cmdline-opts/_NAME.md @@ -0,0 +1,4 @@ + + +# NAME +curl - transfer a URL diff --git a/curl/docs/cmdline-opts/_OPTIONS.md b/curl/docs/cmdline-opts/_OPTIONS.md new file mode 100644 index 000000000..f1067377c --- /dev/null +++ b/curl/docs/cmdline-opts/_OPTIONS.md @@ -0,0 +1,36 @@ + + +# OPTIONS + +Options start with one or two dashes. Many of the options require an +additional value next to them. If provided text does not start with a dash, it +is presumed to be and treated as a URL. + +The short "single-dash" form of the options, -d for example, may be used with +or without a space between it and its value, although a space is a recommended +separator. The long double-dash form, --data for example, requires a space +between it and its value. + +Short version options that do not need any additional values can be used +immediately next to each other, like for example you can specify all the +options *-O*, *-L* and *-v* at once as *-OLv*. + +In general, all boolean options are enabled with --**option** and yet again +disabled with --**no-**option. That is, you use the same option name but +prefix it with `no-`. However, in this list we mostly only list and show the +--**option** version of them. + +When --next is used, it resets the parser state and you start again with a +clean option state, except for the options that are global. Global options +retain their values and meaning even after --next. + +The first argument that is exactly two dashes (`--`), marks the end of +options; any argument after the end of options is interpreted as a URL +argument even if it starts with a dash. + +curl does little to no verification of the contents of command line arguments. +Passing in "creative octets" like newlines might trigger unexpected results. + +The following options are global: `%GLOBALS`. + +# ALL OPTIONS diff --git a/curl/docs/cmdline-opts/_OUTPUT.md b/curl/docs/cmdline-opts/_OUTPUT.md new file mode 100644 index 000000000..32a5457af --- /dev/null +++ b/curl/docs/cmdline-opts/_OUTPUT.md @@ -0,0 +1,11 @@ + + +# OUTPUT +If not told otherwise, curl writes the received data to stdout. It can be +instructed to instead save that data into a local file, using the --output or +--remote-name options. If curl is given multiple URLs to transfer on the +command line, it similarly needs multiple options for where to save them. + +curl does not parse or otherwise "understand" the content it gets or writes as +output. It does no encoding or decoding, unless explicitly asked to with +dedicated command line options. diff --git a/curl/docs/cmdline-opts/_PROGRESS.md b/curl/docs/cmdline-opts/_PROGRESS.md new file mode 100644 index 000000000..4cbbd8eb7 --- /dev/null +++ b/curl/docs/cmdline-opts/_PROGRESS.md @@ -0,0 +1,25 @@ + + +# PROGRESS METER + +curl normally displays a progress meter during operations, indicating the +amount of transferred data, transfer speeds and estimated time left, etc. The +progress meter displays the transfer rate in bytes per second. The suffixes +(k, M, G, T, P) are 1024 based. For example 1k is 1024 bytes. 1M is 1048576 +bytes. + +curl displays this data to the terminal by default, so if you invoke curl to +do an operation and it is about to write data to the terminal, it *disables* +the progress meter as otherwise it would mess up the output mixing progress +meter and response data. + +If you want a progress meter for HTTP POST or PUT requests, you need to +redirect the response output to a file, using shell redirect (\>), --output +or similar. + +This does not apply to FTP upload as that operation does not spit out any +response data to the terminal. + +If you prefer a progress bar instead of the regular meter, --progress-bar is +your friend. You can also disable the progress meter completely with the +--silent option. diff --git a/curl/docs/cmdline-opts/_PROTOCOLS.md b/curl/docs/cmdline-opts/_PROTOCOLS.md new file mode 100644 index 000000000..ffde15b42 --- /dev/null +++ b/curl/docs/cmdline-opts/_PROTOCOLS.md @@ -0,0 +1,53 @@ + + +# PROTOCOLS +curl supports numerous protocols, or put in URL terms: schemes. Your +particular build may not support them all. +## DICT +Lets you lookup words using online dictionaries. +## FILE +Read or write local files. curl does not support accessing file:// URL +remotely, but when running on Microsoft Windows using the native UNC approach +works. +## FTP(S) +curl supports the File Transfer Protocol with a lot of tweaks and levers. With +or without using TLS. +## GOPHER(S) +Retrieve files. +## HTTP(S) +curl supports HTTP with numerous options and variations. It can speak HTTP +version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct +command line options. +## IMAP(S) +Using the mail reading protocol, curl can download emails for you. With or +without using TLS. +## LDAP(S) +curl can do directory lookups for you, with or without TLS. +## MQTT +curl supports MQTT version 3. Downloading over MQTT equals subscribing to a +topic while uploading/posting equals publishing on a topic. MQTT over TLS is not +supported (yet). +## POP3(S) +Downloading from a pop3 server means getting an email. With or without using +TLS. +## RTMP(S) +The **Realtime Messaging Protocol** is primarily used to serve streaming media +and curl can download it. +## RTSP +curl supports RTSP 1.0 downloads. +## SCP +curl supports SSH version 2 scp transfers. +## SFTP +curl supports SFTP (draft 5) done over SSH version 2. +## SMB(S) +curl supports SMB version 1 for upload and download. +## SMTP(S) +Uploading contents to an SMTP server means sending an email. With or without +TLS. +## TELNET +Fetching a telnet URL starts an interactive session where it sends what it +reads on stdin and outputs what the server sends it. +## TFTP +curl can do TFTP downloads and uploads. +## WS(S) +WebSocket done over HTTP/1. WSS implies that it works over HTTPS. diff --git a/curl/docs/cmdline-opts/_PROXYPREFIX.md b/curl/docs/cmdline-opts/_PROXYPREFIX.md new file mode 100644 index 000000000..297b56c4b --- /dev/null +++ b/curl/docs/cmdline-opts/_PROXYPREFIX.md @@ -0,0 +1,22 @@ + + +# PROXY PROTOCOL PREFIXES +The proxy string may be specified with a protocol:// prefix to specify +alternative proxy protocols. (Added in 7.21.7) + +If no protocol is specified in the proxy string or if the string does not +match a supported one, the proxy is treated as an HTTP proxy. + +The supported proxy protocol prefixes are as follows: +## http:// +Makes it use it as an HTTP proxy. The default if no scheme prefix is used. +## https:// +Makes it treated as an **HTTPS** proxy. +## socks4:// +Makes it the equivalent of --socks4 +## socks4a:// +Makes it the equivalent of --socks4a +## socks5:// +Makes it the equivalent of --socks5 +## socks5h:// +Makes it the equivalent of --socks5-hostname diff --git a/curl/docs/cmdline-opts/_SEEALSO.md b/curl/docs/cmdline-opts/_SEEALSO.md new file mode 100644 index 000000000..aa1b25984 --- /dev/null +++ b/curl/docs/cmdline-opts/_SEEALSO.md @@ -0,0 +1,5 @@ + + +# SEE ALSO + +**ftp(1)**, **wget(1)** diff --git a/curl/docs/cmdline-opts/_SYNOPSIS.md b/curl/docs/cmdline-opts/_SYNOPSIS.md new file mode 100644 index 000000000..381587744 --- /dev/null +++ b/curl/docs/cmdline-opts/_SYNOPSIS.md @@ -0,0 +1,5 @@ + + +# SYNOPSIS + +**curl [options / URLs]** diff --git a/curl/docs/cmdline-opts/_URL.md b/curl/docs/cmdline-opts/_URL.md new file mode 100644 index 000000000..48ae02a55 --- /dev/null +++ b/curl/docs/cmdline-opts/_URL.md @@ -0,0 +1,28 @@ + + +# URL +The URL syntax is protocol-dependent. You find a detailed description in +RFC 3986. + +If you provide a URL without a leading **protocol://** scheme, curl guesses +what protocol you want. It then defaults to HTTP but assumes others based on +often-used hostname prefixes. For example, for hostnames starting with `ftp.` +curl assumes you want FTP. + +You can specify any amount of URLs on the command line. They are fetched in a +sequential manner in the specified order unless you use --parallel. You can +specify command line options and URLs mixed and in any order on the command +line. + +curl attempts to reuse connections when doing multiple transfers, so that +getting many files from the same server do not use multiple connects and setup +handshakes. This improves speed. Connection reuse can only be done for URLs +specified for a single command line invocation and cannot be performed between +separate curl runs. + +Provide an IPv6 zone id in the URL with an escaped percentage sign. Like in + + "http://[fe80::3%25eth0]/" + +Everything provided on the command line that is not a command line option or +its argument, curl assumes is a URL and treats it as such. diff --git a/curl/docs/cmdline-opts/_VARIABLES.md b/curl/docs/cmdline-opts/_VARIABLES.md new file mode 100644 index 000000000..3bc86b936 --- /dev/null +++ b/curl/docs/cmdline-opts/_VARIABLES.md @@ -0,0 +1,44 @@ + + +# VARIABLES +curl supports command line variables (added in 8.3.0). Set variables with +--variable name=content or --variable name@file (where `file` can be stdin if +set to a single dash (-)). + +Variable contents can be expanded in option parameters using `{{name}}` if the +option name is prefixed with `--expand-`. This gets the contents of the +variable `name` inserted, or a blank if the name does not exist as a +variable. Insert `{{` verbatim in the string by prefixing it with a backslash, +like `\{{`. + +You access and expand environment variables by first importing them. You +select to either require the environment variable to be set or you can provide +a default value in case it is not already set. Plain `--variable %name` +imports the variable called `name` but exits with an error if that environment +variable is not already set. To provide a default value if it is not set, use +`--variable %name=content` or `--variable %name@content`. + +Example. Get the USER environment variable into the URL, fail if USER is not +set: + + --variable '%USER' + --expand-url = "https://example.com/api/{{USER}}/method" + +When expanding variables, curl supports a set of functions that can make the +variable contents more convenient to use. It can trim leading and trailing +white space with `trim`, it can output the contents as a JSON quoted string +with `json`, URL encode the string with `url`, base64 encode it with `b64` and +base64 decode it with `64dec`. To apply functions to a variable expansion, add +them colon separated to the right side of the variable. Variable content +holding null bytes that are not encoded when expanded causes an error. + +Example: get the contents of a file called $HOME/.secret into a variable +called "fix". Make sure that the content is trimmed and percent-encoded when +sent as POST data: + + --variable %HOME + --expand-variable fix@{{HOME}}/.secret + --expand-data "{{fix:trim:url}}" + https://example.com/ + +Command line variables and expansions were added in 8.3.0. diff --git a/curl/docs/cmdline-opts/_VERSION.md b/curl/docs/cmdline-opts/_VERSION.md new file mode 100644 index 000000000..e0228fe9c --- /dev/null +++ b/curl/docs/cmdline-opts/_VERSION.md @@ -0,0 +1,15 @@ + + +# VERSION + +This man page describes curl `%VERSION`. If you use a later version, chances +are this man page does not fully document it. If you use an earlier version, +this document tries to include version information about which specific +version that introduced changes. + +You can always learn which the latest curl version is by running + + curl https://curl.se/info + +The online version of this man page is always showing the latest incarnation: +https://curl.se/docs/manpage.html diff --git a/curl/docs/cmdline-opts/_WWW.md b/curl/docs/cmdline-opts/_WWW.md new file mode 100644 index 000000000..35d946697 --- /dev/null +++ b/curl/docs/cmdline-opts/_WWW.md @@ -0,0 +1,4 @@ + + +# WWW +https://curl.se diff --git a/curl/docs/cmdline-opts/abstract-unix-socket.md b/curl/docs/cmdline-opts/abstract-unix-socket.md new file mode 100644 index 000000000..7078e642f --- /dev/null +++ b/curl/docs/cmdline-opts/abstract-unix-socket.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: abstract-unix-socket +Arg: +Help: Connect via abstract Unix domain socket +Added: 7.53.0 +Protocols: HTTP +Category: connection +Multi: single +See-also: + - unix-socket +Example: + - --abstract-unix-socket socketpath $URL +--- + +# `--abstract-unix-socket` + +Connect through an abstract Unix domain socket, instead of using the network. +Note: netstat shows the path of an abstract socket prefixed with `@`, however +the \ argument should not have this leading character. diff --git a/curl/docs/cmdline-opts/alt-svc.md b/curl/docs/cmdline-opts/alt-svc.md new file mode 100644 index 000000000..257f4d5b9 --- /dev/null +++ b/curl/docs/cmdline-opts/alt-svc.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: alt-svc +Arg: +Protocols: HTTPS +Help: Enable alt-svc with this cache file +Added: 7.64.1 +Category: http +Multi: append +See-also: + - resolve + - connect-to +Example: + - --alt-svc svc.txt $URL +--- + +# `--alt-svc` + +Enable the alt-svc parser. If the filename points to an existing alt-svc cache +file, that gets used. After a completed transfer, the cache is saved to the +filename again if it has been modified. + +Specify a "" filename (zero length) to avoid loading/saving and make curl just +handle the cache in memory. + +If this option is used several times, curl loads contents from all the +files but the last one is used for saving. diff --git a/curl/docs/cmdline-opts/anyauth.md b/curl/docs/cmdline-opts/anyauth.md new file mode 100644 index 000000000..31b27c4ad --- /dev/null +++ b/curl/docs/cmdline-opts/anyauth.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: anyauth +Help: Pick any authentication method +Protocols: HTTP +Category: http proxy auth +Added: 7.10.6 +Multi: mutex +See-also: + - proxy-anyauth + - basic + - digest +Example: + - --anyauth --user me:pwd $URL +--- + +# `--anyauth` + +Figure out authentication method automatically, and use the most secure one +the remote site claims to support. This is done by first doing a request and +checking the response-headers, thus possibly inducing an extra network +round-trip. This option is used instead of setting a specific authentication +method, which you can do with --basic, --digest, --ntlm, and --negotiate. + +Using --anyauth is not recommended if you do uploads from stdin, since it may +require data to be sent twice and then the client must be able to rewind. If +the need should arise when uploading from stdin, the upload operation fails. + +Used together with --user. diff --git a/curl/docs/cmdline-opts/append.md b/curl/docs/cmdline-opts/append.md new file mode 100644 index 000000000..3d0030d6a --- /dev/null +++ b/curl/docs/cmdline-opts/append.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: a +Long: append +Help: Append to target file when uploading +Protocols: FTP SFTP +Category: ftp sftp +Added: 4.8 +Multi: boolean +See-also: + - range + - continue-at +Example: + - --upload-file local --append ftp://example.com/ +--- + +# `--append` + +When used in an upload, this option makes curl append to the target file +instead of overwriting it. If the remote file does not exist, it is +created. Note that this flag is ignored by some SFTP servers (including +OpenSSH). diff --git a/curl/docs/cmdline-opts/aws-sigv4.md b/curl/docs/cmdline-opts/aws-sigv4.md new file mode 100644 index 000000000..517cc1c5b --- /dev/null +++ b/curl/docs/cmdline-opts/aws-sigv4.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: aws-sigv4 +Protocols: HTTP +Arg: +Help: AWS V4 signature auth +Category: auth http +Added: 7.75.0 +Multi: single +See-also: + - basic + - user +Example: + - --aws-sigv4 "aws:amz:us-east-2:es" --user "key:secret" $URL +--- + +# `--aws-sigv4` + +Use AWS V4 signature authentication in the transfer. + +The provider argument is a string that is used by the algorithm when creating +outgoing authentication headers. + +The region argument is a string that points to a geographic area of +a resources collection (region-code) when the region name is omitted from +the endpoint. + +The service argument is a string that points to a function provided by a cloud +(service-code) when the service name is omitted from the endpoint. diff --git a/curl/docs/cmdline-opts/basic.md b/curl/docs/cmdline-opts/basic.md new file mode 100644 index 000000000..16acd4cb6 --- /dev/null +++ b/curl/docs/cmdline-opts/basic.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: basic +Help: HTTP Basic Authentication +Protocols: HTTP +Category: auth +Added: 7.10.6 +Multi: mutex +See-also: + - proxy-basic +Example: + - -u name:password --basic $URL +--- + +# `--basic` + +Use HTTP Basic authentication with the remote host. This method is the default +and this option is usually pointless, unless you use it to override a +previously set option that sets a different authentication method (such as +--ntlm, --digest, or --negotiate). + +Used together with --user. diff --git a/curl/docs/cmdline-opts/ca-native.md b/curl/docs/cmdline-opts/ca-native.md new file mode 100644 index 000000000..7e833c9d1 --- /dev/null +++ b/curl/docs/cmdline-opts/ca-native.md @@ -0,0 +1,42 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ca-native +Help: Load CA certs from the OS +Protocols: TLS +Category: tls +Added: 8.2.0 +Multi: boolean +See-also: + - cacert + - capath + - dump-ca-embed + - insecure + - proxy-ca-native +Example: + - --ca-native $URL +--- + +# `--ca-native` + +Use the operating system's native CA store for certificate verification. + +This option is independent of other CA certificate locations set at run time or +build time. Those locations are searched in addition to the native CA store. + +This option works with OpenSSL and its forks (LibreSSL, BoringSSL, etc) on +Windows. (Added in 7.71.0) + +This option works with wolfSSL on Windows, Linux (Debian, Ubuntu, Gentoo, +Fedora, RHEL), macOS, Android and iOS. (Added in 8.3.0) + +This option works with GnuTLS. (Added in 8.5.0) + +This option works with rustls on Windows, macOS, Android and iOS. On Linux it +is equivalent to using the Mozilla CA certificate bundle. When used with rustls +_only_ the native CA store is consulted, not other locations set at run time or +build time. (Added in 8.13.0) + +This option currently has no effect for Schannel. This is the native TLS +library from Microsoft, that by default uses the native CA store for +verification unless overridden by a CA certificate location setting. diff --git a/curl/docs/cmdline-opts/cacert.md b/curl/docs/cmdline-opts/cacert.md new file mode 100644 index 000000000..ae9be3824 --- /dev/null +++ b/curl/docs/cmdline-opts/cacert.md @@ -0,0 +1,40 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: cacert +Arg: +Help: CA certificate to verify peer against +Protocols: TLS +Category: tls +Added: 7.5 +Multi: single +See-also: + - capath + - dump-ca-embed + - insecure +Example: + - --cacert CA-file.txt $URL +--- + +# `--cacert` + +Use the specified certificate file to verify the peer. The file may contain +multiple CA certificates. The certificate(s) must be in PEM format. Normally +curl is built to use a default file for this, so this option is typically used +to alter that default file. + +curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is set +and the TLS backend is not Schannel, and uses the given path as a path to a CA +cert bundle. This option overrides that variable. + +(Windows) curl automatically looks for a CA certs file named +'curl-ca-bundle.crt', either in the same directory as curl.exe, or in the +Current Working Directory, or in any folder along your PATH. + +curl 8.11.0 added a build-time option to disable this search behavior, and +another option to restrict search to the application's directory. + +(Schannel) This option is supported for Schannel in Windows 7 or later (added +in 7.60.0). This option is supported for backward compatibility with other SSL +engines; instead it is recommended to use Windows' store of root certificates +(the default for Schannel). diff --git a/curl/docs/cmdline-opts/capath.md b/curl/docs/cmdline-opts/capath.md new file mode 100644 index 000000000..68bc86fbb --- /dev/null +++ b/curl/docs/cmdline-opts/capath.md @@ -0,0 +1,31 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: capath +Arg: +Help: CA directory to verify peer against +Protocols: TLS +Category: tls +Added: 7.9.8 +Multi: single +See-also: + - cacert + - dump-ca-embed + - insecure +Example: + - --capath /local/directory $URL +--- + +# `--capath` + +Use the specified certificate directory to verify the peer. If curl is built against +OpenSSL, multiple paths can be provided by separating them with the appropriate platform-specific +separator (e.g. `path1:path2:path3` on Unix-style platforms for `path1;path2;path3` on Windows). + +The certificates must be in PEM format, and if curl is built against OpenSSL, the +directory must have been processed using the c_rehash utility supplied with +OpenSSL. Using --capath can allow OpenSSL-powered curl to make SSL-connections +much more efficiently than using --cacert if the --cacert file contains many +CA certificates. + +If this option is set, the default capath value is ignored. diff --git a/curl/docs/cmdline-opts/cert-status.md b/curl/docs/cmdline-opts/cert-status.md new file mode 100644 index 000000000..8b6e57b9e --- /dev/null +++ b/curl/docs/cmdline-opts/cert-status.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: cert-status +Protocols: TLS +Added: 7.41.0 +Help: Verify server cert status OCSP-staple +Category: tls +Multi: boolean +See-also: + - pinnedpubkey +Example: + - --cert-status $URL +--- + +# `--cert-status` + +Verify the status of the server certificate by using the Certificate Status +Request (aka. OCSP stapling) TLS extension. + +If this option is enabled and the server sends an invalid (e.g. expired) +response, if the response suggests that the server certificate has been +revoked, or no response at all is received, the verification fails. + +This support is currently only implemented in the OpenSSL and GnuTLS backends. diff --git a/curl/docs/cmdline-opts/cert-type.md b/curl/docs/cmdline-opts/cert-type.md new file mode 100644 index 000000000..a96587ff6 --- /dev/null +++ b/curl/docs/cmdline-opts/cert-type.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: cert-type +Protocols: TLS +Arg: +Help: Certificate type (DER/PEM/ENG/PROV/P12) +Category: tls +Added: 7.9.3 +Multi: single +See-also: + - cert + - key + - key-type +Example: + - --cert-type PEM --cert file $URL +--- + +# `--cert-type` + +Set type of the provided client certificate. PEM, DER, ENG, PROV and P12 are +recognized types. + +The default type depends on the TLS backend and is usually PEM. For Schannel +it is P12. If --cert is a pkcs11: URI then ENG or PROV is the default type +(depending on OpenSSL version). diff --git a/curl/docs/cmdline-opts/cert.md b/curl/docs/cmdline-opts/cert.md new file mode 100644 index 000000000..2bc3d8fa2 --- /dev/null +++ b/curl/docs/cmdline-opts/cert.md @@ -0,0 +1,53 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: E +Long: cert +Arg: +Help: Client certificate file and password +Protocols: TLS +Category: tls +Added: 5.0 +Multi: single +See-also: + - cert-type + - key + - key-type +Example: + - --cert certfile --key keyfile $URL +--- + +# `--cert` + +Use the specified client certificate file when getting a file with HTTPS, FTPS +or another SSL-based protocol. The certificate must be PEM format. If the +optional password is not specified, it is queried for on the terminal. Note +that this option assumes a certificate file that is the private key and the +client certificate concatenated. See --cert and --key to specify them +independently. + +In the \ portion of the argument, you must escape the character +`:` as `\:` so that it is not recognized as the password delimiter. Similarly, +you must escape the double quote character as \" so that it is not recognized +as an escape character. + +If curl is built against OpenSSL, and the engine pkcs11 or pkcs11 +provider is available, then a PKCS#11 URI (RFC 7512) can be used to specify a +certificate located in a PKCS#11 device. A string beginning with `pkcs11:` is +interpreted as a PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine +option is set as `pkcs11` if none was provided and the --cert-type option is +set as `ENG` or `PROV` if none was provided (depending on OpenSSL version). + +If curl is built against GnuTLS, a PKCS#11 URI can be used to specify +a certificate located in a PKCS#11 device. A string beginning with `pkcs11:` +is interpreted as a PKCS#11 URI. + +(Schannel) Client certificates must be specified by a path expression to a +certificate store. (Loading *PFX* is not supported; you can import it to a +store first). You can use "\\\\\" +to refer to a certificate in the system certificates store, for example, +*"CurrentUser\MY\934a7ac6f8a5d579285a74fa61e19f23ddfe8d7a"*. Thumbprint is +usually a SHA-1 hex string which you can see in certificate details. Following +store locations are supported: *CurrentUser*, *LocalMachine*, +*CurrentService*, *Services*, *CurrentUserGroupPolicy*, +*LocalMachineGroupPolicy* and *LocalMachineEnterprise*. diff --git a/curl/docs/cmdline-opts/ciphers.md b/curl/docs/cmdline-opts/ciphers.md new file mode 100644 index 000000000..14f0425db --- /dev/null +++ b/curl/docs/cmdline-opts/ciphers.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ciphers +Arg: +Help: TLS 1.2 (1.1, 1.0) ciphers to use +Protocols: TLS +Category: tls +Added: 7.9 +Multi: single +See-also: + - tls13-ciphers + - proxy-ciphers + - curves +Example: + - --ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 $URL +--- + +# `--ciphers` + +Specify which cipher suites to use in the connection if it negotiates TLS 1.2 +(1.1, 1.0). The list of ciphers suites must specify valid ciphers. Read up on +cipher suite details on this URL: + +https://curl.se/docs/ssl-ciphers.html diff --git a/curl/docs/cmdline-opts/compressed-ssh.md b/curl/docs/cmdline-opts/compressed-ssh.md new file mode 100644 index 000000000..955c59c2b --- /dev/null +++ b/curl/docs/cmdline-opts/compressed-ssh.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: compressed-ssh +Help: Enable SSH compression +Protocols: SCP SFTP +Added: 7.56.0 +Category: scp ssh +Multi: boolean +See-also: + - compressed +Example: + - --compressed-ssh sftp://example.com/ +--- + +# `--compressed-ssh` + +Enable SSH compression. This is a request, not an order; the server may or may +not do it. diff --git a/curl/docs/cmdline-opts/compressed.md b/curl/docs/cmdline-opts/compressed.md new file mode 100644 index 000000000..35bbab813 --- /dev/null +++ b/curl/docs/cmdline-opts/compressed.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: compressed +Help: Request compressed response +Protocols: HTTP +Category: http +Added: 7.10 +Multi: boolean +See-also: + - compressed-ssh +Example: + - --compressed $URL +--- + +# `--compressed` + +Request a compressed response using one of the algorithms curl supports, and +automatically decompress the content. + +Response headers are not modified when saved, so if they are "interpreted" +separately again at a later point they might appear to be saying that the +content is (still) compressed; while in fact it has already been decompressed. + +If this option is used and the server sends an unsupported encoding, curl +reports an error. This is a request, not an order; the server may or may not +deliver data compressed. diff --git a/curl/docs/cmdline-opts/config.md b/curl/docs/cmdline-opts/config.md new file mode 100644 index 000000000..1281a3d9c --- /dev/null +++ b/curl/docs/cmdline-opts/config.md @@ -0,0 +1,84 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: config +Arg: +Help: Read config from a file +Short: K +Category: curl +Added: 4.10 +Multi: append +See-also: + - disable +Example: + - --config file.txt $URL +--- + +# `--config` + +Specify a text file to read curl arguments from. The command line arguments +found in the text file are used as if they were provided on the command +line. + +Options and their parameters must be specified on the same line in the file, +separated by whitespace, colon, or the equals sign. Long option names can +optionally be given in the config file without the initial double dashes and +if so, the colon or equals characters can be used as separators. If the option +is specified with one or two dashes, there can be no colon or equals character +between the option and its parameter. + +If the parameter contains whitespace or starts with a colon (:) or equals sign +(=), it must be specified enclosed within double quotes ("like this"). Within +double quotes the following escape sequences are available: \\, \", \t, \n, \r +and \v. A backslash preceding any other letter is ignored. + +If the first non-blank column of a config line is a '#' character, that line +is treated as a comment. + +Only write one option per physical line in the config file. A single line is +required to be no more than 10 megabytes (since 8.2.0). + +Specify the filename to --config as minus "-" to make curl read the file from +stdin. + +Note that to be able to specify a URL in the config file, you need to specify +it using the --url option, and not by simply writing the URL on its own +line. So, it could look similar to this: + + url = "https://curl.se/docs/" + + # --- Example file --- + # this is a comment + url = "example.com" + output = "curlhere.html" + user-agent = "superagent/1.0" + + # and fetch another URL too + url = "example.com/docs/manpage.html" + -O + referer = "http://nowhereatall.example.com/" + # --- End of example file --- + +When curl is invoked, it (unless --disable is used) checks for a default +config file and uses it if found, even when --config is used. The default +config file is checked for in the following places in this order: + +1) **"$CURL_HOME/.curlrc"** + +2) **"$XDG_CONFIG_HOME/curlrc"** (Added in 7.73.0) + +3) **"$HOME/.curlrc"** + +4) Windows: **"%USERPROFILE%\.curlrc"** + +5) Windows: **"%APPDATA%\.curlrc"** + +6) Windows: **"%USERPROFILE%\Application Data\.curlrc"** + +7) Non-Windows: use getpwuid to find the home directory + +8) On Windows, if it finds no *.curlrc* file in the sequence described above, it +checks for one in the same directory the curl executable is placed. + +On Windows two filenames are checked per location: *.curlrc* and *_curlrc*, +preferring the former. Older versions on Windows checked for *_curlrc* only. diff --git a/curl/docs/cmdline-opts/connect-timeout.md b/curl/docs/cmdline-opts/connect-timeout.md new file mode 100644 index 000000000..dc5f92704 --- /dev/null +++ b/curl/docs/cmdline-opts/connect-timeout.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: connect-timeout +Arg: +Help: Maximum time allowed to connect +Category: connection timeout +Added: 7.7 +Multi: single +See-also: + - max-time +Example: + - --connect-timeout 20 $URL + - --connect-timeout 3.14 $URL +--- + +# `--connect-timeout` + +Maximum time in seconds that you allow curl's connection to take. This only +limits the connection phase, so if curl connects within the given period it +continues - if not it exits. + +This option accepts decimal values (added in 7.32.0). The decimal value needs +to be provided using a dot (.) as decimal separator - not the local version +even if it might be using another separator. + +The connection phase is considered complete when the DNS lookup and requested +TCP, TLS or QUIC handshakes are done. diff --git a/curl/docs/cmdline-opts/connect-to.md b/curl/docs/cmdline-opts/connect-to.md new file mode 100644 index 000000000..79873ab09 --- /dev/null +++ b/curl/docs/cmdline-opts/connect-to.md @@ -0,0 +1,40 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: connect-to +Arg: +Help: Connect to host2 instead of host1 +Added: 7.49.0 +Category: connection dns +Multi: append +See-also: + - resolve + - header +Example: + - --connect-to example.com:443:example.net:8443 $URL +--- + +# `--connect-to` + +For a request intended for the `HOST1:PORT1` pair, connect to `HOST2:PORT2` +instead. This option is only used to establish the network connection. It does +NOT affect the hostname/port number that is used for TLS/SSL (e.g. SNI, +certificate verification) or for the application protocols. + +`HOST1` and `PORT1` may be empty strings, meaning any host or any port number. +`HOST2` and `PORT2` may also be empty strings, meaning use the request's +original hostname and port number. + +A hostname specified to this option is compared as a string, so it needs to +match the name used in the request URL. It can be either numerical such as +`127.0.0.1` or the full host name such as `example.org`. + +Example: redirect connects from the example.com hostname to 127.0.0.1 +independently of port number: + + curl --connect-to example.com::127.0.0.1: https://example.com/ + +Example: redirect connects from all hostnames to 127.0.0.1 independently of +port number: + + curl --connect-to ::127.0.0.1: http://example.com/ diff --git a/curl/docs/cmdline-opts/continue-at.md b/curl/docs/cmdline-opts/continue-at.md new file mode 100644 index 000000000..67a137609 --- /dev/null +++ b/curl/docs/cmdline-opts/continue-at.md @@ -0,0 +1,37 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: C +Long: continue-at +Arg: +Help: Resumed transfer offset +Category: connection +Added: 4.8 +Multi: single +See-also: + - range +Example: + - -C - $URL + - -C 400 $URL +--- + +# `--continue-at` + +Resume a previous transfer from the given byte offset. The given offset is the +exact number of bytes that are skipped, counting from the beginning of the +source file before it is transferred to the destination. If used with uploads, +the FTP server command SIZE is not used by curl. + +Use "-C -" to instruct curl to automatically find out where/how to resume the +transfer. It then uses the given output/input files to figure that out. + +When using this option for HTTP uploads using POST or PUT, functionality is +not guaranteed. The HTTP protocol has no standard interoperable resume upload +and curl uses a set of headers for this purpose that once proved working for +some servers and have been left for those who find that useful. + +This command line option is mutually exclusive with --range: you can only use +one of them for a single transfer. + +The --no-clobber and --remove-on-error options cannot be used together with +--continue-at. diff --git a/curl/docs/cmdline-opts/cookie-jar.md b/curl/docs/cmdline-opts/cookie-jar.md new file mode 100644 index 000000000..103144acc --- /dev/null +++ b/curl/docs/cmdline-opts/cookie-jar.md @@ -0,0 +1,39 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: c +Long: cookie-jar +Arg: +Protocols: HTTP +Help: Save cookies to after operation +Category: http +Added: 7.9 +Multi: single +See-also: + - cookie + - junk-session-cookies +Example: + - -c store-here.txt $URL + - -c store-here.txt -b read-these $URL +--- + +# `--cookie-jar` + +Specify to which file you want curl to write all cookies after a completed +operation. curl writes all cookies from its in-memory cookie storage to the +given file at the end of operations. Even if no cookies are known, a file is +created so that it removes any formerly existing cookies from the file. The +file uses the Netscape cookie file format. If you set the filename to a single +minus, "-", the cookies are written to stdout. + +The file specified with --cookie-jar is only used for output. No cookies are +read from the file. To read cookies, use the --cookie option. Both options +can specify the same file. + +This command line option activates the cookie engine that makes curl record +and use cookies. The --cookie option also activates it. + +If the cookie jar cannot be created or written to, the whole curl operation +does not fail or even report an error clearly. Using --verbose gets a warning +displayed, but that is the only visible feedback you get about this possibly +lethal situation. diff --git a/curl/docs/cmdline-opts/cookie.md b/curl/docs/cmdline-opts/cookie.md new file mode 100644 index 000000000..50f977e70 --- /dev/null +++ b/curl/docs/cmdline-opts/cookie.md @@ -0,0 +1,62 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: b +Long: cookie +Arg: +Protocols: HTTP +Help: Send cookies from string/load from file +Category: http +Added: 4.9 +Multi: append +See-also: + - cookie-jar + - junk-session-cookies +Example: + - -b "" $URL + - -b cookiefile $URL + - -b cookiefile -c cookiefile $URL + - -b name=Jane $URL +--- + +# `--cookie` + +This option has two slightly separate cookie sending functions. + +Either: pass the exact data to send to the HTTP server in the Cookie header. +It is supposedly data previously received from the server in a `Set-Cookie:` +line. The data should be in the format `NAME1=VALUE1; NAME2=VALUE2`. When +given a set of specific cookies, curl populates its cookie header with this +content explicitly in all outgoing request(s). If multiple requests are done +due to authentication, followed redirects or similar, they all get this cookie +header passed on. + +Or: If no `=` symbol is used in the argument, it is instead treated as a +filename to read previously stored cookie from. This option also activates the +cookie engine which makes curl record incoming cookies, which may be handy if +you are using this in combination with the --location option or do multiple +URL transfers on the same invoke. + +If the filename is a single minus ("-"), curl reads the contents from stdin. +If the filename is an empty string ("") and is the only cookie input, curl +activates the cookie engine without any cookies. + +The file format of the file to read cookies from should be plain HTTP headers +(Set-Cookie style) or the Netscape/Mozilla cookie file format. + +The file specified with --cookie is only used as input. No cookies are written +to that file. To store cookies, use the --cookie-jar option. + +If you use the Set-Cookie file format and do not specify a domain then the +cookie is not sent since the domain never matches. To address this, set a +domain in Set-Cookie line (doing that includes subdomains) or preferably: use +the Netscape format. + +Users often want to both read cookies from a file and write updated cookies +back to a file, so using both --cookie and --cookie-jar in the same command +line is common. + +If curl is built with PSL (**Public Suffix List**) support, it detects and +discards cookies that are specified for such suffix domains that should not be +allowed to have cookies. If curl is *not* built with PSL support, it has no +ability to stop super cookies. diff --git a/curl/docs/cmdline-opts/create-dirs.md b/curl/docs/cmdline-opts/create-dirs.md new file mode 100644 index 000000000..89d24f76b --- /dev/null +++ b/curl/docs/cmdline-opts/create-dirs.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: create-dirs +Help: Create necessary local directory hierarchy +Category: output +Added: 7.10.3 +Multi: boolean +See-also: + - ftp-create-dirs + - output-dir +Example: + - --create-dirs --output local/dir/file $URL +--- + +# `--create-dirs` + +When used in conjunction with the --output option, curl creates the necessary +local directory hierarchy as needed. This option creates the directories +mentioned with the --output option combined with the path possibly set with +--output-dir. If the combined output filename uses no directory, or if the +directories it mentions already exist, no directories are created. + +Created directories are made with mode 0750 on Unix-style file systems. + +To create remote directories when using FTP or SFTP, try --ftp-create-dirs. diff --git a/curl/docs/cmdline-opts/create-file-mode.md b/curl/docs/cmdline-opts/create-file-mode.md new file mode 100644 index 000000000..c6467d15a --- /dev/null +++ b/curl/docs/cmdline-opts/create-file-mode.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: create-file-mode +Arg: +Help: File mode for created files +Protocols: SFTP SCP FILE +Category: sftp scp file upload +Added: 7.75.0 +Multi: single +See-also: + - ftp-create-dirs +Example: + - --create-file-mode 0777 -T localfile sftp://example.com/new +--- + +# `--create-file-mode` + +When curl is used to create files remotely using one of the supported +protocols, this option allows the user to set which 'mode' to set on the file +at creation time, instead of the default 0644. + +This option takes an octal number as argument. diff --git a/curl/docs/cmdline-opts/crlf.md b/curl/docs/cmdline-opts/crlf.md new file mode 100644 index 000000000..c36884113 --- /dev/null +++ b/curl/docs/cmdline-opts/crlf.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: crlf +Help: Convert LF to CRLF in upload +Protocols: FTP SMTP +Category: ftp smtp +Added: 5.7 +Multi: boolean +See-also: + - use-ascii +Example: + - --crlf -T file ftp://example.com/ +--- + +# `--crlf` + +Convert line feeds to carriage return plus line feeds in upload. Useful for +**MVS (OS/390)**. diff --git a/curl/docs/cmdline-opts/crlfile.md b/curl/docs/cmdline-opts/crlfile.md new file mode 100644 index 000000000..a762af09f --- /dev/null +++ b/curl/docs/cmdline-opts/crlfile.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: crlfile +Arg: +Protocols: TLS +Help: Certificate Revocation list +Added: 7.19.7 +Category: tls +Multi: single +See-also: + - cacert + - capath +Example: + - --crlfile rejects.txt $URL +--- + +# `--crlfile` + +Provide a file using PEM format with a Certificate Revocation List that may +specify peer certificates that are to be considered revoked. diff --git a/curl/docs/cmdline-opts/curves.md b/curl/docs/cmdline-opts/curves.md new file mode 100644 index 000000000..9473aeaa7 --- /dev/null +++ b/curl/docs/cmdline-opts/curves.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: curves +Arg: +Help: (EC) TLS key exchange algorithms to request +Protocols: TLS +Added: 7.73.0 +Category: tls +Multi: single +See-also: + - ciphers +Example: + - --curves X25519 $URL +--- + +# `--curves` + +Set specific curves to use during SSL session establishment according to RFC +8422, 5.1. Multiple algorithms can be provided by separating them with `:` +(e.g. `X25519:P-521`). The parameter is available identically in the OpenSSL +`s_client` and `s_server` utilities. + +--curves allows a OpenSSL powered curl to make SSL-connections with exactly +the (EC) curve requested by the client, avoiding nontransparent client/server +negotiations. + +If this option is set, the default curves list built into OpenSSL are ignored. diff --git a/curl/docs/cmdline-opts/data-ascii.md b/curl/docs/cmdline-opts/data-ascii.md new file mode 100644 index 000000000..5763d81f1 --- /dev/null +++ b/curl/docs/cmdline-opts/data-ascii.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: data-ascii +Arg: +Help: HTTP POST ASCII data +Protocols: HTTP +Category: http post upload +Added: 7.2 +Multi: append +See-also: + - data-binary + - data-raw + - data-urlencode +Example: + - --data-ascii @file $URL +--- + +# `--data-ascii` + +This option is just an alias for --data. diff --git a/curl/docs/cmdline-opts/data-binary.md b/curl/docs/cmdline-opts/data-binary.md new file mode 100644 index 000000000..4c5e4da8d --- /dev/null +++ b/curl/docs/cmdline-opts/data-binary.md @@ -0,0 +1,32 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: data-binary +Arg: +Help: HTTP POST binary data +Protocols: HTTP +Category: http post upload +Added: 7.2 +Multi: append +See-also: + - data-ascii +Example: + - --data-binary @filename $URL +--- + +# `--data-binary` + +Post data exactly as specified with no extra processing whatsoever. + +If you start the data with the letter @, the rest should be a filename. +`@-` makes curl read the data from stdin. Data is posted in a similar +manner as --data does, except that newlines and carriage returns are +preserved and conversions are never done. + +Like --data the default content-type sent to the server is +application/x-www-form-urlencoded. If you want the data to be treated as +arbitrary binary data by the server then set the content-type to octet-stream: +-H "Content-Type: application/octet-stream". + +If this option is used several times, the ones following the first append +data as described in --data. diff --git a/curl/docs/cmdline-opts/data-raw.md b/curl/docs/cmdline-opts/data-raw.md new file mode 100644 index 000000000..1033678bd --- /dev/null +++ b/curl/docs/cmdline-opts/data-raw.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: data-raw +Arg: +Protocols: HTTP +Help: HTTP POST data, '@' allowed +Added: 7.43.0 +Category: http post upload +Multi: append +See-also: + - data +Example: + - --data-raw "hello" $URL + - --data-raw "@at@at@" $URL +--- + +# `--data-raw` + +Post data similarly to --data but without the special interpretation of the @ +character. diff --git a/curl/docs/cmdline-opts/data-urlencode.md b/curl/docs/cmdline-opts/data-urlencode.md new file mode 100644 index 000000000..b4680e61a --- /dev/null +++ b/curl/docs/cmdline-opts/data-urlencode.md @@ -0,0 +1,51 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: data-urlencode +Arg: +Help: HTTP POST data URL encoded +Protocols: HTTP +Added: 7.18.0 +Category: http post upload +Multi: append +See-also: + - data + - data-raw +Example: + - --data-urlencode name=val $URL + - --data-urlencode =encodethis $URL + - --data-urlencode name@file $URL + - --data-urlencode @fileonly $URL +--- + +# `--data-urlencode` + +Post data, similar to the other --data options with the exception that this +performs URL-encoding. + +To be CGI-compliant, the \ part should begin with a *name* followed by +a separator and a content specification. The \ part can be passed to +curl using one of the following syntaxes: + +## content +URL-encode the content and pass that on. Just be careful so that the content +does not contain any `=` or `@` symbols, as that makes the syntax match one of +the other cases below. + +## =content +URL-encode the content and pass that on. The preceding `=` symbol is not +included in the data. + +## name=content +URL-encode the content part and pass that on. Note that the name part is +expected to be URL-encoded already. + +## @filename +load data from the given file (including any newlines), URL-encode that data +and pass it on in the POST. Using `@-` makes curl read the data from stdin. + +## name@filename +load data from the given file (including any newlines), URL-encode that data +and pass it on in the POST. The name part gets an equal sign appended, +resulting in *name=urlencoded-file-content*. Note that the name is expected to +be URL-encoded already. diff --git a/curl/docs/cmdline-opts/data.md b/curl/docs/cmdline-opts/data.md new file mode 100644 index 000000000..d95b02395 --- /dev/null +++ b/curl/docs/cmdline-opts/data.md @@ -0,0 +1,49 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: data +Short: d +Arg: +Help: HTTP POST data +Protocols: HTTP MQTT +Mutexed: form head upload-file +Category: important http post upload +Added: 4.0 +Multi: append +See-also: + - data-binary + - data-urlencode + - data-raw +Example: + - -d "name=curl" $URL + - -d "name=curl" -d "tool=cmdline" $URL + - -d @filename $URL +--- + +# `--data` + +Send the specified data in a POST request to the HTTP server, in the same way +that a browser does when a user has filled in an HTML form and presses the +submit button. This option makes curl pass the data to the server using the +content-type application/x-www-form-urlencoded. Compared to --form. + +--data-raw is almost the same but does not have a special interpretation of +the @ character. To post data purely binary, you should instead use the +--data-binary option. To URL-encode the value of a form field you may use +--data-urlencode. + +If any of these options is used more than once on the same command line, the +data pieces specified are merged with a separating &-symbol. Thus, using +'-d name=daniel -d skill=lousy' would generate a post chunk that looks like +'name=daniel&skill=lousy'. + +If you start the data with the letter @, the rest should be a filename to read +the data from, or - if you want curl to read the data from stdin. Posting data +from a file named 'foobar' would thus be done with --data @foobar. When --data +is told to read from a file like that, carriage returns, newlines and null +bytes are stripped out. If you do not want the @ character to have a special +interpretation use --data-raw instead. + +The data for this option is passed on to the server exactly as provided on the +command line. curl does not convert, change or improve it. It is up to the +user to provide the data in the correct form. diff --git a/curl/docs/cmdline-opts/delegation.md b/curl/docs/cmdline-opts/delegation.md new file mode 100644 index 000000000..c874a2b59 --- /dev/null +++ b/curl/docs/cmdline-opts/delegation.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: delegation +Arg: +Help: GSS-API delegation permission +Protocols: GSS/kerberos +Category: auth +Added: 7.22.0 +Multi: single +See-also: + - insecure + - ssl +Example: + - --delegation "none" $URL +--- + +# `--delegation` + +Set LEVEL what curl is allowed to delegate when it comes to user credentials. + +## none +Do not allow any delegation. + +## policy +Delegates if and only if the OK-AS-DELEGATE flag is set in the Kerberos +service ticket, which is a matter of realm policy. + +## always +Unconditionally allow the server to delegate. diff --git a/curl/docs/cmdline-opts/digest.md b/curl/docs/cmdline-opts/digest.md new file mode 100644 index 000000000..7a8b49cdf --- /dev/null +++ b/curl/docs/cmdline-opts/digest.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: digest +Help: HTTP Digest Authentication +Protocols: HTTP +Mutexed: basic ntlm negotiate +Category: proxy auth http +Added: 7.10.6 +Multi: boolean +See-also: + - user + - proxy-digest + - anyauth +Example: + - -u name:password --digest $URL +--- + +# `--digest` + +Enable HTTP Digest authentication. This authentication scheme avoids sending +the password over the wire in clear text. Use this in combination with the +normal --user option to set username and password. diff --git a/curl/docs/cmdline-opts/disable-eprt.md b/curl/docs/cmdline-opts/disable-eprt.md new file mode 100644 index 000000000..768b689c1 --- /dev/null +++ b/curl/docs/cmdline-opts/disable-eprt.md @@ -0,0 +1,32 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: disable-eprt +Help: Inhibit using EPRT or LPRT +Protocols: FTP +Category: ftp +Added: 7.10.5 +Multi: boolean +See-also: + - disable-epsv + - ftp-port +Example: + - --disable-eprt ftp://example.com/ +--- + +# `--disable-eprt` + +Disable the use of the EPRT and LPRT commands when doing active FTP transfers. +curl normally first attempts to use EPRT before using PORT, but with this +option, it uses PORT right away. EPRT is an extension to the original FTP +protocol, and does not work on all servers, but enables more functionality in +a better way than the traditional PORT command. + +--eprt can be used to explicitly enable EPRT again and --no-eprt is an alias +for --disable-eprt. + +If the server is accessed using IPv6, this option has no effect as EPRT is +necessary then. + +Disabling EPRT only changes the active behavior. If you want to switch to +passive mode you need to not use --ftp-port or force it with --ftp-pasv. diff --git a/curl/docs/cmdline-opts/disable-epsv.md b/curl/docs/cmdline-opts/disable-epsv.md new file mode 100644 index 000000000..d13e07690 --- /dev/null +++ b/curl/docs/cmdline-opts/disable-epsv.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: disable-epsv +Help: Inhibit using EPSV +Protocols: FTP +Category: ftp +Added: 7.9.2 +Multi: boolean +See-also: + - disable-eprt + - ftp-port +Example: + - --disable-epsv ftp://example.com/ +--- + +# `--disable-epsv` + +Disable the use of the EPSV command when doing passive FTP transfers. curl +normally first attempts to use EPSV before PASV, but with this option, it does +not try EPSV. + +--epsv can be used to explicitly enable EPSV again and --no-epsv is an alias +for --disable-epsv. + +If the server is an IPv6 host, this option has no effect as EPSV is necessary +then. + +Disabling EPSV only changes the passive behavior. If you want to switch to +active mode you need to use --ftp-port. diff --git a/curl/docs/cmdline-opts/disable.md b/curl/docs/cmdline-opts/disable.md new file mode 100644 index 000000000..1370b91d7 --- /dev/null +++ b/curl/docs/cmdline-opts/disable.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: disable +Short: q +Help: Disable .curlrc +Category: curl +Added: 5.0 +Multi: boolean +See-also: + - config +Example: + - -q $URL +--- + +# `--disable` + +If used as the **first** parameter on the command line, the *curlrc* config +file is not read or used. See the --config for details on the default config +file search path. diff --git a/curl/docs/cmdline-opts/disallow-username-in-url.md b/curl/docs/cmdline-opts/disallow-username-in-url.md new file mode 100644 index 000000000..012f2d0dc --- /dev/null +++ b/curl/docs/cmdline-opts/disallow-username-in-url.md @@ -0,0 +1,18 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: disallow-username-in-url +Help: Disallow username in URL +Added: 7.61.0 +Category: curl +Multi: boolean +See-also: + - proto +Example: + - --disallow-username-in-url $URL +--- + +# `--disallow-username-in-url` + +Exit with error if passed a URL containing a username. Probably most useful +when the URL is being provided at runtime or similar. diff --git a/curl/docs/cmdline-opts/dns-interface.md b/curl/docs/cmdline-opts/dns-interface.md new file mode 100644 index 000000000..aee7400bc --- /dev/null +++ b/curl/docs/cmdline-opts/dns-interface.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: dns-interface +Arg: +Help: Interface to use for DNS requests +Protocols: DNS +Added: 7.33.0 +Requires: c-ares +Category: dns +Multi: single +See-also: + - dns-ipv4-addr + - dns-ipv6-addr +Example: + - --dns-interface eth0 $URL +--- + +# `--dns-interface` + +Send outgoing DNS requests through the given interface. This option is a +counterpart to --interface (which does not affect DNS). The supplied string +must be an interface name (not an address). diff --git a/curl/docs/cmdline-opts/dns-ipv4-addr.md b/curl/docs/cmdline-opts/dns-ipv4-addr.md new file mode 100644 index 000000000..4a43cb1d9 --- /dev/null +++ b/curl/docs/cmdline-opts/dns-ipv4-addr.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: dns-ipv4-addr +Arg:
+Help: IPv4 address to use for DNS requests +Protocols: DNS +Added: 7.33.0 +Requires: c-ares +Category: dns +Multi: single +See-also: + - dns-interface + - dns-ipv6-addr +Example: + - --dns-ipv4-addr 10.1.2.3 $URL +--- + +# `--dns-ipv4-addr` + +Bind to a specific IP address when making IPv4 DNS requests, so that the DNS +requests originate from this address. The argument should be a single IPv4 +address. diff --git a/curl/docs/cmdline-opts/dns-ipv6-addr.md b/curl/docs/cmdline-opts/dns-ipv6-addr.md new file mode 100644 index 000000000..711231176 --- /dev/null +++ b/curl/docs/cmdline-opts/dns-ipv6-addr.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: dns-ipv6-addr +Arg:
+Help: IPv6 address to use for DNS requests +Protocols: DNS +Added: 7.33.0 +Requires: c-ares +Category: dns +Multi: single +See-also: + - dns-interface + - dns-ipv4-addr +Example: + - --dns-ipv6-addr 2a04:4e42::561 $URL +--- + +# `--dns-ipv6-addr` + +Bind to a specific IP address when making IPv6 DNS requests, so that the DNS +requests originate from this address. The argument should be a single IPv6 +address. diff --git a/curl/docs/cmdline-opts/dns-servers.md b/curl/docs/cmdline-opts/dns-servers.md new file mode 100644 index 000000000..bf6ba3fe9 --- /dev/null +++ b/curl/docs/cmdline-opts/dns-servers.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: dns-servers +Arg: +Help: DNS server addrs to use +Protocols: DNS +Requires: c-ares +Added: 7.33.0 +Category: dns +Multi: single +See-also: + - dns-interface + - dns-ipv4-addr +Example: + - --dns-servers 192.168.0.1,192.168.0.2 $URL + - --dns-servers 10.0.0.1:53 $URL +--- + +# `--dns-servers` + +Set the list of DNS servers to be used instead of the system default. The list +of IP addresses should be separated with commas. Port numbers may also +optionally be given, appended to the IP address separated with a colon. diff --git a/curl/docs/cmdline-opts/doh-cert-status.md b/curl/docs/cmdline-opts/doh-cert-status.md new file mode 100644 index 000000000..7c497cf16 --- /dev/null +++ b/curl/docs/cmdline-opts/doh-cert-status.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: doh-cert-status +Help: Verify DoH server cert status OCSP-staple +Added: 7.76.0 +Category: dns tls +Multi: boolean +See-also: + - doh-insecure +Example: + - --doh-cert-status --doh-url https://doh.example $URL +--- + +# `--doh-cert-status` + +Same as --cert-status but used for DoH (DNS-over-HTTPS). + +Verify the status of the DoH servers' certificate by using the Certificate +Status Request (aka. OCSP stapling) TLS extension. + +If this option is enabled and the DoH server sends an invalid (e.g. expired) +response, if the response suggests that the server certificate has been +revoked, or no response at all is received, the verification fails. + +This support is currently only implemented in the OpenSSL and GnuTLS backends. diff --git a/curl/docs/cmdline-opts/doh-insecure.md b/curl/docs/cmdline-opts/doh-insecure.md new file mode 100644 index 000000000..72f3cb772 --- /dev/null +++ b/curl/docs/cmdline-opts/doh-insecure.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: doh-insecure +Help: Allow insecure DoH server connections +Added: 7.76.0 +Category: dns tls +Multi: boolean +See-also: + - doh-url + - insecure + - proxy-insecure +Example: + - --doh-insecure --doh-url https://doh.example $URL +--- + +# `--doh-insecure` + +By default, every connection curl makes to a DoH server is verified to be +secure before the transfer takes place. This option tells curl to skip the +verification step and proceed without checking. + +**WARNING**: using this option makes the DoH transfer and name resolution +insecure. + +This option is equivalent to --insecure and --proxy-insecure but used for DoH +(DNS-over-HTTPS) only. diff --git a/curl/docs/cmdline-opts/doh-url.md b/curl/docs/cmdline-opts/doh-url.md new file mode 100644 index 000000000..dcc6e52f8 --- /dev/null +++ b/curl/docs/cmdline-opts/doh-url.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: doh-url +Arg: +Help: Resolve hostnames over DoH +Added: 7.62.0 +Category: dns +Multi: single +See-also: + - doh-insecure +Example: + - --doh-url https://doh.example $URL + - --doh-url https://doh.example --resolve doh.example:443:192.0.2.1 $URL +--- + +# `--doh-url` + +Specify which DNS-over-HTTPS (DoH) server to use to resolve hostnames, instead +of using the default name resolver mechanism. The URL must be HTTPS. + +Some SSL options that you set for your transfer also apply to DoH since the +name lookups take place over SSL. However, the certificate verification +settings are not inherited but are controlled separately via --doh-insecure +and --doh-cert-status. + +By default, DoH is bypassed when initially looking up DNS records of the DoH server. You can specify the IP address(es) of the DoH server with --resolve to avoid this. + +This option is unset if an empty string "" is used as the URL. +(Added in 7.85.0) diff --git a/curl/docs/cmdline-opts/dump-ca-embed.md b/curl/docs/cmdline-opts/dump-ca-embed.md new file mode 100644 index 000000000..2ad123014 --- /dev/null +++ b/curl/docs/cmdline-opts/dump-ca-embed.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: dump-ca-embed +Help: Write the embedded CA bundle to standard output +Protocols: TLS +Category: http proxy tls +Added: 8.10.0 +Multi: boolean +See-also: + - ca-native + - cacert + - capath + - proxy-ca-native + - proxy-cacert + - proxy-capath +Example: + - --dump-ca-embed +--- + +# `--dump-ca-embed` + +Write the CA bundle embedded in curl to standard output, then quit. + +If curl was not built with a default CA bundle embedded, the output is empty. diff --git a/curl/docs/cmdline-opts/dump-header.md b/curl/docs/cmdline-opts/dump-header.md new file mode 100644 index 000000000..bdb0e874e --- /dev/null +++ b/curl/docs/cmdline-opts/dump-header.md @@ -0,0 +1,35 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: dump-header +Short: D +Arg: +Help: Write the received headers to +Protocols: HTTP FTP +Category: http ftp +Added: 5.7 +Multi: single +See-also: + - output +Example: + - --dump-header store.txt $URL + - --dump-header - $URL -o save +--- + +# `--dump-header` + +Write the received protocol headers to the specified file. If no headers are +received, the use of this option creates an empty file. Specify `-` as +filename (a single minus) to have it written to stdout. + +Starting in curl 8.10.0, specify `%` (a single percent sign) as filename +writes the output to stderr. + +When used in FTP, the FTP server response lines are considered being "headers" +and thus are saved there. + +Starting in curl 8.11.0, using the --create-dirs option can also create +missing directory components for the path provided in --dump-header. + +Having multiple transfers in one set of operations (i.e. the URLs in one +--next clause), appends them to the same file, separated by a blank line. diff --git a/curl/docs/cmdline-opts/ech.md b/curl/docs/cmdline-opts/ech.md new file mode 100644 index 000000000..3d8f3873a --- /dev/null +++ b/curl/docs/cmdline-opts/ech.md @@ -0,0 +1,52 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ech +Arg: +Help: Configure ECH +Added: 8.8.0 +Category: tls +Protocols: HTTPS +Multi: single +See-also: + - doh-url +Example: + - --ech true $URL +--- + +# `--ech` + +Specify how to do ECH (Encrypted Client Hello). + +The values allowed for \ can be: + +## `false` + +Do not attempt ECH. The is the default. + +## `grease` + +Send a GREASE ECH extension + +## `true` + +Attempt ECH if possible, but do not fail if ECH is not attempted. +(The connection fails if ECH is attempted but fails.) + +## `hard` + +Attempt ECH and fail if that is not possible. ECH only works with TLS 1.3 and +also requires using DoH or providing an ECHConfigList on the command line. + +## `ecl:` + +A base64 encoded ECHConfigList that is used for ECH. + +## `pn:` + +A name to use to over-ride the `public_name` field of an ECHConfigList (only +available with OpenSSL TLS support) + +## + +Most ECH related errors cause error *CURLE_ECH_REQUIRED* (101). diff --git a/curl/docs/cmdline-opts/egd-file.md b/curl/docs/cmdline-opts/egd-file.md new file mode 100644 index 000000000..ef16b9964 --- /dev/null +++ b/curl/docs/cmdline-opts/egd-file.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: egd-file +Arg: +Help: EGD socket path for random data +Protocols: TLS +Category: deprecated +Added: 7.7 +Multi: single +See-also: + - random-file +Example: + - --egd-file /random/here $URL +--- + +# `--egd-file` + +Deprecated option (added in 7.84.0). Prior to that it only had an effect on +curl if built to use old versions of OpenSSL. + +Specify the path name to the Entropy Gathering Daemon socket. The socket is +used to seed the random engine for SSL connections. diff --git a/curl/docs/cmdline-opts/engine.md b/curl/docs/cmdline-opts/engine.md new file mode 100644 index 000000000..511190023 --- /dev/null +++ b/curl/docs/cmdline-opts/engine.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: engine +Arg: +Help: Crypto engine to use +Protocols: TLS +Category: tls +Added: 7.9.3 +Multi: single +See-also: + - ciphers + - curves +Example: + - --engine flavor $URL +--- + +# `--engine` + +Select the OpenSSL crypto engine to use for cipher operations. Use --engine +list to print a list of build-time supported engines. Note that not all (and +possibly none) of the engines may be available at runtime. diff --git a/curl/docs/cmdline-opts/etag-compare.md b/curl/docs/cmdline-opts/etag-compare.md new file mode 100644 index 000000000..64ab80cd1 --- /dev/null +++ b/curl/docs/cmdline-opts/etag-compare.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: etag-compare +Arg: +Help: Load ETag from file +Protocols: HTTP +Added: 7.68.0 +Category: http +Multi: single +See-also: + - etag-save + - time-cond +Example: + - --etag-compare etag.txt $URL +--- + +# `--etag-compare` + +Make a conditional HTTP request for the specific ETag read from the given file +by sending a custom If-None-Match header using the stored ETag. + +For correct results, make sure that the specified file contains only a single +line with the desired ETag. A non-existing or empty file is treated as an +empty ETag. + +Use the option --etag-save to first save the ETag from a response, and then +use this option to compare against the saved ETag in a subsequent request. + +Use this option with a single URL only. diff --git a/curl/docs/cmdline-opts/etag-save.md b/curl/docs/cmdline-opts/etag-save.md new file mode 100644 index 000000000..137a4d5a5 --- /dev/null +++ b/curl/docs/cmdline-opts/etag-save.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: etag-save +Arg: +Help: Parse incoming ETag and save to a file +Protocols: HTTP +Added: 7.68.0 +Category: http +Multi: single +See-also: + - etag-compare +Example: + - --etag-save storetag.txt $URL +--- + +# `--etag-save` + +Save an HTTP ETag to the specified file. An ETag is a caching related header, +usually returned in a response. Use this option with a single URL only. + +If no ETag is sent by the server, an empty file is created. + +In many situations you want to use an existing etag in the request to avoid +downloading the same resource again but also save the new etag if it has +indeed changed, by using both etag options --etag-save and --etag-compare with +the same filename, in the same command line. + +Starting in curl 8.12.0, using the --create-dirs option can also create +missing directory components for the path provided in --etag-save. diff --git a/curl/docs/cmdline-opts/expect100-timeout.md b/curl/docs/cmdline-opts/expect100-timeout.md new file mode 100644 index 000000000..80cf4eba6 --- /dev/null +++ b/curl/docs/cmdline-opts/expect100-timeout.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: expect100-timeout +Arg: +Help: How long to wait for 100-continue +Protocols: HTTP +Added: 7.47.0 +Category: http timeout +Multi: single +See-also: + - connect-timeout +Example: + - --expect100-timeout 2.5 -T file $URL +--- + +# `--expect100-timeout` + +Maximum time in seconds that you allow curl to wait for a 100-continue +response when curl emits an Expects: 100-continue header in its request. By +default curl waits one second. This option accepts decimal values. When curl +stops waiting, it continues as if a response was received. + +The decimal value needs to be provided using a dot (`.`) as decimal separator - +not the local version even if it might be using another separator. diff --git a/curl/docs/cmdline-opts/fail-early.md b/curl/docs/cmdline-opts/fail-early.md new file mode 100644 index 000000000..67edbf919 --- /dev/null +++ b/curl/docs/cmdline-opts/fail-early.md @@ -0,0 +1,32 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: fail-early +Help: Fail on first transfer error +Added: 7.52.0 +Category: curl global +Multi: boolean +Scope: global +See-also: + - fail + - fail-with-body +Example: + - --fail-early $URL https://two.example +--- + +# `--fail-early` + +Fail and exit on the first detected transfer error. + +When curl is used to do multiple transfers on the command line, it attempts to +operate on each given URL, one by one. By default, it ignores errors if there +are more URLs given and the last URL's success determines the error code curl +returns. Early failures are "hidden" by subsequent successful transfers. + +Using this option, curl instead returns an error on the first transfer that +fails, independent of the amount of URLs that are given on the command +line. This way, no transfer failures go undetected by scripts and similar. + +This option does not imply --fail, which causes transfers to fail due to the +server's HTTP status code. You can combine the two options, however note --fail +is not global and is therefore contained by --next. diff --git a/curl/docs/cmdline-opts/fail-with-body.md b/curl/docs/cmdline-opts/fail-with-body.md new file mode 100644 index 000000000..670959ba9 --- /dev/null +++ b/curl/docs/cmdline-opts/fail-with-body.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: fail-with-body +Protocols: HTTP +Help: Fail on HTTP errors but save the body +Category: http output +Added: 7.76.0 +Mutexed: fail +Multi: boolean +See-also: + - fail + - fail-early +Example: + - --fail-with-body $URL +--- + +# `--fail-with-body` + +Return an error on server errors where the HTTP response code is 400 or +greater). In normal cases when an HTTP server fails to deliver a document, it +returns an HTML document stating so (which often also describes why and more). +This option allows curl to output and save that content but also to return +error 22. + +This is an alternative option to --fail which makes curl fail for the same +circumstances but without saving the content. diff --git a/curl/docs/cmdline-opts/fail.md b/curl/docs/cmdline-opts/fail.md new file mode 100644 index 000000000..0c8db1367 --- /dev/null +++ b/curl/docs/cmdline-opts/fail.md @@ -0,0 +1,35 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: fail +Short: f +Protocols: HTTP +Help: Fail fast with no output on HTTP errors +Category: important http +Mutexed: fail-with-body +Added: 4.0 +Multi: boolean +See-also: + - fail-with-body + - fail-early +Example: + - --fail $URL +--- + +# `--fail` + +Fail with error code 22 and with no response body output at all for HTTP +transfers returning HTTP response codes at 400 or greater. + +In normal cases when an HTTP server fails to deliver a document, it returns a +body of text stating so (which often also describes why and more) and a 4xx +HTTP response code. This command line option prevents curl from outputting +that data and instead returns error 22 early. By default, curl does not +consider HTTP response codes to indicate failure. + +To get both the error code and also save the content, use --fail-with-body +instead. + +This method is not fail-safe and there are occasions where non-successful +response codes slip through, especially when authentication is involved +(response codes 401 and 407). diff --git a/curl/docs/cmdline-opts/false-start.md b/curl/docs/cmdline-opts/false-start.md new file mode 100644 index 000000000..7c8c97669 --- /dev/null +++ b/curl/docs/cmdline-opts/false-start.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: false-start +Help: Enable TLS False Start +Protocols: TLS +Added: 7.42.0 +Category: deprecated +Multi: boolean +See-also: + - tcp-fastopen +Example: + - --false-start $URL +--- + +# `--false-start` + +No TLS backend currently supports this feature. + +Use false start during the TLS handshake. False start is a mode where a TLS +client starts sending application data before verifying the server's Finished +message, thus saving a round trip when performing a full handshake. diff --git a/curl/docs/cmdline-opts/form-escape.md b/curl/docs/cmdline-opts/form-escape.md new file mode 100644 index 000000000..0f93fde7e --- /dev/null +++ b/curl/docs/cmdline-opts/form-escape.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: form-escape +Help: Escape form fields using backslash +Protocols: HTTP imap smtp +Added: 7.81.0 +Category: http upload post +Multi: single +See-also: + - form +Example: + - --form-escape -F 'field\name=curl' -F 'file=@load"this' $URL +--- + +# `--form-escape` + +Pass on names of multipart form fields and files using backslash-escaping +instead of percent-encoding. diff --git a/curl/docs/cmdline-opts/form-string.md b/curl/docs/cmdline-opts/form-string.md new file mode 100644 index 000000000..e58ad625d --- /dev/null +++ b/curl/docs/cmdline-opts/form-string.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: form-string +Help: Specify multipart MIME data +Protocols: HTTP SMTP IMAP +Arg: +Category: http upload post smtp imap +Added: 7.13.2 +Multi: append +See-also: + - form +Example: + - --form-string "name=data" $URL +--- + +# `--form-string` + +Similar to --form except that the value string for the named parameter is used +literally. Leading @ and \< characters, and the `;type=` string in the value +have no special meaning. Use this in preference to --form if there is any +possibility that the string value may accidentally trigger the @ or \< +features of --form. diff --git a/curl/docs/cmdline-opts/form.md b/curl/docs/cmdline-opts/form.md new file mode 100644 index 000000000..9633b2511 --- /dev/null +++ b/curl/docs/cmdline-opts/form.md @@ -0,0 +1,145 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: form +Short: F +Arg: +Help: Specify multipart MIME data +Protocols: HTTP SMTP IMAP +Mutexed: data head upload-file +Category: http upload post imap smtp +Added: 5.0 +Multi: append +See-also: + - data + - form-string + - form-escape +Example: + - --form "name=curl" --form "file=@loadthis" $URL +--- + +# `--form` + +For the HTTP protocol family, emulate a filled-in form in which a user has +pressed the submit button. This makes curl POST data using the Content-Type +multipart/form-data according to RFC 2388. + +For SMTP and IMAP protocols, this composes a multipart mail message to +transmit. + +This enables uploading of binary files etc. To force the 'content' part to be +a file, prefix the filename with an @ sign. To just get the content part from +a file, prefix the filename with the symbol \<. The difference between @ and +\< is then that @ makes a file get attached in the post as a file upload, +while the \< makes a text field and just gets the contents for that text field +from a file. + +Read content from stdin instead of a file by using a single "-" as filename. +This goes for both @ and \< constructs. When stdin is used, the contents is +buffered in memory first by curl to determine its size and allow a possible +resend. Defining a part's data from a named non-regular file (such as a named +pipe or similar) is not subject to buffering and is instead read at +transmission time; since the full size is unknown before the transfer starts, +such data is sent as chunks by HTTP and rejected by IMAP. + +Example: send an image to an HTTP server, where 'profile' is the name of the +form-field to which the file **portrait.jpg** is the input: + + curl -F profile=@portrait.jpg https://example.com/upload.cgi + +Example: send your name and shoe size in two text fields to the server: + + curl -F name=John -F shoesize=11 https://example.com/ + +Example: send your essay in a text field to the server. Send it as a plain +text field, but get the contents for it from a local file: + + curl -F "story=HTML message;type=text/html' \ + -F '=)' -F '=@textfile.txt' ... smtp://example.com + +Data can be encoded for transfer using encoder=. Available encodings are +*binary* and *8bit* that do nothing else than adding the corresponding +Content-Transfer-Encoding header, *7bit* that only rejects 8-bit characters +with a transfer error, *quoted-printable* and *base64* that encodes data +according to the corresponding schemes, limiting lines length to 76 +characters. + +Example: send multipart mail with a quoted-printable text message and a +base64 attached file: + + curl -F '=text message;encoder=quoted-printable' \ + -F '=@localfile;encoder=base64' ... smtp://example.com + +See further examples and details in the MANUAL. diff --git a/curl/docs/cmdline-opts/ftp-account.md b/curl/docs/cmdline-opts/ftp-account.md new file mode 100644 index 000000000..e275349de --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-account.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-account +Arg: +Help: Account data string +Protocols: FTP +Added: 7.13.0 +Category: ftp auth +Multi: single +See-also: + - user +Example: + - --ftp-account "mr.robot" ftp://example.com/ +--- + +# `--ftp-account` + +When an FTP server asks for "account data" after username and password has +been provided, this data is sent off using the ACCT command. diff --git a/curl/docs/cmdline-opts/ftp-alternative-to-user.md b/curl/docs/cmdline-opts/ftp-alternative-to-user.md new file mode 100644 index 000000000..9bd368600 --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-alternative-to-user.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-alternative-to-user +Arg: +Help: String to replace USER [name] +Protocols: FTP +Added: 7.15.5 +Category: ftp +Multi: single +See-also: + - ftp-account + - user +Example: + - --ftp-alternative-to-user "U53r" ftp://example.com +--- + +# `--ftp-alternative-to-user` + +If authenticating with the USER and PASS commands fails, send this command. +When connecting to Tumbleweed's Secure Transport server over FTPS using a +client certificate, using "SITE AUTH" tells the server to retrieve the +username from the certificate. diff --git a/curl/docs/cmdline-opts/ftp-create-dirs.md b/curl/docs/cmdline-opts/ftp-create-dirs.md new file mode 100644 index 000000000..3e851ccae --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-create-dirs.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-create-dirs +Protocols: FTP SFTP +Help: Create the remote dirs if not present +Category: ftp sftp +Added: 7.10.7 +Multi: boolean +See-also: + - create-dirs +Example: + - --ftp-create-dirs -T file ftp://example.com/remote/path/file +--- + +# `--ftp-create-dirs` + +When an FTP or SFTP URL/operation uses a path that does not currently exist on +the server, the standard behavior of curl is to fail. Using this option, curl +instead attempts to create missing directories. diff --git a/curl/docs/cmdline-opts/ftp-method.md b/curl/docs/cmdline-opts/ftp-method.md new file mode 100644 index 000000000..d2bff21d5 --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-method.md @@ -0,0 +1,36 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-method +Arg: +Help: Control CWD usage +Protocols: FTP +Added: 7.15.1 +Category: ftp +Multi: single +See-also: + - list-only +Example: + - --ftp-method multicwd ftp://example.com/dir1/dir2/file + - --ftp-method nocwd ftp://example.com/dir1/dir2/file + - --ftp-method singlecwd ftp://example.com/dir1/dir2/file +--- + +# `--ftp-method` + +Control what method curl should use to reach a file on an FTP(S) +server. The method argument should be one of the following alternatives: + +## multicwd +Do a single CWD operation for each path part in the given URL. For deep +hierarchies this means many commands. This is how RFC 1738 says it should be +done. This is the default but the slowest behavior. + +## nocwd +Do no CWD at all. curl does SIZE, RETR, STOR etc and gives the full path to +the server for each of these commands. This is the fastest behavior. + +## singlecwd +Do one CWD with the full target directory and then operate on the file +"normally" (like in the multicwd case). This is somewhat more standards +compliant than `nocwd` but without the full penalty of `multicwd`. diff --git a/curl/docs/cmdline-opts/ftp-pasv.md b/curl/docs/cmdline-opts/ftp-pasv.md new file mode 100644 index 000000000..02deee30d --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-pasv.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-pasv +Help: Send PASV/EPSV instead of PORT +Protocols: FTP +Added: 7.11.0 +Category: ftp +Multi: mutex +Mutexed: ftp-port +See-also: + - disable-epsv +Example: + - --ftp-pasv ftp://example.com/ +--- + +# `--ftp-pasv` + +Use passive mode for the data connection. Passive is the internal default +behavior, but using this option can be used to override a previous --ftp-port +option. + +Reversing an enforced passive really is not doable but you must then instead +enforce the correct --ftp-port again. + +Passive mode means that curl tries the EPSV command first and then PASV, +unless --disable-epsv is used. diff --git a/curl/docs/cmdline-opts/ftp-port.md b/curl/docs/cmdline-opts/ftp-port.md new file mode 100644 index 000000000..28cc34ba2 --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-port.md @@ -0,0 +1,51 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-port +Arg:
+Help: Send PORT instead of PASV +Short: P +Protocols: FTP +Category: ftp +Added: 4.0 +Multi: single +See-also: + - ftp-pasv + - disable-eprt +Example: + - -P - ftp:/example.com + - -P eth0 ftp:/example.com + - -P 192.168.0.2 ftp:/example.com +--- + +# `--ftp-port` + +Reverse the default initiator/listener roles when connecting with FTP. This +option makes curl use active mode. curl then commands the server to connect +back to the client's specified address and port, while passive mode asks the +server to setup an IP address and port for it to connect to. \ +should be one of: + +## interface +e.g. **eth0** to specify which interface's IP address you want to use (Unix only) + +## IP address +e.g. **192.168.10.1** to specify the exact IP address + +## hostname +e.g. **my.host.domain** to specify the machine + +## - +make curl pick the same IP address that is already used for the control +connection. This is the recommended choice. + +## + +Disable the use of PORT with --ftp-pasv. Disable the attempt to use the EPRT +command instead of PORT by using --disable-eprt. EPRT is really PORT++. + +You can also append ":[start]-[end]" to the right of the address, to tell +curl what TCP port range to use. That means you specify a port range, from a +lower to a higher number. A single number works as well, but do note that it +increases the risk of failure since the port may not be available. +(Added in 7.19.5) diff --git a/curl/docs/cmdline-opts/ftp-pret.md b/curl/docs/cmdline-opts/ftp-pret.md new file mode 100644 index 000000000..48c48e3e7 --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-pret.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-pret +Help: Send PRET before PASV +Protocols: FTP +Added: 7.20.0 +Category: ftp +Multi: boolean +See-also: + - ftp-port + - ftp-pasv +Example: + - --ftp-pret ftp://example.com/ +--- + +# `--ftp-pret` + +Send a PRET command before PASV (and EPSV). Certain FTP servers, mainly +drftpd, require this non-standard command for directory listings as well as up +and downloads in PASV mode. diff --git a/curl/docs/cmdline-opts/ftp-skip-pasv-ip.md b/curl/docs/cmdline-opts/ftp-skip-pasv-ip.md new file mode 100644 index 000000000..37905e63b --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-skip-pasv-ip.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-skip-pasv-ip +Help: Skip the IP address for PASV +Protocols: FTP +Added: 7.15.0 +Category: ftp +Multi: boolean +See-also: + - ftp-pasv +Example: + - --ftp-skip-pasv-ip ftp://example.com/ +--- + +# `--ftp-skip-pasv-ip` + +Do not use the IP address the server suggests in its response to curl's PASV +command when curl connects the data connection. Instead curl reuses the same +IP address it already uses for the control connection. + +This option is enabled by default (added in 7.74.0). + +This option has no effect if PORT, EPRT or EPSV is used instead of PASV. diff --git a/curl/docs/cmdline-opts/ftp-ssl-ccc-mode.md b/curl/docs/cmdline-opts/ftp-ssl-ccc-mode.md new file mode 100644 index 000000000..3e9eb725c --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-ssl-ccc-mode.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-ssl-ccc-mode +Arg: +Help: Set CCC mode +Protocols: FTP +Added: 7.16.2 +Category: ftp tls +Multi: boolean +See-also: + - ftp-ssl-ccc +Example: + - --ftp-ssl-ccc-mode active --ftp-ssl-ccc ftps://example.com/ +--- + +# `--ftp-ssl-ccc-mode` + +Set the CCC mode. The passive mode does not initiate the shutdown, but instead +waits for the server to do it, and does not reply to the shutdown from the +server. The active mode initiates the shutdown and waits for a reply from the +server. diff --git a/curl/docs/cmdline-opts/ftp-ssl-ccc.md b/curl/docs/cmdline-opts/ftp-ssl-ccc.md new file mode 100644 index 000000000..40666646e --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-ssl-ccc.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-ssl-ccc +Help: Send CCC after authenticating +Protocols: FTP +Added: 7.16.1 +Category: ftp tls +Multi: boolean +See-also: + - ssl + - ftp-ssl-ccc-mode +Example: + - --ftp-ssl-ccc ftps://example.com/ +--- + +# `--ftp-ssl-ccc` + +Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after +authenticating. The rest of the control channel communication is +unencrypted. This allows NAT routers to follow the FTP transaction. The +default mode is passive. diff --git a/curl/docs/cmdline-opts/ftp-ssl-control.md b/curl/docs/cmdline-opts/ftp-ssl-control.md new file mode 100644 index 000000000..a68359a7b --- /dev/null +++ b/curl/docs/cmdline-opts/ftp-ssl-control.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ftp-ssl-control +Help: Require TLS for login, clear for transfer +Protocols: FTP +Added: 7.16.0 +Category: ftp tls +Multi: boolean +See-also: + - ssl +Example: + - --ftp-ssl-control ftp://example.com +--- + +# `--ftp-ssl-control` + +Require SSL/TLS for the FTP login, clear for transfer. Allows secure +authentication, but non-encrypted data transfers for efficiency. Fails the +transfer if the server does not support SSL/TLS. diff --git a/curl/docs/cmdline-opts/gen.pl b/curl/docs/cmdline-opts/gen.pl deleted file mode 100644 index 73ea6d47b..000000000 --- a/curl/docs/cmdline-opts/gen.pl +++ /dev/null @@ -1,385 +0,0 @@ -#!/usr/bin/perl - -=begin comment - -This script generates the manpage. - -Example: gen.pl mainpage > curl.1 - -Dev notes: - -We open *input* files in :crlf translation (a no-op on many platforms) in -case we have CRLF line endings in Windows but a perl that defaults to LF. -Unfortunately it seems some perls like msysgit can't handle a global input-only -:crlf so it has to be specified on each file open for text input. - -=end comment -=cut - -my $some_dir=$ARGV[1] || "."; - -opendir(my $dh, $some_dir) || die "Can't opendir $some_dir: $!"; -my @s = grep { /\.d$/ && -f "$some_dir/$_" } readdir($dh); -closedir $dh; - -my %optshort; -my %optlong; -my %helplong; -my %arglong; -my %redirlong; -my %protolong; - -# get the long name version, return the man page string -sub manpageify { - my ($k)=@_; - my $l; - if($optlong{$k} ne "") { - # both short + long - $l = "\\fI-".$optlong{$k}.", --$k\\fP"; - } - else { - # only long - $l = "\\fI--$k\\fP"; - } - return $l; -} - -sub printdesc { - my @desc = @_; - for my $d (@desc) { - # skip lines starting with space (examples) - if($d =~ /^[^ ]/) { - for my $k (keys %optlong) { - my $l = manpageify($k); - $d =~ s/--$k([^a-z0-9_-])/$l$1/; - } - } - print $d; - } -} - -sub seealso { - my($standalone, $data)=@_; - if($standalone) { - return sprintf - ".SH \"SEE ALSO\"\n$data\n"; - } - else { - return "See also $data. "; - } -} - -sub overrides { - my ($standalone, $data)=@_; - if($standalone) { - return ".SH \"OVERRIDES\"\n$data\n"; - } - else { - return $data; - } -} - -sub protocols { - my ($standalone, $data)=@_; - if($standalone) { - return ".SH \"PROTOCOLS\"\n$data\n"; - } - else { - return "($data) "; - } -} - -sub added { - my ($standalone, $data)=@_; - if($standalone) { - return ".SH \"ADDED\"\nAdded in curl version $data\n"; - } - else { - return "Added in $data. "; - } -} - -sub single { - my ($f, $standalone)=@_; - open(F, "<:crlf", "$some_dir/$f") || - return 1; - my $short; - my $long; - my $tags; - my $added; - my $protocols; - my $arg; - my $mutexed; - my $requires; - my $seealso; - my $magic; # cmdline special option - while() { - if(/^Short: *(.)/i) { - $short=$1; - } - elsif(/^Long: *(.*)/i) { - $long=$1; - } - elsif(/^Added: *(.*)/i) { - $added=$1; - } - elsif(/^Tags: *(.*)/i) { - $tags=$1; - } - elsif(/^Arg: *(.*)/i) { - $arg=$1; - } - elsif(/^Magic: *(.*)/i) { - $magic=$1; - } - elsif(/^Mutexed: *(.*)/i) { - $mutexed=$1; - } - elsif(/^Protocols: *(.*)/i) { - $protocols=$1; - } - elsif(/^See-also: *(.*)/i) { - $seealso=$1; - } - elsif(/^Requires: *(.*)/i) { - $requires=$1; - } - elsif(/^Help: *(.*)/i) { - ; - } - elsif(/^---/) { - if(!$long) { - print STDERR "WARN: no 'Long:' in $f\n"; - } - last; - } - else { - chomp; - print STDERR "WARN: unrecognized line in $f, ignoring:\n:'$_';" - } - } - my @dest; - while() { - push @desc, $_; - } - close(F); - my $opt; - if(defined($short) && $long) { - $opt = "-$short, --$long"; - } - elsif($short && !$long) { - $opt = "-$short"; - } - elsif($long && !$short) { - $opt = "--$long"; - } - - if($arg) { - $opt .= " $arg"; - } - - if($standalone) { - print ".TH curl 1 \"30 Nov 2016\" \"curl 7.52.0\" \"curl manual\"\n"; - print ".SH OPTION\n"; - print "curl $opt\n"; - } - else { - print ".IP \"$opt\"\n"; - } - if($protocols) { - print protocols($standalone, $protocols); - } - - if($standalone) { - print ".SH DESCRIPTION\n"; - } - - printdesc(@desc); - undef @desc; - - my @foot; - if($seealso) { - my @m=split(/ /, $seealso); - my $mstr; - for my $k (@m) { - my $l = manpageify($k); - $mstr .= sprintf "%s$l", $mstr?" and ":""; - } - push @foot, seealso($standalone, $mstr); - } - if($requires) { - my $l = manpageify($long); - push @foot, "$l requires that the underlying libcurl". - " was built to support $requires. "; - } - if($mutexed) { - my @m=split(/ /, $mutexed); - my $mstr; - for my $k (@m) { - my $l = manpageify($k); - $mstr .= sprintf "%s$l", $mstr?" and ":""; - } - push @foot, overrides($standalone, "This option overrides $mstr. "); - } - if($added) { - push @foot, added($standalone, $added); - } - if($foot[0]) { - print "\n"; - my $f = join("", @foot); - $f =~ s/ +\z//; # remove trailing space - print "$f\n"; - } - return 0; -} - -sub getshortlong { - my ($f)=@_; - open(F, "<:crlf", "$some_dir/$f"); - my $short; - my $long; - my $help; - my $arg; - my $protocols; - while() { - if(/^Short: (.)/i) { - $short=$1; - } - elsif(/^Long: (.*)/i) { - $long=$1; - } - elsif(/^Help: (.*)/i) { - $help=$1; - } - elsif(/^Arg: (.*)/i) { - $arg=$1; - } - elsif(/^Protocols: (.*)/i) { - $protocols=$1; - } - elsif(/^---/) { - last; - } - } - close(F); - if($short) { - $optshort{$short}=$long; - } - if($long) { - $optlong{$long}=$short; - $helplong{$long}=$help; - $arglong{$long}=$arg; - $protolong{$long}=$protocols; - } -} - -sub indexoptions { - foreach my $f (@s) { - getshortlong($f); - } -} - -sub header { - my ($f)=@_; - open(F, "<:crlf", "$some_dir/$f"); - my @d; - while() { - push @d, $_; - } - close(F); - printdesc(@d); -} - -sub listhelp { - foreach my $f (sort keys %helplong) { - my $long = $f; - my $short = $optlong{$long}; - my $opt; - - if(defined($short) && $long) { - $opt = "-$short, --$long"; - } - elsif($long && !$short) { - $opt = " --$long"; - } - - my $arg = $arglong{$long}; - if($arg) { - $opt .= " $arg"; - } - my $desc = $helplong{$f}; - $desc =~ s/\"/\\\"/g; # escape double quotes - - my $line = sprintf " {\"%s\",\n \"%s\"},\n", $opt, $desc; - - if(length($opt) + length($desc) > 78) { - print STDERR "WARN: the --$long line is too long\n"; - } - print $line; - } -} - -sub mainpage { - # show the page header - header("page-header"); - - # output docs for all options - foreach my $f (sort @s) { - single($f, 0); - } - - header("page-footer"); -} - -sub showonly { - my ($f) = @_; - if(single($f, 1)) { - print STDERR "$f: failed\n"; - } -} - -sub showprotocols { - my %prots; - foreach my $f (keys %optlong) { - my @p = split(/ /, $protolong{$f}); - for my $p (@p) { - $prots{$p}++; - } - } - for(sort keys %prots) { - printf "$_ (%d options)\n", $prots{$_}; - } -} - -sub getargs { - my $f; - do { - $f = shift @ARGV; - if($f eq "mainpage") { - mainpage(); - return; - } - elsif($f eq "listhelp") { - listhelp(); - return; - } - elsif($f eq "single") { - showonly(shift @ARGV); - return; - } - elsif($f eq "protos") { - showprotocols(); - return; - } - } while($f); - - print "Usage: gen.pl [srcdir]\n"; -} - -#------------------------------------------------------------------------ - -# learn all existing options -indexoptions(); - -getargs(); - diff --git a/curl/docs/cmdline-opts/get.md b/curl/docs/cmdline-opts/get.md new file mode 100644 index 000000000..ac0560ab6 --- /dev/null +++ b/curl/docs/cmdline-opts/get.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: get +Short: G +Help: Put the post data in the URL and use GET +Protocols: HTTP +Category: http +Added: 7.8.1 +Multi: boolean +See-also: + - data + - request +Example: + - --get $URL + - --get -d "tool=curl" -d "age=old" $URL + - --get -I -d "tool=curl" $URL +--- + +# `--get` + +When used, this option makes all data specified with --data, --data-binary or +--data-urlencode to be used in an HTTP GET request instead of the POST request +that otherwise would be used. curl appends the provided data to the URL as a +query string. + +If used in combination with --head, the POST data is instead appended to the +URL with a HEAD request. diff --git a/curl/docs/cmdline-opts/globoff.md b/curl/docs/cmdline-opts/globoff.md new file mode 100644 index 000000000..3c8c34143 --- /dev/null +++ b/curl/docs/cmdline-opts/globoff.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: globoff +Short: g +Help: Disable URL globbing with {} and [] +Category: curl +Added: 7.6 +Multi: boolean +See-also: + - config + - disable +Example: + - -g "https://example.com/{[]}}}}" +--- + +# `--globoff` + +Switch off the URL globbing function. When you set this option, you can +specify URLs that contain the letters {}[] without having curl itself +interpret them. Note that these letters are not normal legal URL contents but +they should be encoded according to the URI standard. diff --git a/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md b/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md new file mode 100644 index 000000000..f1abb3772 --- /dev/null +++ b/curl/docs/cmdline-opts/happy-eyeballs-timeout-ms.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: happy-eyeballs-timeout-ms +Arg: +Help: Time for IPv6 before IPv4 +Added: 7.59.0 +Category: connection timeout +Multi: single +See-also: + - max-time + - connect-timeout +Example: + - --happy-eyeballs-timeout-ms 500 $URL +--- + +# `--happy-eyeballs-timeout-ms` + +Set the timeout for Happy Eyeballs. + +Happy Eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6 +addresses for dual-stack hosts, giving IPv6 a head-start of the specified +number of milliseconds. If the IPv6 address cannot be connected to within that +time, then a connection attempt is made to the IPv4 address in parallel. The +first connection to be established is the one that is used. + +The range of suggested useful values is limited. Happy Eyeballs RFC 6555 says +"It is RECOMMENDED that connection attempts be paced 150-250 ms apart to +balance human factors against network load." libcurl currently defaults to +200 ms. Firefox and Chrome currently default to 300 ms. diff --git a/curl/docs/cmdline-opts/haproxy-clientip.md b/curl/docs/cmdline-opts/haproxy-clientip.md new file mode 100644 index 000000000..4bbf26ecc --- /dev/null +++ b/curl/docs/cmdline-opts/haproxy-clientip.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: haproxy-clientip +Arg: +Help: Set address in HAProxy PROXY +Protocols: HTTP +Added: 8.2.0 +Category: http proxy +Multi: single +See-also: + - proxy +Example: + - --haproxy-clientip $IP +--- + +# `--haproxy-clientip` + +Set a client IP in HAProxy PROXY protocol v1 header at the beginning of the +connection. + +For valid requests, IPv4 addresses must be indicated as a series of exactly +4 integers in the range [0..255] inclusive written in decimal representation +separated by exactly one dot between each other. Heading zeroes are not +permitted in front of numbers in order to avoid any possible confusion +with octal numbers. IPv6 addresses must be indicated as series of 4 hexadecimal +digits (upper or lower case) delimited by colons between each other, with the +acceptance of one double colon sequence to replace the largest acceptable range +of consecutive zeroes. The total number of decoded bits must be exactly 128. + +Otherwise, any string can be accepted for the client IP and get sent. + +It replaces --haproxy-protocol if used, it is not necessary to specify both flags. diff --git a/curl/docs/cmdline-opts/haproxy-protocol.md b/curl/docs/cmdline-opts/haproxy-protocol.md new file mode 100644 index 000000000..26456c80b --- /dev/null +++ b/curl/docs/cmdline-opts/haproxy-protocol.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: haproxy-protocol +Help: Send HAProxy PROXY protocol v1 header +Protocols: HTTP +Added: 7.60.0 +Category: http proxy +Multi: boolean +See-also: + - proxy +Example: + - --haproxy-protocol $URL +--- + +# `--haproxy-protocol` + +Send a HAProxy PROXY protocol v1 header at the beginning of the connection. +This is used by some load balancers and reverse proxies to indicate the +client's true IP address and port. + +This option is primarily useful when sending test requests to a service that +expects this header. diff --git a/curl/docs/cmdline-opts/head.md b/curl/docs/cmdline-opts/head.md new file mode 100644 index 000000000..353ef9a01 --- /dev/null +++ b/curl/docs/cmdline-opts/head.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: head +Short: I +Help: Show document info only +Protocols: HTTP FTP FILE +Category: http ftp file +Added: 4.0 +Multi: boolean +See-also: + - get + - verbose + - trace-ascii +Example: + - -I $URL +--- + +# `--head` + +Fetch the headers only. HTTP-servers feature the command HEAD which this uses +to get nothing but the header of a document. When used on an FTP or FILE URL, +curl displays the file size and last modification time only. diff --git a/curl/docs/cmdline-opts/header.md b/curl/docs/cmdline-opts/header.md new file mode 100644 index 000000000..66816aac5 --- /dev/null +++ b/curl/docs/cmdline-opts/header.md @@ -0,0 +1,68 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: header +Short: H +Arg:
+Help: Pass custom header(s) to server +Protocols: HTTP IMAP SMTP +Category: http imap smtp +Added: 5.0 +Multi: append +See-also: + - user-agent + - referer +Example: + - -H "X-First-Name: Joe" $URL + - -H "User-Agent: yes-please/2000" $URL + - -H "Host:" $URL + - -H @headers.txt $URL +--- + +# `--header` + +Extra header to include in information sent. When used within an HTTP request, +it is added to the regular request headers. + +For an IMAP or SMTP MIME uploaded mail built with --form options, it is +prepended to the resulting MIME document, effectively including it at the mail +global level. It does not affect raw uploaded mails (Added in 7.56.0). + +You may specify any number of extra headers. Note that if you should add a +custom header that has the same name as one of the internal ones curl would +use, your externally set header is used instead of the internal one. This +allows you to make even trickier stuff than curl would normally do. You should +not replace internally set headers without knowing perfectly well what you are +doing. Remove an internal header by giving a replacement without content on +the right side of the colon, as in: -H `Host:`. If you send the custom header +with no-value then its header must be terminated with a semicolon, such as -H +`X-Custom-Header;` to send `X-Custom-Header:`. + +curl makes sure that each header you add/replace is sent with the proper +end-of-line marker, you should thus **not** add that as a part of the header +content: do not add newlines or carriage returns, they only mess things up for +you. curl passes on the verbatim string you give it without any filter or +other safe guards. That includes white space and control characters. + +This option can take an argument in @filename style, which then adds a header +for each line in the input file. Using @- makes curl read the header file from +stdin. (Added in 7.55.0) + +Please note that most anti-spam utilities check the presence and value of +several MIME mail headers: these are `From:`, `To:`, `Date:` and `Subject:` +among others and should be added with this option. + +You need --proxy-header to send custom headers intended for an HTTP proxy. +(Added in 7.37.0) + +Passing on a `Transfer-Encoding: chunked` header when doing an HTTP request +with a request body, makes curl send the data using chunked encoding. + +**WARNING**: headers set with this option are set in all HTTP requests - even +after redirects are followed, like when told with --location. This can lead to +the header being sent to other hosts than the original host, so sensitive +headers should be used with caution combined with following redirects. + +`Authorization:` and `Cookie:` headers are explicitly *not* passed on in HTTP +requests when following redirects to other origins, unless --location-trusted +is used. diff --git a/curl/docs/cmdline-opts/help.md b/curl/docs/cmdline-opts/help.md new file mode 100644 index 000000000..122c55cd4 --- /dev/null +++ b/curl/docs/cmdline-opts/help.md @@ -0,0 +1,39 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: help +Arg: +Short: h +Help: Get help for commands +Category: important curl +Added: 4.0 +Multi: custom +See-also: + - verbose +Example: + - --help all + - --help --insecure + - --help -f +--- + +# `--help` + +Usage help. Provide help for the subject given as an optional argument. + +If no argument is provided, curl displays the most important command line +arguments. + +The argument can either be a **category** or a **command line option**. When a +category is provided, curl shows all command line options within the given +category. Specify category `all` to list all available options. + +If `category` is specified, curl displays all available help categories. + +If the provided subject is instead an existing command line option, specified +either in its short form with a single dash and a single letter, or in the +long form with two dashes and a longer name, curl displays a help text for +that option in the terminal. + +The help output is extensive for some options. + +If the provided command line option is not known, curl says so. diff --git a/curl/docs/cmdline-opts/hostpubmd5.md b/curl/docs/cmdline-opts/hostpubmd5.md new file mode 100644 index 000000000..5d480a5bc --- /dev/null +++ b/curl/docs/cmdline-opts/hostpubmd5.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: hostpubmd5 +Arg: +Help: Acceptable MD5 hash of host public key +Protocols: SFTP SCP +Added: 7.17.1 +Category: sftp scp ssh +Multi: single +See-also: + - hostpubsha256 +Example: + - --hostpubmd5 e5c1c49020640a5ab0f2034854c321a8 sftp://example.com/ +--- + +# `--hostpubmd5` + +Pass a string containing 32 hexadecimal digits. The string should be the 128 +bit **MD5** checksum of the remote host's public key, curl refuses the +connection with the host unless the checksums match. diff --git a/curl/docs/cmdline-opts/hostpubsha256.md b/curl/docs/cmdline-opts/hostpubsha256.md new file mode 100644 index 000000000..e695a10cb --- /dev/null +++ b/curl/docs/cmdline-opts/hostpubsha256.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: hostpubsha256 +Arg: +Help: Acceptable SHA256 hash of host public key +Protocols: SFTP SCP +Added: 7.80.0 +Category: sftp scp ssh +Multi: single +See-also: + - hostpubmd5 +Example: + - --hostpubsha256 NDVkMTQxMGQ1ODdmMjQ3MjczYjAyOTY5MmRkMjVmNDQ= sftp://example.com/ +--- + +# `--hostpubsha256` + +Pass a string containing a Base64-encoded SHA256 hash of the remote host's +public key. curl refuses the connection with the host unless the hashes match. + +This feature requires libcurl to be built with libssh2 and does not work with +other SSH backends. diff --git a/curl/docs/cmdline-opts/hsts.md b/curl/docs/cmdline-opts/hsts.md new file mode 100644 index 000000000..ca6b07e66 --- /dev/null +++ b/curl/docs/cmdline-opts/hsts.md @@ -0,0 +1,32 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: hsts +Arg: +Protocols: HTTPS +Help: Enable HSTS with this cache file +Added: 7.74.0 +Category: http +Multi: append +See-also: + - proto +Example: + - --hsts cache.txt $URL +--- + +# `--hsts` + +Enable HSTS for the transfer. If the filename points to an existing HSTS cache +file, that is used. After a completed transfer, the cache is saved to the +filename again if it has been modified. + +If curl is told to use HTTP:// for a transfer involving a hostname that exists +in the HSTS cache, it upgrades the transfer to use HTTPS. Each HSTS cache +entry has an individual lifetime after which the upgrade is no longer +performed. + +Specify a "" filename (zero length) to avoid loading/saving and make curl just +handle HSTS in memory. + +If this option is used several times, curl loads contents from all the +files but the last one is used for saving. diff --git a/curl/docs/cmdline-opts/http0.9.md b/curl/docs/cmdline-opts/http0.9.md new file mode 100644 index 000000000..41b76ffd7 --- /dev/null +++ b/curl/docs/cmdline-opts/http0.9.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: http0.9 +Tags: Versions +Protocols: HTTP +Help: Allow HTTP/0.9 responses +Category: http +Added: 7.64.0 +Multi: boolean +See-also: + - http1.1 + - http2 + - http3 +Example: + - --http0.9 $URL +--- + +# `--http0.9` + +Accept an HTTP version 0.9 response. + +HTTP/0.9 is a response without headers and therefore you can also connect with +this to non-HTTP servers and still get a response since curl simply +transparently downgrades - if allowed. + +HTTP/0.9 is disabled by default (added in 7.66.0) diff --git a/curl/docs/cmdline-opts/http1.0.md b/curl/docs/cmdline-opts/http1.0.md new file mode 100644 index 000000000..0252f0523 --- /dev/null +++ b/curl/docs/cmdline-opts/http1.0.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: 0 +Long: http1.0 +Tags: Versions +Protocols: HTTP +Added: 7.9.1 +Mutexed: http1.1 http2 http2-prior-knowledge http3 +Help: Use HTTP/1.0 +Category: http +Multi: mutex +See-also: + - http0.9 + - http1.1 +Example: + - --http1.0 $URL +--- + +# `--http1.0` + +Use HTTP version 1.0 instead of using its internally preferred HTTP version. diff --git a/curl/docs/cmdline-opts/http1.1.md b/curl/docs/cmdline-opts/http1.1.md new file mode 100644 index 000000000..14e5c7470 --- /dev/null +++ b/curl/docs/cmdline-opts/http1.1.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: http1.1 +Tags: Versions +Protocols: HTTP +Added: 7.33.0 +Mutexed: http1.0 http2 http2-prior-knowledge http3 +Help: Use HTTP/1.1 +Category: http +Multi: mutex +See-also: + - http1.0 + - http0.9 +Example: + - --http1.1 $URL +--- + +# `--http1.1` + +Use HTTP version 1.1. This is the default with HTTP:// URLs. diff --git a/curl/docs/cmdline-opts/http2-prior-knowledge.md b/curl/docs/cmdline-opts/http2-prior-knowledge.md new file mode 100644 index 000000000..6351e06a7 --- /dev/null +++ b/curl/docs/cmdline-opts/http2-prior-knowledge.md @@ -0,0 +1,29 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: http2-prior-knowledge +Tags: Versions +Protocols: HTTP +Added: 7.49.0 +Mutexed: http1.1 http1.0 http2 http3 +Requires: HTTP/2 +Help: Use HTTP/2 without HTTP/1.1 Upgrade +Category: http +Multi: boolean +See-also: + - http2 + - http3 +Example: + - --http2-prior-knowledge $URL +--- + +# `--http2-prior-knowledge` + +Issue a non-TLS HTTP request using HTTP/2 directly without HTTP/1.1 Upgrade. +It requires prior knowledge that the server supports HTTP/2 straight away. +HTTPS requests still do HTTP/2 the standard way with negotiated protocol +versions in the TLS handshake. + +Since 8.10.0 if this option is set for an HTTPS request then the application +layer protocol version (ALPN) offered to the server is only HTTP/2. Prior to +that both HTTP/1.1 and HTTP/2 were offered. diff --git a/curl/docs/cmdline-opts/http2.md b/curl/docs/cmdline-opts/http2.md new file mode 100644 index 000000000..ae4d26974 --- /dev/null +++ b/curl/docs/cmdline-opts/http2.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: http2 +Tags: Versions +Protocols: HTTP +Added: 7.33.0 +Mutexed: http1.1 http1.0 http2-prior-knowledge http3 +Requires: HTTP/2 +Help: Use HTTP/2 +Category: http +Multi: mutex +See-also: + - http1.1 + - http3 + - no-alpn +Example: + - --http2 $URL +--- + +# `--http2` + +Use HTTP/2. + +For HTTPS, this means curl negotiates HTTP/2 in the TLS handshake. curl does +this by default. + +For HTTP, this means curl attempts to upgrade the request to HTTP/2 using the +Upgrade: request header. + +When curl uses HTTP/2 over HTTPS, it does not itself insist on TLS 1.2 or +higher even though that is required by the specification. A user can add this +version requirement with --tlsv1.2. diff --git a/curl/docs/cmdline-opts/http3-only.md b/curl/docs/cmdline-opts/http3-only.md new file mode 100644 index 000000000..400ac19ac --- /dev/null +++ b/curl/docs/cmdline-opts/http3-only.md @@ -0,0 +1,32 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: http3-only +Tags: Versions +Protocols: HTTP +Added: 7.88.0 +Mutexed: http1.1 http1.0 http2 http2-prior-knowledge http3 +Requires: HTTP/3 +Help: Use HTTP/3 only +Category: http +Multi: mutex +See-also: + - http1.1 + - http2 + - http3 +Example: + - --http3-only $URL +--- + +# `--http3-only` + +Instruct curl to use HTTP/3 to the host in the URL, with no fallback to +earlier HTTP versions. HTTP/3 can only be used for HTTPS and not for HTTP +URLs. For HTTP, this option triggers an error. + +This option allows a user to avoid using the Alt-Svc method of upgrading to +HTTP/3 when you know that the target speaks HTTP/3 on the given host and port. + +This option makes curl fail if a QUIC connection cannot be established, it +does not attempt any other HTTP versions on its own. Use --http3 for similar +functionality *with* a fallback. diff --git a/curl/docs/cmdline-opts/http3.md b/curl/docs/cmdline-opts/http3.md new file mode 100644 index 000000000..a66d79782 --- /dev/null +++ b/curl/docs/cmdline-opts/http3.md @@ -0,0 +1,35 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: http3 +Tags: Versions +Protocols: HTTP +Added: 7.66.0 +Mutexed: http1.1 http1.0 http2 http2-prior-knowledge http3-only +Requires: HTTP/3 +Help: Use HTTP/3 +Category: http +Multi: mutex +See-also: + - http1.1 + - http2 +Example: + - --http3 $URL +--- + +# `--http3` + +Attempt HTTP/3 to the host in the URL, but fallback to earlier HTTP versions +if the HTTP/3 connection establishment fails or is slow. HTTP/3 is only +available for HTTPS and not for HTTP URLs. + +This option allows a user to avoid using the Alt-Svc method of upgrading to +HTTP/3 when you know or suspect that the target speaks HTTP/3 on the given +host and port. + +When asked to use HTTP/3, curl issues a separate attempt to use older HTTP +versions with a slight delay, so if the HTTP/3 transfer fails or is slow, curl +still tries to proceed with an older HTTP version. The fallback performs the +regular negotiation between HTTP/1 and HTTP/2. + +Use --http3-only for similar functionality *without* a fallback. diff --git a/curl/docs/cmdline-opts/ignore-content-length.md b/curl/docs/cmdline-opts/ignore-content-length.md new file mode 100644 index 000000000..01ff43b06 --- /dev/null +++ b/curl/docs/cmdline-opts/ignore-content-length.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ignore-content-length +Help: Ignore the size of the remote resource +Protocols: FTP HTTP +Category: http ftp +Added: 7.14.1 +Multi: boolean +See-also: + - ftp-skip-pasv-ip +Example: + - --ignore-content-length $URL +--- + +# `--ignore-content-length` + +For HTTP, ignore the Content-Length header. This is particularly useful for +servers running Apache 1.x, which reports incorrect Content-Length for files +larger than 2 gigabytes. + +For FTP, this makes curl skip the SIZE command to figure out the size before +downloading a file (added in 7.46.0). diff --git a/curl/docs/cmdline-opts/insecure.md b/curl/docs/cmdline-opts/insecure.md new file mode 100644 index 000000000..6b7009f25 --- /dev/null +++ b/curl/docs/cmdline-opts/insecure.md @@ -0,0 +1,41 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: insecure +Short: k +Help: Allow insecure server connections +Protocols: TLS SFTP SCP +Category: tls sftp scp ssh +Added: 7.10 +Multi: boolean +See-also: + - proxy-insecure + - cacert + - capath +Example: + - --insecure $URL +--- + +# `--insecure` + +By default, every secure connection curl makes is verified to be secure before +the transfer takes place. This option makes curl skip the verification step +and proceed without checking. + +When this option is not used for protocols using TLS, curl verifies the +server's TLS certificate before it continues: that the certificate contains +the right name which matches the hostname used in the URL and that the +certificate has been signed by a CA certificate present in the cert store. See +this online resource for further details: +**https://curl.se/docs/sslcerts.html** + +For SFTP and SCP, this option makes curl skip the *known_hosts* verification. +*known_hosts* is a file normally stored in the user's home directory in the +".ssh" subdirectory, which contains hostnames and their public keys. + +**WARNING**: using this option makes the transfer insecure. + +When curl uses secure protocols it trusts responses and allows for example +HSTS and Alt-Svc information to be stored and used subsequently. Using +--insecure can make curl trust and use such information from malicious +servers. diff --git a/curl/docs/cmdline-opts/interface.md b/curl/docs/cmdline-opts/interface.md new file mode 100644 index 000000000..539e39272 --- /dev/null +++ b/curl/docs/cmdline-opts/interface.md @@ -0,0 +1,51 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: interface +Arg: +Help: Use network interface +Category: connection +Added: 7.3 +Multi: single +See-also: + - dns-interface +Example: + - --interface eth0 $URL + - --interface "host!10.0.0.1" $URL + - --interface "if!enp3s0" $URL +--- + +# `--interface` + +Perform the operation using a specified interface. You can enter interface +name, IP address or hostname. If you prefer to be specific, you can use the +following special syntax: + +## if! + +Interface name. If the provided name does not match an existing interface, +curl returns with error 45. + +## host! + +IP address or hostname. + +## ifhost!! + +Interface name and IP address or hostname. This syntax requires libcurl 8.9.0 +or later. + +If the provided name does not match an existing interface, curl returns with +error 45. + +## + +curl does not support using network interface names for this option on +Windows. + +That name resolve operation if a hostname is provided does **not** use +DNS-over-HTTPS even if --doh-url is set. + +On Linux this option can be used to specify a **VRF** (Virtual Routing and +Forwarding) device, but the binary then needs to either have the +**CAP_NET_RAW** capability set or to be run as root. diff --git a/curl/docs/cmdline-opts/ip-tos.md b/curl/docs/cmdline-opts/ip-tos.md new file mode 100644 index 000000000..3d6473f31 --- /dev/null +++ b/curl/docs/cmdline-opts/ip-tos.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ip-tos +Arg: +Help: Set IP Type of Service or Traffic Class +Added: 8.9.0 +Category: connection +Protocols: All +Multi: single +See-also: + - tcp-nodelay + - vlan-priority +Example: + - --ip-tos CS5 $URL +--- + +# `--ip-tos` + +Set Type of Service (TOS) for IPv4 or Traffic Class for IPv6. + +The values allowed for \ can be a numeric value between 1 and 255 +or one of the following: + +CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, AF11, AF12, AF13, AF21, AF22, AF23, +AF31, AF32, AF33, AF41, AF42, AF43, EF, VOICE-ADMIT, ECT1, ECT0, CE, LE, +LOWCOST, LOWDELAY, THROUGHPUT, RELIABILITY, MINCOST diff --git a/curl/docs/cmdline-opts/ipfs-gateway.md b/curl/docs/cmdline-opts/ipfs-gateway.md new file mode 100644 index 000000000..16e197fcf --- /dev/null +++ b/curl/docs/cmdline-opts/ipfs-gateway.md @@ -0,0 +1,40 @@ +--- +c: Copyright (C) Mark Gaiser, +SPDX-License-Identifier: curl +Long: ipfs-gateway +Arg: +Help: Gateway for IPFS +Protocols: IPFS +Added: 8.4.0 +Category: curl +Multi: single +See-also: + - help + - manual +Example: + - --ipfs-gateway $URL ipfs:// +--- + +# `--ipfs-gateway` + +Specify which gateway to use for IPFS and IPNS URLs. Not specifying this +instead makes curl check if the IPFS_GATEWAY environment variable is set, or +if a `~/.ipfs/gateway` file holding the gateway URL exists. + +If you run a local IPFS node, this gateway is by default available under +`http://localhost:8080`. A full example URL would look like: + + curl --ipfs-gateway http://localhost:8080 \ + ipfs://bafybeigagd5nmnn2iys2f3 + +There are many public IPFS gateways. See for example: +https://ipfs.github.io/public-gateway-checker/ + +If you opt to go for a remote gateway you need to be aware that you completely +trust the gateway. This might be fine in local gateways that you host +yourself. With remote gateways there could potentially be malicious actors +returning you data that does not match the request you made, inspect or even +interfere with the request. You may not notice this when using curl. A +mitigation could be to go for a "trustless" gateway. This means you locally +verify the data. Consult the docs page on trusted vs trustless: +https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-trustless diff --git a/curl/docs/cmdline-opts/ipv4.md b/curl/docs/cmdline-opts/ipv4.md new file mode 100644 index 000000000..b790cc65a --- /dev/null +++ b/curl/docs/cmdline-opts/ipv4.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: 4 +Long: ipv4 +Tags: Versions +Protocols: +Added: 7.10.8 +Mutexed: ipv6 +Requires: +Help: Resolve names to IPv4 addresses +Category: connection dns +Multi: mutex +See-also: + - http1.1 + - http2 +Example: + - --ipv4 $URL +--- + +# `--ipv4` + +Use IPv4 addresses only when resolving hostnames, and not for example try +IPv6. diff --git a/curl/docs/cmdline-opts/ipv6.md b/curl/docs/cmdline-opts/ipv6.md new file mode 100644 index 000000000..547f4917c --- /dev/null +++ b/curl/docs/cmdline-opts/ipv6.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: 6 +Long: ipv6 +Tags: Versions +Protocols: +Added: 7.10.8 +Mutexed: ipv4 +Requires: +Help: Resolve names to IPv6 addresses +Category: connection dns +Multi: mutex +See-also: + - http1.1 + - http2 +Example: + - --ipv6 $URL +--- + +# `--ipv6` + +Use IPv6 addresses only when resolving hostnames, and not for example try +IPv4. + +Your resolver may respond to an IPv6-only resolve request by returning IPv6 +addresses that contain "mapped" IPv4 addresses for compatibility purposes. +macOS is known to do this. diff --git a/curl/docs/cmdline-opts/json.md b/curl/docs/cmdline-opts/json.md new file mode 100644 index 000000000..3f1a9a1b7 --- /dev/null +++ b/curl/docs/cmdline-opts/json.md @@ -0,0 +1,42 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: json +Arg: +Help: HTTP POST JSON +Protocols: HTTP +Mutexed: form head upload-file +Category: http post upload +Added: 7.82.0 +Multi: append +See-also: + - data-binary + - data-raw +Example: + - --json '{ "drink": "coffee" }' $URL + - --json '{ "drink":' --json ' "coffee" }' $URL + - --json @prepared $URL + - --json @- $URL < json.txt +--- + +# `--json` + +Send the specified JSON data in a POST request to the HTTP server. --json +works as a shortcut for passing on these three options: + + --data-binary [arg] + --header "Content-Type: application/json" + --header "Accept: application/json" + +There is **no verification** that the passed in data is actual JSON or that +the syntax is correct. + +If you start the data with the letter @, the rest should be a filename to read +the data from, or a single dash (-) if you want curl to read the data from +stdin. Posting data from a file named 'foobar' would thus be done with --json +@foobar and to instead read the data from stdin, use --json @-. + +If this option is used more than once on the same command line, the additional +data pieces are concatenated to the previous before sending. + +The headers this option sets can be overridden with --header as usual. diff --git a/curl/docs/cmdline-opts/junk-session-cookies.md b/curl/docs/cmdline-opts/junk-session-cookies.md new file mode 100644 index 000000000..63971050c --- /dev/null +++ b/curl/docs/cmdline-opts/junk-session-cookies.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: junk-session-cookies +Short: j +Help: Ignore session cookies read from file +Protocols: HTTP +Category: http +Added: 7.9.7 +Multi: boolean +See-also: + - cookie + - cookie-jar +Example: + - --junk-session-cookies -b cookies.txt $URL +--- + +# `--junk-session-cookies` + +When curl is told to read cookies from a given file, this option makes it +discard all "session cookies". This has the same effect as if a new session is +started. Typical browsers discard session cookies when they are closed down. diff --git a/curl/docs/cmdline-opts/keepalive-cnt.md b/curl/docs/cmdline-opts/keepalive-cnt.md new file mode 100644 index 000000000..e56c976ec --- /dev/null +++ b/curl/docs/cmdline-opts/keepalive-cnt.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: keepalive-cnt +Arg: +Help: Maximum number of keepalive probes +Added: 8.9.0 +Category: connection +Multi: single +See-also: + - keepalive-time + - no-keepalive +Example: + - --keepalive-cnt 3 $URL +--- + +# `--keepalive-cnt` + +Set the maximum number of keepalive probes TCP should send but get no response +before dropping the connection. This option is usually used in conjunction +with --keepalive-time. + +This option is supported on Linux, *BSD/macOS, Windows \>=10.0.16299, Solaris +11.4, and recent AIX, HP-UX and more. This option has no effect if +--no-keepalive is used. + +If unspecified, the option defaults to 9. diff --git a/curl/docs/cmdline-opts/keepalive-time.md b/curl/docs/cmdline-opts/keepalive-time.md new file mode 100644 index 000000000..4b10ff6f4 --- /dev/null +++ b/curl/docs/cmdline-opts/keepalive-time.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: keepalive-time +Arg: +Help: Interval time for keepalive probes +Added: 7.18.0 +Category: connection timeout +Multi: single +See-also: + - no-keepalive + - keepalive-cnt + - max-time +Example: + - --keepalive-time 20 $URL +--- + +# `--keepalive-time` + +Set the time a connection needs to remain idle before sending keepalive probes +and the time between individual keepalive probes. It is currently effective on +operating systems offering the `TCP_KEEPIDLE` and `TCP_KEEPINTVL` socket +options (meaning Linux, *BSD/macOS, Windows, Solaris, and recent AIX, HP-UX and more). +Keepalive is used by the TCP stack to detect broken networks on idle connections. +The number of missed keepalive probes before declaring the connection down is OS +dependent and is commonly 8 (*BSD/macOS/AIX), 9 (Linux/AIX) or 5/10 (Windows), and +this number can be changed by specifying the curl option `keepalive-cnt`. +Note that this option has no effect if --no-keepalive is used. + +If unspecified, the option defaults to 60 seconds. diff --git a/curl/docs/cmdline-opts/key-type.md b/curl/docs/cmdline-opts/key-type.md new file mode 100644 index 000000000..4128bfeaf --- /dev/null +++ b/curl/docs/cmdline-opts/key-type.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: key-type +Arg: +Help: Private key file type (DER/PEM/ENG) +Protocols: TLS +Category: tls +Added: 7.9.3 +Multi: single +See-also: + - key +Example: + - --key-type DER --key here $URL +--- + +# `--key-type` + +Private key file type. Specify which type your --key provided private key +is. DER, PEM, and ENG are supported. If not specified, PEM is assumed. diff --git a/curl/docs/cmdline-opts/key.md b/curl/docs/cmdline-opts/key.md new file mode 100644 index 000000000..967119a8b --- /dev/null +++ b/curl/docs/cmdline-opts/key.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: key +Arg: +Protocols: TLS SSH +Help: Private key filename +Category: tls ssh +Added: 7.9.3 +Multi: single +See-also: + - key-type + - cert +Example: + - --cert certificate --key here $URL +--- + +# `--key` + +Private key filename. Allows you to provide your private key in this separate +file. For SSH, if not specified, curl tries the following candidates in order: +`~/.ssh/id_rsa`, `~/.ssh/id_dsa`, `./id_rsa`, `./id_dsa`. + +If curl is built against OpenSSL library, and the engine pkcs11 or pkcs11 +provider is available, then a PKCS#11 URI (RFC 7512) can be used to specify a +private key located in a PKCS#11 device. A string beginning with `pkcs11:` is +interpreted as a PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine +option is set as `pkcs11` if none was provided and the --key-type option is +set as `ENG` or `PROV` if none was provided (depending on OpenSSL version). + +If curl is built against Schannel then this option is ignored for TLS +protocols (HTTPS, etc). That backend expects the private key to be already +present in the keychain or PKCS#12 file containing the certificate. diff --git a/curl/docs/cmdline-opts/krb.md b/curl/docs/cmdline-opts/krb.md new file mode 100644 index 000000000..c353a0c74 --- /dev/null +++ b/curl/docs/cmdline-opts/krb.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: krb +Arg: +Help: Enable Kerberos with security +Protocols: FTP +Requires: Kerberos +Category: ftp +Added: 7.3 +Multi: single +See-also: + - delegation + - ssl +Example: + - --krb clear ftp://example.com/ +--- + +# `--krb` + +Enable Kerberos authentication and use. The level must be entered and should +be one of 'clear', 'safe', 'confidential', or 'private'. Should you use a +level that is not one of these, 'private' is used. diff --git a/curl/docs/cmdline-opts/libcurl.md b/curl/docs/cmdline-opts/libcurl.md new file mode 100644 index 000000000..e37e5aa0f --- /dev/null +++ b/curl/docs/cmdline-opts/libcurl.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: libcurl +Arg: +Help: Generate libcurl code for this command line +Added: 7.16.1 +Category: curl global +Multi: single +Scope: global +See-also: + - verbose +Example: + - --libcurl client.c $URL +--- + +# `--libcurl` + +Append this option to any ordinary curl command line, and you get +libcurl-using C source code written to the file that does the equivalent of +what your command-line operation does. diff --git a/curl/docs/cmdline-opts/limit-rate.md b/curl/docs/cmdline-opts/limit-rate.md new file mode 100644 index 000000000..c5e276e1b --- /dev/null +++ b/curl/docs/cmdline-opts/limit-rate.md @@ -0,0 +1,37 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: limit-rate +Arg: +Help: Limit transfer speed to RATE +Category: connection +Added: 7.10 +Multi: single +See-also: + - rate + - speed-limit + - speed-time +Example: + - --limit-rate 100K $URL + - --limit-rate 1000 $URL + - --limit-rate 10M $URL +--- + +# `--limit-rate` + +Specify the maximum transfer rate you want curl to use - for both downloads +and uploads. This feature is useful if you have a limited pipe and you would +like your transfer not to use your entire bandwidth. To make it slower than it +otherwise would be. + +The given speed is measured in bytes/second, unless a suffix is appended. +Appending 'k' or 'K' counts the number as kilobytes, 'm' or 'M' makes it +megabytes, while 'g' or 'G' makes it gigabytes. The suffixes (k, M, G, T, P) +are 1024 based. For example 1k is 1024. Examples: 200K, 3m and 1G. + +The rate limiting logic works on averaging the transfer speed to no more than +the set threshold over a period of multiple seconds. + +If you also use the --speed-limit option, that option takes precedence and +might cripple the rate-limiting slightly, to help keep the speed-limit +logic working. diff --git a/curl/docs/cmdline-opts/list-only.md b/curl/docs/cmdline-opts/list-only.md new file mode 100644 index 000000000..2800a8f79 --- /dev/null +++ b/curl/docs/cmdline-opts/list-only.md @@ -0,0 +1,43 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: list-only +Short: l +Protocols: FTP POP3 SFTP FILE +Help: List only mode +Added: 4.0 +Category: ftp pop3 sftp file +Multi: boolean +See-also: + - quote + - request +Example: + - --list-only ftp://example.com/dir/ +--- + +# `--list-only` + +When listing an FTP directory, force a name-only view. Maybe particularly +useful if the user wants to machine-parse the contents of an FTP directory +since the normal directory view does not use a standard look or format. When +used like this, the option causes an NLST command to be sent to the server +instead of LIST. + +Note: Some FTP servers list only files in their response to NLST; they do not +include sub-directories and symbolic links. + +When listing an SFTP directory, this switch forces a name-only view, one per +line. This is especially useful if the user wants to machine-parse the +contents of an SFTP directory since the normal directory view provides more +information than just filenames. + +When retrieving a specific email from POP3, this switch forces a LIST command +to be performed instead of RETR. This is particularly useful if the user wants +to see if a specific message-id exists on the server and what size it is. + +For FILE, this option has no effect yet as directories are always listed in +this mode. + +Note: When combined with --request, this option can be used to send a UIDL +command instead, so the user may use the email's unique identifier rather than +its message-id to make the request. diff --git a/curl/docs/cmdline-opts/local-port.md b/curl/docs/cmdline-opts/local-port.md new file mode 100644 index 000000000..b8c0d3fda --- /dev/null +++ b/curl/docs/cmdline-opts/local-port.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: local-port +Arg: +Help: Use a local port number within RANGE +Added: 7.15.2 +Category: connection +Multi: single +See-also: + - globoff +Example: + - --local-port 1000-3000 $URL +--- + +# `--local-port` + +Set a preferred single number or range (FROM-TO) of local port numbers to use +for the connection(s). Note that port numbers by nature are a scarce resource +so setting this range to something too narrow might cause unnecessary +connection setup failures. diff --git a/curl/docs/cmdline-opts/location-trusted.md b/curl/docs/cmdline-opts/location-trusted.md new file mode 100644 index 000000000..5e20d8cc1 --- /dev/null +++ b/curl/docs/cmdline-opts/location-trusted.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: location-trusted +Help: As --location, but send secrets to other hosts +Protocols: HTTP +Category: http auth +Added: 7.10.4 +Multi: boolean +See-also: + - user +Example: + - --location-trusted -u user:password $URL + - --location-trusted -H "Cookie: session=abc" $URL +--- + +# `--location-trusted` + +Instruct curl to follow HTTP redirects like --location, but permit curl to +send credentials and other secrets along to other hosts than the initial one. + +This may or may not introduce a security breach if the site redirects you to a +site to which you send this sensitive data to. Another host means that one or +more of hostname, protocol scheme or port number changed. + +This option also allows curl to pass long cookies set explicitly with --header. diff --git a/curl/docs/cmdline-opts/location.md b/curl/docs/cmdline-opts/location.md new file mode 100644 index 000000000..8d17e45e2 --- /dev/null +++ b/curl/docs/cmdline-opts/location.md @@ -0,0 +1,41 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: location +Short: L +Help: Follow redirects +Protocols: HTTP +Category: http +Added: 4.9 +Multi: boolean +See-also: + - resolve + - alt-svc +Example: + - -L $URL +--- + +# `--location` + +If the server reports that the requested page has moved to a different +location (indicated with a Location: header and a 3XX response code), this +option makes curl redo the request to the new place. If used together with +--show-headers or --head, headers from all requested pages are shown. + +When authentication is used, or when sending a cookie with `-H Cookie:`, curl +only sends its credentials to the initial host. If a redirect takes curl to a +different host, it does not get the credentials passed on. See +--location-trusted on how to change this. + +Limit the amount of redirects to follow by using the --max-redirs option. + +When curl follows a redirect and if the request is a POST, it sends the +following request with a GET if the HTTP response was 301, 302, or 303. If the +response code was any other 3xx code, curl resends the following request using +the same unmodified method. + +You can tell curl to not change POST requests to GET after a 30x response by +using the dedicated options for that: --post301, --post302 and --post303. + +The method set with --request overrides the method curl would otherwise select +to use. diff --git a/curl/docs/cmdline-opts/login-options.md b/curl/docs/cmdline-opts/login-options.md new file mode 100644 index 000000000..fc8292a2b --- /dev/null +++ b/curl/docs/cmdline-opts/login-options.md @@ -0,0 +1,32 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: login-options +Arg: +Protocols: IMAP LDAP POP3 SMTP +Help: Server login options +Added: 7.34.0 +Category: imap pop3 smtp auth ldap +Multi: single +See-also: + - user +Example: + - --login-options 'AUTH=*' imap://example.com +--- + +# `--login-options` + +Specify the login options to use during server authentication. + +You can use login options to specify protocol specific options that may be +used during authentication. At present only IMAP, POP3 and SMTP support login +options. For more information about login options please see RFC 2384, +RFC 5092 and the IETF draft +https://datatracker.ietf.org/doc/html/draft-earhart-url-smtp-00 + +Since 8.2.0, IMAP supports the login option `AUTH=+LOGIN`. With this option, +curl uses the plain (not SASL) `LOGIN IMAP` command even if the server +advertises SASL authentication. Care should be taken in using this option, as +it sends your password over the network in plain text. This does not work if +the IMAP server disables the plain `LOGIN` (e.g. to prevent password +snooping). diff --git a/curl/docs/cmdline-opts/mail-auth.md b/curl/docs/cmdline-opts/mail-auth.md new file mode 100644 index 000000000..deabb38b9 --- /dev/null +++ b/curl/docs/cmdline-opts/mail-auth.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: mail-auth +Arg:
+Protocols: SMTP +Help: Originator address of the original email +Added: 7.25.0 +Category: smtp +Multi: single +See-also: + - mail-rcpt + - mail-from +Example: + - --mail-auth user@example.com -T mail smtp://example.com/ +--- + +# `--mail-auth` + +Specify a single address. This is used to specify the authentication address +(identity) of a submitted message that is being relayed to another server. diff --git a/curl/docs/cmdline-opts/mail-from.md b/curl/docs/cmdline-opts/mail-from.md new file mode 100644 index 000000000..96b062501 --- /dev/null +++ b/curl/docs/cmdline-opts/mail-from.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: mail-from +Arg:
+Help: Mail from this address +Protocols: SMTP +Added: 7.20.0 +Category: smtp +Multi: single +See-also: + - mail-rcpt + - mail-auth +Example: + - --mail-from user@example.com -T mail smtp://example.com/ +--- + +# `--mail-from` + +Specify a single address that the given mail should get sent from. diff --git a/curl/docs/cmdline-opts/mail-rcpt-allowfails.md b/curl/docs/cmdline-opts/mail-rcpt-allowfails.md new file mode 100644 index 000000000..a82948bbc --- /dev/null +++ b/curl/docs/cmdline-opts/mail-rcpt-allowfails.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: mail-rcpt-allowfails +Help: Allow RCPT TO command to fail +Protocols: SMTP +Added: 7.69.0 +Category: smtp +Multi: boolean +See-also: + - mail-rcpt +Example: + - --mail-rcpt-allowfails --mail-rcpt dest@example.com smtp://example.com +--- + +# `--mail-rcpt-allowfails` + +When sending data to multiple recipients, by default curl aborts SMTP +conversation if at least one of the recipients causes RCPT TO command to +return an error. + +The default behavior can be changed by passing --mail-rcpt-allowfails +command-line option which makes curl ignore errors and proceed with the +remaining valid recipients. + +If all recipients trigger RCPT TO failures and this flag is specified, curl +still aborts the SMTP conversation and returns the error received from to the +last RCPT TO command. diff --git a/curl/docs/cmdline-opts/mail-rcpt.md b/curl/docs/cmdline-opts/mail-rcpt.md new file mode 100644 index 000000000..bd787c2fa --- /dev/null +++ b/curl/docs/cmdline-opts/mail-rcpt.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: mail-rcpt +Arg:
+Help: Mail to this address +Protocols: SMTP +Added: 7.20.0 +Category: smtp +Multi: append +See-also: + - mail-rcpt-allowfails +Example: + - --mail-rcpt user@example.net smtp://example.com +--- + +# `--mail-rcpt` + +Specify a single email address, username or mailing list name. Repeat this +option several times to send to multiple recipients. + +When performing an address verification (**VRFY** command), the recipient +should be specified as the username or username and domain (as per Section 3.5 +of RFC 5321). (Added in 7.34.0) + +When performing a mailing list expand (EXPN command), the recipient should be +specified using the mailing list name, such as "Friends" or "London-Office". +(Added in 7.34.0) diff --git a/curl/docs/cmdline-opts/mainpage.idx b/curl/docs/cmdline-opts/mainpage.idx new file mode 100644 index 000000000..8496ee46d --- /dev/null +++ b/curl/docs/cmdline-opts/mainpage.idx @@ -0,0 +1,43 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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 +# +########################################################################### +_NAME.md +_SYNOPSIS.md +_DESCRIPTION.md +_URL.md +_GLOBBING.md +_VARIABLES.md +_OUTPUT.md +_PROTOCOLS.md +_PROGRESS.md +_VERSION.md +_OPTIONS.md +%options +_FILES.md +_ENVIRONMENT.md +_PROXYPREFIX.md +_EXITCODES.md +_BUGS.md +_AUTHORS.md +_WWW.md +_SEEALSO.md diff --git a/curl/docs/cmdline-opts/manual.md b/curl/docs/cmdline-opts/manual.md new file mode 100644 index 000000000..bf44f3b8a --- /dev/null +++ b/curl/docs/cmdline-opts/manual.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: manual +Short: M +Help: Display the full manual +Category: curl +Added: 5.2 +Multi: custom +See-also: + - verbose + - libcurl + - trace +Example: + - --manual +--- + +# `--manual` + +Manual. Display the huge help text. diff --git a/curl/docs/cmdline-opts/max-filesize.md b/curl/docs/cmdline-opts/max-filesize.md new file mode 100644 index 000000000..cf2ac6537 --- /dev/null +++ b/curl/docs/cmdline-opts/max-filesize.md @@ -0,0 +1,34 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: max-filesize +Arg: +Help: Maximum file size to download +Protocols: FTP HTTP MQTT +Category: connection +Added: 7.10.8 +Multi: single +See-also: + - limit-rate +Example: + - --max-filesize 100K $URL +--- + +# `--max-filesize` + +When set to a non-zero value, it specifies the maximum size (in bytes) of a +file to download. If the file requested is larger than this value, the +transfer does not start and curl returns with exit code 63. + +Setting the maximum value to zero disables the limit. + +A size modifier may be used. For example, Appending 'k' or 'K' counts the +number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it +gigabytes. Examples: 200K, 3m and 1G. (Added in 7.58.0) + +**NOTE**: before curl 8.4.0, when the file size is not known prior to +download, for such files this option has no effect even if the file transfer +ends up being larger than this given limit. + +Starting with curl 8.4.0, this option aborts the transfer if it reaches the +threshold during transfer. diff --git a/curl/docs/cmdline-opts/max-redirs.md b/curl/docs/cmdline-opts/max-redirs.md new file mode 100644 index 000000000..7c9f193d2 --- /dev/null +++ b/curl/docs/cmdline-opts/max-redirs.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: max-redirs +Arg: +Help: Maximum number of redirects allowed +Protocols: HTTP +Category: http +Added: 7.5 +Multi: single +See-also: + - location +Example: + - --max-redirs 3 --location $URL +--- + +# `--max-redirs` + +Set the maximum number of redirections to follow. When --location is used, to +prevent curl from following too many redirects, by default, the limit is +set to 50 redirects. Set this option to -1 to make it unlimited. diff --git a/curl/docs/cmdline-opts/max-time.md b/curl/docs/cmdline-opts/max-time.md new file mode 100644 index 000000000..2475dd198 --- /dev/null +++ b/curl/docs/cmdline-opts/max-time.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: max-time +Short: m +Arg: +Help: Maximum time allowed for transfer +Category: connection timeout +Added: 4.0 +Multi: single +See-also: + - connect-timeout + - retry-max-time +Example: + - --max-time 10 $URL + - --max-time 2.92 $URL +--- + +# `--max-time` + +Set the maximum time in seconds that you allow each transfer to take. Prevents +your batch jobs from hanging for hours due to slow networks or links going +down. This option accepts decimal values (added in 7.32.0). + +If you enable retrying the transfer (--retry) then the maximum time counter is +reset each time the transfer is retried. You can use --retry-max-time to limit +the retry time. + +The decimal value needs to be provided using a dot (.) as decimal separator - +not the local version even if it might be using another separator. diff --git a/curl/docs/cmdline-opts/metalink.md b/curl/docs/cmdline-opts/metalink.md new file mode 100644 index 000000000..d3d3e2574 --- /dev/null +++ b/curl/docs/cmdline-opts/metalink.md @@ -0,0 +1,18 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: metalink +Help: Process given URLs as metalink XML file +Added: 7.27.0 +Category: deprecated +Multi: single +See-also: + - parallel +Example: + - --metalink file $URL +--- + +# `--metalink` + +This option was previously used to specify a Metalink resource. Metalink +support is disabled in curl for security reasons (added in 7.78.0). diff --git a/curl/docs/cmdline-opts/mptcp.md b/curl/docs/cmdline-opts/mptcp.md new file mode 100644 index 000000000..4a1bb65c0 --- /dev/null +++ b/curl/docs/cmdline-opts/mptcp.md @@ -0,0 +1,31 @@ +--- +c: Copyright (C) Dorian Craps, +SPDX-License-Identifier: curl +Long: mptcp +Added: 8.9.0 +Help: Enable Multipath TCP +Category: connection +Multi: boolean +See-also: + - tcp-fastopen +Example: + - --mptcp $URL +--- + +# `--mptcp` + +Enable the use of Multipath TCP (MPTCP) for connections. MPTCP is an extension +to the standard TCP that allows multiple TCP streams over different network +paths between the same source and destination. This can enhance bandwidth and +improve reliability by using multiple paths simultaneously. + +MPTCP is beneficial in networks where multiple paths exist between clients and +servers, such as mobile networks where a device may switch between WiFi and +cellular data or in wired networks with multiple Internet Service Providers. + +This option is currently only supported on Linux starting from kernel 5.6. Only +TCP connections are modified, hence this option does not affect HTTP/3 (QUIC) +or UDP connections. + +The server curl connects to must also support MPTCP. If not, the connection +seamlessly falls back to TCP. diff --git a/curl/docs/cmdline-opts/negotiate.md b/curl/docs/cmdline-opts/negotiate.md new file mode 100644 index 000000000..bba3f6a08 --- /dev/null +++ b/curl/docs/cmdline-opts/negotiate.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: negotiate +Help: Use HTTP Negotiate (SPNEGO) authentication +Protocols: HTTP +Category: auth http +Added: 7.10.6 +Multi: mutex +See-also: + - basic + - ntlm + - anyauth + - proxy-negotiate +Example: + - --negotiate -u : $URL +--- + +# `--negotiate` + +Enable Negotiate (SPNEGO) authentication. + +This option requires a library built with GSS-API or SSPI support. Use +--version to see if your curl supports GSS-API/SSPI or SPNEGO. + +When using this option, you must also provide a fake --user option to activate +the authentication code properly. Sending a '-u :' is enough as the username +and password from the --user option are not actually used. diff --git a/curl/docs/cmdline-opts/netrc-file.md b/curl/docs/cmdline-opts/netrc-file.md new file mode 100644 index 000000000..3df72ce14 --- /dev/null +++ b/curl/docs/cmdline-opts/netrc-file.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: netrc-file +Help: Specify FILE for netrc +Arg: +Added: 7.21.5 +Mutexed: netrc +Category: auth +Multi: single +See-also: + - netrc + - user + - config +Example: + - --netrc-file netrc $URL +--- + +# `--netrc-file` + +Set the netrc file to use. Similar to --netrc, except that you also provide +the path (absolute or relative). + +It abides by --netrc-optional if specified. diff --git a/curl/docs/cmdline-opts/netrc-optional.md b/curl/docs/cmdline-opts/netrc-optional.md new file mode 100644 index 000000000..9b9c068c8 --- /dev/null +++ b/curl/docs/cmdline-opts/netrc-optional.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: netrc-optional +Help: Use either .netrc or URL +Mutexed: netrc +Category: auth +Added: 7.9.8 +Multi: boolean +See-also: + - netrc-file +Example: + - --netrc-optional $URL +--- + +# `--netrc-optional` + +Similar to --netrc, but this option makes the .netrc usage **optional** +and not mandatory as the --netrc option does. diff --git a/curl/docs/cmdline-opts/netrc.md b/curl/docs/cmdline-opts/netrc.md new file mode 100644 index 000000000..261dc196d --- /dev/null +++ b/curl/docs/cmdline-opts/netrc.md @@ -0,0 +1,41 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: netrc +Short: n +Help: Must read .netrc for username and password +Category: auth +Added: 4.6 +Mutexed: netrc-file netrc-optional +Multi: boolean +See-also: + - netrc-file + - config + - user +Example: + - --netrc $URL +--- + +# `--netrc` + +Make curl scan the *.netrc* file in the user's home directory for login name +and password. This is typically used for FTP on Unix. If used with HTTP, curl +enables user authentication. See *netrc(5)* and *ftp(1)* for details on the +file format. curl does not complain if that file does not have the right +permissions (it should be neither world- nor group-readable). The environment +variable "HOME" is used to find the home directory. + +The netrc file provides credentials for a hostname independent of which +protocol and port number that are used. + +On Windows two filenames in the home directory are checked: *.netrc* and +*_netrc*, preferring the former. Older versions on Windows checked for *_netrc* +only. + +A quick and simple example of how to setup a *.netrc* to allow curl to FTP to +the machine host.example.com with username 'myself' and password 'secret' could +look similar to: + + machine host.example.com + login myself + password secret diff --git a/curl/docs/cmdline-opts/next.md b/curl/docs/cmdline-opts/next.md new file mode 100644 index 000000000..cb67e907f --- /dev/null +++ b/curl/docs/cmdline-opts/next.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: : +Long: next +Tags: +Protocols: +Added: 7.36.0 +Magic: divider +Help: Make next URL use separate options +Category: curl +Multi: append +See-also: + - parallel + - config +Example: + - $URL --next -d postthis www2.example.com + - -I $URL --next https://example.net/ +--- + +# `--next` + +Use a separate operation for the following URL and associated options. This +allows you to send several URL requests, each with their own specific options, +for example, such as different usernames or custom requests for each. + +--next resets all local options and only global ones have their values survive +over to the operation following the --next instruction. Global options include +--verbose, --trace, --trace-ascii and --fail-early. + +For example, you can do both a GET and a POST in a single command line: + + curl www1.example.com --next -d postthis www2.example.com diff --git a/curl/docs/cmdline-opts/no-alpn.md b/curl/docs/cmdline-opts/no-alpn.md new file mode 100644 index 000000000..475294878 --- /dev/null +++ b/curl/docs/cmdline-opts/no-alpn.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: no-alpn +Tags: HTTP/2 +Protocols: HTTPS +Added: 7.36.0 +Requires: TLS +Help: Disable the ALPN TLS extension +Category: tls http +Multi: boolean +See-also: + - no-npn + - http2 +Example: + - --no-alpn $URL +--- + +# `--no-alpn` + +Disable the ALPN TLS extension. ALPN is enabled by default if libcurl was built +with an SSL library that supports ALPN. ALPN is used by a libcurl that supports +HTTP/2 to negotiate HTTP/2 support with the server during https sessions. + +Note that this is the negated option name documented. You can use --alpn to +enable ALPN. diff --git a/curl/docs/cmdline-opts/no-buffer.md b/curl/docs/cmdline-opts/no-buffer.md new file mode 100644 index 000000000..442beb0b3 --- /dev/null +++ b/curl/docs/cmdline-opts/no-buffer.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: no-buffer +Short: N +Help: Disable buffering of the output stream +Category: output +Added: 6.5 +Multi: boolean +See-also: + - progress-bar +Example: + - --no-buffer $URL +--- + +# `--no-buffer` + +Disable the buffering of the output stream. In normal work situations, curl +uses a standard buffered output stream that has the effect that it outputs the +data in chunks, not necessarily exactly when the data arrives. Using this +option disables that buffering. + +Note that this is the negated option name documented. You can use --buffer to +enable buffering again. diff --git a/curl/docs/cmdline-opts/no-clobber.md b/curl/docs/cmdline-opts/no-clobber.md new file mode 100644 index 000000000..02a74b25e --- /dev/null +++ b/curl/docs/cmdline-opts/no-clobber.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: no-clobber +Help: Do not overwrite files that already exist +Category: output +Added: 7.83.0 +Multi: boolean +See-also: + - output + - remote-name +Example: + - --no-clobber --output local/dir/file $URL +--- + +# `--no-clobber` + +When used in conjunction with the --output, --remote-header-name, +--remote-name, or --remote-name-all options, curl avoids overwriting files +that already exist. Instead, a dot and a number gets appended to the name of +the file that would be created, up to filename.100 after which it does not +create any file. + +Note that this is the negated option name documented. You can thus use +--clobber to enforce the clobbering, even if --remote-header-name is +specified. + +The --continue-at option cannot be used together with --no-clobber. diff --git a/curl/docs/cmdline-opts/no-keepalive.md b/curl/docs/cmdline-opts/no-keepalive.md new file mode 100644 index 000000000..99dd0329d --- /dev/null +++ b/curl/docs/cmdline-opts/no-keepalive.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: no-keepalive +Help: Disable TCP keepalive on the connection +Category: connection +Added: 7.18.0 +Multi: boolean +See-also: + - keepalive-time + - keepalive-cnt +Example: + - --no-keepalive $URL +--- + +# `--no-keepalive` + +Disable the use of keepalive messages on the TCP connection. curl otherwise +enables them by default. + +Note that this is the negated option name documented. You can thus use +--keepalive to enforce keepalive. diff --git a/curl/docs/cmdline-opts/no-npn.md b/curl/docs/cmdline-opts/no-npn.md new file mode 100644 index 000000000..dbb69e91b --- /dev/null +++ b/curl/docs/cmdline-opts/no-npn.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: no-npn +Tags: Versions HTTP/2 +Protocols: HTTPS +Added: 7.36.0 +Mutexed: +Requires: TLS +Help: Disable the NPN TLS extension +Category: deprecated +Multi: boolean +See-also: + - no-alpn + - http2 +Example: + - --no-npn $URL +--- + +# `--no-npn` + +curl never uses NPN, this option has no effect (added in 7.86.0). + +Disable the NPN TLS extension. NPN is enabled by default if libcurl was built +with an SSL library that supports NPN. NPN is used by a libcurl that supports +HTTP/2 to negotiate HTTP/2 support with the server during https sessions. diff --git a/curl/docs/cmdline-opts/no-progress-meter.md b/curl/docs/cmdline-opts/no-progress-meter.md new file mode 100644 index 000000000..72ec99376 --- /dev/null +++ b/curl/docs/cmdline-opts/no-progress-meter.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: no-progress-meter +Help: Do not show the progress meter +Added: 7.67.0 +Category: verbose +Multi: boolean +See-also: + - verbose + - silent +Example: + - --no-progress-meter -o store $URL +--- + +# `--no-progress-meter` + +Option to switch off the progress meter output without muting or otherwise +affecting warning and informational messages like --silent does. + +Note that this is the negated option name documented. You can thus use +--progress-meter to enable the progress meter again. diff --git a/curl/docs/cmdline-opts/no-sessionid.md b/curl/docs/cmdline-opts/no-sessionid.md new file mode 100644 index 000000000..08ba990be --- /dev/null +++ b/curl/docs/cmdline-opts/no-sessionid.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: no-sessionid +Help: Disable SSL session-ID reusing +Protocols: TLS +Added: 7.16.0 +Category: tls +Multi: boolean +See-also: + - insecure +Example: + - --no-sessionid $URL +--- + +# `--no-sessionid` + +Disable curl's use of SSL session-ID caching. By default all transfers are +done using the cache. Note that while nothing should ever get hurt by +attempting to reuse SSL session-IDs, there seem to be broken SSL +implementations in the wild that may require you to disable this in order for +you to succeed. + +Note that this is the negated option name documented. You can thus use +--sessionid to enforce session-ID caching. diff --git a/curl/docs/cmdline-opts/noproxy.md b/curl/docs/cmdline-opts/noproxy.md new file mode 100644 index 000000000..698549e15 --- /dev/null +++ b/curl/docs/cmdline-opts/noproxy.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: noproxy +Arg: +Help: List of hosts which do not use proxy +Added: 7.19.4 +Category: proxy +Multi: single +See-also: + - proxy +Example: + - --noproxy "www.example" $URL +--- + +# `--noproxy` + +Comma-separated list of hosts for which not to use a proxy, if one is +specified. The only wildcard is a single `*` character, which matches all +hosts, and effectively disables the proxy. Each name in this list is matched +as either a domain which contains the hostname, or the hostname itself. For +example, `local.com` would match `local.com`, `local.com:80`, and +`www.local.com`, but not `www.notlocal.com`. + +This option overrides the environment variables that disable the proxy +(`no_proxy` and `NO_PROXY`) (added in 7.53.0). If there is an environment +variable disabling a proxy, you can set the no proxy list to "" to override +it. + +IP addresses specified to this option can be provided using CIDR notation +(added in 7.86.0): an appended slash and number specifies the number of +network bits out of the address to use in the comparison. For example +`192.168.0.0/16` would match all addresses starting with `192.168`. diff --git a/curl/docs/cmdline-opts/ntlm-wb.md b/curl/docs/cmdline-opts/ntlm-wb.md new file mode 100644 index 000000000..3a1d35cb1 --- /dev/null +++ b/curl/docs/cmdline-opts/ntlm-wb.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ntlm-wb +Help: HTTP NTLM authentication with winbind +Protocols: HTTP +Category: deprecated +Added: 7.22.0 +Multi: mutex +See-also: + - ntlm + - proxy-ntlm +Example: + - --ntlm-wb -u user:password $URL +--- + +# `--ntlm-wb` + +Deprecated option (added in 8.8.0). + +Enabled NTLM much in the style --ntlm does, but handed over the authentication +to a separate executable that was executed when needed. diff --git a/curl/docs/cmdline-opts/ntlm.md b/curl/docs/cmdline-opts/ntlm.md new file mode 100644 index 000000000..b37716bca --- /dev/null +++ b/curl/docs/cmdline-opts/ntlm.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ntlm +Help: HTTP NTLM authentication +Mutexed: basic negotiate digest anyauth +Protocols: HTTP +Requires: TLS +Category: auth http +Added: 7.10.6 +Multi: mutex +See-also: + - proxy-ntlm +Example: + - --ntlm -u user:password $URL +--- + +# `--ntlm` + +Use NTLM authentication. The NTLM authentication method was designed by +Microsoft and is used by IIS web servers. It is a proprietary protocol, +reverse-engineered by clever people and implemented in curl based on their +efforts. This kind of behavior should not be endorsed, you should encourage +everyone who uses NTLM to switch to a public and documented authentication +method instead, such as Digest. + +If you want to enable NTLM for your proxy authentication, then use +--proxy-ntlm. diff --git a/curl/docs/cmdline-opts/oauth2-bearer.md b/curl/docs/cmdline-opts/oauth2-bearer.md new file mode 100644 index 000000000..b66477fc7 --- /dev/null +++ b/curl/docs/cmdline-opts/oauth2-bearer.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: oauth2-bearer +Help: OAuth 2 Bearer Token +Arg: +Protocols: IMAP LDAP POP3 SMTP HTTP +Category: auth imap pop3 smtp ldap +Added: 7.33.0 +Multi: single +See-also: + - basic + - ntlm + - digest +Example: + - --oauth2-bearer "mF_9.B5f-4.1JqM" $URL +--- + +# `--oauth2-bearer` + +Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token +is used in conjunction with the username which can be specified as part of the +--url or --user options. + +The Bearer Token and username are formatted according to RFC 6750. diff --git a/curl/docs/cmdline-opts/output-dir.md b/curl/docs/cmdline-opts/output-dir.md new file mode 100644 index 000000000..468ecc8a1 --- /dev/null +++ b/curl/docs/cmdline-opts/output-dir.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: output-dir +Arg: +Help: Directory to save files in +Added: 7.73.0 +Category: output +Multi: single +See-also: + - remote-name + - remote-header-name +Example: + - --output-dir "tmp" -O $URL +--- + +# `--output-dir` + +Specify the directory in which files should be stored, when --remote-name or +--output are used. + +The given output directory is used for all URLs and output options on the +command line, up until the first --next. + +If the specified target directory does not exist, the operation fails unless +--create-dirs is also used. diff --git a/curl/docs/cmdline-opts/output.md b/curl/docs/cmdline-opts/output.md new file mode 100644 index 000000000..48360a498 --- /dev/null +++ b/curl/docs/cmdline-opts/output.md @@ -0,0 +1,62 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: output +Arg: +Short: o +Help: Write to file instead of stdout +Category: important output +Added: 4.0 +Multi: per-URL +See-also: + - remote-name + - remote-name-all + - remote-header-name +Example: + - -o file $URL + - "http://{one,two}.example.com" -o "file_#1.txt" + - "http://{site,host}.host[1-5].example" -o "#1_#2" + - -o file $URL -o file2 https://example.net +--- + +# `--output` + +Write output to the given file instead of stdout. If you are using globbing to +fetch multiple documents, you should quote the URL and you can use `#` +followed by a number in the filename. That variable is then replaced with the +current string for the URL being fetched. Like in: + + curl "http://{one,two}.example.com" -o "file_#1.txt" + +or use several variables like: + + curl "http://{site,host}.host[1-5].example" -o "#1_#2" + +You may use this option as many times as the number of URLs you have. For +example, if you specify two URLs on the same command line, you can use it like +this: + + curl -o aa example.com -o bb example.net + +and the order of the -o options and the URLs does not matter, just that the +first -o is for the first URL and so on, so the above command line can also be +written as + + curl example.com example.net -o aa -o bb + +See also the --create-dirs option to create the local directories +dynamically. Specifying the output as '-' (a single dash) passes the output to +stdout. + +To suppress response bodies, you can redirect output to /dev/null: + + curl example.com -o /dev/null + +Or for Windows: + + curl example.com -o nul + +Specify the filename as single minus to force the output to stdout, to +override curl's internal binary output in terminal prevention: + + curl https://example.com/jpeg -o - diff --git a/curl/docs/cmdline-opts/page-footer b/curl/docs/cmdline-opts/page-footer deleted file mode 100644 index 55aefb23c..000000000 --- a/curl/docs/cmdline-opts/page-footer +++ /dev/null @@ -1,244 +0,0 @@ -.SH FILES -.I ~/.curlrc -.RS -Default config file, see --config for details. -.SH ENVIRONMENT -The environment variables can be specified in lower case or upper case. The -lower case version has precedence. http_proxy is an exception as it is only -available in lower case. - -Using an environment variable to set the proxy has the same effect as using -the --proxy option. - -.IP "http_proxy [protocol://][:port]" -Sets the proxy server to use for HTTP. -.IP "HTTPS_PROXY [protocol://][:port]" -Sets the proxy server to use for HTTPS. -.IP "[url-protocol]_PROXY [protocol://][:port]" -Sets the proxy server to use for [url-protocol], where the protocol is a -protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, -SMTP, LDAP etc. -.IP "ALL_PROXY [protocol://][:port]" -Sets the proxy server to use if no protocol-specific proxy is set. -.IP "NO_PROXY " -list of host names that shouldn't go through any proxy. If set to a asterisk -\&'*' only, it matches all hosts. - -Since 7.53.0, this environment variable disable the proxy even if specify ---proxy option. That is -.B NO_PROXY=direct.example.com curl -x http://proxy.example.com -.B http://direct.example.com -accesses the target URL directly, and -.B NO_PROXY=direct.example.com curl -x http://proxy.example.com -.B http://somewhere.example.com -accesses the target URL through proxy. - -.SH "PROXY PROTOCOL PREFIXES" -Since curl version 7.21.7, the proxy string may be specified with a -protocol:// prefix to specify alternative proxy protocols. - -If no protocol is specified in the proxy string or if the string doesn't match -a supported one, the proxy will be treated as an HTTP proxy. - -The supported proxy protocol prefixes are as follows: -.IP "socks4://" -Makes it the equivalent of --socks4 -.IP "socks4a://" -Makes it the equivalent of --socks4a -.IP "socks5://" -Makes it the equivalent of --socks5 -.IP "socks5h://" -Makes it the equivalent of --socks5-hostname -.SH EXIT CODES -There are a bunch of different error codes and their corresponding error -messages that may appear during bad conditions. At the time of this writing, -the exit codes are: -.IP 1 -Unsupported protocol. This build of curl has no support for this protocol. -.IP 2 -Failed to initialize. -.IP 3 -URL malformed. The syntax was not correct. -.IP 4 -A feature or option that was needed to perform the desired request was not -enabled or was explicitly disabled at build-time. To make curl able to do -this, you probably need another build of libcurl! -.IP 5 -Couldn't resolve proxy. The given proxy host could not be resolved. -.IP 6 -Couldn't resolve host. The given remote host was not resolved. -.IP 7 -Failed to connect to host. -.IP 8 -Weird server reply. The server sent data curl couldn't parse. -.IP 9 -FTP access denied. The server denied login or denied access to the particular -resource or directory you wanted to reach. Most often you tried to change to a -directory that doesn't exist on the server. -.IP 10 -FTP accept failed. While waiting for the server to connect back when an active -FTP session is used, an error code was sent over the control connection or -similar. -.IP 11 -FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request. -.IP 12 -During an active FTP session while waiting for the server to connect back to -curl, the timeout expired. -.IP 13 -FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request. -.IP 14 -FTP weird 227 format. Curl couldn't parse the 227-line the server sent. -.IP 15 -FTP can't get host. Couldn't resolve the host IP we got in the 227-line. -.IP 16 -HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is -somewhat generic and can be one out of several problems, see the error message -for details. -.IP 17 -FTP couldn't set binary. Couldn't change transfer method to binary. -.IP 18 -Partial file. Only a part of the file was transferred. -.IP 19 -FTP couldn't download/access the given file, the RETR (or similar) command -failed. -.IP 21 -FTP quote error. A quote command returned error from the server. -.IP 22 -HTTP page not retrieved. The requested url was not found or returned another -error with the HTTP error code being 400 or above. This return code only -appears if --fail is used. -.IP 23 -Write error. Curl couldn't write data to a local filesystem or similar. -.IP 25 -FTP couldn't STOR file. The server denied the STOR operation, used for FTP -uploading. -.IP 26 -Read error. Various reading problems. -.IP 27 -Out of memory. A memory allocation request failed. -.IP 28 -Operation timeout. The specified time-out period was reached according to the -conditions. -.IP 30 -FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT -command, try doing a transfer using PASV instead! -.IP 31 -FTP couldn't use REST. The REST command failed. This command is used for -resumed FTP transfers. -.IP 33 -HTTP range error. The range "command" didn't work. -.IP 34 -HTTP post error. Internal post-request generation error. -.IP 35 -SSL connect error. The SSL handshaking failed. -.IP 36 -Bad download resume. Couldn't continue an earlier aborted download. -.IP 37 -FILE couldn't read file. Failed to open the file. Permissions? -.IP 38 -LDAP cannot bind. LDAP bind operation failed. -.IP 39 -LDAP search failed. -.IP 41 -Function not found. A required LDAP function was not found. -.IP 42 -Aborted by callback. An application told curl to abort the operation. -.IP 43 -Internal error. A function was called with a bad parameter. -.IP 45 -Interface error. A specified outgoing interface could not be used. -.IP 47 -Too many redirects. When following redirects, curl hit the maximum amount. -.IP 48 -Unknown option specified to libcurl. This indicates that you passed a weird -option to curl that was passed on to libcurl and rejected. Read up in the -manual! -.IP 49 -Malformed telnet option. -.IP 51 -The peer's SSL certificate or SSH MD5 fingerprint was not OK. -.IP 52 -The server didn't reply anything, which here is considered an error. -.IP 53 -SSL crypto engine not found. -.IP 54 -Cannot set SSL crypto engine as default. -.IP 55 -Failed sending network data. -.IP 56 -Failure in receiving network data. -.IP 58 -Problem with the local certificate. -.IP 59 -Couldn't use specified SSL cipher. -.IP 60 -Peer certificate cannot be authenticated with known CA certificates. -.IP 61 -Unrecognized transfer encoding. -.IP 62 -Invalid LDAP URL. -.IP 63 -Maximum file size exceeded. -.IP 64 -Requested FTP SSL level failed. -.IP 65 -Sending the data requires a rewind that failed. -.IP 66 -Failed to initialise SSL Engine. -.IP 67 -The user name, password, or similar was not accepted and curl failed to log in. -.IP 68 -File not found on TFTP server. -.IP 69 -Permission problem on TFTP server. -.IP 70 -Out of disk space on TFTP server. -.IP 71 -Illegal TFTP operation. -.IP 72 -Unknown TFTP transfer ID. -.IP 73 -File already exists (TFTP). -.IP 74 -No such user (TFTP). -.IP 75 -Character conversion failed. -.IP 76 -Character conversion functions required. -.IP 77 -Problem with reading the SSL CA cert (path? access rights?). -.IP 78 -The resource referenced in the URL does not exist. -.IP 79 -An unspecified error occurred during the SSH session. -.IP 80 -Failed to shut down the SSL connection. -.IP 82 -Could not load CRL file, missing or wrong format (added in 7.19.0). -.IP 83 -Issuer check failed (added in 7.19.0). -.IP 84 -The FTP PRET command failed -.IP 85 -RTSP: mismatch of CSeq numbers -.IP 86 -RTSP: mismatch of Session Identifiers -.IP 87 -unable to parse FTP file list -.IP 88 -FTP chunk callback reported error -.IP 89 -No connection available, the session will be queued -.IP 90 -SSL public key does not matched pinned public key -.IP XX -More error codes will appear here in future releases. The existing ones -are meant to never change. -.SH AUTHORS / CONTRIBUTORS -Daniel Stenberg is the main author, but the whole list of contributors is -found in the separate THANKS file. -.SH WWW -https://curl.haxx.se -.SH "SEE ALSO" -.BR ftp (1), -.BR wget (1) diff --git a/curl/docs/cmdline-opts/page-header b/curl/docs/cmdline-opts/page-header deleted file mode 100644 index ee5af1477..000000000 --- a/curl/docs/cmdline-opts/page-header +++ /dev/null @@ -1,141 +0,0 @@ -.\" ************************************************************************** -.\" * _ _ ____ _ -.\" * Project ___| | | | _ \| | -.\" * / __| | | | |_) | | -.\" * | (__| |_| | _ <| |___ -.\" * \___|\___/|_| \_\_____| -.\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , 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.haxx.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. -.\" * -.\" ************************************************************************** -.\" -.\" DO NOT EDIT. Generated by the curl project gen.pl man page generator. -.\" -.TH curl 1 "16 Dec 2016" "Curl 7.52.0" "Curl Manual" -.SH NAME -curl \- transfer a URL -.SH SYNOPSIS -.B curl [options] -.I [URL...] -.SH DESCRIPTION -.B curl -is a tool to transfer data from or to a server, using one of the supported -protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, -LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET -and TFTP). The command is designed to work without user interaction. - -curl offers a busload of useful tricks like proxy support, user -authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer -resume, Metalink, and more. As you will see below, the number of features will -make your head spin! - -curl is powered by libcurl for all transfer-related features. See -\fIlibcurl(3)\fP for details. -.SH URL -The URL syntax is protocol-dependent. You'll find a detailed description in -RFC 3986. - -You can specify multiple URLs or parts of URLs by writing part sets within -braces as in: - - http://site.{one,two,three}.com - -or you can get sequences of alphanumeric series by using [] as in: - - ftp://ftp.example.com/file[1-100].txt - - ftp://ftp.example.com/file[001-100].txt (with leading zeros) - - ftp://ftp.example.com/file[a-z].txt - -Nested sequences are not supported, but you can use several ones next to each -other: - - http://example.com/archive[1996-1999]/vol[1-4]/part{a,b,c}.html - -You can specify any amount of URLs on the command line. They will be fetched -in a sequential manner in the specified order. - -You can specify a step counter for the ranges to get every Nth number or -letter: - - http://example.com/file[1-100:10].txt - - http://example.com/file[a-z:2].txt - -When using [] or {} sequences when invoked from a command line prompt, you -probably have to put the full URL within double quotes to avoid the shell from -interfering with it. This also goes for other characters treated special, like -for example '&', '?' and '*'. - -Provide the IPv6 zone index in the URL with an escaped percentage sign and the -interface name. Like in - - http://[fe80::3%25eth0]/ - -If you specify URL without protocol:// prefix, curl will attempt to guess what -protocol you might want. It will then default to HTTP but try other protocols -based on often-used host name prefixes. For example, for host names starting -with "ftp." curl will assume you want to speak FTP. - -curl will do its best to use what you pass to it as a URL. It is not trying to -validate it as a syntactically correct URL by any means but is instead -\fBvery\fP liberal with what it accepts. - -curl will attempt to re-use connections for multiple file transfers, so that -getting many files from the same server will not do multiple connects / -handshakes. This improves speed. Of course this is only done on files -specified on a single command line and cannot be used between separate curl -invokes. -.SH "PROGRESS METER" -curl normally displays a progress meter during operations, indicating the -amount of transferred data, transfer speeds and estimated time left, etc. The -progress meter displays number of bytes and the speeds are in bytes per -second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024 -bytes. 1M is 1048576 bytes. - -curl displays this data to the terminal by default, so if you invoke curl to -do an operation and it is about to write data to the terminal, it -\fIdisables\fP the progress meter as otherwise it would mess up the output -mixing progress meter and response data. - -If you want a progress meter for HTTP POST or PUT requests, you need to -redirect the response output to a file, using shell redirect (>), --output or -similar. - -It is not the same case for FTP upload as that operation does not spit out -any response data to the terminal. - -If you prefer a progress "bar" instead of the regular meter, --progress-bar is -your friend. You can also disable the progress meter completely with the ---silent option. -.SH OPTIONS -Options start with one or two dashes. Many of the options require an -additional value next to them. - -The short "single-dash" form of the options, -d for example, may be used with -or without a space between it and its value, although a space is a recommended -separator. The long "double-dash" form, --data for example, requires a space -between it and its value. - -Short version options that don't need any additional values can be used -immediately next to each other, like for example you can specify all the -options -O, -L and -v at once as -OLv. - -In general, all boolean options are enabled with --\fBoption\fP and yet again -disabled with --\fBno-\fPoption. That is, you use the exact same option name -but prefix it with "no-". However, in this list we mostly only list and show -the --option version of them. (This concept with --no options was added in -7.19.0. Previously most options were toggled on/off on repeated use of the -same command line option.) diff --git a/curl/docs/cmdline-opts/parallel-immediate.md b/curl/docs/cmdline-opts/parallel-immediate.md new file mode 100644 index 000000000..4d7a3ad51 --- /dev/null +++ b/curl/docs/cmdline-opts/parallel-immediate.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: parallel-immediate +Help: Do not wait for multiplexing +Added: 7.68.0 +Category: connection curl global +Multi: boolean +Scope: global +See-also: + - parallel + - parallel-max +Example: + - --parallel-immediate -Z $URL -o file1 $URL -o file2 +--- + +# `--parallel-immediate` + +When doing parallel transfers, this option instructs curl to prefer opening up +more connections in parallel at once rather than waiting to see if new +transfers can be added as multiplexed streams on another connection. + +By default, without this option set, curl prefers to wait a little and +multiplex new transfers over existing connections. It keeps the number of +connections low at the expense of risking a slightly slower transfer startup. diff --git a/curl/docs/cmdline-opts/parallel-max.md b/curl/docs/cmdline-opts/parallel-max.md new file mode 100644 index 000000000..6b3684b8f --- /dev/null +++ b/curl/docs/cmdline-opts/parallel-max.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: parallel-max +Arg: +Help: Maximum concurrency for parallel transfers +Added: 7.66.0 +Category: connection curl global +Multi: single +Scope: global +See-also: + - parallel +Example: + - --parallel-max 100 -Z $URL ftp://example.com/ +--- + +# `--parallel-max` + +When asked to do parallel transfers, using --parallel, this option controls +the maximum amount of transfers to do simultaneously. + +The default is 50. 300 is the largest supported value. diff --git a/curl/docs/cmdline-opts/parallel.md b/curl/docs/cmdline-opts/parallel.md new file mode 100644 index 000000000..907ab8cb8 --- /dev/null +++ b/curl/docs/cmdline-opts/parallel.md @@ -0,0 +1,32 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: Z +Long: parallel +Help: Perform transfers in parallel +Added: 7.66.0 +Category: connection curl global +Multi: boolean +Scope: global +See-also: + - next + - verbose + - parallel-max + - parallel-immediate +Example: + - --parallel $URL -o file1 $URL -o file2 +--- + +# `--parallel` + +Make curl perform all transfers in parallel as compared to the regular serial +manner. Parallel transfer means that curl runs up to N concurrent transfers +simultaneously and if there are more than N transfers to handle, it starts new +ones when earlier transfers finish. + +With parallel transfers, the progress meter output is different from when +doing serial transfers, as it then displays the transfer status for multiple +transfers in a single line. + +The maximum amount of concurrent transfers is set with --parallel-max and it +defaults to 50. diff --git a/curl/docs/cmdline-opts/pass.md b/curl/docs/cmdline-opts/pass.md new file mode 100644 index 000000000..0527334f2 --- /dev/null +++ b/curl/docs/cmdline-opts/pass.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: pass +Arg: +Help: Passphrase for the private key +Protocols: SSH TLS +Category: ssh tls auth +Added: 7.9.3 +Multi: single +See-also: + - key + - user +Example: + - --pass secret --key file $URL +--- + +# `--pass` + +Passphrase for the private key used for SSH or TLS. diff --git a/curl/docs/cmdline-opts/path-as-is.md b/curl/docs/cmdline-opts/path-as-is.md new file mode 100644 index 000000000..f3a60cff2 --- /dev/null +++ b/curl/docs/cmdline-opts/path-as-is.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: path-as-is +Help: Do not squash .. sequences in URL path +Added: 7.42.0 +Category: curl +Multi: boolean +See-also: + - request-target +Example: + - --path-as-is https://example.com/../../etc/passwd +--- + +# `--path-as-is` + +Do not handle sequences of /../ or /./ in the given URL path. Normally curl +squashes or merges them according to standards but with this option set you +tell it not to do that. diff --git a/curl/docs/cmdline-opts/pinnedpubkey.md b/curl/docs/cmdline-opts/pinnedpubkey.md new file mode 100644 index 000000000..ff7c42b39 --- /dev/null +++ b/curl/docs/cmdline-opts/pinnedpubkey.md @@ -0,0 +1,43 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: pinnedpubkey +Arg: +Help: Public key to verify peer against +Protocols: TLS +Category: tls +Added: 7.39.0 +Multi: single +See-also: + - hostpubsha256 +Example: + - --pinnedpubkey keyfile $URL + - --pinnedpubkey 'sha256//ce118b51897f4452dc' $URL +--- + +# `--pinnedpubkey` + +Use the specified public key file (or hashes) to verify the peer. This can be +a path to a file which contains a single public key in PEM or DER format, or +any number of base64 encoded sha256 hashes preceded by 'sha256//' and +separated by ';'. + +When negotiating a TLS or SSL connection, the server sends a certificate +indicating its identity. A public key is extracted from this certificate and +if it does not exactly match the public key provided to this option, curl +aborts the connection before sending or receiving any data. + +This option is independent of option --insecure. If you use both options +together then the peer is still verified by public key. + +PEM/DER support: + +OpenSSL and GnuTLS (added in 7.39.0), wolfSSL (added in 7.43.0), +mbedTLS (added in 7.47.0), Schannel (added in 7.58.1) + +sha256 support: + +OpenSSL, GnuTLS and wolfSSL (added in 7.44.0), mbedTLS (added in 7.47.0), +Schannel (added in 7.58.1) + +Other SSL backends not supported. diff --git a/curl/docs/cmdline-opts/post301.md b/curl/docs/cmdline-opts/post301.md new file mode 100644 index 000000000..d9506f7df --- /dev/null +++ b/curl/docs/cmdline-opts/post301.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: post301 +Help: Do not switch to GET after a 301 redirect +Protocols: HTTP +Added: 7.17.1 +Category: http post +Multi: boolean +See-also: + - post302 + - post303 + - location +Example: + - --post301 --location -d "data" $URL +--- + +# `--post301` + +Respect RFC 7231/6.4.2 and do not convert POST requests into GET requests when +following a 301 redirect. The non-RFC behavior is ubiquitous in web browsers, +so curl does the conversion by default to maintain consistency. However, a +server may require a POST to remain a POST after such a redirection. This +option is meaningful only when using --location. diff --git a/curl/docs/cmdline-opts/post302.md b/curl/docs/cmdline-opts/post302.md new file mode 100644 index 000000000..9b2c2f658 --- /dev/null +++ b/curl/docs/cmdline-opts/post302.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: post302 +Help: Do not switch to GET after a 302 redirect +Protocols: HTTP +Added: 7.19.1 +Category: http post +Multi: boolean +See-also: + - post301 + - post303 + - location +Example: + - --post302 --location -d "data" $URL +--- + +# `--post302` + +Respect RFC 7231/6.4.3 and do not convert POST requests into GET requests when +following a 302 redirect. The non-RFC behavior is ubiquitous in web browsers, +so curl does the conversion by default to maintain consistency. However, a +server may require a POST to remain a POST after such a redirection. This +option is meaningful only when using --location. diff --git a/curl/docs/cmdline-opts/post303.md b/curl/docs/cmdline-opts/post303.md new file mode 100644 index 000000000..63dc0d795 --- /dev/null +++ b/curl/docs/cmdline-opts/post303.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: post303 +Help: Do not switch to GET after a 303 redirect +Protocols: HTTP +Added: 7.26.0 +Category: http post +Multi: boolean +See-also: + - post302 + - post301 + - location +Example: + - --post303 --location -d "data" $URL +--- + +# `--post303` + +Violate RFC 7231/6.4.4 and do not convert POST requests into GET requests when +following 303 redirect. A server may require a POST to remain a POST after a +303 redirection. This option is meaningful only when using --location. diff --git a/curl/docs/cmdline-opts/preproxy.md b/curl/docs/cmdline-opts/preproxy.md new file mode 100644 index 000000000..87d94a960 --- /dev/null +++ b/curl/docs/cmdline-opts/preproxy.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: preproxy +Arg: <[protocol://]host[:port]> +Help: Use this proxy first +Added: 7.52.0 +Category: proxy +Multi: single +See-also: + - proxy + - socks5 +Example: + - --preproxy socks5://proxy.example -x http://http.example $URL +--- + +# `--preproxy` + +Use the specified SOCKS proxy before connecting to an HTTP or HTTPS --proxy. In +such a case curl first connects to the SOCKS proxy and then connects (through +SOCKS) to the HTTP or HTTPS proxy. Hence pre proxy. + +The pre proxy string should be specified with a protocol:// prefix to specify +alternative proxy protocols. Use socks4://, socks4a://, socks5:// or +socks5h:// to request the specific SOCKS version to be used. No protocol +specified makes curl default to SOCKS4. + +If the port number is not specified in the proxy string, it is assumed to be +1080. + +User and password that might be provided in the proxy string are URL decoded +by curl. This allows you to pass in special characters such as @ by using %40 +or pass in a colon with %3a. diff --git a/curl/docs/cmdline-opts/progress-bar.md b/curl/docs/cmdline-opts/progress-bar.md new file mode 100644 index 000000000..6f08d7f7c --- /dev/null +++ b/curl/docs/cmdline-opts/progress-bar.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: # +Long: progress-bar +Help: Display transfer progress as a bar +Category: verbose global +Added: 5.10 +Multi: boolean +Scope: global +See-also: + - styled-output +Example: + - -# -O $URL +--- + +# `--progress-bar` + +Make curl display transfer progress as a simple progress bar instead of the +standard, more informational, meter. + +This progress bar draws a single line of '#' characters across the screen and +shows a percentage if the transfer size is known. For transfers without a +known size, there is a space ship (-=o=-) that moves back and forth but only +while data is being transferred, with a set of flying hash sign symbols on +top. diff --git a/curl/docs/cmdline-opts/proto-default.md b/curl/docs/cmdline-opts/proto-default.md new file mode 100644 index 000000000..209e5cdc8 --- /dev/null +++ b/curl/docs/cmdline-opts/proto-default.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proto-default +Help: Use PROTOCOL for any URL missing a scheme +Arg: +Added: 7.45.0 +Category: connection curl +Multi: single +See-also: + - proto + - proto-redir +Example: + - --proto-default https ftp.example.com +--- + +# `--proto-default` + +Use *protocol* for any provided URL missing a scheme. + +An unknown or unsupported protocol causes error *CURLE_UNSUPPORTED_PROTOCOL*. + +This option does not change the default proxy protocol (http). + +Without this option set, curl guesses protocol based on the hostname, see +--url for details. diff --git a/curl/docs/cmdline-opts/proto-redir.md b/curl/docs/cmdline-opts/proto-redir.md new file mode 100644 index 000000000..337aa93cb --- /dev/null +++ b/curl/docs/cmdline-opts/proto-redir.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proto-redir +Arg: +Help: Enable/disable PROTOCOLS on redirect +Added: 7.21.0 +Category: connection curl +Multi: single +See-also: + - proto +Example: + - --proto-redir =http,https $URL +--- + +# `--proto-redir` + +Limit what protocols to allow on redirects. Protocols denied by --proto are +not overridden by this option. See --proto for how protocols are represented. + +Example, allow only HTTP and HTTPS on redirect: + + curl --proto-redir -all,http,https http://example.com + +By default curl only allows HTTP, HTTPS, FTP and FTPS on redirects +(added in 7.65.2). Specifying *all* or *+all* enables all protocols on +redirects, which is not good for security. diff --git a/curl/docs/cmdline-opts/proto.md b/curl/docs/cmdline-opts/proto.md new file mode 100644 index 000000000..cf288d456 --- /dev/null +++ b/curl/docs/cmdline-opts/proto.md @@ -0,0 +1,48 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proto +Arg: +Help: Enable/disable PROTOCOLS +Added: 7.21.0 +Category: connection curl +Multi: single +See-also: + - proto-redir + - proto-default +Example: + - --proto =http,https,sftp $URL +--- + +# `--proto` + +Limit what protocols to allow for transfers. Protocols are evaluated left to +right, are comma separated, and are each a protocol name or 'all', optionally +prefixed by zero or more modifiers. Available modifiers are: + +## + +Permit this protocol in addition to protocols already permitted (this is +the default if no modifier is used). + +## - +Deny this protocol, removing it from the list of protocols already permitted. + +## = +Permit only this protocol (ignoring the list already permitted), though +subject to later modification by subsequent entries in the comma separated +list. + +## + +For example: --proto -ftps uses the default protocols, but disables ftps + +--proto -all,https,+http only enables http and https + +--proto =http,https also only enables http and https + +Unknown and disabled protocols produce a warning. This allows scripts to +safely rely on being able to disable potentially dangerous protocols, without +relying upon support for that protocol being built into curl to avoid an error. + +This option can be used multiple times, in which case the effect is the same +as concatenating the protocols into one instance of the option. diff --git a/curl/docs/cmdline-opts/proxy-anyauth.md b/curl/docs/cmdline-opts/proxy-anyauth.md new file mode 100644 index 000000000..78e67ee7c --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-anyauth.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-anyauth +Help: Pick any proxy authentication method +Added: 7.13.2 +Category: proxy auth +Multi: mutex +See-also: + - proxy + - proxy-basic + - proxy-digest +Example: + - --proxy-anyauth --proxy-user user:passwd -x proxy $URL +--- + +# `--proxy-anyauth` + +Automatically pick a suitable authentication method when communicating with +the given HTTP proxy. This might cause an extra request/response round-trip. diff --git a/curl/docs/cmdline-opts/proxy-basic.md b/curl/docs/cmdline-opts/proxy-basic.md new file mode 100644 index 000000000..2fae3d5b9 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-basic.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-basic +Help: Use Basic authentication on the proxy +Category: proxy auth +Added: 7.12.0 +Multi: mutex +See-also: + - proxy + - proxy-anyauth + - proxy-digest +Example: + - --proxy-basic --proxy-user user:passwd -x proxy $URL +--- + +# `--proxy-basic` + +Use HTTP Basic authentication when communicating with the given proxy. Use +--basic for enabling HTTP Basic with a remote host. Basic is the default +authentication method curl uses with proxies. diff --git a/curl/docs/cmdline-opts/proxy-ca-native.md b/curl/docs/cmdline-opts/proxy-ca-native.md new file mode 100644 index 000000000..0252e993f --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-ca-native.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-ca-native +Help: Load CA certs from the OS to verify proxy +Protocols: TLS +Category: tls +Added: 8.2.0 +Multi: boolean +See-also: + - ca-native + - cacert + - capath + - dump-ca-embed + - insecure +Example: + - --proxy-ca-native $URL +--- + +# `--proxy-ca-native` + +Use the operating system's native CA store for certificate verification of the +HTTPS proxy. + +This option is independent of other HTTPS proxy CA certificate locations set at +run time or build time. Those locations are searched in addition to the native +CA store. + +Equivalent to --ca-native but used in HTTPS proxy context. Refer to --ca-native +for TLS backend limitations. diff --git a/curl/docs/cmdline-opts/proxy-cacert.md b/curl/docs/cmdline-opts/proxy-cacert.md new file mode 100644 index 000000000..682349a7e --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-cacert.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-cacert +Help: CA certificates to verify proxy against +Arg: +Added: 7.52.0 +Category: proxy tls +Multi: single +See-also: + - proxy-capath + - cacert + - capath + - dump-ca-embed + - proxy +Example: + - --proxy-cacert CA-file.txt -x https://proxy $URL +--- + +# `--proxy-cacert` + +Use the specified certificate file to verify the HTTPS proxy. The file may +contain multiple CA certificates. The certificate(s) must be in PEM format. + +This allows you to use a different trust for the proxy compared to the remote +server connected to via the proxy. + +Equivalent to --cacert but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-capath.md b/curl/docs/cmdline-opts/proxy-capath.md new file mode 100644 index 000000000..91575ae4d --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-capath.md @@ -0,0 +1,31 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-capath +Help: CA directory to verify proxy against +Arg: +Added: 7.52.0 +Category: proxy tls +Multi: single +See-also: + - proxy-cacert + - proxy + - capath + - dump-ca-embed +Example: + - --proxy-capath /local/directory -x https://proxy $URL +--- + +# `--proxy-capath` + +Same as --capath but used in HTTPS proxy context. + +Use the specified certificate directory to verify the proxy. Multiple paths +can be provided by separating them with colon (`:`) (e.g. `path1:path2:path3`). The +certificates must be in PEM format, and if curl is built against OpenSSL, the +directory must have been processed using the c_rehash utility supplied with +OpenSSL. Using --proxy-capath can allow OpenSSL-powered curl to make +SSL-connections much more efficiently than using --proxy-cacert if the +--proxy-cacert file contains many CA certificates. + +If this option is set, the default capath value is ignored. diff --git a/curl/docs/cmdline-opts/proxy-cert-type.md b/curl/docs/cmdline-opts/proxy-cert-type.md new file mode 100644 index 000000000..8a1121bb3 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-cert-type.md @@ -0,0 +1,26 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-cert-type +Arg: +Added: 7.52.0 +Help: Client certificate type for HTTPS proxy +Category: proxy tls +Multi: single +See-also: + - proxy-cert + - proxy-key +Example: + - --proxy-cert-type PEM --proxy-cert file -x https://proxy $URL +--- + +# `--proxy-cert-type` + +Set type of the provided client certificate when using HTTPS proxy. PEM, DER, +ENG, PROV and P12 are recognized types. + +The default type depends on the TLS backend and is usually PEM. For Schannel +it is P12. If --proxy-cert is a pkcs11: URI then ENG or PROV is the default +type (depending on OpenSSL version). + +Equivalent to --cert-type but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-cert.md b/curl/docs/cmdline-opts/proxy-cert.md new file mode 100644 index 000000000..734766730 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-cert.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-cert +Arg: +Help: Set client certificate for proxy +Added: 7.52.0 +Category: proxy tls +Multi: single +See-also: + - proxy + - proxy-key + - proxy-cert-type +Example: + - --proxy-cert file -x https://proxy $URL +--- + +# `--proxy-cert` + +Use the specified client certificate file when communicating with an HTTPS +proxy. The certificate must be PEM format. If the optional password is not +specified, it is queried for on the terminal. Use --proxy-key to provide the +private key. + +This option is the equivalent to --cert but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-ciphers.md b/curl/docs/cmdline-opts/proxy-ciphers.md new file mode 100644 index 000000000..420e7563b --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-ciphers.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-ciphers +Arg: +Help: TLS 1.2 (1.1, 1.0) ciphers to use for proxy +Protocols: TLS +Added: 7.52.0 +Category: proxy tls +Multi: single +See-also: + - proxy-tls13-ciphers + - ciphers + - proxy +Example: + - --proxy-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256 -x https://proxy $URL +--- + +# `--proxy-ciphers` + +Same as --ciphers but used in HTTPS proxy context. + +Specify which cipher suites to use in the connection to your HTTPS proxy when +it negotiates TLS 1.2 (1.1, 1.0). The list of ciphers suites must specify +valid ciphers. Read up on cipher suite details on this URL: + +https://curl.se/docs/ssl-ciphers.html diff --git a/curl/docs/cmdline-opts/proxy-crlfile.md b/curl/docs/cmdline-opts/proxy-crlfile.md new file mode 100644 index 000000000..726e44955 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-crlfile.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-crlfile +Arg: +Help: Set a CRL list for proxy +Added: 7.52.0 +Category: proxy tls +Multi: single +See-also: + - crlfile + - proxy +Example: + - --proxy-crlfile rejects.txt -x https://proxy $URL +--- + +# `--proxy-crlfile` + +Provide filename for a PEM formatted file with a Certificate Revocation List +that specifies peer certificates that are considered revoked when +communicating with an HTTPS proxy. + +Equivalent to --crlfile but only used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-digest.md b/curl/docs/cmdline-opts/proxy-digest.md new file mode 100644 index 000000000..77b88d7e4 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-digest.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-digest +Help: Digest auth with the proxy +Category: proxy tls +Added: 7.12.0 +Multi: mutex +See-also: + - proxy + - proxy-anyauth + - proxy-basic +Example: + - --proxy-digest --proxy-user user:passwd -x proxy $URL +--- + +# `--proxy-digest` + +Use HTTP Digest authentication when communicating with the given proxy. Use +--digest for enabling HTTP Digest with a remote host. diff --git a/curl/docs/cmdline-opts/proxy-header.md b/curl/docs/cmdline-opts/proxy-header.md new file mode 100644 index 000000000..3edf6c9a9 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-header.md @@ -0,0 +1,38 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-header +Arg:
+Help: Pass custom header(s) to proxy +Protocols: HTTP +Added: 7.37.0 +Category: proxy +Multi: append +See-also: + - proxy +Example: + - --proxy-header "X-First-Name: Joe" -x http://proxy $URL + - --proxy-header "User-Agent: surprise" -x http://proxy $URL + - --proxy-header "Host:" -x http://proxy $URL +--- + +# `--proxy-header` + +Extra header to include in the request when sending HTTP to a proxy. You may +specify any number of extra headers. This is the equivalent option to --header +but is for proxy communication only like in CONNECT requests when you want a +separate header sent to the proxy to what is sent to the actual remote host. + +curl makes sure that each header you add/replace is sent with the proper +end-of-line marker, you should thus **not** add that as a part of the header +content: do not add newlines or carriage returns, they only mess things up for +you. + +Headers specified with this option are not included in requests that curl +knows are not to be sent to a proxy. + +This option can take an argument in @filename style, which then adds a header +for each line in the input file (added in 7.55.0). Using @- makes curl read +the headers from stdin. + +This option can be used multiple times to add/replace/remove multiple headers. diff --git a/curl/docs/cmdline-opts/proxy-http2.md b/curl/docs/cmdline-opts/proxy-http2.md new file mode 100644 index 000000000..ca6a091f3 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-http2.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-http2 +Tags: Versions HTTP/2 +Protocols: HTTP +Added: 8.1.0 +Mutexed: +Requires: HTTP/2 +Help: Use HTTP/2 with HTTPS proxy +Category: http proxy +Multi: boolean +See-also: + - proxy +Example: + - --proxy-http2 -x proxy $URL +--- + +# `--proxy-http2` + +Negotiate HTTP/2 with an HTTPS proxy. The proxy might still only offer HTTP/1 +and then curl sticks to using that version. + +This has no effect for any other kinds of proxies. diff --git a/curl/docs/cmdline-opts/proxy-insecure.md b/curl/docs/cmdline-opts/proxy-insecure.md new file mode 100644 index 000000000..5796c3623 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-insecure.md @@ -0,0 +1,30 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-insecure +Help: Skip HTTPS proxy cert verification +Added: 7.52.0 +Category: proxy tls +Multi: boolean +See-also: + - proxy + - insecure +Example: + - --proxy-insecure -x https://proxy $URL +--- + +# `--proxy-insecure` + +Same as --insecure but used in HTTPS proxy context. + +Every secure connection curl makes is verified to be secure before the +transfer takes place. This option makes curl skip the verification step with a +proxy and proceed without checking. + +When this option is not used for a proxy using HTTPS, curl verifies the +proxy's TLS certificate before it continues: that the certificate contains the +right name which matches the hostname and that the certificate has been signed +by a CA certificate present in the cert store. See this online resource for +further details: **https://curl.se/docs/sslcerts.html** + +**WARNING**: using this option makes the transfer to the proxy insecure. diff --git a/curl/docs/cmdline-opts/proxy-key-type.md b/curl/docs/cmdline-opts/proxy-key-type.md new file mode 100644 index 000000000..587c13c59 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-key-type.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-key-type +Arg: +Help: Private key file type for proxy +Added: 7.52.0 +Category: proxy tls +Multi: single +See-also: + - proxy-key + - proxy +Example: + - --proxy-key-type DER --proxy-key here -x https://proxy $URL +--- + +# `--proxy-key-type` + +Specify the private key file type your --proxy-key provided private key uses. +DER, PEM, and ENG are supported. If not specified, PEM is assumed. + +Equivalent to --key-type but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-key.md b/curl/docs/cmdline-opts/proxy-key.md new file mode 100644 index 000000000..7caa636e3 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-key.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-key +Help: Private key for HTTPS proxy +Arg: +Category: proxy tls +Added: 7.52.0 +Multi: single +See-also: + - proxy-key-type + - proxy +Example: + - --proxy-key here -x https://proxy $URL +--- + +# `--proxy-key` + +Specify the filename for your private key when using client certificates with +your HTTPS proxy. This option is the equivalent to --key but used in HTTPS +proxy context. diff --git a/curl/docs/cmdline-opts/proxy-negotiate.md b/curl/docs/cmdline-opts/proxy-negotiate.md new file mode 100644 index 000000000..0285155c6 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-negotiate.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-negotiate +Help: HTTP Negotiate (SPNEGO) auth with the proxy +Added: 7.17.1 +Category: proxy auth +Multi: mutex +See-also: + - proxy-anyauth + - proxy-basic + - proxy-service-name +Example: + - --proxy-negotiate --proxy-user user:passwd -x proxy $URL +--- + +# `--proxy-negotiate` + +Use HTTP Negotiate (SPNEGO) authentication when communicating with the given +proxy. Use --negotiate for enabling HTTP Negotiate (SPNEGO) with a remote +host. diff --git a/curl/docs/cmdline-opts/proxy-ntlm.md b/curl/docs/cmdline-opts/proxy-ntlm.md new file mode 100644 index 000000000..e403f98ec --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-ntlm.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-ntlm +Help: NTLM authentication with the proxy +Category: proxy auth +Added: 7.10.7 +Multi: mutex +See-also: + - proxy-negotiate + - proxy-anyauth + - proxy-user +Example: + - --proxy-ntlm --proxy-user user:passwd -x http://proxy $URL +--- + +# `--proxy-ntlm` + +Use HTTP NTLM authentication when communicating with the given proxy. Use +--ntlm for enabling NTLM with a remote host. diff --git a/curl/docs/cmdline-opts/proxy-pass.md b/curl/docs/cmdline-opts/proxy-pass.md new file mode 100644 index 000000000..88cefd54c --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-pass.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-pass +Arg: +Help: Passphrase for private key for HTTPS proxy +Added: 7.52.0 +Category: proxy tls auth +Multi: single +See-also: + - proxy + - proxy-key +Example: + - --proxy-pass secret --proxy-key here -x https://proxy $URL +--- + +# `--proxy-pass` + +Passphrase for the private key for HTTPS proxy client certificate. + +Equivalent to --pass but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-pinnedpubkey.md b/curl/docs/cmdline-opts/proxy-pinnedpubkey.md new file mode 100644 index 000000000..df0b0bb90 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-pinnedpubkey.md @@ -0,0 +1,31 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-pinnedpubkey +Arg: +Help: FILE/HASHES public key to verify proxy with +Protocols: TLS +Category: proxy tls +Added: 7.59.0 +Multi: single +See-also: + - pinnedpubkey + - proxy +Example: + - --proxy-pinnedpubkey keyfile $URL + - --proxy-pinnedpubkey 'sha256//ce118b51897f4452dc' $URL +--- + +# `--proxy-pinnedpubkey` + +Use the specified public key file (or hashes) to verify the proxy. This can be +a path to a file which contains a single public key in PEM or DER format, or +any number of base64 encoded sha256 hashes preceded by 'sha256//' and +separated by ';'. + +When negotiating a TLS or SSL connection, the server sends a certificate +indicating its identity. A public key is extracted from this certificate and +if it does not exactly match the public key provided to this option, curl +aborts the connection before sending or receiving any data. + +Before curl 8.10.0 this option did not work due to a bug. diff --git a/curl/docs/cmdline-opts/proxy-service-name.md b/curl/docs/cmdline-opts/proxy-service-name.md new file mode 100644 index 000000000..b3d665d8b --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-service-name.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-service-name +Arg: +Help: SPNEGO proxy service name +Added: 7.43.0 +Category: proxy tls +Multi: single +See-also: + - service-name + - proxy + - proxy-negotiate +Example: + - --proxy-service-name "shrubbery" -x proxy $URL +--- + +# `--proxy-service-name` + +Set the service name for SPNEGO when doing proxy authentication. diff --git a/curl/docs/cmdline-opts/proxy-ssl-allow-beast.md b/curl/docs/cmdline-opts/proxy-ssl-allow-beast.md new file mode 100644 index 000000000..089038dec --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-ssl-allow-beast.md @@ -0,0 +1,29 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-ssl-allow-beast +Help: Allow this security flaw for HTTPS proxy +Added: 7.52.0 +Category: proxy tls +Multi: boolean +See-also: + - ssl-allow-beast + - proxy +Example: + - --proxy-ssl-allow-beast -x https://proxy $URL +--- + +# `--proxy-ssl-allow-beast` + +Do not work around a security flaw in the TLS1.0 protocol known as BEAST when +communicating to an HTTPS proxy. If this option is not used, the TLS layer may +use workarounds known to cause interoperability problems with some older +server implementations. + +This option only changes how curl does TLS 1.0 with an HTTPS proxy and has no +effect on later TLS versions. + +**WARNING**: this option loosens the TLS security, and by using this flag you +ask for exactly that. + +Equivalent to --ssl-allow-beast but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-ssl-auto-client-cert.md b/curl/docs/cmdline-opts/proxy-ssl-auto-client-cert.md new file mode 100644 index 000000000..578a7a641 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-ssl-auto-client-cert.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-ssl-auto-client-cert +Help: Auto client certificate for proxy +Added: 7.77.0 +Category: proxy tls +Multi: boolean +See-also: + - ssl-auto-client-cert + - proxy +Example: + - --proxy-ssl-auto-client-cert -x https://proxy $URL +--- + +# `--proxy-ssl-auto-client-cert` + +Same as --ssl-auto-client-cert but used in HTTPS proxy context. + +This is only supported by Schannel. diff --git a/curl/docs/cmdline-opts/proxy-tls13-ciphers.md b/curl/docs/cmdline-opts/proxy-tls13-ciphers.md new file mode 100644 index 000000000..6fcf6d79d --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-tls13-ciphers.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-tls13-ciphers +Arg: +Help: TLS 1.3 proxy cipher suites +Protocols: TLS +Category: proxy tls +Added: 7.61.0 +Multi: single +See-also: + - proxy-ciphers + - tls13-ciphers + - proxy +Example: + - --proxy-tls13-ciphers TLS_AES_128_GCM_SHA256 -x proxy $URL +--- + +# `--proxy-tls13-ciphers` + +Same as --tls13-ciphers but used in HTTPS proxy context. + +Specify which cipher suites to use in the connection to your HTTPS proxy when +it negotiates TLS 1.3. The list of ciphers suites must specify valid ciphers. +Read up on TLS 1.3 cipher suite details on this URL: + +https://curl.se/docs/ssl-ciphers.html + +This option is used when curl is built to use OpenSSL 1.1.1 or later, +Schannel, wolfSSL, or mbedTLS 3.6.0 or later. + +Before curl 8.10.0 with mbedTLS or wolfSSL, TLS 1.3 cipher suites were set +by using the --proxy-ciphers option. diff --git a/curl/docs/cmdline-opts/proxy-tlsauthtype.md b/curl/docs/cmdline-opts/proxy-tlsauthtype.md new file mode 100644 index 000000000..684a7d55e --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-tlsauthtype.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-tlsauthtype +Arg: +Help: TLS authentication type for HTTPS proxy +Added: 7.52.0 +Category: proxy tls auth +Multi: single +See-also: + - proxy + - proxy-tlsuser + - proxy-tlspassword +Example: + - --proxy-tlsauthtype SRP -x https://proxy $URL +--- + +# `--proxy-tlsauthtype` + +Set TLS authentication type with HTTPS proxy. The only supported option is +`SRP`, for TLS-SRP (RFC 5054). This option works only if the underlying +libcurl is built with TLS-SRP support. + +Equivalent to --tlsauthtype but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-tlspassword.md b/curl/docs/cmdline-opts/proxy-tlspassword.md new file mode 100644 index 000000000..fe9ae7d2e --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-tlspassword.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-tlspassword +Arg: +Help: TLS password for HTTPS proxy +Added: 7.52.0 +Category: proxy tls auth +Multi: single +See-also: + - proxy + - proxy-tlsuser +Example: + - --proxy-tlspassword passwd -x https://proxy $URL +--- + +# `--proxy-tlspassword` + +Set password to use with the TLS authentication method specified with +--proxy-tlsauthtype when using HTTPS proxy. Requires that --proxy-tlsuser is +set. + +This option does not work with TLS 1.3. + +Equivalent to --tlspassword but used in HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-tlsuser.md b/curl/docs/cmdline-opts/proxy-tlsuser.md new file mode 100644 index 000000000..351770111 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-tlsuser.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-tlsuser +Arg: +Help: TLS username for HTTPS proxy +Added: 7.52.0 +Category: proxy tls auth +Multi: single +See-also: + - proxy + - proxy-tlspassword +Example: + - --proxy-tlsuser smith -x https://proxy $URL +--- + +# `--proxy-tlsuser` + +Set username for use for HTTPS proxy with the TLS authentication method +specified with --proxy-tlsauthtype. Requires that --proxy-tlspassword also is +set. + +This option does not work with TLS 1.3. diff --git a/curl/docs/cmdline-opts/proxy-tlsv1.md b/curl/docs/cmdline-opts/proxy-tlsv1.md new file mode 100644 index 000000000..7b322e3a3 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-tlsv1.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-tlsv1 +Help: TLSv1 for HTTPS proxy +Added: 7.52.0 +Category: proxy tls auth +Multi: mutex +See-also: + - proxy +Example: + - --proxy-tlsv1 -x https://proxy $URL +--- + +# `--proxy-tlsv1` + +Use at least TLS version 1.x when negotiating with an HTTPS proxy. That means +TLS version 1.0 or higher + +Equivalent to --tlsv1 but for an HTTPS proxy context. diff --git a/curl/docs/cmdline-opts/proxy-user.md b/curl/docs/cmdline-opts/proxy-user.md new file mode 100644 index 000000000..e2508eda0 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy-user.md @@ -0,0 +1,29 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy-user +Short: U +Arg: +Help: Proxy user and password +Category: proxy auth +Added: 4.0 +Multi: single +See-also: + - proxy-pass +Example: + - --proxy-user smith:secret -x proxy $URL +--- + +# `--proxy-user` + +Specify the username and password to use for proxy authentication. + +If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM +authentication then you can tell curl to select the username and password from +your environment by specifying a single colon with this option: "-U :". + +On systems where it works, curl hides the given option argument from process +listings. This is not enough to protect credentials from possibly getting seen +by other users on the same system as they still are visible for a moment +before being cleared. Such sensitive data should be retrieved from a file instead or +similar and never used in clear text in a command line. diff --git a/curl/docs/cmdline-opts/proxy.md b/curl/docs/cmdline-opts/proxy.md new file mode 100644 index 000000000..1ed503c10 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy.md @@ -0,0 +1,62 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy +Short: x +Arg: <[protocol://]host[:port]> +Help: Use this proxy +Category: proxy +Added: 4.0 +Multi: single +See-also: + - socks5 + - proxy-basic +Example: + - --proxy http://proxy.example $URL +--- + +# `--proxy` + +Use the specified proxy. + +The proxy string can be specified with a protocol:// prefix. No protocol +specified or http:// it is treated as an HTTP proxy. Use socks4://, +socks4a://, socks5:// or socks5h:// to request a specific SOCKS version to be +used. (Added in 7.21.7) + +Unix domain sockets are supported for socks proxy. Set localhost for the host +part. e.g. socks5h://localhost/path/to/socket.sock + +HTTPS proxy support works with the https:// protocol prefix for OpenSSL and +GnuTLS (added in 7.52.0). It also works for mbedTLS, Rustls, Schannel and +wolfSSL (added in 7.87.0). + +Unrecognized and unsupported proxy protocols cause an error (added in 7.52.0). +Ancient curl versions ignored unknown schemes and used http:// instead. + +If the port number is not specified in the proxy string, it is assumed to be +1080. + +This option overrides existing environment variables that set the proxy to +use. If there is an environment variable setting a proxy, you can set proxy to +"" to override it. + +All operations that are performed over an HTTP proxy are transparently +converted to HTTP. It means that certain protocol specific operations might +not be available. This is not the case if you can tunnel through the proxy, as +one with the --proxytunnel option. + +User and password that might be provided in the proxy string are URL decoded +by curl. This allows you to pass in special characters such as @ by using %40 +or pass in a colon with %3a. + +The proxy host can be specified the same way as the proxy environment +variables, including the protocol prefix (http://) and the embedded user + +password. + +When a proxy is used, the active FTP mode as set with --ftp-port, cannot be +used. + +Doing FTP over an HTTP proxy without --proxytunnel makes curl do HTTP with an +FTP URL over the proxy. For such transfers, common FTP specific options do not +work, including --ssl-reqd and --ftp-ssl-control. diff --git a/curl/docs/cmdline-opts/proxy1.0.md b/curl/docs/cmdline-opts/proxy1.0.md new file mode 100644 index 000000000..4d3203a03 --- /dev/null +++ b/curl/docs/cmdline-opts/proxy1.0.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxy1.0 +Arg: +Help: Use HTTP/1.0 proxy on given port +Category: proxy +Added: 7.19.4 +Multi: mutex +See-also: + - proxy + - socks5 + - preproxy +Example: + - --proxy1.0 http://proxy $URL +--- + +# `--proxy1.0` + +Use the specified HTTP 1.0 proxy. If the port number is not specified, it is +assumed at port 1080. + +The only difference between this and the HTTP proxy option --proxy, is that +attempts to use CONNECT through the proxy specifies an HTTP 1.0 protocol +instead of the default HTTP 1.1. diff --git a/curl/docs/cmdline-opts/proxytunnel.md b/curl/docs/cmdline-opts/proxytunnel.md new file mode 100644 index 000000000..fcec87480 --- /dev/null +++ b/curl/docs/cmdline-opts/proxytunnel.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: proxytunnel +Short: p +Help: HTTP proxy tunnel (using CONNECT) +Category: proxy +Added: 7.3 +Multi: boolean +See-also: + - proxy +Example: + - --proxytunnel -x http://proxy $URL +--- + +# `--proxytunnel` + +When an HTTP proxy is used --proxy, this option makes curl tunnel the traffic +through the proxy. The tunnel approach is made with the HTTP proxy CONNECT +request and requires that the proxy allows direct connection to the remote port +number curl wants to tunnel through to. + +To suppress proxy CONNECT response headers when curl is set to output headers +use --suppress-connect-headers. diff --git a/curl/docs/cmdline-opts/pubkey.md b/curl/docs/cmdline-opts/pubkey.md new file mode 100644 index 000000000..373d113c3 --- /dev/null +++ b/curl/docs/cmdline-opts/pubkey.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: pubkey +Arg: +Protocols: SFTP SCP +Help: SSH Public key filename +Category: sftp scp ssh auth +Added: 7.16.2 +Multi: single +See-also: + - pass +Example: + - --pubkey file.pub sftp://example.com/ +--- + +# `--pubkey` + +Public key filename. Allows you to provide your public key in this separate +file. + +curl attempts to automatically extract the public key from the private key +file, so passing this option is generally not required. Note that this public +key extraction requires libcurl to be linked against a copy of libssh2 1.2.8 +or higher that is itself linked against OpenSSL. (Added in 7.39.0.) diff --git a/curl/docs/cmdline-opts/quote.md b/curl/docs/cmdline-opts/quote.md new file mode 100644 index 000000000..04a47424a --- /dev/null +++ b/curl/docs/cmdline-opts/quote.md @@ -0,0 +1,90 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: quote +Arg: +Short: Q +Help: Send command(s) to server before transfer +Protocols: FTP SFTP +Category: ftp sftp +Added: 5.3 +Multi: append +See-also: + - request +Example: + - --quote "DELE file" ftp://example.com/foo +--- + +# `--quote` + +Send an arbitrary command to the remote FTP or SFTP server. Quote commands are +sent BEFORE the transfer takes place (just after the initial **PWD** command +in an FTP transfer, to be exact). To make commands take place after a +successful transfer, prefix them with a dash '-'. + +(FTP only) To make commands be sent after curl has changed the working +directory, just before the file transfer command(s), prefix the command with a +'+'. + +You may specify any number of commands. + +By default curl stops at first failure. To make curl continue even if the +command fails, prefix the command with an asterisk (*). Otherwise, if the +server returns failure for one of the commands, the entire operation is +aborted. + +You must send syntactically correct FTP commands as RFC 959 defines to FTP +servers, or one of the commands listed below to SFTP servers. + +SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands +itself before sending them to the server. Filenames may be quoted shell-style +to embed spaces or special characters. Following is the list of all supported +SFTP quote commands: + +## atime date file +The atime command sets the last access time of the file named by the file +operand. The date expression can be all sorts of date strings, see the +*curl_getdate(3)* man page for date expression details. (Added in 7.73.0) + +## chgrp group file +The chgrp command sets the group ID of the file named by the file operand to +the group ID specified by the group operand. The group operand is a decimal +integer group ID. + +## chmod mode file +The chmod command modifies the file mode bits of the specified file. The +mode operand is an octal integer mode number. + +## chown user file +The chown command sets the owner of the file named by the file operand to the +user ID specified by the user operand. The user operand is a decimal +integer user ID. + +## ln source_file target_file +The ln and symlink commands create a symbolic link at the target_file location +pointing to the source_file location. + +## mkdir directory_name +The mkdir command creates the directory named by the directory_name operand. + +## mtime date file +The mtime command sets the last modification time of the file named by the +file operand. The date expression can be all sorts of date strings, see the +*curl_getdate(3)* man page for date expression details. (Added in 7.73.0) + +## pwd +The pwd command returns the absolute path name of the current working directory. + +## rename source target +The rename command renames the file or directory named by the source +operand to the destination path named by the target operand. + +## rm file +The rm command removes the file specified by the file operand. + +## rmdir directory +The rmdir command removes the directory entry specified by the directory +operand, provided it is empty. + +## symlink source_file target_file +See ln. diff --git a/curl/docs/cmdline-opts/random-file.md b/curl/docs/cmdline-opts/random-file.md new file mode 100644 index 000000000..e2c8624ab --- /dev/null +++ b/curl/docs/cmdline-opts/random-file.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: random-file +Arg: +Help: File for reading random data from +Category: deprecated +Added: 7.7 +Multi: single +See-also: + - egd-file +Example: + - --random-file rubbish $URL +--- + +# `--random-file` + +Deprecated option. This option is ignored (added in 7.84.0). Prior to that it +only had an effect on curl if built to use old versions of OpenSSL. + +Specify the path name to file containing random data. The data may be used to +seed the random engine for SSL connections. diff --git a/curl/docs/cmdline-opts/range.md b/curl/docs/cmdline-opts/range.md new file mode 100644 index 000000000..ab1b12657 --- /dev/null +++ b/curl/docs/cmdline-opts/range.md @@ -0,0 +1,66 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: range +Short: r +Help: Retrieve only the bytes within RANGE +Arg: +Protocols: HTTP FTP SFTP FILE +Category: http ftp sftp file +Added: 4.0 +Multi: single +See-also: + - continue-at + - append +Example: + - --range 22-44 $URL +--- + +# `--range` + +Retrieve a byte range (i.e. a partial document) from an HTTP/1.1, FTP or SFTP +server or a local FILE. Ranges can be specified in a number of ways. + +## 0-499 +specifies the first 500 bytes + +## 500-999 +specifies the second 500 bytes + +## -500 +specifies the last 500 bytes + +## 9500- +specifies the bytes from offset 9500 and forward + +## 0-0,-1 +specifies the first and last byte only(*)(HTTP) + +## 100-199,500-599 +specifies two separate 100-byte ranges(*) (HTTP) + +## + +(*) = NOTE that if specifying multiple ranges and the server supports it then +it replies with a multiple part response that curl returns as-is. It +contains meta information in addition to the requested bytes. Parsing or +otherwise transforming this response is the responsibility of the caller. + +Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the +'start-stop' range syntax. If a non-digit character is given in the range, the +server's response is unspecified, depending on the server's configuration. + +Many HTTP/1.1 servers do not have this feature enabled, so that when you +attempt to get a range, curl instead gets the whole document. + +FTP and SFTP range downloads only support the simple 'start-stop' syntax +(optionally with one of the numbers omitted). FTP use depends on the extended +FTP command SIZE. + +When using this option for HTTP uploads using POST or PUT, functionality is +not guaranteed. The HTTP protocol has no standard interoperable resume upload +and curl uses a set of headers for this purpose that once proved working for +some servers and have been left for those who find that useful. + +This command line option is mutually exclusive with --continue-at: you can only +use one of them for a single transfer. diff --git a/curl/docs/cmdline-opts/rate.md b/curl/docs/cmdline-opts/rate.md new file mode 100644 index 000000000..d389da574 --- /dev/null +++ b/curl/docs/cmdline-opts/rate.md @@ -0,0 +1,46 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: rate +Arg: +Help: Request rate for serial transfers +Category: connection global +Added: 7.84.0 +Multi: single +Scope: global +See-also: + - limit-rate + - retry-delay +Example: + - --rate 2/s $URL ... + - --rate 3/h $URL ... + - --rate 14/m $URL ... +--- + +# `--rate` + +Specify the maximum transfer frequency you allow curl to use - in number of +transfer starts per time unit (sometimes called request rate). Without this +option, curl starts the next transfer as fast as possible. + +If given several URLs and a transfer completes faster than the allowed rate, +curl waits until the next transfer is started to maintain the requested +rate. This option has no effect when --parallel is used. + +The request rate is provided as "N/U" where N is an integer number and U is a +time unit. Supported units are 's' (second), 'm' (minute), 'h' (hour) and 'd' +/(day, as in a 24 hour unit). The default time unit, if no "/U" is provided, +is number of transfers per hour. + +If curl is told to allow 10 requests per minute, it does not start the next +request until 6 seconds have elapsed since the previous transfer was started. + +This function uses millisecond resolution. If the allowed frequency is set +more than 1000 per second, it instead runs unrestricted. + +When retrying transfers, enabled with --retry, the separate retry delay logic +is used and not this setting. + +Starting in version 8.10.0, you can specify the number of time units in the rate +expression. Make curl do no more than 5 transfers per 15 seconds with "5/15s" +or limit it to 3 transfers per 4 hours with "3/4h". No spaces allowed. diff --git a/curl/docs/cmdline-opts/raw.md b/curl/docs/cmdline-opts/raw.md new file mode 100644 index 000000000..ca63dc318 --- /dev/null +++ b/curl/docs/cmdline-opts/raw.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: raw +Help: Do HTTP raw; no transfer decoding +Added: 7.16.2 +Protocols: HTTP +Category: http +Multi: boolean +See-also: + - tr-encoding +Example: + - --raw $URL +--- + +# `--raw` + +When used, it disables all internal HTTP decoding of content or transfer +encodings and instead makes them passed on unaltered, raw. diff --git a/curl/docs/cmdline-opts/referer.md b/curl/docs/cmdline-opts/referer.md new file mode 100644 index 000000000..1fec24850 --- /dev/null +++ b/curl/docs/cmdline-opts/referer.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: referer +Short: e +Arg: +Protocols: HTTP +Help: Referrer URL +Category: http +Added: 4.0 +Multi: single +See-also: + - user-agent + - header +Example: + - --referer "https://fake.example" $URL + - --referer "https://fake.example;auto" -L $URL + - --referer ";auto" -L $URL +--- + +# `--referer` + +Set the referrer URL in the HTTP request. This can also be set with the +--header flag of course. When used with --location you can append `;auto`" to +the --referer URL to make curl automatically set the previous URL when it +follows a Location: header. The `;auto` string can be used alone, even if you +do not set an initial --referer. diff --git a/curl/docs/cmdline-opts/remote-header-name.md b/curl/docs/cmdline-opts/remote-header-name.md new file mode 100644 index 000000000..88c2808a3 --- /dev/null +++ b/curl/docs/cmdline-opts/remote-header-name.md @@ -0,0 +1,39 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: remote-header-name +Short: J +Protocols: HTTP +Help: Use the header-provided filename +Category: output +Added: 7.20.0 +Multi: boolean +See-also: + - remote-name +Example: + - -OJ https://example.com/file +--- + +# `--remote-header-name` + +Tell the --remote-name option to use the server-specified Content-Disposition +filename instead of extracting a filename from the URL. If the server-provided +filename contains a path, that is stripped off before the filename is used. + +The file is saved in the current directory, or in the directory specified with +--output-dir. + +If the server specifies a filename and a file with that name already exists in +the destination directory, it is not overwritten and an error occurs - unless +you allow it by using the --clobber option. If the server does not specify a +filename then this option has no effect. + +There is no attempt to decode %-sequences (yet) in the provided filename, so +this option may provide you with rather unexpected filenames. + +This feature uses the name from the `filename` field, it does not yet support +the `filename*` field (filenames with explicit character sets). + +**WARNING**: Exercise judicious use of this option, especially on Windows. A +rogue server could send you the name of a DLL or other file that could be +loaded automatically by Windows or some third party software. diff --git a/curl/docs/cmdline-opts/remote-name-all.md b/curl/docs/cmdline-opts/remote-name-all.md new file mode 100644 index 000000000..92d348e27 --- /dev/null +++ b/curl/docs/cmdline-opts/remote-name-all.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: remote-name-all +Help: Use the remote filename for all URLs +Added: 7.19.0 +Category: output +Multi: boolean +See-also: + - remote-name +Example: + - --remote-name-all ftp://example.com/file1 ftp://example.com/file2 +--- + +# `--remote-name-all` + +Change the default action for all given URLs to be dealt with as if +--remote-name were used for each one. If you want to disable that for a +specific URL after --remote-name-all has been used, you must use "-o -" or +--no-remote-name. diff --git a/curl/docs/cmdline-opts/remote-name.md b/curl/docs/cmdline-opts/remote-name.md new file mode 100644 index 000000000..e39dd51ae --- /dev/null +++ b/curl/docs/cmdline-opts/remote-name.md @@ -0,0 +1,42 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: remote-name +Short: O +Help: Write output to file named as remote file +Category: important output +Added: 4.0 +Multi: per-URL +See-also: + - remote-name-all + - output-dir + - remote-header-name +Example: + - -O https://example.com/filename + - -O https://example.com/filename -O https://example.com/file2 +--- + +# `--remote-name` + +Write output to a local file named like the remote file we get. (Only the file +part of the remote file is used, the path is cut off.) + +The file is saved in the current working directory. If you want the file saved +in a different directory, make sure you change the current working directory +before invoking curl with this option or use --output-dir. + +The remote filename to use for saving is extracted from the given URL, nothing +else, and if it already exists it is overwritten. If you want the server to be +able to choose the filename refer to --remote-header-name which can be used in +addition to this option. If the server chooses a filename and that name +already exists it is not overwritten. + +There is no URL decoding done on the filename. If it has %20 or other URL +encoded parts of the name, they end up as-is as filename. + +You may use this option as many times as the number of URLs you have. + +Before curl 8.10.0, curl returned an error if the URL ended with a slash, +which means that there is no filename part in the URL. Starting in 8.10.0, +curl sets the filename to the last directory part of the URL or if that also +is missing to `curl_response` (without extension) for this situation. diff --git a/curl/docs/cmdline-opts/remote-time.md b/curl/docs/cmdline-opts/remote-time.md new file mode 100644 index 000000000..3f8c702b4 --- /dev/null +++ b/curl/docs/cmdline-opts/remote-time.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: remote-time +Short: R +Help: Set remote file's time on local output +Category: output +Added: 7.9 +Multi: boolean +See-also: + - remote-name + - time-cond +Example: + - --remote-time -o foo $URL +--- + +# `--remote-time` + +Make curl attempt to figure out the timestamp of the remote file that is +getting downloaded, and if that is available make the local file get that same +timestamp. diff --git a/curl/docs/cmdline-opts/remove-on-error.md b/curl/docs/cmdline-opts/remove-on-error.md new file mode 100644 index 000000000..ec7b88882 --- /dev/null +++ b/curl/docs/cmdline-opts/remove-on-error.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: remove-on-error +Help: Remove output file on errors +Category: output +Added: 7.83.0 +Multi: boolean +See-also: + - fail +Example: + - --remove-on-error -o output $URL +--- + +# `--remove-on-error` + +Remove the output file if an error occurs. If curl returns an error when told to +save output in a local file. This prevents curl from leaving a partial file in +the case of an error during transfer. + +If the output is not a regular file, this option has no effect. + +The --continue-at option cannot be used together with --remove-on-error. diff --git a/curl/docs/cmdline-opts/request-target.md b/curl/docs/cmdline-opts/request-target.md new file mode 100644 index 000000000..c76b6b34d --- /dev/null +++ b/curl/docs/cmdline-opts/request-target.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: request-target +Arg: +Help: Specify the target for this request +Protocols: HTTP +Added: 7.55.0 +Category: http +Multi: single +See-also: + - request +Example: + - --request-target "*" -X OPTIONS $URL +--- + +# `--request-target` + +Use an alternative target (path) instead of using the path as provided in the +URL. Particularly useful when wanting to issue HTTP requests without leading +slash or other data that does not follow the regular URL pattern, like +"OPTIONS *". + +curl passes on the verbatim string you give it in the request without any +filter or other safe guards. That includes white space and control characters. diff --git a/curl/docs/cmdline-opts/request.md b/curl/docs/cmdline-opts/request.md new file mode 100644 index 000000000..86cf10dea --- /dev/null +++ b/curl/docs/cmdline-opts/request.md @@ -0,0 +1,57 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: request +Short: X +Arg: +Help: Specify request method to use +Category: connection pop3 ftp imap smtp +Added: 6.0 +Multi: single +See-also: + - request-target +Example: + - -X "DELETE" $URL + - -X NLST ftp://example.com/ +--- + +# `--request` + +Change the method to use when starting the transfer. + +curl passes on the verbatim string you give it in the request without any +filter or other safe guards. That includes white space and control characters. + +## HTTP +Specifies a custom request method to use when communicating with the HTTP +server. The specified request method is used instead of the method otherwise +used (which defaults to *GET*). Read the HTTP 1.1 specification for details +and explanations. Common additional HTTP requests include *PUT* and *DELETE*, +while related technologies like WebDAV offers *PROPFIND*, *COPY*, *MOVE* and +more. + +Normally you do not need this option. All sorts of *GET*, *HEAD*, *POST* and +*PUT* requests are rather invoked by using dedicated command line options. + +This option only changes the actual word used in the HTTP request, it does not +alter the way curl behaves. For example if you want to make a proper HEAD +request, using -X HEAD does not suffice. You need to use the --head option. + +The method string you set with --request is used for all requests, which +if you for example use --location may cause unintended side-effects when curl +does not change request method according to the HTTP 30x response codes - and +similar. + +## FTP +Specifies a custom FTP command to use instead of *LIST* when doing file lists +with FTP. + +## POP3 +Specifies a custom POP3 command to use instead of *LIST* or *RETR*. +(Added in 7.26.0) + +## IMAP +Specifies a custom IMAP command to use instead of *LIST*. (Added in 7.30.0) + +## SMTP +Specifies a custom SMTP command to use instead of *HELP* or **VRFY**. (Added in 7.34.0) diff --git a/curl/docs/cmdline-opts/resolve.md b/curl/docs/cmdline-opts/resolve.md new file mode 100644 index 000000000..18733df0c --- /dev/null +++ b/curl/docs/cmdline-opts/resolve.md @@ -0,0 +1,50 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: resolve +Arg: <[+]host:port:addr[,addr]...> +Help: Resolve host+port to address +Added: 7.21.3 +Category: connection dns +Multi: append +See-also: + - connect-to + - alt-svc +Example: + - --resolve example.com:443:127.0.0.1 $URL + - --resolve example.com:443:[2001:db8::252f:efd6] $URL +--- + +# `--resolve` + +Provide a custom address for a specific host and port pair. Using this, you +can make the curl requests(s) use a specified address and prevent the +otherwise normally resolved address to be used. Consider it a sort of +/etc/hosts alternative provided on the command line. The port number should be +the number used for the specific protocol the host is used for. It means you +need several entries if you want to provide addresses for the same host but +different ports. + +By specifying `*` as host you can tell curl to resolve any host and specific +port pair to the specified address. Wildcard is resolved last so any --resolve +with a specific host and port is used first. + +The provided address set by this option is used even if --ipv4 or --ipv6 is +set to make curl use another IP version. + +By prefixing the host with a '+' you can make the entry time out after curl's +default timeout (1 minute). Note that this only makes sense for long running +parallel transfers with a lot of files. In such cases, if this option is used +curl tries to resolve the host as it normally would once the timeout has +expired. + +Provide IPv6 addresses within [brackets]. + +To redirect connects from a specific hostname or any hostname, independently +of port number, consider the --connect-to option. + +Support for resolving with wildcard was added in 7.64.0. + +Support for the '+' prefix was added in 7.75.0. + +Support for specifying the host component as an IPv6 address was added in 8.13.0. diff --git a/curl/docs/cmdline-opts/retry-all-errors.md b/curl/docs/cmdline-opts/retry-all-errors.md new file mode 100644 index 000000000..cb337f3f1 --- /dev/null +++ b/curl/docs/cmdline-opts/retry-all-errors.md @@ -0,0 +1,40 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: retry-all-errors +Help: Retry all errors (with --retry) +Added: 7.71.0 +Category: curl +Multi: boolean +See-also: + - retry +Example: + - --retry 5 --retry-all-errors $URL +--- + +# `--retry-all-errors` + +Retry on any error. This option is used together with --retry. + +This option is the "sledgehammer" of retrying. Do not use this option by +default (for example in your **curlrc**), there may be unintended consequences +such as sending or receiving duplicate data. Do not use with redirected input +or output. You might be better off handling your unique problems in a shell +script. Please read the example below. + +**WARNING**: For server compatibility curl attempts to retry failed flaky +transfers as close as possible to how they were started, but this is not +possible with redirected input or output. For example, before retrying it +removes output data from a failed partial transfer that was written to an +output file. However this is not true of data redirected to a | pipe or \> +file, which are not reset. We strongly suggest you do not parse or record +output via redirect in combination with this option, since you may receive +duplicate data. + +By default curl does not return an error for transfers with an HTTP response code +that indicates an HTTP error, if the transfer was successful. For example, if +a server replies 404 Not Found and the reply is fully received then that is +not an error. When --retry is used then curl retries on some HTTP response +codes that indicate transient HTTP errors, but that does not include most 4xx +response codes such as 404. If you want to retry on all response codes that +indicate HTTP errors (4xx and 5xx) then combine with --fail. diff --git a/curl/docs/cmdline-opts/retry-connrefused.md b/curl/docs/cmdline-opts/retry-connrefused.md new file mode 100644 index 000000000..22345cd88 --- /dev/null +++ b/curl/docs/cmdline-opts/retry-connrefused.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: retry-connrefused +Help: Retry on connection refused (with --retry) +Added: 7.52.0 +Category: curl +Multi: boolean +See-also: + - retry + - retry-all-errors +Example: + - --retry-connrefused --retry 7 $URL +--- + +# `--retry-connrefused` + +In addition to the other conditions, consider ECONNREFUSED as a transient +error too for --retry. This option is used together with --retry. diff --git a/curl/docs/cmdline-opts/retry-delay.md b/curl/docs/cmdline-opts/retry-delay.md new file mode 100644 index 000000000..fcee1767a --- /dev/null +++ b/curl/docs/cmdline-opts/retry-delay.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: retry-delay +Arg: +Help: Wait time between retries +Added: 7.12.3 +Category: curl timeout +Multi: single +See-also: + - retry +Example: + - --retry-delay 5 --retry 7 $URL +--- + +# `--retry-delay` + +Make curl sleep this amount of time before each retry when a transfer has +failed with a transient error (it changes the default backoff time algorithm +between retries). This option is only interesting if --retry is also +used. Setting this delay to zero makes curl use the default backoff time. diff --git a/curl/docs/cmdline-opts/retry-max-time.md b/curl/docs/cmdline-opts/retry-max-time.md new file mode 100644 index 000000000..e95a381a4 --- /dev/null +++ b/curl/docs/cmdline-opts/retry-max-time.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: retry-max-time +Arg: +Help: Retry only within this period +Added: 7.12.3 +Category: curl timeout +Multi: single +See-also: + - retry +Example: + - --retry-max-time 30 --retry 10 $URL +--- + +# `--retry-max-time` + +The retry timer is reset before the first transfer attempt. Retries are done +as usual (see --retry) as long as the timer has not reached this given +limit. Notice that if the timer has not reached the limit, the request is +made and while performing, it may take longer than this given time period. To +limit a single request's maximum time, use --max-time. Set this option to zero +to not timeout retries. diff --git a/curl/docs/cmdline-opts/retry.md b/curl/docs/cmdline-opts/retry.md new file mode 100644 index 000000000..2176e8f43 --- /dev/null +++ b/curl/docs/cmdline-opts/retry.md @@ -0,0 +1,31 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: retry +Arg: +Added: 7.12.3 +Help: Retry request if transient problems occur +Category: curl +Multi: single +See-also: + - retry-max-time +Example: + - --retry 7 $URL +--- + +# `--retry` + +If a transient error is returned when curl tries to perform a transfer, it +retries this number of times before giving up. Setting the number to 0 +makes curl do no retries (which is the default). Transient error means either: +a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504 +response code. + +When curl is about to retry a transfer, it first waits one second and then for +all forthcoming retries it doubles the waiting time until it reaches 10 +minutes, which then remains the set fixed delay time between the rest of the +retries. By using --retry-delay you disable this exponential backoff algorithm. +See also --retry-max-time to limit the total time allowed for retries. + +curl complies with the Retry-After: response header if one was present to know +when to issue the next retry (added in 7.66.0). diff --git a/curl/docs/cmdline-opts/sasl-authzid.md b/curl/docs/cmdline-opts/sasl-authzid.md new file mode 100644 index 000000000..4c4282d14 --- /dev/null +++ b/curl/docs/cmdline-opts/sasl-authzid.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: sasl-authzid +Arg: +Help: Identity for SASL PLAIN authentication +Added: 7.66.0 +Category: auth +Multi: single +See-also: + - login-options +Example: + - --sasl-authzid zid imap://example.com/ +--- + +# `--sasl-authzid` + +Use this authorization identity (**authzid**), during SASL PLAIN +authentication, in addition to the authentication identity (**authcid**) as +specified by --user. + +If the option is not specified, the server derives the **authzid** from the +**authcid**, but if specified, and depending on the server implementation, it +may be used to access another user's inbox, that the user has been granted +access to, or a shared mailbox for example. diff --git a/curl/docs/cmdline-opts/sasl-ir.md b/curl/docs/cmdline-opts/sasl-ir.md new file mode 100644 index 000000000..b11137df0 --- /dev/null +++ b/curl/docs/cmdline-opts/sasl-ir.md @@ -0,0 +1,17 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: sasl-ir +Help: Initial response in SASL authentication +Added: 7.31.0 +Category: auth +Multi: boolean +See-also: + - sasl-authzid +Example: + - --sasl-ir imap://example.com/ +--- + +# `--sasl-ir` + +Enable initial response in SASL authentication. diff --git a/curl/docs/cmdline-opts/service-name.md b/curl/docs/cmdline-opts/service-name.md new file mode 100644 index 000000000..f98409aa2 --- /dev/null +++ b/curl/docs/cmdline-opts/service-name.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: service-name +Help: SPNEGO service name +Arg: +Added: 7.43.0 +Category: auth +Multi: single +See-also: + - negotiate + - proxy-service-name +Example: + - --service-name sockd/server $URL +--- + +# `--service-name` + +Set the service name for SPNEGO. diff --git a/curl/docs/cmdline-opts/show-error.md b/curl/docs/cmdline-opts/show-error.md new file mode 100644 index 000000000..aaf865bc0 --- /dev/null +++ b/curl/docs/cmdline-opts/show-error.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: show-error +Short: S +Help: Show error even when -s is used +Category: curl global +Added: 5.9 +Multi: boolean +Scope: global +See-also: + - no-progress-meter +Example: + - --show-error --silent $URL +--- + +# `--show-error` + +When used with --silent, it makes curl show an error message if it fails. diff --git a/curl/docs/cmdline-opts/show-headers.md b/curl/docs/cmdline-opts/show-headers.md new file mode 100644 index 000000000..d733784ac --- /dev/null +++ b/curl/docs/cmdline-opts/show-headers.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: show-headers +Short: i +Help: Show response headers in output +Protocols: HTTP FTP +Category: important verbose output +Added: 4.8 +Multi: boolean +See-also: + - verbose + - dump-header +Example: + - -i $URL +--- + +# `--show-headers` + +Show response headers in the output. HTTP response headers can include things +like server name, cookies, date of the document, HTTP version and more. With +non-HTTP protocols, the "headers" are other server communication. + +This option makes the response headers get saved in the same stream/output as +the data. --dump-header exists to save headers in a separate stream. + +To view the request headers, consider the --verbose option. + +Prior to 7.75.0 curl did not print the headers if --fail was used in +combination with this option and there was an error reported by the server. + +This option was called --include before 8.10.0. The previous name remains +functional. diff --git a/curl/docs/cmdline-opts/sigalgs.md b/curl/docs/cmdline-opts/sigalgs.md new file mode 100644 index 000000000..537b34f3a --- /dev/null +++ b/curl/docs/cmdline-opts/sigalgs.md @@ -0,0 +1,33 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: sigalgs +Arg: +Help: TLS signature algorithms to use +Protocols: TLS +Added: 8.14.0 +Category: tls +Multi: single +See-also: + - ciphers +Example: + - --sigalgs ecdsa_secp256r1_sha256 $URL +--- + +# `--sigalgs` + +Set specific signature algorithms to use during SSL session establishment according to RFC +5246, 7.4.1.4.1. + +An algorithm can use either a signature algorithm and a hash algorithm pair separated by a +`+` (e.g. `ECDSA+SHA224`), or its TLS 1.3 signature scheme name (e.g. `ed25519`). + +Multiple algorithms can be provided by separating them with `:` +(e.g. `DSA+SHA256:rsa_pss_pss_sha256`). The parameter is available as `-sigalgs` in the +OpenSSL `s_client` and `s_server` utilities. + +`--sigalgs` allows a OpenSSL powered curl to make SSL-connections with exactly +the signature algorithms requested by the client, avoiding nontransparent client/server +negotiations. + +If this option is set, the default signature algorithm list built into OpenSSL are ignored. diff --git a/curl/docs/cmdline-opts/silent.md b/curl/docs/cmdline-opts/silent.md new file mode 100644 index 000000000..4e80ee764 --- /dev/null +++ b/curl/docs/cmdline-opts/silent.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: silent +Short: s +Help: Silent mode +Category: important verbose +Added: 4.0 +Multi: boolean +See-also: + - verbose + - stderr + - no-progress-meter +Example: + - -s $URL +--- + +# `--silent` + +Silent or quiet mode. Do not show progress meter or error messages. Makes curl +mute. It still outputs the data you ask for, potentially even to the +terminal/stdout unless you redirect it. + +Use --show-error in addition to this option to disable progress meter but +still show error messages. diff --git a/curl/docs/cmdline-opts/skip-existing.md b/curl/docs/cmdline-opts/skip-existing.md new file mode 100644 index 000000000..cfb7c2f95 --- /dev/null +++ b/curl/docs/cmdline-opts/skip-existing.md @@ -0,0 +1,22 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: skip-existing +Help: Skip download if local file already exists +Category: curl output +Added: 8.10.0 +Multi: boolean +See-also: + - output + - remote-name + - no-clobber +Example: + - --skip-existing --output local/dir/file $URL +--- + +# `--skip-existing` + +If there is a local file present when a download is requested, the operation +is skipped. Note that curl cannot know if the local file was previously +downloaded fine, or if it is incomplete etc, it just knows if there is a +filename present in the file system or not and it skips the transfer if it is. diff --git a/curl/docs/cmdline-opts/socks4.md b/curl/docs/cmdline-opts/socks4.md new file mode 100644 index 000000000..8e92d5930 --- /dev/null +++ b/curl/docs/cmdline-opts/socks4.md @@ -0,0 +1,36 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks4 +Arg: +Help: SOCKS4 proxy on given host + port +Added: 7.15.2 +Category: proxy +Multi: single +See-also: + - socks4a + - socks5 + - socks5-hostname +Example: + - --socks4 hostname:4096 $URL +--- + +# `--socks4` + +Use the specified SOCKS4 proxy. If the port number is not specified, it is +assumed at port 1080. Using this socket type makes curl resolve the hostname +and pass the address on to the proxy. + +To specify proxy on a Unix domain socket, use localhost for host, e.g. +`socks4://localhost/path/to/socket.sock` + +This option overrides any previous use of --proxy, as they are mutually +exclusive. + +This option is superfluous since you can specify a socks4 proxy with --proxy +using a socks4:// protocol prefix. (Added in 7.21.7) + +--preproxy can be used to specify a SOCKS proxy at the same time proxy is used +with an HTTP/HTTPS proxy (added in 7.52.0). In such a case, curl first +connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or +HTTPS proxy. diff --git a/curl/docs/cmdline-opts/socks4a.md b/curl/docs/cmdline-opts/socks4a.md new file mode 100644 index 000000000..04d60b81b --- /dev/null +++ b/curl/docs/cmdline-opts/socks4a.md @@ -0,0 +1,35 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks4a +Arg: +Help: SOCKS4a proxy on given host + port +Added: 7.18.0 +Category: proxy +Multi: single +See-also: + - socks4 + - socks5 + - socks5-hostname +Example: + - --socks4a hostname:4096 $URL +--- + +# `--socks4a` + +Use the specified SOCKS4a proxy. If the port number is not specified, it is +assumed at port 1080. This asks the proxy to resolve the hostname. + +To specify proxy on a Unix domain socket, use localhost for host, e.g. +`socks4a://localhost/path/to/socket.sock` + +This option overrides any previous use of --proxy, as they are mutually +exclusive. + +This option is superfluous since you can specify a socks4a proxy with --proxy +using a socks4a:// protocol prefix. (Added in 7.21.7) + +--preproxy can be used to specify a SOCKS proxy at the same time --proxy is +used with an HTTP/HTTPS proxy (added in 7.52.0). In such a case, curl first +connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or +HTTPS proxy. diff --git a/curl/docs/cmdline-opts/socks5-basic.md b/curl/docs/cmdline-opts/socks5-basic.md new file mode 100644 index 000000000..dc2a5532f --- /dev/null +++ b/curl/docs/cmdline-opts/socks5-basic.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks5-basic +Help: Username/password auth for SOCKS5 proxies +Added: 7.55.0 +Category: proxy auth +Multi: mutex +See-also: + - socks5 +Example: + - --socks5-basic --socks5 hostname:4096 $URL +--- + +# `--socks5-basic` + +Use username/password authentication when connecting to a SOCKS5 proxy. The +username/password authentication is enabled by default. Use --socks5-gssapi to +force GSS-API authentication to SOCKS5 proxies. diff --git a/curl/docs/cmdline-opts/socks5-gssapi-nec.md b/curl/docs/cmdline-opts/socks5-gssapi-nec.md new file mode 100644 index 000000000..eef6b2de9 --- /dev/null +++ b/curl/docs/cmdline-opts/socks5-gssapi-nec.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks5-gssapi-nec +Help: Compatibility with NEC SOCKS5 server +Added: 7.19.4 +Category: proxy auth +Multi: boolean +See-also: + - socks5 +Example: + - --socks5-gssapi-nec --socks5 hostname:4096 $URL +--- + +# `--socks5-gssapi-nec` + +As part of the GSS-API negotiation a protection mode is negotiated. RFC 1961 +says in section 4.3/4.4 it should be protected, but the NEC reference +implementation does not. The option --socks5-gssapi-nec allows the +unprotected exchange of the protection mode negotiation. diff --git a/curl/docs/cmdline-opts/socks5-gssapi-service.md b/curl/docs/cmdline-opts/socks5-gssapi-service.md new file mode 100644 index 000000000..d847e65e2 --- /dev/null +++ b/curl/docs/cmdline-opts/socks5-gssapi-service.md @@ -0,0 +1,18 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks5-gssapi-service +Arg: +Help: SOCKS5 proxy service name for GSS-API +Added: 7.19.4 +Category: proxy auth +Multi: single +See-also: + - socks5 +Example: + - --socks5-gssapi-service sockd --socks5 hostname:4096 $URL +--- + +# `--socks5-gssapi-service` + +Set the service name for a socks server. Default is **rcmd/server-fqdn**. diff --git a/curl/docs/cmdline-opts/socks5-gssapi.md b/curl/docs/cmdline-opts/socks5-gssapi.md new file mode 100644 index 000000000..e17425431 --- /dev/null +++ b/curl/docs/cmdline-opts/socks5-gssapi.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks5-gssapi +Help: Enable GSS-API auth for SOCKS5 proxies +Added: 7.55.0 +Category: proxy auth +Multi: boolean +See-also: + - socks5 +Example: + - --socks5-gssapi --socks5 hostname:4096 $URL +--- + +# `--socks5-gssapi` + +Use GSS-API authentication when connecting to a SOCKS5 proxy. The GSS-API +authentication is enabled by default (if curl is compiled with GSS-API +support). Use --socks5-basic to force username/password authentication to +SOCKS5 proxies. diff --git a/curl/docs/cmdline-opts/socks5-hostname.md b/curl/docs/cmdline-opts/socks5-hostname.md new file mode 100644 index 000000000..0ea2ed739 --- /dev/null +++ b/curl/docs/cmdline-opts/socks5-hostname.md @@ -0,0 +1,34 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks5-hostname +Arg: +Help: SOCKS5 proxy, pass hostname to proxy +Added: 7.18.0 +Category: proxy +Multi: single +See-also: + - socks5 + - socks4a +Example: + - --socks5-hostname proxy.example:7000 $URL +--- + +# `--socks5-hostname` + +Use the specified SOCKS5 proxy (and let the proxy resolve the hostname). If +the port number is not specified, it is assumed at port 1080. + +To specify proxy on a Unix domain socket, use localhost for host, e.g. +`socks5h://localhost/path/to/socket.sock` + +This option overrides any previous use of --proxy, as they are mutually +exclusive. + +This option is superfluous since you can specify a socks5 hostname proxy with +--proxy using a socks5h:// protocol prefix. (Added in 7.21.7) + +--preproxy can be used to specify a SOCKS proxy at the same time --proxy is +used with an HTTP/HTTPS proxy (added in 7.52.0). In such a case, curl first +connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or +HTTPS proxy. diff --git a/curl/docs/cmdline-opts/socks5.md b/curl/docs/cmdline-opts/socks5.md new file mode 100644 index 000000000..4ea660d62 --- /dev/null +++ b/curl/docs/cmdline-opts/socks5.md @@ -0,0 +1,36 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: socks5 +Arg: +Help: SOCKS5 proxy on given host + port +Added: 7.18.0 +Category: proxy +Multi: single +See-also: + - socks5-hostname + - socks4a +Example: + - --socks5 proxy.example:7000 $URL +--- + +# `--socks5` + +Use the specified SOCKS5 proxy - but resolve the hostname locally. If the +port number is not specified, it is assumed at port 1080. + +To specify proxy on a Unix domain socket, use localhost for host, e.g. +`socks5://localhost/path/to/socket.sock` + +This option overrides any previous use of --proxy, as they are mutually +exclusive. + +This option is superfluous since you can specify a socks5 proxy with --proxy +using a socks5:// protocol prefix. (Added in 7.21.7) + +--preproxy can be used to specify a SOCKS proxy at the same time --proxy is +used with an HTTP/HTTPS proxy (added in 7.52.0). In such a case, curl first +connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or +HTTPS proxy. + +This option does not work with FTPS or LDAP. diff --git a/curl/docs/cmdline-opts/speed-limit.md b/curl/docs/cmdline-opts/speed-limit.md new file mode 100644 index 000000000..b95d6e7d4 --- /dev/null +++ b/curl/docs/cmdline-opts/speed-limit.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: speed-limit +Short: Y +Arg: +Help: Stop transfers slower than this +Category: connection +Added: 4.7 +Multi: single +See-also: + - speed-time + - limit-rate + - max-time +Example: + - --speed-limit 300 --speed-time 10 $URL +--- + +# `--speed-limit` + +If a transfer is slower than this set speed (in bytes per second) for a given +number of seconds, it gets aborted. The time period is set with --speed-time +and is 30 seconds by default. diff --git a/curl/docs/cmdline-opts/speed-time.md b/curl/docs/cmdline-opts/speed-time.md new file mode 100644 index 000000000..f27702bec --- /dev/null +++ b/curl/docs/cmdline-opts/speed-time.md @@ -0,0 +1,25 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: speed-time +Short: y +Arg: +Help: Trigger 'speed-limit' abort after this time +Category: connection timeout +Added: 4.7 +Multi: single +See-also: + - speed-limit + - limit-rate +Example: + - --speed-limit 300 --speed-time 10 $URL +--- + +# `--speed-time` + +If a transfer runs slower than speed-limit bytes per second during a +speed-time period, the transfer is aborted. If speed-time is used, the default +speed-limit is 1 unless set with --speed-limit. + +This option controls transfers (in both directions) but does not affect slow +connects etc. If this is a concern for you, try the --connect-timeout option. diff --git a/curl/docs/cmdline-opts/ssl-allow-beast.md b/curl/docs/cmdline-opts/ssl-allow-beast.md new file mode 100644 index 000000000..f9933b77a --- /dev/null +++ b/curl/docs/cmdline-opts/ssl-allow-beast.md @@ -0,0 +1,27 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ssl-allow-beast +Help: Allow security flaw to improve interop +Protocols: TLS +Added: 7.25.0 +Category: tls +Multi: boolean +See-also: + - proxy-ssl-allow-beast + - insecure +Example: + - --ssl-allow-beast $URL +--- + +# `--ssl-allow-beast` + +Do not work around a security flaw in the TLS1.0 protocol known as BEAST. If +this option is not used, the TLS layer may use workarounds known to cause +interoperability problems with some older server implementations. + +This option only changes how curl does TLS 1.0 and has no effect on later TLS +versions. + +**WARNING**: this option loosens the TLS security, and by using this flag you +ask for exactly that. diff --git a/curl/docs/cmdline-opts/ssl-auto-client-cert.md b/curl/docs/cmdline-opts/ssl-auto-client-cert.md new file mode 100644 index 000000000..4f0be5bd7 --- /dev/null +++ b/curl/docs/cmdline-opts/ssl-auto-client-cert.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ssl-auto-client-cert +Help: Use auto client certificate (Schannel) +Added: 7.77.0 +Category: tls +Protocols: TLS +Multi: boolean +See-also: + - proxy-ssl-auto-client-cert +Example: + - --ssl-auto-client-cert $URL +--- + +# `--ssl-auto-client-cert` + +(Schannel) Automatically locate and use a client certificate for +authentication, when requested by the server. Since the server can request any +certificate that supports client authentication in the OS certificate store it +could be a privacy violation and unexpected. diff --git a/curl/docs/cmdline-opts/ssl-no-revoke.md b/curl/docs/cmdline-opts/ssl-no-revoke.md new file mode 100644 index 000000000..16981f14d --- /dev/null +++ b/curl/docs/cmdline-opts/ssl-no-revoke.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ssl-no-revoke +Help: Disable cert revocation checks (Schannel) +Added: 7.44.0 +Protocols: TLS +Category: tls +Multi: boolean +See-also: + - crlfile +Example: + - --ssl-no-revoke $URL +--- + +# `--ssl-no-revoke` + +(Schannel) Disable certificate revocation checks. WARNING: this option loosens +the SSL security, and by using this flag you ask for exactly that. diff --git a/curl/docs/cmdline-opts/ssl-reqd.md b/curl/docs/cmdline-opts/ssl-reqd.md new file mode 100644 index 000000000..f21c145f5 --- /dev/null +++ b/curl/docs/cmdline-opts/ssl-reqd.md @@ -0,0 +1,31 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ssl-reqd +Help: Require SSL/TLS +Protocols: FTP IMAP POP3 SMTP LDAP +Added: 7.20.0 +Category: tls imap pop3 smtp ldap +Multi: boolean +See-also: + - ssl + - insecure +Example: + - --ssl-reqd ftp://example.com +--- + +# `--ssl-reqd` + +Require SSL/TLS for the connection - often referred to as STARTTLS or STLS +because of the involved commands. Terminates the connection if the transfer +cannot be upgraded to use SSL/TLS. + +This option is handled in LDAP (added in 7.81.0). It is fully supported by the +OpenLDAP backend and rejected by the generic ldap backend if explicit TLS is +required. + +This option is unnecessary if you use a URL scheme that in itself implies +immediate and implicit use of TLS, like for FTPS, IMAPS, POP3S, SMTPS and +LDAPS. Such a transfer always fails if the TLS handshake does not work. + +This option was formerly known as --ftp-ssl-reqd. diff --git a/curl/docs/cmdline-opts/ssl-revoke-best-effort.md b/curl/docs/cmdline-opts/ssl-revoke-best-effort.md new file mode 100644 index 000000000..0257e05f4 --- /dev/null +++ b/curl/docs/cmdline-opts/ssl-revoke-best-effort.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ssl-revoke-best-effort +Help: Ignore missing cert CRL dist points +Added: 7.70.0 +Protocols: TLS +Category: tls +Multi: boolean +See-also: + - crlfile + - insecure +Example: + - --ssl-revoke-best-effort $URL +--- + +# `--ssl-revoke-best-effort` + +(Schannel) Ignore certificate revocation checks when they failed due to +missing/offline distribution points for the revocation check lists. diff --git a/curl/docs/cmdline-opts/ssl-sessions.md b/curl/docs/cmdline-opts/ssl-sessions.md new file mode 100644 index 000000000..bb1e251e7 --- /dev/null +++ b/curl/docs/cmdline-opts/ssl-sessions.md @@ -0,0 +1,38 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ssl-sessions +Arg: +Protocols: TLS +Help: Load/save SSL session tickets from/to this file +Added: 8.12.0 +Category: tls +Multi: single +See-also: + - tls-earlydata +Example: + - --ssl-sessions sessions.txt $URL +--- + +# `--ssl-sessions` + +Use the given file to load SSL session tickets into curl's cache before +starting any transfers. At the end of a successful curl run, the cached +SSL sessions tickets are saved to the file, replacing any previous content. + +The file does not have to exist, but curl reports an error if it is +unable to create it. Unused loaded tickets are saved again, unless they +get replaced or purged from the cache for space reasons. + +Using a session file allows `--tls-earlydata` to send the first request +in "0-RTT" mode, should an SSL session with the feature be found. Note that +a server may not support early data. Also note that early data does +not provide forward secrecy, e.g. is not as secure. + +The SSL session tickets are stored as base64 encoded text, each ticket on +its own line. The hostnames are cryptographically salted and hashed. While +this prevents someone from easily seeing the hosts you contacted, they could +still check if a specific hostname matches one of the values. + +This feature requires that the underlying libcurl was built with the +experimental SSL session import/export feature (SSLS-EXPORT) enabled. diff --git a/curl/docs/cmdline-opts/ssl.md b/curl/docs/cmdline-opts/ssl.md new file mode 100644 index 000000000..0c0f28172 --- /dev/null +++ b/curl/docs/cmdline-opts/ssl.md @@ -0,0 +1,35 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: ssl +Help: Try enabling TLS +Protocols: FTP IMAP POP3 SMTP LDAP +Added: 7.20.0 +Category: tls imap pop3 smtp ldap +Multi: boolean +See-also: + - ssl-reqd + - insecure + - ciphers +Example: + - --ssl pop3://example.com/ +--- + +# `--ssl` + +Warning: this is considered an insecure option. Consider using --ssl-reqd +instead to be sure curl upgrades to a secure connection. + +Try to use SSL/TLS for the connection - often referred to as STARTTLS or STLS +because of the involved commands. Reverts to a non-secure connection if the +server does not support SSL/TLS. See also --ftp-ssl-control and --ssl-reqd for +different levels of encryption required. + +This option is handled in LDAP (added in 7.81.0). It is fully supported by the +OpenLDAP backend and ignored by the generic ldap backend. + +Please note that a server may close the connection if the negotiation does +not succeed. + +This option was formerly known as --ftp-ssl (added in 7.11.0). That option +name can still be used but might be removed in a future version. diff --git a/curl/docs/cmdline-opts/sslv2.md b/curl/docs/cmdline-opts/sslv2.md new file mode 100644 index 000000000..ea92a2cb4 --- /dev/null +++ b/curl/docs/cmdline-opts/sslv2.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: 2 +Long: sslv2 +Tags: Versions +Protocols: SSL +Added: 5.9 +Mutexed: sslv3 tlsv1 tlsv1.1 tlsv1.2 +Requires: TLS +Help: SSLv2 +Category: deprecated +Multi: mutex +See-also: + - http1.1 + - http2 +Example: + - --sslv2 $URL +--- + +# `--sslv2` + +This option previously asked curl to use SSLv2, but is now ignored +(added in 7.77.0). SSLv2 is widely considered insecure (see RFC 6176). diff --git a/curl/docs/cmdline-opts/sslv3.md b/curl/docs/cmdline-opts/sslv3.md new file mode 100644 index 000000000..f022124e1 --- /dev/null +++ b/curl/docs/cmdline-opts/sslv3.md @@ -0,0 +1,24 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Short: 3 +Long: sslv3 +Tags: Versions +Protocols: SSL +Added: 5.9 +Mutexed: sslv2 tlsv1 tlsv1.1 tlsv1.2 +Requires: TLS +Help: SSLv3 +Category: deprecated +Multi: mutex +See-also: + - http1.1 + - http2 +Example: + - --sslv3 $URL +--- + +# `--sslv3` + +This option previously asked curl to use SSLv3, but is now ignored +(added in 7.77.0). SSLv3 is widely considered insecure (see RFC 7568). diff --git a/curl/docs/cmdline-opts/stderr.md b/curl/docs/cmdline-opts/stderr.md new file mode 100644 index 000000000..7030e557b --- /dev/null +++ b/curl/docs/cmdline-opts/stderr.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: stderr +Arg: +Help: Where to redirect stderr +Category: verbose global +Added: 6.2 +Multi: single +Scope: global +See-also: + - verbose + - silent +Example: + - --stderr output.txt $URL +--- + +# `--stderr` + +Redirect all writes to stderr to the specified file instead. If the filename +is a plain '-', it is instead written to stdout. diff --git a/curl/docs/cmdline-opts/styled-output.md b/curl/docs/cmdline-opts/styled-output.md new file mode 100644 index 000000000..8193896c5 --- /dev/null +++ b/curl/docs/cmdline-opts/styled-output.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: styled-output +Help: Enable styled output for HTTP headers +Added: 7.61.0 +Category: verbose global +Multi: boolean +Scope: global +See-also: + - head + - verbose +Example: + - --styled-output -I $URL +--- + +# `--styled-output` + +Enable automatic use of bold font styles when writing HTTP headers to the +terminal. Use --no-styled-output to switch them off. + +Styled output requires a terminal that supports bold fonts. This feature is +not present on curl for Windows due to lack of this capability. diff --git a/curl/docs/cmdline-opts/suppress-connect-headers.md b/curl/docs/cmdline-opts/suppress-connect-headers.md new file mode 100644 index 000000000..91d99775c --- /dev/null +++ b/curl/docs/cmdline-opts/suppress-connect-headers.md @@ -0,0 +1,23 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: suppress-connect-headers +Help: Suppress proxy CONNECT response headers +Category: proxy +Added: 7.54.0 +Multi: boolean +See-also: + - dump-header + - show-headers + - proxytunnel +Example: + - --suppress-connect-headers --show-headers -x proxy $URL +--- + +# `--suppress-connect-headers` + +When --proxytunnel is used and a CONNECT request is made, do not output proxy +CONNECT response headers. This option is meant to be used with --dump-header +or --show-headers which are used to show protocol headers in the output. It +has no effect on debug options such as --verbose or --trace, or any +statistics. diff --git a/curl/docs/cmdline-opts/tcp-fastopen.md b/curl/docs/cmdline-opts/tcp-fastopen.md new file mode 100644 index 000000000..7a954d006 --- /dev/null +++ b/curl/docs/cmdline-opts/tcp-fastopen.md @@ -0,0 +1,19 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: tcp-fastopen +Added: 7.49.0 +Help: Use TCP Fast Open +Category: connection +Multi: boolean +See-also: + - false-start +Example: + - --tcp-fastopen $URL +--- + +# `--tcp-fastopen` + +Enable use of TCP Fast Open (RFC 7413). TCP Fast Open is a TCP extension that +allows data to be sent earlier over the connection (before the final +handshake ACK) if the client and server have been connected previously. diff --git a/curl/docs/cmdline-opts/tcp-nodelay.md b/curl/docs/cmdline-opts/tcp-nodelay.md new file mode 100644 index 000000000..6944d7014 --- /dev/null +++ b/curl/docs/cmdline-opts/tcp-nodelay.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: tcp-nodelay +Help: Set TCP_NODELAY +Added: 7.11.2 +Category: connection +Multi: boolean +See-also: + - no-buffer +Example: + - --tcp-nodelay $URL +--- + +# `--tcp-nodelay` + +Turn on the TCP_NODELAY option. See the *curl_easy_setopt(3)* man page for +details about this option. + +curl sets this option by default and you need to explicitly switch it off if +you do not want it on (added in 7.50.2). diff --git a/curl/docs/cmdline-opts/telnet-option.md b/curl/docs/cmdline-opts/telnet-option.md new file mode 100644 index 000000000..a332b1a5c --- /dev/null +++ b/curl/docs/cmdline-opts/telnet-option.md @@ -0,0 +1,28 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: telnet-option +Short: t +Arg: +Help: Set telnet option +Category: telnet +Added: 7.7 +Multi: append +See-also: + - config +Example: + - -t TTYPE=vt100 telnet://example.com/ +--- + +# `--telnet-option` + +Pass options to the telnet protocol. Supported options are: + +## `TTYPE=` +Sets the terminal type. + +## `XDISPLOC=` +Sets the X display location. + +## `NEW_ENV=` +Sets an environment variable. diff --git a/curl/docs/cmdline-opts/tftp-blksize.md b/curl/docs/cmdline-opts/tftp-blksize.md new file mode 100644 index 000000000..21d8476af --- /dev/null +++ b/curl/docs/cmdline-opts/tftp-blksize.md @@ -0,0 +1,21 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: tftp-blksize +Arg: +Help: Set TFTP BLKSIZE option +Protocols: TFTP +Added: 7.20.0 +Category: tftp +Multi: single +See-also: + - tftp-no-options +Example: + - --tftp-blksize 1024 tftp://example.com/file +--- + +# `--tftp-blksize` + +Set the TFTP **BLKSIZE** option (must be 512 or larger). This is the block +size that curl tries to use when transferring data to or from a TFTP +server. By default 512 bytes are used. diff --git a/curl/docs/cmdline-opts/tftp-no-options.md b/curl/docs/cmdline-opts/tftp-no-options.md new file mode 100644 index 000000000..27bbe55bb --- /dev/null +++ b/curl/docs/cmdline-opts/tftp-no-options.md @@ -0,0 +1,20 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: tftp-no-options +Help: Do not send any TFTP options +Protocols: TFTP +Added: 7.48.0 +Category: tftp +Multi: boolean +See-also: + - tftp-blksize +Example: + - --tftp-no-options tftp://192.168.0.1/ +--- + +# `--tftp-no-options` + +Do not send TFTP options requests. This improves interop with some legacy +servers that do not acknowledge or properly implement TFTP options. When this +option is used --tftp-blksize is ignored. diff --git a/curl/docs/cmdline-opts/time-cond.md b/curl/docs/cmdline-opts/time-cond.md new file mode 100644 index 000000000..44cb16634 --- /dev/null +++ b/curl/docs/cmdline-opts/time-cond.md @@ -0,0 +1,34 @@ +--- +c: Copyright (C) Daniel Stenberg, , et al. +SPDX-License-Identifier: curl +Long: time-cond +Short: z +Arg: