1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2018, 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 - 2017 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
53 XC_CHECK_PATH_SEPARATOR
56 # save the configure arguments
58 CONFIGURE_OPTIONS="\"$ac_configure_args\""
59 AC_SUBST(CONFIGURE_OPTIONS)
62 if test X"$want_werror" = Xyes; then
63 CURL_CFLAG_EXTRAS="-Werror"
65 AC_SUBST(CURL_CFLAG_EXTRAS)
67 dnl SED is mandatory for configure process and libtool.
68 dnl Set it now, allowing it to be changed later.
69 if test -z "$SED"; then
70 dnl allow it to be overridden
71 AC_PATH_PROG([SED], [sed], [not_found],
72 [$PATH:/usr/bin:/usr/local/bin])
73 if test -z "$SED" || test "$SED" = "not_found"; then
74 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
79 dnl GREP is mandatory for configure process and libtool.
80 dnl Set it now, allowing it to be changed later.
81 if test -z "$GREP"; then
82 dnl allow it to be overridden
83 AC_PATH_PROG([GREP], [grep], [not_found],
84 [$PATH:/usr/bin:/usr/local/bin])
85 if test -z "$GREP" || test "$GREP" = "not_found"; then
86 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
91 dnl EGREP is mandatory for configure process and libtool.
92 dnl Set it now, allowing it to be changed later.
93 if test -z "$EGREP"; then
94 dnl allow it to be overridden
95 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
96 AC_MSG_CHECKING([for egrep])
98 AC_MSG_RESULT([$EGREP])
100 AC_PATH_PROG([EGREP], [egrep], [not_found],
101 [$PATH:/usr/bin:/usr/local/bin])
104 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
105 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
109 dnl AR is mandatory for configure process and libtool.
110 dnl This is target dependent, so check it as a tool.
111 if test -z "$AR"; then
112 dnl allow it to be overridden
113 AC_PATH_TOOL([AR], [ar], [not_found],
114 [$PATH:/usr/bin:/usr/local/bin])
115 if test -z "$AR" || test "$AR" = "not_found"; then
116 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
123 dnl figure out the libcurl version
124 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
127 dnl Check if gcc is being used before adding AX_CODE_COVERAGE
128 AS_IF([ test "$GCC" = "yes" ], [AX_CODE_COVERAGE],
129 # not using GCC so pass a test below - CODE_COVERAGE_ENABLED_TRUE is not zero length
130 CODE_COVERAGE_ENABLED_TRUE='#'
134 AC_MSG_CHECKING([curl version])
135 AC_MSG_RESULT($CURLVERSION)
137 AC_SUBST(CURLVERSION)
140 dnl we extract the numerical version for curl-config only
141 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
144 dnl Solaris pkgadd support definitions
145 PKGADD_PKG="HAXXcurl"
146 PKGADD_NAME="curl - a client that groks URLs"
147 PKGADD_VENDOR="curl.haxx.se"
149 AC_SUBST(PKGADD_NAME)
150 AC_SUBST(PKGADD_VENDOR)
153 dnl initialize all the info variables
154 curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )"
155 curl_ssh_msg="no (--with-libssh2)"
156 curl_zlib_msg="no (--with-zlib)"
157 curl_brotli_msg="no (--with-brotli)"
158 curl_gss_msg="no (--with-gssapi)"
159 curl_tls_srp_msg="no (--enable-tls-srp)"
160 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
161 curl_ipv6_msg="no (--enable-ipv6)"
162 curl_unix_sockets_msg="no (--enable-unix-sockets)"
163 curl_idn_msg="no (--with-{libidn2,winidn})"
164 curl_manual_msg="no (--enable-manual)"
165 curl_libcurl_msg="enabled (--disable-libcurl-option)"
166 curl_verbose_msg="enabled (--disable-verbose)"
167 curl_sspi_msg="no (--enable-sspi)"
168 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
169 curl_ldaps_msg="no (--enable-ldaps)"
170 curl_rtsp_msg="no (--enable-rtsp)"
171 curl_rtmp_msg="no (--with-librtmp)"
172 curl_mtlnk_msg="no (--with-libmetalink)"
173 curl_psl_msg="no (--with-libpsl)"
178 dnl Save some initial values the user might have provided
180 INITIAL_LDFLAGS=$LDFLAGS
184 dnl Detect the canonical host and target build environment
188 dnl Get system canonical name
189 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
191 dnl Checks for programs.
193 dnl This defines _ALL_SOURCE for AIX
194 CURL_CHECK_AIX_ALL_SOURCE
196 dnl Our configure and build reentrant settings
197 CURL_CONFIGURE_THREAD_SAFE
198 CURL_CONFIGURE_REENTRANT
200 dnl check for how to do large files
206 # Automake conditionals based on libtool related checks
209 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
210 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
211 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
212 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
213 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
214 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
217 # Due to libtool and automake machinery limitations of not allowing
218 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
219 # inclusion of these in shared or static libraries, we are forced to
220 # build using separate configure runs for shared and static libraries
221 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
222 # to compile objects for each kind of library. Notice that relying on
223 # the '-DPIC' CFLAG that libtool provides is not valid given that the
224 # user might for example choose to build static libraries with PIC.
228 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
229 # targeting a static library and not building its shared counterpart.
232 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
233 [test "x$xc_lt_build_static_only" = 'xyes'])
236 # Make staticlib CPPFLAG variable and its definition visible in output
237 # files unconditionally, providing an empty definition unless strictly
238 # targeting a static library and not building its shared counterpart.
241 CPPFLAG_CURL_STATICLIB=
242 if test "x$xc_lt_build_static_only" = 'xyes'; then
243 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
245 AC_SUBST([CPPFLAG_CURL_STATICLIB])
248 # Determine whether all dependent libraries must be specified when linking
249 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
255 AC_SUBST(REQUIRE_LIB_DEPS)
256 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
258 dnl check if there's a way to force code inline
261 dnl **********************************************************************
262 dnl platform/compiler/architecture specific checks/flags
263 dnl **********************************************************************
266 CURL_SET_COMPILER_BASIC_OPTS
267 CURL_SET_COMPILER_DEBUG_OPTS
268 CURL_SET_COMPILER_OPTIMIZE_OPTS
269 CURL_SET_COMPILER_WARNING_OPTS
271 if test "$compiler_id" = "INTEL_UNIX_C"; then
273 if test "$compiler_num" -ge "1000"; then
274 dnl icc 10.X or later
275 CFLAGS="$CFLAGS -shared-intel"
276 elif test "$compiler_num" -ge "900"; then
278 CFLAGS="$CFLAGS -i-dynamic"
283 CURL_CHECK_COMPILER_HALT_ON_ERROR
284 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
285 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
286 CURL_CHECK_COMPILER_SYMBOL_HIDING
289 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
291 supports_unittests=yes
292 # cross-compilation of unit tests static library/programs fails when
293 # libcurl shared library is built. This might be due to a libtool or
294 # automake issue. In this case we disable unit tests.
295 if test "x$cross_compiling" != "xno" &&
296 test "x$enable_shared" != "xno"; then
297 supports_unittests=no
300 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
301 # a problem related with OpenSSL headers and library versions not matching.
302 # Disable unit tests while time to further investigate this is found.
305 if test "$compiler_id" = "GNU_C"; then
306 supports_unittests=no
311 # All AIX autobuilds fails unit tests linking against unittests library
312 # due to unittests library being built with no symbols or members. Libtool ?
313 # Disable unit tests while time to further investigate this is found.
316 supports_unittests=no
320 dnl Build unit tests when option --enable-debug is given.
321 if test "x$want_debug" = "xyes" &&
322 test "x$supports_unittests" = "xyes"; then
327 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
329 dnl **********************************************************************
330 dnl Compilation based checks should not be done before this point.
331 dnl **********************************************************************
333 dnl **********************************************************************
334 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
335 dnl and ws2tcpip.h take precedence over any other further checks which
336 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
337 dnl this specific header files. And do them before its results are used.
338 dnl **********************************************************************
340 CURL_CHECK_HEADER_WINDOWS
341 CURL_CHECK_NATIVE_WINDOWS
342 case X-"$curl_cv_native_windows" in
344 CURL_CHECK_HEADER_WINSOCK
345 CURL_CHECK_HEADER_WINSOCK2
346 CURL_CHECK_HEADER_WS2TCPIP
347 CURL_CHECK_HEADER_WINLDAP
348 CURL_CHECK_HEADER_WINBER
351 curl_cv_header_winsock_h="no"
352 curl_cv_header_winsock2_h="no"
353 curl_cv_header_ws2tcpip_h="no"
354 curl_cv_header_winldap_h="no"
355 curl_cv_header_winber_h="no"
358 CURL_CHECK_WIN32_LARGEFILE
361 CURL_SUPPORTS_BUILTIN_AVAILABLE
363 dnl ************************************************************
364 dnl switch off particular protocols
366 AC_MSG_CHECKING([whether to support http])
368 AC_HELP_STRING([--enable-http],[Enable HTTP support])
369 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
370 [ case "$enableval" in
373 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
375 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
376 AC_SUBST(CURL_DISABLE_HTTP, [1])
377 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
378 AC_SUBST(CURL_DISABLE_RTSP, [1])
380 *) AC_MSG_RESULT(yes)
385 AC_MSG_CHECKING([whether to support ftp])
387 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
388 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
389 [ case "$enableval" in
392 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
393 AC_SUBST(CURL_DISABLE_FTP, [1])
395 *) AC_MSG_RESULT(yes)
400 AC_MSG_CHECKING([whether to support file])
402 AC_HELP_STRING([--enable-file],[Enable FILE support])
403 AC_HELP_STRING([--disable-file],[Disable FILE support]),
404 [ case "$enableval" in
407 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
408 AC_SUBST(CURL_DISABLE_FILE, [1])
410 *) AC_MSG_RESULT(yes)
415 AC_MSG_CHECKING([whether to support ldap])
417 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
418 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
419 [ case "$enableval" in
422 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
423 AC_SUBST(CURL_DISABLE_LDAP, [1])
431 AC_MSG_CHECKING([whether to support ldaps])
433 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
434 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
435 [ case "$enableval" in
438 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
439 AC_SUBST(CURL_DISABLE_LDAPS, [1])
441 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
442 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
443 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
444 AC_SUBST(CURL_DISABLE_LDAPS, [1])
447 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
448 AC_SUBST(HAVE_LDAP_SSL, [1])
452 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
454 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
455 AC_SUBST(CURL_DISABLE_LDAPS, [1])
458 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
459 AC_SUBST(HAVE_LDAP_SSL, [1])
463 AC_MSG_CHECKING([whether to support rtsp])
465 AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
466 AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
467 [ case "$enableval" in
470 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
471 AC_SUBST(CURL_DISABLE_RTSP, [1])
473 *) if test x$CURL_DISABLE_HTTP = x1 ; then
474 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
477 curl_rtsp_msg="enabled"
481 if test "x$CURL_DISABLE_HTTP" != "x1"; then
483 curl_rtsp_msg="enabled"
489 AC_MSG_CHECKING([whether to support proxies])
491 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
492 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
493 [ case "$enableval" in
496 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
497 AC_SUBST(CURL_DISABLE_PROXY, [1])
499 *) AC_MSG_RESULT(yes)
505 AC_MSG_CHECKING([whether to support dict])
507 AC_HELP_STRING([--enable-dict],[Enable DICT support])
508 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
509 [ case "$enableval" in
512 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
513 AC_SUBST(CURL_DISABLE_DICT, [1])
515 *) AC_MSG_RESULT(yes)
520 AC_MSG_CHECKING([whether to support telnet])
521 AC_ARG_ENABLE(telnet,
522 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
523 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
524 [ case "$enableval" in
527 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
528 AC_SUBST(CURL_DISABLE_TELNET, [1])
530 *) AC_MSG_RESULT(yes)
535 AC_MSG_CHECKING([whether to support tftp])
537 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
538 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
539 [ case "$enableval" in
542 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
543 AC_SUBST(CURL_DISABLE_TFTP, [1])
545 *) AC_MSG_RESULT(yes)
551 AC_MSG_CHECKING([whether to support pop3])
553 AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
554 AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
555 [ case "$enableval" in
558 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
559 AC_SUBST(CURL_DISABLE_POP3, [1])
561 *) AC_MSG_RESULT(yes)
568 AC_MSG_CHECKING([whether to support imap])
570 AC_HELP_STRING([--enable-imap],[Enable IMAP support])
571 AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
572 [ case "$enableval" in
575 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
576 AC_SUBST(CURL_DISABLE_IMAP, [1])
578 *) AC_MSG_RESULT(yes)
585 AC_MSG_CHECKING([whether to support smb])
587 AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
588 AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
589 [ case "$enableval" in
592 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
593 AC_SUBST(CURL_DISABLE_SMB, [1])
595 *) AC_MSG_RESULT(yes)
601 AC_MSG_CHECKING([whether to support smtp])
603 AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
604 AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
605 [ case "$enableval" in
608 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
609 AC_SUBST(CURL_DISABLE_SMTP, [1])
611 *) AC_MSG_RESULT(yes)
617 AC_MSG_CHECKING([whether to support gopher])
618 AC_ARG_ENABLE(gopher,
619 AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
620 AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
621 [ case "$enableval" in
624 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
625 AC_SUBST(CURL_DISABLE_GOPHER, [1])
627 *) AC_MSG_RESULT(yes)
634 dnl **********************************************************************
635 dnl Check for built-in manual
636 dnl **********************************************************************
638 AC_MSG_CHECKING([whether to provide built-in manual])
639 AC_ARG_ENABLE(manual,
640 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
641 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
642 [ case "$enableval" in
646 *) AC_MSG_RESULT(yes)
653 dnl The actual use of the USE_MANUAL variable is done much later in this
654 dnl script to allow other actions to disable it as well.
656 dnl ************************************************************
657 dnl disable C code generation support
659 AC_MSG_CHECKING([whether to enable generation of C code])
660 AC_ARG_ENABLE(libcurl_option,
661 AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
662 AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
663 [ case "$enableval" in
666 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
667 curl_libcurl_msg="no"
669 *) AC_MSG_RESULT(yes)
675 dnl **********************************************************************
676 dnl Checks for libraries.
677 dnl **********************************************************************
679 AC_MSG_CHECKING([whether to use libgcc])
680 AC_ARG_ENABLE(libgcc,
681 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
682 [ case "$enableval" in
695 dnl gethostbyname without lib or in the nsl lib?
696 AC_CHECK_FUNC(gethostbyname,
697 [HAVE_GETHOSTBYNAME="1"
699 [ AC_CHECK_LIB(nsl, gethostbyname,
700 [HAVE_GETHOSTBYNAME="1"
705 if test "$HAVE_GETHOSTBYNAME" != "1"
707 dnl gethostbyname in the socket lib?
708 AC_CHECK_LIB(socket, gethostbyname,
709 [HAVE_GETHOSTBYNAME="1"
710 LIBS="-lsocket $LIBS"
714 if test "$HAVE_GETHOSTBYNAME" != "1"
716 dnl gethostbyname in the watt lib?
717 AC_CHECK_LIB(watt, gethostbyname,
718 [HAVE_GETHOSTBYNAME="1"
719 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
720 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
725 dnl At least one system has been identified to require BOTH nsl and socket
726 dnl libs at the same time to link properly.
727 if test "$HAVE_GETHOSTBYNAME" != "1"
729 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
730 my_ac_save_LIBS=$LIBS
731 LIBS="-lnsl -lsocket $LIBS"
739 HAVE_GETHOSTBYNAME="1"
742 LIBS=$my_ac_save_LIBS
746 if test "$HAVE_GETHOSTBYNAME" != "1"
748 dnl This is for winsock systems
749 if test "$curl_cv_header_windows_h" = "yes"; then
750 if test "$curl_cv_header_winsock_h" = "yes"; then
753 winsock_LIB="-lwinsock"
756 winsock_LIB="-lwsock32"
760 if test "$curl_cv_header_winsock2_h" = "yes"; then
761 winsock_LIB="-lws2_32"
763 if test ! -z "$winsock_LIB"; then
764 my_ac_save_LIBS=$LIBS
765 LIBS="$winsock_LIB $LIBS"
766 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
769 #ifdef HAVE_WINDOWS_H
770 #ifndef WIN32_LEAN_AND_MEAN
771 #define WIN32_LEAN_AND_MEAN
774 #ifdef HAVE_WINSOCK2_H
775 #include <winsock2.h>
777 #ifdef HAVE_WINSOCK_H
783 gethostbyname("www.dummysite.com");
787 HAVE_GETHOSTBYNAME="1"
791 LIBS=$my_ac_save_LIBS
797 if test "$HAVE_GETHOSTBYNAME" != "1"
799 dnl This is for Minix 3.1
800 AC_MSG_CHECKING([for gethostbyname for Minix 3])
803 /* Older Minix versions may need <net/gen/netdb.h> here instead */
806 gethostbyname("www.dummysite.com");
810 HAVE_GETHOSTBYNAME="1"
816 if test "$HAVE_GETHOSTBYNAME" != "1"
818 dnl This is for eCos with a stubbed DNS implementation
819 AC_MSG_CHECKING([for gethostbyname for eCos])
825 gethostbyname("www.dummysite.com");
829 HAVE_GETHOSTBYNAME="1"
835 if test "$HAVE_GETHOSTBYNAME" != "1"
837 dnl gethostbyname in the network lib - for Haiku OS
838 AC_CHECK_LIB(network, gethostbyname,
839 [HAVE_GETHOSTBYNAME="1"
840 LIBS="-lnetwork $LIBS"
844 if test "$HAVE_GETHOSTBYNAME" != "1"
846 dnl gethostbyname in the net lib - for BeOS
847 AC_CHECK_LIB(net, gethostbyname,
848 [HAVE_GETHOSTBYNAME="1"
854 if test "$HAVE_GETHOSTBYNAME" != "1"; then
855 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
858 CURL_CHECK_LIBS_CONNECT
860 CURL_NETWORK_LIBS=$LIBS
862 dnl **********************************************************************
863 dnl In case that function clock_gettime with monotonic timer is available,
864 dnl check for additional required libraries.
865 dnl **********************************************************************
866 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
868 dnl **********************************************************************
869 dnl The preceding library checks are all potentially useful for test
870 dnl servers and libtest cases which require networking and clock_gettime
871 dnl support. Save the list of required libraries at this point for use
872 dnl while linking those test servers and programs.
873 dnl **********************************************************************
874 CURL_NETWORK_AND_TIME_LIBS=$LIBS
876 dnl **********************************************************************
877 dnl Check for the presence of ZLIB libraries and headers
878 dnl **********************************************************************
880 dnl Check for & handle argument to --with-zlib.
882 clean_CPPFLAGS=$CPPFLAGS
883 clean_LDFLAGS=$LDFLAGS
887 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
888 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
889 [OPT_ZLIB="$withval"])
891 if test "$OPT_ZLIB" = "no" ; then
892 AC_MSG_WARN([zlib disabled])
894 if test "$OPT_ZLIB" = "yes" ; then
898 if test -z "$OPT_ZLIB" ; then
899 CURL_CHECK_PKGCONFIG(zlib)
901 if test "$PKGCONFIG" != "no" ; then
902 LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
903 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
904 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
909 if test -z "$HAVE_LIBZ"; then
911 dnl Check for the lib without setting any new path, since many
912 dnl people have it in the default path
914 AC_CHECK_LIB(z, inflateEnd,
915 dnl libz found, set the variable
918 dnl if no lib found, try /usr/local
919 [OPT_ZLIB="/usr/local"])
923 dnl Add a nonempty path to the compiler flags
924 if test -n "$OPT_ZLIB"; then
925 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
926 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
929 AC_CHECK_HEADER(zlib.h,
933 dnl if the lib wasn't found already, try again with the new paths
934 if test "$HAVE_LIBZ" != "1"; then
935 AC_CHECK_LIB(z, gzread,
937 dnl the lib was found!
941 [ CPPFLAGS=$clean_CPPFLAGS
942 LDFLAGS=$clean_LDFLAGS])
946 dnl zlib.h was not found, restore the flags
947 CPPFLAGS=$clean_CPPFLAGS
948 LDFLAGS=$clean_LDFLAGS]
951 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
953 AC_MSG_WARN([configure found only the libz lib, not the header file!])
955 CPPFLAGS=$clean_CPPFLAGS
956 LDFLAGS=$clean_LDFLAGS
958 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
960 AC_MSG_WARN([configure found only the libz header file, not the lib!])
961 CPPFLAGS=$clean_CPPFLAGS
962 LDFLAGS=$clean_LDFLAGS
964 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
966 dnl both header and lib were found!
968 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
969 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
972 LIBS="-lz $clean_LIBS"
974 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
976 AC_MSG_NOTICE([found both libz and libz.h header])
977 curl_zlib_msg="enabled"
981 dnl set variable for use in automakefile(s)
982 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
985 dnl **********************************************************************
986 dnl Check for the presence of BROTLI decoder libraries and headers
987 dnl **********************************************************************
989 dnl Brotli project home page: https://github.com/google/brotli
991 dnl Default to compiler & linker defaults for BROTLI files & libraries.
993 AC_ARG_WITH(brotli,dnl
994 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])
995 AC_HELP_STRING([--without-brotli], [disable BROTLI]),
998 if test X"$OPT_BROTLI" != Xno; then
999 dnl backup the pre-brotli variables
1000 CLEANLDFLAGS="$LDFLAGS"
1001 CLEANCPPFLAGS="$CPPFLAGS"
1004 case "$OPT_BROTLI" in
1006 dnl --with-brotli (without path) used
1007 CURL_CHECK_PKGCONFIG(libbrotlidec)
1009 if test "$PKGCONFIG" != "no" ; then
1010 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1011 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1012 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1013 version=`$PKGCONFIG --modversion libbrotlidec`
1014 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/-L//'`
1019 dnl no --with-brotli option given, just check default places
1022 dnl use the given --with-brotli spot
1023 PREFIX_BROTLI=$OPT_BROTLI
1027 dnl if given with a prefix, we set -L and -I based on that
1028 if test -n "$PREFIX_BROTLI"; then
1029 LIB_BROTLI="-lbrotlidec"
1030 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1031 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1032 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1035 LDFLAGS="$LDFLAGS $LD_BROTLI"
1036 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1037 LIBS="$LIB_BROTLI $LIBS"
1039 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1041 AC_CHECK_HEADERS(brotli/decode.h,
1042 curl_brotli_msg="enabled (libbrotlidec)"
1044 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1045 AC_SUBST(HAVE_BROTLI, [1])
1048 if test X"$OPT_BROTLI" != Xoff &&
1049 test "$HAVE_BROTLI" != "1"; then
1050 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1053 if test "$HAVE_BROTLI" = "1"; then
1054 if test -n "$DIR_BROTLI"; then
1055 dnl when the brotli shared libs were found in a path that the run-time
1056 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1057 dnl to prevent further configure tests to fail due to this
1059 if test "x$cross_compiling" != "xyes"; then
1060 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_BROTLI"
1061 export LD_LIBRARY_PATH
1062 AC_MSG_NOTICE([Added $DIR_BROTLI to LD_LIBRARY_PATH])
1066 dnl no brotli, revert back to clean variables
1067 LDFLAGS=$CLEANLDFLAGS
1068 CPPFLAGS=$CLEANCPPFLAGS
1073 dnl **********************************************************************
1075 dnl **********************************************************************
1078 AC_ARG_WITH(ldap-lib,
1079 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1080 [LDAPLIBNAME="$withval"])
1083 AC_ARG_WITH(lber-lib,
1084 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1085 [LBERLIBNAME="$withval"])
1087 if test x$CURL_DISABLE_LDAP != x1 ; then
1089 CURL_CHECK_HEADER_LBER
1090 CURL_CHECK_HEADER_LDAP
1091 CURL_CHECK_HEADER_LDAPSSL
1092 CURL_CHECK_HEADER_LDAP_SSL
1094 if test -z "$LDAPLIBNAME" ; then
1095 if test "$curl_cv_native_windows" = "yes"; then
1096 dnl Windows uses a single and unique LDAP library name
1097 LDAPLIBNAME="wldap32"
1102 if test "$LDAPLIBNAME" ; then
1103 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1104 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1105 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1106 AC_SUBST(CURL_DISABLE_LDAP, [1])
1107 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1108 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1110 dnl Try to find the right ldap libraries for this system
1111 CURL_CHECK_LIBS_LDAP
1112 case X-"$curl_cv_ldap_LIBS" in
1114 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1115 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1116 AC_SUBST(CURL_DISABLE_LDAP, [1])
1117 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1118 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1124 if test x$CURL_DISABLE_LDAP != x1 ; then
1126 if test "$LBERLIBNAME" ; then
1127 dnl If name is "no" then don't define this library at all
1128 dnl (it's only needed if libldap.so's dependencies are broken).
1129 if test "$LBERLIBNAME" != "no" ; then
1130 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1131 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1132 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1133 AC_SUBST(CURL_DISABLE_LDAP, [1])
1134 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1135 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1140 if test x$CURL_DISABLE_LDAP != x1 ; then
1141 AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
1143 if test "$LDAPLIBNAME" = "wldap32"; then
1144 curl_ldap_msg="enabled (winldap)"
1145 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1147 curl_ldap_msg="enabled (OpenLDAP)"
1148 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1149 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1150 AC_SUBST(USE_OPENLDAP, [1])
1155 if test x$CURL_DISABLE_LDAPS != x1 ; then
1156 curl_ldaps_msg="enabled"
1159 dnl **********************************************************************
1161 dnl **********************************************************************
1163 AC_MSG_CHECKING([whether to enable IPv6])
1165 AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1166 AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1167 [ case "$enableval" in
1172 *) AC_MSG_RESULT(yes)
1177 AC_TRY_RUN([ /* is AF_INET6 available? */
1178 #include <sys/types.h>
1179 #ifdef HAVE_WINSOCK2_H
1180 #include <winsock2.h>
1182 #include <sys/socket.h>
1184 #include <stdlib.h> /* for exit() */
1187 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1201 if test "$ipv6" = "yes"; then
1202 curl_ipv6_msg="enabled"
1205 # Check if struct sockaddr_in6 have sin6_scope_id member
1206 if test "$ipv6" = yes; then
1207 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1209 #include <sys/types.h>
1210 #ifdef HAVE_WINSOCK2_H
1211 #include <winsock2.h>
1212 #include <ws2tcpip.h>
1214 #include <netinet/in.h>
1215 #if defined (__TANDEM)
1216 # include <netinet/in6.h>
1219 struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
1220 if test "$have_sin6_scope_id" = yes; then
1221 AC_MSG_RESULT([yes])
1222 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1228 dnl **********************************************************************
1229 dnl Check if the operating system allows programs to write to their own argv[]
1230 dnl **********************************************************************
1232 AC_MSG_CHECKING([if argv can be written to])
1235 int main(int argc, char ** argv) {
1237 return (argv[0][0] == ' ')?0:1;
1241 curl_cv_writable_argv=yes
1243 curl_cv_writable_argv=no
1245 curl_cv_writable_argv=cross
1247 case $curl_cv_writable_argv in
1249 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1257 AC_MSG_WARN([the previous check could not be made default was used])
1261 dnl **********************************************************************
1262 dnl Check for GSS-API libraries
1263 dnl **********************************************************************
1265 dnl check for GSS-API stuff in the /usr as default
1268 AC_ARG_WITH(gssapi-includes,
1269 AC_HELP_STRING([--with-gssapi-includes=DIR],
1270 [Specify location of GSS-API headers]),
1271 [ GSSAPI_INCS="-I$withval"
1275 AC_ARG_WITH(gssapi-libs,
1276 AC_HELP_STRING([--with-gssapi-libs=DIR],
1277 [Specify location of GSS-API libs]),
1278 [ GSSAPI_LIB_DIR="-L$withval"
1283 AC_HELP_STRING([--with-gssapi=DIR],
1284 [Where to look for GSS-API]), [
1285 GSSAPI_ROOT="$withval"
1286 if test x"$GSSAPI_ROOT" != xno; then
1288 if test x"$GSSAPI_ROOT" = xyes; then
1289 dnl if yes, then use default root
1295 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1297 save_CPPFLAGS="$CPPFLAGS"
1298 AC_MSG_CHECKING([if GSS-API support is requested])
1299 if test x"$want_gss" = xyes; then
1302 if test -z "$GSSAPI_INCS"; then
1303 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1304 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1305 elif test -f "$KRB5CONFIG"; then
1306 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1307 elif test "$GSSAPI_ROOT" != "yes"; then
1308 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1312 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1314 AC_CHECK_HEADER(gss.h,
1316 dnl found in the given dirs
1317 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1321 dnl not found, check Heimdal or MIT
1322 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1324 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1329 #ifdef HAVE_GSSAPI_GSSAPI_H
1330 #include <gssapi/gssapi.h>
1333 if test "x$not_mit" = "x1"; then
1334 dnl MIT not found, check for Heimdal
1335 AC_CHECK_HEADER(gssapi.h,
1338 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1341 dnl no header found, disabling GSS
1343 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1348 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1349 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1350 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1353 #include <gssapi/gssapi.h>
1354 #include <gssapi/gssapi_generic.h>
1355 #include <gssapi/gssapi_krb5.h>
1360 GSS_C_NT_HOSTBASED_SERVICE,
1364 AC_MSG_RESULT([yes])
1367 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1368 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1376 if test x"$want_gss" = xyes; then
1377 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1379 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1381 if test -n "$gnu_gss"; then
1382 curl_gss_msg="enabled (GNU GSS)"
1383 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1385 elif test -z "$GSSAPI_LIB_DIR"; then
1388 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1391 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1392 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1394 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1395 LIBS="$gss_libs $LIBS"
1396 elif test -f "$KRB5CONFIG"; then
1397 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1399 gss_libs=`$KRB5CONFIG --libs gssapi`
1400 LIBS="$gss_libs $LIBS"
1407 gss_libname="gssapi"
1411 if test "$GSSAPI_ROOT" != "yes"; then
1412 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1413 LIBS="-l$gss_libname $LIBS"
1415 LIBS="-l$gss_libname $LIBS"
1421 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1427 LIBS="-lgssapi $LIBS"
1432 CPPFLAGS="$save_CPPFLAGS"
1436 if test x"$want_gss" = "xyes"; then
1437 build_libstubgss=yes
1440 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
1442 dnl -------------------------------------------------------------
1443 dnl parse --with-default-ssl-backend so it can be validated below
1444 dnl -------------------------------------------------------------
1446 DEFAULT_SSL_BACKEND=no
1447 VALID_DEFAULT_SSL_BACKEND=
1448 AC_ARG_WITH(default-ssl-backend,
1449 AC_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
1450 AC_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
1451 [DEFAULT_SSL_BACKEND=$withval])
1452 case "$DEFAULT_SSL_BACKEND" in
1454 dnl --without-default-ssl-backend option used
1457 dnl --with-default-ssl-backend option used without name
1458 AC_MSG_ERROR([The name of the default SSL backend is required.])
1461 dnl --with-default-ssl-backend option used with name
1462 AC_SUBST(DEFAULT_SSL_BACKEND)
1463 dnl needs to be validated below
1464 VALID_DEFAULT_SSL_BACKEND=no
1468 dnl **********************************************************************
1470 dnl -------------------------------------------------
1471 dnl check winssl option before other SSL libraries
1472 dnl -------------------------------------------------
1475 AC_ARG_WITH(winssl,dnl
1476 AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
1477 AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
1478 OPT_WINSSL=$withval)
1480 AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
1481 if test -z "$ssl_backends" -o "x$OPT_WINSSL" != xno; then
1483 if test "x$OPT_WINSSL" != "xno" &&
1484 test "x$curl_cv_native_windows" = "xyes"; then
1486 AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
1487 AC_SUBST(USE_SCHANNEL, [1])
1488 ssl_msg="Windows-native"
1489 test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1491 # --with-winssl implies --enable-sspi
1492 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
1493 AC_SUBST(USE_WINDOWS_SSPI, [1])
1494 curl_sspi_msg="enabled"
1495 LIBS="-lcrypt32 $LIBS"
1499 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1505 AC_ARG_WITH(darwinssl,dnl
1506 AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS])
1507 AC_HELP_STRING([--without-darwinssl], [disable Apple OS native SSL/TLS]),
1508 OPT_DARWINSSL=$withval)
1510 AC_MSG_CHECKING([whether to enable Apple OS native SSL/TLS])
1511 if test -z "$ssl_backends" -o "x$OPT_DARWINSSL" != xno; then
1512 if test "x$OPT_DARWINSSL" != "xno" &&
1513 test -d "/System/Library/Frameworks/Security.framework"; then
1515 AC_DEFINE(USE_DARWINSSL, 1, [to enable Apple OS native SSL/TLS support])
1516 AC_SUBST(USE_DARWINSSL, [1])
1517 ssl_msg="Apple OS-native"
1518 test darwinssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1520 LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
1524 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1529 dnl **********************************************************************
1530 dnl Check for the presence of SSL libraries and headers
1531 dnl **********************************************************************
1533 dnl Default to compiler & linker defaults for SSL files & libraries.
1535 dnl Default to no CA bundle
1538 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])
1539 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1542 if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
1543 test X"$OPT_SSL" != Xno; then
1546 dnl backup the pre-ssl variables
1547 CLEANLDFLAGS="$LDFLAGS"
1548 CLEANCPPFLAGS="$CPPFLAGS"
1551 dnl This is for Msys/Mingw
1553 *-*-msys* | *-*-mingw*)
1554 AC_MSG_CHECKING([for gdi32])
1555 my_ac_save_LIBS=$LIBS
1556 LIBS="-lgdi32 $LIBS"
1557 AC_TRY_LINK([#include <windef.h>
1558 #include <wingdi.h>],
1561 AC_MSG_RESULT([yes])],
1562 [ dnl failed, restore LIBS
1563 LIBS=$my_ac_save_LIBS
1571 dnl --with-ssl (without path) used
1572 if test x$cross_compiling != xyes; then
1573 dnl only do pkg-config magic when not cross-compiling
1576 PREFIX_OPENSSL=/usr/local/ssl
1577 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1580 dnl no --with-ssl option given, just check default places
1581 if test x$cross_compiling != xyes; then
1582 dnl only do pkg-config magic when not cross-compiling
1588 dnl check the given --with-ssl spot
1590 PREFIX_OPENSSL=$OPT_SSL
1592 dnl Try pkg-config even when cross-compiling. Since we
1593 dnl specify PKG_CONFIG_LIBDIR we're only looking where
1594 dnl the user told us to look
1595 OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
1596 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
1597 if test -f "$OPENSSL_PCDIR/openssl.pc"; then
1601 dnl in case pkg-config comes up empty, use what we got
1603 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1604 if test "$PREFIX_OPENSSL" != "/usr" ; then
1605 SSL_LDFLAGS="-L$LIB_OPENSSL"
1606 SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
1608 SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1612 if test "$PKGTEST" = "yes"; then
1614 CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
1616 if test "$PKGCONFIG" != "no" ; then
1617 SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1618 $PKGCONFIG --libs-only-l openssl 2>/dev/null`
1620 SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1621 $PKGCONFIG --libs-only-L openssl 2>/dev/null`
1623 SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1624 $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1627 AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
1628 AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
1629 AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
1631 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1633 dnl use the values pkg-config reported. This is here
1634 dnl instead of below with CPPFLAGS and LDFLAGS because we only
1635 dnl learn about this via pkg-config. If we only have
1636 dnl the argument to --with-ssl we don't know what
1637 dnl additional libs may be necessary. Hope that we
1639 LIBS="$SSL_LIBS $LIBS"
1643 dnl finally, set flags to use SSL
1644 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1645 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1647 AC_CHECK_LIB(crypto, HMAC_Update,[
1649 LIBS="-lcrypto $LIBS"
1651 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1652 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1653 AC_CHECK_LIB(crypto, HMAC_Init_ex,[
1655 LIBS="-lcrypto $LIBS"], [
1657 dnl still no, but what about with -ldl?
1658 AC_MSG_CHECKING([OpenSSL linking with -ldl])
1662 #include <openssl/err.h>
1673 dnl ok, so what about bouth -ldl and -lpthread?
1675 AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
1676 LIBS="$LIBS -lpthread"
1679 #include <openssl/err.h>
1690 LDFLAGS="$CLEANLDFLAGS"
1691 CPPFLAGS="$CLEANCPPFLAGS"
1701 if test X"$HAVECRYPTO" = X"yes"; then
1702 dnl This is only reasonable to do if crypto actually is there: check for
1703 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1705 AC_CHECK_LIB(ssl, SSL_connect)
1707 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1708 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1709 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1711 LIBS="-lRSAglue -lrsaref $LIBS"
1712 AC_CHECK_LIB(ssl, SSL_connect)
1713 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1714 dnl still no SSL_connect
1723 dnl Have the libraries--check for OpenSSL headers
1724 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1725 openssl/pem.h openssl/ssl.h openssl/err.h,
1727 test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1729 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1731 if test $ac_cv_header_openssl_x509_h = no; then
1732 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1733 dnl since 'err.h' might in fact find a krb4 header with the same
1735 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1737 if test $ac_cv_header_x509_h = yes &&
1738 test $ac_cv_header_crypto_h = yes &&
1739 test $ac_cv_header_ssl_h = yes; then
1747 if test X"$OPENSSL_ENABLED" != X"1"; then
1751 if test X"$OPT_SSL" != Xoff &&
1752 test "$OPENSSL_ENABLED" != "1"; then
1753 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1757 if test X"$OPENSSL_ENABLED" = X"1"; then
1758 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
1759 dnl stuff, it is kind of "separated" from the main SSL check
1760 AC_CHECK_FUNC(ENGINE_init,
1762 AC_CHECK_HEADERS(openssl/engine.h)
1763 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
1766 dnl These can only exist if OpenSSL exists
1767 dnl Older versions of Cyassl (some time before 2.9.4) don't have
1768 dnl SSL_get_shutdown (but this check won't actually detect it there
1769 dnl as it's a macro that needs the header files be included)
1771 AC_CHECK_FUNCS( RAND_egd \
1774 SSLv2_client_method )
1776 AC_MSG_CHECKING([for BoringSSL])
1779 #include <openssl/base.h>
1781 #ifndef OPENSSL_IS_BORINGSSL
1782 #error not boringssl
1786 AC_MSG_RESULT([yes])
1787 AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
1788 [Define to 1 if using BoringSSL.])
1794 AC_MSG_CHECKING([for libressl])
1797 #include <openssl/opensslv.h>
1799 int dummy = LIBRESSL_VERSION_NUMBER;
1802 AC_MSG_RESULT([yes])
1803 AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1,
1804 [Define to 1 if using libressl.])
1811 if test "$OPENSSL_ENABLED" = "1"; then
1812 if test -n "$LIB_OPENSSL"; then
1813 dnl when the ssl shared libs were found in a path that the run-time
1814 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1815 dnl to prevent further configure tests to fail due to this
1816 if test "x$cross_compiling" != "xyes"; then
1817 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
1818 export LD_LIBRARY_PATH
1819 AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
1822 CURL_CHECK_OPENSSL_API
1825 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1828 dnl **********************************************************************
1829 dnl Check for the random seed preferences
1830 dnl **********************************************************************
1832 if test X"$OPENSSL_ENABLED" = X"1"; then
1833 AC_ARG_WITH(egd-socket,
1834 AC_HELP_STRING([--with-egd-socket=FILE],
1835 [Entropy Gathering Daemon socket pathname]),
1836 [ EGD_SOCKET="$withval" ]
1838 if test -n "$EGD_SOCKET" ; then
1839 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1840 [your Entropy Gathering Daemon socket pathname] )
1843 dnl Check for user-specified random device
1845 AC_HELP_STRING([--with-random=FILE],
1846 [read randomness from FILE (default=/dev/urandom)]),
1847 [ RANDOM_FILE="$withval" ],
1849 if test x$cross_compiling != xyes; then
1850 dnl Check for random device
1851 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1853 AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
1857 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1858 AC_SUBST(RANDOM_FILE)
1859 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1860 [a suitable file to read random data from])
1865 dnl We require OpenSSL with SRP support.
1867 if test "$OPENSSL_ENABLED" = "1"; then
1868 AC_CHECK_LIB(crypto, SRP_Calc_client_key,
1870 AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
1871 AC_SUBST(HAVE_OPENSSL_SRP, [1])
1875 dnl ----------------------------------------------------
1876 dnl check for GnuTLS
1877 dnl ----------------------------------------------------
1879 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1882 AC_ARG_WITH(gnutls,dnl
1883 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
1884 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1885 OPT_GNUTLS=$withval)
1887 if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then
1890 if test X"$OPT_GNUTLS" != Xno; then
1898 if test "x$OPT_GNUTLS" = "xyes"; then
1899 dnl this is with no partiular path given
1900 CURL_CHECK_PKGCONFIG(gnutls)
1902 if test "$PKGCONFIG" != "no" ; then
1903 addlib=`$PKGCONFIG --libs-only-l gnutls`
1904 addld=`$PKGCONFIG --libs-only-L gnutls`
1905 addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1906 version=`$PKGCONFIG --modversion gnutls`
1907 gtlslib=`echo $addld | $SED -e 's/-L//'`
1909 dnl without pkg-config, we try libgnutls-config as that was how it
1911 check=`libgnutls-config --version 2>/dev/null`
1912 if test -n "$check"; then
1913 addlib=`libgnutls-config --libs`
1914 addcflags=`libgnutls-config --cflags`
1915 version=`libgnutls-config --version`
1916 gtlslib=`libgnutls-config --prefix`/lib$libsuff
1920 dnl this is with a given path, first check if there's a libgnutls-config
1921 dnl there and if not, make an educated guess
1922 cfg=$OPT_GNUTLS/bin/libgnutls-config
1923 check=`$cfg --version 2>/dev/null`
1924 if test -n "$check"; then
1925 addlib=`$cfg --libs`
1926 addcflags=`$cfg --cflags`
1927 version=`$cfg --version`
1928 gtlslib=`$cfg --prefix`/lib$libsuff
1930 dnl without pkg-config and libgnutls-config, we guess a lot!
1932 addld=-L$OPT_GNUTLS/lib$libsuff
1933 addcflags=-I$OPT_GNUTLS/include
1934 version="" # we just don't know
1935 gtlslib=$OPT_GNUTLS/lib$libsuff
1939 if test -z "$version"; then
1940 dnl lots of efforts, still no go
1944 if test -n "$addlib"; then
1947 CLEANCPPFLAGS="$CPPFLAGS"
1948 CLEANLDFLAGS="$LDFLAGS"
1950 LIBS="$addlib $LIBS"
1951 LDFLAGS="$LDFLAGS $addld"
1952 if test "$addcflags" != "-I/usr/include"; then
1953 CPPFLAGS="$CPPFLAGS $addcflags"
1956 AC_CHECK_LIB(gnutls, gnutls_check_version,
1958 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1959 AC_SUBST(USE_GNUTLS, [1])
1963 test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1967 CPPFLAGS="$CLEANCPPFLAGS"
1970 if test "x$USE_GNUTLS" = "xyes"; then
1971 AC_MSG_NOTICE([detected GnuTLS version $version])
1973 if test -n "$gtlslib"; then
1974 dnl when shared libs were found in a path that the run-time
1975 dnl linker doesn't search through, we need to add it to
1976 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1978 if test "x$cross_compiling" != "xyes"; then
1979 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
1980 export LD_LIBRARY_PATH
1981 AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
1984 AC_CHECK_FUNCS([gnutls_certificate_set_x509_key_file2 gnutls_alpn_set_protocols gnutls_ocsp_req_init])
1989 fi dnl GNUTLS not disabled
1991 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1995 dnl Check which crypto backend GnuTLS uses
1998 if test "$GNUTLS_ENABLED" = "1"; then
2000 # First check if we can detect either crypto library via transitive linking
2001 AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2002 if test "$USE_GNUTLS_NETTLE" = ""; then
2003 AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2005 # If not, try linking directly to both of them to see if they are available
2006 if test "$USE_GNUTLS_NETTLE" = ""; then
2007 AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2009 if test "$USE_GNUTLS_NETTLE" = ""; then
2010 AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2012 if test "$USE_GNUTLS_NETTLE" = ""; then
2013 AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
2015 if test "$USE_GNUTLS_NETTLE" = "1"; then
2016 AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
2017 AC_SUBST(USE_GNUTLS_NETTLE, [1])
2018 LIBS="-lnettle $LIBS"
2020 LIBS="-lgcrypt $LIBS"
2025 dnl We require GnuTLS with SRP support.
2027 if test "$GNUTLS_ENABLED" = "1"; then
2028 AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
2030 AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
2031 AC_SUBST(HAVE_GNUTLS_SRP, [1])
2035 dnl ----------------------------------------------------
2036 dnl check for PolarSSL
2037 dnl ----------------------------------------------------
2039 dnl Default to compiler & linker defaults for PolarSSL files & libraries.
2044 AC_ARG_WITH(polarssl,dnl
2045 AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root])
2046 AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
2047 OPT_POLARSSL=$withval)
2049 if test -z "$ssl_backends" -o "x$OPT_POLARSSL" != xno; then
2052 if test X"$OPT_POLARSSL" != Xno; then
2054 if test "$OPT_POLARSSL" = "yes"; then
2058 if test -z "$OPT_POLARSSL" ; then
2059 dnl check for lib first without setting any new path
2061 AC_CHECK_LIB(polarssl, havege_init,
2062 dnl libpolarssl found, set the variable
2064 AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
2065 AC_SUBST(USE_POLARSSL, [1])
2069 test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2078 if test "x$USE_POLARSSL" != "xyes"; then
2079 dnl add the path and test again
2080 addld=-L$OPT_POLARSSL/lib$libsuff
2081 addcflags=-I$OPT_POLARSSL/include
2082 polarssllib=$OPT_POLARSSL/lib$libsuff
2084 LDFLAGS="$LDFLAGS $addld"
2085 if test "$addcflags" != "-I/usr/include"; then
2086 CPPFLAGS="$CPPFLAGS $addcflags"
2089 AC_CHECK_LIB(polarssl, ssl_init,
2091 AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
2092 AC_SUBST(USE_POLARSSL, [1])
2096 test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2104 if test "x$USE_POLARSSL" = "xyes"; then
2105 AC_MSG_NOTICE([detected PolarSSL])
2107 LIBS="-lpolarssl $LIBS"
2109 if test -n "$polarssllib"; then
2110 dnl when shared libs were found in a path that the run-time
2111 dnl linker doesn't search through, we need to add it to
2112 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2114 if test "x$cross_compiling" != "xyes"; then
2115 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
2116 export LD_LIBRARY_PATH
2117 AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
2122 fi dnl PolarSSL not disabled
2124 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2127 dnl ----------------------------------------------------
2128 dnl check for mbedTLS
2129 dnl ----------------------------------------------------
2135 AC_ARG_WITH(mbedtls,dnl
2136 AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root])
2137 AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]),
2138 OPT_MBEDTLS=$withval)
2140 if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then
2143 if test X"$OPT_MBEDTLS" != Xno; then
2145 if test "$OPT_MBEDTLS" = "yes"; then
2149 if test -z "$OPT_MBEDTLS" ; then
2150 dnl check for lib first without setting any new path
2152 AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
2153 dnl libmbedtls found, set the variable
2155 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2156 AC_SUBST(USE_MBEDTLS, [1])
2160 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2161 ], [], -lmbedx509 -lmbedcrypto)
2169 if test "x$USE_MBEDTLS" != "xyes"; then
2170 dnl add the path and test again
2171 addld=-L$OPT_MBEDTLS/lib$libsuff
2172 addcflags=-I$OPT_MBEDTLS/include
2173 mbedtlslib=$OPT_MBEDTLS/lib$libsuff
2175 LDFLAGS="$LDFLAGS $addld"
2176 if test "$addcflags" != "-I/usr/include"; then
2177 CPPFLAGS="$CPPFLAGS $addcflags"
2180 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
2182 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2183 AC_SUBST(USE_MBEDTLS, [1])
2187 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2192 ], -lmbedx509 -lmbedcrypto)
2195 if test "x$USE_MBEDTLS" = "xyes"; then
2196 AC_MSG_NOTICE([detected mbedTLS])
2198 LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS"
2200 if test -n "$mbedtlslib"; then
2201 dnl when shared libs were found in a path that the run-time
2202 dnl linker doesn't search through, we need to add it to
2203 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2205 if test "x$cross_compiling" != "xyes"; then
2206 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mbedtlslib"
2207 export LD_LIBRARY_PATH
2208 AC_MSG_NOTICE([Added $mbedtlslib to LD_LIBRARY_PATH])
2213 fi dnl mbedTLS not disabled
2215 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2218 dnl ----------------------------------------------------
2219 dnl check for CyaSSL
2220 dnl ----------------------------------------------------
2222 dnl Default to compiler & linker defaults for CyaSSL files & libraries.
2227 AC_ARG_WITH(cyassl,dnl
2228 AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)])
2229 AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
2230 OPT_CYASSL=$withval)
2232 if test -z "$ssl_backends" -o "x$OPT_CYASSL" != xno; then
2235 if test X"$OPT_CYASSL" != Xno; then
2237 if test "$OPT_CYASSL" = "yes"; then
2241 dnl This should be reworked to use pkg-config instead
2243 cyassllibname=cyassl
2245 if test -z "$OPT_CYASSL" ; then
2246 dnl check for lib in system default first
2248 AC_CHECK_LIB(cyassl, CyaSSL_Init,
2249 dnl libcyassl found, set the variable
2251 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
2252 AC_SUBST(USE_CYASSL, [1])
2256 test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2265 if test "x$USE_CYASSL" != "xyes"; then
2266 dnl add the path and test again
2267 addld=-L$OPT_CYASSL/lib$libsuff
2268 addcflags=-I$OPT_CYASSL/include
2269 cyassllib=$OPT_CYASSL/lib$libsuff
2271 LDFLAGS="$LDFLAGS $addld"
2272 if test "$addcflags" != "-I/usr/include"; then
2273 CPPFLAGS="$CPPFLAGS $addcflags"
2276 AC_CHECK_LIB(cyassl, CyaSSL_Init,
2278 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
2279 AC_SUBST(USE_CYASSL, [1])
2283 test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2296 if test "x$USE_CYASSL" != "xyes"; then
2297 dnl libcyassl renamed to libwolfssl as of 3.4.0
2298 addld=-L$OPT_CYASSL/lib$libsuff
2299 addcflags=-I$OPT_CYASSL/include
2300 cyassllib=$OPT_CYASSL/lib$libsuff
2302 LDFLAGS="$LDFLAGS $addld"
2303 if test "$addcflags" != "-I/usr/include"; then
2304 CPPFLAGS="$CPPFLAGS $addcflags"
2307 cyassllibname=wolfssl
2308 my_ac_save_LIBS="$LIBS"
2309 LIBS="-l$cyassllibname -lm $LIBS"
2311 AC_MSG_CHECKING([for CyaSSL_Init in -lwolfssl])
2314 /* These aren't needed for detection and confuse WolfSSL.
2315 They are set up properly later if it is detected. */
2317 #undef SIZEOF_LONG_LONG
2318 #include <cyassl/ssl.h>
2320 return CyaSSL_Init();
2324 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL/WolfSSL is enabled])
2325 AC_SUBST(USE_CYASSL, [1])
2329 test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2337 LIBS="$my_ac_save_LIBS"
2340 if test "x$USE_CYASSL" = "xyes"; then
2341 AC_MSG_NOTICE([detected $cyassllibname])
2343 dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
2344 AC_CHECK_SIZEOF(long long)
2346 dnl Versions since at least 2.6.0 may have options.h
2347 AC_CHECK_HEADERS(cyassl/options.h)
2349 dnl Versions since at least 2.9.4 renamed error.h to error-ssl.h
2350 AC_CHECK_HEADERS(cyassl/error-ssl.h)
2352 LIBS="-l$cyassllibname -lm $LIBS"
2354 if test "x$cyassllibname" = "xwolfssl"; then
2355 dnl Recent WolfSSL versions build without SSLv3 by default
2356 dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
2357 AC_CHECK_FUNCS(wolfSSLv3_client_method \
2358 wolfSSL_CTX_UseSupportedCurve \
2359 wolfSSL_get_peer_certificate \
2362 dnl Cyassl needs configure --enable-opensslextra to have *get_peer*
2363 AC_CHECK_FUNCS(CyaSSL_CTX_UseSupportedCurve \
2364 CyaSSL_get_peer_certificate)
2367 if test -n "$cyassllib"; then
2368 dnl when shared libs were found in a path that the run-time
2369 dnl linker doesn't search through, we need to add it to
2370 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2372 if test "x$cross_compiling" != "xyes"; then
2373 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib"
2374 export LD_LIBRARY_PATH
2375 AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH])
2381 fi dnl CyaSSL not disabled
2383 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2386 dnl ----------------------------------------------------
2387 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
2388 dnl ----------------------------------------------------
2390 dnl Default to compiler & linker defaults for NSS files & libraries.
2394 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
2395 AC_HELP_STRING([--without-nss], [disable NSS detection]),
2398 if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then
2401 if test X"$OPT_NSS" != Xno; then
2409 if test "x$OPT_NSS" = "xyes"; then
2411 CURL_CHECK_PKGCONFIG(nss)
2413 if test "$PKGCONFIG" != "no" ; then
2414 addlib=`$PKGCONFIG --libs nss`
2415 addcflags=`$PKGCONFIG --cflags nss`
2416 version=`$PKGCONFIG --modversion nss`
2417 nssprefix=`$PKGCONFIG --variable=prefix nss`
2419 dnl Without pkg-config, we check for nss-config
2421 check=`nss-config --version 2>/dev/null`
2422 if test -n "$check"; then
2423 addlib=`nss-config --libs`
2424 addcflags=`nss-config --cflags`
2425 version=`nss-config --version`
2426 nssprefix=`nss-config --prefix`
2434 NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
2435 if test -f "$NSS_PCDIR/nss.pc"; then
2436 CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
2437 if test "$PKGCONFIG" != "no" ; then
2438 addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
2439 addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
2440 addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
2441 version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
2442 nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
2447 if test -z "$addlib"; then
2448 # Without pkg-config, we'll kludge in some defaults
2449 AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
2450 addld="-L$OPT_NSS/lib"
2451 addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
2452 addcflags="-I$OPT_NSS/include"
2457 CLEANLDFLAGS="$LDFLAGS"
2459 CLEANCPPFLAGS="$CPPFLAGS"
2461 LDFLAGS="$addld $LDFLAGS"
2462 LIBS="$addlib $LIBS"
2463 if test "$addcflags" != "-I/usr/include"; then
2464 CPPFLAGS="$CPPFLAGS $addcflags"
2467 dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
2468 AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
2470 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
2471 AC_SUBST(USE_NSS, [1])
2475 test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2478 LDFLAGS="$CLEANLDFLAGS"
2480 CPPFLAGS="$CLEANCPPFLAGS"
2483 if test "x$USE_NSS" = "xyes"; then
2484 AC_MSG_NOTICE([detected NSS version $version])
2486 dnl PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
2487 dnl PK11_DestroyGenericObject() does not release resources allocated by
2488 dnl PK11_CreateGenericObject() early enough.
2489 AC_CHECK_FUNC(PK11_CreateManagedGenericObject,
2491 AC_DEFINE(HAVE_PK11_CREATEMANAGEDGENERICOBJECT, 1,
2492 [if you have the PK11_CreateManagedGenericObject function])
2495 dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
2497 AC_SUBST([NSS_LIBS])
2499 dnl when shared libs were found in a path that the run-time
2500 dnl linker doesn't search through, we need to add it to
2501 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2503 if test "x$cross_compiling" != "xyes"; then
2504 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
2505 export LD_LIBRARY_PATH
2506 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
2511 fi dnl NSS not disabled
2513 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2518 AC_ARG_WITH(axtls,dnl
2519 AC_HELP_STRING([--with-axtls=PATH],[Where to look for axTLS, PATH points to the axTLS installation prefix (default: /usr/local). Ignored if another SSL engine is selected.])
2520 AC_HELP_STRING([--without-axtls], [disable axTLS]),
2523 if test -z "$ssl_backends" -o "x$OPT_AXTLS" != xno; then
2525 if test X"$OPT_AXTLS" != Xno; then
2526 dnl backup the pre-axtls variables
2527 CLEANLDFLAGS="$LDFLAGS"
2528 CLEANCPPFLAGS="$CPPFLAGS"
2531 case "$OPT_AXTLS" in
2533 dnl --with-axtls (without path) used
2534 PREFIX_AXTLS=/usr/local
2535 LIB_AXTLS="$PREFIX_AXTLS/lib"
2536 LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
2537 CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
2540 dnl no --with-axtls option given, just check default places
2544 dnl check the given --with-axtls spot
2545 PREFIX_AXTLS=$OPT_AXTLS
2546 LIB_AXTLS="$PREFIX_AXTLS/lib"
2547 LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
2548 CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
2552 AC_CHECK_LIB(axtls, ssl_version,[
2553 LIBS="-laxtls $LIBS"
2554 AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled])
2555 AC_SUBST(USE_AXTLS, [1])
2559 test axtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2561 if test "x$cross_compiling" != "xyes"; then
2562 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS"
2563 export LD_LIBRARY_PATH
2564 AC_MSG_NOTICE([Added $LIB_AXTLS to LD_LIBRARY_PATH])
2567 LDFLAGS="$CLEANLDFLAGS"
2568 CPPFLAGS="$CLEANCPPFLAGS"
2572 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2575 case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$MBEDTLS_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" in
2577 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
2578 AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.])
2581 # one SSL backend is enabled
2582 AC_SUBST(SSL_ENABLED)
2584 AC_MSG_NOTICE([built with one SSL backend])
2587 # more than one SSL backend is enabled
2588 AC_SUBST(SSL_ENABLED)
2590 AC_SUBST(CURL_WITH_MULTI_SSL)
2591 CURL_WITH_MULTI_SSL="1"
2592 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
2593 AC_MSG_NOTICE([built with multiple SSL backends])
2597 if test -n "$ssl_backends"; then
2598 curl_ssl_msg="enabled ($ssl_backends)"
2601 if test no = "$VALID_DEFAULT_SSL_BACKEND"
2603 if test -n "$SSL_ENABLED"
2605 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
2607 AC_MSG_ERROR([Default SSL backend requires SSL!])
2609 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
2611 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
2614 dnl **********************************************************************
2615 dnl Check for the CA bundle
2616 dnl **********************************************************************
2618 CURL_CHECK_CA_BUNDLE
2620 dnl **********************************************************************
2621 dnl Check for libpsl
2622 dnl **********************************************************************
2625 AS_HELP_STRING([--without-libpsl],
2626 [disable support for libpsl cookie checking]),
2627 with_libpsl=$withval,
2629 if test $with_libpsl != "no"; then
2630 AC_SEARCH_LIBS(psl_builtin, psl,
2631 [curl_psl_msg="yes";
2632 AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
2634 [curl_psl_msg="no (libpsl not found)";
2635 AC_MSG_WARN([libpsl was not found])
2639 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "yes"])
2641 dnl **********************************************************************
2642 dnl Check for libmetalink
2643 dnl **********************************************************************
2647 AC_ARG_WITH(libmetalink,dnl
2648 AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
2649 AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
2650 OPT_LIBMETALINK=$withval)
2652 if test X"$OPT_LIBMETALINK" != Xno; then
2661 if test "x$OPT_LIBMETALINK" = "xyes"; then
2662 dnl this is with no partiular path given
2664 CURL_CHECK_PKGCONFIG(libmetalink)
2666 dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
2667 LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
2668 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
2669 if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
2672 if test "$PKGTEST" = "yes"; then
2673 CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
2676 if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
2677 addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2678 $PKGCONFIG --libs-only-l libmetalink`
2679 addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2680 $PKGCONFIG --libs-only-L libmetalink`
2681 addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2682 $PKGCONFIG --cflags-only-I libmetalink`
2683 version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2684 $PKGCONFIG --modversion libmetalink`
2685 libmetalinklib=`echo $addld | $SED -e 's/-L//'`
2687 if test -n "$addlib"; then
2689 clean_CPPFLAGS="$CPPFLAGS"
2690 clean_LDFLAGS="$LDFLAGS"
2692 CPPFLAGS="$clean_CPPFLAGS $addcflags"
2693 LDFLAGS="$clean_LDFLAGS $addld"
2694 LIBS="$addlib $clean_LIBS"
2695 AC_MSG_CHECKING([if libmetalink is recent enough])
2698 # include <metalink/metalink.h>
2700 if(0 != metalink_strerror(0)) /* added in 0.1.0 */
2704 AC_MSG_RESULT([yes ($version)])
2707 AC_MSG_RESULT([no ($version)])
2708 AC_MSG_NOTICE([libmetalink library defective or too old])
2711 CPPFLAGS="$clean_CPPFLAGS"
2712 LDFLAGS="$clean_LDFLAGS"
2714 if test "$want_metalink" = "yes"; then
2715 dnl finally libmetalink will be used
2716 AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
2717 LIBMETALINK_LIBS=$addlib
2718 LIBMETALINK_LDFLAGS=$addld
2719 LIBMETALINK_CPPFLAGS=$addcflags
2720 AC_SUBST([LIBMETALINK_LIBS])
2721 AC_SUBST([LIBMETALINK_LDFLAGS])
2722 AC_SUBST([LIBMETALINK_CPPFLAGS])
2723 curl_mtlnk_msg="enabled"
2729 dnl **********************************************************************
2730 dnl Check for the presence of LIBSSH2 libraries and headers
2731 dnl **********************************************************************
2733 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
2735 AC_ARG_WITH(libssh2,dnl
2736 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])
2737 AC_HELP_STRING([--with-libssh2], [enable LIBSSH2]),
2738 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
2742 AC_ARG_WITH(libssh,dnl
2743 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])
2744 AC_HELP_STRING([--with-libssh], [enable LIBSSH]),
2745 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2747 if test X"$OPT_LIBSSH2" != Xno; then
2748 dnl backup the pre-libssh2 variables
2749 CLEANLDFLAGS="$LDFLAGS"
2750 CLEANCPPFLAGS="$CPPFLAGS"
2753 case "$OPT_LIBSSH2" in
2755 dnl --with-libssh2 (without path) used
2756 CURL_CHECK_PKGCONFIG(libssh2)
2758 if test "$PKGCONFIG" != "no" ; then
2759 LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
2760 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2761 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2762 version=`$PKGCONFIG --modversion libssh2`
2763 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
2768 dnl no --with-libssh2 option given, just check default places
2771 dnl use the given --with-libssh2 spot
2772 PREFIX_SSH2=$OPT_LIBSSH2
2776 dnl if given with a prefix, we set -L and -I based on that
2777 if test -n "$PREFIX_SSH2"; then
2779 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2780 CPP_SSH2=-I${PREFIX_SSH2}/include
2781 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2784 LDFLAGS="$LDFLAGS $LD_SSH2"
2785 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2786 LIBS="$LIB_SSH2 $LIBS"
2788 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
2790 AC_CHECK_HEADERS(libssh2.h,
2791 curl_ssh_msg="enabled (libSSH2)"
2793 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2794 AC_SUBST(USE_LIBSSH2, [1])
2797 if test X"$OPT_LIBSSH2" != Xoff &&
2798 test "$LIBSSH2_ENABLED" != "1"; then
2799 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2802 if test "$LIBSSH2_ENABLED" = "1"; then
2803 if test -n "$DIR_SSH2"; then
2804 dnl when the libssh2 shared libs were found in a path that the run-time
2805 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
2806 dnl to prevent further configure tests to fail due to this
2808 if test "x$cross_compiling" != "xyes"; then
2809 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
2810 export LD_LIBRARY_PATH
2811 AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH])
2815 dnl no libssh2, revert back to clean variables
2816 LDFLAGS=$CLEANLDFLAGS
2817 CPPFLAGS=$CLEANCPPFLAGS
2820 elif test X"$OPT_LIBSSH" != Xno; then
2821 dnl backup the pre-libssh variables
2822 CLEANLDFLAGS="$LDFLAGS"
2823 CLEANCPPFLAGS="$CPPFLAGS"
2826 case "$OPT_LIBSSH" in
2828 dnl --with-libssh (without path) used
2829 CURL_CHECK_PKGCONFIG(libssh)
2831 if test "$PKGCONFIG" != "no" ; then
2832 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2833 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2834 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2835 version=`$PKGCONFIG --modversion libssh`
2836 DIR_SSH=`echo $LD_SSH | $SED -e 's/-L//'`
2841 dnl no --with-libssh option given, just check default places
2844 dnl use the given --with-libssh spot
2845 PREFIX_SSH=$OPT_LIBSSH
2849 dnl if given with a prefix, we set -L and -I based on that
2850 if test -n "$PREFIX_SSH"; then
2852 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2853 CPP_SSH=-I${PREFIX_SSH}/include
2854 DIR_SSH=${PREFIX_SSH}/lib$libsuff
2857 LDFLAGS="$LDFLAGS $LD_SSH"
2858 CPPFLAGS="$CPPFLAGS $CPP_SSH"
2859 LIBS="$LIB_SSH $LIBS"
2861 AC_CHECK_LIB(ssh, ssh_new)
2863 AC_CHECK_HEADERS(libssh/libssh.h,
2864 curl_ssh_msg="enabled (libSSH)"
2866 AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
2867 AC_SUBST(USE_LIBSSH, [1])
2870 if test X"$OPT_LIBSSH" != Xoff &&
2871 test "$LIBSSH_ENABLED" != "1"; then
2872 AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
2875 if test "$LIBSSH_ENABLED" = "1"; then
2876 if test -n "$DIR_SSH"; then
2877 dnl when the libssh shared libs were found in a path that the run-time
2878 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
2879 dnl to prevent further configure tests to fail due to this
2881 if test "x$cross_compiling" != "xyes"; then
2882 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH"
2883 export LD_LIBRARY_PATH
2884 AC_MSG_NOTICE([Added $DIR_SSH to LD_LIBRARY_PATH])
2888 dnl no libssh, revert back to clean variables
2889 LDFLAGS=$CLEANLDFLAGS
2890 CPPFLAGS=$CLEANCPPFLAGS
2895 dnl **********************************************************************
2896 dnl Check for the presence of LIBRTMP libraries and headers
2897 dnl **********************************************************************
2899 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2901 AC_ARG_WITH(librtmp,dnl
2902 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])
2903 AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2904 OPT_LIBRTMP=$withval)
2906 if test X"$OPT_LIBRTMP" != Xno; then
2907 dnl backup the pre-librtmp variables
2908 CLEANLDFLAGS="$LDFLAGS"
2909 CLEANCPPFLAGS="$CPPFLAGS"
2912 case "$OPT_LIBRTMP" in
2914 dnl --with-librtmp (without path) used
2915 CURL_CHECK_PKGCONFIG(librtmp)
2917 if test "$PKGCONFIG" != "no" ; then
2918 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2919 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2920 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2921 version=`$PKGCONFIG --modversion librtmp`
2922 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
2924 dnl To avoid link errors, we do not allow --librtmp without
2925 dnl a pkgconfig file
2926 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2931 dnl no --with-librtmp option given, just check default places
2935 dnl use the given --with-librtmp spot
2937 PREFIX_RTMP=$OPT_LIBRTMP
2941 dnl if given with a prefix, we set -L and -I based on that
2942 if test -n "$PREFIX_RTMP"; then
2943 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
2944 CPP_RTMP=-I${PREFIX_RTMP}/include
2945 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
2948 LDFLAGS="$LDFLAGS $LD_RTMP"
2949 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2950 LIBS="$LIB_RTMP $LIBS"
2952 AC_CHECK_LIB(rtmp, RTMP_Init,
2954 AC_CHECK_HEADERS(librtmp/rtmp.h,
2955 curl_rtmp_msg="enabled (librtmp)"
2957 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
2958 AC_SUBST(USE_LIBRTMP, [1])
2961 dnl not found, revert back to clean variables
2962 LDFLAGS=$CLEANLDFLAGS
2963 CPPFLAGS=$CLEANCPPFLAGS
2967 if test X"$OPT_LIBRTMP" != Xoff &&
2968 test "$LIBRTMP_ENABLED" != "1"; then
2969 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
2974 dnl **********************************************************************
2975 dnl Check for linker switch for versioned symbols
2976 dnl **********************************************************************
2978 versioned_symbols_flavour=
2979 AC_MSG_CHECKING([whether versioned symbols are wanted])
2980 AC_ARG_ENABLE(versioned-symbols,
2981 AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2982 AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2983 [ case "$enableval" in
2984 yes) AC_MSG_RESULT(yes)
2985 AC_MSG_CHECKING([if libraries can be versioned])
2986 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
2987 if test -z "$GLD"; then
2989 AC_MSG_WARN([You need an ld version supporting the --version-script option])
2992 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
2993 versioned_symbols_flavour="MULTISSL_"
2994 elif test "x$OPENSSL_ENABLED" = "x1"; then
2995 versioned_symbols_flavour="OPENSSL_"
2996 elif test "x$GNUTLS_ENABLED" = "x1"; then
2997 versioned_symbols_flavour="GNUTLS_"
2998 elif test "x$NSS_ENABLED" = "x1"; then
2999 versioned_symbols_flavour="NSS_"
3000 elif test "x$POLARSSL_ENABLED" = "x1"; then
3001 versioned_symbols_flavour="POLARSSL_"
3002 elif test "x$CYASSL_ENABLED" = "x1"; then
3003 versioned_symbols_flavour="CYASSL_"
3004 elif test "x$AXTLS_ENABLED" = "x1"; then
3005 versioned_symbols_flavour="AXTLS_"
3006 elif test "x$WINSSL_ENABLED" = "x1"; then
3007 versioned_symbols_flavour="WINSSL_"
3008 elif test "x$DARWINSSL_ENABLED" = "x1"; then
3009 versioned_symbols_flavour="DARWINSSL_"
3011 versioned_symbols_flavour=""
3013 versioned_symbols="yes"
3017 *) AC_MSG_RESULT(no)
3025 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
3026 ["$versioned_symbols_flavour"])
3027 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
3028 [test "x$versioned_symbols" = 'xyes'])
3030 dnl -------------------------------------------------
3031 dnl check winidn option before other IDN libraries
3032 dnl -------------------------------------------------
3034 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
3035 OPT_WINIDN="default"
3037 AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
3038 AC_HELP_STRING([--without-winidn], [disable Windows native IDN]),
3039 OPT_WINIDN=$withval)
3040 case "$OPT_WINIDN" in
3042 dnl --without-winidn option used or configure option not specified
3047 dnl --with-winidn option used without path
3049 want_winidn_path="default"
3050 AC_MSG_RESULT([yes])
3053 dnl --with-winidn option used with path
3055 want_winidn_path="$withval"
3056 AC_MSG_RESULT([yes ($withval)])
3060 if test "$want_winidn" = "yes"; then
3061 dnl winidn library support has been requested
3062 clean_CPPFLAGS="$CPPFLAGS"
3063 clean_LDFLAGS="$LDFLAGS"
3065 WINIDN_LIBS="-lnormaliz"
3066 WINIDN_CPPFLAGS="-DWINVER=0x0600"
3068 if test "$want_winidn_path" != "default"; then
3069 dnl path has been specified
3070 dnl pkg-config not available or provides no info
3071 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
3072 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
3073 WINIDN_DIR="$want_winidn_path/lib$libsuff"
3076 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
3077 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
3078 LIBS="$WINIDN_LIBS $LIBS"
3080 AC_MSG_CHECKING([if IdnToUnicode can be linked])
3083 #include <windows.h>
3085 IdnToUnicode(0, NULL, 0, NULL, 0);
3088 AC_MSG_RESULT([yes])
3089 tst_links_winidn="yes"
3092 tst_links_winidn="no"
3095 if test "$tst_links_winidn" = "yes"; then
3096 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
3097 AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
3098 AC_SUBST([IDN_ENABLED], [1])
3099 curl_idn_msg="enabled (Windows-native)"
3101 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3102 CPPFLAGS="$clean_CPPFLAGS"
3103 LDFLAGS="$clean_LDFLAGS"
3108 dnl **********************************************************************
3109 dnl Check for the presence of IDN libraries and headers
3110 dnl **********************************************************************
3112 AC_MSG_CHECKING([whether to build with libidn2])
3114 AC_ARG_WITH(libidn2,
3115 AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
3116 AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
3120 dnl --without-libidn2 option used
3125 dnl configure option not specified
3127 want_idn_path="default"
3128 AC_MSG_RESULT([(assumed) yes])
3131 dnl --with-libidn2 option used without path
3133 want_idn_path="default"
3134 AC_MSG_RESULT([yes])
3137 dnl --with-libidn2 option used with path
3139 want_idn_path="$withval"
3140 AC_MSG_RESULT([yes ($withval)])
3144 if test "$want_idn" = "yes"; then
3145 dnl idn library support has been requested
3146 clean_CPPFLAGS="$CPPFLAGS"
3147 clean_LDFLAGS="$LDFLAGS"
3151 if test "$want_idn_path" != "default"; then
3152 dnl path has been specified
3153 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3154 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
3155 if test "$PKGCONFIG" != "no"; then
3156 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3157 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3158 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3159 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3160 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3161 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3162 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3164 dnl pkg-config not available or provides no info
3166 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3167 IDN_CPPFLAGS="-I$want_idn_path/include"
3168 IDN_DIR="$want_idn_path/lib$libsuff"
3171 dnl path not specified
3172 CURL_CHECK_PKGCONFIG(libidn2)
3173 if test "$PKGCONFIG" != "no"; then
3174 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3175 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3176 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3177 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3179 dnl pkg-config not available or provides no info
3184 if test "$PKGCONFIG" != "no"; then
3185 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3186 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3187 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3188 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3190 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3191 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3192 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3193 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3196 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
3197 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
3198 LIBS="$IDN_LIBS $LIBS"
3200 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
3202 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
3204 AC_MSG_RESULT([yes])
3205 tst_links_libidn="yes"
3208 tst_links_libidn="no"
3211 AC_CHECK_HEADERS( idn2.h )
3213 if test "$tst_links_libidn" = "yes"; then
3214 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
3215 dnl different versions of libidn have different setups of these:
3217 AC_SUBST([IDN_ENABLED], [1])
3218 curl_idn_msg="enabled (libidn2)"
3219 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3220 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
3221 export LD_LIBRARY_PATH
3222 AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
3225 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3226 CPPFLAGS="$clean_CPPFLAGS"
3227 LDFLAGS="$clean_LDFLAGS"
3233 dnl Let's hope this split URL remains working:
3234 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
3235 dnl genprogc/thread_quick_ref.htm
3237 dnl **********************************************************************
3238 dnl Check for ICU-UC (IDN support)
3239 dnl **********************************************************************
3241 AC_MSG_CHECKING([whether to build with icu-uc])
3244 AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
3245 AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
3249 dnl --without-icu-uc option used
3254 dnl configure option not specified
3256 want_idn_path="default"
3257 AC_MSG_RESULT([(assumed) yes])
3260 dnl --with-icu-uc option used without path
3262 want_idn_path="default"
3263 AC_MSG_RESULT([yes])
3266 dnl --with-icu-uc option used with path
3268 want_idn_path="$withval"
3269 AC_MSG_RESULT([yes ($withval)])
3273 if test "$want_idn" = "yes"; then
3274 dnl idn library support has been requested
3275 clean_CPPFLAGS="$CPPFLAGS"
3276 clean_LDFLAGS="$LDFLAGS"
3280 if test "$want_idn_path" != "default"; then
3281 dnl path has been specified
3282 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3283 CURL_CHECK_PKGCONFIG(icu-uc, [$IDN_PCDIR])
3284 if test "$PKGCONFIG" != "no"; then
3285 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3286 $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
3287 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3288 $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
3289 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3290 $PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
3291 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3293 dnl pkg-config not available or provides no info
3295 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3296 IDN_CPPFLAGS="-I$want_idn_path/include"
3297 IDN_DIR="$want_idn_path/lib$libsuff"
3300 dnl path not specified
3301 CURL_CHECK_PKGCONFIG(icu-uc)
3302 if test "$PKGCONFIG" != "no"; then
3303 IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
3304 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
3305 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
3306 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3308 dnl pkg-config not available or provides no info
3313 if test "$PKGCONFIG" != "no"; then
3314 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3315 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3316 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3317 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3319 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3320 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3321 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3322 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3325 CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
3326 LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
3327 LIBS="$IDN_LIBS $LIBS"
3329 AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
3331 AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
3333 AC_MSG_RESULT([yes])
3340 if test "$tst_links_icu" = "yes"; then
3341 AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
3342 dnl different versions of libidn have different setups of these:
3344 AC_SUBST([IDN_ENABLED], [1])
3345 curl_idn_msg="enabled (icu-uc)"
3346 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3347 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
3348 export LD_LIBRARY_PATH
3349 AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
3352 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3353 CPPFLAGS="$clean_CPPFLAGS"
3354 LDFLAGS="$clean_LDFLAGS"
3360 dnl Let's hope this split URL remains working:
3361 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
3362 dnl genprogc/thread_quick_ref.htm
3364 dnl **********************************************************************
3366 dnl **********************************************************************
3368 AC_ARG_ENABLE([dlp],
3369 AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
3371 AS_IF([test "x$enable_dlp" = "xyes"], [
3372 CPPFLAGS+=" -DUSE_TIZEN_FEATURE_DLP"
3375 AM_CONDITIONAL(USE_TIZEN_FEATURE_DLP, test "x$enable_dlp" = "xyes")
3378 dnl **********************************************************************
3379 dnl Check for nghttp2
3380 dnl **********************************************************************
3384 if test "x$disable_http" = "xyes"; then
3385 # without HTTP, nghttp2 is no use
3389 AC_ARG_WITH(nghttp2,
3390 AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
3391 AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
3395 dnl --without-nghttp2 option used
3399 dnl --with-nghttp2 option used without path
3404 dnl --with-nghttp2 option used with path
3406 want_h2_path="$withval/lib/pkgconfig"
3410 curl_h2_msg="disabled (--with-nghttp2)"
3411 if test X"$want_h2" != Xno; then
3412 dnl backup the pre-nghttp2 variables
3413 CLEANLDFLAGS="$LDFLAGS"
3414 CLEANCPPFLAGS="$CPPFLAGS"
3417 CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path)
3419 if test "$PKGCONFIG" != "no" ; then
3420 LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3421 $PKGCONFIG --libs-only-l libnghttp2`
3422 AC_MSG_NOTICE([-l is $LIB_H2])
3424 CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl
3425 $PKGCONFIG --cflags-only-I libnghttp2`
3426 AC_MSG_NOTICE([-I is $CPP_H2])
3428 LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3429 $PKGCONFIG --libs-only-L libnghttp2`
3430 AC_MSG_NOTICE([-L is $LD_H2])
3432 LDFLAGS="$LDFLAGS $LD_H2"
3433 CPPFLAGS="$CPPFLAGS $CPP_H2"
3434 LIBS="$LIB_H2 $LIBS"
3436 # use nghttp2_option_set_no_recv_client_magic to require nghttp2
3438 AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic,
3440 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
3441 curl_h2_msg="enabled (nghttp2)"
3443 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
3444 AC_SUBST(USE_NGHTTP2, [1])
3447 dnl not found, revert back to clean variables
3448 LDFLAGS=$CLEANLDFLAGS
3449 CPPFLAGS=$CLEANCPPFLAGS
3454 dnl no nghttp2 pkg-config found, deal with it
3455 if test X"$want_h2" != Xdefault; then
3456 dnl To avoid link errors, we do not allow --with-nghttp2 without
3457 dnl a pkgconfig file
3458 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
3464 dnl **********************************************************************
3465 dnl Check for zsh completion path
3466 dnl **********************************************************************
3468 OPT_ZSH_FPATH=default
3469 AC_ARG_WITH(zsh-functions-dir,
3470 AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3471 AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3472 [OPT_ZSH_FPATH=$withval])
3473 case "$OPT_ZSH_FPATH" in
3475 dnl --without-zsh-functions-dir option used
3478 dnl --with-zsh-functions-dir option used without path
3479 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3480 AC_SUBST(ZSH_FUNCTIONS_DIR)
3483 dnl --with-zsh-functions-dir option used with path
3484 ZSH_FUNCTIONS_DIR="$withval"
3485 AC_SUBST(ZSH_FUNCTIONS_DIR)
3489 dnl **********************************************************************
3490 dnl Back to "normal" configuring
3491 dnl **********************************************************************
3493 dnl Checks for header files.
3496 CURL_CHECK_HEADER_MALLOC
3497 CURL_CHECK_HEADER_MEMORY
3499 dnl Now check for the very most basic headers. Then we can use these
3500 dnl ones as default-headers when checking for the rest!
3544 dnl to do if not found
3548 dnl default includes
3550 #ifdef HAVE_SYS_TYPES_H
3551 #include <sys/types.h>
3553 #ifdef HAVE_SYS_TIME_H
3554 #include <sys/time.h>
3556 #ifdef HAVE_SYS_SELECT_H
3557 #include <sys/select.h>
3559 #ifdef HAVE_SYS_SOCKET_H
3560 #include <sys/socket.h>
3562 #ifdef HAVE_NETINET_IN_H
3563 #include <netinet/in.h>
3565 #ifdef HAVE_NETINET_IN6_H
3566 #include <netinet/in6.h>
3568 #ifdef HAVE_SYS_UN_H
3574 dnl Checks for typedefs, structures, and compiler characteristics.
3576 CURL_CHECK_VARIADIC_MACROS
3579 CURL_CHECK_STRUCT_TIMEVAL
3580 CURL_VERIFY_RUNTIMELIBS
3582 AC_CHECK_SIZEOF(size_t)
3583 AC_CHECK_SIZEOF(long)
3584 AC_CHECK_SIZEOF(int)
3585 AC_CHECK_SIZEOF(short)
3586 AC_CHECK_SIZEOF(time_t)
3587 AC_CHECK_SIZEOF(off_t)
3590 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3591 AC_CHECK_SIZEOF(curl_off_t, unused , [
3592 #include <curl/system.h>
3596 AC_CHECK_TYPE(long long,
3597 [AC_DEFINE(HAVE_LONGLONG, 1,
3598 [Define to 1 if the compiler supports the 'long long' data type.])]
3602 if test "xyes" = "x$longlong"; then
3603 AC_MSG_CHECKING([if numberLL works])
3607 long long val = 1000LL;
3610 AC_MSG_RESULT([yes])
3611 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
3619 AC_CHECK_TYPE(ssize_t, ,
3620 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3622 # check for bool type
3623 AC_CHECK_TYPE([bool],[
3624 AC_DEFINE(HAVE_BOOL_T, 1,
3625 [Define to 1 if bool is an available type.])
3627 #ifdef HAVE_SYS_TYPES_H
3628 #include <sys/types.h>
3630 #ifdef HAVE_STDBOOL_H
3631 #include <stdbool.h>
3635 AC_MSG_CHECKING([if time_t is unsigned])
3643 AC_MSG_RESULT([yes])
3644 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3648 dnl cross-compiling, most systems are unsigned
3652 CURL_CONFIGURE_CURL_SOCKLEN_T
3654 CURL_CONFIGURE_PULL_SYS_POLL
3658 TYPE_SOCKADDR_STORAGE
3664 CURL_CHECK_FUNC_SELECT
3666 CURL_CHECK_FUNC_RECV
3667 CURL_CHECK_FUNC_SEND
3668 CURL_CHECK_MSG_NOSIGNAL
3670 CURL_CHECK_FUNC_ALARM
3671 CURL_CHECK_FUNC_BASENAME
3672 CURL_CHECK_FUNC_CLOSESOCKET
3673 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3674 CURL_CHECK_FUNC_CONNECT
3675 CURL_CHECK_FUNC_FCNTL
3676 CURL_CHECK_FUNC_FDOPEN
3677 CURL_CHECK_FUNC_FREEADDRINFO
3678 CURL_CHECK_FUNC_FREEIFADDRS
3679 CURL_CHECK_FUNC_FSETXATTR
3680 CURL_CHECK_FUNC_FTRUNCATE
3681 CURL_CHECK_FUNC_GETADDRINFO
3682 CURL_CHECK_FUNC_GAI_STRERROR
3683 CURL_CHECK_FUNC_GETHOSTBYADDR
3684 CURL_CHECK_FUNC_GETHOSTBYADDR_R
3685 CURL_CHECK_FUNC_GETHOSTBYNAME
3686 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3687 CURL_CHECK_FUNC_GETHOSTNAME
3688 CURL_CHECK_FUNC_GETIFADDRS
3689 CURL_CHECK_FUNC_GETSERVBYPORT_R
3690 CURL_CHECK_FUNC_GMTIME_R
3691 CURL_CHECK_FUNC_INET_NTOA_R
3692 CURL_CHECK_FUNC_INET_NTOP
3693 CURL_CHECK_FUNC_INET_PTON
3694 CURL_CHECK_FUNC_IOCTL
3695 CURL_CHECK_FUNC_IOCTLSOCKET
3696 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3697 CURL_CHECK_FUNC_LOCALTIME_R
3698 CURL_CHECK_FUNC_MEMRCHR
3699 CURL_CHECK_FUNC_POLL
3700 CURL_CHECK_FUNC_SETSOCKOPT
3701 CURL_CHECK_FUNC_SIGACTION
3702 CURL_CHECK_FUNC_SIGINTERRUPT
3703 CURL_CHECK_FUNC_SIGNAL
3704 CURL_CHECK_FUNC_SIGSETJMP
3705 CURL_CHECK_FUNC_SOCKET
3706 CURL_CHECK_FUNC_SOCKETPAIR
3707 CURL_CHECK_FUNC_STRCASECMP
3708 CURL_CHECK_FUNC_STRCMPI
3709 CURL_CHECK_FUNC_STRDUP
3710 CURL_CHECK_FUNC_STRERROR_R
3711 CURL_CHECK_FUNC_STRICMP
3712 CURL_CHECK_FUNC_STRNCASECMP
3713 CURL_CHECK_FUNC_STRNCMPI
3714 CURL_CHECK_FUNC_STRNICMP
3715 CURL_CHECK_FUNC_STRSTR
3716 CURL_CHECK_FUNC_STRTOK_R
3717 CURL_CHECK_FUNC_STRTOLL
3718 CURL_CHECK_FUNC_WRITEV
3724 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3728 AC_CHECK_FUNCS([geteuid \
3736 mach_absolute_time \
3746 eval skipcheck=\$skipcheck_$func
3747 if test "x$skipcheck" != "xyes"; then
3748 AC_MSG_CHECKING([deeper for $func])
3755 AC_MSG_RESULT([yes])
3756 eval "ac_cv_func_$func=yes"
3757 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3758 [Define to 1 if you have the $func function.])
3760 AC_MSG_RESULT([but still no])
3765 dnl Check if the getnameinfo function is available
3766 dnl and get the types of five of its arguments.
3767 CURL_CHECK_FUNC_GETNAMEINFO
3769 if test "$ipv6" = "yes"; then
3770 if test "$curl_cv_func_getaddrinfo" = "yes"; then
3771 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
3773 AC_SUBST(IPV6_ENABLED)
3775 CURL_CHECK_NI_WITHSCOPEID
3778 CURL_CHECK_NONBLOCKING_SOCKET
3780 dnl ************************************************************
3781 dnl nroff tool stuff
3784 AC_PATH_PROG( PERL, perl, ,
3785 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3788 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3789 $PATH:/usr/bin/:/usr/local/bin )
3792 if test -n "$NROFF"; then
3793 dnl only check for nroff options if an nroff command was found
3795 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3797 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3798 if test -z "$mancheck"; then
3800 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3801 if test -z "$mancheck"; then
3803 AC_MSG_RESULT([failed])
3804 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3806 AC_MSG_RESULT([$MANOPT])
3809 AC_MSG_RESULT([$MANOPT])
3814 if test -z "$MANOPT"
3816 dnl if no nroff tool was found, or no option that could convert man pages
3817 dnl was found, then disable the built-in manual stuff
3818 AC_MSG_WARN([disabling built-in manual])
3822 dnl *************************************************************************
3823 dnl If the manual variable still is set, then we go with providing a built-in
3826 if test "$USE_MANUAL" = "1"; then
3827 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3828 curl_manual_msg="enabled"
3831 dnl set variable for use in automakefile(s)
3832 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3835 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
3837 if test "x$curl_cv_native_windows" != "xyes" &&
3838 test "x$enable_shared" = "xyes"; then
3839 build_libhostname=yes
3841 build_libhostname=no
3843 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3845 if test "x$want_ares" != xyes; then
3846 CURL_CHECK_OPTION_THREADED_RESOLVER
3849 dnl ************************************************************
3850 dnl disable POSIX threads
3852 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3853 AC_ARG_ENABLE(pthreads,
3854 AC_HELP_STRING([--enable-pthreads],
3855 [Enable POSIX threads (default for threaded resolver)])
3856 AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3857 [ case "$enableval" in
3858 no) AC_MSG_RESULT(no)
3861 *) AC_MSG_RESULT(yes)
3870 dnl turn off pthreads if rt is disabled
3871 if test "$want_pthreads" != "no"; then
3872 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
3873 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
3875 if test "$dontwant_rt" != "no"; then
3876 dnl if --enable-pthreads was explicit then warn it's being ignored
3877 if test "$want_pthreads" = "yes"; then
3878 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
3884 dnl turn off pthreads if no threaded resolver
3885 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
3890 if test "$want_pthreads" != "no"; then
3891 AC_CHECK_HEADER(pthread.h,
3892 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3893 save_CFLAGS="$CFLAGS"
3895 dnl first check for function without lib
3896 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3898 dnl if it wasn't found without lib, search for it in pthread lib
3899 if test "$USE_THREADS_POSIX" != "1"
3901 CFLAGS="$CFLAGS -pthread"
3902 AC_CHECK_LIB(pthread, pthread_create,
3903 [USE_THREADS_POSIX=1],
3904 [ CFLAGS="$save_CFLAGS"])
3907 if test "x$USE_THREADS_POSIX" = "x1"
3909 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3910 curl_res_msg="POSIX threaded"
3915 dnl threaded resolver check
3916 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
3917 if test "$want_pthreads" = "yes"; then
3918 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
3920 dnl If native Windows fallback on Win32 threads since no POSIX threads
3921 if test "$curl_cv_native_windows" = "yes"; then
3923 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
3924 curl_res_msg="Win32 threaded"
3926 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
3930 dnl ************************************************************
3931 dnl disable verbose text strings
3933 AC_MSG_CHECKING([whether to enable verbose strings])
3934 AC_ARG_ENABLE(verbose,
3935 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
3936 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3937 [ case "$enableval" in
3940 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3941 curl_verbose_msg="no"
3943 *) AC_MSG_RESULT(yes)
3949 dnl ************************************************************
3950 dnl enable SSPI support
3952 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3954 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
3955 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
3956 [ case "$enableval" in
3958 if test "$curl_cv_native_windows" = "yes"; then
3960 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3961 AC_SUBST(USE_WINDOWS_SSPI, [1])
3962 curl_sspi_msg="enabled"
3965 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3969 if test "x$WINSSL_ENABLED" = "x1"; then
3970 # --with-winssl implies --enable-sspi
3977 if test "x$WINSSL_ENABLED" = "x1"; then
3978 # --with-winssl implies --enable-sspi
3985 dnl ************************************************************
3986 dnl disable cryptographic authentication
3988 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3989 AC_ARG_ENABLE(crypto-auth,
3990 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3991 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3992 [ case "$enableval" in
3995 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3996 CURL_DISABLE_CRYPTO_AUTH=1
3998 *) AC_MSG_RESULT(yes)
4004 CURL_CHECK_OPTION_NTLM_WB
4008 dnl ************************************************************
4009 dnl disable TLS-SRP authentication
4011 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
4012 AC_ARG_ENABLE(tls-srp,
4013 AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
4014 AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
4015 [ case "$enableval" in
4018 AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication])
4021 *) AC_MSG_RESULT(yes)
4029 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
4030 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
4032 curl_tls_srp_msg="enabled"
4035 dnl ************************************************************
4036 dnl disable Unix domain sockets support
4038 AC_MSG_CHECKING([whether to enable Unix domain sockets])
4039 AC_ARG_ENABLE(unix-sockets,
4040 AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
4041 AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
4042 [ case "$enableval" in
4043 no) AC_MSG_RESULT(no)
4044 want_unix_sockets=no
4046 *) AC_MSG_RESULT(yes)
4047 want_unix_sockets=yes
4051 want_unix_sockets=auto
4054 if test "x$want_unix_sockets" != "xno"; then
4055 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
4056 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4057 AC_SUBST(USE_UNIX_SOCKETS, [1])
4058 curl_unix_sockets_msg="enabled"
4060 if test "x$want_unix_sockets" = "xyes"; then
4061 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
4068 dnl ************************************************************
4069 dnl disable cookies support
4071 AC_MSG_CHECKING([whether to enable support for cookies])
4072 AC_ARG_ENABLE(cookies,
4073 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
4074 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
4075 [ case "$enableval" in
4078 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
4080 *) AC_MSG_RESULT(yes)
4086 dnl ************************************************************
4087 dnl hiding of library internal symbols
4089 CURL_CONFIGURE_SYMBOL_HIDING
4092 dnl All the library dependencies put into $LIB apply to libcurl only.
4096 AC_SUBST(LIBCURL_LIBS)
4097 AC_SUBST(CURL_NETWORK_LIBS)
4098 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4100 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4101 dnl LIBS variable used in generated makefile at makefile processing
4102 dnl time. Doing this functionally prevents LIBS from being used for
4103 dnl all link targets in given makefile.
4105 AC_SUBST(BLANK_AT_MAKETIME)
4107 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4110 ENABLE_SHARED="$enable_shared"
4111 AC_SUBST(ENABLE_SHARED)
4113 dnl to let curl-config output the static libraries correctly
4114 ENABLE_STATIC="$enable_static"
4115 AC_SUBST(ENABLE_STATIC)
4119 dnl For keeping supported features and protocols also in pkg-config file
4120 dnl since it is more cross-compile friendly than curl-config
4123 if test "x$OPENSSL_ENABLED" = "x1"; then
4124 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4125 elif test -n "$SSL_ENABLED"; then
4126 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4128 if test "x$IPV6_ENABLED" = "x1"; then
4129 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4131 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4132 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4134 if test "x$HAVE_LIBZ" = "x1"; then
4135 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4137 if test "x$HAVE_BROTLI" = "x1"; then
4138 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4140 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4141 -o "x$USE_THREADS_WIN32" = "x1"; then
4142 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4144 if test "x$IDN_ENABLED" = "x1"; then
4145 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4147 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4148 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4151 if test "x$HAVE_GSSAPI" = "x1"; then
4152 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4155 if test "x$curl_psl_msg" = "xyes"; then
4156 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4159 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4160 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4161 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4164 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4165 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4166 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4169 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
4170 if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
4171 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4172 -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1"; then
4173 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4175 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4176 "x$NTLM_WB_ENABLED" = "x1"; then
4177 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4182 if test "x$USE_TLS_SRP" = "x1"; then
4183 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4186 if test "x$USE_NGHTTP2" = "x1"; then
4187 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4190 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4191 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4194 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4195 -o "x$NSS_ENABLED" = "x1"; then
4196 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4199 AC_SUBST(SUPPORT_FEATURES)
4201 dnl For supported protocols in pkg-config file
4202 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4203 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4204 if test "x$SSL_ENABLED" = "x1"; then
4205 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4208 if test "x$CURL_DISABLE_FTP" != "x1"; then
4209 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4210 if test "x$SSL_ENABLED" = "x1"; then
4211 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4214 if test "x$CURL_DISABLE_FILE" != "x1"; then
4215 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4217 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4218 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4220 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4221 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4222 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4223 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4224 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4225 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4229 if test "x$CURL_DISABLE_DICT" != "x1"; then
4230 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4232 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4233 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4235 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4236 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4238 if test "x$CURL_DISABLE_POP3" != "x1"; then
4239 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4240 if test "x$SSL_ENABLED" = "x1"; then
4241 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4244 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4245 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4246 if test "x$SSL_ENABLED" = "x1"; then
4247 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4250 if test "x$CURL_DISABLE_SMB" != "x1" \
4251 -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
4252 -a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
4253 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4254 -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1" \); then
4255 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4256 if test "x$SSL_ENABLED" = "x1"; then
4257 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4260 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4261 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4262 if test "x$SSL_ENABLED" = "x1"; then
4263 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4266 if test "x$USE_LIBSSH2" = "x1"; then
4267 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4268 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4270 if test "x$USE_LIBSSH" = "x1"; then
4271 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4272 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4274 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4275 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4277 if test "x$USE_LIBRTMP" = "x1"; then
4278 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4281 dnl replace spaces with newlines
4283 dnl replace the newlines back to spaces
4284 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4286 AC_SUBST(SUPPORT_PROTOCOLS)
4288 dnl squeeze whitespace out of some variables
4296 squeeze LIBCURL_LIBS
4297 squeeze CURL_NETWORK_LIBS
4298 squeeze CURL_NETWORK_AND_TIME_LIBS
4300 squeeze SUPPORT_FEATURES
4301 squeeze SUPPORT_PROTOCOLS
4303 XC_CHECK_BUILD_FLAGS
4305 SSL_BACKENDS=${ssl_backends}
4306 AC_SUBST(SSL_BACKENDS)
4308 if test "x$want_curldebug_assumed" = "xyes" &&
4309 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4310 ac_configure_args="$ac_configure_args --enable-curldebug"
4313 AC_CONFIG_FILES([Makefile \
4315 docs/examples/Makefile \
4316 docs/libcurl/Makefile \
4317 docs/libcurl/opts/Makefile \
4318 docs/cmdline-opts/Makefile \
4320 include/curl/Makefile \
4323 extensions/Makefile \
4327 tests/certs/Makefile \
4328 tests/certs/scripts/Makefile \
4329 tests/data/Makefile \
4330 tests/server/Makefile \
4331 tests/libtest/Makefile \
4332 tests/unit/Makefile \
4334 packages/Win32/Makefile \
4335 packages/Win32/cygwin/Makefile \
4336 packages/Linux/Makefile \
4337 packages/Linux/RPM/Makefile \
4338 packages/Linux/RPM/curl.spec \
4339 packages/Linux/RPM/curl-ssl.spec \
4340 packages/Solaris/Makefile \
4341 packages/EPM/curl.list \
4342 packages/EPM/Makefile \
4343 packages/vms/Makefile \
4344 packages/AIX/Makefile \
4345 packages/AIX/RPM/Makefile \
4346 packages/AIX/RPM/curl.spec \
4352 CURL_GENERATE_CONFIGUREHELP_PM
4354 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4356 AC_MSG_NOTICE([Configured to build curl/libcurl:
4358 curl version: ${CURLVERSION}
4360 Install prefix: ${prefix}
4362 SSL support: ${curl_ssl_msg}
4363 SSH support: ${curl_ssh_msg}
4364 zlib support: ${curl_zlib_msg}
4365 brotli support: ${curl_brotli_msg}
4366 GSS-API support: ${curl_gss_msg}
4367 TLS-SRP support: ${curl_tls_srp_msg}
4368 resolver: ${curl_res_msg}
4369 IPv6 support: ${curl_ipv6_msg}
4370 Unix sockets support: ${curl_unix_sockets_msg}
4371 IDN support: ${curl_idn_msg}
4372 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4373 Built-in manual: ${curl_manual_msg}
4374 --libcurl option: ${curl_libcurl_msg}
4375 Verbose errors: ${curl_verbose_msg}
4376 SSPI support: ${curl_sspi_msg}
4377 ca cert bundle: ${ca}${ca_warning}
4378 ca cert path: ${capath}${capath_warning}
4379 ca fallback: ${with_ca_fallback}
4380 LDAP support: ${curl_ldap_msg}
4381 LDAPS support: ${curl_ldaps_msg}
4382 RTSP support: ${curl_rtsp_msg}
4383 RTMP support: ${curl_rtmp_msg}
4384 metalink support: ${curl_mtlnk_msg}
4385 PSL support: ${curl_psl_msg}
4386 HTTP2 support: ${curl_h2_msg}
4387 Protocols: ${SUPPORT_PROTOCOLS}