1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2020, 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 - 2020 Daniel Stenberg, <daniel@haxx.se>
35 This configure script may be copied, distributed and modified under the
36 terms of the curl license; see COPYING for more details])
38 AC_CONFIG_SRCDIR([lib/urldata.h])
39 AC_CONFIG_HEADERS(lib/curl_config.h)
40 AC_CONFIG_MACRO_DIR([m4])
42 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
44 CURL_CHECK_OPTION_DEBUG
45 CURL_CHECK_OPTION_OPTIMIZE
46 CURL_CHECK_OPTION_WARNINGS
47 CURL_CHECK_OPTION_WERROR
48 CURL_CHECK_OPTION_CURLDEBUG
49 CURL_CHECK_OPTION_SYMBOL_HIDING
50 CURL_CHECK_OPTION_ARES
54 XC_CHECK_PATH_SEPARATOR
57 # save the configure arguments
59 CONFIGURE_OPTIONS="\"$ac_configure_args\""
60 AC_SUBST(CONFIGURE_OPTIONS)
62 dnl SED is mandatory for configure process and libtool.
63 dnl Set it now, allowing it to be changed later.
64 if test -z "$SED"; then
65 dnl allow it to be overridden
66 AC_PATH_PROG([SED], [sed], [not_found],
67 [$PATH:/usr/bin:/usr/local/bin])
68 if test -z "$SED" || test "$SED" = "not_found"; then
69 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
74 dnl GREP is mandatory for configure process and libtool.
75 dnl Set it now, allowing it to be changed later.
76 if test -z "$GREP"; then
77 dnl allow it to be overridden
78 AC_PATH_PROG([GREP], [grep], [not_found],
79 [$PATH:/usr/bin:/usr/local/bin])
80 if test -z "$GREP" || test "$GREP" = "not_found"; then
81 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
86 dnl EGREP is mandatory for configure process and libtool.
87 dnl Set it now, allowing it to be changed later.
88 if test -z "$EGREP"; then
89 dnl allow it to be overridden
90 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
91 AC_MSG_CHECKING([for egrep])
93 AC_MSG_RESULT([$EGREP])
95 AC_PATH_PROG([EGREP], [egrep], [not_found],
96 [$PATH:/usr/bin:/usr/local/bin])
99 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
100 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
104 dnl AR is mandatory for configure process and libtool.
105 dnl This is target dependent, so check it as a tool.
106 if test -z "$AR"; then
107 dnl allow it to be overridden
108 AC_PATH_TOOL([AR], [ar], [not_found],
109 [$PATH:/usr/bin:/usr/local/bin])
110 if test -z "$AR" || test "$AR" = "not_found"; then
111 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
118 dnl figure out the libcurl version
119 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
122 dnl for --enable-code-coverage
126 AC_MSG_CHECKING([curl version])
127 AC_MSG_RESULT($CURLVERSION)
129 AC_SUBST(CURLVERSION)
132 dnl we extract the numerical version for curl-config only
133 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
136 dnl Solaris pkgadd support definitions
137 PKGADD_PKG="HAXXcurl"
138 PKGADD_NAME="curl - a client that groks URLs"
139 PKGADD_VENDOR="curl.haxx.se"
141 AC_SUBST(PKGADD_NAME)
142 AC_SUBST(PKGADD_VENDOR)
145 dnl initialize all the info variables
146 curl_ssl_msg="no (--with-{ssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,mesalink,amissl,bearssl} )"
147 curl_ssh_msg="no (--with-{libssh,libssh2})"
148 curl_zlib_msg="no (--with-zlib)"
149 curl_brotli_msg="no (--with-brotli)"
150 curl_zstd_msg="no (--with-zstd)"
151 curl_gss_msg="no (--with-gssapi)"
152 curl_tls_srp_msg="no (--enable-tls-srp)"
153 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
154 curl_ipv6_msg="no (--enable-ipv6)"
155 curl_unix_sockets_msg="no (--enable-unix-sockets)"
156 curl_idn_msg="no (--with-{libidn2,winidn})"
157 curl_manual_msg="no (--enable-manual)"
158 curl_libcurl_msg="enabled (--disable-libcurl-option)"
159 curl_verbose_msg="enabled (--disable-verbose)"
160 curl_sspi_msg="no (--enable-sspi)"
161 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
162 curl_ldaps_msg="no (--enable-ldaps)"
163 curl_rtsp_msg="no (--enable-rtsp)"
164 curl_rtmp_msg="no (--with-librtmp)"
165 curl_mtlnk_msg="no (--with-libmetalink)"
166 curl_psl_msg="no (--with-libpsl)"
171 dnl Save some initial values the user might have provided
173 INITIAL_LDFLAGS=$LDFLAGS
177 dnl Detect the canonical host and target build environment
181 dnl Get system canonical name
182 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
184 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
185 AC_SUBST(AR_FLAGS, [cr])
187 dnl This defines _ALL_SOURCE for AIX
188 CURL_CHECK_AIX_ALL_SOURCE
190 dnl Our configure and build reentrant settings
191 CURL_CONFIGURE_THREAD_SAFE
192 CURL_CONFIGURE_REENTRANT
194 dnl check for how to do large files
200 # Automake conditionals based on libtool related checks
203 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
204 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
205 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
206 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
207 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
208 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
211 # Due to libtool and automake machinery limitations of not allowing
212 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
213 # inclusion of these in shared or static libraries, we are forced to
214 # build using separate configure runs for shared and static libraries
215 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
216 # to compile objects for each kind of library. Notice that relying on
217 # the '-DPIC' CFLAG that libtool provides is not valid given that the
218 # user might for example choose to build static libraries with PIC.
222 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
223 # targeting a static library and not building its shared counterpart.
226 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
227 [test "x$xc_lt_build_static_only" = 'xyes'])
230 # Make staticlib CPPFLAG variable and its definition visible in output
231 # files unconditionally, providing an empty definition unless strictly
232 # targeting a static library and not building its shared counterpart.
235 CPPFLAG_CURL_STATICLIB=
236 if test "x$xc_lt_build_static_only" = 'xyes'; then
237 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
239 AC_SUBST([CPPFLAG_CURL_STATICLIB])
242 # Determine whether all dependent libraries must be specified when linking
243 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
249 AC_SUBST(REQUIRE_LIB_DEPS)
250 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
252 dnl check if there's a way to force code inline
255 dnl **********************************************************************
256 dnl platform/compiler/architecture specific checks/flags
257 dnl **********************************************************************
260 CURL_SET_COMPILER_BASIC_OPTS
261 CURL_SET_COMPILER_DEBUG_OPTS
262 CURL_SET_COMPILER_OPTIMIZE_OPTS
263 CURL_SET_COMPILER_WARNING_OPTS
265 if test "$compiler_id" = "INTEL_UNIX_C"; then
267 if test "$compiler_num" -ge "1000"; then
268 dnl icc 10.X or later
269 CFLAGS="$CFLAGS -shared-intel"
270 elif test "$compiler_num" -ge "900"; then
272 CFLAGS="$CFLAGS -i-dynamic"
278 if test X"$want_werror" = Xyes; then
279 CURL_CFLAG_EXTRAS="-Werror"
280 if test "$compiler_id" = "GNU_C"; then
281 dnl enable -pedantic-errors for GCC 5 and later,
282 dnl as before that it was the same as -Werror=pedantic
283 if test "$compiler_num" -ge "500"; then
284 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
288 AC_SUBST(CURL_CFLAG_EXTRAS)
290 CURL_CHECK_COMPILER_HALT_ON_ERROR
291 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
292 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
293 CURL_CHECK_COMPILER_SYMBOL_HIDING
296 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
298 supports_unittests=yes
299 # cross-compilation of unit tests static library/programs fails when
300 # libcurl shared library is built. This might be due to a libtool or
301 # automake issue. In this case we disable unit tests.
302 if test "x$cross_compiling" != "xno" &&
303 test "x$enable_shared" != "xno"; then
304 supports_unittests=no
307 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
308 # a problem related with OpenSSL headers and library versions not matching.
309 # Disable unit tests while time to further investigate this is found.
312 if test "$compiler_id" = "GNU_C"; then
313 supports_unittests=no
318 # All AIX autobuilds fails unit tests linking against unittests library
319 # due to unittests library being built with no symbols or members. Libtool ?
320 # Disable unit tests while time to further investigate this is found.
323 supports_unittests=no
327 dnl Build unit tests when option --enable-debug is given.
328 if test "x$want_debug" = "xyes" &&
329 test "x$supports_unittests" = "xyes"; then
334 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
336 dnl **********************************************************************
337 dnl Compilation based checks should not be done before this point.
338 dnl **********************************************************************
340 dnl **********************************************************************
341 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
342 dnl and ws2tcpip.h take precedence over any other further checks which
343 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
344 dnl this specific header files. And do them before its results are used.
345 dnl **********************************************************************
347 CURL_CHECK_HEADER_WINDOWS
348 CURL_CHECK_NATIVE_WINDOWS
349 case X-"$curl_cv_native_windows" in
351 CURL_CHECK_HEADER_WINSOCK
352 CURL_CHECK_HEADER_WINSOCK2
353 CURL_CHECK_HEADER_WS2TCPIP
354 CURL_CHECK_HEADER_WINLDAP
355 CURL_CHECK_HEADER_WINBER
358 curl_cv_header_winsock_h="no"
359 curl_cv_header_winsock2_h="no"
360 curl_cv_header_ws2tcpip_h="no"
361 curl_cv_header_winldap_h="no"
362 curl_cv_header_winber_h="no"
365 CURL_CHECK_WIN32_LARGEFILE
368 CURL_SUPPORTS_BUILTIN_AVAILABLE
371 dnl ************************************************************
372 dnl switch off particular protocols
374 AC_MSG_CHECKING([whether to support http])
376 AC_HELP_STRING([--enable-http],[Enable HTTP support])
377 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
378 [ case "$enableval" in
381 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
383 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
384 AC_SUBST(CURL_DISABLE_HTTP, [1])
385 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
386 AC_SUBST(CURL_DISABLE_RTSP, [1])
388 *) AC_MSG_RESULT(yes)
393 AC_MSG_CHECKING([whether to support ftp])
395 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
396 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
397 [ case "$enableval" in
400 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
401 AC_SUBST(CURL_DISABLE_FTP, [1])
403 *) AC_MSG_RESULT(yes)
408 AC_MSG_CHECKING([whether to support file])
410 AC_HELP_STRING([--enable-file],[Enable FILE support])
411 AC_HELP_STRING([--disable-file],[Disable FILE support]),
412 [ case "$enableval" in
415 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
416 AC_SUBST(CURL_DISABLE_FILE, [1])
418 *) AC_MSG_RESULT(yes)
423 AC_MSG_CHECKING([whether to support ldap])
425 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
426 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
427 [ case "$enableval" in
430 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
431 AC_SUBST(CURL_DISABLE_LDAP, [1])
439 AC_MSG_CHECKING([whether to support ldaps])
441 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
442 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
443 [ case "$enableval" in
446 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
447 AC_SUBST(CURL_DISABLE_LDAPS, [1])
449 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
450 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
451 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
452 AC_SUBST(CURL_DISABLE_LDAPS, [1])
455 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
456 AC_SUBST(HAVE_LDAP_SSL, [1])
460 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
462 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
463 AC_SUBST(CURL_DISABLE_LDAPS, [1])
466 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
467 AC_SUBST(HAVE_LDAP_SSL, [1])
471 AC_MSG_CHECKING([whether to support rtsp])
473 AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
474 AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
475 [ case "$enableval" in
478 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
479 AC_SUBST(CURL_DISABLE_RTSP, [1])
481 *) if test x$CURL_DISABLE_HTTP = x1 ; then
482 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
485 curl_rtsp_msg="enabled"
489 if test "x$CURL_DISABLE_HTTP" != "x1"; then
491 curl_rtsp_msg="enabled"
497 AC_MSG_CHECKING([whether to support proxies])
499 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
500 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
501 [ case "$enableval" in
504 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
505 AC_SUBST(CURL_DISABLE_PROXY, [1])
508 *) AC_MSG_RESULT(yes)
514 AC_MSG_CHECKING([whether to support dict])
516 AC_HELP_STRING([--enable-dict],[Enable DICT support])
517 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
518 [ case "$enableval" in
521 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
522 AC_SUBST(CURL_DISABLE_DICT, [1])
524 *) AC_MSG_RESULT(yes)
529 AC_MSG_CHECKING([whether to support telnet])
530 AC_ARG_ENABLE(telnet,
531 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
532 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
533 [ case "$enableval" in
536 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
537 AC_SUBST(CURL_DISABLE_TELNET, [1])
539 *) AC_MSG_RESULT(yes)
544 AC_MSG_CHECKING([whether to support tftp])
546 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
547 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
548 [ case "$enableval" in
551 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
552 AC_SUBST(CURL_DISABLE_TFTP, [1])
554 *) AC_MSG_RESULT(yes)
560 AC_MSG_CHECKING([whether to support pop3])
562 AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
563 AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
564 [ case "$enableval" in
567 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
568 AC_SUBST(CURL_DISABLE_POP3, [1])
570 *) AC_MSG_RESULT(yes)
577 AC_MSG_CHECKING([whether to support imap])
579 AC_HELP_STRING([--enable-imap],[Enable IMAP support])
580 AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
581 [ case "$enableval" in
584 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
585 AC_SUBST(CURL_DISABLE_IMAP, [1])
587 *) AC_MSG_RESULT(yes)
594 AC_MSG_CHECKING([whether to support smb])
596 AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
597 AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
598 [ case "$enableval" in
601 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
602 AC_SUBST(CURL_DISABLE_SMB, [1])
604 *) AC_MSG_RESULT(yes)
610 AC_MSG_CHECKING([whether to support smtp])
612 AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
613 AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
614 [ case "$enableval" in
617 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
618 AC_SUBST(CURL_DISABLE_SMTP, [1])
620 *) AC_MSG_RESULT(yes)
626 AC_MSG_CHECKING([whether to support gopher])
627 AC_ARG_ENABLE(gopher,
628 AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
629 AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
630 [ case "$enableval" in
633 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
634 AC_SUBST(CURL_DISABLE_GOPHER, [1])
636 *) AC_MSG_RESULT(yes)
642 AC_MSG_CHECKING([whether to support mqtt])
644 AC_HELP_STRING([--enable-mqtt],[Enable MQTT support])
645 AC_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
646 [ case "$enableval" in
649 AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
650 AC_SUBST(CURL_DISABLE_MQTT, [1])
652 *) AC_MSG_RESULT(yes)
658 dnl **********************************************************************
659 dnl Check for built-in manual
660 dnl **********************************************************************
662 AC_MSG_CHECKING([whether to provide built-in manual])
663 AC_ARG_ENABLE(manual,
664 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
665 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
666 [ case "$enableval" in
670 *) AC_MSG_RESULT(yes)
677 dnl The actual use of the USE_MANUAL variable is done much later in this
678 dnl script to allow other actions to disable it as well.
680 dnl ************************************************************
681 dnl disable C code generation support
683 AC_MSG_CHECKING([whether to enable generation of C code])
684 AC_ARG_ENABLE(libcurl_option,
685 AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
686 AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
687 [ case "$enableval" in
690 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
691 curl_libcurl_msg="no"
693 *) AC_MSG_RESULT(yes)
699 dnl **********************************************************************
700 dnl Checks for libraries.
701 dnl **********************************************************************
703 AC_MSG_CHECKING([whether to use libgcc])
704 AC_ARG_ENABLE(libgcc,
705 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
706 [ case "$enableval" in
719 dnl gethostbyname without lib or in the nsl lib?
720 AC_CHECK_FUNC(gethostbyname,
721 [HAVE_GETHOSTBYNAME="1"
723 [ AC_CHECK_LIB(nsl, gethostbyname,
724 [HAVE_GETHOSTBYNAME="1"
729 if test "$HAVE_GETHOSTBYNAME" != "1"
731 dnl gethostbyname in the socket lib?
732 AC_CHECK_LIB(socket, gethostbyname,
733 [HAVE_GETHOSTBYNAME="1"
734 LIBS="-lsocket $LIBS"
738 if test "$HAVE_GETHOSTBYNAME" != "1"
740 dnl gethostbyname in the watt lib?
741 AC_CHECK_LIB(watt, gethostbyname,
742 [HAVE_GETHOSTBYNAME="1"
743 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
744 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
749 dnl At least one system has been identified to require BOTH nsl and socket
750 dnl libs at the same time to link properly.
751 if test "$HAVE_GETHOSTBYNAME" != "1"
753 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
754 my_ac_save_LIBS=$LIBS
755 LIBS="-lnsl -lsocket $LIBS"
763 HAVE_GETHOSTBYNAME="1"
766 LIBS=$my_ac_save_LIBS
770 if test "$HAVE_GETHOSTBYNAME" != "1"
772 dnl This is for winsock systems
773 if test "$curl_cv_header_windows_h" = "yes"; then
774 if test "$curl_cv_header_winsock_h" = "yes"; then
777 winsock_LIB="-lwinsock"
780 winsock_LIB="-lwsock32"
784 if test "$curl_cv_header_winsock2_h" = "yes"; then
785 winsock_LIB="-lws2_32"
787 if test ! -z "$winsock_LIB"; then
788 my_ac_save_LIBS=$LIBS
789 LIBS="$winsock_LIB $LIBS"
790 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
793 #ifdef HAVE_WINDOWS_H
794 #ifndef WIN32_LEAN_AND_MEAN
795 #define WIN32_LEAN_AND_MEAN
798 #ifdef HAVE_WINSOCK2_H
799 #include <winsock2.h>
801 #ifdef HAVE_WINSOCK_H
807 gethostbyname("www.dummysite.com");
811 HAVE_GETHOSTBYNAME="1"
815 LIBS=$my_ac_save_LIBS
821 if test "$HAVE_GETHOSTBYNAME" != "1"
823 dnl This is for Minix 3.1
824 AC_MSG_CHECKING([for gethostbyname for Minix 3])
827 /* Older Minix versions may need <net/gen/netdb.h> here instead */
830 gethostbyname("www.dummysite.com");
834 HAVE_GETHOSTBYNAME="1"
840 if test "$HAVE_GETHOSTBYNAME" != "1"
842 dnl This is for eCos with a stubbed DNS implementation
843 AC_MSG_CHECKING([for gethostbyname for eCos])
849 gethostbyname("www.dummysite.com");
853 HAVE_GETHOSTBYNAME="1"
859 if test "$HAVE_GETHOSTBYNAME" != "1"
861 dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
862 AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
865 #include <proto/bsdsocket.h>
866 struct Library *SocketBase = NULL;
868 gethostbyname("www.dummysite.com");
872 HAVE_GETHOSTBYNAME="1"
873 HAVE_PROTO_BSDSOCKET_H="1"
874 AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
875 AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
881 if test "$HAVE_GETHOSTBYNAME" != "1"
883 dnl gethostbyname in the network lib - for Haiku OS
884 AC_CHECK_LIB(network, gethostbyname,
885 [HAVE_GETHOSTBYNAME="1"
886 LIBS="-lnetwork $LIBS"
890 if test "$HAVE_GETHOSTBYNAME" != "1"
892 dnl gethostbyname in the net lib - for BeOS
893 AC_CHECK_LIB(net, gethostbyname,
894 [HAVE_GETHOSTBYNAME="1"
900 if test "$HAVE_GETHOSTBYNAME" != "1"; then
901 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
904 CURL_CHECK_LIBS_CONNECT
906 CURL_NETWORK_LIBS=$LIBS
908 dnl **********************************************************************
909 dnl In case that function clock_gettime with monotonic timer is available,
910 dnl check for additional required libraries.
911 dnl **********************************************************************
912 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
914 dnl **********************************************************************
915 dnl The preceding library checks are all potentially useful for test
916 dnl servers and libtest cases which require networking and clock_gettime
917 dnl support. Save the list of required libraries at this point for use
918 dnl while linking those test servers and programs.
919 dnl **********************************************************************
920 CURL_NETWORK_AND_TIME_LIBS=$LIBS
922 dnl **********************************************************************
923 dnl Check for the presence of ZLIB libraries and headers
924 dnl **********************************************************************
926 dnl Check for & handle argument to --with-zlib.
928 clean_CPPFLAGS=$CPPFLAGS
929 clean_LDFLAGS=$LDFLAGS
933 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
934 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
935 [OPT_ZLIB="$withval"])
937 if test "$OPT_ZLIB" = "no" ; then
938 AC_MSG_WARN([zlib disabled])
940 if test "$OPT_ZLIB" = "yes" ; then
944 if test -z "$OPT_ZLIB" ; then
945 CURL_CHECK_PKGCONFIG(zlib)
947 if test "$PKGCONFIG" != "no" ; then
948 LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
949 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
950 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
955 if test -z "$HAVE_LIBZ"; then
957 dnl Check for the lib without setting any new path, since many
958 dnl people have it in the default path
960 AC_CHECK_LIB(z, inflateEnd,
961 dnl libz found, set the variable
964 dnl if no lib found, try /usr/local
965 [OPT_ZLIB="/usr/local"])
969 dnl Add a nonempty path to the compiler flags
970 if test -n "$OPT_ZLIB"; then
971 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
972 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
975 AC_CHECK_HEADER(zlib.h,
979 dnl if the lib wasn't found already, try again with the new paths
980 if test "$HAVE_LIBZ" != "1"; then
981 AC_CHECK_LIB(z, gzread,
983 dnl the lib was found!
987 [ CPPFLAGS=$clean_CPPFLAGS
988 LDFLAGS=$clean_LDFLAGS])
992 dnl zlib.h was not found, restore the flags
993 CPPFLAGS=$clean_CPPFLAGS
994 LDFLAGS=$clean_LDFLAGS]
997 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
999 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1001 CPPFLAGS=$clean_CPPFLAGS
1002 LDFLAGS=$clean_LDFLAGS
1004 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1006 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1007 CPPFLAGS=$clean_CPPFLAGS
1008 LDFLAGS=$clean_LDFLAGS
1010 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1012 dnl both header and lib were found!
1014 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1015 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1018 LIBS="-lz $clean_LIBS"
1020 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1022 AC_MSG_NOTICE([found both libz and libz.h header])
1023 curl_zlib_msg="enabled"
1027 dnl set variable for use in automakefile(s)
1028 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1031 dnl **********************************************************************
1032 dnl Check for the presence of BROTLI decoder libraries and headers
1033 dnl **********************************************************************
1035 dnl Brotli project home page: https://github.com/google/brotli
1037 dnl Default to compiler & linker defaults for BROTLI files & libraries.
1039 AC_ARG_WITH(brotli,dnl
1040 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])
1041 AC_HELP_STRING([--without-brotli], [disable BROTLI]),
1042 OPT_BROTLI=$withval)
1044 if test X"$OPT_BROTLI" != Xno; then
1045 dnl backup the pre-brotli variables
1046 CLEANLDFLAGS="$LDFLAGS"
1047 CLEANCPPFLAGS="$CPPFLAGS"
1050 case "$OPT_BROTLI" in
1052 dnl --with-brotli (without path) used
1053 CURL_CHECK_PKGCONFIG(libbrotlidec)
1055 if test "$PKGCONFIG" != "no" ; then
1056 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1057 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1058 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1059 version=`$PKGCONFIG --modversion libbrotlidec`
1060 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
1065 dnl no --with-brotli option given, just check default places
1068 dnl use the given --with-brotli spot
1069 PREFIX_BROTLI=$OPT_BROTLI
1073 dnl if given with a prefix, we set -L and -I based on that
1074 if test -n "$PREFIX_BROTLI"; then
1075 LIB_BROTLI="-lbrotlidec"
1076 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1077 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1078 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1081 LDFLAGS="$LDFLAGS $LD_BROTLI"
1082 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1083 LIBS="$LIB_BROTLI $LIBS"
1085 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1087 AC_CHECK_HEADERS(brotli/decode.h,
1088 curl_brotli_msg="enabled (libbrotlidec)"
1090 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1091 AC_SUBST(HAVE_BROTLI, [1])
1094 if test X"$OPT_BROTLI" != Xoff &&
1095 test "$HAVE_BROTLI" != "1"; then
1096 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1099 if test "$HAVE_BROTLI" = "1"; then
1100 if test -n "$DIR_BROTLI"; then
1101 dnl when the brotli shared libs were found in a path that the run-time
1102 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1103 dnl to prevent further configure tests to fail due to this
1105 if test "x$cross_compiling" != "xyes"; then
1106 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1107 export CURL_LIBRARY_PATH
1108 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1112 dnl no brotli, revert back to clean variables
1113 LDFLAGS=$CLEANLDFLAGS
1114 CPPFLAGS=$CLEANCPPFLAGS
1119 dnl **********************************************************************
1120 dnl Check for libzstd
1121 dnl **********************************************************************
1123 dnl Default to compiler & linker defaults for libzstd
1125 AC_ARG_WITH(zstd,dnl
1126 AC_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1127 AC_HELP_STRING([--without-zstd], [disable libzstd]),
1130 if test X"$OPT_ZSTD" != Xno; then
1131 dnl backup the pre-zstd variables
1132 CLEANLDFLAGS="$LDFLAGS"
1133 CLEANCPPFLAGS="$CPPFLAGS"
1138 dnl --with-zstd (without path) used
1139 CURL_CHECK_PKGCONFIG(libzstd)
1141 if test "$PKGCONFIG" != "no" ; then
1142 LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
1143 LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
1144 CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
1145 version=`$PKGCONFIG --modversion libzstd`
1146 DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
1151 dnl no --with-zstd option given, just check default places
1154 dnl use the given --with-zstd spot
1155 PREFIX_ZSTD=$OPT_ZSTD
1159 dnl if given with a prefix, we set -L and -I based on that
1160 if test -n "$PREFIX_ZSTD"; then
1162 LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
1163 CPP_ZSTD=-I${PREFIX_ZSTD}/include
1164 DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
1167 LDFLAGS="$LDFLAGS $LD_ZSTD"
1168 CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
1169 LIBS="$LIB_ZSTD $LIBS"
1171 AC_CHECK_LIB(zstd, ZSTD_createDStream)
1173 AC_CHECK_HEADERS(zstd.h,
1174 curl_zstd_msg="enabled (libzstd)"
1176 AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
1177 AC_SUBST(HAVE_ZSTD, [1])
1180 if test X"$OPT_ZSTD" != Xoff &&
1181 test "$HAVE_ZSTD" != "1"; then
1182 AC_MSG_ERROR([libzstd was not found where specified!])
1185 if test "$HAVE_ZSTD" = "1"; then
1186 if test -n "$DIR_ZSTD"; then
1187 dnl when the zstd shared lib were found in a path that the run-time
1188 dnl linker doesn't search through, we need to add it to
1189 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
1192 if test "x$cross_compiling" != "xyes"; then
1193 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
1194 export CURL_LIBRARY_PATH
1195 AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
1199 dnl no zstd, revert back to clean variables
1200 LDFLAGS=$CLEANLDFLAGS
1201 CPPFLAGS=$CLEANCPPFLAGS
1206 dnl **********************************************************************
1208 dnl **********************************************************************
1211 AC_ARG_WITH(ldap-lib,
1212 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1213 [LDAPLIBNAME="$withval"])
1216 AC_ARG_WITH(lber-lib,
1217 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1218 [LBERLIBNAME="$withval"])
1220 if test x$CURL_DISABLE_LDAP != x1 ; then
1222 CURL_CHECK_HEADER_LBER
1223 CURL_CHECK_HEADER_LDAP
1224 CURL_CHECK_HEADER_LDAPSSL
1225 CURL_CHECK_HEADER_LDAP_SSL
1227 if test -z "$LDAPLIBNAME" ; then
1228 if test "$curl_cv_native_windows" = "yes"; then
1229 dnl Windows uses a single and unique LDAP library name
1230 LDAPLIBNAME="wldap32"
1235 if test "$LDAPLIBNAME" ; then
1236 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1237 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1238 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1239 AC_SUBST(CURL_DISABLE_LDAP, [1])
1240 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1241 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1243 dnl Try to find the right ldap libraries for this system
1244 CURL_CHECK_LIBS_LDAP
1245 case X-"$curl_cv_ldap_LIBS" in
1247 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1248 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1249 AC_SUBST(CURL_DISABLE_LDAP, [1])
1250 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1251 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1257 if test x$CURL_DISABLE_LDAP != x1 ; then
1259 if test "$LBERLIBNAME" ; then
1260 dnl If name is "no" then don't define this library at all
1261 dnl (it's only needed if libldap.so's dependencies are broken).
1262 if test "$LBERLIBNAME" != "no" ; then
1263 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1264 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1265 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1266 AC_SUBST(CURL_DISABLE_LDAP, [1])
1267 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1268 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1273 if test x$CURL_DISABLE_LDAP != x1 ; then
1274 AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
1276 if test "$LDAPLIBNAME" = "wldap32"; then
1277 curl_ldap_msg="enabled (winldap)"
1278 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1280 curl_ldap_msg="enabled (OpenLDAP)"
1281 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1282 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1283 AC_SUBST(USE_OPENLDAP, [1])
1288 if test x$CURL_DISABLE_LDAPS != x1 ; then
1289 curl_ldaps_msg="enabled"
1292 dnl **********************************************************************
1294 dnl **********************************************************************
1296 AC_MSG_CHECKING([whether to enable IPv6])
1298 AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1299 AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1300 [ case "$enableval" in
1305 *) AC_MSG_RESULT(yes)
1310 AC_TRY_RUN([ /* are AF_INET6 and sockaddr_in6 available? */
1311 #include <sys/types.h>
1312 #ifdef HAVE_WINSOCK2_H
1313 #include <winsock2.h>
1314 #include <ws2tcpip.h>
1316 #include <sys/socket.h>
1317 #include <netinet/in.h>
1318 #if defined (__TANDEM)
1319 # include <netinet/in6.h>
1322 #include <stdlib.h> /* for exit() */
1325 struct sockaddr_in6 s;
1327 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1341 if test "$ipv6" = yes; then
1342 curl_ipv6_msg="enabled"
1343 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
1345 AC_SUBST(IPV6_ENABLED)
1347 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1349 #include <sys/types.h>
1350 #ifdef HAVE_WINSOCK2_H
1351 #include <winsock2.h>
1352 #include <ws2tcpip.h>
1354 #include <netinet/in.h>
1355 #if defined (__TANDEM)
1356 # include <netinet/in6.h>
1359 struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
1360 if test "$have_sin6_scope_id" = yes; then
1361 AC_MSG_RESULT([yes])
1362 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1368 dnl **********************************************************************
1369 dnl Check if the operating system allows programs to write to their own argv[]
1370 dnl **********************************************************************
1372 AC_MSG_CHECKING([if argv can be written to])
1374 int main(int argc, char **argv)
1378 return (argv[0][0] == ' ')?0:1;
1381 curl_cv_writable_argv=yes
1383 curl_cv_writable_argv=no
1385 curl_cv_writable_argv=cross
1387 case $curl_cv_writable_argv in
1389 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1397 AC_MSG_WARN([the previous check could not be made default was used])
1401 dnl **********************************************************************
1402 dnl Check for GSS-API libraries
1403 dnl **********************************************************************
1405 dnl check for GSS-API stuff in the /usr as default
1408 AC_ARG_WITH(gssapi-includes,
1409 AC_HELP_STRING([--with-gssapi-includes=DIR],
1410 [Specify location of GSS-API headers]),
1411 [ GSSAPI_INCS="-I$withval"
1415 AC_ARG_WITH(gssapi-libs,
1416 AC_HELP_STRING([--with-gssapi-libs=DIR],
1417 [Specify location of GSS-API libs]),
1418 [ GSSAPI_LIB_DIR="-L$withval"
1423 AC_HELP_STRING([--with-gssapi=DIR],
1424 [Where to look for GSS-API]), [
1425 GSSAPI_ROOT="$withval"
1426 if test x"$GSSAPI_ROOT" != xno; then
1428 if test x"$GSSAPI_ROOT" = xyes; then
1429 dnl if yes, then use default root
1435 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1437 save_CPPFLAGS="$CPPFLAGS"
1438 AC_MSG_CHECKING([if GSS-API support is requested])
1439 if test x"$want_gss" = xyes; then
1442 if test -z "$GSSAPI_INCS"; then
1443 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1444 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1445 elif test -f "$KRB5CONFIG"; then
1446 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1447 elif test "$GSSAPI_ROOT" != "yes"; then
1448 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1452 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1454 AC_CHECK_HEADER(gss.h,
1456 dnl found in the given dirs
1457 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1461 dnl not found, check Heimdal or MIT
1462 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1464 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1469 #ifdef HAVE_GSSAPI_GSSAPI_H
1470 #include <gssapi/gssapi.h>
1473 if test "x$not_mit" = "x1"; then
1474 dnl MIT not found, check for Heimdal
1475 AC_CHECK_HEADER(gssapi.h,
1478 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1481 dnl no header found, disabling GSS
1483 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1488 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1489 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1490 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1493 #include <gssapi/gssapi.h>
1494 #include <gssapi/gssapi_generic.h>
1495 #include <gssapi/gssapi_krb5.h>
1500 GSS_C_NT_HOSTBASED_SERVICE,
1504 AC_MSG_RESULT([yes])
1507 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1508 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1516 if test x"$want_gss" = xyes; then
1517 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1519 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1521 if test -n "$gnu_gss"; then
1522 curl_gss_msg="enabled (GNU GSS)"
1523 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1525 elif test -z "$GSSAPI_LIB_DIR"; then
1528 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1531 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1532 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1534 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1535 LIBS="$gss_libs $LIBS"
1536 elif test -f "$KRB5CONFIG"; then
1537 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1539 gss_libs=`$KRB5CONFIG --libs gssapi`
1540 LIBS="$gss_libs $LIBS"
1547 gss_libname="gssapi"
1551 if test "$GSSAPI_ROOT" != "yes"; then
1552 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1553 LIBS="-l$gss_libname $LIBS"
1555 LIBS="-l$gss_libname $LIBS"
1561 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1567 LIBS="-lgssapi $LIBS"
1572 CPPFLAGS="$save_CPPFLAGS"
1576 if test x"$want_gss" = "xyes"; then
1577 build_libstubgss=yes
1580 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
1582 dnl -------------------------------------------------------------
1583 dnl parse --with-default-ssl-backend so it can be validated below
1584 dnl -------------------------------------------------------------
1586 DEFAULT_SSL_BACKEND=no
1587 VALID_DEFAULT_SSL_BACKEND=
1588 AC_ARG_WITH(default-ssl-backend,
1589 AC_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
1590 AC_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
1591 [DEFAULT_SSL_BACKEND=$withval])
1592 case "$DEFAULT_SSL_BACKEND" in
1594 dnl --without-default-ssl-backend option used
1597 dnl --with-default-ssl-backend option used without name
1598 AC_MSG_ERROR([The name of the default SSL backend is required.])
1601 dnl --with-default-ssl-backend option used with name
1602 AC_SUBST(DEFAULT_SSL_BACKEND)
1603 dnl needs to be validated below
1604 VALID_DEFAULT_SSL_BACKEND=no
1608 dnl **********************************************************************
1610 dnl -------------------------------------------------
1611 dnl check winssl option before other SSL libraries
1612 dnl -------------------------------------------------
1615 AC_ARG_WITH(winssl,dnl
1616 AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
1617 AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
1618 OPT_SCHANNEL=$withval)
1620 AC_ARG_WITH(schannel,dnl
1621 AC_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS])
1622 AC_HELP_STRING([--without-schannel], [disable Windows native SSL/TLS]),
1623 OPT_SCHANNEL=$withval)
1625 AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
1626 if test -z "$ssl_backends" -o "x$OPT_SCHANNEL" != xno; then
1628 if test "x$OPT_SCHANNEL" != "xno" &&
1629 test "x$curl_cv_native_windows" = "xyes"; then
1631 AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
1632 AC_SUBST(USE_SCHANNEL, [1])
1633 ssl_msg="Windows-native"
1634 test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1636 # --with-schannel implies --enable-sspi
1637 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
1638 AC_SUBST(USE_WINDOWS_SSPI, [1])
1639 curl_sspi_msg="enabled"
1640 LIBS="-lcrypt32 $LIBS"
1644 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1649 OPT_SECURETRANSPORT=no
1650 AC_ARG_WITH(darwinssl,dnl
1651 AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS])
1652 AC_HELP_STRING([--without-darwinssl], [disable Apple OS native SSL/TLS]),
1653 OPT_SECURETRANSPORT=$withval)
1655 AC_ARG_WITH(secure-transport,dnl
1656 AC_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS])
1657 AC_HELP_STRING([--without-secure-transport], [disable Apple OS native SSL/TLS]),
1658 OPT_SECURETRANSPORT=$withval)
1660 AC_MSG_CHECKING([whether to enable Secure Transport])
1661 if test -z "$ssl_backends" -o "x$OPT_SECURETRANSPORT" != xno; then
1662 if test "x$OPT_SECURETRANSPORT" != "xno" &&
1663 (test "x$cross_compiling" != "xno" || test -d "/System/Library/Frameworks/Security.framework"); then
1665 AC_DEFINE(USE_SECTRANSP, 1, [enable Secure Transport])
1666 AC_SUBST(USE_SECTRANSP, [1])
1667 ssl_msg="Secure Transport"
1668 test secure-transport != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1669 SECURETRANSPORT_ENABLED=1
1670 LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
1674 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1680 AC_ARG_WITH(amissl,dnl
1681 AC_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)])
1682 AC_HELP_STRING([--without-amissl], [disable Amiga native SSL/TLS (AmiSSL)]),
1683 OPT_AMISSL=$withval)
1685 AC_MSG_CHECKING([whether to enable Amiga native SSL/TLS (AmiSSL)])
1686 if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then
1687 if test -z "$ssl_backends" -o "x$OPT_AMISSL" != xno; then
1689 if test "x$OPT_AMISSL" != "xno"; then
1692 test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1694 LIBS="-lamisslauto $LIBS"
1695 AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use])
1696 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])
1700 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1708 dnl **********************************************************************
1709 dnl Check for the presence of SSL libraries and headers
1710 dnl **********************************************************************
1712 dnl Default to compiler & linker defaults for SSL files & libraries.
1714 dnl Default to no CA bundle
1717 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])
1718 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1721 if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
1722 test X"$OPT_SSL" != Xno; then
1725 dnl backup the pre-ssl variables
1726 CLEANLDFLAGS="$LDFLAGS"
1727 CLEANCPPFLAGS="$CPPFLAGS"
1730 dnl This is for Msys/Mingw
1732 *-*-msys* | *-*-mingw*)
1733 AC_MSG_CHECKING([for gdi32])
1734 my_ac_save_LIBS=$LIBS
1735 LIBS="-lgdi32 $LIBS"
1736 AC_TRY_LINK([#include <windef.h>
1737 #include <wingdi.h>],
1740 AC_MSG_RESULT([yes])],
1741 [ dnl failed, restore LIBS
1742 LIBS=$my_ac_save_LIBS
1750 dnl --with-ssl (without path) used
1751 if test x$cross_compiling != xyes; then
1752 dnl only do pkg-config magic when not cross-compiling
1755 PREFIX_OPENSSL=/usr/local/ssl
1756 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1759 dnl no --with-ssl option given, just check default places
1760 if test x$cross_compiling != xyes; then
1761 dnl only do pkg-config magic when not cross-compiling
1767 dnl check the given --with-ssl spot
1769 PREFIX_OPENSSL=$OPT_SSL
1771 dnl Try pkg-config even when cross-compiling. Since we
1772 dnl specify PKG_CONFIG_LIBDIR we're only looking where
1773 dnl the user told us to look
1774 OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
1775 if test -f "$OPENSSL_PCDIR/openssl.pc"; then
1776 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
1778 elif test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
1779 AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-ssl prefix!])
1782 dnl in case pkg-config comes up empty, use what we got
1784 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1785 if test "$PREFIX_OPENSSL" != "/usr" ; then
1786 SSL_LDFLAGS="-L$LIB_OPENSSL"
1787 SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
1789 SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1793 if test "$PKGTEST" = "yes"; then
1795 CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
1797 if test "$PKGCONFIG" != "no" ; then
1798 SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1799 $PKGCONFIG --libs-only-l --libs-only-other openssl 2>/dev/null`
1801 SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1802 $PKGCONFIG --libs-only-L openssl 2>/dev/null`
1804 SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1805 $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1808 AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
1809 AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
1810 AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
1812 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/^-L//'`
1814 dnl use the values pkg-config reported. This is here
1815 dnl instead of below with CPPFLAGS and LDFLAGS because we only
1816 dnl learn about this via pkg-config. If we only have
1817 dnl the argument to --with-ssl we don't know what
1818 dnl additional libs may be necessary. Hope that we
1820 LIBS="$SSL_LIBS $LIBS"
1824 dnl finally, set flags to use SSL
1825 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1826 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1828 AC_CHECK_LIB(crypto, HMAC_Update,[
1830 LIBS="-lcrypto $LIBS"
1832 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1833 if test "$PKGCONFIG" = "no" ; then
1834 # only set this if pkg-config wasn't used
1835 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1837 # Linking previously failed, try extra paths from --with-ssl or pkg-config.
1838 # Use a different function name to avoid reusing the earlier cached result.
1839 AC_CHECK_LIB(crypto, HMAC_Init_ex,[
1841 LIBS="-lcrypto $LIBS"], [
1843 dnl still no, but what about with -ldl?
1844 AC_MSG_CHECKING([OpenSSL linking with -ldl])
1845 LIBS="$CLEANLIBS -lcrypto -ldl"
1848 #include <openssl/err.h>
1859 dnl ok, so what about both -ldl and -lpthread?
1860 dnl This may be necessary for static libraries.
1862 AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
1863 LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
1866 #include <openssl/err.h>
1877 LDFLAGS="$CLEANLDFLAGS"
1878 CPPFLAGS="$CLEANCPPFLAGS"
1888 if test X"$HAVECRYPTO" = X"yes"; then
1889 dnl This is only reasonable to do if crypto actually is there: check for
1890 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1892 AC_CHECK_LIB(ssl, SSL_connect)
1894 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1895 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1896 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1898 LIBS="-lRSAglue -lrsaref $LIBS"
1899 AC_CHECK_LIB(ssl, SSL_connect)
1900 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1901 dnl still no SSL_connect
1910 dnl Have the libraries--check for OpenSSL headers
1911 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1912 openssl/pem.h openssl/ssl.h openssl/err.h,
1914 test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1916 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1918 if test $ac_cv_header_openssl_x509_h = no; then
1919 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1920 dnl since 'err.h' might in fact find a krb4 header with the same
1922 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1924 if test $ac_cv_header_x509_h = yes &&
1925 test $ac_cv_header_crypto_h = yes &&
1926 test $ac_cv_header_ssl_h = yes; then
1934 if test X"$OPENSSL_ENABLED" != X"1"; then
1938 if test X"$OPT_SSL" != Xoff &&
1939 test "$OPENSSL_ENABLED" != "1"; then
1940 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1944 if test X"$OPENSSL_ENABLED" = X"1"; then
1945 dnl These can only exist if OpenSSL exists
1946 dnl OpenSSL_version is introduced in 3.0.0
1948 AC_CHECK_FUNCS( RAND_egd \
1949 SSLv2_client_method \
1952 AC_MSG_CHECKING([for BoringSSL])
1955 #include <openssl/base.h>
1957 #ifndef OPENSSL_IS_BORINGSSL
1958 #error not boringssl
1962 AC_MSG_RESULT([yes])
1963 AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
1964 [Define to 1 if using BoringSSL.])
1970 AC_MSG_CHECKING([for libressl])
1973 #include <openssl/opensslv.h>
1975 int dummy = LIBRESSL_VERSION_NUMBER;
1978 AC_MSG_RESULT([yes])
1979 AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1,
1980 [Define to 1 if using libressl.])
1986 AC_MSG_CHECKING([for OpenSSL >= v3])
1989 #include <openssl/opensslv.h>
1991 #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
1998 AC_MSG_RESULT([yes])
1999 AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1,
2000 [Define to 1 if using OpenSSL 3 or later.])
2001 dnl OpenSSLv3 marks the DES functions deprecated but we have no
2002 dnl replacements (yet) so tell the compiler to not warn for them
2004 dnl Ask OpenSSL to suppress the warnings.
2005 CPPFLAGS="$CPPFLAGS -DOPENSSL_SUPPRESS_DEPRECATED"
2006 ssl_msg="OpenSSL v3+"
2012 if test "$OPENSSL_ENABLED" = "1"; then
2013 if test -n "$LIB_OPENSSL"; then
2014 dnl when the ssl shared libs were found in a path that the run-time
2015 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2016 dnl to prevent further configure tests to fail due to this
2017 if test "x$cross_compiling" != "xyes"; then
2018 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL"
2019 export CURL_LIBRARY_PATH
2020 AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH])
2023 CURL_CHECK_OPENSSL_API
2024 check_for_ca_bundle=1
2027 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2030 if test X"$OPT_SSL" != Xoff &&
2031 test X"$OPT_SSL" != Xno &&
2032 test "$OPENSSL_ENABLED" != "1"; then
2033 AC_MSG_NOTICE([OPT_SSL: $OPT_SSL])
2034 AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED])
2035 AC_MSG_ERROR([--with-ssl was given but OpenSSL could not be detected])
2038 dnl **********************************************************************
2039 dnl Check for the random seed preferences
2040 dnl **********************************************************************
2042 if test X"$OPENSSL_ENABLED" = X"1"; then
2043 AC_ARG_WITH(egd-socket,
2044 AC_HELP_STRING([--with-egd-socket=FILE],
2045 [Entropy Gathering Daemon socket pathname]),
2046 [ EGD_SOCKET="$withval" ]
2048 if test -n "$EGD_SOCKET" ; then
2049 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
2050 [your Entropy Gathering Daemon socket pathname] )
2053 dnl Check for user-specified random device
2055 AC_HELP_STRING([--with-random=FILE],
2056 [read randomness from FILE (default=/dev/urandom)]),
2057 [ RANDOM_FILE="$withval" ],
2059 if test x$cross_compiling != xyes; then
2060 dnl Check for random device
2061 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
2063 AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
2067 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
2068 AC_SUBST(RANDOM_FILE)
2069 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
2070 [a suitable file to read random data from])
2075 dnl We require OpenSSL with SRP support.
2077 if test "$OPENSSL_ENABLED" = "1"; then
2078 AC_CHECK_LIB(crypto, SRP_Calc_client_key,
2080 AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
2081 AC_SUBST(HAVE_OPENSSL_SRP, [1])
2086 dnl Whether the OpenSSL configuration will be loaded automatically
2088 if test X"$OPENSSL_ENABLED" = X"1"; then
2089 AC_ARG_ENABLE(openssl-auto-load-config,
2090 AC_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration])
2091 AC_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]),
2092 [ if test X"$enableval" = X"no"; then
2093 AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled])
2094 AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically])
2099 dnl ----------------------------------------------------
2100 dnl check for GnuTLS
2101 dnl ----------------------------------------------------
2103 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
2106 AC_ARG_WITH(gnutls,dnl
2107 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
2108 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
2109 OPT_GNUTLS=$withval)
2111 if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then
2114 if test X"$OPT_GNUTLS" != Xno; then
2122 if test "x$OPT_GNUTLS" = "xyes"; then
2123 dnl this is with no partiular path given
2124 CURL_CHECK_PKGCONFIG(gnutls)
2126 if test "$PKGCONFIG" != "no" ; then
2127 addlib=`$PKGCONFIG --libs-only-l gnutls`
2128 addld=`$PKGCONFIG --libs-only-L gnutls`
2129 addcflags=`$PKGCONFIG --cflags-only-I gnutls`
2130 version=`$PKGCONFIG --modversion gnutls`
2131 gtlslib=`echo $addld | $SED -e 's/^-L//'`
2133 dnl without pkg-config, we try libgnutls-config as that was how it
2135 check=`libgnutls-config --version 2>/dev/null`
2136 if test -n "$check"; then
2137 addlib=`libgnutls-config --libs`
2138 addcflags=`libgnutls-config --cflags`
2139 version=`libgnutls-config --version`
2140 gtlslib=`libgnutls-config --prefix`/lib$libsuff
2144 dnl this is with a given path, first check if there's a libgnutls-config
2145 dnl there and if not, make an educated guess
2146 cfg=$OPT_GNUTLS/bin/libgnutls-config
2147 check=`$cfg --version 2>/dev/null`
2148 if test -n "$check"; then
2149 addlib=`$cfg --libs`
2150 addcflags=`$cfg --cflags`
2151 version=`$cfg --version`
2152 gtlslib=`$cfg --prefix`/lib$libsuff
2154 dnl without pkg-config and libgnutls-config, we guess a lot!
2156 addld=-L$OPT_GNUTLS/lib$libsuff
2157 addcflags=-I$OPT_GNUTLS/include
2158 version="" # we just don't know
2159 gtlslib=$OPT_GNUTLS/lib$libsuff
2163 if test -z "$version"; then
2164 dnl lots of efforts, still no go
2168 if test -n "$addlib"; then
2171 CLEANCPPFLAGS="$CPPFLAGS"
2172 CLEANLDFLAGS="$LDFLAGS"
2174 LIBS="$addlib $LIBS"
2175 LDFLAGS="$LDFLAGS $addld"
2176 if test "$addcflags" != "-I/usr/include"; then
2177 CPPFLAGS="$CPPFLAGS $addcflags"
2180 dnl this function is selected since it was introduced in 3.1.10
2181 AC_CHECK_LIB(gnutls, gnutls_x509_crt_get_dn2,
2183 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
2184 AC_SUBST(USE_GNUTLS, [1])
2188 test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2192 CPPFLAGS="$CLEANCPPFLAGS"
2195 if test "x$USE_GNUTLS" = "xyes"; then
2196 AC_MSG_NOTICE([detected GnuTLS version $version])
2197 check_for_ca_bundle=1
2198 if test -n "$gtlslib"; then
2199 dnl when shared libs were found in a path that the run-time
2200 dnl linker doesn't search through, we need to add it to
2201 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2203 if test "x$cross_compiling" != "xyes"; then
2204 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$gtlslib"
2205 export CURL_LIBRARY_PATH
2206 AC_MSG_NOTICE([Added $gtlslib to CURL_LIBRARY_PATH])
2213 fi dnl GNUTLS not disabled
2215 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2219 dnl Check which crypto backend GnuTLS uses
2222 if test "$GNUTLS_ENABLED" = "1"; then
2224 # First check if we can detect either crypto library via transitive linking
2225 AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2226 if test "$USE_GNUTLS_NETTLE" = ""; then
2227 AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2229 # If not, try linking directly to both of them to see if they are available
2230 if test "$USE_GNUTLS_NETTLE" = ""; then
2231 AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2233 if test "$USE_GNUTLS_NETTLE" = ""; then
2234 AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2236 if test "$USE_GNUTLS_NETTLE" = ""; then
2237 AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
2239 if test "$USE_GNUTLS_NETTLE" = "1"; then
2240 AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
2241 AC_SUBST(USE_GNUTLS_NETTLE, [1])
2242 LIBS="-lnettle $LIBS"
2244 LIBS="-lgcrypt $LIBS"
2249 dnl We require GnuTLS with SRP support.
2251 if test "$GNUTLS_ENABLED" = "1"; then
2252 AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
2254 AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
2255 AC_SUBST(HAVE_GNUTLS_SRP, [1])
2259 dnl ----------------------------------------------------
2260 dnl check for mbedTLS
2261 dnl ----------------------------------------------------
2267 AC_ARG_WITH(mbedtls,dnl
2268 AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root])
2269 AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]),
2270 OPT_MBEDTLS=$withval)
2272 if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then
2275 if test X"$OPT_MBEDTLS" != Xno; then
2277 if test "$OPT_MBEDTLS" = "yes"; then
2281 if test -z "$OPT_MBEDTLS" ; then
2282 dnl check for lib first without setting any new path
2284 AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
2285 dnl libmbedtls found, set the variable
2287 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2288 AC_SUBST(USE_MBEDTLS, [1])
2292 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2293 ], [], -lmbedx509 -lmbedcrypto)
2301 if test "x$USE_MBEDTLS" != "xyes"; then
2302 dnl add the path and test again
2303 addld=-L$OPT_MBEDTLS/lib$libsuff
2304 addcflags=-I$OPT_MBEDTLS/include
2305 mbedtlslib=$OPT_MBEDTLS/lib$libsuff
2307 LDFLAGS="$LDFLAGS $addld"
2308 if test "$addcflags" != "-I/usr/include"; then
2309 CPPFLAGS="$CPPFLAGS $addcflags"
2312 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
2314 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2315 AC_SUBST(USE_MBEDTLS, [1])
2319 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2324 ], -lmbedx509 -lmbedcrypto)
2327 if test "x$USE_MBEDTLS" = "xyes"; then
2328 AC_MSG_NOTICE([detected mbedTLS])
2329 check_for_ca_bundle=1
2331 LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS"
2333 if test -n "$mbedtlslib"; then
2334 dnl when shared libs were found in a path that the run-time
2335 dnl linker doesn't search through, we need to add it to
2336 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2338 if test "x$cross_compiling" != "xyes"; then
2339 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$mbedtlslib"
2340 export CURL_LIBRARY_PATH
2341 AC_MSG_NOTICE([Added $mbedtlslib to CURL_LIBRARY_PATH])
2346 fi dnl mbedTLS not disabled
2348 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2351 dnl ----------------------------------------------------
2352 dnl check for wolfSSL
2353 dnl ----------------------------------------------------
2355 dnl Default to compiler & linker defaults for wolfSSL files & libraries.
2361 AC_ARG_WITH(wolfssl,dnl
2362 AC_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)])
2363 AC_HELP_STRING([--without-wolfssl], [disable WolfSSL detection]),
2364 OPT_WOLFSSL=$withval)
2366 case "$OPT_WOLFSSL" in
2371 wolfpkg="$withval/lib/pkgconfig"
2375 if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then
2378 if test X"$OPT_WOLFSSL" != Xno; then
2380 if test "$OPT_WOLFSSL" = "yes"; then
2384 dnl try pkg-config magic
2385 CURL_CHECK_PKGCONFIG(wolfssl, [$wolfpkg])
2386 AC_MSG_NOTICE([Check dir $wolfpkg])
2391 if test "$PKGCONFIG" != "no" ; then
2392 addlib=`CURL_EXPORT_PCDIR([$wolfpkg])
2393 $PKGCONFIG --libs-only-l wolfssl`
2394 addld=`CURL_EXPORT_PCDIR([$wolfpkg])
2395 $PKGCONFIG --libs-only-L wolfssl`
2396 addcflags=`CURL_EXPORT_PCDIR([$wolfpkg])
2397 $PKGCONFIG --cflags-only-I wolfssl`
2398 version=`CURL_EXPORT_PCDIR([$wolfpkg])
2399 $PKGCONFIG --modversion wolfssl`
2400 wolfssllibpath=`echo $addld | $SED -e 's/^-L//'`
2403 dnl use system defaults if user does not supply a path
2404 if test -n "$OPT_WOLFSSL"; then
2405 addld=-L$OPT_WOLFSSL/lib$libsuff
2406 addcflags=-I$OPT_WOLFSSL/include
2407 wolfssllibpath=$OPT_WOLFSSL/lib$libsuff
2411 if test "x$USE_WOLFSSL" != "xyes"; then
2413 LDFLAGS="$LDFLAGS $addld"
2414 AC_MSG_NOTICE([Add $addld to LDFLAGS])
2415 if test "$addcflags" != "-I/usr/include"; then
2416 CPPFLAGS="$CPPFLAGS $addcflags"
2417 AC_MSG_NOTICE([Add $addcflags to CPPFLAGS])
2420 my_ac_save_LIBS="$LIBS"
2421 LIBS="$addlib $LIBS"
2422 AC_MSG_NOTICE([Add $addlib to LIBS])
2424 AC_MSG_CHECKING([for wolfSSL_Init in -lwolfssl])
2427 /* These aren't needed for detection and confuse WolfSSL.
2428 They are set up properly later if it is detected. */
2430 #undef SIZEOF_LONG_LONG
2431 #include <wolfssl/ssl.h>
2433 return wolfSSL_Init();
2437 AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled])
2438 AC_SUBST(USE_WOLFSSL, [1])
2442 test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2450 LIBS="$my_ac_save_LIBS"
2453 if test "x$USE_WOLFSSL" = "xyes"; then
2454 AC_MSG_NOTICE([detected wolfSSL])
2455 check_for_ca_bundle=1
2457 dnl wolfssl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
2458 AX_COMPILE_CHECK_SIZEOF(long long)
2460 LIBS="$addlib -lm $LIBS"
2462 dnl Recent WolfSSL versions build without SSLv3 by default
2463 dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
2464 dnl DES* is needed for NTLM support and lives in the OpenSSL compatibility
2466 AC_CHECK_FUNCS(wolfSSLv3_client_method \
2467 wolfSSL_get_peer_certificate \
2470 dnl if this symbol is present, we want the include path to include the
2471 dnl OpenSSL API root as well
2472 AC_CHECK_FUNC(wolfSSL_DES_ecb_encrypt,
2474 AC_DEFINE(HAVE_WOLFSSL_DES_ECB_ENCRYPT, 1,
2475 [if you have wolfSSL_DES_ecb_encrypt])
2476 if test -n "$addcflags"; then
2477 dnl use a for loop to strip off whitespace
2478 for f in $addcflags; do
2479 CPPFLAGS="$f/wolfssl $CPPFLAGS"
2480 AC_MSG_NOTICE([Add $f/wolfssl to CPPFLAGS])
2484 dnl user didn't give a path, so guess/hope they installed wolfssl
2485 dnl headers to system default location
2486 CPPFLAGS="-I$includedir/wolfssl $CPPFLAGS"
2487 AC_MSG_NOTICE([Add $includedir/wolfssl to CPPFLAGS])
2493 if test -n "$wolfssllibpath"; then
2494 dnl when shared libs were found in a path that the run-time
2495 dnl linker doesn't search through, we need to add it to
2496 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2498 if test "x$cross_compiling" != "xyes"; then
2499 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$wolfssllibpath"
2500 export CURL_LIBRARY_PATH
2501 AC_MSG_NOTICE([Added $wolfssllibpath to CURL_LIBRARY_PATH])
2507 fi dnl wolfSSL not disabled
2509 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2512 dnl ----------------------------------------------------
2513 dnl check for MesaLink
2514 dnl ----------------------------------------------------
2516 dnl Default to compiler & linker defaults for MesaLink files & libraries.
2521 AC_ARG_WITH(mesalink,dnl
2522 AC_HELP_STRING([--with-mesalink=PATH],[where to look for MesaLink, PATH points to the installation root])
2523 AC_HELP_STRING([--without-mesalink], [disable MesaLink detection]),
2524 OPT_MESALINK=$withval)
2526 if test -z "$ssl_backends" -o "x$OPT_MESALINK" != xno; then
2529 if test X"$OPT_MESALINK" != Xno; then
2531 if test "$OPT_MESALINK" = "yes"; then
2535 if test -z "$OPT_MESALINK" ; then
2536 dnl check for lib first without setting any new path
2538 AC_CHECK_LIB(mesalink, mesalink_library_init,
2539 dnl libmesalink found, set the variable
2541 AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
2542 AC_SUBST(USE_MESALINK, [1])
2546 test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2555 if test "x$USE_MESALINK" != "xyes"; then
2556 dnl add the path and test again
2557 addld=-L$OPT_MESALINK/lib$libsuff
2558 addcflags=-I$OPT_MESALINK/include
2559 mesalinklib=$OPT_MESALINK/lib$libsuff
2561 LDFLAGS="$LDFLAGS $addld"
2562 if test "$addcflags" != "-I/usr/include"; then
2563 CPPFLAGS="$CPPFLAGS $addcflags"
2566 AC_CHECK_LIB(mesalink, mesalink_library_init,
2568 AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
2569 AC_SUBST(USE_MESALINK, [1])
2573 test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2581 if test "x$USE_MESALINK" = "xyes"; then
2582 AC_MSG_NOTICE([detected MesaLink])
2584 LIBS="-lmesalink $LIBS"
2586 if test -n "$mesalinklib"; then
2587 dnl when shared libs were found in a path that the run-time
2588 dnl linker doesn't search through, we need to add it to
2589 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2591 if test "x$cross_compiling" != "xyes"; then
2592 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mesalinklib"
2593 export LD_LIBRARY_PATH
2594 AC_MSG_NOTICE([Added $mesalinklib to LD_LIBRARY_PATH])
2599 fi dnl MesaLink not disabled
2601 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2604 dnl ----------------------------------------------------
2605 dnl check for BearSSL
2606 dnl ----------------------------------------------------
2612 AC_ARG_WITH(bearssl,dnl
2613 AC_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root])
2614 AC_HELP_STRING([--without-bearssl], [disable BearSSL detection]),
2615 OPT_BEARSSL=$withval)
2617 if test -z "$ssl_backends" -o "x$OPT_BEARSSL" != xno; then
2620 if test X"$OPT_BEARSSL" != Xno; then
2622 if test "$OPT_BEARSSL" = "yes"; then
2626 if test -z "$OPT_BEARSSL" ; then
2627 dnl check for lib first without setting any new path
2629 AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
2630 dnl libbearssl found, set the variable
2632 AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
2633 AC_SUBST(USE_BEARSSL, [1])
2637 test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2646 if test "x$USE_BEARSSL" != "xyes"; then
2647 dnl add the path and test again
2648 addld=-L$OPT_BEARSSL/lib$libsuff
2649 addcflags=-I$OPT_BEARSSL/include
2650 bearssllib=$OPT_BEARSSL/lib$libsuff
2652 LDFLAGS="$LDFLAGS $addld"
2653 if test "$addcflags" != "-I/usr/include"; then
2654 CPPFLAGS="$CPPFLAGS $addcflags"
2657 AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
2659 AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
2660 AC_SUBST(USE_BEARSSL, [1])
2664 test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2672 if test "x$USE_BEARSSL" = "xyes"; then
2673 AC_MSG_NOTICE([detected BearSSL])
2674 check_for_ca_bundle=1
2676 LIBS="-lbearssl $LIBS"
2678 if test -n "$bearssllib"; then
2679 dnl when shared libs were found in a path that the run-time
2680 dnl linker doesn't search through, we need to add it to
2681 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2683 if test "x$cross_compiling" != "xyes"; then
2684 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$bearssllib"
2685 export CURL_LIBRARY_PATH
2686 AC_MSG_NOTICE([Added $bearssllib to CURL_LIBRARY_PATH])
2691 fi dnl BearSSL not disabled
2693 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2696 dnl ----------------------------------------------------
2697 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
2698 dnl ----------------------------------------------------
2700 dnl Default to compiler & linker defaults for NSS files & libraries.
2704 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
2705 AC_HELP_STRING([--without-nss], [disable NSS detection]),
2708 if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then
2711 if test X"$OPT_NSS" != Xno; then
2719 if test "x$OPT_NSS" = "xyes"; then
2721 CURL_CHECK_PKGCONFIG(nss)
2723 if test "$PKGCONFIG" != "no" ; then
2724 addlib=`$PKGCONFIG --libs nss`
2725 addcflags=`$PKGCONFIG --cflags nss`
2726 version=`$PKGCONFIG --modversion nss`
2727 nssprefix=`$PKGCONFIG --variable=prefix nss`
2729 dnl Without pkg-config, we check for nss-config
2731 check=`nss-config --version 2>/dev/null`
2732 if test -n "$check"; then
2733 addlib=`nss-config --libs`
2734 addcflags=`nss-config --cflags`
2735 version=`nss-config --version`
2736 nssprefix=`nss-config --prefix`
2744 NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
2745 if test -f "$NSS_PCDIR/nss.pc"; then
2746 CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
2747 if test "$PKGCONFIG" != "no" ; then
2748 addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
2749 addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
2750 addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
2751 version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
2752 nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
2757 if test -z "$addlib"; then
2758 # Without pkg-config, we'll kludge in some defaults
2759 AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
2760 addld="-L$OPT_NSS/lib"
2761 addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
2762 addcflags="-I$OPT_NSS/include"
2767 CLEANLDFLAGS="$LDFLAGS"
2769 CLEANCPPFLAGS="$CPPFLAGS"
2771 LDFLAGS="$addld $LDFLAGS"
2772 LIBS="$addlib $LIBS"
2773 if test "$addcflags" != "-I/usr/include"; then
2774 CPPFLAGS="$CPPFLAGS $addcflags"
2777 dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
2778 AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
2780 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
2781 AC_SUBST(USE_NSS, [1])
2785 test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2788 LDFLAGS="$CLEANLDFLAGS"
2790 CPPFLAGS="$CLEANCPPFLAGS"
2793 if test "x$USE_NSS" = "xyes"; then
2794 AC_MSG_NOTICE([detected NSS version $version])
2796 dnl PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
2797 dnl PK11_DestroyGenericObject() does not release resources allocated by
2798 dnl PK11_CreateGenericObject() early enough.
2799 AC_CHECK_FUNC(PK11_CreateManagedGenericObject,
2801 AC_DEFINE(HAVE_PK11_CREATEMANAGEDGENERICOBJECT, 1,
2802 [if you have the PK11_CreateManagedGenericObject function])
2805 dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
2807 AC_SUBST([NSS_LIBS])
2809 dnl when shared libs were found in a path that the run-time
2810 dnl linker doesn't search through, we need to add it to
2811 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2813 if test "x$cross_compiling" != "xyes"; then
2814 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$nssprefix/lib$libsuff"
2815 export CURL_LIBRARY_PATH
2816 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to CURL_LIBRARY_PATH])
2821 fi dnl NSS not disabled
2823 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2826 case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$MESALINK_ENABLED$BEARSSL_ENABLED$AMISSL_ENABLED" in
2828 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
2829 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.])
2832 # one SSL backend is enabled
2833 AC_SUBST(SSL_ENABLED)
2835 AC_MSG_NOTICE([built with one SSL backend])
2838 # more than one SSL backend is enabled
2839 AC_SUBST(SSL_ENABLED)
2841 AC_SUBST(CURL_WITH_MULTI_SSL)
2842 CURL_WITH_MULTI_SSL="1"
2843 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
2844 AC_MSG_NOTICE([built with multiple SSL backends])
2848 if test -n "$ssl_backends"; then
2849 curl_ssl_msg="enabled ($ssl_backends)"
2852 if test no = "$VALID_DEFAULT_SSL_BACKEND"
2854 if test -n "$SSL_ENABLED"
2856 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
2858 AC_MSG_ERROR([Default SSL backend requires SSL!])
2860 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
2862 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
2865 dnl **********************************************************************
2866 dnl Check for the CA bundle
2867 dnl **********************************************************************
2869 if test -n "$check_for_ca_bundle"; then
2870 CURL_CHECK_CA_BUNDLE
2873 dnl **********************************************************************
2874 dnl Check for libpsl
2875 dnl **********************************************************************
2878 AS_HELP_STRING([--without-libpsl],
2879 [disable support for libpsl cookie checking]),
2880 with_libpsl=$withval,
2882 if test $with_libpsl != "no"; then
2883 AC_SEARCH_LIBS(psl_builtin, psl,
2884 [curl_psl_msg="enabled";
2885 AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
2887 [curl_psl_msg="no (libpsl not found)";
2888 AC_MSG_WARN([libpsl was not found])
2892 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
2894 dnl **********************************************************************
2895 dnl Check for libmetalink
2896 dnl **********************************************************************
2900 AC_ARG_WITH(libmetalink,dnl
2901 AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
2902 AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
2903 OPT_LIBMETALINK=$withval)
2905 if test X"$OPT_LIBMETALINK" != Xno; then
2914 if test "x$OPT_LIBMETALINK" = "xyes"; then
2915 dnl this is with no partiular path given
2917 CURL_CHECK_PKGCONFIG(libmetalink)
2919 dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
2920 LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
2921 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
2922 if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
2925 if test "$PKGTEST" = "yes"; then
2926 CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
2929 if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
2930 addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2931 $PKGCONFIG --libs-only-l libmetalink`
2932 addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2933 $PKGCONFIG --libs-only-L libmetalink`
2934 addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2935 $PKGCONFIG --cflags-only-I libmetalink`
2936 version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2937 $PKGCONFIG --modversion libmetalink`
2938 libmetalinklib=`echo $addld | $SED -e 's/^-L//'`
2940 if test -n "$addlib"; then
2942 clean_CPPFLAGS="$CPPFLAGS"
2943 clean_LDFLAGS="$LDFLAGS"
2945 CPPFLAGS="$clean_CPPFLAGS $addcflags"
2946 LDFLAGS="$clean_LDFLAGS $addld"
2947 LIBS="$addlib $clean_LIBS"
2948 AC_MSG_CHECKING([if libmetalink is recent enough])
2951 # include <metalink/metalink.h>
2953 if(0 != metalink_strerror(0)) /* added in 0.1.0 */
2957 AC_MSG_RESULT([yes ($version)])
2960 AC_MSG_RESULT([no ($version)])
2961 AC_MSG_NOTICE([libmetalink library defective or too old])
2964 if test "x$OPENSSL_ENABLED" != "x1" -a "x$USE_WINDOWS_SSPI" != "x1" \
2965 -a "x$GNUTLS_ENABLED" != "x1" -a "x$NSS_ENABLED" != "x1" \
2966 -a "x$SECURETRANSPORT_ENABLED" != "x1"; then
2967 AC_MSG_WARN([metalink support requires a compatible SSL/TLS backend])
2970 CPPFLAGS="$clean_CPPFLAGS"
2971 LDFLAGS="$clean_LDFLAGS"
2973 if test "$want_metalink" = "yes"; then
2974 dnl finally libmetalink will be used
2975 AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
2976 LIBMETALINK_LIBS=$addlib
2977 LIBMETALINK_LDFLAGS=$addld
2978 LIBMETALINK_CPPFLAGS=$addcflags
2979 AC_SUBST([LIBMETALINK_LIBS])
2980 AC_SUBST([LIBMETALINK_LDFLAGS])
2981 AC_SUBST([LIBMETALINK_CPPFLAGS])
2982 curl_mtlnk_msg="enabled"
2988 dnl **********************************************************************
2989 dnl Check for the presence of LIBSSH2 libraries and headers
2990 dnl **********************************************************************
2992 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
2994 AC_ARG_WITH(libssh2,dnl
2995 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])
2996 AC_HELP_STRING([--with-libssh2], [enable libssh2]),
2997 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
3001 AC_ARG_WITH(libssh,dnl
3002 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])
3003 AC_HELP_STRING([--with-libssh], [enable libssh]),
3004 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
3007 AC_ARG_WITH(wolfssh,dnl
3008 AC_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
3009 AC_HELP_STRING([--with-wolfssh], [enable wolfssh]),
3010 OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
3012 if test X"$OPT_LIBSSH2" != Xno; then
3013 dnl backup the pre-libssh2 variables
3014 CLEANLDFLAGS="$LDFLAGS"
3015 CLEANCPPFLAGS="$CPPFLAGS"
3018 case "$OPT_LIBSSH2" in
3020 dnl --with-libssh2 (without path) used
3021 CURL_CHECK_PKGCONFIG(libssh2)
3023 if test "$PKGCONFIG" != "no" ; then
3024 LIB_SSH2=`$PKGCONFIG --libs libssh2`
3025 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
3026 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
3027 version=`$PKGCONFIG --modversion libssh2`
3028 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
3033 dnl no --with-libssh2 option given, just check default places
3036 dnl use the given --with-libssh2 spot
3037 PREFIX_SSH2=$OPT_LIBSSH2
3041 dnl if given with a prefix, we set -L and -I based on that
3042 if test -n "$PREFIX_SSH2"; then
3044 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
3045 CPP_SSH2=-I${PREFIX_SSH2}/include
3046 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
3049 LDFLAGS="$LDFLAGS $LD_SSH2"
3050 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
3051 LIBS="$LIB_SSH2 $LIBS"
3053 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
3055 AC_CHECK_HEADERS(libssh2.h,
3056 curl_ssh_msg="enabled (libSSH2)"
3058 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
3059 AC_SUBST(USE_LIBSSH2, [1])
3062 if test X"$OPT_LIBSSH2" != Xoff &&
3063 test "$LIBSSH2_ENABLED" != "1"; then
3064 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
3067 if test "$LIBSSH2_ENABLED" = "1"; then
3068 if test -n "$DIR_SSH2"; then
3069 dnl when the libssh2 shared libs were found in a path that the run-time
3070 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
3071 dnl to prevent further configure tests to fail due to this
3073 if test "x$cross_compiling" != "xyes"; then
3074 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
3075 export CURL_LIBRARY_PATH
3076 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
3080 dnl no libssh2, revert back to clean variables
3081 LDFLAGS=$CLEANLDFLAGS
3082 CPPFLAGS=$CLEANCPPFLAGS
3085 elif test X"$OPT_LIBSSH" != Xno; then
3086 dnl backup the pre-libssh variables
3087 CLEANLDFLAGS="$LDFLAGS"
3088 CLEANCPPFLAGS="$CPPFLAGS"
3091 case "$OPT_LIBSSH" in
3093 dnl --with-libssh (without path) used
3094 CURL_CHECK_PKGCONFIG(libssh)
3096 if test "$PKGCONFIG" != "no" ; then
3097 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
3098 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
3099 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
3100 version=`$PKGCONFIG --modversion libssh`
3101 DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
3106 dnl no --with-libssh option given, just check default places
3109 dnl use the given --with-libssh spot
3110 PREFIX_SSH=$OPT_LIBSSH
3114 dnl if given with a prefix, we set -L and -I based on that
3115 if test -n "$PREFIX_SSH"; then
3117 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
3118 CPP_SSH=-I${PREFIX_SSH}/include
3119 DIR_SSH=${PREFIX_SSH}/lib$libsuff
3122 LDFLAGS="$LDFLAGS $LD_SSH"
3123 CPPFLAGS="$CPPFLAGS $CPP_SSH"
3124 LIBS="$LIB_SSH $LIBS"
3126 AC_CHECK_LIB(ssh, ssh_new)
3128 AC_CHECK_HEADERS(libssh/libssh.h,
3129 curl_ssh_msg="enabled (libSSH)"
3131 AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
3132 AC_SUBST(USE_LIBSSH, [1])
3135 if test X"$OPT_LIBSSH" != Xoff &&
3136 test "$LIBSSH_ENABLED" != "1"; then
3137 AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
3140 if test "$LIBSSH_ENABLED" = "1"; then
3141 if test -n "$DIR_SSH"; then
3142 dnl when the libssh shared libs were found in a path that the run-time
3143 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
3144 dnl to prevent further configure tests to fail due to this
3146 if test "x$cross_compiling" != "xyes"; then
3147 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
3148 export CURL_LIBRARY_PATH
3149 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
3153 dnl no libssh, revert back to clean variables
3154 LDFLAGS=$CLEANLDFLAGS
3155 CPPFLAGS=$CLEANCPPFLAGS
3158 elif test X"$OPT_WOLFSSH" != Xno; then
3159 dnl backup the pre-wolfssh variables
3160 CLEANLDFLAGS="$LDFLAGS"
3161 CLEANCPPFLAGS="$CPPFLAGS"
3165 if test "$OPT_WOLFSSH" != yes; then
3166 WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
3167 LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
3168 CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
3171 AC_CHECK_LIB(wolfssh, wolfSSH_Init)
3173 AC_CHECK_HEADERS(wolfssh/ssh.h,
3174 curl_ssh_msg="enabled (wolfSSH)"
3176 AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
3177 AC_SUBST(USE_WOLFSSH, [1])
3182 dnl **********************************************************************
3183 dnl Check for the presence of LIBRTMP libraries and headers
3184 dnl **********************************************************************
3186 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
3188 AC_ARG_WITH(librtmp,dnl
3189 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])
3190 AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
3191 OPT_LIBRTMP=$withval)
3193 if test X"$OPT_LIBRTMP" != Xno; then
3194 dnl backup the pre-librtmp variables
3195 CLEANLDFLAGS="$LDFLAGS"
3196 CLEANCPPFLAGS="$CPPFLAGS"
3199 case "$OPT_LIBRTMP" in
3201 dnl --with-librtmp (without path) used
3202 CURL_CHECK_PKGCONFIG(librtmp)
3204 if test "$PKGCONFIG" != "no" ; then
3205 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
3206 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
3207 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
3208 version=`$PKGCONFIG --modversion librtmp`
3209 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
3211 dnl To avoid link errors, we do not allow --librtmp without
3212 dnl a pkgconfig file
3213 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
3218 dnl no --with-librtmp option given, just check default places
3222 dnl use the given --with-librtmp spot
3224 PREFIX_RTMP=$OPT_LIBRTMP
3228 dnl if given with a prefix, we set -L and -I based on that
3229 if test -n "$PREFIX_RTMP"; then
3230 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
3231 CPP_RTMP=-I${PREFIX_RTMP}/include
3232 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
3235 LDFLAGS="$LDFLAGS $LD_RTMP"
3236 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
3237 LIBS="$LIB_RTMP $LIBS"
3239 AC_CHECK_LIB(rtmp, RTMP_Init,
3241 AC_CHECK_HEADERS(librtmp/rtmp.h,
3242 curl_rtmp_msg="enabled (librtmp)"
3244 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
3245 AC_SUBST(USE_LIBRTMP, [1])
3248 dnl not found, revert back to clean variables
3249 LDFLAGS=$CLEANLDFLAGS
3250 CPPFLAGS=$CLEANCPPFLAGS
3254 if test X"$OPT_LIBRTMP" != Xoff &&
3255 test "$LIBRTMP_ENABLED" != "1"; then
3256 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
3261 dnl **********************************************************************
3262 dnl Check for linker switch for versioned symbols
3263 dnl **********************************************************************
3265 versioned_symbols_flavour=
3266 AC_MSG_CHECKING([whether versioned symbols are wanted])
3267 AC_ARG_ENABLE(versioned-symbols,
3268 AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
3269 AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
3270 [ case "$enableval" in
3271 yes) AC_MSG_RESULT(yes)
3272 AC_MSG_CHECKING([if libraries can be versioned])
3273 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
3274 if test -z "$GLD"; then
3276 AC_MSG_WARN([You need an ld version supporting the --version-script option])
3279 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
3280 versioned_symbols_flavour="MULTISSL_"
3281 elif test "x$OPENSSL_ENABLED" = "x1"; then
3282 versioned_symbols_flavour="OPENSSL_"
3283 elif test "x$GNUTLS_ENABLED" = "x1"; then
3284 versioned_symbols_flavour="GNUTLS_"
3285 elif test "x$NSS_ENABLED" = "x1"; then
3286 versioned_symbols_flavour="NSS_"
3287 elif test "x$WOLFSSL_ENABLED" = "x1"; then
3288 versioned_symbols_flavour="WOLFSSL_"
3289 elif test "x$SCHANNEL_ENABLED" = "x1"; then
3290 versioned_symbols_flavour="SCHANNEL_"
3291 elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
3292 versioned_symbols_flavour="SECURE_TRANSPORT_"
3294 versioned_symbols_flavour=""
3296 versioned_symbols="yes"
3300 *) AC_MSG_RESULT(no)
3308 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
3309 ["$versioned_symbols_flavour"])
3310 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
3311 [test "x$versioned_symbols" = 'xyes'])
3313 dnl -------------------------------------------------
3314 dnl check winidn option before other IDN libraries
3315 dnl -------------------------------------------------
3317 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
3318 OPT_WINIDN="default"
3320 AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
3321 AC_HELP_STRING([--without-winidn], [disable Windows native IDN]),
3322 OPT_WINIDN=$withval)
3323 case "$OPT_WINIDN" in
3325 dnl --without-winidn option used or configure option not specified
3330 dnl --with-winidn option used without path
3332 want_winidn_path="default"
3333 AC_MSG_RESULT([yes])
3336 dnl --with-winidn option used with path
3338 want_winidn_path="$withval"
3339 AC_MSG_RESULT([yes ($withval)])
3343 if test "$want_winidn" = "yes"; then
3344 dnl winidn library support has been requested
3345 clean_CPPFLAGS="$CPPFLAGS"
3346 clean_LDFLAGS="$LDFLAGS"
3348 WINIDN_LIBS="-lnormaliz"
3349 WINIDN_CPPFLAGS="-DWINVER=0x0600"
3351 if test "$want_winidn_path" != "default"; then
3352 dnl path has been specified
3353 dnl pkg-config not available or provides no info
3354 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
3355 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
3356 WINIDN_DIR="$want_winidn_path/lib$libsuff"
3359 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
3360 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
3361 LIBS="$WINIDN_LIBS $LIBS"
3363 AC_MSG_CHECKING([if IdnToUnicode can be linked])
3366 #include <windows.h>
3368 IdnToUnicode(0, NULL, 0, NULL, 0);
3371 AC_MSG_RESULT([yes])
3372 tst_links_winidn="yes"
3375 tst_links_winidn="no"
3378 if test "$tst_links_winidn" = "yes"; then
3379 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
3380 AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
3381 AC_SUBST([IDN_ENABLED], [1])
3382 curl_idn_msg="enabled (Windows-native)"
3384 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3385 CPPFLAGS="$clean_CPPFLAGS"
3386 LDFLAGS="$clean_LDFLAGS"
3391 dnl **********************************************************************
3392 dnl Check for the presence of IDN libraries and headers
3393 dnl **********************************************************************
3395 AC_MSG_CHECKING([whether to build with libidn2])
3397 AC_ARG_WITH(libidn2,
3398 AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
3399 AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
3403 dnl --without-libidn2 option used
3408 dnl configure option not specified
3410 want_idn_path="default"
3411 AC_MSG_RESULT([(assumed) yes])
3414 dnl --with-libidn2 option used without path
3416 want_idn_path="default"
3417 AC_MSG_RESULT([yes])
3420 dnl --with-libidn2 option used with path
3422 want_idn_path="$withval"
3423 AC_MSG_RESULT([yes ($withval)])
3427 if test "$want_idn" = "yes"; then
3428 dnl idn library support has been requested
3429 clean_CPPFLAGS="$CPPFLAGS"
3430 clean_LDFLAGS="$LDFLAGS"
3434 if test "$want_idn_path" != "default"; then
3435 dnl path has been specified
3436 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3437 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
3438 if test "$PKGCONFIG" != "no"; then
3439 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3440 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3441 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3442 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3443 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3444 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3445 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
3447 dnl pkg-config not available or provides no info
3449 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3450 IDN_CPPFLAGS="-I$want_idn_path/include"
3451 IDN_DIR="$want_idn_path/lib$libsuff"
3454 dnl path not specified
3455 CURL_CHECK_PKGCONFIG(libidn2)
3456 if test "$PKGCONFIG" != "no"; then
3457 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3458 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3459 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3460 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
3462 dnl pkg-config not available or provides no info
3467 if test "$PKGCONFIG" != "no"; then
3468 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3469 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3470 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3471 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3473 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3474 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3475 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3476 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3479 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
3480 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
3481 LIBS="$IDN_LIBS $LIBS"
3483 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
3485 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
3487 AC_MSG_RESULT([yes])
3488 tst_links_libidn="yes"
3491 tst_links_libidn="no"
3494 AC_CHECK_HEADERS( idn2.h )
3496 if test "$tst_links_libidn" = "yes"; then
3497 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
3498 dnl different versions of libidn have different setups of these:
3500 AC_SUBST([IDN_ENABLED], [1])
3501 curl_idn_msg="enabled (libidn2)"
3502 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3503 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
3504 export CURL_LIBRARY_PATH
3505 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
3508 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3509 CPPFLAGS="$clean_CPPFLAGS"
3510 LDFLAGS="$clean_LDFLAGS"
3516 dnl Let's hope this split URL remains working:
3517 dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
3518 dnl genprogc/thread_quick_ref.htm
3521 dnl **********************************************************************
3522 dnl Check for nghttp2
3523 dnl **********************************************************************
3527 if test "x$disable_http" = "xyes"; then
3528 # without HTTP, nghttp2 is no use
3532 AC_ARG_WITH(nghttp2,
3533 AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
3534 AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
3538 dnl --without-nghttp2 option used
3542 dnl --with-nghttp2 option used without path
3547 dnl --with-nghttp2 option used with path
3549 want_h2_path="$withval/lib/pkgconfig"
3553 curl_h2_msg="no (--with-nghttp2)"
3554 if test X"$want_h2" != Xno; then
3555 dnl backup the pre-nghttp2 variables
3556 CLEANLDFLAGS="$LDFLAGS"
3557 CLEANCPPFLAGS="$CPPFLAGS"
3560 CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path)
3562 if test "$PKGCONFIG" != "no" ; then
3563 LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3564 $PKGCONFIG --libs-only-l libnghttp2`
3565 AC_MSG_NOTICE([-l is $LIB_H2])
3567 CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl
3568 $PKGCONFIG --cflags-only-I libnghttp2`
3569 AC_MSG_NOTICE([-I is $CPP_H2])
3571 LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3572 $PKGCONFIG --libs-only-L libnghttp2`
3573 AC_MSG_NOTICE([-L is $LD_H2])
3575 LDFLAGS="$LDFLAGS $LD_H2"
3576 CPPFLAGS="$CPPFLAGS $CPP_H2"
3577 LIBS="$LIB_H2 $LIBS"
3579 # use nghttp2_session_set_local_window_size to require nghttp2
3581 AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
3583 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
3584 curl_h2_msg="enabled (nghttp2)"
3586 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
3587 AC_SUBST(USE_NGHTTP2, [1])
3590 dnl not found, revert back to clean variables
3591 LDFLAGS=$CLEANLDFLAGS
3592 CPPFLAGS=$CLEANCPPFLAGS
3597 dnl no nghttp2 pkg-config found, deal with it
3598 if test X"$want_h2" != Xdefault; then
3599 dnl To avoid link errors, we do not allow --with-nghttp2 without
3600 dnl a pkgconfig file
3601 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
3607 dnl **********************************************************************
3608 dnl Check for ngtcp2 (QUIC)
3609 dnl **********************************************************************
3612 curl_h3_msg="no (--with-ngtcp2, --with-quiche)"
3614 if test "x$disable_http" = "xyes"; then
3615 # without HTTP, ngtcp2 is no use
3620 AC_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
3621 AC_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
3622 [OPT_TCP2=$withval])
3625 dnl --without-ngtcp2 option used
3629 dnl --with-ngtcp2 option used without path
3634 dnl --with-ngtcp2 option used with path
3636 want_tcp2_path="$withval/lib/pkgconfig"
3640 curl_tcp2_msg="no (--with-ngtcp2)"
3641 if test X"$want_tcp2" != Xno; then
3642 dnl backup the pre-ngtcp2 variables
3643 CLEANLDFLAGS="$LDFLAGS"
3644 CLEANCPPFLAGS="$CPPFLAGS"
3647 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
3649 if test "$PKGCONFIG" != "no" ; then
3650 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3651 $PKGCONFIG --libs-only-l libngtcp2`
3652 AC_MSG_NOTICE([-l is $LIB_TCP2])
3654 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3655 $PKGCONFIG --cflags-only-I libngtcp2`
3656 AC_MSG_NOTICE([-I is $CPP_TCP2])
3658 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3659 $PKGCONFIG --libs-only-L libngtcp2`
3660 AC_MSG_NOTICE([-L is $LD_TCP2])
3662 LDFLAGS="$LDFLAGS $LD_TCP2"
3663 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
3664 LIBS="$LIB_TCP2 $LIBS"
3666 if test "x$cross_compiling" != "xyes"; then
3667 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
3669 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new,
3671 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
3673 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
3674 AC_SUBST(USE_NGTCP2, [1])
3675 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
3676 export CURL_LIBRARY_PATH
3677 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
3680 dnl not found, revert back to clean variables
3681 LDFLAGS=$CLEANLDFLAGS
3682 CPPFLAGS=$CLEANCPPFLAGS
3687 dnl no ngtcp2 pkg-config found, deal with it
3688 if test X"$want_tcp2" != Xdefault; then
3689 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3690 dnl a pkgconfig file
3691 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
3697 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
3698 dnl backup the pre-ngtcp2_crypto_openssl variables
3699 CLEANLDFLAGS="$LDFLAGS"
3700 CLEANCPPFLAGS="$CPPFLAGS"
3703 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
3705 if test "$PKGCONFIG" != "no" ; then
3706 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3707 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
3708 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
3710 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3711 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
3712 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
3714 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3715 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
3716 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
3718 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
3719 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
3720 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
3722 if test "x$cross_compiling" != "xyes"; then
3723 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
3725 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
3727 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3729 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
3730 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
3731 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
3732 export CURL_LIBRARY_PATH
3733 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
3736 dnl not found, revert back to clean variables
3737 LDFLAGS=$CLEANLDFLAGS
3738 CPPFLAGS=$CLEANCPPFLAGS
3743 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
3744 if test X"$want_tcp2" != Xdefault; then
3745 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3746 dnl a pkgconfig file
3747 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
3752 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
3753 dnl backup the pre-ngtcp2_crypto_gnutls variables
3754 CLEANLDFLAGS="$LDFLAGS"
3755 CLEANCPPFLAGS="$CPPFLAGS"
3758 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
3760 if test "$PKGCONFIG" != "no" ; then
3761 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3762 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
3763 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
3765 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3766 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
3767 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
3769 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3770 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
3771 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
3773 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
3774 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
3775 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
3777 if test "x$cross_compiling" != "xyes"; then
3778 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
3780 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_ctx_initial,
3782 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3784 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
3785 AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
3786 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
3787 export CURL_LIBRARY_PATH
3788 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
3791 dnl not found, revert back to clean variables
3792 LDFLAGS=$CLEANLDFLAGS
3793 CPPFLAGS=$CLEANCPPFLAGS
3798 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
3799 if test X"$want_tcp2" != Xdefault; then
3800 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3801 dnl a pkgconfig file
3802 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
3807 dnl **********************************************************************
3808 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
3809 dnl **********************************************************************
3813 if test "x$NGTCP2_ENABLED" = "x"; then
3814 # without ngtcp2, nghttp3 is of no use for us
3818 AC_ARG_WITH(nghttp3,
3819 AC_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
3820 AC_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
3821 [OPT_NGHTTP3=$withval])
3822 case "$OPT_NGHTTP3" in
3824 dnl --without-nghttp3 option used
3828 dnl --with-nghttp3 option used without path
3829 want_nghttp3="default"
3830 want_nghttp3_path=""
3833 dnl --with-nghttp3 option used with path
3835 want_nghttp3_path="$withval/lib/pkgconfig"
3839 curl_http3_msg="no (--with-nghttp3)"
3840 if test X"$want_nghttp3" != Xno; then
3841 dnl backup the pre-nghttp3 variables
3842 CLEANLDFLAGS="$LDFLAGS"
3843 CLEANCPPFLAGS="$CPPFLAGS"
3846 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3848 if test "$PKGCONFIG" != "no" ; then
3849 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3850 $PKGCONFIG --libs-only-l libnghttp3`
3851 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3853 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
3854 $PKGCONFIG --cflags-only-I libnghttp3`
3855 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3857 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3858 $PKGCONFIG --libs-only-L libnghttp3`
3859 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3861 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3862 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3863 LIBS="$LIB_NGHTTP3 $LIBS"
3865 if test "x$cross_compiling" != "xyes"; then
3866 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
3868 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new,
3870 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3871 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3873 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3874 AC_SUBST(USE_NGHTTP3, [1])
3875 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3876 export CURL_LIBRARY_PATH
3877 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3878 experimental="$experimental HTTP3"
3881 dnl not found, revert back to clean variables
3882 LDFLAGS=$CLEANLDFLAGS
3883 CPPFLAGS=$CLEANCPPFLAGS
3888 dnl no nghttp3 pkg-config found, deal with it
3889 if test X"$want_nghttp3" != Xdefault; then
3890 dnl To avoid link errors, we do not allow --with-nghttp3 without
3891 dnl a pkgconfig file
3892 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3898 dnl **********************************************************************
3899 dnl Check for quiche (QUIC)
3900 dnl **********************************************************************
3904 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3905 # without HTTP or with ngtcp2, quiche is no use
3910 AC_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
3911 AC_HELP_STRING([--without-quiche],[Disable quiche usage]),
3912 [OPT_QUICHE=$withval])
3913 case "$OPT_QUICHE" in
3915 dnl --without-quiche option used
3919 dnl --with-quiche option used without path
3920 want_quiche="default"
3924 dnl --with-quiche option used with path
3926 want_quiche_path="$withval"
3930 if test X"$want_quiche" != Xno; then
3931 dnl backup the pre-quiche variables
3932 CLEANLDFLAGS="$LDFLAGS"
3933 CLEANCPPFLAGS="$CPPFLAGS"
3936 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3938 if test "$PKGCONFIG" != "no" ; then
3939 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3940 $PKGCONFIG --libs-only-l quiche`
3941 AC_MSG_NOTICE([-l is $LIB_QUICHE])
3943 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
3944 $PKGCONFIG --cflags-only-I quiche`
3945 AC_MSG_NOTICE([-I is $CPP_QUICHE])
3947 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3948 $PKGCONFIG --libs-only-L quiche`
3949 AC_MSG_NOTICE([-L is $LD_QUICHE])
3951 LDFLAGS="$LDFLAGS $LD_QUICHE"
3952 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3953 LIBS="$LIB_QUICHE $LIBS"
3955 if test "x$cross_compiling" != "xyes"; then
3956 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
3958 AC_CHECK_LIB(quiche, quiche_connect,
3960 AC_CHECK_HEADERS(quiche.h,
3961 experimental="$experimental HTTP3"
3962 AC_MSG_NOTICE([HTTP3 support is experimental])
3963 curl_h3_msg="enabled (quiche)"
3965 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3966 AC_SUBST(USE_QUICHE, [1])
3967 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
3968 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3969 export CURL_LIBRARY_PATH
3970 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
3973 dnl not found, revert back to clean variables
3974 LDFLAGS=$CLEANLDFLAGS
3975 CPPFLAGS=$CLEANCPPFLAGS
3979 dnl no quiche pkg-config found, deal with it
3980 if test X"$want_quiche" != Xdefault; then
3981 dnl To avoid link errors, we do not allow --with-quiche without
3982 dnl a pkgconfig file
3983 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3988 dnl **********************************************************************
3989 dnl Check for zsh completion path
3990 dnl **********************************************************************
3992 OPT_ZSH_FPATH=default
3993 AC_ARG_WITH(zsh-functions-dir,
3994 AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3995 AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3996 [OPT_ZSH_FPATH=$withval])
3997 case "$OPT_ZSH_FPATH" in
3999 dnl --without-zsh-functions-dir option used
4002 dnl --with-zsh-functions-dir option used without path
4003 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
4004 AC_SUBST(ZSH_FUNCTIONS_DIR)
4007 dnl --with-zsh-functions-dir option used with path
4008 ZSH_FUNCTIONS_DIR="$withval"
4009 AC_SUBST(ZSH_FUNCTIONS_DIR)
4013 dnl **********************************************************************
4014 dnl Check for fish completion path
4015 dnl **********************************************************************
4017 OPT_FISH_FPATH=default
4018 AC_ARG_WITH(fish-functions-dir,
4019 AC_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
4020 AC_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
4021 [OPT_FISH_FPATH=$withval])
4022 case "$OPT_FISH_FPATH" in
4024 dnl --without-fish-functions-dir option used
4027 dnl --with-fish-functions-dir option used without path
4028 CURL_CHECK_PKGCONFIG(fish)
4029 if test "$PKGCONFIG" != "no" ; then
4030 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
4032 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
4034 AC_SUBST(FISH_FUNCTIONS_DIR)
4037 dnl --with-fish-functions-dir option used with path
4038 FISH_FUNCTIONS_DIR="$withval"
4039 AC_SUBST(FISH_FUNCTIONS_DIR)
4043 dnl **********************************************************************
4044 dnl Back to "normal" configuring
4045 dnl **********************************************************************
4047 dnl Checks for header files.
4050 CURL_CHECK_HEADER_MALLOC
4051 CURL_CHECK_HEADER_MEMORY
4053 dnl Now check for the very most basic headers. Then we can use these
4054 dnl ones as default-headers when checking for the rest!
4098 dnl to do if not found
4102 dnl default includes
4104 #ifdef HAVE_SYS_TYPES_H
4105 #include <sys/types.h>
4107 #ifdef HAVE_SYS_TIME_H
4108 #include <sys/time.h>
4110 #ifdef HAVE_SYS_SELECT_H
4111 #include <sys/select.h>
4112 #elif defined(HAVE_UNISTD_H)
4115 #ifdef HAVE_SYS_SOCKET_H
4116 #include <sys/socket.h>
4118 #ifdef HAVE_NETINET_IN_H
4119 #include <netinet/in.h>
4121 #ifdef HAVE_NETINET_IN6_H
4122 #include <netinet/in6.h>
4124 #ifdef HAVE_SYS_UN_H
4131 dnl Checks for typedefs, structures, and compiler characteristics.
4133 CURL_CHECK_VARIADIC_MACROS
4136 CURL_CHECK_STRUCT_TIMEVAL
4137 CURL_VERIFY_RUNTIMELIBS
4139 AX_COMPILE_CHECK_SIZEOF(size_t)
4140 AX_COMPILE_CHECK_SIZEOF(long)
4141 AX_COMPILE_CHECK_SIZEOF(int)
4142 AX_COMPILE_CHECK_SIZEOF(short)
4143 AX_COMPILE_CHECK_SIZEOF(time_t)
4144 AX_COMPILE_CHECK_SIZEOF(off_t)
4147 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
4148 AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
4149 #include <curl/system.h>
4153 AC_CHECK_TYPE(long long,
4154 [AC_DEFINE(HAVE_LONGLONG, 1,
4155 [Define to 1 if the compiler supports the 'long long' data type.])]
4159 if test "xyes" = "x$longlong"; then
4160 AC_MSG_CHECKING([if numberLL works])
4164 long long val = 1000LL;
4167 AC_MSG_RESULT([yes])
4168 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
4176 AC_CHECK_TYPE(ssize_t, ,
4177 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
4179 # check for bool type
4180 AC_CHECK_TYPE([bool],[
4181 AC_DEFINE(HAVE_BOOL_T, 1,
4182 [Define to 1 if bool is an available type.])
4184 #ifdef HAVE_SYS_TYPES_H
4185 #include <sys/types.h>
4187 #ifdef HAVE_STDBOOL_H
4188 #include <stdbool.h>
4192 # check for sa_family_t
4193 AC_CHECK_TYPE(sa_family_t,
4194 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
4197 AC_CHECK_TYPE(ADDRESS_FAMILY,
4198 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
4199 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
4201 #ifdef HAVE_SYS_SOCKET_H
4202 #include <sys/socket.h>
4207 #ifdef HAVE_SYS_SOCKET_H
4208 #include <sys/socket.h>
4212 # check for suseconds_t
4213 AC_CHECK_TYPE([suseconds_t],[
4214 AC_DEFINE(HAVE_SUSECONDS_T, 1,
4215 [Define to 1 if suseconds_t is an available type.])
4217 #ifdef HAVE_SYS_TYPES_H
4218 #include <sys/types.h>
4220 #ifdef HAVE_SYS_TIME_H
4221 #include <sys/time.h>
4225 AC_MSG_CHECKING([if time_t is unsigned])
4233 AC_MSG_RESULT([yes])
4234 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
4238 dnl cross-compiling, most systems are unsigned
4242 CURL_CONFIGURE_PULL_SYS_POLL
4246 TYPE_SOCKADDR_STORAGE
4252 CURL_CHECK_FUNC_SELECT
4254 CURL_CHECK_FUNC_RECV
4255 CURL_CHECK_FUNC_SEND
4256 CURL_CHECK_MSG_NOSIGNAL
4258 CURL_CHECK_FUNC_ALARM
4259 CURL_CHECK_FUNC_BASENAME
4260 CURL_CHECK_FUNC_CLOSESOCKET
4261 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
4262 CURL_CHECK_FUNC_CONNECT
4263 CURL_CHECK_FUNC_FCNTL
4264 CURL_CHECK_FUNC_FREEADDRINFO
4265 CURL_CHECK_FUNC_FREEIFADDRS
4266 CURL_CHECK_FUNC_FSETXATTR
4267 CURL_CHECK_FUNC_FTRUNCATE
4268 CURL_CHECK_FUNC_GETADDRINFO
4269 CURL_CHECK_FUNC_GAI_STRERROR
4270 CURL_CHECK_FUNC_GETHOSTBYADDR
4271 CURL_CHECK_FUNC_GETHOSTBYADDR_R
4272 CURL_CHECK_FUNC_GETHOSTBYNAME
4273 CURL_CHECK_FUNC_GETHOSTBYNAME_R
4274 CURL_CHECK_FUNC_GETHOSTNAME
4275 CURL_CHECK_FUNC_GETPEERNAME
4276 CURL_CHECK_FUNC_GETSOCKNAME
4277 CURL_CHECK_FUNC_IF_NAMETOINDEX
4278 CURL_CHECK_FUNC_GETIFADDRS
4279 CURL_CHECK_FUNC_GETSERVBYPORT_R
4280 CURL_CHECK_FUNC_GMTIME_R
4281 CURL_CHECK_FUNC_INET_NTOA_R
4282 CURL_CHECK_FUNC_INET_NTOP
4283 CURL_CHECK_FUNC_INET_PTON
4284 CURL_CHECK_FUNC_IOCTL
4285 CURL_CHECK_FUNC_IOCTLSOCKET
4286 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
4287 CURL_CHECK_FUNC_LOCALTIME_R
4288 CURL_CHECK_FUNC_MEMRCHR
4289 CURL_CHECK_FUNC_POLL
4290 CURL_CHECK_FUNC_SETSOCKOPT
4291 CURL_CHECK_FUNC_SIGACTION
4292 CURL_CHECK_FUNC_SIGINTERRUPT
4293 CURL_CHECK_FUNC_SIGNAL
4294 CURL_CHECK_FUNC_SIGSETJMP
4295 CURL_CHECK_FUNC_SOCKET
4296 CURL_CHECK_FUNC_SOCKETPAIR
4297 CURL_CHECK_FUNC_STRCASECMP
4298 CURL_CHECK_FUNC_STRCMPI
4299 CURL_CHECK_FUNC_STRDUP
4300 CURL_CHECK_FUNC_STRERROR_R
4301 CURL_CHECK_FUNC_STRICMP
4302 CURL_CHECK_FUNC_STRNCASECMP
4303 CURL_CHECK_FUNC_STRNCMPI
4304 CURL_CHECK_FUNC_STRNICMP
4305 CURL_CHECK_FUNC_STRSTR
4306 CURL_CHECK_FUNC_STRTOK_R
4307 CURL_CHECK_FUNC_STRTOLL
4308 CURL_CHECK_FUNC_WRITEV
4314 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
4318 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
4320 #include <sys/types.h>]])
4323 AC_CHECK_FUNCS([fnmatch \
4332 mach_absolute_time \
4343 eval skipcheck=\$skipcheck_$func
4344 if test "x$skipcheck" != "xyes"; then
4345 AC_MSG_CHECKING([deeper for $func])
4352 AC_MSG_RESULT([yes])
4353 eval "ac_cv_func_$func=yes"
4354 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
4355 [Define to 1 if you have the $func function.])
4357 AC_MSG_RESULT([but still no])
4362 CURL_CHECK_NONBLOCKING_SOCKET
4364 dnl ************************************************************
4365 dnl nroff tool stuff
4368 AC_PATH_PROG( PERL, perl, ,
4369 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
4372 AC_PATH_PROGS( NROFF, gnroff nroff, ,
4373 $PATH:/usr/bin/:/usr/local/bin )
4376 if test -n "$NROFF"; then
4377 dnl only check for nroff options if an nroff command was found
4379 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
4381 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
4382 if test -z "$mancheck"; then
4384 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
4385 if test -z "$mancheck"; then
4387 AC_MSG_RESULT([failed])
4388 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
4390 AC_MSG_RESULT([$MANOPT])
4393 AC_MSG_RESULT([$MANOPT])
4398 if test -z "$MANOPT"
4400 dnl if no nroff tool was found, or no option that could convert man pages
4401 dnl was found, then disable the built-in manual stuff
4402 AC_MSG_WARN([disabling built-in manual])
4406 dnl *************************************************************************
4407 dnl If the manual variable still is set, then we go with providing a built-in
4410 if test "$USE_MANUAL" = "1"; then
4411 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
4412 curl_manual_msg="enabled"
4415 dnl set variable for use in automakefile(s)
4416 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
4419 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
4421 if test "x$curl_cv_native_windows" != "xyes" &&
4422 test "x$enable_shared" = "xyes"; then
4423 build_libhostname=yes
4425 build_libhostname=no
4427 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
4429 if test "x$want_ares" != xyes; then
4430 CURL_CHECK_OPTION_THREADED_RESOLVER
4433 dnl ************************************************************
4434 dnl disable POSIX threads
4436 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
4437 AC_ARG_ENABLE(pthreads,
4438 AC_HELP_STRING([--enable-pthreads],
4439 [Enable POSIX threads (default for threaded resolver)])
4440 AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
4441 [ case "$enableval" in
4442 no) AC_MSG_RESULT(no)
4445 *) AC_MSG_RESULT(yes)
4454 dnl turn off pthreads if rt is disabled
4455 if test "$want_pthreads" != "no"; then
4456 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
4457 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
4459 if test "$dontwant_rt" != "no"; then
4460 dnl if --enable-pthreads was explicit then warn it's being ignored
4461 if test "$want_pthreads" = "yes"; then
4462 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
4468 dnl turn off pthreads if no threaded resolver
4469 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
4474 if test "$want_pthreads" != "no"; then
4475 AC_CHECK_HEADER(pthread.h,
4476 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
4477 save_CFLAGS="$CFLAGS"
4478 dnl When statically linking against boringssl, -lpthread is added to LIBS.
4479 dnl Make sure to that this does not pass the check below, we really want
4480 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
4481 dnl lib1541 and lib1565 tests are built with these options. Otherwise
4482 dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
4486 dnl Check for libc variants without a separate pthread lib like bionic
4487 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
4490 dnl on HPUX, life is more complicated...
4493 dnl it doesn't actually work without -lpthread
4494 USE_THREADS_POSIX=""
4500 dnl if it wasn't found without lib, search for it in pthread lib
4501 if test "$USE_THREADS_POSIX" != "1"
4503 CFLAGS="$CFLAGS -pthread"
4504 AC_CHECK_LIB(pthread, pthread_create,
4505 [USE_THREADS_POSIX=1],
4506 [ CFLAGS="$save_CFLAGS"])
4509 if test "x$USE_THREADS_POSIX" = "x1"
4511 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
4512 curl_res_msg="POSIX threaded"
4517 dnl threaded resolver check
4518 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
4519 if test "$want_pthreads" = "yes"; then
4520 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
4522 dnl If native Windows fallback on Win32 threads since no POSIX threads
4523 if test "$curl_cv_native_windows" = "yes"; then
4525 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
4526 curl_res_msg="Win32 threaded"
4528 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
4532 CURL_CONVERT_INCLUDE_TO_ISYSTEM
4534 dnl ************************************************************
4535 dnl disable verbose text strings
4537 AC_MSG_CHECKING([whether to enable verbose strings])
4538 AC_ARG_ENABLE(verbose,
4539 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
4540 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
4541 [ case "$enableval" in
4544 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
4545 curl_verbose_msg="no"
4547 *) AC_MSG_RESULT(yes)
4553 dnl ************************************************************
4554 dnl enable SSPI support
4556 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
4558 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
4559 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
4560 [ case "$enableval" in
4562 if test "$curl_cv_native_windows" = "yes"; then
4564 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
4565 AC_SUBST(USE_WINDOWS_SSPI, [1])
4566 curl_sspi_msg="enabled"
4569 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
4573 if test "x$SCHANNEL_ENABLED" = "x1"; then
4574 # --with-schannel implies --enable-sspi
4581 if test "x$SCHANNEL_ENABLED" = "x1"; then
4582 # --with-schannel implies --enable-sspi
4589 dnl ************************************************************
4590 dnl disable cryptographic authentication
4592 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
4593 AC_ARG_ENABLE(crypto-auth,
4594 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
4595 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
4596 [ case "$enableval" in
4599 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
4600 CURL_DISABLE_CRYPTO_AUTH=1
4602 *) AC_MSG_RESULT(yes)
4608 CURL_CHECK_OPTION_NTLM_WB
4612 dnl ************************************************************
4613 dnl disable TLS-SRP authentication
4615 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
4616 AC_ARG_ENABLE(tls-srp,
4617 AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
4618 AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
4619 [ case "$enableval" in
4624 *) AC_MSG_RESULT(yes)
4632 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
4633 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
4635 curl_tls_srp_msg="enabled"
4638 dnl ************************************************************
4639 dnl disable Unix domain sockets support
4641 AC_MSG_CHECKING([whether to enable Unix domain sockets])
4642 AC_ARG_ENABLE(unix-sockets,
4643 AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
4644 AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
4645 [ case "$enableval" in
4646 no) AC_MSG_RESULT(no)
4647 want_unix_sockets=no
4649 *) AC_MSG_RESULT(yes)
4650 want_unix_sockets=yes
4654 want_unix_sockets=auto
4657 if test "x$want_unix_sockets" != "xno"; then
4658 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
4659 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4660 AC_SUBST(USE_UNIX_SOCKETS, [1])
4661 curl_unix_sockets_msg="enabled"
4663 if test "x$want_unix_sockets" = "xyes"; then
4664 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
4671 dnl ************************************************************
4672 dnl disable cookies support
4674 AC_MSG_CHECKING([whether to support cookies])
4675 AC_ARG_ENABLE(cookies,
4676 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
4677 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
4678 [ case "$enableval" in
4681 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
4683 *) AC_MSG_RESULT(yes)
4689 dnl ************************************************************
4690 dnl disable socketpair
4692 AC_MSG_CHECKING([whether to support socketpair])
4693 AC_ARG_ENABLE(socketpair,
4694 AC_HELP_STRING([--enable-socketpair],[Enable socketpair support])
4695 AC_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
4696 [ case "$enableval" in
4699 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
4701 *) AC_MSG_RESULT(yes)
4707 dnl ************************************************************
4708 dnl disable HTTP authentication support
4710 AC_MSG_CHECKING([whether to support HTTP authentication])
4711 AC_ARG_ENABLE(http-auth,
4712 AC_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
4713 AC_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
4714 [ case "$enableval" in
4717 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
4719 *) AC_MSG_RESULT(yes)
4725 dnl ************************************************************
4726 dnl disable DoH support
4728 AC_MSG_CHECKING([whether to support DoH])
4730 AC_HELP_STRING([--enable-doh],[Enable DoH support])
4731 AC_HELP_STRING([--disable-doh],[Disable DoH support]),
4732 [ case "$enableval" in
4735 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
4737 *) AC_MSG_RESULT(yes)
4743 dnl ************************************************************
4744 dnl disable mime API support
4746 AC_MSG_CHECKING([whether to support the MIME API])
4748 AC_HELP_STRING([--enable-mime],[Enable mime API support])
4749 AC_HELP_STRING([--disable-mime],[Disable mime API support]),
4750 [ case "$enableval" in
4753 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
4755 *) AC_MSG_RESULT(yes)
4761 dnl ************************************************************
4762 dnl disable date parsing
4764 AC_MSG_CHECKING([whether to support date parsing])
4765 AC_ARG_ENABLE(dateparse,
4766 AC_HELP_STRING([--enable-dateparse],[Enable date parsing])
4767 AC_HELP_STRING([--disable-dateparse],[Disable date parsing]),
4768 [ case "$enableval" in
4771 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
4773 *) AC_MSG_RESULT(yes)
4779 dnl ************************************************************
4782 AC_MSG_CHECKING([whether to support netrc parsing])
4783 AC_ARG_ENABLE(netrc,
4784 AC_HELP_STRING([--enable-netrc],[Enable netrc parsing])
4785 AC_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
4786 [ case "$enableval" in
4789 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
4791 *) AC_MSG_RESULT(yes)
4797 dnl ************************************************************
4798 dnl disable progress-meter
4800 AC_MSG_CHECKING([whether to support progress-meter])
4801 AC_ARG_ENABLE(progress-meter,
4802 AC_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
4803 AC_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
4804 [ case "$enableval" in
4807 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
4809 *) AC_MSG_RESULT(yes)
4815 dnl ************************************************************
4816 dnl disable shuffle DNS support
4818 AC_MSG_CHECKING([whether to support DNS shuffling])
4819 AC_ARG_ENABLE(dnsshuffle,
4820 AC_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
4821 AC_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
4822 [ case "$enableval" in
4825 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4827 *) AC_MSG_RESULT(yes)
4833 dnl ************************************************************
4834 dnl disable the curl_easy_options API
4836 AC_MSG_CHECKING([whether to support curl_easy_option*])
4837 AC_ARG_ENABLE(get-easy-option,
4838 AC_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
4839 AC_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
4840 [ case "$enableval" in
4843 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
4845 *) AC_MSG_RESULT(yes)
4851 dnl ************************************************************
4852 dnl switch on/off alt-svc
4854 curl_altsvc_msg="no (--enable-alt-svc)";
4855 AC_MSG_CHECKING([whether to support alt-svc])
4856 AC_ARG_ENABLE(alt-svc,
4857 AC_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
4858 AC_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
4859 [ case "$enableval" in
4863 *) AC_MSG_RESULT(yes)
4864 curl_altsvc_msg="enabled";
4871 if test "$enable_altsvc" = "yes"; then
4872 AC_DEFINE(USE_ALTSVC, 1, [to enable alt-svc])
4873 experimental="$experimental alt-svc"
4876 dnl *************************************************************
4877 dnl check whether ECH support, if desired, is actually available
4879 if test "x$want_ech" != "xno"; then
4880 AC_MSG_CHECKING([whether ECH support is available])
4882 dnl assume NOT and look for sufficient condition
4886 dnl OpenSSL with a chosen ECH function should be enough
4887 dnl so more exhaustive checking seems unnecessary for now
4888 if test "x$OPENSSL_ENABLED" = "x1"; then
4889 AC_CHECK_FUNCS(SSL_get_ech_status,
4890 ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
4893 dnl add 'elif' chain here for additional implementations
4896 dnl now deal with whatever we found
4897 if test "x$ECH_ENABLED" = "x1"; then
4898 AC_DEFINE(USE_ECH, 1, [if ECH support is available])
4899 AC_MSG_RESULT($ECH_SUPPORT)
4900 experimental="$experimental ECH"
4902 AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
4906 dnl ************************************************************
4907 dnl hiding of library internal symbols
4909 CURL_CONFIGURE_SYMBOL_HIDING
4912 dnl All the library dependencies put into $LIB apply to libcurl only.
4916 AC_SUBST(LIBCURL_LIBS)
4917 AC_SUBST(CURL_NETWORK_LIBS)
4918 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4920 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4921 dnl LIBS variable used in generated makefile at makefile processing
4922 dnl time. Doing this functionally prevents LIBS from being used for
4923 dnl all link targets in given makefile.
4925 AC_SUBST(BLANK_AT_MAKETIME)
4927 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4930 ENABLE_SHARED="$enable_shared"
4931 AC_SUBST(ENABLE_SHARED)
4933 dnl to let curl-config output the static libraries correctly
4934 ENABLE_STATIC="$enable_static"
4935 AC_SUBST(ENABLE_STATIC)
4937 dnl merge the pkg-config Libs.private field into Libs when static-only
4938 if test "x$enable_shared" = "xno"; then
4939 LIBCURL_NO_SHARED=$LIBCURL_LIBS
4943 AC_SUBST(LIBCURL_NO_SHARED)
4946 dnl For keeping supported features and protocols also in pkg-config file
4947 dnl since it is more cross-compile friendly than curl-config
4950 if test "x$OPENSSL_ENABLED" = "x1"; then
4951 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4952 elif test -n "$SSL_ENABLED"; then
4953 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4955 if test "x$IPV6_ENABLED" = "x1"; then
4956 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4958 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4959 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4961 if test "x$HAVE_LIBZ" = "x1"; then
4962 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4964 if test "x$HAVE_BROTLI" = "x1"; then
4965 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4967 if test "x$HAVE_ZSTD" = "x1"; then
4968 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
4970 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4971 -o "x$USE_THREADS_WIN32" = "x1"; then
4972 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4974 if test "x$IDN_ENABLED" = "x1"; then
4975 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4977 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4978 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4981 if test "x$HAVE_GSSAPI" = "x1"; then
4982 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4985 if test "x$curl_psl_msg" = "xenabled"; then
4986 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4989 if test "x$enable_altsvc" = "xyes"; then
4990 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4993 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4994 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4995 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4998 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4999 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
5000 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
5003 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
5004 if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
5005 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
5006 -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
5007 -o "x$WOLFSSL_NTLM" = "x1"; then
5008 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
5010 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
5011 "x$NTLM_WB_ENABLED" = "x1"; then
5012 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
5017 if test "x$USE_TLS_SRP" = "x1"; then
5018 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
5021 if test "x$USE_NGHTTP2" = "x1"; then
5022 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
5025 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then
5026 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
5029 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
5030 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
5033 dnl if not explictily turned off, HTTPS-proxy comes with some TLS backends
5034 if test "x$https_proxy" != "xno"; then
5035 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
5036 -o "x$NSS_ENABLED" = "x1"; then
5037 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
5041 if test "x$ECH_ENABLED" = "x1"; then
5042 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
5045 dnl replace spaces with newlines
5047 dnl replace the newlines back to spaces
5048 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
5049 AC_SUBST(SUPPORT_FEATURES)
5051 dnl For supported protocols in pkg-config file
5052 if test "x$CURL_DISABLE_HTTP" != "x1"; then
5053 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
5054 if test "x$SSL_ENABLED" = "x1"; then
5055 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
5058 if test "x$CURL_DISABLE_FTP" != "x1"; then
5059 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
5060 if test "x$SSL_ENABLED" = "x1"; then
5061 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
5064 if test "x$CURL_DISABLE_FILE" != "x1"; then
5065 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
5067 if test "x$CURL_DISABLE_TELNET" != "x1"; then
5068 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
5070 if test "x$CURL_DISABLE_LDAP" != "x1"; then
5071 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
5072 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
5073 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
5074 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
5075 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
5079 if test "x$CURL_DISABLE_DICT" != "x1"; then
5080 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
5082 if test "x$CURL_DISABLE_TFTP" != "x1"; then
5083 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
5085 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
5086 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
5088 if test "x$CURL_DISABLE_MQTT" != "x1"; then
5089 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
5091 if test "x$CURL_DISABLE_POP3" != "x1"; then
5092 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
5093 if test "x$SSL_ENABLED" = "x1"; then
5094 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
5097 if test "x$CURL_DISABLE_IMAP" != "x1"; then
5098 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
5099 if test "x$SSL_ENABLED" = "x1"; then
5100 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
5103 if test "x$CURL_DISABLE_SMB" != "x1" \
5104 -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
5105 -a \( "x$OPENSSL_ENABLED" = "x1" \
5106 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
5107 -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
5108 -o "x$WOLFSSL_NTLM" = "x1" \); then
5109 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
5110 if test "x$SSL_ENABLED" = "x1"; then
5111 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
5114 if test "x$CURL_DISABLE_SMTP" != "x1"; then
5115 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
5116 if test "x$SSL_ENABLED" = "x1"; then
5117 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
5120 if test "x$USE_LIBSSH2" = "x1"; then
5121 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
5122 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
5124 if test "x$USE_LIBSSH" = "x1"; then
5125 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
5126 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
5128 if test "x$USE_WOLFSSH" = "x1"; then
5129 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
5131 if test "x$CURL_DISABLE_RTSP" != "x1"; then
5132 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
5134 if test "x$USE_LIBRTMP" = "x1"; then
5135 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
5138 dnl replace spaces with newlines
5140 dnl replace the newlines back to spaces
5141 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
5143 AC_SUBST(SUPPORT_PROTOCOLS)
5145 dnl squeeze whitespace out of some variables
5153 squeeze LIBCURL_LIBS
5154 squeeze CURL_NETWORK_LIBS
5155 squeeze CURL_NETWORK_AND_TIME_LIBS
5157 squeeze SUPPORT_FEATURES
5158 squeeze SUPPORT_PROTOCOLS
5160 XC_CHECK_BUILD_FLAGS
5162 SSL_BACKENDS=${ssl_backends}
5163 AC_SUBST(SSL_BACKENDS)
5165 if test "x$want_curldebug_assumed" = "xyes" &&
5166 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
5167 ac_configure_args="$ac_configure_args --enable-curldebug"
5170 AC_CONFIG_FILES([Makefile \
5172 docs/examples/Makefile \
5173 docs/libcurl/Makefile \
5174 docs/libcurl/opts/Makefile \
5175 docs/cmdline-opts/Makefile \
5177 include/curl/Makefile \
5183 tests/certs/Makefile \
5184 tests/certs/scripts/Makefile \
5185 tests/data/Makefile \
5186 tests/server/Makefile \
5187 tests/libtest/Makefile \
5188 tests/unit/Makefile \
5190 packages/vms/Makefile \
5196 CURL_GENERATE_CONFIGUREHELP_PM
5198 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
5200 AC_MSG_NOTICE([Configured to build curl/libcurl:
5203 Install prefix: ${prefix}
5206 CPPFLAGS: ${CPPFLAGS}
5210 curl version: ${CURLVERSION}
5211 SSL: ${curl_ssl_msg}
5212 SSH: ${curl_ssh_msg}
5213 zlib: ${curl_zlib_msg}
5214 brotli: ${curl_brotli_msg}
5215 zstd: ${curl_zstd_msg}
5216 GSS-API: ${curl_gss_msg}
5217 TLS-SRP: ${curl_tls_srp_msg}
5218 resolver: ${curl_res_msg}
5219 IPv6: ${curl_ipv6_msg}
5220 Unix sockets: ${curl_unix_sockets_msg}
5221 IDN: ${curl_idn_msg}
5222 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
5223 Built-in manual: ${curl_manual_msg}
5224 --libcurl option: ${curl_libcurl_msg}
5225 Verbose errors: ${curl_verbose_msg}
5226 Code coverage: ${curl_coverage_msg}
5227 SSPI: ${curl_sspi_msg}
5228 ca cert bundle: ${ca}${ca_warning}
5229 ca cert path: ${capath}${capath_warning}
5230 ca fallback: ${with_ca_fallback}
5231 LDAP: ${curl_ldap_msg}
5232 LDAPS: ${curl_ldaps_msg}
5233 RTSP: ${curl_rtsp_msg}
5234 RTMP: ${curl_rtmp_msg}
5235 Metalink: ${curl_mtlnk_msg}
5236 PSL: ${curl_psl_msg}
5237 Alt-svc: ${curl_altsvc_msg}
5238 HTTP2: ${curl_h2_msg}
5239 HTTP3: ${curl_h3_msg}
5240 ECH: ${curl_ech_msg}
5241 Protocols: ${SUPPORT_PROTOCOLS}
5242 Features: ${SUPPORT_FEATURES}
5244 if test -n "$experimental"; then
5246 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!