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 ICU-UC (IDN support)
2412 dnl **********************************************************************
2414 AC_MSG_CHECKING([whether to build with icu-uc])
2417 AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
2418 AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
2422 dnl --without-icu-uc option used
2427 dnl configure option not specified
2429 want_idn_path="default"
2430 AC_MSG_RESULT([(assumed) yes])
2433 dnl --with-icu-uc option used without path
2435 want_idn_path="default"
2436 AC_MSG_RESULT([yes])
2439 dnl --with-icu-uc 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(icu-uc, [$IDN_PCDIR])
2457 if test "$PKGCONFIG" != "no"; then
2458 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2459 $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
2460 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2461 $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
2462 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2463 $PKGCONFIG --cflags-only-I icu-uc 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(icu-uc)
2475 if test "$PKGCONFIG" != "no"; then
2476 IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
2477 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
2478 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 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="$IDN_CPPFLAGS $CPPFLAGS"
2499 LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
2500 LIBS="$IDN_LIBS $LIBS"
2502 AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
2504 AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
2506 AC_MSG_RESULT([yes])
2513 if test "$tst_links_icu" = "yes"; then
2514 AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
2515 dnl different versions of libidn have different setups of these:
2517 AC_SUBST([IDN_ENABLED], [1])
2518 curl_idn_msg="enabled (icu-uc)"
2519 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2520 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
2521 export LD_LIBRARY_PATH
2522 AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
2525 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2526 CPPFLAGS="$clean_CPPFLAGS"
2527 LDFLAGS="$clean_LDFLAGS"
2533 dnl **********************************************************************
2534 dnl Check for the presence of IDN libraries and headers
2535 dnl **********************************************************************
2537 AC_MSG_CHECKING([whether to build with libidn2])
2539 AC_ARG_WITH(libidn2,
2540 AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
2541 AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2545 dnl --without-libidn2 option used
2550 dnl configure option not specified
2552 want_idn_path="default"
2553 AC_MSG_RESULT([(assumed) yes])
2556 dnl --with-libidn2 option used without path
2558 want_idn_path="default"
2559 AC_MSG_RESULT([yes])
2562 dnl --with-libidn2 option used with path
2564 want_idn_path="$withval"
2565 AC_MSG_RESULT([yes ($withval)])
2569 if test "$want_idn" = "yes"; then
2570 dnl idn library support has been requested
2571 clean_CPPFLAGS="$CPPFLAGS"
2572 clean_LDFLAGS="$LDFLAGS"
2576 if test "$want_idn_path" != "default"; then
2577 dnl path has been specified
2578 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2579 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
2580 if test "$PKGCONFIG" != "no"; then
2581 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2582 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2583 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2584 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2585 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2586 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2587 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2589 dnl pkg-config not available or provides no info
2591 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2592 IDN_CPPFLAGS="-I$want_idn_path/include"
2593 IDN_DIR="$want_idn_path/lib$libsuff"
2596 dnl path not specified
2597 CURL_CHECK_PKGCONFIG(libidn2)
2598 if test "$PKGCONFIG" != "no"; then
2599 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2600 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2601 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2602 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2604 dnl pkg-config not available or provides no info
2609 if test "$PKGCONFIG" != "no"; then
2610 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2611 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2612 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2613 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2615 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2616 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2617 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2618 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2621 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
2622 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
2623 LIBS="$IDN_LIBS $LIBS"
2625 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
2627 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
2629 AC_MSG_RESULT([yes])
2630 tst_links_libidn="yes"
2633 tst_links_libidn="no"
2636 AC_CHECK_HEADERS( idn2.h )
2638 if test "$tst_links_libidn" = "yes"; then
2639 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
2640 dnl different versions of libidn have different setups of these:
2642 AC_SUBST([IDN_ENABLED], [1])
2643 curl_idn_msg="enabled (libidn2)"
2644 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2645 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
2646 export CURL_LIBRARY_PATH
2647 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
2650 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2651 CPPFLAGS="$clean_CPPFLAGS"
2652 LDFLAGS="$clean_LDFLAGS"
2657 dnl Let's hope this split URL remains working:
2658 dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
2659 dnl genprogc/thread_quick_ref.htm
2661 dnl **********************************************************************
2662 dnl Check for strict SSL check
2663 dnl **********************************************************************
2664 AC_ARG_ENABLE([strict-ssl-check],
2665 AS_HELP_STRING([--enable-strict-ssl-check], [Enable strict SSL check usage]),
2666 [enable_strict_ssl_check=yes],
2667 [enable_strict_ssl_check=no])
2669 AS_IF([test "x$enable_strict_ssl_check" = "xyes"], [
2670 CPPFLAGS+=" -DUSE_TIZEN_FEATURE_STRICT_SSL_CHECK"
2671 SUPPORT_TIZEN_FEATURES="$SUPPORT_TIZEN_FEATURES strict-ssl-check"
2674 AM_CONDITIONAL(USE_TIZEN_FEATURE_STRICT_SSL_CHECK, test "x$enable_strict_ssl_check" = "xyes")
2676 dnl **********************************************************************
2678 dnl **********************************************************************
2680 AC_ARG_ENABLE([dlp],
2681 AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
2683 AS_IF([test "x$enable_dlp" = "xyes"], [
2684 AC_DEFINE(HAVE_TIZEN_DLP, 1, [Enadle DLP])
2688 AM_CONDITIONAL(HAVE_TIZEN_DLP, test "x$enable_dlp" = "xyes")
2690 dnl **********************************************************************
2691 dnl Check for nghttp2
2692 dnl **********************************************************************
2696 if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
2697 # without HTTP or with Hyper, nghttp2 is no use
2701 AC_ARG_WITH(nghttp2,
2702 AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
2703 AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2707 dnl --without-nghttp2 option used
2711 dnl --with-nghttp2 option used without path
2712 want_nghttp2="default"
2713 want_nghttp2_path=""
2716 dnl --with-nghttp2 option used with path
2718 want_nghttp2_path="$withval/lib/pkgconfig"
2722 if test X"$want_nghttp2" != Xno; then
2723 dnl backup the pre-nghttp2 variables
2724 CLEANLDFLAGS="$LDFLAGS"
2725 CLEANCPPFLAGS="$CPPFLAGS"
2728 CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_path)
2730 if test "$PKGCONFIG" != "no" ; then
2731 LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path])
2732 $PKGCONFIG --libs-only-l libnghttp2`
2733 AC_MSG_NOTICE([-l is $LIB_H2])
2735 CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path]) dnl
2736 $PKGCONFIG --cflags-only-I libnghttp2`
2737 AC_MSG_NOTICE([-I is $CPP_H2])
2739 LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path])
2740 $PKGCONFIG --libs-only-L libnghttp2`
2741 AC_MSG_NOTICE([-L is $LD_H2])
2743 LDFLAGS="$LDFLAGS $LD_H2"
2744 CPPFLAGS="$CPPFLAGS $CPP_H2"
2745 LIBS="$LIB_H2 $LIBS"
2747 # use nghttp2_session_set_local_window_size to require nghttp2
2749 AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
2751 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
2752 curl_h2_msg="enabled (nghttp2)"
2754 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
2755 AC_SUBST(USE_NGHTTP2, [1])
2758 dnl not found, revert back to clean variables
2759 LDFLAGS=$CLEANLDFLAGS
2760 CPPFLAGS=$CLEANCPPFLAGS
2765 dnl no nghttp2 pkg-config found, deal with it
2766 if test X"$want_nghttp2" != Xdefault; then
2767 dnl To avoid link errors, we do not allow --with-nghttp2 without
2768 dnl a pkgconfig file
2769 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2775 dnl **********************************************************************
2776 dnl Check for ngtcp2 (QUIC)
2777 dnl **********************************************************************
2781 if test "x$disable_http" = "xyes"; then
2782 # without HTTP, ngtcp2 is no use
2787 AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
2788 AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
2789 [OPT_TCP2=$withval])
2792 dnl --without-ngtcp2 option used
2796 dnl --with-ngtcp2 option used without path
2801 dnl --with-ngtcp2 option used with path
2803 want_tcp2_path="$withval/lib/pkgconfig"
2807 curl_tcp2_msg="no (--with-ngtcp2)"
2808 if test X"$want_tcp2" != Xno; then
2809 dnl backup the pre-ngtcp2 variables
2810 CLEANLDFLAGS="$LDFLAGS"
2811 CLEANCPPFLAGS="$CPPFLAGS"
2814 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
2816 if test "$PKGCONFIG" != "no" ; then
2817 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2818 $PKGCONFIG --libs-only-l libngtcp2`
2819 AC_MSG_NOTICE([-l is $LIB_TCP2])
2821 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2822 $PKGCONFIG --cflags-only-I libngtcp2`
2823 AC_MSG_NOTICE([-I is $CPP_TCP2])
2825 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2826 $PKGCONFIG --libs-only-L libngtcp2`
2827 AC_MSG_NOTICE([-L is $LD_TCP2])
2829 LDFLAGS="$LDFLAGS $LD_TCP2"
2830 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
2831 LIBS="$LIB_TCP2 $LIBS"
2833 if test "x$cross_compiling" != "xyes"; then
2834 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
2836 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
2838 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
2840 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
2841 AC_SUBST(USE_NGTCP2, [1])
2842 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
2843 export CURL_LIBRARY_PATH
2844 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
2847 dnl not found, revert back to clean variables
2848 LDFLAGS=$CLEANLDFLAGS
2849 CPPFLAGS=$CLEANCPPFLAGS
2854 dnl no ngtcp2 pkg-config found, deal with it
2855 if test X"$want_tcp2" != Xdefault; then
2856 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2857 dnl a pkgconfig file
2858 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
2864 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
2865 dnl backup the pre-ngtcp2_crypto_openssl variables
2866 CLEANLDFLAGS="$LDFLAGS"
2867 CLEANCPPFLAGS="$CPPFLAGS"
2870 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
2872 if test "$PKGCONFIG" != "no" ; then
2873 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2874 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
2875 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
2877 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2878 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
2879 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
2881 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2882 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
2883 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
2885 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
2886 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
2887 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
2889 if test "x$cross_compiling" != "xyes"; then
2890 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
2892 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
2894 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2896 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
2897 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
2898 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
2899 export CURL_LIBRARY_PATH
2900 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
2903 dnl not found, revert back to clean variables
2904 LDFLAGS=$CLEANLDFLAGS
2905 CPPFLAGS=$CLEANCPPFLAGS
2910 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
2911 if test X"$want_tcp2" != Xdefault; then
2912 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2913 dnl a pkgconfig file
2914 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
2919 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
2920 dnl backup the pre-ngtcp2_crypto_gnutls variables
2921 CLEANLDFLAGS="$LDFLAGS"
2922 CLEANCPPFLAGS="$CPPFLAGS"
2925 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
2927 if test "$PKGCONFIG" != "no" ; then
2928 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2929 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
2930 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
2932 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2933 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
2934 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
2936 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2937 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
2938 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
2940 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
2941 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
2942 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
2944 if test "x$cross_compiling" != "xyes"; then
2945 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
2947 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_ctx_initial,
2949 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2951 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
2952 AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
2953 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
2954 export CURL_LIBRARY_PATH
2955 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
2958 dnl not found, revert back to clean variables
2959 LDFLAGS=$CLEANLDFLAGS
2960 CPPFLAGS=$CLEANCPPFLAGS
2965 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
2966 if test X"$want_tcp2" != Xdefault; then
2967 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2968 dnl a pkgconfig file
2969 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
2974 dnl **********************************************************************
2975 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
2976 dnl **********************************************************************
2980 if test "x$NGTCP2_ENABLED" = "x"; then
2981 # without ngtcp2, nghttp3 is of no use for us
2985 AC_ARG_WITH(nghttp3,
2986 AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
2987 AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
2988 [OPT_NGHTTP3=$withval])
2989 case "$OPT_NGHTTP3" in
2991 dnl --without-nghttp3 option used
2995 dnl --with-nghttp3 option used without path
2996 want_nghttp3="default"
2997 want_nghttp3_path=""
3000 dnl --with-nghttp3 option used with path
3002 want_nghttp3_path="$withval/lib/pkgconfig"
3006 curl_http3_msg="no (--with-nghttp3)"
3007 if test X"$want_nghttp3" != Xno; then
3008 dnl backup the pre-nghttp3 variables
3009 CLEANLDFLAGS="$LDFLAGS"
3010 CLEANCPPFLAGS="$CPPFLAGS"
3013 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3015 if test "$PKGCONFIG" != "no" ; then
3016 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3017 $PKGCONFIG --libs-only-l libnghttp3`
3018 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3020 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
3021 $PKGCONFIG --cflags-only-I libnghttp3`
3022 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3024 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3025 $PKGCONFIG --libs-only-L libnghttp3`
3026 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3028 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3029 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3030 LIBS="$LIB_NGHTTP3 $LIBS"
3032 if test "x$cross_compiling" != "xyes"; then
3033 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
3035 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
3037 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3038 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3040 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3041 AC_SUBST(USE_NGHTTP3, [1])
3042 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3043 export CURL_LIBRARY_PATH
3044 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3045 experimental="$experimental HTTP3"
3048 dnl not found, revert back to clean variables
3049 LDFLAGS=$CLEANLDFLAGS
3050 CPPFLAGS=$CLEANCPPFLAGS
3055 dnl no nghttp3 pkg-config found, deal with it
3056 if test X"$want_nghttp3" != Xdefault; then
3057 dnl To avoid link errors, we do not allow --with-nghttp3 without
3058 dnl a pkgconfig file
3059 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3065 dnl **********************************************************************
3066 dnl Check for quiche (QUIC)
3067 dnl **********************************************************************
3071 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3072 # without HTTP or with ngtcp2, quiche is no use
3077 AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
3078 AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
3079 [OPT_QUICHE=$withval])
3080 case "$OPT_QUICHE" in
3082 dnl --without-quiche option used
3086 dnl --with-quiche option used without path
3087 want_quiche="default"
3091 dnl --with-quiche option used with path
3093 want_quiche_path="$withval"
3097 if test X"$want_quiche" != Xno; then
3099 if test "$NGHTTP3_ENABLED" = 1; then
3100 AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
3103 dnl backup the pre-quiche variables
3104 CLEANLDFLAGS="$LDFLAGS"
3105 CLEANCPPFLAGS="$CPPFLAGS"
3108 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3110 if test "$PKGCONFIG" != "no" ; then
3111 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3112 $PKGCONFIG --libs-only-l quiche`
3113 AC_MSG_NOTICE([-l is $LIB_QUICHE])
3115 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
3116 $PKGCONFIG --cflags-only-I quiche`
3117 AC_MSG_NOTICE([-I is $CPP_QUICHE])
3119 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3120 $PKGCONFIG --libs-only-L quiche`
3121 AC_MSG_NOTICE([-L is $LD_QUICHE])
3123 LDFLAGS="$LDFLAGS $LD_QUICHE"
3124 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3125 LIBS="$LIB_QUICHE $LIBS"
3127 if test "x$cross_compiling" != "xyes"; then
3128 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
3130 AC_CHECK_LIB(quiche, quiche_connect,
3132 AC_CHECK_HEADERS(quiche.h,
3133 experimental="$experimental HTTP3"
3134 AC_MSG_NOTICE([HTTP3 support is experimental])
3135 curl_h3_msg="enabled (quiche)"
3137 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3138 AC_SUBST(USE_QUICHE, [1])
3139 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
3140 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3141 export CURL_LIBRARY_PATH
3142 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
3146 #include <sys/socket.h>
3150 dnl not found, revert back to clean variables
3151 AC_MSG_ERROR([couldn't use quiche])
3154 dnl no quiche pkg-config found, deal with it
3155 if test X"$want_quiche" != Xdefault; then
3156 dnl To avoid link errors, we do not allow --with-quiche without
3157 dnl a pkgconfig file
3158 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3163 dnl **********************************************************************
3164 dnl Check for zsh completion path
3165 dnl **********************************************************************
3167 OPT_ZSH_FPATH=default
3168 AC_ARG_WITH(zsh-functions-dir,
3169 AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3170 AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3171 [OPT_ZSH_FPATH=$withval])
3172 case "$OPT_ZSH_FPATH" in
3174 dnl --without-zsh-functions-dir option used
3177 dnl --with-zsh-functions-dir option used without path
3178 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3179 AC_SUBST(ZSH_FUNCTIONS_DIR)
3182 dnl --with-zsh-functions-dir option used with path
3183 ZSH_FUNCTIONS_DIR="$withval"
3184 AC_SUBST(ZSH_FUNCTIONS_DIR)
3188 dnl **********************************************************************
3189 dnl Check for fish completion path
3190 dnl **********************************************************************
3192 OPT_FISH_FPATH=default
3193 AC_ARG_WITH(fish-functions-dir,
3194 AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3195 AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3196 [OPT_FISH_FPATH=$withval])
3197 case "$OPT_FISH_FPATH" in
3199 dnl --without-fish-functions-dir option used
3202 dnl --with-fish-functions-dir option used without path
3203 CURL_CHECK_PKGCONFIG(fish)
3204 if test "$PKGCONFIG" != "no" ; then
3205 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
3207 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3209 AC_SUBST(FISH_FUNCTIONS_DIR)
3212 dnl --with-fish-functions-dir option used with path
3213 FISH_FUNCTIONS_DIR="$withval"
3214 AC_SUBST(FISH_FUNCTIONS_DIR)
3218 CURL_CHECK_HEADER_MALLOC
3219 CURL_CHECK_HEADER_MEMORY
3221 dnl Now check for the very most basic headers. Then we can use these
3222 dnl ones as default-headers when checking for the rest!
3264 dnl to do if not found
3268 dnl default includes
3270 #ifdef HAVE_SYS_TYPES_H
3271 #include <sys/types.h>
3273 #ifdef HAVE_SYS_TIME_H
3274 #include <sys/time.h>
3276 #ifdef HAVE_SYS_SELECT_H
3277 #include <sys/select.h>
3278 #elif defined(HAVE_UNISTD_H)
3281 #ifdef HAVE_SYS_SOCKET_H
3282 #include <sys/socket.h>
3284 #ifdef HAVE_NETINET_IN_H
3285 #include <netinet/in.h>
3287 #ifdef HAVE_NETINET_IN6_H
3288 #include <netinet/in6.h>
3290 #ifdef HAVE_SYS_UN_H
3297 dnl Checks for typedefs, structures, and compiler characteristics.
3299 CURL_CHECK_VARIADIC_MACROS
3302 CURL_CHECK_STRUCT_TIMEVAL
3303 CURL_VERIFY_RUNTIMELIBS
3305 AX_COMPILE_CHECK_SIZEOF(size_t)
3306 AX_COMPILE_CHECK_SIZEOF(long)
3307 AX_COMPILE_CHECK_SIZEOF(int)
3308 AX_COMPILE_CHECK_SIZEOF(short)
3309 AX_COMPILE_CHECK_SIZEOF(time_t)
3310 AX_COMPILE_CHECK_SIZEOF(off_t)
3313 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3314 AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
3315 #include <curl/system.h>
3319 AC_CHECK_TYPE(long long,
3320 [AC_DEFINE(HAVE_LONGLONG, 1,
3321 [Define to 1 if the compiler supports the 'long long' data type.])]
3325 if test "xyes" = "x$longlong"; then
3326 AC_MSG_CHECKING([if numberLL works])
3330 long long val = 1000LL;
3333 AC_MSG_RESULT([yes])
3334 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
3342 AC_CHECK_TYPE(ssize_t, ,
3343 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3345 # check for bool type
3346 AC_CHECK_TYPE([bool],[
3347 AC_DEFINE(HAVE_BOOL_T, 1,
3348 [Define to 1 if bool is an available type.])
3350 #ifdef HAVE_SYS_TYPES_H
3351 #include <sys/types.h>
3353 #ifdef HAVE_STDBOOL_H
3354 #include <stdbool.h>
3358 # check for sa_family_t
3359 AC_CHECK_TYPE(sa_family_t,
3360 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3363 AC_CHECK_TYPE(ADDRESS_FAMILY,
3364 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3365 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3367 #ifdef HAVE_SYS_SOCKET_H
3368 #include <sys/socket.h>
3373 #ifdef HAVE_SYS_SOCKET_H
3374 #include <sys/socket.h>
3378 # check for suseconds_t
3379 AC_CHECK_TYPE([suseconds_t],[
3380 AC_DEFINE(HAVE_SUSECONDS_T, 1,
3381 [Define to 1 if suseconds_t is an available type.])
3383 #ifdef HAVE_SYS_TYPES_H
3384 #include <sys/types.h>
3386 #ifdef HAVE_SYS_TIME_H
3387 #include <sys/time.h>
3391 AC_MSG_CHECKING([if time_t is unsigned])
3399 AC_MSG_RESULT([yes])
3400 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3404 dnl cross-compiling, most systems are unsigned
3408 CURL_CONFIGURE_PULL_SYS_POLL
3412 TYPE_SOCKADDR_STORAGE
3414 CURL_CHECK_FUNC_SELECT
3416 CURL_CHECK_FUNC_RECV
3417 CURL_CHECK_FUNC_SEND
3418 CURL_CHECK_MSG_NOSIGNAL
3420 CURL_CHECK_FUNC_ALARM
3421 CURL_CHECK_FUNC_BASENAME
3422 CURL_CHECK_FUNC_CLOSESOCKET
3423 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3424 CURL_CHECK_FUNC_CONNECT
3425 CURL_CHECK_FUNC_FCNTL
3426 CURL_CHECK_FUNC_FREEADDRINFO
3427 CURL_CHECK_FUNC_FSETXATTR
3428 CURL_CHECK_FUNC_FTRUNCATE
3429 CURL_CHECK_FUNC_GETADDRINFO
3430 CURL_CHECK_FUNC_GETHOSTBYNAME
3431 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3432 CURL_CHECK_FUNC_GETHOSTNAME
3433 CURL_CHECK_FUNC_GETPEERNAME
3434 CURL_CHECK_FUNC_GETSOCKNAME
3435 CURL_CHECK_FUNC_IF_NAMETOINDEX
3436 CURL_CHECK_FUNC_GETIFADDRS
3437 CURL_CHECK_FUNC_GMTIME_R
3438 CURL_CHECK_FUNC_INET_NTOP
3439 CURL_CHECK_FUNC_INET_PTON
3440 CURL_CHECK_FUNC_IOCTL
3441 CURL_CHECK_FUNC_IOCTLSOCKET
3442 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3443 CURL_CHECK_FUNC_LOCALTIME_R
3444 CURL_CHECK_FUNC_MEMRCHR
3445 CURL_CHECK_FUNC_POLL
3446 CURL_CHECK_FUNC_SETSOCKOPT
3447 CURL_CHECK_FUNC_SIGACTION
3448 CURL_CHECK_FUNC_SIGINTERRUPT
3449 CURL_CHECK_FUNC_SIGNAL
3450 CURL_CHECK_FUNC_SIGSETJMP
3451 CURL_CHECK_FUNC_SOCKET
3452 CURL_CHECK_FUNC_SOCKETPAIR
3453 CURL_CHECK_FUNC_STRCASECMP
3454 CURL_CHECK_FUNC_STRCMPI
3455 CURL_CHECK_FUNC_STRDUP
3456 CURL_CHECK_FUNC_STRERROR_R
3457 CURL_CHECK_FUNC_STRICMP
3458 CURL_CHECK_FUNC_STRNCMPI
3459 CURL_CHECK_FUNC_STRNICMP
3460 CURL_CHECK_FUNC_STRSTR
3461 CURL_CHECK_FUNC_STRTOK_R
3462 CURL_CHECK_FUNC_STRTOLL
3463 CURL_CHECK_FUNC_WRITEV
3469 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3473 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
3475 #include <sys/types.h>]])
3478 AC_CHECK_FUNCS([fnmatch \
3487 mach_absolute_time \
3498 eval skipcheck=\$skipcheck_$func
3499 if test "x$skipcheck" != "xyes"; then
3500 AC_MSG_CHECKING([deeper for $func])
3507 AC_MSG_RESULT([yes])
3508 eval "ac_cv_func_$func=yes"
3509 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3510 [Define to 1 if you have the $func function.])
3512 AC_MSG_RESULT([but still no])
3517 CURL_CHECK_NONBLOCKING_SOCKET
3519 dnl ************************************************************
3520 dnl nroff tool stuff
3523 AC_PATH_PROG( PERL, perl, ,
3524 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3527 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3528 $PATH:/usr/bin/:/usr/local/bin )
3531 if test -n "$NROFF"; then
3532 dnl only check for nroff options if an nroff command was found
3534 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3536 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3537 if test -z "$mancheck"; then
3539 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3540 if test -z "$mancheck"; then
3542 AC_MSG_RESULT([failed])
3543 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3545 AC_MSG_RESULT([$MANOPT])
3548 AC_MSG_RESULT([$MANOPT])
3553 if test -z "$MANOPT"
3555 dnl if no nroff tool was found, or no option that could convert man pages
3556 dnl was found, then disable the built-in manual stuff
3557 AC_MSG_WARN([disabling built-in manual])
3561 dnl *************************************************************************
3562 dnl If the manual variable still is set, then we go with providing a built-in
3565 if test "$USE_MANUAL" = "1"; then
3566 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3567 curl_manual_msg="enabled"
3570 dnl set variable for use in automakefile(s)
3571 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3574 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
3576 if test "x$curl_cv_native_windows" != "xyes" &&
3577 test "x$enable_shared" = "xyes"; then
3578 build_libhostname=yes
3580 build_libhostname=no
3582 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3584 if test "x$want_ares" != xyes; then
3585 CURL_CHECK_OPTION_THREADED_RESOLVER
3588 dnl ************************************************************
3589 dnl disable POSIX threads
3591 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3592 AC_ARG_ENABLE(pthreads,
3593 AS_HELP_STRING([--enable-pthreads],
3594 [Enable POSIX threads (default for threaded resolver)])
3595 AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3596 [ case "$enableval" in
3597 no) AC_MSG_RESULT(no)
3600 *) AC_MSG_RESULT(yes)
3609 dnl turn off pthreads if rt is disabled
3610 if test "$want_pthreads" != "no"; then
3611 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
3612 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
3614 if test "$dontwant_rt" != "no"; then
3615 dnl if --enable-pthreads was explicit then warn it's being ignored
3616 if test "$want_pthreads" = "yes"; then
3617 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
3623 dnl turn off pthreads if no threaded resolver
3624 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
3629 if test "$want_pthreads" != "no"; then
3630 AC_CHECK_HEADER(pthread.h,
3631 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3632 save_CFLAGS="$CFLAGS"
3633 dnl When statically linking against boringssl, -lpthread is added to LIBS.
3634 dnl Make sure to that this does not pass the check below, we really want
3635 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
3636 dnl lib1541 and lib1565 tests are built with these options. Otherwise
3637 dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
3641 dnl Check for libc variants without a separate pthread lib like bionic
3642 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3645 dnl on HPUX, life is more complicated...
3648 dnl it doesn't actually work without -lpthread
3649 USE_THREADS_POSIX=""
3655 dnl if it wasn't found without lib, search for it in pthread lib
3656 if test "$USE_THREADS_POSIX" != "1"
3658 CFLAGS="$CFLAGS -pthread"
3659 # assign PTHREAD for pkg-config use
3661 AC_CHECK_LIB(pthread, pthread_create,
3662 [USE_THREADS_POSIX=1],
3663 [ CFLAGS="$save_CFLAGS"])
3666 if test "x$USE_THREADS_POSIX" = "x1"
3668 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3669 curl_res_msg="POSIX threaded"
3674 dnl threaded resolver check
3675 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
3676 if test "$want_pthreads" = "yes"; then
3677 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
3679 dnl If native Windows fallback on Win32 threads since no POSIX threads
3680 if test "$curl_cv_native_windows" = "yes"; then
3682 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
3683 curl_res_msg="Win32 threaded"
3685 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
3689 CURL_CONVERT_INCLUDE_TO_ISYSTEM
3691 dnl ************************************************************
3692 dnl disable verbose text strings
3694 AC_MSG_CHECKING([whether to enable verbose strings])
3695 AC_ARG_ENABLE(verbose,
3696 AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
3697 AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3698 [ case "$enableval" in
3701 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3702 curl_verbose_msg="no"
3704 *) AC_MSG_RESULT(yes)
3710 dnl ************************************************************
3711 dnl enable SSPI support
3713 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3715 AS_HELP_STRING([--enable-sspi],[Enable SSPI])
3716 AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
3717 [ case "$enableval" in
3719 if test "$curl_cv_native_windows" = "yes"; then
3721 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3722 AC_SUBST(USE_WINDOWS_SSPI, [1])
3723 curl_sspi_msg="enabled"
3726 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3730 if test "x$SCHANNEL_ENABLED" = "x1"; then
3731 # --with-schannel implies --enable-sspi
3738 if test "x$SCHANNEL_ENABLED" = "x1"; then
3739 # --with-schannel implies --enable-sspi
3746 dnl ************************************************************
3747 dnl disable cryptographic authentication
3749 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3750 AC_ARG_ENABLE(crypto-auth,
3751 AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3752 AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3753 [ case "$enableval" in
3756 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3757 CURL_DISABLE_CRYPTO_AUTH=1
3759 *) AC_MSG_RESULT(yes)
3765 dnl ************************************************************
3766 dnl disable NTLM support
3768 AC_MSG_CHECKING([whether to support NTLM])
3770 AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
3771 AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
3772 [ case "$enableval" in
3775 AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
3778 *) AC_MSG_RESULT(yes)
3784 CURL_CHECK_OPTION_NTLM_WB
3788 dnl ************************************************************
3789 dnl disable TLS-SRP authentication
3791 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
3792 AC_ARG_ENABLE(tls-srp,
3793 AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
3794 AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
3795 [ case "$enableval" in
3800 *) AC_MSG_RESULT(yes)
3808 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
3809 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
3811 curl_tls_srp_msg="enabled"
3814 dnl ************************************************************
3815 dnl disable Unix domain sockets support
3817 AC_MSG_CHECKING([whether to enable Unix domain sockets])
3818 AC_ARG_ENABLE(unix-sockets,
3819 AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
3820 AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
3821 [ case "$enableval" in
3822 no) AC_MSG_RESULT(no)
3823 want_unix_sockets=no
3825 *) AC_MSG_RESULT(yes)
3826 want_unix_sockets=yes
3830 want_unix_sockets=auto
3833 if test "x$want_unix_sockets" != "xno"; then
3834 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
3835 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
3836 AC_SUBST(USE_UNIX_SOCKETS, [1])
3837 curl_unix_sockets_msg="enabled"
3839 if test "x$want_unix_sockets" = "xyes"; then
3840 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
3847 dnl ************************************************************
3848 dnl disable cookies support
3850 AC_MSG_CHECKING([whether to support cookies])
3851 AC_ARG_ENABLE(cookies,
3852 AS_HELP_STRING([--enable-cookies],[Enable cookies support])
3853 AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
3854 [ case "$enableval" in
3857 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
3859 *) AC_MSG_RESULT(yes)
3865 dnl ************************************************************
3866 dnl disable socketpair
3868 AC_MSG_CHECKING([whether to support socketpair])
3869 AC_ARG_ENABLE(socketpair,
3870 AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
3871 AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
3872 [ case "$enableval" in
3875 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
3877 *) AC_MSG_RESULT(yes)
3883 dnl ************************************************************
3884 dnl disable HTTP authentication support
3886 AC_MSG_CHECKING([whether to support HTTP authentication])
3887 AC_ARG_ENABLE(http-auth,
3888 AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
3889 AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
3890 [ case "$enableval" in
3893 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
3895 *) AC_MSG_RESULT(yes)
3901 dnl ************************************************************
3902 dnl disable DoH support
3904 AC_MSG_CHECKING([whether to support DoH])
3906 AS_HELP_STRING([--enable-doh],[Enable DoH support])
3907 AS_HELP_STRING([--disable-doh],[Disable DoH support]),
3908 [ case "$enableval" in
3911 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
3913 *) AC_MSG_RESULT(yes)
3919 dnl ************************************************************
3920 dnl disable mime API support
3922 AC_MSG_CHECKING([whether to support the MIME API])
3924 AS_HELP_STRING([--enable-mime],[Enable mime API support])
3925 AS_HELP_STRING([--disable-mime],[Disable mime API support]),
3926 [ case "$enableval" in
3929 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
3931 *) AC_MSG_RESULT(yes)
3937 dnl ************************************************************
3938 dnl disable date parsing
3940 AC_MSG_CHECKING([whether to support date parsing])
3941 AC_ARG_ENABLE(dateparse,
3942 AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
3943 AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
3944 [ case "$enableval" in
3947 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
3949 *) AC_MSG_RESULT(yes)
3955 dnl ************************************************************
3958 AC_MSG_CHECKING([whether to support netrc parsing])
3959 AC_ARG_ENABLE(netrc,
3960 AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
3961 AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
3962 [ case "$enableval" in
3965 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
3967 *) AC_MSG_RESULT(yes)
3973 dnl ************************************************************
3974 dnl disable progress-meter
3976 AC_MSG_CHECKING([whether to support progress-meter])
3977 AC_ARG_ENABLE(progress-meter,
3978 AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
3979 AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
3980 [ case "$enableval" in
3983 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
3985 *) AC_MSG_RESULT(yes)
3991 dnl ************************************************************
3992 dnl disable shuffle DNS support
3994 AC_MSG_CHECKING([whether to support DNS shuffling])
3995 AC_ARG_ENABLE(dnsshuffle,
3996 AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
3997 AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
3998 [ case "$enableval" in
4001 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4003 *) AC_MSG_RESULT(yes)
4009 dnl ************************************************************
4010 dnl disable the curl_easy_options API
4012 AC_MSG_CHECKING([whether to support curl_easy_option*])
4013 AC_ARG_ENABLE(get-easy-options,
4014 AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
4015 AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
4016 [ case "$enableval" in
4019 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
4021 *) AC_MSG_RESULT(yes)
4027 dnl ************************************************************
4028 dnl switch on/off alt-svc
4030 AC_MSG_CHECKING([whether to support alt-svc])
4031 AC_ARG_ENABLE(alt-svc,
4032 AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
4033 AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
4034 [ case "$enableval" in
4037 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
4038 curl_altsvc_msg="no";
4041 *) AC_MSG_RESULT(yes)
4047 dnl only check for HSTS if there's SSL present
4048 if test -n "$SSL_ENABLED"; then
4050 dnl ************************************************************
4051 dnl switch on/off hsts
4053 AC_MSG_CHECKING([whether to support HSTS])
4055 AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
4056 AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
4057 [ case "$enableval" in
4062 *) AC_MSG_RESULT(yes)
4065 AC_MSG_RESULT($hsts)
4068 AC_MSG_NOTICE([disables HSTS due to lack of SSL])
4072 if test "x$hsts" != "xyes"; then
4073 curl_hsts_msg="no (--enable-hsts)";
4074 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
4077 dnl *************************************************************
4078 dnl check whether ECH support, if desired, is actually available
4080 if test "x$want_ech" != "xno"; then
4081 AC_MSG_CHECKING([whether ECH support is available])
4083 dnl assume NOT and look for sufficient condition
4087 dnl OpenSSL with a chosen ECH function should be enough
4088 dnl so more exhaustive checking seems unnecessary for now
4089 if test "x$OPENSSL_ENABLED" = "x1"; then
4090 AC_CHECK_FUNCS(SSL_get_ech_status,
4091 ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
4094 dnl add 'elif' chain here for additional implementations
4097 dnl now deal with whatever we found
4098 if test "x$ECH_ENABLED" = "x1"; then
4099 AC_DEFINE(USE_ECH, 1, [if ECH support is available])
4100 AC_MSG_RESULT($ECH_SUPPORT)
4101 experimental="$experimental ECH"
4103 AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
4107 dnl ************************************************************
4108 dnl hiding of library internal symbols
4110 CURL_CONFIGURE_SYMBOL_HIDING
4113 dnl All the library dependencies put into $LIB apply to libcurl only.
4115 LIBCURL_LIBS="$LIBS$PTHREAD"
4117 AC_SUBST(LIBCURL_LIBS)
4118 AC_SUBST(CURL_NETWORK_LIBS)
4119 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4121 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4122 dnl LIBS variable used in generated makefile at makefile processing
4123 dnl time. Doing this functionally prevents LIBS from being used for
4124 dnl all link targets in given makefile.
4126 AC_SUBST(BLANK_AT_MAKETIME)
4128 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4131 ENABLE_SHARED="$enable_shared"
4132 AC_SUBST(ENABLE_SHARED)
4134 dnl to let curl-config output the static libraries correctly
4135 ENABLE_STATIC="$enable_static"
4136 AC_SUBST(ENABLE_STATIC)
4138 dnl merge the pkg-config Libs.private field into Libs when static-only
4139 if test "x$enable_shared" = "xno"; then
4140 LIBCURL_NO_SHARED=$LIBCURL_LIBS
4144 AC_SUBST(LIBCURL_NO_SHARED)
4147 dnl For keeping supported features and protocols also in pkg-config file
4148 dnl since it is more cross-compile friendly than curl-config
4151 if test "x$OPENSSL_ENABLED" = "x1"; then
4152 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4153 elif test -n "$SSL_ENABLED"; then
4154 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4156 if test "x$IPV6_ENABLED" = "x1"; then
4157 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4159 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4160 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4162 if test "x$HAVE_LIBZ" = "x1"; then
4163 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4165 if test "x$HAVE_BROTLI" = "x1"; then
4166 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4168 if test "x$HAVE_ZSTD" = "x1"; then
4169 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
4171 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4172 -o "x$USE_THREADS_WIN32" = "x1"; then
4173 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4175 if test "x$IDN_ENABLED" = "x1"; then
4176 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4178 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4179 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4182 if test "x$HAVE_GSSAPI" = "x1"; then
4183 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4186 if test "x$curl_psl_msg" = "xenabled"; then
4187 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4190 if test "x$curl_gsasl_msg" = "xenabled"; then
4191 SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
4194 if test "x$enable_altsvc" = "xyes"; then
4195 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4197 if test "x$hsts" = "xyes"; then
4198 SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
4201 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4202 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4203 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4206 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4207 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4208 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4211 use_curl_ntlm_core=no
4213 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4214 "x$CURL_DISABLE_NTLM" != "x1"; then
4215 if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4216 -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
4217 -o "x$SECURETRANSPORT_ENABLED" = "x1" \
4218 -o "x$USE_WIN32_CRYPTO" = "x1" \
4219 -o "x$WOLFSSL_NTLM" = "x1"; then
4220 use_curl_ntlm_core=yes
4223 if test "x$use_curl_ntlm_core" = "xyes" \
4224 -o "x$USE_WINDOWS_SSPI" = "x1"; then
4225 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4227 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4228 "x$NTLM_WB_ENABLED" = "x1"; then
4229 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4234 if test "x$USE_TLS_SRP" = "x1"; then
4235 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4238 if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
4239 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4242 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then
4243 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
4246 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4247 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4250 dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
4251 if test "x$https_proxy" != "xno"; then
4252 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4253 -o "x$NSS_ENABLED" = "x1"; then
4254 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4258 if test "x$ECH_ENABLED" = "x1"; then
4259 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
4262 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4263 if test ${ac_cv_sizeof_off_t} -gt 4 -o \
4264 "$curl_win32_file_api" = "win32_large_files"; then
4265 SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
4269 dnl replace spaces with newlines
4271 dnl replace the newlines back to spaces
4272 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
4273 AC_SUBST(SUPPORT_FEATURES)
4275 dnl For supported protocols in pkg-config file
4276 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4277 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4278 if test "x$SSL_ENABLED" = "x1"; then
4279 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4282 if test "x$CURL_DISABLE_FTP" != "x1"; then
4283 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4284 if test "x$SSL_ENABLED" = "x1"; then
4285 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4288 if test "x$CURL_DISABLE_FILE" != "x1"; then
4289 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4291 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4292 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4294 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4295 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4296 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4297 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4298 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4299 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4303 if test "x$CURL_DISABLE_DICT" != "x1"; then
4304 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4306 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4307 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4309 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4310 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4311 if test "x$SSL_ENABLED" = "x1"; then
4312 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
4315 if test "x$CURL_DISABLE_MQTT" != "x1"; then
4316 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
4318 if test "x$CURL_DISABLE_POP3" != "x1"; then
4319 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4320 if test "x$SSL_ENABLED" = "x1"; then
4321 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4324 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4325 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4326 if test "x$SSL_ENABLED" = "x1"; then
4327 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4330 if test "x$CURL_DISABLE_SMB" != "x1" \
4331 -a "x$use_curl_ntlm_core" = "xyes"; then
4332 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4333 if test "x$SSL_ENABLED" = "x1"; then
4334 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4337 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4338 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4339 if test "x$SSL_ENABLED" = "x1"; then
4340 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4343 if test "x$USE_LIBSSH2" = "x1"; then
4344 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4345 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4347 if test "x$USE_LIBSSH" = "x1"; then
4348 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4349 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4351 if test "x$USE_WOLFSSH" = "x1"; then
4352 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4354 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4355 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4357 if test "x$USE_LIBRTMP" = "x1"; then
4358 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4361 dnl replace spaces with newlines
4363 dnl replace the newlines back to spaces
4364 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4366 AC_SUBST(SUPPORT_PROTOCOLS)
4368 dnl squeeze whitespace out of some variables
4376 squeeze LIBCURL_LIBS
4377 squeeze CURL_NETWORK_LIBS
4378 squeeze CURL_NETWORK_AND_TIME_LIBS
4380 squeeze SUPPORT_FEATURES
4381 squeeze SUPPORT_PROTOCOLS
4383 XC_CHECK_BUILD_FLAGS
4385 SSL_BACKENDS=${ssl_backends}
4386 AC_SUBST(SSL_BACKENDS)
4388 if test "x$want_curldebug_assumed" = "xyes" &&
4389 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4390 ac_configure_args="$ac_configure_args --enable-curldebug"
4393 AC_CONFIG_FILES([Makefile \
4395 docs/examples/Makefile \
4396 docs/libcurl/Makefile \
4397 docs/libcurl/opts/Makefile \
4398 docs/cmdline-opts/Makefile \
4400 include/curl/Makefile \
4403 extensions/Makefile \
4407 tests/certs/Makefile \
4408 tests/certs/scripts/Makefile \
4409 tests/data/Makefile \
4410 tests/server/Makefile \
4411 tests/libtest/Makefile \
4412 tests/unit/Makefile \
4414 packages/vms/Makefile \
4420 CURL_GENERATE_CONFIGUREHELP_PM
4422 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4424 AC_MSG_NOTICE([Configured to build curl/libcurl:
4427 Install prefix: ${prefix}
4430 CPPFLAGS: ${CPPFLAGS}
4434 curl version: ${CURLVERSION}
4435 SSL: ${curl_ssl_msg}
4436 SSH: ${curl_ssh_msg}
4437 zlib: ${curl_zlib_msg}
4438 brotli: ${curl_brotli_msg}
4439 zstd: ${curl_zstd_msg}
4440 GSS-API: ${curl_gss_msg}
4441 GSASL: ${curl_gsasl_msg}
4442 TLS-SRP: ${curl_tls_srp_msg}
4443 resolver: ${curl_res_msg}
4444 IPv6: ${curl_ipv6_msg}
4445 Unix sockets: ${curl_unix_sockets_msg}
4446 IDN: ${curl_idn_msg}
4447 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4448 Built-in manual: ${curl_manual_msg}
4449 --libcurl option: ${curl_libcurl_msg}
4450 Verbose errors: ${curl_verbose_msg}
4451 Code coverage: ${curl_coverage_msg}
4452 SSPI: ${curl_sspi_msg}
4453 ca cert bundle: ${ca}${ca_warning}
4454 ca cert path: ${capath}${capath_warning}
4455 ca fallback: ${with_ca_fallback}
4456 LDAP: ${curl_ldap_msg}
4457 LDAPS: ${curl_ldaps_msg}
4458 RTSP: ${curl_rtsp_msg}
4459 RTMP: ${curl_rtmp_msg}
4460 PSL: ${curl_psl_msg}
4461 Alt-svc: ${curl_altsvc_msg}
4462 HSTS: ${curl_hsts_msg}
4463 HTTP1: ${curl_h1_msg}
4464 HTTP2: ${curl_h2_msg}
4465 HTTP3: ${curl_h3_msg}
4466 ECH: ${curl_ech_msg}
4467 Protocols: ${SUPPORT_PROTOCOLS}
4468 Features: ${SUPPORT_FEATURES}
4469 Tizen Features: ${SUPPORT_TIZEN_FEATURES}
4471 if test -n "$experimental"; then
4473 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!