1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2009, 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.
22 #***************************************************************************
23 dnl Process this file with autoconf to produce a configure script.
27 dnl We don't know the version number "statically" so we use a dash here
28 AC_INIT([curl], [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
30 CURL_OVERRIDE_AUTOCONF
32 dnl configure script copyright
33 AC_COPYRIGHT([Copyright (c) 1998 - 2009 Daniel Stenberg, <daniel@haxx.se>
34 This configure script may be copied, distributed and modified under the
35 terms of the curl license; see COPYING for more details])
37 AC_CONFIG_SRCDIR([lib/urldata.h])
38 AM_CONFIG_HEADER(lib/config.h src/config.h include/curl/curlbuild.h)
41 CURL_CHECK_OPTION_DEBUG
42 CURL_CHECK_OPTION_OPTIMIZE
43 CURL_CHECK_OPTION_WARNINGS
45 CURL_CHECK_PATH_SEPARATOR
47 dnl SED is mandatory for configure process and libtool.
48 dnl Set it now, allowing it to be changed later.
49 AC_PATH_PROG([SED], [sed], [not_found],
50 [$PATH:/usr/bin:/usr/local/bin])
51 if test -z "$SED" || test "$SED" = "not_found"; then
52 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
56 dnl GREP is mandatory for configure process and libtool.
57 dnl Set it now, allowing it to be changed later.
58 AC_PATH_PROG([GREP], [grep], [not_found],
59 [$PATH:/usr/bin:/usr/local/bin])
60 if test -z "$GREP" || test "$GREP" = "not_found"; then
61 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
65 dnl EGREP is mandatory for configure process and libtool.
66 dnl Set it now, allowing it to be changed later.
67 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
68 AC_MSG_CHECKING([for egrep])
70 AC_MSG_RESULT([$EGREP])
72 AC_PATH_PROG([EGREP], [egrep], [not_found],
73 [$PATH:/usr/bin:/usr/local/bin])
75 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
76 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
80 dnl AR is mandatory for configure process and libtool.
81 dnl This is target dependant, so check it as a tool.
82 AC_PATH_TOOL([AR], [ar], [not_found],
83 [$PATH:/usr/bin:/usr/local/bin])
84 if test -z "$AR" || test "$AR" = "not_found"; then
85 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
91 dnl figure out the libcurl version
92 VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
93 AM_INIT_AUTOMAKE(curl,$VERSION)
94 AC_MSG_CHECKING([curl version])
95 AC_MSG_RESULT($VERSION)
98 dnl we extract the numerical version for curl-config only
99 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
102 dnl Solaris pkgadd support definitions
103 PKGADD_PKG="HAXXcurl"
104 PKGADD_NAME="cURL - a client that groks URLs"
105 PKGADD_VENDOR="curl.haxx.se"
107 AC_SUBST(PKGADD_NAME)
108 AC_SUBST(PKGADD_VENDOR)
111 dnl initialize all the info variables
112 curl_ssl_msg="no (--with-ssl / --with-gnutls)"
113 curl_ssh_msg="no (--with-libssh2)"
114 curl_zlib_msg="no (--with-zlib)"
115 curl_krb4_msg="no (--with-krb4*)"
116 curl_gss_msg="no (--with-gssapi)"
117 curl_spnego_msg="no (--with-spnego)"
118 curl_ares_msg="no (--enable-ares)"
119 curl_ipv6_msg="no (--enable-ipv6)"
120 curl_idn_msg="no (--with-libidn)"
121 curl_manual_msg="no (--enable-manual)"
122 curl_verbose_msg="enabled (--disable-verbose)"
123 curl_sspi_msg="no (--enable-sspi)"
124 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
125 curl_ldaps_msg="no (--enable-ldaps)"
128 dnl Save anything in $LIBS for later
133 dnl Detect the canonical host and target build environment
137 dnl Get system canonical name
138 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
140 dnl Checks for programs.
143 dnl Our curl_off_t internal and external configure settings
144 CURL_CONFIGURE_CURL_OFF_T
146 dnl This defines _ALL_SOURCE for AIX
147 CURL_CHECK_AIX_ALL_SOURCE
149 dnl Our configure and build reentrant settings
150 CURL_CONFIGURE_REENTRANT
152 dnl check for how to do large files
155 dnl support building of Windows DLLs
158 CURL_PROCESS_DEBUG_BUILD_OPTS
160 dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
161 AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
163 x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
175 AC_MSG_CHECKING([if we need -no-undefined])
177 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
178 need_no_undefined=yes
184 AC_MSG_RESULT($need_no_undefined)
185 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
187 AC_MSG_CHECKING([if we need -mimpure-text])
191 if test "$GCC" = "yes"; then
198 AC_MSG_RESULT($mimpure)
199 AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
200 AM_CONDITIONAL(STATICLIB, false)
202 AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
205 AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
207 AC_MSG_CHECKING([if we need CURL_STATICLIB])
208 if test "X$enable_shared" = "Xno"
210 AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
212 AM_CONDITIONAL(STATICLIB, true)
222 # Determine whether all dependent libraries must be specified when linking
223 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
229 AC_SUBST(REQUIRE_LIB_DEPS)
231 dnl The install stuff has already been taken care of by the automake stuff
235 dnl check if there's a way to force code inline
238 dnl **********************************************************************
239 dnl platform/compiler/architecture specific checks/flags
240 dnl **********************************************************************
243 CURL_SET_COMPILER_BASIC_OPTS
244 CURL_SET_COMPILER_DEBUG_OPTS
245 CURL_SET_COMPILER_OPTIMIZE_OPTS
246 CURL_SET_COMPILER_WARNING_OPTS
250 x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
252 if test "$compiler_id" = "INTEL_UNIX_C"; then
254 if test "$compiler_num" -ge "900" &&
255 test "$compiler_num" -lt "1000"; then
257 CFLAGS="$CFLAGS -i-dynamic"
260 if test "$compiler_num" -ge "1000"; then
261 dnl icc 10.X or later
262 CFLAGS="$CFLAGS -shared-intel"
270 CURL_CHECK_COMPILER_HALT_ON_ERROR
271 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
273 dnl **********************************************************************
274 dnl Compilation based checks should not be done before this point.
275 dnl **********************************************************************
277 dnl **********************************************************************
278 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
279 dnl and ws2tcpip.h take precedence over any other further checks which
280 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
281 dnl this specific header files. And do them before its results are used.
282 dnl **********************************************************************
284 CURL_CHECK_HEADER_WINDOWS
285 CURL_CHECK_NATIVE_WINDOWS
286 case X-"$ac_cv_native_windows" in
288 CURL_CHECK_HEADER_WINSOCK
289 CURL_CHECK_HEADER_WINSOCK2
290 CURL_CHECK_HEADER_WS2TCPIP
291 CURL_CHECK_HEADER_WINLDAP
292 CURL_CHECK_HEADER_WINBER
295 ac_cv_header_winsock_h="no"
296 ac_cv_header_winsock2_h="no"
297 ac_cv_header_ws2tcpip_h="no"
298 ac_cv_header_winldap_h="no"
299 ac_cv_header_winber_h="no"
302 CURL_CHECK_WIN32_LARGEFILE
304 dnl ************************************************************
305 dnl switch off particular protocols
307 AC_MSG_CHECKING([whether to support http])
309 AC_HELP_STRING([--enable-http],[Enable HTTP support])
310 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
311 [ case "$enableval" in
314 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
315 AC_MSG_WARN([disable HTTP disables FTP over proxy])
316 AC_SUBST(CURL_DISABLE_HTTP, [1])
318 *) AC_MSG_RESULT(yes)
323 AC_MSG_CHECKING([whether to support ftp])
325 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
326 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
327 [ case "$enableval" in
330 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
331 AC_SUBST(CURL_DISABLE_FTP, [1])
333 *) AC_MSG_RESULT(yes)
338 AC_MSG_CHECKING([whether to support file])
340 AC_HELP_STRING([--enable-file],[Enable FILE support])
341 AC_HELP_STRING([--disable-file],[Disable FILE support]),
342 [ case "$enableval" in
345 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
346 AC_SUBST(CURL_DISABLE_FILE, [1])
348 *) AC_MSG_RESULT(yes)
353 AC_MSG_CHECKING([whether to support ldap])
355 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
356 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
357 [ case "$enableval" in
360 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
361 AC_SUBST(CURL_DISABLE_LDAP, [1])
366 # Force no ldap. config/build process is broken for cygwin
367 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
368 AC_SUBST(CURL_DISABLE_LDAP, [1])
378 # Force no ldap. config/build process is broken for cygwin
379 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
380 AC_SUBST(CURL_DISABLE_LDAP, [1])
387 AC_MSG_CHECKING([whether to support ldaps])
389 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
390 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
391 [ case "$enableval" in
394 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
395 AC_SUBST(CURL_DISABLE_LDAPS, [1])
397 *) if test x$CURL_DISABLE_LDAP = x1 ; then
398 AC_MSG_RESULT(LDAP support needs to be enabled in order to enable LDAPS support!)
399 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
400 AC_SUBST(CURL_DISABLE_LDAPS, [1])
403 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
404 curl_ldaps_msg="enabled"
409 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
410 AC_SUBST(CURL_DISABLE_LDAPS, [1])
413 AC_MSG_CHECKING([whether to support proxies])
415 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
416 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
417 [ case "$enableval" in
420 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
421 AC_SUBST(CURL_DISABLE_PROXY, [1])
423 *) AC_MSG_RESULT(yes)
429 AC_MSG_CHECKING([whether to support dict])
431 AC_HELP_STRING([--enable-dict],[Enable DICT support])
432 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
433 [ case "$enableval" in
436 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
437 AC_SUBST(CURL_DISABLE_DICT, [1])
439 *) AC_MSG_RESULT(yes)
444 AC_MSG_CHECKING([whether to support telnet])
445 AC_ARG_ENABLE(telnet,
446 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
447 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
448 [ case "$enableval" in
451 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
452 AC_SUBST(CURL_DISABLE_TELNET, [1])
454 *) AC_MSG_RESULT(yes)
459 AC_MSG_CHECKING([whether to support tftp])
461 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
462 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
463 [ case "$enableval" in
466 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
467 AC_SUBST(CURL_DISABLE_TFTP, [1])
469 *) AC_MSG_RESULT(yes)
475 dnl **********************************************************************
476 dnl Check for built-in manual
477 dnl **********************************************************************
479 AC_MSG_CHECKING([whether to provide built-in manual])
480 AC_ARG_ENABLE(manual,
481 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
482 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
483 [ case "$enableval" in
487 *) AC_MSG_RESULT(yes)
494 dnl The actual use of the USE_MANUAL variable is done much later in this
495 dnl script to allow other actions to disable it as well.
497 dnl **********************************************************************
498 dnl Checks for libraries.
499 dnl **********************************************************************
503 dnl gethostbyname without lib or in the nsl lib?
504 AC_CHECK_FUNC(gethostbyname,
505 [HAVE_GETHOSTBYNAME="1"
507 [ AC_CHECK_LIB(nsl, gethostbyname,
508 [HAVE_GETHOSTBYNAME="1"
513 if test "$HAVE_GETHOSTBYNAME" != "1"
515 dnl gethostbyname in the socket lib?
516 AC_CHECK_LIB(socket, gethostbyname,
517 [HAVE_GETHOSTBYNAME="1"
518 LIBS="$LIBS -lsocket"
522 dnl At least one system has been identified to require BOTH nsl and socket
523 dnl libs at the same time to link properly.
524 if test "$HAVE_GETHOSTBYNAME" != "1"
526 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
527 my_ac_save_LIBS=$LIBS
528 LIBS="-lnsl -lsocket $LIBS"
536 HAVE_GETHOSTBYNAME="1"
539 LIBS=$my_ac_save_LIBS
543 if test "$HAVE_GETHOSTBYNAME" != "1"
545 dnl This is for winsock systems
546 if test "$ac_cv_header_windows_h" = "yes"; then
547 if test "$ac_cv_header_winsock_h" = "yes"; then
550 winsock_LIB="-lwinsock"
553 winsock_LIB="-lwsock32"
557 if test "$ac_cv_header_winsock2_h" = "yes"; then
558 winsock_LIB="-lws2_32"
560 if test ! -z "$winsock_LIB"; then
561 my_ac_save_LIBS=$LIBS
562 LIBS="$winsock_LIB $LIBS"
563 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
566 #ifdef HAVE_WINDOWS_H
567 #ifndef WIN32_LEAN_AND_MEAN
568 #define WIN32_LEAN_AND_MEAN
571 #ifdef HAVE_WINSOCK2_H
572 #include <winsock2.h>
574 #ifdef HAVE_WINSOCK_H
580 gethostbyname("www.dummysite.com");
584 HAVE_GETHOSTBYNAME="1"
588 LIBS=$my_ac_save_LIBS
594 if test "$HAVE_GETHOSTBYNAME" != "1"
596 dnl This is for Minix 3.1
597 AC_MSG_CHECKING([for gethostbyname for Minix 3])
600 /* Older Minix versions may need <net/gen/netdb.h> here instead */
603 gethostbyname("www.dummysite.com");
607 HAVE_GETHOSTBYNAME="1"
613 if test "$HAVE_GETHOSTBYNAME" != "1"
615 dnl This is for eCos with a stubbed DNS implementation
616 AC_MSG_CHECKING([for gethostbyname for eCos])
622 gethostbyname("www.dummysite.com");
626 HAVE_GETHOSTBYNAME="1"
632 if test "$HAVE_GETHOSTBYNAME" != "1"
634 dnl gethostbyname in the network lib - for Haiku OS
635 AC_CHECK_LIB(network, gethostbyname,
636 [HAVE_GETHOSTBYNAME="1"
637 LIBS="$LIBS -lnetwork"
641 if test "$HAVE_GETHOSTBYNAME" != "1"
643 dnl gethostbyname in the net lib - for BeOS
644 AC_CHECK_LIB(net, gethostbyname,
645 [HAVE_GETHOSTBYNAME="1"
651 if test "$HAVE_GETHOSTBYNAME" != "1"; then
652 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
656 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
658 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
659 AC_CHECK_LIB(resolve, strcasecmp,
660 [LIBS="-lresolve $LIBS"],
664 ac_cv_func_strcasecmp="no"
667 AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
669 dnl **********************************************************************
670 dnl In case that function clock_gettime with monotonic timer is available,
671 dnl check for additional required libraries.
672 dnl **********************************************************************
673 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
675 dnl **********************************************************************
676 dnl The preceding library checks are all potentially useful for test
677 dnl servers (for providing networking support). Save the list of required
678 dnl libraries at this point for use while linking those test servers.
679 dnl **********************************************************************
680 TEST_SERVER_LIBS=$LIBS
682 dnl **********************************************************************
683 AC_MSG_CHECKING([whether to use libgcc])
684 AC_ARG_ENABLE(libgcc,
685 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
686 [ case "$enableval" in
688 ALL_LIBS="$ALL_LIBS -lgcc"
697 dnl **********************************************************************
699 dnl **********************************************************************
702 AC_ARG_WITH(ldap-lib,
703 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
704 [LDAPLIBNAME="$withval"])
707 AC_ARG_WITH(lber-lib,
708 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
709 [LBERLIBNAME="$withval"])
711 if test x$CURL_DISABLE_LDAP != x1 ; then
713 CURL_CHECK_HEADER_LBER
714 CURL_CHECK_HEADER_LDAP
715 CURL_CHECK_HEADER_LDAPSSL
716 CURL_CHECK_HEADER_LDAP_SSL
718 if test -z "$LDAPLIBNAME" ; then
720 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
721 dnl Windows uses a single and unique OpenLDAP DLL name
722 LDAPLIBNAME="wldap32"
728 if test "$LDAPLIBNAME" ; then
729 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
730 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
731 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
732 AC_SUBST(CURL_DISABLE_LDAP, [1])])
733 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
734 AC_SUBST(CURL_DISABLE_LDAPS, [1])
736 dnl Try to find the right ldap libraries for this system
738 case X-"$curl_cv_ldap_LIBS" in
740 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
741 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
742 AC_SUBST(CURL_DISABLE_LDAP, [1])
743 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
744 AC_SUBST(CURL_DISABLE_LDAPS, [1])
750 if test x$CURL_DISABLE_LDAP != x1 ; then
752 if test "$LBERLIBNAME" ; then
753 dnl If name is "no" then don't define this library at all
754 dnl (it's only needed if libldap.so's dependencies are broken).
755 if test "$LBERLIBNAME" != "no" ; then
756 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
757 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
758 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
759 AC_SUBST(CURL_DISABLE_LDAP, [1])])
760 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
761 AC_SUBST(CURL_DISABLE_LDAPS, [1])
766 if test x$CURL_DISABLE_LDAP != x1 ; then
767 AC_CHECK_FUNCS([ldap_url_parse])
769 if test "$LDAPLIBNAME" = "wldap32"; then
770 curl_ldap_msg="enabled (winldap)"
771 AC_DEFINE(CURL_LDAP_WIN, 1, [Use W$ LDAP implementation])
773 *-*-cygwin* | *-*-pw32*)
774 AC_DEFINE(CURL_LDAP_HYBRID, 1, [W$ LDAP with non-W$ compiler])
778 curl_ldap_msg="enabled (OpenLDAP)"
782 dnl **********************************************************************
784 dnl **********************************************************************
786 AC_MSG_CHECKING([whether to enable ipv6])
788 AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
789 AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
790 [ case "$enableval" in
795 *) AC_MSG_RESULT(yes)
800 AC_TRY_RUN([ /* is AF_INET6 available? */
801 #include <sys/types.h>
802 #include <sys/socket.h>
805 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
819 if test "$ipv6" = "yes"; then
820 curl_ipv6_msg="enabled"
823 # Check if struct sockaddr_in6 have sin6_scope_id member
824 if test "$ipv6" = yes; then
825 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
827 #include <sys/types.h>
828 #include <netinet/in.h>] ,
829 struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
830 if test "$have_sin6_scope_id" = yes; then
832 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
838 dnl **********************************************************************
839 dnl Check if the operating system allows programs to write to their own argv[]
840 dnl **********************************************************************
842 AC_MSG_CHECKING([if argv can be written to])
843 AC_CACHE_VAL(curl_cv_writable_argv, [
845 int main(int argc, char ** argv) {
847 return (argv[0][0] == ' ')?0:1;
850 curl_cv_writable_argv=yes,
851 curl_cv_writable_argv=no,
852 curl_cv_writable_argv=cross)
854 case $curl_cv_writable_argv in
856 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
864 AC_MSG_WARN([the previous check could not be made default was used])
868 dnl **********************************************************************
869 dnl Check for the presence of Kerberos4 libraries and headers
870 dnl **********************************************************************
872 AC_ARG_WITH(krb4-includes,
873 AC_HELP_STRING([--with-krb4-includes=DIR],
874 [Specify location of kerberos4 headers]),[
875 CPPFLAGS="$CPPFLAGS -I$withval"
880 AC_ARG_WITH(krb4-libs,
881 AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
882 LDFLAGS="$LDFLAGS -L$withval"
890 AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
892 if test X"$OPT_KRB4" != Xno; then
894 if test X"$OPT_KRB4" != Xyes; then
895 LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
896 KRB4LIB="$OPT_KRB4/lib$libsuff"
897 CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
898 KRB4INC="$OPT_KRB4/include"
903 AC_MSG_CHECKING([if Kerberos4 support is requested])
905 if test "$want_krb4" = yes
907 if test "$ipv6" = "yes"; then
908 echo krb4 is not compatible with IPv6
913 dnl Check for & handle argument to --with-krb4
915 AC_MSG_CHECKING(where to look for Kerberos4)
916 if test X"$OPT_KRB4" = Xyes
918 AC_MSG_RESULT([defaults])
920 AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
923 dnl Check for DES library
924 AC_CHECK_LIB(des, des_pcbc_encrypt,
926 AC_CHECK_HEADERS(des.h)
929 AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
931 dnl Check for the Kerberos4 library
932 AC_CHECK_LIB(krb, krb_net_read,
934 dnl Check for header files
935 AC_CHECK_HEADERS(krb.h)
937 dnl we found the required libraries, add to LIBS
938 LIBS="-lkrb -lcom_err -ldes $LIBS"
940 dnl Check for function krb_get_our_ip_for_realm
941 dnl this is needed for NAT networks
942 AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
945 AC_DEFINE(HAVE_KRB4, 1,
946 [if you have the Kerberos4 libraries (including -ldes)])
948 dnl substitute it too!
950 AC_SUBST(KRB4_ENABLED)
952 curl_krb4_msg="enabled"
954 dnl the krb4 stuff needs a strlcpy()
955 AC_CHECK_FUNCS(strlcpy)
963 dnl **********************************************************************
964 dnl Check for FBopenssl(SPNEGO) libraries
965 dnl **********************************************************************
968 AC_HELP_STRING([--with-spnego=DIR],
969 [Specify location of SPNEGO library fbopenssl]), [
970 SPNEGO_ROOT="$withval"
971 if test x"$SPNEGO_ROOT" != xno; then
976 AC_MSG_CHECKING([if SPNEGO support is requested])
977 if test x"$want_spnego" = xyes; then
979 if test X"$SPNEGO_ROOT" = Xyes; then
980 AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
983 if test -z "$SPNEGO_LIB_DIR"; then
984 LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
986 LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
990 AC_DEFINE(HAVE_SPNEGO, 1,
991 [Define this if you have the SPNEGO library fbopenssl])
992 curl_spnego_msg="enabled"
998 dnl **********************************************************************
999 dnl Check for GSS-API libraries
1000 dnl **********************************************************************
1002 dnl check for gss stuff in the /usr as default
1005 AC_ARG_WITH(gssapi-includes,
1006 AC_HELP_STRING([--with-gssapi-includes=DIR],
1007 [Specify location of GSSAPI header]),
1008 [ GSSAPI_INCS="-I$withval"
1012 AC_ARG_WITH(gssapi-libs,
1013 AC_HELP_STRING([--with-gssapi-libs=DIR],
1014 [Specify location of GSSAPI libs]),
1015 [ GSSAPI_LIB_DIR="-L$withval"
1020 AC_HELP_STRING([--with-gssapi=DIR],
1021 [Where to look for GSSAPI]), [
1022 GSSAPI_ROOT="$withval"
1023 if test x"$GSSAPI_ROOT" != xno; then
1025 if test x"$GSSAPI_ROOT" = xyes; then
1026 dnl if yes, then use default root
1032 save_CPPFLAGS="$CPPFLAGS"
1033 AC_MSG_CHECKING([if GSSAPI support is requested])
1034 if test x"$want_gss" = xyes; then
1037 if test -z "$GSSAPI_INCS"; then
1038 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1039 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
1040 GSSAPI_LIBS=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1041 elif test "$GSSAPI_ROOT" != "yes"; then
1042 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1043 GSSAPI_LIBS="-lgssapi"
1047 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1048 LIBS="$LIBS $GSSAPI_LIBS"
1050 AC_CHECK_HEADER(gss.h,
1052 dnl found in the given dirs
1053 AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
1057 dnl not found, check Heimdal or MIT
1059 [gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1062 if test "x$not_mit" = "x1"; then
1063 dnl MIT not found, check for Heimdal
1064 AC_CHECK_HEADER(gssapi.h,
1067 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
1070 dnl no header found, disabling GSS
1072 AC_MSG_WARN(disabling GSSAPI since no header files was found)
1077 AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
1078 dnl check if we have a really old MIT kerberos (<= 1.2)
1079 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1082 #include <gssapi/gssapi.h>
1083 #include <gssapi/gssapi_generic.h>
1084 #include <gssapi/gssapi_krb5.h>
1089 GSS_C_NT_HOSTBASED_SERVICE,
1093 AC_MSG_RESULT([yes])
1096 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1097 [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1105 if test x"$want_gss" = xyes; then
1106 AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
1108 curl_gss_msg="enabled (MIT/Heimdal)"
1110 if test -n "$gnu_gss"; then
1111 curl_gss_msg="enabled (GNU GSS)"
1112 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1114 elif test -z "$GSSAPI_LIB_DIR"; then
1115 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1116 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1118 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1119 LIBS="$LIBS $gss_libs"
1120 elif test "$GSSAPI_ROOT" != "yes"; then
1121 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1122 LIBS="$LIBS -lgssapi"
1124 LIBS="$LIBS -lgssapi"
1127 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1128 LIBS="$LIBS -lgssapi"
1131 CPPFLAGS="$save_CPPFLAGS"
1134 dnl **********************************************************************
1135 dnl Check for the presence of SSL libraries and headers
1136 dnl **********************************************************************
1138 dnl Default to compiler & linker defaults for SSL files & libraries.
1140 dnl Default to no CA bundle
1143 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])
1144 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1147 if test X"$OPT_SSL" != Xno; then
1148 dnl backup the pre-ssl variables
1149 CLEANLDFLAGS="$LDFLAGS"
1150 CLEANCPPFLAGS="$CPPFLAGS"
1155 dnl --with-ssl (without path) used
1156 if test x$cross_compiling != xyes; then
1157 dnl only do pkg-config magic when not cross-compiling
1160 PREFIX_OPENSSL=/usr/local/ssl
1161 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1164 dnl no --with-ssl option given, just check default places
1165 if test x$cross_compiling != xyes; then
1166 dnl only do pkg-config magic when not cross-compiling
1172 dnl check the given --with-ssl spot
1174 PREFIX_OPENSSL=$OPT_SSL
1175 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1176 if test "$PREFIX_OPENSSL" != "/usr" ; then
1177 LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
1178 CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include"
1180 CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1184 if test "$PKGTEST" = "yes"; then
1186 CURL_CHECK_PKGCONFIG(openssl)
1188 if test "$PKGCONFIG" != "no" ; then
1189 SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
1190 SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
1191 SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1193 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1195 dnl use the values pkg-config reported
1196 LIBS="$LIBS $SSL_LIBS"
1197 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1198 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1202 dnl This is for Msys/Mingw
1204 *-*-msys* | *-*-mingw*)
1205 AC_MSG_CHECKING([for gdi32])
1206 my_ac_save_LIBS=$LIBS
1207 LIBS="-lgdi32 $LIBS"
1208 AC_TRY_LINK([#include <windef.h>
1209 #include <wingdi.h>],
1212 AC_MSG_RESULT([yes])],
1213 [ dnl failed, restore LIBS
1214 LIBS=$my_ac_save_LIBS
1220 AC_CHECK_LIB(crypto, CRYPTO_lock,[
1222 LIBS="-lcrypto $LIBS"
1224 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1225 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1226 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
1228 LIBS="-lcrypto $LIBS"], [
1229 LDFLAGS="$CLEANLDFLAGS"
1230 CPPFLAGS="$CLEANCPPFLAGS"
1236 if test X"$HAVECRYPTO" = X"yes"; then
1237 dnl This is only reasonable to do if crypto actually is there: check for
1238 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1240 AC_CHECK_LIB(ssl, SSL_connect)
1242 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1243 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1244 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1246 LIBS="$LIBS -lRSAglue -lrsaref"
1247 AC_CHECK_LIB(ssl, SSL_connect)
1248 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1249 dnl still no SSL_connect
1258 dnl Have the libraries--check for SSLeay/OpenSSL headers
1259 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1260 openssl/pem.h openssl/ssl.h openssl/err.h,
1261 curl_ssl_msg="enabled (OpenSSL)"
1263 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1265 if test $ac_cv_header_openssl_x509_h = no; then
1266 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1267 dnl since 'err.h' might in fact find a krb4 header with the same
1269 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1271 if test $ac_cv_header_x509_h = yes &&
1272 test $ac_cv_header_crypto_h = yes &&
1273 test $ac_cv_header_ssl_h = yes; then
1275 curl_ssl_msg="enabled (OpenSSL)"
1281 if test X"$OPENSSL_ENABLED" = X"1"; then
1282 AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
1284 dnl is there a pkcs12.h header present?
1285 AC_CHECK_HEADERS(openssl/pkcs12.h)
1289 dnl USE_SSLEAY is the historical name for what configure calls
1290 dnl OPENSSL_ENABLED; the names should really be unified
1291 USE_SSLEAY="$OPENSSL_ENABLED"
1292 AC_SUBST(USE_SSLEAY)
1294 if test X"$OPT_SSL" != Xoff &&
1295 test "$OPENSSL_ENABLED" != "1"; then
1296 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1300 if test X"$OPENSSL_ENABLED" = X"1"; then
1301 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
1302 dnl stuff, it is kind of "separated" from the main SSL check
1303 AC_CHECK_FUNC(ENGINE_init,
1305 AC_CHECK_HEADERS(openssl/engine.h)
1306 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
1309 dnl these can only exist if openssl exists
1310 dnl yassl doesn't have SSL_get_shutdown
1312 AC_CHECK_FUNCS( RAND_status \
1315 CRYPTO_cleanup_all_ex_data \
1318 dnl Make an attempt to detect if this is actually yassl's headers and
1319 dnl OpenSSL emulation layer. We still leave everything else believing
1320 dnl and acting like OpenSSL.
1322 AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
1325 #include <openssl/ssl.h>
1327 #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
1328 int dummy = SSL_ERROR_NONE;
1330 Not the yaSSL OpenSSL compatibility header.
1334 AC_MSG_RESULT([yes])
1335 AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
1336 [Define to 1 if using yaSSL in OpenSSL compatibility mode.])
1337 curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
1343 if test "$OPENSSL_ENABLED" = "1"; then
1344 if test -n "$LIB_OPENSSL"; then
1345 dnl when the ssl shared libs were found in a path that the run-time
1346 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1347 dnl to prevent further configure tests to fail due to this
1349 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
1350 export LD_LIBRARY_PATH
1351 AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
1357 dnl **********************************************************************
1358 dnl Check for the presence of ZLIB libraries and headers
1359 dnl **********************************************************************
1361 dnl Check for & handle argument to --with-zlib.
1366 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1367 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
1368 [OPT_ZLIB="$withval"])
1370 if test "$OPT_ZLIB" = "no" ; then
1371 AC_MSG_WARN([zlib disabled])
1373 if test "$OPT_ZLIB" = "yes" ; then
1377 if test -z "$OPT_ZLIB" ; then
1378 dnl check for the lib first without setting any new path, since many
1379 dnl people have it in the default path
1381 AC_CHECK_LIB(z, inflateEnd,
1382 dnl libz found, set the variable
1384 dnl if no lib found, try /usr/local
1385 [OPT_ZLIB="/usr/local"])
1389 dnl Add a nonempty path to the compiler flags
1390 if test -n "$OPT_ZLIB"; then
1391 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1392 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1395 AC_CHECK_HEADER(zlib.h,
1397 dnl zlib.h was found
1399 dnl if the lib wasn't found already, try again with the new paths
1400 if test "$HAVE_LIBZ" != "1"; then
1401 AC_CHECK_LIB(z, gzread,
1403 dnl the lib was found!
1406 [ CPPFLAGS=$_cppflags
1411 dnl zlib.h was not found, restore the flags
1416 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1418 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1420 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1422 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1423 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1425 dnl both header and lib were found!
1427 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1428 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1430 CURL_LIBS="$CURL_LIBS -lz"
1433 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1435 AC_MSG_NOTICE([found both libz and libz.h header])
1436 curl_zlib_msg="enabled"
1440 dnl set variable for use in automakefile(s)
1441 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1443 dnl **********************************************************************
1444 dnl Check for the presence of LIBSSH2 libraries and headers
1445 dnl **********************************************************************
1447 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
1449 AC_ARG_WITH(libssh2,dnl
1450 AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation (default: /usr/local/lib); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1451 AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
1452 OPT_LIBSSH2=$withval)
1454 if test X"$OPT_LIBSSH2" != Xno; then
1455 dnl backup the pre-libssh2 variables
1456 CLEANLDFLAGS="$LDFLAGS"
1457 CLEANCPPFLAGS="$CPPFLAGS"
1460 case "$OPT_LIBSSH2" in
1462 dnl --with-libssh2 (without path) used
1463 PREFIX_LIBSSH2=/usr/local/lib
1464 LIB_LIBSSH2="$PREFIX_LIBSSH2$libsuff"
1467 dnl no --with-libssh2 option given, just check default places
1471 dnl use the given --with-libssh2 spot
1472 PREFIX_LIBSSH2=$OPT_LIBSSH2
1473 LIB_LIBSSH2="$PREFIX_LIBSSH2/lib$libsuff"
1474 LDFLAGS="$LDFLAGS -L$LIB_LIBSSH2"
1475 CPPFLAGS="$CPPFLAGS -I$PREFIX_LIBSSH2/include"
1479 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
1481 AC_CHECK_HEADERS(libssh2.h,
1482 curl_ssh_msg="enabled (libSSH2)"
1484 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
1485 AC_SUBST(USE_LIBSSH2, [1])
1488 if test X"$OPT_LIBSSH2" != Xoff &&
1489 test "$LIBSSH2_ENABLED" != "1"; then
1490 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
1493 if test "$LIBSSH2_ENABLED" = "1"; then
1494 if test -n "$LIB_LIBSSH2"; then
1495 dnl when the libssh2 shared libs were found in a path that the run-time
1496 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1497 dnl to prevent further configure tests to fail due to this
1499 dnl libssh2_version is a post 1.0 addition
1500 AC_CHECK_FUNCS( libssh2_version )
1502 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_LIBSSH2"
1503 export LD_LIBRARY_PATH
1504 AC_MSG_NOTICE([Added $LIB_LIBSSH2 to LD_LIBRARY_PATH])
1509 dnl **********************************************************************
1510 dnl Check for the random seed preferences
1511 dnl **********************************************************************
1513 if test X"$OPENSSL_ENABLED" = X"1"; then
1514 AC_ARG_WITH(egd-socket,
1515 AC_HELP_STRING([--with-egd-socket=FILE],
1516 [Entropy Gathering Daemon socket pathname]),
1517 [ EGD_SOCKET="$withval" ]
1519 if test -n "$EGD_SOCKET" ; then
1520 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1521 [your Entropy Gathering Daemon socket pathname] )
1524 dnl Check for user-specified random device
1526 AC_HELP_STRING([--with-random=FILE],
1527 [read randomness from FILE (default=/dev/urandom)]),
1528 [ RANDOM_FILE="$withval" ],
1530 dnl Check for random device
1531 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1534 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1535 AC_SUBST(RANDOM_FILE)
1536 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1537 [a suitable file to read random data from])
1541 dnl ----------------------------------------------------
1542 dnl check for GnuTLS
1543 dnl ----------------------------------------------------
1545 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1548 AC_ARG_WITH(gnutls,dnl
1549 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
1550 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1551 OPT_GNUTLS=$withval)
1553 if test "$OPENSSL_ENABLED" != "1"; then
1555 if test X"$OPT_GNUTLS" != Xno; then
1557 AC_MSG_NOTICE([OPT_GNUTLS is $OPT_GNUTLS])
1560 if test "x$OPT_GNUTLS" = "xyes"; then
1561 check=`libgnutls-config --version 2>/dev/null`
1562 if test -n "$check"; then
1563 addlib=`libgnutls-config --libs`
1564 addcflags=`libgnutls-config --cflags`
1565 version=`libgnutls-config --version`
1566 gtlslib=`libgnutls-config --prefix`/lib$libsuff
1569 addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
1570 addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
1571 version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
1572 gtlslib=$OPT_GNUTLS/lib$libsuff
1575 if test -z "$version"; then
1576 CURL_CHECK_PKGCONFIG(gnutls)
1578 if test "$PKGCONFIG" != "no" ; then
1579 addlib=`$PKGCONFIG --libs-only-l gnutls`
1580 addld=`$PKGCONFIG --libs-only-L gnutls`
1581 addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1582 version=`$PKGCONFIG --modversion gnutls`
1583 gtlslib=`echo $addld | $SED -e 's/-L//'`
1588 if test -z "$version"; then
1589 dnl lots of efforts, still no go
1593 if test -n "$addlib"; then
1596 CLEANCPPFLAGS="$CPPFLAGS"
1597 CLEADLDFLAGS="$LDFLAGS"
1599 LIBS="$LIBS $addlib"
1600 LDFLAGS="$LDFLAGS $addld"
1601 if test "$addcflags" != "-I/usr/include"; then
1602 CPPFLAGS="$CPPFLAGS $addcflags"
1605 AC_CHECK_LIB(gnutls, gnutls_check_version,
1607 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1608 AC_SUBST(USE_GNUTLS, [1])
1611 curl_ssl_msg="enabled (GnuTLS)"
1615 CPPFLAGS="$CLEANCPPFLAGS"
1618 if test "x$USE_GNUTLS" = "xyes"; then
1619 AC_MSG_NOTICE([detected GnuTLS version $version])
1621 if test -n "$gtlslib"; then
1622 dnl when shared libs were found in a path that the run-time
1623 dnl linker doesn't search through, we need to add it to
1624 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1627 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
1628 export LD_LIBRARY_PATH
1629 AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
1635 fi dnl GNUTLS not disabled
1639 dnl ----------------------------------------------------
1640 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
1641 dnl ----------------------------------------------------
1643 dnl Default to compiler & linker defaults for NSS files & libraries.
1647 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root (default: /usr/local/)])
1648 AC_HELP_STRING([--without-nss], [disable NSS detection]),
1651 if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
1653 if test X"$OPT_NSS" != Xno; then
1654 if test "x$OPT_NSS" = "xyes"; then
1656 CURL_CHECK_PKGCONFIG(nss)
1658 if test "$PKGCONFIG" != "no" ; then
1659 addlib=`$PKGCONFIG --libs nss`
1660 addcflags=`$PKGCONFIG --cflags nss`
1661 version=`$PKGCONFIG --modversion nss`
1662 nssprefix=`$PKGCONFIG --variable=prefix nss`
1665 # Without pkg-config, we'll kludge in some defaults
1666 addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
1667 addcflags="-I$OPT_NSS/include"
1669 gtlsprefix=$OPT_GNUTLS
1672 dnl Check for functionPK11_CreateGenericObject
1673 dnl this is needed for using the PEM PKCS#11 module
1674 AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
1676 AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject])
1677 AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1])
1679 if test -n "$addlib"; then
1682 CLEANCPPFLAGS="$CPPFLAGS"
1684 LIBS="$LIBS $addlib"
1685 if test "$addcflags" != "-I/usr/include"; then
1686 CPPFLAGS="$CPPFLAGS $addcflags"
1689 AC_CHECK_LIB(nss3, NSS_Initialize,
1691 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
1692 AC_SUBST(USE_NSS, [1])
1695 curl_ssl_msg="enabled (NSS)"
1699 CPPFLAGS="$CLEANCPPFLAGS"
1702 if test "x$USE_NSS" = "xyes"; then
1703 AC_MSG_NOTICE([detected NSS version $version])
1705 dnl when shared libs were found in a path that the run-time
1706 dnl linker doesn't search through, we need to add it to
1707 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1710 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
1711 export LD_LIBRARY_PATH
1712 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
1717 fi dnl NSS not disabled
1719 fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
1721 if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
1722 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
1723 AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
1725 # SSL is enabled, genericly
1726 AC_SUBST(SSL_ENABLED)
1730 dnl **********************************************************************
1731 dnl Check for the CA bundle
1732 dnl **********************************************************************
1734 CURL_CHECK_CA_BUNDLE
1736 dnl **********************************************************************
1737 dnl Check for the presence of IDN libraries and headers
1738 dnl **********************************************************************
1740 AC_MSG_CHECKING([whether to build with libidn])
1742 AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
1743 AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
1744 [LIBIDN="$withval"])
1750 *) AC_MSG_RESULT(yes)
1753 dnl if there is a given path, check that FIRST
1754 if test -n "$LIBIDN"; then
1755 if test "x$LIBIDN" != "xyes"; then
1757 oldCPPFLAGS=$CPPFLAGS
1758 LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
1759 CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
1761 AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
1764 CPPFLAGS=$oldCPPFLAGS)
1768 if test "x$idn" != "xyes"; then
1769 dnl check with default paths
1771 AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
1775 if test "x$idn" = "xyes"; then
1776 curl_idn_msg="enabled"
1777 AC_SUBST(IDN_ENABLED, [1])
1778 dnl different versions of libidn have different setups of these:
1779 AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
1780 AC_CHECK_HEADERS( idn-free.h tld.h )
1786 dnl Default is to try the thread-safe versions of a few functions
1789 dnl detect AIX 4.3 or later
1790 dnl see full docs on this reasoning in the lib/hostip.c source file
1791 AC_MSG_CHECKING([AIX 4.3 or later])
1793 #if defined(_AIX) && defined(_AIX43)
1794 printf("just fine");
1796 #error "this is not AIX 4.3 or later"
1799 [ AC_MSG_RESULT([yes])
1802 [ AC_MSG_RESULT([no]) ]
1805 AC_ARG_ENABLE(thread,dnl
1806 AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
1807 AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
1808 [ case "$enableval" in
1811 AC_MSG_WARN(libcurl will not get built using thread-safe functions)
1819 if test X"$OPT_THREAD" = Xoff
1821 AC_DEFINE(DISABLED_THREADSAFE, 1,
1822 [Set to explicitly specify we don't want to use thread-safe functions])
1824 dnl if test "$ipv6" != "yes"; then
1825 dnl dig around for gethostbyname_r()
1826 dnl the old gethostbyname_r check was done here
1828 dnl dig around for gethostbyaddr_r()
1829 dnl the old gethostbyaddr_r check was here BUT COMMENTED OUT
1832 dnl poke around for inet_ntoa_r()
1833 dnl the old inet_ntoa_r check was done here
1835 dnl is there a localtime_r()
1836 dnl the old localtime_r check was done here
1838 dnl is there a strerror_r()
1839 dnl the old strerror_r check was done here
1841 checkfor_gmtime_r="yes"
1844 dnl for recent AIX versions, we skip all the thread-safe checks above since
1845 dnl they claim a thread-safe libc using the standard API. But there are
1846 dnl some functions still not thread-safe. Check for these!
1848 dnl Let's hope this split URL remains working:
1849 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
1850 dnl genprogc/thread_quick_ref.htm
1852 if test "x$RECENTAIX" = "xyes"; then
1854 AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
1856 dnl is there a localtime_r()
1857 dnl the old localtime_r check was done here
1859 dnl is there a strerror_r()
1860 dnl the old strerror_r check was done here
1862 checkfor_gmtime_r="yes"
1866 dnl **********************************************************************
1867 dnl Back to "normal" configuring
1868 dnl **********************************************************************
1870 dnl Checks for header files.
1873 CURL_CHECK_HEADER_MALLOC
1874 CURL_CHECK_HEADER_MEMORY
1876 dnl Now check for the very most basic headers. Then we can use these
1877 dnl ones as default-headers when checking for the rest!
1918 dnl to do if not found
1922 dnl default includes
1924 #ifdef HAVE_SYS_TYPES_H
1925 #include <sys/types.h>
1927 #ifdef HAVE_SYS_TIME_H
1928 #include <sys/time.h>
1930 #ifdef HAVE_SYS_SELECT_H
1931 #include <sys/select.h>
1933 #ifdef HAVE_SYS_SOCKET_H
1934 #include <sys/socket.h>
1936 #ifdef HAVE_NETINET_IN_H
1937 #include <netinet/in.h>
1939 #ifdef HAVE_SYS_UN_H
1945 dnl Checks for typedefs, structures, and compiler characteristics.
1947 CURL_CHECK_VARIADIC_MACROS
1950 CURL_CHECK_STRUCT_TIMEVAL
1951 CURL_VERIFY_RUNTIMELIBS
1953 AC_CHECK_SIZEOF(size_t)
1954 AC_CHECK_SIZEOF(int)
1955 AC_CHECK_SIZEOF(long)
1957 AC_CHECK_SIZEOF(time_t)
1958 AC_CHECK_SIZEOF(off_t)
1961 if test x"$ac_cv_native_windows" != "xyes" &&
1962 test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
1963 AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
1964 AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
1969 AC_CHECK_TYPE(long long,
1970 [AC_DEFINE(HAVE_LONGLONG, 1,
1971 [Define to 1 if the compiler supports the 'long long' data type.])]
1975 if test "xyes" = "x$longlong"; then
1976 AC_MSG_CHECKING([if numberLL works])
1977 AC_COMPILE_IFELSE([long long val = 1000LL;],
1978 [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
1986 AC_CHECK_TYPE(ssize_t, ,
1987 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
1989 # check for bool type
1990 AC_CHECK_TYPE([bool],[
1991 AC_DEFINE(HAVE_BOOL_T, 1,
1992 [Define to 1 if bool is an available type.])
1994 #ifdef HAVE_SYS_TYPES_H
1995 #include <sys/types.h>
1997 #ifdef HAVE_STDBOOL_H
1998 #include <stdbool.h>
2002 CURL_A_COUPLE_OF_EXPERIMENTAL_COMPILER_TESTS
2004 CURL_CONFIGURE_CURL_SOCKLEN_T
2008 TYPE_SOCKADDR_STORAGE
2014 CURL_CHECK_FUNC_SELECT
2016 CURL_CHECK_FUNC_RECV
2017 CURL_CHECK_FUNC_RECVFROM
2018 CURL_CHECK_FUNC_SEND
2019 CURL_CHECK_MSG_NOSIGNAL
2021 CURL_CHECK_FUNC_ALARM
2022 CURL_CHECK_FUNC_FCNTL
2023 CURL_CHECK_FUNC_FDOPEN
2024 CURL_CHECK_FUNC_FREEADDRINFO
2025 CURL_CHECK_FUNC_FREEIFADDRS
2026 CURL_CHECK_FUNC_FTRUNCATE
2027 CURL_CHECK_FUNC_GETADDRINFO
2028 CURL_CHECK_FUNC_GETHOSTBYADDR
2029 CURL_CHECK_FUNC_GETHOSTBYADDR_R
2030 CURL_CHECK_FUNC_GETHOSTBYNAME
2031 CURL_CHECK_FUNC_GETHOSTBYNAME_R
2032 CURL_CHECK_FUNC_GETHOSTNAME
2033 CURL_CHECK_FUNC_GETIFADDRS
2034 CURL_CHECK_FUNC_GETSERVBYPORT_R
2035 CURL_CHECK_FUNC_GMTIME_R
2036 CURL_CHECK_FUNC_INET_NTOA_R
2037 CURL_CHECK_FUNC_INET_NTOP
2038 CURL_CHECK_FUNC_INET_PTON
2039 CURL_CHECK_FUNC_IOCTL
2040 CURL_CHECK_FUNC_IOCTLSOCKET
2041 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
2042 CURL_CHECK_FUNC_LOCALTIME_R
2043 CURL_CHECK_FUNC_POLL
2044 CURL_CHECK_FUNC_SETSOCKOPT
2045 CURL_CHECK_FUNC_SIGACTION
2046 CURL_CHECK_FUNC_SIGINTERRUPT
2047 CURL_CHECK_FUNC_SIGNAL
2048 CURL_CHECK_FUNC_SIGSETJMP
2049 CURL_CHECK_FUNC_STRCASECMP
2050 CURL_CHECK_FUNC_STRCASESTR
2051 CURL_CHECK_FUNC_STRCMPI
2052 CURL_CHECK_FUNC_STRDUP
2053 CURL_CHECK_FUNC_STRERROR_R
2054 CURL_CHECK_FUNC_STRICMP
2055 CURL_CHECK_FUNC_STRLCAT
2056 CURL_CHECK_FUNC_STRNCASECMP
2057 CURL_CHECK_FUNC_STRNCMPI
2058 CURL_CHECK_FUNC_STRNICMP
2059 CURL_CHECK_FUNC_STRSTR
2060 CURL_CHECK_FUNC_STRTOK_R
2061 CURL_CHECK_FUNC_STRTOLL
2062 CURL_CHECK_FUNC_WRITEV
2064 dnl Checks for library functions.
2065 dnl AC_PROG_GCC_TRADITIONAL
2072 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
2076 AC_CHECK_FUNCS([basename \
2098 eval skipcheck=\$skipcheck_$func
2099 if test "x$skipcheck" != "xyes"; then
2100 AC_MSG_CHECKING([deeper for $func])
2107 AC_MSG_RESULT([yes])
2108 eval "ac_cv_func_$func=yes"
2109 AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$func])], [1],
2110 [Define to 1 if you have the $func function.])
2112 AC_MSG_RESULT([but still no])
2118 AC_CHECK_DECL(basename, ,
2119 AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
2120 #ifdef HAVE_STRING_H
2123 #ifdef HAVE_LIBGEN_H
2126 #ifdef HAVE_UNISTD_H
2132 dnl Check if the getnameinfo function is available
2133 dnl and get the types of five of its arguments.
2134 CURL_CHECK_FUNC_GETNAMEINFO
2136 if test "$ipv6" = "yes"; then
2137 if test "$ac_cv_func_getaddrinfo" = "yes"; then
2138 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
2140 AC_SUBST(IPV6_ENABLED)
2142 CURL_CHECK_NI_WITHSCOPEID
2145 dnl ************************************************************
2146 dnl enable non-blocking communications
2148 CURL_CHECK_OPTION_NONBLOCKING
2149 CURL_CHECK_NONBLOCKING_SOCKET
2151 dnl ************************************************************
2152 dnl nroff tool stuff
2155 AC_PATH_PROG( PERL, perl, ,
2156 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
2159 AC_PATH_PROGS( NROFF, gnroff nroff, ,
2160 $PATH:/usr/bin/:/usr/local/bin )
2163 if test -n "$NROFF"; then
2164 dnl only check for nroff options if an nroff command was found
2166 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
2168 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2169 if test -z "$mancheck"; then
2171 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2172 if test -z "$mancheck"; then
2174 AC_MSG_RESULT([failed])
2175 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
2177 AC_MSG_RESULT([$MANOPT])
2180 AC_MSG_RESULT([$MANOPT])
2185 if test -z "$MANOPT"
2187 dnl if no nroff tool was found, or no option that could convert man pages
2188 dnl was found, then disable the built-in manual stuff
2189 AC_MSG_WARN([disabling built-in manual])
2193 dnl *************************************************************************
2194 dnl If the manual variable still is set, then we go with providing a built-in
2197 if test "$USE_MANUAL" = "1"; then
2198 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
2199 curl_manual_msg="enabled"
2202 dnl set variable for use in automakefile(s)
2203 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
2205 AC_MSG_CHECKING([whether to enable c-ares])
2207 AC_HELP_STRING([--enable-ares=PATH],[Enable c-ares for name lookups])
2208 AC_HELP_STRING([--disable-ares],[Disable c-ares for name lookups]),
2209 [ case "$enableval" in
2213 *) AC_MSG_RESULT(yes)
2215 if test "x$IPV6_ENABLED" = "x1"; then
2216 AC_MSG_NOTICE([c-ares may not work properly with ipv6])
2219 AC_DEFINE(USE_ARES, 1, [Define if you want to enable c-ares support])
2220 dnl substitute HAVE_ARES for curl-config and similar
2223 curl_ares_msg="enabled"
2225 LIBS="-lcares $LIBS"
2227 dnl For backwards compatibility default to includes/lib in srcdir/ares
2228 dnl If a value is specified it is assumed that the libs are in $val/lib
2229 dnl and the includes are in $val/include. This is the default setup for
2230 dnl ares so it should not be a problem.
2231 if test "x$enableval" = "xyes" ; then
2232 if test -d "$srcdir/ares"; then
2234 AC_CONFIG_SUBDIRS(ares)
2235 aresinc=`cd $srcdir/ares && pwd`
2236 CPPFLAGS="$CPPFLAGS -I$aresinc"
2238 dnl the pwd= below cannot 'cd' into the ares dir to get the full
2239 dnl path to it, since it may not exist yet if we build outside of
2242 LDFLAGS="$LDFLAGS -L$pwd/ares"
2245 CPPFLAGS="$CPPFLAGS -I$enableval/include"
2246 LDFLAGS="$LDFLAGS -L$enableval/lib"
2249 if test -z "$aresembedded"; then
2250 dnl verify that a sufficient c-ares is here if we have pointed one
2251 dnl out and don't use the "embedded" ares dir (in which case we don't
2252 dnl check it because it might not have been built yet)
2253 AC_MSG_CHECKING([that c-ares is good and recent enough])
2257 /* set of dummy functions in case c-ares was built with debug */
2258 void curl_dofree() { }
2259 void curl_sclose() { }
2260 void curl_domalloc() { }
2261 void curl_docalloc() { }
2262 void curl_socket() { }
2264 ares_channel channel;
2265 ares_cancel(channel); /* added in 1.2.0 */
2266 ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
2269 AC_MSG_RESULT([yes])
2272 AC_MSG_ERROR([c-ares library defective or too old])
2280 dnl ************************************************************
2281 dnl disable verbose text strings
2283 AC_MSG_CHECKING([whether to enable verbose strings])
2284 AC_ARG_ENABLE(verbose,
2285 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
2286 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
2287 [ case "$enableval" in
2290 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
2291 curl_verbose_msg="no"
2293 *) AC_MSG_RESULT(yes)
2299 dnl ************************************************************
2300 dnl enable SSPI support
2302 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
2304 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
2305 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
2306 [ case "$enableval" in
2308 if test "$ac_cv_native_windows" = "yes"; then
2310 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
2311 AC_SUBST(USE_WINDOWS_SSPI, [1])
2315 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
2325 dnl ************************************************************
2326 dnl disable cryptographic authentication
2328 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
2329 AC_ARG_ENABLE(crypto-auth,
2330 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
2331 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
2332 [ case "$enableval" in
2335 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
2337 *) AC_MSG_RESULT(yes)
2343 dnl ************************************************************
2344 dnl disable cookies support
2346 AC_MSG_CHECKING([whether to enable support for cookies])
2347 AC_ARG_ENABLE(cookies,
2348 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
2349 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
2350 [ case "$enableval" in
2353 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
2355 *) AC_MSG_RESULT(yes)
2361 dnl ************************************************************
2362 dnl Enable hiding of internal symbols in library to reduce its size and
2363 dnl speed dynamic linking of applications. This currently is only supported
2364 dnl on gcc >= 4.0 and SunPro C.
2366 AC_MSG_CHECKING([whether to enable hidden symbols in the library])
2367 AC_ARG_ENABLE(hidden-symbols,
2368 AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
2369 AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
2370 [ case "$enableval" in
2375 AC_MSG_CHECKING([whether $CC supports it])
2376 if test "$GCC" = yes ; then
2377 if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
2379 AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2380 AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
2381 CFLAGS="$CFLAGS -fvisibility=hidden"
2387 dnl Test for SunPro cc
2388 if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
2390 AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2391 AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
2392 CFLAGS="$CFLAGS -xldscope=hidden"
2402 dnl ************************************************************
2403 dnl enforce SONAME bump
2406 AC_MSG_CHECKING([whether to enforce SONAME bump])
2407 AC_ARG_ENABLE(soname-bump,
2408 AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
2409 AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
2410 [ case "$enableval" in
2411 yes) AC_MSG_RESULT(yes)
2418 AC_MSG_RESULT($soname_bump)
2420 AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
2423 dnl ************************************************************
2424 if test ! -z "$winsock_LIB"; then
2426 dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
2427 dnl things work when built with c-ares). But we can't just move it last
2428 dnl since then other stuff (SSL) won't build. So we simply append it to the
2431 LIBS="$LIBS $winsock_LIB"
2432 TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
2437 dnl All the library dependencies put into $LIB apply to libcurl only.
2438 dnl Those in $CURL_LIBS apply to the curl command-line client only.
2439 dnl Those in $TEST_SERVER_LIBS apply to test servers only.
2440 dnl Those in $ALL_LIBS apply to all targets, including test targets.
2444 AC_SUBST(LIBCURL_LIBS)
2446 AC_SUBST(TEST_SERVER_LIBS)
2447 LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
2449 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
2452 dnl For keeping supported features and protocols also in pkg-config file
2453 dnl since it is more cross-compile frient than curl-config
2456 if test "x$USE_SSLEAY" = "x1"; then
2457 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2458 elif test -n "$SSL_ENABLED"; then
2459 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2461 if test "@KRB4_ENABLED@" = "x1"; then
2462 SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
2464 if test "x$IPV6_ENABLED" = "x1"; then
2465 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
2467 if test "x$HAVE_LIBZ" = "x1"; then
2468 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
2470 if test "x$HAVE_ARES" = "x1"; then
2471 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
2473 if test "x$IDN_ENABLED" = "x1"; then
2474 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
2476 if test "x$USE_WINDOWS_SSPI" = "x1"; then
2477 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
2479 if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then
2480 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
2483 AC_SUBST(SUPPORT_FEATURES)
2485 dnl For supported protocols in pkg-config file
2486 if test "x$CURL_DISABLE_HTTP" != "x1"; then
2487 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
2488 if test "x$SSL_ENABLED" = "x1"; then
2489 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
2492 if test "x$CURL_DISABLE_FTP" != "x1"; then
2493 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
2494 if test "x$SSL_ENABLED" = "x1"; then
2495 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
2498 if test "x$CURL_DISABLE_FILE" != "x1"; then
2499 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
2501 if test "x$CURL_DISABLE_TELNET" != "x1"; then
2502 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
2504 if test "x$CURL_DISABLE_LDAP" != "x1"; then
2505 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
2507 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
2508 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
2510 if test "x$CURL_DISABLE_DICT" != "x1"; then
2511 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
2513 if test "x$CURL_DISABLE_TFTP" != "x1"; then
2514 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
2516 if test "x$USE_LIBSSH2" = "x1"; then
2517 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
2518 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
2521 AC_SUBST(SUPPORT_PROTOCOLS)
2523 dnl squeeze whitespace out of some variables
2532 squeeze LIBCURL_LIBS
2533 squeeze TEST_SERVER_LIBS
2535 AC_CONFIG_FILES([Makefile \
2537 docs/examples/Makefile \
2538 docs/libcurl/Makefile \
2540 include/curl/Makefile \
2544 tests/data/Makefile \
2545 tests/server/Makefile \
2546 tests/libtest/Makefile \
2548 packages/Win32/Makefile \
2549 packages/Win32/cygwin/Makefile \
2550 packages/Linux/Makefile \
2551 packages/Linux/RPM/Makefile \
2552 packages/Linux/RPM/curl.spec \
2553 packages/Linux/RPM/curl-ssl.spec \
2554 packages/Solaris/Makefile \
2555 packages/DOS/Makefile \
2556 packages/EPM/curl.list \
2557 packages/EPM/Makefile \
2558 packages/vms/Makefile \
2559 packages/AIX/Makefile \
2560 packages/AIX/RPM/Makefile \
2561 packages/AIX/RPM/curl.spec \
2562 packages/TPF/Makefile \
2568 AC_MSG_NOTICE([Configured to build curl/libcurl:
2570 curl version: ${VERSION}
2572 Install prefix: ${prefix}
2574 SSL support: ${curl_ssl_msg}
2575 SSH support: ${curl_ssh_msg}
2576 zlib support: ${curl_zlib_msg}
2577 krb4 support: ${curl_krb4_msg}
2578 GSSAPI support: ${curl_gss_msg}
2579 SPNEGO support: ${curl_spnego_msg}
2580 c-ares support: ${curl_ares_msg}
2581 ipv6 support: ${curl_ipv6_msg}
2582 IDN support: ${curl_idn_msg}
2583 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
2584 Built-in manual: ${curl_manual_msg}
2585 Verbose errors: ${curl_verbose_msg}
2586 SSPI support: ${curl_sspi_msg}
2587 ca cert bundle: ${ca}
2588 ca cert path: ${capath}
2589 LDAP support: ${curl_ldap_msg}
2590 LDAPS support: ${curl_ldaps_msg}
2593 if test "x$soname_bump" = "xyes"; then
2596 SONAME bump: yes - WARNING: this library will be built with the SONAME
2597 number bumped due to (a detected) ABI breakage.
2598 See lib/README.curl_off_t for details on this.