]> git.ipfire.org Git - thirdparty/curl.git/blame - configure.ac
remove the warning for a lacking crypto lib since it migth just be a gnutls
[thirdparty/curl.git] / configure.ac
CommitLineData
ae1912cb
DS
1dnl $Id$
2dnl Process this file with autoconf to produce a configure script.
7349940b 3
a147a079 4AC_PREREQ(2.57)
7349940b 5
d5ba0309 6dnl We don't know the version number "staticly" so we use a dash here
e3fc0d5e 7AC_INIT(curl, [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
d5ba0309
DS
8
9dnl configure script copyright
c2fcdf3a 10AC_COPYRIGHT([Copyright (c) 1998 - 2005 Daniel Stenberg, <daniel@haxx.se>
d5ba0309
DS
11This configure script may be copied, distributed and modified under the
12terms of the curl license; see COPYING for more details])
13
93c53424 14AC_CONFIG_SRCDIR([lib/urldata.h])
1a4fddb9 15AM_CONFIG_HEADER(lib/config.h src/config.h)
ed29552b 16AM_MAINTAINER_MODE
8f5ffd94 17
9f7c6341 18dnl SED is needed by some of the tools
3fc39a6e
DS
19AC_PATH_PROG( SED, sed, sed-was-not-found-by-configure,
20 $PATH:/usr/bin:/usr/local/bin)
075c5342
DS
21AC_SUBST(SED)
22
3fc39a6e
DS
23if test "x$SED" = "xsed-was-not-found-by-configure"; then
24 AC_MSG_WARN([sed was not found, this may ruin your chances to build fine])
25fi
26
9f7c6341 27dnl AR is used by libtool, and try the odd Solaris path too
91018f4f
DS
28dnl we use AC_CHECK_TOOL since this should make a library for the target
29dnl platform
30AC_CHECK_TOOL(AR, ar,
3fc39a6e
DS
31 ar-was-not-found-by-configure,
32 $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
9f7c6341 33AC_SUBST(AR)
3fc39a6e
DS
34if test "x$AR" = "xar-was-not-found-by-configure"; then
35 AC_MSG_WARN([ar was not found, this may ruin your chances to build fine])
36fi
9f7c6341 37
7349940b 38dnl figure out the libcurl version
593170d1 39VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
8f5ffd94 40AM_INIT_AUTOMAKE(curl,$VERSION)
075c5342
DS
41AC_MSG_CHECKING([curl version])
42AC_MSG_RESULT($VERSION)
caf8c01e 43
1e5e0f9a
DS
44dnl
45dnl we extract the numerical version for curl-config only
593170d1 46VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
1e5e0f9a
DS
47AC_SUBST(VERSIONNUM)
48
c503930b
CB
49dnl Solaris pkgadd support definitions
50PKGADD_PKG="HAXXcurl"
51PKGADD_NAME="cURL - a client that groks URLs"
52PKGADD_VENDOR="curl.haxx.se"
53AC_SUBST(PKGADD_PKG)
54AC_SUBST(PKGADD_NAME)
55AC_SUBST(PKGADD_VENDOR)
56
cff90cf3 57dnl
710e370c 58dnl initialize all the info variables
bebd5dbc 59 curl_ssl_msg="no (--with-ssl / --with-gnutls)"
710e370c
DS
60 curl_zlib_msg="no (--with-zlib)"
61 curl_krb4_msg="no (--with-krb4*)"
62 curl_gss_msg="no (--with-gssapi)"
63 curl_spnego_msg="no (--with-spnego)"
64 curl_ares_msg="no (--enable-ares)"
65 curl_ipv6_msg="no (--enable-ipv6)"
66 curl_idn_msg="no (--with-libidn)"
67 curl_manual_msg="no (--enable-manual)"
68curl_verbose_msg="enabled (--disable-verbose)"
8ed31c48 69 curl_sspi_msg="no (--enable-sspi)"
c503930b 70
caf8c01e
DS
71dnl
72dnl Detect the canonical host and target build environment
73dnl
ae1912cb 74
c77f77a1 75AC_CANONICAL_HOST
93c53424 76dnl Get system canonical name
22a32389 77AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
1b1f143c
DS
78
79dnl Check for AIX weirdos
80AC_AIX
81
93c53424
DS
82dnl Checks for programs.
83AC_PROG_CC
84
d4ffc5ef 85dnl check for how to do large files
1b1f143c 86AC_SYS_LARGEFILE
d4ffc5ef 87
1e8f0c57
DS
88dnl check for cygwin stuff
89AC_LIBTOOL_WIN32_DLL
90
91dnl libtool setup
d20a0516 92AC_PROG_LIBTOOL
93c53424 93
fcfc6de9 94AC_MSG_CHECKING([if we need -no-undefined])
ecf3aee4 95case $host in
c2e2c98d 96 *-*-cygwin | *-*-mingw* | *-*-pw32*)
ecf3aee4
DS
97 need_no_undefined=yes
98 ;;
99 *)
100 need_no_undefined=no
101 ;;
102esac
fcfc6de9 103AC_MSG_RESULT($need_no_undefined)
ecf3aee4
DS
104AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
105
fcfc6de9 106AC_MSG_CHECKING([if we need -mimpure-text])
5ab9d72e 107mimpure=no
fcfc6de9
DS
108case $host in
109 *-*-solaris2*)
110 if test "$GCC" = "yes"; then
111 mimpure="yes"
112 fi
113 ;;
114 *)
fcfc6de9
DS
115 ;;
116esac
117AC_MSG_RESULT($mimpure)
118AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
119
4d815c99
DS
120AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
121case $host in
122 *-*-mingw*)
123 AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
124 AC_MSG_RESULT(yes)
125 ;;
126 *)
127 AC_MSG_RESULT(no)
128 ;;
129esac
130
d1a1fcc6
DS
131dnl The install stuff has already been taken care of by the automake stuff
132dnl AC_PROG_INSTALL
ae1912cb
DS
133AC_PROG_MAKE_SET
134
fd3881ea
DS
135dnl ************************************************************
136dnl switch off particular protocols
137dnl
138AC_MSG_CHECKING([whether to support http])
139AC_ARG_ENABLE(http,
f136f435
DS
140AC_HELP_STRING([--enable-http],[Enable HTTP support])
141AC_HELP_STRING([--disable-http],[Disable HTTP support]),
fd3881ea
DS
142[ case "$enableval" in
143 no)
144 AC_MSG_RESULT(no)
22a32389 145 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
fd3881ea 146 AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
22a32389 147 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
3955b313
DS
148 AC_SUBST(CURL_DISABLE_HTTP, [1])
149 AC_SUBST(CURL_DISABLE_GOPHER, [1])
fd3881ea
DS
150 ;;
151 *) AC_MSG_RESULT(yes)
152 ;;
153 esac ],
154 AC_MSG_RESULT(yes)
155)
156AC_MSG_CHECKING([whether to support ftp])
157AC_ARG_ENABLE(ftp,
f136f435
DS
158AC_HELP_STRING([--enable-ftp],[Enable FTP support])
159AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
fd3881ea
DS
160[ case "$enableval" in
161 no)
162 AC_MSG_RESULT(no)
22a32389 163 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
3955b313 164 AC_SUBST(CURL_DISABLE_FTP, [1])
fd3881ea
DS
165 ;;
166 *) AC_MSG_RESULT(yes)
167 ;;
168 esac ],
169 AC_MSG_RESULT(yes)
170)
171AC_MSG_CHECKING([whether to support gopher])
172AC_ARG_ENABLE(gopher,
f136f435
DS
173AC_HELP_STRING([--enable-gopher],[Enable GOPHER support])
174AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]),
fd3881ea
DS
175[ case "$enableval" in
176 no)
177 AC_MSG_RESULT(no)
22a32389 178 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
3955b313 179 AC_SUBST(CURL_DISABLE_GOPHER, [1])
fd3881ea
DS
180 ;;
181 *) AC_MSG_RESULT(yes)
182 ;;
183 esac ],
184 AC_MSG_RESULT(yes)
185)
186AC_MSG_CHECKING([whether to support file])
187AC_ARG_ENABLE(file,
f136f435
DS
188AC_HELP_STRING([--enable-file],[Enable FILE support])
189AC_HELP_STRING([--disable-file],[Disable FILE support]),
fd3881ea
DS
190[ case "$enableval" in
191 no)
192 AC_MSG_RESULT(no)
22a32389 193 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
3955b313 194 AC_SUBST(CURL_DISABLE_FILE, [1])
fd3881ea
DS
195 ;;
196 *) AC_MSG_RESULT(yes)
197 ;;
198 esac ],
199 AC_MSG_RESULT(yes)
200)
201AC_MSG_CHECKING([whether to support ldap])
202AC_ARG_ENABLE(ldap,
f136f435
DS
203AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
204AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
fd3881ea
DS
205[ case "$enableval" in
206 no)
207 AC_MSG_RESULT(no)
22a32389 208 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
3955b313 209 AC_SUBST(CURL_DISABLE_LDAP, [1])
fd3881ea
DS
210 ;;
211 *) AC_MSG_RESULT(yes)
212 ;;
213 esac ],
214 AC_MSG_RESULT(yes)
215)
216AC_MSG_CHECKING([whether to support dict])
217AC_ARG_ENABLE(dict,
f136f435
DS
218AC_HELP_STRING([--enable-dict],[Enable DICT support])
219AC_HELP_STRING([--disable-dict],[Disable DICT support]),
fd3881ea
DS
220[ case "$enableval" in
221 no)
222 AC_MSG_RESULT(no)
b9c60df0 223 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
3955b313 224 AC_SUBST(CURL_DISABLE_DICT, [1])
fd3881ea
DS
225 ;;
226 *) AC_MSG_RESULT(yes)
227 ;;
228 esac ],
229 AC_MSG_RESULT(yes)
230)
231AC_MSG_CHECKING([whether to support telnet])
232AC_ARG_ENABLE(telnet,
f136f435
DS
233AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
234AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
fd3881ea
DS
235[ case "$enableval" in
236 no)
237 AC_MSG_RESULT(no)
22a32389 238 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
3955b313 239 AC_SUBST(CURL_DISABLE_TELNET, [1])
fd3881ea
DS
240 ;;
241 *) AC_MSG_RESULT(yes)
242 ;;
243 esac ],
244 AC_MSG_RESULT(yes)
245)
246
f3663a9d
DS
247dnl **********************************************************************
248dnl Check for built-in manual
249dnl **********************************************************************
250
251AC_MSG_CHECKING([whether to provide built-in manual])
252AC_ARG_ENABLE(manual,
253AC_HELP_STRING([--enable-manual],[Enable built-in manual])
254AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
255[ case "$enableval" in
256 no)
257 AC_MSG_RESULT(no)
258 ;;
259 *) AC_MSG_RESULT(yes)
260 USE_MANUAL="1"
261 ;;
262 esac ],
263 AC_MSG_RESULT(yes)
264 USE_MANUAL="1"
265)
266dnl The actual use of the USE_MANUAL variable is done much later in this
267dnl script to allow other actions to disable it as well.
268
269
ae1912cb
DS
270dnl **********************************************************************
271dnl Checks for libraries.
272dnl **********************************************************************
273
9f2780a2
DS
274dnl gethostbyname without lib or in the nsl lib?
275AC_CHECK_FUNC(gethostbyname,
276 [HAVE_GETHOSTBYNAME="1"
277 ],
278 [ AC_CHECK_LIB(nsl, gethostbyname,
279 [HAVE_GETHOSTBYNAME="1"
280 LIBS="$LIBS -lnsl"
281 ])
282 ])
283
284if test "$HAVE_GETHOSTBYNAME" != "1"
285then
61fb8fea 286 dnl gethostbyname in the socket lib?
9f2780a2
DS
287 AC_CHECK_LIB(socket, gethostbyname,
288 [HAVE_GETHOSTBYNAME="1"
289 LIBS="$LIBS -lsocket"
290 ])
61fb8fea
DS
291fi
292
9f2780a2
DS
293dnl At least one system has been identified to require BOTH nsl and socket
294dnl libs at the same time to link properly.
295if test "$HAVE_GETHOSTBYNAME" != "1"
296then
af43ce73 297 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
caf8c01e
DS
298 my_ac_save_LIBS=$LIBS
299 LIBS="-lnsl -lsocket $LIBS"
300 AC_TRY_LINK( ,
301 [gethostbyname();],
9f2780a2 302 [ dnl found it!
5c7dcc6c 303 HAVE_GETHOSTBYNAME="1"
9f2780a2
DS
304 AC_MSG_RESULT([yes])],
305 [ dnl failed!
306 AC_MSG_RESULT([no])
307 dnl restore LIBS
308 LIBS=$my_ac_save_LIBS]
309 )
310fi
caf8c01e 311
9f2780a2
DS
312if test "$HAVE_GETHOSTBYNAME" != "1"
313then
314 dnl This is for Msys/Mingw
315 AC_MSG_CHECKING([for gethostbyname in ws2_32])
316 my_ac_save_LIBS=$LIBS
317 LIBS="-lws2_32 $LIBS"
318 AC_TRY_LINK([#include <winsock2.h>],
319 [gethostbyname("www.dummysite.com");],
320 [ dnl worked!
9f3d9da1 321 ws2="yes"
a3d39efa 322 AC_MSG_RESULT([yes])
9f2780a2
DS
323 HAVE_GETHOSTBYNAME="1"],
324 [ dnl failed, restore LIBS
325 LIBS=$my_ac_save_LIBS
326 AC_MSG_RESULT(no)]
327 )
328fi
329
58f4af79
DS
330if test "$HAVE_GETHOSTBYNAME" != "1"
331then
332 dnl gethostbyname in the net lib - for BeOS
333 AC_CHECK_LIB(net, gethostbyname,
334 [HAVE_GETHOSTBYNAME="1"
335 LIBS="$LIBS -lnet"
336 ])
337fi
338
339
9f2780a2
DS
340if test "$HAVE_GETHOSTBYNAME" = "1"; then
341 AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
342else
343 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
caf8c01e
DS
344fi
345
ae1912cb 346dnl resolve lib?
22a32389 347AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
ae1912cb 348
b174aeaa
DS
349if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
350 AC_CHECK_LIB(resolve, strcasecmp,
351 [LIBS="-lresolve $LIBS"],
352 ,
353 -lnsl)
354fi
355
ae1912cb 356dnl socket lib?
22a32389 357AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
ae1912cb 358
ae1912cb 359dnl dl lib?
22a32389 360AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
ae1912cb 361
075c5342
DS
362AC_MSG_CHECKING([whether to use libgcc])
363AC_ARG_ENABLE(libgcc,
364AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
365[ case "$enableval" in
366 yes)
367 LIBS="$LIBS -lgcc"
368 AC_MSG_RESULT(yes)
369 ;;
370 *) AC_MSG_RESULT(no)
371 ;;
372 esac ],
373 AC_MSG_RESULT(no)
374)
375
3ec605de 376dnl **********************************************************************
205f8b26
DF
377dnl Check for the name of dynamic OpenLDAP libraries
378dnl **********************************************************************
379
380LDAPLIBNAME=""
381AC_ARG_WITH(ldap-lib,
382AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of dynamic ldap lib file]),
383 [LDAPLIBNAME="$withval"])
384
385LBERLIBNAME=""
386AC_ARG_WITH(lber-lib,
387AC_HELP_STRING([--with-lber-lib=libname],[Specify name of dynamic lber lib file]),
388 [LBERLIBNAME="$withval"])
389
390if test x$CURL_DISABLE_LDAP != x1 ; then
391
392 if test -z "$LDAPLIBNAME" ; then
393 case $host in
394 *-*-cygwin | *-*-mingw* | *-*-pw32*)
395 dnl Windows uses a single and unique OpenLDAP DLL name
396 LDAPLIBNAME="wldap32.dll"
397 LBERLIBNAME="no"
398 ;;
399 esac
400 fi
401
402 if test "$LDAPLIBNAME" ; then
403 AC_DEFINE_UNQUOTED(DL_LDAP_FILE, "$LDAPLIBNAME")
404 AC_MSG_CHECKING([name of dynamic library ldap])
405 AC_MSG_RESULT($LDAPLIBNAME)
406 else
407 dnl Try to find the right ldap library name for this system
408 CURL_DLLIB_NAME(DL_LDAP_FILE, ldap)
409 fi
410
411 if test "$LBERLIBNAME" ; then
412 dnl If name is "no" then don't define this variable at all
413 dnl (it's only needed if libldap.so's dependencies are broken).
414 if test "$LBERLIBNAME" != "no" ; then
415 AC_DEFINE_UNQUOTED(DL_LBER_FILE, "$LBERLIBNAME")
416 fi
417 AC_MSG_CHECKING([name of dynamic library lber])
418 AC_MSG_RESULT($LBERLIBNAME)
419 else
420 dnl Try to find the right lber library name for this system
421 CURL_DLLIB_NAME(DL_LBER_FILE, lber)
422 fi
423fi
424
425dnl **********************************************************************
3ec605de
DS
426dnl Check for the presence of the winmm library.
427dnl **********************************************************************
428
429AC_MSG_CHECKING([for timeGetTime in winmm])
430my_ac_save_LIBS=$LIBS
431LIBS="-lwinmm $LIBS"
432AC_TRY_LINK([#include <windef.h>
433 #include <mmsystem.h>
434 ],
435 [timeGetTime();],
436 [ dnl worked!
437 AC_MSG_RESULT([yes])
438 ],
439 [ dnl failed, restore LIBS
440 LIBS=$my_ac_save_LIBS
441 AC_MSG_RESULT(no)]
442 )
443
d1b17779
DS
444dnl **********************************************************************
445dnl Checks for IPv6
446dnl **********************************************************************
447
448AC_MSG_CHECKING([whether to enable ipv6])
449AC_ARG_ENABLE(ipv6,
450AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
451AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
452[ case "$enableval" in
453 no)
454 AC_MSG_RESULT(no)
455 ipv6=no
456 ;;
457 *) AC_MSG_RESULT(yes)
458 ipv6=yes
459 ;;
460 esac ],
461
462 AC_TRY_RUN([ /* is AF_INET6 available? */
463#include <sys/types.h>
464#include <sys/socket.h>
465main()
466{
467 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
468 exit(1);
469 else
470 exit(0);
471}
472],
473 AC_MSG_RESULT(yes)
474 ipv6=yes,
475 AC_MSG_RESULT(no)
476 ipv6=no,
477 AC_MSG_RESULT(no)
478 ipv6=no
479))
480
481if test "$ipv6" = "yes"; then
cff90cf3
DS
482 curl_ipv6_msg="enabled"
483
d1b17779 484 CURL_CHECK_WORKING_GETADDRINFO
a2ea0abf
DS
485
486 CURL_CHECK_NI_WITHSCOPEID
d1b17779
DS
487fi
488
6ca45bea
DS
489dnl **********************************************************************
490dnl Check how non-blocking sockets are set
491dnl **********************************************************************
492AC_ARG_ENABLE(nonblocking,
f136f435
DS
493AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
494AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
6ca45bea
DS
495[
496 if test "$enableval" = "no" ; then
497 AC_MSG_WARN([non-blocking sockets disabled])
22a32389
DS
498 AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
499 [to disable NON-BLOCKING connections])
6ca45bea
DS
500 else
501 CURL_CHECK_NONBLOCKING_SOCKET
502 fi
503],
504[
505 CURL_CHECK_NONBLOCKING_SOCKET
506])
507
7f67a28c
DS
508dnl **********************************************************************
509dnl Check if the operating system allows programs to write to their own argv[]
510dnl **********************************************************************
511
512AC_MSG_CHECKING([if argv can be written to])
0717e469 513AC_CACHE_VAL(curl_cv_writable_argv, [
a139ce90 514AC_RUN_IFELSE([[
7f67a28c
DS
515int main(int argc, char ** argv) {
516 argv[0][0] = ' ';
517 return (argv[0][0] == ' ')?0:1;
518}
a139ce90 519 ]],
0717e469
DS
520 curl_cv_writable_argv=yes,
521 curl_cv_writable_argv=no,
522 curl_cv_writable_argv=cross)
523])
524case $curl_cv_writable_argv in
525yes)
7f67a28c 526 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
0717e469
DS
527 AC_MSG_RESULT(yes)
528 ;;
529no)
530 AC_MSG_RESULT(no)
531 ;;
532*)
a139ce90
DS
533 AC_MSG_RESULT(no)
534 AC_MSG_WARN([the previous check could not be made default was used])
0717e469
DS
535 ;;
536esac
7f67a28c 537
00505c92
DS
538dnl **********************************************************************
539dnl Check for the presence of Kerberos4 libraries and headers
540dnl **********************************************************************
541
542AC_ARG_WITH(krb4-includes,
f136f435
DS
543AC_HELP_STRING([--with-krb4-includes=DIR],
544 [Specify location of kerberos4 headers]),[
00505c92
DS
545 CPPFLAGS="$CPPFLAGS -I$withval"
546 KRB4INC="$withval"
547 want_krb4=yes
548 ])
549
550AC_ARG_WITH(krb4-libs,
f136f435 551AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
00505c92
DS
552 LDFLAGS="$LDFLAGS -L$withval"
553 KRB4LIB="$withval"
554 want_krb4=yes
555 ])
556
557
558OPT_KRB4=off
559AC_ARG_WITH(krb4,dnl
f136f435 560AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
00505c92
DS
561 OPT_KRB4="$withval"
562 if test X"$OPT_KRB4" != Xyes
563 then
81f83506
DS
564 LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
565 KRB4LIB="$OPT_KRB4/lib$libsuff"
00505c92
DS
566 CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
567 KRB4INC="$OPT_KRB4/include"
568 fi
569 want_krb4="yes"
570 ])
571
572AC_MSG_CHECKING([if Kerberos4 support is requested])
573
574if test "$want_krb4" = yes
575then
f6e2bfd4
DS
576 if test "$ipv6" = "yes"; then
577 echo krb4 is not compatible with IPv6
578 exit 1
579 fi
00505c92
DS
580 AC_MSG_RESULT(yes)
581
582 dnl Check for & handle argument to --with-krb4
583
584 AC_MSG_CHECKING(where to look for Kerberos4)
585 if test X"$OPT_KRB4" = Xyes
586 then
587 AC_MSG_RESULT([defaults])
588 else
589 AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
590 fi
591
592 dnl Check for DES library
593 AC_CHECK_LIB(des, des_pcbc_encrypt,
594 [
595 AC_CHECK_HEADERS(des.h)
596
597 dnl resolv lib?
22a32389 598 AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
00505c92
DS
599
600 dnl Check for the Kerberos4 library
601 AC_CHECK_LIB(krb, krb_net_read,
602 [
603 dnl Check for header files
604 AC_CHECK_HEADERS(krb.h)
605
606 dnl we found the required libraries, add to LIBS
b55507c8 607 LIBS="-lkrb -lcom_err -ldes $LIBS"
00505c92
DS
608
609 dnl Check for function krb_get_our_ip_for_realm
610 dnl this is needed for NAT networks
611 AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
612
613 dnl add define KRB4
d4629fd3 614 AC_DEFINE(HAVE_KRB4, 1,
22a32389 615 [if you have the Kerberos4 libraries (including -ldes)])
00505c92 616
1ee7f92c
DS
617 dnl substitute it too!
618 KRB4_ENABLED=1
619 AC_SUBST(KRB4_ENABLED)
620
cff90cf3
DS
621 curl_krb4_msg="enabled"
622
00505c92
DS
623 dnl the krb4 stuff needs a strlcpy()
624 AC_CHECK_FUNCS(strlcpy)
625
626 ])
627 ])
628else
629 AC_MSG_RESULT(no)
630fi
631
09ccfcdc
DS
632dnl **********************************************************************
633dnl Check for FBopenssl(SPNEGO) libraries
634dnl **********************************************************************
635
636AC_ARG_WITH(spnego,
637 AC_HELP_STRING([--with-spnego=DIR],
638 [Specify location of SPNEGO library fbopenssl]),
639 [ SPNEGO_ROOT="$withval"
640 want_spnego="yes" ]
641)
642AC_MSG_CHECKING([if SPNEGO support is requested])
643if test x"$want_spnego" = xyes; then
f6413f2c
DS
644
645 if test X"$SPNEGO_ROOT" = Xyes; then
646 AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
647 AC_MSG_RESULT(no)
09ccfcdc 648 else
f6413f2c 649 if test -z "$SPNEGO_LIB_DIR"; then
202e54cf 650 LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
f6413f2c
DS
651 else
652 LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
653 fi
09ccfcdc 654
f6413f2c 655 AC_MSG_RESULT(yes)
cff90cf3
DS
656 AC_DEFINE(HAVE_SPNEGO, 1,
657 [Define this if you have the SPNEGO library fbopenssl])
658 curl_spnego_msg="enabled"
f6413f2c 659 fi
09ccfcdc
DS
660else
661 AC_MSG_RESULT(no)
662fi
663
e56ae142
DS
664dnl **********************************************************************
665dnl Check for GSS-API libraries
666dnl **********************************************************************
667
668AC_ARG_WITH(gssapi-includes,
669 AC_HELP_STRING([--with-gssapi-includes=DIR],
670 [Specify location of GSSAPI header]),
671 [ GSSAPI_INCS="-I$withval"
672 want_gss="yes" ]
673)
674
675AC_ARG_WITH(gssapi-libs,
676 AC_HELP_STRING([--with-gssapi-libs=DIR],
677 [Specify location of GSSAPI libs]),
678 [ GSSAPI_LIBS="-L$withval -lgssapi"
679 want_gss="yes" ]
680)
681
682AC_ARG_WITH(gssapi,
683 AC_HELP_STRING([--with-gssapi=DIR],
684 [Where to look for GSSAPI]),
685 [ GSSAPI_ROOT="$withval"
686 want_gss="yes" ]
687)
688
689AC_MSG_CHECKING([if GSSAPI support is requested])
690if test x"$want_gss" = xyes; then
691 if test -z "$GSSAPI_INCS"; then
692 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
f4046763 693 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
49111a63 694 elif test "$GSSAPI_ROOT" != "yes"; then
533519cc 695 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
e56ae142 696 fi
e56ae142 697 fi
f4046763 698 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
e56ae142
DS
699
700 if test -z "$GSSAPI_LIB_DIR"; then
701 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
702 gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
703 LDFLAGS="$LDFLAGS $gss_ldflags"
49111a63 704 elif test "$GSSAPI_ROOT" != "yes"; then
81f83506 705 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
49111a63
DS
706 else
707 LDFLAGS="$LDFLAGS -lgssapi"
e56ae142
DS
708 fi
709 else
710 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
711 fi
712
713 AC_MSG_RESULT(yes)
09ccfcdc 714 AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
f4046763 715
cff90cf3
DS
716 curl_gss_msg="enabled"
717
49111a63
DS
718 AC_CHECK_HEADER(gssapi.h,
719 [
720 dnl found in the given dirs
09ccfcdc 721 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
49111a63
DS
722 ],
723 [
724 dnl not found, check in gssapi/ subdir
725 AC_CHECK_HEADER(gssapi/gssapi.h,
726 dnl found
727 AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
728 )
729
730 ]
731 )
732
e56ae142
DS
733else
734 AC_MSG_RESULT(no)
735fi
736
ae1912cb
DS
737dnl **********************************************************************
738dnl Check for the presence of SSL libraries and headers
739dnl **********************************************************************
740
741dnl Default to compiler & linker defaults for SSL files & libraries.
742OPT_SSL=off
2c2baa93
DS
743dnl Default to no CA bundle
744ca="no"
ae1912cb 745AC_ARG_WITH(ssl,dnl
f136f435 746AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
e890113f
DS
747AC_HELP_STRING([--without-ssl], [disable SSL]),
748 OPT_SSL=$withval)
ae1912cb 749
bebd5dbc 750if test X"$OPT_SSL" != Xno; then
6bd02a3a 751 dnl backup the pre-ssl variables
4ac7a087
DS
752 CLEANLDFLAGS="$LDFLAGS"
753 CLEANCPPFLAGS="$CPPFLAGS"
6bd02a3a
DS
754 CLEANLIBS="$LIBS"
755
4836154c
DS
756 case "$OPT_SSL" in
757 yes)
75e5967a 758 dnl --with-ssl (without path) used
736a40fe
DS
759 if test x$cross_compiling != xyes; then
760 dnl only do pkg-config magic when not cross-compiling
761 PKGTEST="yes"
762 fi
4836154c 763 EXTRA_SSL=/usr/local/ssl ;;
4398151f 764 off)
75e5967a 765 dnl no --with-ssl option given, just check default places
736a40fe
DS
766 if test x$cross_compiling != xyes; then
767 dnl only do pkg-config magic when not cross-compiling
768 PKGTEST="yes"
769 fi
4398151f 770 EXTRA_SSL= ;;
4836154c 771 *)
75e5967a
DS
772 dnl check the given --with-ssl spot
773 PKGTEST="no"
4ac7a087 774 EXTRA_SSL=$OPT_SSL
81f83506 775 LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
4ac7a087
DS
776 CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
777 ;;
4836154c
DS
778 esac
779
75e5967a
DS
780 if test "$PKGTEST" = "yes"; then
781
782 dnl Detect the pkg-config tool, as it may have extra info about the
783 dnl openssl installation we can use. I *believe* this is what we are
784 dnl expected to do on really recent Redhat Linux hosts.
785
786 AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
787 if test "$PKGCONFIG" != "no" ; then
788 AC_MSG_CHECKING([OpenSSL options with pkg-config])
789
790 $PKGCONFIG --exists openssl
791 SSL_EXISTS=$?
792
793 if test "$SSL_EXISTS" -eq "0"; then
794 SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
795 SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
796 SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
797
798 dnl use the values pkg-config reported
799 LIBS="$LIBS $SSL_LIBS"
800 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
801 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
802 AC_MSG_RESULT([found])
803 else
804 AC_MSG_RESULT([no])
805 fi
806 fi
807 fi
808
93fcb94b
DS
809 dnl This is for Msys/Mingw
810 AC_MSG_CHECKING([for gdi32])
811 my_ac_save_LIBS=$LIBS
812 LIBS="-lgdi32 $LIBS"
813 AC_TRY_LINK([#include <windef.h>
814 #include <wingdi.h>],
815 [GdiFlush();],
816 [ dnl worked!
817 AC_MSG_RESULT([yes])],
818 [ dnl failed, restore LIBS
819 LIBS=$my_ac_save_LIBS
820 AC_MSG_RESULT(no)]
821 )
822
4836154c
DS
823 AC_CHECK_LIB(crypto, CRYPTO_lock,[
824 HAVECRYPTO="yes"
c4f7570a 825 LIBS="-lcrypto $LIBS"
4836154c 826 ],[
81f83506 827 LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib$libsuff"
4ac7a087 828 CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
4836154c 829 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
c4f7570a
DF
830 HAVECRYPTO="yes"
831 LIBS="-lcrypto $LIBS"], [
6bd02a3a
DS
832 LDFLAGS="$CLEANLDFLAGS"
833 CPPFLAGS="$CLEANCPPFLAGS"
834 LIBS="$CLEANLIBS"
4836154c
DS
835 ])
836 ])
ae1912cb 837
ae1912cb 838
21337f47 839 if test X"$HAVECRYPTO" = X"yes"; then
ae1912cb
DS
840 dnl This is only reasonable to do if crypto actually is there: check for
841 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
4836154c 842
ae1912cb
DS
843 AC_CHECK_LIB(ssl, SSL_connect)
844
b32bf427
DS
845 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
846 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
847 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
848 OLIBS=$LIBS
849 LIBS="$LIBS -lRSAglue -lrsaref"
850 AC_CHECK_LIB(ssl, SSL_connect)
851 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
852 dnl still no SSL_connect
853 AC_MSG_RESULT(no)
854 LIBS=$OLIBS
855 else
856 AC_MSG_RESULT(yes)
857 fi
b32bf427 858
df3ca591 859 else
b32bf427 860
df3ca591
DS
861 dnl Have the libraries--check for SSLeay/OpenSSL headers
862 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
863 openssl/pem.h openssl/ssl.h openssl/err.h,
bebd5dbc 864 curl_ssl_msg="enabled (OpenSSL)"
df3ca591
DS
865 OPENSSL_ENABLED=1
866 AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
867
868 if test $ac_cv_header_openssl_x509_h = no; then
869 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
bebd5dbc 870 curl_ssl_msg="enabled (OpenSSL)"
df3ca591
DS
871 OPENSSL_ENABLED=1)
872 fi
873 fi
874
f966dad3
DS
875 if test X"$OPENSSL_ENABLED" = X"1"; then
876 AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
090a7f38
DS
877
878 dnl is there a pkcs12.h header present?
879 AC_CHECK_HEADERS(openssl/pkcs12.h)
c4f7570a
DF
880 else
881 LIBS="$CLEANLIBS"
f966dad3 882 fi
c4f7570a
DF
883 dnl USE_SSLEAY is the historical name for what configure calls
884 dnl OPENSSL_ENABLED; the names should really be unified
df3ca591 885 USE_SSLEAY="$OPENSSL_ENABLED"
df3ca591 886 AC_SUBST(USE_SSLEAY)
df3ca591
DS
887
888 if test X"$OPT_SSL" != Xoff &&
889 test "$OPENSSL_ENABLED" != "1"; then
890 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1ee7f92c 891 fi
df3ca591
DS
892 fi
893
894
895dnl **********************************************************************
896dnl Check for the CA bundle
897dnl **********************************************************************
1ee7f92c 898
df3ca591 899 if test X"$OPENSSL_ENABLED" = X"1"; then
e157aabd 900 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
f169b750
DS
901 dnl stuff, it is kind of "separated" from the main SSL check
902 AC_CHECK_FUNC(ENGINE_init,
903 [
904 AC_CHECK_HEADERS(openssl/engine.h)
905 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
906 ])
af6c3947 907
2c2baa93
DS
908 AC_MSG_CHECKING([CA cert bundle install path])
909
910 AC_ARG_WITH(ca-bundle,
911AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
912AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
913 [ ca="$withval" ],
914 [
915 if test "x$prefix" != xNONE; then
916 ca="\${prefix}/share/curl/curl-ca-bundle.crt"
917 else
918 ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
919 fi
920 ] )
921
922 if test X"$OPT_SSL" = Xno; then
923 ca="no"
924 fi
925
926 if test "x$ca" != "xno"; then
927 CURL_CA_BUNDLE='"'$ca'"'
928 AC_SUBST(CURL_CA_BUNDLE)
929 fi
930 AC_MSG_RESULT([$ca])
931
932 dnl these can only exist if openssl exists
933
934 AC_CHECK_FUNCS( RAND_status \
935 RAND_screen \
e16bc916
DS
936 RAND_egd \
937 CRYPTO_cleanup_all_ex_data )
2c2baa93 938
ae1912cb 939 fi
00505c92 940
df3ca591 941 if test "$OPENSSL_ENABLED" = "1"; then
98adcdd4
DS
942 dnl when the ssl shared libs were found in a path that the run-time linker
943 dnl doesn't search through, we need to add it to LD_LIBRARY_PATH to
944 dnl prevent further configure tests to fail due to this
945 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$EXTRA_SSL/lib$libsuff"
946 export LD_LIBRARY_PATH
1ee7f92c
DS
947 fi
948
ae1912cb
DS
949fi
950
2c2baa93
DS
951AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
952
df3ca591
DS
953dnl **********************************************************************
954dnl Check for the random seed preferences
955dnl **********************************************************************
956
957if test X"$OPENSSL_ENABLED" = X"1"; then
958 AC_ARG_WITH(egd-socket,
959 AC_HELP_STRING([--with-egd-socket=FILE],
960 [Entropy Gathering Daemon socket pathname]),
961 [ EGD_SOCKET="$withval" ]
962 )
963 if test -n "$EGD_SOCKET" ; then
964 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
965 [your Entropy Gathering Daemon socket pathname] )
966 fi
967
968 dnl Check for user-specified random device
969 AC_ARG_WITH(random,
970 AC_HELP_STRING([--with-random=FILE],
971 [read randomness from FILE (default=/dev/urandom)]),
972 [ RANDOM_FILE="$withval" ],
973 [
974 dnl Check for random device
975 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
976 ]
977 )
978 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
979 AC_SUBST(RANDOM_FILE)
980 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
981 [a suitable file to read random data from])
982 fi
983fi
984
bebd5dbc
DS
985dnl ----------------------------------------------------
986dnl FIX: only check for GnuTLS if OpenSSL is not enabled
987dnl ----------------------------------------------------
988
989dnl Default to compiler & linker defaults for GnuTLS files & libraries.
990OPT_GNUTLS=off
991
992AC_ARG_WITH(gnutls,dnl
993AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
994AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
995 OPT_GNUTLS=$withval)
996
997if test "$OPENSSL_ENABLED" != "1"; then
998
999 if test X"$OPT_GNUTLS" != Xoff; then
1000 if test "x$OPT_GNUTLS" = "xyes"; then
1001 check=`libgnutls-config --version 2>/dev/null`
1002 if test -n "$check"; then
1003 addlib=`libgnutls-config --libs`
1004 addcflags=`libgnutls-config --cflags`
1005 version=`libgnutls-config --version`
241b2b4a 1006 gtlsprefix=`libgnutls-config --prefix`
bebd5dbc
DS
1007 fi
1008 else
1009 addlib="-L$OPT_GNUTLS/lib -lgnutls"
1010 addcflags="-I$OPT_GNUTLS/include"
c2fcdf3a 1011 version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
241b2b4a 1012 gtlsprefix=$OPT_GNUTLS
c2fcdf3a
DS
1013 if test -z "$version"; then
1014 version="unknown"
1015 fi
bebd5dbc
DS
1016 fi
1017
1018 CLEANLDFLAGS="$LDFLAGS"
1019 CLEANCPPFLAGS="$CPPFLAGS"
1020
1021 LDFLAGS="$LDFLAGS $addlib"
1022 if test "$addcflags" != "-I/usr/include"; then
1023 CPPFLAGS="$CPPFLAGS $addcflags"
1024 fi
1025
1026 AC_CHECK_LIB(gnutls, gnutls_check_version,
1027 [
1028 AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1029 AC_SUBST(USE_GNUTLS, [1])
1030 USE_GNUTLS="yes"
1031 curl_ssl_msg="enabled (GnuTLS)"
1032 ],
1033 [
1034 LDFLAGS="$CLEANLDFLAGS"
1035 CPPFLAGS="$CLEANCPPFLAGS"
1036 ])
1037
1038 if test "x$USE_GNUTLS" = "xyes"; then
1039 AC_MSG_NOTICE([detected GnuTLS version $version])
241b2b4a
DS
1040
1041 dnl when shared libs were found in a path that the run-time
1042 dnl linker doesn't search through, we need to add it to
1043 dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1044 dnl due to this
1045
1046 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
1047 export LD_LIBRARY_PATH
bebd5dbc
DS
1048 fi
1049 fi dnl GNUTLS not disabled
1050
1051 if test X"$USE_GNUTLS" != "Xyes"; then
1052 AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
1053 AC_MSG_WARN([Use --with-ssl or --with-gnutls to address this.])
1054 fi
1055
1056fi dnl OPENSSL != 1
1057
ae1912cb
DS
1058dnl **********************************************************************
1059dnl Check for the presence of ZLIB libraries and headers
1060dnl **********************************************************************
1061
ae1912cb 1062dnl Check for & handle argument to --with-zlib.
ae1912cb 1063
e157aabd
DS
1064_cppflags=$CPPFLAGS
1065_ldflags=$LDFLAGS
e157aabd 1066AC_ARG_WITH(zlib,
f136f435
DS
1067AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1068AC_HELP_STRING([--without-zlib],[disable use of zlib]),
1069 [OPT_ZLIB="$withval"])
e890113f 1070
18d87edd
DF
1071if test "$OPT_ZLIB" = "no" ; then
1072 AC_MSG_WARN([zlib disabled])
1073else
1074 if test "$OPT_ZLIB" = "yes" ; then
1075 OPT_ZLIB=""
1076 fi
1077
1078 if test -z "$OPT_ZLIB" ; then
e157aabd
DS
1079 dnl check for the lib first without setting any new path, since many
1080 dnl people have it in the default path
1081
de100f8b
DS
1082 AC_CHECK_LIB(z, inflateEnd,
1083 dnl libz found, set the variable
1084 [HAVE_LIBZ="1"],
18d87edd
DF
1085 dnl if no lib found, try /usr/local
1086 [OPT_ZLIB="/usr/local"])
e157aabd 1087
18d87edd 1088 fi
de100f8b 1089
18d87edd
DF
1090 dnl Add a nonempty path to the compiler flags
1091 if test -n "$OPT_ZLIB"; then
1092 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1093 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1094 fi
1095
1096 AC_CHECK_HEADER(zlib.h,
1097 [
1098 dnl zlib.h was found
1099 HAVE_ZLIB_H="1"
1100 dnl if the lib wasn't found already, try again with the new paths
1101 if test "$HAVE_LIBZ" != "1"; then
1102 AC_CHECK_LIB(z, gzread,
1103 [
1104 dnl the lib was found!
1105 HAVE_LIBZ="1"
1106 ],
1107 [ CPPFLAGS=$_cppflags
1108 LDFLAGS=$_ldflags])
de100f8b 1109 fi
18d87edd
DF
1110 ],
1111 [
1112 dnl zlib.h was not found, restore the flags
1113 CPPFLAGS=$_cppflags
1114 LDFLAGS=$_ldflags]
1115 )
1116
1117 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1118 then
1119 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1120 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1121 then
1122 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1123 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1124 then
1125 dnl both header and lib were found!
1126 AC_SUBST(HAVE_LIBZ)
1127 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1128 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1129
1130 LIBS="$LIBS -lz"
1131
1132 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1133 AMFIXLIB="1"
1134 AC_MSG_NOTICE([found both libz and libz.h header])
1135 curl_zlib_msg="enabled"
1136 fi
1137fi
b174aeaa 1138
4a8155b5 1139dnl set variable for use in automakefile(s)
de100f8b 1140AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
4a8155b5 1141
cff90cf3 1142AC_MSG_CHECKING([whether to build with libidn])
96002646 1143AC_ARG_WITH(libidn,
cff90cf3
DS
1144AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
1145AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
96002646 1146 [LIBIDN="$withval"])
cff90cf3
DS
1147
1148case "$LIBIDN" in
1149 no)
1150 AC_MSG_RESULT(no)
1151 ;;
1152 *) AC_MSG_RESULT(yes)
19a568a9
DS
1153
1154 idn=""
1155 dnl if there is a given path, check that FIRST
7bb6d76d
DS
1156 if test -n "$LIBIDN"; then
1157 if test "x$LIBIDN" != "xyes"; then
1158 AC_MSG_WARN([moo moo $LIBIDN])
1159 oldLDFLAGS=$LDFLAGS
1160 oldCPPFLAGS=$CPPFLAGS
1161 LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
1162 CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
1163 idn="yes"
1164 AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
1165 idn=""
1166 LDFLAGS=$oldLDFLAGS
1167 CPPFLAGS=$oldCPPFLAGS)
1168 fi
19a568a9
DS
1169 fi
1170
1171 if test "x$idn" != "xyes"; then
1172 dnl check with default paths
8c16696f 1173 idn="yes"
19a568a9
DS
1174 AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
1175 idn="")
1176 fi
1177
1178 if test "x$idn" = "xyes"; then
cff90cf3 1179 curl_idn_msg="enabled"
d6460aff 1180 AC_SUBST(IDN_ENABLED, [1])
4e7575fc 1181 dnl different versions of libidn have different setups of these:
1239e483 1182 AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
c6881660 1183 AC_CHECK_HEADERS( idn-free.h tld.h )
cff90cf3
DS
1184 fi
1185
1186 ;;
1187esac
1188
b174aeaa
DS
1189dnl Default is to try the thread-safe versions of a few functions
1190OPT_THREAD=on
243942a7
DS
1191
1192dnl detect AIX 4.3 or later
1193dnl see full docs on this reasoning in the lib/hostip.c source file
1194AC_MSG_CHECKING([AIX 4.3 or later])
1195AC_PREPROC_IFELSE([
1196#if defined(_AIX) && defined(_AIX43)
1197printf("just fine");
1198#else
1199#error "this is not AIX 4.3 or later"
1200#endif
1201],
1202 [ AC_MSG_RESULT([yes])
abd65e21 1203 RECENTAIX=yes
243942a7
DS
1204 OPT_THREAD=off ],
1205 [ AC_MSG_RESULT([no]) ]
1206)
1207
b174aeaa 1208AC_ARG_ENABLE(thread,dnl
a53d7848
DS
1209AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
1210AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
1211[ case "$enableval" in
1212 no)
1213 OPT_THREAD=off
1214 AC_MSG_WARN(libcurl will not get built using thread-safe functions)
1215 ;;
1216 *)
1217 ;;
1218 esac
1219]
b174aeaa
DS
1220)
1221
1222if test X"$OPT_THREAD" = Xoff
1223then
b174aeaa
DS
1224 AC_DEFINE(DISABLED_THREADSAFE, 1, \
1225Set to explicitly specify we don't want to use thread-safe functions)
1226else
9f2780a2
DS
1227 if test "$ipv6" != "yes"; then
1228 dnl dig around for gethostbyname_r()
1229 CURL_CHECK_GETHOSTBYNAME_R()
b174aeaa 1230
9f2780a2 1231 dnl dig around for gethostbyaddr_r()
f633ab68 1232 dnl CURL_CHECK_GETHOSTBYADDR_R()
9f2780a2 1233 fi
d4731b70 1234
61fb8fea
DS
1235 dnl poke around for inet_ntoa_r()
1236 CURL_CHECK_INET_NTOA_R()
d4731b70 1237
61fb8fea
DS
1238 dnl is there a localtime_r()
1239 CURL_CHECK_LOCALTIME_R()
d4731b70 1240
242be557
DS
1241 dnl is there a strerror_r()
1242 CURL_CHECK_STRERROR_R()
1243
650b9504 1244 AC_CHECK_FUNCS( gmtime_r )
b174aeaa
DS
1245fi
1246
abd65e21 1247dnl for recent AIX versions, we skip all the thread-safe checks above since
0eace2fe
DS
1248dnl they claim a thread-safe libc using the standard API. But there are
1249dnl some functions still not thread-safe. Check for these!
1250
1251dnl Let's hope this split URL remains working:
1252dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
1253dnl genprogc/thread_quick_ref.htm
abd65e21
DS
1254
1255if test "x$RECENTAIX" = "xyes"; then
db302a10
DS
1256
1257 AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
62af3fb7
DS
1258
1259 dnl check if this is the IMB xlc compiler
1260 dnl Details thanks to => http://predef.sourceforge.net/
1261 AC_MSG_CHECKING([if this is the xlc compiler])
1262 AC_EGREP_CPP([^__xlC__], [__xlC__],
1263 dnl action if the text is found, this it has not been replaced by the
1264 dnl cpp
1265 XLC="no"
1266 AC_MSG_RESULT([no]),
1267 dnl the text was not found, it was replaced by the cpp
1268 XLC="yes"
1269 AC_MSG_RESULT([yes])
1270 CFLAGS="$CFLAGS -qthreaded"
1271 )
1272
62ff567c
DS
1273
1274 dnl is there a localtime_r()
1275 CURL_CHECK_LOCALTIME_R()
1276
1277 dnl is there a strerror_r()
1278 CURL_CHECK_STRERROR_R()
1279
1280 AC_CHECK_FUNCS( gmtime_r )
abd65e21
DS
1281fi
1282
1283
ae1912cb
DS
1284dnl **********************************************************************
1285dnl Back to "normal" configuring
1286dnl **********************************************************************
1287
1288dnl Checks for header files.
1289AC_HEADER_STDC
075c5342
DS
1290
1291dnl First check for the very most basic headers. Then we can use these
1292dnl ones as default-headers when checking for the rest!
1293AC_CHECK_HEADERS(
1294 sys/types.h \
1295 sys/time.h \
1296 sys/select.h \
1297 sys/socket.h \
a4351517 1298 sys/ioctl.h \
24ac5b8a 1299 assert.h \
ae1912cb 1300 unistd.h \
8898ff9e
DS
1301 malloc.h \
1302 stdlib.h \
3d66d10f 1303 limits.h \
ae1912cb
DS
1304 arpa/inet.h \
1305 net/if.h \
1306 netinet/in.h \
43137cf5 1307 netinet/tcp.h \
ae1912cb 1308 netdb.h \
ae1912cb
DS
1309 sys/sockio.h \
1310 sys/stat.h \
ae1912cb
DS
1311 sys/param.h \
1312 termios.h \
1313 termio.h \
1314 sgtty.h \
1315 fcntl.h \
1316 dlfcn.h \
1317 alloca.h \
1318 winsock.h \
2e973684 1319 winsock2.h \
ae1912cb
DS
1320 time.h \
1321 io.h \
5900c0f7 1322 pwd.h \
82d3ded9 1323 utime.h \
3c49b405 1324 sys/utime.h \
99dfdebc 1325 sys/poll.h \
a4e1ac79 1326 sys/resource.h \
8e872231 1327 libgen.h \
82d6cfa7 1328 locale.h \
65dbee01 1329 errno.h \
075c5342
DS
1330 setjmp.h,
1331dnl to do if not found
1332[],
1333dnl to do if found
1334[],
1335dnl default includes
1336[
1337#ifdef HAVE_SYS_TYPES_H
1338#include <sys/types.h>
1339#endif
1340#ifdef HAVE_SYS_TIME_H
1341#include <sys/time.h>
1342#endif
1343#ifdef HAVE_SYS_SELECT_H
1344#include <sys/select.h>
1345#endif
1346#ifdef HAVE_SYS_SOCKET_H
1347#include <sys/socket.h>
1348#endif
d85c2199
DS
1349#ifdef HAVE_NETINET_IN_H
1350#include <netinet/in.h>
1351#endif
075c5342 1352]
ae1912cb
DS
1353)
1354
ae1912cb
DS
1355dnl Checks for typedefs, structures, and compiler characteristics.
1356AC_C_CONST
1357AC_TYPE_SIZE_T
1358AC_HEADER_TIME
1359
6cd0a90b
DS
1360AC_CHECK_SIZEOF(curl_off_t, ,[
1361#include <stdio.h>
1362#include "$srcdir/include/curl/curl.h"
1363])
78e6508e 1364AC_CHECK_SIZEOF(size_t)
af677c4e 1365AC_CHECK_SIZEOF(long)
cd73a733 1366AC_CHECK_SIZEOF(time_t)
ae1912cb 1367
a147a079 1368AC_CHECK_TYPE(long long,
af677c4e
DS
1369 [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
1370 longlong="yes"
1371)
1372
1373if test "xyes" = "x$longlong"; then
1374 AC_MSG_CHECKING([if numberLL works])
1375 AC_COMPILE_IFELSE([long long val = 1000LL;],
1376 [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
1377 AC_MSG_RESULT(yes),
1378 AC_MSG_RESULT(no)
1379 )
1380fi
1381
ae1912cb 1382
61e2a810 1383# check for ssize_t
a147a079
DS
1384AC_CHECK_TYPE(ssize_t, ,
1385 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
61e2a810 1386
a1cec0e4 1387TYPE_SOCKLEN_T
d09b4369 1388TYPE_IN_ADDR_T
11693c0f 1389
ad05d0a8
DS
1390AC_FUNC_SELECT_ARGTYPES
1391
ae1912cb
DS
1392dnl Checks for library functions.
1393dnl AC_PROG_GCC_TRADITIONAL
1394AC_TYPE_SIGNAL
f8e916db 1395dnl AC_FUNC_VPRINTF
4eb9ac08
DS
1396AC_CHECK_FUNCS( strtoll \
1397 socket \
ae1912cb
DS
1398 select \
1399 strdup \
1400 strstr \
4e376a2f 1401 strtok_r \
ae1912cb
DS
1402 uname \
1403 strcasecmp \
95c2534a
DS
1404 stricmp \
1405 strcmpi \
ae1912cb 1406 gethostbyaddr \
ae1912cb
DS
1407 gettimeofday \
1408 inet_addr \
1409 inet_ntoa \
c86768d8 1410 inet_pton \
ae1912cb 1411 perror \
0e31dadf 1412 closesocket \
02437b2d 1413 siginterrupt \
852b664e 1414 sigaction \
1ff573c6 1415 signal \
f6e2bfd4 1416 getpass_r \
92186dc3
DS
1417 strlcat \
1418 getpwuid \
43d0d756 1419 geteuid \
5900c0f7 1420 dlopen \
3c49b405 1421 utime \
6a3e2272 1422 sigsetjmp \
8e872231 1423 basename \
82d6cfa7 1424 setlocale \
2e973684 1425 ftruncate \
facfa19c 1426 pipe \
a4e1ac79
DS
1427 poll \
1428 getrlimit \
1429 setrlimit,
70b80b01
DS
1430dnl if found
1431[],
1432dnl if not found, $ac_func is the name we check for
1433 func="$ac_func"
1434 AC_MSG_CHECKING([deeper for $func])
1435 AC_TRY_LINK( [],
1436 [ $func ();],
1437 AC_MSG_RESULT(yes!)
d65587b0 1438 eval "ac_cv_func_$func=yes"
70b80b01 1439 def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
d65587b0 1440 AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
70b80b01
DS
1441 AC_MSG_RESULT(but still no)
1442 )
1443
ae1912cb
DS
1444)
1445
25559ac0
DS
1446dnl For some reason, the check above doesn't properly detect select() with
1447dnl Msys/Mingw
1448if test "$ac_cv_func_select" != "yes"; then
1449 AC_MSG_CHECKING([for select in ws2_32])
1450 AC_TRY_LINK([#include <winsock2.h>],
1451 [select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);],
1452 [ dnl worked!
1453 AC_MSG_RESULT([yes])
1454 HAVE_SELECT="1"
1455 AC_DEFINE_UNQUOTED(HAVE_SELECT,1)],
1456 [AC_MSG_ERROR(You can't compile without a select)]
1457 )
1458fi
1459
3c49b405
DS
1460dnl sigsetjmp() might be a macro and no function so if it isn't found already
1461dnl we make an extra check here!
1462if test "$ac_cv_func_sigsetjmp" != "yes"; then
1463 AC_MSG_CHECKING([for sigsetjmp defined as macro])
1464 AC_TRY_LINK( [#include <setjmp.h>],
1465 [sigjmp_buf jmpenv;
1466 sigsetjmp(jmpenv, 1);],
1467 AC_MSG_RESULT(yes)
22a32389 1468 AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
3c49b405
DS
1469 AC_MSG_RESULT(no)
1470 )
1471fi
1472
76637759
DS
1473AC_CHECK_DECL(basename, ,
1474 AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
1475#ifdef HAVE_STRING_H
1476#include <string.h>
1477#endif
1478#ifdef HAVE_LIBGEN_H
1479#include <libgen.h>
1480#endif
1481)
1482
a7b99fc4
DS
1483dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
1484dnl to find out we make an extra check here!
1485if test "$ac_cv_func_poll" = "yes"; then
1486 AC_MSG_CHECKING([if poll works with NULL inputs])
1487 AC_RUN_IFELSE([
1488#ifdef HAVE_SYS_POLL_H
1489#include <sys/poll.h>
1490#endif
1491
1492 int main(void)
1493 {
1494 /* make this return 0 == timeout since there's nothing to read from */
1495 return poll((void *)0, 0, 10 /*ms*/);
1496 }
1497],
1498 AC_MSG_RESULT(yes)
1499 AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
1500 AC_MSG_RESULT(no),
1501 AC_MSG_RESULT(cross-compiling assumes yes)
1502 AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
1503 ) dnl end of AC_RUN_IFELSE
1504fi
1505
1506
1507
7dc36344
DS
1508AC_PATH_PROG( PERL, perl, ,
1509 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
1510AC_SUBST(PERL)
ae1912cb 1511
90719eb3 1512AC_PATH_PROGS( NROFF, gnroff nroff, ,
ae1912cb 1513 $PATH:/usr/bin/:/usr/local/bin )
96dde76b 1514AC_SUBST(NROFF)
ae1912cb 1515
773e7e87
DS
1516if test -n "$NROFF"; then
1517 dnl only check for nroff options if an nroff command was found
1518
1519 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
1520 MANOPT="-man"
37685848
DS
1521 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1522 if test -z "$mancheck"; then
773e7e87
DS
1523 MANOPT="-mandoc"
1524 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1525 if test -z "$mancheck"; then
1526 MANOPT=""
1527 AC_MSG_RESULT([failed])
1528 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
1529 else
1530 AC_MSG_RESULT([$MANOPT])
1531 fi
37685848
DS
1532 else
1533 AC_MSG_RESULT([$MANOPT])
1534 fi
773e7e87
DS
1535 AC_SUBST(MANOPT)
1536fi
1537
1538if test -z "$MANOPT"
1539then
1540 dnl if no nroff tool was found, or no option that could convert man pages
1541 dnl was found, then disable the built-in manual stuff
1542 AC_MSG_WARN([disabling built-in manual])
1543 USE_MANUAL="no";
37685848 1544fi
37685848 1545
f3663a9d
DS
1546dnl *************************************************************************
1547dnl If the manual variable still is set, then we go with providing a built-in
1548dnl manual
1549
1550if test "$USE_MANUAL" = "1"; then
1551 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
cff90cf3 1552 curl_manual_msg="enabled"
f3663a9d
DS
1553fi
1554
1555dnl set variable for use in automakefile(s)
1556AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
1557
673ff5eb
DS
1558AC_MSG_CHECKING([whether to enable ares])
1559AC_ARG_ENABLE(ares,
1560AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
1561AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
1562[ case "$enableval" in
1563 no)
1564 AC_MSG_RESULT(no)
1565 ;;
1566 *) AC_MSG_RESULT(yes)
1567
1568 if test "x$IPV6_ENABLED" = "x1"; then
1569 AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
1570 fi
1571
1572 AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
1573 dnl substitute HAVE_ARES for curl-config and similar
1574 HAVE_ARES="1"
1575 AC_SUBST(HAVE_ARES)
1576 curl_ares_msg="enabled"
1577
1578 LIBS="$LIBS -lcares"
1579
1580 dnl For backwards compatibility default to includes/lib in srcdir/ares
1581 dnl If a value is specified it is assumed that the libs are in $val/lib
1582 dnl and the includes are in $val/include. This is the default setup for
1583 dnl ares so it should not be a problem.
1584 if test "x$enableval" = "xyes" ; then
1585 if test -d "$srcdir/ares"; then
1586 aresembedded="yes"
1587 AC_CONFIG_SUBDIRS(ares)
1588 aresinc=`cd $srcdir/ares && pwd`
1589 CPPFLAGS="$CPPFLAGS -I$aresinc"
1590
1591 dnl the pwd= below cannot 'cd' into the ares dir to get the full
1592 dnl path to it, since it may not exist yet if we build outside of
1593 dnl the source tree
1594 pwd=`pwd`
1595 LDFLAGS="$LDFLAGS -L$pwd/ares"
1596 fi
1597 else
1598 CPPFLAGS="$CPPFLAGS -I$enableval/include"
1599 LDFLAGS="$LDFLAGS -L$enableval/lib"
1600 fi
1601
1602 if test -z "$aresembedded"; then
1603 dnl verify that a sufficient c-ares is here if we have pointed one
1604 dnl out and don't use the "embedded" ares dir (in which case we don't
1605 dnl check it because it might not have been built yet)
1606 AC_MSG_CHECKING([that c-ares is good and recent enough])
1607 AC_LINK_IFELSE( [
1608#include <ares.h>
1609/* provide a set of dummy functions in case c-ares was built with debug */
1610void curl_dofree() { }
1611void curl_sclose() { }
1612void curl_domalloc() { }
f3663a9d 1613
673ff5eb
DS
1614int main(void)
1615{
1616 ares_channel channel;
1617 ares_cancel(channel);
1618 return 0;
1619}
1620],
1621 AC_MSG_RESULT(yes),
1622 AC_MSG_RESULT(no)
1623 AC_MSG_ERROR([c-ares library defective or too old])
1624 )
1625 fi
1626 ;;
1627 esac ],
1628 AC_MSG_RESULT(no)
1629)
ae1912cb 1630
710e370c
DS
1631dnl ************************************************************
1632dnl disable verbose text strings
1633dnl
1634AC_MSG_CHECKING([whether to enable verbose strings])
1635AC_ARG_ENABLE(verbose,
1636AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
1637AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
1638[ case "$enableval" in
1639 no)
1640 AC_MSG_RESULT(no)
1641 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
1642 AC_SUBST(CURL_DISABLE_VERBOSE_STRINGS)
1643 curl_verbose_msg="no"
1644 ;;
1645 *) AC_MSG_RESULT(yes)
1646 ;;
1647 esac ],
1648 AC_MSG_RESULT(yes)
1649)
1650
8ed31c48
DS
1651dnl ************************************************************
1652dnl enable SSPI support
1653dnl
1654AC_MSG_CHECKING([whether to enable SSPI support (win32 builds only)])
1655AC_ARG_ENABLE(sspi,
1656AC_HELP_STRING([--enable-sspi],[Enable SSPI])
1657AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
1658[ case "$enableval" in
1659 yes)
1660 AC_MSG_RESULT(yes)
1661 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
1662 AC_SUBST(USE_WINDOWS_SSPI)
1663 LIBS="$LIBS -lsecur32"
1664 curl_sspi_msg="yes"
1665 ;;
1666 *)
1667 AC_MSG_RESULT(no)
1668 ;;
1669 esac ],
1670 AC_MSG_RESULT(no)
1671)
1672
3c49b405
DS
1673dnl ************************************************************
1674dnl lame option to switch on debug options
1675dnl
1676AC_MSG_CHECKING([whether to enable debug options])
1677AC_ARG_ENABLE(debug,
f136f435
DS
1678AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
1679AC_HELP_STRING([--disable-debug],[Disable debug options]),
3c49b405
DS
1680[ case "$enableval" in
1681 no)
1682 AC_MSG_RESULT(no)
1683 ;;
1684 *) AC_MSG_RESULT(yes)
1685
f8c3b3aa 1686 CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
4fa58560 1687 CFLAGS="$CFLAGS -g"
455b1af2 1688
4fa58560
DS
1689 dnl set compiler "debug" options to become more picky, and remove
1690 dnl optimize options from CFLAGS
1691 CURL_CC_DEBUG_OPTS
3c49b405 1692 ;;
4fa58560
DS
1693 esac
1694 ],
3c49b405
DS
1695 AC_MSG_RESULT(no)
1696)
1697
94043b11
DS
1698dnl ************************************************************
1699dnl disable cryptographic authentication
1700dnl
1701AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
1702AC_ARG_ENABLE(crypto-auth,
1703AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
1704AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
1705[ case "$enableval" in
1706 no)
1707 AC_MSG_RESULT(no)
1708 AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
1709 AC_SUBST(CURL_DISABLE_CRYPTO_AUTH)
1710 ;;
1711 *) AC_MSG_RESULT(yes)
1712 ;;
1713 esac ],
1714 AC_MSG_RESULT(yes)
1715)
1716
ac269a8f
DS
1717dnl ************************************************************
1718dnl disable cookies support
1719dnl
1720AC_MSG_CHECKING([whether to enable support for cookies])
1721AC_ARG_ENABLE(cookies,
1722AC_HELP_STRING([--enable-cookies],[Enable cookies support])
1723AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
1724[ case "$enableval" in
1725 no)
1726 AC_MSG_RESULT(no)
1727 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
1728 AC_SUBST(CURL_DISABLE_COOKIES)
1729 ;;
1730 *) AC_MSG_RESULT(yes)
1731 ;;
1732 esac ],
1733 AC_MSG_RESULT(yes)
1734)
1735
9f3d9da1
DS
1736if test "x$ws2" = "xyes"; then
1737
1738 dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
1739 dnl things work when built with c-ares). But we can't just move it last
1740 dnl since then other stuff (SSL) won't build. So we simply append it to the
1741 dnl end.
1742
1743 LIBS="$LIBS -lws2_32"
1744
1745fi
1746
20705ca3
DS
1747AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
1748
93c53424 1749AC_CONFIG_FILES([Makefile \
f71a1485 1750 docs/Makefile \
d54cdf29 1751 docs/examples/Makefile \
e22657ea 1752 docs/libcurl/Makefile \
c3c77398
DS
1753 include/Makefile \
1754 include/curl/Makefile \
ae1912cb 1755 src/Makefile \
172f0ba1 1756 lib/Makefile \
044ca343 1757 tests/Makefile \
b915ca68 1758 tests/data/Makefile \
fd8bf5f1 1759 tests/server/Makefile \
2aa0c6c4 1760 tests/libtest/Makefile \
9ade752f
DS
1761 packages/Makefile \
1762 packages/Win32/Makefile \
fbb9d23a 1763 packages/Win32/cygwin/Makefile \
9ade752f
DS
1764 packages/Linux/Makefile \
1765 packages/Linux/RPM/Makefile \
d54cdf29 1766 packages/Linux/RPM/curl.spec \
aa860990 1767 packages/Linux/RPM/curl-ssl.spec \
c503930b 1768 packages/Solaris/Makefile \
d78ec593 1769 packages/DOS/Makefile \
34f9ab10
DS
1770 packages/EPM/curl.list \
1771 packages/EPM/Makefile \
f19cade5 1772 packages/vms/Makefile \
df3ca591
DS
1773 curl-config \
1774 libcurl.pc
93c53424
DS
1775])
1776AC_OUTPUT
cff90cf3
DS
1777
1778AC_MSG_NOTICE([Configured to build curl/libcurl:
1779
1780 curl version: ${VERSION}
1781 Host setup: ${host}
1782 Install prefix: ${prefix}
1783 Compiler: ${CC}
1784 SSL support: ${curl_ssl_msg}
1785 zlib support: ${curl_zlib_msg}
1786 krb4 support: ${curl_krb4_msg}
1787 GSSAPI support: ${curl_gss_msg}
48975876 1788 SPNEGO support: ${curl_spnego_msg}
cff90cf3
DS
1789 c-ares support: ${curl_ares_msg}
1790 ipv6 support: ${curl_ipv6_msg}
96002646 1791 IDN support: ${curl_idn_msg}
cff90cf3
DS
1792 Build libcurl: Shared=${enable_shared}, Static=${enable_static}
1793 Built-in manual: ${curl_manual_msg}
710e370c 1794 Verbose errors: ${curl_verbose_msg}
8ed31c48 1795 SSPI support: ${curl_sspi_msg}
cff90cf3 1796])