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