2 dnl Process this file with autoconf to produce a configure script.
6 dnl We don't know the version number "staticly" so we use a dash here
7 AC_INIT(curl, [-], [curl-bug@haxx.se])
9 dnl configure script copyright
10 AC_COPYRIGHT([Copyright (c) 1998 - 2004 Daniel Stenberg, <daniel@haxx.se>
11 This configure script may be copied, distributed and modified under the
12 terms of the curl license; see COPYING for more details])
14 AC_CONFIG_SRCDIR([lib/urldata.h])
15 AM_CONFIG_HEADER(lib/config.h src/config.h)
18 dnl SED is needed by some of the tools
19 AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin)
22 dnl AR is used by libtool, and try the odd Solaris path too
23 AC_PATH_PROG( AR, ar, , $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
26 dnl figure out the libcurl version
27 VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
28 AM_INIT_AUTOMAKE(curl,$VERSION)
29 AC_MSG_CHECKING([curl version])
30 AC_MSG_RESULT($VERSION)
33 dnl we extract the numerical version for curl-config only
34 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curl.h`
37 dnl Solaris pkgadd support definitions
39 PKGADD_NAME="cURL - a client that groks URLs"
40 PKGADD_VENDOR="curl.haxx.se"
43 AC_SUBST(PKGADD_VENDOR)
47 dnl Detect the canonical host and target build environment
51 dnl Get system canonical name
52 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
54 dnl Check for AIX weirdos
57 dnl Checks for programs.
60 dnl check for how to do large files
63 dnl check for cygwin stuff
69 AC_MSG_CHECKING([if we need -no-undefined])
71 *-*-cygwin | *-*-mingw* | *-*-pw32*)
78 AC_MSG_RESULT($need_no_undefined)
79 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
81 AC_MSG_CHECKING([if we need -mimpure-text])
84 if test "$GCC" = "yes"; then
92 AC_MSG_RESULT($mimpure)
93 AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
95 dnl The install stuff has already been taken care of by the automake stuff
99 dnl ************************************************************
100 dnl switch off particular protocols
102 AC_MSG_CHECKING([whether to support http])
104 AC_HELP_STRING([--enable-http],[Enable HTTP support])
105 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
106 [ case "$enableval" in
109 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
110 AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
111 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
112 AC_SUBST(CURL_DISABLE_HTTP)
113 AC_SUBST(CURL_DISABLE_GOPHER)
115 *) AC_MSG_RESULT(yes)
120 AC_MSG_CHECKING([whether to support ftp])
122 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
123 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
124 [ case "$enableval" in
127 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
128 AC_SUBST(CURL_DISABLE_FTP)
130 *) AC_MSG_RESULT(yes)
135 AC_MSG_CHECKING([whether to support gopher])
136 AC_ARG_ENABLE(gopher,
137 AC_HELP_STRING([--enable-gopher],[Enable GOPHER support])
138 AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]),
139 [ case "$enableval" in
142 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
143 AC_SUBST(CURL_DISABLE_GOPHER)
145 *) AC_MSG_RESULT(yes)
150 AC_MSG_CHECKING([whether to support file])
152 AC_HELP_STRING([--enable-file],[Enable FILE support])
153 AC_HELP_STRING([--disable-file],[Disable FILE support]),
154 [ case "$enableval" in
157 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
158 AC_SUBST(CURL_DISABLE_FILE)
160 *) AC_MSG_RESULT(yes)
165 AC_MSG_CHECKING([whether to support ldap])
167 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
168 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
169 [ case "$enableval" in
172 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
173 AC_SUBST(CURL_DISABLE_LDAP)
175 *) AC_MSG_RESULT(yes)
180 AC_MSG_CHECKING([whether to support dict])
182 AC_HELP_STRING([--enable-dict],[Enable DICT support])
183 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
184 [ case "$enableval" in
187 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
188 AC_SUBST(CURL_DISABLE_DICT)
190 *) AC_MSG_RESULT(yes)
195 AC_MSG_CHECKING([whether to support telnet])
196 AC_ARG_ENABLE(telnet,
197 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
198 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
199 [ case "$enableval" in
202 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
203 AC_SUBST(CURL_DISABLE_TELNET)
205 *) AC_MSG_RESULT(yes)
211 dnl **********************************************************************
212 dnl Checks for libraries.
213 dnl **********************************************************************
215 dnl gethostbyname in the nsl lib?
216 AC_CHECK_FUNC(gethostbyname, , [ AC_CHECK_LIB(nsl, gethostbyname) ])
218 if test "$ac_cv_lib_nsl_gethostbyname" != "yes" -a "$ac_cv_func_gethostbyname" != "yes"; then
219 dnl gethostbyname in the socket lib?
220 AC_CHECK_FUNC(gethostbyname, , [ AC_CHECK_LIB(socket, gethostbyname) ])
223 dnl At least one system has been identified to require BOTH nsl and
224 dnl socket libs to link properly.
225 if test "$ac_cv_lib_nsl_gethostbyname" != "yes" -a "$ac_cv_lib_socket_gethostbyname" != "yes" -a "$ac_cv_func_gethostbyname" != "yes"; then
226 AC_MSG_CHECKING([trying both nsl and socket libs])
227 my_ac_save_LIBS=$LIBS
228 LIBS="-lnsl -lsocket $LIBS"
231 my_ac_link_result=success,
232 my_ac_link_result=failure )
234 if test "$my_ac_link_result" = "failure"; then
236 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
238 LIBS=$my_ac_save_LIBS
245 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
247 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
248 AC_CHECK_LIB(resolve, strcasecmp,
249 [LIBS="-lresolve $LIBS"],
255 AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
258 AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
260 AC_MSG_CHECKING([whether to use libgcc])
261 AC_ARG_ENABLE(libgcc,
262 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
263 [ case "$enableval" in
274 dnl **********************************************************************
276 dnl **********************************************************************
278 AC_MSG_CHECKING([whether to enable ipv6])
280 AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
281 AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
282 [ case "$enableval" in
287 *) AC_MSG_RESULT(yes)
292 AC_TRY_RUN([ /* is AF_INET6 available? */
293 #include <sys/types.h>
294 #include <sys/socket.h>
297 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
311 if test "$ipv6" = "yes"; then
312 CURL_CHECK_WORKING_GETADDRINFO
315 dnl **********************************************************************
316 dnl Check how non-blocking sockets are set
317 dnl **********************************************************************
318 AC_ARG_ENABLE(nonblocking,
319 AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
320 AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
322 if test "$enableval" = "no" ; then
323 AC_MSG_WARN([non-blocking sockets disabled])
324 AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
325 [to disable NON-BLOCKING connections])
327 CURL_CHECK_NONBLOCKING_SOCKET
331 CURL_CHECK_NONBLOCKING_SOCKET
334 dnl **********************************************************************
335 dnl Check for the random seed preferences
336 dnl **********************************************************************
338 AC_ARG_WITH(egd-socket,
339 AC_HELP_STRING([--with-egd-socket=FILE],
340 [Entropy Gathering Daemon socket pathname]),
341 [ EGD_SOCKET="$withval" ]
343 if test -n "$EGD_SOCKET" ; then
344 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
345 [your Entropy Gathering Daemon socket pathname] )
348 dnl Check for user-specified random device
350 AC_HELP_STRING([--with-random=FILE],[read randomness from FILE (default=/dev/urandom)]),
351 [ RANDOM_FILE="$withval" ],
353 dnl Check for random device
354 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
357 if test -n "$RANDOM_FILE" ; then
358 AC_SUBST(RANDOM_FILE)
359 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
360 [a suitable file to read random data from])
363 dnl **********************************************************************
364 dnl Check if the operating system allows programs to write to their own argv[]
365 dnl **********************************************************************
367 AC_MSG_CHECKING([if argv can be written to])
368 AC_CACHE_VAL(curl_cv_writable_argv, [
370 int main(int argc, char ** argv) {
372 return (argv[0][0] == ' ')?0:1;
375 curl_cv_writable_argv=yes,
376 curl_cv_writable_argv=no,
377 curl_cv_writable_argv=cross)
379 case $curl_cv_writable_argv in
381 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
389 AC_MSG_WARN([the previous check could not be made default was used])
393 dnl **********************************************************************
394 dnl Check for the presence of Kerberos4 libraries and headers
395 dnl **********************************************************************
397 AC_ARG_WITH(krb4-includes,
398 AC_HELP_STRING([--with-krb4-includes=DIR],
399 [Specify location of kerberos4 headers]),[
400 CPPFLAGS="$CPPFLAGS -I$withval"
405 AC_ARG_WITH(krb4-libs,
406 AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
407 LDFLAGS="$LDFLAGS -L$withval"
415 AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
417 if test X"$OPT_KRB4" != Xyes
419 LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib"
420 KRB4LIB="$OPT_KRB4/lib"
421 CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
422 KRB4INC="$OPT_KRB4/include"
427 AC_MSG_CHECKING([if Kerberos4 support is requested])
429 if test "$want_krb4" = yes
431 if test "$ipv6" = "yes"; then
432 echo krb4 is not compatible with IPv6
437 dnl Check for & handle argument to --with-krb4
439 AC_MSG_CHECKING(where to look for Kerberos4)
440 if test X"$OPT_KRB4" = Xyes
442 AC_MSG_RESULT([defaults])
444 AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
447 dnl Check for DES library
448 AC_CHECK_LIB(des, des_pcbc_encrypt,
450 AC_CHECK_HEADERS(des.h)
453 AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
455 dnl Check for the Kerberos4 library
456 AC_CHECK_LIB(krb, krb_net_read,
458 dnl Check for header files
459 AC_CHECK_HEADERS(krb.h)
461 dnl we found the required libraries, add to LIBS
462 LIBS="-lkrb -ldes $LIBS"
464 dnl Check for function krb_get_our_ip_for_realm
465 dnl this is needed for NAT networks
466 AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
469 AC_DEFINE(HAVE_KRB4, 1,
470 [if you have the Kerberos4 libraries (including -ldes)])
472 dnl substitute it too!
474 AC_SUBST(KRB4_ENABLED)
476 dnl the krb4 stuff needs a strlcpy()
477 AC_CHECK_FUNCS(strlcpy)
485 dnl **********************************************************************
486 dnl Check for FBopenssl(SPNEGO) libraries
487 dnl **********************************************************************
490 AC_HELP_STRING([--with-spnego=DIR],
491 [Specify location of SPNEGO library fbopenssl]),
492 [ SPNEGO_ROOT="$withval"
495 AC_MSG_CHECKING([if SPNEGO support is requested])
496 if test x"$want_spnego" = xyes; then
498 if test X"$SPNEGO_ROOT" = Xyes; then
499 AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
502 if test -z "$SPNEGO_LIB_DIR"; then
503 LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT ${wl}-R$SPNEGO_ROOT -lfbopenssl"
505 LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
509 AC_DEFINE(HAVE_SPNEGO, 1, [Define this if you have the SPNEGO library fbopenssl])
515 dnl **********************************************************************
516 dnl Check for GSS-API libraries
517 dnl **********************************************************************
519 AC_ARG_WITH(gssapi-includes,
520 AC_HELP_STRING([--with-gssapi-includes=DIR],
521 [Specify location of GSSAPI header]),
522 [ GSSAPI_INCS="-I$withval"
526 AC_ARG_WITH(gssapi-libs,
527 AC_HELP_STRING([--with-gssapi-libs=DIR],
528 [Specify location of GSSAPI libs]),
529 [ GSSAPI_LIBS="-L$withval -lgssapi"
534 AC_HELP_STRING([--with-gssapi=DIR],
535 [Where to look for GSSAPI]),
536 [ GSSAPI_ROOT="$withval"
540 AC_MSG_CHECKING([if GSSAPI support is requested])
541 if test x"$want_gss" = xyes; then
542 if test -z "$GSSAPI_INCS"; then
543 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
544 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
546 GSSAPI_INCS=="-I$GSSAPI_ROOT/include"
549 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
551 if test -z "$GSSAPI_LIB_DIR"; then
552 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
553 gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
554 LDFLAGS="$LDFLAGS $gss_ldflags"
556 LDFLAGS="$LDFLAGS $GSSAPI_ROOT/lib -lgssapi"
559 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
563 AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
565 if test -n "$GSSAPI_INCS"; then
566 # cut off the preceding -I from the include path
567 GSSAPI_INCS=`echo $GSSAPI_INCS | sed -e s/^-I//g`
570 if test -f "$GSSAPI_INCS/gssapi.h"; then
571 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
573 AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
581 dnl Detect the pkg-config tool, as it may have extra info about the
582 dnl openssl installation we can use. I *believe* this is what we are
583 dnl expected to do on really recent Redhat Linux hosts.
584 AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
585 if test "$PKGCONFIG" != "no" ; then
586 AC_MSG_CHECKING([for OpenSSL options using pkg-config])
588 $PKGCONFIG --exists openssl
591 if test "$SSL_EXISTS" -eq "0"; then
592 SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
593 SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
594 SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
596 LIBS="$LIBS $SSL_LIBS"
597 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
598 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
607 dnl **********************************************************************
608 dnl Check for the presence of SSL libraries and headers
609 dnl **********************************************************************
611 dnl Default to compiler & linker defaults for SSL files & libraries.
613 dnl Default to no CA bundle
616 AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
617 AC_HELP_STRING([--without-ssl], [disable SSL]),
620 if test X"$OPT_SSL" = Xno
622 AC_MSG_WARN(SSL/https support disabled)
625 dnl Check for and handle argument to --with-ssl.
627 dnl save the pre-ssl check flags for a while
628 CLEANLDFLAGS="$LDFLAGS"
629 CLEANCPPFLAGS="$CPPFLAGS"
633 EXTRA_SSL=/usr/local/ssl ;;
637 dnl check the given spot right away!
639 LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib"
640 CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
644 AC_CHECK_LIB(crypto, CRYPTO_lock,[
647 OLDLDFLAGS="$LDFLAGS"
648 OLDCPPFLAGS="$CPPFLAGS"
649 LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib"
650 CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
651 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
652 HAVECRYPTO="yes" ], [
653 LDFLAGS="$OLDLDFLAGS"
654 CPPFLAGS="$OLDCPPFLAGS"
659 if test "$HAVECRYPTO" = "yes"; then
660 dnl This is only reasonable to do if crypto actually is there: check for
661 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
663 AC_CHECK_LIB(crypto, CRYPTO_add_lock)
664 AC_CHECK_LIB(ssl, SSL_connect)
666 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
667 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
668 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
670 LIBS="$LIBS -lRSAglue -lrsaref"
671 AC_CHECK_LIB(ssl, SSL_connect)
672 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
673 dnl still no SSL_connect
682 dnl Check for SSLeay headers
683 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
684 openssl/pem.h openssl/ssl.h openssl/err.h,
687 if test $ac_cv_header_openssl_x509_h = no; then
688 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
692 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
693 dnl header, it is kind of "separated" from the main SSL check
694 AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ])
696 AC_SUBST(OPENSSL_ENABLED)
698 AC_MSG_CHECKING([CA cert bundle install path])
700 AC_ARG_WITH(ca-bundle,
701 AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
702 AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
705 if test "x$prefix" != xNONE; then
706 ca="\${prefix}/share/curl/curl-ca-bundle.crt"
708 ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
712 if test X"$OPT_SSL" = Xno; then
716 if test "x$ca" != "xno"; then
717 CURL_CA_BUNDLE='"'$ca'"'
718 AC_SUBST(CURL_CA_BUNDLE)
722 dnl these can only exist if openssl exists
724 AC_CHECK_FUNCS( RAND_status \
727 CRYPTO_cleanup_all_ex_data )
731 if test X"$OPT_SSL" != Xoff &&
732 test "$OPENSSL_ENABLED" != "1"; then
733 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
738 AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
740 dnl **********************************************************************
741 dnl Check for the presence of ZLIB libraries and headers
742 dnl **********************************************************************
744 dnl Check for & handle argument to --with-zlib.
748 OPT_ZLIB="/usr/local"
750 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
751 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
752 [OPT_ZLIB="$withval"])
756 AC_MSG_WARN([zlib disabled]) ;;
758 dnl check for the lib first without setting any new path, since many
759 dnl people have it in the default path
761 AC_CHECK_LIB(z, inflateEnd, ,
762 [if test -d "$OPT_ZLIB"; then
763 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
764 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib"
767 AC_CHECK_HEADER(zlib.h,[
768 AC_CHECK_LIB(z, gzread,
771 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
772 AC_DEFINE(HAVE_LIBZ, 1, [If zlib is available])],
773 [ CPPFLAGS=$_cppflags
774 LDFLAGS=$_ldflags])],
775 [ CPPFLAGS=$_cppflags
781 dnl set variable for use in automakefile(s)
782 AM_CONDITIONAL(HAVE_LIBZ, test x"$HAVE_LIBZ" = x1)
784 dnl Default is to try the thread-safe versions of a few functions
787 dnl detect AIX 4.3 or later
788 dnl see full docs on this reasoning in the lib/hostip.c source file
789 AC_MSG_CHECKING([AIX 4.3 or later])
791 #if defined(_AIX) && defined(_AIX43)
794 #error "this is not AIX 4.3 or later"
797 [ AC_MSG_RESULT([yes])
799 [ AC_MSG_RESULT([no]) ]
802 AC_ARG_ENABLE(thread,dnl
803 AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
804 AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
805 [ case "$enableval" in
808 AC_MSG_WARN(libcurl will not get built using thread-safe functions)
816 if test X"$OPT_THREAD" = Xoff
818 AC_DEFINE(DISABLED_THREADSAFE, 1, \
819 Set to explicitly specify we don't want to use thread-safe functions)
822 dnl dig around for gethostbyname_r()
823 CURL_CHECK_GETHOSTBYNAME_R()
825 dnl dig around for gethostbyaddr_r()
826 CURL_CHECK_GETHOSTBYADDR_R()
828 dnl poke around for inet_ntoa_r()
829 CURL_CHECK_INET_NTOA_R()
831 dnl is there a localtime_r()
832 CURL_CHECK_LOCALTIME_R()
834 AC_CHECK_FUNCS( gmtime_r )
838 dnl **********************************************************************
839 dnl Back to "normal" configuring
840 dnl **********************************************************************
842 dnl Checks for header files.
845 dnl First check for the very most basic headers. Then we can use these
846 dnl ones as default-headers when checking for the rest!
877 dnl to do if not found
883 #ifdef HAVE_SYS_TYPES_H
884 #include <sys/types.h>
886 #ifdef HAVE_SYS_TIME_H
887 #include <sys/time.h>
889 #ifdef HAVE_SYS_SELECT_H
890 #include <sys/select.h>
892 #ifdef HAVE_SYS_SOCKET_H
893 #include <sys/socket.h>
898 dnl Checks for typedefs, structures, and compiler characteristics.
903 AC_CHECK_SIZEOF(off_t)
905 AC_CHECK_TYPE(long long,
906 [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])])
909 AC_CHECK_TYPE(ssize_t, ,
910 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
915 AC_FUNC_SELECT_ARGTYPES
917 dnl Checks for library functions.
918 dnl AC_PROG_GCC_TRADITIONAL
921 AC_CHECK_FUNCS( strtoll \
954 dnl if not found, $ac_func is the name we check for
956 AC_MSG_CHECKING([deeper for $func])
960 eval "ac_cv_func_$func=yes"
961 def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
962 AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
963 AC_MSG_RESULT(but still no)
968 dnl sigsetjmp() might be a macro and no function so if it isn't found already
969 dnl we make an extra check here!
970 if test "$ac_cv_func_sigsetjmp" != "yes"; then
971 AC_MSG_CHECKING([for sigsetjmp defined as macro])
972 AC_TRY_LINK( [#include <setjmp.h>],
974 sigsetjmp(jmpenv, 1);],
976 AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
981 AC_PATH_PROG( PERL, perl, ,
982 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
985 AC_PATH_PROGS( NROFF, gnroff nroff, ,
986 $PATH:/usr/bin/:/usr/local/bin )
991 dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib,
992 dnl $PATH:/usr/bin/:/usr/local/bin )
995 dnl ************************************************************
996 dnl lame option to switch on debug options
998 AC_MSG_CHECKING([whether to enable debug options])
1000 AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
1001 AC_HELP_STRING([--disable-debug],[Disable debug options]),
1002 [ case "$enableval" in
1006 *) AC_MSG_RESULT(yes)
1008 CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
1010 if test "$GCC" = "yes"; then
1011 CFLAGS="$CFLAGS -W -Wall -Wwrite-strings -pedantic -Wno-long-long -Wundef -Wpointer-arith -Wnested-externs"
1013 dnl strip off optimizer flags
1015 for flag in $CFLAGS; do
1018 dnl echo "cut off $flag"
1021 NEWFLAGS="$NEWFLAGS $flag"
1031 AC_MSG_CHECKING([whether to enable ares])
1033 AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
1034 AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
1035 [ case "$enableval" in
1039 *) AC_MSG_RESULT(yes)
1041 if test "x$IPV6_ENABLED" = "x1"; then
1042 AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
1045 AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
1046 dnl substitute HAVE_ARES for curl-config and similar
1052 dnl For backwards compatibility default to includes/lib in srcdir/ares
1053 dnl If a value is specified it is assumed that the libs are in $val/lib
1054 dnl and the includes are in $val/include. This is the default setup for
1055 dnl ares so it should not be a problem.
1056 if test "x$enableval" = "xyes" ; then
1057 if test -d "$srcdir/ares"; then
1058 AC_CONFIG_SUBDIRS(ares)
1059 aresinc=`cd $srcdir/ares && pwd`
1060 CPPFLAGS="$CPPFLAGS -I$aresinc"
1062 dnl the pwd= below cannot 'cd' into the ares dir to get the full
1063 dnl path to it, since it may not exist yet if we build outside of
1066 LDFLAGS="$LDFLAGS -L$pwd/ares"
1069 CPPFLAGS="$CPPFLAGS -I$enableval/include"
1070 LDFLAGS="$LDFLAGS -L$enableval/lib"
1077 AC_CONFIG_FILES([Makefile \
1079 docs/examples/Makefile \
1080 docs/libcurl/Makefile \
1082 include/curl/Makefile \
1086 tests/data/Makefile \
1087 tests/server/Makefile \
1088 tests/libtest/Makefile \
1090 packages/Win32/Makefile \
1091 packages/Win32/cygwin/Makefile \
1092 packages/Linux/Makefile \
1093 packages/Linux/RPM/Makefile \
1094 packages/Linux/RPM/curl.spec \
1095 packages/Linux/RPM/curl-ssl.spec \
1096 packages/Solaris/Makefile \
1097 packages/DOS/Makefile \
1098 packages/EPM/curl.list \
1099 packages/EPM/Makefile \