1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at https://curl.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 # SPDX-License-Identifier: curl
23 #***************************************************************************
24 dnl Process this file with autoconf to produce a configure script.
28 dnl We don't know the version number "statically" so we use a dash here
29 AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/])
33 CURL_OVERRIDE_AUTOCONF
35 dnl configure script copyright
36 AC_COPYRIGHT([Copyright (C) Daniel Stenberg, <daniel@haxx.se>
37 This configure script may be copied, distributed and modified under the
38 terms of the curl license; see COPYING for more details])
40 AC_CONFIG_SRCDIR([lib/urldata.h])
41 AC_CONFIG_HEADERS(lib/curl_config.h)
42 AC_CONFIG_MACRO_DIR([m4])
44 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
46 CURL_CHECK_OPTION_DEBUG
47 CURL_CHECK_OPTION_OPTIMIZE
48 CURL_CHECK_OPTION_WARNINGS
49 CURL_CHECK_OPTION_WERROR
50 CURL_CHECK_OPTION_CURLDEBUG
51 CURL_CHECK_OPTION_SYMBOL_HIDING
52 CURL_CHECK_OPTION_ARES
56 XC_CHECK_PATH_SEPARATOR
59 # save the configure arguments
61 CONFIGURE_OPTIONS="\"$ac_configure_args\""
62 AC_SUBST(CONFIGURE_OPTIONS)
64 dnl SED is mandatory for configure process and libtool.
65 dnl Set it now, allowing it to be changed later.
66 if test -z "$SED"; then
67 dnl allow it to be overridden
68 AC_PATH_PROG([SED], [sed], [not_found],
69 [$PATH:/usr/bin:/usr/local/bin])
70 if test -z "$SED" || test "$SED" = "not_found"; then
71 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
76 dnl GREP is mandatory for configure process and libtool.
77 dnl Set it now, allowing it to be changed later.
78 if test -z "$GREP"; then
79 dnl allow it to be overridden
80 AC_PATH_PROG([GREP], [grep], [not_found],
81 [$PATH:/usr/bin:/usr/local/bin])
82 if test -z "$GREP" || test "$GREP" = "not_found"; then
83 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
88 dnl 'grep -E' is mandatory for configure process and libtool.
89 dnl Set it now, allowing it to be changed later.
90 if test -z "$EGREP"; then
91 dnl allow it to be overridden
92 AC_MSG_CHECKING([that grep -E works])
93 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
98 AC_PATH_PROG([EGREP], [egrep], [not_found],
99 [$PATH:/usr/bin:/usr/local/bin])
102 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
103 AC_MSG_ERROR([grep -E is not working and egrep is not found in PATH. Cannot continue.])
107 dnl AR is mandatory for configure process and libtool.
108 dnl This is target dependent, so check it as a tool.
109 if test -z "$AR"; then
110 dnl allow it to be overridden
111 AC_PATH_TOOL([AR], [ar], [not_found],
112 [$PATH:/usr/bin:/usr/local/bin])
113 if test -z "$AR" || test "$AR" = "not_found"; then
114 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
121 dnl figure out the libcurl version
122 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
126 dnl for --enable-code-coverage
130 AC_MSG_CHECKING([curl version])
131 AC_MSG_RESULT($CURLVERSION)
133 AC_SUBST(CURLVERSION)
136 dnl we extract the numerical version for curl-config only
137 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
140 dnl Solaris pkgadd support definitions
141 PKGADD_PKG="HAXXcurl"
142 PKGADD_NAME="curl - a client that groks URLs"
143 PKGADD_VENDOR="curl.se"
145 AC_SUBST(PKGADD_NAME)
146 AC_SUBST(PKGADD_VENDOR)
149 dnl initialize all the info variables
150 curl_ssl_msg="no (--with-{openssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )"
151 curl_ssh_msg="no (--with-{libssh,libssh2})"
152 curl_zlib_msg="no (--with-zlib)"
153 curl_brotli_msg="no (--with-brotli)"
154 curl_zstd_msg="no (--with-zstd)"
155 curl_gss_msg="no (--with-gssapi)"
156 curl_gsasl_msg="no (--with-gsasl)"
157 curl_tls_srp_msg="no (--enable-tls-srp)"
158 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
159 curl_ipv6_msg="no (--enable-ipv6)"
160 curl_unix_sockets_msg="no (--enable-unix-sockets)"
161 curl_idn_msg="no (--with-{libidn2,winidn})"
162 curl_manual_msg="no (--enable-manual)"
163 curl_libcurl_msg="enabled (--disable-libcurl-option)"
164 curl_verbose_msg="enabled (--disable-verbose)"
165 curl_sspi_msg="no (--enable-sspi)"
166 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
167 curl_ldaps_msg="no (--enable-ldaps)"
168 curl_rtsp_msg="no (--enable-rtsp)"
169 curl_rtmp_msg="no (--with-librtmp)"
170 curl_psl_msg="no (--with-libpsl)"
171 curl_altsvc_msg="enabled (--disable-alt-svc)"
172 curl_headers_msg="enabled (--disable-headers-api)"
173 curl_hsts_msg="enabled (--disable-hsts)"
174 curl_ws_msg="no (--enable-websockets)"
176 curl_h1_msg="enabled (internal)"
177 curl_h2_msg="no (--with-nghttp2, --with-hyper)"
178 curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-msh3)"
184 dnl Save some initial values the user might have provided
186 INITIAL_LDFLAGS=$LDFLAGS
190 dnl Generates a shell script to run the compiler with LD_LIBRARY_PATH set to
191 dnl the value used right now. This lets CURL_RUN_IFELSE set LD_LIBRARY_PATH to
192 dnl something different but only have that affect the execution of the results
193 dnl of the compile, not change the libraries for the compiler itself.
195 compilersh="run-compiler"
198 CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
199 export CURL_SAVED_LD_LIBRARY_PATH
200 cat <<\EOF > "$compilersh"
203 LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH"
204 export LD_LIBRARY_PATH
208 dnl **********************************************************************
209 dnl See which TLS backend(s) that are requested. Just do all the
210 dnl TLS AC_ARG_WITH() invokes here and do the checks later
211 dnl **********************************************************************
213 AC_ARG_WITH(schannel,dnl
214 AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
215 OPT_SCHANNEL=$withval
216 TLSCHOICE="schannel")
218 OPT_SECURETRANSPORT=no
219 AC_ARG_WITH(secure-transport,dnl
220 AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),[
221 OPT_SECURETRANSPORT=$withval
222 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
226 AC_ARG_WITH(amissl,dnl
227 AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
229 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
233 dnl Default to no CA bundle
236 AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
237 AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
240 if test X"$withval" != Xno; then
241 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
247 AC_ARG_WITH(openssl,dnl
248 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]),[
250 if test X"$withval" != Xno; then
251 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
256 AC_ARG_WITH(gnutls,dnl
257 AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
259 if test X"$withval" != Xno; then
260 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
265 AC_ARG_WITH(mbedtls,dnl
266 AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
268 if test X"$withval" != Xno; then
269 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
274 AC_ARG_WITH(wolfssl,dnl
275 AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),[
277 if test X"$withval" != Xno; then
278 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
283 AC_ARG_WITH(bearssl,dnl
284 AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),[
286 if test X"$withval" != Xno; then
287 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
292 AC_ARG_WITH(rustls,dnl
293 AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),[
295 if test X"$withval" != Xno; then
296 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
297 experimental="$experimental rustls"
302 AC_ARG_WITH(nss-deprecated,dnl
303 AS_HELP_STRING([--with-nss-deprecated],[confirm you realize NSS is going away]),
304 if test X"$withval" != Xno; then
305 OPT_NSS_AWARE=$withval
311 AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),
313 if test X"$withval" != Xno; then
315 if test X"$OPT_NSS_AWARE" = "Xno" ; then
316 AC_MSG_ERROR([NSS use must be confirmed using --with-nss-deprecated. NSS support will be dropped from curl in August 2022. See docs/DEPRECATE.md])
319 [TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS"]
324 AC_ARG_WITH(test-nghttpx,dnl
325 AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]),
326 TEST_NGHTTPX=$withval
327 if test X"$OPT_TEST_NGHTTPX" = "Xno" ; then
331 AC_SUBST(TEST_NGHTTPX)
334 AC_ARG_WITH(test-caddy,dnl
335 AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]),
337 if test X"$OPT_CADDY" = "Xno" ; then
343 dnl we'd like a httpd+apachectl as test server
345 HTTPD_ENABLED="maybe"
346 AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH],
347 [where to find httpd/apache2 for testing])],
348 [request_httpd=$withval], [request_httpd=check])
349 if test x"$request_httpd" = "xcheck" -o x"$request_httpd" = "xyes"; then
350 if test -x "/usr/sbin/apache2" -a -x "/usr/sbin/apache2ctl"; then
351 # common location on distros (debian/ubuntu)
352 HTTPD="/usr/sbin/apache2"
353 APACHECTL="/usr/sbin/apache2ctl"
354 AC_PATH_PROG([APXS], [apxs])
355 if test "x$APXS" = "x"; then
356 AC_MSG_NOTICE([apache2-dev not installed, httpd tests disabled])
360 AC_PATH_PROG([HTTPD], [httpd])
361 if test "x$HTTPD" = "x"; then
362 AC_PATH_PROG([HTTPD], [apache2])
364 AC_PATH_PROG([APACHECTL], [apachectl])
365 AC_PATH_PROG([APXS], [apxs])
366 if test "x$HTTPD" = "x" -o "x$APACHECTL" = "x"; then
367 AC_MSG_NOTICE([httpd/apache2 not in PATH, http tests disabled])
370 if test "x$APXS" = "x"; then
371 AC_MSG_NOTICE([apxs not in PATH, http tests disabled])
375 elif test x"$request_httpd" != "xno"; then
376 HTTPD="${request_httpd}/bin/httpd"
377 APACHECTL="${request_httpd}/bin/apachectl"
378 APXS="${request_httpd}/bin/apxs"
379 if test ! -x "${HTTPD}"; then
380 AC_MSG_NOTICE([httpd not found as ${HTTPD}, http tests disabled])
382 elif test ! -x "${APACHECTL}"; then
383 AC_MSG_NOTICE([apachectl not found as ${APACHECTL}, http tests disabled])
385 elif test ! -x "${APXS}"; then
386 AC_MSG_NOTICE([apxs not found as ${APXS}, http tests disabled])
389 AC_MSG_NOTICE([using HTTPD=$HTTPD for tests])
392 if test x"$HTTPD_ENABLED" = "xno"; then
401 dnl the nghttpx we might use in httpd testing
402 if test "x$TEST_NGHTTPX" != "x" -a "x$TEST_NGHTTPX" != "xnghttpx"; then
403 HTTPD_NGHTTPX="$TEST_NGHTTPX"
405 AC_PATH_PROG([HTTPD_NGHTTPX], [nghttpx], [],
406 [$PATH:/usr/bin:/usr/local/bin])
408 AC_SUBST(HTTPD_NGHTTPX)
410 dnl the Caddy server we might use in testing
411 if test "x$TEST_CADDY" != "x"; then
414 AC_PATH_PROG([CADDY], [caddy])
418 dnl If no TLS choice has been made, check if it was explicitly disabled or
419 dnl error out to force the user to decide.
420 if test -z "$TLSCHOICE"; then
421 if test "x$OPT_SSL" != "xno"; then
422 AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
431 --with-openssl (also works for BoringSSL and libressl)
434 --with-secure-transport
440 AC_ARG_WITH(darwinssl,,
441 AC_MSG_ERROR([--with-darwin-ssl no longer works!]))
444 dnl Detect the canonical host and target build environment
448 dnl Get system canonical name
449 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
451 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
452 AC_SUBST(AR_FLAGS, [cr])
454 dnl This defines _ALL_SOURCE for AIX
455 CURL_CHECK_AIX_ALL_SOURCE
457 dnl Our configure and build reentrant settings
458 CURL_CONFIGURE_THREAD_SAFE
459 CURL_CONFIGURE_REENTRANT
461 dnl check for how to do large files
466 LT_LANG([Windows Resource])
469 # Automake conditionals based on libtool related checks
472 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
473 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
474 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
475 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
476 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
477 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
480 # Due to libtool and automake machinery limitations of not allowing
481 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
482 # inclusion of these in shared or static libraries, we are forced to
483 # build using separate configure runs for shared and static libraries
484 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
485 # to compile objects for each kind of library. Notice that relying on
486 # the '-DPIC' CFLAG that libtool provides is not valid given that the
487 # user might for example choose to build static libraries with PIC.
491 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
492 # targeting a static library and not building its shared counterpart.
495 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
496 [test "x$xc_lt_build_static_only" = 'xyes'])
499 # Make staticlib CPPFLAG variable and its definition visible in output
500 # files unconditionally, providing an empty definition unless strictly
501 # targeting a static library and not building its shared counterpart.
504 CPPFLAG_CURL_STATICLIB=
505 if test "x$xc_lt_build_static_only" = 'xyes'; then
506 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
508 AC_SUBST([CPPFLAG_CURL_STATICLIB])
511 # Determine whether all dependent libraries must be specified when linking
512 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
518 AC_SUBST(REQUIRE_LIB_DEPS)
519 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
521 dnl check if there's a way to force code inline
524 dnl **********************************************************************
525 dnl platform/compiler/architecture specific checks/flags
526 dnl **********************************************************************
529 CURL_SET_COMPILER_BASIC_OPTS
530 CURL_SET_COMPILER_DEBUG_OPTS
531 CURL_SET_COMPILER_OPTIMIZE_OPTS
532 CURL_SET_COMPILER_WARNING_OPTS
534 if test "$compiler_id" = "INTEL_UNIX_C"; then
536 if test "$compiler_num" -ge "1000"; then
537 dnl icc 10.X or later
538 CFLAGS="$CFLAGS -shared-intel"
539 elif test "$compiler_num" -ge "900"; then
541 CFLAGS="$CFLAGS -i-dynamic"
547 if test X"$want_werror" = Xyes; then
548 CURL_CFLAG_EXTRAS="-Werror"
549 if test "$compiler_id" = "GNU_C"; then
550 dnl enable -pedantic-errors for GCC 5 and later,
551 dnl as before that it was the same as -Werror=pedantic
552 if test "$compiler_num" -ge "500"; then
553 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
557 AC_SUBST(CURL_CFLAG_EXTRAS)
559 CURL_CHECK_COMPILER_HALT_ON_ERROR
560 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
561 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
562 CURL_CHECK_COMPILER_SYMBOL_HIDING
565 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
567 supports_unittests=yes
568 # cross-compilation of unit tests static library/programs fails when
569 # libcurl shared library is built. This might be due to a libtool or
570 # automake issue. In this case we disable unit tests.
571 if test "x$cross_compiling" != "xno" &&
572 test "x$enable_shared" != "xno"; then
573 supports_unittests=no
576 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
577 # a problem related with OpenSSL headers and library versions not matching.
578 # Disable unit tests while time to further investigate this is found.
581 if test "$compiler_id" = "GNU_C"; then
582 supports_unittests=no
587 # All AIX autobuilds fails unit tests linking against unittests library
588 # due to unittests library being built with no symbols or members. Libtool ?
589 # Disable unit tests while time to further investigate this is found.
592 supports_unittests=no
596 dnl Build unit tests when option --enable-debug is given.
597 if test "x$want_debug" = "xyes" &&
598 test "x$supports_unittests" = "xyes"; then
603 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
605 # For original MinGW (ie not MinGW-w64) define the Windows minimum supported OS
606 # version to Windows XP (0x501) if it hasn't already been defined by the user.
607 # Without this override original MinGW defaults the version to Windows NT 4.0.
608 # Note original MinGW sets _WIN32_WINNT if not defined to whatever WINVER is.
611 AC_MSG_CHECKING([if MinGW minimum supported OS should be set to XP])
616 #if defined(__MINGW64_VERSION_MAJOR) || \
618 defined(_WIN32_WINNT)
623 CPPFLAGS="$CPPFLAGS -DWINVER=0x501"
631 # Detect original MinGW (not MinGW-w64)
632 curl_mingw_original=no
635 AC_MSG_CHECKING([using original MinGW (not MinGW-w64)])
640 #if defined(__MINGW64_VERSION_MAJOR)
645 curl_mingw_original=yes
655 AC_ARG_WITH(mingw1-deprecated,dnl
656 AS_HELP_STRING([--with-mingw1-deprecated],[confirm you realize support for mingw v1 is dying]),
657 if test X"$withval" != Xno; then
662 if test -n "$curl_mingw_die"; then
663 AC_MSG_ERROR([support for mingw v1 is going away, enable temporarily with --with-mingw1-deprecated])
666 dnl **********************************************************************
667 dnl Compilation based checks should not be done before this point.
668 dnl **********************************************************************
670 dnl **********************************************************************
671 dnl Make sure that our checks for headers windows.h winsock2.h
672 dnl and ws2tcpip.h take precedence over any other further checks which
673 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
674 dnl this specific header files. And do them before its results are used.
675 dnl **********************************************************************
677 CURL_CHECK_HEADER_WINDOWS
678 CURL_CHECK_NATIVE_WINDOWS
679 case X-"$curl_cv_native_windows" in
681 CURL_CHECK_HEADER_WINSOCK2
682 CURL_CHECK_HEADER_WS2TCPIP
683 CURL_CHECK_HEADER_WINCRYPT
686 curl_cv_header_winsock2_h="no"
687 curl_cv_header_ws2tcpip_h="no"
688 curl_cv_header_wincrypt_h="no"
691 CURL_CHECK_WIN32_LARGEFILE
692 CURL_CHECK_WIN32_CRYPTO
695 CURL_DARWIN_SYSTEMCONFIGURATION
696 CURL_SUPPORTS_BUILTIN_AVAILABLE
698 AM_CONDITIONAL([HAVE_WINDRES],
699 [test "$curl_cv_native_windows" = "yes" && test -n "${RC}"])
701 if test "$curl_cv_native_windows" = "yes"; then
702 AM_COND_IF([HAVE_WINDRES],,
703 [AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])])
706 dnl ************************************************************
707 dnl switch off particular protocols
709 AC_MSG_CHECKING([whether to support http])
711 AS_HELP_STRING([--enable-http],[Enable HTTP support])
712 AS_HELP_STRING([--disable-http],[Disable HTTP support]),
713 [ case "$enableval" in
716 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
718 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
719 AC_SUBST(CURL_DISABLE_HTTP, [1])
720 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
721 AC_SUBST(CURL_DISABLE_RTSP, [1])
722 dnl toggle off alt-svc too when HTTP is disabled
723 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
724 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
725 curl_h1_msg="no (--enable-http, --with-hyper)"
726 curl_altsvc_msg="no";
727 curl_hsts_msg="no (--enable-hsts)";
731 *) AC_MSG_RESULT(yes)
736 AC_MSG_CHECKING([whether to support ftp])
738 AS_HELP_STRING([--enable-ftp],[Enable FTP support])
739 AS_HELP_STRING([--disable-ftp],[Disable FTP support]),
740 [ case "$enableval" in
743 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
744 AC_SUBST(CURL_DISABLE_FTP, [1])
746 *) AC_MSG_RESULT(yes)
751 AC_MSG_CHECKING([whether to support file])
753 AS_HELP_STRING([--enable-file],[Enable FILE support])
754 AS_HELP_STRING([--disable-file],[Disable FILE support]),
755 [ case "$enableval" in
758 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
759 AC_SUBST(CURL_DISABLE_FILE, [1])
761 *) AC_MSG_RESULT(yes)
766 AC_MSG_CHECKING([whether to support ldap])
768 AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
769 AS_HELP_STRING([--disable-ldap],[Disable LDAP support]),
770 [ case "$enableval" in
773 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
774 AC_SUBST(CURL_DISABLE_LDAP, [1])
786 AC_MSG_CHECKING([whether to support ldaps])
788 AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
789 AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
790 [ case "$enableval" in
793 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
794 AC_SUBST(CURL_DISABLE_LDAPS, [1])
796 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
797 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
798 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
799 AC_SUBST(CURL_DISABLE_LDAPS, [1])
802 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
803 AC_SUBST(HAVE_LDAP_SSL, [1])
807 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
809 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
810 AC_SUBST(CURL_DISABLE_LDAPS, [1])
813 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
814 AC_SUBST(HAVE_LDAP_SSL, [1])
818 dnl **********************************************************************
820 dnl **********************************************************************
825 AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
826 AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
827 [OPT_HYPER=$withval])
830 dnl --without-hyper option used
834 dnl --with-hyper option used without path
839 dnl --with-hyper option used with path
841 want_hyper_path="$withval"
845 if test X"$want_hyper" != Xno; then
846 if test "x$disable_http" = "xyes"; then
847 AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
850 dnl backup the pre-hyper variables
851 CLEANLDFLAGS="$LDFLAGS"
852 CLEANCPPFLAGS="$CPPFLAGS"
855 CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
857 if test "$PKGCONFIG" != "no" ; then
858 LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
859 $PKGCONFIG --libs-only-l hyper`
860 CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
861 $PKGCONFIG --cflags-only-I hyper`
862 LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
863 $PKGCONFIG --libs-only-L hyper`
865 dnl no hyper pkg-config found
866 LIB_HYPER="-lhyper -ldl -lpthread -lm"
867 if test X"$want_hyper" != Xdefault; then
868 CPP_HYPER=-I"$want_hyper_path/capi/include"
869 LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
872 if test -n "$LIB_HYPER"; then
873 AC_MSG_NOTICE([-l is $LIB_HYPER])
874 AC_MSG_NOTICE([-I is $CPP_HYPER])
875 AC_MSG_NOTICE([-L is $LD_HYPER])
877 LDFLAGS="$LDFLAGS $LD_HYPER"
878 CPPFLAGS="$CPPFLAGS $CPP_HYPER"
879 LIBS="$LIB_HYPER $LIBS"
881 if test "x$cross_compiling" != "xyes"; then
882 dnl remove -L, separate with colon if more than one
883 DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
886 AC_CHECK_LIB(hyper, hyper_io_new,
888 AC_CHECK_HEADERS(hyper.h,
889 experimental="$experimental Hyper"
890 AC_MSG_NOTICE([Hyper support is experimental])
891 curl_h1_msg="enabled (Hyper)"
892 curl_h2_msg=$curl_h1_msg
894 AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
895 AC_SUBST(USE_HYPER, [1])
896 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
897 export CURL_LIBRARY_PATH
898 AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]),
901 for d in `echo $DIR_HYPER | $SED -e 's/:/ /'`; do
902 if test -f "$d/libhyper.a"; then
903 AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
906 AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
911 if test X"$want_hyper" != Xno; then
912 AC_MSG_NOTICE([Disable RTSP support with hyper])
913 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
914 AC_SUBST(CURL_DISABLE_RTSP, [1])
916 AC_MSG_CHECKING([whether to support rtsp])
918 AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
919 AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
920 [ case "$enableval" in
923 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
924 AC_SUBST(CURL_DISABLE_RTSP, [1])
927 if test x$CURL_DISABLE_HTTP = x1 ; then
928 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
931 curl_rtsp_msg="enabled"
935 if test "x$CURL_DISABLE_HTTP" != "x1"; then
937 curl_rtsp_msg="enabled"
944 AC_MSG_CHECKING([whether to support proxies])
946 AS_HELP_STRING([--enable-proxy],[Enable proxy support])
947 AS_HELP_STRING([--disable-proxy],[Disable proxy support]),
948 [ case "$enableval" in
951 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
952 AC_SUBST(CURL_DISABLE_PROXY, [1])
955 *) AC_MSG_RESULT(yes)
961 AC_MSG_CHECKING([whether to support dict])
963 AS_HELP_STRING([--enable-dict],[Enable DICT support])
964 AS_HELP_STRING([--disable-dict],[Disable DICT support]),
965 [ case "$enableval" in
968 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
969 AC_SUBST(CURL_DISABLE_DICT, [1])
971 *) AC_MSG_RESULT(yes)
976 AC_MSG_CHECKING([whether to support telnet])
977 AC_ARG_ENABLE(telnet,
978 AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
979 AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
980 [ case "$enableval" in
983 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
984 AC_SUBST(CURL_DISABLE_TELNET, [1])
986 *) AC_MSG_RESULT(yes)
991 AC_MSG_CHECKING([whether to support tftp])
993 AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
994 AS_HELP_STRING([--disable-tftp],[Disable TFTP support]),
995 [ case "$enableval" in
998 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
999 AC_SUBST(CURL_DISABLE_TFTP, [1])
1001 *) AC_MSG_RESULT(yes)
1007 AC_MSG_CHECKING([whether to support pop3])
1009 AS_HELP_STRING([--enable-pop3],[Enable POP3 support])
1010 AS_HELP_STRING([--disable-pop3],[Disable POP3 support]),
1011 [ case "$enableval" in
1014 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
1015 AC_SUBST(CURL_DISABLE_POP3, [1])
1017 *) AC_MSG_RESULT(yes)
1024 AC_MSG_CHECKING([whether to support imap])
1026 AS_HELP_STRING([--enable-imap],[Enable IMAP support])
1027 AS_HELP_STRING([--disable-imap],[Disable IMAP support]),
1028 [ case "$enableval" in
1031 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
1032 AC_SUBST(CURL_DISABLE_IMAP, [1])
1034 *) AC_MSG_RESULT(yes)
1041 AC_MSG_CHECKING([whether to support smb])
1043 AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
1044 AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
1045 [ case "$enableval" in
1048 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
1049 AC_SUBST(CURL_DISABLE_SMB, [1])
1051 *) AC_MSG_RESULT(yes)
1057 AC_MSG_CHECKING([whether to support smtp])
1059 AS_HELP_STRING([--enable-smtp],[Enable SMTP support])
1060 AS_HELP_STRING([--disable-smtp],[Disable SMTP support]),
1061 [ case "$enableval" in
1064 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
1065 AC_SUBST(CURL_DISABLE_SMTP, [1])
1067 *) AC_MSG_RESULT(yes)
1073 AC_MSG_CHECKING([whether to support gopher])
1074 AC_ARG_ENABLE(gopher,
1075 AS_HELP_STRING([--enable-gopher],[Enable Gopher support])
1076 AS_HELP_STRING([--disable-gopher],[Disable Gopher support]),
1077 [ case "$enableval" in
1080 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
1081 AC_SUBST(CURL_DISABLE_GOPHER, [1])
1083 *) AC_MSG_RESULT(yes)
1089 AC_MSG_CHECKING([whether to support mqtt])
1091 AS_HELP_STRING([--enable-mqtt],[Enable MQTT support])
1092 AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
1093 [ case "$enableval" in
1096 AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
1097 AC_SUBST(CURL_DISABLE_MQTT, [1])
1099 *) AC_MSG_RESULT(yes)
1105 dnl **********************************************************************
1106 dnl Check for built-in manual
1107 dnl **********************************************************************
1109 AC_MSG_CHECKING([whether to provide built-in manual])
1110 AC_ARG_ENABLE(manual,
1111 AS_HELP_STRING([--enable-manual],[Enable built-in manual])
1112 AS_HELP_STRING([--disable-manual],[Disable built-in manual]),
1113 [ case "$enableval" in
1117 *) AC_MSG_RESULT(yes)
1124 dnl The actual use of the USE_MANUAL variable is done much later in this
1125 dnl script to allow other actions to disable it as well.
1127 dnl ************************************************************
1128 dnl disable C code generation support
1130 AC_MSG_CHECKING([whether to enable generation of C code])
1131 AC_ARG_ENABLE(libcurl_option,
1132 AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
1133 AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
1134 [ case "$enableval" in
1137 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
1138 curl_libcurl_msg="no"
1140 *) AC_MSG_RESULT(yes)
1146 dnl **********************************************************************
1147 dnl Checks for libraries.
1148 dnl **********************************************************************
1150 AC_MSG_CHECKING([whether to use libgcc])
1151 AC_ARG_ENABLE(libgcc,
1152 AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
1153 [ case "$enableval" in
1158 *) AC_MSG_RESULT(no)
1166 dnl gethostbyname without lib or in the nsl lib?
1167 AC_CHECK_FUNC(gethostbyname,
1168 [HAVE_GETHOSTBYNAME="1"
1170 [ AC_CHECK_LIB(nsl, gethostbyname,
1171 [HAVE_GETHOSTBYNAME="1"
1176 if test "$HAVE_GETHOSTBYNAME" != "1"
1178 dnl gethostbyname in the socket lib?
1179 AC_CHECK_LIB(socket, gethostbyname,
1180 [HAVE_GETHOSTBYNAME="1"
1181 LIBS="-lsocket $LIBS"
1185 if test "$HAVE_GETHOSTBYNAME" != "1"
1187 dnl gethostbyname in the watt lib?
1188 AC_CHECK_LIB(watt, gethostbyname,
1189 [HAVE_GETHOSTBYNAME="1"
1190 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
1191 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
1196 dnl At least one system has been identified to require BOTH nsl and socket
1197 dnl libs at the same time to link properly.
1198 if test "$HAVE_GETHOSTBYNAME" != "1"
1200 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
1201 my_ac_save_LIBS=$LIBS
1202 LIBS="-lnsl -lsocket $LIBS"
1209 AC_MSG_RESULT([yes])
1210 HAVE_GETHOSTBYNAME="1"
1213 LIBS=$my_ac_save_LIBS
1217 if test "$HAVE_GETHOSTBYNAME" != "1"
1219 dnl This is for winsock systems
1220 if test "$curl_cv_header_windows_h" = "yes"; then
1221 if test "$curl_cv_header_winsock2_h" = "yes"; then
1222 winsock_LIB="-lws2_32"
1224 if test ! -z "$winsock_LIB"; then
1225 my_ac_save_LIBS=$LIBS
1226 LIBS="$winsock_LIB $LIBS"
1227 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
1230 #ifdef HAVE_WINDOWS_H
1231 #ifndef WIN32_LEAN_AND_MEAN
1232 #define WIN32_LEAN_AND_MEAN
1234 #include <windows.h>
1235 #ifdef HAVE_WINSOCK2_H
1236 #include <winsock2.h>
1240 gethostbyname("www.dummysite.com");
1243 AC_MSG_RESULT([yes])
1244 HAVE_GETHOSTBYNAME="1"
1248 LIBS=$my_ac_save_LIBS
1254 if test "$HAVE_GETHOSTBYNAME" != "1"
1256 dnl This is for Minix 3.1
1257 AC_MSG_CHECKING([for gethostbyname for Minix 3])
1260 /* Older Minix versions may need <net/gen/netdb.h> here instead */
1263 gethostbyname("www.dummysite.com");
1266 AC_MSG_RESULT([yes])
1267 HAVE_GETHOSTBYNAME="1"
1273 if test "$HAVE_GETHOSTBYNAME" != "1"
1275 dnl This is for eCos with a stubbed DNS implementation
1276 AC_MSG_CHECKING([for gethostbyname for eCos])
1282 gethostbyname("www.dummysite.com");
1285 AC_MSG_RESULT([yes])
1286 HAVE_GETHOSTBYNAME="1"
1292 if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
1294 dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
1295 AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
1298 #define __USE_INLINE__
1299 #include <proto/bsdsocket.h>
1301 struct SocketIFace *ISocket = NULL;
1303 struct Library *SocketBase = NULL;
1306 gethostbyname("www.dummysite.com");
1309 AC_MSG_RESULT([yes])
1310 HAVE_GETHOSTBYNAME="1"
1311 HAVE_PROTO_BSDSOCKET_H="1"
1312 AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
1313 AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
1319 if test "$HAVE_GETHOSTBYNAME" != "1"
1321 dnl gethostbyname in the network lib - for Haiku OS
1322 AC_CHECK_LIB(network, gethostbyname,
1323 [HAVE_GETHOSTBYNAME="1"
1324 LIBS="-lnetwork $LIBS"
1328 if test "$HAVE_GETHOSTBYNAME" != "1"; then
1329 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
1332 CURL_CHECK_LIBS_CONNECT
1334 CURL_NETWORK_LIBS=$LIBS
1336 dnl **********************************************************************
1337 dnl In case that function clock_gettime with monotonic timer is available,
1338 dnl check for additional required libraries.
1339 dnl **********************************************************************
1340 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
1342 dnl Check for even better option
1343 CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW
1345 dnl **********************************************************************
1346 dnl The preceding library checks are all potentially useful for test
1347 dnl servers and libtest cases which require networking and clock_gettime
1348 dnl support. Save the list of required libraries at this point for use
1349 dnl while linking those test servers and programs.
1350 dnl **********************************************************************
1351 CURL_NETWORK_AND_TIME_LIBS=$LIBS
1353 dnl **********************************************************************
1354 dnl Check for the presence of ZLIB libraries and headers
1355 dnl **********************************************************************
1357 dnl Check for & handle argument to --with-zlib.
1359 clean_CPPFLAGS=$CPPFLAGS
1360 clean_LDFLAGS=$LDFLAGS
1364 AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1365 AS_HELP_STRING([--without-zlib],[disable use of zlib]),
1366 [OPT_ZLIB="$withval"])
1368 if test "$OPT_ZLIB" = "no" ; then
1369 AC_MSG_WARN([zlib disabled])
1371 if test "$OPT_ZLIB" = "yes" ; then
1375 if test -z "$OPT_ZLIB" ; then
1376 CURL_CHECK_PKGCONFIG(zlib)
1378 if test "$PKGCONFIG" != "no" ; then
1379 LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
1380 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
1381 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
1386 if test -z "$HAVE_LIBZ"; then
1388 dnl Check for the lib without setting any new path, since many
1389 dnl people have it in the default path
1391 AC_CHECK_LIB(z, inflateEnd,
1392 dnl libz found, set the variable
1395 dnl if no lib found, try /usr/local
1396 [OPT_ZLIB="/usr/local"])
1400 dnl Add a nonempty path to the compiler flags
1401 if test -n "$OPT_ZLIB"; then
1402 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1403 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1406 AC_CHECK_HEADER(zlib.h,
1408 dnl zlib.h was found
1410 dnl if the lib wasn't found already, try again with the new paths
1411 if test "$HAVE_LIBZ" != "1"; then
1412 AC_CHECK_LIB(z, gzread,
1414 dnl the lib was found!
1418 [ CPPFLAGS=$clean_CPPFLAGS
1419 LDFLAGS=$clean_LDFLAGS])
1423 dnl zlib.h was not found, restore the flags
1424 CPPFLAGS=$clean_CPPFLAGS
1425 LDFLAGS=$clean_LDFLAGS]
1428 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1430 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1432 CPPFLAGS=$clean_CPPFLAGS
1433 LDFLAGS=$clean_LDFLAGS
1435 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1437 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1438 CPPFLAGS=$clean_CPPFLAGS
1439 LDFLAGS=$clean_LDFLAGS
1441 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1443 dnl both header and lib were found!
1445 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1448 LIBS="-lz $clean_LIBS"
1450 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1452 AC_MSG_NOTICE([found both libz and libz.h header])
1453 curl_zlib_msg="enabled"
1457 dnl set variable for use in automakefile(s)
1458 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1461 dnl **********************************************************************
1462 dnl Check for the presence of BROTLI decoder libraries and headers
1463 dnl **********************************************************************
1465 dnl Brotli project home page: https://github.com/google/brotli
1467 dnl Default to compiler & linker defaults for BROTLI files & libraries.
1469 AC_ARG_WITH(brotli,dnl
1470 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])
1471 AS_HELP_STRING([--without-brotli], [disable BROTLI]),
1472 OPT_BROTLI=$withval)
1474 if test X"$OPT_BROTLI" != Xno; then
1475 dnl backup the pre-brotli variables
1476 CLEANLDFLAGS="$LDFLAGS"
1477 CLEANCPPFLAGS="$CPPFLAGS"
1480 case "$OPT_BROTLI" in
1482 dnl --with-brotli (without path) used
1483 CURL_CHECK_PKGCONFIG(libbrotlidec)
1485 if test "$PKGCONFIG" != "no" ; then
1486 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1487 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1488 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1489 version=`$PKGCONFIG --modversion libbrotlidec`
1490 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
1495 dnl no --with-brotli option given, just check default places
1498 dnl use the given --with-brotli spot
1499 PREFIX_BROTLI=$OPT_BROTLI
1503 dnl if given with a prefix, we set -L and -I based on that
1504 if test -n "$PREFIX_BROTLI"; then
1505 LIB_BROTLI="-lbrotlidec"
1506 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1507 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1508 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1511 LDFLAGS="$LDFLAGS $LD_BROTLI"
1512 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1513 LIBS="$LIB_BROTLI $LIBS"
1515 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1517 AC_CHECK_HEADERS(brotli/decode.h,
1518 curl_brotli_msg="enabled (libbrotlidec)"
1520 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1521 AC_SUBST(HAVE_BROTLI, [1])
1524 if test X"$OPT_BROTLI" != Xoff &&
1525 test "$HAVE_BROTLI" != "1"; then
1526 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1529 if test "$HAVE_BROTLI" = "1"; then
1530 if test -n "$DIR_BROTLI"; then
1531 dnl when the brotli shared libs were found in a path that the run-time
1532 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1533 dnl to prevent further configure tests to fail due to this
1535 if test "x$cross_compiling" != "xyes"; then
1536 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1537 export CURL_LIBRARY_PATH
1538 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1542 dnl no brotli, revert back to clean variables
1543 LDFLAGS=$CLEANLDFLAGS
1544 CPPFLAGS=$CLEANCPPFLAGS
1549 dnl **********************************************************************
1550 dnl Check for libzstd
1551 dnl **********************************************************************
1553 dnl Default to compiler & linker defaults for libzstd
1555 AC_ARG_WITH(zstd,dnl
1556 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])
1557 AS_HELP_STRING([--without-zstd], [disable libzstd]),
1560 if test X"$OPT_ZSTD" != Xno; then
1561 dnl backup the pre-zstd variables
1562 CLEANLDFLAGS="$LDFLAGS"
1563 CLEANCPPFLAGS="$CPPFLAGS"
1568 dnl --with-zstd (without path) used
1569 CURL_CHECK_PKGCONFIG(libzstd)
1571 if test "$PKGCONFIG" != "no" ; then
1572 LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
1573 LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
1574 CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
1575 version=`$PKGCONFIG --modversion libzstd`
1576 DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
1581 dnl no --with-zstd option given, just check default places
1584 dnl use the given --with-zstd spot
1585 PREFIX_ZSTD=$OPT_ZSTD
1589 dnl if given with a prefix, we set -L and -I based on that
1590 if test -n "$PREFIX_ZSTD"; then
1592 LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
1593 CPP_ZSTD=-I${PREFIX_ZSTD}/include
1594 DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
1597 LDFLAGS="$LDFLAGS $LD_ZSTD"
1598 CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
1599 LIBS="$LIB_ZSTD $LIBS"
1601 AC_CHECK_LIB(zstd, ZSTD_createDStream)
1603 AC_CHECK_HEADERS(zstd.h,
1604 curl_zstd_msg="enabled (libzstd)"
1606 AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
1607 AC_SUBST(HAVE_ZSTD, [1])
1610 if test X"$OPT_ZSTD" != Xoff &&
1611 test "$HAVE_ZSTD" != "1"; then
1612 AC_MSG_ERROR([libzstd was not found where specified!])
1615 if test "$HAVE_ZSTD" = "1"; then
1616 if test -n "$DIR_ZSTD"; then
1617 dnl when the zstd shared lib were found in a path that the run-time
1618 dnl linker doesn't search through, we need to add it to
1619 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
1622 if test "x$cross_compiling" != "xyes"; then
1623 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
1624 export CURL_LIBRARY_PATH
1625 AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
1629 dnl no zstd, revert back to clean variables
1630 LDFLAGS=$CLEANLDFLAGS
1631 CPPFLAGS=$CLEANCPPFLAGS
1636 dnl **********************************************************************
1638 dnl **********************************************************************
1641 AC_ARG_WITH(ldap-lib,
1642 AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1643 [LDAPLIBNAME="$withval"])
1646 AC_ARG_WITH(lber-lib,
1647 AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1648 [LBERLIBNAME="$withval"])
1650 if test x$CURL_DISABLE_LDAP != x1 ; then
1652 CURL_CHECK_HEADER_LBER
1653 CURL_CHECK_HEADER_LDAP
1654 CURL_CHECK_HEADER_LDAP_SSL
1656 if test -z "$LDAPLIBNAME" ; then
1657 if test "$curl_cv_native_windows" = "yes"; then
1658 dnl Windows uses a single and unique LDAP library name
1659 LDAPLIBNAME="wldap32"
1664 if test "$LDAPLIBNAME" ; then
1665 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1666 if test -n "$ldap_askedfor"; then
1667 AC_MSG_ERROR([couldn't detect the LDAP libraries])
1669 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1670 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1671 AC_SUBST(CURL_DISABLE_LDAP, [1])
1672 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1673 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1675 dnl Try to find the right ldap libraries for this system
1676 CURL_CHECK_LIBS_LDAP
1677 case X-"$curl_cv_ldap_LIBS" in
1679 if test -n "$ldap_askedfor"; then
1680 AC_MSG_ERROR([couldn't detect the LDAP libraries])
1682 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1683 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1684 AC_SUBST(CURL_DISABLE_LDAP, [1])
1685 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1686 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1692 if test x$CURL_DISABLE_LDAP != x1 ; then
1694 if test "$LBERLIBNAME" ; then
1695 dnl If name is "no" then don't define this library at all
1696 dnl (it's only needed if libldap.so's dependencies are broken).
1697 if test "$LBERLIBNAME" != "no" ; then
1698 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1699 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1700 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1701 AC_SUBST(CURL_DISABLE_LDAP, [1])
1702 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1703 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1708 if test x$CURL_DISABLE_LDAP != x1 ; then
1709 AC_CHECK_FUNCS([ldap_url_parse])
1711 if test "$LDAPLIBNAME" = "wldap32"; then
1712 curl_ldap_msg="enabled (winldap)"
1713 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1715 curl_ldap_msg="enabled (OpenLDAP)"
1716 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1717 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1718 AC_SUBST(USE_OPENLDAP, [1])
1723 if test x$CURL_DISABLE_LDAPS != x1 ; then
1724 curl_ldaps_msg="enabled"
1727 dnl **********************************************************************
1729 dnl **********************************************************************
1731 AC_MSG_CHECKING([whether to enable IPv6])
1733 AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1734 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1735 [ case "$enableval" in
1740 *) AC_MSG_RESULT(yes)
1745 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1746 /* are AF_INET6 and sockaddr_in6 available? */
1747 #include <sys/types.h>
1748 #ifdef HAVE_WINSOCK2_H
1749 #include <winsock2.h>
1750 #include <ws2tcpip.h>
1752 #include <sys/socket.h>
1753 #include <netinet/in.h>
1754 #if defined (__TANDEM)
1755 # include <netinet/in6.h>
1758 #include <stdlib.h> /* for exit() */
1761 struct sockaddr_in6 s;
1763 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1778 if test "$ipv6" = yes; then
1779 curl_ipv6_msg="enabled"
1780 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
1782 AC_SUBST(IPV6_ENABLED)
1784 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1785 AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
1786 #include <sys/types.h>
1787 #ifdef HAVE_WINSOCK2_H
1788 #include <winsock2.h>
1789 #include <ws2tcpip.h>
1791 #include <netinet/in.h>
1792 #if defined (__TANDEM)
1793 # include <netinet/in6.h>
1797 struct sockaddr_in6 s;
1798 s.sin6_scope_id = 0;
1800 AC_MSG_RESULT([yes])
1801 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1807 dnl **********************************************************************
1808 dnl Check if the operating system allows programs to write to their own argv[]
1809 dnl **********************************************************************
1811 AC_MSG_CHECKING([if argv can be written to])
1813 int main(int argc, char **argv)
1816 /* on Windows, writing to the argv does not hide the argument in
1817 process lists so it can just be skipped */
1824 return (argv[0][0] == ' ')?0:1;
1828 curl_cv_writable_argv=yes
1830 curl_cv_writable_argv=no
1832 curl_cv_writable_argv=cross
1834 case $curl_cv_writable_argv in
1836 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1844 AC_MSG_WARN([the previous check could not be made default was used])
1848 dnl **********************************************************************
1849 dnl Check for GSS-API libraries
1850 dnl **********************************************************************
1852 dnl check for GSS-API stuff in the /usr as default
1855 AC_ARG_WITH(gssapi-includes,
1856 AS_HELP_STRING([--with-gssapi-includes=DIR],
1857 [Specify location of GSS-API headers]),
1858 [ GSSAPI_INCS="-I$withval"
1862 AC_ARG_WITH(gssapi-libs,
1863 AS_HELP_STRING([--with-gssapi-libs=DIR],
1864 [Specify location of GSS-API libs]),
1865 [ GSSAPI_LIB_DIR="-L$withval"
1870 AS_HELP_STRING([--with-gssapi=DIR],
1871 [Where to look for GSS-API]), [
1872 GSSAPI_ROOT="$withval"
1873 if test x"$GSSAPI_ROOT" != xno; then
1875 if test x"$GSSAPI_ROOT" = xyes; then
1876 dnl if yes, then use default root
1882 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1884 save_CPPFLAGS="$CPPFLAGS"
1885 AC_MSG_CHECKING([if GSS-API support is requested])
1886 if test x"$want_gss" = xyes; then
1889 if test $GSSAPI_ROOT != "/usr"; then
1890 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
1892 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1894 if test -z "$GSSAPI_INCS"; then
1895 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1896 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1897 elif test "$PKGCONFIG" != "no" ; then
1898 GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
1899 elif test -f "$KRB5CONFIG"; then
1900 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1901 elif test "$GSSAPI_ROOT" != "yes"; then
1902 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1906 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1908 AC_CHECK_HEADER(gss.h,
1910 dnl found in the given dirs
1911 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1915 dnl not found, check Heimdal or MIT
1916 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1918 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1923 #ifdef HAVE_GSSAPI_GSSAPI_H
1924 #include <gssapi/gssapi.h>
1927 if test "x$not_mit" = "x1"; then
1928 dnl MIT not found, check for Heimdal
1929 AC_CHECK_HEADER(gssapi.h,
1932 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1935 dnl no header found, disabling GSS
1937 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1942 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1943 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1944 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1947 #include <gssapi/gssapi.h>
1948 #include <gssapi/gssapi_generic.h>
1949 #include <gssapi/gssapi_krb5.h>
1954 GSS_C_NT_HOSTBASED_SERVICE,
1958 AC_MSG_RESULT([yes])
1961 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1962 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1970 if test x"$want_gss" = xyes; then
1971 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1973 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1975 if test -n "$gnu_gss"; then
1976 curl_gss_msg="enabled (GNU GSS)"
1977 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1979 elif test -z "$GSSAPI_LIB_DIR"; then
1982 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1985 if test $GSSAPI_ROOT != "/usr"; then
1986 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
1988 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1990 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1991 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1993 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1994 LIBS="$gss_libs $LIBS"
1995 elif test "$PKGCONFIG" != "no" ; then
1996 gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
1997 LIBS="$gss_libs $LIBS"
1998 elif test -f "$KRB5CONFIG"; then
1999 dnl krb5-config doesn't have --libs-only-L or similar, put everything
2001 gss_libs=`$KRB5CONFIG --libs gssapi`
2002 LIBS="$gss_libs $LIBS"
2009 gss_libname="gssapi"
2013 if test "$GSSAPI_ROOT" != "yes"; then
2014 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
2015 LIBS="-l$gss_libname $LIBS"
2017 LIBS="-l$gss_libname $LIBS"
2023 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
2029 LIBS="-lgssapi $LIBS"
2034 CPPFLAGS="$save_CPPFLAGS"
2037 if test x"$want_gss" = xyes; then
2038 AC_MSG_CHECKING([if we can link against GSS-API library])
2040 AC_LANG_FUNC_LINK_TRY([gss_init_sec_context])
2042 AC_MSG_RESULT([yes])
2045 AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.])
2050 if test x"$want_gss" = "xyes"; then
2051 build_libstubgss=yes
2054 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
2056 dnl -------------------------------------------------------------
2057 dnl parse --with-default-ssl-backend so it can be validated below
2058 dnl -------------------------------------------------------------
2060 DEFAULT_SSL_BACKEND=no
2061 VALID_DEFAULT_SSL_BACKEND=
2062 AC_ARG_WITH(default-ssl-backend,
2063 AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
2064 AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
2065 [DEFAULT_SSL_BACKEND=$withval])
2066 case "$DEFAULT_SSL_BACKEND" in
2068 dnl --without-default-ssl-backend option used
2071 dnl --with-default-ssl-backend option used without name
2072 AC_MSG_ERROR([The name of the default SSL backend is required.])
2075 dnl --with-default-ssl-backend option used with name
2076 AC_SUBST(DEFAULT_SSL_BACKEND)
2077 dnl needs to be validated below
2078 VALID_DEFAULT_SSL_BACKEND=no
2083 CURL_WITH_SECURETRANSPORT
2093 dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
2094 if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then
2095 LIBS="-ladvapi32 -lcrypt32 $LIBS"
2098 dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
2099 if test "x$curl_cv_native_windows" = "xyes" &&
2100 test "x$curl_mingw_original" = "xno"; then
2101 LIBS="-lbcrypt $LIBS"
2104 case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$RUSTLS_ENABLED"
2107 AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more.
2108 Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl or --with-rustls to address this.])
2111 # one SSL backend is enabled
2112 AC_SUBST(SSL_ENABLED)
2114 AC_MSG_NOTICE([built with one SSL backend])
2117 # explicitly built without TLS
2120 AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library
2121 (e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl, --with-rustls).
2122 Since these are conflicting parameters, verify which is the desired one and drop the other.])
2125 # more than one SSL backend is enabled
2126 AC_SUBST(SSL_ENABLED)
2128 AC_SUBST(CURL_WITH_MULTI_SSL)
2129 CURL_WITH_MULTI_SSL="1"
2130 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
2131 AC_MSG_NOTICE([built with multiple SSL backends])
2135 if test -n "$ssl_backends"; then
2136 curl_ssl_msg="enabled ($ssl_backends)"
2139 if test no = "$VALID_DEFAULT_SSL_BACKEND"
2141 if test -n "$SSL_ENABLED"
2143 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
2145 AC_MSG_ERROR([Default SSL backend requires SSL!])
2147 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
2149 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
2152 dnl **********************************************************************
2153 dnl Check for the CA bundle
2154 dnl **********************************************************************
2156 if test -n "$check_for_ca_bundle"; then
2157 CURL_CHECK_CA_BUNDLE
2160 dnl **********************************************************************
2161 dnl Check for libpsl
2162 dnl **********************************************************************
2165 AS_HELP_STRING([--without-libpsl],
2166 [disable support for libpsl cookie checking]),
2167 with_libpsl=$withval,
2169 if test $with_libpsl != "no"; then
2170 AC_SEARCH_LIBS(psl_builtin, psl,
2171 [curl_psl_msg="enabled";
2172 AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
2174 [curl_psl_msg="no (libpsl not found)";
2175 AC_MSG_WARN([libpsl was not found])
2179 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
2182 dnl **********************************************************************
2183 dnl Check for libgsasl
2184 dnl **********************************************************************
2186 AC_ARG_WITH(libgsasl,
2187 AS_HELP_STRING([--without-libgsasl],
2188 [disable libgsasl support for SCRAM]),
2189 with_libgsasl=$withval,
2191 if test $with_libgsasl != "no"; then
2192 AC_SEARCH_LIBS(gsasl_init, gsasl,
2193 [curl_gsasl_msg="enabled";
2194 AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
2196 [curl_gsasl_msg="no (libgsasl not found)";
2197 AC_MSG_WARN([libgsasl was not found])
2201 AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
2203 AC_ARG_WITH(libmetalink,,
2204 AC_MSG_ERROR([--with-libmetalink no longer works!]))
2206 dnl **********************************************************************
2207 dnl Check for the presence of LIBSSH2 libraries and headers
2208 dnl **********************************************************************
2210 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
2212 AC_ARG_WITH(libssh2,dnl
2213 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])
2214 AS_HELP_STRING([--with-libssh2], [enable libssh2]),
2215 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
2219 AC_ARG_WITH(libssh,dnl
2220 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])
2221 AS_HELP_STRING([--with-libssh], [enable libssh]),
2222 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2225 AC_ARG_WITH(wolfssh,dnl
2226 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])
2227 AS_HELP_STRING([--with-wolfssh], [enable wolfssh]),
2228 OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
2230 if test X"$OPT_LIBSSH2" != Xno; then
2231 dnl backup the pre-libssh2 variables
2232 CLEANLDFLAGS="$LDFLAGS"
2233 CLEANCPPFLAGS="$CPPFLAGS"
2236 case "$OPT_LIBSSH2" in
2238 dnl --with-libssh2 (without path) used
2239 CURL_CHECK_PKGCONFIG(libssh2)
2241 if test "$PKGCONFIG" != "no" ; then
2242 LIB_SSH2=`$PKGCONFIG --libs libssh2`
2243 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2244 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2245 version=`$PKGCONFIG --modversion libssh2`
2246 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
2251 dnl no --with-libssh2 option given, just check default places
2254 dnl use the given --with-libssh2 spot
2255 PREFIX_SSH2=$OPT_LIBSSH2
2259 dnl if given with a prefix, we set -L and -I based on that
2260 if test -n "$PREFIX_SSH2"; then
2262 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2263 CPP_SSH2=-I${PREFIX_SSH2}/include
2264 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2267 LDFLAGS="$LDFLAGS $LD_SSH2"
2268 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2269 LIBS="$LIB_SSH2 $LIBS"
2271 dnl check for function added in libssh2 version 1.0
2272 AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
2274 AC_CHECK_HEADER(libssh2.h,
2275 curl_ssh_msg="enabled (libSSH2)"
2277 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2278 AC_SUBST(USE_LIBSSH2, [1])
2281 if test X"$OPT_LIBSSH2" != Xoff &&
2282 test "$LIBSSH2_ENABLED" != "1"; then
2283 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2286 if test "$LIBSSH2_ENABLED" = "1"; then
2287 if test -n "$DIR_SSH2"; then
2288 dnl when the libssh2 shared libs were found in a path that the run-time
2289 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2290 dnl to prevent further configure tests to fail due to this
2292 if test "x$cross_compiling" != "xyes"; then
2293 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
2294 export CURL_LIBRARY_PATH
2295 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2299 dnl no libssh2, revert back to clean variables
2300 LDFLAGS=$CLEANLDFLAGS
2301 CPPFLAGS=$CLEANCPPFLAGS
2304 elif test X"$OPT_LIBSSH" != Xno; then
2305 dnl backup the pre-libssh variables
2306 CLEANLDFLAGS="$LDFLAGS"
2307 CLEANCPPFLAGS="$CPPFLAGS"
2310 case "$OPT_LIBSSH" in
2312 dnl --with-libssh (without path) used
2313 CURL_CHECK_PKGCONFIG(libssh)
2315 if test "$PKGCONFIG" != "no" ; then
2316 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2317 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2318 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2319 version=`$PKGCONFIG --modversion libssh`
2320 DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
2325 dnl no --with-libssh option given, just check default places
2328 dnl use the given --with-libssh spot
2329 PREFIX_SSH=$OPT_LIBSSH
2333 dnl if given with a prefix, we set -L and -I based on that
2334 if test -n "$PREFIX_SSH"; then
2336 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2337 CPP_SSH=-I${PREFIX_SSH}/include
2338 DIR_SSH=${PREFIX_SSH}/lib$libsuff
2341 LDFLAGS="$LDFLAGS $LD_SSH"
2342 CPPFLAGS="$CPPFLAGS $CPP_SSH"
2343 LIBS="$LIB_SSH $LIBS"
2345 AC_CHECK_LIB(ssh, ssh_new)
2347 AC_CHECK_HEADER(libssh/libssh.h,
2348 curl_ssh_msg="enabled (libSSH)"
2350 AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
2351 AC_SUBST(USE_LIBSSH, [1])
2354 if test X"$OPT_LIBSSH" != Xoff &&
2355 test "$LIBSSH_ENABLED" != "1"; then
2356 AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
2359 if test "$LIBSSH_ENABLED" = "1"; then
2360 if test -n "$DIR_SSH"; then
2361 dnl when the libssh shared libs were found in a path that the run-time
2362 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2363 dnl to prevent further configure tests to fail due to this
2365 if test "x$cross_compiling" != "xyes"; then
2366 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
2367 export CURL_LIBRARY_PATH
2368 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
2372 dnl no libssh, revert back to clean variables
2373 LDFLAGS=$CLEANLDFLAGS
2374 CPPFLAGS=$CLEANCPPFLAGS
2377 elif test X"$OPT_WOLFSSH" != Xno; then
2378 dnl backup the pre-wolfssh variables
2379 CLEANLDFLAGS="$LDFLAGS"
2380 CLEANCPPFLAGS="$CPPFLAGS"
2384 if test "$OPT_WOLFSSH" != yes; then
2385 WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
2386 LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
2387 CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
2390 AC_CHECK_LIB(wolfssh, wolfSSH_Init)
2392 AC_CHECK_HEADERS(wolfssh/ssh.h,
2393 curl_ssh_msg="enabled (wolfSSH)"
2395 AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
2396 AC_SUBST(USE_WOLFSSH, [1])
2401 dnl **********************************************************************
2402 dnl Check for the presence of LIBRTMP libraries and headers
2403 dnl **********************************************************************
2405 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2407 AC_ARG_WITH(librtmp,dnl
2408 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])
2409 AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2410 OPT_LIBRTMP=$withval)
2412 if test X"$OPT_LIBRTMP" != Xno; then
2413 dnl backup the pre-librtmp variables
2414 CLEANLDFLAGS="$LDFLAGS"
2415 CLEANCPPFLAGS="$CPPFLAGS"
2418 case "$OPT_LIBRTMP" in
2420 dnl --with-librtmp (without path) used
2421 CURL_CHECK_PKGCONFIG(librtmp)
2423 if test "$PKGCONFIG" != "no" ; then
2424 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2425 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2426 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2427 version=`$PKGCONFIG --modversion librtmp`
2428 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
2430 dnl To avoid link errors, we do not allow --librtmp without
2431 dnl a pkgconfig file
2432 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2437 dnl no --with-librtmp option given, just check default places
2441 dnl use the given --with-librtmp spot
2443 PREFIX_RTMP=$OPT_LIBRTMP
2447 dnl if given with a prefix, we set -L and -I based on that
2448 if test -n "$PREFIX_RTMP"; then
2449 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
2450 CPP_RTMP=-I${PREFIX_RTMP}/include
2451 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
2454 LDFLAGS="$LDFLAGS $LD_RTMP"
2455 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2456 LIBS="$LIB_RTMP $LIBS"
2458 AC_CHECK_LIB(rtmp, RTMP_Init,
2460 AC_CHECK_HEADERS(librtmp/rtmp.h,
2461 curl_rtmp_msg="enabled (librtmp)"
2463 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
2464 AC_SUBST(USE_LIBRTMP, [1])
2467 dnl not found, revert back to clean variables
2468 LDFLAGS=$CLEANLDFLAGS
2469 CPPFLAGS=$CLEANCPPFLAGS
2473 if test X"$OPT_LIBRTMP" != Xoff &&
2474 test "$LIBRTMP_ENABLED" != "1"; then
2475 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
2480 dnl **********************************************************************
2481 dnl Check for linker switch for versioned symbols
2482 dnl **********************************************************************
2484 versioned_symbols_flavour=
2485 AC_MSG_CHECKING([whether versioned symbols are wanted])
2486 AC_ARG_ENABLE(versioned-symbols,
2487 AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2488 AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2489 [ case "$enableval" in
2490 yes) AC_MSG_RESULT(yes)
2491 AC_MSG_CHECKING([if libraries can be versioned])
2492 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
2493 if test -z "$GLD"; then
2495 AC_MSG_WARN([You need an ld version supporting the --version-script option])
2498 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
2499 versioned_symbols_flavour="MULTISSL_"
2500 elif test "x$OPENSSL_ENABLED" = "x1"; then
2501 versioned_symbols_flavour="OPENSSL_"
2502 elif test "x$GNUTLS_ENABLED" = "x1"; then
2503 versioned_symbols_flavour="GNUTLS_"
2504 elif test "x$NSS_ENABLED" = "x1"; then
2505 versioned_symbols_flavour="NSS_"
2506 elif test "x$WOLFSSL_ENABLED" = "x1"; then
2507 versioned_symbols_flavour="WOLFSSL_"
2508 elif test "x$SCHANNEL_ENABLED" = "x1"; then
2509 versioned_symbols_flavour="SCHANNEL_"
2510 elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
2511 versioned_symbols_flavour="SECURE_TRANSPORT_"
2513 versioned_symbols_flavour=""
2515 versioned_symbols="yes"
2519 *) AC_MSG_RESULT(no)
2527 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
2528 ["$versioned_symbols_flavour"])
2529 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
2530 [test "x$versioned_symbols" = 'xyes'])
2532 dnl Update .plist file with current version
2533 AC_SUBST([CURL_PLIST_VERSION],
2536 dnl -------------------------------------------------
2537 dnl check winidn option before other IDN libraries
2538 dnl -------------------------------------------------
2540 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
2541 OPT_WINIDN="default"
2543 AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
2544 AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
2545 OPT_WINIDN=$withval)
2546 case "$OPT_WINIDN" in
2548 dnl --without-winidn option used or configure option not specified
2553 dnl --with-winidn option used without path
2555 want_winidn_path="default"
2556 AC_MSG_RESULT([yes])
2559 dnl --with-winidn option used with path
2561 want_winidn_path="$withval"
2562 AC_MSG_RESULT([yes ($withval)])
2566 if test "$want_winidn" = "yes"; then
2567 dnl winidn library support has been requested
2568 clean_CFLAGS="$CFLAGS"
2569 clean_CPPFLAGS="$CPPFLAGS"
2570 clean_LDFLAGS="$LDFLAGS"
2572 WINIDN_LIBS="-lnormaliz"
2575 if test "$want_winidn_path" != "default"; then
2576 dnl path has been specified
2577 dnl pkg-config not available or provides no info
2578 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
2579 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
2580 WINIDN_DIR="$want_winidn_path/lib$libsuff"
2583 dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
2586 #include <windows.h>
2588 #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
2594 CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2595 CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2596 CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2597 CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2598 WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
2601 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
2602 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
2603 LIBS="$WINIDN_LIBS $LIBS"
2605 AC_MSG_CHECKING([if IdnToUnicode can be linked])
2608 #include <windows.h>
2610 IdnToUnicode(0, NULL, 0, NULL, 0);
2613 AC_MSG_RESULT([yes])
2614 tst_links_winidn="yes"
2617 tst_links_winidn="no"
2620 if test "$tst_links_winidn" = "yes"; then
2621 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
2622 AC_SUBST([IDN_ENABLED], [1])
2623 curl_idn_msg="enabled (Windows-native)"
2625 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2626 CFLAGS="$clean_CFLAGS"
2627 CPPFLAGS="$clean_CPPFLAGS"
2628 LDFLAGS="$clean_LDFLAGS"
2633 dnl **********************************************************************
2634 dnl Check for the presence of IDN libraries and headers
2635 dnl **********************************************************************
2637 AC_MSG_CHECKING([whether to build with libidn2])
2639 AC_ARG_WITH(libidn2,
2640 AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
2641 AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2643 if test "x$tst_links_winidn" = "xyes"; then
2645 AC_MSG_RESULT([no (using winidn instead)])
2649 dnl --without-libidn2 option used
2654 dnl configure option not specified
2656 want_idn_path="default"
2657 AC_MSG_RESULT([(assumed) yes])
2660 dnl --with-libidn2 option used without path
2662 want_idn_path="default"
2663 AC_MSG_RESULT([yes])
2666 dnl --with-libidn2 option used with path
2668 want_idn_path="$withval"
2669 AC_MSG_RESULT([yes ($withval)])
2674 if test "$want_idn" = "yes"; then
2675 dnl idn library support has been requested
2676 clean_CPPFLAGS="$CPPFLAGS"
2677 clean_LDFLAGS="$LDFLAGS"
2681 if test "$want_idn_path" != "default"; then
2682 dnl path has been specified
2683 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2684 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
2685 if test "$PKGCONFIG" != "no"; then
2686 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2687 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2688 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2689 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2690 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2691 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2692 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2694 dnl pkg-config not available or provides no info
2696 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2697 IDN_CPPFLAGS="-I$want_idn_path/include"
2698 IDN_DIR="$want_idn_path/lib$libsuff"
2701 dnl path not specified
2702 CURL_CHECK_PKGCONFIG(libidn2)
2703 if test "$PKGCONFIG" != "no"; then
2704 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2705 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2706 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2707 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2709 dnl pkg-config not available or provides no info
2714 if test "$PKGCONFIG" != "no"; then
2715 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2716 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2717 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2718 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2720 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2721 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2722 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2723 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2726 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
2727 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
2728 LIBS="$IDN_LIBS $LIBS"
2730 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
2732 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
2734 AC_MSG_RESULT([yes])
2735 tst_links_libidn="yes"
2738 tst_links_libidn="no"
2741 AC_CHECK_HEADERS( idn2.h )
2743 if test "$tst_links_libidn" = "yes"; then
2744 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
2745 dnl different versions of libidn have different setups of these:
2747 AC_SUBST([IDN_ENABLED], [1])
2748 curl_idn_msg="enabled (libidn2)"
2749 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2750 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
2751 export CURL_LIBRARY_PATH
2752 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
2755 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2756 CPPFLAGS="$clean_CPPFLAGS"
2757 LDFLAGS="$clean_LDFLAGS"
2762 dnl **********************************************************************
2763 dnl Check for nghttp2
2764 dnl **********************************************************************
2768 if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
2769 # without HTTP or with Hyper, nghttp2 is no use
2773 AC_ARG_WITH(nghttp2,
2774 AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
2775 AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2779 dnl --without-nghttp2 option used
2783 dnl --with-nghttp2 option used without path
2784 want_nghttp2="default"
2785 want_nghttp2_path=""
2786 want_nghttp2_pkg_config_path=""
2789 dnl --with-nghttp2 option used with path
2791 want_nghttp2_path="$withval"
2792 want_nghttp2_pkg_config_path="$withval/lib/pkgconfig"
2796 if test X"$want_nghttp2" != Xno; then
2797 dnl backup the pre-nghttp2 variables
2798 CLEANLDFLAGS="$LDFLAGS"
2799 CLEANCPPFLAGS="$CPPFLAGS"
2802 CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path)
2804 if test "$PKGCONFIG" != "no" ; then
2805 LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2806 $PKGCONFIG --libs-only-l libnghttp2`
2807 AC_MSG_NOTICE([-l is $LIB_H2])
2809 CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl
2810 $PKGCONFIG --cflags-only-I libnghttp2`
2811 AC_MSG_NOTICE([-I is $CPP_H2])
2813 LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2814 $PKGCONFIG --libs-only-L libnghttp2`
2815 AC_MSG_NOTICE([-L is $LD_H2])
2817 DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'`
2818 elif test x"$want_nghttp2_path" != x; then
2820 LD_H2=-L${want_nghttp2_path}/lib$libsuff
2821 CPP_H2=-I${want_nghttp2_path}/include
2822 DIR_H2=${want_nghttp2_path}/lib$libsuff
2823 elif test X"$want_nghttp2" != Xdefault; then
2824 dnl no nghttp2 pkg-config found and no custom directory specified,
2826 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2831 LDFLAGS="$LDFLAGS $LD_H2"
2832 CPPFLAGS="$CPPFLAGS $CPP_H2"
2833 LIBS="$LIB_H2 $LIBS"
2835 # use nghttp2_session_set_local_window_size to require nghttp2
2837 AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
2839 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
2840 curl_h2_msg="enabled (nghttp2)"
2842 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
2843 AC_SUBST(USE_NGHTTP2, [1])
2846 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2"
2847 export CURL_LIBRARY_PATH
2848 AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH])
2850 dnl not found, revert back to clean variables
2851 LDFLAGS=$CLEANLDFLAGS
2852 CPPFLAGS=$CLEANCPPFLAGS
2857 dnl **********************************************************************
2858 dnl Check for ngtcp2 (QUIC)
2859 dnl **********************************************************************
2863 if test "x$disable_http" = "xyes"; then
2864 # without HTTP, ngtcp2 is no use
2869 AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
2870 AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
2871 [OPT_TCP2=$withval])
2874 dnl --without-ngtcp2 option used
2878 dnl --with-ngtcp2 option used without path
2883 dnl --with-ngtcp2 option used with path
2885 want_tcp2_path="$withval/lib/pkgconfig"
2889 curl_tcp2_msg="no (--with-ngtcp2)"
2890 if test X"$want_tcp2" != Xno; then
2891 dnl backup the pre-ngtcp2 variables
2892 CLEANLDFLAGS="$LDFLAGS"
2893 CLEANCPPFLAGS="$CPPFLAGS"
2896 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
2898 if test "$PKGCONFIG" != "no" ; then
2899 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2900 $PKGCONFIG --libs-only-l libngtcp2`
2901 AC_MSG_NOTICE([-l is $LIB_TCP2])
2903 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2904 $PKGCONFIG --cflags-only-I libngtcp2`
2905 AC_MSG_NOTICE([-I is $CPP_TCP2])
2907 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2908 $PKGCONFIG --libs-only-L libngtcp2`
2909 AC_MSG_NOTICE([-L is $LD_TCP2])
2911 LDFLAGS="$LDFLAGS $LD_TCP2"
2912 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
2913 LIBS="$LIB_TCP2 $LIBS"
2915 if test "x$cross_compiling" != "xyes"; then
2916 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
2918 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
2920 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
2922 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
2923 AC_SUBST(USE_NGTCP2, [1])
2924 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
2925 export CURL_LIBRARY_PATH
2926 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
2929 dnl not found, revert back to clean variables
2930 LDFLAGS=$CLEANLDFLAGS
2931 CPPFLAGS=$CLEANCPPFLAGS
2936 dnl no ngtcp2 pkg-config found, deal with it
2937 if test X"$want_tcp2" != Xdefault; then
2938 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2939 dnl a pkgconfig file
2940 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
2946 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
2947 dnl backup the pre-ngtcp2_crypto_openssl variables
2948 CLEANLDFLAGS="$LDFLAGS"
2949 CLEANCPPFLAGS="$CPPFLAGS"
2952 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
2954 if test "$PKGCONFIG" != "no" ; then
2955 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2956 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
2957 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
2959 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2960 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
2961 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
2963 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2964 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
2965 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
2967 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
2968 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
2969 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
2971 if test "x$cross_compiling" != "xyes"; then
2972 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
2974 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_recv_client_initial_cb,
2976 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2978 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
2979 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
2980 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
2981 export CURL_LIBRARY_PATH
2982 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
2985 dnl not found, revert back to clean variables
2986 LDFLAGS=$CLEANLDFLAGS
2987 CPPFLAGS=$CLEANCPPFLAGS
2992 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
2993 if test X"$want_tcp2" != Xdefault; then
2994 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2995 dnl a pkgconfig file
2996 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
3001 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
3002 dnl backup the pre-ngtcp2_crypto_gnutls variables
3003 CLEANLDFLAGS="$LDFLAGS"
3004 CLEANCPPFLAGS="$CPPFLAGS"
3007 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
3009 if test "$PKGCONFIG" != "no" ; then
3010 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3011 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
3012 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
3014 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3015 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
3016 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
3018 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3019 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
3020 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
3022 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
3023 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
3024 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
3026 if test "x$cross_compiling" != "xyes"; then
3027 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
3029 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb,
3031 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3033 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
3034 AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
3035 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
3036 export CURL_LIBRARY_PATH
3037 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
3040 dnl not found, revert back to clean variables
3041 LDFLAGS=$CLEANLDFLAGS
3042 CPPFLAGS=$CLEANCPPFLAGS
3047 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
3048 if test X"$want_tcp2" != Xdefault; then
3049 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3050 dnl a pkgconfig file
3051 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
3056 if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then
3057 dnl backup the pre-ngtcp2_crypto_wolfssl variables
3058 CLEANLDFLAGS="$LDFLAGS"
3059 CLEANCPPFLAGS="$CPPFLAGS"
3062 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path)
3064 if test "$PKGCONFIG" != "no" ; then
3065 LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3066 $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl`
3067 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL])
3069 CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3070 $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl`
3071 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL])
3073 LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3074 $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl`
3075 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL])
3077 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL"
3078 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL"
3079 LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS"
3081 if test "x$cross_compiling" != "xyes"; then
3082 DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'`
3084 AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb,
3086 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3088 AC_DEFINE(USE_NGTCP2_CRYPTO_WOLFSSL, 1, [if ngtcp2_crypto_wolfssl is in use])
3089 AC_SUBST(USE_NGTCP2_CRYPTO_WOLFSSL, [1])
3090 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL"
3091 export CURL_LIBRARY_PATH
3092 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH])
3095 dnl not found, revert back to clean variables
3096 LDFLAGS=$CLEANLDFLAGS
3097 CPPFLAGS=$CLEANCPPFLAGS
3102 dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it
3103 if test X"$want_tcp2" != Xdefault; then
3104 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3105 dnl a pkgconfig file
3106 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.])
3111 dnl **********************************************************************
3112 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
3113 dnl **********************************************************************
3117 if test "x$NGTCP2_ENABLED" = "x"; then
3118 # without ngtcp2, nghttp3 is of no use for us
3122 AC_ARG_WITH(nghttp3,
3123 AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
3124 AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
3125 [OPT_NGHTTP3=$withval])
3126 case "$OPT_NGHTTP3" in
3128 dnl --without-nghttp3 option used
3132 dnl --with-nghttp3 option used without path
3133 want_nghttp3="default"
3134 want_nghttp3_path=""
3137 dnl --with-nghttp3 option used with path
3139 want_nghttp3_path="$withval/lib/pkgconfig"
3143 curl_http3_msg="no (--with-nghttp3)"
3144 if test X"$want_nghttp3" != Xno; then
3145 dnl backup the pre-nghttp3 variables
3146 CLEANLDFLAGS="$LDFLAGS"
3147 CLEANCPPFLAGS="$CPPFLAGS"
3150 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3152 if test "$PKGCONFIG" != "no" ; then
3153 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3154 $PKGCONFIG --libs-only-l libnghttp3`
3155 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3157 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
3158 $PKGCONFIG --cflags-only-I libnghttp3`
3159 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3161 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3162 $PKGCONFIG --libs-only-L libnghttp3`
3163 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3165 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3166 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3167 LIBS="$LIB_NGHTTP3 $LIBS"
3169 if test "x$cross_compiling" != "xyes"; then
3170 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
3172 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
3174 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3175 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3177 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3178 AC_SUBST(USE_NGHTTP3, [1])
3179 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3180 export CURL_LIBRARY_PATH
3181 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3182 experimental="$experimental HTTP3"
3185 dnl not found, revert back to clean variables
3186 LDFLAGS=$CLEANLDFLAGS
3187 CPPFLAGS=$CLEANCPPFLAGS
3192 dnl no nghttp3 pkg-config found, deal with it
3193 if test X"$want_nghttp3" != Xdefault; then
3194 dnl To avoid link errors, we do not allow --with-nghttp3 without
3195 dnl a pkgconfig file
3196 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3202 dnl **********************************************************************
3203 dnl Check for quiche (QUIC)
3204 dnl **********************************************************************
3208 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3209 # without HTTP or with ngtcp2, quiche is no use
3214 AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
3215 AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
3216 [OPT_QUICHE=$withval])
3217 case "$OPT_QUICHE" in
3219 dnl --without-quiche option used
3223 dnl --with-quiche option used without path
3224 want_quiche="default"
3228 dnl --with-quiche option used with path
3230 want_quiche_path="$withval"
3234 if test X"$want_quiche" != Xno; then
3236 if test "$NGHTTP3_ENABLED" = 1; then
3237 AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
3240 dnl backup the pre-quiche variables
3241 CLEANLDFLAGS="$LDFLAGS"
3242 CLEANCPPFLAGS="$CPPFLAGS"
3245 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3247 if test "$PKGCONFIG" != "no" ; then
3248 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3249 $PKGCONFIG --libs-only-l quiche`
3250 AC_MSG_NOTICE([-l is $LIB_QUICHE])
3252 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
3253 $PKGCONFIG --cflags-only-I quiche`
3254 AC_MSG_NOTICE([-I is $CPP_QUICHE])
3256 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3257 $PKGCONFIG --libs-only-L quiche`
3258 AC_MSG_NOTICE([-L is $LD_QUICHE])
3260 LDFLAGS="$LDFLAGS $LD_QUICHE"
3261 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3262 LIBS="$LIB_QUICHE $LIBS"
3264 if test "x$cross_compiling" != "xyes"; then
3265 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
3267 AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting,
3269 AC_CHECK_HEADERS(quiche.h,
3270 experimental="$experimental HTTP3"
3271 AC_MSG_NOTICE([HTTP3 support is experimental])
3272 curl_h3_msg="enabled (quiche)"
3274 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3275 AC_SUBST(USE_QUICHE, [1])
3276 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
3277 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3278 export CURL_LIBRARY_PATH
3279 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
3283 #include <sys/socket.h>
3287 dnl not found, revert back to clean variables
3288 AC_MSG_ERROR([couldn't use quiche])
3291 dnl no quiche pkg-config found, deal with it
3292 if test X"$want_quiche" != Xdefault; then
3293 dnl To avoid link errors, we do not allow --with-quiche without
3294 dnl a pkgconfig file
3295 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3300 dnl **********************************************************************
3301 dnl Check for msh3 (QUIC)
3302 dnl **********************************************************************
3306 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3307 # without HTTP or with ngtcp2, msh3 is no use
3312 AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage])
3313 AS_HELP_STRING([--without-msh3],[Disable msh3 usage]),
3314 [OPT_MSH3=$withval])
3317 dnl --without-msh3 option used
3321 dnl --with-msh3 option used without path
3326 dnl --with-msh3 option used with path
3328 want_msh3_path="$withval"
3332 if test X"$want_msh3" != Xno; then
3334 if test "$NGHTTP3_ENABLED" = 1; then
3335 AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive])
3338 dnl backup the pre-msh3 variables
3339 CLEANLDFLAGS="$LDFLAGS"
3340 CLEANCPPFLAGS="$CPPFLAGS"
3343 if test -n "$want_msh3_path"; then
3344 LD_MSH3="-L$want_msh3_path/lib"
3345 CPP_MSH3="-I$want_msh3_path/include"
3346 DIR_MSH3="$want_msh3_path/lib"
3347 LDFLAGS="$LDFLAGS $LD_MSH3"
3348 CPPFLAGS="$CPPFLAGS $CPP_MSH3"
3352 AC_CHECK_LIB(msh3, MsH3ApiOpen,
3354 AC_CHECK_HEADERS(msh3.h,
3355 curl_h3_msg="enabled (msh3)"
3357 AC_DEFINE(USE_MSH3, 1, [if msh3 is in use])
3358 AC_SUBST(USE_MSH3, [1])
3359 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3"
3360 export CURL_LIBRARY_PATH
3361 AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]),
3362 experimental="$experimental HTTP3"
3365 dnl not found, revert back to clean variables
3366 LDFLAGS=$CLEANLDFLAGS
3367 CPPFLAGS=$CLEANCPPFLAGS
3372 dnl **********************************************************************
3373 dnl Check for zsh completion path
3374 dnl **********************************************************************
3376 OPT_ZSH_FPATH=default
3377 AC_ARG_WITH(zsh-functions-dir,
3378 AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3379 AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3380 [OPT_ZSH_FPATH=$withval])
3381 case "$OPT_ZSH_FPATH" in
3383 dnl --without-zsh-functions-dir option used
3386 dnl --with-zsh-functions-dir option used without path
3387 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3388 AC_SUBST(ZSH_FUNCTIONS_DIR)
3391 dnl --with-zsh-functions-dir option used with path
3392 ZSH_FUNCTIONS_DIR="$withval"
3393 AC_SUBST(ZSH_FUNCTIONS_DIR)
3397 dnl **********************************************************************
3398 dnl Check for fish completion path
3399 dnl **********************************************************************
3401 OPT_FISH_FPATH=default
3402 AC_ARG_WITH(fish-functions-dir,
3403 AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3404 AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3405 [OPT_FISH_FPATH=$withval])
3406 case "$OPT_FISH_FPATH" in
3408 dnl --without-fish-functions-dir option used
3411 dnl --with-fish-functions-dir option used without path
3412 CURL_CHECK_PKGCONFIG(fish)
3413 if test "$PKGCONFIG" != "no" ; then
3414 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
3416 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3418 AC_SUBST(FISH_FUNCTIONS_DIR)
3421 dnl --with-fish-functions-dir option used with path
3422 FISH_FUNCTIONS_DIR="$withval"
3423 AC_SUBST(FISH_FUNCTIONS_DIR)
3427 dnl Now check for the very most basic headers. Then we can use these
3428 dnl ones as default-headers when checking for the rest!
3468 dnl to do if not found
3472 dnl default includes
3474 #ifdef HAVE_SYS_TYPES_H
3475 #include <sys/types.h>
3477 #ifdef HAVE_SYS_TIME_H
3478 #include <sys/time.h>
3480 #ifdef HAVE_SYS_SELECT_H
3481 #include <sys/select.h>
3482 #elif defined(HAVE_UNISTD_H)
3485 #ifdef HAVE_SYS_SOCKET_H
3486 #include <sys/socket.h>
3488 #ifdef HAVE_NETINET_IN_H
3489 #include <netinet/in.h>
3491 #ifdef HAVE_NETINET_IN6_H
3492 #include <netinet/in6.h>
3494 #ifdef HAVE_SYS_UN_H
3501 dnl Checks for typedefs, structures, and compiler characteristics.
3503 CURL_CHECK_VARIADIC_MACROS
3506 CURL_CHECK_STRUCT_TIMEVAL
3507 CURL_VERIFY_RUNTIMELIBS
3516 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3517 CURL_SIZEOF(curl_off_t, [
3518 #include <curl/system.h>
3520 CURL_SIZEOF(curl_socket_t, [
3521 #include <curl/curl.h>
3525 AC_CHECK_TYPE(long long,
3526 [AC_DEFINE(HAVE_LONGLONG, 1,
3527 [Define to 1 if the compiler supports the 'long long' data type.])]
3531 if test ${ac_cv_sizeof_curl_off_t} -lt 8; then
3532 AC_MSG_ERROR([64 bit curl_off_t is required])
3536 AC_CHECK_TYPE(ssize_t, ,
3537 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3539 # check for bool type
3540 AC_CHECK_TYPE([bool],[
3541 AC_DEFINE(HAVE_BOOL_T, 1,
3542 [Define to 1 if bool is an available type.])
3544 #ifdef HAVE_SYS_TYPES_H
3545 #include <sys/types.h>
3547 #ifdef HAVE_STDBOOL_H
3548 #include <stdbool.h>
3552 # check for sa_family_t
3553 AC_CHECK_TYPE(sa_family_t,
3554 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3557 AC_CHECK_TYPE(ADDRESS_FAMILY,
3558 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3559 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3561 #ifdef HAVE_SYS_SOCKET_H
3562 #include <sys/socket.h>
3567 #ifdef HAVE_SYS_SOCKET_H
3568 #include <sys/socket.h>
3572 # check for suseconds_t
3573 AC_CHECK_TYPE([suseconds_t],[
3574 AC_DEFINE(HAVE_SUSECONDS_T, 1,
3575 [Define to 1 if suseconds_t is an available type.])
3577 #ifdef HAVE_SYS_TYPES_H
3578 #include <sys/types.h>
3580 #ifdef HAVE_SYS_TIME_H
3581 #include <sys/time.h>
3585 AC_MSG_CHECKING([if time_t is unsigned])
3593 AC_MSG_RESULT([yes])
3594 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3598 dnl cross-compiling, most systems are unsigned
3602 CURL_CONFIGURE_PULL_SYS_POLL
3606 TYPE_SOCKADDR_STORAGE
3608 CURL_CHECK_FUNC_SELECT
3610 CURL_CHECK_FUNC_RECV
3611 CURL_CHECK_FUNC_SEND
3612 CURL_CHECK_MSG_NOSIGNAL
3614 CURL_CHECK_FUNC_ALARM
3615 CURL_CHECK_FUNC_BASENAME
3616 CURL_CHECK_FUNC_CLOSESOCKET
3617 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3618 CURL_CHECK_FUNC_CONNECT
3619 CURL_CHECK_FUNC_FCNTL
3620 CURL_CHECK_FUNC_FREEADDRINFO
3621 CURL_CHECK_FUNC_FSETXATTR
3622 CURL_CHECK_FUNC_FTRUNCATE
3623 CURL_CHECK_FUNC_GETADDRINFO
3624 CURL_CHECK_FUNC_GETHOSTBYNAME
3625 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3626 CURL_CHECK_FUNC_GETHOSTNAME
3627 CURL_CHECK_FUNC_GETPEERNAME
3628 CURL_CHECK_FUNC_GETSOCKNAME
3629 CURL_CHECK_FUNC_IF_NAMETOINDEX
3630 CURL_CHECK_FUNC_GETIFADDRS
3631 CURL_CHECK_FUNC_GMTIME_R
3632 CURL_CHECK_FUNC_INET_NTOP
3633 CURL_CHECK_FUNC_INET_PTON
3634 CURL_CHECK_FUNC_IOCTLSOCKET
3635 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3636 CURL_CHECK_FUNC_MEMRCHR
3637 CURL_CHECK_FUNC_POLL
3638 CURL_CHECK_FUNC_SIGACTION
3639 CURL_CHECK_FUNC_SIGINTERRUPT
3640 CURL_CHECK_FUNC_SIGNAL
3641 CURL_CHECK_FUNC_SIGSETJMP
3642 CURL_CHECK_FUNC_SOCKET
3643 CURL_CHECK_FUNC_SOCKETPAIR
3644 CURL_CHECK_FUNC_STRCASECMP
3645 CURL_CHECK_FUNC_STRCMPI
3646 CURL_CHECK_FUNC_STRDUP
3647 CURL_CHECK_FUNC_STRERROR_R
3648 CURL_CHECK_FUNC_STRICMP
3649 CURL_CHECK_FUNC_STRTOK_R
3650 CURL_CHECK_FUNC_STRTOLL
3656 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3660 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
3662 #include <sys/types.h>]])
3665 AC_CHECK_FUNCS([fnmatch \
3676 mach_absolute_time \
3690 eval skipcheck=\$skipcheck_$func
3691 if test "x$skipcheck" != "xyes"; then
3692 AC_MSG_CHECKING([deeper for $func])
3699 AC_MSG_RESULT([yes])
3700 eval "ac_cv_func_$func=yes"
3701 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3702 [Define to 1 if you have the $func function.])
3704 AC_MSG_RESULT([but still no])
3709 CURL_CHECK_NONBLOCKING_SOCKET
3711 dnl ************************************************************
3712 dnl nroff tool stuff
3715 AC_PATH_PROG( PERL, perl, ,
3716 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3719 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3720 $PATH:/usr/bin/:/usr/local/bin )
3723 if test -n "$NROFF"; then
3724 dnl only check for nroff options if an nroff command was found
3726 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3728 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3729 if test -z "$mancheck"; then
3731 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3732 if test -z "$mancheck"; then
3734 AC_MSG_RESULT([failed])
3735 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3737 AC_MSG_RESULT([$MANOPT])
3740 AC_MSG_RESULT([$MANOPT])
3745 if test -z "$MANOPT"
3747 dnl if no nroff tool was found, or no option that could convert man pages
3748 dnl was found, then disable the built-in manual stuff
3749 AC_MSG_WARN([disabling built-in manual])
3753 dnl *************************************************************************
3754 dnl If the manual variable still is set, then we go with providing a built-in
3757 if test "$USE_MANUAL" = "1"; then
3758 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3759 curl_manual_msg="enabled"
3762 dnl set variable for use in automakefile(s)
3763 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3767 if test "x$curl_cv_native_windows" != "xyes" &&
3768 test "x$enable_shared" = "xyes"; then
3769 build_libhostname=yes
3771 build_libhostname=no
3773 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3775 if test "x$want_ares" != xyes; then
3776 CURL_CHECK_OPTION_THREADED_RESOLVER
3779 dnl ************************************************************
3780 dnl disable POSIX threads
3782 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3783 AC_ARG_ENABLE(pthreads,
3784 AS_HELP_STRING([--enable-pthreads],
3785 [Enable POSIX threads (default for threaded resolver)])
3786 AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3787 [ case "$enableval" in
3788 no) AC_MSG_RESULT(no)
3791 *) AC_MSG_RESULT(yes)
3800 dnl turn off pthreads if rt is disabled
3801 if test "$want_pthreads" != "no"; then
3802 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
3803 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
3805 if test "$dontwant_rt" != "no"; then
3806 dnl if --enable-pthreads was explicit then warn it's being ignored
3807 if test "$want_pthreads" = "yes"; then
3808 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
3814 dnl turn off pthreads if no threaded resolver
3815 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
3820 if test "$want_pthreads" != "no"; then
3821 AC_CHECK_HEADER(pthread.h,
3822 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3823 save_CFLAGS="$CFLAGS"
3824 dnl When statically linking against boringssl, -lpthread is added to LIBS.
3825 dnl Make sure to that this does not pass the check below, we really want
3826 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
3827 dnl lib1541 and lib1565 tests are built with these options. Otherwise
3828 dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
3832 dnl Check for libc variants without a separate pthread lib like bionic
3833 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3836 dnl on HPUX, life is more complicated...
3839 dnl it doesn't actually work without -lpthread
3840 USE_THREADS_POSIX=""
3846 dnl if it wasn't found without lib, search for it in pthread lib
3847 if test "$USE_THREADS_POSIX" != "1"
3849 # assign PTHREAD for pkg-config use
3854 dnl Check if compiler is xlC
3855 COMPILER_VERSION=`"$CC" -qversion 2>/dev/null`
3856 if test x"$COMPILER_VERSION" = "x"; then
3857 CFLAGS="$CFLAGS -pthread"
3859 CFLAGS="$CFLAGS -qthreaded"
3863 dnl No -pthread option, but link with -lpthread
3864 PTHREAD=" -lpthread"
3867 CFLAGS="$CFLAGS -pthread"
3870 AC_CHECK_LIB(pthread, pthread_create,
3871 [USE_THREADS_POSIX=1],
3872 [ CFLAGS="$save_CFLAGS"])
3875 if test "x$USE_THREADS_POSIX" = "x1"
3877 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3878 curl_res_msg="POSIX threaded"
3883 dnl threaded resolver check
3884 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
3885 if test "$want_pthreads" = "yes"; then
3886 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
3888 dnl If native Windows fallback on Win32 threads since no POSIX threads
3889 if test "$curl_cv_native_windows" = "yes"; then
3891 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
3892 curl_res_msg="Win32 threaded"
3894 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
3898 CURL_CONVERT_INCLUDE_TO_ISYSTEM
3900 dnl ************************************************************
3901 dnl disable verbose text strings
3903 AC_MSG_CHECKING([whether to enable verbose strings])
3904 AC_ARG_ENABLE(verbose,
3905 AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
3906 AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3907 [ case "$enableval" in
3910 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3911 curl_verbose_msg="no"
3913 *) AC_MSG_RESULT(yes)
3919 dnl ************************************************************
3920 dnl enable SSPI support
3922 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3924 AS_HELP_STRING([--enable-sspi],[Enable SSPI])
3925 AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
3926 [ case "$enableval" in
3928 if test "$curl_cv_native_windows" = "yes"; then
3930 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3931 AC_SUBST(USE_WINDOWS_SSPI, [1])
3932 curl_sspi_msg="enabled"
3935 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3939 if test "x$SCHANNEL_ENABLED" = "x1"; then
3940 # --with-schannel implies --enable-sspi
3947 if test "x$SCHANNEL_ENABLED" = "x1"; then
3948 # --with-schannel implies --enable-sspi
3955 dnl ************************************************************
3956 dnl disable cryptographic authentication
3958 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3959 AC_ARG_ENABLE(crypto-auth,
3960 AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3961 AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3962 [ case "$enableval" in
3965 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3966 CURL_DISABLE_CRYPTO_AUTH=1
3968 *) AC_MSG_RESULT(yes)
3974 dnl ************************************************************
3975 dnl disable NTLM support
3977 AC_MSG_CHECKING([whether to support NTLM])
3979 AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
3980 AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
3981 [ case "$enableval" in
3984 AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
3987 *) AC_MSG_RESULT(yes)
3993 CURL_CHECK_OPTION_NTLM_WB
3997 dnl ************************************************************
3998 dnl disable TLS-SRP authentication
4000 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
4001 AC_ARG_ENABLE(tls-srp,
4002 AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
4003 AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
4004 [ case "$enableval" in
4009 *) AC_MSG_RESULT(yes)
4017 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
4018 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
4020 curl_tls_srp_msg="enabled"
4023 dnl ************************************************************
4024 dnl disable Unix domain sockets support
4026 AC_MSG_CHECKING([whether to enable Unix domain sockets])
4027 AC_ARG_ENABLE(unix-sockets,
4028 AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
4029 AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
4030 [ case "$enableval" in
4031 no) AC_MSG_RESULT(no)
4032 want_unix_sockets=no
4034 *) AC_MSG_RESULT(yes)
4035 want_unix_sockets=yes
4039 want_unix_sockets=auto
4042 if test "x$want_unix_sockets" != "xno"; then
4043 if test "x$curl_cv_native_windows" = "xyes"; then
4045 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4046 curl_unix_sockets_msg="enabled"
4048 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
4049 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4050 AC_SUBST(USE_UNIX_SOCKETS, [1])
4051 curl_unix_sockets_msg="enabled"
4053 if test "x$want_unix_sockets" = "xyes"; then
4054 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
4062 dnl ************************************************************
4063 dnl disable cookies support
4065 AC_MSG_CHECKING([whether to support cookies])
4066 AC_ARG_ENABLE(cookies,
4067 AS_HELP_STRING([--enable-cookies],[Enable cookies support])
4068 AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
4069 [ case "$enableval" in
4072 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
4074 *) AC_MSG_RESULT(yes)
4080 dnl ************************************************************
4081 dnl disable socketpair
4083 AC_MSG_CHECKING([whether to support socketpair])
4084 AC_ARG_ENABLE(socketpair,
4085 AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
4086 AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
4087 [ case "$enableval" in
4090 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
4092 *) AC_MSG_RESULT(yes)
4098 dnl ************************************************************
4099 dnl disable HTTP authentication support
4101 AC_MSG_CHECKING([whether to support HTTP authentication])
4102 AC_ARG_ENABLE(http-auth,
4103 AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
4104 AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
4105 [ case "$enableval" in
4108 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
4110 *) AC_MSG_RESULT(yes)
4116 dnl ************************************************************
4117 dnl disable DoH support
4119 AC_MSG_CHECKING([whether to support DoH])
4121 AS_HELP_STRING([--enable-doh],[Enable DoH support])
4122 AS_HELP_STRING([--disable-doh],[Disable DoH support]),
4123 [ case "$enableval" in
4126 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
4128 *) AC_MSG_RESULT(yes)
4134 dnl ************************************************************
4135 dnl disable mime API support
4137 AC_MSG_CHECKING([whether to support the MIME API])
4139 AS_HELP_STRING([--enable-mime],[Enable mime API support])
4140 AS_HELP_STRING([--disable-mime],[Disable mime API support]),
4141 [ case "$enableval" in
4144 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
4146 *) AC_MSG_RESULT(yes)
4152 dnl ************************************************************
4153 dnl disable date parsing
4155 AC_MSG_CHECKING([whether to support date parsing])
4156 AC_ARG_ENABLE(dateparse,
4157 AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
4158 AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
4159 [ case "$enableval" in
4162 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
4164 *) AC_MSG_RESULT(yes)
4170 dnl ************************************************************
4173 AC_MSG_CHECKING([whether to support netrc parsing])
4174 AC_ARG_ENABLE(netrc,
4175 AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
4176 AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
4177 [ case "$enableval" in
4180 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
4182 *) AC_MSG_RESULT(yes)
4188 dnl ************************************************************
4189 dnl disable progress-meter
4191 AC_MSG_CHECKING([whether to support progress-meter])
4192 AC_ARG_ENABLE(progress-meter,
4193 AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
4194 AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
4195 [ case "$enableval" in
4198 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
4200 *) AC_MSG_RESULT(yes)
4206 dnl ************************************************************
4207 dnl disable shuffle DNS support
4209 AC_MSG_CHECKING([whether to support DNS shuffling])
4210 AC_ARG_ENABLE(dnsshuffle,
4211 AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
4212 AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
4213 [ case "$enableval" in
4216 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4218 *) AC_MSG_RESULT(yes)
4224 dnl ************************************************************
4225 dnl disable the curl_easy_options API
4227 AC_MSG_CHECKING([whether to support curl_easy_option*])
4228 AC_ARG_ENABLE(get-easy-options,
4229 AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
4230 AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
4231 [ case "$enableval" in
4234 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
4236 *) AC_MSG_RESULT(yes)
4242 dnl ************************************************************
4243 dnl switch on/off alt-svc
4245 AC_MSG_CHECKING([whether to support alt-svc])
4246 AC_ARG_ENABLE(alt-svc,
4247 AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
4248 AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
4249 [ case "$enableval" in
4252 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
4253 curl_altsvc_msg="no";
4256 *) AC_MSG_RESULT(yes)
4262 dnl ************************************************************
4263 dnl switch on/off headers-api
4265 AC_MSG_CHECKING([whether to support headers-api])
4266 AC_ARG_ENABLE(headers-api,
4267 AS_HELP_STRING([--enable-headers-api],[Enable headers-api support])
4268 AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]),
4269 [ case "$enableval" in
4270 no) AC_MSG_RESULT(no)
4271 curl_headers_msg="no (--enable-headers-api)"
4272 AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api])
4281 dnl only check for HSTS if there's SSL present
4282 if test -n "$SSL_ENABLED"; then
4283 dnl ************************************************************
4284 dnl switch on/off hsts
4286 AC_MSG_CHECKING([whether to support HSTS])
4288 AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
4289 AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
4290 [ case "$enableval" in
4295 *) AC_MSG_RESULT(yes)
4298 AC_MSG_RESULT($hsts)
4301 AC_MSG_NOTICE([disables HSTS due to lack of SSL])
4305 if test "x$hsts" != "xyes"; then
4306 curl_hsts_msg="no (--enable-hsts)";
4307 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
4310 dnl *************************************************************
4311 dnl check whether ECH support, if desired, is actually available
4313 if test "x$want_ech" != "xno"; then
4314 AC_MSG_CHECKING([whether ECH support is available])
4316 dnl assume NOT and look for sufficient condition
4320 dnl OpenSSL with a chosen ECH function should be enough
4321 dnl so more exhaustive checking seems unnecessary for now
4322 if test "x$OPENSSL_ENABLED" = "x1"; then
4323 AC_CHECK_FUNCS(SSL_get_ech_status,
4324 ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
4327 dnl add 'elif' chain here for additional implementations
4330 dnl now deal with whatever we found
4331 if test "x$ECH_ENABLED" = "x1"; then
4332 AC_DEFINE(USE_ECH, 1, [if ECH support is available])
4333 AC_MSG_RESULT($ECH_SUPPORT)
4334 experimental="$experimental ECH"
4336 AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
4340 dnl *************************************************************
4341 dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio
4343 if test "x$OPENSSL_ENABLED" = "x1"; then
4344 AC_CHECK_FUNCS([SSL_set0_wbio])
4347 dnl *************************************************************
4350 AC_MSG_CHECKING([whether to support WebSockets])
4351 AC_ARG_ENABLE(websockets,
4352 AS_HELP_STRING([--enable-websockets],[Enable WebSockets support])
4353 AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]),
4354 [ case "$enableval" in
4359 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4361 curl_ws_msg="enabled"
4362 AC_DEFINE_UNQUOTED(USE_WEBSOCKETS, [1], [enable websockets support])
4363 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS"
4364 if test "x$SSL_ENABLED" = "x1"; then
4365 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS"
4367 experimental="$experimental Websockets"
4369 dnl websockets requires >32 bit curl_off_t
4371 AC_MSG_WARN([Websockets disabled due to lack of >32 bit curl_off_t])
4379 dnl ************************************************************
4380 dnl hiding of library internal symbols
4382 CURL_CONFIGURE_SYMBOL_HIDING
4385 dnl All the library dependencies put into $LIB apply to libcurl only.
4387 LIBCURL_LIBS="$LIBS$PTHREAD"
4389 AC_SUBST(LIBCURL_LIBS)
4390 AC_SUBST(CURL_NETWORK_LIBS)
4391 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4393 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4394 dnl LIBS variable used in generated makefile at makefile processing
4395 dnl time. Doing this functionally prevents LIBS from being used for
4396 dnl all link targets in given makefile.
4398 AC_SUBST(BLANK_AT_MAKETIME)
4400 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4403 ENABLE_SHARED="$enable_shared"
4404 AC_SUBST(ENABLE_SHARED)
4406 dnl to let curl-config output the static libraries correctly
4407 ENABLE_STATIC="$enable_static"
4408 AC_SUBST(ENABLE_STATIC)
4410 dnl merge the pkg-config Libs.private field into Libs when static-only
4411 if test "x$enable_shared" = "xno"; then
4412 LIBCURL_NO_SHARED=$LIBCURL_LIBS
4416 AC_SUBST(LIBCURL_NO_SHARED)
4421 dnl For keeping supported features and protocols also in pkg-config file
4422 dnl since it is more cross-compile friendly than curl-config
4425 if test "x$OPENSSL_ENABLED" = "x1"; then
4426 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4427 elif test -n "$SSL_ENABLED"; then
4428 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4430 if test "x$IPV6_ENABLED" = "x1"; then
4431 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4433 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4434 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4436 if test "x$HAVE_LIBZ" = "x1"; then
4437 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4439 if test "x$HAVE_BROTLI" = "x1"; then
4440 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4442 if test "x$HAVE_ZSTD" = "x1"; then
4443 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
4445 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4446 -o "x$USE_THREADS_WIN32" = "x1"; then
4447 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4449 if test "x$IDN_ENABLED" = "x1"; then
4450 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4452 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4453 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4456 if test "x$HAVE_GSSAPI" = "x1"; then
4457 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4460 if test "x$curl_psl_msg" = "xenabled"; then
4461 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4464 if test "x$curl_gsasl_msg" = "xenabled"; then
4465 SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
4468 if test "x$enable_altsvc" = "xyes"; then
4469 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4471 if test "x$hsts" = "xyes"; then
4472 SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
4475 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4476 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4477 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4480 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4481 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4482 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4485 use_curl_ntlm_core=no
4487 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4488 "x$CURL_DISABLE_NTLM" != "x1"; then
4489 if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4490 -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
4491 -o "x$SECURETRANSPORT_ENABLED" = "x1" \
4492 -o "x$USE_WIN32_CRYPTO" = "x1" \
4493 -o "x$WOLFSSL_NTLM" = "x1"; then
4494 use_curl_ntlm_core=yes
4497 if test "x$use_curl_ntlm_core" = "xyes" \
4498 -o "x$USE_WINDOWS_SSPI" = "x1"; then
4499 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4501 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4502 "x$NTLM_WB_ENABLED" = "x1"; then
4503 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4508 if test "x$USE_TLS_SRP" = "x1"; then
4509 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4512 if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
4513 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4516 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1" \
4517 -o "x$USE_MSH3" = "x1"; then
4518 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
4521 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4522 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4525 dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
4526 if test "x$https_proxy" != "xno"; then
4527 if test "x$OPENSSL_ENABLED" = "x1" \
4528 -o "x$GNUTLS_ENABLED" = "x1" \
4529 -o "x$NSS_ENABLED" = "x1" \
4530 -o "x$SECURETRANSPORT_ENABLED" = "x1" \
4531 -o "x$RUSTLS_ENABLED" = "x1" \
4532 -o "x$BEARSSL_ENABLED" = "x1" \
4533 -o "x$SCHANNEL_ENABLED" = "x1" \
4534 -o "x$GNUTLS_ENABLED" = "x1" \
4535 -o "x$MBEDTLS_ENABLED" = "x1"; then
4536 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4537 elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$WOLFSSL_FULL_BIO" = "x1"; then
4538 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4542 if test "x$ECH_ENABLED" = "x1"; then
4543 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
4546 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4547 if test ${ac_cv_sizeof_off_t} -gt 4 -o \
4548 "$curl_win32_file_api" = "win32_large_files"; then
4549 SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
4553 if test "$tst_atomic" = "yes"; then
4554 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
4558 #include <windows.h>
4560 #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
4565 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
4570 dnl replace spaces with newlines
4572 dnl replace the newlines back to spaces
4573 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
4574 AC_SUBST(SUPPORT_FEATURES)
4576 dnl For supported protocols in pkg-config file
4577 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4578 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4579 if test "x$SSL_ENABLED" = "x1"; then
4580 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4583 if test "x$CURL_DISABLE_FTP" != "x1"; then
4584 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4585 if test "x$SSL_ENABLED" = "x1"; then
4586 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4589 if test "x$CURL_DISABLE_FILE" != "x1"; then
4590 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4592 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4593 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4595 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4596 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4597 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4598 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4599 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4600 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4604 if test "x$CURL_DISABLE_DICT" != "x1"; then
4605 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4607 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4608 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4610 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4611 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4612 if test "x$SSL_ENABLED" = "x1"; then
4613 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
4616 if test "x$CURL_DISABLE_MQTT" != "x1"; then
4617 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
4619 if test "x$CURL_DISABLE_POP3" != "x1"; then
4620 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4621 if test "x$SSL_ENABLED" = "x1"; then
4622 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4625 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4626 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4627 if test "x$SSL_ENABLED" = "x1"; then
4628 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4631 if test "x$CURL_DISABLE_SMB" != "x1" \
4632 -a "x$use_curl_ntlm_core" = "xyes"; then
4633 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4634 if test "x$SSL_ENABLED" = "x1"; then
4635 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4638 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4639 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4640 if test "x$SSL_ENABLED" = "x1"; then
4641 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4644 if test "x$USE_LIBSSH2" = "x1"; then
4645 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4646 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4648 if test "x$USE_LIBSSH" = "x1"; then
4649 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4650 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4652 if test "x$USE_WOLFSSH" = "x1"; then
4653 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4655 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4656 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4658 if test "x$USE_LIBRTMP" = "x1"; then
4659 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4662 dnl replace spaces with newlines
4664 dnl replace the newlines back to spaces
4665 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4667 AC_SUBST(SUPPORT_PROTOCOLS)
4669 dnl squeeze whitespace out of some variables
4677 squeeze LIBCURL_LIBS
4678 squeeze CURL_NETWORK_LIBS
4679 squeeze CURL_NETWORK_AND_TIME_LIBS
4681 squeeze SUPPORT_FEATURES
4682 squeeze SUPPORT_PROTOCOLS
4684 XC_CHECK_BUILD_FLAGS
4686 SSL_BACKENDS=${ssl_backends}
4687 AC_SUBST(SSL_BACKENDS)
4689 if test "x$want_curldebug_assumed" = "xyes" &&
4690 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4691 ac_configure_args="$ac_configure_args --enable-curldebug"
4694 AC_CONFIG_FILES([Makefile \
4696 docs/examples/Makefile \
4697 docs/libcurl/Makefile \
4698 docs/libcurl/opts/Makefile \
4699 docs/cmdline-opts/Makefile \
4701 include/curl/Makefile \
4709 tests/certs/Makefile \
4710 tests/certs/scripts/Makefile \
4711 tests/data/Makefile \
4712 tests/server/Makefile \
4713 tests/libtest/Makefile \
4714 tests/unit/Makefile \
4715 tests/http/config.ini \
4716 tests/http/Makefile \
4717 tests/http/clients/Makefile \
4719 packages/vms/Makefile \
4725 CURL_GENERATE_CONFIGUREHELP_PM
4727 AC_MSG_NOTICE([Configured to build curl/libcurl:
4730 Install prefix: ${prefix}
4733 CPPFLAGS: ${CPPFLAGS}
4737 curl version: ${CURLVERSION}
4738 SSL: ${curl_ssl_msg}
4739 SSH: ${curl_ssh_msg}
4740 zlib: ${curl_zlib_msg}
4741 brotli: ${curl_brotli_msg}
4742 zstd: ${curl_zstd_msg}
4743 GSS-API: ${curl_gss_msg}
4744 GSASL: ${curl_gsasl_msg}
4745 TLS-SRP: ${curl_tls_srp_msg}
4746 resolver: ${curl_res_msg}
4747 IPv6: ${curl_ipv6_msg}
4748 Unix sockets: ${curl_unix_sockets_msg}
4749 IDN: ${curl_idn_msg}
4750 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4751 Built-in manual: ${curl_manual_msg}
4752 --libcurl option: ${curl_libcurl_msg}
4753 Verbose errors: ${curl_verbose_msg}
4754 Code coverage: ${curl_coverage_msg}
4755 SSPI: ${curl_sspi_msg}
4756 ca cert bundle: ${ca}${ca_warning}
4757 ca cert path: ${capath}${capath_warning}
4758 ca fallback: ${with_ca_fallback}
4759 LDAP: ${curl_ldap_msg}
4760 LDAPS: ${curl_ldaps_msg}
4761 RTSP: ${curl_rtsp_msg}
4762 RTMP: ${curl_rtmp_msg}
4763 PSL: ${curl_psl_msg}
4764 Alt-svc: ${curl_altsvc_msg}
4765 Headers API: ${curl_headers_msg}
4766 HSTS: ${curl_hsts_msg}
4767 HTTP1: ${curl_h1_msg}
4768 HTTP2: ${curl_h2_msg}
4769 HTTP3: ${curl_h3_msg}
4770 ECH: ${curl_ech_msg}
4771 WebSockets: ${curl_ws_msg}
4772 Protocols: ${SUPPORT_PROTOCOLS}
4773 Features: ${SUPPORT_FEATURES}
4775 if test -n "$experimental"; then
4777 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!