1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at https://curl.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 #***************************************************************************
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.se/mail/])
31 CURL_OVERRIDE_AUTOCONF
33 dnl configure script copyright
34 AC_COPYRIGHT([Copyright (c) 1998 - 2021 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
54 XC_CHECK_PATH_SEPARATOR
57 # save the configure arguments
59 CONFIGURE_OPTIONS="\"$ac_configure_args\""
60 AC_SUBST(CONFIGURE_OPTIONS)
62 dnl SED is mandatory for configure process and libtool.
63 dnl Set it now, allowing it to be changed later.
64 if test -z "$SED"; then
65 dnl allow it to be overridden
66 AC_PATH_PROG([SED], [sed], [not_found],
67 [$PATH:/usr/bin:/usr/local/bin])
68 if test -z "$SED" || test "$SED" = "not_found"; then
69 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
74 dnl GREP is mandatory for configure process and libtool.
75 dnl Set it now, allowing it to be changed later.
76 if test -z "$GREP"; then
77 dnl allow it to be overridden
78 AC_PATH_PROG([GREP], [grep], [not_found],
79 [$PATH:/usr/bin:/usr/local/bin])
80 if test -z "$GREP" || test "$GREP" = "not_found"; then
81 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
86 dnl EGREP is mandatory for configure process and libtool.
87 dnl Set it now, allowing it to be changed later.
88 if test -z "$EGREP"; then
89 dnl allow it to be overridden
90 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
91 AC_MSG_CHECKING([for egrep])
93 AC_MSG_RESULT([$EGREP])
95 AC_PATH_PROG([EGREP], [egrep], [not_found],
96 [$PATH:/usr/bin:/usr/local/bin])
99 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
100 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
104 dnl AR is mandatory for configure process and libtool.
105 dnl This is target dependent, so check it as a tool.
106 if test -z "$AR"; then
107 dnl allow it to be overridden
108 AC_PATH_TOOL([AR], [ar], [not_found],
109 [$PATH:/usr/bin:/usr/local/bin])
110 if test -z "$AR" || test "$AR" = "not_found"; then
111 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
118 dnl figure out the libcurl version
119 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
122 dnl for --enable-code-coverage
126 AC_MSG_CHECKING([curl version])
127 AC_MSG_RESULT($CURLVERSION)
129 AC_SUBST(CURLVERSION)
132 dnl we extract the numerical version for curl-config only
133 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
136 dnl Solaris pkgadd support definitions
137 PKGADD_PKG="HAXXcurl"
138 PKGADD_NAME="curl - a client that groks URLs"
139 PKGADD_VENDOR="curl.se"
141 AC_SUBST(PKGADD_NAME)
142 AC_SUBST(PKGADD_VENDOR)
145 dnl initialize all the info variables
146 curl_ssl_msg="no (--with-{openssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,mesalink,amissl,bearssl,rustls} )"
147 curl_ssh_msg="no (--with-{libssh,libssh2})"
148 curl_zlib_msg="no (--with-zlib)"
149 curl_brotli_msg="no (--with-brotli)"
150 curl_zstd_msg="no (--with-zstd)"
151 curl_gss_msg="no (--with-gssapi)"
152 curl_gsasl_msg="no (--with-gsasl)"
153 curl_tls_srp_msg="no (--enable-tls-srp)"
154 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
155 curl_ipv6_msg="no (--enable-ipv6)"
156 curl_unix_sockets_msg="no (--enable-unix-sockets)"
157 curl_idn_msg="no (--with-{libidn2,winidn})"
158 curl_manual_msg="no (--enable-manual)"
159 curl_libcurl_msg="enabled (--disable-libcurl-option)"
160 curl_verbose_msg="enabled (--disable-verbose)"
161 curl_sspi_msg="no (--enable-sspi)"
162 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
163 curl_ldaps_msg="no (--enable-ldaps)"
164 curl_rtsp_msg="no (--enable-rtsp)"
165 curl_rtmp_msg="no (--with-librtmp)"
166 curl_psl_msg="no (--with-libpsl)"
167 curl_altsvc_msg="enabled (--disable-alt-svc)"
168 curl_hsts_msg="enabled (--disable-hsts)"
170 curl_h1_msg="enabled (internal)"
171 curl_h2_msg="no (--with-nghttp2, --with-hyper)"
172 curl_h3_msg="no (--with-ngtcp2, --with-quiche)"
178 dnl Save some initial values the user might have provided
180 INITIAL_LDFLAGS=$LDFLAGS
183 dnl **********************************************************************
184 dnl See which TLS backend(s) that are requested. Just do all the
185 dnl TLS AC_ARG_WITH() invokes here and do the checks later
186 dnl **********************************************************************
188 AC_ARG_WITH(schannel,dnl
189 AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
190 OPT_SCHANNEL=$withval
191 TLSCHOICE="schannel")
193 OPT_SECURETRANSPORT=no
194 AC_ARG_WITH(secure-transport,dnl
195 AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),
196 OPT_SECURETRANSPORT=$withval
197 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
201 AC_ARG_WITH(amissl,dnl
202 AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),
204 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL")
207 dnl Default to no CA bundle
210 AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
211 AS_HELP_STRING([--without-ssl], [build without any TLS library]),
214 if test X"$withval" != Xno; then
215 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
218 AC_ARG_WITH(openssl,dnl
219 AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]),
221 if test X"$withval" != Xno; then
222 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
226 AC_ARG_WITH(gnutls,dnl
227 AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),
229 if test X"$withval" != Xno; then
230 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS")
234 AC_ARG_WITH(mbedtls,dnl
235 AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),
237 if test X"$withval" != Xno; then
238 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS")
242 AC_ARG_WITH(wolfssl,dnl
243 AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),
245 if test X"$withval" != Xno; then
246 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL")
250 AC_ARG_WITH(mesalink,dnl
251 AS_HELP_STRING([--with-mesalink=PATH],[where to look for MesaLink, PATH points to the installation root]),
252 OPT_MESALINK=$withval
253 if test X"$withval" != Xno; then
254 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }MesaLink")
258 AC_ARG_WITH(bearssl,dnl
259 AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),
261 if test X"$withval" != Xno; then
262 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL")
266 AC_ARG_WITH(rustls,dnl
267 AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),
269 if test X"$withval" != Xno; then
270 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls")
275 AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),
277 if test X"$withval" != Xno; then
278 test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS")
281 dnl If no TLS choice has been made, check if it was explicitly disabled or
282 dnl error out to force the user to decide.
283 if test -z "$TLSCHOICE"; then
284 if test "x$OPT_SSL" != "xno"; then
285 AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
295 --with-openssl (also works for BoringSSL and libressl)
298 --with-secure-transport
304 AC_ARG_WITH(darwinssl,,
305 AC_MSG_ERROR([--with-darwin-ssl no longer works!]))
308 dnl Detect the canonical host and target build environment
312 dnl Get system canonical name
313 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
315 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
316 AC_SUBST(AR_FLAGS, [cr])
318 dnl This defines _ALL_SOURCE for AIX
319 CURL_CHECK_AIX_ALL_SOURCE
321 dnl Our configure and build reentrant settings
322 CURL_CONFIGURE_THREAD_SAFE
323 CURL_CONFIGURE_REENTRANT
325 dnl check for how to do large files
331 # Automake conditionals based on libtool related checks
334 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
335 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
336 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
337 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
338 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
339 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
342 # Due to libtool and automake machinery limitations of not allowing
343 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
344 # inclusion of these in shared or static libraries, we are forced to
345 # build using separate configure runs for shared and static libraries
346 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
347 # to compile objects for each kind of library. Notice that relying on
348 # the '-DPIC' CFLAG that libtool provides is not valid given that the
349 # user might for example choose to build static libraries with PIC.
353 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
354 # targeting a static library and not building its shared counterpart.
357 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
358 [test "x$xc_lt_build_static_only" = 'xyes'])
361 # Make staticlib CPPFLAG variable and its definition visible in output
362 # files unconditionally, providing an empty definition unless strictly
363 # targeting a static library and not building its shared counterpart.
366 CPPFLAG_CURL_STATICLIB=
367 if test "x$xc_lt_build_static_only" = 'xyes'; then
368 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
370 AC_SUBST([CPPFLAG_CURL_STATICLIB])
373 # Determine whether all dependent libraries must be specified when linking
374 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
380 AC_SUBST(REQUIRE_LIB_DEPS)
381 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
383 dnl check if there's a way to force code inline
386 dnl **********************************************************************
387 dnl platform/compiler/architecture specific checks/flags
388 dnl **********************************************************************
391 CURL_SET_COMPILER_BASIC_OPTS
392 CURL_SET_COMPILER_DEBUG_OPTS
393 CURL_SET_COMPILER_OPTIMIZE_OPTS
394 CURL_SET_COMPILER_WARNING_OPTS
396 if test "$compiler_id" = "INTEL_UNIX_C"; then
398 if test "$compiler_num" -ge "1000"; then
399 dnl icc 10.X or later
400 CFLAGS="$CFLAGS -shared-intel"
401 elif test "$compiler_num" -ge "900"; then
403 CFLAGS="$CFLAGS -i-dynamic"
409 if test X"$want_werror" = Xyes; then
410 CURL_CFLAG_EXTRAS="-Werror"
411 if test "$compiler_id" = "GNU_C"; then
412 dnl enable -pedantic-errors for GCC 5 and later,
413 dnl as before that it was the same as -Werror=pedantic
414 if test "$compiler_num" -ge "500"; then
415 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
419 AC_SUBST(CURL_CFLAG_EXTRAS)
421 CURL_CHECK_COMPILER_HALT_ON_ERROR
422 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
423 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
424 CURL_CHECK_COMPILER_SYMBOL_HIDING
427 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
429 supports_unittests=yes
430 # cross-compilation of unit tests static library/programs fails when
431 # libcurl shared library is built. This might be due to a libtool or
432 # automake issue. In this case we disable unit tests.
433 if test "x$cross_compiling" != "xno" &&
434 test "x$enable_shared" != "xno"; then
435 supports_unittests=no
438 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
439 # a problem related with OpenSSL headers and library versions not matching.
440 # Disable unit tests while time to further investigate this is found.
443 if test "$compiler_id" = "GNU_C"; then
444 supports_unittests=no
449 # All AIX autobuilds fails unit tests linking against unittests library
450 # due to unittests library being built with no symbols or members. Libtool ?
451 # Disable unit tests while time to further investigate this is found.
454 supports_unittests=no
458 dnl Build unit tests when option --enable-debug is given.
459 if test "x$want_debug" = "xyes" &&
460 test "x$supports_unittests" = "xyes"; then
465 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
467 # For original MinGW (ie not MinGW-w64) define the Windows minimum supported OS
468 # version to Windows XP (0x501) if it hasn't already been defined by the user.
469 # Without this override original MinGW defaults the version to Windows NT 4.0.
470 # Note original MinGW sets _WIN32_WINNT if not defined to whatever WINVER is.
473 AC_MSG_CHECKING([if MinGW minimum supported OS should be set to XP])
478 #if defined(__MINGW64_VERSION_MAJOR) || \
480 defined(_WIN32_WINNT)
485 CPPFLAGS="$CPPFLAGS -DWINVER=0x501"
493 dnl **********************************************************************
494 dnl Compilation based checks should not be done before this point.
495 dnl **********************************************************************
497 dnl **********************************************************************
498 dnl Make sure that our checks for headers windows.h winsock2.h
499 dnl and ws2tcpip.h take precedence over any other further checks which
500 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
501 dnl this specific header files. And do them before its results are used.
502 dnl **********************************************************************
504 CURL_CHECK_HEADER_WINDOWS
505 CURL_CHECK_NATIVE_WINDOWS
506 case X-"$curl_cv_native_windows" in
508 CURL_CHECK_HEADER_WINSOCK2
509 CURL_CHECK_HEADER_WS2TCPIP
510 CURL_CHECK_HEADER_WINCRYPT
511 CURL_CHECK_HEADER_WINLDAP
512 CURL_CHECK_HEADER_WINBER
515 curl_cv_header_winsock2_h="no"
516 curl_cv_header_ws2tcpip_h="no"
517 curl_cv_header_wincrypt_h="no"
518 curl_cv_header_winldap_h="no"
519 curl_cv_header_winber_h="no"
522 CURL_CHECK_WIN32_LARGEFILE
523 CURL_CHECK_WIN32_CRYPTO
526 CURL_DARWIN_SYSTEMCONFIGURATION
527 CURL_SUPPORTS_BUILTIN_AVAILABLE
530 dnl ************************************************************
531 dnl switch off particular protocols
533 AC_MSG_CHECKING([whether to support http])
535 AS_HELP_STRING([--enable-http],[Enable HTTP support])
536 AS_HELP_STRING([--disable-http],[Disable HTTP support]),
537 [ case "$enableval" in
540 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
542 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
543 AC_SUBST(CURL_DISABLE_HTTP, [1])
544 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
545 AC_SUBST(CURL_DISABLE_RTSP, [1])
546 dnl toggle off alt-svc too when HTTP is disabled
547 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
548 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
549 curl_h1_msg="no (--enable-http, --with-hyper)"
550 curl_altsvc_msg="no";
551 curl_hsts_msg="no (--enable-hsts)";
555 *) AC_MSG_RESULT(yes)
560 AC_MSG_CHECKING([whether to support ftp])
562 AS_HELP_STRING([--enable-ftp],[Enable FTP support])
563 AS_HELP_STRING([--disable-ftp],[Disable FTP support]),
564 [ case "$enableval" in
567 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
568 AC_SUBST(CURL_DISABLE_FTP, [1])
570 *) AC_MSG_RESULT(yes)
575 AC_MSG_CHECKING([whether to support file])
577 AS_HELP_STRING([--enable-file],[Enable FILE support])
578 AS_HELP_STRING([--disable-file],[Disable FILE support]),
579 [ case "$enableval" in
582 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
583 AC_SUBST(CURL_DISABLE_FILE, [1])
585 *) AC_MSG_RESULT(yes)
590 AC_MSG_CHECKING([whether to support ldap])
592 AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
593 AS_HELP_STRING([--disable-ldap],[Disable LDAP support]),
594 [ case "$enableval" in
597 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
598 AC_SUBST(CURL_DISABLE_LDAP, [1])
610 AC_MSG_CHECKING([whether to support ldaps])
612 AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
613 AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
614 [ case "$enableval" in
617 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
618 AC_SUBST(CURL_DISABLE_LDAPS, [1])
620 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
621 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
622 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
623 AC_SUBST(CURL_DISABLE_LDAPS, [1])
626 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
627 AC_SUBST(HAVE_LDAP_SSL, [1])
631 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
633 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
634 AC_SUBST(CURL_DISABLE_LDAPS, [1])
637 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
638 AC_SUBST(HAVE_LDAP_SSL, [1])
642 dnl **********************************************************************
644 dnl **********************************************************************
649 AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
650 AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
651 [OPT_HYPER=$withval])
654 dnl --without-hyper option used
658 dnl --with-hyper option used without path
663 dnl --with-hyper option used with path
665 want_hyper_path="$withval"
669 if test X"$want_hyper" != Xno; then
670 if test "x$disable_http" = "xyes"; then
671 AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
674 dnl backup the pre-hyper variables
675 CLEANLDFLAGS="$LDFLAGS"
676 CLEANCPPFLAGS="$CPPFLAGS"
679 CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
681 if test "$PKGCONFIG" != "no" ; then
682 LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
683 $PKGCONFIG --libs-only-l hyper`
684 CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
685 $PKGCONFIG --cflags-only-I hyper`
686 LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
687 $PKGCONFIG --libs-only-L hyper`
689 dnl no hyper pkg-config found
690 LIB_HYPER="-lhyper -ldl -lpthread -lm"
691 if test X"$want_hyper" != Xdefault; then
692 CPP_HYPER=-I"$want_hyper_path/capi/include"
693 LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
696 if test -n "$LIB_HYPER"; then
697 AC_MSG_NOTICE([-l is $LIB_HYPER])
698 AC_MSG_NOTICE([-I is $CPP_HYPER])
699 AC_MSG_NOTICE([-L is $LD_HYPER])
701 LDFLAGS="$LDFLAGS $LD_HYPER"
702 CPPFLAGS="$CPPFLAGS $CPP_HYPER"
703 LIBS="$LIB_HYPER $LIBS"
705 if test "x$cross_compiling" != "xyes"; then
706 dnl remove -L, separate with colon if more than one
707 DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
710 AC_CHECK_LIB(hyper, hyper_io_new,
712 AC_CHECK_HEADERS(hyper.h,
713 experimental="$experimental Hyper"
714 AC_MSG_NOTICE([Hyper support is experimental])
715 curl_h1_msg="enabled (Hyper)"
716 curl_h2_msg=$curl_h1_msg
718 AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
719 AC_SUBST(USE_HYPER, [1])
720 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
721 export CURL_LIBRARY_PATH
722 AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]),
725 for d in `echo $DIR_HYPER | sed -e 's/:/ /'`; do
726 if test -f "$d/libhyper.a"; then
727 AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
730 AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
735 if test X"$want_hyper" != Xno; then
736 AC_MSG_NOTICE([Disable RTSP support with hyper])
737 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
738 AC_SUBST(CURL_DISABLE_RTSP, [1])
742 AC_MSG_CHECKING([whether to support rtsp])
744 AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
745 AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
746 [ case "$enableval" in
749 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
750 AC_SUBST(CURL_DISABLE_RTSP, [1])
753 if test x$CURL_DISABLE_HTTP = x1 ; then
754 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
757 curl_rtsp_msg="enabled"
761 if test "x$CURL_DISABLE_HTTP" != "x1"; then
763 curl_rtsp_msg="enabled"
770 AC_MSG_CHECKING([whether to support proxies])
772 AS_HELP_STRING([--enable-proxy],[Enable proxy support])
773 AS_HELP_STRING([--disable-proxy],[Disable proxy support]),
774 [ case "$enableval" in
777 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
778 AC_SUBST(CURL_DISABLE_PROXY, [1])
781 *) AC_MSG_RESULT(yes)
787 AC_MSG_CHECKING([whether to support dict])
789 AS_HELP_STRING([--enable-dict],[Enable DICT support])
790 AS_HELP_STRING([--disable-dict],[Disable DICT support]),
791 [ case "$enableval" in
794 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
795 AC_SUBST(CURL_DISABLE_DICT, [1])
797 *) AC_MSG_RESULT(yes)
802 AC_MSG_CHECKING([whether to support telnet])
803 AC_ARG_ENABLE(telnet,
804 AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
805 AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
806 [ case "$enableval" in
809 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
810 AC_SUBST(CURL_DISABLE_TELNET, [1])
812 *) AC_MSG_RESULT(yes)
817 AC_MSG_CHECKING([whether to support tftp])
819 AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
820 AS_HELP_STRING([--disable-tftp],[Disable TFTP support]),
821 [ case "$enableval" in
824 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
825 AC_SUBST(CURL_DISABLE_TFTP, [1])
827 *) AC_MSG_RESULT(yes)
833 AC_MSG_CHECKING([whether to support pop3])
835 AS_HELP_STRING([--enable-pop3],[Enable POP3 support])
836 AS_HELP_STRING([--disable-pop3],[Disable POP3 support]),
837 [ case "$enableval" in
840 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
841 AC_SUBST(CURL_DISABLE_POP3, [1])
843 *) AC_MSG_RESULT(yes)
850 AC_MSG_CHECKING([whether to support imap])
852 AS_HELP_STRING([--enable-imap],[Enable IMAP support])
853 AS_HELP_STRING([--disable-imap],[Disable IMAP support]),
854 [ case "$enableval" in
857 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
858 AC_SUBST(CURL_DISABLE_IMAP, [1])
860 *) AC_MSG_RESULT(yes)
867 AC_MSG_CHECKING([whether to support smb])
869 AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
870 AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
871 [ case "$enableval" in
874 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
875 AC_SUBST(CURL_DISABLE_SMB, [1])
877 *) AC_MSG_RESULT(yes)
883 AC_MSG_CHECKING([whether to support smtp])
885 AS_HELP_STRING([--enable-smtp],[Enable SMTP support])
886 AS_HELP_STRING([--disable-smtp],[Disable SMTP support]),
887 [ case "$enableval" in
890 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
891 AC_SUBST(CURL_DISABLE_SMTP, [1])
893 *) AC_MSG_RESULT(yes)
899 AC_MSG_CHECKING([whether to support gopher])
900 AC_ARG_ENABLE(gopher,
901 AS_HELP_STRING([--enable-gopher],[Enable Gopher support])
902 AS_HELP_STRING([--disable-gopher],[Disable Gopher support]),
903 [ case "$enableval" in
906 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
907 AC_SUBST(CURL_DISABLE_GOPHER, [1])
909 *) AC_MSG_RESULT(yes)
915 AC_MSG_CHECKING([whether to support mqtt])
917 AS_HELP_STRING([--enable-mqtt],[Enable MQTT support])
918 AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
919 [ case "$enableval" in
922 AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
923 AC_SUBST(CURL_DISABLE_MQTT, [1])
925 *) AC_MSG_RESULT(yes)
931 dnl **********************************************************************
932 dnl Check for built-in manual
933 dnl **********************************************************************
935 AC_MSG_CHECKING([whether to provide built-in manual])
936 AC_ARG_ENABLE(manual,
937 AS_HELP_STRING([--enable-manual],[Enable built-in manual])
938 AS_HELP_STRING([--disable-manual],[Disable built-in manual]),
939 [ case "$enableval" in
943 *) AC_MSG_RESULT(yes)
950 dnl The actual use of the USE_MANUAL variable is done much later in this
951 dnl script to allow other actions to disable it as well.
953 dnl ************************************************************
954 dnl disable C code generation support
956 AC_MSG_CHECKING([whether to enable generation of C code])
957 AC_ARG_ENABLE(libcurl_option,
958 AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
959 AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
960 [ case "$enableval" in
963 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
964 curl_libcurl_msg="no"
966 *) AC_MSG_RESULT(yes)
972 dnl **********************************************************************
973 dnl Checks for libraries.
974 dnl **********************************************************************
976 AC_MSG_CHECKING([whether to use libgcc])
977 AC_ARG_ENABLE(libgcc,
978 AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
979 [ case "$enableval" in
992 dnl gethostbyname without lib or in the nsl lib?
993 AC_CHECK_FUNC(gethostbyname,
994 [HAVE_GETHOSTBYNAME="1"
996 [ AC_CHECK_LIB(nsl, gethostbyname,
997 [HAVE_GETHOSTBYNAME="1"
1002 if test "$HAVE_GETHOSTBYNAME" != "1"
1004 dnl gethostbyname in the socket lib?
1005 AC_CHECK_LIB(socket, gethostbyname,
1006 [HAVE_GETHOSTBYNAME="1"
1007 LIBS="-lsocket $LIBS"
1011 if test "$HAVE_GETHOSTBYNAME" != "1"
1013 dnl gethostbyname in the watt lib?
1014 AC_CHECK_LIB(watt, gethostbyname,
1015 [HAVE_GETHOSTBYNAME="1"
1016 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
1017 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
1022 dnl At least one system has been identified to require BOTH nsl and socket
1023 dnl libs at the same time to link properly.
1024 if test "$HAVE_GETHOSTBYNAME" != "1"
1026 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
1027 my_ac_save_LIBS=$LIBS
1028 LIBS="-lnsl -lsocket $LIBS"
1035 AC_MSG_RESULT([yes])
1036 HAVE_GETHOSTBYNAME="1"
1039 LIBS=$my_ac_save_LIBS
1043 if test "$HAVE_GETHOSTBYNAME" != "1"
1045 dnl This is for winsock systems
1046 if test "$curl_cv_header_windows_h" = "yes"; then
1047 if test "$curl_cv_header_winsock2_h" = "yes"; then
1048 winsock_LIB="-lws2_32"
1050 if test ! -z "$winsock_LIB"; then
1051 my_ac_save_LIBS=$LIBS
1052 LIBS="$winsock_LIB $LIBS"
1053 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
1056 #ifdef HAVE_WINDOWS_H
1057 #ifndef WIN32_LEAN_AND_MEAN
1058 #define WIN32_LEAN_AND_MEAN
1060 #include <windows.h>
1061 #ifdef HAVE_WINSOCK2_H
1062 #include <winsock2.h>
1066 gethostbyname("www.dummysite.com");
1069 AC_MSG_RESULT([yes])
1070 HAVE_GETHOSTBYNAME="1"
1074 LIBS=$my_ac_save_LIBS
1080 if test "$HAVE_GETHOSTBYNAME" != "1"
1082 dnl This is for Minix 3.1
1083 AC_MSG_CHECKING([for gethostbyname for Minix 3])
1086 /* Older Minix versions may need <net/gen/netdb.h> here instead */
1089 gethostbyname("www.dummysite.com");
1092 AC_MSG_RESULT([yes])
1093 HAVE_GETHOSTBYNAME="1"
1099 if test "$HAVE_GETHOSTBYNAME" != "1"
1101 dnl This is for eCos with a stubbed DNS implementation
1102 AC_MSG_CHECKING([for gethostbyname for eCos])
1108 gethostbyname("www.dummysite.com");
1111 AC_MSG_RESULT([yes])
1112 HAVE_GETHOSTBYNAME="1"
1118 if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
1120 dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
1121 AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
1124 #include <proto/bsdsocket.h>
1125 struct Library *SocketBase = NULL;
1127 gethostbyname("www.dummysite.com");
1130 AC_MSG_RESULT([yes])
1131 HAVE_GETHOSTBYNAME="1"
1132 HAVE_PROTO_BSDSOCKET_H="1"
1133 AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
1134 AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
1140 if test "$HAVE_GETHOSTBYNAME" != "1"
1142 dnl gethostbyname in the network lib - for Haiku OS
1143 AC_CHECK_LIB(network, gethostbyname,
1144 [HAVE_GETHOSTBYNAME="1"
1145 LIBS="-lnetwork $LIBS"
1149 if test "$HAVE_GETHOSTBYNAME" != "1"
1151 dnl gethostbyname in the net lib - for BeOS
1152 AC_CHECK_LIB(net, gethostbyname,
1153 [HAVE_GETHOSTBYNAME="1"
1159 if test "$HAVE_GETHOSTBYNAME" != "1"; then
1160 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
1163 CURL_CHECK_LIBS_CONNECT
1165 CURL_NETWORK_LIBS=$LIBS
1167 dnl **********************************************************************
1168 dnl In case that function clock_gettime with monotonic timer is available,
1169 dnl check for additional required libraries.
1170 dnl **********************************************************************
1171 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
1173 dnl **********************************************************************
1174 dnl The preceding library checks are all potentially useful for test
1175 dnl servers and libtest cases which require networking and clock_gettime
1176 dnl support. Save the list of required libraries at this point for use
1177 dnl while linking those test servers and programs.
1178 dnl **********************************************************************
1179 CURL_NETWORK_AND_TIME_LIBS=$LIBS
1181 dnl **********************************************************************
1182 dnl Check for the presence of ZLIB libraries and headers
1183 dnl **********************************************************************
1185 dnl Check for & handle argument to --with-zlib.
1187 clean_CPPFLAGS=$CPPFLAGS
1188 clean_LDFLAGS=$LDFLAGS
1192 AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1193 AS_HELP_STRING([--without-zlib],[disable use of zlib]),
1194 [OPT_ZLIB="$withval"])
1196 if test "$OPT_ZLIB" = "no" ; then
1197 AC_MSG_WARN([zlib disabled])
1199 if test "$OPT_ZLIB" = "yes" ; then
1203 if test -z "$OPT_ZLIB" ; then
1204 CURL_CHECK_PKGCONFIG(zlib)
1206 if test "$PKGCONFIG" != "no" ; then
1207 LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
1208 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
1209 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
1214 if test -z "$HAVE_LIBZ"; then
1216 dnl Check for the lib without setting any new path, since many
1217 dnl people have it in the default path
1219 AC_CHECK_LIB(z, inflateEnd,
1220 dnl libz found, set the variable
1223 dnl if no lib found, try /usr/local
1224 [OPT_ZLIB="/usr/local"])
1228 dnl Add a nonempty path to the compiler flags
1229 if test -n "$OPT_ZLIB"; then
1230 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1231 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1234 AC_CHECK_HEADER(zlib.h,
1236 dnl zlib.h was found
1238 dnl if the lib wasn't found already, try again with the new paths
1239 if test "$HAVE_LIBZ" != "1"; then
1240 AC_CHECK_LIB(z, gzread,
1242 dnl the lib was found!
1246 [ CPPFLAGS=$clean_CPPFLAGS
1247 LDFLAGS=$clean_LDFLAGS])
1251 dnl zlib.h was not found, restore the flags
1252 CPPFLAGS=$clean_CPPFLAGS
1253 LDFLAGS=$clean_LDFLAGS]
1256 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1258 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1260 CPPFLAGS=$clean_CPPFLAGS
1261 LDFLAGS=$clean_LDFLAGS
1263 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1265 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1266 CPPFLAGS=$clean_CPPFLAGS
1267 LDFLAGS=$clean_LDFLAGS
1269 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1271 dnl both header and lib were found!
1273 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1274 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1277 LIBS="-lz $clean_LIBS"
1279 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1281 AC_MSG_NOTICE([found both libz and libz.h header])
1282 curl_zlib_msg="enabled"
1286 dnl set variable for use in automakefile(s)
1287 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1290 dnl **********************************************************************
1291 dnl Check for the presence of BROTLI decoder libraries and headers
1292 dnl **********************************************************************
1294 dnl Brotli project home page: https://github.com/google/brotli
1296 dnl Default to compiler & linker defaults for BROTLI files & libraries.
1298 AC_ARG_WITH(brotli,dnl
1299 AS_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1300 AS_HELP_STRING([--without-brotli], [disable BROTLI]),
1301 OPT_BROTLI=$withval)
1303 if test X"$OPT_BROTLI" != Xno; then
1304 dnl backup the pre-brotli variables
1305 CLEANLDFLAGS="$LDFLAGS"
1306 CLEANCPPFLAGS="$CPPFLAGS"
1309 case "$OPT_BROTLI" in
1311 dnl --with-brotli (without path) used
1312 CURL_CHECK_PKGCONFIG(libbrotlidec)
1314 if test "$PKGCONFIG" != "no" ; then
1315 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1316 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1317 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1318 version=`$PKGCONFIG --modversion libbrotlidec`
1319 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
1324 dnl no --with-brotli option given, just check default places
1327 dnl use the given --with-brotli spot
1328 PREFIX_BROTLI=$OPT_BROTLI
1332 dnl if given with a prefix, we set -L and -I based on that
1333 if test -n "$PREFIX_BROTLI"; then
1334 LIB_BROTLI="-lbrotlidec"
1335 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1336 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1337 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1340 LDFLAGS="$LDFLAGS $LD_BROTLI"
1341 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1342 LIBS="$LIB_BROTLI $LIBS"
1344 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1346 AC_CHECK_HEADERS(brotli/decode.h,
1347 curl_brotli_msg="enabled (libbrotlidec)"
1349 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1350 AC_SUBST(HAVE_BROTLI, [1])
1353 if test X"$OPT_BROTLI" != Xoff &&
1354 test "$HAVE_BROTLI" != "1"; then
1355 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1358 if test "$HAVE_BROTLI" = "1"; then
1359 if test -n "$DIR_BROTLI"; then
1360 dnl when the brotli shared libs were found in a path that the run-time
1361 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1362 dnl to prevent further configure tests to fail due to this
1364 if test "x$cross_compiling" != "xyes"; then
1365 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1366 export CURL_LIBRARY_PATH
1367 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1371 dnl no brotli, revert back to clean variables
1372 LDFLAGS=$CLEANLDFLAGS
1373 CPPFLAGS=$CLEANCPPFLAGS
1378 dnl **********************************************************************
1379 dnl Check for libzstd
1380 dnl **********************************************************************
1382 dnl Default to compiler & linker defaults for libzstd
1384 AC_ARG_WITH(zstd,dnl
1385 AS_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1386 AS_HELP_STRING([--without-zstd], [disable libzstd]),
1389 if test X"$OPT_ZSTD" != Xno; then
1390 dnl backup the pre-zstd variables
1391 CLEANLDFLAGS="$LDFLAGS"
1392 CLEANCPPFLAGS="$CPPFLAGS"
1397 dnl --with-zstd (without path) used
1398 CURL_CHECK_PKGCONFIG(libzstd)
1400 if test "$PKGCONFIG" != "no" ; then
1401 LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
1402 LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
1403 CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
1404 version=`$PKGCONFIG --modversion libzstd`
1405 DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
1410 dnl no --with-zstd option given, just check default places
1413 dnl use the given --with-zstd spot
1414 PREFIX_ZSTD=$OPT_ZSTD
1418 dnl if given with a prefix, we set -L and -I based on that
1419 if test -n "$PREFIX_ZSTD"; then
1421 LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
1422 CPP_ZSTD=-I${PREFIX_ZSTD}/include
1423 DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
1426 LDFLAGS="$LDFLAGS $LD_ZSTD"
1427 CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
1428 LIBS="$LIB_ZSTD $LIBS"
1430 AC_CHECK_LIB(zstd, ZSTD_createDStream)
1432 AC_CHECK_HEADERS(zstd.h,
1433 curl_zstd_msg="enabled (libzstd)"
1435 AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
1436 AC_SUBST(HAVE_ZSTD, [1])
1439 if test X"$OPT_ZSTD" != Xoff &&
1440 test "$HAVE_ZSTD" != "1"; then
1441 AC_MSG_ERROR([libzstd was not found where specified!])
1444 if test "$HAVE_ZSTD" = "1"; then
1445 if test -n "$DIR_ZSTD"; then
1446 dnl when the zstd shared lib were found in a path that the run-time
1447 dnl linker doesn't search through, we need to add it to
1448 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
1451 if test "x$cross_compiling" != "xyes"; then
1452 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
1453 export CURL_LIBRARY_PATH
1454 AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
1458 dnl no zstd, revert back to clean variables
1459 LDFLAGS=$CLEANLDFLAGS
1460 CPPFLAGS=$CLEANCPPFLAGS
1465 dnl **********************************************************************
1467 dnl **********************************************************************
1470 AC_ARG_WITH(ldap-lib,
1471 AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1472 [LDAPLIBNAME="$withval"])
1475 AC_ARG_WITH(lber-lib,
1476 AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1477 [LBERLIBNAME="$withval"])
1479 if test x$CURL_DISABLE_LDAP != x1 ; then
1481 CURL_CHECK_HEADER_LBER
1482 CURL_CHECK_HEADER_LDAP
1483 CURL_CHECK_HEADER_LDAPSSL
1484 CURL_CHECK_HEADER_LDAP_SSL
1486 if test -z "$LDAPLIBNAME" ; then
1487 if test "$curl_cv_native_windows" = "yes"; then
1488 dnl Windows uses a single and unique LDAP library name
1489 LDAPLIBNAME="wldap32"
1494 if test "$LDAPLIBNAME" ; then
1495 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1496 if test -n "$ldap_askedfor"; then
1497 AC_MSG_ERROR([couldn't detect the LDAP libraries])
1499 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1500 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1501 AC_SUBST(CURL_DISABLE_LDAP, [1])
1502 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1503 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1505 dnl Try to find the right ldap libraries for this system
1506 CURL_CHECK_LIBS_LDAP
1507 case X-"$curl_cv_ldap_LIBS" in
1509 if test -n "$ldap_askedfor"; then
1510 AC_MSG_ERROR([couldn't detect the LDAP libraries])
1512 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1513 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1514 AC_SUBST(CURL_DISABLE_LDAP, [1])
1515 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1516 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1522 if test x$CURL_DISABLE_LDAP != x1 ; then
1524 if test "$LBERLIBNAME" ; then
1525 dnl If name is "no" then don't define this library at all
1526 dnl (it's only needed if libldap.so's dependencies are broken).
1527 if test "$LBERLIBNAME" != "no" ; then
1528 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1529 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1530 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1531 AC_SUBST(CURL_DISABLE_LDAP, [1])
1532 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1533 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1538 if test x$CURL_DISABLE_LDAP != x1 ; then
1539 AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
1541 if test "$LDAPLIBNAME" = "wldap32"; then
1542 curl_ldap_msg="enabled (winldap)"
1543 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1545 curl_ldap_msg="enabled (OpenLDAP)"
1546 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1547 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1548 AC_SUBST(USE_OPENLDAP, [1])
1553 if test x$CURL_DISABLE_LDAPS != x1 ; then
1554 curl_ldaps_msg="enabled"
1557 dnl **********************************************************************
1559 dnl **********************************************************************
1561 AC_MSG_CHECKING([whether to enable IPv6])
1563 AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1564 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1565 [ case "$enableval" in
1570 *) AC_MSG_RESULT(yes)
1575 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1576 /* are AF_INET6 and sockaddr_in6 available? */
1577 #include <sys/types.h>
1578 #ifdef HAVE_WINSOCK2_H
1579 #include <winsock2.h>
1580 #include <ws2tcpip.h>
1582 #include <sys/socket.h>
1583 #include <netinet/in.h>
1584 #if defined (__TANDEM)
1585 # include <netinet/in6.h>
1588 #include <stdlib.h> /* for exit() */
1591 struct sockaddr_in6 s;
1593 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1608 if test "$ipv6" = yes; then
1609 curl_ipv6_msg="enabled"
1610 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
1612 AC_SUBST(IPV6_ENABLED)
1614 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1615 AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
1616 #include <sys/types.h>
1617 #ifdef HAVE_WINSOCK2_H
1618 #include <winsock2.h>
1619 #include <ws2tcpip.h>
1621 #include <netinet/in.h>
1622 #if defined (__TANDEM)
1623 # include <netinet/in6.h>
1627 struct sockaddr_in6 s;
1628 s.sin6_scope_id = 0;
1630 AC_MSG_RESULT([yes])
1631 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1637 dnl **********************************************************************
1638 dnl Check if the operating system allows programs to write to their own argv[]
1639 dnl **********************************************************************
1641 AC_MSG_CHECKING([if argv can be written to])
1643 int main(int argc, char **argv)
1647 return (argv[0][0] == ' ')?0:1;
1650 curl_cv_writable_argv=yes
1652 curl_cv_writable_argv=no
1654 curl_cv_writable_argv=cross
1656 case $curl_cv_writable_argv in
1658 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1666 AC_MSG_WARN([the previous check could not be made default was used])
1670 dnl **********************************************************************
1671 dnl Check for GSS-API libraries
1672 dnl **********************************************************************
1674 dnl check for GSS-API stuff in the /usr as default
1677 AC_ARG_WITH(gssapi-includes,
1678 AS_HELP_STRING([--with-gssapi-includes=DIR],
1679 [Specify location of GSS-API headers]),
1680 [ GSSAPI_INCS="-I$withval"
1684 AC_ARG_WITH(gssapi-libs,
1685 AS_HELP_STRING([--with-gssapi-libs=DIR],
1686 [Specify location of GSS-API libs]),
1687 [ GSSAPI_LIB_DIR="-L$withval"
1692 AS_HELP_STRING([--with-gssapi=DIR],
1693 [Where to look for GSS-API]), [
1694 GSSAPI_ROOT="$withval"
1695 if test x"$GSSAPI_ROOT" != xno; then
1697 if test x"$GSSAPI_ROOT" = xyes; then
1698 dnl if yes, then use default root
1704 save_CPPFLAGS="$CPPFLAGS"
1705 AC_MSG_CHECKING([if GSS-API support is requested])
1706 if test x"$want_gss" = xyes; then
1709 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1710 if test -z "$GSSAPI_INCS"; then
1711 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1712 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1713 elif test "$PKGCONFIG" != "no" ; then
1714 GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
1715 elif test "$GSSAPI_ROOT" != "yes"; then
1716 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1720 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1722 AC_CHECK_HEADER(gss.h,
1724 dnl found in the given dirs
1725 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1729 dnl not found, check Heimdal or MIT
1730 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1732 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1737 #ifdef HAVE_GSSAPI_GSSAPI_H
1738 #include <gssapi/gssapi.h>
1741 if test "x$not_mit" = "x1"; then
1742 dnl MIT not found, check for Heimdal
1743 AC_CHECK_HEADER(gssapi.h,
1746 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1749 dnl no header found, disabling GSS
1751 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1756 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1757 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1758 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1761 #include <gssapi/gssapi.h>
1762 #include <gssapi/gssapi_generic.h>
1763 #include <gssapi/gssapi_krb5.h>
1768 GSS_C_NT_HOSTBASED_SERVICE,
1772 AC_MSG_RESULT([yes])
1775 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1776 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1784 if test x"$want_gss" = xyes; then
1785 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1787 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1789 if test -n "$gnu_gss"; then
1790 curl_gss_msg="enabled (GNU GSS)"
1791 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1793 elif test -z "$GSSAPI_LIB_DIR"; then
1796 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1799 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1800 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1801 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1803 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1804 LIBS="$gss_libs $LIBS"
1805 elif test "$PKGCONFIG" != "no" ; then
1806 gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
1807 LIBS="$gss_libs $LIBS"
1814 gss_libname="gssapi"
1818 if test "$GSSAPI_ROOT" != "yes"; then
1819 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1820 LIBS="-l$gss_libname $LIBS"
1822 LIBS="-l$gss_libname $LIBS"
1828 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1834 LIBS="-lgssapi $LIBS"
1839 CPPFLAGS="$save_CPPFLAGS"
1843 if test x"$want_gss" = "xyes"; then
1844 build_libstubgss=yes
1847 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
1849 dnl -------------------------------------------------------------
1850 dnl parse --with-default-ssl-backend so it can be validated below
1851 dnl -------------------------------------------------------------
1853 DEFAULT_SSL_BACKEND=no
1854 VALID_DEFAULT_SSL_BACKEND=
1855 AC_ARG_WITH(default-ssl-backend,
1856 AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
1857 AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
1858 [DEFAULT_SSL_BACKEND=$withval])
1859 case "$DEFAULT_SSL_BACKEND" in
1861 dnl --without-default-ssl-backend option used
1864 dnl --with-default-ssl-backend option used without name
1865 AC_MSG_ERROR([The name of the default SSL backend is required.])
1868 dnl --with-default-ssl-backend option used with name
1869 AC_SUBST(DEFAULT_SSL_BACKEND)
1870 dnl needs to be validated below
1871 VALID_DEFAULT_SSL_BACKEND=no
1876 CURL_WITH_SECURETRANSPORT
1887 dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
1888 if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then
1889 LIBS="-ladvapi32 -lcrypt32 $LIBS"
1892 case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$MESALINK_ENABLED$BEARSSL_ENABLED$AMISSL_ENABLED$RUSTLS_ENABLED"
1895 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
1896 AC_MSG_WARN([Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-mesalink, --with-amissl, --with-bearssl or --with-rustls to address this.])
1899 # one SSL backend is enabled
1900 AC_SUBST(SSL_ENABLED)
1902 AC_MSG_NOTICE([built with one SSL backend])
1905 # more than one SSL backend is enabled
1906 AC_SUBST(SSL_ENABLED)
1908 AC_SUBST(CURL_WITH_MULTI_SSL)
1909 CURL_WITH_MULTI_SSL="1"
1910 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
1911 AC_MSG_NOTICE([built with multiple SSL backends])
1915 if test -n "$ssl_backends"; then
1916 curl_ssl_msg="enabled ($ssl_backends)"
1919 if test no = "$VALID_DEFAULT_SSL_BACKEND"
1921 if test -n "$SSL_ENABLED"
1923 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
1925 AC_MSG_ERROR([Default SSL backend requires SSL!])
1927 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
1929 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
1932 dnl **********************************************************************
1933 dnl Check for the CA bundle
1934 dnl **********************************************************************
1936 if test -n "$check_for_ca_bundle"; then
1937 CURL_CHECK_CA_BUNDLE
1940 dnl **********************************************************************
1941 dnl Check for libpsl
1942 dnl **********************************************************************
1945 AS_HELP_STRING([--without-libpsl],
1946 [disable support for libpsl cookie checking]),
1947 with_libpsl=$withval,
1949 if test $with_libpsl != "no"; then
1950 AC_SEARCH_LIBS(psl_builtin, psl,
1951 [curl_psl_msg="enabled";
1952 AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
1954 [curl_psl_msg="no (libpsl not found)";
1955 AC_MSG_WARN([libpsl was not found])
1959 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
1962 dnl **********************************************************************
1963 dnl Check for libgsasl
1964 dnl **********************************************************************
1966 AC_ARG_WITH(libgsasl,
1967 AS_HELP_STRING([--without-libgsasl],
1968 [disable libgsasl support for SCRAM]),
1969 with_libgsasl=$withval,
1971 if test $with_libgsasl != "no"; then
1972 AC_SEARCH_LIBS(gsasl_init, gsasl,
1973 [curl_gsasl_msg="enabled";
1974 AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
1976 [curl_gsasl_msg="no (libgsasl not found)";
1977 AC_MSG_WARN([libgsasl was not found])
1981 AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
1983 AC_ARG_WITH(libmetalink,,
1984 AC_MSG_ERROR([--with-libmetalink no longer works!]))
1986 dnl **********************************************************************
1987 dnl Check for the presence of LIBSSH2 libraries and headers
1988 dnl **********************************************************************
1990 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
1992 AC_ARG_WITH(libssh2,dnl
1993 AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1994 AS_HELP_STRING([--with-libssh2], [enable libssh2]),
1995 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
1999 AC_ARG_WITH(libssh,dnl
2000 AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2001 AS_HELP_STRING([--with-libssh], [enable libssh]),
2002 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2005 AC_ARG_WITH(wolfssh,dnl
2006 AS_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2007 AS_HELP_STRING([--with-wolfssh], [enable wolfssh]),
2008 OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
2010 if test X"$OPT_LIBSSH2" != Xno; then
2011 dnl backup the pre-libssh2 variables
2012 CLEANLDFLAGS="$LDFLAGS"
2013 CLEANCPPFLAGS="$CPPFLAGS"
2016 case "$OPT_LIBSSH2" in
2018 dnl --with-libssh2 (without path) used
2019 CURL_CHECK_PKGCONFIG(libssh2)
2021 if test "$PKGCONFIG" != "no" ; then
2022 LIB_SSH2=`$PKGCONFIG --libs libssh2`
2023 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2024 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2025 version=`$PKGCONFIG --modversion libssh2`
2026 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
2031 dnl no --with-libssh2 option given, just check default places
2034 dnl use the given --with-libssh2 spot
2035 PREFIX_SSH2=$OPT_LIBSSH2
2039 dnl if given with a prefix, we set -L and -I based on that
2040 if test -n "$PREFIX_SSH2"; then
2042 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2043 CPP_SSH2=-I${PREFIX_SSH2}/include
2044 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2047 LDFLAGS="$LDFLAGS $LD_SSH2"
2048 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2049 LIBS="$LIB_SSH2 $LIBS"
2051 dnl check for function added in libssh2 version 1.0
2052 AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
2054 AC_CHECK_HEADERS(libssh2.h,
2055 curl_ssh_msg="enabled (libSSH2)"
2057 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2058 AC_SUBST(USE_LIBSSH2, [1])
2061 if test X"$OPT_LIBSSH2" != Xoff &&
2062 test "$LIBSSH2_ENABLED" != "1"; then
2063 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2066 if test "$LIBSSH2_ENABLED" = "1"; then
2067 if test -n "$DIR_SSH2"; then
2068 dnl when the libssh2 shared libs were found in a path that the run-time
2069 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2070 dnl to prevent further configure tests to fail due to this
2072 if test "x$cross_compiling" != "xyes"; then
2073 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
2074 export CURL_LIBRARY_PATH
2075 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2079 dnl no libssh2, revert back to clean variables
2080 LDFLAGS=$CLEANLDFLAGS
2081 CPPFLAGS=$CLEANCPPFLAGS
2084 elif test X"$OPT_LIBSSH" != Xno; then
2085 dnl backup the pre-libssh variables
2086 CLEANLDFLAGS="$LDFLAGS"
2087 CLEANCPPFLAGS="$CPPFLAGS"
2090 case "$OPT_LIBSSH" in
2092 dnl --with-libssh (without path) used
2093 CURL_CHECK_PKGCONFIG(libssh)
2095 if test "$PKGCONFIG" != "no" ; then
2096 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2097 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2098 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2099 version=`$PKGCONFIG --modversion libssh`
2100 DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
2105 dnl no --with-libssh option given, just check default places
2108 dnl use the given --with-libssh spot
2109 PREFIX_SSH=$OPT_LIBSSH
2113 dnl if given with a prefix, we set -L and -I based on that
2114 if test -n "$PREFIX_SSH"; then
2116 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2117 CPP_SSH=-I${PREFIX_SSH}/include
2118 DIR_SSH=${PREFIX_SSH}/lib$libsuff
2121 LDFLAGS="$LDFLAGS $LD_SSH"
2122 CPPFLAGS="$CPPFLAGS $CPP_SSH"
2123 LIBS="$LIB_SSH $LIBS"
2125 AC_CHECK_LIB(ssh, ssh_new)
2127 AC_CHECK_HEADERS(libssh/libssh.h,
2128 curl_ssh_msg="enabled (libSSH)"
2130 AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
2131 AC_SUBST(USE_LIBSSH, [1])
2134 if test X"$OPT_LIBSSH" != Xoff &&
2135 test "$LIBSSH_ENABLED" != "1"; then
2136 AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
2139 if test "$LIBSSH_ENABLED" = "1"; then
2140 if test -n "$DIR_SSH"; then
2141 dnl when the libssh shared libs were found in a path that the run-time
2142 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2143 dnl to prevent further configure tests to fail due to this
2145 if test "x$cross_compiling" != "xyes"; then
2146 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
2147 export CURL_LIBRARY_PATH
2148 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
2152 dnl no libssh, revert back to clean variables
2153 LDFLAGS=$CLEANLDFLAGS
2154 CPPFLAGS=$CLEANCPPFLAGS
2157 elif test X"$OPT_WOLFSSH" != Xno; then
2158 dnl backup the pre-wolfssh variables
2159 CLEANLDFLAGS="$LDFLAGS"
2160 CLEANCPPFLAGS="$CPPFLAGS"
2164 if test "$OPT_WOLFSSH" != yes; then
2165 WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
2166 LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
2167 CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
2170 AC_CHECK_LIB(wolfssh, wolfSSH_Init)
2172 AC_CHECK_HEADERS(wolfssh/ssh.h,
2173 curl_ssh_msg="enabled (wolfSSH)"
2175 AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
2176 AC_SUBST(USE_WOLFSSH, [1])
2181 dnl **********************************************************************
2182 dnl Check for the presence of LIBRTMP libraries and headers
2183 dnl **********************************************************************
2185 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2187 AC_ARG_WITH(librtmp,dnl
2188 AS_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2189 AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2190 OPT_LIBRTMP=$withval)
2192 if test X"$OPT_LIBRTMP" != Xno; then
2193 dnl backup the pre-librtmp variables
2194 CLEANLDFLAGS="$LDFLAGS"
2195 CLEANCPPFLAGS="$CPPFLAGS"
2198 case "$OPT_LIBRTMP" in
2200 dnl --with-librtmp (without path) used
2201 CURL_CHECK_PKGCONFIG(librtmp)
2203 if test "$PKGCONFIG" != "no" ; then
2204 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2205 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2206 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2207 version=`$PKGCONFIG --modversion librtmp`
2208 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
2210 dnl To avoid link errors, we do not allow --librtmp without
2211 dnl a pkgconfig file
2212 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2217 dnl no --with-librtmp option given, just check default places
2221 dnl use the given --with-librtmp spot
2223 PREFIX_RTMP=$OPT_LIBRTMP
2227 dnl if given with a prefix, we set -L and -I based on that
2228 if test -n "$PREFIX_RTMP"; then
2229 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
2230 CPP_RTMP=-I${PREFIX_RTMP}/include
2231 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
2234 LDFLAGS="$LDFLAGS $LD_RTMP"
2235 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2236 LIBS="$LIB_RTMP $LIBS"
2238 AC_CHECK_LIB(rtmp, RTMP_Init,
2240 AC_CHECK_HEADERS(librtmp/rtmp.h,
2241 curl_rtmp_msg="enabled (librtmp)"
2243 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
2244 AC_SUBST(USE_LIBRTMP, [1])
2247 dnl not found, revert back to clean variables
2248 LDFLAGS=$CLEANLDFLAGS
2249 CPPFLAGS=$CLEANCPPFLAGS
2253 if test X"$OPT_LIBRTMP" != Xoff &&
2254 test "$LIBRTMP_ENABLED" != "1"; then
2255 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
2260 dnl **********************************************************************
2261 dnl Check for linker switch for versioned symbols
2262 dnl **********************************************************************
2264 versioned_symbols_flavour=
2265 AC_MSG_CHECKING([whether versioned symbols are wanted])
2266 AC_ARG_ENABLE(versioned-symbols,
2267 AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2268 AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2269 [ case "$enableval" in
2270 yes) AC_MSG_RESULT(yes)
2271 AC_MSG_CHECKING([if libraries can be versioned])
2272 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
2273 if test -z "$GLD"; then
2275 AC_MSG_WARN([You need an ld version supporting the --version-script option])
2278 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
2279 versioned_symbols_flavour="MULTISSL_"
2280 elif test "x$OPENSSL_ENABLED" = "x1"; then
2281 versioned_symbols_flavour="OPENSSL_"
2282 elif test "x$GNUTLS_ENABLED" = "x1"; then
2283 versioned_symbols_flavour="GNUTLS_"
2284 elif test "x$NSS_ENABLED" = "x1"; then
2285 versioned_symbols_flavour="NSS_"
2286 elif test "x$WOLFSSL_ENABLED" = "x1"; then
2287 versioned_symbols_flavour="WOLFSSL_"
2288 elif test "x$SCHANNEL_ENABLED" = "x1"; then
2289 versioned_symbols_flavour="SCHANNEL_"
2290 elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
2291 versioned_symbols_flavour="SECURE_TRANSPORT_"
2293 versioned_symbols_flavour=""
2295 versioned_symbols="yes"
2299 *) AC_MSG_RESULT(no)
2307 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
2308 ["$versioned_symbols_flavour"])
2309 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
2310 [test "x$versioned_symbols" = 'xyes'])
2312 dnl -------------------------------------------------
2313 dnl check winidn option before other IDN libraries
2314 dnl -------------------------------------------------
2316 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
2317 OPT_WINIDN="default"
2319 AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
2320 AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
2321 OPT_WINIDN=$withval)
2322 case "$OPT_WINIDN" in
2324 dnl --without-winidn option used or configure option not specified
2329 dnl --with-winidn option used without path
2331 want_winidn_path="default"
2332 AC_MSG_RESULT([yes])
2335 dnl --with-winidn option used with path
2337 want_winidn_path="$withval"
2338 AC_MSG_RESULT([yes ($withval)])
2342 if test "$want_winidn" = "yes"; then
2343 dnl winidn library support has been requested
2344 clean_CFLAGS="$CFLAGS"
2345 clean_CPPFLAGS="$CPPFLAGS"
2346 clean_LDFLAGS="$LDFLAGS"
2348 WINIDN_LIBS="-lnormaliz"
2351 if test "$want_winidn_path" != "default"; then
2352 dnl path has been specified
2353 dnl pkg-config not available or provides no info
2354 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
2355 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
2356 WINIDN_DIR="$want_winidn_path/lib$libsuff"
2359 dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
2362 #include <windows.h>
2364 #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
2370 CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2371 CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2372 CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2373 CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2374 WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
2377 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
2378 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
2379 LIBS="$WINIDN_LIBS $LIBS"
2381 AC_MSG_CHECKING([if IdnToUnicode can be linked])
2384 #include <windows.h>
2386 IdnToUnicode(0, NULL, 0, NULL, 0);
2389 AC_MSG_RESULT([yes])
2390 tst_links_winidn="yes"
2393 tst_links_winidn="no"
2396 if test "$tst_links_winidn" = "yes"; then
2397 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
2398 AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
2399 AC_SUBST([IDN_ENABLED], [1])
2400 curl_idn_msg="enabled (Windows-native)"
2402 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2403 CFLAGS="$clean_CFLAGS"
2404 CPPFLAGS="$clean_CPPFLAGS"
2405 LDFLAGS="$clean_LDFLAGS"
2410 dnl **********************************************************************
2411 dnl Check for the presence of IDN libraries and headers
2412 dnl **********************************************************************
2414 AC_MSG_CHECKING([whether to build with libidn2])
2416 AC_ARG_WITH(libidn2,
2417 AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
2418 AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2422 dnl --without-libidn2 option used
2427 dnl configure option not specified
2429 want_idn_path="default"
2430 AC_MSG_RESULT([(assumed) yes])
2433 dnl --with-libidn2 option used without path
2435 want_idn_path="default"
2436 AC_MSG_RESULT([yes])
2439 dnl --with-libidn2 option used with path
2441 want_idn_path="$withval"
2442 AC_MSG_RESULT([yes ($withval)])
2446 if test "$want_idn" = "yes"; then
2447 dnl idn library support has been requested
2448 clean_CPPFLAGS="$CPPFLAGS"
2449 clean_LDFLAGS="$LDFLAGS"
2453 if test "$want_idn_path" != "default"; then
2454 dnl path has been specified
2455 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2456 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
2457 if test "$PKGCONFIG" != "no"; then
2458 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2459 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2460 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2461 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2462 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2463 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2464 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2466 dnl pkg-config not available or provides no info
2468 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2469 IDN_CPPFLAGS="-I$want_idn_path/include"
2470 IDN_DIR="$want_idn_path/lib$libsuff"
2473 dnl path not specified
2474 CURL_CHECK_PKGCONFIG(libidn2)
2475 if test "$PKGCONFIG" != "no"; then
2476 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2477 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2478 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2479 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2481 dnl pkg-config not available or provides no info
2486 if test "$PKGCONFIG" != "no"; then
2487 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2488 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2489 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2490 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2492 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2493 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2494 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2495 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2498 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
2499 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
2500 LIBS="$IDN_LIBS $LIBS"
2502 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
2504 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
2506 AC_MSG_RESULT([yes])
2507 tst_links_libidn="yes"
2510 tst_links_libidn="no"
2513 AC_CHECK_HEADERS( idn2.h )
2515 if test "$tst_links_libidn" = "yes"; then
2516 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
2517 dnl different versions of libidn have different setups of these:
2519 AC_SUBST([IDN_ENABLED], [1])
2520 curl_idn_msg="enabled (libidn2)"
2521 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2522 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
2523 export CURL_LIBRARY_PATH
2524 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
2527 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2528 CPPFLAGS="$clean_CPPFLAGS"
2529 LDFLAGS="$clean_LDFLAGS"
2534 dnl **********************************************************************
2535 dnl Check for nghttp2
2536 dnl **********************************************************************
2540 if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
2541 # without HTTP or with Hyper, nghttp2 is no use
2545 AC_ARG_WITH(nghttp2,
2546 AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
2547 AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2551 dnl --without-nghttp2 option used
2555 dnl --with-nghttp2 option used without path
2556 want_nghttp2="default"
2557 want_nghttp2_path=""
2560 dnl --with-nghttp2 option used with path
2562 want_nghttp2_path="$withval/lib/pkgconfig"
2566 if test X"$want_nghttp2" != Xno; then
2567 dnl backup the pre-nghttp2 variables
2568 CLEANLDFLAGS="$LDFLAGS"
2569 CLEANCPPFLAGS="$CPPFLAGS"
2572 CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_path)
2574 if test "$PKGCONFIG" != "no" ; then
2575 LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path])
2576 $PKGCONFIG --libs-only-l libnghttp2`
2577 AC_MSG_NOTICE([-l is $LIB_H2])
2579 CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path]) dnl
2580 $PKGCONFIG --cflags-only-I libnghttp2`
2581 AC_MSG_NOTICE([-I is $CPP_H2])
2583 LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path])
2584 $PKGCONFIG --libs-only-L libnghttp2`
2585 AC_MSG_NOTICE([-L is $LD_H2])
2587 LDFLAGS="$LDFLAGS $LD_H2"
2588 CPPFLAGS="$CPPFLAGS $CPP_H2"
2589 LIBS="$LIB_H2 $LIBS"
2591 # use nghttp2_session_set_local_window_size to require nghttp2
2593 AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
2595 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
2596 curl_h2_msg="enabled (nghttp2)"
2598 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
2599 AC_SUBST(USE_NGHTTP2, [1])
2602 dnl not found, revert back to clean variables
2603 LDFLAGS=$CLEANLDFLAGS
2604 CPPFLAGS=$CLEANCPPFLAGS
2609 dnl no nghttp2 pkg-config found, deal with it
2610 if test X"$want_nghttp2" != Xdefault; then
2611 dnl To avoid link errors, we do not allow --with-nghttp2 without
2612 dnl a pkgconfig file
2613 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2619 dnl **********************************************************************
2620 dnl Check for ngtcp2 (QUIC)
2621 dnl **********************************************************************
2625 if test "x$disable_http" = "xyes"; then
2626 # without HTTP, ngtcp2 is no use
2631 AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
2632 AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
2633 [OPT_TCP2=$withval])
2636 dnl --without-ngtcp2 option used
2640 dnl --with-ngtcp2 option used without path
2645 dnl --with-ngtcp2 option used with path
2647 want_tcp2_path="$withval/lib/pkgconfig"
2651 curl_tcp2_msg="no (--with-ngtcp2)"
2652 if test X"$want_tcp2" != Xno; then
2653 dnl backup the pre-ngtcp2 variables
2654 CLEANLDFLAGS="$LDFLAGS"
2655 CLEANCPPFLAGS="$CPPFLAGS"
2658 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
2660 if test "$PKGCONFIG" != "no" ; then
2661 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2662 $PKGCONFIG --libs-only-l libngtcp2`
2663 AC_MSG_NOTICE([-l is $LIB_TCP2])
2665 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2666 $PKGCONFIG --cflags-only-I libngtcp2`
2667 AC_MSG_NOTICE([-I is $CPP_TCP2])
2669 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2670 $PKGCONFIG --libs-only-L libngtcp2`
2671 AC_MSG_NOTICE([-L is $LD_TCP2])
2673 LDFLAGS="$LDFLAGS $LD_TCP2"
2674 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
2675 LIBS="$LIB_TCP2 $LIBS"
2677 if test "x$cross_compiling" != "xyes"; then
2678 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
2680 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
2682 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
2684 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
2685 AC_SUBST(USE_NGTCP2, [1])
2686 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
2687 export CURL_LIBRARY_PATH
2688 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
2691 dnl not found, revert back to clean variables
2692 LDFLAGS=$CLEANLDFLAGS
2693 CPPFLAGS=$CLEANCPPFLAGS
2698 dnl no ngtcp2 pkg-config found, deal with it
2699 if test X"$want_tcp2" != Xdefault; then
2700 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2701 dnl a pkgconfig file
2702 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
2708 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
2709 dnl backup the pre-ngtcp2_crypto_openssl variables
2710 CLEANLDFLAGS="$LDFLAGS"
2711 CLEANCPPFLAGS="$CPPFLAGS"
2714 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
2716 if test "$PKGCONFIG" != "no" ; then
2717 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2718 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
2719 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
2721 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2722 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
2723 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
2725 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2726 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
2727 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
2729 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
2730 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
2731 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
2733 if test "x$cross_compiling" != "xyes"; then
2734 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
2736 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
2738 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2740 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
2741 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
2742 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
2743 export CURL_LIBRARY_PATH
2744 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
2747 dnl not found, revert back to clean variables
2748 LDFLAGS=$CLEANLDFLAGS
2749 CPPFLAGS=$CLEANCPPFLAGS
2754 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
2755 if test X"$want_tcp2" != Xdefault; then
2756 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2757 dnl a pkgconfig file
2758 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
2763 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
2764 dnl backup the pre-ngtcp2_crypto_gnutls variables
2765 CLEANLDFLAGS="$LDFLAGS"
2766 CLEANCPPFLAGS="$CPPFLAGS"
2769 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
2771 if test "$PKGCONFIG" != "no" ; then
2772 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2773 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
2774 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
2776 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2777 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
2778 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
2780 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2781 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
2782 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
2784 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
2785 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
2786 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
2788 if test "x$cross_compiling" != "xyes"; then
2789 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
2791 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_ctx_initial,
2793 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2795 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
2796 AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
2797 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
2798 export CURL_LIBRARY_PATH
2799 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
2802 dnl not found, revert back to clean variables
2803 LDFLAGS=$CLEANLDFLAGS
2804 CPPFLAGS=$CLEANCPPFLAGS
2809 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
2810 if test X"$want_tcp2" != Xdefault; then
2811 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2812 dnl a pkgconfig file
2813 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
2818 dnl **********************************************************************
2819 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
2820 dnl **********************************************************************
2824 if test "x$NGTCP2_ENABLED" = "x"; then
2825 # without ngtcp2, nghttp3 is of no use for us
2829 AC_ARG_WITH(nghttp3,
2830 AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
2831 AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
2832 [OPT_NGHTTP3=$withval])
2833 case "$OPT_NGHTTP3" in
2835 dnl --without-nghttp3 option used
2839 dnl --with-nghttp3 option used without path
2840 want_nghttp3="default"
2841 want_nghttp3_path=""
2844 dnl --with-nghttp3 option used with path
2846 want_nghttp3_path="$withval/lib/pkgconfig"
2850 curl_http3_msg="no (--with-nghttp3)"
2851 if test X"$want_nghttp3" != Xno; then
2852 dnl backup the pre-nghttp3 variables
2853 CLEANLDFLAGS="$LDFLAGS"
2854 CLEANCPPFLAGS="$CPPFLAGS"
2857 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
2859 if test "$PKGCONFIG" != "no" ; then
2860 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
2861 $PKGCONFIG --libs-only-l libnghttp3`
2862 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
2864 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
2865 $PKGCONFIG --cflags-only-I libnghttp3`
2866 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
2868 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
2869 $PKGCONFIG --libs-only-L libnghttp3`
2870 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
2872 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
2873 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
2874 LIBS="$LIB_NGHTTP3 $LIBS"
2876 if test "x$cross_compiling" != "xyes"; then
2877 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
2879 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
2881 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
2882 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
2884 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
2885 AC_SUBST(USE_NGHTTP3, [1])
2886 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
2887 export CURL_LIBRARY_PATH
2888 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
2889 experimental="$experimental HTTP3"
2892 dnl not found, revert back to clean variables
2893 LDFLAGS=$CLEANLDFLAGS
2894 CPPFLAGS=$CLEANCPPFLAGS
2899 dnl no nghttp3 pkg-config found, deal with it
2900 if test X"$want_nghttp3" != Xdefault; then
2901 dnl To avoid link errors, we do not allow --with-nghttp3 without
2902 dnl a pkgconfig file
2903 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
2909 dnl **********************************************************************
2910 dnl Check for quiche (QUIC)
2911 dnl **********************************************************************
2915 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
2916 # without HTTP or with ngtcp2, quiche is no use
2921 AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
2922 AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
2923 [OPT_QUICHE=$withval])
2924 case "$OPT_QUICHE" in
2926 dnl --without-quiche option used
2930 dnl --with-quiche option used without path
2931 want_quiche="default"
2935 dnl --with-quiche option used with path
2937 want_quiche_path="$withval"
2941 if test X"$want_quiche" != Xno; then
2943 if test "$NGHTTP3_ENABLED" = 1; then
2944 AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
2947 dnl backup the pre-quiche variables
2948 CLEANLDFLAGS="$LDFLAGS"
2949 CLEANCPPFLAGS="$CPPFLAGS"
2952 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
2954 if test "$PKGCONFIG" != "no" ; then
2955 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
2956 $PKGCONFIG --libs-only-l quiche`
2957 AC_MSG_NOTICE([-l is $LIB_QUICHE])
2959 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
2960 $PKGCONFIG --cflags-only-I quiche`
2961 AC_MSG_NOTICE([-I is $CPP_QUICHE])
2963 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
2964 $PKGCONFIG --libs-only-L quiche`
2965 AC_MSG_NOTICE([-L is $LD_QUICHE])
2967 LDFLAGS="$LDFLAGS $LD_QUICHE"
2968 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
2969 LIBS="$LIB_QUICHE $LIBS"
2971 if test "x$cross_compiling" != "xyes"; then
2972 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
2974 AC_CHECK_LIB(quiche, quiche_connect,
2976 AC_CHECK_HEADERS(quiche.h,
2977 experimental="$experimental HTTP3"
2978 AC_MSG_NOTICE([HTTP3 support is experimental])
2979 curl_h3_msg="enabled (quiche)"
2981 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
2982 AC_SUBST(USE_QUICHE, [1])
2983 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
2984 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
2985 export CURL_LIBRARY_PATH
2986 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
2990 #include <sys/socket.h>
2994 dnl not found, revert back to clean variables
2995 AC_MSG_ERROR([couldn't use quiche])
2998 dnl no quiche pkg-config found, deal with it
2999 if test X"$want_quiche" != Xdefault; then
3000 dnl To avoid link errors, we do not allow --with-quiche without
3001 dnl a pkgconfig file
3002 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3007 dnl **********************************************************************
3008 dnl Check for zsh completion path
3009 dnl **********************************************************************
3011 OPT_ZSH_FPATH=default
3012 AC_ARG_WITH(zsh-functions-dir,
3013 AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3014 AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3015 [OPT_ZSH_FPATH=$withval])
3016 case "$OPT_ZSH_FPATH" in
3018 dnl --without-zsh-functions-dir option used
3021 dnl --with-zsh-functions-dir option used without path
3022 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3023 AC_SUBST(ZSH_FUNCTIONS_DIR)
3026 dnl --with-zsh-functions-dir option used with path
3027 ZSH_FUNCTIONS_DIR="$withval"
3028 AC_SUBST(ZSH_FUNCTIONS_DIR)
3032 dnl **********************************************************************
3033 dnl Check for fish completion path
3034 dnl **********************************************************************
3036 OPT_FISH_FPATH=default
3037 AC_ARG_WITH(fish-functions-dir,
3038 AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3039 AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3040 [OPT_FISH_FPATH=$withval])
3041 case "$OPT_FISH_FPATH" in
3043 dnl --without-fish-functions-dir option used
3046 dnl --with-fish-functions-dir option used without path
3047 CURL_CHECK_PKGCONFIG(fish)
3048 if test "$PKGCONFIG" != "no" ; then
3049 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
3051 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3053 AC_SUBST(FISH_FUNCTIONS_DIR)
3056 dnl --with-fish-functions-dir option used with path
3057 FISH_FUNCTIONS_DIR="$withval"
3058 AC_SUBST(FISH_FUNCTIONS_DIR)
3062 CURL_CHECK_HEADER_MALLOC
3063 CURL_CHECK_HEADER_MEMORY
3065 dnl Now check for the very most basic headers. Then we can use these
3066 dnl ones as default-headers when checking for the rest!
3108 dnl to do if not found
3112 dnl default includes
3114 #ifdef HAVE_SYS_TYPES_H
3115 #include <sys/types.h>
3117 #ifdef HAVE_SYS_TIME_H
3118 #include <sys/time.h>
3120 #ifdef HAVE_SYS_SELECT_H
3121 #include <sys/select.h>
3122 #elif defined(HAVE_UNISTD_H)
3125 #ifdef HAVE_SYS_SOCKET_H
3126 #include <sys/socket.h>
3128 #ifdef HAVE_NETINET_IN_H
3129 #include <netinet/in.h>
3131 #ifdef HAVE_NETINET_IN6_H
3132 #include <netinet/in6.h>
3134 #ifdef HAVE_SYS_UN_H
3141 dnl Checks for typedefs, structures, and compiler characteristics.
3143 CURL_CHECK_VARIADIC_MACROS
3146 CURL_CHECK_STRUCT_TIMEVAL
3147 CURL_VERIFY_RUNTIMELIBS
3149 AX_COMPILE_CHECK_SIZEOF(size_t)
3150 AX_COMPILE_CHECK_SIZEOF(long)
3151 AX_COMPILE_CHECK_SIZEOF(int)
3152 AX_COMPILE_CHECK_SIZEOF(short)
3153 AX_COMPILE_CHECK_SIZEOF(time_t)
3154 AX_COMPILE_CHECK_SIZEOF(off_t)
3157 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3158 AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
3159 #include <curl/system.h>
3163 AC_CHECK_TYPE(long long,
3164 [AC_DEFINE(HAVE_LONGLONG, 1,
3165 [Define to 1 if the compiler supports the 'long long' data type.])]
3169 if test "xyes" = "x$longlong"; then
3170 AC_MSG_CHECKING([if numberLL works])
3174 long long val = 1000LL;
3177 AC_MSG_RESULT([yes])
3178 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
3186 AC_CHECK_TYPE(ssize_t, ,
3187 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3189 # check for bool type
3190 AC_CHECK_TYPE([bool],[
3191 AC_DEFINE(HAVE_BOOL_T, 1,
3192 [Define to 1 if bool is an available type.])
3194 #ifdef HAVE_SYS_TYPES_H
3195 #include <sys/types.h>
3197 #ifdef HAVE_STDBOOL_H
3198 #include <stdbool.h>
3202 # check for sa_family_t
3203 AC_CHECK_TYPE(sa_family_t,
3204 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3207 AC_CHECK_TYPE(ADDRESS_FAMILY,
3208 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3209 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3211 #ifdef HAVE_SYS_SOCKET_H
3212 #include <sys/socket.h>
3217 #ifdef HAVE_SYS_SOCKET_H
3218 #include <sys/socket.h>
3222 # check for suseconds_t
3223 AC_CHECK_TYPE([suseconds_t],[
3224 AC_DEFINE(HAVE_SUSECONDS_T, 1,
3225 [Define to 1 if suseconds_t is an available type.])
3227 #ifdef HAVE_SYS_TYPES_H
3228 #include <sys/types.h>
3230 #ifdef HAVE_SYS_TIME_H
3231 #include <sys/time.h>
3235 AC_MSG_CHECKING([if time_t is unsigned])
3243 AC_MSG_RESULT([yes])
3244 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3248 dnl cross-compiling, most systems are unsigned
3252 CURL_CONFIGURE_PULL_SYS_POLL
3256 TYPE_SOCKADDR_STORAGE
3258 CURL_CHECK_FUNC_SELECT
3260 CURL_CHECK_FUNC_RECV
3261 CURL_CHECK_FUNC_SEND
3262 CURL_CHECK_MSG_NOSIGNAL
3264 CURL_CHECK_FUNC_ALARM
3265 CURL_CHECK_FUNC_BASENAME
3266 CURL_CHECK_FUNC_CLOSESOCKET
3267 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3268 CURL_CHECK_FUNC_CONNECT
3269 CURL_CHECK_FUNC_FCNTL
3270 CURL_CHECK_FUNC_FREEADDRINFO
3271 CURL_CHECK_FUNC_FSETXATTR
3272 CURL_CHECK_FUNC_FTRUNCATE
3273 CURL_CHECK_FUNC_GETADDRINFO
3274 CURL_CHECK_FUNC_GETHOSTBYNAME
3275 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3276 CURL_CHECK_FUNC_GETHOSTNAME
3277 CURL_CHECK_FUNC_GETPEERNAME
3278 CURL_CHECK_FUNC_GETSOCKNAME
3279 CURL_CHECK_FUNC_IF_NAMETOINDEX
3280 CURL_CHECK_FUNC_GETIFADDRS
3281 CURL_CHECK_FUNC_GMTIME_R
3282 CURL_CHECK_FUNC_INET_NTOP
3283 CURL_CHECK_FUNC_INET_PTON
3284 CURL_CHECK_FUNC_IOCTL
3285 CURL_CHECK_FUNC_IOCTLSOCKET
3286 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3287 CURL_CHECK_FUNC_LOCALTIME_R
3288 CURL_CHECK_FUNC_MEMRCHR
3289 CURL_CHECK_FUNC_POLL
3290 CURL_CHECK_FUNC_SETSOCKOPT
3291 CURL_CHECK_FUNC_SIGACTION
3292 CURL_CHECK_FUNC_SIGINTERRUPT
3293 CURL_CHECK_FUNC_SIGNAL
3294 CURL_CHECK_FUNC_SIGSETJMP
3295 CURL_CHECK_FUNC_SOCKET
3296 CURL_CHECK_FUNC_SOCKETPAIR
3297 CURL_CHECK_FUNC_STRCASECMP
3298 CURL_CHECK_FUNC_STRCMPI
3299 CURL_CHECK_FUNC_STRDUP
3300 CURL_CHECK_FUNC_STRERROR_R
3301 CURL_CHECK_FUNC_STRICMP
3302 CURL_CHECK_FUNC_STRNCMPI
3303 CURL_CHECK_FUNC_STRNICMP
3304 CURL_CHECK_FUNC_STRSTR
3305 CURL_CHECK_FUNC_STRTOK_R
3306 CURL_CHECK_FUNC_STRTOLL
3307 CURL_CHECK_FUNC_WRITEV
3313 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3317 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
3319 #include <sys/types.h>]])
3322 AC_CHECK_FUNCS([fnmatch \
3331 mach_absolute_time \
3342 eval skipcheck=\$skipcheck_$func
3343 if test "x$skipcheck" != "xyes"; then
3344 AC_MSG_CHECKING([deeper for $func])
3351 AC_MSG_RESULT([yes])
3352 eval "ac_cv_func_$func=yes"
3353 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3354 [Define to 1 if you have the $func function.])
3356 AC_MSG_RESULT([but still no])
3361 CURL_CHECK_NONBLOCKING_SOCKET
3363 dnl ************************************************************
3364 dnl nroff tool stuff
3367 AC_PATH_PROG( PERL, perl, ,
3368 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3371 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3372 $PATH:/usr/bin/:/usr/local/bin )
3375 if test -n "$NROFF"; then
3376 dnl only check for nroff options if an nroff command was found
3378 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3380 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3381 if test -z "$mancheck"; then
3383 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3384 if test -z "$mancheck"; then
3386 AC_MSG_RESULT([failed])
3387 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3389 AC_MSG_RESULT([$MANOPT])
3392 AC_MSG_RESULT([$MANOPT])
3397 if test -z "$MANOPT"
3399 dnl if no nroff tool was found, or no option that could convert man pages
3400 dnl was found, then disable the built-in manual stuff
3401 AC_MSG_WARN([disabling built-in manual])
3405 dnl *************************************************************************
3406 dnl If the manual variable still is set, then we go with providing a built-in
3409 if test "$USE_MANUAL" = "1"; then
3410 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3411 curl_manual_msg="enabled"
3414 dnl set variable for use in automakefile(s)
3415 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3418 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
3420 if test "x$curl_cv_native_windows" != "xyes" &&
3421 test "x$enable_shared" = "xyes"; then
3422 build_libhostname=yes
3424 build_libhostname=no
3426 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3428 if test "x$want_ares" != xyes; then
3429 CURL_CHECK_OPTION_THREADED_RESOLVER
3432 dnl ************************************************************
3433 dnl disable POSIX threads
3435 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3436 AC_ARG_ENABLE(pthreads,
3437 AS_HELP_STRING([--enable-pthreads],
3438 [Enable POSIX threads (default for threaded resolver)])
3439 AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3440 [ case "$enableval" in
3441 no) AC_MSG_RESULT(no)
3444 *) AC_MSG_RESULT(yes)
3453 dnl turn off pthreads if rt is disabled
3454 if test "$want_pthreads" != "no"; then
3455 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
3456 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
3458 if test "$dontwant_rt" != "no"; then
3459 dnl if --enable-pthreads was explicit then warn it's being ignored
3460 if test "$want_pthreads" = "yes"; then
3461 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
3467 dnl turn off pthreads if no threaded resolver
3468 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
3473 if test "$want_pthreads" != "no"; then
3474 AC_CHECK_HEADER(pthread.h,
3475 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3476 save_CFLAGS="$CFLAGS"
3477 dnl When statically linking against boringssl, -lpthread is added to LIBS.
3478 dnl Make sure to that this does not pass the check below, we really want
3479 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
3480 dnl lib1541 and lib1565 tests are built with these options. Otherwise
3481 dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
3485 dnl Check for libc variants without a separate pthread lib like bionic
3486 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3489 dnl on HPUX, life is more complicated...
3492 dnl it doesn't actually work without -lpthread
3493 USE_THREADS_POSIX=""
3499 dnl if it wasn't found without lib, search for it in pthread lib
3500 if test "$USE_THREADS_POSIX" != "1"
3502 CFLAGS="$CFLAGS -pthread"
3503 # assign PTHREAD for pkg-config use
3505 AC_CHECK_LIB(pthread, pthread_create,
3506 [USE_THREADS_POSIX=1],
3507 [ CFLAGS="$save_CFLAGS"])
3510 if test "x$USE_THREADS_POSIX" = "x1"
3512 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3513 curl_res_msg="POSIX threaded"
3518 dnl threaded resolver check
3519 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
3520 if test "$want_pthreads" = "yes"; then
3521 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
3523 dnl If native Windows fallback on Win32 threads since no POSIX threads
3524 if test "$curl_cv_native_windows" = "yes"; then
3526 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
3527 curl_res_msg="Win32 threaded"
3529 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
3533 CURL_CONVERT_INCLUDE_TO_ISYSTEM
3535 dnl ************************************************************
3536 dnl disable verbose text strings
3538 AC_MSG_CHECKING([whether to enable verbose strings])
3539 AC_ARG_ENABLE(verbose,
3540 AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
3541 AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3542 [ case "$enableval" in
3545 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3546 curl_verbose_msg="no"
3548 *) AC_MSG_RESULT(yes)
3554 dnl ************************************************************
3555 dnl enable SSPI support
3557 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3559 AS_HELP_STRING([--enable-sspi],[Enable SSPI])
3560 AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
3561 [ case "$enableval" in
3563 if test "$curl_cv_native_windows" = "yes"; then
3565 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3566 AC_SUBST(USE_WINDOWS_SSPI, [1])
3567 curl_sspi_msg="enabled"
3570 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3574 if test "x$SCHANNEL_ENABLED" = "x1"; then
3575 # --with-schannel implies --enable-sspi
3582 if test "x$SCHANNEL_ENABLED" = "x1"; then
3583 # --with-schannel implies --enable-sspi
3590 dnl ************************************************************
3591 dnl disable cryptographic authentication
3593 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3594 AC_ARG_ENABLE(crypto-auth,
3595 AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3596 AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3597 [ case "$enableval" in
3600 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3601 CURL_DISABLE_CRYPTO_AUTH=1
3603 *) AC_MSG_RESULT(yes)
3609 dnl ************************************************************
3610 dnl disable NTLM support
3612 AC_MSG_CHECKING([whether to support NTLM])
3614 AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
3615 AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
3616 [ case "$enableval" in
3619 AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
3622 *) AC_MSG_RESULT(yes)
3628 CURL_CHECK_OPTION_NTLM_WB
3632 dnl ************************************************************
3633 dnl disable TLS-SRP authentication
3635 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
3636 AC_ARG_ENABLE(tls-srp,
3637 AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
3638 AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
3639 [ case "$enableval" in
3644 *) AC_MSG_RESULT(yes)
3652 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
3653 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
3655 curl_tls_srp_msg="enabled"
3658 dnl ************************************************************
3659 dnl disable Unix domain sockets support
3661 AC_MSG_CHECKING([whether to enable Unix domain sockets])
3662 AC_ARG_ENABLE(unix-sockets,
3663 AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
3664 AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
3665 [ case "$enableval" in
3666 no) AC_MSG_RESULT(no)
3667 want_unix_sockets=no
3669 *) AC_MSG_RESULT(yes)
3670 want_unix_sockets=yes
3674 want_unix_sockets=auto
3677 if test "x$want_unix_sockets" != "xno"; then
3678 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
3679 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
3680 AC_SUBST(USE_UNIX_SOCKETS, [1])
3681 curl_unix_sockets_msg="enabled"
3683 if test "x$want_unix_sockets" = "xyes"; then
3684 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
3691 dnl ************************************************************
3692 dnl disable cookies support
3694 AC_MSG_CHECKING([whether to support cookies])
3695 AC_ARG_ENABLE(cookies,
3696 AS_HELP_STRING([--enable-cookies],[Enable cookies support])
3697 AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
3698 [ case "$enableval" in
3701 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
3703 *) AC_MSG_RESULT(yes)
3709 dnl ************************************************************
3710 dnl disable socketpair
3712 AC_MSG_CHECKING([whether to support socketpair])
3713 AC_ARG_ENABLE(socketpair,
3714 AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
3715 AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
3716 [ case "$enableval" in
3719 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
3721 *) AC_MSG_RESULT(yes)
3727 dnl ************************************************************
3728 dnl disable HTTP authentication support
3730 AC_MSG_CHECKING([whether to support HTTP authentication])
3731 AC_ARG_ENABLE(http-auth,
3732 AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
3733 AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
3734 [ case "$enableval" in
3737 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
3739 *) AC_MSG_RESULT(yes)
3745 dnl ************************************************************
3746 dnl disable DoH support
3748 AC_MSG_CHECKING([whether to support DoH])
3750 AS_HELP_STRING([--enable-doh],[Enable DoH support])
3751 AS_HELP_STRING([--disable-doh],[Disable DoH support]),
3752 [ case "$enableval" in
3755 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
3757 *) AC_MSG_RESULT(yes)
3763 dnl ************************************************************
3764 dnl disable mime API support
3766 AC_MSG_CHECKING([whether to support the MIME API])
3768 AS_HELP_STRING([--enable-mime],[Enable mime API support])
3769 AS_HELP_STRING([--disable-mime],[Disable mime API support]),
3770 [ case "$enableval" in
3773 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
3775 *) AC_MSG_RESULT(yes)
3781 dnl ************************************************************
3782 dnl disable date parsing
3784 AC_MSG_CHECKING([whether to support date parsing])
3785 AC_ARG_ENABLE(dateparse,
3786 AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
3787 AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
3788 [ case "$enableval" in
3791 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
3793 *) AC_MSG_RESULT(yes)
3799 dnl ************************************************************
3802 AC_MSG_CHECKING([whether to support netrc parsing])
3803 AC_ARG_ENABLE(netrc,
3804 AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
3805 AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
3806 [ case "$enableval" in
3809 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
3811 *) AC_MSG_RESULT(yes)
3817 dnl ************************************************************
3818 dnl disable progress-meter
3820 AC_MSG_CHECKING([whether to support progress-meter])
3821 AC_ARG_ENABLE(progress-meter,
3822 AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
3823 AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
3824 [ case "$enableval" in
3827 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
3829 *) AC_MSG_RESULT(yes)
3835 dnl ************************************************************
3836 dnl disable shuffle DNS support
3838 AC_MSG_CHECKING([whether to support DNS shuffling])
3839 AC_ARG_ENABLE(dnsshuffle,
3840 AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
3841 AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
3842 [ case "$enableval" in
3845 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
3847 *) AC_MSG_RESULT(yes)
3853 dnl ************************************************************
3854 dnl disable the curl_easy_options API
3856 AC_MSG_CHECKING([whether to support curl_easy_option*])
3857 AC_ARG_ENABLE(get-easy-options,
3858 AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
3859 AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
3860 [ case "$enableval" in
3863 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
3865 *) AC_MSG_RESULT(yes)
3871 dnl ************************************************************
3872 dnl switch on/off alt-svc
3874 AC_MSG_CHECKING([whether to support alt-svc])
3875 AC_ARG_ENABLE(alt-svc,
3876 AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
3877 AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
3878 [ case "$enableval" in
3881 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
3882 curl_altsvc_msg="no";
3885 *) AC_MSG_RESULT(yes)
3891 dnl only check for HSTS if there's SSL present
3892 if test -n "$SSL_ENABLED"; then
3894 dnl ************************************************************
3895 dnl switch on/off hsts
3897 AC_MSG_CHECKING([whether to support HSTS])
3899 AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
3900 AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
3901 [ case "$enableval" in
3906 *) AC_MSG_RESULT(yes)
3909 AC_MSG_RESULT($hsts)
3912 AC_MSG_NOTICE([disables HSTS due to lack of SSL])
3916 if test "x$hsts" != "xyes"; then
3917 curl_hsts_msg="no (--enable-hsts)";
3918 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
3921 dnl *************************************************************
3922 dnl check whether ECH support, if desired, is actually available
3924 if test "x$want_ech" != "xno"; then
3925 AC_MSG_CHECKING([whether ECH support is available])
3927 dnl assume NOT and look for sufficient condition
3931 dnl OpenSSL with a chosen ECH function should be enough
3932 dnl so more exhaustive checking seems unnecessary for now
3933 if test "x$OPENSSL_ENABLED" = "x1"; then
3934 AC_CHECK_FUNCS(SSL_get_ech_status,
3935 ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
3938 dnl add 'elif' chain here for additional implementations
3941 dnl now deal with whatever we found
3942 if test "x$ECH_ENABLED" = "x1"; then
3943 AC_DEFINE(USE_ECH, 1, [if ECH support is available])
3944 AC_MSG_RESULT($ECH_SUPPORT)
3945 experimental="$experimental ECH"
3947 AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
3951 dnl ************************************************************
3952 dnl hiding of library internal symbols
3954 CURL_CONFIGURE_SYMBOL_HIDING
3957 dnl All the library dependencies put into $LIB apply to libcurl only.
3959 LIBCURL_LIBS="$LIBS$PTHREAD"
3961 AC_SUBST(LIBCURL_LIBS)
3962 AC_SUBST(CURL_NETWORK_LIBS)
3963 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
3965 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
3966 dnl LIBS variable used in generated makefile at makefile processing
3967 dnl time. Doing this functionally prevents LIBS from being used for
3968 dnl all link targets in given makefile.
3970 AC_SUBST(BLANK_AT_MAKETIME)
3972 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
3975 ENABLE_SHARED="$enable_shared"
3976 AC_SUBST(ENABLE_SHARED)
3978 dnl to let curl-config output the static libraries correctly
3979 ENABLE_STATIC="$enable_static"
3980 AC_SUBST(ENABLE_STATIC)
3982 dnl merge the pkg-config Libs.private field into Libs when static-only
3983 if test "x$enable_shared" = "xno"; then
3984 LIBCURL_NO_SHARED=$LIBCURL_LIBS
3988 AC_SUBST(LIBCURL_NO_SHARED)
3991 dnl For keeping supported features and protocols also in pkg-config file
3992 dnl since it is more cross-compile friendly than curl-config
3995 if test "x$OPENSSL_ENABLED" = "x1"; then
3996 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
3997 elif test -n "$SSL_ENABLED"; then
3998 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4000 if test "x$IPV6_ENABLED" = "x1"; then
4001 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4003 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4004 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4006 if test "x$HAVE_LIBZ" = "x1"; then
4007 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4009 if test "x$HAVE_BROTLI" = "x1"; then
4010 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4012 if test "x$HAVE_ZSTD" = "x1"; then
4013 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
4015 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4016 -o "x$USE_THREADS_WIN32" = "x1"; then
4017 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4019 if test "x$IDN_ENABLED" = "x1"; then
4020 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4022 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4023 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4026 if test "x$HAVE_GSSAPI" = "x1"; then
4027 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4030 if test "x$curl_psl_msg" = "xenabled"; then
4031 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4034 if test "x$curl_gsasl_msg" = "xenabled"; then
4035 SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
4038 if test "x$enable_altsvc" = "xyes"; then
4039 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4041 if test "x$hsts" = "xyes"; then
4042 SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
4045 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4046 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4047 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4050 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4051 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4052 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4055 use_curl_ntlm_core=no
4057 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4058 "x$CURL_DISABLE_NTLM" != "x1"; then
4059 if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4060 -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
4061 -o "x$SECURETRANSPORT_ENABLED" = "x1" \
4062 -o "x$USE_WIN32_CRYPTO" = "x1" \
4063 -o "x$WOLFSSL_NTLM" = "x1"; then
4064 use_curl_ntlm_core=yes
4067 if test "x$use_curl_ntlm_core" = "xyes" \
4068 -o "x$USE_WINDOWS_SSPI" = "x1"; then
4069 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4071 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4072 "x$NTLM_WB_ENABLED" = "x1"; then
4073 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4078 if test "x$USE_TLS_SRP" = "x1"; then
4079 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4082 if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
4083 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4086 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then
4087 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
4090 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4091 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4094 dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
4095 if test "x$https_proxy" != "xno"; then
4096 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4097 -o "x$NSS_ENABLED" = "x1"; then
4098 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4102 if test "x$ECH_ENABLED" = "x1"; then
4103 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
4106 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4107 if test ${ac_cv_sizeof_off_t} -gt 4 -o \
4108 "$curl_win32_file_api" = "win32_large_files"; then
4109 SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
4113 dnl replace spaces with newlines
4115 dnl replace the newlines back to spaces
4116 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
4117 AC_SUBST(SUPPORT_FEATURES)
4119 dnl For supported protocols in pkg-config file
4120 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4121 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4122 if test "x$SSL_ENABLED" = "x1"; then
4123 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4126 if test "x$CURL_DISABLE_FTP" != "x1"; then
4127 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4128 if test "x$SSL_ENABLED" = "x1"; then
4129 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4132 if test "x$CURL_DISABLE_FILE" != "x1"; then
4133 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4135 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4136 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4138 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4139 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4140 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4141 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4142 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4143 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4147 if test "x$CURL_DISABLE_DICT" != "x1"; then
4148 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4150 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4151 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4153 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4154 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4155 if test "x$SSL_ENABLED" = "x1"; then
4156 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
4159 if test "x$CURL_DISABLE_MQTT" != "x1"; then
4160 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
4162 if test "x$CURL_DISABLE_POP3" != "x1"; then
4163 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4164 if test "x$SSL_ENABLED" = "x1"; then
4165 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4168 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4169 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4170 if test "x$SSL_ENABLED" = "x1"; then
4171 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4174 if test "x$CURL_DISABLE_SMB" != "x1" \
4175 -a "x$use_curl_ntlm_core" = "xyes"; then
4176 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4177 if test "x$SSL_ENABLED" = "x1"; then
4178 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4181 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4182 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4183 if test "x$SSL_ENABLED" = "x1"; then
4184 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4187 if test "x$USE_LIBSSH2" = "x1"; then
4188 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4189 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4191 if test "x$USE_LIBSSH" = "x1"; then
4192 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4193 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4195 if test "x$USE_WOLFSSH" = "x1"; then
4196 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4198 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4199 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4201 if test "x$USE_LIBRTMP" = "x1"; then
4202 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4205 dnl replace spaces with newlines
4207 dnl replace the newlines back to spaces
4208 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4210 AC_SUBST(SUPPORT_PROTOCOLS)
4212 dnl squeeze whitespace out of some variables
4220 squeeze LIBCURL_LIBS
4221 squeeze CURL_NETWORK_LIBS
4222 squeeze CURL_NETWORK_AND_TIME_LIBS
4224 squeeze SUPPORT_FEATURES
4225 squeeze SUPPORT_PROTOCOLS
4227 XC_CHECK_BUILD_FLAGS
4229 SSL_BACKENDS=${ssl_backends}
4230 AC_SUBST(SSL_BACKENDS)
4232 if test "x$want_curldebug_assumed" = "xyes" &&
4233 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4234 ac_configure_args="$ac_configure_args --enable-curldebug"
4237 AC_CONFIG_FILES([Makefile \
4239 docs/examples/Makefile \
4240 docs/libcurl/Makefile \
4241 docs/libcurl/opts/Makefile \
4242 docs/cmdline-opts/Makefile \
4244 include/curl/Makefile \
4250 tests/certs/Makefile \
4251 tests/certs/scripts/Makefile \
4252 tests/data/Makefile \
4253 tests/server/Makefile \
4254 tests/libtest/Makefile \
4255 tests/unit/Makefile \
4257 packages/vms/Makefile \
4263 CURL_GENERATE_CONFIGUREHELP_PM
4265 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4267 AC_MSG_NOTICE([Configured to build curl/libcurl:
4270 Install prefix: ${prefix}
4273 CPPFLAGS: ${CPPFLAGS}
4277 curl version: ${CURLVERSION}
4278 SSL: ${curl_ssl_msg}
4279 SSH: ${curl_ssh_msg}
4280 zlib: ${curl_zlib_msg}
4281 brotli: ${curl_brotli_msg}
4282 zstd: ${curl_zstd_msg}
4283 GSS-API: ${curl_gss_msg}
4284 GSASL: ${curl_gsasl_msg}
4285 TLS-SRP: ${curl_tls_srp_msg}
4286 resolver: ${curl_res_msg}
4287 IPv6: ${curl_ipv6_msg}
4288 Unix sockets: ${curl_unix_sockets_msg}
4289 IDN: ${curl_idn_msg}
4290 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4291 Built-in manual: ${curl_manual_msg}
4292 --libcurl option: ${curl_libcurl_msg}
4293 Verbose errors: ${curl_verbose_msg}
4294 Code coverage: ${curl_coverage_msg}
4295 SSPI: ${curl_sspi_msg}
4296 ca cert bundle: ${ca}${ca_warning}
4297 ca cert path: ${capath}${capath_warning}
4298 ca fallback: ${with_ca_fallback}
4299 LDAP: ${curl_ldap_msg}
4300 LDAPS: ${curl_ldaps_msg}
4301 RTSP: ${curl_rtsp_msg}
4302 RTMP: ${curl_rtmp_msg}
4303 PSL: ${curl_psl_msg}
4304 Alt-svc: ${curl_altsvc_msg}
4305 HSTS: ${curl_hsts_msg}
4306 HTTP1: ${curl_h1_msg}
4307 HTTP2: ${curl_h2_msg}
4308 HTTP3: ${curl_h3_msg}
4309 ECH: ${curl_ech_msg}
4310 Protocols: ${SUPPORT_PROTOCOLS}
4311 Features: ${SUPPORT_FEATURES}
4313 if test -n "$experimental"; then
4315 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!