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 ICU-UC (IDN support)
2496 dnl **********************************************************************
2498 AC_MSG_CHECKING([whether to build with icu-uc])
2501 AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
2502 AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
2506 dnl --without-icu-uc option used
2511 dnl configure option not specified
2513 want_idn_path="default"
2514 AC_MSG_RESULT([(assumed) yes])
2517 dnl --with-icu-uc option used without path
2519 want_idn_path="default"
2520 AC_MSG_RESULT([yes])
2523 dnl --with-icu-uc option used with path
2525 want_idn_path="$withval"
2526 AC_MSG_RESULT([yes ($withval)])
2530 if test "$want_idn" = "yes"; then
2531 dnl idn library support has been requested
2532 clean_CPPFLAGS="$CPPFLAGS"
2533 clean_LDFLAGS="$LDFLAGS"
2537 if test "$want_idn_path" != "default"; then
2538 dnl path has been specified
2539 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2540 CURL_CHECK_PKGCONFIG(icu-uc, [$IDN_PCDIR])
2541 if test "$PKGCONFIG" != "no"; then
2542 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2543 $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
2544 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2545 $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
2546 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2547 $PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
2548 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
2550 dnl pkg-config not available or provides no info
2552 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2553 IDN_CPPFLAGS="-I$want_idn_path/include"
2554 IDN_DIR="$want_idn_path/lib$libsuff"
2557 dnl path not specified
2558 CURL_CHECK_PKGCONFIG(icu-uc)
2559 if test "$PKGCONFIG" != "no"; then
2560 IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
2561 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
2562 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
2563 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
2565 dnl pkg-config not available or provides no info
2570 if test "$PKGCONFIG" != "no"; then
2571 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2572 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2573 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2574 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2576 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2577 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2578 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2579 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2582 CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
2583 LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
2584 LIBS="$IDN_LIBS $LIBS"
2586 AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
2588 AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
2590 AC_MSG_RESULT([yes])
2597 if test "$tst_links_icu" = "yes"; then
2598 AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
2599 dnl different versions of libidn have different setups of these:
2601 AC_SUBST([IDN_ENABLED], [1])
2602 curl_idn_msg="enabled (icu-uc)"
2603 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2604 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
2605 export LD_LIBRARY_PATH
2606 AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
2609 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2610 CPPFLAGS="$clean_CPPFLAGS"
2611 LDFLAGS="$clean_LDFLAGS"
2617 dnl **********************************************************************
2618 dnl Check for the presence of IDN libraries and headers
2619 dnl **********************************************************************
2621 AC_MSG_CHECKING([whether to build with libidn2])
2623 AC_ARG_WITH(libidn2,
2624 AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
2625 AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2627 if test "x$tst_links_winidn" = "xyes"; then
2629 AC_MSG_RESULT([no (using winidn instead)])
2633 dnl --without-libidn2 option used
2638 dnl configure option not specified
2640 want_idn_path="default"
2641 AC_MSG_RESULT([(assumed) yes])
2644 dnl --with-libidn2 option used without path
2646 want_idn_path="default"
2647 AC_MSG_RESULT([yes])
2650 dnl --with-libidn2 option used with path
2652 want_idn_path="$withval"
2653 AC_MSG_RESULT([yes ($withval)])
2658 if test "$want_idn" = "yes"; then
2659 dnl idn library support has been requested
2660 clean_CPPFLAGS="$CPPFLAGS"
2661 clean_LDFLAGS="$LDFLAGS"
2665 if test "$want_idn_path" != "default"; then
2666 dnl path has been specified
2667 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2668 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
2669 if test "$PKGCONFIG" != "no"; then
2670 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2671 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2672 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2673 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2674 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2675 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2676 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2678 dnl pkg-config not available or provides no info
2680 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2681 IDN_CPPFLAGS="-I$want_idn_path/include"
2682 IDN_DIR="$want_idn_path/lib$libsuff"
2685 dnl path not specified
2686 CURL_CHECK_PKGCONFIG(libidn2)
2687 if test "$PKGCONFIG" != "no"; then
2688 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2689 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2690 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2691 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2693 dnl pkg-config not available or provides no info
2698 if test "$PKGCONFIG" != "no"; then
2699 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2700 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2701 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2702 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2704 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2705 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2706 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2707 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2710 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
2711 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
2712 LIBS="$IDN_LIBS $LIBS"
2714 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
2716 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
2718 AC_MSG_RESULT([yes])
2719 tst_links_libidn="yes"
2722 tst_links_libidn="no"
2725 AC_CHECK_HEADERS( idn2.h )
2727 if test "$tst_links_libidn" = "yes"; then
2728 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
2729 dnl different versions of libidn have different setups of these:
2731 AC_SUBST([IDN_ENABLED], [1])
2732 curl_idn_msg="enabled (libidn2)"
2733 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2734 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
2735 export CURL_LIBRARY_PATH
2736 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
2739 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2740 CPPFLAGS="$clean_CPPFLAGS"
2741 LDFLAGS="$clean_LDFLAGS"
2746 dnl Let's hope this split URL remains working:
2747 dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
2748 dnl genprogc/thread_quick_ref.htm
2750 dnl **********************************************************************
2751 dnl Check for strict SSL check
2752 dnl **********************************************************************
2753 AC_ARG_ENABLE([strict-ssl-check],
2754 AS_HELP_STRING([--enable-strict-ssl-check], [Enable strict SSL check usage]),
2755 [enable_strict_ssl_check=yes],
2756 [enable_strict_ssl_check=no])
2758 AS_IF([test "x$enable_strict_ssl_check" = "xyes"], [
2759 CPPFLAGS+=" -DUSE_TIZEN_FEATURE_STRICT_SSL_CHECK"
2760 SUPPORT_TIZEN_FEATURES="$SUPPORT_TIZEN_FEATURES strict-ssl-check"
2763 AM_CONDITIONAL(USE_TIZEN_FEATURE_STRICT_SSL_CHECK, test "x$enable_strict_ssl_check" = "xyes")
2765 dnl **********************************************************************
2767 dnl **********************************************************************
2769 AC_ARG_ENABLE([dlp],
2770 AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
2772 AS_IF([test "x$enable_dlp" = "xyes"], [
2773 AC_DEFINE(HAVE_TIZEN_DLP, 1, [Enadle DLP])
2777 AM_CONDITIONAL(HAVE_TIZEN_DLP, test "x$enable_dlp" = "xyes")
2779 dnl **********************************************************************
2780 dnl Check for nghttp2
2781 dnl **********************************************************************
2785 if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
2786 # without HTTP or with Hyper, nghttp2 is no use
2790 AC_ARG_WITH(nghttp2,
2791 AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
2792 AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2796 dnl --without-nghttp2 option used
2800 dnl --with-nghttp2 option used without path
2801 want_nghttp2="default"
2802 want_nghttp2_path=""
2803 want_nghttp2_pkg_config_path=""
2806 dnl --with-nghttp2 option used with path
2808 want_nghttp2_path="$withval"
2809 want_nghttp2_pkg_config_path="$withval/lib/pkgconfig"
2813 if test X"$want_nghttp2" != Xno; then
2814 dnl backup the pre-nghttp2 variables
2815 CLEANLDFLAGS="$LDFLAGS"
2816 CLEANCPPFLAGS="$CPPFLAGS"
2819 CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path)
2821 if test "$PKGCONFIG" != "no" ; then
2822 LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2823 $PKGCONFIG --libs-only-l libnghttp2`
2824 AC_MSG_NOTICE([-l is $LIB_H2])
2826 CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl
2827 $PKGCONFIG --cflags-only-I libnghttp2`
2828 AC_MSG_NOTICE([-I is $CPP_H2])
2830 LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2831 $PKGCONFIG --libs-only-L libnghttp2`
2832 AC_MSG_NOTICE([-L is $LD_H2])
2834 DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'`
2835 elif test x"$want_nghttp2_path" != x; then
2837 LD_H2=-L${want_nghttp2_path}/lib$libsuff
2838 CPP_H2=-I${want_nghttp2_path}/include
2839 DIR_H2=${want_nghttp2_path}/lib$libsuff
2840 elif test X"$want_nghttp2" != Xdefault; then
2841 dnl no nghttp2 pkg-config found and no custom directory specified,
2843 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2846 LDFLAGS="$LDFLAGS $LD_H2"
2847 CPPFLAGS="$CPPFLAGS $CPP_H2"
2848 LIBS="$LIB_H2 $LIBS"
2850 # use nghttp2_session_set_local_window_size to require nghttp2
2852 AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
2854 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
2855 curl_h2_msg="enabled (nghttp2)"
2857 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
2858 AC_SUBST(USE_NGHTTP2, [1])
2861 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2"
2862 export CURL_LIBRARY_PATH
2863 AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH])
2865 dnl not found, revert back to clean variables
2866 LDFLAGS=$CLEANLDFLAGS
2867 CPPFLAGS=$CLEANCPPFLAGS
2872 dnl **********************************************************************
2873 dnl Check for ngtcp2 (QUIC)
2874 dnl **********************************************************************
2878 if test "x$disable_http" = "xyes"; then
2879 # without HTTP, ngtcp2 is no use
2884 AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
2885 AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
2886 [OPT_TCP2=$withval])
2889 dnl --without-ngtcp2 option used
2893 dnl --with-ngtcp2 option used without path
2898 dnl --with-ngtcp2 option used with path
2900 want_tcp2_path="$withval/lib/pkgconfig"
2904 curl_tcp2_msg="no (--with-ngtcp2)"
2905 if test X"$want_tcp2" != Xno; then
2906 dnl backup the pre-ngtcp2 variables
2907 CLEANLDFLAGS="$LDFLAGS"
2908 CLEANCPPFLAGS="$CPPFLAGS"
2911 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
2913 if test "$PKGCONFIG" != "no" ; then
2914 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2915 $PKGCONFIG --libs-only-l libngtcp2`
2916 AC_MSG_NOTICE([-l is $LIB_TCP2])
2918 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2919 $PKGCONFIG --cflags-only-I libngtcp2`
2920 AC_MSG_NOTICE([-I is $CPP_TCP2])
2922 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2923 $PKGCONFIG --libs-only-L libngtcp2`
2924 AC_MSG_NOTICE([-L is $LD_TCP2])
2926 LDFLAGS="$LDFLAGS $LD_TCP2"
2927 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
2928 LIBS="$LIB_TCP2 $LIBS"
2930 if test "x$cross_compiling" != "xyes"; then
2931 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
2933 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
2935 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
2937 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
2938 AC_SUBST(USE_NGTCP2, [1])
2939 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
2940 export CURL_LIBRARY_PATH
2941 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
2944 dnl not found, revert back to clean variables
2945 LDFLAGS=$CLEANLDFLAGS
2946 CPPFLAGS=$CLEANCPPFLAGS
2951 dnl no ngtcp2 pkg-config found, deal with it
2952 if test X"$want_tcp2" != Xdefault; then
2953 dnl To avoid link errors, we do not allow --with-ngtcp2 without
2954 dnl a pkgconfig file
2955 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
2961 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
2962 dnl backup the pre-ngtcp2_crypto_openssl variables
2963 CLEANLDFLAGS="$LDFLAGS"
2964 CLEANCPPFLAGS="$CPPFLAGS"
2967 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
2969 if test "$PKGCONFIG" != "no" ; then
2970 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2971 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
2972 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
2974 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2975 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
2976 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
2978 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2979 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
2980 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
2982 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
2983 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
2984 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
2986 if test "x$cross_compiling" != "xyes"; then
2987 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
2989 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_recv_client_initial_cb,
2991 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2993 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
2994 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
2995 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
2996 export CURL_LIBRARY_PATH
2997 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
3000 dnl not found, revert back to clean variables
3001 LDFLAGS=$CLEANLDFLAGS
3002 CPPFLAGS=$CLEANCPPFLAGS
3007 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
3008 if test X"$want_tcp2" != Xdefault; then
3009 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3010 dnl a pkgconfig file
3011 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
3016 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
3017 dnl backup the pre-ngtcp2_crypto_gnutls variables
3018 CLEANLDFLAGS="$LDFLAGS"
3019 CLEANCPPFLAGS="$CPPFLAGS"
3022 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
3024 if test "$PKGCONFIG" != "no" ; then
3025 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3026 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
3027 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
3029 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3030 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
3031 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
3033 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3034 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
3035 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
3037 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
3038 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
3039 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
3041 if test "x$cross_compiling" != "xyes"; then
3042 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
3044 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb,
3046 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3048 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
3049 AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
3050 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
3051 export CURL_LIBRARY_PATH
3052 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
3055 dnl not found, revert back to clean variables
3056 LDFLAGS=$CLEANLDFLAGS
3057 CPPFLAGS=$CLEANCPPFLAGS
3062 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
3063 if test X"$want_tcp2" != Xdefault; then
3064 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3065 dnl a pkgconfig file
3066 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
3071 if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then
3072 dnl backup the pre-ngtcp2_crypto_wolfssl variables
3073 CLEANLDFLAGS="$LDFLAGS"
3074 CLEANCPPFLAGS="$CPPFLAGS"
3077 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path)
3079 if test "$PKGCONFIG" != "no" ; then
3080 LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3081 $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl`
3082 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL])
3084 CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3085 $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl`
3086 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL])
3088 LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3089 $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl`
3090 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL])
3092 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL"
3093 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL"
3094 LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS"
3096 if test "x$cross_compiling" != "xyes"; then
3097 DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'`
3099 AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb,
3101 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3103 AC_DEFINE(USE_NGTCP2_CRYPTO_WOLFSSL, 1, [if ngtcp2_crypto_wolfssl is in use])
3104 AC_SUBST(USE_NGTCP2_CRYPTO_WOLFSSL, [1])
3105 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL"
3106 export CURL_LIBRARY_PATH
3107 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH])
3110 dnl not found, revert back to clean variables
3111 LDFLAGS=$CLEANLDFLAGS
3112 CPPFLAGS=$CLEANCPPFLAGS
3117 dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it
3118 if test X"$want_tcp2" != Xdefault; then
3119 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3120 dnl a pkgconfig file
3121 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.])
3126 dnl **********************************************************************
3127 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
3128 dnl **********************************************************************
3132 if test "x$NGTCP2_ENABLED" = "x"; then
3133 # without ngtcp2, nghttp3 is of no use for us
3137 AC_ARG_WITH(nghttp3,
3138 AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
3139 AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
3140 [OPT_NGHTTP3=$withval])
3141 case "$OPT_NGHTTP3" in
3143 dnl --without-nghttp3 option used
3147 dnl --with-nghttp3 option used without path
3148 want_nghttp3="default"
3149 want_nghttp3_path=""
3152 dnl --with-nghttp3 option used with path
3154 want_nghttp3_path="$withval/lib/pkgconfig"
3158 curl_http3_msg="no (--with-nghttp3)"
3159 if test X"$want_nghttp3" != Xno; then
3160 dnl backup the pre-nghttp3 variables
3161 CLEANLDFLAGS="$LDFLAGS"
3162 CLEANCPPFLAGS="$CPPFLAGS"
3165 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3167 if test "$PKGCONFIG" != "no" ; then
3168 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3169 $PKGCONFIG --libs-only-l libnghttp3`
3170 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3172 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
3173 $PKGCONFIG --cflags-only-I libnghttp3`
3174 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3176 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3177 $PKGCONFIG --libs-only-L libnghttp3`
3178 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3180 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3181 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3182 LIBS="$LIB_NGHTTP3 $LIBS"
3184 if test "x$cross_compiling" != "xyes"; then
3185 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
3187 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
3189 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3190 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3192 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3193 AC_SUBST(USE_NGHTTP3, [1])
3194 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3195 export CURL_LIBRARY_PATH
3196 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3197 experimental="$experimental HTTP3"
3200 dnl not found, revert back to clean variables
3201 LDFLAGS=$CLEANLDFLAGS
3202 CPPFLAGS=$CLEANCPPFLAGS
3207 dnl no nghttp3 pkg-config found, deal with it
3208 if test X"$want_nghttp3" != Xdefault; then
3209 dnl To avoid link errors, we do not allow --with-nghttp3 without
3210 dnl a pkgconfig file
3211 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3217 dnl **********************************************************************
3218 dnl Check for quiche (QUIC)
3219 dnl **********************************************************************
3223 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3224 # without HTTP or with ngtcp2, quiche is no use
3229 AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
3230 AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
3231 [OPT_QUICHE=$withval])
3232 case "$OPT_QUICHE" in
3234 dnl --without-quiche option used
3238 dnl --with-quiche option used without path
3239 want_quiche="default"
3243 dnl --with-quiche option used with path
3245 want_quiche_path="$withval"
3249 if test X"$want_quiche" != Xno; then
3251 if test "$NGHTTP3_ENABLED" = 1; then
3252 AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
3255 dnl backup the pre-quiche variables
3256 CLEANLDFLAGS="$LDFLAGS"
3257 CLEANCPPFLAGS="$CPPFLAGS"
3260 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3262 if test "$PKGCONFIG" != "no" ; then
3263 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3264 $PKGCONFIG --libs-only-l quiche`
3265 AC_MSG_NOTICE([-l is $LIB_QUICHE])
3267 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
3268 $PKGCONFIG --cflags-only-I quiche`
3269 AC_MSG_NOTICE([-I is $CPP_QUICHE])
3271 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3272 $PKGCONFIG --libs-only-L quiche`
3273 AC_MSG_NOTICE([-L is $LD_QUICHE])
3275 LDFLAGS="$LDFLAGS $LD_QUICHE"
3276 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3277 LIBS="$LIB_QUICHE $LIBS"
3279 if test "x$cross_compiling" != "xyes"; then
3280 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
3282 AC_CHECK_LIB(quiche, quiche_connect,
3284 AC_CHECK_HEADERS(quiche.h,
3285 experimental="$experimental HTTP3"
3286 AC_MSG_NOTICE([HTTP3 support is experimental])
3287 curl_h3_msg="enabled (quiche)"
3289 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3290 AC_SUBST(USE_QUICHE, [1])
3291 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
3292 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3293 export CURL_LIBRARY_PATH
3294 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
3298 #include <sys/socket.h>
3302 dnl not found, revert back to clean variables
3303 AC_MSG_ERROR([couldn't use quiche])
3306 dnl no quiche pkg-config found, deal with it
3307 if test X"$want_quiche" != Xdefault; then
3308 dnl To avoid link errors, we do not allow --with-quiche without
3309 dnl a pkgconfig file
3310 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3315 dnl **********************************************************************
3316 dnl Check for msh3 (QUIC)
3317 dnl **********************************************************************
3321 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3322 # without HTTP or with ngtcp2, msh3 is no use
3327 AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage])
3328 AS_HELP_STRING([--without-msh3],[Disable msh3 usage]),
3329 [OPT_MSH3=$withval])
3332 dnl --without-msh3 option used
3336 dnl --with-msh3 option used without path
3341 dnl --with-msh3 option used with path
3343 want_msh3_path="$withval"
3347 if test X"$want_msh3" != Xno; then
3349 if test "$NGHTTP3_ENABLED" = 1; then
3350 AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive])
3353 dnl backup the pre-msh3 variables
3354 CLEANLDFLAGS="$LDFLAGS"
3355 CLEANCPPFLAGS="$CPPFLAGS"
3358 if test -n "$want_msh3_path"; then
3359 LD_MSH3="-L$want_msh3_path/lib"
3360 CPP_MSH3="-I$want_msh3_path/include"
3361 DIR_MSH3="$want_msh3_path/lib"
3362 LDFLAGS="$LDFLAGS $LD_MSH3"
3363 CPPFLAGS="$CPPFLAGS $CPP_MSH3"
3367 AC_CHECK_LIB(msh3, MsH3ApiOpen,
3369 AC_CHECK_HEADERS(msh3.h,
3370 curl_h3_msg="enabled (msh3)"
3372 AC_DEFINE(USE_MSH3, 1, [if msh3 is in use])
3373 AC_SUBST(USE_MSH3, [1])
3374 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3"
3375 export CURL_LIBRARY_PATH
3376 AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]),
3377 experimental="$experimental HTTP3"
3380 dnl not found, revert back to clean variables
3381 LDFLAGS=$CLEANLDFLAGS
3382 CPPFLAGS=$CLEANCPPFLAGS
3387 dnl **********************************************************************
3388 dnl Check for zsh completion path
3389 dnl **********************************************************************
3391 OPT_ZSH_FPATH=default
3392 AC_ARG_WITH(zsh-functions-dir,
3393 AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3394 AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3395 [OPT_ZSH_FPATH=$withval])
3396 case "$OPT_ZSH_FPATH" in
3398 dnl --without-zsh-functions-dir option used
3401 dnl --with-zsh-functions-dir option used without path
3402 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3403 AC_SUBST(ZSH_FUNCTIONS_DIR)
3406 dnl --with-zsh-functions-dir option used with path
3407 ZSH_FUNCTIONS_DIR="$withval"
3408 AC_SUBST(ZSH_FUNCTIONS_DIR)
3412 dnl **********************************************************************
3413 dnl Check for fish completion path
3414 dnl **********************************************************************
3416 OPT_FISH_FPATH=default
3417 AC_ARG_WITH(fish-functions-dir,
3418 AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3419 AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3420 [OPT_FISH_FPATH=$withval])
3421 case "$OPT_FISH_FPATH" in
3423 dnl --without-fish-functions-dir option used
3426 dnl --with-fish-functions-dir option used without path
3427 CURL_CHECK_PKGCONFIG(fish)
3428 if test "$PKGCONFIG" != "no" ; then
3429 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
3431 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3433 AC_SUBST(FISH_FUNCTIONS_DIR)
3436 dnl --with-fish-functions-dir option used with path
3437 FISH_FUNCTIONS_DIR="$withval"
3438 AC_SUBST(FISH_FUNCTIONS_DIR)
3442 dnl Now check for the very most basic headers. Then we can use these
3443 dnl ones as default-headers when checking for the rest!
3485 dnl to do if not found
3489 dnl default includes
3491 #ifdef HAVE_SYS_TYPES_H
3492 #include <sys/types.h>
3494 #ifdef HAVE_SYS_TIME_H
3495 #include <sys/time.h>
3497 #ifdef HAVE_SYS_SELECT_H
3498 #include <sys/select.h>
3499 #elif defined(HAVE_UNISTD_H)
3502 #ifdef HAVE_SYS_SOCKET_H
3503 #include <sys/socket.h>
3505 #ifdef HAVE_NETINET_IN_H
3506 #include <netinet/in.h>
3508 #ifdef HAVE_NETINET_IN6_H
3509 #include <netinet/in6.h>
3511 #ifdef HAVE_SYS_UN_H
3518 dnl Checks for typedefs, structures, and compiler characteristics.
3520 CURL_CHECK_VARIADIC_MACROS
3523 CURL_CHECK_STRUCT_TIMEVAL
3524 CURL_VERIFY_RUNTIMELIBS
3533 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3534 CURL_SIZEOF(curl_off_t, [
3535 #include <curl/system.h>
3539 AC_CHECK_TYPE(long long,
3540 [AC_DEFINE(HAVE_LONGLONG, 1,
3541 [Define to 1 if the compiler supports the 'long long' data type.])]
3546 if test ${ac_cv_sizeof_curl_off_t} -lt 8; then
3547 AC_ARG_WITH(n64-deprecated,dnl
3548 AS_HELP_STRING([--with-n64-deprecated],[confirm you realize support for systems without 64 bit data types is going away]),
3549 if test X"$withval" != Xno; then
3550 OPT_N64_AWARE=$withval
3553 if test -z "$OPT_N64_AWARE"; then
3554 AC_MSG_ERROR([support for systems without 64 bit curl_off_t is deprecated, use --with-n64-deprecated until then])
3559 AC_CHECK_TYPE(ssize_t, ,
3560 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3562 # check for bool type
3563 AC_CHECK_TYPE([bool],[
3564 AC_DEFINE(HAVE_BOOL_T, 1,
3565 [Define to 1 if bool is an available type.])
3567 #ifdef HAVE_SYS_TYPES_H
3568 #include <sys/types.h>
3570 #ifdef HAVE_STDBOOL_H
3571 #include <stdbool.h>
3575 # check for sa_family_t
3576 AC_CHECK_TYPE(sa_family_t,
3577 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3580 AC_CHECK_TYPE(ADDRESS_FAMILY,
3581 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3582 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3584 #ifdef HAVE_SYS_SOCKET_H
3585 #include <sys/socket.h>
3590 #ifdef HAVE_SYS_SOCKET_H
3591 #include <sys/socket.h>
3595 # check for suseconds_t
3596 AC_CHECK_TYPE([suseconds_t],[
3597 AC_DEFINE(HAVE_SUSECONDS_T, 1,
3598 [Define to 1 if suseconds_t is an available type.])
3600 #ifdef HAVE_SYS_TYPES_H
3601 #include <sys/types.h>
3603 #ifdef HAVE_SYS_TIME_H
3604 #include <sys/time.h>
3608 AC_MSG_CHECKING([if time_t is unsigned])
3616 AC_MSG_RESULT([yes])
3617 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3621 dnl cross-compiling, most systems are unsigned
3625 CURL_CONFIGURE_PULL_SYS_POLL
3629 TYPE_SOCKADDR_STORAGE
3631 CURL_CHECK_FUNC_SELECT
3633 CURL_CHECK_FUNC_RECV
3634 CURL_CHECK_FUNC_SEND
3635 CURL_CHECK_MSG_NOSIGNAL
3637 CURL_CHECK_FUNC_ALARM
3638 CURL_CHECK_FUNC_BASENAME
3639 CURL_CHECK_FUNC_CLOSESOCKET
3640 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3641 CURL_CHECK_FUNC_CONNECT
3642 CURL_CHECK_FUNC_FCNTL
3643 CURL_CHECK_FUNC_FREEADDRINFO
3644 CURL_CHECK_FUNC_FSETXATTR
3645 CURL_CHECK_FUNC_FTRUNCATE
3646 CURL_CHECK_FUNC_GETADDRINFO
3647 CURL_CHECK_FUNC_GETHOSTBYNAME
3648 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3649 CURL_CHECK_FUNC_GETHOSTNAME
3650 CURL_CHECK_FUNC_GETPEERNAME
3651 CURL_CHECK_FUNC_GETSOCKNAME
3652 CURL_CHECK_FUNC_IF_NAMETOINDEX
3653 CURL_CHECK_FUNC_GETIFADDRS
3654 CURL_CHECK_FUNC_GMTIME_R
3655 CURL_CHECK_FUNC_INET_NTOP
3656 CURL_CHECK_FUNC_INET_PTON
3657 CURL_CHECK_FUNC_IOCTLSOCKET
3658 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3659 CURL_CHECK_FUNC_MEMRCHR
3660 CURL_CHECK_FUNC_POLL
3661 CURL_CHECK_FUNC_SIGACTION
3662 CURL_CHECK_FUNC_SIGINTERRUPT
3663 CURL_CHECK_FUNC_SIGNAL
3664 CURL_CHECK_FUNC_SIGSETJMP
3665 CURL_CHECK_FUNC_SOCKET
3666 CURL_CHECK_FUNC_SOCKETPAIR
3667 CURL_CHECK_FUNC_STRCASECMP
3668 CURL_CHECK_FUNC_STRCMPI
3669 CURL_CHECK_FUNC_STRDUP
3670 CURL_CHECK_FUNC_STRERROR_R
3671 CURL_CHECK_FUNC_STRICMP
3672 CURL_CHECK_FUNC_STRTOK_R
3673 CURL_CHECK_FUNC_STRTOLL
3679 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3683 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
3685 #include <sys/types.h>]])
3688 AC_CHECK_FUNCS([fnmatch \
3698 mach_absolute_time \
3711 eval skipcheck=\$skipcheck_$func
3712 if test "x$skipcheck" != "xyes"; then
3713 AC_MSG_CHECKING([deeper for $func])
3720 AC_MSG_RESULT([yes])
3721 eval "ac_cv_func_$func=yes"
3722 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3723 [Define to 1 if you have the $func function.])
3725 AC_MSG_RESULT([but still no])
3730 CURL_CHECK_NONBLOCKING_SOCKET
3732 dnl ************************************************************
3733 dnl nroff tool stuff
3736 AC_PATH_PROG( PERL, perl, ,
3737 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3740 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3741 $PATH:/usr/bin/:/usr/local/bin )
3744 if test -n "$NROFF"; then
3745 dnl only check for nroff options if an nroff command was found
3747 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3749 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3750 if test -z "$mancheck"; then
3752 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3753 if test -z "$mancheck"; then
3755 AC_MSG_RESULT([failed])
3756 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3758 AC_MSG_RESULT([$MANOPT])
3761 AC_MSG_RESULT([$MANOPT])
3766 if test -z "$MANOPT"
3768 dnl if no nroff tool was found, or no option that could convert man pages
3769 dnl was found, then disable the built-in manual stuff
3770 AC_MSG_WARN([disabling built-in manual])
3774 dnl *************************************************************************
3775 dnl If the manual variable still is set, then we go with providing a built-in
3778 if test "$USE_MANUAL" = "1"; then
3779 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3780 curl_manual_msg="enabled"
3783 dnl set variable for use in automakefile(s)
3784 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3788 if test "x$curl_cv_native_windows" != "xyes" &&
3789 test "x$enable_shared" = "xyes"; then
3790 build_libhostname=yes
3792 build_libhostname=no
3794 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3796 if test "x$want_ares" != xyes; then
3797 CURL_CHECK_OPTION_THREADED_RESOLVER
3800 dnl ************************************************************
3801 dnl disable POSIX threads
3803 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3804 AC_ARG_ENABLE(pthreads,
3805 AS_HELP_STRING([--enable-pthreads],
3806 [Enable POSIX threads (default for threaded resolver)])
3807 AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3808 [ case "$enableval" in
3809 no) AC_MSG_RESULT(no)
3812 *) AC_MSG_RESULT(yes)
3821 dnl turn off pthreads if rt is disabled
3822 if test "$want_pthreads" != "no"; then
3823 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
3824 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
3826 if test "$dontwant_rt" != "no"; then
3827 dnl if --enable-pthreads was explicit then warn it's being ignored
3828 if test "$want_pthreads" = "yes"; then
3829 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
3835 dnl turn off pthreads if no threaded resolver
3836 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
3841 if test "$want_pthreads" != "no"; then
3842 AC_CHECK_HEADER(pthread.h,
3843 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3844 save_CFLAGS="$CFLAGS"
3845 dnl When statically linking against boringssl, -lpthread is added to LIBS.
3846 dnl Make sure to that this does not pass the check below, we really want
3847 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
3848 dnl lib1541 and lib1565 tests are built with these options. Otherwise
3849 dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
3853 dnl Check for libc variants without a separate pthread lib like bionic
3854 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3857 dnl on HPUX, life is more complicated...
3860 dnl it doesn't actually work without -lpthread
3861 USE_THREADS_POSIX=""
3867 dnl if it wasn't found without lib, search for it in pthread lib
3868 if test "$USE_THREADS_POSIX" != "1"
3870 # assign PTHREAD for pkg-config use
3875 dnl Check if compiler is xlC
3876 COMPILER_VERSION=`"$CC" -qversion 2>/dev/null`
3877 if test x"$COMPILER_VERSION" = "x"; then
3878 CFLAGS="$CFLAGS -pthread"
3880 CFLAGS="$CFLAGS -qthreaded"
3884 dnl No -pthread option, but link with -lpthread
3885 PTHREAD=" -lpthread"
3888 CFLAGS="$CFLAGS -pthread"
3891 AC_CHECK_LIB(pthread, pthread_create,
3892 [USE_THREADS_POSIX=1],
3893 [ CFLAGS="$save_CFLAGS"])
3896 if test "x$USE_THREADS_POSIX" = "x1"
3898 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3899 curl_res_msg="POSIX threaded"
3904 dnl threaded resolver check
3905 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
3906 if test "$want_pthreads" = "yes"; then
3907 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
3909 dnl If native Windows fallback on Win32 threads since no POSIX threads
3910 if test "$curl_cv_native_windows" = "yes"; then
3912 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
3913 curl_res_msg="Win32 threaded"
3915 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
3919 CURL_CONVERT_INCLUDE_TO_ISYSTEM
3921 dnl ************************************************************
3922 dnl disable verbose text strings
3924 AC_MSG_CHECKING([whether to enable verbose strings])
3925 AC_ARG_ENABLE(verbose,
3926 AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
3927 AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3928 [ case "$enableval" in
3931 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3932 curl_verbose_msg="no"
3934 *) AC_MSG_RESULT(yes)
3940 dnl ************************************************************
3941 dnl enable SSPI support
3943 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3945 AS_HELP_STRING([--enable-sspi],[Enable SSPI])
3946 AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
3947 [ case "$enableval" in
3949 if test "$curl_cv_native_windows" = "yes"; then
3951 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3952 AC_SUBST(USE_WINDOWS_SSPI, [1])
3953 curl_sspi_msg="enabled"
3956 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3960 if test "x$SCHANNEL_ENABLED" = "x1"; then
3961 # --with-schannel implies --enable-sspi
3968 if test "x$SCHANNEL_ENABLED" = "x1"; then
3969 # --with-schannel implies --enable-sspi
3976 dnl ************************************************************
3977 dnl disable cryptographic authentication
3979 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3980 AC_ARG_ENABLE(crypto-auth,
3981 AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3982 AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3983 [ case "$enableval" in
3986 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3987 CURL_DISABLE_CRYPTO_AUTH=1
3989 *) AC_MSG_RESULT(yes)
3995 dnl ************************************************************
3996 dnl disable NTLM support
3998 AC_MSG_CHECKING([whether to support NTLM])
4000 AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
4001 AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
4002 [ case "$enableval" in
4005 AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
4008 *) AC_MSG_RESULT(yes)
4014 CURL_CHECK_OPTION_NTLM_WB
4018 dnl ************************************************************
4019 dnl disable TLS-SRP authentication
4021 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
4022 AC_ARG_ENABLE(tls-srp,
4023 AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
4024 AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
4025 [ case "$enableval" in
4030 *) AC_MSG_RESULT(yes)
4038 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
4039 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
4041 curl_tls_srp_msg="enabled"
4044 dnl ************************************************************
4045 dnl disable Unix domain sockets support
4047 AC_MSG_CHECKING([whether to enable Unix domain sockets])
4048 AC_ARG_ENABLE(unix-sockets,
4049 AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
4050 AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
4051 [ case "$enableval" in
4052 no) AC_MSG_RESULT(no)
4053 want_unix_sockets=no
4055 *) AC_MSG_RESULT(yes)
4056 want_unix_sockets=yes
4060 want_unix_sockets=auto
4063 if test "x$want_unix_sockets" != "xno"; then
4064 if test "x$curl_cv_native_windows" = "xyes"; then
4066 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4067 curl_unix_sockets_msg="enabled"
4069 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
4070 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4071 AC_SUBST(USE_UNIX_SOCKETS, [1])
4072 curl_unix_sockets_msg="enabled"
4074 if test "x$want_unix_sockets" = "xyes"; then
4075 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
4083 dnl ************************************************************
4084 dnl disable cookies support
4086 AC_MSG_CHECKING([whether to support cookies])
4087 AC_ARG_ENABLE(cookies,
4088 AS_HELP_STRING([--enable-cookies],[Enable cookies support])
4089 AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
4090 [ case "$enableval" in
4093 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
4095 *) AC_MSG_RESULT(yes)
4101 dnl ************************************************************
4102 dnl disable socketpair
4104 AC_MSG_CHECKING([whether to support socketpair])
4105 AC_ARG_ENABLE(socketpair,
4106 AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
4107 AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
4108 [ case "$enableval" in
4111 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
4113 *) AC_MSG_RESULT(yes)
4119 dnl ************************************************************
4120 dnl disable HTTP authentication support
4122 AC_MSG_CHECKING([whether to support HTTP authentication])
4123 AC_ARG_ENABLE(http-auth,
4124 AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
4125 AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
4126 [ case "$enableval" in
4129 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
4131 *) AC_MSG_RESULT(yes)
4137 dnl ************************************************************
4138 dnl disable DoH support
4140 AC_MSG_CHECKING([whether to support DoH])
4142 AS_HELP_STRING([--enable-doh],[Enable DoH support])
4143 AS_HELP_STRING([--disable-doh],[Disable DoH support]),
4144 [ case "$enableval" in
4147 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
4149 *) AC_MSG_RESULT(yes)
4155 dnl ************************************************************
4156 dnl disable mime API support
4158 AC_MSG_CHECKING([whether to support the MIME API])
4160 AS_HELP_STRING([--enable-mime],[Enable mime API support])
4161 AS_HELP_STRING([--disable-mime],[Disable mime API support]),
4162 [ case "$enableval" in
4165 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
4167 *) AC_MSG_RESULT(yes)
4173 dnl ************************************************************
4174 dnl disable date parsing
4176 AC_MSG_CHECKING([whether to support date parsing])
4177 AC_ARG_ENABLE(dateparse,
4178 AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
4179 AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
4180 [ case "$enableval" in
4183 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
4185 *) AC_MSG_RESULT(yes)
4191 dnl ************************************************************
4194 AC_MSG_CHECKING([whether to support netrc parsing])
4195 AC_ARG_ENABLE(netrc,
4196 AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
4197 AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
4198 [ case "$enableval" in
4201 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
4203 *) AC_MSG_RESULT(yes)
4209 dnl ************************************************************
4210 dnl disable progress-meter
4212 AC_MSG_CHECKING([whether to support progress-meter])
4213 AC_ARG_ENABLE(progress-meter,
4214 AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
4215 AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
4216 [ case "$enableval" in
4219 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
4221 *) AC_MSG_RESULT(yes)
4227 dnl ************************************************************
4228 dnl disable shuffle DNS support
4230 AC_MSG_CHECKING([whether to support DNS shuffling])
4231 AC_ARG_ENABLE(dnsshuffle,
4232 AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
4233 AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
4234 [ case "$enableval" in
4237 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4239 *) AC_MSG_RESULT(yes)
4245 dnl ************************************************************
4246 dnl disable the curl_easy_options API
4248 AC_MSG_CHECKING([whether to support curl_easy_option*])
4249 AC_ARG_ENABLE(get-easy-options,
4250 AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
4251 AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
4252 [ case "$enableval" in
4255 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
4257 *) AC_MSG_RESULT(yes)
4263 dnl ************************************************************
4264 dnl switch on/off alt-svc
4266 AC_MSG_CHECKING([whether to support alt-svc])
4267 AC_ARG_ENABLE(alt-svc,
4268 AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
4269 AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
4270 [ case "$enableval" in
4273 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
4274 curl_altsvc_msg="no";
4277 *) AC_MSG_RESULT(yes)
4283 dnl ************************************************************
4284 dnl switch on/off headers-api
4286 AC_MSG_CHECKING([whether to support headers-api])
4287 AC_ARG_ENABLE(headers-api,
4288 AS_HELP_STRING([--enable-headers-api],[Enable headers-api support])
4289 AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]),
4290 [ case "$enableval" in
4291 no) AC_MSG_RESULT(no)
4292 curl_headers_msg="no (--enable-headers-api)"
4293 AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api])
4302 dnl only check for HSTS if there's SSL present
4303 if test -n "$SSL_ENABLED"; then
4305 dnl ************************************************************
4306 dnl switch on/off hsts
4308 AC_MSG_CHECKING([whether to support HSTS])
4310 AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
4311 AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
4312 [ case "$enableval" in
4317 *) AC_MSG_RESULT(yes)
4320 AC_MSG_RESULT($hsts)
4323 AC_MSG_NOTICE([disables HSTS due to lack of SSL])
4327 if test "x$hsts" != "xyes"; then
4328 curl_hsts_msg="no (--enable-hsts)";
4329 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
4332 dnl *************************************************************
4333 dnl check whether ECH support, if desired, is actually available
4335 if test "x$want_ech" != "xno"; then
4336 AC_MSG_CHECKING([whether ECH support is available])
4338 dnl assume NOT and look for sufficient condition
4342 dnl OpenSSL with a chosen ECH function should be enough
4343 dnl so more exhaustive checking seems unnecessary for now
4344 if test "x$OPENSSL_ENABLED" = "x1"; then
4345 AC_CHECK_FUNCS(SSL_get_ech_status,
4346 ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
4349 dnl add 'elif' chain here for additional implementations
4352 dnl now deal with whatever we found
4353 if test "x$ECH_ENABLED" = "x1"; then
4354 AC_DEFINE(USE_ECH, 1, [if ECH support is available])
4355 AC_MSG_RESULT($ECH_SUPPORT)
4356 experimental="$experimental ECH"
4358 AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
4362 dnl *************************************************************
4365 AC_MSG_CHECKING([whether to support WebSockets])
4366 AC_ARG_ENABLE(websockets,
4367 AS_HELP_STRING([--enable-websockets],[Enable WebSockets support])
4368 AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]),
4369 [ case "$enableval" in
4374 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4376 curl_ws_msg="enabled"
4377 AC_DEFINE_UNQUOTED(USE_WEBSOCKETS, [1], [enable websockets support])
4378 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS"
4379 if test "x$SSL_ENABLED" = "x1"; then
4380 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS"
4382 experimental="$experimental Websockets"
4384 dnl websockets requires >32 bit curl_off_t
4386 AC_MSG_WARN([Websockets disabled due to lack of >32 bit curl_off_t])
4394 dnl ************************************************************
4395 dnl hiding of library internal symbols
4397 CURL_CONFIGURE_SYMBOL_HIDING
4400 dnl All the library dependencies put into $LIB apply to libcurl only.
4402 LIBCURL_LIBS="$LIBS$PTHREAD"
4404 AC_SUBST(LIBCURL_LIBS)
4405 AC_SUBST(CURL_NETWORK_LIBS)
4406 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4408 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4409 dnl LIBS variable used in generated makefile at makefile processing
4410 dnl time. Doing this functionally prevents LIBS from being used for
4411 dnl all link targets in given makefile.
4413 AC_SUBST(BLANK_AT_MAKETIME)
4415 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4418 ENABLE_SHARED="$enable_shared"
4419 AC_SUBST(ENABLE_SHARED)
4421 dnl to let curl-config output the static libraries correctly
4422 ENABLE_STATIC="$enable_static"
4423 AC_SUBST(ENABLE_STATIC)
4425 dnl merge the pkg-config Libs.private field into Libs when static-only
4426 if test "x$enable_shared" = "xno"; then
4427 LIBCURL_NO_SHARED=$LIBCURL_LIBS
4431 AC_SUBST(LIBCURL_NO_SHARED)
4434 dnl For keeping supported features and protocols also in pkg-config file
4435 dnl since it is more cross-compile friendly than curl-config
4438 if test "x$OPENSSL_ENABLED" = "x1"; then
4439 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4440 elif test -n "$SSL_ENABLED"; then
4441 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4443 if test "x$IPV6_ENABLED" = "x1"; then
4444 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4446 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4447 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4449 if test "x$HAVE_LIBZ" = "x1"; then
4450 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4452 if test "x$HAVE_BROTLI" = "x1"; then
4453 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4455 if test "x$HAVE_ZSTD" = "x1"; then
4456 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
4458 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4459 -o "x$USE_THREADS_WIN32" = "x1"; then
4460 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4462 if test "x$IDN_ENABLED" = "x1"; then
4463 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4465 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4466 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4469 if test "x$HAVE_GSSAPI" = "x1"; then
4470 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4473 if test "x$curl_psl_msg" = "xenabled"; then
4474 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4477 if test "x$curl_gsasl_msg" = "xenabled"; then
4478 SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
4481 if test "x$enable_altsvc" = "xyes"; then
4482 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4484 if test "x$hsts" = "xyes"; then
4485 SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
4488 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4489 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4490 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4493 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4494 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4495 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4498 use_curl_ntlm_core=no
4500 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4501 "x$CURL_DISABLE_NTLM" != "x1"; then
4502 if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4503 -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
4504 -o "x$SECURETRANSPORT_ENABLED" = "x1" \
4505 -o "x$USE_WIN32_CRYPTO" = "x1" \
4506 -o "x$WOLFSSL_NTLM" = "x1"; then
4507 use_curl_ntlm_core=yes
4510 if test "x$use_curl_ntlm_core" = "xyes" \
4511 -o "x$USE_WINDOWS_SSPI" = "x1"; then
4512 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4514 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4515 "x$NTLM_WB_ENABLED" = "x1"; then
4516 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4521 if test "x$USE_TLS_SRP" = "x1"; then
4522 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4525 if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
4526 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4529 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1" \
4530 -o "x$USE_MSH3" = "x1"; then
4531 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
4534 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4535 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4538 dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
4539 if test "x$https_proxy" != "xno"; then
4540 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4541 -o "x$NSS_ENABLED" = "x1"; then
4542 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4546 if test "x$ECH_ENABLED" = "x1"; then
4547 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
4550 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4551 if test ${ac_cv_sizeof_off_t} -gt 4 -o \
4552 "$curl_win32_file_api" = "win32_large_files"; then
4553 SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
4557 if test "$tst_atomic" = "yes"; then
4558 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
4562 #include <windows.h>
4564 #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
4569 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
4574 dnl replace spaces with newlines
4576 dnl replace the newlines back to spaces
4577 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
4578 AC_SUBST(SUPPORT_FEATURES)
4580 dnl For supported protocols in pkg-config file
4581 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4582 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4583 if test "x$SSL_ENABLED" = "x1"; then
4584 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4587 if test "x$CURL_DISABLE_FTP" != "x1"; then
4588 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4589 if test "x$SSL_ENABLED" = "x1"; then
4590 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4593 if test "x$CURL_DISABLE_FILE" != "x1"; then
4594 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4596 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4597 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4599 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4600 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4601 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4602 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4603 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4604 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4608 if test "x$CURL_DISABLE_DICT" != "x1"; then
4609 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4611 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4612 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4614 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4615 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4616 if test "x$SSL_ENABLED" = "x1"; then
4617 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
4620 if test "x$CURL_DISABLE_MQTT" != "x1"; then
4621 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
4623 if test "x$CURL_DISABLE_POP3" != "x1"; then
4624 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4625 if test "x$SSL_ENABLED" = "x1"; then
4626 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4629 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4630 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4631 if test "x$SSL_ENABLED" = "x1"; then
4632 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4635 if test "x$CURL_DISABLE_SMB" != "x1" \
4636 -a "x$use_curl_ntlm_core" = "xyes"; then
4637 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4638 if test "x$SSL_ENABLED" = "x1"; then
4639 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4642 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4643 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4644 if test "x$SSL_ENABLED" = "x1"; then
4645 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4648 if test "x$USE_LIBSSH2" = "x1"; then
4649 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4650 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4652 if test "x$USE_LIBSSH" = "x1"; then
4653 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4654 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4656 if test "x$USE_WOLFSSH" = "x1"; then
4657 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4659 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4660 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4662 if test "x$USE_LIBRTMP" = "x1"; then
4663 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4666 dnl replace spaces with newlines
4668 dnl replace the newlines back to spaces
4669 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4671 AC_SUBST(SUPPORT_PROTOCOLS)
4673 dnl squeeze whitespace out of some variables
4681 squeeze LIBCURL_LIBS
4682 squeeze CURL_NETWORK_LIBS
4683 squeeze CURL_NETWORK_AND_TIME_LIBS
4685 squeeze SUPPORT_FEATURES
4686 squeeze SUPPORT_PROTOCOLS
4688 XC_CHECK_BUILD_FLAGS
4690 SSL_BACKENDS=${ssl_backends}
4691 AC_SUBST(SSL_BACKENDS)
4693 if test "x$want_curldebug_assumed" = "xyes" &&
4694 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4695 ac_configure_args="$ac_configure_args --enable-curldebug"
4698 AC_CONFIG_FILES([Makefile \
4700 docs/examples/Makefile \
4701 docs/libcurl/Makefile \
4702 docs/libcurl/opts/Makefile \
4703 docs/cmdline-opts/Makefile \
4705 include/curl/Makefile \
4708 extensions/Makefile \
4713 tests/certs/Makefile \
4714 tests/certs/scripts/Makefile \
4715 tests/data/Makefile \
4716 tests/server/Makefile \
4717 tests/libtest/Makefile \
4718 tests/unit/Makefile \
4720 packages/vms/Makefile \
4726 CURL_GENERATE_CONFIGUREHELP_PM
4728 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4730 AC_MSG_NOTICE([Configured to build curl/libcurl:
4733 Install prefix: ${prefix}
4736 CPPFLAGS: ${CPPFLAGS}
4740 curl version: ${CURLVERSION}
4741 SSL: ${curl_ssl_msg}
4742 SSH: ${curl_ssh_msg}
4743 zlib: ${curl_zlib_msg}
4744 brotli: ${curl_brotli_msg}
4745 zstd: ${curl_zstd_msg}
4746 GSS-API: ${curl_gss_msg}
4747 GSASL: ${curl_gsasl_msg}
4748 TLS-SRP: ${curl_tls_srp_msg}
4749 resolver: ${curl_res_msg}
4750 IPv6: ${curl_ipv6_msg}
4751 Unix sockets: ${curl_unix_sockets_msg}
4752 IDN: ${curl_idn_msg}
4753 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4754 Built-in manual: ${curl_manual_msg}
4755 --libcurl option: ${curl_libcurl_msg}
4756 Verbose errors: ${curl_verbose_msg}
4757 Code coverage: ${curl_coverage_msg}
4758 SSPI: ${curl_sspi_msg}
4759 ca cert bundle: ${ca}${ca_warning}
4760 ca cert path: ${capath}${capath_warning}
4761 ca fallback: ${with_ca_fallback}
4762 LDAP: ${curl_ldap_msg}
4763 LDAPS: ${curl_ldaps_msg}
4764 RTSP: ${curl_rtsp_msg}
4765 RTMP: ${curl_rtmp_msg}
4766 PSL: ${curl_psl_msg}
4767 Alt-svc: ${curl_altsvc_msg}
4768 Headers API: ${curl_headers_msg}
4769 HSTS: ${curl_hsts_msg}
4770 HTTP1: ${curl_h1_msg}
4771 HTTP2: ${curl_h2_msg}
4772 HTTP3: ${curl_h3_msg}
4773 ECH: ${curl_ech_msg}
4774 WebSockets: ${curl_ws_msg}
4775 Protocols: ${SUPPORT_PROTOCOLS}
4776 Features: ${SUPPORT_FEATURES}
4777 Tizen Features: ${SUPPORT_TIZEN_FEATURES}
4779 if test -n "$experimental"; then
4781 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!