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
44 CURL_CHECK_OPTION_CURLDEBUG
46 CURL_CHECK_PATH_SEPARATOR
48 dnl SED is mandatory for configure process and libtool.
49 dnl Set it now, allowing it to be changed later.
50 AC_PATH_PROG([SED], [sed], [not_found],
51 [$PATH:/usr/bin:/usr/local/bin])
52 if test -z "$SED" || test "$SED" = "not_found"; then
53 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
57 dnl GREP is mandatory for configure process and libtool.
58 dnl Set it now, allowing it to be changed later.
59 AC_PATH_PROG([GREP], [grep], [not_found],
60 [$PATH:/usr/bin:/usr/local/bin])
61 if test -z "$GREP" || test "$GREP" = "not_found"; then
62 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
66 dnl EGREP is mandatory for configure process and libtool.
67 dnl Set it now, allowing it to be changed later.
68 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
69 AC_MSG_CHECKING([for egrep])
71 AC_MSG_RESULT([$EGREP])
73 AC_PATH_PROG([EGREP], [egrep], [not_found],
74 [$PATH:/usr/bin:/usr/local/bin])
76 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
77 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
81 dnl AR is mandatory for configure process and libtool.
82 dnl This is target dependant, so check it as a tool.
83 AC_PATH_TOOL([AR], [ar], [not_found],
84 [$PATH:/usr/bin:/usr/local/bin])
85 if test -z "$AR" || test "$AR" = "not_found"; then
86 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
92 dnl figure out the libcurl version
93 VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
94 AM_INIT_AUTOMAKE(curl,$VERSION)
95 AC_MSG_CHECKING([curl version])
96 AC_MSG_RESULT($VERSION)
99 dnl we extract the numerical version for curl-config only
100 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
103 dnl Solaris pkgadd support definitions
104 PKGADD_PKG="HAXXcurl"
105 PKGADD_NAME="cURL - a client that groks URLs"
106 PKGADD_VENDOR="curl.haxx.se"
108 AC_SUBST(PKGADD_NAME)
109 AC_SUBST(PKGADD_VENDOR)
112 dnl initialize all the info variables
113 curl_ssl_msg="no (--with-ssl / --with-gnutls)"
114 curl_ssh_msg="no (--with-libssh2)"
115 curl_zlib_msg="no (--with-zlib)"
116 curl_krb4_msg="no (--with-krb4*)"
117 curl_gss_msg="no (--with-gssapi)"
118 curl_spnego_msg="no (--with-spnego)"
119 curl_ares_msg="no (--enable-ares)"
120 curl_ipv6_msg="no (--enable-ipv6)"
121 curl_idn_msg="no (--with-libidn)"
122 curl_manual_msg="no (--enable-manual)"
123 curl_verbose_msg="enabled (--disable-verbose)"
124 curl_sspi_msg="no (--enable-sspi)"
125 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
126 curl_ldaps_msg="no (--enable-ldaps)"
129 dnl Save anything in $LIBS for later
134 dnl Detect the canonical host and target build environment
138 dnl Get system canonical name
139 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
141 dnl Checks for programs.
144 dnl Our curl_off_t internal and external configure settings
145 CURL_CONFIGURE_CURL_OFF_T
147 dnl This defines _ALL_SOURCE for AIX
148 CURL_CHECK_AIX_ALL_SOURCE
150 dnl Our configure and build reentrant settings
151 CURL_CONFIGURE_REENTRANT
153 dnl check for how to do large files
156 dnl support building of Windows DLLs
159 dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
160 AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
162 x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
174 AC_MSG_CHECKING([if we need -mimpure-text])
178 if test "$GCC" = "yes"; then
185 AC_MSG_RESULT($mimpure)
186 AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
187 AM_CONDITIONAL(STATICLIB, false)
189 AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
192 AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
194 AC_MSG_CHECKING([if we need CURL_STATICLIB])
195 if test "X$enable_shared" = "Xno"
197 AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
199 AM_CONDITIONAL(STATICLIB, true)
209 # Determine whether all dependent libraries must be specified when linking
210 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
216 AC_SUBST(REQUIRE_LIB_DEPS)
218 dnl The install stuff has already been taken care of by the automake stuff
222 dnl check if there's a way to force code inline
225 dnl **********************************************************************
226 dnl platform/compiler/architecture specific checks/flags
227 dnl **********************************************************************
230 CURL_SET_COMPILER_BASIC_OPTS
231 CURL_SET_COMPILER_DEBUG_OPTS
232 CURL_SET_COMPILER_OPTIMIZE_OPTS
233 CURL_SET_COMPILER_WARNING_OPTS
237 x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
239 if test "$compiler_id" = "INTEL_UNIX_C"; then
241 if test "$compiler_num" -ge "900" &&
242 test "$compiler_num" -lt "1000"; then
244 CFLAGS="$CFLAGS -i-dynamic"
247 if test "$compiler_num" -ge "1000"; then
248 dnl icc 10.X or later
249 CFLAGS="$CFLAGS -shared-intel"
257 CURL_CHECK_COMPILER_HALT_ON_ERROR
258 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
260 CURL_CHECK_NO_UNDEFINED
261 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
264 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
266 dnl **********************************************************************
267 dnl Compilation based checks should not be done before this point.
268 dnl **********************************************************************
270 dnl **********************************************************************
271 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
272 dnl and ws2tcpip.h take precedence over any other further checks which
273 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
274 dnl this specific header files. And do them before its results are used.
275 dnl **********************************************************************
277 CURL_CHECK_HEADER_WINDOWS
278 CURL_CHECK_NATIVE_WINDOWS
279 case X-"$ac_cv_native_windows" in
281 CURL_CHECK_HEADER_WINSOCK
282 CURL_CHECK_HEADER_WINSOCK2
283 CURL_CHECK_HEADER_WS2TCPIP
284 CURL_CHECK_HEADER_WINLDAP
285 CURL_CHECK_HEADER_WINBER
288 ac_cv_header_winsock_h="no"
289 ac_cv_header_winsock2_h="no"
290 ac_cv_header_ws2tcpip_h="no"
291 ac_cv_header_winldap_h="no"
292 ac_cv_header_winber_h="no"
295 CURL_CHECK_WIN32_LARGEFILE
297 dnl ************************************************************
298 dnl switch off particular protocols
300 AC_MSG_CHECKING([whether to support http])
302 AC_HELP_STRING([--enable-http],[Enable HTTP support])
303 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
304 [ case "$enableval" in
307 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
308 AC_MSG_WARN([disable HTTP disables FTP over proxy])
309 AC_SUBST(CURL_DISABLE_HTTP, [1])
311 *) AC_MSG_RESULT(yes)
316 AC_MSG_CHECKING([whether to support ftp])
318 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
319 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
320 [ case "$enableval" in
323 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
324 AC_SUBST(CURL_DISABLE_FTP, [1])
326 *) AC_MSG_RESULT(yes)
331 AC_MSG_CHECKING([whether to support file])
333 AC_HELP_STRING([--enable-file],[Enable FILE support])
334 AC_HELP_STRING([--disable-file],[Disable FILE support]),
335 [ case "$enableval" in
338 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
339 AC_SUBST(CURL_DISABLE_FILE, [1])
341 *) AC_MSG_RESULT(yes)
346 AC_MSG_CHECKING([whether to support ldap])
348 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
349 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
350 [ case "$enableval" in
353 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
354 AC_SUBST(CURL_DISABLE_LDAP, [1])
359 # Force no ldap. config/build process is broken for cygwin
360 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
361 AC_SUBST(CURL_DISABLE_LDAP, [1])
371 # Force no ldap. config/build process is broken for cygwin
372 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
373 AC_SUBST(CURL_DISABLE_LDAP, [1])
380 AC_MSG_CHECKING([whether to support ldaps])
382 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
383 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
384 [ case "$enableval" in
387 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
388 AC_SUBST(CURL_DISABLE_LDAPS, [1])
390 *) if test x$CURL_DISABLE_LDAP = x1 ; then
391 AC_MSG_RESULT(LDAP support needs to be enabled in order to enable LDAPS support!)
392 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
393 AC_SUBST(CURL_DISABLE_LDAPS, [1])
396 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
397 curl_ldaps_msg="enabled"
402 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
403 AC_SUBST(CURL_DISABLE_LDAPS, [1])
406 AC_MSG_CHECKING([whether to support proxies])
408 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
409 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
410 [ case "$enableval" in
413 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
414 AC_SUBST(CURL_DISABLE_PROXY, [1])
416 *) AC_MSG_RESULT(yes)
422 AC_MSG_CHECKING([whether to support dict])
424 AC_HELP_STRING([--enable-dict],[Enable DICT support])
425 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
426 [ case "$enableval" in
429 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
430 AC_SUBST(CURL_DISABLE_DICT, [1])
432 *) AC_MSG_RESULT(yes)
437 AC_MSG_CHECKING([whether to support telnet])
438 AC_ARG_ENABLE(telnet,
439 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
440 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
441 [ case "$enableval" in
444 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
445 AC_SUBST(CURL_DISABLE_TELNET, [1])
447 *) AC_MSG_RESULT(yes)
452 AC_MSG_CHECKING([whether to support tftp])
454 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
455 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
456 [ case "$enableval" in
459 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
460 AC_SUBST(CURL_DISABLE_TFTP, [1])
462 *) AC_MSG_RESULT(yes)
468 dnl **********************************************************************
469 dnl Check for built-in manual
470 dnl **********************************************************************
472 AC_MSG_CHECKING([whether to provide built-in manual])
473 AC_ARG_ENABLE(manual,
474 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
475 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
476 [ case "$enableval" in
480 *) AC_MSG_RESULT(yes)
487 dnl The actual use of the USE_MANUAL variable is done much later in this
488 dnl script to allow other actions to disable it as well.
490 dnl **********************************************************************
491 dnl Checks for libraries.
492 dnl **********************************************************************
496 dnl gethostbyname without lib or in the nsl lib?
497 AC_CHECK_FUNC(gethostbyname,
498 [HAVE_GETHOSTBYNAME="1"
500 [ AC_CHECK_LIB(nsl, gethostbyname,
501 [HAVE_GETHOSTBYNAME="1"
506 if test "$HAVE_GETHOSTBYNAME" != "1"
508 dnl gethostbyname in the socket lib?
509 AC_CHECK_LIB(socket, gethostbyname,
510 [HAVE_GETHOSTBYNAME="1"
511 LIBS="$LIBS -lsocket"
515 dnl At least one system has been identified to require BOTH nsl and socket
516 dnl libs at the same time to link properly.
517 if test "$HAVE_GETHOSTBYNAME" != "1"
519 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
520 my_ac_save_LIBS=$LIBS
521 LIBS="-lnsl -lsocket $LIBS"
529 HAVE_GETHOSTBYNAME="1"
532 LIBS=$my_ac_save_LIBS
536 if test "$HAVE_GETHOSTBYNAME" != "1"
538 dnl This is for winsock systems
539 if test "$ac_cv_header_windows_h" = "yes"; then
540 if test "$ac_cv_header_winsock_h" = "yes"; then
543 winsock_LIB="-lwinsock"
546 winsock_LIB="-lwsock32"
550 if test "$ac_cv_header_winsock2_h" = "yes"; then
551 winsock_LIB="-lws2_32"
553 if test ! -z "$winsock_LIB"; then
554 my_ac_save_LIBS=$LIBS
555 LIBS="$winsock_LIB $LIBS"
556 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
559 #ifdef HAVE_WINDOWS_H
560 #ifndef WIN32_LEAN_AND_MEAN
561 #define WIN32_LEAN_AND_MEAN
564 #ifdef HAVE_WINSOCK2_H
565 #include <winsock2.h>
567 #ifdef HAVE_WINSOCK_H
573 gethostbyname("www.dummysite.com");
577 HAVE_GETHOSTBYNAME="1"
581 LIBS=$my_ac_save_LIBS
587 if test "$HAVE_GETHOSTBYNAME" != "1"
589 dnl This is for Minix 3.1
590 AC_MSG_CHECKING([for gethostbyname for Minix 3])
593 /* Older Minix versions may need <net/gen/netdb.h> here instead */
596 gethostbyname("www.dummysite.com");
600 HAVE_GETHOSTBYNAME="1"
606 if test "$HAVE_GETHOSTBYNAME" != "1"
608 dnl This is for eCos with a stubbed DNS implementation
609 AC_MSG_CHECKING([for gethostbyname for eCos])
615 gethostbyname("www.dummysite.com");
619 HAVE_GETHOSTBYNAME="1"
625 if test "$HAVE_GETHOSTBYNAME" != "1"
627 dnl gethostbyname in the network lib - for Haiku OS
628 AC_CHECK_LIB(network, gethostbyname,
629 [HAVE_GETHOSTBYNAME="1"
630 LIBS="$LIBS -lnetwork"
634 if test "$HAVE_GETHOSTBYNAME" != "1"
636 dnl gethostbyname in the net lib - for BeOS
637 AC_CHECK_LIB(net, gethostbyname,
638 [HAVE_GETHOSTBYNAME="1"
644 if test "$HAVE_GETHOSTBYNAME" != "1"; then
645 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
649 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
651 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
652 AC_CHECK_LIB(resolve, strcasecmp,
653 [LIBS="-lresolve $LIBS"],
657 ac_cv_func_strcasecmp="no"
660 AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
662 dnl **********************************************************************
663 dnl In case that function clock_gettime with monotonic timer is available,
664 dnl check for additional required libraries.
665 dnl **********************************************************************
666 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
668 dnl **********************************************************************
669 dnl The preceding library checks are all potentially useful for test
670 dnl servers (for providing networking support). Save the list of required
671 dnl libraries at this point for use while linking those test servers.
672 dnl **********************************************************************
673 TEST_SERVER_LIBS=$LIBS
675 dnl **********************************************************************
676 AC_MSG_CHECKING([whether to use libgcc])
677 AC_ARG_ENABLE(libgcc,
678 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
679 [ case "$enableval" in
681 ALL_LIBS="$ALL_LIBS -lgcc"
690 dnl **********************************************************************
692 dnl **********************************************************************
695 AC_ARG_WITH(ldap-lib,
696 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
697 [LDAPLIBNAME="$withval"])
700 AC_ARG_WITH(lber-lib,
701 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
702 [LBERLIBNAME="$withval"])
704 if test x$CURL_DISABLE_LDAP != x1 ; then
706 CURL_CHECK_HEADER_LBER
707 CURL_CHECK_HEADER_LDAP
708 CURL_CHECK_HEADER_LDAPSSL
709 CURL_CHECK_HEADER_LDAP_SSL
711 if test -z "$LDAPLIBNAME" ; then
713 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
714 dnl Windows uses a single and unique OpenLDAP DLL name
715 LDAPLIBNAME="wldap32"
721 if test "$LDAPLIBNAME" ; then
722 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
723 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
724 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
725 AC_SUBST(CURL_DISABLE_LDAP, [1])])
726 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
727 AC_SUBST(CURL_DISABLE_LDAPS, [1])
729 dnl Try to find the right ldap libraries for this system
731 case X-"$curl_cv_ldap_LIBS" in
733 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
734 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
735 AC_SUBST(CURL_DISABLE_LDAP, [1])
736 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
737 AC_SUBST(CURL_DISABLE_LDAPS, [1])
743 if test x$CURL_DISABLE_LDAP != x1 ; then
745 if test "$LBERLIBNAME" ; then
746 dnl If name is "no" then don't define this library at all
747 dnl (it's only needed if libldap.so's dependencies are broken).
748 if test "$LBERLIBNAME" != "no" ; then
749 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
750 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
751 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
752 AC_SUBST(CURL_DISABLE_LDAP, [1])])
753 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
754 AC_SUBST(CURL_DISABLE_LDAPS, [1])
759 if test x$CURL_DISABLE_LDAP != x1 ; then
760 AC_CHECK_FUNCS([ldap_url_parse])
762 if test "$LDAPLIBNAME" = "wldap32"; then
763 curl_ldap_msg="enabled (winldap)"
764 AC_DEFINE(CURL_LDAP_WIN, 1, [Use W$ LDAP implementation])
766 *-*-cygwin* | *-*-pw32*)
767 AC_DEFINE(CURL_LDAP_HYBRID, 1, [W$ LDAP with non-W$ compiler])
771 curl_ldap_msg="enabled (OpenLDAP)"
775 dnl **********************************************************************
777 dnl **********************************************************************
779 AC_MSG_CHECKING([whether to enable ipv6])
781 AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
782 AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
783 [ case "$enableval" in
788 *) AC_MSG_RESULT(yes)
793 AC_TRY_RUN([ /* is AF_INET6 available? */
794 #include <sys/types.h>
795 #include <sys/socket.h>
798 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
812 if test "$ipv6" = "yes"; then
813 curl_ipv6_msg="enabled"
816 # Check if struct sockaddr_in6 have sin6_scope_id member
817 if test "$ipv6" = yes; then
818 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
820 #include <sys/types.h>
821 #include <netinet/in.h>] ,
822 struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
823 if test "$have_sin6_scope_id" = yes; then
825 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
831 dnl **********************************************************************
832 dnl Check if the operating system allows programs to write to their own argv[]
833 dnl **********************************************************************
835 AC_MSG_CHECKING([if argv can be written to])
836 AC_CACHE_VAL(curl_cv_writable_argv, [
838 int main(int argc, char ** argv) {
840 return (argv[0][0] == ' ')?0:1;
843 curl_cv_writable_argv=yes,
844 curl_cv_writable_argv=no,
845 curl_cv_writable_argv=cross)
847 case $curl_cv_writable_argv in
849 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
857 AC_MSG_WARN([the previous check could not be made default was used])
861 dnl **********************************************************************
862 dnl Check for the presence of Kerberos4 libraries and headers
863 dnl **********************************************************************
865 AC_ARG_WITH(krb4-includes,
866 AC_HELP_STRING([--with-krb4-includes=DIR],
867 [Specify location of kerberos4 headers]),[
868 CPPFLAGS="$CPPFLAGS -I$withval"
873 AC_ARG_WITH(krb4-libs,
874 AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
875 LDFLAGS="$LDFLAGS -L$withval"
883 AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
885 if test X"$OPT_KRB4" != Xno; then
887 if test X"$OPT_KRB4" != Xyes; then
888 LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
889 KRB4LIB="$OPT_KRB4/lib$libsuff"
890 CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
891 KRB4INC="$OPT_KRB4/include"
896 AC_MSG_CHECKING([if Kerberos4 support is requested])
898 if test "$want_krb4" = yes
900 if test "$ipv6" = "yes"; then
901 echo krb4 is not compatible with IPv6
906 dnl Check for & handle argument to --with-krb4
908 AC_MSG_CHECKING(where to look for Kerberos4)
909 if test X"$OPT_KRB4" = Xyes
911 AC_MSG_RESULT([defaults])
913 AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
916 dnl Check for DES library
917 AC_CHECK_LIB(des, des_pcbc_encrypt,
919 AC_CHECK_HEADERS(des.h)
922 AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
924 dnl Check for the Kerberos4 library
925 AC_CHECK_LIB(krb, krb_net_read,
927 dnl Check for header files
928 AC_CHECK_HEADERS(krb.h)
930 dnl we found the required libraries, add to LIBS
931 LIBS="-lkrb -lcom_err -ldes $LIBS"
933 dnl Check for function krb_get_our_ip_for_realm
934 dnl this is needed for NAT networks
935 AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
938 AC_DEFINE(HAVE_KRB4, 1,
939 [if you have the Kerberos4 libraries (including -ldes)])
941 dnl substitute it too!
943 AC_SUBST(KRB4_ENABLED)
945 curl_krb4_msg="enabled"
947 dnl the krb4 stuff needs a strlcpy()
948 AC_CHECK_FUNCS(strlcpy)
956 dnl **********************************************************************
957 dnl Check for FBopenssl(SPNEGO) libraries
958 dnl **********************************************************************
961 AC_HELP_STRING([--with-spnego=DIR],
962 [Specify location of SPNEGO library fbopenssl]), [
963 SPNEGO_ROOT="$withval"
964 if test x"$SPNEGO_ROOT" != xno; then
969 AC_MSG_CHECKING([if SPNEGO support is requested])
970 if test x"$want_spnego" = xyes; then
972 if test X"$SPNEGO_ROOT" = Xyes; then
973 AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
976 if test -z "$SPNEGO_LIB_DIR"; then
977 LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
979 LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
983 AC_DEFINE(HAVE_SPNEGO, 1,
984 [Define this if you have the SPNEGO library fbopenssl])
985 curl_spnego_msg="enabled"
991 dnl **********************************************************************
992 dnl Check for GSS-API libraries
993 dnl **********************************************************************
995 dnl check for gss stuff in the /usr as default
998 AC_ARG_WITH(gssapi-includes,
999 AC_HELP_STRING([--with-gssapi-includes=DIR],
1000 [Specify location of GSSAPI header]),
1001 [ GSSAPI_INCS="-I$withval"
1005 AC_ARG_WITH(gssapi-libs,
1006 AC_HELP_STRING([--with-gssapi-libs=DIR],
1007 [Specify location of GSSAPI libs]),
1008 [ GSSAPI_LIB_DIR="-L$withval"
1013 AC_HELP_STRING([--with-gssapi=DIR],
1014 [Where to look for GSSAPI]), [
1015 GSSAPI_ROOT="$withval"
1016 if test x"$GSSAPI_ROOT" != xno; then
1018 if test x"$GSSAPI_ROOT" = xyes; then
1019 dnl if yes, then use default root
1025 save_CPPFLAGS="$CPPFLAGS"
1026 AC_MSG_CHECKING([if GSSAPI support is requested])
1027 if test x"$want_gss" = xyes; then
1030 if test -z "$GSSAPI_INCS"; then
1031 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1032 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
1033 GSSAPI_LIBS=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1034 elif test "$GSSAPI_ROOT" != "yes"; then
1035 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1036 GSSAPI_LIBS="-lgssapi"
1040 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1041 LIBS="$LIBS $GSSAPI_LIBS"
1043 AC_CHECK_HEADER(gss.h,
1045 dnl found in the given dirs
1046 AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
1050 dnl not found, check Heimdal or MIT
1052 [gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1055 if test "x$not_mit" = "x1"; then
1056 dnl MIT not found, check for Heimdal
1057 AC_CHECK_HEADER(gssapi.h,
1060 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
1063 dnl no header found, disabling GSS
1065 AC_MSG_WARN(disabling GSSAPI since no header files was found)
1070 AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
1071 dnl check if we have a really old MIT kerberos (<= 1.2)
1072 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1075 #include <gssapi/gssapi.h>
1076 #include <gssapi/gssapi_generic.h>
1077 #include <gssapi/gssapi_krb5.h>
1082 GSS_C_NT_HOSTBASED_SERVICE,
1086 AC_MSG_RESULT([yes])
1089 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1090 [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1098 if test x"$want_gss" = xyes; then
1099 AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
1101 curl_gss_msg="enabled (MIT/Heimdal)"
1103 if test -n "$gnu_gss"; then
1104 curl_gss_msg="enabled (GNU GSS)"
1105 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1107 elif test -z "$GSSAPI_LIB_DIR"; then
1108 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1109 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1111 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1112 LIBS="$LIBS $gss_libs"
1113 elif test "$GSSAPI_ROOT" != "yes"; then
1114 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1115 LIBS="$LIBS -lgssapi"
1117 LIBS="$LIBS -lgssapi"
1120 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1121 LIBS="$LIBS -lgssapi"
1124 CPPFLAGS="$save_CPPFLAGS"
1127 dnl **********************************************************************
1128 dnl Check for the presence of SSL libraries and headers
1129 dnl **********************************************************************
1131 dnl Default to compiler & linker defaults for SSL files & libraries.
1133 dnl Default to no CA bundle
1136 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])
1137 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1140 if test X"$OPT_SSL" != Xno; then
1141 dnl backup the pre-ssl variables
1142 CLEANLDFLAGS="$LDFLAGS"
1143 CLEANCPPFLAGS="$CPPFLAGS"
1148 dnl --with-ssl (without path) used
1149 if test x$cross_compiling != xyes; then
1150 dnl only do pkg-config magic when not cross-compiling
1153 PREFIX_OPENSSL=/usr/local/ssl
1154 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1157 dnl no --with-ssl option given, just check default places
1158 if test x$cross_compiling != xyes; then
1159 dnl only do pkg-config magic when not cross-compiling
1165 dnl check the given --with-ssl spot
1167 PREFIX_OPENSSL=$OPT_SSL
1168 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1169 if test "$PREFIX_OPENSSL" != "/usr" ; then
1170 LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
1171 CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include"
1173 CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1177 if test "$PKGTEST" = "yes"; then
1179 CURL_CHECK_PKGCONFIG(openssl)
1181 if test "$PKGCONFIG" != "no" ; then
1182 SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
1183 SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
1184 SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1186 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1188 dnl use the values pkg-config reported
1189 LIBS="$LIBS $SSL_LIBS"
1190 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1191 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1195 dnl This is for Msys/Mingw
1197 *-*-msys* | *-*-mingw*)
1198 AC_MSG_CHECKING([for gdi32])
1199 my_ac_save_LIBS=$LIBS
1200 LIBS="-lgdi32 $LIBS"
1201 AC_TRY_LINK([#include <windef.h>
1202 #include <wingdi.h>],
1205 AC_MSG_RESULT([yes])],
1206 [ dnl failed, restore LIBS
1207 LIBS=$my_ac_save_LIBS
1213 AC_CHECK_LIB(crypto, CRYPTO_lock,[
1215 LIBS="-lcrypto $LIBS"
1217 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1218 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1219 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
1221 LIBS="-lcrypto $LIBS"], [
1222 LDFLAGS="$CLEANLDFLAGS"
1223 CPPFLAGS="$CLEANCPPFLAGS"
1229 if test X"$HAVECRYPTO" = X"yes"; then
1230 dnl This is only reasonable to do if crypto actually is there: check for
1231 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1233 AC_CHECK_LIB(ssl, SSL_connect)
1235 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1236 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1237 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1239 LIBS="$LIBS -lRSAglue -lrsaref"
1240 AC_CHECK_LIB(ssl, SSL_connect)
1241 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1242 dnl still no SSL_connect
1251 dnl Have the libraries--check for SSLeay/OpenSSL headers
1252 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1253 openssl/pem.h openssl/ssl.h openssl/err.h,
1254 curl_ssl_msg="enabled (OpenSSL)"
1256 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1258 if test $ac_cv_header_openssl_x509_h = no; then
1259 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1260 dnl since 'err.h' might in fact find a krb4 header with the same
1262 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1264 if test $ac_cv_header_x509_h = yes &&
1265 test $ac_cv_header_crypto_h = yes &&
1266 test $ac_cv_header_ssl_h = yes; then
1268 curl_ssl_msg="enabled (OpenSSL)"
1274 if test X"$OPENSSL_ENABLED" = X"1"; then
1275 AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
1277 dnl is there a pkcs12.h header present?
1278 AC_CHECK_HEADERS(openssl/pkcs12.h)
1282 dnl USE_SSLEAY is the historical name for what configure calls
1283 dnl OPENSSL_ENABLED; the names should really be unified
1284 USE_SSLEAY="$OPENSSL_ENABLED"
1285 AC_SUBST(USE_SSLEAY)
1287 if test X"$OPT_SSL" != Xoff &&
1288 test "$OPENSSL_ENABLED" != "1"; then
1289 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1293 if test X"$OPENSSL_ENABLED" = X"1"; then
1294 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
1295 dnl stuff, it is kind of "separated" from the main SSL check
1296 AC_CHECK_FUNC(ENGINE_init,
1298 AC_CHECK_HEADERS(openssl/engine.h)
1299 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
1302 dnl these can only exist if openssl exists
1303 dnl yassl doesn't have SSL_get_shutdown
1305 AC_CHECK_FUNCS( RAND_status \
1308 CRYPTO_cleanup_all_ex_data \
1311 dnl Make an attempt to detect if this is actually yassl's headers and
1312 dnl OpenSSL emulation layer. We still leave everything else believing
1313 dnl and acting like OpenSSL.
1315 AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
1318 #include <openssl/ssl.h>
1320 #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
1321 int dummy = SSL_ERROR_NONE;
1323 Not the yaSSL OpenSSL compatibility header.
1327 AC_MSG_RESULT([yes])
1328 AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
1329 [Define to 1 if using yaSSL in OpenSSL compatibility mode.])
1330 curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
1336 if test "$OPENSSL_ENABLED" = "1"; then
1337 if test -n "$LIB_OPENSSL"; then
1338 dnl when the ssl shared libs were found in a path that the run-time
1339 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1340 dnl to prevent further configure tests to fail due to this
1342 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
1343 export LD_LIBRARY_PATH
1344 AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
1350 dnl **********************************************************************
1351 dnl Check for the presence of ZLIB libraries and headers
1352 dnl **********************************************************************
1354 dnl Check for & handle argument to --with-zlib.
1359 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1360 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
1361 [OPT_ZLIB="$withval"])
1363 if test "$OPT_ZLIB" = "no" ; then
1364 AC_MSG_WARN([zlib disabled])
1366 if test "$OPT_ZLIB" = "yes" ; then
1370 if test -z "$OPT_ZLIB" ; then
1371 dnl check for the lib first without setting any new path, since many
1372 dnl people have it in the default path
1374 AC_CHECK_LIB(z, inflateEnd,
1375 dnl libz found, set the variable
1377 dnl if no lib found, try /usr/local
1378 [OPT_ZLIB="/usr/local"])
1382 dnl Add a nonempty path to the compiler flags
1383 if test -n "$OPT_ZLIB"; then
1384 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1385 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1388 AC_CHECK_HEADER(zlib.h,
1390 dnl zlib.h was found
1392 dnl if the lib wasn't found already, try again with the new paths
1393 if test "$HAVE_LIBZ" != "1"; then
1394 AC_CHECK_LIB(z, gzread,
1396 dnl the lib was found!
1399 [ CPPFLAGS=$_cppflags
1404 dnl zlib.h was not found, restore the flags
1409 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1411 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1413 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1415 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1416 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1418 dnl both header and lib were found!
1420 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1421 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1423 CURL_LIBS="$CURL_LIBS -lz"
1426 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1428 AC_MSG_NOTICE([found both libz and libz.h header])
1429 curl_zlib_msg="enabled"
1433 dnl set variable for use in automakefile(s)
1434 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1436 dnl **********************************************************************
1437 dnl Check for the presence of LIBSSH2 libraries and headers
1438 dnl **********************************************************************
1440 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
1442 AC_ARG_WITH(libssh2,dnl
1443 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])
1444 AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
1445 OPT_LIBSSH2=$withval)
1447 if test X"$OPT_LIBSSH2" != Xno; then
1448 dnl backup the pre-libssh2 variables
1449 CLEANLDFLAGS="$LDFLAGS"
1450 CLEANCPPFLAGS="$CPPFLAGS"
1453 case "$OPT_LIBSSH2" in
1455 dnl --with-libssh2 (without path) used
1456 PREFIX_LIBSSH2=/usr/local/lib
1457 LIB_LIBSSH2="$PREFIX_LIBSSH2$libsuff"
1460 dnl no --with-libssh2 option given, just check default places
1464 dnl use the given --with-libssh2 spot
1465 PREFIX_LIBSSH2=$OPT_LIBSSH2
1466 LIB_LIBSSH2="$PREFIX_LIBSSH2/lib$libsuff"
1467 LDFLAGS="$LDFLAGS -L$LIB_LIBSSH2"
1468 CPPFLAGS="$CPPFLAGS -I$PREFIX_LIBSSH2/include"
1472 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
1474 AC_CHECK_HEADERS(libssh2.h,
1475 curl_ssh_msg="enabled (libSSH2)"
1477 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
1478 AC_SUBST(USE_LIBSSH2, [1])
1481 if test X"$OPT_LIBSSH2" != Xoff &&
1482 test "$LIBSSH2_ENABLED" != "1"; then
1483 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
1486 if test "$LIBSSH2_ENABLED" = "1"; then
1487 if test -n "$LIB_LIBSSH2"; then
1488 dnl when the libssh2 shared libs were found in a path that the run-time
1489 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1490 dnl to prevent further configure tests to fail due to this
1492 dnl libssh2_version is a post 1.0 addition
1493 AC_CHECK_FUNCS( libssh2_version )
1495 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_LIBSSH2"
1496 export LD_LIBRARY_PATH
1497 AC_MSG_NOTICE([Added $LIB_LIBSSH2 to LD_LIBRARY_PATH])
1502 dnl **********************************************************************
1503 dnl Check for the random seed preferences
1504 dnl **********************************************************************
1506 if test X"$OPENSSL_ENABLED" = X"1"; then
1507 AC_ARG_WITH(egd-socket,
1508 AC_HELP_STRING([--with-egd-socket=FILE],
1509 [Entropy Gathering Daemon socket pathname]),
1510 [ EGD_SOCKET="$withval" ]
1512 if test -n "$EGD_SOCKET" ; then
1513 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1514 [your Entropy Gathering Daemon socket pathname] )
1517 dnl Check for user-specified random device
1519 AC_HELP_STRING([--with-random=FILE],
1520 [read randomness from FILE (default=/dev/urandom)]),
1521 [ RANDOM_FILE="$withval" ],
1523 dnl Check for random device
1524 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1527 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1528 AC_SUBST(RANDOM_FILE)
1529 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1530 [a suitable file to read random data from])
1534 dnl ----------------------------------------------------
1535 dnl check for GnuTLS
1536 dnl ----------------------------------------------------
1538 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1541 AC_ARG_WITH(gnutls,dnl
1542 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
1543 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1544 OPT_GNUTLS=$withval)
1546 if test "$OPENSSL_ENABLED" != "1"; then
1548 if test X"$OPT_GNUTLS" != Xno; then
1551 if test "x$OPT_GNUTLS" = "xyes"; then
1552 CURL_CHECK_PKGCONFIG(gnutls)
1554 if test "$PKGCONFIG" != "no" ; then
1555 addlib=`$PKGCONFIG --libs-only-l gnutls`
1556 addld=`$PKGCONFIG --libs-only-L gnutls`
1557 addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1558 version=`$PKGCONFIG --modversion gnutls`
1559 gtlslib=`echo $addld | $SED -e 's/-L//'`
1562 dnl without pkg-config, we guess a lot!
1564 addld=-L$OPT_GNUTLS/lib$libsuff
1565 addcflags=-I$OPT_GNUTLS/include
1566 version="" # we just don't know
1567 gtlslib=$OPT_GNUTLS/lib$libsuff
1570 if test -z "$version"; then
1571 dnl lots of efforts, still no go
1575 if test -n "$addlib"; then
1578 CLEANCPPFLAGS="$CPPFLAGS"
1579 CLEADLDFLAGS="$LDFLAGS"
1581 LIBS="$LIBS $addlib"
1582 LDFLAGS="$LDFLAGS $addld"
1583 if test "$addcflags" != "-I/usr/include"; then
1584 CPPFLAGS="$CPPFLAGS $addcflags"
1587 AC_CHECK_LIB(gnutls, gnutls_check_version,
1589 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1590 AC_SUBST(USE_GNUTLS, [1])
1593 curl_ssl_msg="enabled (GnuTLS)"
1597 CPPFLAGS="$CLEANCPPFLAGS"
1600 if test "x$USE_GNUTLS" = "xyes"; then
1601 AC_MSG_NOTICE([detected GnuTLS version $version])
1603 if test -n "$gtlslib"; then
1604 dnl when shared libs were found in a path that the run-time
1605 dnl linker doesn't search through, we need to add it to
1606 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1609 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
1610 export LD_LIBRARY_PATH
1611 AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
1617 fi dnl GNUTLS not disabled
1621 dnl ----------------------------------------------------
1622 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
1623 dnl ----------------------------------------------------
1625 dnl Default to compiler & linker defaults for NSS files & libraries.
1629 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root (default: /usr/local/)])
1630 AC_HELP_STRING([--without-nss], [disable NSS detection]),
1633 if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
1635 if test X"$OPT_NSS" != Xno; then
1636 if test "x$OPT_NSS" = "xyes"; then
1638 CURL_CHECK_PKGCONFIG(nss)
1640 if test "$PKGCONFIG" != "no" ; then
1641 addlib=`$PKGCONFIG --libs nss`
1642 addcflags=`$PKGCONFIG --cflags nss`
1643 version=`$PKGCONFIG --modversion nss`
1644 nssprefix=`$PKGCONFIG --variable=prefix nss`
1647 # Without pkg-config, we'll kludge in some defaults
1648 addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
1649 addcflags="-I$OPT_NSS/include"
1654 dnl Check for functionPK11_CreateGenericObject
1655 dnl this is needed for using the PEM PKCS#11 module
1656 AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
1658 AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject])
1659 AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1])
1661 if test -n "$addlib"; then
1664 CLEANCPPFLAGS="$CPPFLAGS"
1666 LIBS="$LIBS $addlib"
1667 if test "$addcflags" != "-I/usr/include"; then
1668 CPPFLAGS="$CPPFLAGS $addcflags"
1671 AC_CHECK_LIB(nss3, NSS_Initialize,
1673 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
1674 AC_SUBST(USE_NSS, [1])
1677 curl_ssl_msg="enabled (NSS)"
1681 CPPFLAGS="$CLEANCPPFLAGS"
1684 if test "x$USE_NSS" = "xyes"; then
1685 AC_MSG_NOTICE([detected NSS version $version])
1687 dnl when shared libs were found in a path that the run-time
1688 dnl linker doesn't search through, we need to add it to
1689 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1692 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
1693 export LD_LIBRARY_PATH
1694 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
1699 fi dnl NSS not disabled
1701 fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
1703 if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
1704 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
1705 AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
1707 # SSL is enabled, genericly
1708 AC_SUBST(SSL_ENABLED)
1712 dnl **********************************************************************
1713 dnl Check for the CA bundle
1714 dnl **********************************************************************
1716 CURL_CHECK_CA_BUNDLE
1718 dnl **********************************************************************
1719 dnl Check for the presence of IDN libraries and headers
1720 dnl **********************************************************************
1722 AC_MSG_CHECKING([whether to build with libidn])
1724 AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
1725 AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
1726 [LIBIDN="$withval"])
1732 *) AC_MSG_RESULT(yes)
1735 dnl if there is a given path, check that FIRST
1736 if test -n "$LIBIDN"; then
1737 if test "x$LIBIDN" != "xyes"; then
1739 oldCPPFLAGS=$CPPFLAGS
1740 LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
1741 CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
1743 AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
1746 CPPFLAGS=$oldCPPFLAGS)
1750 if test "x$idn" != "xyes"; then
1751 dnl check with default paths
1753 AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
1757 if test "x$idn" = "xyes"; then
1758 curl_idn_msg="enabled"
1759 AC_SUBST(IDN_ENABLED, [1])
1760 dnl different versions of libidn have different setups of these:
1761 AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
1762 AC_CHECK_HEADERS( idn-free.h tld.h )
1768 dnl Default is to try the thread-safe versions of a few functions
1771 dnl detect AIX 4.3 or later
1772 dnl see full docs on this reasoning in the lib/hostip.c source file
1773 AC_MSG_CHECKING([AIX 4.3 or later])
1775 #if defined(_AIX) && defined(_AIX43)
1776 printf("just fine");
1778 #error "this is not AIX 4.3 or later"
1781 [ AC_MSG_RESULT([yes])
1784 [ AC_MSG_RESULT([no]) ]
1787 AC_ARG_ENABLE(thread,dnl
1788 AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
1789 AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
1790 [ case "$enableval" in
1793 AC_MSG_WARN(libcurl will not get built using thread-safe functions)
1801 if test X"$OPT_THREAD" = Xoff
1803 AC_DEFINE(DISABLED_THREADSAFE, 1,
1804 [Set to explicitly specify we don't want to use thread-safe functions])
1806 dnl if test "$ipv6" != "yes"; then
1807 dnl dig around for gethostbyname_r()
1808 dnl the old gethostbyname_r check was done here
1810 dnl dig around for gethostbyaddr_r()
1811 dnl the old gethostbyaddr_r check was here BUT COMMENTED OUT
1814 dnl poke around for inet_ntoa_r()
1815 dnl the old inet_ntoa_r check was done here
1817 dnl is there a localtime_r()
1818 dnl the old localtime_r check was done here
1820 dnl is there a strerror_r()
1821 dnl the old strerror_r check was done here
1823 checkfor_gmtime_r="yes"
1826 dnl for recent AIX versions, we skip all the thread-safe checks above since
1827 dnl they claim a thread-safe libc using the standard API. But there are
1828 dnl some functions still not thread-safe. Check for these!
1830 dnl Let's hope this split URL remains working:
1831 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
1832 dnl genprogc/thread_quick_ref.htm
1834 if test "x$RECENTAIX" = "xyes"; then
1836 AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
1838 dnl is there a localtime_r()
1839 dnl the old localtime_r check was done here
1841 dnl is there a strerror_r()
1842 dnl the old strerror_r check was done here
1844 checkfor_gmtime_r="yes"
1848 dnl **********************************************************************
1849 dnl Back to "normal" configuring
1850 dnl **********************************************************************
1852 dnl Checks for header files.
1855 CURL_CHECK_HEADER_MALLOC
1856 CURL_CHECK_HEADER_MEMORY
1858 dnl Now check for the very most basic headers. Then we can use these
1859 dnl ones as default-headers when checking for the rest!
1900 dnl to do if not found
1904 dnl default includes
1906 #ifdef HAVE_SYS_TYPES_H
1907 #include <sys/types.h>
1909 #ifdef HAVE_SYS_TIME_H
1910 #include <sys/time.h>
1912 #ifdef HAVE_SYS_SELECT_H
1913 #include <sys/select.h>
1915 #ifdef HAVE_SYS_SOCKET_H
1916 #include <sys/socket.h>
1918 #ifdef HAVE_NETINET_IN_H
1919 #include <netinet/in.h>
1921 #ifdef HAVE_SYS_UN_H
1927 dnl Checks for typedefs, structures, and compiler characteristics.
1929 CURL_CHECK_VARIADIC_MACROS
1932 CURL_CHECK_STRUCT_TIMEVAL
1933 CURL_VERIFY_RUNTIMELIBS
1935 AC_CHECK_SIZEOF(size_t)
1936 AC_CHECK_SIZEOF(int)
1937 AC_CHECK_SIZEOF(long)
1939 AC_CHECK_SIZEOF(time_t)
1940 AC_CHECK_SIZEOF(off_t)
1943 if test x"$ac_cv_native_windows" != "xyes" &&
1944 test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
1945 AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
1946 AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
1951 AC_CHECK_TYPE(long long,
1952 [AC_DEFINE(HAVE_LONGLONG, 1,
1953 [Define to 1 if the compiler supports the 'long long' data type.])]
1957 if test "xyes" = "x$longlong"; then
1958 AC_MSG_CHECKING([if numberLL works])
1959 AC_COMPILE_IFELSE([long long val = 1000LL;],
1960 [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
1968 AC_CHECK_TYPE(ssize_t, ,
1969 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
1971 # check for bool type
1972 AC_CHECK_TYPE([bool],[
1973 AC_DEFINE(HAVE_BOOL_T, 1,
1974 [Define to 1 if bool is an available type.])
1976 #ifdef HAVE_SYS_TYPES_H
1977 #include <sys/types.h>
1979 #ifdef HAVE_STDBOOL_H
1980 #include <stdbool.h>
1984 CURL_CONFIGURE_CURL_SOCKLEN_T
1988 TYPE_SOCKADDR_STORAGE
1994 CURL_CHECK_FUNC_SELECT
1996 CURL_CHECK_FUNC_RECV
1997 CURL_CHECK_FUNC_RECVFROM
1998 CURL_CHECK_FUNC_SEND
1999 CURL_CHECK_MSG_NOSIGNAL
2001 CURL_CHECK_FUNC_ALARM
2002 CURL_CHECK_FUNC_FCNTL
2003 CURL_CHECK_FUNC_FDOPEN
2004 CURL_CHECK_FUNC_FREEADDRINFO
2005 CURL_CHECK_FUNC_FREEIFADDRS
2006 CURL_CHECK_FUNC_FTRUNCATE
2007 CURL_CHECK_FUNC_GETADDRINFO
2008 CURL_CHECK_FUNC_GETHOSTBYADDR
2009 CURL_CHECK_FUNC_GETHOSTBYADDR_R
2010 CURL_CHECK_FUNC_GETHOSTBYNAME
2011 CURL_CHECK_FUNC_GETHOSTBYNAME_R
2012 CURL_CHECK_FUNC_GETHOSTNAME
2013 CURL_CHECK_FUNC_GETIFADDRS
2014 CURL_CHECK_FUNC_GETSERVBYPORT_R
2015 CURL_CHECK_FUNC_GMTIME_R
2016 CURL_CHECK_FUNC_INET_NTOA_R
2017 CURL_CHECK_FUNC_INET_NTOP
2018 CURL_CHECK_FUNC_INET_PTON
2019 CURL_CHECK_FUNC_IOCTL
2020 CURL_CHECK_FUNC_IOCTLSOCKET
2021 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
2022 CURL_CHECK_FUNC_LOCALTIME_R
2023 CURL_CHECK_FUNC_POLL
2024 CURL_CHECK_FUNC_SETSOCKOPT
2025 CURL_CHECK_FUNC_SIGACTION
2026 CURL_CHECK_FUNC_SIGINTERRUPT
2027 CURL_CHECK_FUNC_SIGNAL
2028 CURL_CHECK_FUNC_SIGSETJMP
2029 CURL_CHECK_FUNC_STRCASECMP
2030 CURL_CHECK_FUNC_STRCASESTR
2031 CURL_CHECK_FUNC_STRCMPI
2032 CURL_CHECK_FUNC_STRDUP
2033 CURL_CHECK_FUNC_STRERROR_R
2034 CURL_CHECK_FUNC_STRICMP
2035 CURL_CHECK_FUNC_STRLCAT
2036 CURL_CHECK_FUNC_STRNCASECMP
2037 CURL_CHECK_FUNC_STRNCMPI
2038 CURL_CHECK_FUNC_STRNICMP
2039 CURL_CHECK_FUNC_STRSTR
2040 CURL_CHECK_FUNC_STRTOK_R
2041 CURL_CHECK_FUNC_STRTOLL
2042 CURL_CHECK_FUNC_WRITEV
2044 dnl Checks for library functions.
2045 dnl AC_PROG_GCC_TRADITIONAL
2052 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
2056 AC_CHECK_FUNCS([basename \
2078 eval skipcheck=\$skipcheck_$func
2079 if test "x$skipcheck" != "xyes"; then
2080 AC_MSG_CHECKING([deeper for $func])
2087 AC_MSG_RESULT([yes])
2088 eval "ac_cv_func_$func=yes"
2089 AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$func]), [1],
2090 [Define to 1 if you have the $func function.])
2092 AC_MSG_RESULT([but still no])
2098 AC_CHECK_DECL(basename, ,
2099 AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
2100 #ifdef HAVE_STRING_H
2103 #ifdef HAVE_LIBGEN_H
2106 #ifdef HAVE_UNISTD_H
2112 dnl Check if the getnameinfo function is available
2113 dnl and get the types of five of its arguments.
2114 CURL_CHECK_FUNC_GETNAMEINFO
2116 if test "$ipv6" = "yes"; then
2117 if test "$ac_cv_func_getaddrinfo" = "yes"; then
2118 AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
2120 AC_SUBST(IPV6_ENABLED)
2122 CURL_CHECK_NI_WITHSCOPEID
2125 dnl ************************************************************
2126 dnl enable non-blocking communications
2128 CURL_CHECK_OPTION_NONBLOCKING
2129 CURL_CHECK_NONBLOCKING_SOCKET
2131 dnl ************************************************************
2132 dnl nroff tool stuff
2135 AC_PATH_PROG( PERL, perl, ,
2136 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
2139 AC_PATH_PROGS( NROFF, gnroff nroff, ,
2140 $PATH:/usr/bin/:/usr/local/bin )
2143 if test -n "$NROFF"; then
2144 dnl only check for nroff options if an nroff command was found
2146 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
2148 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2149 if test -z "$mancheck"; then
2151 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2152 if test -z "$mancheck"; then
2154 AC_MSG_RESULT([failed])
2155 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
2157 AC_MSG_RESULT([$MANOPT])
2160 AC_MSG_RESULT([$MANOPT])
2165 if test -z "$MANOPT"
2167 dnl if no nroff tool was found, or no option that could convert man pages
2168 dnl was found, then disable the built-in manual stuff
2169 AC_MSG_WARN([disabling built-in manual])
2173 dnl *************************************************************************
2174 dnl If the manual variable still is set, then we go with providing a built-in
2177 if test "$USE_MANUAL" = "1"; then
2178 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
2179 curl_manual_msg="enabled"
2182 dnl set variable for use in automakefile(s)
2183 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
2185 aresembedded="unknown"
2186 configure_rundir=`pwd`
2187 embedded_ares_builddir="$configure_rundir/ares"
2188 AC_MSG_CHECKING([whether to enable c-ares])
2190 AC_HELP_STRING([--enable-ares=PATH],[Enable c-ares for name lookups])
2191 AC_HELP_STRING([--disable-ares],[Disable c-ares for name lookups]),
2192 [ case "$enableval" in
2196 *) AC_MSG_RESULT(yes)
2198 if test "x$IPV6_ENABLED" = "x1"; then
2199 AC_MSG_NOTICE([c-ares may not work properly with ipv6])
2202 AC_DEFINE(USE_ARES, 1, [Define if you want to enable c-ares support])
2203 dnl substitute HAVE_ARES for curl-config and similar
2206 curl_ares_msg="enabled"
2208 LIBS="-lcares $LIBS"
2210 dnl For backwards compatibility default to includes/lib in srcdir/ares
2211 dnl If a value is specified it is assumed that the libs are in $val/lib
2212 dnl and the includes are in $val/include. This is the default setup for
2213 dnl ares so it should not be a problem.
2214 if test "x$enableval" = "xyes" ; then
2215 if test -d "$srcdir/ares"; then
2217 AC_CONFIG_SUBDIRS(ares)
2218 dnl Since c-ares has installable configured header files, path
2219 dnl inclusion is fully done in makefiles for in-tree builds.
2220 LDFLAGS="$LDFLAGS -L$embedded_ares_builddir"
2223 CPPFLAGS="$CPPFLAGS -I$enableval/include"
2224 LDFLAGS="$LDFLAGS -L$enableval/lib"
2227 if test -z "$aresembedded"; then
2228 dnl verify that a sufficient c-ares is here if we have pointed one
2229 dnl out and don't use the "embedded" ares dir (in which case we don't
2230 dnl check it because it might not have been built yet)
2231 AC_MSG_CHECKING([that c-ares is good and recent enough])
2235 /* set of dummy functions in case c-ares was built with debug */
2236 void curl_dofree() { }
2237 void curl_sclose() { }
2238 void curl_domalloc() { }
2239 void curl_docalloc() { }
2240 void curl_socket() { }
2242 ares_channel channel;
2243 ares_cancel(channel); /* added in 1.2.0 */
2244 ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
2247 AC_MSG_RESULT([yes])
2250 AC_MSG_ERROR([c-ares library defective or too old])
2258 dnl set variable for use in automakefile(s)
2259 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$aresembedded = xyes)
2261 dnl ************************************************************
2262 dnl disable verbose text strings
2264 AC_MSG_CHECKING([whether to enable verbose strings])
2265 AC_ARG_ENABLE(verbose,
2266 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
2267 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
2268 [ case "$enableval" in
2271 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
2272 curl_verbose_msg="no"
2274 *) AC_MSG_RESULT(yes)
2280 dnl ************************************************************
2281 dnl enable SSPI support
2283 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
2285 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
2286 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
2287 [ case "$enableval" in
2289 if test "$ac_cv_native_windows" = "yes"; then
2291 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
2292 AC_SUBST(USE_WINDOWS_SSPI, [1])
2296 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
2306 dnl ************************************************************
2307 dnl disable cryptographic authentication
2309 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
2310 AC_ARG_ENABLE(crypto-auth,
2311 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
2312 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
2313 [ case "$enableval" in
2316 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
2318 *) AC_MSG_RESULT(yes)
2324 dnl ************************************************************
2325 dnl disable cookies support
2327 AC_MSG_CHECKING([whether to enable support for cookies])
2328 AC_ARG_ENABLE(cookies,
2329 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
2330 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
2331 [ case "$enableval" in
2334 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
2336 *) AC_MSG_RESULT(yes)
2342 dnl ************************************************************
2343 dnl Enable hiding of internal symbols in library to reduce its size and
2344 dnl speed dynamic linking of applications. This currently is only supported
2345 dnl on gcc >= 4.0 and SunPro C.
2347 AC_MSG_CHECKING([whether to enable hidden symbols in the library])
2348 AC_ARG_ENABLE(hidden-symbols,
2349 AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
2350 AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
2351 [ case "$enableval" in
2356 AC_MSG_CHECKING([whether $CC supports it])
2357 if test "$GCC" = yes ; then
2358 if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
2360 AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2361 AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
2362 CFLAGS="$CFLAGS -fvisibility=hidden"
2368 dnl Test for SunPro cc
2369 if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
2371 AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2372 AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
2373 CFLAGS="$CFLAGS -xldscope=hidden"
2383 dnl ************************************************************
2384 dnl enforce SONAME bump
2387 AC_MSG_CHECKING([whether to enforce SONAME bump])
2388 AC_ARG_ENABLE(soname-bump,
2389 AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
2390 AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
2391 [ case "$enableval" in
2392 yes) AC_MSG_RESULT(yes)
2399 AC_MSG_RESULT($soname_bump)
2401 AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
2404 dnl ************************************************************
2405 if test ! -z "$winsock_LIB"; then
2407 dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
2408 dnl things work when built with c-ares). But we can't just move it last
2409 dnl since then other stuff (SSL) won't build. So we simply append it to the
2412 LIBS="$LIBS $winsock_LIB"
2413 TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
2418 dnl All the library dependencies put into $LIB apply to libcurl only.
2419 dnl Those in $CURL_LIBS apply to the curl command-line client only.
2420 dnl Those in $TEST_SERVER_LIBS apply to test servers only.
2421 dnl Those in $ALL_LIBS apply to all targets, including test targets.
2425 AC_SUBST(LIBCURL_LIBS)
2427 AC_SUBST(TEST_SERVER_LIBS)
2428 LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
2430 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
2433 dnl For keeping supported features and protocols also in pkg-config file
2434 dnl since it is more cross-compile frient than curl-config
2437 if test "x$USE_SSLEAY" = "x1"; then
2438 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2439 elif test -n "$SSL_ENABLED"; then
2440 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2442 if test "@KRB4_ENABLED@" = "x1"; then
2443 SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
2445 if test "x$IPV6_ENABLED" = "x1"; then
2446 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
2448 if test "x$HAVE_LIBZ" = "x1"; then
2449 SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
2451 if test "x$HAVE_ARES" = "x1"; then
2452 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
2454 if test "x$IDN_ENABLED" = "x1"; then
2455 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
2457 if test "x$USE_WINDOWS_SSPI" = "x1"; then
2458 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
2460 if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then
2461 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
2464 AC_SUBST(SUPPORT_FEATURES)
2466 dnl For supported protocols in pkg-config file
2467 if test "x$CURL_DISABLE_HTTP" != "x1"; then
2468 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
2469 if test "x$SSL_ENABLED" = "x1"; then
2470 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
2473 if test "x$CURL_DISABLE_FTP" != "x1"; then
2474 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
2475 if test "x$SSL_ENABLED" = "x1"; then
2476 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
2479 if test "x$CURL_DISABLE_FILE" != "x1"; then
2480 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
2482 if test "x$CURL_DISABLE_TELNET" != "x1"; then
2483 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
2485 if test "x$CURL_DISABLE_LDAP" != "x1"; then
2486 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
2488 if test "x$CURL_DISABLE_LDAPS" != "x1"; then
2489 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
2491 if test "x$CURL_DISABLE_DICT" != "x1"; then
2492 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
2494 if test "x$CURL_DISABLE_TFTP" != "x1"; then
2495 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
2497 if test "x$USE_LIBSSH2" = "x1"; then
2498 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
2499 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
2502 AC_SUBST(SUPPORT_PROTOCOLS)
2504 dnl squeeze whitespace out of some variables
2513 squeeze LIBCURL_LIBS
2514 squeeze TEST_SERVER_LIBS
2516 if test "x$want_curldebug_assumed" = "xyes" &&
2517 test "x$want_curldebug" = "xyes" && test "x$HAVE_ARES" = "x1"; then
2518 ac_configure_args="$ac_configure_args --enable-curldebug"
2521 AC_CONFIG_FILES([Makefile \
2523 docs/examples/Makefile \
2524 docs/libcurl/Makefile \
2526 include/curl/Makefile \
2530 tests/data/Makefile \
2531 tests/server/Makefile \
2532 tests/libtest/Makefile \
2534 packages/Win32/Makefile \
2535 packages/Win32/cygwin/Makefile \
2536 packages/Linux/Makefile \
2537 packages/Linux/RPM/Makefile \
2538 packages/Linux/RPM/curl.spec \
2539 packages/Linux/RPM/curl-ssl.spec \
2540 packages/Solaris/Makefile \
2541 packages/EPM/curl.list \
2542 packages/EPM/Makefile \
2543 packages/vms/Makefile \
2544 packages/AIX/Makefile \
2545 packages/AIX/RPM/Makefile \
2546 packages/AIX/RPM/curl.spec \
2552 AC_MSG_NOTICE([Configured to build curl/libcurl:
2554 curl version: ${VERSION}
2556 Install prefix: ${prefix}
2558 SSL support: ${curl_ssl_msg}
2559 SSH support: ${curl_ssh_msg}
2560 zlib support: ${curl_zlib_msg}
2561 krb4 support: ${curl_krb4_msg}
2562 GSSAPI support: ${curl_gss_msg}
2563 SPNEGO support: ${curl_spnego_msg}
2564 c-ares support: ${curl_ares_msg}
2565 ipv6 support: ${curl_ipv6_msg}
2566 IDN support: ${curl_idn_msg}
2567 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
2568 Built-in manual: ${curl_manual_msg}
2569 Verbose errors: ${curl_verbose_msg}
2570 SSPI support: ${curl_sspi_msg}
2571 ca cert bundle: ${ca}
2572 ca cert path: ${capath}
2573 LDAP support: ${curl_ldap_msg}
2574 LDAPS support: ${curl_ldaps_msg}
2577 if test "x$soname_bump" = "xyes"; then
2580 SONAME bump: yes - WARNING: this library will be built with the SONAME
2581 number bumped due to (a detected) ABI breakage.
2582 See lib/README.curl_off_t for details on this.