1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 # $Id: configure.ac,v 1.335 2008-08-26 16:46:46 yangtse Exp $
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 dnl configure script copyright
31 AC_COPYRIGHT([Copyright (c) 1998 - 2008 Daniel Stenberg, <daniel@haxx.se>
32 This configure script may be copied, distributed and modified under the
33 terms of the curl license; see COPYING for more details])
35 AC_CONFIG_SRCDIR([lib/urldata.h])
36 AM_CONFIG_HEADER(lib/config.h src/config.h include/curl/curlbuild.h)
39 dnl SED is mandatory for configure process and libtool.
40 dnl Set it now, allowing it to be changed later.
41 AC_PATH_PROG([SED], [sed], [not_found],
42 [$PATH:/usr/bin:/usr/local/bin])
43 if test -z "$SED" || test "$SED" = "not_found"; then
44 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
48 dnl GREP is mandatory for configure process and libtool.
49 dnl Set it now, allowing it to be changed later.
50 AC_PATH_PROG([GREP], [grep], [not_found],
51 [$PATH:/usr/bin:/usr/local/bin])
52 if test -z "$GREP" || test "$GREP" = "not_found"; then
53 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
57 dnl EGREP is mandatory for configure process and libtool.
58 dnl Set it now, allowing it to be changed later.
59 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
60 AC_MSG_CHECKING([for egrep])
62 AC_MSG_RESULT([$EGREP])
64 AC_PATH_PROG([EGREP], [egrep], [not_found],
65 [$PATH:/usr/bin:/usr/local/bin])
67 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
68 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
72 dnl AR is mandatory for configure process and libtool.
73 dnl This is target dependant, so check it as a tool.
74 AC_PATH_TOOL([AR], [ar], [not_found],
75 [$PATH:/usr/bin:/usr/local/bin])
76 if test -z "$AR" || test "$AR" = "not_found"; then
77 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
83 dnl figure out the libcurl version
84 VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
85 AM_INIT_AUTOMAKE(curl,$VERSION)
86 AC_MSG_CHECKING([curl version])
87 AC_MSG_RESULT($VERSION)
90 dnl we extract the numerical version for curl-config only
91 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
94 dnl Solaris pkgadd support definitions
96 PKGADD_NAME="cURL - a client that groks URLs"
97 PKGADD_VENDOR="curl.haxx.se"
100 AC_SUBST(PKGADD_VENDOR)
103 dnl initialize all the info variables
104 curl_ssl_msg="no (--with-ssl / --with-gnutls)"
105 curl_ssh_msg="no (--with-libssh2)"
106 curl_zlib_msg="no (--with-zlib)"
107 curl_krb4_msg="no (--with-krb4*)"
108 curl_gss_msg="no (--with-gssapi)"
109 curl_spnego_msg="no (--with-spnego)"
110 curl_ares_msg="no (--enable-ares)"
111 curl_ipv6_msg="no (--enable-ipv6)"
112 curl_idn_msg="no (--with-libidn)"
113 curl_manual_msg="no (--enable-manual)"
114 curl_verbose_msg="enabled (--disable-verbose)"
115 curl_sspi_msg="no (--enable-sspi)"
116 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
117 curl_ldaps_msg="no (--enable-ldaps)"
120 dnl Save anything in $LIBS for later
125 dnl Detect the canonical host and target build environment
129 dnl Get system canonical name
130 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
132 dnl Checks for programs.
135 dnl Our curl_off_t internal and external configure settings
136 CURL_CONFIGURE_CURL_OFF_T
138 dnl This defines _ALL_SOURCE for AIX
139 CURL_CHECK_AIX_ALL_SOURCE
141 dnl Our configure and build reentrant settings
142 CURL_CONFIGURE_REENTRANT
144 dnl check for how to do large files
147 dnl support building of Windows DLLs
150 dnl skip libtool C++ and Fortran compiler checks
151 m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
152 m4_defun([AC_PROG_CXX],[])
153 m4_ifdef([AC_PROG_CXXCPP], [m4_undefine([AC_PROG_CXXCPP])])
154 m4_defun([AC_PROG_CXXCPP],[true])
155 m4_ifdef([AC_PROG_F77], [m4_undefine([AC_PROG_F77])])
156 m4_defun([AC_PROG_F77],[])
158 dnl skip libtool C++ and Fortran linker checks
159 m4_ifdef([AC_LIBTOOL_CXX], [m4_undefine([AC_LIBTOOL_CXX])])
160 m4_defun([AC_LIBTOOL_CXX],[])
161 m4_ifdef([AC_LIBTOOL_CXXCPP], [m4_undefine([AC_LIBTOOL_CXXCPP])])
162 m4_defun([AC_LIBTOOL_CXXCPP],[true])
163 m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
164 m4_defun([AC_LIBTOOL_F77],[])
166 dnl force libtool to build static libraries with PIC on AMD64-linux
167 AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
181 AC_MSG_CHECKING([if we need -no-undefined])
183 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
184 need_no_undefined=yes
190 AC_MSG_RESULT($need_no_undefined)
191 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
193 AC_MSG_CHECKING([if we need -mimpure-text])
197 if test "$GCC" = "yes"; then
204 AC_MSG_RESULT($mimpure)
205 AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
206 AM_CONDITIONAL(STATICLIB, false)
208 AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
211 AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
213 AC_MSG_CHECKING([if we need CURL_STATICLIB])
214 if test "X$enable_shared" = "Xno"
216 AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
218 AM_CONDITIONAL(STATICLIB, true)
228 # Determine whether all dependent libraries must be specified when linking
229 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
235 AC_SUBST(REQUIRE_LIB_DEPS)
237 dnl The install stuff has already been taken care of by the automake stuff
241 dnl check if there's a way to force code inline
244 dnl **********************************************************************
245 dnl platform/compiler/architecture specific checks/flags
246 dnl **********************************************************************
252 dnl find out if icc is being used
253 if test "z$ICC" = "z"; then
257 if test "$ICC" = "yes"; then
258 dnl figure out icc version
259 AC_MSG_CHECKING([icc version])
260 iccver=`$CC -dumpversion`
261 iccnhi=`echo $iccver | cut -d . -f1`
262 iccnlo=`echo $iccver | cut -d . -f2`
263 iccnum=`(expr $iccnhi "*" 100 + $iccnlo) 2>/dev/null`
264 AC_MSG_RESULT($iccver)
266 if test "$iccnum" -ge "900" && test "$iccnum" -lt "1000"; then
268 CFLAGS="$CFLAGS -i-dynamic"
271 if test "$iccnum" -ge "1000"; then
272 dnl icc 10.X or later
273 CFLAGS="$CFLAGS -shared-intel"
281 AC_MSG_CHECKING([whether we are using the IBM C compiler])
282 CURL_CHECK_DEF([__IBMC__], [], [silent])
283 if test "$curl_cv_have_def___IBMC__" = "yes"; then
285 dnl Ensure that compiler optimizations are always thread-safe.
286 CFLAGS="$CFLAGS -qthreaded"
287 dnl Disable type based strict aliasing optimizations, using worst
288 dnl case aliasing assumptions when compiling. Type based aliasing
289 dnl would restrict the lvalues that could be safely used to access
291 CFLAGS="$CFLAGS -qnoansialias"
292 dnl Force compiler to stop after the compilation phase, without
293 dnl generating an object code file when compilation has errors.
294 CFLAGS="$CFLAGS -qhalt=e"
299 AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
300 CURL_CHECK_DEF([__DECC], [], [silent])
301 CURL_CHECK_DEF([__DECC_VER], [], [silent])
302 if test "$curl_cv_have_def___DECC" = "yes" &&
303 test "$curl_cv_have_def___DECC_VER" = "yes"; then
305 dnl Select strict ANSI C compiler mode
306 CFLAGS="$CFLAGS -std1"
307 dnl Turn off optimizer ANSI C aliasing rules
308 CFLAGS="$CFLAGS -noansi_alias"
309 dnl Select a higher warning level than default level2
310 CFLAGS="$CFLAGS -msg_enable level3"
311 dnl Generate warnings for missing function prototypes
312 CFLAGS="$CFLAGS -warnprotos"
313 dnl Change some warnings into fatal errors
314 CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs"
319 CURL_CHECK_COMPILER_HALT_ON_ERROR
320 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
322 dnl **********************************************************************
323 dnl Compilation based checks should not be done before this point.
324 dnl **********************************************************************
326 dnl **********************************************************************
327 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
328 dnl and ws2tcpip.h take precedence over any other further checks which
329 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
330 dnl this specific header files. And do them before its results are used.
331 dnl **********************************************************************
333 CURL_CHECK_HEADER_WINDOWS
334 CURL_CHECK_NATIVE_WINDOWS
335 case X-"$ac_cv_native_windows" in
337 CURL_CHECK_HEADER_WINSOCK
338 CURL_CHECK_HEADER_WINSOCK2
339 CURL_CHECK_HEADER_WS2TCPIP
340 CURL_CHECK_HEADER_WINLDAP
341 CURL_CHECK_HEADER_WINBER
344 ac_cv_header_winsock_h="no"
345 ac_cv_header_winsock2_h="no"
346 ac_cv_header_ws2tcpip_h="no"
347 ac_cv_header_winldap_h="no"
348 ac_cv_header_winber_h="no"
351 CURL_CHECK_WIN32_LARGEFILE
353 dnl ************************************************************
354 dnl switch off particular protocols
356 AC_MSG_CHECKING([whether to support http])
358 AC_HELP_STRING([--enable-http],[Enable HTTP support])
359 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
360 [ case "$enableval" in
363 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
364 AC_MSG_WARN([disable HTTP disables FTP over proxy])
365 AC_SUBST(CURL_DISABLE_HTTP, [1])
367 *) AC_MSG_RESULT(yes)
372 AC_MSG_CHECKING([whether to support ftp])
374 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
375 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
376 [ case "$enableval" in
379 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
380 AC_SUBST(CURL_DISABLE_FTP, [1])
382 *) AC_MSG_RESULT(yes)
387 AC_MSG_CHECKING([whether to support file])
389 AC_HELP_STRING([--enable-file],[Enable FILE support])
390 AC_HELP_STRING([--disable-file],[Disable FILE support]),
391 [ case "$enableval" in
394 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
395 AC_SUBST(CURL_DISABLE_FILE, [1])
397 *) AC_MSG_RESULT(yes)
402 AC_MSG_CHECKING([whether to support ldap])
404 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
405 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
406 [ case "$enableval" in
409 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
410 AC_SUBST(CURL_DISABLE_LDAP, [1])
415 # Force no ldap. config/build process is broken for cygwin
416 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
417 AC_SUBST(CURL_DISABLE_LDAP, [1])
427 # Force no ldap. config/build process is broken for cygwin
428 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
429 AC_SUBST(CURL_DISABLE_LDAP, [1])
436 AC_MSG_CHECKING([whether to support ldaps])
438 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
439 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
440 [ case "$enableval" in
443 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
444 AC_SUBST(CURL_DISABLE_LDAPS, [1])
446 *) if test x$CURL_DISABLE_LDAP = x1 ; then
447 AC_MSG_RESULT(LDAP support needs to be enabled in order to enable LDAPS support!)
448 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
449 AC_SUBST(CURL_DISABLE_LDAPS, [1])
452 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
453 curl_ldaps_msg="enabled"
458 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
459 AC_SUBST(CURL_DISABLE_LDAPS, [1])
462 AC_MSG_CHECKING([whether to support dict])
464 AC_HELP_STRING([--enable-dict],[Enable DICT support])
465 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
466 [ case "$enableval" in
469 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
470 AC_SUBST(CURL_DISABLE_DICT, [1])
472 *) AC_MSG_RESULT(yes)
477 AC_MSG_CHECKING([whether to support telnet])
478 AC_ARG_ENABLE(telnet,
479 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
480 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
481 [ case "$enableval" in
484 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
485 AC_SUBST(CURL_DISABLE_TELNET, [1])
487 *) AC_MSG_RESULT(yes)
492 AC_MSG_CHECKING([whether to support tftp])
494 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
495 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
496 [ case "$enableval" in
499 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
500 AC_SUBST(CURL_DISABLE_TFTP, [1])
502 *) AC_MSG_RESULT(yes)
508 dnl **********************************************************************
509 dnl Check for built-in manual
510 dnl **********************************************************************
512 AC_MSG_CHECKING([whether to provide built-in manual])
513 AC_ARG_ENABLE(manual,
514 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
515 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
516 [ case "$enableval" in
520 *) AC_MSG_RESULT(yes)
527 dnl The actual use of the USE_MANUAL variable is done much later in this
528 dnl script to allow other actions to disable it as well.
530 dnl **********************************************************************
531 dnl check if this is the Intel ICC compiler, and if so make it stricter
532 dnl (convert warning 147 into an error) so that it properly can detect the
533 dnl gethostbyname_r() version
534 dnl **********************************************************************
535 CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
537 dnl **********************************************************************
538 dnl Checks for libraries.
539 dnl **********************************************************************
541 dnl gethostbyname without lib or in the nsl lib?
542 AC_CHECK_FUNC(gethostbyname,
543 [HAVE_GETHOSTBYNAME="1"
545 [ AC_CHECK_LIB(nsl, gethostbyname,
546 [HAVE_GETHOSTBYNAME="1"
551 if test "$HAVE_GETHOSTBYNAME" != "1"
553 dnl gethostbyname in the socket lib?
554 AC_CHECK_LIB(socket, gethostbyname,
555 [HAVE_GETHOSTBYNAME="1"
556 LIBS="$LIBS -lsocket"
560 dnl At least one system has been identified to require BOTH nsl and socket
561 dnl libs at the same time to link properly.
562 if test "$HAVE_GETHOSTBYNAME" != "1"
564 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
565 my_ac_save_LIBS=$LIBS
566 LIBS="-lnsl -lsocket $LIBS"
574 HAVE_GETHOSTBYNAME="1"
577 LIBS=$my_ac_save_LIBS
581 if test "$HAVE_GETHOSTBYNAME" != "1"
583 dnl This is for winsock systems
584 if test "$ac_cv_header_windows_h" = "yes"; then
585 if test "$ac_cv_header_winsock_h" = "yes"; then
588 winsock_LIB="-lwinsock"
591 winsock_LIB="-lwsock32"
595 if test "$ac_cv_header_winsock2_h" = "yes"; then
596 winsock_LIB="-lws2_32"
598 if test ! -z "$winsock_LIB"; then
599 my_ac_save_LIBS=$LIBS
600 LIBS="$winsock_LIB $LIBS"
601 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
604 #ifdef HAVE_WINDOWS_H
605 #ifndef WIN32_LEAN_AND_MEAN
606 #define WIN32_LEAN_AND_MEAN
609 #ifdef HAVE_WINSOCK2_H
610 #include <winsock2.h>
612 #ifdef HAVE_WINSOCK_H
618 gethostbyname("www.dummysite.com");
622 HAVE_GETHOSTBYNAME="1"
626 LIBS=$my_ac_save_LIBS
632 if test "$HAVE_GETHOSTBYNAME" != "1"
634 dnl This is for Minix 3.1
635 AC_MSG_CHECKING([for gethostbyname for Minix 3])
638 /* Older Minix versions may need <net/gen/netdb.h> here instead */
641 gethostbyname("www.dummysite.com");
645 HAVE_GETHOSTBYNAME="1"
651 if test "$HAVE_GETHOSTBYNAME" != "1"
653 dnl This is for eCos with a stubbed DNS implementation
654 AC_MSG_CHECKING([for gethostbyname for eCos])
660 gethostbyname("www.dummysite.com");
664 HAVE_GETHOSTBYNAME="1"
670 if test "$HAVE_GETHOSTBYNAME" != "1"
672 dnl gethostbyname in the network lib - for Haiku OS
673 AC_CHECK_LIB(network, gethostbyname,
674 [HAVE_GETHOSTBYNAME="1"
675 LIBS="$LIBS -lnetwork"
679 if test "$HAVE_GETHOSTBYNAME" != "1"
681 dnl gethostbyname in the net lib - for BeOS
682 AC_CHECK_LIB(net, gethostbyname,
683 [HAVE_GETHOSTBYNAME="1"
689 if test "$HAVE_GETHOSTBYNAME" = "1"; then
690 AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
692 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
696 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
698 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
699 AC_CHECK_LIB(resolve, strcasecmp,
700 [LIBS="-lresolve $LIBS"],
706 AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
708 dnl **********************************************************************
709 dnl In case that function clock_gettime with monotonic timer is available,
710 dnl check for additional required libraries.
711 dnl **********************************************************************
712 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
714 dnl **********************************************************************
715 dnl The preceding library checks are all potentially useful for test
716 dnl servers (for providing networking support). Save the list of required
717 dnl libraries at this point for use while linking those test servers.
718 dnl **********************************************************************
719 TEST_SERVER_LIBS=$LIBS
721 dnl **********************************************************************
722 AC_MSG_CHECKING([whether to use libgcc])
723 AC_ARG_ENABLE(libgcc,
724 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
725 [ case "$enableval" in
727 ALL_LIBS="$ALL_LIBS -lgcc"
736 dnl **********************************************************************
738 dnl **********************************************************************
741 AC_ARG_WITH(ldap-lib,
742 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
743 [LDAPLIBNAME="$withval"])
746 AC_ARG_WITH(lber-lib,
747 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
748 [LBERLIBNAME="$withval"])
750 if test x$CURL_DISABLE_LDAP != x1 ; then
752 CURL_CHECK_HEADER_LBER
753 CURL_CHECK_HEADER_LDAP
754 CURL_CHECK_HEADER_LDAPSSL
755 CURL_CHECK_HEADER_LDAP_SSL
757 if test -z "$LDAPLIBNAME" ; then
759 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
760 dnl Windows uses a single and unique OpenLDAP DLL name
761 LDAPLIBNAME="wldap32"
767 if test "$LDAPLIBNAME" ; then
768 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
769 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
770 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
771 AC_SUBST(CURL_DISABLE_LDAP, [1])])
772 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
773 AC_SUBST(CURL_DISABLE_LDAPS, [1])
775 dnl Try to find the right ldap libraries for this system
777 case X-"$curl_cv_ldap_LIBS" in
779 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
780 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
781 AC_SUBST(CURL_DISABLE_LDAP, [1])
782 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
783 AC_SUBST(CURL_DISABLE_LDAPS, [1])
789 if test x$CURL_DISABLE_LDAP != x1 ; then
791 if test "$LBERLIBNAME" ; then
792 dnl If name is "no" then don't define this library at all
793 dnl (it's only needed if libldap.so's dependencies are broken).
794 if test "$LBERLIBNAME" != "no" ; then
795 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
796 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
797 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
798 AC_SUBST(CURL_DISABLE_LDAP, [1])])
799 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
800 AC_SUBST(CURL_DISABLE_LDAPS, [1])
805 if test x$CURL_DISABLE_LDAP != x1 ; then
806 AC_CHECK_FUNCS([ldap_url_parse])
808 if test "$LDAPLIBNAME" = "wldap32"; then
809 curl_ldap_msg="enabled (winldap)"
810 AC_DEFINE(CURL_LDAP_WIN, 1, [Use W$ LDAP implementation])
812 *-*-cygwin* | *-*-pw32*)
813 AC_DEFINE(CURL_LDAP_HYBRID, 1, [W$ LDAP with non-W$ compiler])
817 curl_ldap_msg="enabled (OpenLDAP)"
821 dnl **********************************************************************
823 dnl **********************************************************************
825 AC_MSG_CHECKING([whether to enable ipv6])
827 AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
828 AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
829 [ case "$enableval" in
834 *) AC_MSG_RESULT(yes)
839 AC_TRY_RUN([ /* is AF_INET6 available? */
840 #include <sys/types.h>
841 #include <sys/socket.h>
844 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
858 if test "$ipv6" = "yes"; then
859 curl_ipv6_msg="enabled"
862 dnl **********************************************************************
863 dnl Check how non-blocking sockets are set
864 dnl **********************************************************************
865 AC_ARG_ENABLE(nonblocking,
866 AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
867 AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
869 if test "$enableval" = "no" ; then
870 AC_MSG_WARN([non-blocking sockets disabled])
871 AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
872 [to disable NON-BLOCKING connections])
874 CURL_CHECK_NONBLOCKING_SOCKET
878 CURL_CHECK_NONBLOCKING_SOCKET
881 dnl **********************************************************************
882 dnl Check if the operating system allows programs to write to their own argv[]
883 dnl **********************************************************************
885 AC_MSG_CHECKING([if argv can be written to])
886 AC_CACHE_VAL(curl_cv_writable_argv, [
888 int main(int argc, char ** argv) {
890 return (argv[0][0] == ' ')?0:1;
893 curl_cv_writable_argv=yes,
894 curl_cv_writable_argv=no,
895 curl_cv_writable_argv=cross)
897 case $curl_cv_writable_argv in
899 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
907 AC_MSG_WARN([the previous check could not be made default was used])
911 dnl **********************************************************************
912 dnl Check for the presence of Kerberos4 libraries and headers
913 dnl **********************************************************************
915 AC_ARG_WITH(krb4-includes,
916 AC_HELP_STRING([--with-krb4-includes=DIR],
917 [Specify location of kerberos4 headers]),[
918 CPPFLAGS="$CPPFLAGS -I$withval"
923 AC_ARG_WITH(krb4-libs,
924 AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
925 LDFLAGS="$LDFLAGS -L$withval"
933 AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
935 if test X"$OPT_KRB4" != Xno; then
937 if test X"$OPT_KRB4" != Xyes; then
938 LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
939 KRB4LIB="$OPT_KRB4/lib$libsuff"
940 CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
941 KRB4INC="$OPT_KRB4/include"
946 AC_MSG_CHECKING([if Kerberos4 support is requested])
948 if test "$want_krb4" = yes
950 if test "$ipv6" = "yes"; then
951 echo krb4 is not compatible with IPv6
956 dnl Check for & handle argument to --with-krb4
958 AC_MSG_CHECKING(where to look for Kerberos4)
959 if test X"$OPT_KRB4" = Xyes
961 AC_MSG_RESULT([defaults])
963 AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
966 dnl Check for DES library
967 AC_CHECK_LIB(des, des_pcbc_encrypt,
969 AC_CHECK_HEADERS(des.h)
972 AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
974 dnl Check for the Kerberos4 library
975 AC_CHECK_LIB(krb, krb_net_read,
977 dnl Check for header files
978 AC_CHECK_HEADERS(krb.h)
980 dnl we found the required libraries, add to LIBS
981 LIBS="-lkrb -lcom_err -ldes $LIBS"
983 dnl Check for function krb_get_our_ip_for_realm
984 dnl this is needed for NAT networks
985 AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
988 AC_DEFINE(HAVE_KRB4, 1,
989 [if you have the Kerberos4 libraries (including -ldes)])
991 dnl substitute it too!
993 AC_SUBST(KRB4_ENABLED)
995 curl_krb4_msg="enabled"
997 dnl the krb4 stuff needs a strlcpy()
998 AC_CHECK_FUNCS(strlcpy)
1006 dnl **********************************************************************
1007 dnl Check for FBopenssl(SPNEGO) libraries
1008 dnl **********************************************************************
1011 AC_HELP_STRING([--with-spnego=DIR],
1012 [Specify location of SPNEGO library fbopenssl]), [
1013 SPNEGO_ROOT="$withval"
1014 if test x"$SPNEGO_ROOT" != xno; then
1019 AC_MSG_CHECKING([if SPNEGO support is requested])
1020 if test x"$want_spnego" = xyes; then
1022 if test X"$SPNEGO_ROOT" = Xyes; then
1023 AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
1026 if test -z "$SPNEGO_LIB_DIR"; then
1027 LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
1029 LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
1033 AC_DEFINE(HAVE_SPNEGO, 1,
1034 [Define this if you have the SPNEGO library fbopenssl])
1035 curl_spnego_msg="enabled"
1041 dnl **********************************************************************
1042 dnl Check for GSS-API libraries
1043 dnl **********************************************************************
1045 dnl check for gss stuff in the /usr as default
1048 AC_ARG_WITH(gssapi-includes,
1049 AC_HELP_STRING([--with-gssapi-includes=DIR],
1050 [Specify location of GSSAPI header]),
1051 [ GSSAPI_INCS="-I$withval"
1055 AC_ARG_WITH(gssapi-libs,
1056 AC_HELP_STRING([--with-gssapi-libs=DIR],
1057 [Specify location of GSSAPI libs]),
1058 [ GSSAPI_LIB_DIR="-L$withval"
1063 AC_HELP_STRING([--with-gssapi=DIR],
1064 [Where to look for GSSAPI]), [
1065 GSSAPI_ROOT="$withval"
1066 if test x"$GSSAPI_ROOT" != xno; then
1068 if test x"$GSSAPI_ROOT" = xyes; then
1069 dnl if yes, then use default root
1075 save_CPPFLAGS="$CPPFLAGS"
1076 AC_MSG_CHECKING([if GSSAPI support is requested])
1077 if test x"$want_gss" = xyes; then
1080 if test -z "$GSSAPI_INCS"; then
1081 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1082 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
1083 GSSAPI_LIBS=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1084 elif test "$GSSAPI_ROOT" != "yes"; then
1085 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1086 GSSAPI_LIBS="-lgssapi"
1090 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1091 LIBS="$LIBS $GSSAPI_LIBS"
1093 AC_CHECK_HEADER(gss.h,
1095 dnl found in the given dirs
1096 AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
1100 dnl not found, check Heimdal or MIT
1102 [gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1105 if test "x$not_mit" = "x1"; then
1106 dnl MIT not found, check for Heimdal
1107 AC_CHECK_HEADER(gssapi.h,
1110 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
1113 dnl no header found, disabling GSS
1115 AC_MSG_WARN(disabling GSSAPI since no header files was found)
1120 AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
1121 dnl check if we have a really old MIT kerberos (<= 1.2)
1122 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1125 #include <gssapi/gssapi.h>
1126 #include <gssapi/gssapi_generic.h>
1127 #include <gssapi/gssapi_krb5.h>
1132 GSS_C_NT_HOSTBASED_SERVICE,
1136 AC_MSG_RESULT([yes])
1139 AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1140 [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1148 if test x"$want_gss" = xyes; then
1149 AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
1151 curl_gss_msg="enabled (MIT/Heimdal)"
1153 if test -n "$gnu_gss"; then
1154 curl_gss_msg="enabled (GNU GSS)"
1155 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1157 elif test -z "$GSSAPI_LIB_DIR"; then
1158 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1159 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1161 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1162 LIBS="$LIBS $gss_libs"
1163 elif test "$GSSAPI_ROOT" != "yes"; then
1164 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1165 LIBS="$LIBS -lgssapi"
1167 LIBS="$LIBS -lgssapi"
1170 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1171 LIBS="$LIBS -lgssapi"
1174 CPPFLAGS="$save_CPPFLAGS"
1177 dnl **********************************************************************
1178 dnl Check for the presence of SSL libraries and headers
1179 dnl **********************************************************************
1181 dnl Default to compiler & linker defaults for SSL files & libraries.
1183 dnl Default to no CA bundle
1186 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])
1187 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1190 if test X"$OPT_SSL" != Xno; then
1191 dnl backup the pre-ssl variables
1192 CLEANLDFLAGS="$LDFLAGS"
1193 CLEANCPPFLAGS="$CPPFLAGS"
1198 dnl --with-ssl (without path) used
1199 if test x$cross_compiling != xyes; then
1200 dnl only do pkg-config magic when not cross-compiling
1203 PREFIX_OPENSSL=/usr/local/ssl
1204 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1207 dnl no --with-ssl option given, just check default places
1208 if test x$cross_compiling != xyes; then
1209 dnl only do pkg-config magic when not cross-compiling
1215 dnl check the given --with-ssl spot
1217 PREFIX_OPENSSL=$OPT_SSL
1218 LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1219 LDFLAGS="$LDFLAGS -L$LIB_OPENSSL"
1220 CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1224 if test "$PKGTEST" = "yes"; then
1226 dnl Detect the pkg-config tool, as it may have extra info about the
1227 dnl openssl installation we can use. I *believe* this is what we are
1228 dnl expected to do on really recent Redhat Linux hosts.
1230 AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
1231 if test "$PKGCONFIG" != "no" ; then
1232 AC_MSG_CHECKING([OpenSSL options with pkg-config])
1234 $PKGCONFIG --exists openssl
1237 if test "$SSL_EXISTS" -eq "0"; then
1238 SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
1239 SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
1240 SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1242 LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1244 dnl use the values pkg-config reported
1245 LIBS="$LIBS $SSL_LIBS"
1246 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1247 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1248 AC_MSG_RESULT([found])
1255 AC_CHECK_LIB(crypto, CRYPTO_lock,[
1257 LIBS="-lcrypto $LIBS"
1259 LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1260 CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1261 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
1263 LIBS="-lcrypto $LIBS"], [
1264 LDFLAGS="$CLEANLDFLAGS"
1265 CPPFLAGS="$CLEANCPPFLAGS"
1271 if test X"$HAVECRYPTO" = X"yes"; then
1272 dnl This is only reasonable to do if crypto actually is there: check for
1273 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1275 AC_CHECK_LIB(ssl, SSL_connect)
1277 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1278 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1279 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1281 LIBS="$LIBS -lRSAglue -lrsaref"
1282 AC_CHECK_LIB(ssl, SSL_connect)
1283 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1284 dnl still no SSL_connect
1293 dnl Have the libraries--check for SSLeay/OpenSSL headers
1294 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1295 openssl/pem.h openssl/ssl.h openssl/err.h,
1296 curl_ssl_msg="enabled (OpenSSL)"
1298 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1300 if test $ac_cv_header_openssl_x509_h = no; then
1301 dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1302 dnl since 'err.h' might in fact find a krb4 header with the same
1304 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1306 if test $ac_cv_header_x509_h = yes &&
1307 test $ac_cv_header_crypto_h = yes &&
1308 test $ac_cv_header_ssl_h = yes; then
1310 curl_ssl_msg="enabled (OpenSSL)"
1316 if test X"$OPENSSL_ENABLED" = X"1"; then
1317 AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
1319 dnl is there a pkcs12.h header present?
1320 AC_CHECK_HEADERS(openssl/pkcs12.h)
1324 dnl USE_SSLEAY is the historical name for what configure calls
1325 dnl OPENSSL_ENABLED; the names should really be unified
1326 USE_SSLEAY="$OPENSSL_ENABLED"
1327 AC_SUBST(USE_SSLEAY)
1329 if test X"$OPT_SSL" != Xoff &&
1330 test "$OPENSSL_ENABLED" != "1"; then
1331 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1335 if test X"$OPENSSL_ENABLED" = X"1"; then
1336 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
1337 dnl stuff, it is kind of "separated" from the main SSL check
1338 AC_CHECK_FUNC(ENGINE_init,
1340 AC_CHECK_HEADERS(openssl/engine.h)
1341 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
1344 dnl these can only exist if openssl exists
1345 dnl yassl doesn't have SSL_get_shutdown
1347 AC_CHECK_FUNCS( RAND_status \
1350 CRYPTO_cleanup_all_ex_data \
1353 dnl Make an attempt to detect if this is actually yassl's headers and
1354 dnl OpenSSL emulation layer. We still leave everything else believing
1355 dnl and acting like OpenSSL.
1357 AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
1360 #include <openssl/ssl.h>
1362 #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
1363 int dummy = SSL_ERROR_NONE;
1365 Not the yaSSL OpenSSL compatibility header.
1369 AC_MSG_RESULT([yes])
1370 AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
1371 [Define to 1 if using yaSSL in OpenSSL compatibility mode.])
1372 curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
1378 if test "$OPENSSL_ENABLED" = "1"; then
1379 if test -n "$LIB_OPENSSL"; then
1380 dnl when the ssl shared libs were found in a path that the run-time
1381 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1382 dnl to prevent further configure tests to fail due to this
1384 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
1385 export LD_LIBRARY_PATH
1386 AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
1392 dnl **********************************************************************
1393 dnl Check for the presence of ZLIB libraries and headers
1394 dnl **********************************************************************
1396 dnl Check for & handle argument to --with-zlib.
1401 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1402 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
1403 [OPT_ZLIB="$withval"])
1405 if test "$OPT_ZLIB" = "no" ; then
1406 AC_MSG_WARN([zlib disabled])
1408 if test "$OPT_ZLIB" = "yes" ; then
1412 if test -z "$OPT_ZLIB" ; then
1413 dnl check for the lib first without setting any new path, since many
1414 dnl people have it in the default path
1416 AC_CHECK_LIB(z, inflateEnd,
1417 dnl libz found, set the variable
1419 dnl if no lib found, try /usr/local
1420 [OPT_ZLIB="/usr/local"])
1424 dnl Add a nonempty path to the compiler flags
1425 if test -n "$OPT_ZLIB"; then
1426 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1427 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1430 AC_CHECK_HEADER(zlib.h,
1432 dnl zlib.h was found
1434 dnl if the lib wasn't found already, try again with the new paths
1435 if test "$HAVE_LIBZ" != "1"; then
1436 AC_CHECK_LIB(z, gzread,
1438 dnl the lib was found!
1441 [ CPPFLAGS=$_cppflags
1446 dnl zlib.h was not found, restore the flags
1451 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1453 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1455 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1457 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1458 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1460 dnl both header and lib were found!
1462 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1463 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1465 CURL_LIBS="$CURL_LIBS -lz"
1468 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1470 AC_MSG_NOTICE([found both libz and libz.h header])
1471 curl_zlib_msg="enabled"
1475 dnl set variable for use in automakefile(s)
1476 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1478 dnl **********************************************************************
1479 dnl Check for the presence of LIBSSH2 libraries and headers
1480 dnl **********************************************************************
1482 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
1484 AC_ARG_WITH(libssh2,dnl
1485 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])
1486 AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
1487 OPT_LIBSSH2=$withval)
1489 if test X"$OPT_LIBSSH2" != Xno; then
1490 dnl backup the pre-libssh2 variables
1491 CLEANLDFLAGS="$LDFLAGS"
1492 CLEANCPPFLAGS="$CPPFLAGS"
1495 case "$OPT_LIBSSH2" in
1497 dnl --with-libssh2 (without path) used
1498 PREFIX_LIBSSH2=/usr/local/lib
1499 LIB_LIBSSH2="$PREFIX_LIBSSH2$libsuff"
1502 dnl no --with-libssh2 option given, just check default places
1506 dnl use the given --with-libssh2 spot
1507 PREFIX_LIBSSH2=$OPT_LIBSSH2
1508 LIB_LIBSSH2="$PREFIX_LIBSSH2/lib$libsuff"
1509 LDFLAGS="$LDFLAGS -L$LIB_LIBSSH2"
1510 CPPFLAGS="$CPPFLAGS -I$PREFIX_LIBSSH2/include"
1514 AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
1516 AC_CHECK_HEADERS(libssh2.h,
1517 curl_ssh_msg="enabled (libSSH2)"
1519 AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
1520 AC_SUBST(USE_LIBSSH2, [1])
1523 if test X"$OPT_LIBSSH2" != Xoff &&
1524 test "$LIBSSH2_ENABLED" != "1"; then
1525 AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
1528 if test "$LIBSSH2_ENABLED" = "1"; then
1529 if test -n "$LIB_LIBSSH2"; then
1530 dnl when the libssh2 shared libs were found in a path that the run-time
1531 dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1532 dnl to prevent further configure tests to fail due to this
1534 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_LIBSSH2"
1535 export LD_LIBRARY_PATH
1536 AC_MSG_NOTICE([Added $LIB_LIBSSH2 to LD_LIBRARY_PATH])
1541 dnl **********************************************************************
1542 dnl Check for the random seed preferences
1543 dnl **********************************************************************
1545 if test X"$OPENSSL_ENABLED" = X"1"; then
1546 AC_ARG_WITH(egd-socket,
1547 AC_HELP_STRING([--with-egd-socket=FILE],
1548 [Entropy Gathering Daemon socket pathname]),
1549 [ EGD_SOCKET="$withval" ]
1551 if test -n "$EGD_SOCKET" ; then
1552 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1553 [your Entropy Gathering Daemon socket pathname] )
1556 dnl Check for user-specified random device
1558 AC_HELP_STRING([--with-random=FILE],
1559 [read randomness from FILE (default=/dev/urandom)]),
1560 [ RANDOM_FILE="$withval" ],
1562 dnl Check for random device
1563 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1566 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1567 AC_SUBST(RANDOM_FILE)
1568 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1569 [a suitable file to read random data from])
1573 dnl ----------------------------------------------------
1574 dnl FIX: only check for GnuTLS if OpenSSL is not enabled
1575 dnl ----------------------------------------------------
1577 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1580 AC_ARG_WITH(gnutls,dnl
1581 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
1582 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1583 OPT_GNUTLS=$withval)
1585 if test "$OPENSSL_ENABLED" != "1"; then
1587 if test X"$OPT_GNUTLS" != Xno; then
1588 if test "x$OPT_GNUTLS" = "xyes"; then
1589 check=`libgnutls-config --version 2>/dev/null`
1590 if test -n "$check"; then
1591 addlib=`libgnutls-config --libs`
1592 addcflags=`libgnutls-config --cflags`
1593 version=`libgnutls-config --version`
1594 gtlsprefix=`libgnutls-config --prefix`
1597 addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
1598 addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
1599 version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
1600 gtlsprefix=$OPT_GNUTLS
1601 if test -z "$version"; then
1605 if test -n "$addlib"; then
1608 CLEANCPPFLAGS="$CPPFLAGS"
1610 LIBS="$LIBS $addlib"
1611 if test "$addcflags" != "-I/usr/include"; then
1612 CPPFLAGS="$CPPFLAGS $addcflags"
1615 AC_CHECK_LIB(gnutls, gnutls_check_version,
1617 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1618 AC_SUBST(USE_GNUTLS, [1])
1621 curl_ssl_msg="enabled (GnuTLS)"
1625 CPPFLAGS="$CLEANCPPFLAGS"
1628 if test "x$USE_GNUTLS" = "xyes"; then
1629 AC_MSG_NOTICE([detected GnuTLS version $version])
1631 dnl when shared libs were found in a path that the run-time
1632 dnl linker doesn't search through, we need to add it to
1633 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1636 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
1637 export LD_LIBRARY_PATH
1638 AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH])
1643 fi dnl GNUTLS not disabled
1647 dnl ----------------------------------------------------
1648 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
1649 dnl ----------------------------------------------------
1651 dnl Default to compiler & linker defaults for NSS files & libraries.
1655 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root (default: /usr/local/)])
1656 AC_HELP_STRING([--without-nss], [disable NSS detection]),
1659 if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
1661 if test X"$OPT_NSS" != Xno; then
1662 if test "x$OPT_NSS" = "xyes"; then
1663 check=`pkg-config --version 2>/dev/null`
1664 if test -n "$check"; then
1665 addlib=`pkg-config --libs nss`
1666 addcflags=`pkg-config --cflags nss`
1667 version=`pkg-config --modversion nss`
1668 nssprefix=`pkg-config --variable=prefix nss`
1671 # Without pkg-config, we'll kludge in some defaults
1672 addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
1673 addcflags="-I$OPT_NSS/include"
1675 gtlsprefix=$OPT_GNUTLS
1678 dnl Check for functionPK11_CreateGenericObject
1679 dnl this is needed for using the PEM PKCS#11 module
1680 AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
1682 AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject])
1683 AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1])
1685 if test -n "$addlib"; then
1688 CLEANCPPFLAGS="$CPPFLAGS"
1690 LIBS="$LIBS $addlib"
1691 if test "$addcflags" != "-I/usr/include"; then
1692 CPPFLAGS="$CPPFLAGS $addcflags"
1695 AC_CHECK_LIB(nss3, NSS_Initialize,
1697 AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
1698 AC_SUBST(USE_NSS, [1])
1701 curl_ssl_msg="enabled (NSS)"
1705 CPPFLAGS="$CLEANCPPFLAGS"
1708 if test "x$USE_NSS" = "xyes"; then
1709 AC_MSG_NOTICE([detected NSS version $version])
1711 dnl when shared libs were found in a path that the run-time
1712 dnl linker doesn't search through, we need to add it to
1713 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1716 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
1717 export LD_LIBRARY_PATH
1718 AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
1723 fi dnl NSS not disabled
1725 fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
1727 if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
1728 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
1729 AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
1731 # SSL is enabled, genericly
1732 AC_SUBST(SSL_ENABLED)
1736 dnl **********************************************************************
1737 dnl Check for the CA bundle
1738 dnl **********************************************************************
1740 CURL_CHECK_CA_BUNDLE
1742 dnl **********************************************************************
1743 dnl Check for the presence of IDN libraries and headers
1744 dnl **********************************************************************
1746 AC_MSG_CHECKING([whether to build with libidn])
1748 AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
1749 AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
1750 [LIBIDN="$withval"])
1756 *) AC_MSG_RESULT(yes)
1759 dnl if there is a given path, check that FIRST
1760 if test -n "$LIBIDN"; then
1761 if test "x$LIBIDN" != "xyes"; then
1763 oldCPPFLAGS=$CPPFLAGS
1764 LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
1765 CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
1767 AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
1770 CPPFLAGS=$oldCPPFLAGS)
1774 if test "x$idn" != "xyes"; then
1775 dnl check with default paths
1777 AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
1781 if test "x$idn" = "xyes"; then
1782 curl_idn_msg="enabled"
1783 AC_SUBST(IDN_ENABLED, [1])
1784 dnl different versions of libidn have different setups of these:
1785 AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
1786 AC_CHECK_HEADERS( idn-free.h tld.h )
1792 dnl Default is to try the thread-safe versions of a few functions
1795 dnl detect AIX 4.3 or later
1796 dnl see full docs on this reasoning in the lib/hostip.c source file
1797 AC_MSG_CHECKING([AIX 4.3 or later])
1799 #if defined(_AIX) && defined(_AIX43)
1800 printf("just fine");
1802 #error "this is not AIX 4.3 or later"
1805 [ AC_MSG_RESULT([yes])
1808 [ AC_MSG_RESULT([no]) ]
1811 AC_ARG_ENABLE(thread,dnl
1812 AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
1813 AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
1814 [ case "$enableval" in
1817 AC_MSG_WARN(libcurl will not get built using thread-safe functions)
1825 if test X"$OPT_THREAD" = Xoff
1827 AC_DEFINE(DISABLED_THREADSAFE, 1,
1828 [Set to explicitly specify we don't want to use thread-safe functions])
1830 if test "$ipv6" != "yes"; then
1831 dnl dig around for gethostbyname_r()
1832 CURL_CHECK_GETHOSTBYNAME_R()
1834 dnl dig around for gethostbyaddr_r()
1835 dnl CURL_CHECK_GETHOSTBYADDR_R()
1838 dnl poke around for inet_ntoa_r()
1839 CURL_CHECK_INET_NTOA_R()
1841 dnl is there a localtime_r()
1842 CURL_CHECK_LOCALTIME_R()
1844 dnl is there a strerror_r()
1845 CURL_CHECK_STRERROR_R()
1847 checkfor_gmtime_r="yes"
1850 dnl for recent AIX versions, we skip all the thread-safe checks above since
1851 dnl they claim a thread-safe libc using the standard API. But there are
1852 dnl some functions still not thread-safe. Check for these!
1854 dnl Let's hope this split URL remains working:
1855 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
1856 dnl genprogc/thread_quick_ref.htm
1858 if test "x$RECENTAIX" = "xyes"; then
1860 AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
1862 dnl is there a localtime_r()
1863 CURL_CHECK_LOCALTIME_R()
1865 dnl is there a strerror_r()
1866 CURL_CHECK_STRERROR_R()
1868 checkfor_gmtime_r="yes"
1871 if test x$cross_compiling != xyes; then
1873 if test x$checkfor_gmtime_r = xyes; then
1875 dnl if gmtime_r was found, verify that it actually works, as (at least) HPUX
1876 dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
1879 AC_MSG_CHECKING([if gmtime_r exists and works])
1884 time_t local = 1170352587;
1887 putenv("TZ=CST6CDT");
1889 gmt = gmtime_r(&local, &keeper);
1893 return 1; /* failure */
1896 dnl success, do nothing
1898 AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r])
1900 dnl failure, now disable the function
1903 dnl not invoked when crosscompiling)
1908 dnl and for crosscompiling
1909 AC_CHECK_FUNCS(gmtime_r)
1913 dnl **********************************************************************
1914 dnl Back to "normal" configuring
1915 dnl **********************************************************************
1917 dnl Checks for header files.
1920 CURL_CHECK_HEADER_MALLOC
1922 dnl Now check for the very most basic headers. Then we can use these
1923 dnl ones as default-headers when checking for the rest!
1963 dnl to do if not found
1967 dnl default includes
1969 #ifdef HAVE_SYS_TYPES_H
1970 #include <sys/types.h>
1972 #ifdef HAVE_SYS_TIME_H
1973 #include <sys/time.h>
1975 #ifdef HAVE_SYS_SELECT_H
1976 #include <sys/select.h>
1978 #ifdef HAVE_SYS_SOCKET_H
1979 #include <sys/socket.h>
1981 #ifdef HAVE_NETINET_IN_H
1982 #include <netinet/in.h>
1984 #ifdef HAVE_SYS_UN_H
1990 dnl Checks for typedefs, structures, and compiler characteristics.
1992 CURL_CHECK_VARIADIC_MACROS
1995 CURL_CHECK_STRUCT_TIMEVAL
1996 CURL_VERIFY_RUNTIMELIBS
1998 AC_CHECK_SIZEOF(size_t)
1999 AC_CHECK_SIZEOF(int)
2000 AC_CHECK_SIZEOF(long)
2002 AC_CHECK_SIZEOF(time_t)
2003 AC_CHECK_SIZEOF(off_t)
2006 if test x"$ac_cv_native_windows" != "xyes" &&
2007 test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
2008 AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
2009 AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
2014 AC_CHECK_TYPE(long long,
2015 [AC_DEFINE(HAVE_LONGLONG, 1,
2016 [Define to 1 if the compiler supports the 'long long' data type.])]
2020 if test "xyes" = "x$longlong"; then
2021 AC_MSG_CHECKING([if numberLL works])
2022 AC_COMPILE_IFELSE([long long val = 1000LL;],
2023 [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
2031 AC_CHECK_TYPE(ssize_t, ,
2032 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
2034 # check for bool type
2035 AC_CHECK_TYPE([bool],[
2036 AC_DEFINE(HAVE_BOOL_T, 1,
2037 [Define to 1 if bool is an available type.])
2039 #ifdef HAVE_SYS_TYPES_H
2040 #include <sys/types.h>
2042 #ifdef HAVE_STDBOOL_H
2043 #include <stdbool.h>
2047 # Check for socklen_t or equivalent
2048 CURL_CHECK_TYPE_SOCKLEN_T
2052 TYPE_SOCKADDR_STORAGE
2058 CURL_CHECK_FUNC_SELECT
2060 CURL_CHECK_FUNC_RECV
2061 CURL_CHECK_FUNC_RECVFROM
2062 CURL_CHECK_FUNC_SEND
2063 CURL_CHECK_MSG_NOSIGNAL
2065 dnl Checks for library functions.
2066 dnl AC_PROG_GCC_TRADITIONAL
2073 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
2077 AC_CHECK_FUNCS([basename \
2117 eval skipcheck=\$skipcheck_$func
2118 if test "x$skipcheck" != "xyes"; then
2119 AC_MSG_CHECKING([deeper for $func])
2126 AC_MSG_RESULT([yes])
2127 eval "ac_cv_func_$func=yes"
2128 AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$func])], [1],
2129 [Define to 1 if you have the $func function.])
2131 AC_MSG_RESULT([but still no])
2137 dnl sigsetjmp() might be a macro and no function so if it isn't found already
2138 dnl we make an extra check here!
2139 if test "$ac_cv_func_sigsetjmp" != "yes"; then
2140 AC_MSG_CHECKING([for sigsetjmp defined as macro])
2146 sigsetjmp(jmpenv, 1);
2149 AC_MSG_RESULT([yes])
2150 AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp])
2156 AC_CHECK_DECL(basename, ,
2157 AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
2158 #ifdef HAVE_STRING_H
2161 #ifdef HAVE_LIBGEN_H
2164 #ifdef HAVE_UNISTD_H
2169 AC_CHECK_DECL(inet_pton, ,
2170 AC_DEFINE(HAVE_NO_INET_PTON_PROTO, 1,
2171 [Defined if no inet_pton() prototype available]),
2173 #ifdef HAVE_ARPA_INET_H
2174 #include <arpa/inet.h>
2179 dnl Check if the getnameinfo function is available
2180 dnl and get the types of five of its arguments.
2181 CURL_CHECK_FUNC_GETNAMEINFO
2183 if test "$ipv6" = "yes"; then
2184 CURL_CHECK_WORKING_GETADDRINFO
2185 CURL_CHECK_NI_WITHSCOPEID
2188 AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
2197 AC_MSG_RESULT($disable_poll)
2199 if test "$disable_poll" = "no"; then
2201 dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
2202 dnl to find out we make an extra check here!
2203 if test "$ac_cv_func_poll" = "yes"; then
2204 AC_MSG_CHECKING([if poll works with NULL inputs])
2206 #ifdef HAVE_SYS_POLL_H
2207 #include <sys/poll.h>
2208 #elif defined(HAVE_POLL_H)
2214 /* make this return 0 == timeout since there's nothing to read from */
2215 return poll((void *)0, 0, 10 /*ms*/);
2219 AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
2221 AC_MSG_RESULT(cross-compiling assumes yes)
2222 AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
2223 ) dnl end of AC_RUN_IFELSE
2224 fi dnl poll() was found
2225 fi dnl poll()-check is not disabled
2228 AC_PATH_PROG( PERL, perl, ,
2229 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
2232 AC_PATH_PROGS( NROFF, gnroff nroff, ,
2233 $PATH:/usr/bin/:/usr/local/bin )
2236 if test -n "$NROFF"; then
2237 dnl only check for nroff options if an nroff command was found
2239 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
2241 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2242 if test -z "$mancheck"; then
2244 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2245 if test -z "$mancheck"; then
2247 AC_MSG_RESULT([failed])
2248 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
2250 AC_MSG_RESULT([$MANOPT])
2253 AC_MSG_RESULT([$MANOPT])
2258 if test -z "$MANOPT"
2260 dnl if no nroff tool was found, or no option that could convert man pages
2261 dnl was found, then disable the built-in manual stuff
2262 AC_MSG_WARN([disabling built-in manual])
2266 dnl *************************************************************************
2267 dnl If the manual variable still is set, then we go with providing a built-in
2270 if test "$USE_MANUAL" = "1"; then
2271 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
2272 curl_manual_msg="enabled"
2275 dnl set variable for use in automakefile(s)
2276 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
2278 AC_MSG_CHECKING([whether to enable c-ares])
2280 AC_HELP_STRING([--enable-ares=PATH],[Enable c-ares for name lookups])
2281 AC_HELP_STRING([--disable-ares],[Disable c-ares for name lookups]),
2282 [ case "$enableval" in
2286 *) AC_MSG_RESULT(yes)
2288 if test "x$IPV6_ENABLED" = "x1"; then
2289 AC_MSG_NOTICE([c-ares may not work properly with ipv6])
2292 AC_DEFINE(USE_ARES, 1, [Define if you want to enable c-ares support])
2293 dnl substitute HAVE_ARES for curl-config and similar
2296 curl_ares_msg="enabled"
2298 LIBS="-lcares $LIBS"
2300 dnl For backwards compatibility default to includes/lib in srcdir/ares
2301 dnl If a value is specified it is assumed that the libs are in $val/lib
2302 dnl and the includes are in $val/include. This is the default setup for
2303 dnl ares so it should not be a problem.
2304 if test "x$enableval" = "xyes" ; then
2305 if test -d "$srcdir/ares"; then
2307 AC_CONFIG_SUBDIRS(ares)
2308 aresinc=`cd $srcdir/ares && pwd`
2309 CPPFLAGS="$CPPFLAGS -I$aresinc"
2311 dnl the pwd= below cannot 'cd' into the ares dir to get the full
2312 dnl path to it, since it may not exist yet if we build outside of
2315 LDFLAGS="$LDFLAGS -L$pwd/ares"
2318 CPPFLAGS="$CPPFLAGS -I$enableval/include"
2319 LDFLAGS="$LDFLAGS -L$enableval/lib"
2322 if test -z "$aresembedded"; then
2323 dnl verify that a sufficient c-ares is here if we have pointed one
2324 dnl out and don't use the "embedded" ares dir (in which case we don't
2325 dnl check it because it might not have been built yet)
2326 AC_MSG_CHECKING([that c-ares is good and recent enough])
2330 /* set of dummy functions in case c-ares was built with debug */
2331 void curl_dofree() { }
2332 void curl_sclose() { }
2333 void curl_domalloc() { }
2334 void curl_docalloc() { }
2335 void curl_socket() { }
2337 ares_channel channel;
2338 ares_cancel(channel); /* added in 1.2.0 */
2339 ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
2342 AC_MSG_RESULT([yes])
2345 AC_MSG_ERROR([c-ares library defective or too old])
2353 dnl ************************************************************
2354 dnl disable verbose text strings
2356 AC_MSG_CHECKING([whether to enable verbose strings])
2357 AC_ARG_ENABLE(verbose,
2358 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
2359 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
2360 [ case "$enableval" in
2363 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
2364 curl_verbose_msg="no"
2366 *) AC_MSG_RESULT(yes)
2372 dnl ************************************************************
2373 dnl enable SSPI support
2375 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
2377 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
2378 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
2379 [ case "$enableval" in
2381 if test "$ac_cv_native_windows" = "yes"; then
2383 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
2384 AC_SUBST(USE_WINDOWS_SSPI, [1])
2388 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
2398 dnl ************************************************************
2399 dnl lame option to switch on debug options
2401 AC_MSG_CHECKING([whether to enable debug options])
2402 AC_ARG_ENABLE(debug,
2403 AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
2404 AC_HELP_STRING([--disable-debug],[Disable debug options]),
2405 [ case "$enableval" in
2409 *) AC_MSG_RESULT(yes)
2411 CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
2414 dnl set compiler "debug" options to become more picky, and remove
2415 dnl optimize options from CFLAGS
2423 dnl ************************************************************
2424 dnl disable cryptographic authentication
2426 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
2427 AC_ARG_ENABLE(crypto-auth,
2428 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
2429 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
2430 [ case "$enableval" in
2433 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
2435 *) AC_MSG_RESULT(yes)
2441 dnl ************************************************************
2442 dnl disable cookies support
2444 AC_MSG_CHECKING([whether to enable support for cookies])
2445 AC_ARG_ENABLE(cookies,
2446 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
2447 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
2448 [ case "$enableval" in
2451 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
2453 *) AC_MSG_RESULT(yes)
2459 dnl ************************************************************
2460 dnl Enable hiding of internal symbols in library to reduce its size and
2461 dnl speed dynamic linking of applications. This currently is only supported
2462 dnl on gcc >= 4.0 and SunPro C.
2464 AC_MSG_CHECKING([whether to enable hidden symbols in the library])
2465 AC_ARG_ENABLE(hidden-symbols,
2466 AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
2467 AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
2468 [ case "$enableval" in
2473 AC_MSG_CHECKING([whether $CC supports it])
2474 if test "$GCC" = yes ; then
2475 if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
2477 AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2478 AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
2479 CFLAGS="$CFLAGS -fvisibility=hidden"
2485 dnl Test for SunPro cc
2486 if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
2488 AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2489 AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
2490 CFLAGS="$CFLAGS -xldscope=hidden"
2500 dnl ************************************************************
2501 dnl enforce SONAME bump
2504 AC_MSG_CHECKING([whether to enforce SONAME bump])
2505 AC_ARG_ENABLE(soname-bump,
2506 AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
2507 AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
2508 [ case "$enableval" in
2509 yes) AC_MSG_RESULT(yes)
2516 AC_MSG_RESULT($soname_bump)
2518 AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
2521 dnl ************************************************************
2522 if test ! -z "$winsock_LIB"; then
2524 dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
2525 dnl things work when built with c-ares). But we can't just move it last
2526 dnl since then other stuff (SSL) won't build. So we simply append it to the
2529 LIBS="$LIBS $winsock_LIB"
2530 TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
2535 dnl All the library dependencies put into $LIB apply to libcurl only.
2536 dnl Those in $CURL_LIBS apply to the curl command-line client only.
2537 dnl Those in $TEST_SERVER_LIBS apply to test servers only.
2538 dnl Those in $ALL_LIBS apply to all targets, including test targets.
2542 AC_SUBST(LIBCURL_LIBS)
2544 AC_SUBST(TEST_SERVER_LIBS)
2545 LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
2547 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
2549 AC_CONFIG_FILES([Makefile \
2551 docs/examples/Makefile \
2552 docs/libcurl/Makefile \
2554 include/curl/Makefile \
2558 tests/data/Makefile \
2559 tests/server/Makefile \
2560 tests/libtest/Makefile \
2562 packages/Win32/Makefile \
2563 packages/Win32/cygwin/Makefile \
2564 packages/Linux/Makefile \
2565 packages/Linux/RPM/Makefile \
2566 packages/Linux/RPM/curl.spec \
2567 packages/Linux/RPM/curl-ssl.spec \
2568 packages/Solaris/Makefile \
2569 packages/DOS/Makefile \
2570 packages/EPM/curl.list \
2571 packages/EPM/Makefile \
2572 packages/vms/Makefile \
2573 packages/AIX/Makefile \
2574 packages/AIX/RPM/Makefile \
2575 packages/AIX/RPM/curl.spec \
2581 AC_MSG_NOTICE([Configured to build curl/libcurl:
2583 curl version: ${VERSION}
2585 Install prefix: ${prefix}
2587 SSL support: ${curl_ssl_msg}
2588 SSH support: ${curl_ssh_msg}
2589 zlib support: ${curl_zlib_msg}
2590 krb4 support: ${curl_krb4_msg}
2591 GSSAPI support: ${curl_gss_msg}
2592 SPNEGO support: ${curl_spnego_msg}
2593 c-ares support: ${curl_ares_msg}
2594 ipv6 support: ${curl_ipv6_msg}
2595 IDN support: ${curl_idn_msg}
2596 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
2597 Built-in manual: ${curl_manual_msg}
2598 Verbose errors: ${curl_verbose_msg}
2599 SSPI support: ${curl_sspi_msg}
2600 ca cert bundle: ${ca}
2601 ca cert path: ${capath}
2602 LDAP support: ${curl_ldap_msg}
2603 LDAPS support: ${curl_ldaps_msg}
2606 if test "x$soname_bump" = "xyes"; then
2609 SONAME bump: yes - WARNING: this library will be built with the SONAME
2610 number bumped due to (a detected) ABI breakage.
2611 See lib/README.curl_off_t for details on this.