1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at https://curl.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 # SPDX-License-Identifier: curl
23 #***************************************************************************
24 dnl Process this file with autoconf to produce a configure script.
28 dnl We don't know the version number "statically" so we use a dash here
29 AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/])
33 CURL_OVERRIDE_AUTOCONF
35 dnl configure script copyright
36 AC_COPYRIGHT([Copyright (c) 1998 - 2022 Daniel Stenberg, <daniel@haxx.se>
37 This configure script may be copied, distributed and modified under the
38 terms of the curl license; see COPYING for more details])
40 AC_CONFIG_SRCDIR([lib/urldata.h])
41 AC_CONFIG_HEADERS(lib/curl_config.h)
42 AC_CONFIG_MACRO_DIR([m4])
44 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
46 CURL_CHECK_OPTION_DEBUG
47 CURL_CHECK_OPTION_OPTIMIZE
48 CURL_CHECK_OPTION_WARNINGS
49 CURL_CHECK_OPTION_WERROR
50 CURL_CHECK_OPTION_CURLDEBUG
51 CURL_CHECK_OPTION_SYMBOL_HIDING
52 CURL_CHECK_OPTION_ARES
56 XC_CHECK_PATH_SEPARATOR
59 # save the configure arguments
61 CONFIGURE_OPTIONS="\"$ac_configure_args\""
62 AC_SUBST(CONFIGURE_OPTIONS)
64 dnl SED is mandatory for configure process and libtool.
65 dnl Set it now, allowing it to be changed later.
66 if test -z "$SED"; then
67 dnl allow it to be overridden
68 AC_PATH_PROG([SED], [sed], [not_found],
69 [$PATH:/usr/bin:/usr/local/bin])
70 if test -z "$SED" || test "$SED" = "not_found"; then
71 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
76 dnl GREP is mandatory for configure process and libtool.
77 dnl Set it now, allowing it to be changed later.
78 if test -z "$GREP"; then
79 dnl allow it to be overridden
80 AC_PATH_PROG([GREP], [grep], [not_found],
81 [$PATH:/usr/bin:/usr/local/bin])
82 if test -z "$GREP" || test "$GREP" = "not_found"; then
83 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
88 dnl 'grep -E' is mandatory for configure process and libtool.
89 dnl Set it now, allowing it to be changed later.
90 if test -z "$EGREP"; then
91 dnl allow it to be overridden
92 AC_MSG_CHECKING([that grep -E works])
93 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
98 AC_PATH_PROG([EGREP], [egrep], [not_found],
99 [$PATH:/usr/bin:/usr/local/bin])
102 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
103 AC_MSG_ERROR([grep -E is not working and egrep is not found in PATH. Cannot continue.])
107 dnl AR is mandatory for configure process and libtool.
108 dnl This is target dependent, so check it as a tool.
109 if test -z "$AR"; then
110 dnl allow it to be overridden
111 AC_PATH_TOOL([AR], [ar], [not_found],
112 [$PATH:/usr/bin:/usr/local/bin])
113 if test -z "$AR" || test "$AR" = "not_found"; then
114 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
121 dnl figure out the libcurl version
122 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
126 dnl for --enable-code-coverage
130 AC_MSG_CHECKING([curl version])
131 AC_MSG_RESULT($CURLVERSION)
133 AC_SUBST(CURLVERSION)
136 dnl we extract the numerical version for curl-config only
137 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
140 dnl Solaris pkgadd support definitions
141 PKGADD_PKG="HAXXcurl"
142 PKGADD_NAME="curl - a client that groks URLs"
143 PKGADD_VENDOR="curl.se"
145 AC_SUBST(PKGADD_NAME)
146 AC_SUBST(PKGADD_VENDOR)
149 dnl initialize all the info variables
150 curl_ssl_msg="no (--with-{openssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )"
151 curl_ssh_msg="no (--with-{libssh,libssh2})"
152 curl_zlib_msg="no (--with-zlib)"
153 curl_brotli_msg="no (--with-brotli)"
154 curl_zstd_msg="no (--with-zstd)"
155 curl_gss_msg="no (--with-gssapi)"
156 curl_gsasl_msg="no (--with-gsasl)"
157 curl_tls_srp_msg="no (--enable-tls-srp)"
158 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
159 curl_ipv6_msg="no (--enable-ipv6)"
160 curl_unix_sockets_msg="no (--enable-unix-sockets)"
161 curl_idn_msg="no (--with-{libidn2,winidn})"
162 curl_manual_msg="no (--enable-manual)"
163 curl_libcurl_msg="enabled (--disable-libcurl-option)"
164 curl_verbose_msg="enabled (--disable-verbose)"
165 curl_sspi_msg="no (--enable-sspi)"
166 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
167 curl_ldaps_msg="no (--enable-ldaps)"
168 curl_rtsp_msg="no (--enable-rtsp)"
169 curl_rtmp_msg="no (--with-librtmp)"
170 curl_psl_msg="no (--with-libpsl)"
171 curl_altsvc_msg="enabled (--disable-alt-svc)"
172 curl_headers_msg="enabled (--disable-headers-api)"
173 curl_hsts_msg="enabled (--disable-hsts)"
174 curl_ws_msg="no (--enable-websockets)"
176 curl_h1_msg="enabled (internal)"
177 curl_h2_msg="no (--with-nghttp2, --with-hyper)"
178 curl_h3_msg="no (--with-ngtcp2, --with-quiche --with-msh3)"
184 dnl Save some initial values the user might have provided
186 INITIAL_LDFLAGS=$LDFLAGS
189 dnl **********************************************************************
190 dnl See which TLS backend(s) that are requested. Just do all the
191 dnl TLS AC_ARG_WITH() invokes here and do the checks later
192 dnl **********************************************************************
194 AC_ARG_WITH(schannel,dnl
195 AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
196 OPT_SCHANNEL=$withval
197 TLSCHOICE="schannel")
199 OPT_SECURETRANSPORT=no
200 AC_ARG_WITH(secure-transport,dnl
201 AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),[
202 OPT_SECURETRANSPORT=$withval
203 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
207 AC_ARG_WITH(amissl,dnl
208 AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
210 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
214 dnl Default to no CA bundle
217 AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
218 AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
221 if test X"$withval" != Xno; then
222 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
228 AC_ARG_WITH(openssl,dnl
229 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]),[
231 if test X"$withval" != Xno; then
232 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
237 AC_ARG_WITH(gnutls,dnl
238 AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
240 if test X"$withval" != Xno; then
241 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
246 AC_ARG_WITH(mbedtls,dnl
247 AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
249 if test X"$withval" != Xno; then
250 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
255 AC_ARG_WITH(wolfssl,dnl
256 AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),[
258 if test X"$withval" != Xno; then
259 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
264 AC_ARG_WITH(bearssl,dnl
265 AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),[
267 if test X"$withval" != Xno; then
268 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
273 AC_ARG_WITH(rustls,dnl
274 AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),[
276 if test X"$withval" != Xno; then
277 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
278 experimental="$experimental rustls"
283 AC_ARG_WITH(nss-deprecated,dnl
284 AS_HELP_STRING([--with-nss-deprecated],[confirm you realize NSS is going away]),
285 if test X"$withval" != Xno; then
286 OPT_NSS_AWARE=$withval
292 AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),
294 if test X"$withval" != Xno; then
296 if test X"$OPT_NSS_AWARE" = "Xno" ; then
297 AC_MSG_ERROR([NSS use must be confirmed using --with-nss-deprecated. NSS support will be dropped from curl in August 2022. See docs/DEPRECATE.md])
300 [TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS"]
304 dnl If no TLS choice has been made, check if it was explicitly disabled or
305 dnl error out to force the user to decide.
306 if test -z "$TLSCHOICE"; then
307 if test "x$OPT_SSL" != "xno"; then
308 AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
317 --with-openssl (also works for BoringSSL and libressl)
320 --with-secure-transport
326 AC_ARG_WITH(darwinssl,,
327 AC_MSG_ERROR([--with-darwin-ssl no longer works!]))
330 dnl Detect the canonical host and target build environment
334 dnl Get system canonical name
335 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
337 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
338 AC_SUBST(AR_FLAGS, [cr])
340 dnl This defines _ALL_SOURCE for AIX
341 CURL_CHECK_AIX_ALL_SOURCE
343 dnl Our configure and build reentrant settings
344 CURL_CONFIGURE_THREAD_SAFE
345 CURL_CONFIGURE_REENTRANT
347 dnl check for how to do large files
352 LT_LANG([Windows Resource])
355 # Automake conditionals based on libtool related checks
358 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
359 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
360 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
361 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
362 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
363 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
366 # Due to libtool and automake machinery limitations of not allowing
367 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
368 # inclusion of these in shared or static libraries, we are forced to
369 # build using separate configure runs for shared and static libraries
370 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
371 # to compile objects for each kind of library. Notice that relying on
372 # the '-DPIC' CFLAG that libtool provides is not valid given that the
373 # user might for example choose to build static libraries with PIC.
377 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
378 # targeting a static library and not building its shared counterpart.
381 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
382 [test "x$xc_lt_build_static_only" = 'xyes'])
385 # Make staticlib CPPFLAG variable and its definition visible in output
386 # files unconditionally, providing an empty definition unless strictly
387 # targeting a static library and not building its shared counterpart.
390 CPPFLAG_CURL_STATICLIB=
391 if test "x$xc_lt_build_static_only" = 'xyes'; then
392 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
394 AC_SUBST([CPPFLAG_CURL_STATICLIB])
397 # Determine whether all dependent libraries must be specified when linking
398 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
404 AC_SUBST(REQUIRE_LIB_DEPS)
405 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
407 dnl check if there's a way to force code inline
410 dnl **********************************************************************
411 dnl platform/compiler/architecture specific checks/flags
412 dnl **********************************************************************
415 CURL_SET_COMPILER_BASIC_OPTS
416 CURL_SET_COMPILER_DEBUG_OPTS
417 CURL_SET_COMPILER_OPTIMIZE_OPTS
418 CURL_SET_COMPILER_WARNING_OPTS
420 if test "$compiler_id" = "INTEL_UNIX_C"; then
422 if test "$compiler_num" -ge "1000"; then
423 dnl icc 10.X or later
424 CFLAGS="$CFLAGS -shared-intel"
425 elif test "$compiler_num" -ge "900"; then
427 CFLAGS="$CFLAGS -i-dynamic"
433 if test X"$want_werror" = Xyes; then
434 CURL_CFLAG_EXTRAS="-Werror"
435 if test "$compiler_id" = "GNU_C"; then
436 dnl enable -pedantic-errors for GCC 5 and later,
437 dnl as before that it was the same as -Werror=pedantic
438 if test "$compiler_num" -ge "500"; then
439 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
443 AC_SUBST(CURL_CFLAG_EXTRAS)
445 CURL_CHECK_COMPILER_HALT_ON_ERROR
446 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
447 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
448 CURL_CHECK_COMPILER_SYMBOL_HIDING
451 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
453 supports_unittests=yes
454 # cross-compilation of unit tests static library/programs fails when
455 # libcurl shared library is built. This might be due to a libtool or
456 # automake issue. In this case we disable unit tests.
457 if test "x$cross_compiling" != "xno" &&
458 test "x$enable_shared" != "xno"; then
459 supports_unittests=no
462 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
463 # a problem related with OpenSSL headers and library versions not matching.
464 # Disable unit tests while time to further investigate this is found.
467 if test "$compiler_id" = "GNU_C"; then
468 supports_unittests=no
473 # All AIX autobuilds fails unit tests linking against unittests library
474 # due to unittests library being built with no symbols or members. Libtool ?
475 # Disable unit tests while time to further investigate this is found.
478 supports_unittests=no
482 dnl Build unit tests when option --enable-debug is given.
483 if test "x$want_debug" = "xyes" &&
484 test "x$supports_unittests" = "xyes"; then
489 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
491 # For original MinGW (ie not MinGW-w64) define the Windows minimum supported OS
492 # version to Windows XP (0x501) if it hasn't already been defined by the user.
493 # Without this override original MinGW defaults the version to Windows NT 4.0.
494 # Note original MinGW sets _WIN32_WINNT if not defined to whatever WINVER is.
497 AC_MSG_CHECKING([if MinGW minimum supported OS should be set to XP])
502 #if defined(__MINGW64_VERSION_MAJOR) || \
504 defined(_WIN32_WINNT)
509 CPPFLAGS="$CPPFLAGS -DWINVER=0x501"
517 # Detect original MinGW (not MinGW-w64)
518 curl_mingw_original=no
521 AC_MSG_CHECKING([using original MinGW (not MinGW-w64)])
526 #if defined(__MINGW64_VERSION_MAJOR)
531 curl_mingw_original=yes
539 dnl **********************************************************************
540 dnl Compilation based checks should not be done before this point.
541 dnl **********************************************************************
543 dnl **********************************************************************
544 dnl Make sure that our checks for headers windows.h winsock2.h
545 dnl and ws2tcpip.h take precedence over any other further checks which
546 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
547 dnl this specific header files. And do them before its results are used.
548 dnl **********************************************************************
550 CURL_CHECK_HEADER_WINDOWS
551 CURL_CHECK_NATIVE_WINDOWS
552 case X-"$curl_cv_native_windows" in
554 CURL_CHECK_HEADER_WINSOCK2
555 CURL_CHECK_HEADER_WS2TCPIP
556 CURL_CHECK_HEADER_WINCRYPT
557 CURL_CHECK_HEADER_WINLDAP
560 curl_cv_header_winsock2_h="no"
561 curl_cv_header_ws2tcpip_h="no"
562 curl_cv_header_wincrypt_h="no"
563 curl_cv_header_winldap_h="no"
566 CURL_CHECK_WIN32_LARGEFILE
567 CURL_CHECK_WIN32_CRYPTO
570 CURL_DARWIN_SYSTEMCONFIGURATION
571 CURL_SUPPORTS_BUILTIN_AVAILABLE
573 AM_CONDITIONAL([OS_WINDOWS], [test "$curl_cv_native_windows" = "yes"])
575 dnl ************************************************************
576 dnl switch off particular protocols
578 AC_MSG_CHECKING([whether to support http])
580 AS_HELP_STRING([--enable-http],[Enable HTTP support])
581 AS_HELP_STRING([--disable-http],[Disable HTTP support]),
582 [ case "$enableval" in
585 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
587 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
588 AC_SUBST(CURL_DISABLE_HTTP, [1])
589 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
590 AC_SUBST(CURL_DISABLE_RTSP, [1])
591 dnl toggle off alt-svc too when HTTP is disabled
592 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
593 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
594 curl_h1_msg="no (--enable-http, --with-hyper)"
595 curl_altsvc_msg="no";
596 curl_hsts_msg="no (--enable-hsts)";
600 *) AC_MSG_RESULT(yes)
605 AC_MSG_CHECKING([whether to support ftp])
607 AS_HELP_STRING([--enable-ftp],[Enable FTP support])
608 AS_HELP_STRING([--disable-ftp],[Disable FTP support]),
609 [ case "$enableval" in
612 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
613 AC_SUBST(CURL_DISABLE_FTP, [1])
615 *) AC_MSG_RESULT(yes)
620 AC_MSG_CHECKING([whether to support file])
622 AS_HELP_STRING([--enable-file],[Enable FILE support])
623 AS_HELP_STRING([--disable-file],[Disable FILE support]),
624 [ case "$enableval" in
627 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
628 AC_SUBST(CURL_DISABLE_FILE, [1])
630 *) AC_MSG_RESULT(yes)
635 AC_MSG_CHECKING([whether to support ldap])
637 AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
638 AS_HELP_STRING([--disable-ldap],[Disable LDAP support]),
639 [ case "$enableval" in
642 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
643 AC_SUBST(CURL_DISABLE_LDAP, [1])
655 AC_MSG_CHECKING([whether to support ldaps])
657 AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
658 AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
659 [ case "$enableval" in
662 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
663 AC_SUBST(CURL_DISABLE_LDAPS, [1])
665 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
666 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
667 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
668 AC_SUBST(CURL_DISABLE_LDAPS, [1])
671 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
672 AC_SUBST(HAVE_LDAP_SSL, [1])
676 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
678 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
679 AC_SUBST(CURL_DISABLE_LDAPS, [1])
682 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
683 AC_SUBST(HAVE_LDAP_SSL, [1])
687 dnl **********************************************************************
689 dnl **********************************************************************
694 AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
695 AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
696 [OPT_HYPER=$withval])
699 dnl --without-hyper option used
703 dnl --with-hyper option used without path
708 dnl --with-hyper option used with path
710 want_hyper_path="$withval"
714 if test X"$want_hyper" != Xno; then
715 if test "x$disable_http" = "xyes"; then
716 AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
719 dnl backup the pre-hyper variables
720 CLEANLDFLAGS="$LDFLAGS"
721 CLEANCPPFLAGS="$CPPFLAGS"
724 CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
726 if test "$PKGCONFIG" != "no" ; then
727 LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
728 $PKGCONFIG --libs-only-l hyper`
729 CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
730 $PKGCONFIG --cflags-only-I hyper`
731 LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
732 $PKGCONFIG --libs-only-L hyper`
734 dnl no hyper pkg-config found
735 LIB_HYPER="-lhyper -ldl -lpthread -lm"
736 if test X"$want_hyper" != Xdefault; then
737 CPP_HYPER=-I"$want_hyper_path/capi/include"
738 LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
741 if test -n "$LIB_HYPER"; then
742 AC_MSG_NOTICE([-l is $LIB_HYPER])
743 AC_MSG_NOTICE([-I is $CPP_HYPER])
744 AC_MSG_NOTICE([-L is $LD_HYPER])
746 LDFLAGS="$LDFLAGS $LD_HYPER"
747 CPPFLAGS="$CPPFLAGS $CPP_HYPER"
748 LIBS="$LIB_HYPER $LIBS"
750 if test "x$cross_compiling" != "xyes"; then
751 dnl remove -L, separate with colon if more than one
752 DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
755 AC_CHECK_LIB(hyper, hyper_io_new,
757 AC_CHECK_HEADERS(hyper.h,
758 experimental="$experimental Hyper"
759 AC_MSG_NOTICE([Hyper support is experimental])
760 curl_h1_msg="enabled (Hyper)"
761 curl_h2_msg=$curl_h1_msg
763 AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
764 AC_SUBST(USE_HYPER, [1])
765 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
766 export CURL_LIBRARY_PATH
767 AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]),
770 for d in `echo $DIR_HYPER | $SED -e 's/:/ /'`; do
771 if test -f "$d/libhyper.a"; then
772 AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
775 AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
780 if test X"$want_hyper" != Xno; then
781 AC_MSG_NOTICE([Disable RTSP support with hyper])
782 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
783 AC_SUBST(CURL_DISABLE_RTSP, [1])
787 AC_MSG_CHECKING([whether to support rtsp])
789 AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
790 AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
791 [ case "$enableval" in
794 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
795 AC_SUBST(CURL_DISABLE_RTSP, [1])
798 if test x$CURL_DISABLE_HTTP = x1 ; then
799 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
802 curl_rtsp_msg="enabled"
806 if test "x$CURL_DISABLE_HTTP" != "x1"; then
808 curl_rtsp_msg="enabled"
815 AC_MSG_CHECKING([whether to support proxies])
817 AS_HELP_STRING([--enable-proxy],[Enable proxy support])
818 AS_HELP_STRING([--disable-proxy],[Disable proxy support]),
819 [ case "$enableval" in
822 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
823 AC_SUBST(CURL_DISABLE_PROXY, [1])
826 *) AC_MSG_RESULT(yes)
832 AC_MSG_CHECKING([whether to support dict])
834 AS_HELP_STRING([--enable-dict],[Enable DICT support])
835 AS_HELP_STRING([--disable-dict],[Disable DICT support]),
836 [ case "$enableval" in
839 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
840 AC_SUBST(CURL_DISABLE_DICT, [1])
842 *) AC_MSG_RESULT(yes)
847 AC_MSG_CHECKING([whether to support telnet])
848 AC_ARG_ENABLE(telnet,
849 AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
850 AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
851 [ case "$enableval" in
854 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
855 AC_SUBST(CURL_DISABLE_TELNET, [1])
857 *) AC_MSG_RESULT(yes)
862 AC_MSG_CHECKING([whether to support tftp])
864 AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
865 AS_HELP_STRING([--disable-tftp],[Disable TFTP support]),
866 [ case "$enableval" in
869 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
870 AC_SUBST(CURL_DISABLE_TFTP, [1])
872 *) AC_MSG_RESULT(yes)
878 AC_MSG_CHECKING([whether to support pop3])
880 AS_HELP_STRING([--enable-pop3],[Enable POP3 support])
881 AS_HELP_STRING([--disable-pop3],[Disable POP3 support]),
882 [ case "$enableval" in
885 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
886 AC_SUBST(CURL_DISABLE_POP3, [1])
888 *) AC_MSG_RESULT(yes)
895 AC_MSG_CHECKING([whether to support imap])
897 AS_HELP_STRING([--enable-imap],[Enable IMAP support])
898 AS_HELP_STRING([--disable-imap],[Disable IMAP support]),
899 [ case "$enableval" in
902 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
903 AC_SUBST(CURL_DISABLE_IMAP, [1])
905 *) AC_MSG_RESULT(yes)
912 AC_MSG_CHECKING([whether to support smb])
914 AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
915 AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
916 [ case "$enableval" in
919 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
920 AC_SUBST(CURL_DISABLE_SMB, [1])
922 *) AC_MSG_RESULT(yes)
928 AC_MSG_CHECKING([whether to support smtp])
930 AS_HELP_STRING([--enable-smtp],[Enable SMTP support])
931 AS_HELP_STRING([--disable-smtp],[Disable SMTP support]),
932 [ case "$enableval" in
935 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
936 AC_SUBST(CURL_DISABLE_SMTP, [1])
938 *) AC_MSG_RESULT(yes)
944 AC_MSG_CHECKING([whether to support gopher])
945 AC_ARG_ENABLE(gopher,
946 AS_HELP_STRING([--enable-gopher],[Enable Gopher support])
947 AS_HELP_STRING([--disable-gopher],[Disable Gopher support]),
948 [ case "$enableval" in
951 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
952 AC_SUBST(CURL_DISABLE_GOPHER, [1])
954 *) AC_MSG_RESULT(yes)
960 AC_MSG_CHECKING([whether to support mqtt])
962 AS_HELP_STRING([--enable-mqtt],[Enable MQTT support])
963 AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
964 [ case "$enableval" in
967 AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
968 AC_SUBST(CURL_DISABLE_MQTT, [1])
970 *) AC_MSG_RESULT(yes)
976 dnl **********************************************************************
977 dnl Check for built-in manual
978 dnl **********************************************************************
980 AC_MSG_CHECKING([whether to provide built-in manual])
981 AC_ARG_ENABLE(manual,
982 AS_HELP_STRING([--enable-manual],[Enable built-in manual])
983 AS_HELP_STRING([--disable-manual],[Disable built-in manual]),
984 [ case "$enableval" in
988 *) AC_MSG_RESULT(yes)
995 dnl The actual use of the USE_MANUAL variable is done much later in this
996 dnl script to allow other actions to disable it as well.
998 dnl ************************************************************
999 dnl disable C code generation support
1001 AC_MSG_CHECKING([whether to enable generation of C code])
1002 AC_ARG_ENABLE(libcurl_option,
1003 AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
1004 AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
1005 [ case "$enableval" in
1008 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
1009 curl_libcurl_msg="no"
1011 *) AC_MSG_RESULT(yes)
1017 dnl **********************************************************************
1018 dnl Checks for libraries.
1019 dnl **********************************************************************
1021 AC_MSG_CHECKING([whether to use libgcc])
1022 AC_ARG_ENABLE(libgcc,
1023 AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
1024 [ case "$enableval" in
1029 *) AC_MSG_RESULT(no)
1037 dnl gethostbyname without lib or in the nsl lib?
1038 AC_CHECK_FUNC(gethostbyname,
1039 [HAVE_GETHOSTBYNAME="1"
1041 [ AC_CHECK_LIB(nsl, gethostbyname,
1042 [HAVE_GETHOSTBYNAME="1"
1047 if test "$HAVE_GETHOSTBYNAME" != "1"
1049 dnl gethostbyname in the socket lib?
1050 AC_CHECK_LIB(socket, gethostbyname,
1051 [HAVE_GETHOSTBYNAME="1"
1052 LIBS="-lsocket $LIBS"
1056 if test "$HAVE_GETHOSTBYNAME" != "1"
1058 dnl gethostbyname in the watt lib?
1059 AC_CHECK_LIB(watt, gethostbyname,
1060 [HAVE_GETHOSTBYNAME="1"
1061 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
1062 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
1067 dnl At least one system has been identified to require BOTH nsl and socket
1068 dnl libs at the same time to link properly.
1069 if test "$HAVE_GETHOSTBYNAME" != "1"
1071 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
1072 my_ac_save_LIBS=$LIBS
1073 LIBS="-lnsl -lsocket $LIBS"
1080 AC_MSG_RESULT([yes])
1081 HAVE_GETHOSTBYNAME="1"
1084 LIBS=$my_ac_save_LIBS
1088 if test "$HAVE_GETHOSTBYNAME" != "1"
1090 dnl This is for winsock systems
1091 if test "$curl_cv_header_windows_h" = "yes"; then
1092 if test "$curl_cv_header_winsock2_h" = "yes"; then
1093 winsock_LIB="-lws2_32"
1095 if test ! -z "$winsock_LIB"; then
1096 my_ac_save_LIBS=$LIBS
1097 LIBS="$winsock_LIB $LIBS"
1098 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
1101 #ifdef HAVE_WINDOWS_H
1102 #ifndef WIN32_LEAN_AND_MEAN
1103 #define WIN32_LEAN_AND_MEAN
1105 #include <windows.h>
1106 #ifdef HAVE_WINSOCK2_H
1107 #include <winsock2.h>
1111 gethostbyname("www.dummysite.com");
1114 AC_MSG_RESULT([yes])
1115 HAVE_GETHOSTBYNAME="1"
1119 LIBS=$my_ac_save_LIBS
1125 if test "$HAVE_GETHOSTBYNAME" != "1"
1127 dnl This is for Minix 3.1
1128 AC_MSG_CHECKING([for gethostbyname for Minix 3])
1131 /* Older Minix versions may need <net/gen/netdb.h> here instead */
1134 gethostbyname("www.dummysite.com");
1137 AC_MSG_RESULT([yes])
1138 HAVE_GETHOSTBYNAME="1"
1144 if test "$HAVE_GETHOSTBYNAME" != "1"
1146 dnl This is for eCos with a stubbed DNS implementation
1147 AC_MSG_CHECKING([for gethostbyname for eCos])
1153 gethostbyname("www.dummysite.com");
1156 AC_MSG_RESULT([yes])
1157 HAVE_GETHOSTBYNAME="1"
1163 if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
1165 dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
1166 AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
1169 #define __USE_INLINE__
1170 #include <proto/bsdsocket.h>
1172 struct SocketIFace *ISocket = NULL;
1174 struct Library *SocketBase = NULL;
1177 gethostbyname("www.dummysite.com");
1180 AC_MSG_RESULT([yes])
1181 HAVE_GETHOSTBYNAME="1"
1182 HAVE_PROTO_BSDSOCKET_H="1"
1183 AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
1184 AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
1190 if test "$HAVE_GETHOSTBYNAME" != "1"
1192 dnl gethostbyname in the network lib - for Haiku OS
1193 AC_CHECK_LIB(network, gethostbyname,
1194 [HAVE_GETHOSTBYNAME="1"
1195 LIBS="-lnetwork $LIBS"
1199 if test "$HAVE_GETHOSTBYNAME" != "1"; then
1200 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
1203 CURL_CHECK_LIBS_CONNECT
1205 CURL_NETWORK_LIBS=$LIBS
1207 dnl **********************************************************************
1208 dnl In case that function clock_gettime with monotonic timer is available,
1209 dnl check for additional required libraries.
1210 dnl **********************************************************************
1211 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
1213 dnl **********************************************************************
1214 dnl The preceding library checks are all potentially useful for test
1215 dnl servers and libtest cases which require networking and clock_gettime
1216 dnl support. Save the list of required libraries at this point for use
1217 dnl while linking those test servers and programs.
1218 dnl **********************************************************************
1219 CURL_NETWORK_AND_TIME_LIBS=$LIBS
1221 dnl **********************************************************************
1222 dnl Check for the presence of ZLIB libraries and headers
1223 dnl **********************************************************************
1225 dnl Check for & handle argument to --with-zlib.
1227 clean_CPPFLAGS=$CPPFLAGS
1228 clean_LDFLAGS=$LDFLAGS
1232 AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1233 AS_HELP_STRING([--without-zlib],[disable use of zlib]),
1234 [OPT_ZLIB="$withval"])
1236 if test "$OPT_ZLIB" = "no" ; then
1237 AC_MSG_WARN([zlib disabled])
1239 if test "$OPT_ZLIB" = "yes" ; then
1243 if test -z "$OPT_ZLIB" ; then
1244 CURL_CHECK_PKGCONFIG(zlib)
1246 if test "$PKGCONFIG" != "no" ; then
1247 LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
1248 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
1249 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
1254 if test -z "$HAVE_LIBZ"; then
1256 dnl Check for the lib without setting any new path, since many
1257 dnl people have it in the default path
1259 AC_CHECK_LIB(z, inflateEnd,
1260 dnl libz found, set the variable
1263 dnl if no lib found, try /usr/local
1264 [OPT_ZLIB="/usr/local"])
1268 dnl Add a nonempty path to the compiler flags
1269 if test -n "$OPT_ZLIB"; then
1270 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1271 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1274 AC_CHECK_HEADER(zlib.h,
1276 dnl zlib.h was found
1278 dnl if the lib wasn't found already, try again with the new paths
1279 if test "$HAVE_LIBZ" != "1"; then
1280 AC_CHECK_LIB(z, gzread,
1282 dnl the lib was found!
1286 [ CPPFLAGS=$clean_CPPFLAGS
1287 LDFLAGS=$clean_LDFLAGS])
1291 dnl zlib.h was not found, restore the flags
1292 CPPFLAGS=$clean_CPPFLAGS
1293 LDFLAGS=$clean_LDFLAGS]
1296 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1298 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1300 CPPFLAGS=$clean_CPPFLAGS
1301 LDFLAGS=$clean_LDFLAGS
1303 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1305 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1306 CPPFLAGS=$clean_CPPFLAGS
1307 LDFLAGS=$clean_LDFLAGS
1309 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1311 dnl both header and lib were found!
1313 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1316 LIBS="-lz $clean_LIBS"
1318 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1320 AC_MSG_NOTICE([found both libz and libz.h header])
1321 curl_zlib_msg="enabled"
1325 dnl set variable for use in automakefile(s)
1326 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1329 dnl **********************************************************************
1330 dnl Check for the presence of BROTLI decoder libraries and headers
1331 dnl **********************************************************************
1333 dnl Brotli project home page: https://github.com/google/brotli
1335 dnl Default to compiler & linker defaults for BROTLI files & libraries.
1337 AC_ARG_WITH(brotli,dnl
1338 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])
1339 AS_HELP_STRING([--without-brotli], [disable BROTLI]),
1340 OPT_BROTLI=$withval)
1342 if test X"$OPT_BROTLI" != Xno; then
1343 dnl backup the pre-brotli variables
1344 CLEANLDFLAGS="$LDFLAGS"
1345 CLEANCPPFLAGS="$CPPFLAGS"
1348 case "$OPT_BROTLI" in
1350 dnl --with-brotli (without path) used
1351 CURL_CHECK_PKGCONFIG(libbrotlidec)
1353 if test "$PKGCONFIG" != "no" ; then
1354 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1355 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1356 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1357 version=`$PKGCONFIG --modversion libbrotlidec`
1358 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
1363 dnl no --with-brotli option given, just check default places
1366 dnl use the given --with-brotli spot
1367 PREFIX_BROTLI=$OPT_BROTLI
1371 dnl if given with a prefix, we set -L and -I based on that
1372 if test -n "$PREFIX_BROTLI"; then
1373 LIB_BROTLI="-lbrotlidec"
1374 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1375 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1376 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1379 LDFLAGS="$LDFLAGS $LD_BROTLI"
1380 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1381 LIBS="$LIB_BROTLI $LIBS"
1383 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1385 AC_CHECK_HEADERS(brotli/decode.h,
1386 curl_brotli_msg="enabled (libbrotlidec)"
1388 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1389 AC_SUBST(HAVE_BROTLI, [1])
1392 if test X"$OPT_BROTLI" != Xoff &&
1393 test "$HAVE_BROTLI" != "1"; then
1394 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1397 if test "$HAVE_BROTLI" = "1"; then
1398 if test -n "$DIR_BROTLI"; then
1399 dnl when the brotli shared libs were found in a path that the run-time
1400 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1401 dnl to prevent further configure tests to fail due to this
1403 if test "x$cross_compiling" != "xyes"; then
1404 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1405 export CURL_LIBRARY_PATH
1406 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1410 dnl no brotli, revert back to clean variables
1411 LDFLAGS=$CLEANLDFLAGS
1412 CPPFLAGS=$CLEANCPPFLAGS
1417 dnl **********************************************************************
1418 dnl Check for libzstd
1419 dnl **********************************************************************
1421 dnl Default to compiler & linker defaults for libzstd
1423 AC_ARG_WITH(zstd,dnl
1424 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])
1425 AS_HELP_STRING([--without-zstd], [disable libzstd]),
1428 if test X"$OPT_ZSTD" != Xno; then
1429 dnl backup the pre-zstd variables
1430 CLEANLDFLAGS="$LDFLAGS"
1431 CLEANCPPFLAGS="$CPPFLAGS"
1436 dnl --with-zstd (without path) used
1437 CURL_CHECK_PKGCONFIG(libzstd)
1439 if test "$PKGCONFIG" != "no" ; then
1440 LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
1441 LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
1442 CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
1443 version=`$PKGCONFIG --modversion libzstd`
1444 DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
1449 dnl no --with-zstd option given, just check default places
1452 dnl use the given --with-zstd spot
1453 PREFIX_ZSTD=$OPT_ZSTD
1457 dnl if given with a prefix, we set -L and -I based on that
1458 if test -n "$PREFIX_ZSTD"; then
1460 LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
1461 CPP_ZSTD=-I${PREFIX_ZSTD}/include
1462 DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
1465 LDFLAGS="$LDFLAGS $LD_ZSTD"
1466 CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
1467 LIBS="$LIB_ZSTD $LIBS"
1469 AC_CHECK_LIB(zstd, ZSTD_createDStream)
1471 AC_CHECK_HEADERS(zstd.h,
1472 curl_zstd_msg="enabled (libzstd)"
1474 AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
1475 AC_SUBST(HAVE_ZSTD, [1])
1478 if test X"$OPT_ZSTD" != Xoff &&
1479 test "$HAVE_ZSTD" != "1"; then
1480 AC_MSG_ERROR([libzstd was not found where specified!])
1483 if test "$HAVE_ZSTD" = "1"; then
1484 if test -n "$DIR_ZSTD"; then
1485 dnl when the zstd shared lib were found in a path that the run-time
1486 dnl linker doesn't search through, we need to add it to
1487 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
1490 if test "x$cross_compiling" != "xyes"; then
1491 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
1492 export CURL_LIBRARY_PATH
1493 AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
1497 dnl no zstd, revert back to clean variables
1498 LDFLAGS=$CLEANLDFLAGS
1499 CPPFLAGS=$CLEANCPPFLAGS
1504 dnl **********************************************************************
1506 dnl **********************************************************************
1509 AC_ARG_WITH(ldap-lib,
1510 AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1511 [LDAPLIBNAME="$withval"])
1514 AC_ARG_WITH(lber-lib,
1515 AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1516 [LBERLIBNAME="$withval"])
1518 if test x$CURL_DISABLE_LDAP != x1 ; then
1520 CURL_CHECK_HEADER_LBER
1521 CURL_CHECK_HEADER_LDAP
1522 CURL_CHECK_HEADER_LDAP_SSL
1524 if test -z "$LDAPLIBNAME" ; then
1525 if test "$curl_cv_native_windows" = "yes"; then
1526 dnl Windows uses a single and unique LDAP library name
1527 LDAPLIBNAME="wldap32"
1532 if test "$LDAPLIBNAME" ; then
1533 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1534 if test -n "$ldap_askedfor"; then
1535 AC_MSG_ERROR([couldn't detect the LDAP libraries])
1537 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1538 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1539 AC_SUBST(CURL_DISABLE_LDAP, [1])
1540 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1541 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1543 dnl Try to find the right ldap libraries for this system
1544 CURL_CHECK_LIBS_LDAP
1545 case X-"$curl_cv_ldap_LIBS" in
1547 if test -n "$ldap_askedfor"; then
1548 AC_MSG_ERROR([couldn't detect the LDAP libraries])
1550 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1551 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1552 AC_SUBST(CURL_DISABLE_LDAP, [1])
1553 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1554 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1560 if test x$CURL_DISABLE_LDAP != x1 ; then
1562 if test "$LBERLIBNAME" ; then
1563 dnl If name is "no" then don't define this library at all
1564 dnl (it's only needed if libldap.so's dependencies are broken).
1565 if test "$LBERLIBNAME" != "no" ; then
1566 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1567 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1568 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1569 AC_SUBST(CURL_DISABLE_LDAP, [1])
1570 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1571 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1576 if test x$CURL_DISABLE_LDAP != x1 ; then
1577 AC_CHECK_FUNCS([ldap_url_parse])
1579 if test "$LDAPLIBNAME" = "wldap32"; then
1580 curl_ldap_msg="enabled (winldap)"
1581 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1583 curl_ldap_msg="enabled (OpenLDAP)"
1584 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1585 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1586 AC_SUBST(USE_OPENLDAP, [1])
1591 if test x$CURL_DISABLE_LDAPS != x1 ; then
1592 curl_ldaps_msg="enabled"
1595 dnl **********************************************************************
1597 dnl **********************************************************************
1599 AC_MSG_CHECKING([whether to enable IPv6])
1601 AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1602 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1603 [ case "$enableval" in
1608 *) AC_MSG_RESULT(yes)
1613 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1614 /* are AF_INET6 and sockaddr_in6 available? */
1615 #include <sys/types.h>
1616 #ifdef HAVE_WINSOCK2_H
1617 #include <winsock2.h>
1618 #include <ws2tcpip.h>
1620 #include <sys/socket.h>
1621 #include <netinet/in.h>
1622 #if defined (__TANDEM)
1623 # include <netinet/in6.h>
1626 #include <stdlib.h> /* for exit() */
1629 struct sockaddr_in6 s;
1631 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1646 if test "$ipv6" = yes; then
1647 curl_ipv6_msg="enabled"
1648 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
1650 AC_SUBST(IPV6_ENABLED)
1652 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1653 AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
1654 #include <sys/types.h>
1655 #ifdef HAVE_WINSOCK2_H
1656 #include <winsock2.h>
1657 #include <ws2tcpip.h>
1659 #include <netinet/in.h>
1660 #if defined (__TANDEM)
1661 # include <netinet/in6.h>
1665 struct sockaddr_in6 s;
1666 s.sin6_scope_id = 0;
1668 AC_MSG_RESULT([yes])
1669 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1675 dnl **********************************************************************
1676 dnl Check if the operating system allows programs to write to their own argv[]
1677 dnl **********************************************************************
1679 AC_MSG_CHECKING([if argv can be written to])
1681 int main(int argc, char **argv)
1685 return (argv[0][0] == ' ')?0:1;
1688 curl_cv_writable_argv=yes
1690 curl_cv_writable_argv=no
1692 curl_cv_writable_argv=cross
1694 case $curl_cv_writable_argv in
1696 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1704 AC_MSG_WARN([the previous check could not be made default was used])
1708 dnl **********************************************************************
1709 dnl Check for GSS-API libraries
1710 dnl **********************************************************************
1712 dnl check for GSS-API stuff in the /usr as default
1715 AC_ARG_WITH(gssapi-includes,
1716 AS_HELP_STRING([--with-gssapi-includes=DIR],
1717 [Specify location of GSS-API headers]),
1718 [ GSSAPI_INCS="-I$withval"
1722 AC_ARG_WITH(gssapi-libs,
1723 AS_HELP_STRING([--with-gssapi-libs=DIR],
1724 [Specify location of GSS-API libs]),
1725 [ GSSAPI_LIB_DIR="-L$withval"
1730 AS_HELP_STRING([--with-gssapi=DIR],
1731 [Where to look for GSS-API]), [
1732 GSSAPI_ROOT="$withval"
1733 if test x"$GSSAPI_ROOT" != xno; then
1735 if test x"$GSSAPI_ROOT" = xyes; then
1736 dnl if yes, then use default root
1742 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1744 save_CPPFLAGS="$CPPFLAGS"
1745 AC_MSG_CHECKING([if GSS-API support is requested])
1746 if test x"$want_gss" = xyes; then
1749 if test $GSSAPI_ROOT != "/usr"; then
1750 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
1752 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1754 if test -z "$GSSAPI_INCS"; then
1755 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1756 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1757 elif test "$PKGCONFIG" != "no" ; then
1758 GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
1759 elif test -f "$KRB5CONFIG"; then
1760 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1761 elif test "$GSSAPI_ROOT" != "yes"; then
1762 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1766 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1768 AC_CHECK_HEADER(gss.h,
1770 dnl found in the given dirs
1771 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1775 dnl not found, check Heimdal or MIT
1776 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1778 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1783 #ifdef HAVE_GSSAPI_GSSAPI_H
1784 #include <gssapi/gssapi.h>
1787 if test "x$not_mit" = "x1"; then
1788 dnl MIT not found, check for Heimdal
1789 AC_CHECK_HEADER(gssapi.h,
1792 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1795 dnl no header found, disabling GSS
1797 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1802 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1803 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1804 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1807 #include <gssapi/gssapi.h>
1808 #include <gssapi/gssapi_generic.h>
1809 #include <gssapi/gssapi_krb5.h>
1814 GSS_C_NT_HOSTBASED_SERVICE,
1818 AC_MSG_RESULT([yes])
1821 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1822 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1830 if test x"$want_gss" = xyes; then
1831 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1833 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1835 if test -n "$gnu_gss"; then
1836 curl_gss_msg="enabled (GNU GSS)"
1837 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1839 elif test -z "$GSSAPI_LIB_DIR"; then
1842 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1845 if test $GSSAPI_ROOT != "/usr"; then
1846 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
1848 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1850 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1851 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1853 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1854 LIBS="$gss_libs $LIBS"
1855 elif test "$PKGCONFIG" != "no" ; then
1856 gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
1857 LIBS="$gss_libs $LIBS"
1858 elif test -f "$KRB5CONFIG"; then
1859 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1861 gss_libs=`$KRB5CONFIG --libs gssapi`
1862 LIBS="$gss_libs $LIBS"
1869 gss_libname="gssapi"
1873 if test "$GSSAPI_ROOT" != "yes"; then
1874 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1875 LIBS="-l$gss_libname $LIBS"
1877 LIBS="-l$gss_libname $LIBS"
1883 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1889 LIBS="-lgssapi $LIBS"
1894 CPPFLAGS="$save_CPPFLAGS"
1897 if test x"$want_gss" = xyes; then
1898 AC_MSG_CHECKING([if we can link against GSS-API library])
1900 AC_LANG_FUNC_LINK_TRY([gss_init_sec_context])
1902 AC_MSG_RESULT([yes])
1905 AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.])
1910 if test x"$want_gss" = "xyes"; then
1911 build_libstubgss=yes
1914 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
1916 dnl -------------------------------------------------------------
1917 dnl parse --with-default-ssl-backend so it can be validated below
1918 dnl -------------------------------------------------------------
1920 DEFAULT_SSL_BACKEND=no
1921 VALID_DEFAULT_SSL_BACKEND=
1922 AC_ARG_WITH(default-ssl-backend,
1923 AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
1924 AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
1925 [DEFAULT_SSL_BACKEND=$withval])
1926 case "$DEFAULT_SSL_BACKEND" in
1928 dnl --without-default-ssl-backend option used
1931 dnl --with-default-ssl-backend option used without name
1932 AC_MSG_ERROR([The name of the default SSL backend is required.])
1935 dnl --with-default-ssl-backend option used with name
1936 AC_SUBST(DEFAULT_SSL_BACKEND)
1937 dnl needs to be validated below
1938 VALID_DEFAULT_SSL_BACKEND=no
1943 CURL_WITH_SECURETRANSPORT
1953 dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
1954 if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then
1955 LIBS="-ladvapi32 -lcrypt32 $LIBS"
1958 dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
1959 if test "x$curl_cv_native_windows" = "xyes" &&
1960 test "x$curl_mingw_original" = "xno"; then
1961 LIBS="-lbcrypt $LIBS"
1964 case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$RUSTLS_ENABLED"
1967 AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more.
1968 Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl or --with-rustls to address this.])
1971 # one SSL backend is enabled
1972 AC_SUBST(SSL_ENABLED)
1974 AC_MSG_NOTICE([built with one SSL backend])
1977 # explicitly built without TLS
1980 AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library
1981 (e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl, --with-rustls).
1982 Since these are conflicting parameters, verify which is the desired one and drop the other.])
1985 # more than one SSL backend is enabled
1986 AC_SUBST(SSL_ENABLED)
1988 AC_SUBST(CURL_WITH_MULTI_SSL)
1989 CURL_WITH_MULTI_SSL="1"
1990 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
1991 AC_MSG_NOTICE([built with multiple SSL backends])
1995 if test -n "$ssl_backends"; then
1996 curl_ssl_msg="enabled ($ssl_backends)"
1999 if test no = "$VALID_DEFAULT_SSL_BACKEND"
2001 if test -n "$SSL_ENABLED"
2003 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
2005 AC_MSG_ERROR([Default SSL backend requires SSL!])
2007 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
2009 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
2012 dnl **********************************************************************
2013 dnl Check for the CA bundle
2014 dnl **********************************************************************
2016 if test -n "$check_for_ca_bundle"; then
2017 CURL_CHECK_CA_BUNDLE
2020 dnl **********************************************************************
2021 dnl Check for libpsl
2022 dnl **********************************************************************
2025 AS_HELP_STRING([--without-libpsl],
2026 [disable support for libpsl cookie checking]),
2027 with_libpsl=$withval,
2029 if test $with_libpsl != "no"; then
2030 AC_SEARCH_LIBS(psl_builtin, psl,
2031 [curl_psl_msg="enabled";
2032 AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
2034 [curl_psl_msg="no (libpsl not found)";
2035 AC_MSG_WARN([libpsl was not found])
2039 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
2042 dnl **********************************************************************
2043 dnl Check for libgsasl
2044 dnl **********************************************************************
2046 AC_ARG_WITH(libgsasl,
2047 AS_HELP_STRING([--without-libgsasl],
2048 [disable libgsasl support for SCRAM]),
2049 with_libgsasl=$withval,
2051 if test $with_libgsasl != "no"; then
2052 AC_SEARCH_LIBS(gsasl_init, gsasl,
2053 [curl_gsasl_msg="enabled";
2054 AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
2056 [curl_gsasl_msg="no (libgsasl not found)";
2057 AC_MSG_WARN([libgsasl was not found])
2061 AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
2063 AC_ARG_WITH(libmetalink,,
2064 AC_MSG_ERROR([--with-libmetalink no longer works!]))
2066 dnl **********************************************************************
2067 dnl Check for the presence of LIBSSH2 libraries and headers
2068 dnl **********************************************************************
2070 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
2072 AC_ARG_WITH(libssh2,dnl
2073 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])
2074 AS_HELP_STRING([--with-libssh2], [enable libssh2]),
2075 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
2079 AC_ARG_WITH(libssh,dnl
2080 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])
2081 AS_HELP_STRING([--with-libssh], [enable libssh]),
2082 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2085 AC_ARG_WITH(wolfssh,dnl
2086 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])
2087 AS_HELP_STRING([--with-wolfssh], [enable wolfssh]),
2088 OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
2090 if test X"$OPT_LIBSSH2" != Xno; then
2091 dnl backup the pre-libssh2 variables
2092 CLEANLDFLAGS="$LDFLAGS"
2093 CLEANCPPFLAGS="$CPPFLAGS"
2096 case "$OPT_LIBSSH2" in
2098 dnl --with-libssh2 (without path) used
2099 CURL_CHECK_PKGCONFIG(libssh2)
2101 if test "$PKGCONFIG" != "no" ; then
2102 LIB_SSH2=`$PKGCONFIG --libs libssh2`
2103 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2104 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2105 version=`$PKGCONFIG --modversion libssh2`
2106 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
2111 dnl no --with-libssh2 option given, just check default places
2114 dnl use the given --with-libssh2 spot
2115 PREFIX_SSH2=$OPT_LIBSSH2
2119 dnl if given with a prefix, we set -L and -I based on that
2120 if test -n "$PREFIX_SSH2"; then
2122 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2123 CPP_SSH2=-I${PREFIX_SSH2}/include
2124 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2127 LDFLAGS="$LDFLAGS $LD_SSH2"
2128 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2129 LIBS="$LIB_SSH2 $LIBS"
2131 dnl check for function added in libssh2 version 1.0
2132 AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
2134 AC_CHECK_HEADER(libssh2.h,
2135 curl_ssh_msg="enabled (libSSH2)"
2137 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2138 AC_SUBST(USE_LIBSSH2, [1])
2141 if test X"$OPT_LIBSSH2" != Xoff &&
2142 test "$LIBSSH2_ENABLED" != "1"; then
2143 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2146 if test "$LIBSSH2_ENABLED" = "1"; then
2147 if test -n "$DIR_SSH2"; then
2148 dnl when the libssh2 shared libs were found in a path that the run-time
2149 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2150 dnl to prevent further configure tests to fail due to this
2152 if test "x$cross_compiling" != "xyes"; then
2153 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
2154 export CURL_LIBRARY_PATH
2155 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2159 dnl no libssh2, revert back to clean variables
2160 LDFLAGS=$CLEANLDFLAGS
2161 CPPFLAGS=$CLEANCPPFLAGS
2164 elif test X"$OPT_LIBSSH" != Xno; then
2165 dnl backup the pre-libssh variables
2166 CLEANLDFLAGS="$LDFLAGS"
2167 CLEANCPPFLAGS="$CPPFLAGS"
2170 case "$OPT_LIBSSH" in
2172 dnl --with-libssh (without path) used
2173 CURL_CHECK_PKGCONFIG(libssh)
2175 if test "$PKGCONFIG" != "no" ; then
2176 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2177 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2178 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2179 version=`$PKGCONFIG --modversion libssh`
2180 DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
2185 dnl no --with-libssh option given, just check default places
2188 dnl use the given --with-libssh spot
2189 PREFIX_SSH=$OPT_LIBSSH
2193 dnl if given with a prefix, we set -L and -I based on that
2194 if test -n "$PREFIX_SSH"; then
2196 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2197 CPP_SSH=-I${PREFIX_SSH}/include
2198 DIR_SSH=${PREFIX_SSH}/lib$libsuff
2201 LDFLAGS="$LDFLAGS $LD_SSH"
2202 CPPFLAGS="$CPPFLAGS $CPP_SSH"
2203 LIBS="$LIB_SSH $LIBS"
2205 AC_CHECK_LIB(ssh, ssh_new)
2207 AC_CHECK_HEADER(libssh/libssh.h,
2208 curl_ssh_msg="enabled (libSSH)"
2210 AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
2211 AC_SUBST(USE_LIBSSH, [1])
2214 if test X"$OPT_LIBSSH" != Xoff &&
2215 test "$LIBSSH_ENABLED" != "1"; then
2216 AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
2219 if test "$LIBSSH_ENABLED" = "1"; then
2220 if test -n "$DIR_SSH"; then
2221 dnl when the libssh shared libs were found in a path that the run-time
2222 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2223 dnl to prevent further configure tests to fail due to this
2225 if test "x$cross_compiling" != "xyes"; then
2226 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
2227 export CURL_LIBRARY_PATH
2228 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
2232 dnl no libssh, revert back to clean variables
2233 LDFLAGS=$CLEANLDFLAGS
2234 CPPFLAGS=$CLEANCPPFLAGS
2237 elif test X"$OPT_WOLFSSH" != Xno; then
2238 dnl backup the pre-wolfssh variables
2239 CLEANLDFLAGS="$LDFLAGS"
2240 CLEANCPPFLAGS="$CPPFLAGS"
2244 if test "$OPT_WOLFSSH" != yes; then
2245 WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
2246 LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
2247 CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
2250 AC_CHECK_LIB(wolfssh, wolfSSH_Init)
2252 AC_CHECK_HEADERS(wolfssh/ssh.h,
2253 curl_ssh_msg="enabled (wolfSSH)"
2255 AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
2256 AC_SUBST(USE_WOLFSSH, [1])
2261 dnl **********************************************************************
2262 dnl Check for the presence of LIBRTMP libraries and headers
2263 dnl **********************************************************************
2265 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2267 AC_ARG_WITH(librtmp,dnl
2268 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])
2269 AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2270 OPT_LIBRTMP=$withval)
2272 if test X"$OPT_LIBRTMP" != Xno; then
2273 dnl backup the pre-librtmp variables
2274 CLEANLDFLAGS="$LDFLAGS"
2275 CLEANCPPFLAGS="$CPPFLAGS"
2278 case "$OPT_LIBRTMP" in
2280 dnl --with-librtmp (without path) used
2281 CURL_CHECK_PKGCONFIG(librtmp)
2283 if test "$PKGCONFIG" != "no" ; then
2284 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2285 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2286 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2287 version=`$PKGCONFIG --modversion librtmp`
2288 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
2290 dnl To avoid link errors, we do not allow --librtmp without
2291 dnl a pkgconfig file
2292 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2297 dnl no --with-librtmp option given, just check default places
2301 dnl use the given --with-librtmp spot
2303 PREFIX_RTMP=$OPT_LIBRTMP
2307 dnl if given with a prefix, we set -L and -I based on that
2308 if test -n "$PREFIX_RTMP"; then
2309 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
2310 CPP_RTMP=-I${PREFIX_RTMP}/include
2311 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
2314 LDFLAGS="$LDFLAGS $LD_RTMP"
2315 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2316 LIBS="$LIB_RTMP $LIBS"
2318 AC_CHECK_LIB(rtmp, RTMP_Init,
2320 AC_CHECK_HEADERS(librtmp/rtmp.h,
2321 curl_rtmp_msg="enabled (librtmp)"
2323 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
2324 AC_SUBST(USE_LIBRTMP, [1])
2327 dnl not found, revert back to clean variables
2328 LDFLAGS=$CLEANLDFLAGS
2329 CPPFLAGS=$CLEANCPPFLAGS
2333 if test X"$OPT_LIBRTMP" != Xoff &&
2334 test "$LIBRTMP_ENABLED" != "1"; then
2335 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
2340 dnl **********************************************************************
2341 dnl Check for linker switch for versioned symbols
2342 dnl **********************************************************************
2344 versioned_symbols_flavour=
2345 AC_MSG_CHECKING([whether versioned symbols are wanted])
2346 AC_ARG_ENABLE(versioned-symbols,
2347 AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2348 AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2349 [ case "$enableval" in
2350 yes) AC_MSG_RESULT(yes)
2351 AC_MSG_CHECKING([if libraries can be versioned])
2352 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
2353 if test -z "$GLD"; then
2355 AC_MSG_WARN([You need an ld version supporting the --version-script option])
2358 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
2359 versioned_symbols_flavour="MULTISSL_"
2360 elif test "x$OPENSSL_ENABLED" = "x1"; then
2361 versioned_symbols_flavour="OPENSSL_"
2362 elif test "x$GNUTLS_ENABLED" = "x1"; then
2363 versioned_symbols_flavour="GNUTLS_"
2364 elif test "x$NSS_ENABLED" = "x1"; then
2365 versioned_symbols_flavour="NSS_"
2366 elif test "x$WOLFSSL_ENABLED" = "x1"; then
2367 versioned_symbols_flavour="WOLFSSL_"
2368 elif test "x$SCHANNEL_ENABLED" = "x1"; then
2369 versioned_symbols_flavour="SCHANNEL_"
2370 elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
2371 versioned_symbols_flavour="SECURE_TRANSPORT_"
2373 versioned_symbols_flavour=""
2375 versioned_symbols="yes"
2379 *) AC_MSG_RESULT(no)
2387 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
2388 ["$versioned_symbols_flavour"])
2389 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
2390 [test "x$versioned_symbols" = 'xyes'])
2392 dnl Update .plist file with current version
2393 AC_SUBST([CURL_PLIST_VERSION],
2396 dnl -------------------------------------------------
2397 dnl check winidn option before other IDN libraries
2398 dnl -------------------------------------------------
2400 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
2401 OPT_WINIDN="default"
2403 AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
2404 AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
2405 OPT_WINIDN=$withval)
2406 case "$OPT_WINIDN" in
2408 dnl --without-winidn option used or configure option not specified
2413 dnl --with-winidn option used without path
2415 want_winidn_path="default"
2416 AC_MSG_RESULT([yes])
2419 dnl --with-winidn option used with path
2421 want_winidn_path="$withval"
2422 AC_MSG_RESULT([yes ($withval)])
2426 if test "$want_winidn" = "yes"; then
2427 dnl winidn library support has been requested
2428 clean_CFLAGS="$CFLAGS"
2429 clean_CPPFLAGS="$CPPFLAGS"
2430 clean_LDFLAGS="$LDFLAGS"
2432 WINIDN_LIBS="-lnormaliz"
2435 if test "$want_winidn_path" != "default"; then
2436 dnl path has been specified
2437 dnl pkg-config not available or provides no info
2438 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
2439 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
2440 WINIDN_DIR="$want_winidn_path/lib$libsuff"
2443 dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
2446 #include <windows.h>
2448 #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
2454 CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2455 CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2456 CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2457 CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2458 WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
2461 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
2462 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
2463 LIBS="$WINIDN_LIBS $LIBS"
2465 AC_MSG_CHECKING([if IdnToUnicode can be linked])
2468 #include <windows.h>
2470 IdnToUnicode(0, NULL, 0, NULL, 0);
2473 AC_MSG_RESULT([yes])
2474 tst_links_winidn="yes"
2477 tst_links_winidn="no"
2480 if test "$tst_links_winidn" = "yes"; then
2481 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
2482 AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
2483 AC_SUBST([IDN_ENABLED], [1])
2484 curl_idn_msg="enabled (Windows-native)"
2486 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2487 CFLAGS="$clean_CFLAGS"
2488 CPPFLAGS="$clean_CPPFLAGS"
2489 LDFLAGS="$clean_LDFLAGS"
2494 dnl **********************************************************************
2495 dnl Check for the presence of IDN libraries and headers
2496 dnl **********************************************************************
2498 AC_MSG_CHECKING([whether to build with libidn2])
2500 AC_ARG_WITH(libidn2,
2501 AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
2502 AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2504 if test "x$tst_links_winidn" = "xyes"; then
2506 AC_MSG_RESULT([no (using winidn instead)])
2510 dnl --without-libidn2 option used
2515 dnl configure option not specified
2517 want_idn_path="default"
2518 AC_MSG_RESULT([(assumed) yes])
2521 dnl --with-libidn2 option used without path
2523 want_idn_path="default"
2524 AC_MSG_RESULT([yes])
2527 dnl --with-libidn2 option used with path
2529 want_idn_path="$withval"
2530 AC_MSG_RESULT([yes ($withval)])
2535 if test "$want_idn" = "yes"; then
2536 dnl idn library support has been requested
2537 clean_CPPFLAGS="$CPPFLAGS"
2538 clean_LDFLAGS="$LDFLAGS"
2542 if test "$want_idn_path" != "default"; then
2543 dnl path has been specified
2544 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2545 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
2546 if test "$PKGCONFIG" != "no"; then
2547 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2548 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2549 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2550 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2551 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2552 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2553 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2555 dnl pkg-config not available or provides no info
2557 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2558 IDN_CPPFLAGS="-I$want_idn_path/include"
2559 IDN_DIR="$want_idn_path/lib$libsuff"
2562 dnl path not specified
2563 CURL_CHECK_PKGCONFIG(libidn2)
2564 if test "$PKGCONFIG" != "no"; then
2565 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2566 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2567 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2568 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2570 dnl pkg-config not available or provides no info
2575 if test "$PKGCONFIG" != "no"; then
2576 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2577 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2578 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2579 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2581 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2582 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2583 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2584 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2587 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
2588 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
2589 LIBS="$IDN_LIBS $LIBS"
2591 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
2593 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
2595 AC_MSG_RESULT([yes])
2596 tst_links_libidn="yes"
2599 tst_links_libidn="no"
2602 AC_CHECK_HEADERS( idn2.h )
2604 if test "$tst_links_libidn" = "yes"; then
2605 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
2606 dnl different versions of libidn have different setups of these:
2608 AC_SUBST([IDN_ENABLED], [1])
2609 curl_idn_msg="enabled (libidn2)"
2610 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2611 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
2612 export CURL_LIBRARY_PATH
2613 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
2616 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2617 CPPFLAGS="$clean_CPPFLAGS"
2618 LDFLAGS="$clean_LDFLAGS"
2623 dnl **********************************************************************
2624 dnl Check for nghttp2
2625 dnl **********************************************************************
2629 if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
2630 # without HTTP or with Hyper, nghttp2 is no use
2634 AC_ARG_WITH(nghttp2,
2635 AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
2636 AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2640 dnl --without-nghttp2 option used
2644 dnl --with-nghttp2 option used without path
2645 want_nghttp2="default"
2646 want_nghttp2_path=""
2647 want_nghttp2_pkg_config_path=""
2650 dnl --with-nghttp2 option used with path
2652 want_nghttp2_path="$withval"
2653 want_nghttp2_pkg_config_path="$withval/lib/pkgconfig"
2657 if test X"$want_nghttp2" != Xno; then
2658 dnl backup the pre-nghttp2 variables
2659 CLEANLDFLAGS="$LDFLAGS"
2660 CLEANCPPFLAGS="$CPPFLAGS"
2663 CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path)
2665 if test "$PKGCONFIG" != "no" ; then
2666 LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2667 $PKGCONFIG --libs-only-l libnghttp2`
2668 AC_MSG_NOTICE([-l is $LIB_H2])
2670 CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl
2671 $PKGCONFIG --cflags-only-I libnghttp2`
2672 AC_MSG_NOTICE([-I is $CPP_H2])
2674 LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2675 $PKGCONFIG --libs-only-L libnghttp2`
2676 AC_MSG_NOTICE([-L is $LD_H2])
2678 DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'`
2679 elif test x"$want_nghttp2_path" != x; then
2681 LD_H2=-L${want_nghttp2_path}/lib$libsuff
2682 CPP_H2=-I${want_nghttp2_path}/include
2683 DIR_H2=${want_nghttp2_path}/lib$libsuff
2684 elif test X"$want_nghttp2" != Xdefault; then
2685 dnl no nghttp2 pkg-config found and no custom directory specified,
2687 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2690 LDFLAGS="$LDFLAGS $LD_H2"
2691 CPPFLAGS="$CPPFLAGS $CPP_H2"
2692 LIBS="$LIB_H2 $LIBS"
2694 # use nghttp2_session_set_local_window_size to require nghttp2
2696 AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
2698 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
2699 curl_h2_msg="enabled (nghttp2)"
2701 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
2702 AC_SUBST(USE_NGHTTP2, [1])
2705 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2"
2706 export CURL_LIBRARY_PATH
2707 AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH])
2709 dnl not found, revert back to clean variables
2710 LDFLAGS=$CLEANLDFLAGS
2711 CPPFLAGS=$CLEANCPPFLAGS
2716 dnl **********************************************************************
2717 dnl Check for ngtcp2 (QUIC)
2718 dnl **********************************************************************
2722 if test "x$disable_http" = "xyes"; then
2723 # without HTTP, ngtcp2 is no use
2728 AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
2729 AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
2730 [OPT_TCP2=$withval])
2733 dnl --without-ngtcp2 option used
2737 dnl --with-ngtcp2 option used without path
2742 dnl --with-ngtcp2 option used with path
2744 want_tcp2_path="$withval/lib/pkgconfig"
2748 curl_tcp2_msg="no (--with-ngtcp2)"
2749 if test X"$want_tcp2" != Xno; then
2750 dnl backup the pre-ngtcp2 variables
2751 CLEANLDFLAGS="$LDFLAGS"
2752 CLEANCPPFLAGS="$CPPFLAGS"
2755 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
2757 if test "$PKGCONFIG" != "no" ; then
2758 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2759 $PKGCONFIG --libs-only-l libngtcp2`
2760 AC_MSG_NOTICE([-l is $LIB_TCP2])
2762 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2763 $PKGCONFIG --cflags-only-I libngtcp2`
2764 AC_MSG_NOTICE([-I is $CPP_TCP2])
2766 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2767 $PKGCONFIG --libs-only-L libngtcp2`
2768 AC_MSG_NOTICE([-L is $LD_TCP2])
2770 LDFLAGS="$LDFLAGS $LD_TCP2"
2771 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
2772 LIBS="$LIB_TCP2 $LIBS"
2774 if test "x$cross_compiling" != "xyes"; then
2775 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
2777 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
2779 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
2781 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
2782 AC_SUBST(USE_NGTCP2, [1])
2783 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
2784 export CURL_LIBRARY_PATH
2785 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
2788 dnl not found, revert back to clean variables
2789 LDFLAGS=$CLEANLDFLAGS
2790 CPPFLAGS=$CLEANCPPFLAGS
2795 dnl no ngtcp2 pkg-config found, deal with it
2796 if test X"$want_tcp2" != Xdefault; then
2797 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2798 dnl a pkgconfig file
2799 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
2805 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
2806 dnl backup the pre-ngtcp2_crypto_openssl variables
2807 CLEANLDFLAGS="$LDFLAGS"
2808 CLEANCPPFLAGS="$CPPFLAGS"
2811 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
2813 if test "$PKGCONFIG" != "no" ; then
2814 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2815 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
2816 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
2818 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2819 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
2820 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
2822 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2823 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
2824 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
2826 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
2827 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
2828 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
2830 if test "x$cross_compiling" != "xyes"; then
2831 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
2833 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_recv_client_initial_cb,
2835 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2837 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
2838 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
2839 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
2840 export CURL_LIBRARY_PATH
2841 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
2844 dnl not found, revert back to clean variables
2845 LDFLAGS=$CLEANLDFLAGS
2846 CPPFLAGS=$CLEANCPPFLAGS
2851 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
2852 if test X"$want_tcp2" != Xdefault; then
2853 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2854 dnl a pkgconfig file
2855 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
2860 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
2861 dnl backup the pre-ngtcp2_crypto_gnutls variables
2862 CLEANLDFLAGS="$LDFLAGS"
2863 CLEANCPPFLAGS="$CPPFLAGS"
2866 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
2868 if test "$PKGCONFIG" != "no" ; then
2869 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2870 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
2871 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
2873 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2874 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
2875 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
2877 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2878 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
2879 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
2881 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
2882 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
2883 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
2885 if test "x$cross_compiling" != "xyes"; then
2886 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
2888 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb,
2890 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2892 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
2893 AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
2894 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
2895 export CURL_LIBRARY_PATH
2896 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
2899 dnl not found, revert back to clean variables
2900 LDFLAGS=$CLEANLDFLAGS
2901 CPPFLAGS=$CLEANCPPFLAGS
2906 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
2907 if test X"$want_tcp2" != Xdefault; then
2908 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2909 dnl a pkgconfig file
2910 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
2915 if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then
2916 dnl backup the pre-ngtcp2_crypto_wolfssl variables
2917 CLEANLDFLAGS="$LDFLAGS"
2918 CLEANCPPFLAGS="$CPPFLAGS"
2921 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path)
2923 if test "$PKGCONFIG" != "no" ; then
2924 LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2925 $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl`
2926 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL])
2928 CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2929 $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl`
2930 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL])
2932 LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2933 $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl`
2934 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL])
2936 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL"
2937 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL"
2938 LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS"
2940 if test "x$cross_compiling" != "xyes"; then
2941 DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'`
2943 AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb,
2945 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2947 AC_DEFINE(USE_NGTCP2_CRYPTO_WOLFSSL, 1, [if ngtcp2_crypto_wolfssl is in use])
2948 AC_SUBST(USE_NGTCP2_CRYPTO_WOLFSSL, [1])
2949 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL"
2950 export CURL_LIBRARY_PATH
2951 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH])
2954 dnl not found, revert back to clean variables
2955 LDFLAGS=$CLEANLDFLAGS
2956 CPPFLAGS=$CLEANCPPFLAGS
2961 dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it
2962 if test X"$want_tcp2" != Xdefault; then
2963 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2964 dnl a pkgconfig file
2965 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.])
2970 dnl **********************************************************************
2971 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
2972 dnl **********************************************************************
2976 if test "x$NGTCP2_ENABLED" = "x"; then
2977 # without ngtcp2, nghttp3 is of no use for us
2981 AC_ARG_WITH(nghttp3,
2982 AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
2983 AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
2984 [OPT_NGHTTP3=$withval])
2985 case "$OPT_NGHTTP3" in
2987 dnl --without-nghttp3 option used
2991 dnl --with-nghttp3 option used without path
2992 want_nghttp3="default"
2993 want_nghttp3_path=""
2996 dnl --with-nghttp3 option used with path
2998 want_nghttp3_path="$withval/lib/pkgconfig"
3002 curl_http3_msg="no (--with-nghttp3)"
3003 if test X"$want_nghttp3" != Xno; then
3004 dnl backup the pre-nghttp3 variables
3005 CLEANLDFLAGS="$LDFLAGS"
3006 CLEANCPPFLAGS="$CPPFLAGS"
3009 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3011 if test "$PKGCONFIG" != "no" ; then
3012 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3013 $PKGCONFIG --libs-only-l libnghttp3`
3014 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3016 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
3017 $PKGCONFIG --cflags-only-I libnghttp3`
3018 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3020 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3021 $PKGCONFIG --libs-only-L libnghttp3`
3022 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3024 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3025 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3026 LIBS="$LIB_NGHTTP3 $LIBS"
3028 if test "x$cross_compiling" != "xyes"; then
3029 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
3031 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
3033 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3034 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3036 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3037 AC_SUBST(USE_NGHTTP3, [1])
3038 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3039 export CURL_LIBRARY_PATH
3040 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3041 experimental="$experimental HTTP3"
3044 dnl not found, revert back to clean variables
3045 LDFLAGS=$CLEANLDFLAGS
3046 CPPFLAGS=$CLEANCPPFLAGS
3051 dnl no nghttp3 pkg-config found, deal with it
3052 if test X"$want_nghttp3" != Xdefault; then
3053 dnl To avoid link errors, we do not allow --with-nghttp3 without
3054 dnl a pkgconfig file
3055 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3061 dnl **********************************************************************
3062 dnl Check for quiche (QUIC)
3063 dnl **********************************************************************
3067 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3068 # without HTTP or with ngtcp2, quiche is no use
3073 AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
3074 AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
3075 [OPT_QUICHE=$withval])
3076 case "$OPT_QUICHE" in
3078 dnl --without-quiche option used
3082 dnl --with-quiche option used without path
3083 want_quiche="default"
3087 dnl --with-quiche option used with path
3089 want_quiche_path="$withval"
3093 if test X"$want_quiche" != Xno; then
3095 if test "$NGHTTP3_ENABLED" = 1; then
3096 AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
3099 dnl backup the pre-quiche variables
3100 CLEANLDFLAGS="$LDFLAGS"
3101 CLEANCPPFLAGS="$CPPFLAGS"
3104 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3106 if test "$PKGCONFIG" != "no" ; then
3107 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3108 $PKGCONFIG --libs-only-l quiche`
3109 AC_MSG_NOTICE([-l is $LIB_QUICHE])
3111 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
3112 $PKGCONFIG --cflags-only-I quiche`
3113 AC_MSG_NOTICE([-I is $CPP_QUICHE])
3115 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3116 $PKGCONFIG --libs-only-L quiche`
3117 AC_MSG_NOTICE([-L is $LD_QUICHE])
3119 LDFLAGS="$LDFLAGS $LD_QUICHE"
3120 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3121 LIBS="$LIB_QUICHE $LIBS"
3123 if test "x$cross_compiling" != "xyes"; then
3124 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
3126 AC_CHECK_LIB(quiche, quiche_connect,
3128 AC_CHECK_HEADERS(quiche.h,
3129 experimental="$experimental HTTP3"
3130 AC_MSG_NOTICE([HTTP3 support is experimental])
3131 curl_h3_msg="enabled (quiche)"
3133 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3134 AC_SUBST(USE_QUICHE, [1])
3135 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
3136 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3137 export CURL_LIBRARY_PATH
3138 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
3142 #include <sys/socket.h>
3146 dnl not found, revert back to clean variables
3147 AC_MSG_ERROR([couldn't use quiche])
3150 dnl no quiche pkg-config found, deal with it
3151 if test X"$want_quiche" != Xdefault; then
3152 dnl To avoid link errors, we do not allow --with-quiche without
3153 dnl a pkgconfig file
3154 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3159 dnl **********************************************************************
3160 dnl Check for msh3 (QUIC)
3161 dnl **********************************************************************
3165 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3166 # without HTTP or with ngtcp2, msh3 is no use
3171 AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage])
3172 AS_HELP_STRING([--without-msh3],[Disable msh3 usage]),
3173 [OPT_MSH3=$withval])
3176 dnl --without-msh3 option used
3180 dnl --with-msh3 option used without path
3185 dnl --with-msh3 option used with path
3187 want_msh3_path="$withval"
3191 if test X"$want_msh3" != Xno; then
3193 if test "$NGHTTP3_ENABLED" = 1; then
3194 AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive])
3197 dnl backup the pre-msh3 variables
3198 CLEANLDFLAGS="$LDFLAGS"
3199 CLEANCPPFLAGS="$CPPFLAGS"
3202 if test -n "$want_msh3_path"; then
3203 LD_MSH3="-L$want_msh3_path/lib"
3204 CPP_MSH3="-I$want_msh3_path/include"
3205 DIR_MSH3="$want_msh3_path/lib"
3206 LDFLAGS="$LDFLAGS $LD_MSH3"
3207 CPPFLAGS="$CPPFLAGS $CPP_MSH3"
3211 AC_CHECK_LIB(msh3, MsH3ApiOpen,
3213 AC_CHECK_HEADERS(msh3.h,
3214 curl_h3_msg="enabled (msh3)"
3216 AC_DEFINE(USE_MSH3, 1, [if msh3 is in use])
3217 AC_SUBST(USE_MSH3, [1])
3218 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3"
3219 export CURL_LIBRARY_PATH
3220 AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]),
3221 experimental="$experimental HTTP3"
3224 dnl not found, revert back to clean variables
3225 LDFLAGS=$CLEANLDFLAGS
3226 CPPFLAGS=$CLEANCPPFLAGS
3231 dnl **********************************************************************
3232 dnl Check for zsh completion path
3233 dnl **********************************************************************
3235 OPT_ZSH_FPATH=default
3236 AC_ARG_WITH(zsh-functions-dir,
3237 AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3238 AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3239 [OPT_ZSH_FPATH=$withval])
3240 case "$OPT_ZSH_FPATH" in
3242 dnl --without-zsh-functions-dir option used
3245 dnl --with-zsh-functions-dir option used without path
3246 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3247 AC_SUBST(ZSH_FUNCTIONS_DIR)
3250 dnl --with-zsh-functions-dir option used with path
3251 ZSH_FUNCTIONS_DIR="$withval"
3252 AC_SUBST(ZSH_FUNCTIONS_DIR)
3256 dnl **********************************************************************
3257 dnl Check for fish completion path
3258 dnl **********************************************************************
3260 OPT_FISH_FPATH=default
3261 AC_ARG_WITH(fish-functions-dir,
3262 AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3263 AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3264 [OPT_FISH_FPATH=$withval])
3265 case "$OPT_FISH_FPATH" in
3267 dnl --without-fish-functions-dir option used
3270 dnl --with-fish-functions-dir option used without path
3271 CURL_CHECK_PKGCONFIG(fish)
3272 if test "$PKGCONFIG" != "no" ; then
3273 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
3275 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3277 AC_SUBST(FISH_FUNCTIONS_DIR)
3280 dnl --with-fish-functions-dir option used with path
3281 FISH_FUNCTIONS_DIR="$withval"
3282 AC_SUBST(FISH_FUNCTIONS_DIR)
3286 dnl Now check for the very most basic headers. Then we can use these
3287 dnl ones as default-headers when checking for the rest!
3329 dnl to do if not found
3333 dnl default includes
3335 #ifdef HAVE_SYS_TYPES_H
3336 #include <sys/types.h>
3338 #ifdef HAVE_SYS_TIME_H
3339 #include <sys/time.h>
3341 #ifdef HAVE_SYS_SELECT_H
3342 #include <sys/select.h>
3343 #elif defined(HAVE_UNISTD_H)
3346 #ifdef HAVE_SYS_SOCKET_H
3347 #include <sys/socket.h>
3349 #ifdef HAVE_NETINET_IN_H
3350 #include <netinet/in.h>
3352 #ifdef HAVE_NETINET_IN6_H
3353 #include <netinet/in6.h>
3355 #ifdef HAVE_SYS_UN_H
3362 dnl Checks for typedefs, structures, and compiler characteristics.
3364 CURL_CHECK_VARIADIC_MACROS
3367 CURL_CHECK_STRUCT_TIMEVAL
3368 CURL_VERIFY_RUNTIMELIBS
3377 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3378 CURL_SIZEOF(curl_off_t, [
3379 #include <curl/system.h>
3383 AC_CHECK_TYPE(long long,
3384 [AC_DEFINE(HAVE_LONGLONG, 1,
3385 [Define to 1 if the compiler supports the 'long long' data type.])]
3390 if test ${ac_cv_sizeof_curl_off_t} -lt 8; then
3391 AC_ARG_WITH(n64-deprecated,dnl
3392 AS_HELP_STRING([--with-n64-deprecated],[confirm you realize support for systems without 64 bit data types is going away]),
3393 if test X"$withval" != Xno; then
3394 OPT_N64_AWARE=$withval
3397 if test -z "$OPT_N64_AWARE"; then
3398 AC_MSG_ERROR([support for systems without 64 bit curl_off_t is deprecated, use --with-n64-deprecated until then])
3403 AC_CHECK_TYPE(ssize_t, ,
3404 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3406 # check for bool type
3407 AC_CHECK_TYPE([bool],[
3408 AC_DEFINE(HAVE_BOOL_T, 1,
3409 [Define to 1 if bool is an available type.])
3411 #ifdef HAVE_SYS_TYPES_H
3412 #include <sys/types.h>
3414 #ifdef HAVE_STDBOOL_H
3415 #include <stdbool.h>
3419 # check for sa_family_t
3420 AC_CHECK_TYPE(sa_family_t,
3421 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3424 AC_CHECK_TYPE(ADDRESS_FAMILY,
3425 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3426 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3428 #ifdef HAVE_SYS_SOCKET_H
3429 #include <sys/socket.h>
3434 #ifdef HAVE_SYS_SOCKET_H
3435 #include <sys/socket.h>
3439 # check for suseconds_t
3440 AC_CHECK_TYPE([suseconds_t],[
3441 AC_DEFINE(HAVE_SUSECONDS_T, 1,
3442 [Define to 1 if suseconds_t is an available type.])
3444 #ifdef HAVE_SYS_TYPES_H
3445 #include <sys/types.h>
3447 #ifdef HAVE_SYS_TIME_H
3448 #include <sys/time.h>
3452 AC_MSG_CHECKING([if time_t is unsigned])
3460 AC_MSG_RESULT([yes])
3461 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3465 dnl cross-compiling, most systems are unsigned
3469 CURL_CONFIGURE_PULL_SYS_POLL
3473 TYPE_SOCKADDR_STORAGE
3475 CURL_CHECK_FUNC_SELECT
3477 CURL_CHECK_FUNC_RECV
3478 CURL_CHECK_FUNC_SEND
3479 CURL_CHECK_MSG_NOSIGNAL
3481 CURL_CHECK_FUNC_ALARM
3482 CURL_CHECK_FUNC_BASENAME
3483 CURL_CHECK_FUNC_CLOSESOCKET
3484 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3485 CURL_CHECK_FUNC_CONNECT
3486 CURL_CHECK_FUNC_FCNTL
3487 CURL_CHECK_FUNC_FREEADDRINFO
3488 CURL_CHECK_FUNC_FSETXATTR
3489 CURL_CHECK_FUNC_FTRUNCATE
3490 CURL_CHECK_FUNC_GETADDRINFO
3491 CURL_CHECK_FUNC_GETHOSTBYNAME
3492 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3493 CURL_CHECK_FUNC_GETHOSTNAME
3494 CURL_CHECK_FUNC_GETPEERNAME
3495 CURL_CHECK_FUNC_GETSOCKNAME
3496 CURL_CHECK_FUNC_IF_NAMETOINDEX
3497 CURL_CHECK_FUNC_GETIFADDRS
3498 CURL_CHECK_FUNC_GMTIME_R
3499 CURL_CHECK_FUNC_INET_NTOP
3500 CURL_CHECK_FUNC_INET_PTON
3501 CURL_CHECK_FUNC_IOCTLSOCKET
3502 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3503 CURL_CHECK_FUNC_MEMRCHR
3504 CURL_CHECK_FUNC_POLL
3505 CURL_CHECK_FUNC_SIGACTION
3506 CURL_CHECK_FUNC_SIGINTERRUPT
3507 CURL_CHECK_FUNC_SIGNAL
3508 CURL_CHECK_FUNC_SIGSETJMP
3509 CURL_CHECK_FUNC_SOCKET
3510 CURL_CHECK_FUNC_SOCKETPAIR
3511 CURL_CHECK_FUNC_STRCASECMP
3512 CURL_CHECK_FUNC_STRCMPI
3513 CURL_CHECK_FUNC_STRDUP
3514 CURL_CHECK_FUNC_STRERROR_R
3515 CURL_CHECK_FUNC_STRICMP
3516 CURL_CHECK_FUNC_STRTOK_R
3517 CURL_CHECK_FUNC_STRTOLL
3523 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3527 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
3529 #include <sys/types.h>]])
3532 AC_CHECK_FUNCS([fnmatch \
3542 mach_absolute_time \
3555 eval skipcheck=\$skipcheck_$func
3556 if test "x$skipcheck" != "xyes"; then
3557 AC_MSG_CHECKING([deeper for $func])
3564 AC_MSG_RESULT([yes])
3565 eval "ac_cv_func_$func=yes"
3566 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3567 [Define to 1 if you have the $func function.])
3569 AC_MSG_RESULT([but still no])
3574 CURL_CHECK_NONBLOCKING_SOCKET
3576 dnl ************************************************************
3577 dnl nroff tool stuff
3580 AC_PATH_PROG( PERL, perl, ,
3581 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3584 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3585 $PATH:/usr/bin/:/usr/local/bin )
3588 if test -n "$NROFF"; then
3589 dnl only check for nroff options if an nroff command was found
3591 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3593 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3594 if test -z "$mancheck"; then
3596 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3597 if test -z "$mancheck"; then
3599 AC_MSG_RESULT([failed])
3600 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3602 AC_MSG_RESULT([$MANOPT])
3605 AC_MSG_RESULT([$MANOPT])
3610 if test -z "$MANOPT"
3612 dnl if no nroff tool was found, or no option that could convert man pages
3613 dnl was found, then disable the built-in manual stuff
3614 AC_MSG_WARN([disabling built-in manual])
3618 dnl *************************************************************************
3619 dnl If the manual variable still is set, then we go with providing a built-in
3622 if test "$USE_MANUAL" = "1"; then
3623 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3624 curl_manual_msg="enabled"
3627 dnl set variable for use in automakefile(s)
3628 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3632 if test "x$curl_cv_native_windows" != "xyes" &&
3633 test "x$enable_shared" = "xyes"; then
3634 build_libhostname=yes
3636 build_libhostname=no
3638 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3640 if test "x$want_ares" != xyes; then
3641 CURL_CHECK_OPTION_THREADED_RESOLVER
3644 dnl ************************************************************
3645 dnl disable POSIX threads
3647 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3648 AC_ARG_ENABLE(pthreads,
3649 AS_HELP_STRING([--enable-pthreads],
3650 [Enable POSIX threads (default for threaded resolver)])
3651 AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3652 [ case "$enableval" in
3653 no) AC_MSG_RESULT(no)
3656 *) AC_MSG_RESULT(yes)
3665 dnl turn off pthreads if rt is disabled
3666 if test "$want_pthreads" != "no"; then
3667 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
3668 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
3670 if test "$dontwant_rt" != "no"; then
3671 dnl if --enable-pthreads was explicit then warn it's being ignored
3672 if test "$want_pthreads" = "yes"; then
3673 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
3679 dnl turn off pthreads if no threaded resolver
3680 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
3685 if test "$want_pthreads" != "no"; then
3686 AC_CHECK_HEADER(pthread.h,
3687 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3688 save_CFLAGS="$CFLAGS"
3689 dnl When statically linking against boringssl, -lpthread is added to LIBS.
3690 dnl Make sure to that this does not pass the check below, we really want
3691 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
3692 dnl lib1541 and lib1565 tests are built with these options. Otherwise
3693 dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
3697 dnl Check for libc variants without a separate pthread lib like bionic
3698 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3701 dnl on HPUX, life is more complicated...
3704 dnl it doesn't actually work without -lpthread
3705 USE_THREADS_POSIX=""
3711 dnl if it wasn't found without lib, search for it in pthread lib
3712 if test "$USE_THREADS_POSIX" != "1"
3714 # assign PTHREAD for pkg-config use
3719 dnl Check if compiler is xlC
3720 COMPILER_VERSION=`"$CC" -qversion 2>/dev/null`
3721 if test x"$COMPILER_VERSION" = "x"; then
3722 CFLAGS="$CFLAGS -pthread"
3724 CFLAGS="$CFLAGS -qthreaded"
3728 dnl No -pthread option, but link with -lpthread
3729 PTHREAD=" -lpthread"
3732 CFLAGS="$CFLAGS -pthread"
3735 AC_CHECK_LIB(pthread, pthread_create,
3736 [USE_THREADS_POSIX=1],
3737 [ CFLAGS="$save_CFLAGS"])
3740 if test "x$USE_THREADS_POSIX" = "x1"
3742 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3743 curl_res_msg="POSIX threaded"
3748 dnl threaded resolver check
3749 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
3750 if test "$want_pthreads" = "yes"; then
3751 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
3753 dnl If native Windows fallback on Win32 threads since no POSIX threads
3754 if test "$curl_cv_native_windows" = "yes"; then
3756 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
3757 curl_res_msg="Win32 threaded"
3759 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
3763 CURL_CONVERT_INCLUDE_TO_ISYSTEM
3765 dnl ************************************************************
3766 dnl disable verbose text strings
3768 AC_MSG_CHECKING([whether to enable verbose strings])
3769 AC_ARG_ENABLE(verbose,
3770 AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
3771 AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3772 [ case "$enableval" in
3775 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3776 curl_verbose_msg="no"
3778 *) AC_MSG_RESULT(yes)
3784 dnl ************************************************************
3785 dnl enable SSPI support
3787 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3789 AS_HELP_STRING([--enable-sspi],[Enable SSPI])
3790 AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
3791 [ case "$enableval" in
3793 if test "$curl_cv_native_windows" = "yes"; then
3795 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3796 AC_SUBST(USE_WINDOWS_SSPI, [1])
3797 curl_sspi_msg="enabled"
3800 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3804 if test "x$SCHANNEL_ENABLED" = "x1"; then
3805 # --with-schannel implies --enable-sspi
3812 if test "x$SCHANNEL_ENABLED" = "x1"; then
3813 # --with-schannel implies --enable-sspi
3820 dnl ************************************************************
3821 dnl disable cryptographic authentication
3823 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3824 AC_ARG_ENABLE(crypto-auth,
3825 AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3826 AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3827 [ case "$enableval" in
3830 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3831 CURL_DISABLE_CRYPTO_AUTH=1
3833 *) AC_MSG_RESULT(yes)
3839 dnl ************************************************************
3840 dnl disable NTLM support
3842 AC_MSG_CHECKING([whether to support NTLM])
3844 AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
3845 AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
3846 [ case "$enableval" in
3849 AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
3852 *) AC_MSG_RESULT(yes)
3858 CURL_CHECK_OPTION_NTLM_WB
3862 dnl ************************************************************
3863 dnl disable TLS-SRP authentication
3865 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
3866 AC_ARG_ENABLE(tls-srp,
3867 AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
3868 AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
3869 [ case "$enableval" in
3874 *) AC_MSG_RESULT(yes)
3882 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
3883 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
3885 curl_tls_srp_msg="enabled"
3888 dnl ************************************************************
3889 dnl disable Unix domain sockets support
3891 AC_MSG_CHECKING([whether to enable Unix domain sockets])
3892 AC_ARG_ENABLE(unix-sockets,
3893 AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
3894 AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
3895 [ case "$enableval" in
3896 no) AC_MSG_RESULT(no)
3897 want_unix_sockets=no
3899 *) AC_MSG_RESULT(yes)
3900 want_unix_sockets=yes
3904 want_unix_sockets=auto
3907 if test "x$want_unix_sockets" != "xno"; then
3908 if test "x$curl_cv_native_windows" = "xyes"; then
3910 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
3911 curl_unix_sockets_msg="enabled"
3913 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
3914 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
3915 AC_SUBST(USE_UNIX_SOCKETS, [1])
3916 curl_unix_sockets_msg="enabled"
3918 if test "x$want_unix_sockets" = "xyes"; then
3919 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
3927 dnl ************************************************************
3928 dnl disable cookies support
3930 AC_MSG_CHECKING([whether to support cookies])
3931 AC_ARG_ENABLE(cookies,
3932 AS_HELP_STRING([--enable-cookies],[Enable cookies support])
3933 AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
3934 [ case "$enableval" in
3937 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
3939 *) AC_MSG_RESULT(yes)
3945 dnl ************************************************************
3946 dnl disable socketpair
3948 AC_MSG_CHECKING([whether to support socketpair])
3949 AC_ARG_ENABLE(socketpair,
3950 AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
3951 AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
3952 [ case "$enableval" in
3955 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
3957 *) AC_MSG_RESULT(yes)
3963 dnl ************************************************************
3964 dnl disable HTTP authentication support
3966 AC_MSG_CHECKING([whether to support HTTP authentication])
3967 AC_ARG_ENABLE(http-auth,
3968 AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
3969 AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
3970 [ case "$enableval" in
3973 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
3975 *) AC_MSG_RESULT(yes)
3981 dnl ************************************************************
3982 dnl disable DoH support
3984 AC_MSG_CHECKING([whether to support DoH])
3986 AS_HELP_STRING([--enable-doh],[Enable DoH support])
3987 AS_HELP_STRING([--disable-doh],[Disable DoH support]),
3988 [ case "$enableval" in
3991 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
3993 *) AC_MSG_RESULT(yes)
3999 dnl ************************************************************
4000 dnl disable mime API support
4002 AC_MSG_CHECKING([whether to support the MIME API])
4004 AS_HELP_STRING([--enable-mime],[Enable mime API support])
4005 AS_HELP_STRING([--disable-mime],[Disable mime API support]),
4006 [ case "$enableval" in
4009 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
4011 *) AC_MSG_RESULT(yes)
4017 dnl ************************************************************
4018 dnl disable date parsing
4020 AC_MSG_CHECKING([whether to support date parsing])
4021 AC_ARG_ENABLE(dateparse,
4022 AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
4023 AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
4024 [ case "$enableval" in
4027 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
4029 *) AC_MSG_RESULT(yes)
4035 dnl ************************************************************
4038 AC_MSG_CHECKING([whether to support netrc parsing])
4039 AC_ARG_ENABLE(netrc,
4040 AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
4041 AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
4042 [ case "$enableval" in
4045 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
4047 *) AC_MSG_RESULT(yes)
4053 dnl ************************************************************
4054 dnl disable progress-meter
4056 AC_MSG_CHECKING([whether to support progress-meter])
4057 AC_ARG_ENABLE(progress-meter,
4058 AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
4059 AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
4060 [ case "$enableval" in
4063 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
4065 *) AC_MSG_RESULT(yes)
4071 dnl ************************************************************
4072 dnl disable shuffle DNS support
4074 AC_MSG_CHECKING([whether to support DNS shuffling])
4075 AC_ARG_ENABLE(dnsshuffle,
4076 AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
4077 AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
4078 [ case "$enableval" in
4081 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4083 *) AC_MSG_RESULT(yes)
4089 dnl ************************************************************
4090 dnl disable the curl_easy_options API
4092 AC_MSG_CHECKING([whether to support curl_easy_option*])
4093 AC_ARG_ENABLE(get-easy-options,
4094 AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
4095 AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
4096 [ case "$enableval" in
4099 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
4101 *) AC_MSG_RESULT(yes)
4107 dnl ************************************************************
4108 dnl switch on/off alt-svc
4110 AC_MSG_CHECKING([whether to support alt-svc])
4111 AC_ARG_ENABLE(alt-svc,
4112 AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
4113 AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
4114 [ case "$enableval" in
4117 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
4118 curl_altsvc_msg="no";
4121 *) AC_MSG_RESULT(yes)
4127 dnl ************************************************************
4128 dnl switch on/off headers-api
4130 AC_MSG_CHECKING([whether to support headers-api])
4131 AC_ARG_ENABLE(headers-api,
4132 AS_HELP_STRING([--enable-headers-api],[Enable headers-api support])
4133 AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]),
4134 [ case "$enableval" in
4135 no) AC_MSG_RESULT(no)
4136 curl_headers_msg="no (--enable-headers-api)"
4137 AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api])
4146 dnl only check for HSTS if there's SSL present
4147 if test -n "$SSL_ENABLED"; then
4149 dnl ************************************************************
4150 dnl switch on/off hsts
4152 AC_MSG_CHECKING([whether to support HSTS])
4154 AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
4155 AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
4156 [ case "$enableval" in
4161 *) AC_MSG_RESULT(yes)
4164 AC_MSG_RESULT($hsts)
4167 AC_MSG_NOTICE([disables HSTS due to lack of SSL])
4171 if test "x$hsts" != "xyes"; then
4172 curl_hsts_msg="no (--enable-hsts)";
4173 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
4176 dnl *************************************************************
4177 dnl check whether ECH support, if desired, is actually available
4179 if test "x$want_ech" != "xno"; then
4180 AC_MSG_CHECKING([whether ECH support is available])
4182 dnl assume NOT and look for sufficient condition
4186 dnl OpenSSL with a chosen ECH function should be enough
4187 dnl so more exhaustive checking seems unnecessary for now
4188 if test "x$OPENSSL_ENABLED" = "x1"; then
4189 AC_CHECK_FUNCS(SSL_get_ech_status,
4190 ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
4193 dnl add 'elif' chain here for additional implementations
4196 dnl now deal with whatever we found
4197 if test "x$ECH_ENABLED" = "x1"; then
4198 AC_DEFINE(USE_ECH, 1, [if ECH support is available])
4199 AC_MSG_RESULT($ECH_SUPPORT)
4200 experimental="$experimental ECH"
4202 AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
4206 dnl *************************************************************
4209 AC_MSG_CHECKING([whether to support WebSockets])
4210 AC_ARG_ENABLE(websockets,
4211 AS_HELP_STRING([--enable-websockets],[Enable WebSockets support])
4212 AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]),
4213 [ case "$enableval" in
4218 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4220 curl_ws_msg="enabled"
4221 AC_DEFINE_UNQUOTED(USE_WEBSOCKETS, [1], [enable websockets support])
4222 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS"
4223 if test "x$SSL_ENABLED" = "x1"; then
4224 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS"
4226 experimental="$experimental Websockets"
4228 dnl websockets requires >32 bit curl_off_t
4230 AC_MSG_WARN([Websockets disabled due to lack of >32 bit curl_off_t])
4238 dnl ************************************************************
4239 dnl hiding of library internal symbols
4241 CURL_CONFIGURE_SYMBOL_HIDING
4244 dnl All the library dependencies put into $LIB apply to libcurl only.
4246 LIBCURL_LIBS="$LIBS$PTHREAD"
4248 AC_SUBST(LIBCURL_LIBS)
4249 AC_SUBST(CURL_NETWORK_LIBS)
4250 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4252 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4253 dnl LIBS variable used in generated makefile at makefile processing
4254 dnl time. Doing this functionally prevents LIBS from being used for
4255 dnl all link targets in given makefile.
4257 AC_SUBST(BLANK_AT_MAKETIME)
4259 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4262 ENABLE_SHARED="$enable_shared"
4263 AC_SUBST(ENABLE_SHARED)
4265 dnl to let curl-config output the static libraries correctly
4266 ENABLE_STATIC="$enable_static"
4267 AC_SUBST(ENABLE_STATIC)
4269 dnl merge the pkg-config Libs.private field into Libs when static-only
4270 if test "x$enable_shared" = "xno"; then
4271 LIBCURL_NO_SHARED=$LIBCURL_LIBS
4275 AC_SUBST(LIBCURL_NO_SHARED)
4278 dnl For keeping supported features and protocols also in pkg-config file
4279 dnl since it is more cross-compile friendly than curl-config
4282 if test "x$OPENSSL_ENABLED" = "x1"; then
4283 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4284 elif test -n "$SSL_ENABLED"; then
4285 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4287 if test "x$IPV6_ENABLED" = "x1"; then
4288 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4290 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4291 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4293 if test "x$HAVE_LIBZ" = "x1"; then
4294 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4296 if test "x$HAVE_BROTLI" = "x1"; then
4297 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4299 if test "x$HAVE_ZSTD" = "x1"; then
4300 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
4302 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4303 -o "x$USE_THREADS_WIN32" = "x1"; then
4304 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4306 if test "x$IDN_ENABLED" = "x1"; then
4307 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4309 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4310 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4313 if test "x$HAVE_GSSAPI" = "x1"; then
4314 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4317 if test "x$curl_psl_msg" = "xenabled"; then
4318 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4321 if test "x$curl_gsasl_msg" = "xenabled"; then
4322 SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
4325 if test "x$enable_altsvc" = "xyes"; then
4326 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4328 if test "x$hsts" = "xyes"; then
4329 SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
4332 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4333 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4334 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4337 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4338 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4339 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4342 use_curl_ntlm_core=no
4344 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4345 "x$CURL_DISABLE_NTLM" != "x1"; then
4346 if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4347 -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
4348 -o "x$SECURETRANSPORT_ENABLED" = "x1" \
4349 -o "x$USE_WIN32_CRYPTO" = "x1" \
4350 -o "x$WOLFSSL_NTLM" = "x1"; then
4351 use_curl_ntlm_core=yes
4354 if test "x$use_curl_ntlm_core" = "xyes" \
4355 -o "x$USE_WINDOWS_SSPI" = "x1"; then
4356 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4358 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4359 "x$NTLM_WB_ENABLED" = "x1"; then
4360 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4365 if test "x$USE_TLS_SRP" = "x1"; then
4366 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4369 if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
4370 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4373 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1" \
4374 -o "x$USE_MSH3" = "x1"; then
4375 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
4378 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4379 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4382 dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
4383 if test "x$https_proxy" != "xno"; then
4384 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4385 -o "x$NSS_ENABLED" = "x1"; then
4386 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4390 if test "x$ECH_ENABLED" = "x1"; then
4391 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
4394 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4395 if test ${ac_cv_sizeof_off_t} -gt 4 -o \
4396 "$curl_win32_file_api" = "win32_large_files"; then
4397 SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
4401 if test "$tst_atomic" = "yes"; then
4402 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
4406 #include <windows.h>
4408 #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
4413 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
4418 dnl replace spaces with newlines
4420 dnl replace the newlines back to spaces
4421 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
4422 AC_SUBST(SUPPORT_FEATURES)
4424 dnl For supported protocols in pkg-config file
4425 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4426 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4427 if test "x$SSL_ENABLED" = "x1"; then
4428 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4431 if test "x$CURL_DISABLE_FTP" != "x1"; then
4432 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4433 if test "x$SSL_ENABLED" = "x1"; then
4434 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4437 if test "x$CURL_DISABLE_FILE" != "x1"; then
4438 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4440 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4441 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4443 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4444 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4445 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4446 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4447 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4448 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4452 if test "x$CURL_DISABLE_DICT" != "x1"; then
4453 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4455 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4456 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4458 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4459 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4460 if test "x$SSL_ENABLED" = "x1"; then
4461 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
4464 if test "x$CURL_DISABLE_MQTT" != "x1"; then
4465 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
4467 if test "x$CURL_DISABLE_POP3" != "x1"; then
4468 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4469 if test "x$SSL_ENABLED" = "x1"; then
4470 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4473 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4474 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4475 if test "x$SSL_ENABLED" = "x1"; then
4476 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4479 if test "x$CURL_DISABLE_SMB" != "x1" \
4480 -a "x$use_curl_ntlm_core" = "xyes"; then
4481 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4482 if test "x$SSL_ENABLED" = "x1"; then
4483 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4486 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4487 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4488 if test "x$SSL_ENABLED" = "x1"; then
4489 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4492 if test "x$USE_LIBSSH2" = "x1"; then
4493 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4494 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4496 if test "x$USE_LIBSSH" = "x1"; then
4497 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4498 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4500 if test "x$USE_WOLFSSH" = "x1"; then
4501 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4503 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4504 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4506 if test "x$USE_LIBRTMP" = "x1"; then
4507 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4510 dnl replace spaces with newlines
4512 dnl replace the newlines back to spaces
4513 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4515 AC_SUBST(SUPPORT_PROTOCOLS)
4517 dnl squeeze whitespace out of some variables
4525 squeeze LIBCURL_LIBS
4526 squeeze CURL_NETWORK_LIBS
4527 squeeze CURL_NETWORK_AND_TIME_LIBS
4529 squeeze SUPPORT_FEATURES
4530 squeeze SUPPORT_PROTOCOLS
4532 XC_CHECK_BUILD_FLAGS
4534 SSL_BACKENDS=${ssl_backends}
4535 AC_SUBST(SSL_BACKENDS)
4537 if test "x$want_curldebug_assumed" = "xyes" &&
4538 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4539 ac_configure_args="$ac_configure_args --enable-curldebug"
4542 AC_CONFIG_FILES([Makefile \
4544 docs/examples/Makefile \
4545 docs/libcurl/Makefile \
4546 docs/libcurl/opts/Makefile \
4547 docs/cmdline-opts/Makefile \
4549 include/curl/Makefile \
4556 tests/certs/Makefile \
4557 tests/certs/scripts/Makefile \
4558 tests/data/Makefile \
4559 tests/server/Makefile \
4560 tests/libtest/Makefile \
4561 tests/unit/Makefile \
4563 packages/vms/Makefile \
4569 CURL_GENERATE_CONFIGUREHELP_PM
4571 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4573 AC_MSG_NOTICE([Configured to build curl/libcurl:
4576 Install prefix: ${prefix}
4579 CPPFLAGS: ${CPPFLAGS}
4583 curl version: ${CURLVERSION}
4584 SSL: ${curl_ssl_msg}
4585 SSH: ${curl_ssh_msg}
4586 zlib: ${curl_zlib_msg}
4587 brotli: ${curl_brotli_msg}
4588 zstd: ${curl_zstd_msg}
4589 GSS-API: ${curl_gss_msg}
4590 GSASL: ${curl_gsasl_msg}
4591 TLS-SRP: ${curl_tls_srp_msg}
4592 resolver: ${curl_res_msg}
4593 IPv6: ${curl_ipv6_msg}
4594 Unix sockets: ${curl_unix_sockets_msg}
4595 IDN: ${curl_idn_msg}
4596 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4597 Built-in manual: ${curl_manual_msg}
4598 --libcurl option: ${curl_libcurl_msg}
4599 Verbose errors: ${curl_verbose_msg}
4600 Code coverage: ${curl_coverage_msg}
4601 SSPI: ${curl_sspi_msg}
4602 ca cert bundle: ${ca}${ca_warning}
4603 ca cert path: ${capath}${capath_warning}
4604 ca fallback: ${with_ca_fallback}
4605 LDAP: ${curl_ldap_msg}
4606 LDAPS: ${curl_ldaps_msg}
4607 RTSP: ${curl_rtsp_msg}
4608 RTMP: ${curl_rtmp_msg}
4609 PSL: ${curl_psl_msg}
4610 Alt-svc: ${curl_altsvc_msg}
4611 Headers API: ${curl_headers_msg}
4612 HSTS: ${curl_hsts_msg}
4613 HTTP1: ${curl_h1_msg}
4614 HTTP2: ${curl_h2_msg}
4615 HTTP3: ${curl_h3_msg}
4616 ECH: ${curl_ech_msg}
4617 WebSockets: ${curl_ws_msg}
4618 Protocols: ${SUPPORT_PROTOCOLS}
4619 Features: ${SUPPORT_FEATURES}
4621 if test -n "$experimental"; then
4623 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!