1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2019, 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.haxx.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 #***************************************************************************
22 dnl Process this file with autoconf to produce a configure script.
26 dnl We don't know the version number "statically" so we use a dash here
27 AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.haxx.se/mail/])
31 CURL_OVERRIDE_AUTOCONF
33 dnl configure script copyright
34 AC_COPYRIGHT([Copyright (c) 1998 - 2019 Daniel Stenberg, <daniel@haxx.se>
35 This configure script may be copied, distributed and modified under the
36 terms of the curl license; see COPYING for more details])
38 AC_CONFIG_SRCDIR([lib/urldata.h])
39 AC_CONFIG_HEADERS(lib/curl_config.h)
40 AC_CONFIG_MACRO_DIR([m4])
42 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
44 CURL_CHECK_OPTION_DEBUG
45 CURL_CHECK_OPTION_OPTIMIZE
46 CURL_CHECK_OPTION_WARNINGS
47 CURL_CHECK_OPTION_WERROR
48 CURL_CHECK_OPTION_CURLDEBUG
49 CURL_CHECK_OPTION_SYMBOL_HIDING
50 CURL_CHECK_OPTION_ARES
52 CURL_CHECK_OPTION_ESNI
54 XC_CHECK_PATH_SEPARATOR
57 # save the configure arguments
59 CONFIGURE_OPTIONS="\"$ac_configure_args\""
60 AC_SUBST(CONFIGURE_OPTIONS)
63 if test X"$want_werror" = Xyes; then
64 CURL_CFLAG_EXTRAS="-Werror"
65 if test "$compiler_id" = "GNU_C"; then
66 dnl enable -pedantic-errors for GCC 5 and later,
67 dnl as before that it was the same as -Werror=pedantic
68 if test "$compiler_num" -ge "500"; then
69 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
73 AC_SUBST(CURL_CFLAG_EXTRAS)
75 dnl SED is mandatory for configure process and libtool.
76 dnl Set it now, allowing it to be changed later.
77 if test -z "$SED"; then
78 dnl allow it to be overridden
79 AC_PATH_PROG([SED], [sed], [not_found],
80 [$PATH:/usr/bin:/usr/local/bin])
81 if test -z "$SED" || test "$SED" = "not_found"; then
82 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
87 dnl GREP is mandatory for configure process and libtool.
88 dnl Set it now, allowing it to be changed later.
89 if test -z "$GREP"; then
90 dnl allow it to be overridden
91 AC_PATH_PROG([GREP], [grep], [not_found],
92 [$PATH:/usr/bin:/usr/local/bin])
93 if test -z "$GREP" || test "$GREP" = "not_found"; then
94 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
99 dnl EGREP is mandatory for configure process and libtool.
100 dnl Set it now, allowing it to be changed later.
101 if test -z "$EGREP"; then
102 dnl allow it to be overridden
103 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
104 AC_MSG_CHECKING([for egrep])
106 AC_MSG_RESULT([$EGREP])
108 AC_PATH_PROG([EGREP], [egrep], [not_found],
109 [$PATH:/usr/bin:/usr/local/bin])
112 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
113 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
117 dnl AR is mandatory for configure process and libtool.
118 dnl This is target dependent, so check it as a tool.
119 if test -z "$AR"; then
120 dnl allow it to be overridden
121 AC_PATH_TOOL([AR], [ar], [not_found],
122 [$PATH:/usr/bin:/usr/local/bin])
123 if test -z "$AR" || test "$AR" = "not_found"; then
124 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
131 dnl figure out the libcurl version
132 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
135 dnl for --enable-code-coverage
139 AC_MSG_CHECKING([curl version])
140 AC_MSG_RESULT($CURLVERSION)
142 AC_SUBST(CURLVERSION)
145 dnl we extract the numerical version for curl-config only
146 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
149 dnl Solaris pkgadd support definitions
150 PKGADD_PKG="HAXXcurl"
151 PKGADD_NAME="curl - a client that groks URLs"
152 PKGADD_VENDOR="curl.haxx.se"
154 AC_SUBST(PKGADD_NAME)
155 AC_SUBST(PKGADD_VENDOR)
158 dnl initialize all the info variables
159 curl_ssl_msg="no (--with-{ssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,mesalink,amissl,bearssl} )"
160 curl_ssh_msg="no (--with-{libssh,libssh2})"
161 curl_zlib_msg="no (--with-zlib)"
162 curl_brotli_msg="no (--with-brotli)"
163 curl_gss_msg="no (--with-gssapi)"
164 curl_tls_srp_msg="no (--enable-tls-srp)"
165 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
166 curl_ipv6_msg="no (--enable-ipv6)"
167 curl_unix_sockets_msg="no (--enable-unix-sockets)"
168 curl_idn_msg="no (--with-{libidn2,winidn})"
169 curl_manual_msg="no (--enable-manual)"
170 curl_libcurl_msg="enabled (--disable-libcurl-option)"
171 curl_verbose_msg="enabled (--disable-verbose)"
172 curl_sspi_msg="no (--enable-sspi)"
173 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
174 curl_ldaps_msg="no (--enable-ldaps)"
175 curl_rtsp_msg="no (--enable-rtsp)"
176 curl_rtmp_msg="no (--with-librtmp)"
177 curl_mtlnk_msg="no (--with-libmetalink)"
178 curl_psl_msg="no (--with-libpsl)"
183 dnl Save some initial values the user might have provided
185 INITIAL_LDFLAGS=$LDFLAGS
189 dnl Detect the canonical host and target build environment
193 dnl Get system canonical name
194 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
196 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
197 AC_SUBST(AR_FLAGS, [cr])
199 dnl This defines _ALL_SOURCE for AIX
200 CURL_CHECK_AIX_ALL_SOURCE
202 dnl Our configure and build reentrant settings
203 CURL_CONFIGURE_THREAD_SAFE
204 CURL_CONFIGURE_REENTRANT
206 dnl check for how to do large files
212 # Automake conditionals based on libtool related checks
215 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
216 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
217 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
218 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
219 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
220 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
223 # Due to libtool and automake machinery limitations of not allowing
224 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
225 # inclusion of these in shared or static libraries, we are forced to
226 # build using separate configure runs for shared and static libraries
227 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
228 # to compile objects for each kind of library. Notice that relying on
229 # the '-DPIC' CFLAG that libtool provides is not valid given that the
230 # user might for example choose to build static libraries with PIC.
234 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
235 # targeting a static library and not building its shared counterpart.
238 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
239 [test "x$xc_lt_build_static_only" = 'xyes'])
242 # Make staticlib CPPFLAG variable and its definition visible in output
243 # files unconditionally, providing an empty definition unless strictly
244 # targeting a static library and not building its shared counterpart.
247 CPPFLAG_CURL_STATICLIB=
248 if test "x$xc_lt_build_static_only" = 'xyes'; then
249 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
251 AC_SUBST([CPPFLAG_CURL_STATICLIB])
254 # Determine whether all dependent libraries must be specified when linking
255 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
261 AC_SUBST(REQUIRE_LIB_DEPS)
262 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
264 dnl check if there's a way to force code inline
267 dnl **********************************************************************
268 dnl platform/compiler/architecture specific checks/flags
269 dnl **********************************************************************
272 CURL_SET_COMPILER_BASIC_OPTS
273 CURL_SET_COMPILER_DEBUG_OPTS
274 CURL_SET_COMPILER_OPTIMIZE_OPTS
275 CURL_SET_COMPILER_WARNING_OPTS
277 if test "$compiler_id" = "INTEL_UNIX_C"; then
279 if test "$compiler_num" -ge "1000"; then
280 dnl icc 10.X or later
281 CFLAGS="$CFLAGS -shared-intel"
282 elif test "$compiler_num" -ge "900"; then
284 CFLAGS="$CFLAGS -i-dynamic"
289 CURL_CHECK_COMPILER_HALT_ON_ERROR
290 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
291 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
292 CURL_CHECK_COMPILER_SYMBOL_HIDING
295 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
297 supports_unittests=yes
298 # cross-compilation of unit tests static library/programs fails when
299 # libcurl shared library is built. This might be due to a libtool or
300 # automake issue. In this case we disable unit tests.
301 if test "x$cross_compiling" != "xno" &&
302 test "x$enable_shared" != "xno"; then
303 supports_unittests=no
306 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
307 # a problem related with OpenSSL headers and library versions not matching.
308 # Disable unit tests while time to further investigate this is found.
311 if test "$compiler_id" = "GNU_C"; then
312 supports_unittests=no
317 # All AIX autobuilds fails unit tests linking against unittests library
318 # due to unittests library being built with no symbols or members. Libtool ?
319 # Disable unit tests while time to further investigate this is found.
322 supports_unittests=no
326 dnl Build unit tests when option --enable-debug is given.
327 if test "x$want_debug" = "xyes" &&
328 test "x$supports_unittests" = "xyes"; then
333 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
335 dnl **********************************************************************
336 dnl Compilation based checks should not be done before this point.
337 dnl **********************************************************************
339 dnl **********************************************************************
340 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
341 dnl and ws2tcpip.h take precedence over any other further checks which
342 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
343 dnl this specific header files. And do them before its results are used.
344 dnl **********************************************************************
346 CURL_CHECK_HEADER_WINDOWS
347 CURL_CHECK_NATIVE_WINDOWS
348 case X-"$curl_cv_native_windows" in
350 CURL_CHECK_HEADER_WINSOCK
351 CURL_CHECK_HEADER_WINSOCK2
352 CURL_CHECK_HEADER_WS2TCPIP
353 CURL_CHECK_HEADER_WINLDAP
354 CURL_CHECK_HEADER_WINBER
357 curl_cv_header_winsock_h="no"
358 curl_cv_header_winsock2_h="no"
359 curl_cv_header_ws2tcpip_h="no"
360 curl_cv_header_winldap_h="no"
361 curl_cv_header_winber_h="no"
364 CURL_CHECK_WIN32_LARGEFILE
367 CURL_SUPPORTS_BUILTIN_AVAILABLE
370 dnl ************************************************************
371 dnl switch off particular protocols
373 AC_MSG_CHECKING([whether to support http])
375 AC_HELP_STRING([--enable-http],[Enable HTTP support])
376 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
377 [ case "$enableval" in
380 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
382 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
383 AC_SUBST(CURL_DISABLE_HTTP, [1])
384 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
385 AC_SUBST(CURL_DISABLE_RTSP, [1])
387 *) AC_MSG_RESULT(yes)
392 AC_MSG_CHECKING([whether to support ftp])
394 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
395 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
396 [ case "$enableval" in
399 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
400 AC_SUBST(CURL_DISABLE_FTP, [1])
402 *) AC_MSG_RESULT(yes)
407 AC_MSG_CHECKING([whether to support file])
409 AC_HELP_STRING([--enable-file],[Enable FILE support])
410 AC_HELP_STRING([--disable-file],[Disable FILE support]),
411 [ case "$enableval" in
414 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
415 AC_SUBST(CURL_DISABLE_FILE, [1])
417 *) AC_MSG_RESULT(yes)
422 AC_MSG_CHECKING([whether to support ldap])
424 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
425 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
426 [ case "$enableval" in
429 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
430 AC_SUBST(CURL_DISABLE_LDAP, [1])
438 AC_MSG_CHECKING([whether to support ldaps])
440 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
441 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
442 [ case "$enableval" in
445 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
446 AC_SUBST(CURL_DISABLE_LDAPS, [1])
448 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
449 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
450 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
451 AC_SUBST(CURL_DISABLE_LDAPS, [1])
454 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
455 AC_SUBST(HAVE_LDAP_SSL, [1])
459 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
461 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
462 AC_SUBST(CURL_DISABLE_LDAPS, [1])
465 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
466 AC_SUBST(HAVE_LDAP_SSL, [1])
470 AC_MSG_CHECKING([whether to support rtsp])
472 AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
473 AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
474 [ case "$enableval" in
477 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
478 AC_SUBST(CURL_DISABLE_RTSP, [1])
480 *) if test x$CURL_DISABLE_HTTP = x1 ; then
481 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
484 curl_rtsp_msg="enabled"
488 if test "x$CURL_DISABLE_HTTP" != "x1"; then
490 curl_rtsp_msg="enabled"
496 AC_MSG_CHECKING([whether to support proxies])
498 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
499 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
500 [ case "$enableval" in
503 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
504 AC_SUBST(CURL_DISABLE_PROXY, [1])
506 *) AC_MSG_RESULT(yes)
512 AC_MSG_CHECKING([whether to support dict])
514 AC_HELP_STRING([--enable-dict],[Enable DICT support])
515 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
516 [ case "$enableval" in
519 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
520 AC_SUBST(CURL_DISABLE_DICT, [1])
522 *) AC_MSG_RESULT(yes)
527 AC_MSG_CHECKING([whether to support telnet])
528 AC_ARG_ENABLE(telnet,
529 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
530 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
531 [ case "$enableval" in
534 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
535 AC_SUBST(CURL_DISABLE_TELNET, [1])
537 *) AC_MSG_RESULT(yes)
542 AC_MSG_CHECKING([whether to support tftp])
544 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
545 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
546 [ case "$enableval" in
549 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
550 AC_SUBST(CURL_DISABLE_TFTP, [1])
552 *) AC_MSG_RESULT(yes)
558 AC_MSG_CHECKING([whether to support pop3])
560 AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
561 AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
562 [ case "$enableval" in
565 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
566 AC_SUBST(CURL_DISABLE_POP3, [1])
568 *) AC_MSG_RESULT(yes)
575 AC_MSG_CHECKING([whether to support imap])
577 AC_HELP_STRING([--enable-imap],[Enable IMAP support])
578 AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
579 [ case "$enableval" in
582 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
583 AC_SUBST(CURL_DISABLE_IMAP, [1])
585 *) AC_MSG_RESULT(yes)
592 AC_MSG_CHECKING([whether to support smb])
594 AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
595 AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
596 [ case "$enableval" in
599 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
600 AC_SUBST(CURL_DISABLE_SMB, [1])
602 *) AC_MSG_RESULT(yes)
608 AC_MSG_CHECKING([whether to support smtp])
610 AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
611 AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
612 [ case "$enableval" in
615 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
616 AC_SUBST(CURL_DISABLE_SMTP, [1])
618 *) AC_MSG_RESULT(yes)
624 AC_MSG_CHECKING([whether to support gopher])
625 AC_ARG_ENABLE(gopher,
626 AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
627 AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
628 [ case "$enableval" in
631 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
632 AC_SUBST(CURL_DISABLE_GOPHER, [1])
634 *) AC_MSG_RESULT(yes)
641 dnl **********************************************************************
642 dnl Check for built-in manual
643 dnl **********************************************************************
645 AC_MSG_CHECKING([whether to provide built-in manual])
646 AC_ARG_ENABLE(manual,
647 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
648 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
649 [ case "$enableval" in
653 *) AC_MSG_RESULT(yes)
660 dnl The actual use of the USE_MANUAL variable is done much later in this
661 dnl script to allow other actions to disable it as well.
663 dnl ************************************************************
664 dnl disable C code generation support
666 AC_MSG_CHECKING([whether to enable generation of C code])
667 AC_ARG_ENABLE(libcurl_option,
668 AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
669 AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
670 [ case "$enableval" in
673 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
674 curl_libcurl_msg="no"
676 *) AC_MSG_RESULT(yes)
682 dnl **********************************************************************
683 dnl Checks for libraries.
684 dnl **********************************************************************
686 AC_MSG_CHECKING([whether to use libgcc])
687 AC_ARG_ENABLE(libgcc,
688 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
689 [ case "$enableval" in
702 dnl gethostbyname without lib or in the nsl lib?
703 AC_CHECK_FUNC(gethostbyname,
704 [HAVE_GETHOSTBYNAME="1"
706 [ AC_CHECK_LIB(nsl, gethostbyname,
707 [HAVE_GETHOSTBYNAME="1"
712 if test "$HAVE_GETHOSTBYNAME" != "1"
714 dnl gethostbyname in the socket lib?
715 AC_CHECK_LIB(socket, gethostbyname,
716 [HAVE_GETHOSTBYNAME="1"
717 LIBS="-lsocket $LIBS"
721 if test "$HAVE_GETHOSTBYNAME" != "1"
723 dnl gethostbyname in the watt lib?
724 AC_CHECK_LIB(watt, gethostbyname,
725 [HAVE_GETHOSTBYNAME="1"
726 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
727 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
732 dnl At least one system has been identified to require BOTH nsl and socket
733 dnl libs at the same time to link properly.
734 if test "$HAVE_GETHOSTBYNAME" != "1"
736 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
737 my_ac_save_LIBS=$LIBS
738 LIBS="-lnsl -lsocket $LIBS"
746 HAVE_GETHOSTBYNAME="1"
749 LIBS=$my_ac_save_LIBS
753 if test "$HAVE_GETHOSTBYNAME" != "1"
755 dnl This is for winsock systems
756 if test "$curl_cv_header_windows_h" = "yes"; then
757 if test "$curl_cv_header_winsock_h" = "yes"; then
760 winsock_LIB="-lwinsock"
763 winsock_LIB="-lwsock32"
767 if test "$curl_cv_header_winsock2_h" = "yes"; then
768 winsock_LIB="-lws2_32"
770 if test ! -z "$winsock_LIB"; then
771 my_ac_save_LIBS=$LIBS
772 LIBS="$winsock_LIB $LIBS"
773 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
776 #ifdef HAVE_WINDOWS_H
777 #ifndef WIN32_LEAN_AND_MEAN
778 #define WIN32_LEAN_AND_MEAN
781 #ifdef HAVE_WINSOCK2_H
782 #include <winsock2.h>
784 #ifdef HAVE_WINSOCK_H
790 gethostbyname("www.dummysite.com");
794 HAVE_GETHOSTBYNAME="1"
798 LIBS=$my_ac_save_LIBS
804 if test "$HAVE_GETHOSTBYNAME" != "1"
806 dnl This is for Minix 3.1
807 AC_MSG_CHECKING([for gethostbyname for Minix 3])
810 /* Older Minix versions may need <net/gen/netdb.h> here instead */
813 gethostbyname("www.dummysite.com");
817 HAVE_GETHOSTBYNAME="1"
823 if test "$HAVE_GETHOSTBYNAME" != "1"
825 dnl This is for eCos with a stubbed DNS implementation
826 AC_MSG_CHECKING([for gethostbyname for eCos])
832 gethostbyname("www.dummysite.com");
836 HAVE_GETHOSTBYNAME="1"
842 if test "$HAVE_GETHOSTBYNAME" != "1"
844 dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
845 AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
848 #include <proto/bsdsocket.h>
849 struct Library *SocketBase = NULL;
851 gethostbyname("www.dummysite.com");
855 HAVE_GETHOSTBYNAME="1"
856 HAVE_PROTO_BSDSOCKET_H="1"
857 AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
858 AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
864 if test "$HAVE_GETHOSTBYNAME" != "1"
866 dnl gethostbyname in the network lib - for Haiku OS
867 AC_CHECK_LIB(network, gethostbyname,
868 [HAVE_GETHOSTBYNAME="1"
869 LIBS="-lnetwork $LIBS"
873 if test "$HAVE_GETHOSTBYNAME" != "1"
875 dnl gethostbyname in the net lib - for BeOS
876 AC_CHECK_LIB(net, gethostbyname,
877 [HAVE_GETHOSTBYNAME="1"
883 if test "$HAVE_GETHOSTBYNAME" != "1"; then
884 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
887 CURL_CHECK_LIBS_CONNECT
889 CURL_NETWORK_LIBS=$LIBS
891 dnl **********************************************************************
892 dnl In case that function clock_gettime with monotonic timer is available,
893 dnl check for additional required libraries.
894 dnl **********************************************************************
895 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
897 dnl **********************************************************************
898 dnl The preceding library checks are all potentially useful for test
899 dnl servers and libtest cases which require networking and clock_gettime
900 dnl support. Save the list of required libraries at this point for use
901 dnl while linking those test servers and programs.
902 dnl **********************************************************************
903 CURL_NETWORK_AND_TIME_LIBS=$LIBS
905 dnl **********************************************************************
906 dnl Check for the presence of ZLIB libraries and headers
907 dnl **********************************************************************
909 dnl Check for & handle argument to --with-zlib.
911 clean_CPPFLAGS=$CPPFLAGS
912 clean_LDFLAGS=$LDFLAGS
916 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
917 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
918 [OPT_ZLIB="$withval"])
920 if test "$OPT_ZLIB" = "no" ; then
921 AC_MSG_WARN([zlib disabled])
923 if test "$OPT_ZLIB" = "yes" ; then
927 if test -z "$OPT_ZLIB" ; then
928 CURL_CHECK_PKGCONFIG(zlib)
930 if test "$PKGCONFIG" != "no" ; then
931 LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
932 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
933 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
938 if test -z "$HAVE_LIBZ"; then
940 dnl Check for the lib without setting any new path, since many
941 dnl people have it in the default path
943 AC_CHECK_LIB(z, inflateEnd,
944 dnl libz found, set the variable
947 dnl if no lib found, try /usr/local
948 [OPT_ZLIB="/usr/local"])
952 dnl Add a nonempty path to the compiler flags
953 if test -n "$OPT_ZLIB"; then
954 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
955 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
958 AC_CHECK_HEADER(zlib.h,
962 dnl if the lib wasn't found already, try again with the new paths
963 if test "$HAVE_LIBZ" != "1"; then
964 AC_CHECK_LIB(z, gzread,
966 dnl the lib was found!
970 [ CPPFLAGS=$clean_CPPFLAGS
971 LDFLAGS=$clean_LDFLAGS])
975 dnl zlib.h was not found, restore the flags
976 CPPFLAGS=$clean_CPPFLAGS
977 LDFLAGS=$clean_LDFLAGS]
980 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
982 AC_MSG_WARN([configure found only the libz lib, not the header file!])
984 CPPFLAGS=$clean_CPPFLAGS
985 LDFLAGS=$clean_LDFLAGS
987 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
989 AC_MSG_WARN([configure found only the libz header file, not the lib!])
990 CPPFLAGS=$clean_CPPFLAGS
991 LDFLAGS=$clean_LDFLAGS
993 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
995 dnl both header and lib were found!
997 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
998 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1001 LIBS="-lz $clean_LIBS"
1003 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1005 AC_MSG_NOTICE([found both libz and libz.h header])
1006 curl_zlib_msg="enabled"
1010 dnl set variable for use in automakefile(s)
1011 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1014 dnl **********************************************************************
1015 dnl Check for the presence of BROTLI decoder libraries and headers
1016 dnl **********************************************************************
1018 dnl Brotli project home page: https://github.com/google/brotli
1020 dnl Default to compiler & linker defaults for BROTLI files & libraries.
1022 AC_ARG_WITH(brotli,dnl
1023 AC_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])
1024 AC_HELP_STRING([--without-brotli], [disable BROTLI]),
1025 OPT_BROTLI=$withval)
1027 if test X"$OPT_BROTLI" != Xno; then
1028 dnl backup the pre-brotli variables
1029 CLEANLDFLAGS="$LDFLAGS"
1030 CLEANCPPFLAGS="$CPPFLAGS"
1033 case "$OPT_BROTLI" in
1035 dnl --with-brotli (without path) used
1036 CURL_CHECK_PKGCONFIG(libbrotlidec)
1038 if test "$PKGCONFIG" != "no" ; then
1039 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1040 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1041 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1042 version=`$PKGCONFIG --modversion libbrotlidec`
1043 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/-L//'`
1048 dnl no --with-brotli option given, just check default places
1051 dnl use the given --with-brotli spot
1052 PREFIX_BROTLI=$OPT_BROTLI
1056 dnl if given with a prefix, we set -L and -I based on that
1057 if test -n "$PREFIX_BROTLI"; then
1058 LIB_BROTLI="-lbrotlidec"
1059 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1060 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1061 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1064 LDFLAGS="$LDFLAGS $LD_BROTLI"
1065 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1066 LIBS="$LIB_BROTLI $LIBS"
1068 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1070 AC_CHECK_HEADERS(brotli/decode.h,
1071 curl_brotli_msg="enabled (libbrotlidec)"
1073 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1074 AC_SUBST(HAVE_BROTLI, [1])
1077 if test X"$OPT_BROTLI" != Xoff &&
1078 test "$HAVE_BROTLI" != "1"; then
1079 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1082 if test "$HAVE_BROTLI" = "1"; then
1083 if test -n "$DIR_BROTLI"; then
1084 dnl when the brotli shared libs were found in a path that the run-time
1085 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1086 dnl to prevent further configure tests to fail due to this
1088 if test "x$cross_compiling" != "xyes"; then
1089 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1090 export CURL_LIBRARY_PATH
1091 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1095 dnl no brotli, revert back to clean variables
1096 LDFLAGS=$CLEANLDFLAGS
1097 CPPFLAGS=$CLEANCPPFLAGS
1102 dnl **********************************************************************
1104 dnl **********************************************************************
1107 AC_ARG_WITH(ldap-lib,
1108 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1109 [LDAPLIBNAME="$withval"])
1112 AC_ARG_WITH(lber-lib,
1113 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1114 [LBERLIBNAME="$withval"])
1116 if test x$CURL_DISABLE_LDAP != x1 ; then
1118 CURL_CHECK_HEADER_LBER
1119 CURL_CHECK_HEADER_LDAP
1120 CURL_CHECK_HEADER_LDAPSSL
1121 CURL_CHECK_HEADER_LDAP_SSL
1123 if test -z "$LDAPLIBNAME" ; then
1124 if test "$curl_cv_native_windows" = "yes"; then
1125 dnl Windows uses a single and unique LDAP library name
1126 LDAPLIBNAME="wldap32"
1131 if test "$LDAPLIBNAME" ; then
1132 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1133 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1134 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1135 AC_SUBST(CURL_DISABLE_LDAP, [1])
1136 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1137 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1139 dnl Try to find the right ldap libraries for this system
1140 CURL_CHECK_LIBS_LDAP
1141 case X-"$curl_cv_ldap_LIBS" in
1143 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1144 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1145 AC_SUBST(CURL_DISABLE_LDAP, [1])
1146 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1147 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1153 if test x$CURL_DISABLE_LDAP != x1 ; then
1155 if test "$LBERLIBNAME" ; then
1156 dnl If name is "no" then don't define this library at all
1157 dnl (it's only needed if libldap.so's dependencies are broken).
1158 if test "$LBERLIBNAME" != "no" ; then
1159 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1160 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1161 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1162 AC_SUBST(CURL_DISABLE_LDAP, [1])
1163 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1164 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1169 if test x$CURL_DISABLE_LDAP != x1 ; then
1170 AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
1172 if test "$LDAPLIBNAME" = "wldap32"; then
1173 curl_ldap_msg="enabled (winldap)"
1174 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1176 curl_ldap_msg="enabled (OpenLDAP)"
1177 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1178 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1179 AC_SUBST(USE_OPENLDAP, [1])
1184 if test x$CURL_DISABLE_LDAPS != x1 ; then
1185 curl_ldaps_msg="enabled"
1188 dnl **********************************************************************
1190 dnl **********************************************************************
1192 AC_MSG_CHECKING([whether to enable IPv6])
1194 AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1195 AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1196 [ case "$enableval" in
1201 *) AC_MSG_RESULT(yes)
1206 AC_TRY_RUN([ /* are AF_INET6 and sockaddr_in6 available? */
1207 #include <sys/types.h>
1208 #ifdef HAVE_WINSOCK2_H
1209 #include <winsock2.h>
1210 #include <ws2tcpip.h>
1212 #include <sys/socket.h>
1213 #include <netinet/in.h>
1214 #if defined (__TANDEM)
1215 # include <netinet/in6.h>
1218 #include <stdlib.h> /* for exit() */
1221 struct sockaddr_in6 s;
1223 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1237 if test "$ipv6" = yes; then
1238 curl_ipv6_msg="enabled"
1239 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
1241 AC_SUBST(IPV6_ENABLED)
1243 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1245 #include <sys/types.h>
1246 #ifdef HAVE_WINSOCK2_H
1247 #include <winsock2.h>
1248 #include <ws2tcpip.h>
1250 #include <netinet/in.h>
1251 #if defined (__TANDEM)
1252 # include <netinet/in6.h>
1255 struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
1256 if test "$have_sin6_scope_id" = yes; then
1257 AC_MSG_RESULT([yes])
1258 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1264 dnl **********************************************************************
1265 dnl Check if the operating system allows programs to write to their own argv[]
1266 dnl **********************************************************************
1268 AC_MSG_CHECKING([if argv can be written to])
1270 int main(int argc, char ** argv) {
1272 return (argv[0][0] == ' ')?0:1;
1275 curl_cv_writable_argv=yes
1277 curl_cv_writable_argv=no
1279 curl_cv_writable_argv=cross
1281 case $curl_cv_writable_argv in
1283 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1291 AC_MSG_WARN([the previous check could not be made default was used])
1295 dnl **********************************************************************
1296 dnl Check for GSS-API libraries
1297 dnl **********************************************************************
1299 dnl check for GSS-API stuff in the /usr as default
1302 AC_ARG_WITH(gssapi-includes,
1303 AC_HELP_STRING([--with-gssapi-includes=DIR],
1304 [Specify location of GSS-API headers]),
1305 [ GSSAPI_INCS="-I$withval"
1309 AC_ARG_WITH(gssapi-libs,
1310 AC_HELP_STRING([--with-gssapi-libs=DIR],
1311 [Specify location of GSS-API libs]),
1312 [ GSSAPI_LIB_DIR="-L$withval"
1317 AC_HELP_STRING([--with-gssapi=DIR],
1318 [Where to look for GSS-API]), [
1319 GSSAPI_ROOT="$withval"
1320 if test x"$GSSAPI_ROOT" != xno; then
1322 if test x"$GSSAPI_ROOT" = xyes; then
1323 dnl if yes, then use default root
1329 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1331 save_CPPFLAGS="$CPPFLAGS"
1332 AC_MSG_CHECKING([if GSS-API support is requested])
1333 if test x"$want_gss" = xyes; then
1336 if test -z "$GSSAPI_INCS"; then
1337 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1338 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1339 elif test -f "$KRB5CONFIG"; then
1340 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1341 elif test "$GSSAPI_ROOT" != "yes"; then
1342 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1346 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1348 AC_CHECK_HEADER(gss.h,
1350 dnl found in the given dirs
1351 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1355 dnl not found, check Heimdal or MIT
1356 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1358 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1363 #ifdef HAVE_GSSAPI_GSSAPI_H
1364 #include <gssapi/gssapi.h>
1367 if test "x$not_mit" = "x1"; then
1368 dnl MIT not found, check for Heimdal
1369 AC_CHECK_HEADER(gssapi.h,
1372 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1375 dnl no header found, disabling GSS
1377 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1382 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1383 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1384 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1387 #include <gssapi/gssapi.h>
1388 #include <gssapi/gssapi_generic.h>
1389 #include <gssapi/gssapi_krb5.h>
1394 GSS_C_NT_HOSTBASED_SERVICE,
1398 AC_MSG_RESULT([yes])
1401 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1402 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1410 if test x"$want_gss" = xyes; then
1411 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1413 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1415 if test -n "$gnu_gss"; then
1416 curl_gss_msg="enabled (GNU GSS)"
1417 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1419 elif test -z "$GSSAPI_LIB_DIR"; then
1422 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1425 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1426 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1428 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1429 LIBS="$gss_libs $LIBS"
1430 elif test -f "$KRB5CONFIG"; then
1431 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1433 gss_libs=`$KRB5CONFIG --libs gssapi`
1434 LIBS="$gss_libs $LIBS"
1441 gss_libname="gssapi"
1445 if test "$GSSAPI_ROOT" != "yes"; then
1446 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1447 LIBS="-l$gss_libname $LIBS"
1449 LIBS="-l$gss_libname $LIBS"
1455 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1461 LIBS="-lgssapi $LIBS"
1466 CPPFLAGS="$save_CPPFLAGS"
1470 if test x"$want_gss" = "xyes"; then
1471 build_libstubgss=yes
1474 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
1476 dnl -------------------------------------------------------------
1477 dnl parse --with-default-ssl-backend so it can be validated below
1478 dnl -------------------------------------------------------------
1480 DEFAULT_SSL_BACKEND=no
1481 VALID_DEFAULT_SSL_BACKEND=
1482 AC_ARG_WITH(default-ssl-backend,
1483 AC_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
1484 AC_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
1485 [DEFAULT_SSL_BACKEND=$withval])
1486 case "$DEFAULT_SSL_BACKEND" in
1488 dnl --without-default-ssl-backend option used
1491 dnl --with-default-ssl-backend option used without name
1492 AC_MSG_ERROR([The name of the default SSL backend is required.])
1495 dnl --with-default-ssl-backend option used with name
1496 AC_SUBST(DEFAULT_SSL_BACKEND)
1497 dnl needs to be validated below
1498 VALID_DEFAULT_SSL_BACKEND=no
1502 dnl **********************************************************************
1504 dnl -------------------------------------------------
1505 dnl check winssl option before other SSL libraries
1506 dnl -------------------------------------------------
1509 AC_ARG_WITH(winssl,dnl
1510 AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
1511 AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
1512 OPT_WINSSL=$withval)
1514 AC_ARG_WITH(schannel,dnl
1515 AC_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS])
1516 AC_HELP_STRING([--without-schannel], [disable Windows native SSL/TLS]),
1517 OPT_WINSSL=$withval)
1519 AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
1520 if test -z "$ssl_backends" -o "x$OPT_WINSSL" != xno; then
1522 if test "x$OPT_WINSSL" != "xno" &&
1523 test "x$curl_cv_native_windows" = "xyes"; then
1525 AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
1526 AC_SUBST(USE_SCHANNEL, [1])
1527 ssl_msg="Windows-native"
1528 test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1530 # --with-winssl implies --enable-sspi
1531 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
1532 AC_SUBST(USE_WINDOWS_SSPI, [1])
1533 curl_sspi_msg="enabled"
1534 LIBS="-lcrypt32 $LIBS"
1538 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1543 OPT_SECURETRANSPORT=no
1544 AC_ARG_WITH(darwinssl,dnl
1545 AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS])
1546 AC_HELP_STRING([--without-darwinssl], [disable Apple OS native SSL/TLS]),
1547 OPT_SECURETRANSPORT=$withval)
1549 AC_ARG_WITH(secure-transport,dnl
1550 AC_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS])
1551 AC_HELP_STRING([--without-secure-transport], [disable Apple OS native SSL/TLS]),
1552 OPT_SECURETRANSPORT=$withval)
1554 AC_MSG_CHECKING([whether to enable Secure Transport])
1555 if test -z "$ssl_backends" -o "x$OPT_SECURETRANSPORT" != xno; then
1556 if test "x$OPT_SECURETRANSPORT" != "xno" &&
1557 test -d "/System/Library/Frameworks/Security.framework"; then
1559 AC_DEFINE(USE_SECTRANSP, 1, [enable Secure Transport])
1560 AC_SUBST(USE_SECTRANSP, [1])
1561 ssl_msg="Secure Transport"
1562 test secure-transport != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1563 SECURETRANSPORT_ENABLED=1
1564 LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
1568 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1574 AC_ARG_WITH(amissl,dnl
1575 AC_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)])
1576 AC_HELP_STRING([--without-amissl], [disable Amiga native SSL/TLS (AmiSSL)]),
1577 OPT_AMISSL=$withval)
1579 AC_MSG_CHECKING([whether to enable Amiga native SSL/TLS (AmiSSL)])
1580 if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then
1581 if test -z "$ssl_backends" -o "x$OPT_AMISSL" != xno; then
1583 if test "x$OPT_AMISSL" != "xno"; then
1586 test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1588 LIBS="-lamisslauto $LIBS"
1589 AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use])
1590 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])
1594 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1602 dnl **********************************************************************
1603 dnl Check for the presence of SSL libraries and headers
1604 dnl **********************************************************************
1606 dnl Default to compiler & linker defaults for SSL files & libraries.
1608 dnl Default to no CA bundle
1611 AC_HELP_STRING([--with-ssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1612 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1615 if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
1616 test X"$OPT_SSL" != Xno; then
1619 dnl backup the pre-ssl variables
1620 CLEANLDFLAGS="$LDFLAGS"
1621 CLEANCPPFLAGS="$CPPFLAGS"
1624 dnl This is for Msys/Mingw
1626 *-*-msys* | *-*-mingw*)
1627 AC_MSG_CHECKING([for gdi32])
1628 my_ac_save_LIBS=$LIBS
1629 LIBS="-lgdi32 $LIBS"
1630 AC_TRY_LINK([#include <windef.h>
1631 #include <wingdi.h>],
1634 AC_MSG_RESULT([yes])],
1635 [ dnl failed, restore LIBS
1636 LIBS=$my_ac_save_LIBS
1644 dnl --with-ssl (without path) used
1645 if test x$cross_compiling != xyes; then
1646 dnl only do pkg-config magic when not cross-compiling
1649 PREFIX_OPENSSL=/usr/local/ssl
1650 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1653 dnl no --with-ssl option given, just check default places
1654 if test x$cross_compiling != xyes; then
1655 dnl only do pkg-config magic when not cross-compiling
1661 dnl check the given --with-ssl spot
1663 PREFIX_OPENSSL=$OPT_SSL
1665 dnl Try pkg-config even when cross-compiling. Since we
1666 dnl specify PKG_CONFIG_LIBDIR we're only looking where
1667 dnl the user told us to look
1668 OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
1669 if test -f "$OPENSSL_PCDIR/openssl.pc"; then
1670 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
1672 elif test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
1673 AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-ssl prefix!])
1676 dnl in case pkg-config comes up empty, use what we got
1678 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1679 if test "$PREFIX_OPENSSL" != "/usr" ; then
1680 SSL_LDFLAGS="-L$LIB_OPENSSL"
1681 SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
1683 SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1687 if test "$PKGTEST" = "yes"; then
1689 CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
1691 if test "$PKGCONFIG" != "no" ; then
1692 SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1693 $PKGCONFIG --libs-only-l --libs-only-other openssl 2>/dev/null`
1695 SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1696 $PKGCONFIG --libs-only-L openssl 2>/dev/null`
1698 SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1699 $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1702 AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
1703 AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
1704 AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
1706 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1708 dnl use the values pkg-config reported. This is here
1709 dnl instead of below with CPPFLAGS and LDFLAGS because we only
1710 dnl learn about this via pkg-config. If we only have
1711 dnl the argument to --with-ssl we don't know what
1712 dnl additional libs may be necessary. Hope that we
1714 LIBS="$SSL_LIBS $LIBS"
1718 dnl finally, set flags to use SSL
1719 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1720 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1722 AC_CHECK_LIB(crypto, HMAC_Update,[
1724 LIBS="-lcrypto $LIBS"
1726 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1727 if test "$PKGCONFIG" = "no" ; then
1728 # only set this if pkg-config wasn't used
1729 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1731 AC_CHECK_LIB(crypto, HMAC_Init_ex,[
1733 LIBS="-lcrypto $LIBS"], [
1735 dnl still no, but what about with -ldl?
1736 AC_MSG_CHECKING([OpenSSL linking with -ldl])
1737 LIBS="$CLEANLIBS -lcrypto -ldl"
1740 #include <openssl/err.h>
1751 dnl ok, so what about both -ldl and -lpthread?
1753 AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
1754 LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
1757 #include <openssl/err.h>
1768 LDFLAGS="$CLEANLDFLAGS"
1769 CPPFLAGS="$CLEANCPPFLAGS"
1779 if test X"$HAVECRYPTO" = X"yes"; then
1780 dnl This is only reasonable to do if crypto actually is there: check for
1781 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1783 AC_CHECK_LIB(ssl, SSL_connect)
1785 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1786 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1787 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1789 LIBS="-lRSAglue -lrsaref $LIBS"
1790 AC_CHECK_LIB(ssl, SSL_connect)
1791 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1792 dnl still no SSL_connect
1801 dnl Have the libraries--check for OpenSSL headers
1802 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1803 openssl/pem.h openssl/ssl.h openssl/err.h,
1805 test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1807 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1809 if test $ac_cv_header_openssl_x509_h = no; then
1810 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1811 dnl since 'err.h' might in fact find a krb4 header with the same
1813 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1815 if test $ac_cv_header_x509_h = yes &&
1816 test $ac_cv_header_crypto_h = yes &&
1817 test $ac_cv_header_ssl_h = yes; then
1825 if test X"$OPENSSL_ENABLED" != X"1"; then
1829 if test X"$OPT_SSL" != Xoff &&
1830 test "$OPENSSL_ENABLED" != "1"; then
1831 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1835 if test X"$OPENSSL_ENABLED" = X"1"; then
1836 dnl These can only exist if OpenSSL exists
1837 dnl OpenSSL_version is introduced in 3.0.0
1839 AC_CHECK_FUNCS( RAND_egd \
1840 SSLv2_client_method \
1843 AC_MSG_CHECKING([for BoringSSL])
1846 #include <openssl/base.h>
1848 #ifndef OPENSSL_IS_BORINGSSL
1849 #error not boringssl
1853 AC_MSG_RESULT([yes])
1854 AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
1855 [Define to 1 if using BoringSSL.])
1861 AC_MSG_CHECKING([for libressl])
1864 #include <openssl/opensslv.h>
1866 int dummy = LIBRESSL_VERSION_NUMBER;
1869 AC_MSG_RESULT([yes])
1870 AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1,
1871 [Define to 1 if using libressl.])
1878 if test "$OPENSSL_ENABLED" = "1"; then
1879 if test -n "$LIB_OPENSSL"; then
1880 dnl when the ssl shared libs were found in a path that the run-time
1881 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1882 dnl to prevent further configure tests to fail due to this
1883 if test "x$cross_compiling" != "xyes"; then
1884 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL"
1885 export CURL_LIBRARY_PATH
1886 AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH])
1889 CURL_CHECK_OPENSSL_API
1890 check_for_ca_bundle=1
1893 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1896 if test X"$OPT_SSL" != Xoff &&
1897 test X"$OPT_SSL" != Xno &&
1898 test "$OPENSSL_ENABLED" != "1"; then
1899 AC_MSG_NOTICE([OPT_SSL: $OPT_SSL])
1900 AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED])
1901 AC_MSG_ERROR([--with-ssl was given but OpenSSL could not be detected])
1904 dnl **********************************************************************
1905 dnl Check for the random seed preferences
1906 dnl **********************************************************************
1908 if test X"$OPENSSL_ENABLED" = X"1"; then
1909 AC_ARG_WITH(egd-socket,
1910 AC_HELP_STRING([--with-egd-socket=FILE],
1911 [Entropy Gathering Daemon socket pathname]),
1912 [ EGD_SOCKET="$withval" ]
1914 if test -n "$EGD_SOCKET" ; then
1915 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1916 [your Entropy Gathering Daemon socket pathname] )
1919 dnl Check for user-specified random device
1921 AC_HELP_STRING([--with-random=FILE],
1922 [read randomness from FILE (default=/dev/urandom)]),
1923 [ RANDOM_FILE="$withval" ],
1925 if test x$cross_compiling != xyes; then
1926 dnl Check for random device
1927 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1929 AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
1933 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1934 AC_SUBST(RANDOM_FILE)
1935 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1936 [a suitable file to read random data from])
1941 dnl We require OpenSSL with SRP support.
1943 if test "$OPENSSL_ENABLED" = "1"; then
1944 AC_CHECK_LIB(crypto, SRP_Calc_client_key,
1946 AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
1947 AC_SUBST(HAVE_OPENSSL_SRP, [1])
1952 dnl Whether the OpenSSL configuration will be loaded automatically
1954 if test X"$OPENSSL_ENABLED" = X"1"; then
1955 AC_ARG_ENABLE(openssl-auto-load-config,
1956 AC_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration])
1957 AC_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]),
1958 [ if test X"$enableval" = X"no"; then
1959 AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled])
1960 AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically])
1965 dnl ----------------------------------------------------
1966 dnl check for GnuTLS
1967 dnl ----------------------------------------------------
1969 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1972 AC_ARG_WITH(gnutls,dnl
1973 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
1974 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1975 OPT_GNUTLS=$withval)
1977 if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then
1980 if test X"$OPT_GNUTLS" != Xno; then
1988 if test "x$OPT_GNUTLS" = "xyes"; then
1989 dnl this is with no partiular path given
1990 CURL_CHECK_PKGCONFIG(gnutls)
1992 if test "$PKGCONFIG" != "no" ; then
1993 addlib=`$PKGCONFIG --libs-only-l gnutls`
1994 addld=`$PKGCONFIG --libs-only-L gnutls`
1995 addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1996 version=`$PKGCONFIG --modversion gnutls`
1997 gtlslib=`echo $addld | $SED -e 's/-L//'`
1999 dnl without pkg-config, we try libgnutls-config as that was how it
2001 check=`libgnutls-config --version 2>/dev/null`
2002 if test -n "$check"; then
2003 addlib=`libgnutls-config --libs`
2004 addcflags=`libgnutls-config --cflags`
2005 version=`libgnutls-config --version`
2006 gtlslib=`libgnutls-config --prefix`/lib$libsuff
2010 dnl this is with a given path, first check if there's a libgnutls-config
2011 dnl there and if not, make an educated guess
2012 cfg=$OPT_GNUTLS/bin/libgnutls-config
2013 check=`$cfg --version 2>/dev/null`
2014 if test -n "$check"; then
2015 addlib=`$cfg --libs`
2016 addcflags=`$cfg --cflags`
2017 version=`$cfg --version`
2018 gtlslib=`$cfg --prefix`/lib$libsuff
2020 dnl without pkg-config and libgnutls-config, we guess a lot!
2022 addld=-L$OPT_GNUTLS/lib$libsuff
2023 addcflags=-I$OPT_GNUTLS/include
2024 version="" # we just don't know
2025 gtlslib=$OPT_GNUTLS/lib$libsuff
2029 if test -z "$version"; then
2030 dnl lots of efforts, still no go
2034 if test -n "$addlib"; then
2037 CLEANCPPFLAGS="$CPPFLAGS"
2038 CLEANLDFLAGS="$LDFLAGS"
2040 LIBS="$addlib $LIBS"
2041 LDFLAGS="$LDFLAGS $addld"
2042 if test "$addcflags" != "-I/usr/include"; then
2043 CPPFLAGS="$CPPFLAGS $addcflags"
2046 AC_CHECK_LIB(gnutls, gnutls_check_version,
2048 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
2049 AC_SUBST(USE_GNUTLS, [1])
2053 test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2057 CPPFLAGS="$CLEANCPPFLAGS"
2060 if test "x$USE_GNUTLS" = "xyes"; then
2061 AC_MSG_NOTICE([detected GnuTLS version $version])
2062 check_for_ca_bundle=1
2063 if test -n "$gtlslib"; then
2064 dnl when shared libs were found in a path that the run-time
2065 dnl linker doesn't search through, we need to add it to
2066 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2068 if test "x$cross_compiling" != "xyes"; then
2069 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$gtlslib"
2070 export CURL_LIBRARY_PATH
2071 AC_MSG_NOTICE([Added $gtlslib to CURL_LIBRARY_PATH])
2074 AC_CHECK_FUNCS([gnutls_certificate_set_x509_key_file2 gnutls_alpn_set_protocols gnutls_ocsp_req_init])
2079 fi dnl GNUTLS not disabled
2081 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2085 dnl Check which crypto backend GnuTLS uses
2088 if test "$GNUTLS_ENABLED" = "1"; then
2090 # First check if we can detect either crypto library via transitive linking
2091 AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2092 if test "$USE_GNUTLS_NETTLE" = ""; then
2093 AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2095 # If not, try linking directly to both of them to see if they are available
2096 if test "$USE_GNUTLS_NETTLE" = ""; then
2097 AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2099 if test "$USE_GNUTLS_NETTLE" = ""; then
2100 AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2102 if test "$USE_GNUTLS_NETTLE" = ""; then
2103 AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
2105 if test "$USE_GNUTLS_NETTLE" = "1"; then
2106 AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
2107 AC_SUBST(USE_GNUTLS_NETTLE, [1])
2108 LIBS="-lnettle $LIBS"
2110 LIBS="-lgcrypt $LIBS"
2115 dnl We require GnuTLS with SRP support.
2117 if test "$GNUTLS_ENABLED" = "1"; then
2118 AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
2120 AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
2121 AC_SUBST(HAVE_GNUTLS_SRP, [1])
2125 dnl ----------------------------------------------------
2126 dnl check for mbedTLS
2127 dnl ----------------------------------------------------
2133 AC_ARG_WITH(mbedtls,dnl
2134 AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root])
2135 AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]),
2136 OPT_MBEDTLS=$withval)
2138 if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then
2141 if test X"$OPT_MBEDTLS" != Xno; then
2143 if test "$OPT_MBEDTLS" = "yes"; then
2147 if test -z "$OPT_MBEDTLS" ; then
2148 dnl check for lib first without setting any new path
2150 AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
2151 dnl libmbedtls found, set the variable
2153 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2154 AC_SUBST(USE_MBEDTLS, [1])
2158 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2159 ], [], -lmbedx509 -lmbedcrypto)
2167 if test "x$USE_MBEDTLS" != "xyes"; then
2168 dnl add the path and test again
2169 addld=-L$OPT_MBEDTLS/lib$libsuff
2170 addcflags=-I$OPT_MBEDTLS/include
2171 mbedtlslib=$OPT_MBEDTLS/lib$libsuff
2173 LDFLAGS="$LDFLAGS $addld"
2174 if test "$addcflags" != "-I/usr/include"; then
2175 CPPFLAGS="$CPPFLAGS $addcflags"
2178 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
2180 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2181 AC_SUBST(USE_MBEDTLS, [1])
2185 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2190 ], -lmbedx509 -lmbedcrypto)
2193 if test "x$USE_MBEDTLS" = "xyes"; then
2194 AC_MSG_NOTICE([detected mbedTLS])
2195 check_for_ca_bundle=1
2197 LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS"
2199 if test -n "$mbedtlslib"; then
2200 dnl when shared libs were found in a path that the run-time
2201 dnl linker doesn't search through, we need to add it to
2202 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2204 if test "x$cross_compiling" != "xyes"; then
2205 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$mbedtlslib"
2206 export CURL_LIBRARY_PATH
2207 AC_MSG_NOTICE([Added $mbedtlslib to CURL_LIBRARY_PATH])
2212 fi dnl mbedTLS not disabled
2214 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2217 dnl ----------------------------------------------------
2218 dnl check for wolfSSL
2219 dnl ----------------------------------------------------
2221 dnl Default to compiler & linker defaults for wolfSSL files & libraries.
2227 AC_ARG_WITH(wolfssl,dnl
2228 AC_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)])
2229 AC_HELP_STRING([--without-wolfssl], [disable WolfSSL detection]),
2230 OPT_WOLFSSL=$withval)
2232 if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then
2235 if test X"$OPT_WOLFSSL" != Xno; then
2237 if test "$OPT_WOLFSSL" = "yes"; then
2245 if test "x$USE_WOLFSSL" != "xyes"; then
2246 addld=-L$OPT_WOLFSSL/lib$libsuff
2247 addcflags=-I$OPT_WOLFSSL/include
2248 wolfssllibpath=$OPT_WOLFSSL/lib$libsuff
2250 LDFLAGS="$LDFLAGS $addld"
2251 if test "$addcflags" != "-I/usr/include"; then
2252 CPPFLAGS="$CPPFLAGS $addcflags"
2255 my_ac_save_LIBS="$LIBS"
2256 LIBS="-lwolfssl -lm $LIBS"
2258 AC_MSG_CHECKING([for wolfSSL_Init in -lwolfssl])
2261 /* These aren't needed for detection and confuse WolfSSL.
2262 They are set up properly later if it is detected. */
2264 #undef SIZEOF_LONG_LONG
2265 #include <wolfssl/ssl.h>
2267 return wolfSSL_Init();
2271 AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled])
2272 AC_SUBST(USE_WOLFSSL, [1])
2276 test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2284 LIBS="$my_ac_save_LIBS"
2287 if test "x$USE_WOLFSSL" = "xyes"; then
2288 AC_MSG_NOTICE([detected wolfSSL])
2289 check_for_ca_bundle=1
2291 dnl wolfssl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
2292 AX_COMPILE_CHECK_SIZEOF(long long)
2294 LIBS="-lwolfssl -lm $LIBS"
2296 dnl Recent WolfSSL versions build without SSLv3 by default
2297 dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
2298 AC_CHECK_FUNCS(wolfSSLv3_client_method \
2299 wolfSSL_get_peer_certificate \
2302 if test -n "$wolfssllibpath"; then
2303 dnl when shared libs were found in a path that the run-time
2304 dnl linker doesn't search through, we need to add it to
2305 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2307 if test "x$cross_compiling" != "xyes"; then
2308 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$wolfssllibpath"
2309 export CURL_LIBRARY_PATH
2310 AC_MSG_NOTICE([Added $wolfssllibpath to CURL_LIBRARY_PATH])
2316 fi dnl wolfSSL not disabled
2318 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2321 dnl ----------------------------------------------------
2322 dnl check for MesaLink
2323 dnl ----------------------------------------------------
2325 dnl Default to compiler & linker defaults for MesaLink files & libraries.
2330 AC_ARG_WITH(mesalink,dnl
2331 AC_HELP_STRING([--with-mesalink=PATH],[where to look for MesaLink, PATH points to the installation root])
2332 AC_HELP_STRING([--without-mesalink], [disable MesaLink detection]),
2333 OPT_MESALINK=$withval)
2335 if test -z "$ssl_backends" -o "x$OPT_MESALINK" != xno; then
2338 if test X"$OPT_MESALINK" != Xno; then
2340 if test "$OPT_MESALINK" = "yes"; then
2344 if test -z "$OPT_MESALINK" ; then
2345 dnl check for lib first without setting any new path
2347 AC_CHECK_LIB(mesalink, mesalink_library_init,
2348 dnl libmesalink found, set the variable
2350 AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
2351 AC_SUBST(USE_MESALINK, [1])
2355 test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2364 if test "x$USE_MESALINK" != "xyes"; then
2365 dnl add the path and test again
2366 addld=-L$OPT_MESALINK/lib$libsuff
2367 addcflags=-I$OPT_MESALINK/include
2368 mesalinklib=$OPT_MESALINK/lib$libsuff
2370 LDFLAGS="$LDFLAGS $addld"
2371 if test "$addcflags" != "-I/usr/include"; then
2372 CPPFLAGS="$CPPFLAGS $addcflags"
2375 AC_CHECK_LIB(mesalink, mesalink_library_init,
2377 AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
2378 AC_SUBST(USE_MESALINK, [1])
2382 test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2390 if test "x$USE_MESALINK" = "xyes"; then
2391 AC_MSG_NOTICE([detected MesaLink])
2393 LIBS="-lmesalink $LIBS"
2395 if test -n "$mesalinklib"; then
2396 dnl when shared libs were found in a path that the run-time
2397 dnl linker doesn't search through, we need to add it to
2398 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2400 if test "x$cross_compiling" != "xyes"; then
2401 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mesalinklib"
2402 export LD_LIBRARY_PATH
2403 AC_MSG_NOTICE([Added $mesalinklib to LD_LIBRARY_PATH])
2408 fi dnl MesaLink not disabled
2410 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2413 dnl ----------------------------------------------------
2414 dnl check for BearSSL
2415 dnl ----------------------------------------------------
2421 AC_ARG_WITH(bearssl,dnl
2422 AC_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root])
2423 AC_HELP_STRING([--without-bearssl], [disable BearSSL detection]),
2424 OPT_BEARSSL=$withval)
2426 if test -z "$ssl_backends" -o "x$OPT_BEARSSL" != xno; then
2429 if test X"$OPT_BEARSSL" != Xno; then
2431 if test "$OPT_BEARSSL" = "yes"; then
2435 if test -z "$OPT_BEARSSL" ; then
2436 dnl check for lib first without setting any new path
2438 AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
2439 dnl libbearssl found, set the variable
2441 AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
2442 AC_SUBST(USE_BEARSSL, [1])
2446 test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2455 if test "x$USE_BEARSSL" != "xyes"; then
2456 dnl add the path and test again
2457 addld=-L$OPT_BEARSSL/lib$libsuff
2458 addcflags=-I$OPT_BEARSSL/include
2459 bearssllib=$OPT_BEARSSL/lib$libsuff
2461 LDFLAGS="$LDFLAGS $addld"
2462 if test "$addcflags" != "-I/usr/include"; then
2463 CPPFLAGS="$CPPFLAGS $addcflags"
2466 AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
2468 AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
2469 AC_SUBST(USE_BEARSSL, [1])
2473 test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2481 if test "x$USE_BEARSSL" = "xyes"; then
2482 AC_MSG_NOTICE([detected BearSSL])
2483 check_for_ca_bundle=1
2485 LIBS="-lbearssl $LIBS"
2487 if test -n "$bearssllib"; then
2488 dnl when shared libs were found in a path that the run-time
2489 dnl linker doesn't search through, we need to add it to
2490 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2492 if test "x$cross_compiling" != "xyes"; then
2493 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$bearssllib"
2494 export CURL_LIBRARY_PATH
2495 AC_MSG_NOTICE([Added $bearssllib to CURL_LIBRARY_PATH])
2500 fi dnl BearSSL not disabled
2502 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2505 dnl ----------------------------------------------------
2506 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
2507 dnl ----------------------------------------------------
2509 dnl Default to compiler & linker defaults for NSS files & libraries.
2513 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
2514 AC_HELP_STRING([--without-nss], [disable NSS detection]),
2517 if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then
2520 if test X"$OPT_NSS" != Xno; then
2528 if test "x$OPT_NSS" = "xyes"; then
2530 CURL_CHECK_PKGCONFIG(nss)
2532 if test "$PKGCONFIG" != "no" ; then
2533 addlib=`$PKGCONFIG --libs nss`
2534 addcflags=`$PKGCONFIG --cflags nss`
2535 version=`$PKGCONFIG --modversion nss`
2536 nssprefix=`$PKGCONFIG --variable=prefix nss`
2538 dnl Without pkg-config, we check for nss-config
2540 check=`nss-config --version 2>/dev/null`
2541 if test -n "$check"; then
2542 addlib=`nss-config --libs`
2543 addcflags=`nss-config --cflags`
2544 version=`nss-config --version`
2545 nssprefix=`nss-config --prefix`
2553 NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
2554 if test -f "$NSS_PCDIR/nss.pc"; then
2555 CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
2556 if test "$PKGCONFIG" != "no" ; then
2557 addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
2558 addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
2559 addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
2560 version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
2561 nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
2566 if test -z "$addlib"; then
2567 # Without pkg-config, we'll kludge in some defaults
2568 AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
2569 addld="-L$OPT_NSS/lib"
2570 addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
2571 addcflags="-I$OPT_NSS/include"
2576 CLEANLDFLAGS="$LDFLAGS"
2578 CLEANCPPFLAGS="$CPPFLAGS"
2580 LDFLAGS="$addld $LDFLAGS"
2581 LIBS="$addlib $LIBS"
2582 if test "$addcflags" != "-I/usr/include"; then
2583 CPPFLAGS="$CPPFLAGS $addcflags"
2586 dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
2587 AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
2589 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
2590 AC_SUBST(USE_NSS, [1])
2594 test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2597 LDFLAGS="$CLEANLDFLAGS"
2599 CPPFLAGS="$CLEANCPPFLAGS"
2602 if test "x$USE_NSS" = "xyes"; then
2603 AC_MSG_NOTICE([detected NSS version $version])
2605 dnl PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
2606 dnl PK11_DestroyGenericObject() does not release resources allocated by
2607 dnl PK11_CreateGenericObject() early enough.
2608 AC_CHECK_FUNC(PK11_CreateManagedGenericObject,
2610 AC_DEFINE(HAVE_PK11_CREATEMANAGEDGENERICOBJECT, 1,
2611 [if you have the PK11_CreateManagedGenericObject function])
2614 dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
2616 AC_SUBST([NSS_LIBS])
2618 dnl when shared libs were found in a path that the run-time
2619 dnl linker doesn't search through, we need to add it to
2620 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2622 if test "x$cross_compiling" != "xyes"; then
2623 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$nssprefix/lib$libsuff"
2624 export CURL_LIBRARY_PATH
2625 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to CURL_LIBRARY_PATH])
2630 fi dnl NSS not disabled
2632 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2635 case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$WINSSL_ENABLED$SECURETRANSPORT_ENABLED$MESALINK_ENABLED$BEARSSL_ENABLED$AMISSL_ENABLED" in
2637 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
2638 AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-mesalink, --with-amissl or --with-bearssl to address this.])
2641 # one SSL backend is enabled
2642 AC_SUBST(SSL_ENABLED)
2644 AC_MSG_NOTICE([built with one SSL backend])
2647 # more than one SSL backend is enabled
2648 AC_SUBST(SSL_ENABLED)
2650 AC_SUBST(CURL_WITH_MULTI_SSL)
2651 CURL_WITH_MULTI_SSL="1"
2652 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
2653 AC_MSG_NOTICE([built with multiple SSL backends])
2657 if test -n "$ssl_backends"; then
2658 curl_ssl_msg="enabled ($ssl_backends)"
2661 if test no = "$VALID_DEFAULT_SSL_BACKEND"
2663 if test -n "$SSL_ENABLED"
2665 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
2667 AC_MSG_ERROR([Default SSL backend requires SSL!])
2669 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
2671 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
2674 dnl **********************************************************************
2675 dnl Check for the CA bundle
2676 dnl **********************************************************************
2678 if test -n "$check_for_ca_bundle"; then
2679 CURL_CHECK_CA_BUNDLE
2682 dnl **********************************************************************
2683 dnl Check for libpsl
2684 dnl **********************************************************************
2687 AS_HELP_STRING([--without-libpsl],
2688 [disable support for libpsl cookie checking]),
2689 with_libpsl=$withval,
2691 if test $with_libpsl != "no"; then
2692 AC_SEARCH_LIBS(psl_builtin, psl,
2693 [curl_psl_msg="enabled";
2694 AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
2696 [curl_psl_msg="no (libpsl not found)";
2697 AC_MSG_WARN([libpsl was not found])
2701 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
2703 dnl **********************************************************************
2704 dnl Check for libmetalink
2705 dnl **********************************************************************
2709 AC_ARG_WITH(libmetalink,dnl
2710 AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
2711 AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
2712 OPT_LIBMETALINK=$withval)
2714 if test X"$OPT_LIBMETALINK" != Xno; then
2723 if test "x$OPT_LIBMETALINK" = "xyes"; then
2724 dnl this is with no partiular path given
2726 CURL_CHECK_PKGCONFIG(libmetalink)
2728 dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
2729 LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
2730 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
2731 if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
2734 if test "$PKGTEST" = "yes"; then
2735 CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
2738 if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
2739 addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2740 $PKGCONFIG --libs-only-l libmetalink`
2741 addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2742 $PKGCONFIG --libs-only-L libmetalink`
2743 addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2744 $PKGCONFIG --cflags-only-I libmetalink`
2745 version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2746 $PKGCONFIG --modversion libmetalink`
2747 libmetalinklib=`echo $addld | $SED -e 's/-L//'`
2749 if test -n "$addlib"; then
2751 clean_CPPFLAGS="$CPPFLAGS"
2752 clean_LDFLAGS="$LDFLAGS"
2754 CPPFLAGS="$clean_CPPFLAGS $addcflags"
2755 LDFLAGS="$clean_LDFLAGS $addld"
2756 LIBS="$addlib $clean_LIBS"
2757 AC_MSG_CHECKING([if libmetalink is recent enough])
2760 # include <metalink/metalink.h>
2762 if(0 != metalink_strerror(0)) /* added in 0.1.0 */
2766 AC_MSG_RESULT([yes ($version)])
2769 AC_MSG_RESULT([no ($version)])
2770 AC_MSG_NOTICE([libmetalink library defective or too old])
2773 CPPFLAGS="$clean_CPPFLAGS"
2774 LDFLAGS="$clean_LDFLAGS"
2776 if test "$want_metalink" = "yes"; then
2777 dnl finally libmetalink will be used
2778 AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
2779 LIBMETALINK_LIBS=$addlib
2780 LIBMETALINK_LDFLAGS=$addld
2781 LIBMETALINK_CPPFLAGS=$addcflags
2782 AC_SUBST([LIBMETALINK_LIBS])
2783 AC_SUBST([LIBMETALINK_LDFLAGS])
2784 AC_SUBST([LIBMETALINK_CPPFLAGS])
2785 curl_mtlnk_msg="enabled"
2791 dnl **********************************************************************
2792 dnl Check for the presence of LIBSSH2 libraries and headers
2793 dnl **********************************************************************
2795 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
2797 AC_ARG_WITH(libssh2,dnl
2798 AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2799 AC_HELP_STRING([--with-libssh2], [enable LIBSSH2]),
2800 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
2804 AC_ARG_WITH(libssh,dnl
2805 AC_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])
2806 AC_HELP_STRING([--with-libssh], [enable LIBSSH]),
2807 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2809 if test X"$OPT_LIBSSH2" != Xno; then
2810 dnl backup the pre-libssh2 variables
2811 CLEANLDFLAGS="$LDFLAGS"
2812 CLEANCPPFLAGS="$CPPFLAGS"
2815 case "$OPT_LIBSSH2" in
2817 dnl --with-libssh2 (without path) used
2818 CURL_CHECK_PKGCONFIG(libssh2)
2820 if test "$PKGCONFIG" != "no" ; then
2821 LIB_SSH2=`$PKGCONFIG --libs libssh2`
2822 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2823 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2824 version=`$PKGCONFIG --modversion libssh2`
2825 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
2830 dnl no --with-libssh2 option given, just check default places
2833 dnl use the given --with-libssh2 spot
2834 PREFIX_SSH2=$OPT_LIBSSH2
2838 dnl if given with a prefix, we set -L and -I based on that
2839 if test -n "$PREFIX_SSH2"; then
2841 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2842 CPP_SSH2=-I${PREFIX_SSH2}/include
2843 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2846 LDFLAGS="$LDFLAGS $LD_SSH2"
2847 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2848 LIBS="$LIB_SSH2 $LIBS"
2850 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
2852 AC_CHECK_HEADERS(libssh2.h,
2853 curl_ssh_msg="enabled (libSSH2)"
2855 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2856 AC_SUBST(USE_LIBSSH2, [1])
2859 if test X"$OPT_LIBSSH2" != Xoff &&
2860 test "$LIBSSH2_ENABLED" != "1"; then
2861 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2864 if test "$LIBSSH2_ENABLED" = "1"; then
2865 if test -n "$DIR_SSH2"; then
2866 dnl when the libssh2 shared libs were found in a path that the run-time
2867 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2868 dnl to prevent further configure tests to fail due to this
2870 if test "x$cross_compiling" != "xyes"; then
2871 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
2872 export CURL_LIBRARY_PATH
2873 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2877 dnl no libssh2, revert back to clean variables
2878 LDFLAGS=$CLEANLDFLAGS
2879 CPPFLAGS=$CLEANCPPFLAGS
2882 elif test X"$OPT_LIBSSH" != Xno; then
2883 dnl backup the pre-libssh variables
2884 CLEANLDFLAGS="$LDFLAGS"
2885 CLEANCPPFLAGS="$CPPFLAGS"
2888 case "$OPT_LIBSSH" in
2890 dnl --with-libssh (without path) used
2891 CURL_CHECK_PKGCONFIG(libssh)
2893 if test "$PKGCONFIG" != "no" ; then
2894 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2895 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2896 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2897 version=`$PKGCONFIG --modversion libssh`
2898 DIR_SSH=`echo $LD_SSH | $SED -e 's/-L//'`
2903 dnl no --with-libssh option given, just check default places
2906 dnl use the given --with-libssh spot
2907 PREFIX_SSH=$OPT_LIBSSH
2911 dnl if given with a prefix, we set -L and -I based on that
2912 if test -n "$PREFIX_SSH"; then
2914 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2915 CPP_SSH=-I${PREFIX_SSH}/include
2916 DIR_SSH=${PREFIX_SSH}/lib$libsuff
2919 LDFLAGS="$LDFLAGS $LD_SSH"
2920 CPPFLAGS="$CPPFLAGS $CPP_SSH"
2921 LIBS="$LIB_SSH $LIBS"
2923 AC_CHECK_LIB(ssh, ssh_new)
2925 AC_CHECK_HEADERS(libssh/libssh.h,
2926 curl_ssh_msg="enabled (libSSH)"
2928 AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
2929 AC_SUBST(USE_LIBSSH, [1])
2932 if test X"$OPT_LIBSSH" != Xoff &&
2933 test "$LIBSSH_ENABLED" != "1"; then
2934 AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
2937 if test "$LIBSSH_ENABLED" = "1"; then
2938 if test -n "$DIR_SSH"; then
2939 dnl when the libssh shared libs were found in a path that the run-time
2940 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2941 dnl to prevent further configure tests to fail due to this
2943 if test "x$cross_compiling" != "xyes"; then
2944 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
2945 export CURL_LIBRARY_PATH
2946 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
2950 dnl no libssh, revert back to clean variables
2951 LDFLAGS=$CLEANLDFLAGS
2952 CPPFLAGS=$CLEANCPPFLAGS
2957 dnl **********************************************************************
2958 dnl Check for the presence of LIBRTMP libraries and headers
2959 dnl **********************************************************************
2961 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2963 AC_ARG_WITH(librtmp,dnl
2964 AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2965 AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2966 OPT_LIBRTMP=$withval)
2968 if test X"$OPT_LIBRTMP" != Xno; then
2969 dnl backup the pre-librtmp variables
2970 CLEANLDFLAGS="$LDFLAGS"
2971 CLEANCPPFLAGS="$CPPFLAGS"
2974 case "$OPT_LIBRTMP" in
2976 dnl --with-librtmp (without path) used
2977 CURL_CHECK_PKGCONFIG(librtmp)
2979 if test "$PKGCONFIG" != "no" ; then
2980 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2981 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2982 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2983 version=`$PKGCONFIG --modversion librtmp`
2984 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
2986 dnl To avoid link errors, we do not allow --librtmp without
2987 dnl a pkgconfig file
2988 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2993 dnl no --with-librtmp option given, just check default places
2997 dnl use the given --with-librtmp spot
2999 PREFIX_RTMP=$OPT_LIBRTMP
3003 dnl if given with a prefix, we set -L and -I based on that
3004 if test -n "$PREFIX_RTMP"; then
3005 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
3006 CPP_RTMP=-I${PREFIX_RTMP}/include
3007 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
3010 LDFLAGS="$LDFLAGS $LD_RTMP"
3011 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
3012 LIBS="$LIB_RTMP $LIBS"
3014 AC_CHECK_LIB(rtmp, RTMP_Init,
3016 AC_CHECK_HEADERS(librtmp/rtmp.h,
3017 curl_rtmp_msg="enabled (librtmp)"
3019 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
3020 AC_SUBST(USE_LIBRTMP, [1])
3023 dnl not found, revert back to clean variables
3024 LDFLAGS=$CLEANLDFLAGS
3025 CPPFLAGS=$CLEANCPPFLAGS
3029 if test X"$OPT_LIBRTMP" != Xoff &&
3030 test "$LIBRTMP_ENABLED" != "1"; then
3031 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
3036 dnl **********************************************************************
3037 dnl Check for linker switch for versioned symbols
3038 dnl **********************************************************************
3040 versioned_symbols_flavour=
3041 AC_MSG_CHECKING([whether versioned symbols are wanted])
3042 AC_ARG_ENABLE(versioned-symbols,
3043 AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
3044 AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
3045 [ case "$enableval" in
3046 yes) AC_MSG_RESULT(yes)
3047 AC_MSG_CHECKING([if libraries can be versioned])
3048 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
3049 if test -z "$GLD"; then
3051 AC_MSG_WARN([You need an ld version supporting the --version-script option])
3054 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
3055 versioned_symbols_flavour="MULTISSL_"
3056 elif test "x$OPENSSL_ENABLED" = "x1"; then
3057 versioned_symbols_flavour="OPENSSL_"
3058 elif test "x$GNUTLS_ENABLED" = "x1"; then
3059 versioned_symbols_flavour="GNUTLS_"
3060 elif test "x$NSS_ENABLED" = "x1"; then
3061 versioned_symbols_flavour="NSS_"
3062 elif test "x$WOLFSSL_ENABLED" = "x1"; then
3063 versioned_symbols_flavour="WOLFSSL_"
3064 elif test "x$WINSSL_ENABLED" = "x1"; then
3065 versioned_symbols_flavour="SCHANNEL_"
3066 elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
3067 versioned_symbols_flavour="SECURE_TRANSPORT_"
3069 versioned_symbols_flavour=""
3071 versioned_symbols="yes"
3075 *) AC_MSG_RESULT(no)
3083 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
3084 ["$versioned_symbols_flavour"])
3085 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
3086 [test "x$versioned_symbols" = 'xyes'])
3088 dnl -------------------------------------------------
3089 dnl check winidn option before other IDN libraries
3090 dnl -------------------------------------------------
3092 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
3093 OPT_WINIDN="default"
3095 AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
3096 AC_HELP_STRING([--without-winidn], [disable Windows native IDN]),
3097 OPT_WINIDN=$withval)
3098 case "$OPT_WINIDN" in
3100 dnl --without-winidn option used or configure option not specified
3105 dnl --with-winidn option used without path
3107 want_winidn_path="default"
3108 AC_MSG_RESULT([yes])
3111 dnl --with-winidn option used with path
3113 want_winidn_path="$withval"
3114 AC_MSG_RESULT([yes ($withval)])
3118 if test "$want_winidn" = "yes"; then
3119 dnl winidn library support has been requested
3120 clean_CPPFLAGS="$CPPFLAGS"
3121 clean_LDFLAGS="$LDFLAGS"
3123 WINIDN_LIBS="-lnormaliz"
3124 WINIDN_CPPFLAGS="-DWINVER=0x0600"
3126 if test "$want_winidn_path" != "default"; then
3127 dnl path has been specified
3128 dnl pkg-config not available or provides no info
3129 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
3130 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
3131 WINIDN_DIR="$want_winidn_path/lib$libsuff"
3134 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
3135 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
3136 LIBS="$WINIDN_LIBS $LIBS"
3138 AC_MSG_CHECKING([if IdnToUnicode can be linked])
3141 #include <windows.h>
3143 IdnToUnicode(0, NULL, 0, NULL, 0);
3146 AC_MSG_RESULT([yes])
3147 tst_links_winidn="yes"
3150 tst_links_winidn="no"
3153 if test "$tst_links_winidn" = "yes"; then
3154 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
3155 AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
3156 AC_SUBST([IDN_ENABLED], [1])
3157 curl_idn_msg="enabled (Windows-native)"
3159 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3160 CPPFLAGS="$clean_CPPFLAGS"
3161 LDFLAGS="$clean_LDFLAGS"
3166 dnl **********************************************************************
3167 dnl Check for the presence of IDN libraries and headers
3168 dnl **********************************************************************
3170 AC_MSG_CHECKING([whether to build with libidn2])
3172 AC_ARG_WITH(libidn2,
3173 AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
3174 AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
3178 dnl --without-libidn2 option used
3183 dnl configure option not specified
3185 want_idn_path="default"
3186 AC_MSG_RESULT([(assumed) yes])
3189 dnl --with-libidn2 option used without path
3191 want_idn_path="default"
3192 AC_MSG_RESULT([yes])
3195 dnl --with-libidn2 option used with path
3197 want_idn_path="$withval"
3198 AC_MSG_RESULT([yes ($withval)])
3202 if test "$want_idn" = "yes"; then
3203 dnl idn library support has been requested
3204 clean_CPPFLAGS="$CPPFLAGS"
3205 clean_LDFLAGS="$LDFLAGS"
3209 if test "$want_idn_path" != "default"; then
3210 dnl path has been specified
3211 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3212 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
3213 if test "$PKGCONFIG" != "no"; then
3214 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3215 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3216 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3217 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3218 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3219 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3220 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3222 dnl pkg-config not available or provides no info
3224 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3225 IDN_CPPFLAGS="-I$want_idn_path/include"
3226 IDN_DIR="$want_idn_path/lib$libsuff"
3229 dnl path not specified
3230 CURL_CHECK_PKGCONFIG(libidn2)
3231 if test "$PKGCONFIG" != "no"; then
3232 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3233 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3234 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3235 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3237 dnl pkg-config not available or provides no info
3242 if test "$PKGCONFIG" != "no"; then
3243 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3244 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3245 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3246 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3248 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3249 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3250 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3251 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3254 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
3255 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
3256 LIBS="$IDN_LIBS $LIBS"
3258 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
3260 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
3262 AC_MSG_RESULT([yes])
3263 tst_links_libidn="yes"
3266 tst_links_libidn="no"
3269 AC_CHECK_HEADERS( idn2.h )
3271 if test "$tst_links_libidn" = "yes"; then
3272 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
3273 dnl different versions of libidn have different setups of these:
3275 AC_SUBST([IDN_ENABLED], [1])
3276 curl_idn_msg="enabled (libidn2)"
3277 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3278 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
3279 export CURL_LIBRARY_PATH
3280 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
3283 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3284 CPPFLAGS="$clean_CPPFLAGS"
3285 LDFLAGS="$clean_LDFLAGS"
3291 dnl Let's hope this split URL remains working:
3292 dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
3293 dnl genprogc/thread_quick_ref.htm
3296 dnl **********************************************************************
3297 dnl Check for nghttp2
3298 dnl **********************************************************************
3302 if test "x$disable_http" = "xyes"; then
3303 # without HTTP, nghttp2 is no use
3307 AC_ARG_WITH(nghttp2,
3308 AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
3309 AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
3313 dnl --without-nghttp2 option used
3317 dnl --with-nghttp2 option used without path
3322 dnl --with-nghttp2 option used with path
3324 want_h2_path="$withval/lib/pkgconfig"
3328 curl_h2_msg="disabled (--with-nghttp2)"
3329 if test X"$want_h2" != Xno; then
3330 dnl backup the pre-nghttp2 variables
3331 CLEANLDFLAGS="$LDFLAGS"
3332 CLEANCPPFLAGS="$CPPFLAGS"
3335 CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path)
3337 if test "$PKGCONFIG" != "no" ; then
3338 LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3339 $PKGCONFIG --libs-only-l libnghttp2`
3340 AC_MSG_NOTICE([-l is $LIB_H2])
3342 CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl
3343 $PKGCONFIG --cflags-only-I libnghttp2`
3344 AC_MSG_NOTICE([-I is $CPP_H2])
3346 LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3347 $PKGCONFIG --libs-only-L libnghttp2`
3348 AC_MSG_NOTICE([-L is $LD_H2])
3350 LDFLAGS="$LDFLAGS $LD_H2"
3351 CPPFLAGS="$CPPFLAGS $CPP_H2"
3352 LIBS="$LIB_H2 $LIBS"
3354 # use nghttp2_option_set_no_recv_client_magic to require nghttp2
3356 AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic,
3358 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
3359 curl_h2_msg="enabled (nghttp2)"
3361 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
3362 AC_SUBST(USE_NGHTTP2, [1])
3365 dnl not found, revert back to clean variables
3366 LDFLAGS=$CLEANLDFLAGS
3367 CPPFLAGS=$CLEANCPPFLAGS
3372 dnl no nghttp2 pkg-config found, deal with it
3373 if test X"$want_h2" != Xdefault; then
3374 dnl To avoid link errors, we do not allow --with-nghttp2 without
3375 dnl a pkgconfig file
3376 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
3382 dnl **********************************************************************
3383 dnl Check for ngtcp2 (QUIC)
3384 dnl **********************************************************************
3387 curl_h3_msg="disabled (--with-ngtcp2, --with-quiche)"
3389 if test "x$disable_http" = "xyes"; then
3390 # without HTTP, ngtcp2 is no use
3395 AC_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
3396 AC_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
3397 [OPT_TCP2=$withval])
3400 dnl --without-ngtcp2 option used
3404 dnl --with-ngtcp2 option used without path
3409 dnl --with-ngtcp2 option used with path
3411 want_tcp2_path="$withval/lib/pkgconfig"
3415 curl_tcp2_msg="disabled (--with-ngtcp2)"
3416 if test X"$want_tcp2" != Xno; then
3417 dnl backup the pre-ngtcp2 variables
3418 CLEANLDFLAGS="$LDFLAGS"
3419 CLEANCPPFLAGS="$CPPFLAGS"
3422 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
3424 if test "$PKGCONFIG" != "no" ; then
3425 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3426 $PKGCONFIG --libs-only-l libngtcp2`
3427 AC_MSG_NOTICE([-l is $LIB_TCP2])
3429 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3430 $PKGCONFIG --cflags-only-I libngtcp2`
3431 AC_MSG_NOTICE([-I is $CPP_TCP2])
3433 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3434 $PKGCONFIG --libs-only-L libngtcp2`
3435 AC_MSG_NOTICE([-L is $LD_TCP2])
3437 LDFLAGS="$LDFLAGS $LD_TCP2"
3438 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
3439 LIBS="$LIB_TCP2 $LIBS"
3441 if test "x$cross_compiling" != "xyes"; then
3442 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/-L//'`
3444 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new,
3446 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
3448 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
3449 AC_SUBST(USE_NGTCP2, [1])
3450 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
3451 export CURL_LIBRARY_PATH
3452 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
3455 dnl not found, revert back to clean variables
3456 LDFLAGS=$CLEANLDFLAGS
3457 CPPFLAGS=$CLEANCPPFLAGS
3462 dnl no ngtcp2 pkg-config found, deal with it
3463 if test X"$want_tcp2" != Xdefault; then
3464 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3465 dnl a pkgconfig file
3466 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
3472 if test "x$NGTCP2_ENABLED" = "x1"; then
3473 dnl backup the pre-ngtcp2_crypto_openssl variables
3474 CLEANLDFLAGS="$LDFLAGS"
3475 CLEANCPPFLAGS="$CPPFLAGS"
3478 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
3480 if test "$PKGCONFIG" != "no" ; then
3481 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3482 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
3483 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
3485 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3486 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
3487 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
3489 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3490 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
3491 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
3493 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
3494 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
3495 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
3497 if test "x$cross_compiling" != "xyes"; then
3498 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/-L//'`
3500 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
3502 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3504 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
3505 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
3506 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
3507 export CURL_LIBRARY_PATH
3508 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
3511 dnl not found, revert back to clean variables
3512 LDFLAGS=$CLEANLDFLAGS
3513 CPPFLAGS=$CLEANCPPFLAGS
3518 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
3519 if test X"$want_tcp2" != Xdefault; then
3520 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3521 dnl a pkgconfig file
3522 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
3527 dnl **********************************************************************
3528 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
3529 dnl **********************************************************************
3533 if test "x$NGTCP2_ENABLED" = "x"; then
3534 # without ngtcp2, nghttp3 is of no use for us
3538 AC_ARG_WITH(nghttp3,
3539 AC_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
3540 AC_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
3541 [OPT_NGHTTP3=$withval])
3542 case "$OPT_NGHTTP3" in
3544 dnl --without-nghttp3 option used
3548 dnl --with-nghttp3 option used without path
3549 want_nghttp3="default"
3550 want_nghttp3_path=""
3553 dnl --with-nghttp3 option used with path
3555 want_nghttp3_path="$withval/lib/pkgconfig"
3559 curl_http3_msg="disabled (--with-nghttp3)"
3560 if test X"$want_nghttp3" != Xno; then
3561 dnl backup the pre-nghttp3 variables
3562 CLEANLDFLAGS="$LDFLAGS"
3563 CLEANCPPFLAGS="$CPPFLAGS"
3566 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3568 if test "$PKGCONFIG" != "no" ; then
3569 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3570 $PKGCONFIG --libs-only-l libnghttp3`
3571 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3573 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
3574 $PKGCONFIG --cflags-only-I libnghttp3`
3575 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3577 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3578 $PKGCONFIG --libs-only-L libnghttp3`
3579 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3581 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3582 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3583 LIBS="$LIB_NGHTTP3 $LIBS"
3585 if test "x$cross_compiling" != "xyes"; then
3586 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/-L//'`
3588 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new,
3590 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3591 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3593 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3594 AC_SUBST(USE_NGHTTP3, [1])
3595 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3596 export CURL_LIBRARY_PATH
3597 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3598 experimental="$experimental HTTP3"
3601 dnl not found, revert back to clean variables
3602 LDFLAGS=$CLEANLDFLAGS
3603 CPPFLAGS=$CLEANCPPFLAGS
3608 dnl no nghttp3 pkg-config found, deal with it
3609 if test X"$want_nghttp3" != Xdefault; then
3610 dnl To avoid link errors, we do not allow --with-nghttp3 without
3611 dnl a pkgconfig file
3612 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3618 dnl **********************************************************************
3619 dnl Check for quiche (QUIC)
3620 dnl **********************************************************************
3624 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3625 # without HTTP or with ngtcp2, quiche is no use
3630 AC_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
3631 AC_HELP_STRING([--without-quiche],[Disable quiche usage]),
3632 [OPT_QUICHE=$withval])
3633 case "$OPT_QUICHE" in
3635 dnl --without-quiche option used
3639 dnl --with-quiche option used without path
3640 want_quiche="default"
3644 dnl --with-quiche option used with path
3646 want_quiche_path="$withval"
3650 if test X"$want_quiche" != Xno; then
3651 dnl backup the pre-quiche variables
3652 CLEANLDFLAGS="$LDFLAGS"
3653 CLEANCPPFLAGS="$CPPFLAGS"
3656 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3658 if test "$PKGCONFIG" != "no" ; then
3659 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3660 $PKGCONFIG --libs-only-l quiche`
3661 AC_MSG_NOTICE([-l is $LIB_QUICHE])
3663 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
3664 $PKGCONFIG --cflags-only-I quiche`
3665 AC_MSG_NOTICE([-I is $CPP_QUICHE])
3667 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3668 $PKGCONFIG --libs-only-L quiche`
3669 AC_MSG_NOTICE([-L is $LD_QUICHE])
3671 LDFLAGS="$LDFLAGS $LD_QUICHE"
3672 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3673 LIBS="$LIB_QUICHE $LIBS"
3675 if test "x$cross_compiling" != "xyes"; then
3676 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/-L//'`
3678 AC_CHECK_LIB(quiche, quiche_connect,
3680 AC_CHECK_HEADERS(quiche.h,
3681 experimental="$experimental HTTP3"
3682 AC_MSG_NOTICE([HTTP3 support is experimental])
3683 curl_h3_msg="enabled (quiche)"
3685 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3686 AC_SUBST(USE_QUICHE, [1])
3687 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3688 export CURL_LIBRARY_PATH
3689 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
3692 dnl not found, revert back to clean variables
3693 LDFLAGS=$CLEANLDFLAGS
3694 CPPFLAGS=$CLEANCPPFLAGS
3698 dnl no nghttp3 pkg-config found, deal with it
3699 if test X"$want_quiche" != Xdefault; then
3700 dnl To avoid link errors, we do not allow --with-nghttp3 without
3701 dnl a pkgconfig file
3702 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3707 dnl **********************************************************************
3708 dnl Check for zsh completion path
3709 dnl **********************************************************************
3711 OPT_ZSH_FPATH=default
3712 AC_ARG_WITH(zsh-functions-dir,
3713 AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3714 AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3715 [OPT_ZSH_FPATH=$withval])
3716 case "$OPT_ZSH_FPATH" in
3718 dnl --without-zsh-functions-dir option used
3721 dnl --with-zsh-functions-dir option used without path
3722 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3723 AC_SUBST(ZSH_FUNCTIONS_DIR)
3726 dnl --with-zsh-functions-dir option used with path
3727 ZSH_FUNCTIONS_DIR="$withval"
3728 AC_SUBST(ZSH_FUNCTIONS_DIR)
3732 dnl **********************************************************************
3733 dnl Check for fish completion path
3734 dnl **********************************************************************
3736 OPT_FISH_FPATH=default
3737 AC_ARG_WITH(fish-functions-dir,
3738 AC_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3739 AC_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3740 [OPT_FISH_FPATH=$withval])
3741 case "$OPT_FISH_FPATH" in
3743 dnl --without-fish-functions-dir option used
3746 dnl --with-fish-functions-dir option used without path
3747 CURL_CHECK_PKGCONFIG(fish)
3748 if test "$PKGCONFIG" != "no" ; then
3749 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
3751 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3753 AC_SUBST(FISH_FUNCTIONS_DIR)
3756 dnl --with-fish-functions-dir option used with path
3757 FISH_FUNCTIONS_DIR="$withval"
3758 AC_SUBST(FISH_FUNCTIONS_DIR)
3762 dnl **********************************************************************
3763 dnl Back to "normal" configuring
3764 dnl **********************************************************************
3766 dnl Checks for header files.
3769 CURL_CHECK_HEADER_MALLOC
3770 CURL_CHECK_HEADER_MEMORY
3772 dnl Now check for the very most basic headers. Then we can use these
3773 dnl ones as default-headers when checking for the rest!
3817 dnl to do if not found
3821 dnl default includes
3823 #ifdef HAVE_SYS_TYPES_H
3824 #include <sys/types.h>
3826 #ifdef HAVE_SYS_TIME_H
3827 #include <sys/time.h>
3829 #ifdef HAVE_SYS_SELECT_H
3830 #include <sys/select.h>
3832 #ifdef HAVE_SYS_SOCKET_H
3833 #include <sys/socket.h>
3835 #ifdef HAVE_NETINET_IN_H
3836 #include <netinet/in.h>
3838 #ifdef HAVE_NETINET_IN6_H
3839 #include <netinet/in6.h>
3841 #ifdef HAVE_SYS_UN_H
3848 dnl Checks for typedefs, structures, and compiler characteristics.
3850 CURL_CHECK_VARIADIC_MACROS
3853 CURL_CHECK_STRUCT_TIMEVAL
3854 CURL_VERIFY_RUNTIMELIBS
3856 AX_COMPILE_CHECK_SIZEOF(size_t)
3857 AX_COMPILE_CHECK_SIZEOF(long)
3858 AX_COMPILE_CHECK_SIZEOF(int)
3859 AX_COMPILE_CHECK_SIZEOF(short)
3860 AX_COMPILE_CHECK_SIZEOF(time_t)
3861 AX_COMPILE_CHECK_SIZEOF(off_t)
3864 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3865 AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
3866 #include <curl/system.h>
3870 AC_CHECK_TYPE(long long,
3871 [AC_DEFINE(HAVE_LONGLONG, 1,
3872 [Define to 1 if the compiler supports the 'long long' data type.])]
3876 if test "xyes" = "x$longlong"; then
3877 AC_MSG_CHECKING([if numberLL works])
3881 long long val = 1000LL;
3884 AC_MSG_RESULT([yes])
3885 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
3893 AC_CHECK_TYPE(ssize_t, ,
3894 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3896 # check for bool type
3897 AC_CHECK_TYPE([bool],[
3898 AC_DEFINE(HAVE_BOOL_T, 1,
3899 [Define to 1 if bool is an available type.])
3901 #ifdef HAVE_SYS_TYPES_H
3902 #include <sys/types.h>
3904 #ifdef HAVE_STDBOOL_H
3905 #include <stdbool.h>
3909 # check for sa_family_t
3910 AC_CHECK_TYPE(sa_family_t,
3911 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3914 AC_CHECK_TYPE(ADDRESS_FAMILY,
3915 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3916 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3918 #ifdef HAVE_SYS_SOCKET_H
3919 #include <sys/socket.h>
3924 #ifdef HAVE_SYS_SOCKET_H
3925 #include <sys/socket.h>
3929 AC_MSG_CHECKING([if time_t is unsigned])
3937 AC_MSG_RESULT([yes])
3938 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3942 dnl cross-compiling, most systems are unsigned
3946 CURL_CONFIGURE_PULL_SYS_POLL
3950 TYPE_SOCKADDR_STORAGE
3956 CURL_CHECK_FUNC_SELECT
3958 CURL_CHECK_FUNC_RECV
3959 CURL_CHECK_FUNC_SEND
3960 CURL_CHECK_MSG_NOSIGNAL
3962 CURL_CHECK_FUNC_ALARM
3963 CURL_CHECK_FUNC_BASENAME
3964 CURL_CHECK_FUNC_CLOSESOCKET
3965 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3966 CURL_CHECK_FUNC_CONNECT
3967 CURL_CHECK_FUNC_FCNTL
3968 CURL_CHECK_FUNC_FREEADDRINFO
3969 CURL_CHECK_FUNC_FREEIFADDRS
3970 CURL_CHECK_FUNC_FSETXATTR
3971 CURL_CHECK_FUNC_FTRUNCATE
3972 CURL_CHECK_FUNC_GETADDRINFO
3973 CURL_CHECK_FUNC_GAI_STRERROR
3974 CURL_CHECK_FUNC_GETHOSTBYADDR
3975 CURL_CHECK_FUNC_GETHOSTBYADDR_R
3976 CURL_CHECK_FUNC_GETHOSTBYNAME
3977 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3978 CURL_CHECK_FUNC_GETHOSTNAME
3979 CURL_CHECK_FUNC_GETPEERNAME
3980 CURL_CHECK_FUNC_GETSOCKNAME
3981 CURL_CHECK_FUNC_IF_NAMETOINDEX
3982 CURL_CHECK_FUNC_GETIFADDRS
3983 CURL_CHECK_FUNC_GETSERVBYPORT_R
3984 CURL_CHECK_FUNC_GMTIME_R
3985 CURL_CHECK_FUNC_INET_NTOA_R
3986 CURL_CHECK_FUNC_INET_NTOP
3987 CURL_CHECK_FUNC_INET_PTON
3988 CURL_CHECK_FUNC_IOCTL
3989 CURL_CHECK_FUNC_IOCTLSOCKET
3990 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3991 CURL_CHECK_FUNC_LOCALTIME_R
3992 CURL_CHECK_FUNC_MEMRCHR
3993 CURL_CHECK_FUNC_POLL
3994 CURL_CHECK_FUNC_SETSOCKOPT
3995 CURL_CHECK_FUNC_SIGACTION
3996 CURL_CHECK_FUNC_SIGINTERRUPT
3997 CURL_CHECK_FUNC_SIGNAL
3998 CURL_CHECK_FUNC_SIGSETJMP
3999 CURL_CHECK_FUNC_SOCKET
4000 CURL_CHECK_FUNC_SOCKETPAIR
4001 CURL_CHECK_FUNC_STRCASECMP
4002 CURL_CHECK_FUNC_STRCMPI
4003 CURL_CHECK_FUNC_STRDUP
4004 CURL_CHECK_FUNC_STRERROR_R
4005 CURL_CHECK_FUNC_STRICMP
4006 CURL_CHECK_FUNC_STRNCASECMP
4007 CURL_CHECK_FUNC_STRNCMPI
4008 CURL_CHECK_FUNC_STRNICMP
4009 CURL_CHECK_FUNC_STRSTR
4010 CURL_CHECK_FUNC_STRTOK_R
4011 CURL_CHECK_FUNC_STRTOLL
4012 CURL_CHECK_FUNC_WRITEV
4018 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
4022 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
4024 #include <sys/types.h>]])
4027 AC_CHECK_FUNCS([fnmatch \
4036 mach_absolute_time \
4047 eval skipcheck=\$skipcheck_$func
4048 if test "x$skipcheck" != "xyes"; then
4049 AC_MSG_CHECKING([deeper for $func])
4056 AC_MSG_RESULT([yes])
4057 eval "ac_cv_func_$func=yes"
4058 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
4059 [Define to 1 if you have the $func function.])
4061 AC_MSG_RESULT([but still no])
4066 CURL_CHECK_NONBLOCKING_SOCKET
4068 dnl ************************************************************
4069 dnl nroff tool stuff
4072 AC_PATH_PROG( PERL, perl, ,
4073 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
4076 AC_PATH_PROGS( NROFF, gnroff nroff, ,
4077 $PATH:/usr/bin/:/usr/local/bin )
4080 if test -n "$NROFF"; then
4081 dnl only check for nroff options if an nroff command was found
4083 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
4085 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
4086 if test -z "$mancheck"; then
4088 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
4089 if test -z "$mancheck"; then
4091 AC_MSG_RESULT([failed])
4092 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
4094 AC_MSG_RESULT([$MANOPT])
4097 AC_MSG_RESULT([$MANOPT])
4102 if test -z "$MANOPT"
4104 dnl if no nroff tool was found, or no option that could convert man pages
4105 dnl was found, then disable the built-in manual stuff
4106 AC_MSG_WARN([disabling built-in manual])
4110 dnl *************************************************************************
4111 dnl If the manual variable still is set, then we go with providing a built-in
4114 if test "$USE_MANUAL" = "1"; then
4115 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
4116 curl_manual_msg="enabled"
4119 dnl set variable for use in automakefile(s)
4120 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
4123 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
4125 if test "x$curl_cv_native_windows" != "xyes" &&
4126 test "x$enable_shared" = "xyes"; then
4127 build_libhostname=yes
4129 build_libhostname=no
4131 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
4133 if test "x$want_ares" != xyes; then
4134 CURL_CHECK_OPTION_THREADED_RESOLVER
4137 dnl ************************************************************
4138 dnl disable POSIX threads
4140 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
4141 AC_ARG_ENABLE(pthreads,
4142 AC_HELP_STRING([--enable-pthreads],
4143 [Enable POSIX threads (default for threaded resolver)])
4144 AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
4145 [ case "$enableval" in
4146 no) AC_MSG_RESULT(no)
4149 *) AC_MSG_RESULT(yes)
4158 dnl turn off pthreads if rt is disabled
4159 if test "$want_pthreads" != "no"; then
4160 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
4161 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
4163 if test "$dontwant_rt" != "no"; then
4164 dnl if --enable-pthreads was explicit then warn it's being ignored
4165 if test "$want_pthreads" = "yes"; then
4166 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
4172 dnl turn off pthreads if no threaded resolver
4173 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
4178 if test "$want_pthreads" != "no"; then
4179 AC_CHECK_HEADER(pthread.h,
4180 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
4181 save_CFLAGS="$CFLAGS"
4183 dnl first check for function without lib
4184 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
4186 dnl on HPUX, life is more complicated...
4189 dnl it doesn't actually work without -lpthread
4190 USE_THREADS_POSIX=""
4196 dnl if it wasn't found without lib, search for it in pthread lib
4197 if test "$USE_THREADS_POSIX" != "1"
4199 CFLAGS="$CFLAGS -pthread"
4200 AC_CHECK_LIB(pthread, pthread_create,
4201 [USE_THREADS_POSIX=1],
4202 [ CFLAGS="$save_CFLAGS"])
4205 if test "x$USE_THREADS_POSIX" = "x1"
4207 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
4208 curl_res_msg="POSIX threaded"
4213 dnl threaded resolver check
4214 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
4215 if test "$want_pthreads" = "yes"; then
4216 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
4218 dnl If native Windows fallback on Win32 threads since no POSIX threads
4219 if test "$curl_cv_native_windows" = "yes"; then
4221 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
4222 curl_res_msg="Win32 threaded"
4224 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
4228 dnl ************************************************************
4229 dnl disable verbose text strings
4231 AC_MSG_CHECKING([whether to enable verbose strings])
4232 AC_ARG_ENABLE(verbose,
4233 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
4234 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
4235 [ case "$enableval" in
4238 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
4239 curl_verbose_msg="no"
4241 *) AC_MSG_RESULT(yes)
4247 dnl ************************************************************
4248 dnl enable SSPI support
4250 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
4252 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
4253 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
4254 [ case "$enableval" in
4256 if test "$curl_cv_native_windows" = "yes"; then
4258 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
4259 AC_SUBST(USE_WINDOWS_SSPI, [1])
4260 curl_sspi_msg="enabled"
4263 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
4267 if test "x$WINSSL_ENABLED" = "x1"; then
4268 # --with-winssl implies --enable-sspi
4275 if test "x$WINSSL_ENABLED" = "x1"; then
4276 # --with-winssl implies --enable-sspi
4283 dnl ************************************************************
4284 dnl disable cryptographic authentication
4286 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
4287 AC_ARG_ENABLE(crypto-auth,
4288 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
4289 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
4290 [ case "$enableval" in
4293 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
4294 CURL_DISABLE_CRYPTO_AUTH=1
4296 *) AC_MSG_RESULT(yes)
4302 CURL_CHECK_OPTION_NTLM_WB
4306 dnl ************************************************************
4307 dnl disable TLS-SRP authentication
4309 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
4310 AC_ARG_ENABLE(tls-srp,
4311 AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
4312 AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
4313 [ case "$enableval" in
4318 *) AC_MSG_RESULT(yes)
4326 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
4327 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
4329 curl_tls_srp_msg="enabled"
4332 dnl ************************************************************
4333 dnl disable Unix domain sockets support
4335 AC_MSG_CHECKING([whether to enable Unix domain sockets])
4336 AC_ARG_ENABLE(unix-sockets,
4337 AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
4338 AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
4339 [ case "$enableval" in
4340 no) AC_MSG_RESULT(no)
4341 want_unix_sockets=no
4343 *) AC_MSG_RESULT(yes)
4344 want_unix_sockets=yes
4348 want_unix_sockets=auto
4351 if test "x$want_unix_sockets" != "xno"; then
4352 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
4353 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4354 AC_SUBST(USE_UNIX_SOCKETS, [1])
4355 curl_unix_sockets_msg="enabled"
4357 if test "x$want_unix_sockets" = "xyes"; then
4358 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
4365 dnl ************************************************************
4366 dnl disable cookies support
4368 AC_MSG_CHECKING([whether to support cookies])
4369 AC_ARG_ENABLE(cookies,
4370 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
4371 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
4372 [ case "$enableval" in
4375 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
4377 *) AC_MSG_RESULT(yes)
4383 dnl ************************************************************
4384 dnl disable HTTP authentication support
4386 AC_MSG_CHECKING([whether to support HTTP authentication])
4387 AC_ARG_ENABLE(http-auth,
4388 AC_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
4389 AC_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
4390 [ case "$enableval" in
4393 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
4395 *) AC_MSG_RESULT(yes)
4401 dnl ************************************************************
4402 dnl disable DoH support
4404 AC_MSG_CHECKING([whether to support DoH])
4406 AC_HELP_STRING([--enable-doh],[Enable DoH support])
4407 AC_HELP_STRING([--disable-doh],[Disable DoH support]),
4408 [ case "$enableval" in
4411 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
4413 *) AC_MSG_RESULT(yes)
4419 dnl ************************************************************
4420 dnl disable mime API support
4422 AC_MSG_CHECKING([whether to support the MIME API])
4424 AC_HELP_STRING([--enable-mime],[Enable mime API support])
4425 AC_HELP_STRING([--disable-mime],[Disable mime API support]),
4426 [ case "$enableval" in
4429 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
4431 *) AC_MSG_RESULT(yes)
4437 dnl ************************************************************
4438 dnl disable date parsing
4440 AC_MSG_CHECKING([whether to support date parsing])
4441 AC_ARG_ENABLE(dateparse,
4442 AC_HELP_STRING([--enable-dateparse],[Enable date parsing])
4443 AC_HELP_STRING([--disable-dateparse],[Disable date parsing]),
4444 [ case "$enableval" in
4447 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
4449 *) AC_MSG_RESULT(yes)
4455 dnl ************************************************************
4458 AC_MSG_CHECKING([whether to support netrc parsing])
4459 AC_ARG_ENABLE(netrc,
4460 AC_HELP_STRING([--enable-netrc],[Enable netrc parsing])
4461 AC_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
4462 [ case "$enableval" in
4465 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
4467 *) AC_MSG_RESULT(yes)
4473 dnl ************************************************************
4474 dnl disable progress-meter
4476 AC_MSG_CHECKING([whether to support progress-meter])
4477 AC_ARG_ENABLE(progress-meter,
4478 AC_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
4479 AC_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
4480 [ case "$enableval" in
4483 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
4485 *) AC_MSG_RESULT(yes)
4491 dnl ************************************************************
4492 dnl disable shuffle DNS support
4494 AC_MSG_CHECKING([whether to support DNS shuffling])
4495 AC_ARG_ENABLE(dnsshuffle,
4496 AC_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
4497 AC_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
4498 [ case "$enableval" in
4501 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4503 *) AC_MSG_RESULT(yes)
4509 dnl ************************************************************
4510 dnl switch on/off alt-svc
4512 curl_altsvc_msg="no (--enable-alt-svc)";
4513 AC_MSG_CHECKING([whether to support alt-svc])
4514 AC_ARG_ENABLE(alt-svc,
4515 AC_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
4516 AC_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
4517 [ case "$enableval" in
4521 *) AC_MSG_RESULT(yes)
4522 curl_altsvc_msg="enabled";
4529 if test "$enable_altsvc" = "yes"; then
4530 AC_DEFINE(USE_ALTSVC, 1, [to enable alt-svc])
4531 experimental="$experimental alt-svc"
4534 dnl *************************************************************
4535 dnl check whether ESNI support, if desired, is actually available
4537 if test "x$want_esni" != "xno"; then
4538 AC_MSG_CHECKING([whether ESNI support is available])
4540 dnl assume NOT and look for sufficient condition
4544 dnl OpenSSL with a chosen ESNI function should be enough
4545 dnl so more exhaustive checking seems unnecessary for now
4546 if test "x$OPENSSL_ENABLED" = "x1"; then
4547 AC_CHECK_FUNCS(SSL_get_esni_status,
4548 ESNI_SUPPORT="ESNI support available (OpenSSL with SSL_get_esni_status)"
4551 dnl add 'elif' chain here for additional implementations
4554 dnl now deal with whatever we found
4555 if test "x$ESNI_ENABLED" = "x1"; then
4556 AC_DEFINE(USE_ESNI, 1, [if ESNI support is available])
4557 AC_MSG_RESULT($ESNI_SUPPORT)
4558 experimental="$experimental ESNI"
4560 AC_MSG_ERROR([--enable-esni ignored: No ESNI support found])
4564 dnl ************************************************************
4565 dnl hiding of library internal symbols
4567 CURL_CONFIGURE_SYMBOL_HIDING
4570 dnl All the library dependencies put into $LIB apply to libcurl only.
4574 AC_SUBST(LIBCURL_LIBS)
4575 AC_SUBST(CURL_NETWORK_LIBS)
4576 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4578 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4579 dnl LIBS variable used in generated makefile at makefile processing
4580 dnl time. Doing this functionally prevents LIBS from being used for
4581 dnl all link targets in given makefile.
4583 AC_SUBST(BLANK_AT_MAKETIME)
4585 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4588 ENABLE_SHARED="$enable_shared"
4589 AC_SUBST(ENABLE_SHARED)
4591 dnl to let curl-config output the static libraries correctly
4592 ENABLE_STATIC="$enable_static"
4593 AC_SUBST(ENABLE_STATIC)
4597 dnl For keeping supported features and protocols also in pkg-config file
4598 dnl since it is more cross-compile friendly than curl-config
4601 if test "x$OPENSSL_ENABLED" = "x1"; then
4602 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4603 elif test -n "$SSL_ENABLED"; then
4604 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4606 if test "x$IPV6_ENABLED" = "x1"; then
4607 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4609 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4610 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4612 if test "x$HAVE_LIBZ" = "x1"; then
4613 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4615 if test "x$HAVE_BROTLI" = "x1"; then
4616 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4618 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4619 -o "x$USE_THREADS_WIN32" = "x1"; then
4620 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4622 if test "x$IDN_ENABLED" = "x1"; then
4623 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4625 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4626 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4629 if test "x$HAVE_GSSAPI" = "x1"; then
4630 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4633 if test "x$curl_psl_msg" = "xenabled"; then
4634 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4637 if test "x$enable_altsvc" = "xyes"; then
4638 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4641 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4642 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4643 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4646 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4647 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4648 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4651 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
4652 if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
4653 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4654 -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1"; then
4655 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4657 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4658 "x$NTLM_WB_ENABLED" = "x1"; then
4659 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4664 if test "x$USE_TLS_SRP" = "x1"; then
4665 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4668 if test "x$USE_NGHTTP2" = "x1"; then
4669 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4672 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then
4673 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
4676 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4677 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4680 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4681 -o "x$NSS_ENABLED" = "x1"; then
4682 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4685 if test "x$ESNI_ENABLED" = "x1"; then
4686 SUPPORT_FEATURES="$SUPPORT_FEATURES ESNI"
4689 AC_SUBST(SUPPORT_FEATURES)
4691 dnl For supported protocols in pkg-config file
4692 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4693 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4694 if test "x$SSL_ENABLED" = "x1"; then
4695 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4698 if test "x$CURL_DISABLE_FTP" != "x1"; then
4699 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4700 if test "x$SSL_ENABLED" = "x1"; then
4701 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4704 if test "x$CURL_DISABLE_FILE" != "x1"; then
4705 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4707 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4708 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4710 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4711 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4712 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4713 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4714 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4715 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4719 if test "x$CURL_DISABLE_DICT" != "x1"; then
4720 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4722 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4723 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4725 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4726 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4728 if test "x$CURL_DISABLE_POP3" != "x1"; then
4729 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4730 if test "x$SSL_ENABLED" = "x1"; then
4731 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4734 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4735 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4736 if test "x$SSL_ENABLED" = "x1"; then
4737 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4740 if test "x$CURL_DISABLE_SMB" != "x1" \
4741 -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
4742 -a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
4743 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4744 -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \); then
4745 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4746 if test "x$SSL_ENABLED" = "x1"; then
4747 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4750 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4751 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4752 if test "x$SSL_ENABLED" = "x1"; then
4753 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4756 if test "x$USE_LIBSSH2" = "x1"; then
4757 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4758 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4760 if test "x$USE_LIBSSH" = "x1"; then
4761 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4762 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4764 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4765 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4767 if test "x$USE_LIBRTMP" = "x1"; then
4768 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4771 dnl replace spaces with newlines
4773 dnl replace the newlines back to spaces
4774 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4776 AC_SUBST(SUPPORT_PROTOCOLS)
4778 dnl squeeze whitespace out of some variables
4786 squeeze LIBCURL_LIBS
4787 squeeze CURL_NETWORK_LIBS
4788 squeeze CURL_NETWORK_AND_TIME_LIBS
4790 squeeze SUPPORT_FEATURES
4791 squeeze SUPPORT_PROTOCOLS
4793 XC_CHECK_BUILD_FLAGS
4795 SSL_BACKENDS=${ssl_backends}
4796 AC_SUBST(SSL_BACKENDS)
4798 if test "x$want_curldebug_assumed" = "xyes" &&
4799 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4800 ac_configure_args="$ac_configure_args --enable-curldebug"
4803 AC_CONFIG_FILES([Makefile \
4805 docs/examples/Makefile \
4806 docs/libcurl/Makefile \
4807 docs/libcurl/opts/Makefile \
4808 docs/cmdline-opts/Makefile \
4810 include/curl/Makefile \
4816 tests/certs/Makefile \
4817 tests/certs/scripts/Makefile \
4818 tests/data/Makefile \
4819 tests/server/Makefile \
4820 tests/libtest/Makefile \
4821 tests/unit/Makefile \
4823 packages/vms/Makefile \
4829 CURL_GENERATE_CONFIGUREHELP_PM
4831 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4833 AC_MSG_NOTICE([Configured to build curl/libcurl:
4836 Install prefix: ${prefix}
4839 CPPFLAGS: ${CPPFLAGS}
4843 curl version: ${CURLVERSION}
4844 SSL: ${curl_ssl_msg}
4845 SSH: ${curl_ssh_msg}
4846 zlib: ${curl_zlib_msg}
4847 brotli: ${curl_brotli_msg}
4848 GSS-API: ${curl_gss_msg}
4849 TLS-SRP: ${curl_tls_srp_msg}
4850 resolver: ${curl_res_msg}
4851 IPv6: ${curl_ipv6_msg}
4852 Unix sockets: ${curl_unix_sockets_msg}
4853 IDN: ${curl_idn_msg}
4854 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4855 Built-in manual: ${curl_manual_msg}
4856 --libcurl option: ${curl_libcurl_msg}
4857 Verbose errors: ${curl_verbose_msg}
4858 Code coverage: ${curl_coverage_msg}
4859 SSPI: ${curl_sspi_msg}
4860 ca cert bundle: ${ca}${ca_warning}
4861 ca cert path: ${capath}${capath_warning}
4862 ca fallback: ${with_ca_fallback}
4863 LDAP: ${curl_ldap_msg}
4864 LDAPS: ${curl_ldaps_msg}
4865 RTSP: ${curl_rtsp_msg}
4866 RTMP: ${curl_rtmp_msg}
4867 Metalink: ${curl_mtlnk_msg}
4868 PSL: ${curl_psl_msg}
4869 Alt-svc: ${curl_altsvc_msg}
4870 HTTP2: ${curl_h2_msg}
4871 HTTP3: ${curl_h3_msg}
4872 ESNI: ${curl_esni_msg}
4873 Protocols: ${SUPPORT_PROTOCOLS}
4874 Features: ${SUPPORT_FEATURES}
4876 if test -n "$experimental"; then
4878 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!