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"
64 if test "$compiler_id" = "GNU_C"; then
65 dnl enable -pedantic-errors for GCC 5 and later,
66 dnl as before that it was the same as -Werror=pedantic
67 if test "$compiler_num" -ge "500"; then
68 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
72 AC_SUBST(CURL_CFLAG_EXTRAS)
74 dnl SED is mandatory for configure process and libtool.
75 dnl Set it now, allowing it to be changed later.
76 if test -z "$SED"; then
77 dnl allow it to be overridden
78 AC_PATH_PROG([SED], [sed], [not_found],
79 [$PATH:/usr/bin:/usr/local/bin])
80 if test -z "$SED" || test "$SED" = "not_found"; then
81 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
86 dnl GREP is mandatory for configure process and libtool.
87 dnl Set it now, allowing it to be changed later.
88 if test -z "$GREP"; then
89 dnl allow it to be overridden
90 AC_PATH_PROG([GREP], [grep], [not_found],
91 [$PATH:/usr/bin:/usr/local/bin])
92 if test -z "$GREP" || test "$GREP" = "not_found"; then
93 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
98 dnl EGREP is mandatory for configure process and libtool.
99 dnl Set it now, allowing it to be changed later.
100 if test -z "$EGREP"; then
101 dnl allow it to be overridden
102 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
103 AC_MSG_CHECKING([for egrep])
105 AC_MSG_RESULT([$EGREP])
107 AC_PATH_PROG([EGREP], [egrep], [not_found],
108 [$PATH:/usr/bin:/usr/local/bin])
111 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
112 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
116 dnl AR is mandatory for configure process and libtool.
117 dnl This is target dependent, so check it as a tool.
118 if test -z "$AR"; then
119 dnl allow it to be overridden
120 AC_PATH_TOOL([AR], [ar], [not_found],
121 [$PATH:/usr/bin:/usr/local/bin])
122 if test -z "$AR" || test "$AR" = "not_found"; then
123 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
130 dnl figure out the libcurl version
131 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
134 dnl Check if gcc is being used before adding AX_CODE_COVERAGE
135 AS_IF([ test "$GCC" = "yes" ], [AX_CODE_COVERAGE],
136 # not using GCC so pass a test below - CODE_COVERAGE_ENABLED_TRUE is not zero length
137 CODE_COVERAGE_ENABLED_TRUE='#'
141 AC_MSG_CHECKING([curl version])
142 AC_MSG_RESULT($CURLVERSION)
144 AC_SUBST(CURLVERSION)
147 dnl we extract the numerical version for curl-config only
148 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
151 dnl Solaris pkgadd support definitions
152 PKGADD_PKG="HAXXcurl"
153 PKGADD_NAME="curl - a client that groks URLs"
154 PKGADD_VENDOR="curl.haxx.se"
156 AC_SUBST(PKGADD_NAME)
157 AC_SUBST(PKGADD_VENDOR)
160 dnl initialize all the info variables
161 curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl,mesalink} )"
162 curl_ssh_msg="no (--with-libssh2)"
163 curl_zlib_msg="no (--with-zlib)"
164 curl_brotli_msg="no (--with-brotli)"
165 curl_gss_msg="no (--with-gssapi)"
166 curl_tls_srp_msg="no (--enable-tls-srp)"
167 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
168 curl_ipv6_msg="no (--enable-ipv6)"
169 curl_unix_sockets_msg="no (--enable-unix-sockets)"
170 curl_idn_msg="no (--with-{libidn2,winidn})"
171 curl_manual_msg="no (--enable-manual)"
172 curl_libcurl_msg="enabled (--disable-libcurl-option)"
173 curl_verbose_msg="enabled (--disable-verbose)"
174 curl_sspi_msg="no (--enable-sspi)"
175 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
176 curl_ldaps_msg="no (--enable-ldaps)"
177 curl_rtsp_msg="no (--enable-rtsp)"
178 curl_rtmp_msg="no (--with-librtmp)"
179 curl_mtlnk_msg="no (--with-libmetalink)"
180 curl_psl_msg="no (--with-libpsl)"
185 dnl Save some initial values the user might have provided
187 INITIAL_LDFLAGS=$LDFLAGS
191 dnl Detect the canonical host and target build environment
195 dnl Get system canonical name
196 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
198 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
199 AC_SUBST(AR_FLAGS, [cr])
201 dnl This defines _ALL_SOURCE for AIX
202 CURL_CHECK_AIX_ALL_SOURCE
204 dnl Our configure and build reentrant settings
205 CURL_CONFIGURE_THREAD_SAFE
206 CURL_CONFIGURE_REENTRANT
208 dnl check for how to do large files
214 # Automake conditionals based on libtool related checks
217 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
218 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
219 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
220 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
221 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
222 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
225 # Due to libtool and automake machinery limitations of not allowing
226 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
227 # inclusion of these in shared or static libraries, we are forced to
228 # build using separate configure runs for shared and static libraries
229 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
230 # to compile objects for each kind of library. Notice that relying on
231 # the '-DPIC' CFLAG that libtool provides is not valid given that the
232 # user might for example choose to build static libraries with PIC.
236 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
237 # targeting a static library and not building its shared counterpart.
240 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
241 [test "x$xc_lt_build_static_only" = 'xyes'])
244 # Make staticlib CPPFLAG variable and its definition visible in output
245 # files unconditionally, providing an empty definition unless strictly
246 # targeting a static library and not building its shared counterpart.
249 CPPFLAG_CURL_STATICLIB=
250 if test "x$xc_lt_build_static_only" = 'xyes'; then
251 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
253 AC_SUBST([CPPFLAG_CURL_STATICLIB])
256 # Determine whether all dependent libraries must be specified when linking
257 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
263 AC_SUBST(REQUIRE_LIB_DEPS)
264 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
266 dnl check if there's a way to force code inline
269 dnl **********************************************************************
270 dnl platform/compiler/architecture specific checks/flags
271 dnl **********************************************************************
274 CURL_SET_COMPILER_BASIC_OPTS
275 CURL_SET_COMPILER_DEBUG_OPTS
276 CURL_SET_COMPILER_OPTIMIZE_OPTS
277 CURL_SET_COMPILER_WARNING_OPTS
279 if test "$compiler_id" = "INTEL_UNIX_C"; then
281 if test "$compiler_num" -ge "1000"; then
282 dnl icc 10.X or later
283 CFLAGS="$CFLAGS -shared-intel"
284 elif test "$compiler_num" -ge "900"; then
286 CFLAGS="$CFLAGS -i-dynamic"
291 CURL_CHECK_COMPILER_HALT_ON_ERROR
292 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
293 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
294 CURL_CHECK_COMPILER_SYMBOL_HIDING
297 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
299 supports_unittests=yes
300 # cross-compilation of unit tests static library/programs fails when
301 # libcurl shared library is built. This might be due to a libtool or
302 # automake issue. In this case we disable unit tests.
303 if test "x$cross_compiling" != "xno" &&
304 test "x$enable_shared" != "xno"; then
305 supports_unittests=no
308 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
309 # a problem related with OpenSSL headers and library versions not matching.
310 # Disable unit tests while time to further investigate this is found.
313 if test "$compiler_id" = "GNU_C"; then
314 supports_unittests=no
319 # All AIX autobuilds fails unit tests linking against unittests library
320 # due to unittests library being built with no symbols or members. Libtool ?
321 # Disable unit tests while time to further investigate this is found.
324 supports_unittests=no
328 dnl Build unit tests when option --enable-debug is given.
329 if test "x$want_debug" = "xyes" &&
330 test "x$supports_unittests" = "xyes"; then
335 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
337 dnl **********************************************************************
338 dnl Compilation based checks should not be done before this point.
339 dnl **********************************************************************
341 dnl **********************************************************************
342 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
343 dnl and ws2tcpip.h take precedence over any other further checks which
344 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
345 dnl this specific header files. And do them before its results are used.
346 dnl **********************************************************************
348 CURL_CHECK_HEADER_WINDOWS
349 CURL_CHECK_NATIVE_WINDOWS
350 case X-"$curl_cv_native_windows" in
352 CURL_CHECK_HEADER_WINSOCK
353 CURL_CHECK_HEADER_WINSOCK2
354 CURL_CHECK_HEADER_WS2TCPIP
355 CURL_CHECK_HEADER_WINLDAP
356 CURL_CHECK_HEADER_WINBER
359 curl_cv_header_winsock_h="no"
360 curl_cv_header_winsock2_h="no"
361 curl_cv_header_ws2tcpip_h="no"
362 curl_cv_header_winldap_h="no"
363 curl_cv_header_winber_h="no"
366 CURL_CHECK_WIN32_LARGEFILE
369 CURL_SUPPORTS_BUILTIN_AVAILABLE
371 dnl ************************************************************
372 dnl switch off particular protocols
374 AC_MSG_CHECKING([whether to support http])
376 AC_HELP_STRING([--enable-http],[Enable HTTP support])
377 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
378 [ case "$enableval" in
381 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
383 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
384 AC_SUBST(CURL_DISABLE_HTTP, [1])
385 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
386 AC_SUBST(CURL_DISABLE_RTSP, [1])
388 *) AC_MSG_RESULT(yes)
393 AC_MSG_CHECKING([whether to support ftp])
395 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
396 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
397 [ case "$enableval" in
400 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
401 AC_SUBST(CURL_DISABLE_FTP, [1])
403 *) AC_MSG_RESULT(yes)
408 AC_MSG_CHECKING([whether to support file])
410 AC_HELP_STRING([--enable-file],[Enable FILE support])
411 AC_HELP_STRING([--disable-file],[Disable FILE support]),
412 [ case "$enableval" in
415 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
416 AC_SUBST(CURL_DISABLE_FILE, [1])
418 *) AC_MSG_RESULT(yes)
423 AC_MSG_CHECKING([whether to support ldap])
425 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
426 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
427 [ case "$enableval" in
430 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
431 AC_SUBST(CURL_DISABLE_LDAP, [1])
439 AC_MSG_CHECKING([whether to support ldaps])
441 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
442 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
443 [ case "$enableval" in
446 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
447 AC_SUBST(CURL_DISABLE_LDAPS, [1])
449 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
450 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
451 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
452 AC_SUBST(CURL_DISABLE_LDAPS, [1])
455 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
456 AC_SUBST(HAVE_LDAP_SSL, [1])
460 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
462 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
463 AC_SUBST(CURL_DISABLE_LDAPS, [1])
466 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
467 AC_SUBST(HAVE_LDAP_SSL, [1])
471 AC_MSG_CHECKING([whether to support rtsp])
473 AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
474 AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
475 [ case "$enableval" in
478 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
479 AC_SUBST(CURL_DISABLE_RTSP, [1])
481 *) if test x$CURL_DISABLE_HTTP = x1 ; then
482 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
485 curl_rtsp_msg="enabled"
489 if test "x$CURL_DISABLE_HTTP" != "x1"; then
491 curl_rtsp_msg="enabled"
497 AC_MSG_CHECKING([whether to support proxies])
499 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
500 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
501 [ case "$enableval" in
504 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
505 AC_SUBST(CURL_DISABLE_PROXY, [1])
507 *) AC_MSG_RESULT(yes)
513 AC_MSG_CHECKING([whether to support dict])
515 AC_HELP_STRING([--enable-dict],[Enable DICT support])
516 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
517 [ case "$enableval" in
520 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
521 AC_SUBST(CURL_DISABLE_DICT, [1])
523 *) AC_MSG_RESULT(yes)
528 AC_MSG_CHECKING([whether to support telnet])
529 AC_ARG_ENABLE(telnet,
530 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
531 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
532 [ case "$enableval" in
535 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
536 AC_SUBST(CURL_DISABLE_TELNET, [1])
538 *) AC_MSG_RESULT(yes)
543 AC_MSG_CHECKING([whether to support tftp])
545 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
546 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
547 [ case "$enableval" in
550 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
551 AC_SUBST(CURL_DISABLE_TFTP, [1])
553 *) AC_MSG_RESULT(yes)
559 AC_MSG_CHECKING([whether to support pop3])
561 AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
562 AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
563 [ case "$enableval" in
566 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
567 AC_SUBST(CURL_DISABLE_POP3, [1])
569 *) AC_MSG_RESULT(yes)
576 AC_MSG_CHECKING([whether to support imap])
578 AC_HELP_STRING([--enable-imap],[Enable IMAP support])
579 AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
580 [ case "$enableval" in
583 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
584 AC_SUBST(CURL_DISABLE_IMAP, [1])
586 *) AC_MSG_RESULT(yes)
593 AC_MSG_CHECKING([whether to support smb])
595 AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
596 AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
597 [ case "$enableval" in
600 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
601 AC_SUBST(CURL_DISABLE_SMB, [1])
603 *) AC_MSG_RESULT(yes)
609 AC_MSG_CHECKING([whether to support smtp])
611 AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
612 AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
613 [ case "$enableval" in
616 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
617 AC_SUBST(CURL_DISABLE_SMTP, [1])
619 *) AC_MSG_RESULT(yes)
625 AC_MSG_CHECKING([whether to support gopher])
626 AC_ARG_ENABLE(gopher,
627 AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
628 AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
629 [ case "$enableval" in
632 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
633 AC_SUBST(CURL_DISABLE_GOPHER, [1])
635 *) AC_MSG_RESULT(yes)
642 dnl **********************************************************************
643 dnl Check for built-in manual
644 dnl **********************************************************************
646 AC_MSG_CHECKING([whether to provide built-in manual])
647 AC_ARG_ENABLE(manual,
648 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
649 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
650 [ case "$enableval" in
654 *) AC_MSG_RESULT(yes)
661 dnl The actual use of the USE_MANUAL variable is done much later in this
662 dnl script to allow other actions to disable it as well.
664 dnl ************************************************************
665 dnl disable C code generation support
667 AC_MSG_CHECKING([whether to enable generation of C code])
668 AC_ARG_ENABLE(libcurl_option,
669 AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
670 AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
671 [ case "$enableval" in
674 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
675 curl_libcurl_msg="no"
677 *) AC_MSG_RESULT(yes)
683 dnl **********************************************************************
684 dnl Checks for libraries.
685 dnl **********************************************************************
687 AC_MSG_CHECKING([whether to use libgcc])
688 AC_ARG_ENABLE(libgcc,
689 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
690 [ case "$enableval" in
703 dnl gethostbyname without lib or in the nsl lib?
704 AC_CHECK_FUNC(gethostbyname,
705 [HAVE_GETHOSTBYNAME="1"
707 [ AC_CHECK_LIB(nsl, gethostbyname,
708 [HAVE_GETHOSTBYNAME="1"
713 if test "$HAVE_GETHOSTBYNAME" != "1"
715 dnl gethostbyname in the socket lib?
716 AC_CHECK_LIB(socket, gethostbyname,
717 [HAVE_GETHOSTBYNAME="1"
718 LIBS="-lsocket $LIBS"
722 if test "$HAVE_GETHOSTBYNAME" != "1"
724 dnl gethostbyname in the watt lib?
725 AC_CHECK_LIB(watt, gethostbyname,
726 [HAVE_GETHOSTBYNAME="1"
727 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
728 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
733 dnl At least one system has been identified to require BOTH nsl and socket
734 dnl libs at the same time to link properly.
735 if test "$HAVE_GETHOSTBYNAME" != "1"
737 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
738 my_ac_save_LIBS=$LIBS
739 LIBS="-lnsl -lsocket $LIBS"
747 HAVE_GETHOSTBYNAME="1"
750 LIBS=$my_ac_save_LIBS
754 if test "$HAVE_GETHOSTBYNAME" != "1"
756 dnl This is for winsock systems
757 if test "$curl_cv_header_windows_h" = "yes"; then
758 if test "$curl_cv_header_winsock_h" = "yes"; then
761 winsock_LIB="-lwinsock"
764 winsock_LIB="-lwsock32"
768 if test "$curl_cv_header_winsock2_h" = "yes"; then
769 winsock_LIB="-lws2_32"
771 if test ! -z "$winsock_LIB"; then
772 my_ac_save_LIBS=$LIBS
773 LIBS="$winsock_LIB $LIBS"
774 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
777 #ifdef HAVE_WINDOWS_H
778 #ifndef WIN32_LEAN_AND_MEAN
779 #define WIN32_LEAN_AND_MEAN
782 #ifdef HAVE_WINSOCK2_H
783 #include <winsock2.h>
785 #ifdef HAVE_WINSOCK_H
791 gethostbyname("www.dummysite.com");
795 HAVE_GETHOSTBYNAME="1"
799 LIBS=$my_ac_save_LIBS
805 if test "$HAVE_GETHOSTBYNAME" != "1"
807 dnl This is for Minix 3.1
808 AC_MSG_CHECKING([for gethostbyname for Minix 3])
811 /* Older Minix versions may need <net/gen/netdb.h> here instead */
814 gethostbyname("www.dummysite.com");
818 HAVE_GETHOSTBYNAME="1"
824 if test "$HAVE_GETHOSTBYNAME" != "1"
826 dnl This is for eCos with a stubbed DNS implementation
827 AC_MSG_CHECKING([for gethostbyname for eCos])
833 gethostbyname("www.dummysite.com");
837 HAVE_GETHOSTBYNAME="1"
843 if test "$HAVE_GETHOSTBYNAME" != "1"
845 dnl gethostbyname in the network lib - for Haiku OS
846 AC_CHECK_LIB(network, gethostbyname,
847 [HAVE_GETHOSTBYNAME="1"
848 LIBS="-lnetwork $LIBS"
852 if test "$HAVE_GETHOSTBYNAME" != "1"
854 dnl gethostbyname in the net lib - for BeOS
855 AC_CHECK_LIB(net, gethostbyname,
856 [HAVE_GETHOSTBYNAME="1"
862 if test "$HAVE_GETHOSTBYNAME" != "1"; then
863 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
866 CURL_CHECK_LIBS_CONNECT
868 CURL_NETWORK_LIBS=$LIBS
870 dnl **********************************************************************
871 dnl In case that function clock_gettime with monotonic timer is available,
872 dnl check for additional required libraries.
873 dnl **********************************************************************
874 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
876 dnl **********************************************************************
877 dnl The preceding library checks are all potentially useful for test
878 dnl servers and libtest cases which require networking and clock_gettime
879 dnl support. Save the list of required libraries at this point for use
880 dnl while linking those test servers and programs.
881 dnl **********************************************************************
882 CURL_NETWORK_AND_TIME_LIBS=$LIBS
884 dnl **********************************************************************
885 dnl Check for the presence of ZLIB libraries and headers
886 dnl **********************************************************************
888 dnl Check for & handle argument to --with-zlib.
890 clean_CPPFLAGS=$CPPFLAGS
891 clean_LDFLAGS=$LDFLAGS
895 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
896 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
897 [OPT_ZLIB="$withval"])
899 if test "$OPT_ZLIB" = "no" ; then
900 AC_MSG_WARN([zlib disabled])
902 if test "$OPT_ZLIB" = "yes" ; then
906 if test -z "$OPT_ZLIB" ; then
907 CURL_CHECK_PKGCONFIG(zlib)
909 if test "$PKGCONFIG" != "no" ; then
910 LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
911 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
912 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
917 if test -z "$HAVE_LIBZ"; then
919 dnl Check for the lib without setting any new path, since many
920 dnl people have it in the default path
922 AC_CHECK_LIB(z, inflateEnd,
923 dnl libz found, set the variable
926 dnl if no lib found, try /usr/local
927 [OPT_ZLIB="/usr/local"])
931 dnl Add a nonempty path to the compiler flags
932 if test -n "$OPT_ZLIB"; then
933 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
934 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
937 AC_CHECK_HEADER(zlib.h,
941 dnl if the lib wasn't found already, try again with the new paths
942 if test "$HAVE_LIBZ" != "1"; then
943 AC_CHECK_LIB(z, gzread,
945 dnl the lib was found!
949 [ CPPFLAGS=$clean_CPPFLAGS
950 LDFLAGS=$clean_LDFLAGS])
954 dnl zlib.h was not found, restore the flags
955 CPPFLAGS=$clean_CPPFLAGS
956 LDFLAGS=$clean_LDFLAGS]
959 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
961 AC_MSG_WARN([configure found only the libz lib, not the header file!])
963 CPPFLAGS=$clean_CPPFLAGS
964 LDFLAGS=$clean_LDFLAGS
966 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
968 AC_MSG_WARN([configure found only the libz header file, not the lib!])
969 CPPFLAGS=$clean_CPPFLAGS
970 LDFLAGS=$clean_LDFLAGS
972 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
974 dnl both header and lib were found!
976 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
977 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
980 LIBS="-lz $clean_LIBS"
982 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
984 AC_MSG_NOTICE([found both libz and libz.h header])
985 curl_zlib_msg="enabled"
989 dnl set variable for use in automakefile(s)
990 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
993 dnl **********************************************************************
994 dnl Check for the presence of BROTLI decoder libraries and headers
995 dnl **********************************************************************
997 dnl Brotli project home page: https://github.com/google/brotli
999 dnl Default to compiler & linker defaults for BROTLI files & libraries.
1001 AC_ARG_WITH(brotli,dnl
1002 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])
1003 AC_HELP_STRING([--without-brotli], [disable BROTLI]),
1004 OPT_BROTLI=$withval)
1006 if test X"$OPT_BROTLI" != Xno; then
1007 dnl backup the pre-brotli variables
1008 CLEANLDFLAGS="$LDFLAGS"
1009 CLEANCPPFLAGS="$CPPFLAGS"
1012 case "$OPT_BROTLI" in
1014 dnl --with-brotli (without path) used
1015 CURL_CHECK_PKGCONFIG(libbrotlidec)
1017 if test "$PKGCONFIG" != "no" ; then
1018 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1019 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1020 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1021 version=`$PKGCONFIG --modversion libbrotlidec`
1022 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/-L//'`
1027 dnl no --with-brotli option given, just check default places
1030 dnl use the given --with-brotli spot
1031 PREFIX_BROTLI=$OPT_BROTLI
1035 dnl if given with a prefix, we set -L and -I based on that
1036 if test -n "$PREFIX_BROTLI"; then
1037 LIB_BROTLI="-lbrotlidec"
1038 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1039 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1040 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1043 LDFLAGS="$LDFLAGS $LD_BROTLI"
1044 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1045 LIBS="$LIB_BROTLI $LIBS"
1047 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1049 AC_CHECK_HEADERS(brotli/decode.h,
1050 curl_brotli_msg="enabled (libbrotlidec)"
1052 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1053 AC_SUBST(HAVE_BROTLI, [1])
1056 if test X"$OPT_BROTLI" != Xoff &&
1057 test "$HAVE_BROTLI" != "1"; then
1058 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1061 if test "$HAVE_BROTLI" = "1"; then
1062 if test -n "$DIR_BROTLI"; then
1063 dnl when the brotli shared libs were found in a path that the run-time
1064 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1065 dnl to prevent further configure tests to fail due to this
1067 if test "x$cross_compiling" != "xyes"; then
1068 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1069 export CURL_LIBRARY_PATH
1070 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1074 dnl no brotli, revert back to clean variables
1075 LDFLAGS=$CLEANLDFLAGS
1076 CPPFLAGS=$CLEANCPPFLAGS
1081 dnl **********************************************************************
1083 dnl **********************************************************************
1086 AC_ARG_WITH(ldap-lib,
1087 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1088 [LDAPLIBNAME="$withval"])
1091 AC_ARG_WITH(lber-lib,
1092 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1093 [LBERLIBNAME="$withval"])
1095 if test x$CURL_DISABLE_LDAP != x1 ; then
1097 CURL_CHECK_HEADER_LBER
1098 CURL_CHECK_HEADER_LDAP
1099 CURL_CHECK_HEADER_LDAPSSL
1100 CURL_CHECK_HEADER_LDAP_SSL
1102 if test -z "$LDAPLIBNAME" ; then
1103 if test "$curl_cv_native_windows" = "yes"; then
1104 dnl Windows uses a single and unique LDAP library name
1105 LDAPLIBNAME="wldap32"
1110 if test "$LDAPLIBNAME" ; then
1111 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1112 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1113 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1114 AC_SUBST(CURL_DISABLE_LDAP, [1])
1115 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1116 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1118 dnl Try to find the right ldap libraries for this system
1119 CURL_CHECK_LIBS_LDAP
1120 case X-"$curl_cv_ldap_LIBS" in
1122 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1123 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1124 AC_SUBST(CURL_DISABLE_LDAP, [1])
1125 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1126 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1132 if test x$CURL_DISABLE_LDAP != x1 ; then
1134 if test "$LBERLIBNAME" ; then
1135 dnl If name is "no" then don't define this library at all
1136 dnl (it's only needed if libldap.so's dependencies are broken).
1137 if test "$LBERLIBNAME" != "no" ; then
1138 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1139 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1140 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1141 AC_SUBST(CURL_DISABLE_LDAP, [1])
1142 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1143 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1148 if test x$CURL_DISABLE_LDAP != x1 ; then
1149 AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
1151 if test "$LDAPLIBNAME" = "wldap32"; then
1152 curl_ldap_msg="enabled (winldap)"
1153 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1155 curl_ldap_msg="enabled (OpenLDAP)"
1156 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1157 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1158 AC_SUBST(USE_OPENLDAP, [1])
1163 if test x$CURL_DISABLE_LDAPS != x1 ; then
1164 curl_ldaps_msg="enabled"
1167 dnl **********************************************************************
1169 dnl **********************************************************************
1171 AC_MSG_CHECKING([whether to enable IPv6])
1173 AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1174 AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1175 [ case "$enableval" in
1180 *) AC_MSG_RESULT(yes)
1185 AC_TRY_RUN([ /* is AF_INET6 available? */
1186 #include <sys/types.h>
1187 #ifdef HAVE_WINSOCK2_H
1188 #include <winsock2.h>
1190 #include <sys/socket.h>
1192 #include <stdlib.h> /* for exit() */
1195 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1209 if test "$ipv6" = "yes"; then
1210 curl_ipv6_msg="enabled"
1213 # Check if struct sockaddr_in6 have sin6_scope_id member
1214 if test "$ipv6" = yes; then
1215 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1217 #include <sys/types.h>
1218 #ifdef HAVE_WINSOCK2_H
1219 #include <winsock2.h>
1220 #include <ws2tcpip.h>
1222 #include <netinet/in.h>
1223 #if defined (__TANDEM)
1224 # include <netinet/in6.h>
1227 struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
1228 if test "$have_sin6_scope_id" = yes; then
1229 AC_MSG_RESULT([yes])
1230 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1236 dnl **********************************************************************
1237 dnl Check if the operating system allows programs to write to their own argv[]
1238 dnl **********************************************************************
1240 AC_MSG_CHECKING([if argv can be written to])
1242 int main(int argc, char ** argv) {
1244 return (argv[0][0] == ' ')?0:1;
1247 curl_cv_writable_argv=yes
1249 curl_cv_writable_argv=no
1251 curl_cv_writable_argv=cross
1253 case $curl_cv_writable_argv in
1255 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1263 AC_MSG_WARN([the previous check could not be made default was used])
1267 dnl **********************************************************************
1268 dnl Check for GSS-API libraries
1269 dnl **********************************************************************
1271 dnl check for GSS-API stuff in the /usr as default
1274 AC_ARG_WITH(gssapi-includes,
1275 AC_HELP_STRING([--with-gssapi-includes=DIR],
1276 [Specify location of GSS-API headers]),
1277 [ GSSAPI_INCS="-I$withval"
1281 AC_ARG_WITH(gssapi-libs,
1282 AC_HELP_STRING([--with-gssapi-libs=DIR],
1283 [Specify location of GSS-API libs]),
1284 [ GSSAPI_LIB_DIR="-L$withval"
1289 AC_HELP_STRING([--with-gssapi=DIR],
1290 [Where to look for GSS-API]), [
1291 GSSAPI_ROOT="$withval"
1292 if test x"$GSSAPI_ROOT" != xno; then
1294 if test x"$GSSAPI_ROOT" = xyes; then
1295 dnl if yes, then use default root
1301 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1303 save_CPPFLAGS="$CPPFLAGS"
1304 AC_MSG_CHECKING([if GSS-API support is requested])
1305 if test x"$want_gss" = xyes; then
1308 if test -z "$GSSAPI_INCS"; then
1309 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1310 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1311 elif test -f "$KRB5CONFIG"; then
1312 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1313 elif test "$GSSAPI_ROOT" != "yes"; then
1314 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1318 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1320 AC_CHECK_HEADER(gss.h,
1322 dnl found in the given dirs
1323 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1327 dnl not found, check Heimdal or MIT
1328 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1330 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1335 #ifdef HAVE_GSSAPI_GSSAPI_H
1336 #include <gssapi/gssapi.h>
1339 if test "x$not_mit" = "x1"; then
1340 dnl MIT not found, check for Heimdal
1341 AC_CHECK_HEADER(gssapi.h,
1344 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1347 dnl no header found, disabling GSS
1349 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1354 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1355 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1356 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1359 #include <gssapi/gssapi.h>
1360 #include <gssapi/gssapi_generic.h>
1361 #include <gssapi/gssapi_krb5.h>
1366 GSS_C_NT_HOSTBASED_SERVICE,
1370 AC_MSG_RESULT([yes])
1373 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1374 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1382 if test x"$want_gss" = xyes; then
1383 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1385 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1387 if test -n "$gnu_gss"; then
1388 curl_gss_msg="enabled (GNU GSS)"
1389 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1391 elif test -z "$GSSAPI_LIB_DIR"; then
1394 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1397 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1398 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1400 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1401 LIBS="$gss_libs $LIBS"
1402 elif test -f "$KRB5CONFIG"; then
1403 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1405 gss_libs=`$KRB5CONFIG --libs gssapi`
1406 LIBS="$gss_libs $LIBS"
1413 gss_libname="gssapi"
1417 if test "$GSSAPI_ROOT" != "yes"; then
1418 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1419 LIBS="-l$gss_libname $LIBS"
1421 LIBS="-l$gss_libname $LIBS"
1427 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1433 LIBS="-lgssapi $LIBS"
1438 CPPFLAGS="$save_CPPFLAGS"
1442 if test x"$want_gss" = "xyes"; then
1443 build_libstubgss=yes
1446 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
1448 dnl -------------------------------------------------------------
1449 dnl parse --with-default-ssl-backend so it can be validated below
1450 dnl -------------------------------------------------------------
1452 DEFAULT_SSL_BACKEND=no
1453 VALID_DEFAULT_SSL_BACKEND=
1454 AC_ARG_WITH(default-ssl-backend,
1455 AC_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
1456 AC_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
1457 [DEFAULT_SSL_BACKEND=$withval])
1458 case "$DEFAULT_SSL_BACKEND" in
1460 dnl --without-default-ssl-backend option used
1463 dnl --with-default-ssl-backend option used without name
1464 AC_MSG_ERROR([The name of the default SSL backend is required.])
1467 dnl --with-default-ssl-backend option used with name
1468 AC_SUBST(DEFAULT_SSL_BACKEND)
1469 dnl needs to be validated below
1470 VALID_DEFAULT_SSL_BACKEND=no
1474 dnl **********************************************************************
1476 dnl -------------------------------------------------
1477 dnl check winssl option before other SSL libraries
1478 dnl -------------------------------------------------
1481 AC_ARG_WITH(winssl,dnl
1482 AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
1483 AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
1484 OPT_WINSSL=$withval)
1486 AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
1487 if test -z "$ssl_backends" -o "x$OPT_WINSSL" != xno; then
1489 if test "x$OPT_WINSSL" != "xno" &&
1490 test "x$curl_cv_native_windows" = "xyes"; then
1492 AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
1493 AC_SUBST(USE_SCHANNEL, [1])
1494 ssl_msg="Windows-native"
1495 test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1497 # --with-winssl implies --enable-sspi
1498 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
1499 AC_SUBST(USE_WINDOWS_SSPI, [1])
1500 curl_sspi_msg="enabled"
1501 LIBS="-lcrypt32 $LIBS"
1505 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1511 AC_ARG_WITH(darwinssl,dnl
1512 AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS])
1513 AC_HELP_STRING([--without-darwinssl], [disable Apple OS native SSL/TLS]),
1514 OPT_DARWINSSL=$withval)
1516 AC_MSG_CHECKING([whether to enable Apple OS native SSL/TLS])
1517 if test -z "$ssl_backends" -o "x$OPT_DARWINSSL" != xno; then
1518 if test "x$OPT_DARWINSSL" != "xno" &&
1519 test -d "/System/Library/Frameworks/Security.framework"; then
1521 AC_DEFINE(USE_DARWINSSL, 1, [to enable Apple OS native SSL/TLS support])
1522 AC_SUBST(USE_DARWINSSL, [1])
1523 ssl_msg="Apple OS-native"
1524 test darwinssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1526 LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
1530 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1535 dnl **********************************************************************
1536 dnl Check for the presence of SSL libraries and headers
1537 dnl **********************************************************************
1539 dnl Default to compiler & linker defaults for SSL files & libraries.
1541 dnl Default to no CA bundle
1544 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])
1545 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1548 if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
1549 test X"$OPT_SSL" != Xno; then
1552 dnl backup the pre-ssl variables
1553 CLEANLDFLAGS="$LDFLAGS"
1554 CLEANCPPFLAGS="$CPPFLAGS"
1557 dnl This is for Msys/Mingw
1559 *-*-msys* | *-*-mingw*)
1560 AC_MSG_CHECKING([for gdi32])
1561 my_ac_save_LIBS=$LIBS
1562 LIBS="-lgdi32 $LIBS"
1563 AC_TRY_LINK([#include <windef.h>
1564 #include <wingdi.h>],
1567 AC_MSG_RESULT([yes])],
1568 [ dnl failed, restore LIBS
1569 LIBS=$my_ac_save_LIBS
1577 dnl --with-ssl (without path) used
1578 if test x$cross_compiling != xyes; then
1579 dnl only do pkg-config magic when not cross-compiling
1582 PREFIX_OPENSSL=/usr/local/ssl
1583 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1586 dnl no --with-ssl option given, just check default places
1587 if test x$cross_compiling != xyes; then
1588 dnl only do pkg-config magic when not cross-compiling
1594 dnl check the given --with-ssl spot
1596 PREFIX_OPENSSL=$OPT_SSL
1598 dnl Try pkg-config even when cross-compiling. Since we
1599 dnl specify PKG_CONFIG_LIBDIR we're only looking where
1600 dnl the user told us to look
1601 OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
1602 if test -f "$OPENSSL_PCDIR/openssl.pc"; then
1603 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
1605 elif test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
1606 AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-ssl prefix!])
1609 dnl in case pkg-config comes up empty, use what we got
1611 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1612 if test "$PREFIX_OPENSSL" != "/usr" ; then
1613 SSL_LDFLAGS="-L$LIB_OPENSSL"
1614 SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
1616 SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1620 if test "$PKGTEST" = "yes"; then
1622 CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
1624 if test "$PKGCONFIG" != "no" ; then
1625 SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1626 $PKGCONFIG --libs-only-l openssl 2>/dev/null`
1628 SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1629 $PKGCONFIG --libs-only-L openssl 2>/dev/null`
1631 SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1632 $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1635 AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
1636 AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
1637 AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
1639 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1641 dnl use the values pkg-config reported. This is here
1642 dnl instead of below with CPPFLAGS and LDFLAGS because we only
1643 dnl learn about this via pkg-config. If we only have
1644 dnl the argument to --with-ssl we don't know what
1645 dnl additional libs may be necessary. Hope that we
1647 LIBS="$SSL_LIBS $LIBS"
1651 dnl finally, set flags to use SSL
1652 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1653 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1655 AC_CHECK_LIB(crypto, HMAC_Update,[
1657 LIBS="-lcrypto $LIBS"
1659 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1660 if test "$PKGCONFIG" = "no" ; then
1661 # only set this if pkg-config wasn't used
1662 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1664 AC_CHECK_LIB(crypto, HMAC_Init_ex,[
1666 LIBS="-lcrypto $LIBS"], [
1668 dnl still no, but what about with -ldl?
1669 AC_MSG_CHECKING([OpenSSL linking with -ldl])
1670 LIBS="$CLEANLIBS -lcrypto -ldl"
1673 #include <openssl/err.h>
1684 dnl ok, so what about both -ldl and -lpthread?
1686 AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
1687 LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
1690 #include <openssl/err.h>
1701 LDFLAGS="$CLEANLDFLAGS"
1702 CPPFLAGS="$CLEANCPPFLAGS"
1712 if test X"$HAVECRYPTO" = X"yes"; then
1713 dnl This is only reasonable to do if crypto actually is there: check for
1714 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1716 AC_CHECK_LIB(ssl, SSL_connect)
1718 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1719 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1720 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1722 LIBS="-lRSAglue -lrsaref $LIBS"
1723 AC_CHECK_LIB(ssl, SSL_connect)
1724 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1725 dnl still no SSL_connect
1734 dnl Have the libraries--check for OpenSSL headers
1735 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1736 openssl/pem.h openssl/ssl.h openssl/err.h,
1738 test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1740 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1742 if test $ac_cv_header_openssl_x509_h = no; then
1743 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1744 dnl since 'err.h' might in fact find a krb4 header with the same
1746 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1748 if test $ac_cv_header_x509_h = yes &&
1749 test $ac_cv_header_crypto_h = yes &&
1750 test $ac_cv_header_ssl_h = yes; then
1758 if test X"$OPENSSL_ENABLED" != X"1"; then
1762 if test X"$OPT_SSL" != Xoff &&
1763 test "$OPENSSL_ENABLED" != "1"; then
1764 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1768 if test X"$OPENSSL_ENABLED" = X"1"; then
1769 dnl These can only exist if OpenSSL exists
1770 dnl Older versions of Cyassl (some time before 2.9.4) don't have
1771 dnl SSL_get_shutdown (but this check won't actually detect it there
1772 dnl as it's a macro that needs the header files be included)
1774 AC_CHECK_FUNCS( RAND_egd \
1777 SSLv2_client_method )
1779 AC_MSG_CHECKING([for BoringSSL])
1782 #include <openssl/base.h>
1784 #ifndef OPENSSL_IS_BORINGSSL
1785 #error not boringssl
1789 AC_MSG_RESULT([yes])
1790 AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
1791 [Define to 1 if using BoringSSL.])
1797 AC_MSG_CHECKING([for libressl])
1800 #include <openssl/opensslv.h>
1802 int dummy = LIBRESSL_VERSION_NUMBER;
1805 AC_MSG_RESULT([yes])
1806 AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1,
1807 [Define to 1 if using libressl.])
1814 if test "$OPENSSL_ENABLED" = "1"; then
1815 if test -n "$LIB_OPENSSL"; then
1816 dnl when the ssl shared libs were found in a path that the run-time
1817 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1818 dnl to prevent further configure tests to fail due to this
1819 if test "x$cross_compiling" != "xyes"; then
1820 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL"
1821 export CURL_LIBRARY_PATH
1822 AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH])
1825 CURL_CHECK_OPENSSL_API
1826 check_for_ca_bundle=1
1829 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
1832 dnl **********************************************************************
1833 dnl Check for the random seed preferences
1834 dnl **********************************************************************
1836 if test X"$OPENSSL_ENABLED" = X"1"; then
1837 AC_ARG_WITH(egd-socket,
1838 AC_HELP_STRING([--with-egd-socket=FILE],
1839 [Entropy Gathering Daemon socket pathname]),
1840 [ EGD_SOCKET="$withval" ]
1842 if test -n "$EGD_SOCKET" ; then
1843 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1844 [your Entropy Gathering Daemon socket pathname] )
1847 dnl Check for user-specified random device
1849 AC_HELP_STRING([--with-random=FILE],
1850 [read randomness from FILE (default=/dev/urandom)]),
1851 [ RANDOM_FILE="$withval" ],
1853 if test x$cross_compiling != xyes; then
1854 dnl Check for random device
1855 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1857 AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
1861 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1862 AC_SUBST(RANDOM_FILE)
1863 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1864 [a suitable file to read random data from])
1869 dnl We require OpenSSL with SRP support.
1871 if test "$OPENSSL_ENABLED" = "1"; then
1872 AC_CHECK_LIB(crypto, SRP_Calc_client_key,
1874 AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
1875 AC_SUBST(HAVE_OPENSSL_SRP, [1])
1880 dnl Whether the OpenSSL configuration will be loaded automatically
1882 if test X"$OPENSSL_ENABLED" = X"1"; then
1883 AC_ARG_ENABLE(openssl-auto-load-config,
1884 AC_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration])
1885 AC_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]),
1886 [ if test X"$enableval" = X"no"; then
1887 AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled])
1888 AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically])
1893 dnl ----------------------------------------------------
1894 dnl check for GnuTLS
1895 dnl ----------------------------------------------------
1897 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1900 AC_ARG_WITH(gnutls,dnl
1901 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
1902 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1903 OPT_GNUTLS=$withval)
1905 if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then
1908 if test X"$OPT_GNUTLS" != Xno; then
1916 if test "x$OPT_GNUTLS" = "xyes"; then
1917 dnl this is with no partiular path given
1918 CURL_CHECK_PKGCONFIG(gnutls)
1920 if test "$PKGCONFIG" != "no" ; then
1921 addlib=`$PKGCONFIG --libs-only-l gnutls`
1922 addld=`$PKGCONFIG --libs-only-L gnutls`
1923 addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1924 version=`$PKGCONFIG --modversion gnutls`
1925 gtlslib=`echo $addld | $SED -e 's/-L//'`
1927 dnl without pkg-config, we try libgnutls-config as that was how it
1929 check=`libgnutls-config --version 2>/dev/null`
1930 if test -n "$check"; then
1931 addlib=`libgnutls-config --libs`
1932 addcflags=`libgnutls-config --cflags`
1933 version=`libgnutls-config --version`
1934 gtlslib=`libgnutls-config --prefix`/lib$libsuff
1938 dnl this is with a given path, first check if there's a libgnutls-config
1939 dnl there and if not, make an educated guess
1940 cfg=$OPT_GNUTLS/bin/libgnutls-config
1941 check=`$cfg --version 2>/dev/null`
1942 if test -n "$check"; then
1943 addlib=`$cfg --libs`
1944 addcflags=`$cfg --cflags`
1945 version=`$cfg --version`
1946 gtlslib=`$cfg --prefix`/lib$libsuff
1948 dnl without pkg-config and libgnutls-config, we guess a lot!
1950 addld=-L$OPT_GNUTLS/lib$libsuff
1951 addcflags=-I$OPT_GNUTLS/include
1952 version="" # we just don't know
1953 gtlslib=$OPT_GNUTLS/lib$libsuff
1957 if test -z "$version"; then
1958 dnl lots of efforts, still no go
1962 if test -n "$addlib"; then
1965 CLEANCPPFLAGS="$CPPFLAGS"
1966 CLEANLDFLAGS="$LDFLAGS"
1968 LIBS="$addlib $LIBS"
1969 LDFLAGS="$LDFLAGS $addld"
1970 if test "$addcflags" != "-I/usr/include"; then
1971 CPPFLAGS="$CPPFLAGS $addcflags"
1974 AC_CHECK_LIB(gnutls, gnutls_check_version,
1976 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1977 AC_SUBST(USE_GNUTLS, [1])
1981 test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
1985 CPPFLAGS="$CLEANCPPFLAGS"
1988 if test "x$USE_GNUTLS" = "xyes"; then
1989 AC_MSG_NOTICE([detected GnuTLS version $version])
1990 check_for_ca_bundle=1
1991 if test -n "$gtlslib"; then
1992 dnl when shared libs were found in a path that the run-time
1993 dnl linker doesn't search through, we need to add it to
1994 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
1996 if test "x$cross_compiling" != "xyes"; then
1997 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$gtlslib"
1998 export CURL_LIBRARY_PATH
1999 AC_MSG_NOTICE([Added $gtlslib to CURL_LIBRARY_PATH])
2002 AC_CHECK_FUNCS([gnutls_certificate_set_x509_key_file2 gnutls_alpn_set_protocols gnutls_ocsp_req_init])
2007 fi dnl GNUTLS not disabled
2009 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2013 dnl Check which crypto backend GnuTLS uses
2016 if test "$GNUTLS_ENABLED" = "1"; then
2018 # First check if we can detect either crypto library via transitive linking
2019 AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2020 if test "$USE_GNUTLS_NETTLE" = ""; then
2021 AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2023 # If not, try linking directly to both of them to see if they are available
2024 if test "$USE_GNUTLS_NETTLE" = ""; then
2025 AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
2027 if test "$USE_GNUTLS_NETTLE" = ""; then
2028 AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
2030 if test "$USE_GNUTLS_NETTLE" = ""; then
2031 AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
2033 if test "$USE_GNUTLS_NETTLE" = "1"; then
2034 AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
2035 AC_SUBST(USE_GNUTLS_NETTLE, [1])
2036 LIBS="-lnettle $LIBS"
2038 LIBS="-lgcrypt $LIBS"
2043 dnl We require GnuTLS with SRP support.
2045 if test "$GNUTLS_ENABLED" = "1"; then
2046 AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
2048 AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
2049 AC_SUBST(HAVE_GNUTLS_SRP, [1])
2053 dnl ----------------------------------------------------
2054 dnl check for PolarSSL
2055 dnl ----------------------------------------------------
2057 dnl Default to compiler & linker defaults for PolarSSL files & libraries.
2062 AC_ARG_WITH(polarssl,dnl
2063 AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root])
2064 AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
2065 OPT_POLARSSL=$withval)
2067 if test -z "$ssl_backends" -o "x$OPT_POLARSSL" != xno; then
2070 if test X"$OPT_POLARSSL" != Xno; then
2072 if test "$OPT_POLARSSL" = "yes"; then
2076 if test -z "$OPT_POLARSSL" ; then
2077 dnl check for lib first without setting any new path
2079 AC_CHECK_LIB(polarssl, havege_init,
2080 dnl libpolarssl found, set the variable
2082 AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
2083 AC_SUBST(USE_POLARSSL, [1])
2087 test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2096 if test "x$USE_POLARSSL" != "xyes"; then
2097 dnl add the path and test again
2098 addld=-L$OPT_POLARSSL/lib$libsuff
2099 addcflags=-I$OPT_POLARSSL/include
2100 polarssllib=$OPT_POLARSSL/lib$libsuff
2102 LDFLAGS="$LDFLAGS $addld"
2103 if test "$addcflags" != "-I/usr/include"; then
2104 CPPFLAGS="$CPPFLAGS $addcflags"
2107 AC_CHECK_LIB(polarssl, ssl_init,
2109 AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
2110 AC_SUBST(USE_POLARSSL, [1])
2114 test polarssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2122 if test "x$USE_POLARSSL" = "xyes"; then
2123 AC_MSG_NOTICE([detected PolarSSL])
2124 check_for_ca_bundle=1
2125 LIBS="-lpolarssl $LIBS"
2127 if test -n "$polarssllib"; then
2128 dnl when shared libs were found in a path that the run-time
2129 dnl linker doesn't search through, we need to add it to
2130 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2132 if test "x$cross_compiling" != "xyes"; then
2133 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$polarssllib"
2134 export CURL_LIBRARY_PATH
2135 AC_MSG_NOTICE([Added $polarssllib to CURL_LIBRARY_PATH])
2140 fi dnl PolarSSL not disabled
2142 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2145 dnl ----------------------------------------------------
2146 dnl check for mbedTLS
2147 dnl ----------------------------------------------------
2153 AC_ARG_WITH(mbedtls,dnl
2154 AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root])
2155 AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]),
2156 OPT_MBEDTLS=$withval)
2158 if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then
2161 if test X"$OPT_MBEDTLS" != Xno; then
2163 if test "$OPT_MBEDTLS" = "yes"; then
2167 if test -z "$OPT_MBEDTLS" ; then
2168 dnl check for lib first without setting any new path
2170 AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
2171 dnl libmbedtls found, set the variable
2173 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2174 AC_SUBST(USE_MBEDTLS, [1])
2178 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2179 ], [], -lmbedx509 -lmbedcrypto)
2187 if test "x$USE_MBEDTLS" != "xyes"; then
2188 dnl add the path and test again
2189 addld=-L$OPT_MBEDTLS/lib$libsuff
2190 addcflags=-I$OPT_MBEDTLS/include
2191 mbedtlslib=$OPT_MBEDTLS/lib$libsuff
2193 LDFLAGS="$LDFLAGS $addld"
2194 if test "$addcflags" != "-I/usr/include"; then
2195 CPPFLAGS="$CPPFLAGS $addcflags"
2198 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
2200 AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
2201 AC_SUBST(USE_MBEDTLS, [1])
2205 test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2210 ], -lmbedx509 -lmbedcrypto)
2213 if test "x$USE_MBEDTLS" = "xyes"; then
2214 AC_MSG_NOTICE([detected mbedTLS])
2215 check_for_ca_bundle=1
2217 LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS"
2219 if test -n "$mbedtlslib"; then
2220 dnl when shared libs were found in a path that the run-time
2221 dnl linker doesn't search through, we need to add it to
2222 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2224 if test "x$cross_compiling" != "xyes"; then
2225 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$mbedtlslib"
2226 export CURL_LIBRARY_PATH
2227 AC_MSG_NOTICE([Added $mbedtlslib to CURL_LIBRARY_PATH])
2232 fi dnl mbedTLS not disabled
2234 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2237 dnl ----------------------------------------------------
2238 dnl check for CyaSSL
2239 dnl ----------------------------------------------------
2241 dnl Default to compiler & linker defaults for CyaSSL files & libraries.
2246 AC_ARG_WITH(cyassl,dnl
2247 AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)])
2248 AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
2249 OPT_CYASSL=$withval)
2251 dnl provide --with-wolfssl as an alias for --with-cyassl
2252 AC_ARG_WITH(wolfssl,dnl
2253 AC_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)])
2254 AC_HELP_STRING([--without-wolfssl], [disable WolfSSL detection]),
2255 OPT_CYASSL=$withval)
2257 if test -z "$ssl_backends" -o "x$OPT_CYASSL" != xno; then
2260 if test X"$OPT_CYASSL" != Xno; then
2262 if test "$OPT_CYASSL" = "yes"; then
2266 dnl This should be reworked to use pkg-config instead
2268 cyassllibname=cyassl
2270 if test -z "$OPT_CYASSL" ; then
2271 dnl check for lib in system default first
2273 AC_CHECK_LIB(cyassl, CyaSSL_Init,
2274 dnl libcyassl found, set the variable
2276 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
2277 AC_SUBST(USE_CYASSL, [1])
2281 test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2290 if test "x$USE_CYASSL" != "xyes"; then
2291 dnl add the path and test again
2292 addld=-L$OPT_CYASSL/lib$libsuff
2293 addcflags=-I$OPT_CYASSL/include
2294 cyassllib=$OPT_CYASSL/lib$libsuff
2296 LDFLAGS="$LDFLAGS $addld"
2297 if test "$addcflags" != "-I/usr/include"; then
2298 CPPFLAGS="$CPPFLAGS $addcflags"
2301 AC_CHECK_LIB(cyassl, CyaSSL_Init,
2303 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
2304 AC_SUBST(USE_CYASSL, [1])
2308 test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2321 if test "x$USE_CYASSL" != "xyes"; then
2322 dnl libcyassl renamed to libwolfssl as of 3.4.0
2323 addld=-L$OPT_CYASSL/lib$libsuff
2324 addcflags=-I$OPT_CYASSL/include
2325 cyassllib=$OPT_CYASSL/lib$libsuff
2327 LDFLAGS="$LDFLAGS $addld"
2328 if test "$addcflags" != "-I/usr/include"; then
2329 CPPFLAGS="$CPPFLAGS $addcflags"
2332 cyassllibname=wolfssl
2333 my_ac_save_LIBS="$LIBS"
2334 LIBS="-l$cyassllibname -lm $LIBS"
2336 AC_MSG_CHECKING([for CyaSSL_Init in -lwolfssl])
2339 /* These aren't needed for detection and confuse WolfSSL.
2340 They are set up properly later if it is detected. */
2342 #undef SIZEOF_LONG_LONG
2343 #include <cyassl/ssl.h>
2345 return CyaSSL_Init();
2349 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL/WolfSSL is enabled])
2350 AC_SUBST(USE_CYASSL, [1])
2354 test cyassl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2362 LIBS="$my_ac_save_LIBS"
2365 if test "x$USE_CYASSL" = "xyes"; then
2366 AC_MSG_NOTICE([detected $cyassllibname])
2367 check_for_ca_bundle=1
2369 dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
2370 AX_COMPILE_CHECK_SIZEOF(long long)
2372 dnl Versions since at least 2.6.0 may have options.h
2373 AC_CHECK_HEADERS(cyassl/options.h)
2375 dnl Versions since at least 2.9.4 renamed error.h to error-ssl.h
2376 AC_CHECK_HEADERS(cyassl/error-ssl.h)
2378 LIBS="-l$cyassllibname -lm $LIBS"
2380 if test "x$cyassllibname" = "xwolfssl"; then
2381 dnl Recent WolfSSL versions build without SSLv3 by default
2382 dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
2383 AC_CHECK_FUNCS(wolfSSLv3_client_method \
2384 wolfSSL_CTX_UseSupportedCurve \
2385 wolfSSL_get_peer_certificate \
2388 dnl Cyassl needs configure --enable-opensslextra to have *get_peer*
2389 AC_CHECK_FUNCS(CyaSSL_CTX_UseSupportedCurve \
2390 CyaSSL_get_peer_certificate)
2393 if test -n "$cyassllib"; then
2394 dnl when shared libs were found in a path that the run-time
2395 dnl linker doesn't search through, we need to add it to
2396 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2398 if test "x$cross_compiling" != "xyes"; then
2399 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$cyassllib"
2400 export CURL_LIBRARY_PATH
2401 AC_MSG_NOTICE([Added $cyassllib to CURL_LIBRARY_PATH])
2407 fi dnl CyaSSL not disabled
2409 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2412 dnl ----------------------------------------------------
2413 dnl check for MesaLink
2414 dnl ----------------------------------------------------
2416 dnl Default to compiler & linker defaults for MesaLink files & libraries.
2421 AC_ARG_WITH(mesalink,dnl
2422 AC_HELP_STRING([--with-mesalink=PATH],[where to look for MesaLink, PATH points to the installation root])
2423 AC_HELP_STRING([--without-mesalink], [disable MesaLink detection]),
2424 OPT_MESALINK=$withval)
2426 if test -z "$ssl_backends" -o "x$OPT_MESALINK" != xno; then
2429 if test X"$OPT_MESALINK" != Xno; then
2431 if test "$OPT_MESALINK" = "yes"; then
2435 if test -z "$OPT_MESALINK" ; then
2436 dnl check for lib first without setting any new path
2438 AC_CHECK_LIB(mesalink, mesalink_library_init,
2439 dnl libmesalink found, set the variable
2441 AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
2442 AC_SUBST(USE_MESALINK, [1])
2446 test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2455 if test "x$USE_MESALINK" != "xyes"; then
2456 dnl add the path and test again
2457 addld=-L$OPT_MESALINK/lib$libsuff
2458 addcflags=-I$OPT_MESALINK/include
2459 mesalinklib=$OPT_MESALINK/lib$libsuff
2461 LDFLAGS="$LDFLAGS $addld"
2462 if test "$addcflags" != "-I/usr/include"; then
2463 CPPFLAGS="$CPPFLAGS $addcflags"
2466 AC_CHECK_LIB(mesalink, mesalink_library_init,
2468 AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
2469 AC_SUBST(USE_MESALINK, [1])
2473 test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2481 if test "x$USE_MESALINK" = "xyes"; then
2482 AC_MSG_NOTICE([detected MesaLink])
2484 LIBS="-lmesalink $LIBS"
2486 if test -n "$mesalinklib"; then
2487 dnl when shared libs were found in a path that the run-time
2488 dnl linker doesn't search through, we need to add it to
2489 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2491 if test "x$cross_compiling" != "xyes"; then
2492 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mesalinklib"
2493 export LD_LIBRARY_PATH
2494 AC_MSG_NOTICE([Added $mesalinklib to LD_LIBRARY_PATH])
2499 fi dnl MesaLink not disabled
2501 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2504 dnl ----------------------------------------------------
2505 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
2506 dnl ----------------------------------------------------
2508 dnl Default to compiler & linker defaults for NSS files & libraries.
2512 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
2513 AC_HELP_STRING([--without-nss], [disable NSS detection]),
2516 if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then
2519 if test X"$OPT_NSS" != Xno; then
2527 if test "x$OPT_NSS" = "xyes"; then
2529 CURL_CHECK_PKGCONFIG(nss)
2531 if test "$PKGCONFIG" != "no" ; then
2532 addlib=`$PKGCONFIG --libs nss`
2533 addcflags=`$PKGCONFIG --cflags nss`
2534 version=`$PKGCONFIG --modversion nss`
2535 nssprefix=`$PKGCONFIG --variable=prefix nss`
2537 dnl Without pkg-config, we check for nss-config
2539 check=`nss-config --version 2>/dev/null`
2540 if test -n "$check"; then
2541 addlib=`nss-config --libs`
2542 addcflags=`nss-config --cflags`
2543 version=`nss-config --version`
2544 nssprefix=`nss-config --prefix`
2552 NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
2553 if test -f "$NSS_PCDIR/nss.pc"; then
2554 CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
2555 if test "$PKGCONFIG" != "no" ; then
2556 addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
2557 addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
2558 addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
2559 version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
2560 nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
2565 if test -z "$addlib"; then
2566 # Without pkg-config, we'll kludge in some defaults
2567 AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
2568 addld="-L$OPT_NSS/lib"
2569 addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
2570 addcflags="-I$OPT_NSS/include"
2575 CLEANLDFLAGS="$LDFLAGS"
2577 CLEANCPPFLAGS="$CPPFLAGS"
2579 LDFLAGS="$addld $LDFLAGS"
2580 LIBS="$addlib $LIBS"
2581 if test "$addcflags" != "-I/usr/include"; then
2582 CPPFLAGS="$CPPFLAGS $addcflags"
2585 dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
2586 AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
2588 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
2589 AC_SUBST(USE_NSS, [1])
2593 test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2596 LDFLAGS="$CLEANLDFLAGS"
2598 CPPFLAGS="$CLEANCPPFLAGS"
2601 if test "x$USE_NSS" = "xyes"; then
2602 AC_MSG_NOTICE([detected NSS version $version])
2604 dnl PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
2605 dnl PK11_DestroyGenericObject() does not release resources allocated by
2606 dnl PK11_CreateGenericObject() early enough.
2607 AC_CHECK_FUNC(PK11_CreateManagedGenericObject,
2609 AC_DEFINE(HAVE_PK11_CREATEMANAGEDGENERICOBJECT, 1,
2610 [if you have the PK11_CreateManagedGenericObject function])
2613 dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
2615 AC_SUBST([NSS_LIBS])
2617 dnl when shared libs were found in a path that the run-time
2618 dnl linker doesn't search through, we need to add it to
2619 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
2621 if test "x$cross_compiling" != "xyes"; then
2622 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$nssprefix/lib$libsuff"
2623 export CURL_LIBRARY_PATH
2624 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to CURL_LIBRARY_PATH])
2629 fi dnl NSS not disabled
2631 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2636 AC_ARG_WITH(axtls,dnl
2637 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.])
2638 AC_HELP_STRING([--without-axtls], [disable axTLS]),
2641 if test -z "$ssl_backends" -o "x$OPT_AXTLS" != xno; then
2643 if test X"$OPT_AXTLS" != Xno; then
2644 dnl backup the pre-axtls variables
2645 CLEANLDFLAGS="$LDFLAGS"
2646 CLEANCPPFLAGS="$CPPFLAGS"
2649 case "$OPT_AXTLS" in
2651 dnl --with-axtls (without path) used
2652 PREFIX_AXTLS=/usr/local
2653 LIB_AXTLS="$PREFIX_AXTLS/lib"
2654 LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
2655 CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
2658 dnl no --with-axtls option given, just check default places
2662 dnl check the given --with-axtls spot
2663 PREFIX_AXTLS=$OPT_AXTLS
2664 LIB_AXTLS="$PREFIX_AXTLS/lib"
2665 LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
2666 CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
2670 AC_CHECK_LIB(axtls, ssl_version,[
2671 LIBS="-laxtls $LIBS"
2672 AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled])
2673 AC_SUBST(USE_AXTLS, [1])
2675 check_for_ca_bundle=1
2678 test axtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
2680 if test "x$cross_compiling" != "xyes"; then
2681 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_AXTLS"
2682 export CURL_LIBRARY_PATH
2683 AC_MSG_NOTICE([Added $LIB_AXTLS to CURL_LIBRARY_PATH])
2686 LDFLAGS="$CLEANLDFLAGS"
2687 CPPFLAGS="$CLEANCPPFLAGS"
2691 test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
2694 case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$MBEDTLS_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED$MESALINK_ENABLED" in
2696 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
2697 AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, --with-darwinssl, or --with-mesalink to address this.])
2700 # one SSL backend is enabled
2701 AC_SUBST(SSL_ENABLED)
2703 AC_MSG_NOTICE([built with one SSL backend])
2706 # more than one SSL backend is enabled
2707 AC_SUBST(SSL_ENABLED)
2709 AC_SUBST(CURL_WITH_MULTI_SSL)
2710 CURL_WITH_MULTI_SSL="1"
2711 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
2712 AC_MSG_NOTICE([built with multiple SSL backends])
2716 if test -n "$ssl_backends"; then
2717 curl_ssl_msg="enabled ($ssl_backends)"
2720 if test no = "$VALID_DEFAULT_SSL_BACKEND"
2722 if test -n "$SSL_ENABLED"
2724 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
2726 AC_MSG_ERROR([Default SSL backend requires SSL!])
2728 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
2730 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
2733 dnl **********************************************************************
2734 dnl Check for the CA bundle
2735 dnl **********************************************************************
2737 if test "$check_for_ca_bundle" -gt 0; then
2738 CURL_CHECK_CA_BUNDLE
2741 dnl **********************************************************************
2742 dnl Check for libpsl
2743 dnl **********************************************************************
2746 AS_HELP_STRING([--without-libpsl],
2747 [disable support for libpsl cookie checking]),
2748 with_libpsl=$withval,
2750 if test $with_libpsl != "no"; then
2751 AC_SEARCH_LIBS(psl_builtin, psl,
2752 [curl_psl_msg="yes";
2753 AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
2755 [curl_psl_msg="no (libpsl not found)";
2756 AC_MSG_WARN([libpsl was not found])
2760 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "yes"])
2762 dnl **********************************************************************
2763 dnl Check for libmetalink
2764 dnl **********************************************************************
2768 AC_ARG_WITH(libmetalink,dnl
2769 AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
2770 AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
2771 OPT_LIBMETALINK=$withval)
2773 if test X"$OPT_LIBMETALINK" != Xno; then
2782 if test "x$OPT_LIBMETALINK" = "xyes"; then
2783 dnl this is with no partiular path given
2785 CURL_CHECK_PKGCONFIG(libmetalink)
2787 dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
2788 LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
2789 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
2790 if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
2793 if test "$PKGTEST" = "yes"; then
2794 CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
2797 if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
2798 addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2799 $PKGCONFIG --libs-only-l libmetalink`
2800 addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2801 $PKGCONFIG --libs-only-L libmetalink`
2802 addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2803 $PKGCONFIG --cflags-only-I libmetalink`
2804 version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2805 $PKGCONFIG --modversion libmetalink`
2806 libmetalinklib=`echo $addld | $SED -e 's/-L//'`
2808 if test -n "$addlib"; then
2810 clean_CPPFLAGS="$CPPFLAGS"
2811 clean_LDFLAGS="$LDFLAGS"
2813 CPPFLAGS="$clean_CPPFLAGS $addcflags"
2814 LDFLAGS="$clean_LDFLAGS $addld"
2815 LIBS="$addlib $clean_LIBS"
2816 AC_MSG_CHECKING([if libmetalink is recent enough])
2819 # include <metalink/metalink.h>
2821 if(0 != metalink_strerror(0)) /* added in 0.1.0 */
2825 AC_MSG_RESULT([yes ($version)])
2828 AC_MSG_RESULT([no ($version)])
2829 AC_MSG_NOTICE([libmetalink library defective or too old])
2832 CPPFLAGS="$clean_CPPFLAGS"
2833 LDFLAGS="$clean_LDFLAGS"
2835 if test "$want_metalink" = "yes"; then
2836 dnl finally libmetalink will be used
2837 AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
2838 LIBMETALINK_LIBS=$addlib
2839 LIBMETALINK_LDFLAGS=$addld
2840 LIBMETALINK_CPPFLAGS=$addcflags
2841 AC_SUBST([LIBMETALINK_LIBS])
2842 AC_SUBST([LIBMETALINK_LDFLAGS])
2843 AC_SUBST([LIBMETALINK_CPPFLAGS])
2844 curl_mtlnk_msg="enabled"
2850 dnl **********************************************************************
2851 dnl Check for the presence of LIBSSH2 libraries and headers
2852 dnl **********************************************************************
2854 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
2856 AC_ARG_WITH(libssh2,dnl
2857 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])
2858 AC_HELP_STRING([--with-libssh2], [enable LIBSSH2]),
2859 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
2863 AC_ARG_WITH(libssh,dnl
2864 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])
2865 AC_HELP_STRING([--with-libssh], [enable LIBSSH]),
2866 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2868 if test X"$OPT_LIBSSH2" != Xno; then
2869 dnl backup the pre-libssh2 variables
2870 CLEANLDFLAGS="$LDFLAGS"
2871 CLEANCPPFLAGS="$CPPFLAGS"
2874 case "$OPT_LIBSSH2" in
2876 dnl --with-libssh2 (without path) used
2877 CURL_CHECK_PKGCONFIG(libssh2)
2879 if test "$PKGCONFIG" != "no" ; then
2880 LIB_SSH2=`$PKGCONFIG --libs libssh2`
2881 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2882 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2883 version=`$PKGCONFIG --modversion libssh2`
2884 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
2889 dnl no --with-libssh2 option given, just check default places
2892 dnl use the given --with-libssh2 spot
2893 PREFIX_SSH2=$OPT_LIBSSH2
2897 dnl if given with a prefix, we set -L and -I based on that
2898 if test -n "$PREFIX_SSH2"; then
2900 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2901 CPP_SSH2=-I${PREFIX_SSH2}/include
2902 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2905 LDFLAGS="$LDFLAGS $LD_SSH2"
2906 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2907 LIBS="$LIB_SSH2 $LIBS"
2909 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
2911 AC_CHECK_HEADERS(libssh2.h,
2912 curl_ssh_msg="enabled (libSSH2)"
2914 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2915 AC_SUBST(USE_LIBSSH2, [1])
2918 if test X"$OPT_LIBSSH2" != Xoff &&
2919 test "$LIBSSH2_ENABLED" != "1"; then
2920 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2923 if test "$LIBSSH2_ENABLED" = "1"; then
2924 if test -n "$DIR_SSH2"; then
2925 dnl when the libssh2 shared libs were found in a path that the run-time
2926 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2927 dnl to prevent further configure tests to fail due to this
2929 if test "x$cross_compiling" != "xyes"; then
2930 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
2931 export CURL_LIBRARY_PATH
2932 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2936 dnl no libssh2, revert back to clean variables
2937 LDFLAGS=$CLEANLDFLAGS
2938 CPPFLAGS=$CLEANCPPFLAGS
2941 elif test X"$OPT_LIBSSH" != Xno; then
2942 dnl backup the pre-libssh variables
2943 CLEANLDFLAGS="$LDFLAGS"
2944 CLEANCPPFLAGS="$CPPFLAGS"
2947 case "$OPT_LIBSSH" in
2949 dnl --with-libssh (without path) used
2950 CURL_CHECK_PKGCONFIG(libssh)
2952 if test "$PKGCONFIG" != "no" ; then
2953 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2954 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2955 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2956 version=`$PKGCONFIG --modversion libssh`
2957 DIR_SSH=`echo $LD_SSH | $SED -e 's/-L//'`
2962 dnl no --with-libssh option given, just check default places
2965 dnl use the given --with-libssh spot
2966 PREFIX_SSH=$OPT_LIBSSH
2970 dnl if given with a prefix, we set -L and -I based on that
2971 if test -n "$PREFIX_SSH"; then
2973 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2974 CPP_SSH=-I${PREFIX_SSH}/include
2975 DIR_SSH=${PREFIX_SSH}/lib$libsuff
2978 LDFLAGS="$LDFLAGS $LD_SSH"
2979 CPPFLAGS="$CPPFLAGS $CPP_SSH"
2980 LIBS="$LIB_SSH $LIBS"
2982 AC_CHECK_LIB(ssh, ssh_new)
2984 AC_CHECK_HEADERS(libssh/libssh.h,
2985 curl_ssh_msg="enabled (libSSH)"
2987 AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
2988 AC_SUBST(USE_LIBSSH, [1])
2991 if test X"$OPT_LIBSSH" != Xoff &&
2992 test "$LIBSSH_ENABLED" != "1"; then
2993 AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
2996 if test "$LIBSSH_ENABLED" = "1"; then
2997 if test -n "$DIR_SSH"; then
2998 dnl when the libssh shared libs were found in a path that the run-time
2999 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
3000 dnl to prevent further configure tests to fail due to this
3002 if test "x$cross_compiling" != "xyes"; then
3003 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
3004 export CURL_LIBRARY_PATH
3005 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
3009 dnl no libssh, revert back to clean variables
3010 LDFLAGS=$CLEANLDFLAGS
3011 CPPFLAGS=$CLEANCPPFLAGS
3016 dnl **********************************************************************
3017 dnl Check for the presence of LIBRTMP libraries and headers
3018 dnl **********************************************************************
3020 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
3022 AC_ARG_WITH(librtmp,dnl
3023 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])
3024 AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
3025 OPT_LIBRTMP=$withval)
3027 if test X"$OPT_LIBRTMP" != Xno; then
3028 dnl backup the pre-librtmp variables
3029 CLEANLDFLAGS="$LDFLAGS"
3030 CLEANCPPFLAGS="$CPPFLAGS"
3033 case "$OPT_LIBRTMP" in
3035 dnl --with-librtmp (without path) used
3036 CURL_CHECK_PKGCONFIG(librtmp)
3038 if test "$PKGCONFIG" != "no" ; then
3039 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
3040 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
3041 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
3042 version=`$PKGCONFIG --modversion librtmp`
3043 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
3045 dnl To avoid link errors, we do not allow --librtmp without
3046 dnl a pkgconfig file
3047 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
3052 dnl no --with-librtmp option given, just check default places
3056 dnl use the given --with-librtmp spot
3058 PREFIX_RTMP=$OPT_LIBRTMP
3062 dnl if given with a prefix, we set -L and -I based on that
3063 if test -n "$PREFIX_RTMP"; then
3064 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
3065 CPP_RTMP=-I${PREFIX_RTMP}/include
3066 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
3069 LDFLAGS="$LDFLAGS $LD_RTMP"
3070 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
3071 LIBS="$LIB_RTMP $LIBS"
3073 AC_CHECK_LIB(rtmp, RTMP_Init,
3075 AC_CHECK_HEADERS(librtmp/rtmp.h,
3076 curl_rtmp_msg="enabled (librtmp)"
3078 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
3079 AC_SUBST(USE_LIBRTMP, [1])
3082 dnl not found, revert back to clean variables
3083 LDFLAGS=$CLEANLDFLAGS
3084 CPPFLAGS=$CLEANCPPFLAGS
3088 if test X"$OPT_LIBRTMP" != Xoff &&
3089 test "$LIBRTMP_ENABLED" != "1"; then
3090 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
3095 dnl **********************************************************************
3096 dnl Check for linker switch for versioned symbols
3097 dnl **********************************************************************
3099 versioned_symbols_flavour=
3100 AC_MSG_CHECKING([whether versioned symbols are wanted])
3101 AC_ARG_ENABLE(versioned-symbols,
3102 AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
3103 AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
3104 [ case "$enableval" in
3105 yes) AC_MSG_RESULT(yes)
3106 AC_MSG_CHECKING([if libraries can be versioned])
3107 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
3108 if test -z "$GLD"; then
3110 AC_MSG_WARN([You need an ld version supporting the --version-script option])
3113 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
3114 versioned_symbols_flavour="MULTISSL_"
3115 elif test "x$OPENSSL_ENABLED" = "x1"; then
3116 versioned_symbols_flavour="OPENSSL_"
3117 elif test "x$GNUTLS_ENABLED" = "x1"; then
3118 versioned_symbols_flavour="GNUTLS_"
3119 elif test "x$NSS_ENABLED" = "x1"; then
3120 versioned_symbols_flavour="NSS_"
3121 elif test "x$POLARSSL_ENABLED" = "x1"; then
3122 versioned_symbols_flavour="POLARSSL_"
3123 elif test "x$CYASSL_ENABLED" = "x1"; then
3124 versioned_symbols_flavour="CYASSL_"
3125 elif test "x$AXTLS_ENABLED" = "x1"; then
3126 versioned_symbols_flavour="AXTLS_"
3127 elif test "x$WINSSL_ENABLED" = "x1"; then
3128 versioned_symbols_flavour="WINSSL_"
3129 elif test "x$DARWINSSL_ENABLED" = "x1"; then
3130 versioned_symbols_flavour="DARWINSSL_"
3132 versioned_symbols_flavour=""
3134 versioned_symbols="yes"
3138 *) AC_MSG_RESULT(no)
3146 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
3147 ["$versioned_symbols_flavour"])
3148 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
3149 [test "x$versioned_symbols" = 'xyes'])
3151 dnl -------------------------------------------------
3152 dnl check winidn option before other IDN libraries
3153 dnl -------------------------------------------------
3155 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
3156 OPT_WINIDN="default"
3158 AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
3159 AC_HELP_STRING([--without-winidn], [disable Windows native IDN]),
3160 OPT_WINIDN=$withval)
3161 case "$OPT_WINIDN" in
3163 dnl --without-winidn option used or configure option not specified
3168 dnl --with-winidn option used without path
3170 want_winidn_path="default"
3171 AC_MSG_RESULT([yes])
3174 dnl --with-winidn option used with path
3176 want_winidn_path="$withval"
3177 AC_MSG_RESULT([yes ($withval)])
3181 if test "$want_winidn" = "yes"; then
3182 dnl winidn library support has been requested
3183 clean_CPPFLAGS="$CPPFLAGS"
3184 clean_LDFLAGS="$LDFLAGS"
3186 WINIDN_LIBS="-lnormaliz"
3187 WINIDN_CPPFLAGS="-DWINVER=0x0600"
3189 if test "$want_winidn_path" != "default"; then
3190 dnl path has been specified
3191 dnl pkg-config not available or provides no info
3192 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
3193 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
3194 WINIDN_DIR="$want_winidn_path/lib$libsuff"
3197 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
3198 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
3199 LIBS="$WINIDN_LIBS $LIBS"
3201 AC_MSG_CHECKING([if IdnToUnicode can be linked])
3204 #include <windows.h>
3206 IdnToUnicode(0, NULL, 0, NULL, 0);
3209 AC_MSG_RESULT([yes])
3210 tst_links_winidn="yes"
3213 tst_links_winidn="no"
3216 if test "$tst_links_winidn" = "yes"; then
3217 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
3218 AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
3219 AC_SUBST([IDN_ENABLED], [1])
3220 curl_idn_msg="enabled (Windows-native)"
3222 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3223 CPPFLAGS="$clean_CPPFLAGS"
3224 LDFLAGS="$clean_LDFLAGS"
3229 dnl **********************************************************************
3230 dnl Check for the presence of IDN libraries and headers
3231 dnl **********************************************************************
3233 AC_MSG_CHECKING([whether to build with libidn2])
3235 AC_ARG_WITH(libidn2,
3236 AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
3237 AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
3241 dnl --without-libidn2 option used
3246 dnl configure option not specified
3248 want_idn_path="default"
3249 AC_MSG_RESULT([(assumed) yes])
3252 dnl --with-libidn2 option used without path
3254 want_idn_path="default"
3255 AC_MSG_RESULT([yes])
3258 dnl --with-libidn2 option used with path
3260 want_idn_path="$withval"
3261 AC_MSG_RESULT([yes ($withval)])
3265 if test "$want_idn" = "yes"; then
3266 dnl idn library support has been requested
3267 clean_CPPFLAGS="$CPPFLAGS"
3268 clean_LDFLAGS="$LDFLAGS"
3272 if test "$want_idn_path" != "default"; then
3273 dnl path has been specified
3274 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3275 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
3276 if test "$PKGCONFIG" != "no"; then
3277 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3278 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3279 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3280 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3281 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3282 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3283 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3285 dnl pkg-config not available or provides no info
3287 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3288 IDN_CPPFLAGS="-I$want_idn_path/include"
3289 IDN_DIR="$want_idn_path/lib$libsuff"
3292 dnl path not specified
3293 CURL_CHECK_PKGCONFIG(libidn2)
3294 if test "$PKGCONFIG" != "no"; then
3295 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3296 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3297 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3298 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3300 dnl pkg-config not available or provides no info
3305 if test "$PKGCONFIG" != "no"; then
3306 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3307 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3308 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3309 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3311 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3312 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3313 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3314 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3317 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
3318 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
3319 LIBS="$IDN_LIBS $LIBS"
3321 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
3323 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
3325 AC_MSG_RESULT([yes])
3326 tst_links_libidn="yes"
3329 tst_links_libidn="no"
3332 AC_CHECK_HEADERS( idn2.h )
3334 if test "$tst_links_libidn" = "yes"; then
3335 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
3336 dnl different versions of libidn have different setups of these:
3338 AC_SUBST([IDN_ENABLED], [1])
3339 curl_idn_msg="enabled (libidn2)"
3340 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3341 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
3342 export CURL_LIBRARY_PATH
3343 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
3346 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3347 CPPFLAGS="$clean_CPPFLAGS"
3348 LDFLAGS="$clean_LDFLAGS"
3354 dnl Let's hope this split URL remains working:
3355 dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
3356 dnl genprogc/thread_quick_ref.htm
3358 dnl **********************************************************************
3359 dnl Check for ICU-UC (IDN support)
3360 dnl **********************************************************************
3362 AC_MSG_CHECKING([whether to build with icu-uc])
3365 AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
3366 AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
3370 dnl --without-icu-uc option used
3375 dnl configure option not specified
3377 want_idn_path="default"
3378 AC_MSG_RESULT([(assumed) yes])
3381 dnl --with-icu-uc option used without path
3383 want_idn_path="default"
3384 AC_MSG_RESULT([yes])
3387 dnl --with-icu-uc option used with path
3389 want_idn_path="$withval"
3390 AC_MSG_RESULT([yes ($withval)])
3394 if test "$want_idn" = "yes"; then
3395 dnl idn library support has been requested
3396 clean_CPPFLAGS="$CPPFLAGS"
3397 clean_LDFLAGS="$LDFLAGS"
3401 if test "$want_idn_path" != "default"; then
3402 dnl path has been specified
3403 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3404 CURL_CHECK_PKGCONFIG(icu-uc, [$IDN_PCDIR])
3405 if test "$PKGCONFIG" != "no"; then
3406 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3407 $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
3408 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3409 $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
3410 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
3411 $PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
3412 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3414 dnl pkg-config not available or provides no info
3416 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3417 IDN_CPPFLAGS="-I$want_idn_path/include"
3418 IDN_DIR="$want_idn_path/lib$libsuff"
3421 dnl path not specified
3422 CURL_CHECK_PKGCONFIG(icu-uc)
3423 if test "$PKGCONFIG" != "no"; then
3424 IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
3425 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
3426 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
3427 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
3429 dnl pkg-config not available or provides no info
3434 if test "$PKGCONFIG" != "no"; then
3435 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3436 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3437 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3438 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3440 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3441 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3442 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3443 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3446 CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
3447 LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
3448 LIBS="$IDN_LIBS $LIBS"
3450 AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
3452 AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
3454 AC_MSG_RESULT([yes])
3461 if test "$tst_links_icu" = "yes"; then
3462 AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
3463 dnl different versions of libidn have different setups of these:
3465 AC_SUBST([IDN_ENABLED], [1])
3466 curl_idn_msg="enabled (icu-uc)"
3467 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
3468 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
3469 export LD_LIBRARY_PATH
3470 AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
3473 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
3474 CPPFLAGS="$clean_CPPFLAGS"
3475 LDFLAGS="$clean_LDFLAGS"
3481 dnl Let's hope this split URL remains working:
3482 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
3483 dnl genprogc/thread_quick_ref.htm
3485 dnl **********************************************************************
3487 dnl **********************************************************************
3489 AC_ARG_ENABLE([dlp],
3490 AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
3492 AS_IF([test "x$enable_dlp" = "xyes"], [
3493 CPPFLAGS+=" -DUSE_TIZEN_FEATURE_DLP"
3497 AM_CONDITIONAL(USE_TIZEN_FEATURE_DLP, test "x$enable_dlp" = "xyes")
3500 dnl **********************************************************************
3501 dnl Check for nghttp2
3502 dnl **********************************************************************
3506 if test "x$disable_http" = "xyes"; then
3507 # without HTTP, nghttp2 is no use
3511 AC_ARG_WITH(nghttp2,
3512 AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
3513 AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
3517 dnl --without-nghttp2 option used
3521 dnl --with-nghttp2 option used without path
3526 dnl --with-nghttp2 option used with path
3528 want_h2_path="$withval/lib/pkgconfig"
3532 curl_h2_msg="disabled (--with-nghttp2)"
3533 if test X"$want_h2" != Xno; then
3534 dnl backup the pre-nghttp2 variables
3535 CLEANLDFLAGS="$LDFLAGS"
3536 CLEANCPPFLAGS="$CPPFLAGS"
3539 CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path)
3541 if test "$PKGCONFIG" != "no" ; then
3542 LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3543 $PKGCONFIG --libs-only-l libnghttp2`
3544 AC_MSG_NOTICE([-l is $LIB_H2])
3546 CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl
3547 $PKGCONFIG --cflags-only-I libnghttp2`
3548 AC_MSG_NOTICE([-I is $CPP_H2])
3550 LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
3551 $PKGCONFIG --libs-only-L libnghttp2`
3552 AC_MSG_NOTICE([-L is $LD_H2])
3554 LDFLAGS="$LDFLAGS $LD_H2"
3555 CPPFLAGS="$CPPFLAGS $CPP_H2"
3556 LIBS="$LIB_H2 $LIBS"
3558 # use nghttp2_option_set_no_recv_client_magic to require nghttp2
3560 AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic,
3562 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
3563 curl_h2_msg="enabled (nghttp2)"
3565 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
3566 AC_SUBST(USE_NGHTTP2, [1])
3569 dnl not found, revert back to clean variables
3570 LDFLAGS=$CLEANLDFLAGS
3571 CPPFLAGS=$CLEANCPPFLAGS
3576 dnl no nghttp2 pkg-config found, deal with it
3577 if test X"$want_h2" != Xdefault; then
3578 dnl To avoid link errors, we do not allow --with-nghttp2 without
3579 dnl a pkgconfig file
3580 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
3586 dnl **********************************************************************
3587 dnl Check for zsh completion path
3588 dnl **********************************************************************
3590 OPT_ZSH_FPATH=default
3591 AC_ARG_WITH(zsh-functions-dir,
3592 AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3593 AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3594 [OPT_ZSH_FPATH=$withval])
3595 case "$OPT_ZSH_FPATH" in
3597 dnl --without-zsh-functions-dir option used
3600 dnl --with-zsh-functions-dir option used without path
3601 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3602 AC_SUBST(ZSH_FUNCTIONS_DIR)
3605 dnl --with-zsh-functions-dir option used with path
3606 ZSH_FUNCTIONS_DIR="$withval"
3607 AC_SUBST(ZSH_FUNCTIONS_DIR)
3611 dnl **********************************************************************
3612 dnl Back to "normal" configuring
3613 dnl **********************************************************************
3615 dnl Checks for header files.
3618 CURL_CHECK_HEADER_MALLOC
3619 CURL_CHECK_HEADER_MEMORY
3621 dnl Now check for the very most basic headers. Then we can use these
3622 dnl ones as default-headers when checking for the rest!
3666 dnl to do if not found
3670 dnl default includes
3672 #ifdef HAVE_SYS_TYPES_H
3673 #include <sys/types.h>
3675 #ifdef HAVE_SYS_TIME_H
3676 #include <sys/time.h>
3678 #ifdef HAVE_SYS_SELECT_H
3679 #include <sys/select.h>
3681 #ifdef HAVE_SYS_SOCKET_H
3682 #include <sys/socket.h>
3684 #ifdef HAVE_NETINET_IN_H
3685 #include <netinet/in.h>
3687 #ifdef HAVE_NETINET_IN6_H
3688 #include <netinet/in6.h>
3690 #ifdef HAVE_SYS_UN_H
3696 dnl Checks for typedefs, structures, and compiler characteristics.
3698 CURL_CHECK_VARIADIC_MACROS
3701 CURL_CHECK_STRUCT_TIMEVAL
3702 CURL_VERIFY_RUNTIMELIBS
3704 AX_COMPILE_CHECK_SIZEOF(size_t)
3705 AX_COMPILE_CHECK_SIZEOF(long)
3706 AX_COMPILE_CHECK_SIZEOF(int)
3707 AX_COMPILE_CHECK_SIZEOF(short)
3708 AX_COMPILE_CHECK_SIZEOF(time_t)
3709 AX_COMPILE_CHECK_SIZEOF(off_t)
3712 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3713 AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
3714 #include <curl/system.h>
3718 AC_CHECK_TYPE(long long,
3719 [AC_DEFINE(HAVE_LONGLONG, 1,
3720 [Define to 1 if the compiler supports the 'long long' data type.])]
3724 if test "xyes" = "x$longlong"; then
3725 AC_MSG_CHECKING([if numberLL works])
3729 long long val = 1000LL;
3732 AC_MSG_RESULT([yes])
3733 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
3741 AC_CHECK_TYPE(ssize_t, ,
3742 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3744 # check for bool type
3745 AC_CHECK_TYPE([bool],[
3746 AC_DEFINE(HAVE_BOOL_T, 1,
3747 [Define to 1 if bool is an available type.])
3749 #ifdef HAVE_SYS_TYPES_H
3750 #include <sys/types.h>
3752 #ifdef HAVE_STDBOOL_H
3753 #include <stdbool.h>
3757 # check for sa_family_t
3758 AC_CHECK_TYPE(sa_family_t,
3759 AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3762 AC_CHECK_TYPE(ADDRESS_FAMILY,
3763 AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3764 AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3766 #ifdef HAVE_SYS_SOCKET_H
3767 #include <sys/socket.h>
3772 #ifdef HAVE_SYS_SOCKET_H
3773 #include <sys/socket.h>
3777 AC_MSG_CHECKING([if time_t is unsigned])
3785 AC_MSG_RESULT([yes])
3786 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3790 dnl cross-compiling, most systems are unsigned
3794 CURL_CONFIGURE_PULL_SYS_POLL
3798 TYPE_SOCKADDR_STORAGE
3804 CURL_CHECK_FUNC_SELECT
3806 CURL_CHECK_FUNC_RECV
3807 CURL_CHECK_FUNC_SEND
3808 CURL_CHECK_MSG_NOSIGNAL
3810 CURL_CHECK_FUNC_ALARM
3811 CURL_CHECK_FUNC_BASENAME
3812 CURL_CHECK_FUNC_CLOSESOCKET
3813 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3814 CURL_CHECK_FUNC_CONNECT
3815 CURL_CHECK_FUNC_FCNTL
3816 CURL_CHECK_FUNC_FDOPEN
3817 CURL_CHECK_FUNC_FREEADDRINFO
3818 CURL_CHECK_FUNC_FREEIFADDRS
3819 CURL_CHECK_FUNC_FSETXATTR
3820 CURL_CHECK_FUNC_FTRUNCATE
3821 CURL_CHECK_FUNC_GETADDRINFO
3822 CURL_CHECK_FUNC_GAI_STRERROR
3823 CURL_CHECK_FUNC_GETHOSTBYADDR
3824 CURL_CHECK_FUNC_GETHOSTBYADDR_R
3825 CURL_CHECK_FUNC_GETHOSTBYNAME
3826 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3827 CURL_CHECK_FUNC_GETHOSTNAME
3828 CURL_CHECK_FUNC_GETIFADDRS
3829 CURL_CHECK_FUNC_GETSERVBYPORT_R
3830 CURL_CHECK_FUNC_GMTIME_R
3831 CURL_CHECK_FUNC_INET_NTOA_R
3832 CURL_CHECK_FUNC_INET_NTOP
3833 CURL_CHECK_FUNC_INET_PTON
3834 CURL_CHECK_FUNC_IOCTL
3835 CURL_CHECK_FUNC_IOCTLSOCKET
3836 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3837 CURL_CHECK_FUNC_LOCALTIME_R
3838 CURL_CHECK_FUNC_MEMRCHR
3839 CURL_CHECK_FUNC_POLL
3840 CURL_CHECK_FUNC_SETSOCKOPT
3841 CURL_CHECK_FUNC_SIGACTION
3842 CURL_CHECK_FUNC_SIGINTERRUPT
3843 CURL_CHECK_FUNC_SIGNAL
3844 CURL_CHECK_FUNC_SIGSETJMP
3845 CURL_CHECK_FUNC_SOCKET
3846 CURL_CHECK_FUNC_SOCKETPAIR
3847 CURL_CHECK_FUNC_STRCASECMP
3848 CURL_CHECK_FUNC_STRCMPI
3849 CURL_CHECK_FUNC_STRDUP
3850 CURL_CHECK_FUNC_STRERROR_R
3851 CURL_CHECK_FUNC_STRICMP
3852 CURL_CHECK_FUNC_STRNCASECMP
3853 CURL_CHECK_FUNC_STRNCMPI
3854 CURL_CHECK_FUNC_STRNICMP
3855 CURL_CHECK_FUNC_STRSTR
3856 CURL_CHECK_FUNC_STRTOK_R
3857 CURL_CHECK_FUNC_STRTOLL
3858 CURL_CHECK_FUNC_WRITEV
3864 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3868 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
3870 #include <sys/types.h>]])
3873 AC_CHECK_FUNCS([fnmatch \
3882 mach_absolute_time \
3892 eval skipcheck=\$skipcheck_$func
3893 if test "x$skipcheck" != "xyes"; then
3894 AC_MSG_CHECKING([deeper for $func])
3901 AC_MSG_RESULT([yes])
3902 eval "ac_cv_func_$func=yes"
3903 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3904 [Define to 1 if you have the $func function.])
3906 AC_MSG_RESULT([but still no])
3911 if test "$ipv6" = "yes"; then
3912 if test "$curl_cv_func_getaddrinfo" = "yes"; then
3913 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
3915 AC_SUBST(IPV6_ENABLED)
3919 CURL_CHECK_NONBLOCKING_SOCKET
3921 dnl ************************************************************
3922 dnl nroff tool stuff
3925 AC_PATH_PROG( PERL, perl, ,
3926 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3929 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3930 $PATH:/usr/bin/:/usr/local/bin )
3933 if test -n "$NROFF"; then
3934 dnl only check for nroff options if an nroff command was found
3936 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3938 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3939 if test -z "$mancheck"; then
3941 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3942 if test -z "$mancheck"; then
3944 AC_MSG_RESULT([failed])
3945 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3947 AC_MSG_RESULT([$MANOPT])
3950 AC_MSG_RESULT([$MANOPT])
3955 if test -z "$MANOPT"
3957 dnl if no nroff tool was found, or no option that could convert man pages
3958 dnl was found, then disable the built-in manual stuff
3959 AC_MSG_WARN([disabling built-in manual])
3963 dnl *************************************************************************
3964 dnl If the manual variable still is set, then we go with providing a built-in
3967 if test "$USE_MANUAL" = "1"; then
3968 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3969 curl_manual_msg="enabled"
3972 dnl set variable for use in automakefile(s)
3973 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3976 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
3978 if test "x$curl_cv_native_windows" != "xyes" &&
3979 test "x$enable_shared" = "xyes"; then
3980 build_libhostname=yes
3982 build_libhostname=no
3984 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3986 if test "x$want_ares" != xyes; then
3987 CURL_CHECK_OPTION_THREADED_RESOLVER
3990 dnl ************************************************************
3991 dnl disable POSIX threads
3993 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3994 AC_ARG_ENABLE(pthreads,
3995 AC_HELP_STRING([--enable-pthreads],
3996 [Enable POSIX threads (default for threaded resolver)])
3997 AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3998 [ case "$enableval" in
3999 no) AC_MSG_RESULT(no)
4002 *) AC_MSG_RESULT(yes)
4011 dnl turn off pthreads if rt is disabled
4012 if test "$want_pthreads" != "no"; then
4013 if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
4014 AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
4016 if test "$dontwant_rt" != "no"; then
4017 dnl if --enable-pthreads was explicit then warn it's being ignored
4018 if test "$want_pthreads" = "yes"; then
4019 AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
4025 dnl turn off pthreads if no threaded resolver
4026 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
4031 if test "$want_pthreads" != "no"; then
4032 AC_CHECK_HEADER(pthread.h,
4033 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
4034 save_CFLAGS="$CFLAGS"
4036 dnl first check for function without lib
4037 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
4039 dnl on HPUX, life is more complicated...
4042 dnl it doesn't actually work without -lpthread
4043 USE_THREADS_POSIX=""
4049 dnl if it wasn't found without lib, search for it in pthread lib
4050 if test "$USE_THREADS_POSIX" != "1"
4052 CFLAGS="$CFLAGS -pthread"
4053 AC_CHECK_LIB(pthread, pthread_create,
4054 [USE_THREADS_POSIX=1],
4055 [ CFLAGS="$save_CFLAGS"])
4058 if test "x$USE_THREADS_POSIX" = "x1"
4060 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
4061 curl_res_msg="POSIX threaded"
4066 dnl threaded resolver check
4067 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
4068 if test "$want_pthreads" = "yes"; then
4069 AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
4071 dnl If native Windows fallback on Win32 threads since no POSIX threads
4072 if test "$curl_cv_native_windows" = "yes"; then
4074 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
4075 curl_res_msg="Win32 threaded"
4077 AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
4081 dnl ************************************************************
4082 dnl disable verbose text strings
4084 AC_MSG_CHECKING([whether to enable verbose strings])
4085 AC_ARG_ENABLE(verbose,
4086 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
4087 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
4088 [ case "$enableval" in
4091 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
4092 curl_verbose_msg="no"
4094 *) AC_MSG_RESULT(yes)
4100 dnl ************************************************************
4101 dnl enable SSPI support
4103 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
4105 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
4106 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
4107 [ case "$enableval" in
4109 if test "$curl_cv_native_windows" = "yes"; then
4111 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
4112 AC_SUBST(USE_WINDOWS_SSPI, [1])
4113 curl_sspi_msg="enabled"
4116 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
4120 if test "x$WINSSL_ENABLED" = "x1"; then
4121 # --with-winssl implies --enable-sspi
4128 if test "x$WINSSL_ENABLED" = "x1"; then
4129 # --with-winssl implies --enable-sspi
4136 dnl ************************************************************
4137 dnl disable cryptographic authentication
4139 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
4140 AC_ARG_ENABLE(crypto-auth,
4141 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
4142 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
4143 [ case "$enableval" in
4146 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
4147 CURL_DISABLE_CRYPTO_AUTH=1
4149 *) AC_MSG_RESULT(yes)
4155 CURL_CHECK_OPTION_NTLM_WB
4159 dnl ************************************************************
4160 dnl disable TLS-SRP authentication
4162 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
4163 AC_ARG_ENABLE(tls-srp,
4164 AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
4165 AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
4166 [ case "$enableval" in
4169 AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication])
4172 *) AC_MSG_RESULT(yes)
4180 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
4181 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
4183 curl_tls_srp_msg="enabled"
4186 dnl ************************************************************
4187 dnl disable Unix domain sockets support
4189 AC_MSG_CHECKING([whether to enable Unix domain sockets])
4190 AC_ARG_ENABLE(unix-sockets,
4191 AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
4192 AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
4193 [ case "$enableval" in
4194 no) AC_MSG_RESULT(no)
4195 want_unix_sockets=no
4197 *) AC_MSG_RESULT(yes)
4198 want_unix_sockets=yes
4202 want_unix_sockets=auto
4205 if test "x$want_unix_sockets" != "xno"; then
4206 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
4207 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
4208 AC_SUBST(USE_UNIX_SOCKETS, [1])
4209 curl_unix_sockets_msg="enabled"
4211 if test "x$want_unix_sockets" = "xyes"; then
4212 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
4219 dnl ************************************************************
4220 dnl disable cookies support
4222 AC_MSG_CHECKING([whether to enable support for cookies])
4223 AC_ARG_ENABLE(cookies,
4224 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
4225 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
4226 [ case "$enableval" in
4229 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
4231 *) AC_MSG_RESULT(yes)
4237 dnl ************************************************************
4238 dnl hiding of library internal symbols
4240 CURL_CONFIGURE_SYMBOL_HIDING
4243 dnl All the library dependencies put into $LIB apply to libcurl only.
4247 AC_SUBST(LIBCURL_LIBS)
4248 AC_SUBST(CURL_NETWORK_LIBS)
4249 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4251 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4252 dnl LIBS variable used in generated makefile at makefile processing
4253 dnl time. Doing this functionally prevents LIBS from being used for
4254 dnl all link targets in given makefile.
4256 AC_SUBST(BLANK_AT_MAKETIME)
4258 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4261 ENABLE_SHARED="$enable_shared"
4262 AC_SUBST(ENABLE_SHARED)
4264 dnl to let curl-config output the static libraries correctly
4265 ENABLE_STATIC="$enable_static"
4266 AC_SUBST(ENABLE_STATIC)
4270 dnl For keeping supported features and protocols also in pkg-config file
4271 dnl since it is more cross-compile friendly than curl-config
4274 if test "x$OPENSSL_ENABLED" = "x1"; then
4275 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4276 elif test -n "$SSL_ENABLED"; then
4277 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4279 if test "x$IPV6_ENABLED" = "x1"; then
4280 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4282 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4283 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4285 if test "x$HAVE_LIBZ" = "x1"; then
4286 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4288 if test "x$HAVE_BROTLI" = "x1"; then
4289 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4291 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4292 -o "x$USE_THREADS_WIN32" = "x1"; then
4293 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4295 if test "x$IDN_ENABLED" = "x1"; then
4296 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4298 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4299 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4302 if test "x$HAVE_GSSAPI" = "x1"; then
4303 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4306 if test "x$curl_psl_msg" = "xyes"; then
4307 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4310 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4311 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4312 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4315 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4316 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4317 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4320 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
4321 if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
4322 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4323 -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1"; then
4324 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4326 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4327 "x$NTLM_WB_ENABLED" = "x1"; then
4328 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4333 if test "x$USE_TLS_SRP" = "x1"; then
4334 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4337 if test "x$USE_NGHTTP2" = "x1"; then
4338 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4341 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4342 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4345 if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4346 -o "x$NSS_ENABLED" = "x1"; then
4347 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4350 AC_SUBST(SUPPORT_FEATURES)
4352 dnl For supported protocols in pkg-config file
4353 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4354 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4355 if test "x$SSL_ENABLED" = "x1"; then
4356 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4359 if test "x$CURL_DISABLE_FTP" != "x1"; then
4360 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4361 if test "x$SSL_ENABLED" = "x1"; then
4362 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4365 if test "x$CURL_DISABLE_FILE" != "x1"; then
4366 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4368 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4369 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4371 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4372 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4373 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4374 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4375 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
4376 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4380 if test "x$CURL_DISABLE_DICT" != "x1"; then
4381 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4383 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4384 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4386 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4387 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4389 if test "x$CURL_DISABLE_POP3" != "x1"; then
4390 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4391 if test "x$SSL_ENABLED" = "x1"; then
4392 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4395 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4396 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4397 if test "x$SSL_ENABLED" = "x1"; then
4398 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4401 if test "x$CURL_DISABLE_SMB" != "x1" \
4402 -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
4403 -a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
4404 -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4405 -o "x$NSS_ENABLED" = "x1" -o "x$DARWINSSL_ENABLED" = "x1" \); then
4406 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4407 if test "x$SSL_ENABLED" = "x1"; then
4408 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4411 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4412 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4413 if test "x$SSL_ENABLED" = "x1"; then
4414 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4417 if test "x$USE_LIBSSH2" = "x1"; then
4418 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4419 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4421 if test "x$USE_LIBSSH" = "x1"; then
4422 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4423 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4425 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4426 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4428 if test "x$USE_LIBRTMP" = "x1"; then
4429 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4432 dnl replace spaces with newlines
4434 dnl replace the newlines back to spaces
4435 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4437 AC_SUBST(SUPPORT_PROTOCOLS)
4439 dnl squeeze whitespace out of some variables
4447 squeeze LIBCURL_LIBS
4448 squeeze CURL_NETWORK_LIBS
4449 squeeze CURL_NETWORK_AND_TIME_LIBS
4451 squeeze SUPPORT_FEATURES
4452 squeeze SUPPORT_PROTOCOLS
4454 XC_CHECK_BUILD_FLAGS
4456 SSL_BACKENDS=${ssl_backends}
4457 AC_SUBST(SSL_BACKENDS)
4459 if test "x$want_curldebug_assumed" = "xyes" &&
4460 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4461 ac_configure_args="$ac_configure_args --enable-curldebug"
4464 AC_CONFIG_FILES([Makefile \
4466 docs/examples/Makefile \
4467 docs/libcurl/Makefile \
4468 docs/libcurl/opts/Makefile \
4469 docs/cmdline-opts/Makefile \
4471 include/curl/Makefile \
4474 extensions/Makefile \
4478 tests/certs/Makefile \
4479 tests/certs/scripts/Makefile \
4480 tests/data/Makefile \
4481 tests/server/Makefile \
4482 tests/libtest/Makefile \
4483 tests/unit/Makefile \
4485 packages/Win32/Makefile \
4486 packages/Win32/cygwin/Makefile \
4487 packages/Linux/Makefile \
4488 packages/Linux/RPM/Makefile \
4489 packages/Linux/RPM/curl.spec \
4490 packages/Linux/RPM/curl-ssl.spec \
4491 packages/Solaris/Makefile \
4492 packages/vms/Makefile \
4493 packages/AIX/Makefile \
4494 packages/AIX/RPM/Makefile \
4495 packages/AIX/RPM/curl.spec \
4501 CURL_GENERATE_CONFIGUREHELP_PM
4503 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4505 AC_MSG_NOTICE([Configured to build curl/libcurl:
4507 curl version: ${CURLVERSION}
4509 Install prefix: ${prefix}
4511 SSL support: ${curl_ssl_msg}
4512 SSH support: ${curl_ssh_msg}
4513 zlib support: ${curl_zlib_msg}
4514 brotli support: ${curl_brotli_msg}
4515 GSS-API support: ${curl_gss_msg}
4516 TLS-SRP support: ${curl_tls_srp_msg}
4517 resolver: ${curl_res_msg}
4518 IPv6 support: ${curl_ipv6_msg}
4519 Unix sockets support: ${curl_unix_sockets_msg}
4520 IDN support: ${curl_idn_msg}
4521 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
4522 Built-in manual: ${curl_manual_msg}
4523 --libcurl option: ${curl_libcurl_msg}
4524 Verbose errors: ${curl_verbose_msg}
4525 SSPI support: ${curl_sspi_msg}
4526 ca cert bundle: ${ca}${ca_warning}
4527 ca cert path: ${capath}${capath_warning}
4528 ca fallback: ${with_ca_fallback}
4529 LDAP support: ${curl_ldap_msg}
4530 LDAPS support: ${curl_ldaps_msg}
4531 RTSP support: ${curl_rtsp_msg}
4532 RTMP support: ${curl_rtmp_msg}
4533 metalink support: ${curl_mtlnk_msg}
4534 PSL support: ${curl_psl_msg}
4535 HTTP2 support: ${curl_h2_msg}
4536 Protocols: ${SUPPORT_PROTOCOLS}