1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2015, 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 http://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: http://curl.haxx.se/mail/])
31 CURL_OVERRIDE_AUTOCONF
33 dnl configure script copyright
34 AC_COPYRIGHT([Copyright (c) 1998 - 2014 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 include/curl/curlbuild.h)
40 AC_CONFIG_MACRO_DIR([m4])
43 CURL_CHECK_OPTION_DEBUG
44 CURL_CHECK_OPTION_OPTIMIZE
45 CURL_CHECK_OPTION_WARNINGS
46 CURL_CHECK_OPTION_WERROR
47 CURL_CHECK_OPTION_CURLDEBUG
48 CURL_CHECK_OPTION_SYMBOL_HIDING
49 CURL_CHECK_OPTION_ARES
52 XC_CHECK_PATH_SEPARATOR
55 # save the configure arguments
57 CONFIGURE_OPTIONS="\"$ac_configure_args\""
58 AC_SUBST(CONFIGURE_OPTIONS)
61 if test X"$want_werror" = Xyes; then
62 CURL_CFLAG_EXTRAS="-Werror"
64 AC_SUBST(CURL_CFLAG_EXTRAS)
66 dnl SED is mandatory for configure process and libtool.
67 dnl Set it now, allowing it to be changed later.
68 if test -z "$SED"; then
69 dnl allow it to be overridden
70 AC_PATH_PROG([SED], [sed], [not_found],
71 [$PATH:/usr/bin:/usr/local/bin])
72 if test -z "$SED" || test "$SED" = "not_found"; then
73 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
78 dnl GREP is mandatory for configure process and libtool.
79 dnl Set it now, allowing it to be changed later.
80 if test -z "$GREP"; then
81 dnl allow it to be overridden
82 AC_PATH_PROG([GREP], [grep], [not_found],
83 [$PATH:/usr/bin:/usr/local/bin])
84 if test -z "$GREP" || test "$GREP" = "not_found"; then
85 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
90 dnl EGREP is mandatory for configure process and libtool.
91 dnl Set it now, allowing it to be changed later.
92 if test -z "$EGREP"; then
93 dnl allow it to be overridden
94 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
95 AC_MSG_CHECKING([for egrep])
97 AC_MSG_RESULT([$EGREP])
99 AC_PATH_PROG([EGREP], [egrep], [not_found],
100 [$PATH:/usr/bin:/usr/local/bin])
103 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
104 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
108 dnl AR is mandatory for configure process and libtool.
109 dnl This is target dependent, so check it as a tool.
110 if test -z "$AR"; then
111 dnl allow it to be overridden
112 AC_PATH_TOOL([AR], [ar], [not_found],
113 [$PATH:/usr/bin:/usr/local/bin])
114 if test -z "$AR" || test "$AR" = "not_found"; then
115 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
122 dnl Remove non-configure distributed curlbuild.h
123 if test -f ${srcdir}/include/curl/curlbuild.h; then
124 rm -f ${srcdir}/include/curl/curlbuild.h
127 dnl figure out the libcurl version
128 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
131 AC_MSG_CHECKING([curl version])
132 AC_MSG_RESULT($CURLVERSION)
134 AC_SUBST(CURLVERSION)
137 dnl we extract the numerical version for curl-config only
138 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
141 dnl Solaris pkgadd support definitions
142 PKGADD_PKG="HAXXcurl"
143 PKGADD_NAME="cURL - a client that groks URLs"
144 PKGADD_VENDOR="curl.haxx.se"
146 AC_SUBST(PKGADD_NAME)
147 AC_SUBST(PKGADD_VENDOR)
150 dnl initialize all the info variables
151 curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )"
152 curl_ssh_msg="no (--with-libssh2)"
153 curl_zlib_msg="no (--with-zlib)"
154 curl_gss_msg="no (--with-gssapi)"
155 curl_tls_srp_msg="no (--enable-tls-srp)"
156 curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
157 curl_ipv6_msg="no (--enable-ipv6)"
158 curl_unix_sockets_msg="no (--enable-unix-sockets)"
159 curl_idn_msg="no (--with-{libidn,winidn})"
160 curl_manual_msg="no (--enable-manual)"
161 curl_libcurl_msg="enabled (--disable-libcurl-option)"
162 curl_verbose_msg="enabled (--disable-verbose)"
163 curl_sspi_msg="no (--enable-sspi)"
164 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
165 curl_ldaps_msg="no (--enable-ldaps)"
166 curl_rtsp_msg="no (--enable-rtsp)"
167 curl_rtmp_msg="no (--with-librtmp)"
168 curl_mtlnk_msg="no (--with-libmetalink)"
170 init_ssl_msg=${curl_ssl_msg}
173 dnl Save some initial values the user might have provided
175 INITIAL_LDFLAGS=$LDFLAGS
179 dnl Detect the canonical host and target build environment
183 dnl Get system canonical name
184 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
186 dnl Checks for programs.
188 dnl Our curl_off_t internal and external configure settings
189 CURL_CONFIGURE_CURL_OFF_T
191 dnl This defines _ALL_SOURCE for AIX
192 CURL_CHECK_AIX_ALL_SOURCE
194 dnl Our configure and build reentrant settings
195 CURL_CONFIGURE_THREAD_SAFE
196 CURL_CONFIGURE_REENTRANT
198 dnl check for how to do large files
204 # Automake conditionals based on libtool related checks
207 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
208 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
209 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
210 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
211 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
212 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
215 # Due to libtool and automake machinery limitations of not allowing
216 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
217 # inclusion of these in shared or static libraries, we are forced to
218 # build using separate configure runs for shared and static libraries
219 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
220 # to compile objects for each kind of library. Notice that relying on
221 # the '-DPIC' CFLAG that libtool provides is not valid given that the
222 # user might for example choose to build static libraries with PIC.
226 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
227 # targeting a static library and not building its shared counterpart.
230 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
231 [test "x$xc_lt_build_static_only" = 'xyes'])
234 # Make staticlib CPPFLAG variable and its definition visible in output
235 # files unconditionally, providing an empty definition unless strictly
236 # targeting a static library and not building its shared counterpart.
239 CPPFLAG_CURL_STATICLIB=
240 if test "x$xc_lt_build_static_only" = 'xyes'; then
241 CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
243 AC_SUBST([CPPFLAG_CURL_STATICLIB])
246 # Determine whether all dependent libraries must be specified when linking
247 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
253 AC_SUBST(REQUIRE_LIB_DEPS)
254 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
256 dnl check if there's a way to force code inline
259 dnl **********************************************************************
260 dnl platform/compiler/architecture specific checks/flags
261 dnl **********************************************************************
264 CURL_SET_COMPILER_BASIC_OPTS
265 CURL_SET_COMPILER_DEBUG_OPTS
266 CURL_SET_COMPILER_OPTIMIZE_OPTS
267 CURL_SET_COMPILER_WARNING_OPTS
269 if test "$compiler_id" = "INTEL_UNIX_C"; then
271 if test "$compiler_num" -ge "1000"; then
272 dnl icc 10.X or later
273 CFLAGS="$CFLAGS -shared-intel"
274 elif test "$compiler_num" -ge "900"; then
276 CFLAGS="$CFLAGS -i-dynamic"
281 CURL_CHECK_COMPILER_HALT_ON_ERROR
282 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
283 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
284 CURL_CHECK_COMPILER_SYMBOL_HIDING
287 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
289 supports_unittests=yes
290 # cross-compilation of unit tests static library/programs fails when
291 # libcurl shared library is built. This might be due to a libtool or
292 # automake issue. In this case we disable unit tests.
293 if test "x$cross_compiling" != "xno" &&
294 test "x$enable_shared" != "xno"; then
295 supports_unittests=no
298 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
299 # a problem related with OpenSSL headers and library versions not matching.
300 # Disable unit tests while time to further investigate this is found.
303 if test "$compiler_id" = "GNU_C"; then
304 supports_unittests=no
309 # All AIX autobuilds fails unit tests linking against unittests library
310 # due to unittests library being built with no symbols or members. Libtool ?
311 # Disable unit tests while time to further investigate this is found.
314 supports_unittests=no
318 dnl Build unit tests when option --enable-debug is given.
319 if test "x$want_debug" = "xyes" &&
320 test "x$supports_unittests" = "xyes"; then
325 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
327 dnl **********************************************************************
328 dnl Compilation based checks should not be done before this point.
329 dnl **********************************************************************
331 dnl **********************************************************************
332 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
333 dnl and ws2tcpip.h take precedence over any other further checks which
334 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
335 dnl this specific header files. And do them before its results are used.
336 dnl **********************************************************************
338 CURL_CHECK_HEADER_WINDOWS
339 CURL_CHECK_NATIVE_WINDOWS
340 case X-"$ac_cv_native_windows" in
342 CURL_CHECK_HEADER_WINSOCK
343 CURL_CHECK_HEADER_WINSOCK2
344 CURL_CHECK_HEADER_WS2TCPIP
345 CURL_CHECK_HEADER_WINLDAP
346 CURL_CHECK_HEADER_WINBER
349 ac_cv_header_winsock_h="no"
350 ac_cv_header_winsock2_h="no"
351 ac_cv_header_ws2tcpip_h="no"
352 ac_cv_header_winldap_h="no"
353 ac_cv_header_winber_h="no"
356 CURL_CHECK_WIN32_LARGEFILE
358 dnl ************************************************************
359 dnl switch off particular protocols
361 AC_MSG_CHECKING([whether to support http])
363 AC_HELP_STRING([--enable-http],[Enable HTTP support])
364 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
365 [ case "$enableval" in
368 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
369 AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
370 AC_SUBST(CURL_DISABLE_HTTP, [1])
371 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
372 AC_SUBST(CURL_DISABLE_RTSP, [1])
374 *) AC_MSG_RESULT(yes)
379 AC_MSG_CHECKING([whether to support ftp])
381 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
382 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
383 [ case "$enableval" in
386 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
387 AC_SUBST(CURL_DISABLE_FTP, [1])
389 *) AC_MSG_RESULT(yes)
394 AC_MSG_CHECKING([whether to support file])
396 AC_HELP_STRING([--enable-file],[Enable FILE support])
397 AC_HELP_STRING([--disable-file],[Disable FILE support]),
398 [ case "$enableval" in
401 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
402 AC_SUBST(CURL_DISABLE_FILE, [1])
404 *) AC_MSG_RESULT(yes)
409 AC_MSG_CHECKING([whether to support ldap])
411 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
412 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
413 [ case "$enableval" in
416 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
417 AC_SUBST(CURL_DISABLE_LDAP, [1])
425 AC_MSG_CHECKING([whether to support ldaps])
427 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
428 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
429 [ case "$enableval" in
432 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
433 AC_SUBST(CURL_DISABLE_LDAPS, [1])
435 *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
436 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
437 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
438 AC_SUBST(CURL_DISABLE_LDAPS, [1])
441 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
442 AC_SUBST(HAVE_LDAP_SSL, [1])
446 if test "x$CURL_DISABLE_LDAP" = "x1" ; then
448 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
449 AC_SUBST(CURL_DISABLE_LDAPS, [1])
452 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
453 AC_SUBST(HAVE_LDAP_SSL, [1])
457 AC_MSG_CHECKING([whether to support rtsp])
459 AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
460 AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
461 [ case "$enableval" in
464 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
465 AC_SUBST(CURL_DISABLE_RTSP, [1])
467 *) if test x$CURL_DISABLE_HTTP = x1 ; then
468 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
471 curl_rtsp_msg="enabled"
475 if test "x$CURL_DISABLE_HTTP" != "x1"; then
477 curl_rtsp_msg="enabled"
483 AC_MSG_CHECKING([whether to support proxies])
485 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
486 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
487 [ case "$enableval" in
490 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
491 AC_SUBST(CURL_DISABLE_PROXY, [1])
493 *) AC_MSG_RESULT(yes)
499 AC_MSG_CHECKING([whether to support dict])
501 AC_HELP_STRING([--enable-dict],[Enable DICT support])
502 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
503 [ case "$enableval" in
506 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
507 AC_SUBST(CURL_DISABLE_DICT, [1])
509 *) AC_MSG_RESULT(yes)
514 AC_MSG_CHECKING([whether to support telnet])
515 AC_ARG_ENABLE(telnet,
516 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
517 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
518 [ case "$enableval" in
521 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
522 AC_SUBST(CURL_DISABLE_TELNET, [1])
524 *) AC_MSG_RESULT(yes)
529 AC_MSG_CHECKING([whether to support tftp])
531 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
532 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
533 [ case "$enableval" in
536 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
537 AC_SUBST(CURL_DISABLE_TFTP, [1])
539 *) AC_MSG_RESULT(yes)
545 AC_MSG_CHECKING([whether to support pop3])
547 AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
548 AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
549 [ case "$enableval" in
552 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
553 AC_SUBST(CURL_DISABLE_POP3, [1])
555 *) AC_MSG_RESULT(yes)
562 AC_MSG_CHECKING([whether to support imap])
564 AC_HELP_STRING([--enable-imap],[Enable IMAP support])
565 AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
566 [ case "$enableval" in
569 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
570 AC_SUBST(CURL_DISABLE_IMAP, [1])
572 *) AC_MSG_RESULT(yes)
579 AC_MSG_CHECKING([whether to support smb])
581 AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
582 AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
583 [ case "$enableval" in
586 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
587 AC_SUBST(CURL_DISABLE_SMB, [1])
589 *) AC_MSG_RESULT(yes)
595 AC_MSG_CHECKING([whether to support smtp])
597 AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
598 AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
599 [ case "$enableval" in
602 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
603 AC_SUBST(CURL_DISABLE_SMTP, [1])
605 *) AC_MSG_RESULT(yes)
611 AC_MSG_CHECKING([whether to support gopher])
612 AC_ARG_ENABLE(gopher,
613 AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
614 AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
615 [ case "$enableval" in
618 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
619 AC_SUBST(CURL_DISABLE_GOPHER, [1])
621 *) AC_MSG_RESULT(yes)
628 dnl **********************************************************************
629 dnl Check for built-in manual
630 dnl **********************************************************************
632 AC_MSG_CHECKING([whether to provide built-in manual])
633 AC_ARG_ENABLE(manual,
634 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
635 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
636 [ case "$enableval" in
640 *) AC_MSG_RESULT(yes)
647 dnl The actual use of the USE_MANUAL variable is done much later in this
648 dnl script to allow other actions to disable it as well.
650 dnl ************************************************************
651 dnl disable C code generation support
653 AC_MSG_CHECKING([whether to enable generation of C code])
654 AC_ARG_ENABLE(libcurl_option,
655 AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
656 AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
657 [ case "$enableval" in
660 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
661 curl_libcurl_msg="no"
663 *) AC_MSG_RESULT(yes)
669 dnl **********************************************************************
670 dnl Checks for libraries.
671 dnl **********************************************************************
673 AC_MSG_CHECKING([whether to use libgcc])
674 AC_ARG_ENABLE(libgcc,
675 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
676 [ case "$enableval" in
689 dnl gethostbyname without lib or in the nsl lib?
690 AC_CHECK_FUNC(gethostbyname,
691 [HAVE_GETHOSTBYNAME="1"
693 [ AC_CHECK_LIB(nsl, gethostbyname,
694 [HAVE_GETHOSTBYNAME="1"
699 if test "$HAVE_GETHOSTBYNAME" != "1"
701 dnl gethostbyname in the socket lib?
702 AC_CHECK_LIB(socket, gethostbyname,
703 [HAVE_GETHOSTBYNAME="1"
704 LIBS="-lsocket $LIBS"
708 if test "$HAVE_GETHOSTBYNAME" != "1"
710 dnl gethostbyname in the watt lib?
711 AC_CHECK_LIB(watt, gethostbyname,
712 [HAVE_GETHOSTBYNAME="1"
713 CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
714 LDFLAGS="-L/dev/env/WATT_ROOT/lib"
719 dnl At least one system has been identified to require BOTH nsl and socket
720 dnl libs at the same time to link properly.
721 if test "$HAVE_GETHOSTBYNAME" != "1"
723 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
724 my_ac_save_LIBS=$LIBS
725 LIBS="-lnsl -lsocket $LIBS"
733 HAVE_GETHOSTBYNAME="1"
736 LIBS=$my_ac_save_LIBS
740 if test "$HAVE_GETHOSTBYNAME" != "1"
742 dnl This is for winsock systems
743 if test "$ac_cv_header_windows_h" = "yes"; then
744 if test "$ac_cv_header_winsock_h" = "yes"; then
747 winsock_LIB="-lwinsock"
750 winsock_LIB="-lwsock32"
754 if test "$ac_cv_header_winsock2_h" = "yes"; then
755 winsock_LIB="-lws2_32"
757 if test ! -z "$winsock_LIB"; then
758 my_ac_save_LIBS=$LIBS
759 LIBS="$winsock_LIB $LIBS"
760 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
763 #ifdef HAVE_WINDOWS_H
764 #ifndef WIN32_LEAN_AND_MEAN
765 #define WIN32_LEAN_AND_MEAN
768 #ifdef HAVE_WINSOCK2_H
769 #include <winsock2.h>
771 #ifdef HAVE_WINSOCK_H
777 gethostbyname("www.dummysite.com");
781 HAVE_GETHOSTBYNAME="1"
785 LIBS=$my_ac_save_LIBS
791 if test "$HAVE_GETHOSTBYNAME" != "1"
793 dnl This is for Minix 3.1
794 AC_MSG_CHECKING([for gethostbyname for Minix 3])
797 /* Older Minix versions may need <net/gen/netdb.h> here instead */
800 gethostbyname("www.dummysite.com");
804 HAVE_GETHOSTBYNAME="1"
810 if test "$HAVE_GETHOSTBYNAME" != "1"
812 dnl This is for eCos with a stubbed DNS implementation
813 AC_MSG_CHECKING([for gethostbyname for eCos])
819 gethostbyname("www.dummysite.com");
823 HAVE_GETHOSTBYNAME="1"
829 if test "$HAVE_GETHOSTBYNAME" != "1"
831 dnl gethostbyname in the network lib - for Haiku OS
832 AC_CHECK_LIB(network, gethostbyname,
833 [HAVE_GETHOSTBYNAME="1"
834 LIBS="-lnetwork $LIBS"
838 if test "$HAVE_GETHOSTBYNAME" != "1"
840 dnl gethostbyname in the net lib - for BeOS
841 AC_CHECK_LIB(net, gethostbyname,
842 [HAVE_GETHOSTBYNAME="1"
848 if test "$HAVE_GETHOSTBYNAME" != "1"; then
849 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
853 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
855 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
856 AC_CHECK_LIB(resolve, strcasecmp,
857 [LIBS="-lresolve $LIBS"],
861 ac_cv_func_strcasecmp="no"
863 CURL_CHECK_LIBS_CONNECT
865 CURL_NETWORK_LIBS=$LIBS
867 dnl **********************************************************************
868 dnl In case that function clock_gettime with monotonic timer is available,
869 dnl check for additional required libraries.
870 dnl **********************************************************************
871 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
873 dnl **********************************************************************
874 dnl The preceding library checks are all potentially useful for test
875 dnl servers and libtest cases which require networking and clock_gettime
876 dnl support. Save the list of required libraries at this point for use
877 dnl while linking those test servers and programs.
878 dnl **********************************************************************
879 CURL_NETWORK_AND_TIME_LIBS=$LIBS
881 dnl **********************************************************************
882 dnl Check for the presence of ZLIB libraries and headers
883 dnl **********************************************************************
885 dnl Check for & handle argument to --with-zlib.
887 clean_CPPFLAGS=$CPPFLAGS
888 clean_LDFLAGS=$LDFLAGS
892 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
893 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
894 [OPT_ZLIB="$withval"])
896 if test "$OPT_ZLIB" = "no" ; then
897 AC_MSG_WARN([zlib disabled])
899 if test "$OPT_ZLIB" = "yes" ; then
903 if test -z "$OPT_ZLIB" ; then
904 dnl check for the lib first without setting any new path, since many
905 dnl people have it in the default path
907 AC_CHECK_LIB(z, inflateEnd,
908 dnl libz found, set the variable
911 dnl if no lib found, try /usr/local
912 [OPT_ZLIB="/usr/local"])
916 dnl Add a nonempty path to the compiler flags
917 if test -n "$OPT_ZLIB"; then
918 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
919 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
922 AC_CHECK_HEADER(zlib.h,
926 dnl if the lib wasn't found already, try again with the new paths
927 if test "$HAVE_LIBZ" != "1"; then
928 AC_CHECK_LIB(z, gzread,
930 dnl the lib was found!
934 [ CPPFLAGS=$clean_CPPFLAGS
935 LDFLAGS=$clean_LDFLAGS])
939 dnl zlib.h was not found, restore the flags
940 CPPFLAGS=$clean_CPPFLAGS
941 LDFLAGS=$clean_LDFLAGS]
944 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
946 AC_MSG_WARN([configure found only the libz lib, not the header file!])
948 CPPFLAGS=$clean_CPPFLAGS
949 LDFLAGS=$clean_LDFLAGS
951 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
953 AC_MSG_WARN([configure found only the libz header file, not the lib!])
954 CPPFLAGS=$clean_CPPFLAGS
955 LDFLAGS=$clean_LDFLAGS
957 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
959 dnl both header and lib were found!
961 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
962 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
965 LIBS="-lz $clean_LIBS"
967 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
969 AC_MSG_NOTICE([found both libz and libz.h header])
970 curl_zlib_msg="enabled"
974 dnl set variable for use in automakefile(s)
975 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
978 dnl **********************************************************************
980 dnl **********************************************************************
983 AC_ARG_WITH(ldap-lib,
984 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
985 [LDAPLIBNAME="$withval"])
988 AC_ARG_WITH(lber-lib,
989 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
990 [LBERLIBNAME="$withval"])
992 if test x$CURL_DISABLE_LDAP != x1 ; then
994 CURL_CHECK_HEADER_LBER
995 CURL_CHECK_HEADER_LDAP
996 CURL_CHECK_HEADER_LDAPSSL
997 CURL_CHECK_HEADER_LDAP_SSL
999 if test -z "$LDAPLIBNAME" ; then
1000 if test "$ac_cv_native_windows" = "yes"; then
1001 dnl Windows uses a single and unique LDAP library name
1002 LDAPLIBNAME="wldap32"
1007 if test "$LDAPLIBNAME" ; then
1008 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1009 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1010 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1011 AC_SUBST(CURL_DISABLE_LDAP, [1])
1012 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1013 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1015 dnl Try to find the right ldap libraries for this system
1016 CURL_CHECK_LIBS_LDAP
1017 case X-"$curl_cv_ldap_LIBS" in
1019 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1020 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1021 AC_SUBST(CURL_DISABLE_LDAP, [1])
1022 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1023 AC_SUBST(CURL_DISABLE_LDAPS, [1])
1029 if test x$CURL_DISABLE_LDAP != x1 ; then
1031 if test "$LBERLIBNAME" ; then
1032 dnl If name is "no" then don't define this library at all
1033 dnl (it's only needed if libldap.so's dependencies are broken).
1034 if test "$LBERLIBNAME" != "no" ; then
1035 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1036 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1037 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1038 AC_SUBST(CURL_DISABLE_LDAP, [1])
1039 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1040 AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1045 if test x$CURL_DISABLE_LDAP != x1 ; then
1046 AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
1048 if test "$LDAPLIBNAME" = "wldap32"; then
1049 curl_ldap_msg="enabled (winldap)"
1050 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1052 curl_ldap_msg="enabled (OpenLDAP)"
1053 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1054 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1055 AC_SUBST(USE_OPENLDAP, [1])
1060 if test x$CURL_DISABLE_LDAPS != x1 ; then
1061 curl_ldaps_msg="enabled"
1064 dnl **********************************************************************
1066 dnl **********************************************************************
1068 AC_MSG_CHECKING([whether to enable IPv6])
1070 AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1071 AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1072 [ case "$enableval" in
1077 *) AC_MSG_RESULT(yes)
1082 AC_TRY_RUN([ /* is AF_INET6 available? */
1083 #include <sys/types.h>
1084 #include <sys/socket.h>
1085 #include <stdlib.h> /* for exit() */
1088 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1102 if test "$ipv6" = "yes"; then
1103 curl_ipv6_msg="enabled"
1106 # Check if struct sockaddr_in6 have sin6_scope_id member
1107 if test "$ipv6" = yes; then
1108 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1110 #include <sys/types.h>
1111 #include <netinet/in.h>] ,
1112 struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
1113 if test "$have_sin6_scope_id" = yes; then
1114 AC_MSG_RESULT([yes])
1115 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1121 dnl **********************************************************************
1122 dnl Check if the operating system allows programs to write to their own argv[]
1123 dnl **********************************************************************
1125 AC_MSG_CHECKING([if argv can be written to])
1128 int main(int argc, char ** argv) {
1130 return (argv[0][0] == ' ')?0:1;
1134 curl_cv_writable_argv=yes
1136 curl_cv_writable_argv=no
1138 curl_cv_writable_argv=cross
1140 case $curl_cv_writable_argv in
1142 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1150 AC_MSG_WARN([the previous check could not be made default was used])
1154 dnl **********************************************************************
1155 dnl Check for GSS-API libraries
1156 dnl **********************************************************************
1158 dnl check for GSS-API stuff in the /usr as default
1161 AC_ARG_WITH(gssapi-includes,
1162 AC_HELP_STRING([--with-gssapi-includes=DIR],
1163 [Specify location of GSS-API headers]),
1164 [ GSSAPI_INCS="-I$withval"
1168 AC_ARG_WITH(gssapi-libs,
1169 AC_HELP_STRING([--with-gssapi-libs=DIR],
1170 [Specify location of GSS-API libs]),
1171 [ GSSAPI_LIB_DIR="-L$withval"
1176 AC_HELP_STRING([--with-gssapi=DIR],
1177 [Where to look for GSS-API]), [
1178 GSSAPI_ROOT="$withval"
1179 if test x"$GSSAPI_ROOT" != xno; then
1181 if test x"$GSSAPI_ROOT" = xyes; then
1182 dnl if yes, then use default root
1188 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1190 save_CPPFLAGS="$CPPFLAGS"
1191 AC_MSG_CHECKING([if GSS-API support is requested])
1192 if test x"$want_gss" = xyes; then
1195 if test -z "$GSSAPI_INCS"; then
1196 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1197 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1198 elif test -f "$KRB5CONFIG"; then
1199 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1200 elif test "$GSSAPI_ROOT" != "yes"; then
1201 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1205 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1207 AC_CHECK_HEADER(gss.h,
1209 dnl found in the given dirs
1210 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1214 dnl not found, check Heimdal or MIT
1215 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1217 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1222 #ifdef HAVE_GSSAPI_GSSAPI_H
1223 #include <gssapi/gssapi.h>
1226 if test "x$not_mit" = "x1"; then
1227 dnl MIT not found, check for Heimdal
1228 AC_CHECK_HEADER(gssapi.h,
1231 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1234 dnl no header found, disabling GSS
1236 AC_MSG_WARN(disabling GSS-API support since no header files were found)
1241 AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1242 dnl check if we have a really old MIT Kerberos version (<= 1.2)
1243 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1246 #include <gssapi/gssapi.h>
1247 #include <gssapi/gssapi_generic.h>
1248 #include <gssapi/gssapi_krb5.h>
1253 GSS_C_NT_HOSTBASED_SERVICE,
1257 AC_MSG_RESULT([yes])
1260 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1261 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1269 if test x"$want_gss" = xyes; then
1270 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1272 curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1274 if test -n "$gnu_gss"; then
1275 curl_gss_msg="enabled (GNU GSS)"
1276 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1278 elif test -z "$GSSAPI_LIB_DIR"; then
1281 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1284 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1285 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1287 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1288 LIBS="$gss_libs $LIBS"
1289 elif test -f "$KRB5CONFIG"; then
1290 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1292 gss_libs=`$KRB5CONFIG --libs gssapi`
1293 LIBS="$gss_libs $LIBS"
1300 gss_libname="gssapi"
1304 if test "$GSSAPI_ROOT" != "yes"; then
1305 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1306 LIBS="-l$gss_libname $LIBS"
1308 LIBS="-l$gss_libname $LIBS"
1314 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1320 LIBS="-lgssapi $LIBS"
1325 CPPFLAGS="$save_CPPFLAGS"
1328 dnl -------------------------------------------------
1329 dnl check winssl option before other SSL libraries
1330 dnl -------------------------------------------------
1333 AC_ARG_WITH(winssl,dnl
1334 AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
1335 AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
1336 OPT_WINSSL=$withval)
1338 AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
1339 if test "$curl_ssl_msg" = "$init_ssl_msg"; then
1340 if test "x$OPT_WINSSL" != "xno" &&
1341 test "x$ac_cv_native_windows" = "xyes"; then
1343 AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
1344 AC_SUBST(USE_SCHANNEL, [1])
1345 curl_ssl_msg="enabled (Windows-native)"
1347 # --with-winssl implies --enable-sspi
1348 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
1349 AC_SUBST(USE_WINDOWS_SSPI, [1])
1350 curl_sspi_msg="enabled"
1359 AC_ARG_WITH(darwinssl,dnl
1360 AC_HELP_STRING([--with-darwinssl],[enable iOS/Mac OS X native SSL/TLS])
1361 AC_HELP_STRING([--without-darwinssl], [disable iOS/Mac OS X native SSL/TLS]),
1362 OPT_DARWINSSL=$withval)
1364 AC_MSG_CHECKING([whether to enable iOS/Mac OS X native SSL/TLS])
1365 if test "$curl_ssl_msg" = "$init_ssl_msg"; then
1366 if test "x$OPT_DARWINSSL" != "xno" &&
1367 test -d "/System/Library/Frameworks/Security.framework"; then
1369 AC_DEFINE(USE_DARWINSSL, 1, [to enable iOS/Mac OS X native SSL/TLS support])
1370 AC_SUBST(USE_DARWINSSL, [1])
1371 curl_ssl_msg="enabled (iOS/Mac OS X-native)"
1373 LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
1381 dnl **********************************************************************
1382 dnl Check for the presence of SSL libraries and headers
1383 dnl **********************************************************************
1385 dnl Default to compiler & linker defaults for SSL files & libraries.
1387 dnl Default to no CA bundle
1390 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])
1391 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1394 if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
1395 dnl backup the pre-ssl variables
1396 CLEANLDFLAGS="$LDFLAGS"
1397 CLEANCPPFLAGS="$CPPFLAGS"
1402 dnl --with-ssl (without path) used
1403 if test x$cross_compiling != xyes; then
1404 dnl only do pkg-config magic when not cross-compiling
1407 PREFIX_OPENSSL=/usr/local/ssl
1408 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1411 dnl no --with-ssl option given, just check default places
1412 if test x$cross_compiling != xyes; then
1413 dnl only do pkg-config magic when not cross-compiling
1419 dnl check the given --with-ssl spot
1421 PREFIX_OPENSSL=$OPT_SSL
1423 dnl Try pkg-config even when cross-compiling. Since we
1424 dnl specify PKG_CONFIG_LIBDIR we're only looking where
1425 dnl the user told us to look
1426 OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
1427 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
1428 if test -f "$OPENSSL_PCDIR/openssl.pc"; then
1432 dnl in case pkg-config comes up empty, use what we got
1434 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1435 if test "$PREFIX_OPENSSL" != "/usr" ; then
1436 SSL_LDFLAGS="-L$LIB_OPENSSL"
1437 SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
1439 SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1443 if test "$PKGTEST" = "yes"; then
1445 CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
1447 if test "$PKGCONFIG" != "no" ; then
1448 SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1449 $PKGCONFIG --libs-only-l openssl 2>/dev/null`
1451 SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1452 $PKGCONFIG --libs-only-L openssl 2>/dev/null`
1454 SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1455 $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1458 AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
1459 AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
1460 AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
1462 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1464 dnl use the values pkg-config reported. This is here
1465 dnl instead of below with CPPFLAGS and LDFLAGS because we only
1466 dnl learn about this via pkg-config. If we only have
1467 dnl the argument to --with-ssl we don't know what
1468 dnl additional libs may be necessary. Hope that we
1470 LIBS="$SSL_LIBS $LIBS"
1474 dnl finally, set flags to use SSL
1475 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1476 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1478 dnl This is for Msys/Mingw
1480 *-*-msys* | *-*-mingw*)
1481 AC_MSG_CHECKING([for gdi32])
1482 my_ac_save_LIBS=$LIBS
1483 LIBS="-lgdi32 $LIBS"
1484 AC_TRY_LINK([#include <windef.h>
1485 #include <wingdi.h>],
1488 AC_MSG_RESULT([yes])],
1489 [ dnl failed, restore LIBS
1490 LIBS=$my_ac_save_LIBS
1496 AC_CHECK_LIB(crypto, CRYPTO_lock,[
1498 LIBS="-lcrypto $LIBS"
1500 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1501 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1502 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
1504 LIBS="-lcrypto $LIBS"], [
1505 LDFLAGS="$CLEANLDFLAGS"
1506 CPPFLAGS="$CLEANCPPFLAGS"
1512 if test X"$HAVECRYPTO" = X"yes"; then
1513 AC_MSG_CHECKING([OpenSSL linking without -ldl])
1517 #include <openssl/evp.h>
1520 SSLeay_add_all_algorithms();
1528 AC_MSG_CHECKING([OpenSSL linking with -ldl])
1532 #include <openssl/evp.h>
1535 SSLeay_add_all_algorithms();
1539 LIBS="$saved_libs -ldl"
1552 if test X"$HAVECRYPTO" = X"yes"; then
1553 dnl This is only reasonable to do if crypto actually is there: check for
1554 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1556 AC_CHECK_LIB(ssl, SSL_connect)
1558 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1559 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1560 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1562 LIBS="-lRSAglue -lrsaref $LIBS"
1563 AC_CHECK_LIB(ssl, SSL_connect)
1564 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1565 dnl still no SSL_connect
1574 dnl Have the libraries--check for OpenSSL headers
1575 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1576 openssl/pem.h openssl/ssl.h openssl/err.h,
1577 curl_ssl_msg="enabled (OpenSSL)"
1579 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1581 if test $ac_cv_header_openssl_x509_h = no; then
1582 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1583 dnl since 'err.h' might in fact find a krb4 header with the same
1585 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1587 if test $ac_cv_header_x509_h = yes &&
1588 test $ac_cv_header_crypto_h = yes &&
1589 test $ac_cv_header_ssl_h = yes; then
1591 curl_ssl_msg="enabled (OpenSSL)"
1597 if test X"$OPENSSL_ENABLED" = X"1"; then
1598 dnl is there a pkcs12.h header present?
1599 AC_CHECK_HEADERS(openssl/pkcs12.h)
1604 if test X"$OPT_SSL" != Xoff &&
1605 test "$OPENSSL_ENABLED" != "1"; then
1606 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1610 if test X"$OPENSSL_ENABLED" = X"1"; then
1611 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
1612 dnl stuff, it is kind of "separated" from the main SSL check
1613 AC_CHECK_FUNC(ENGINE_init,
1615 AC_CHECK_HEADERS(openssl/engine.h)
1616 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
1619 dnl These can only exist if OpenSSL exists
1620 dnl Older versions of Cyassl (some time before 2.9.4) don't have
1621 dnl SSL_get_shutdown (but this check won't actually detect it there
1622 dnl as it's a macro that needs the header files be included)
1623 dnl BoringSSL doesn't have DES_set_odd_parity
1625 AC_CHECK_FUNCS( RAND_status \
1629 CRYPTO_cleanup_all_ex_data \
1631 SSLv2_client_method \
1632 DES_set_odd_parity )
1634 AC_MSG_CHECKING([for BoringSSL])
1635 if test "x$ac_cv_func_DES_set_odd_parity" != "xyes"; then
1636 curl_ssl_msg="enabled (BoringSSL)"
1637 AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
1638 [Define to 1 if using BoringSSL.])
1639 AC_MSG_RESULT([yes])
1643 AC_MSG_CHECKING([for libressl])
1646 #include <openssl/opensslv.h>
1648 int dummy = LIBRESSL_VERSION_NUMBER;
1651 AC_MSG_RESULT([yes])
1652 AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1,
1653 [Define to 1 if using libressl.])
1654 curl_ssl_msg="enabled (libressl)"
1660 if test "$OPENSSL_ENABLED" = "1"; then
1661 if test -n "$LIB_OPENSSL"; then
1662 dnl when the ssl shared libs were found in a path that the run-time
1663 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1664 dnl to prevent further configure tests to fail due to this
1665 if test "x$cross_compiling" != "xyes"; then
1666 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
1667 export LD_LIBRARY_PATH
1668 AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
1671 CURL_CHECK_OPENSSL_API
1676 dnl **********************************************************************
1677 dnl Check for the random seed preferences
1678 dnl **********************************************************************
1680 if test X"$OPENSSL_ENABLED" = X"1"; then
1681 AC_ARG_WITH(egd-socket,
1682 AC_HELP_STRING([--with-egd-socket=FILE],
1683 [Entropy Gathering Daemon socket pathname]),
1684 [ EGD_SOCKET="$withval" ]
1686 if test -n "$EGD_SOCKET" ; then
1687 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1688 [your Entropy Gathering Daemon socket pathname] )
1691 dnl Check for user-specified random device
1693 AC_HELP_STRING([--with-random=FILE],
1694 [read randomness from FILE (default=/dev/urandom)]),
1695 [ RANDOM_FILE="$withval" ],
1697 if test x$cross_compiling != xyes; then
1698 dnl Check for random device
1699 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1701 AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
1705 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1706 AC_SUBST(RANDOM_FILE)
1707 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1708 [a suitable file to read random data from])
1713 dnl We require OpenSSL with SRP support.
1715 if test "$OPENSSL_ENABLED" = "1"; then
1716 AC_CHECK_LIB(crypto, SRP_Calc_client_key,
1718 AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
1719 AC_SUBST(HAVE_OPENSSL_SRP, [1])
1723 dnl ----------------------------------------------------
1724 dnl check for GnuTLS
1725 dnl ----------------------------------------------------
1727 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1730 AC_ARG_WITH(gnutls,dnl
1731 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
1732 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1733 OPT_GNUTLS=$withval)
1735 if test "$curl_ssl_msg" = "$init_ssl_msg"; then
1737 if test X"$OPT_GNUTLS" != Xno; then
1745 if test "x$OPT_GNUTLS" = "xyes"; then
1746 dnl this is with no partiular path given
1747 CURL_CHECK_PKGCONFIG(gnutls)
1749 if test "$PKGCONFIG" != "no" ; then
1750 addlib=`$PKGCONFIG --libs-only-l gnutls`
1751 addld=`$PKGCONFIG --libs-only-L gnutls`
1752 addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1753 version=`$PKGCONFIG --modversion gnutls`
1754 gtlslib=`echo $addld | $SED -e 's/-L//'`
1756 dnl without pkg-config, we try libgnutls-config as that was how it
1758 check=`libgnutls-config --version 2>/dev/null`
1759 if test -n "$check"; then
1760 addlib=`libgnutls-config --libs`
1761 addcflags=`libgnutls-config --cflags`
1762 version=`libgnutls-config --version`
1763 gtlslib=`libgnutls-config --prefix`/lib$libsuff
1767 dnl this is with a given path, first check if there's a libgnutls-config
1768 dnl there and if not, make an educated guess
1769 cfg=$OPT_GNUTLS/bin/libgnutls-config
1770 check=`$cfg --version 2>/dev/null`
1771 if test -n "$check"; then
1772 addlib=`$cfg --libs`
1773 addcflags=`$cfg --cflags`
1774 version=`$cfg --version`
1775 gtlslib=`$cfg --prefix`/lib$libsuff
1777 dnl without pkg-config and libgnutls-config, we guess a lot!
1779 addld=-L$OPT_GNUTLS/lib$libsuff
1780 addcflags=-I$OPT_GNUTLS/include
1781 version="" # we just don't know
1782 gtlslib=$OPT_GNUTLS/lib$libsuff
1786 if test -z "$version"; then
1787 dnl lots of efforts, still no go
1791 if test -n "$addlib"; then
1794 CLEANCPPFLAGS="$CPPFLAGS"
1795 CLEANLDFLAGS="$LDFLAGS"
1797 LIBS="$addlib $LIBS"
1798 LDFLAGS="$LDFLAGS $addld"
1799 if test "$addcflags" != "-I/usr/include"; then
1800 CPPFLAGS="$CPPFLAGS $addcflags"
1803 AC_CHECK_LIB(gnutls, gnutls_check_version,
1805 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1806 AC_SUBST(USE_GNUTLS, [1])
1809 curl_ssl_msg="enabled (GnuTLS)"
1813 CPPFLAGS="$CLEANCPPFLAGS"
1816 if test "x$USE_GNUTLS" = "xyes"; then
1817 AC_MSG_NOTICE([detected GnuTLS version $version])
1819 if test -n "$gtlslib"; then
1820 dnl when shared libs were found in a path that the run-time
1821 dnl linker doesn't search through, we need to add it to
1822 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1824 if test "x$cross_compiling" != "xyes"; then
1825 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
1826 export LD_LIBRARY_PATH
1827 AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
1834 fi dnl GNUTLS not disabled
1839 dnl Check which crypto backend GnuTLS uses
1842 if test "$GNUTLS_ENABLED" = "1"; then
1844 # First check if we can detect either crypto library via transitive linking
1845 AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
1846 if test "$USE_GNUTLS_NETTLE" = ""; then
1847 AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
1849 # If not, try linking directly to both of them to see if they are available
1850 if test "$USE_GNUTLS_NETTLE" = ""; then
1851 AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
1853 if test "$USE_GNUTLS_NETTLE" = ""; then
1854 AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
1856 if test "$USE_GNUTLS_NETTLE" = ""; then
1857 AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
1859 if test "$USE_GNUTLS_NETTLE" = "1"; then
1860 AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
1861 AC_SUBST(USE_GNUTLS_NETTLE, [1])
1862 LIBS="-lnettle $LIBS"
1864 LIBS="-lgcrypt $LIBS"
1869 dnl We require GnuTLS with SRP support.
1871 if test "$GNUTLS_ENABLED" = "1"; then
1872 AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
1874 AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
1875 AC_SUBST(HAVE_GNUTLS_SRP, [1])
1879 dnl ----------------------------------------------------
1880 dnl check for PolarSSL
1881 dnl ----------------------------------------------------
1883 dnl Default to compiler & linker defaults for PolarSSL files & libraries.
1888 AC_ARG_WITH(polarssl,dnl
1889 AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root])
1890 AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
1891 OPT_POLARSSL=$withval)
1893 if test "$curl_ssl_msg" = "$init_ssl_msg"; then
1895 if test X"$OPT_POLARSSL" != Xno; then
1897 if test "$OPT_POLARSSL" = "yes"; then
1901 if test -z "$OPT_POLARSSL" ; then
1902 dnl check for lib first without setting any new path
1904 AC_CHECK_LIB(polarssl, havege_init,
1905 dnl libpolarssl found, set the variable
1907 AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
1908 AC_SUBST(USE_POLARSSL, [1])
1911 curl_ssl_msg="enabled (PolarSSL)"
1920 if test "x$USE_POLARSSL" != "xyes"; then
1921 dnl add the path and test again
1922 addld=-L$OPT_POLARSSL/lib$libsuff
1923 addcflags=-I$OPT_POLARSSL/include
1924 polarssllib=$OPT_POLARSSL/lib$libsuff
1926 LDFLAGS="$LDFLAGS $addld"
1927 if test "$addcflags" != "-I/usr/include"; then
1928 CPPFLAGS="$CPPFLAGS $addcflags"
1931 AC_CHECK_LIB(polarssl, ssl_init,
1933 AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
1934 AC_SUBST(USE_POLARSSL, [1])
1937 curl_ssl_msg="enabled (PolarSSL)"
1945 if test "x$USE_POLARSSL" = "xyes"; then
1946 AC_MSG_NOTICE([detected PolarSSL])
1948 LIBS="-lpolarssl $LIBS"
1950 if test -n "$polarssllib"; then
1951 dnl when shared libs were found in a path that the run-time
1952 dnl linker doesn't search through, we need to add it to
1953 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1955 if test "x$cross_compiling" != "xyes"; then
1956 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
1957 export LD_LIBRARY_PATH
1958 AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
1963 fi dnl PolarSSL not disabled
1967 dnl ----------------------------------------------------
1968 dnl check for CyaSSL
1969 dnl ----------------------------------------------------
1971 dnl Default to compiler & linker defaults for CyaSSL files & libraries.
1976 AC_ARG_WITH(cyassl,dnl
1977 AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)])
1978 AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
1979 OPT_CYASSL=$withval)
1981 if test "$curl_ssl_msg" = "$init_ssl_msg"; then
1983 if test X"$OPT_CYASSL" != Xno; then
1985 if test "$OPT_CYASSL" = "yes"; then
1989 dnl This should be reworked to use pkg-config instead
1991 cyassllibname=cyassl
1993 if test -z "$OPT_CYASSL" ; then
1994 dnl check for lib in system default first
1996 AC_CHECK_LIB(cyassl, CyaSSL_Init,
1997 dnl libcyassl found, set the variable
1999 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
2000 AC_SUBST(USE_CYASSL, [1])
2003 curl_ssl_msg="enabled (CyaSSL)"
2012 if test "x$USE_CYASSL" != "xyes"; then
2013 dnl add the path and test again
2014 addld=-L$OPT_CYASSL/lib$libsuff
2015 addcflags=-I$OPT_CYASSL/include
2016 cyassllib=$OPT_CYASSL/lib$libsuff
2018 LDFLAGS="$LDFLAGS $addld"
2019 if test "$addcflags" != "-I/usr/include"; then
2020 CPPFLAGS="$CPPFLAGS $addcflags"
2023 AC_CHECK_LIB(cyassl, CyaSSL_Init,
2025 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
2026 AC_SUBST(USE_CYASSL, [1])
2029 curl_ssl_msg="enabled (CyaSSL)"
2042 if test "x$USE_CYASSL" != "xyes"; then
2043 dnl libcyassl renamed to libwolfssl as of 3.4.0
2044 addld=-L$OPT_CYASSL/lib$libsuff
2045 addcflags=-I$OPT_CYASSL/include
2046 cyassllib=$OPT_CYASSL/lib$libsuff
2048 LDFLAGS="$LDFLAGS $addld"
2049 if test "$addcflags" != "-I/usr/include"; then
2050 CPPFLAGS="$CPPFLAGS $addcflags"
2053 cyassllibname=wolfssl
2054 my_ac_save_LIBS="$LIBS"
2055 LIBS="-l$cyassllibname -lm $LIBS"
2057 AC_MSG_CHECKING([for CyaSSL_Init in -lwolfssl])
2060 /* These aren't needed for detection and confuse WolfSSL.
2061 They are set up properly later if it is detected. */
2063 #undef SIZEOF_LONG_LONG
2064 #include <cyassl/ssl.h>
2066 return CyaSSL_Init();
2070 AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
2071 AC_SUBST(USE_CYASSL, [1])
2074 curl_ssl_msg="enabled (CyaSSL)"
2082 LIBS="$my_ac_save_LIBS"
2085 if test "x$USE_CYASSL" = "xyes"; then
2086 AC_MSG_NOTICE([detected CyaSSL])
2088 dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
2089 AC_CHECK_SIZEOF(long long)
2091 dnl Versions since at least 2.6.0 may have options.h
2092 AC_CHECK_HEADERS(cyassl/options.h)
2094 dnl Versions since at least 2.9.4 renamed error.h to error-ssl.h
2095 AC_CHECK_HEADERS(cyassl/error-ssl.h)
2097 LIBS="-l$cyassllibname -lm $LIBS"
2099 if test -n "$cyassllib"; then
2100 dnl when shared libs were found in a path that the run-time
2101 dnl linker doesn't search through, we need to add it to
2102 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2104 if test "x$cross_compiling" != "xyes"; then
2105 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib"
2106 export LD_LIBRARY_PATH
2107 AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH])
2113 fi dnl CyaSSL not disabled
2117 dnl ----------------------------------------------------
2118 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
2119 dnl ----------------------------------------------------
2121 dnl Default to compiler & linker defaults for NSS files & libraries.
2125 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
2126 AC_HELP_STRING([--without-nss], [disable NSS detection]),
2129 if test "$curl_ssl_msg" = "$init_ssl_msg"; then
2131 if test X"$OPT_NSS" != Xno; then
2139 if test "x$OPT_NSS" = "xyes"; then
2141 CURL_CHECK_PKGCONFIG(nss)
2143 if test "$PKGCONFIG" != "no" ; then
2144 addlib=`$PKGCONFIG --libs nss`
2145 addcflags=`$PKGCONFIG --cflags nss`
2146 version=`$PKGCONFIG --modversion nss`
2147 nssprefix=`$PKGCONFIG --variable=prefix nss`
2149 dnl Without pkg-config, we check for nss-config
2151 check=`nss-config --version 2>/dev/null`
2152 if test -n "$check"; then
2153 addlib=`nss-config --libs`
2154 addcflags=`nss-config --cflags`
2155 version=`nss-config --version`
2156 nssprefix=`nss-config --prefix`
2164 NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
2165 if test -f "$NSS_PCDIR/nss.pc"; then
2166 CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
2167 if test "$PKGCONFIG" != "no" ; then
2168 addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
2169 addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
2170 addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
2171 version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
2172 nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
2177 if test -z "$addlib"; then
2178 # Without pkg-config, we'll kludge in some defaults
2179 AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
2180 addld="-L$OPT_NSS/lib"
2181 addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
2182 addcflags="-I$OPT_NSS/include"
2187 CLEANLDFLAGS="$LDFLAGS"
2189 CLEANCPPFLAGS="$CPPFLAGS"
2191 LDFLAGS="$addld $LDFLAGS"
2192 LIBS="$addlib $LIBS"
2193 if test "$addcflags" != "-I/usr/include"; then
2194 CPPFLAGS="$CPPFLAGS $addcflags"
2197 dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
2198 AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
2200 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
2201 AC_SUBST(USE_NSS, [1])
2204 curl_ssl_msg="enabled (NSS)"
2207 LDFLAGS="$CLEANLDFLAGS"
2209 CPPFLAGS="$CLEANCPPFLAGS"
2212 if test "x$USE_NSS" = "xyes"; then
2213 AC_MSG_NOTICE([detected NSS version $version])
2215 dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
2217 AC_SUBST([NSS_LIBS])
2219 dnl when shared libs were found in a path that the run-time
2220 dnl linker doesn't search through, we need to add it to
2221 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
2223 if test "x$cross_compiling" != "xyes"; then
2224 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
2225 export LD_LIBRARY_PATH
2226 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
2231 fi dnl NSS not disabled
2233 fi dnl curl_ssl_msg = init_ssl_msg
2237 AC_ARG_WITH(axtls,dnl
2238 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.])
2239 AC_HELP_STRING([--without-axtls], [disable axTLS]),
2242 if test "$curl_ssl_msg" = "$init_ssl_msg"; then
2243 if test X"$OPT_AXTLS" != Xno; then
2244 dnl backup the pre-axtls variables
2245 CLEANLDFLAGS="$LDFLAGS"
2246 CLEANCPPFLAGS="$CPPFLAGS"
2249 case "$OPT_AXTLS" in
2251 dnl --with-axtls (without path) used
2252 PREFIX_AXTLS=/usr/local
2253 LIB_AXTLS="$PREFIX_AXTLS/lib"
2254 LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
2255 CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
2258 dnl no --with-axtls option given, just check default places
2262 dnl check the given --with-axtls spot
2263 PREFIX_AXTLS=$OPT_AXTLS
2264 LIB_AXTLS="$PREFIX_AXTLS/lib"
2265 LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
2266 CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
2270 AC_CHECK_LIB(axtls, ssl_version,[
2271 LIBS="-laxtls $LIBS"
2272 AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled])
2273 AC_SUBST(USE_AXTLS, [1])
2276 curl_ssl_msg="enabled (axTLS)"
2278 if test "x$cross_compiling" != "xyes"; then
2279 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS"
2280 export LD_LIBRARY_PATH
2281 AC_MSG_NOTICE([Added $LIB_AXTLS to LD_LIBRARY_PATH])
2284 LDFLAGS="$CLEANLDFLAGS"
2285 CPPFLAGS="$CLEANCPPFLAGS"
2291 if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
2292 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
2293 AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.])
2295 # SSL is enabled, genericly
2296 AC_SUBST(SSL_ENABLED)
2300 dnl **********************************************************************
2301 dnl Check for the CA bundle
2302 dnl **********************************************************************
2304 CURL_CHECK_CA_BUNDLE
2306 dnl **********************************************************************
2307 dnl Check for libmetalink
2308 dnl **********************************************************************
2312 AC_ARG_WITH(libmetalink,dnl
2313 AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
2314 AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
2315 OPT_LIBMETALINK=$withval)
2317 if test X"$OPT_LIBMETALINK" != Xno; then
2326 if test "x$OPT_LIBMETALINK" = "xyes"; then
2327 dnl this is with no partiular path given
2329 CURL_CHECK_PKGCONFIG(libmetalink)
2331 dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
2332 LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
2333 AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
2334 if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
2337 if test "$PKGTEST" = "yes"; then
2338 CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
2341 if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
2342 addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2343 $PKGCONFIG --libs-only-l libmetalink`
2344 addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2345 $PKGCONFIG --libs-only-L libmetalink`
2346 addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2347 $PKGCONFIG --cflags-only-I libmetalink`
2348 version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
2349 $PKGCONFIG --modversion libmetalink`
2350 libmetalinklib=`echo $addld | $SED -e 's/-L//'`
2352 if test -n "$addlib"; then
2354 clean_CPPFLAGS="$CPPFLAGS"
2355 clean_LDFLAGS="$LDFLAGS"
2357 CPPFLAGS="$addcflags $clean_CPPFLAGS"
2358 LDFLAGS="$addld $clean_LDFLAGS"
2359 LIBS="$addlib $clean_LIBS"
2360 AC_MSG_CHECKING([if libmetalink is recent enough])
2363 # include <metalink/metalink.h>
2365 if(0 != metalink_strerror(0)) /* added in 0.1.0 */
2369 AC_MSG_RESULT([yes ($version)])
2372 AC_MSG_RESULT([no ($version)])
2373 AC_MSG_NOTICE([libmetalink library defective or too old])
2376 CPPFLAGS="$clean_CPPFLAGS"
2377 LDFLAGS="$clean_LDFLAGS"
2379 if test "$want_metalink" = "yes"; then
2380 dnl finally libmetalink will be used
2381 AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
2382 LIBMETALINK_LIBS=$addlib
2383 LIBMETALINK_LDFLAGS=$addld
2384 LIBMETALINK_CPPFLAGS=$addcflags
2385 AC_SUBST([LIBMETALINK_LIBS])
2386 AC_SUBST([LIBMETALINK_LDFLAGS])
2387 AC_SUBST([LIBMETALINK_CPPFLAGS])
2388 curl_mtlnk_msg="enabled"
2394 dnl **********************************************************************
2395 dnl Check for the presence of LIBSSH2 libraries and headers
2396 dnl **********************************************************************
2398 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
2400 AC_ARG_WITH(libssh2,dnl
2401 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])
2402 AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
2403 OPT_LIBSSH2=$withval)
2405 if test X"$OPT_LIBSSH2" != Xno; then
2406 dnl backup the pre-libssh2 variables
2407 CLEANLDFLAGS="$LDFLAGS"
2408 CLEANCPPFLAGS="$CPPFLAGS"
2411 case "$OPT_LIBSSH2" in
2413 dnl --with-libssh2 (without path) used
2414 CURL_CHECK_PKGCONFIG(libssh2)
2416 if test "$PKGCONFIG" != "no" ; then
2417 LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
2418 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2419 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2420 version=`$PKGCONFIG --modversion libssh2`
2421 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
2426 dnl no --with-libssh2 option given, just check default places
2429 dnl use the given --with-libssh2 spot
2430 PREFIX_SSH2=$OPT_LIBSSH2
2434 dnl if given with a prefix, we set -L and -I based on that
2435 if test -n "$PREFIX_SSH2"; then
2437 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2438 CPP_SSH2=-I${PREFIX_SSH2}/include
2439 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2442 LDFLAGS="$LDFLAGS $LD_SSH2"
2443 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2444 LIBS="$LIB_SSH2 $LIBS"
2446 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
2448 AC_CHECK_HEADERS(libssh2.h,
2449 curl_ssh_msg="enabled (libSSH2)"
2451 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2452 AC_SUBST(USE_LIBSSH2, [1])
2455 if test X"$OPT_LIBSSH2" != Xoff &&
2456 test "$LIBSSH2_ENABLED" != "1"; then
2457 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2460 if test "$LIBSSH2_ENABLED" = "1"; then
2461 if test -n "$DIR_SSH2"; then
2462 dnl when the libssh2 shared libs were found in a path that the run-time
2463 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
2464 dnl to prevent further configure tests to fail due to this
2466 if test "x$cross_compiling" != "xyes"; then
2467 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
2468 export LD_LIBRARY_PATH
2469 AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH])
2473 dnl no libssh2, revert back to clean variables
2474 LDFLAGS=$CLEANLDFLAGS
2475 CPPFLAGS=$CLEANCPPFLAGS
2480 dnl **********************************************************************
2481 dnl Check for the presence of LIBRTMP libraries and headers
2482 dnl **********************************************************************
2484 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2486 AC_ARG_WITH(librtmp,dnl
2487 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])
2488 AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2489 OPT_LIBRTMP=$withval)
2491 if test X"$OPT_LIBRTMP" != Xno; then
2492 dnl backup the pre-librtmp variables
2493 CLEANLDFLAGS="$LDFLAGS"
2494 CLEANCPPFLAGS="$CPPFLAGS"
2497 case "$OPT_LIBRTMP" in
2499 dnl --with-librtmp (without path) used
2500 CURL_CHECK_PKGCONFIG(librtmp)
2502 if test "$PKGCONFIG" != "no" ; then
2503 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2504 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2505 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2506 version=`$PKGCONFIG --modversion librtmp`
2507 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
2509 dnl To avoid link errors, we do not allow --librtmp without
2510 dnl a pkgconfig file
2511 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2516 dnl no --with-librtmp option given, just check default places
2520 dnl use the given --with-librtmp spot
2521 PREFIX_RTMP=$OPT_LIBRTMP
2525 dnl if given with a prefix, we set -L and -I based on that
2526 if test -n "$PREFIX_RTMP"; then
2527 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
2528 CPP_RTMP=-I${PREFIX_RTMP}/include
2529 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
2532 LDFLAGS="$LDFLAGS $LD_RTMP"
2533 CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2534 LIBS="$LIB_RTMP $LIBS"
2536 AC_CHECK_LIB(rtmp, RTMP_Init,
2538 AC_CHECK_HEADERS(librtmp/rtmp.h,
2539 curl_rtmp_msg="enabled (librtmp)"
2541 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
2542 AC_SUBST(USE_LIBRTMP, [1])
2545 dnl not found, revert back to clean variables
2546 LDFLAGS=$CLEANLDFLAGS
2547 CPPFLAGS=$CLEANCPPFLAGS
2551 if test X"$OPT_LIBRTMP" != Xoff &&
2552 test "$LIBRTMP_ENABLED" != "1"; then
2553 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
2558 dnl **********************************************************************
2559 dnl Check for linker switch for versioned symbols
2560 dnl **********************************************************************
2562 versioned_symbols_flavour=
2563 AC_MSG_CHECKING([whether versioned symbols are wanted])
2564 AC_ARG_ENABLE(versioned-symbols,
2565 AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2566 AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2567 [ case "$enableval" in
2568 yes) AC_MSG_RESULT(yes)
2569 AC_MSG_CHECKING([if libraries can be versioned])
2570 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
2571 if test -z "$GLD"; then
2573 AC_MSG_WARN([You need an ld version supporting the --version-script option])
2576 if test "x$OPENSSL_ENABLED" = "x1"; then
2577 versioned_symbols_flavour="OPENSSL_"
2578 elif test "x$GNUTLS_ENABLED" = "x1"; then
2579 versioned_symbols_flavour="GNUTLS_"
2580 elif test "x$NSS_ENABLED" = "x1"; then
2581 versioned_symbols_flavour="NSS_"
2582 elif test "x$POLARSSL_ENABLED" = "x1"; then
2583 versioned_symbols_flavour="POLARSSL_"
2584 elif test "x$CYASSL_ENABLED" = "x1"; then
2585 versioned_symbols_flavour="CYASSL_"
2586 elif test "x$AXTLS_ENABLED" = "x1"; then
2587 versioned_symbols_flavour="AXTLS_"
2588 elif test "x$WINSSL_ENABLED" = "x1"; then
2589 versioned_symbols_flavour="WINSSL_"
2590 elif test "x$DARWINSSL_ENABLED" = "x1"; then
2591 versioned_symbols_flavour="DARWINSSL_"
2593 versioned_symbols_flavour=""
2595 versioned_symbols="yes"
2599 *) AC_MSG_RESULT(no)
2607 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
2608 ["$versioned_symbols_flavour"])
2609 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
2610 [test "x$versioned_symbols" = 'xyes'])
2612 dnl -------------------------------------------------
2613 dnl check winidn option before other IDN libraries
2614 dnl -------------------------------------------------
2616 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
2617 OPT_WINIDN="default"
2619 AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
2620 AC_HELP_STRING([--without-winidn], [disable Windows native IDN]),
2621 OPT_WINIDN=$withval)
2622 case "$OPT_WINIDN" in
2624 dnl --without-winidn option used or configure option not specified
2629 dnl --with-winidn option used without path
2631 want_winidn_path="default"
2632 AC_MSG_RESULT([yes])
2635 dnl --with-winidn option used with path
2637 want_winidn_path="$withval"
2638 AC_MSG_RESULT([yes ($withval)])
2642 if test "$want_winidn" = "yes"; then
2643 dnl winidn library support has been requested
2644 clean_CPPFLAGS="$CPPFLAGS"
2645 clean_LDFLAGS="$LDFLAGS"
2647 WINIDN_LIBS="-lnormaliz"
2649 if test "$want_winidn_path" != "default"; then
2650 dnl path has been specified
2651 dnl pkg-config not available or provides no info
2652 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
2653 WINIDN_CPPFLAGS="-I$want_winidn_path/include"
2654 WINIDN_DIR="$want_winidn_path/lib$libsuff"
2657 CPPFLAGS="$WINIDN_CPPFLAGS $CPPFLAGS"
2658 LDFLAGS="$WINIDN_LDFLAGS $LDFLAGS"
2659 LIBS="$WINIDN_LIBS $LIBS"
2661 AC_MSG_CHECKING([if IdnToUnicode can be linked])
2663 AC_LANG_FUNC_LINK_TRY([IdnToUnicode])
2665 AC_MSG_RESULT([yes])
2666 tst_links_winidn="yes"
2669 tst_links_winidn="no"
2672 if test "$tst_links_winidn" = "yes"; then
2673 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
2674 AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
2675 AC_SUBST([IDN_ENABLED], [1])
2676 curl_idn_msg="enabled (Windows-native)"
2678 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2679 CPPFLAGS="$clean_CPPFLAGS"
2680 LDFLAGS="$clean_LDFLAGS"
2685 dnl **********************************************************************
2686 dnl Check for the presence of IDN libraries and headers
2687 dnl **********************************************************************
2689 AC_MSG_CHECKING([whether to build with libidn])
2692 AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
2693 AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
2697 dnl --without-libidn option used
2702 dnl configure option not specified
2704 want_idn_path="default"
2705 AC_MSG_RESULT([(assumed) yes])
2708 dnl --with-libidn option used without path
2710 want_idn_path="default"
2711 AC_MSG_RESULT([yes])
2714 dnl --with-libidn option used with path
2716 want_idn_path="$withval"
2717 AC_MSG_RESULT([yes ($withval)])
2721 if test "$want_idn" = "yes"; then
2722 dnl idn library support has been requested
2723 clean_CPPFLAGS="$CPPFLAGS"
2724 clean_LDFLAGS="$LDFLAGS"
2728 if test "$want_idn_path" != "default"; then
2729 dnl path has been specified
2730 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2731 CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR])
2732 if test "$PKGCONFIG" != "no"; then
2733 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2734 $PKGCONFIG --libs-only-l libidn 2>/dev/null`
2735 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2736 $PKGCONFIG --libs-only-L libidn 2>/dev/null`
2737 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2738 $PKGCONFIG --cflags-only-I libidn 2>/dev/null`
2739 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
2741 dnl pkg-config not available or provides no info
2743 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2744 IDN_CPPFLAGS="-I$want_idn_path/include"
2745 IDN_DIR="$want_idn_path/lib$libsuff"
2748 dnl path not specified
2749 CURL_CHECK_PKGCONFIG(libidn)
2750 if test "$PKGCONFIG" != "no"; then
2751 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null`
2752 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null`
2753 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
2754 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
2756 dnl pkg-config not available or provides no info
2761 if test "$PKGCONFIG" != "no"; then
2762 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2763 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2764 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2765 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2767 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2768 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2769 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2770 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2773 CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
2774 LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
2775 LIBS="$IDN_LIBS $LIBS"
2777 AC_MSG_CHECKING([if idna_to_ascii_4i can be linked])
2779 AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i])
2781 AC_MSG_RESULT([yes])
2782 tst_links_libidn="yes"
2785 tst_links_libidn="no"
2787 if test "$tst_links_libidn" = "no"; then
2788 AC_MSG_CHECKING([if idna_to_ascii_lz can be linked])
2790 AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz])
2792 AC_MSG_RESULT([yes])
2793 tst_links_libidn="yes"
2796 tst_links_libidn="no"
2800 if test "$tst_links_libidn" = "yes"; then
2801 AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).])
2802 dnl different versions of libidn have different setups of these:
2803 AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror )
2804 AC_CHECK_HEADERS( idn-free.h tld.h )
2805 if test "x$ac_cv_header_tld_h" = "xyes"; then
2806 AC_SUBST([IDN_ENABLED], [1])
2807 curl_idn_msg="enabled"
2808 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2809 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
2810 export LD_LIBRARY_PATH
2811 AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
2814 AC_MSG_WARN([Libraries for IDN support too old: IDN disabled])
2815 CPPFLAGS="$clean_CPPFLAGS"
2816 LDFLAGS="$clean_LDFLAGS"
2820 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2821 CPPFLAGS="$clean_CPPFLAGS"
2822 LDFLAGS="$clean_LDFLAGS"
2828 dnl Let's hope this split URL remains working:
2829 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
2830 dnl genprogc/thread_quick_ref.htm
2833 dnl **********************************************************************
2834 dnl Check for nghttp2
2835 dnl **********************************************************************
2838 AC_ARG_WITH(nghttp2,
2839 AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
2840 AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2844 dnl --without-nghttp2 option used
2848 dnl --with-nghttp2 option used without path
2853 dnl --with-nghttp2 option used with path
2855 want_h2_path="$withval/lib/pkgconfig"
2859 curl_h2_msg="disabled (--with-nghttp2)"
2860 if test X"$want_h2" != Xno; then
2861 dnl backup the pre-nghttp2 variables
2862 CLEANLDFLAGS="$LDFLAGS"
2863 CLEANCPPFLAGS="$CPPFLAGS"
2866 CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path)
2868 if test "$PKGCONFIG" != "no" ; then
2869 LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
2870 $PKGCONFIG --libs-only-l libnghttp2`
2871 AC_MSG_NOTICE([-l is $LIB_H2])
2873 CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl
2874 $PKGCONFIG --cflags-only-I libnghttp2`
2875 AC_MSG_NOTICE([-I is $CPP_H2])
2877 LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
2878 $PKGCONFIG --libs-only-L libnghttp2`
2879 AC_MSG_NOTICE([-L is $LD_H2])
2881 LDFLAGS="$LDFLAGS $LD_H2"
2882 CPPFLAGS="$CPPFLAGS $CPP_H2"
2883 LIBS="$LIB_H2 $LIBS"
2885 # use nghttp2_option_set_no_recv_client_magic to require nghttp2
2887 AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic,
2889 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
2890 curl_h2_msg="enabled (nghttp2)"
2892 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
2893 AC_SUBST(USE_NGHTTP2, [1])
2896 dnl not found, revert back to clean variables
2897 LDFLAGS=$CLEANLDFLAGS
2898 CPPFLAGS=$CLEANCPPFLAGS
2903 dnl no nghttp2 pkg-config found, deal with it
2904 if test X"$want_h2" != Xdefault; then
2905 dnl To avoid link errors, we do not allow --with-nghttp2 without
2906 dnl a pkgconfig file
2907 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2913 dnl **********************************************************************
2914 dnl Back to "normal" configuring
2915 dnl **********************************************************************
2917 dnl Checks for header files.
2920 CURL_CHECK_HEADER_MALLOC
2921 CURL_CHECK_HEADER_MEMORY
2923 dnl Now check for the very most basic headers. Then we can use these
2924 dnl ones as default-headers when checking for the rest!
2967 dnl to do if not found
2971 dnl default includes
2973 #ifdef HAVE_SYS_TYPES_H
2974 #include <sys/types.h>
2976 #ifdef HAVE_SYS_TIME_H
2977 #include <sys/time.h>
2979 #ifdef HAVE_SYS_SELECT_H
2980 #include <sys/select.h>
2982 #ifdef HAVE_SYS_SOCKET_H
2983 #include <sys/socket.h>
2985 #ifdef HAVE_NETINET_IN_H
2986 #include <netinet/in.h>
2988 #ifdef HAVE_SYS_UN_H
2994 dnl Checks for typedefs, structures, and compiler characteristics.
2996 CURL_CHECK_VARIADIC_MACROS
2999 CURL_CHECK_STRUCT_TIMEVAL
3000 CURL_VERIFY_RUNTIMELIBS
3002 AC_CHECK_SIZEOF(size_t)
3003 AC_CHECK_SIZEOF(long)
3004 AC_CHECK_SIZEOF(int)
3005 AC_CHECK_SIZEOF(short)
3007 AC_CHECK_SIZEOF(time_t)
3008 AC_CHECK_SIZEOF(off_t)
3011 if test x"$ac_cv_native_windows" != "xyes" &&
3012 test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
3013 AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
3014 AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
3019 AC_CHECK_TYPE(long long,
3020 [AC_DEFINE(HAVE_LONGLONG, 1,
3021 [Define to 1 if the compiler supports the 'long long' data type.])]
3025 if test "xyes" = "x$longlong"; then
3026 AC_MSG_CHECKING([if numberLL works])
3030 long long val = 1000LL;
3033 AC_MSG_RESULT([yes])
3034 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
3042 AC_CHECK_TYPE(ssize_t, ,
3043 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3045 # check for bool type
3046 AC_CHECK_TYPE([bool],[
3047 AC_DEFINE(HAVE_BOOL_T, 1,
3048 [Define to 1 if bool is an available type.])
3050 #ifdef HAVE_SYS_TYPES_H
3051 #include <sys/types.h>
3053 #ifdef HAVE_STDBOOL_H
3054 #include <stdbool.h>
3058 CURL_CONFIGURE_CURL_SOCKLEN_T
3060 CURL_CONFIGURE_PULL_SYS_POLL
3064 TYPE_SOCKADDR_STORAGE
3070 CURL_CHECK_FUNC_SELECT
3072 CURL_CHECK_FUNC_RECV
3073 CURL_CHECK_FUNC_SEND
3074 CURL_CHECK_MSG_NOSIGNAL
3076 CURL_CHECK_FUNC_ALARM
3077 CURL_CHECK_FUNC_BASENAME
3078 CURL_CHECK_FUNC_CLOSESOCKET
3079 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3080 CURL_CHECK_FUNC_CONNECT
3081 CURL_CHECK_FUNC_FCNTL
3082 CURL_CHECK_FUNC_FDOPEN
3083 CURL_CHECK_FUNC_FREEADDRINFO
3084 CURL_CHECK_FUNC_FREEIFADDRS
3085 CURL_CHECK_FUNC_FSETXATTR
3086 CURL_CHECK_FUNC_FTRUNCATE
3087 CURL_CHECK_FUNC_GETADDRINFO
3088 CURL_CHECK_FUNC_GAI_STRERROR
3089 CURL_CHECK_FUNC_GETHOSTBYADDR
3090 CURL_CHECK_FUNC_GETHOSTBYADDR_R
3091 CURL_CHECK_FUNC_GETHOSTBYNAME
3092 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3093 CURL_CHECK_FUNC_GETHOSTNAME
3094 CURL_CHECK_FUNC_GETIFADDRS
3095 CURL_CHECK_FUNC_GETSERVBYPORT_R
3096 CURL_CHECK_FUNC_GMTIME_R
3097 CURL_CHECK_FUNC_INET_NTOA_R
3098 CURL_CHECK_FUNC_INET_NTOP
3099 CURL_CHECK_FUNC_INET_PTON
3100 CURL_CHECK_FUNC_IOCTL
3101 CURL_CHECK_FUNC_IOCTLSOCKET
3102 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3103 CURL_CHECK_FUNC_LOCALTIME_R
3104 CURL_CHECK_FUNC_MEMRCHR
3105 CURL_CHECK_FUNC_POLL
3106 CURL_CHECK_FUNC_SETSOCKOPT
3107 CURL_CHECK_FUNC_SIGACTION
3108 CURL_CHECK_FUNC_SIGINTERRUPT
3109 CURL_CHECK_FUNC_SIGNAL
3110 CURL_CHECK_FUNC_SIGSETJMP
3111 CURL_CHECK_FUNC_SOCKET
3112 CURL_CHECK_FUNC_SOCKETPAIR
3113 CURL_CHECK_FUNC_STRCASECMP
3114 CURL_CHECK_FUNC_STRCMPI
3115 CURL_CHECK_FUNC_STRDUP
3116 CURL_CHECK_FUNC_STRERROR_R
3117 CURL_CHECK_FUNC_STRICMP
3118 CURL_CHECK_FUNC_STRNCASECMP
3119 CURL_CHECK_FUNC_STRNCMPI
3120 CURL_CHECK_FUNC_STRNICMP
3121 CURL_CHECK_FUNC_STRSTR
3122 CURL_CHECK_FUNC_STRTOK_R
3123 CURL_CHECK_FUNC_STRTOLL
3124 CURL_CHECK_FUNC_WRITEV
3130 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3134 AC_CHECK_FUNCS([fork \
3155 eval skipcheck=\$skipcheck_$func
3156 if test "x$skipcheck" != "xyes"; then
3157 AC_MSG_CHECKING([deeper for $func])
3164 AC_MSG_RESULT([yes])
3165 eval "ac_cv_func_$func=yes"
3166 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3167 [Define to 1 if you have the $func function.])
3169 AC_MSG_RESULT([but still no])
3174 dnl Check if the getnameinfo function is available
3175 dnl and get the types of five of its arguments.
3176 CURL_CHECK_FUNC_GETNAMEINFO
3178 if test "$ipv6" = "yes"; then
3179 if test "$ac_cv_func_getaddrinfo" = "yes"; then
3180 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
3182 AC_SUBST(IPV6_ENABLED)
3184 CURL_CHECK_NI_WITHSCOPEID
3187 CURL_CHECK_NONBLOCKING_SOCKET
3189 dnl ************************************************************
3190 dnl nroff tool stuff
3193 AC_PATH_PROG( PERL, perl, ,
3194 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3197 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3198 $PATH:/usr/bin/:/usr/local/bin )
3201 if test -n "$NROFF"; then
3202 dnl only check for nroff options if an nroff command was found
3204 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3206 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3207 if test -z "$mancheck"; then
3209 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3210 if test -z "$mancheck"; then
3212 AC_MSG_RESULT([failed])
3213 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3215 AC_MSG_RESULT([$MANOPT])
3218 AC_MSG_RESULT([$MANOPT])
3223 if test -z "$MANOPT"
3225 dnl if no nroff tool was found, or no option that could convert man pages
3226 dnl was found, then disable the built-in manual stuff
3227 AC_MSG_WARN([disabling built-in manual])
3231 dnl *************************************************************************
3232 dnl If the manual variable still is set, then we go with providing a built-in
3235 if test "$USE_MANUAL" = "1"; then
3236 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3237 curl_manual_msg="enabled"
3240 dnl set variable for use in automakefile(s)
3241 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3244 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
3246 if test "x$ac_cv_native_windows" != "xyes" &&
3247 test "x$enable_shared" = "xyes"; then
3248 build_libhostname=yes
3250 build_libhostname=no
3252 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3254 CURL_CHECK_OPTION_THREADED_RESOLVER
3256 if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
3258 [Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
3261 if test "$want_thres" = "yes" && test "$dontwant_rt" = "no"; then
3262 AC_CHECK_HEADER(pthread.h,
3263 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3264 save_CFLAGS="$CFLAGS"
3266 dnl first check for function without lib
3267 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3269 dnl if it wasn't found without lib, search for it in pthread lib
3270 if test "$USE_THREADS_POSIX" != "1"
3272 CFLAGS="$CFLAGS -pthread"
3273 AC_CHECK_LIB(pthread, pthread_create,
3274 [USE_THREADS_POSIX=1],
3275 [ CFLAGS="$save_CFLAGS"])
3278 if test "x$USE_THREADS_POSIX" = "x1"
3280 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3281 curl_res_msg="POSIX threaded"
3288 dnl ************************************************************
3289 dnl disable verbose text strings
3291 AC_MSG_CHECKING([whether to enable verbose strings])
3292 AC_ARG_ENABLE(verbose,
3293 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
3294 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3295 [ case "$enableval" in
3298 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3299 curl_verbose_msg="no"
3301 *) AC_MSG_RESULT(yes)
3307 dnl ************************************************************
3308 dnl enable SSPI support
3310 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3312 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
3313 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
3314 [ case "$enableval" in
3316 if test "$ac_cv_native_windows" = "yes"; then
3318 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3319 AC_SUBST(USE_WINDOWS_SSPI, [1])
3320 curl_sspi_msg="enabled"
3323 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3327 if test "x$WINSSL_ENABLED" = "x1"; then
3328 # --with-winssl implies --enable-sspi
3335 if test "x$WINSSL_ENABLED" = "x1"; then
3336 # --with-winssl implies --enable-sspi
3343 dnl ************************************************************
3344 dnl disable cryptographic authentication
3346 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3347 AC_ARG_ENABLE(crypto-auth,
3348 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3349 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3350 [ case "$enableval" in
3353 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3354 CURL_DISABLE_CRYPTO_AUTH=1
3356 *) AC_MSG_RESULT(yes)
3362 CURL_CHECK_OPTION_NTLM_WB
3366 dnl ************************************************************
3367 dnl disable TLS-SRP authentication
3369 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
3370 AC_ARG_ENABLE(tls-srp,
3371 AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
3372 AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
3373 [ case "$enableval" in
3376 AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication])
3379 *) AC_MSG_RESULT(yes)
3387 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
3388 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
3390 curl_tls_srp_msg="enabled"
3393 dnl ************************************************************
3394 dnl disable Unix domain sockets support
3396 AC_MSG_CHECKING([whether to enable Unix domain sockets])
3397 AC_ARG_ENABLE(unix-sockets,
3398 AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
3399 AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
3400 [ case "$enableval" in
3401 no) AC_MSG_RESULT(no)
3402 want_unix_sockets=no
3404 *) AC_MSG_RESULT(yes)
3405 want_unix_sockets=yes
3409 want_unix_sockets=auto
3412 if test "x$want_unix_sockets" != "xno"; then
3413 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
3414 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
3415 AC_SUBST(USE_UNIX_SOCKETS, [1])
3416 curl_unix_sockets_msg="enabled"
3418 if test "x$want_unix_sockets" = "xyes"; then
3419 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
3426 dnl ************************************************************
3427 dnl disable cookies support
3429 AC_MSG_CHECKING([whether to enable support for cookies])
3430 AC_ARG_ENABLE(cookies,
3431 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
3432 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
3433 [ case "$enableval" in
3436 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
3438 *) AC_MSG_RESULT(yes)
3444 dnl ************************************************************
3445 dnl hiding of library internal symbols
3447 CURL_CONFIGURE_SYMBOL_HIDING
3449 dnl ************************************************************
3450 dnl enforce SONAME bump
3453 AC_MSG_CHECKING([whether to enforce SONAME bump])
3454 AC_ARG_ENABLE(soname-bump,
3455 AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
3456 AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
3457 [ case "$enableval" in
3458 yes) AC_MSG_RESULT(yes)
3465 AC_MSG_RESULT($soname_bump)
3467 AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
3470 dnl All the library dependencies put into $LIB apply to libcurl only.
3474 AC_SUBST(LIBCURL_LIBS)
3475 AC_SUBST(CURL_NETWORK_LIBS)
3476 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
3478 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
3479 dnl LIBS variable used in generated makefile at makefile processing
3480 dnl time. Doing this functionally prevents LIBS from being used for
3481 dnl all link targets in given makefile.
3483 AC_SUBST(BLANK_AT_MAKETIME)
3485 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
3488 ENABLE_SHARED="$enable_shared"
3489 AC_SUBST(ENABLE_SHARED)
3491 dnl to let curl-config output the static libraries correctly
3492 ENABLE_STATIC="$enable_static"
3493 AC_SUBST(ENABLE_STATIC)
3497 dnl For keeping supported features and protocols also in pkg-config file
3498 dnl since it is more cross-compile friendly than curl-config
3501 if test "x$OPENSSL_ENABLED" = "x1"; then
3502 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
3503 elif test -n "$SSL_ENABLED"; then
3504 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
3506 if test "x$IPV6_ENABLED" = "x1"; then
3507 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
3509 if test "x$USE_UNIX_SOCKETS" = "x1"; then
3510 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
3512 if test "x$HAVE_LIBZ" = "x1"; then
3513 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
3515 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then
3516 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
3518 if test "x$IDN_ENABLED" = "x1"; then
3519 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
3521 if test "x$USE_WINDOWS_SSPI" = "x1"; then
3522 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
3525 if test "x$HAVE_GSSAPI" = "x1"; then
3526 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
3529 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
3530 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
3531 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
3534 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
3535 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
3536 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
3539 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
3540 if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
3541 -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
3542 -o "x$DARWINSSL_ENABLED" = "x1"; then
3543 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
3545 if test "x$CURL_DISABLE_HTTP" != "x1" -a \
3546 "x$NTLM_WB_ENABLED" = "x1"; then
3547 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
3552 if test "x$USE_TLS_SRP" = "x1"; then
3553 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
3556 if test "x$USE_NGHTTP2" = "x1"; then
3557 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
3560 AC_SUBST(SUPPORT_FEATURES)
3562 dnl For supported protocols in pkg-config file
3563 if test "x$CURL_DISABLE_HTTP" != "x1"; then
3564 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
3565 if test "x$SSL_ENABLED" = "x1"; then
3566 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
3569 if test "x$CURL_DISABLE_FTP" != "x1"; then
3570 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
3571 if test "x$SSL_ENABLED" = "x1"; then
3572 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
3575 if test "x$CURL_DISABLE_FILE" != "x1"; then
3576 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
3578 if test "x$CURL_DISABLE_TELNET" != "x1"; then
3579 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
3581 if test "x$CURL_DISABLE_LDAP" != "x1"; then
3582 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
3583 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
3584 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
3585 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
3586 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
3590 if test "x$CURL_DISABLE_DICT" != "x1"; then
3591 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
3593 if test "x$CURL_DISABLE_TFTP" != "x1"; then
3594 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
3596 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
3597 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
3599 if test "x$CURL_DISABLE_POP3" != "x1"; then
3600 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
3601 if test "x$SSL_ENABLED" = "x1"; then
3602 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
3605 if test "x$CURL_DISABLE_IMAP" != "x1"; then
3606 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
3607 if test "x$SSL_ENABLED" = "x1"; then
3608 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
3611 if test "x$CURL_DISABLE_SMB" != "x1" \
3612 -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
3613 -a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
3614 -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
3615 -o "x$DARWINSSL_ENABLED" = "x1" \); then
3616 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
3617 if test "x$SSL_ENABLED" = "x1"; then
3618 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
3621 if test "x$CURL_DISABLE_SMTP" != "x1"; then
3622 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
3623 if test "x$SSL_ENABLED" = "x1"; then
3624 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
3627 if test "x$USE_LIBSSH2" = "x1"; then
3628 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
3629 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
3631 if test "x$CURL_DISABLE_RTSP" != "x1"; then
3632 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
3634 if test "x$USE_LIBRTMP" = "x1"; then
3635 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
3638 dnl replace spaces with newlines
3640 dnl replace the newlines back to spaces
3641 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
3643 AC_SUBST(SUPPORT_PROTOCOLS)
3645 dnl squeeze whitespace out of some variables
3653 squeeze LIBCURL_LIBS
3654 squeeze CURL_NETWORK_LIBS
3655 squeeze CURL_NETWORK_AND_TIME_LIBS
3657 squeeze SUPPORT_FEATURES
3658 squeeze SUPPORT_PROTOCOLS
3660 XC_CHECK_BUILD_FLAGS
3662 if test "x$want_curldebug_assumed" = "xyes" &&
3663 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
3664 ac_configure_args="$ac_configure_args --enable-curldebug"
3667 AC_CONFIG_FILES([Makefile \
3669 docs/examples/Makefile \
3670 docs/libcurl/Makefile \
3671 docs/libcurl/opts/Makefile \
3673 include/curl/Makefile \
3678 tests/certs/Makefile \
3679 tests/certs/scripts/Makefile \
3680 tests/data/Makefile \
3681 tests/server/Makefile \
3682 tests/libtest/Makefile \
3683 tests/unit/Makefile \
3685 packages/Win32/Makefile \
3686 packages/Win32/cygwin/Makefile \
3687 packages/Linux/Makefile \
3688 packages/Linux/RPM/Makefile \
3689 packages/Linux/RPM/curl.spec \
3690 packages/Linux/RPM/curl-ssl.spec \
3691 packages/Solaris/Makefile \
3692 packages/EPM/curl.list \
3693 packages/EPM/Makefile \
3694 packages/vms/Makefile \
3695 packages/AIX/Makefile \
3696 packages/AIX/RPM/Makefile \
3697 packages/AIX/RPM/curl.spec \
3703 CURL_GENERATE_CONFIGUREHELP_PM
3705 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
3707 AC_MSG_NOTICE([Configured to build curl/libcurl:
3709 curl version: ${CURLVERSION}
3711 Install prefix: ${prefix}
3713 SSL support: ${curl_ssl_msg}
3714 SSH support: ${curl_ssh_msg}
3715 zlib support: ${curl_zlib_msg}
3716 GSS-API support: ${curl_gss_msg}
3717 TLS-SRP support: ${curl_tls_srp_msg}
3718 resolver: ${curl_res_msg}
3719 IPv6 support: ${curl_ipv6_msg}
3720 Unix sockets support: ${curl_unix_sockets_msg}
3721 IDN support: ${curl_idn_msg}
3722 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
3723 Built-in manual: ${curl_manual_msg}
3724 --libcurl option: ${curl_libcurl_msg}
3725 Verbose errors: ${curl_verbose_msg}
3726 SSPI support: ${curl_sspi_msg}
3727 ca cert bundle: ${ca}
3728 ca cert path: ${capath}
3729 LDAP support: ${curl_ldap_msg}
3730 LDAPS support: ${curl_ldaps_msg}
3731 RTSP support: ${curl_rtsp_msg}
3732 RTMP support: ${curl_rtmp_msg}
3733 metalink support: ${curl_mtlnk_msg}
3734 HTTP2 support: ${curl_h2_msg}
3735 Protocols: ${SUPPORT_PROTOCOLS}
3738 if test "x$soname_bump" = "xyes"; then
3741 SONAME bump: yes - WARNING: this library will be built with the SONAME
3742 number bumped due to (a detected) ABI breakage.
3743 See lib/README.curl_off_t for details on this.