1
dnl $Id: configure.ac,v 1.72 2004/04/25 15:23:23 bagder Exp $
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/curlver.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/curlver.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 Check for built-in manual
213
dnl **********************************************************************
215
AC_MSG_CHECKING([whether to provide built-in manual])
216
AC_ARG_ENABLE(manual,
217
AC_HELP_STRING([--enable-manual],[Enable built-in manual])
218
AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
219
[ case "$enableval" in
223
*) AC_MSG_RESULT(yes)
230
dnl The actual use of the USE_MANUAL variable is done much later in this
231
dnl script to allow other actions to disable it as well.
234
dnl **********************************************************************
235
dnl Checks for libraries.
236
dnl **********************************************************************
238
dnl gethostbyname without lib or in the nsl lib?
239
AC_CHECK_FUNC(gethostbyname,
240
[HAVE_GETHOSTBYNAME="1"
242
[ AC_CHECK_LIB(nsl, gethostbyname,
243
[HAVE_GETHOSTBYNAME="1"
248
if test "$HAVE_GETHOSTBYNAME" != "1"
250
dnl gethostbyname in the socket lib?
251
AC_CHECK_LIB(socket, gethostbyname,
252
[HAVE_GETHOSTBYNAME="1"
253
LIBS="$LIBS -lsocket"
257
dnl At least one system has been identified to require BOTH nsl and socket
258
dnl libs at the same time to link properly.
259
if test "$HAVE_GETHOSTBYNAME" != "1"
261
AC_MSG_CHECKING([trying gethostbyname with both nsl and socket libs])
262
my_ac_save_LIBS=$LIBS
263
LIBS="-lnsl -lsocket $LIBS"
267
HAVE_GETHOSTBYNAME="1",
268
AC_MSG_RESULT([yes])],
272
LIBS=$my_ac_save_LIBS]
276
if test "$HAVE_GETHOSTBYNAME" != "1"
278
dnl This is for Msys/Mingw
279
AC_MSG_CHECKING([for gethostbyname in ws2_32])
280
my_ac_save_LIBS=$LIBS
281
LIBS="-lws2_32 $LIBS"
282
AC_TRY_LINK([#include <winsock2.h>],
283
[gethostbyname("www.dummysite.com");],
286
HAVE_GETHOSTBYNAME="1"],
287
[ dnl failed, restore LIBS
288
LIBS=$my_ac_save_LIBS
293
if test "$HAVE_GETHOSTBYNAME" = "1"; then
294
AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
296
AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
300
AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
302
if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
303
AC_CHECK_LIB(resolve, strcasecmp,
304
[LIBS="-lresolve $LIBS"],
310
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
313
AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
315
AC_MSG_CHECKING([whether to use libgcc])
316
AC_ARG_ENABLE(libgcc,
317
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
318
[ case "$enableval" in
329
dnl **********************************************************************
330
dnl Check for the presence of the winmm library.
331
dnl **********************************************************************
333
AC_MSG_CHECKING([for timeGetTime in winmm])
334
my_ac_save_LIBS=$LIBS
336
AC_TRY_LINK([#include <windef.h>
337
#include <mmsystem.h>
343
[ dnl failed, restore LIBS
344
LIBS=$my_ac_save_LIBS
348
dnl **********************************************************************
350
dnl **********************************************************************
352
AC_MSG_CHECKING([whether to enable ipv6])
354
AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
355
AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
356
[ case "$enableval" in
361
*) AC_MSG_RESULT(yes)
366
AC_TRY_RUN([ /* is AF_INET6 available? */
367
#include <sys/types.h>
368
#include <sys/socket.h>
371
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
385
if test "$ipv6" = "yes"; then
386
CURL_CHECK_WORKING_GETADDRINFO
388
CURL_CHECK_NI_WITHSCOPEID
391
dnl **********************************************************************
392
dnl Check how non-blocking sockets are set
393
dnl **********************************************************************
394
AC_ARG_ENABLE(nonblocking,
395
AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
396
AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
398
if test "$enableval" = "no" ; then
399
AC_MSG_WARN([non-blocking sockets disabled])
400
AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
401
[to disable NON-BLOCKING connections])
403
CURL_CHECK_NONBLOCKING_SOCKET
407
CURL_CHECK_NONBLOCKING_SOCKET
410
dnl **********************************************************************
411
dnl Check for the random seed preferences
412
dnl **********************************************************************
414
AC_ARG_WITH(egd-socket,
415
AC_HELP_STRING([--with-egd-socket=FILE],
416
[Entropy Gathering Daemon socket pathname]),
417
[ EGD_SOCKET="$withval" ]
419
if test -n "$EGD_SOCKET" ; then
420
AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
421
[your Entropy Gathering Daemon socket pathname] )
424
dnl Check for user-specified random device
426
AC_HELP_STRING([--with-random=FILE],[read randomness from FILE (default=/dev/urandom)]),
427
[ RANDOM_FILE="$withval" ],
429
dnl Check for random device
430
AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
433
if test -n "$RANDOM_FILE" ; then
434
AC_SUBST(RANDOM_FILE)
435
AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
436
[a suitable file to read random data from])
439
dnl **********************************************************************
440
dnl Check if the operating system allows programs to write to their own argv[]
441
dnl **********************************************************************
443
AC_MSG_CHECKING([if argv can be written to])
444
AC_CACHE_VAL(curl_cv_writable_argv, [
446
int main(int argc, char ** argv) {
448
return (argv[0][0] == ' ')?0:1;
451
curl_cv_writable_argv=yes,
452
curl_cv_writable_argv=no,
453
curl_cv_writable_argv=cross)
455
case $curl_cv_writable_argv in
457
AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
465
AC_MSG_WARN([the previous check could not be made default was used])
469
dnl **********************************************************************
470
dnl Check for the presence of Kerberos4 libraries and headers
471
dnl **********************************************************************
473
AC_ARG_WITH(krb4-includes,
474
AC_HELP_STRING([--with-krb4-includes=DIR],
475
[Specify location of kerberos4 headers]),[
476
CPPFLAGS="$CPPFLAGS -I$withval"
481
AC_ARG_WITH(krb4-libs,
482
AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
483
LDFLAGS="$LDFLAGS -L$withval"
491
AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
493
if test X"$OPT_KRB4" != Xyes
495
LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
496
KRB4LIB="$OPT_KRB4/lib$libsuff"
497
CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
498
KRB4INC="$OPT_KRB4/include"
503
AC_MSG_CHECKING([if Kerberos4 support is requested])
505
if test "$want_krb4" = yes
507
if test "$ipv6" = "yes"; then
508
echo krb4 is not compatible with IPv6
513
dnl Check for & handle argument to --with-krb4
515
AC_MSG_CHECKING(where to look for Kerberos4)
516
if test X"$OPT_KRB4" = Xyes
518
AC_MSG_RESULT([defaults])
520
AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
523
dnl Check for DES library
524
AC_CHECK_LIB(des, des_pcbc_encrypt,
526
AC_CHECK_HEADERS(des.h)
529
AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
531
dnl Check for the Kerberos4 library
532
AC_CHECK_LIB(krb, krb_net_read,
534
dnl Check for header files
535
AC_CHECK_HEADERS(krb.h)
537
dnl we found the required libraries, add to LIBS
538
LIBS="-lkrb -ldes $LIBS"
540
dnl Check for function krb_get_our_ip_for_realm
541
dnl this is needed for NAT networks
542
AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
545
AC_DEFINE(HAVE_KRB4, 1,
546
[if you have the Kerberos4 libraries (including -ldes)])
548
dnl substitute it too!
550
AC_SUBST(KRB4_ENABLED)
552
dnl the krb4 stuff needs a strlcpy()
553
AC_CHECK_FUNCS(strlcpy)
561
dnl **********************************************************************
562
dnl Check for FBopenssl(SPNEGO) libraries
563
dnl **********************************************************************
566
AC_HELP_STRING([--with-spnego=DIR],
567
[Specify location of SPNEGO library fbopenssl]),
568
[ SPNEGO_ROOT="$withval"
571
AC_MSG_CHECKING([if SPNEGO support is requested])
572
if test x"$want_spnego" = xyes; then
574
if test X"$SPNEGO_ROOT" = Xyes; then
575
AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
578
if test -z "$SPNEGO_LIB_DIR"; then
579
LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
581
LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
585
AC_DEFINE(HAVE_SPNEGO, 1, [Define this if you have the SPNEGO library fbopenssl])
591
dnl **********************************************************************
592
dnl Check for GSS-API libraries
593
dnl **********************************************************************
595
AC_ARG_WITH(gssapi-includes,
596
AC_HELP_STRING([--with-gssapi-includes=DIR],
597
[Specify location of GSSAPI header]),
598
[ GSSAPI_INCS="-I$withval"
602
AC_ARG_WITH(gssapi-libs,
603
AC_HELP_STRING([--with-gssapi-libs=DIR],
604
[Specify location of GSSAPI libs]),
605
[ GSSAPI_LIBS="-L$withval -lgssapi"
610
AC_HELP_STRING([--with-gssapi=DIR],
611
[Where to look for GSSAPI]),
612
[ GSSAPI_ROOT="$withval"
616
AC_MSG_CHECKING([if GSSAPI support is requested])
617
if test x"$want_gss" = xyes; then
618
if test -z "$GSSAPI_INCS"; then
619
if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
620
GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
622
GSSAPI_INCS="-I$GSSAPI_ROOT/include"
625
CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
627
if test -z "$GSSAPI_LIB_DIR"; then
628
if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
629
gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
630
LDFLAGS="$LDFLAGS $gss_ldflags"
632
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
635
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
639
AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
641
if test -n "$GSSAPI_INCS"; then
642
# cut off the preceding -I from the include path
643
GSSAPI_INCS=`echo $GSSAPI_INCS | sed -e s/^-I//g`
646
if test -f "$GSSAPI_INCS/gssapi.h"; then
647
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
649
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
657
dnl Detect the pkg-config tool, as it may have extra info about the
658
dnl openssl installation we can use. I *believe* this is what we are
659
dnl expected to do on really recent Redhat Linux hosts.
660
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
661
if test "$PKGCONFIG" != "no" ; then
662
AC_MSG_CHECKING([for OpenSSL options using pkg-config])
664
$PKGCONFIG --exists openssl
667
if test "$SSL_EXISTS" -eq "0"; then
668
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
669
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
670
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
672
LIBS="$LIBS $SSL_LIBS"
673
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
674
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
683
dnl **********************************************************************
684
dnl Check for the presence of SSL libraries and headers
685
dnl **********************************************************************
687
dnl Default to compiler & linker defaults for SSL files & libraries.
689
dnl Default to no CA bundle
692
AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
693
AC_HELP_STRING([--without-ssl], [disable SSL]),
696
if test X"$OPT_SSL" = Xno
698
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more])
701
dnl Check for and handle argument to --with-ssl.
703
dnl save the pre-ssl check flags for a while
704
CLEANLDFLAGS="$LDFLAGS"
705
CLEANCPPFLAGS="$CPPFLAGS"
709
EXTRA_SSL=/usr/local/ssl ;;
713
dnl check the given spot right away!
715
LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
716
CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
720
AC_CHECK_LIB(crypto, CRYPTO_lock,[
723
OLDLDFLAGS="$LDFLAGS"
724
OLDCPPFLAGS="$CPPFLAGS"
725
LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib$libsuff"
726
CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
727
AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
728
HAVECRYPTO="yes" ], [
729
LDFLAGS="$OLDLDFLAGS"
730
CPPFLAGS="$OLDCPPFLAGS"
735
if test "$HAVECRYPTO" = "yes"; then
736
dnl This is only reasonable to do if crypto actually is there: check for
737
dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
739
dnl This is for Msys/Mingw
740
AC_MSG_CHECKING([for gdi32])
741
my_ac_save_LIBS=$LIBS
743
AC_TRY_LINK([#include <windef.h>
744
#include <wingdi.h>],
747
AC_MSG_RESULT([yes])],
748
[ dnl failed, restore LIBS
749
LIBS=$my_ac_save_LIBS
753
AC_CHECK_LIB(crypto, CRYPTO_add_lock)
754
AC_CHECK_LIB(ssl, SSL_connect)
756
if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
757
dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
758
AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
760
LIBS="$LIBS -lRSAglue -lrsaref"
761
AC_CHECK_LIB(ssl, SSL_connect)
762
if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
763
dnl still no SSL_connect
772
dnl Check for SSLeay headers
773
AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
774
openssl/pem.h openssl/ssl.h openssl/err.h,
777
if test $ac_cv_header_openssl_x509_h = no; then
778
AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
782
dnl If the ENGINE library seems to be around, check for the OpenSSL engine
783
dnl header, it is kind of "separated" from the main SSL check
784
AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ])
786
AC_SUBST(OPENSSL_ENABLED)
788
AC_MSG_CHECKING([CA cert bundle install path])
790
AC_ARG_WITH(ca-bundle,
791
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
792
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
795
if test "x$prefix" != xNONE; then
796
ca="\${prefix}/share/curl/curl-ca-bundle.crt"
798
ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
802
if test X"$OPT_SSL" = Xno; then
806
if test "x$ca" != "xno"; then
807
CURL_CA_BUNDLE='"'$ca'"'
808
AC_SUBST(CURL_CA_BUNDLE)
812
dnl these can only exist if openssl exists
814
AC_CHECK_FUNCS( RAND_status \
817
CRYPTO_cleanup_all_ex_data )
821
if test X"$OPT_SSL" != Xoff &&
822
test "$OPENSSL_ENABLED" != "1"; then
823
AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
828
AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
830
dnl **********************************************************************
831
dnl Check for the presence of ZLIB libraries and headers
832
dnl **********************************************************************
834
dnl Check for & handle argument to --with-zlib.
838
OPT_ZLIB="/usr/local"
840
AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
841
AC_HELP_STRING([--without-zlib],[disable use of zlib]),
842
[OPT_ZLIB="$withval"])
846
AC_MSG_WARN([zlib disabled]) ;;
848
dnl check for the lib first without setting any new path, since many
849
dnl people have it in the default path
851
AC_CHECK_LIB(z, inflateEnd,
852
dnl libz found, set the variable
854
dnl if no lib found, try to add the given library
855
[if test -d "$OPT_ZLIB"; then
856
CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
857
LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
860
AC_CHECK_HEADER(zlib.h,
864
dnl if the lib wasn't found already, try again with the new paths
865
if test "$HAVE_LIBZ" != "1"; then
866
AC_CHECK_LIB(z, gzread,
868
dnl the lib was found!
871
[ CPPFLAGS=$_cppflags
876
dnl zlib.h was not found, restore the flags
881
if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
883
AC_MSG_WARN([configure found only the libz lib, not the header file!])
884
elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
886
AC_MSG_WARN([configure found only the libz header file, not the lib!])
887
elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
889
dnl both header and lib were found!
891
AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
892
AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
896
dnl replace 'HAVE_LIBZ' in the automake makefile.ams
898
AC_MSG_NOTICE([found both libz and libz.h header])
903
dnl set variable for use in automakefile(s)
904
AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
906
dnl Default is to try the thread-safe versions of a few functions
909
dnl detect AIX 4.3 or later
910
dnl see full docs on this reasoning in the lib/hostip.c source file
911
AC_MSG_CHECKING([AIX 4.3 or later])
913
#if defined(_AIX) && defined(_AIX43)
916
#error "this is not AIX 4.3 or later"
919
[ AC_MSG_RESULT([yes])
922
[ AC_MSG_RESULT([no]) ]
925
AC_ARG_ENABLE(thread,dnl
926
AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
927
AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
928
[ case "$enableval" in
931
AC_MSG_WARN(libcurl will not get built using thread-safe functions)
939
if test X"$OPT_THREAD" = Xoff
941
AC_DEFINE(DISABLED_THREADSAFE, 1, \
942
Set to explicitly specify we don't want to use thread-safe functions)
944
if test "$ipv6" != "yes"; then
945
dnl dig around for gethostbyname_r()
946
CURL_CHECK_GETHOSTBYNAME_R()
948
dnl dig around for gethostbyaddr_r()
949
CURL_CHECK_GETHOSTBYADDR_R()
952
dnl poke around for inet_ntoa_r()
953
CURL_CHECK_INET_NTOA_R()
955
dnl is there a localtime_r()
956
CURL_CHECK_LOCALTIME_R()
958
dnl is there a strerror_r()
959
CURL_CHECK_STRERROR_R()
961
AC_CHECK_FUNCS( gmtime_r )
964
dnl for recent AIX versions, we skip all the thread-safe checks above since
965
dnl they claim a thread-safe libc using the standard API. But there are
966
dnl some functions still not thread-safe. Check for these!
968
dnl Let's hope this split URL remains working:
969
dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
970
dnl genprogc/thread_quick_ref.htm
972
if test "x$RECENTAIX" = "xyes"; then
973
dnl is there a localtime_r()
974
CURL_CHECK_LOCALTIME_R()
976
dnl is there a strerror_r()
977
CURL_CHECK_STRERROR_R()
979
AC_CHECK_FUNCS( gmtime_r )
983
dnl **********************************************************************
984
dnl Back to "normal" configuring
985
dnl **********************************************************************
987
dnl Checks for header files.
990
dnl First check for the very most basic headers. Then we can use these
991
dnl ones as default-headers when checking for the rest!
1025
dnl to do if not found
1029
dnl default includes
1031
#ifdef HAVE_SYS_TYPES_H
1032
#include <sys/types.h>
1034
#ifdef HAVE_SYS_TIME_H
1035
#include <sys/time.h>
1037
#ifdef HAVE_SYS_SELECT_H
1038
#include <sys/select.h>
1040
#ifdef HAVE_SYS_SOCKET_H
1041
#include <sys/socket.h>
1043
#ifdef HAVE_NETINET_IN_H
1044
#include <netinet/in.h>
1049
dnl Checks for typedefs, structures, and compiler characteristics.
1054
AC_CHECK_SIZEOF(curl_off_t, ,[
1056
#include "$srcdir/include/curl/curl.h"
1059
AC_CHECK_TYPE(long long,
1060
[AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])])
1063
AC_CHECK_TYPE(ssize_t, ,
1064
AC_DEFINE(ssize_t, int, [the signed version of size_t]))
1069
AC_FUNC_SELECT_ARGTYPES
1071
dnl Checks for library functions.
1072
dnl AC_PROG_GCC_TRADITIONAL
1075
AC_CHECK_FUNCS( strtoll \
1108
dnl if not found, $ac_func is the name we check for
1110
AC_MSG_CHECKING([deeper for $func])
1114
eval "ac_cv_func_$func=yes"
1115
def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
1116
AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
1117
AC_MSG_RESULT(but still no)
1122
dnl sigsetjmp() might be a macro and no function so if it isn't found already
1123
dnl we make an extra check here!
1124
if test "$ac_cv_func_sigsetjmp" != "yes"; then
1125
AC_MSG_CHECKING([for sigsetjmp defined as macro])
1126
AC_TRY_LINK( [#include <setjmp.h>],
1128
sigsetjmp(jmpenv, 1);],
1130
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
1135
AC_PATH_PROG( PERL, perl, ,
1136
$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
1139
AC_PATH_PROGS( NROFF, gnroff nroff, ,
1140
$PATH:/usr/bin/:/usr/local/bin )
1143
if test -n "$NROFF"; then
1144
dnl only check for nroff options if an nroff command was found
1146
AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
1148
mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1149
if test -z "$mancheck"; then
1151
mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1152
if test -z "$mancheck"; then
1154
AC_MSG_RESULT([failed])
1155
AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
1157
AC_MSG_RESULT([$MANOPT])
1160
AC_MSG_RESULT([$MANOPT])
1165
if test -z "$MANOPT"
1167
dnl if no nroff tool was found, or no option that could convert man pages
1168
dnl was found, then disable the built-in manual stuff
1169
AC_MSG_WARN([disabling built-in manual])
1177
AC_MSG_CHECKING([if OK to build without bison/yacc])
1178
dnl no yacc is a big deal if we have no pre-fixed getdate.y
1179
if test -r "$srcdir/lib/getdate.c"
1181
dnl all is well, we don't have to generate it!
1185
AC_MSG_ERROR([no yacc or bison found, can't build libcurl!])
1189
dnl *************************************************************************
1190
dnl If the manual variable still is set, then we go with providing a built-in
1193
if test "$USE_MANUAL" = "1"; then
1194
AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
1197
dnl set variable for use in automakefile(s)
1198
AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
1201
dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib,
1202
dnl $PATH:/usr/bin/:/usr/local/bin )
1203
dnl AC_SUBST(RANLIB)
1205
dnl ************************************************************
1206
dnl lame option to switch on debug options
1208
AC_MSG_CHECKING([whether to enable debug options])
1209
AC_ARG_ENABLE(debug,
1210
AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
1211
AC_HELP_STRING([--disable-debug],[Disable debug options]),
1212
[ case "$enableval" in
1216
*) AC_MSG_RESULT(yes)
1218
CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
1221
dnl set compiler "debug" options to become more picky, and remove
1222
dnl optimize options from CFLAGS
1230
AC_MSG_CHECKING([whether to enable ares])
1232
AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
1233
AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
1234
[ case "$enableval" in
1238
*) AC_MSG_RESULT(yes)
1240
if test "x$IPV6_ENABLED" = "x1"; then
1241
AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
1244
AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
1245
dnl substitute HAVE_ARES for curl-config and similar
1249
LIBS="$LIBS -lcares"
1251
dnl For backwards compatibility default to includes/lib in srcdir/ares
1252
dnl If a value is specified it is assumed that the libs are in $val/lib
1253
dnl and the includes are in $val/include. This is the default setup for
1254
dnl ares so it should not be a problem.
1255
if test "x$enableval" = "xyes" ; then
1256
if test -d "$srcdir/ares"; then
1258
AC_CONFIG_SUBDIRS(ares)
1259
aresinc=`cd $srcdir/ares && pwd`
1260
CPPFLAGS="$CPPFLAGS -I$aresinc"
1262
dnl the pwd= below cannot 'cd' into the ares dir to get the full
1263
dnl path to it, since it may not exist yet if we build outside of
1266
LDFLAGS="$LDFLAGS -L$pwd/ares"
1269
CPPFLAGS="$CPPFLAGS -I$enableval/include"
1270
LDFLAGS="$LDFLAGS -L$enableval/lib"
1273
if test -z "$aresembedded"; then
1274
dnl verify that a sufficient c-ares is here if we have pointed one
1275
dnl out and don't use the "embedded" ares dir (in which case we don't
1276
dnl check it because it might not have been built yet)
1277
AC_MSG_CHECKING([that c-ares is good and recent enough])
1280
/* provide a set of dummy functions in case c-ares was built with debug */
1281
void curl_dofree() { }
1282
void curl_sclose() { }
1283
void curl_domalloc() { }
1287
ares_channel channel;
1288
ares_cancel(channel);
1294
AC_MSG_ERROR([c-ares library defective or too old])
1302
AC_CONFIG_FILES([Makefile \
1304
docs/examples/Makefile \
1305
docs/libcurl/Makefile \
1307
include/curl/Makefile \
1311
tests/data/Makefile \
1312
tests/server/Makefile \
1313
tests/libtest/Makefile \
1315
packages/Win32/Makefile \
1316
packages/Win32/cygwin/Makefile \
1317
packages/Linux/Makefile \
1318
packages/Linux/RPM/Makefile \
1319
packages/Linux/RPM/curl.spec \
1320
packages/Linux/RPM/curl-ssl.spec \
1321
packages/Solaris/Makefile \
1322
packages/DOS/Makefile \
1323
packages/EPM/curl.list \
1324
packages/EPM/Makefile \
1325
packages/vms/Makefile \