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 ICU-UC (IDN support)
3393 dnl **********************************************************************
3395 AC_MSG_CHECKING([whether to build with icu-uc])
3398 AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
3399 AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
3403 dnl --without-icu-uc option used
3408 dnl configure option not specified
3410 want_idn_path="default"
3411 AC_MSG_RESULT([(assumed) yes])
3414 dnl --with-icu-uc option used without path
3416 want_idn_path="default"
3417 AC_MSG_RESULT([yes])
3420 dnl --with-icu-uc 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(icu-uc, [$IDN_PCDIR])
3438 if test "$PKGCONFIG" != "no"; then
3439 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3440 $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
3441 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3442 $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
3443 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3444 $PKGCONFIG --cflags-only-I icu-uc 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(icu-uc)
3456 if test "$PKGCONFIG" != "no"; then
3457 IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
3458 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
3459 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 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="$IDN_CPPFLAGS $CPPFLAGS"
3480 LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
3481 LIBS="$IDN_LIBS $LIBS"
3483 AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
3485 AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
3487 AC_MSG_RESULT([yes])
3494 if test "$tst_links_icu" = "yes"; then
3495 AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
3496 dnl different versions of libidn have different setups of these:
3498 AC_SUBST([IDN_ENABLED], [1])
3499 curl_idn_msg="enabled (icu-uc)"
3500 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3501 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
3502 export LD_LIBRARY_PATH
3503 AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
3506 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3507 CPPFLAGS="$clean_CPPFLAGS"
3508 LDFLAGS="$clean_LDFLAGS"
3514 dnl **********************************************************************
3515 dnl Check for the presence of IDN libraries and headers
3516 dnl **********************************************************************
3518 AC_MSG_CHECKING([whether to build with libidn2])
3520 AC_ARG_WITH(libidn2,
3521 AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
3522 AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
3526 dnl --without-libidn2 option used
3531 dnl configure option not specified
3533 want_idn_path="default"
3534 AC_MSG_RESULT([(assumed) yes])
3537 dnl --with-libidn2 option used without path
3539 want_idn_path="default"
3540 AC_MSG_RESULT([yes])
3543 dnl --with-libidn2 option used with path
3545 want_idn_path="$withval"
3546 AC_MSG_RESULT([yes ($withval)])
3550 if test "$want_idn" = "yes"; then
3551 dnl idn library support has been requested
3552 clean_CPPFLAGS="$CPPFLAGS"
3553 clean_LDFLAGS="$LDFLAGS"
3557 if test "$want_idn_path" != "default"; then
3558 dnl path has been specified
3559 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3560 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
3561 if test "$PKGCONFIG" != "no"; then
3562 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3563 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3564 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3565 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3566 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3567 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3568 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
3570 dnl pkg-config not available or provides no info
3572 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3573 IDN_CPPFLAGS="-I$want_idn_path/include"
3574 IDN_DIR="$want_idn_path/lib$libsuff"
3577 dnl path not specified
3578 CURL_CHECK_PKGCONFIG(libidn2)
3579 if test "$PKGCONFIG" != "no"; then
3580 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3581 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3582 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3583 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
3585 dnl pkg-config not available or provides no info
3590 if test "$PKGCONFIG" != "no"; then
3591 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3592 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3593 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3594 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3596 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3597 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3598 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3599 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3602 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
3603 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
3604 LIBS="$IDN_LIBS $LIBS"
3606 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
3608 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
3610 AC_MSG_RESULT([yes])
3611 tst_links_libidn="yes"
3614 tst_links_libidn="no"
3617 AC_CHECK_HEADERS( idn2.h )
3619 if test "$tst_links_libidn" = "yes"; then
3620 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
3621 dnl different versions of libidn have different setups of these:
3623 AC_SUBST([IDN_ENABLED], [1])
3624 curl_idn_msg="enabled (libidn2)"
3625 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3626 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
3627 export CURL_LIBRARY_PATH
3628 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
3631 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3632 CPPFLAGS="$clean_CPPFLAGS"
3633 LDFLAGS="$clean_LDFLAGS"
3639 dnl Let's hope this split URL remains working:
3640 dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
3641 dnl genprogc/thread_quick_ref.htm
3643 dnl **********************************************************************
3644 dnl Check for strict SSL check
3645 dnl **********************************************************************
3646 AC_ARG_ENABLE([strict-ssl-check],
3647 AS_HELP_STRING([--enable-strict-ssl-check], [Enable strict SSL check usage]),
3648 [enable_strict_ssl_check=yes],
3649 [enable_strict_ssl_check=no])
3651 AS_IF([test "x$enable_strict_ssl_check" = "xyes"], [
3652 CPPFLAGS+=" -DUSE_TIZEN_FEATURE_STRICT_SSL_CHECK"
3653 SUPPORT_TIZEN_FEATURES="$SUPPORT_TIZEN_FEATURES strict-ssl-check"
3656 AM_CONDITIONAL(USE_TIZEN_FEATURE_STRICT_SSL_CHECK, test "x$enable_strict_ssl_check" = "xyes")
3658 dnl **********************************************************************
3660 dnl **********************************************************************
3662 AC_ARG_ENABLE([dlp],
3663 AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
3665 AS_IF([test "x$enable_dlp" = "xyes"], [
3666 AC_DEFINE(HAVE_TIZEN_DLP, 1, [Enadle DLP])
3670 AM_CONDITIONAL(HAVE_TIZEN_DLP, test "x$enable_dlp" = "xyes")
3672 dnl **********************************************************************
3673 dnl Check for nghttp2
3674 dnl **********************************************************************
3678 if test "x$disable_http" = "xyes"; then
3679 # without HTTP, nghttp2 is no use
3683 AC_ARG_WITH(nghttp2,
3684 AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
3685 AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
3689 dnl --without-nghttp2 option used
3693 dnl --with-nghttp2 option used without path
3698 dnl --with-nghttp2 option used with path
3700 want_h2_path="$withval/lib/pkgconfig"
3704 curl_h2_msg="no (--with-nghttp2)"
3705 if test X"$want_h2" != Xno; then
3706 dnl backup the pre-nghttp2 variables
3707 CLEANLDFLAGS="$LDFLAGS"
3708 CLEANCPPFLAGS="$CPPFLAGS"
3711 CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path)
3713 if test "$PKGCONFIG" != "no" ; then
3714 LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3715 $PKGCONFIG --libs-only-l libnghttp2`
3716 AC_MSG_NOTICE([-l is $LIB_H2])
3718 CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl
3719 $PKGCONFIG --cflags-only-I libnghttp2`
3720 AC_MSG_NOTICE([-I is $CPP_H2])
3722 LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3723 $PKGCONFIG --libs-only-L libnghttp2`
3724 AC_MSG_NOTICE([-L is $LD_H2])
3726 LDFLAGS="$LDFLAGS $LD_H2"
3727 CPPFLAGS="$CPPFLAGS $CPP_H2"
3728 LIBS="$LIB_H2 $LIBS"
3730 # use nghttp2_session_set_local_window_size to require nghttp2
3732 AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
3734 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
3735 curl_h2_msg="enabled (nghttp2)"
3737 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
3738 AC_SUBST(USE_NGHTTP2, [1])
3741 dnl not found, revert back to clean variables
3742 LDFLAGS=$CLEANLDFLAGS
3743 CPPFLAGS=$CLEANCPPFLAGS
3748 dnl no nghttp2 pkg-config found, deal with it
3749 if test X"$want_h2" != Xdefault; then
3750 dnl To avoid link errors, we do not allow --with-nghttp2 without
3751 dnl a pkgconfig file
3752 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
3758 dnl **********************************************************************
3759 dnl Check for ngtcp2 (QUIC)
3760 dnl **********************************************************************
3763 curl_h3_msg="no (--with-ngtcp2, --with-quiche)"
3765 if test "x$disable_http" = "xyes"; then
3766 # without HTTP, ngtcp2 is no use
3771 AC_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
3772 AC_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
3773 [OPT_TCP2=$withval])
3776 dnl --without-ngtcp2 option used
3780 dnl --with-ngtcp2 option used without path
3785 dnl --with-ngtcp2 option used with path
3787 want_tcp2_path="$withval/lib/pkgconfig"
3791 curl_tcp2_msg="no (--with-ngtcp2)"
3792 if test X"$want_tcp2" != Xno; then
3793 dnl backup the pre-ngtcp2 variables
3794 CLEANLDFLAGS="$LDFLAGS"
3795 CLEANCPPFLAGS="$CPPFLAGS"
3798 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
3800 if test "$PKGCONFIG" != "no" ; then
3801 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3802 $PKGCONFIG --libs-only-l libngtcp2`
3803 AC_MSG_NOTICE([-l is $LIB_TCP2])
3805 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3806 $PKGCONFIG --cflags-only-I libngtcp2`
3807 AC_MSG_NOTICE([-I is $CPP_TCP2])
3809 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3810 $PKGCONFIG --libs-only-L libngtcp2`
3811 AC_MSG_NOTICE([-L is $LD_TCP2])
3813 LDFLAGS="$LDFLAGS $LD_TCP2"
3814 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
3815 LIBS="$LIB_TCP2 $LIBS"
3817 if test "x$cross_compiling" != "xyes"; then
3818 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
3820 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new,
3822 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
3824 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
3825 AC_SUBST(USE_NGTCP2, [1])
3826 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
3827 export CURL_LIBRARY_PATH
3828 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
3831 dnl not found, revert back to clean variables
3832 LDFLAGS=$CLEANLDFLAGS
3833 CPPFLAGS=$CLEANCPPFLAGS
3838 dnl no ngtcp2 pkg-config found, deal with it
3839 if test X"$want_tcp2" != Xdefault; then
3840 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3841 dnl a pkgconfig file
3842 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
3848 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
3849 dnl backup the pre-ngtcp2_crypto_openssl variables
3850 CLEANLDFLAGS="$LDFLAGS"
3851 CLEANCPPFLAGS="$CPPFLAGS"
3854 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
3856 if test "$PKGCONFIG" != "no" ; then
3857 LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3858 $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
3859 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
3861 CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3862 $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
3863 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
3865 LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3866 $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
3867 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
3869 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
3870 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
3871 LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
3873 if test "x$cross_compiling" != "xyes"; then
3874 DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
3876 AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
3878 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3880 AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
3881 AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
3882 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
3883 export CURL_LIBRARY_PATH
3884 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
3887 dnl not found, revert back to clean variables
3888 LDFLAGS=$CLEANLDFLAGS
3889 CPPFLAGS=$CLEANCPPFLAGS
3894 dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
3895 if test X"$want_tcp2" != Xdefault; then
3896 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3897 dnl a pkgconfig file
3898 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
3903 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
3904 dnl backup the pre-ngtcp2_crypto_gnutls variables
3905 CLEANLDFLAGS="$LDFLAGS"
3906 CLEANCPPFLAGS="$CPPFLAGS"
3909 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
3911 if test "$PKGCONFIG" != "no" ; then
3912 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3913 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
3914 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
3916 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
3917 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
3918 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
3920 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3921 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
3922 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
3924 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
3925 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
3926 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
3928 if test "x$cross_compiling" != "xyes"; then
3929 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
3931 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_ctx_initial,
3933 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3935 AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
3936 AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
3937 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
3938 export CURL_LIBRARY_PATH
3939 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
3942 dnl not found, revert back to clean variables
3943 LDFLAGS=$CLEANLDFLAGS
3944 CPPFLAGS=$CLEANCPPFLAGS
3949 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
3950 if test X"$want_tcp2" != Xdefault; then
3951 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3952 dnl a pkgconfig file
3953 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
3958 dnl **********************************************************************
3959 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
3960 dnl **********************************************************************
3964 if test "x$NGTCP2_ENABLED" = "x"; then
3965 # without ngtcp2, nghttp3 is of no use for us
3969 AC_ARG_WITH(nghttp3,
3970 AC_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
3971 AC_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
3972 [OPT_NGHTTP3=$withval])
3973 case "$OPT_NGHTTP3" in
3975 dnl --without-nghttp3 option used
3979 dnl --with-nghttp3 option used without path
3980 want_nghttp3="default"
3981 want_nghttp3_path=""
3984 dnl --with-nghttp3 option used with path
3986 want_nghttp3_path="$withval/lib/pkgconfig"
3990 curl_http3_msg="no (--with-nghttp3)"
3991 if test X"$want_nghttp3" != Xno; then
3992 dnl backup the pre-nghttp3 variables
3993 CLEANLDFLAGS="$LDFLAGS"
3994 CLEANCPPFLAGS="$CPPFLAGS"
3997 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3999 if test "$PKGCONFIG" != "no" ; then
4000 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
4001 $PKGCONFIG --libs-only-l libnghttp3`
4002 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
4004 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
4005 $PKGCONFIG --cflags-only-I libnghttp3`
4006 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
4008 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
4009 $PKGCONFIG --libs-only-L libnghttp3`
4010 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
4012 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
4013 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
4014 LIBS="$LIB_NGHTTP3 $LIBS"
4016 if test "x$cross_compiling" != "xyes"; then
4017 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
4019 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new,
4021 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
4022 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
4024 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
4025 AC_SUBST(USE_NGHTTP3, [1])
4026 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
4027 export CURL_LIBRARY_PATH
4028 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
4029 experimental="$experimental HTTP3"
4032 dnl not found, revert back to clean variables
4033 LDFLAGS=$CLEANLDFLAGS
4034 CPPFLAGS=$CLEANCPPFLAGS
4039 dnl no nghttp3 pkg-config found, deal with it
4040 if test X"$want_nghttp3" != Xdefault; then
4041 dnl To avoid link errors, we do not allow --with-nghttp3 without
4042 dnl a pkgconfig file
4043 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
4049 dnl **********************************************************************
4050 dnl Check for quiche (QUIC)
4051 dnl **********************************************************************
4055 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
4056 # without HTTP or with ngtcp2, quiche is no use
4061 AC_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
4062 AC_HELP_STRING([--without-quiche],[Disable quiche usage]),
4063 [OPT_QUICHE=$withval])
4064 case "$OPT_QUICHE" in
4066 dnl --without-quiche option used
4070 dnl --with-quiche option used without path
4071 want_quiche="default"
4075 dnl --with-quiche option used with path
4077 want_quiche_path="$withval"
4081 if test X"$want_quiche" != Xno; then
4082 dnl backup the pre-quiche variables
4083 CLEANLDFLAGS="$LDFLAGS"
4084 CLEANCPPFLAGS="$CPPFLAGS"
4087 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
4089 if test "$PKGCONFIG" != "no" ; then
4090 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
4091 $PKGCONFIG --libs-only-l quiche`
4092 AC_MSG_NOTICE([-l is $LIB_QUICHE])
4094 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
4095 $PKGCONFIG --cflags-only-I quiche`
4096 AC_MSG_NOTICE([-I is $CPP_QUICHE])
4098 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
4099 $PKGCONFIG --libs-only-L quiche`
4100 AC_MSG_NOTICE([-L is $LD_QUICHE])
4102 LDFLAGS="$LDFLAGS $LD_QUICHE"
4103 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
4104 LIBS="$LIB_QUICHE $LIBS"
4106 if test "x$cross_compiling" != "xyes"; then
4107 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
4109 AC_CHECK_LIB(quiche, quiche_connect,
4111 AC_CHECK_HEADERS(quiche.h,
4112 experimental="$experimental HTTP3"
4113 AC_MSG_NOTICE([HTTP3 support is experimental])
4114 curl_h3_msg="enabled (quiche)"
4116 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
4117 AC_SUBST(USE_QUICHE, [1])
4118 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
4119 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
4120 export CURL_LIBRARY_PATH
4121 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
4124 dnl not found, revert back to clean variables
4125 LDFLAGS=$CLEANLDFLAGS
4126 CPPFLAGS=$CLEANCPPFLAGS
4130 dnl no quiche pkg-config found, deal with it
4131 if test X"$want_quiche" != Xdefault; then
4132 dnl To avoid link errors, we do not allow --with-quiche without
4133 dnl a pkgconfig file
4134 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
4139 dnl **********************************************************************
4140 dnl Check for zsh completion path
4141 dnl **********************************************************************
4143 OPT_ZSH_FPATH=default
4144 AC_ARG_WITH(zsh-functions-dir,
4145 AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
4146 AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
4147 [OPT_ZSH_FPATH=$withval])
4148 case "$OPT_ZSH_FPATH" in
4150 dnl --without-zsh-functions-dir option used
4153 dnl --with-zsh-functions-dir option used without path
4154 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
4155 AC_SUBST(ZSH_FUNCTIONS_DIR)
4158 dnl --with-zsh-functions-dir option used with path
4159 ZSH_FUNCTIONS_DIR="$withval"
4160 AC_SUBST(ZSH_FUNCTIONS_DIR)
4164 dnl **********************************************************************
4165 dnl Check for fish completion path
4166 dnl **********************************************************************
4168 OPT_FISH_FPATH=default
4169 AC_ARG_WITH(fish-functions-dir,
4170 AC_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
4171 AC_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
4172 [OPT_FISH_FPATH=$withval])
4173 case "$OPT_FISH_FPATH" in
4175 dnl --without-fish-functions-dir option used
4178 dnl --with-fish-functions-dir option used without path
4179 CURL_CHECK_PKGCONFIG(fish)
4180 if test "$PKGCONFIG" != "no" ; then
4181 FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
4183 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
4185 AC_SUBST(FISH_FUNCTIONS_DIR)
4188 dnl --with-fish-functions-dir option used with path
4189 FISH_FUNCTIONS_DIR="$withval"
4190 AC_SUBST(FISH_FUNCTIONS_DIR)
4194 dnl **********************************************************************
4195 dnl Back to "normal" configuring
4196 dnl **********************************************************************
4198 dnl Checks for header files.
4201 CURL_CHECK_HEADER_MALLOC
4202 CURL_CHECK_HEADER_MEMORY
4204 dnl Now check for the very most basic headers. Then we can use these
4205 dnl ones as default-headers when checking for the rest!
4249 dnl to do if not found
4253 dnl default includes
4255 #ifdef HAVE_SYS_TYPES_H
4256 #include <sys/types.h>
4258 #ifdef HAVE_SYS_TIME_H
4259 #include <sys/time.h>
4261 #ifdef HAVE_SYS_SELECT_H
4262 #include <sys/select.h>
4263 #elif defined(HAVE_UNISTD_H)
4266 #ifdef HAVE_SYS_SOCKET_H
4267 #include <sys/socket.h>
4269 #ifdef HAVE_NETINET_IN_H
4270 #include <netinet/in.h>
4272 #ifdef HAVE_NETINET_IN6_H
4273 #include <netinet/in6.h>
4275 #ifdef HAVE_SYS_UN_H
4282 dnl Checks for typedefs, structures, and compiler characteristics.
4284 CURL_CHECK_VARIADIC_MACROS
4287 CURL_CHECK_STRUCT_TIMEVAL
4288 CURL_VERIFY_RUNTIMELIBS
4290 AX_COMPILE_CHECK_SIZEOF(size_t)
4291 AX_COMPILE_CHECK_SIZEOF(long)
4292 AX_COMPILE_CHECK_SIZEOF(int)
4293 AX_COMPILE_CHECK_SIZEOF(short)
4294 AX_COMPILE_CHECK_SIZEOF(time_t)
4295 AX_COMPILE_CHECK_SIZEOF(off_t)
4298 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
4299 AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
4300 #include <curl/system.h>
4304 AC_CHECK_TYPE(long long,
4305 [AC_DEFINE(HAVE_LONGLONG, 1,
4306 [Define to 1 if the compiler supports the 'long long' data type.])]
4310 if test "xyes" = "x$longlong"; then
4311 AC_MSG_CHECKING([if numberLL works])
4315 long long val = 1000LL;
4318 AC_MSG_RESULT([yes])
4319 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
4327 AC_CHECK_TYPE(ssize_t, ,
4328 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
4330 # check for bool type
4331 AC_CHECK_TYPE([bool],[
4332 AC_DEFINE(HAVE_BOOL_T, 1,
4333 [Define to 1 if bool is an available type.])
4335 #ifdef HAVE_SYS_TYPES_H
4336 #include <sys/types.h>
4338 #ifdef HAVE_STDBOOL_H
4339 #include <stdbool.h>
4343 # check for sa_family_t
4344 AC_CHECK_TYPE(sa_family_t,
4345 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
4348 AC_CHECK_TYPE(ADDRESS_FAMILY,
4349 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
4350 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
4352 #ifdef HAVE_SYS_SOCKET_H
4353 #include <sys/socket.h>
4358 #ifdef HAVE_SYS_SOCKET_H
4359 #include <sys/socket.h>
4363 # check for suseconds_t
4364 AC_CHECK_TYPE([suseconds_t],[
4365 AC_DEFINE(HAVE_SUSECONDS_T, 1,
4366 [Define to 1 if suseconds_t is an available type.])
4368 #ifdef HAVE_SYS_TYPES_H
4369 #include <sys/types.h>
4371 #ifdef HAVE_SYS_TIME_H
4372 #include <sys/time.h>
4376 AC_MSG_CHECKING([if time_t is unsigned])
4384 AC_MSG_RESULT([yes])
4385 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
4389 dnl cross-compiling, most systems are unsigned
4393 CURL_CONFIGURE_PULL_SYS_POLL
4397 TYPE_SOCKADDR_STORAGE
4403 CURL_CHECK_FUNC_SELECT
4405 CURL_CHECK_FUNC_RECV
4406 CURL_CHECK_FUNC_SEND
4407 CURL_CHECK_MSG_NOSIGNAL
4409 CURL_CHECK_FUNC_ALARM
4410 CURL_CHECK_FUNC_BASENAME
4411 CURL_CHECK_FUNC_CLOSESOCKET
4412 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
4413 CURL_CHECK_FUNC_CONNECT
4414 CURL_CHECK_FUNC_FCNTL
4415 CURL_CHECK_FUNC_FREEADDRINFO
4416 CURL_CHECK_FUNC_FREEIFADDRS
4417 CURL_CHECK_FUNC_FSETXATTR
4418 CURL_CHECK_FUNC_FTRUNCATE
4419 CURL_CHECK_FUNC_GETADDRINFO
4420 CURL_CHECK_FUNC_GAI_STRERROR
4421 CURL_CHECK_FUNC_GETHOSTBYADDR
4422 CURL_CHECK_FUNC_GETHOSTBYADDR_R
4423 CURL_CHECK_FUNC_GETHOSTBYNAME
4424 CURL_CHECK_FUNC_GETHOSTBYNAME_R
4425 CURL_CHECK_FUNC_GETHOSTNAME
4426 CURL_CHECK_FUNC_GETPEERNAME
4427 CURL_CHECK_FUNC_GETSOCKNAME
4428 CURL_CHECK_FUNC_IF_NAMETOINDEX
4429 CURL_CHECK_FUNC_GETIFADDRS
4430 CURL_CHECK_FUNC_GETSERVBYPORT_R
4431 CURL_CHECK_FUNC_GMTIME_R
4432 CURL_CHECK_FUNC_INET_NTOA_R
4433 CURL_CHECK_FUNC_INET_NTOP
4434 CURL_CHECK_FUNC_INET_PTON
4435 CURL_CHECK_FUNC_IOCTL
4436 CURL_CHECK_FUNC_IOCTLSOCKET
4437 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
4438 CURL_CHECK_FUNC_LOCALTIME_R
4439 CURL_CHECK_FUNC_MEMRCHR
4440 CURL_CHECK_FUNC_POLL
4441 CURL_CHECK_FUNC_SETSOCKOPT
4442 CURL_CHECK_FUNC_SIGACTION
4443 CURL_CHECK_FUNC_SIGINTERRUPT
4444 CURL_CHECK_FUNC_SIGNAL
4445 CURL_CHECK_FUNC_SIGSETJMP
4446 CURL_CHECK_FUNC_SOCKET
4447 CURL_CHECK_FUNC_SOCKETPAIR
4448 CURL_CHECK_FUNC_STRCASECMP
4449 CURL_CHECK_FUNC_STRCMPI
4450 CURL_CHECK_FUNC_STRDUP
4451 CURL_CHECK_FUNC_STRERROR_R
4452 CURL_CHECK_FUNC_STRICMP
4453 CURL_CHECK_FUNC_STRNCASECMP
4454 CURL_CHECK_FUNC_STRNCMPI
4455 CURL_CHECK_FUNC_STRNICMP
4456 CURL_CHECK_FUNC_STRSTR
4457 CURL_CHECK_FUNC_STRTOK_R
4458 CURL_CHECK_FUNC_STRTOLL
4459 CURL_CHECK_FUNC_WRITEV
4465 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
4469 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
4471 #include <sys/types.h>]])
4474 AC_CHECK_FUNCS([fnmatch \
4483 mach_absolute_time \
4494 eval skipcheck=\$skipcheck_$func
4495 if test "x$skipcheck" != "xyes"; then
4496 AC_MSG_CHECKING([deeper for $func])
4503 AC_MSG_RESULT([yes])
4504 eval "ac_cv_func_$func=yes"
4505 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
4506 [Define to 1 if you have the $func function.])
4508 AC_MSG_RESULT([but still no])
4513 CURL_CHECK_NONBLOCKING_SOCKET
4515 dnl ************************************************************
4516 dnl nroff tool stuff
4519 AC_PATH_PROG( PERL, perl, ,
4520 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
4523 AC_PATH_PROGS( NROFF, gnroff nroff, ,
4524 $PATH:/usr/bin/:/usr/local/bin )
4527 if test -n "$NROFF"; then
4528 dnl only check for nroff options if an nroff command was found
4530 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
4532 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
4533 if test -z "$mancheck"; then
4535 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
4536 if test -z "$mancheck"; then
4538 AC_MSG_RESULT([failed])
4539 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
4541 AC_MSG_RESULT([$MANOPT])
4544 AC_MSG_RESULT([$MANOPT])
4549 if test -z "$MANOPT"
4551 dnl if no nroff tool was found, or no option that could convert man pages
4552 dnl was found, then disable the built-in manual stuff
4553 AC_MSG_WARN([disabling built-in manual])
4557 dnl *************************************************************************
4558 dnl If the manual variable still is set, then we go with providing a built-in
4561 if test "$USE_MANUAL" = "1"; then
4562 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
4563 curl_manual_msg="enabled"
4566 dnl set variable for use in automakefile(s)
4567 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
4570 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
4572 if test "x$curl_cv_native_windows" != "xyes" &&
4573 test "x$enable_shared" = "xyes"; then
4574 build_libhostname=yes
4576 build_libhostname=no
4578 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
4580 if test "x$want_ares" != xyes; then
4581 CURL_CHECK_OPTION_THREADED_RESOLVER
4584 dnl ************************************************************
4585 dnl disable POSIX threads
4587 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
4588 AC_ARG_ENABLE(pthreads,
4589 AC_HELP_STRING([--enable-pthreads],
4590 [Enable POSIX threads (default for threaded resolver)])
4591 AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
4592 [ case "$enableval" in
4593 no) AC_MSG_RESULT(no)
4596 *) AC_MSG_RESULT(yes)
4605 dnl turn off pthreads if rt is disabled
4606 if test "$want_pthreads" != "no"; then
4607 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
4608 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
4610 if test "$dontwant_rt" != "no"; then
4611 dnl if --enable-pthreads was explicit then warn it's being ignored
4612 if test "$want_pthreads" = "yes"; then
4613 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
4619 dnl turn off pthreads if no threaded resolver
4620 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
4625 if test "$want_pthreads" != "no"; then
4626 AC_CHECK_HEADER(pthread.h,
4627 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
4628 save_CFLAGS="$CFLAGS"
4629 dnl When statically linking against boringssl, -lpthread is added to LIBS.
4630 dnl Make sure to that this does not pass the check below, we really want
4631 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
4632 dnl lib1541 and lib1565 tests are built with these options. Otherwise
4633 dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
4637 dnl Check for libc variants without a separate pthread lib like bionic
4638 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
4641 dnl on HPUX, life is more complicated...
4644 dnl it doesn't actually work without -lpthread
4645 USE_THREADS_POSIX=""
4651 dnl if it wasn't found without lib, search for it in pthread lib
4652 if test "$USE_THREADS_POSIX" != "1"
4654 CFLAGS="$CFLAGS -pthread"
4655 AC_CHECK_LIB(pthread, pthread_create,
4656 [USE_THREADS_POSIX=1],
4657 [ CFLAGS="$save_CFLAGS"])
4660 if test "x$USE_THREADS_POSIX" = "x1"
4662 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
4663 curl_res_msg="POSIX threaded"
4668 dnl threaded resolver check
4669 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
4670 if test "$want_pthreads" = "yes"; then
4671 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
4673 dnl If native Windows fallback on Win32 threads since no POSIX threads
4674 if test "$curl_cv_native_windows" = "yes"; then
4676 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
4677 curl_res_msg="Win32 threaded"
4679 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
4683 CURL_CONVERT_INCLUDE_TO_ISYSTEM
4685 dnl ************************************************************
4686 dnl disable verbose text strings
4688 AC_MSG_CHECKING([whether to enable verbose strings])
4689 AC_ARG_ENABLE(verbose,
4690 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
4691 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
4692 [ case "$enableval" in
4695 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
4696 curl_verbose_msg="no"
4698 *) AC_MSG_RESULT(yes)
4704 dnl ************************************************************
4705 dnl enable SSPI support
4707 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
4709 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
4710 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
4711 [ case "$enableval" in
4713 if test "$curl_cv_native_windows" = "yes"; then
4715 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
4716 AC_SUBST(USE_WINDOWS_SSPI, [1])
4717 curl_sspi_msg="enabled"
4720 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
4724 if test "x$SCHANNEL_ENABLED" = "x1"; then
4725 # --with-schannel implies --enable-sspi
4732 if test "x$SCHANNEL_ENABLED" = "x1"; then
4733 # --with-schannel implies --enable-sspi
4740 dnl ************************************************************
4741 dnl disable cryptographic authentication
4743 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
4744 AC_ARG_ENABLE(crypto-auth,
4745 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
4746 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
4747 [ case "$enableval" in
4750 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
4751 CURL_DISABLE_CRYPTO_AUTH=1
4753 *) AC_MSG_RESULT(yes)
4759 CURL_CHECK_OPTION_NTLM_WB
4763 dnl ************************************************************
4764 dnl disable TLS-SRP authentication
4766 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
4767 AC_ARG_ENABLE(tls-srp,
4768 AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
4769 AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
4770 [ case "$enableval" in
4775 *) AC_MSG_RESULT(yes)
4783 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
4784 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
4786 curl_tls_srp_msg="enabled"
4789 dnl ************************************************************
4790 dnl disable Unix domain sockets support
4792 AC_MSG_CHECKING([whether to enable Unix domain sockets])
4793 AC_ARG_ENABLE(unix-sockets,
4794 AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
4795 AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
4796 [ case "$enableval" in
4797 no) AC_MSG_RESULT(no)
4798 want_unix_sockets=no
4800 *) AC_MSG_RESULT(yes)
4801 want_unix_sockets=yes
4805 want_unix_sockets=auto
4808 if test "x$want_unix_sockets" != "xno"; then
4809 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
4810 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4811 AC_SUBST(USE_UNIX_SOCKETS, [1])
4812 curl_unix_sockets_msg="enabled"
4814 if test "x$want_unix_sockets" = "xyes"; then
4815 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
4822 dnl ************************************************************
4823 dnl disable cookies support
4825 AC_MSG_CHECKING([whether to support cookies])
4826 AC_ARG_ENABLE(cookies,
4827 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
4828 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
4829 [ case "$enableval" in
4832 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
4834 *) AC_MSG_RESULT(yes)
4840 dnl ************************************************************
4841 dnl disable socketpair
4843 AC_MSG_CHECKING([whether to support socketpair])
4844 AC_ARG_ENABLE(socketpair,
4845 AC_HELP_STRING([--enable-socketpair],[Enable socketpair support])
4846 AC_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
4847 [ case "$enableval" in
4850 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
4852 *) AC_MSG_RESULT(yes)
4858 dnl ************************************************************
4859 dnl disable HTTP authentication support
4861 AC_MSG_CHECKING([whether to support HTTP authentication])
4862 AC_ARG_ENABLE(http-auth,
4863 AC_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
4864 AC_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
4865 [ case "$enableval" in
4868 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
4870 *) AC_MSG_RESULT(yes)
4876 dnl ************************************************************
4877 dnl disable DoH support
4879 AC_MSG_CHECKING([whether to support DoH])
4881 AC_HELP_STRING([--enable-doh],[Enable DoH support])
4882 AC_HELP_STRING([--disable-doh],[Disable DoH support]),
4883 [ case "$enableval" in
4886 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
4888 *) AC_MSG_RESULT(yes)
4894 dnl ************************************************************
4895 dnl disable mime API support
4897 AC_MSG_CHECKING([whether to support the MIME API])
4899 AC_HELP_STRING([--enable-mime],[Enable mime API support])
4900 AC_HELP_STRING([--disable-mime],[Disable mime API support]),
4901 [ case "$enableval" in
4904 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
4906 *) AC_MSG_RESULT(yes)
4912 dnl ************************************************************
4913 dnl disable date parsing
4915 AC_MSG_CHECKING([whether to support date parsing])
4916 AC_ARG_ENABLE(dateparse,
4917 AC_HELP_STRING([--enable-dateparse],[Enable date parsing])
4918 AC_HELP_STRING([--disable-dateparse],[Disable date parsing]),
4919 [ case "$enableval" in
4922 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
4924 *) AC_MSG_RESULT(yes)
4930 dnl ************************************************************
4933 AC_MSG_CHECKING([whether to support netrc parsing])
4934 AC_ARG_ENABLE(netrc,
4935 AC_HELP_STRING([--enable-netrc],[Enable netrc parsing])
4936 AC_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
4937 [ case "$enableval" in
4940 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
4942 *) AC_MSG_RESULT(yes)
4948 dnl ************************************************************
4949 dnl disable progress-meter
4951 AC_MSG_CHECKING([whether to support progress-meter])
4952 AC_ARG_ENABLE(progress-meter,
4953 AC_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
4954 AC_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
4955 [ case "$enableval" in
4958 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
4960 *) AC_MSG_RESULT(yes)
4966 dnl ************************************************************
4967 dnl disable shuffle DNS support
4969 AC_MSG_CHECKING([whether to support DNS shuffling])
4970 AC_ARG_ENABLE(dnsshuffle,
4971 AC_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
4972 AC_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
4973 [ case "$enableval" in
4976 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4978 *) AC_MSG_RESULT(yes)
4984 dnl ************************************************************
4985 dnl disable the curl_easy_options API
4987 AC_MSG_CHECKING([whether to support curl_easy_option*])
4988 AC_ARG_ENABLE(get-easy-option,
4989 AC_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
4990 AC_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
4991 [ case "$enableval" in
4994 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
4996 *) AC_MSG_RESULT(yes)
5002 dnl ************************************************************
5003 dnl switch on/off alt-svc
5005 curl_altsvc_msg="no (--enable-alt-svc)";
5006 AC_MSG_CHECKING([whether to support alt-svc])
5007 AC_ARG_ENABLE(alt-svc,
5008 AC_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
5009 AC_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
5010 [ case "$enableval" in
5014 *) AC_MSG_RESULT(yes)
5015 curl_altsvc_msg="enabled";
5022 if test "$enable_altsvc" = "yes"; then
5023 AC_DEFINE(USE_ALTSVC, 1, [to enable alt-svc])
5024 experimental="$experimental alt-svc"
5027 dnl *************************************************************
5028 dnl check whether ECH support, if desired, is actually available
5030 if test "x$want_ech" != "xno"; then
5031 AC_MSG_CHECKING([whether ECH support is available])
5033 dnl assume NOT and look for sufficient condition
5037 dnl OpenSSL with a chosen ECH function should be enough
5038 dnl so more exhaustive checking seems unnecessary for now
5039 if test "x$OPENSSL_ENABLED" = "x1"; then
5040 AC_CHECK_FUNCS(SSL_get_ech_status,
5041 ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
5044 dnl add 'elif' chain here for additional implementations
5047 dnl now deal with whatever we found
5048 if test "x$ECH_ENABLED" = "x1"; then
5049 AC_DEFINE(USE_ECH, 1, [if ECH support is available])
5050 AC_MSG_RESULT($ECH_SUPPORT)
5051 experimental="$experimental ECH"
5053 AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
5057 dnl ************************************************************
5058 dnl hiding of library internal symbols
5060 CURL_CONFIGURE_SYMBOL_HIDING
5063 dnl All the library dependencies put into $LIB apply to libcurl only.
5067 AC_SUBST(LIBCURL_LIBS)
5068 AC_SUBST(CURL_NETWORK_LIBS)
5069 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
5071 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
5072 dnl LIBS variable used in generated makefile at makefile processing
5073 dnl time. Doing this functionally prevents LIBS from being used for
5074 dnl all link targets in given makefile.
5076 AC_SUBST(BLANK_AT_MAKETIME)
5078 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
5081 ENABLE_SHARED="$enable_shared"
5082 AC_SUBST(ENABLE_SHARED)
5084 dnl to let curl-config output the static libraries correctly
5085 ENABLE_STATIC="$enable_static"
5086 AC_SUBST(ENABLE_STATIC)
5088 dnl merge the pkg-config Libs.private field into Libs when static-only
5089 if test "x$enable_shared" = "xno"; then
5090 LIBCURL_NO_SHARED=$LIBCURL_LIBS
5094 AC_SUBST(LIBCURL_NO_SHARED)
5097 dnl For keeping supported features and protocols also in pkg-config file
5098 dnl since it is more cross-compile friendly than curl-config
5101 if test "x$OPENSSL_ENABLED" = "x1"; then
5102 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
5103 elif test -n "$SSL_ENABLED"; then
5104 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
5106 if test "x$IPV6_ENABLED" = "x1"; then
5107 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
5109 if test "x$USE_UNIX_SOCKETS" = "x1"; then
5110 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
5112 if test "x$HAVE_LIBZ" = "x1"; then
5113 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
5115 if test "x$HAVE_BROTLI" = "x1"; then
5116 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
5118 if test "x$HAVE_ZSTD" = "x1"; then
5119 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
5121 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
5122 -o "x$USE_THREADS_WIN32" = "x1"; then
5123 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
5125 if test "x$IDN_ENABLED" = "x1"; then
5126 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
5128 if test "x$USE_WINDOWS_SSPI" = "x1"; then
5129 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
5132 if test "x$HAVE_GSSAPI" = "x1"; then
5133 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
5136 if test "x$curl_psl_msg" = "xenabled"; then
5137 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
5140 if test "x$enable_altsvc" = "xyes"; then
5141 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
5144 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
5145 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
5146 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
5149 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
5150 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
5151 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
5154 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
5155 if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
5156 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
5157 -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
5158 -o "x$WOLFSSL_NTLM" = "x1"; then
5159 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
5161 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
5162 "x$NTLM_WB_ENABLED" = "x1"; then
5163 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
5168 if test "x$USE_TLS_SRP" = "x1"; then
5169 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
5172 if test "x$USE_NGHTTP2" = "x1"; then
5173 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
5176 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then
5177 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
5180 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
5181 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
5184 dnl if not explictily turned off, HTTPS-proxy comes with some TLS backends
5185 if test "x$https_proxy" != "xno"; then
5186 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
5187 -o "x$NSS_ENABLED" = "x1"; then
5188 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
5192 if test "x$ECH_ENABLED" = "x1"; then
5193 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
5196 dnl replace spaces with newlines
5198 dnl replace the newlines back to spaces
5199 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
5200 AC_SUBST(SUPPORT_FEATURES)
5202 dnl For supported protocols in pkg-config file
5203 if test "x$CURL_DISABLE_HTTP" != "x1"; then
5204 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
5205 if test "x$SSL_ENABLED" = "x1"; then
5206 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
5209 if test "x$CURL_DISABLE_FTP" != "x1"; then
5210 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
5211 if test "x$SSL_ENABLED" = "x1"; then
5212 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
5215 if test "x$CURL_DISABLE_FILE" != "x1"; then
5216 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
5218 if test "x$CURL_DISABLE_TELNET" != "x1"; then
5219 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
5221 if test "x$CURL_DISABLE_LDAP" != "x1"; then
5222 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
5223 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
5224 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
5225 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
5226 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
5230 if test "x$CURL_DISABLE_DICT" != "x1"; then
5231 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
5233 if test "x$CURL_DISABLE_TFTP" != "x1"; then
5234 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
5236 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
5237 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
5239 if test "x$CURL_DISABLE_MQTT" != "x1"; then
5240 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
5242 if test "x$CURL_DISABLE_POP3" != "x1"; then
5243 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
5244 if test "x$SSL_ENABLED" = "x1"; then
5245 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
5248 if test "x$CURL_DISABLE_IMAP" != "x1"; then
5249 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
5250 if test "x$SSL_ENABLED" = "x1"; then
5251 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
5254 if test "x$CURL_DISABLE_SMB" != "x1" \
5255 -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
5256 -a \( "x$OPENSSL_ENABLED" = "x1" \
5257 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
5258 -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
5259 -o "x$WOLFSSL_NTLM" = "x1" \); then
5260 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
5261 if test "x$SSL_ENABLED" = "x1"; then
5262 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
5265 if test "x$CURL_DISABLE_SMTP" != "x1"; then
5266 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
5267 if test "x$SSL_ENABLED" = "x1"; then
5268 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
5271 if test "x$USE_LIBSSH2" = "x1"; then
5272 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
5273 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
5275 if test "x$USE_LIBSSH" = "x1"; then
5276 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
5277 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
5279 if test "x$USE_WOLFSSH" = "x1"; then
5280 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
5282 if test "x$CURL_DISABLE_RTSP" != "x1"; then
5283 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
5285 if test "x$USE_LIBRTMP" = "x1"; then
5286 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
5289 dnl replace spaces with newlines
5291 dnl replace the newlines back to spaces
5292 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
5294 AC_SUBST(SUPPORT_PROTOCOLS)
5296 dnl squeeze whitespace out of some variables
5304 squeeze LIBCURL_LIBS
5305 squeeze CURL_NETWORK_LIBS
5306 squeeze CURL_NETWORK_AND_TIME_LIBS
5308 squeeze SUPPORT_FEATURES
5309 squeeze SUPPORT_PROTOCOLS
5311 XC_CHECK_BUILD_FLAGS
5313 SSL_BACKENDS=${ssl_backends}
5314 AC_SUBST(SSL_BACKENDS)
5316 if test "x$want_curldebug_assumed" = "xyes" &&
5317 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
5318 ac_configure_args="$ac_configure_args --enable-curldebug"
5321 AC_CONFIG_FILES([Makefile \
5323 docs/examples/Makefile \
5324 docs/libcurl/Makefile \
5325 docs/libcurl/opts/Makefile \
5326 docs/cmdline-opts/Makefile \
5328 include/curl/Makefile \
5331 extensions/Makefile \
5335 tests/certs/Makefile \
5336 tests/certs/scripts/Makefile \
5337 tests/data/Makefile \
5338 tests/server/Makefile \
5339 tests/libtest/Makefile \
5340 tests/unit/Makefile \
5342 packages/vms/Makefile \
5348 CURL_GENERATE_CONFIGUREHELP_PM
5350 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
5352 AC_MSG_NOTICE([Configured to build curl/libcurl:
5355 Install prefix: ${prefix}
5358 CPPFLAGS: ${CPPFLAGS}
5362 curl version: ${CURLVERSION}
5363 SSL: ${curl_ssl_msg}
5364 SSH: ${curl_ssh_msg}
5365 zlib: ${curl_zlib_msg}
5366 brotli: ${curl_brotli_msg}
5367 zstd: ${curl_zstd_msg}
5368 GSS-API: ${curl_gss_msg}
5369 TLS-SRP: ${curl_tls_srp_msg}
5370 resolver: ${curl_res_msg}
5371 IPv6: ${curl_ipv6_msg}
5372 Unix sockets: ${curl_unix_sockets_msg}
5373 IDN: ${curl_idn_msg}
5374 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
5375 Built-in manual: ${curl_manual_msg}
5376 --libcurl option: ${curl_libcurl_msg}
5377 Verbose errors: ${curl_verbose_msg}
5378 Code coverage: ${curl_coverage_msg}
5379 SSPI: ${curl_sspi_msg}
5380 ca cert bundle: ${ca}${ca_warning}
5381 ca cert path: ${capath}${capath_warning}
5382 ca fallback: ${with_ca_fallback}
5383 LDAP: ${curl_ldap_msg}
5384 LDAPS: ${curl_ldaps_msg}
5385 RTSP: ${curl_rtsp_msg}
5386 RTMP: ${curl_rtmp_msg}
5387 Metalink: ${curl_mtlnk_msg}
5388 PSL: ${curl_psl_msg}
5389 Alt-svc: ${curl_altsvc_msg}
5390 HTTP2: ${curl_h2_msg}
5391 HTTP3: ${curl_h3_msg}
5392 ECH: ${curl_ech_msg}
5393 Protocols: ${SUPPORT_PROTOCOLS}
5394 Features: ${SUPPORT_FEATURES}
5395 Tizen Features: ${SUPPORT_TIZEN_FEATURES}
5397 if test -n "$experimental"; then
5399 WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!