]> git.ipfire.org Git - thirdparty/curl.git/blame - configure.ac
localtime and gmtime are not thread-safe on newer AIXes either so we force
[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
DS
6dnl We don't know the version number "staticly" so we use a dash here
7AC_INIT(curl, [-], [curl-bug@haxx.se])
8
9dnl configure script copyright
053f6c85 10AC_COPYRIGHT([Copyright (c) 1998 - 2004 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
075c5342
DS
19AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin)
20AC_SUBST(SED)
21
9f7c6341
DS
22dnl AR is used by libtool, and try the odd Solaris path too
23AC_PATH_PROG( AR, ar, , $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
24AC_SUBST(AR)
25
7349940b 26dnl figure out the libcurl version
075c5342 27VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
8f5ffd94 28AM_INIT_AUTOMAKE(curl,$VERSION)
075c5342
DS
29AC_MSG_CHECKING([curl version])
30AC_MSG_RESULT($VERSION)
caf8c01e 31
1e5e0f9a
DS
32dnl
33dnl we extract the numerical version for curl-config only
075c5342 34VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curl.h`
1e5e0f9a
DS
35AC_SUBST(VERSIONNUM)
36
c503930b
CB
37dnl Solaris pkgadd support definitions
38PKGADD_PKG="HAXXcurl"
39PKGADD_NAME="cURL - a client that groks URLs"
40PKGADD_VENDOR="curl.haxx.se"
41AC_SUBST(PKGADD_PKG)
42AC_SUBST(PKGADD_NAME)
43AC_SUBST(PKGADD_VENDOR)
44
45
caf8c01e
DS
46dnl
47dnl Detect the canonical host and target build environment
48dnl
ae1912cb 49
c77f77a1 50AC_CANONICAL_HOST
93c53424 51dnl Get system canonical name
22a32389 52AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
1b1f143c
DS
53
54dnl Check for AIX weirdos
55AC_AIX
56
93c53424
DS
57dnl Checks for programs.
58AC_PROG_CC
59
d4ffc5ef 60dnl check for how to do large files
1b1f143c 61AC_SYS_LARGEFILE
d4ffc5ef 62
1e8f0c57
DS
63dnl check for cygwin stuff
64AC_LIBTOOL_WIN32_DLL
65
66dnl libtool setup
93c53424
DS
67AM_PROG_LIBTOOL
68
fcfc6de9 69AC_MSG_CHECKING([if we need -no-undefined])
ecf3aee4 70case $host in
c2e2c98d 71 *-*-cygwin | *-*-mingw* | *-*-pw32*)
ecf3aee4
DS
72 need_no_undefined=yes
73 ;;
74 *)
75 need_no_undefined=no
76 ;;
77esac
fcfc6de9 78AC_MSG_RESULT($need_no_undefined)
ecf3aee4
DS
79AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
80
fcfc6de9
DS
81AC_MSG_CHECKING([if we need -mimpure-text])
82case $host in
83 *-*-solaris2*)
84 if test "$GCC" = "yes"; then
85 mimpure="yes"
86 fi
87 ;;
88 *)
89 mimpure=no
90 ;;
91esac
92AC_MSG_RESULT($mimpure)
93AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
94
d1a1fcc6
DS
95dnl The install stuff has already been taken care of by the automake stuff
96dnl AC_PROG_INSTALL
ae1912cb
DS
97AC_PROG_MAKE_SET
98
fd3881ea
DS
99dnl ************************************************************
100dnl switch off particular protocols
101dnl
102AC_MSG_CHECKING([whether to support http])
103AC_ARG_ENABLE(http,
f136f435
DS
104AC_HELP_STRING([--enable-http],[Enable HTTP support])
105AC_HELP_STRING([--disable-http],[Disable HTTP support]),
fd3881ea
DS
106[ case "$enableval" in
107 no)
108 AC_MSG_RESULT(no)
22a32389 109 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
fd3881ea 110 AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
22a32389 111 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
fd3881ea
DS
112 AC_SUBST(CURL_DISABLE_HTTP)
113 AC_SUBST(CURL_DISABLE_GOPHER)
114 ;;
115 *) AC_MSG_RESULT(yes)
116 ;;
117 esac ],
118 AC_MSG_RESULT(yes)
119)
120AC_MSG_CHECKING([whether to support ftp])
121AC_ARG_ENABLE(ftp,
f136f435
DS
122AC_HELP_STRING([--enable-ftp],[Enable FTP support])
123AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
fd3881ea
DS
124[ case "$enableval" in
125 no)
126 AC_MSG_RESULT(no)
22a32389 127 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
fd3881ea
DS
128 AC_SUBST(CURL_DISABLE_FTP)
129 ;;
130 *) AC_MSG_RESULT(yes)
131 ;;
132 esac ],
133 AC_MSG_RESULT(yes)
134)
135AC_MSG_CHECKING([whether to support gopher])
136AC_ARG_ENABLE(gopher,
f136f435
DS
137AC_HELP_STRING([--enable-gopher],[Enable GOPHER support])
138AC_HELP_STRING([--disable-gopher],[Disable GOPHER support]),
fd3881ea
DS
139[ case "$enableval" in
140 no)
141 AC_MSG_RESULT(no)
22a32389 142 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
fd3881ea
DS
143 AC_SUBST(CURL_DISABLE_GOPHER)
144 ;;
145 *) AC_MSG_RESULT(yes)
146 ;;
147 esac ],
148 AC_MSG_RESULT(yes)
149)
150AC_MSG_CHECKING([whether to support file])
151AC_ARG_ENABLE(file,
f136f435
DS
152AC_HELP_STRING([--enable-file],[Enable FILE support])
153AC_HELP_STRING([--disable-file],[Disable FILE support]),
fd3881ea
DS
154[ case "$enableval" in
155 no)
156 AC_MSG_RESULT(no)
22a32389 157 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
fd3881ea
DS
158 AC_SUBST(CURL_DISABLE_FILE)
159 ;;
160 *) AC_MSG_RESULT(yes)
161 ;;
162 esac ],
163 AC_MSG_RESULT(yes)
164)
165AC_MSG_CHECKING([whether to support ldap])
166AC_ARG_ENABLE(ldap,
f136f435
DS
167AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
168AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
fd3881ea
DS
169[ case "$enableval" in
170 no)
171 AC_MSG_RESULT(no)
22a32389 172 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
fd3881ea
DS
173 AC_SUBST(CURL_DISABLE_LDAP)
174 ;;
175 *) AC_MSG_RESULT(yes)
176 ;;
177 esac ],
178 AC_MSG_RESULT(yes)
179)
180AC_MSG_CHECKING([whether to support dict])
181AC_ARG_ENABLE(dict,
f136f435
DS
182AC_HELP_STRING([--enable-dict],[Enable DICT support])
183AC_HELP_STRING([--disable-dict],[Disable DICT support]),
fd3881ea
DS
184[ case "$enableval" in
185 no)
186 AC_MSG_RESULT(no)
b9c60df0 187 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
fd3881ea
DS
188 AC_SUBST(CURL_DISABLE_DICT)
189 ;;
190 *) AC_MSG_RESULT(yes)
191 ;;
192 esac ],
193 AC_MSG_RESULT(yes)
194)
195AC_MSG_CHECKING([whether to support telnet])
196AC_ARG_ENABLE(telnet,
f136f435
DS
197AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
198AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
fd3881ea
DS
199[ case "$enableval" in
200 no)
201 AC_MSG_RESULT(no)
22a32389 202 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
fd3881ea
DS
203 AC_SUBST(CURL_DISABLE_TELNET)
204 ;;
205 *) AC_MSG_RESULT(yes)
206 ;;
207 esac ],
208 AC_MSG_RESULT(yes)
209)
210
f3663a9d
DS
211dnl **********************************************************************
212dnl Check for built-in manual
213dnl **********************************************************************
214
215AC_MSG_CHECKING([whether to provide built-in manual])
216AC_ARG_ENABLE(manual,
217AC_HELP_STRING([--enable-manual],[Enable built-in manual])
218AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
219[ case "$enableval" in
220 no)
221 AC_MSG_RESULT(no)
222 ;;
223 *) AC_MSG_RESULT(yes)
224 USE_MANUAL="1"
225 ;;
226 esac ],
227 AC_MSG_RESULT(yes)
228 USE_MANUAL="1"
229)
230dnl The actual use of the USE_MANUAL variable is done much later in this
231dnl script to allow other actions to disable it as well.
232
233
ae1912cb
DS
234dnl **********************************************************************
235dnl Checks for libraries.
236dnl **********************************************************************
237
9f2780a2
DS
238dnl gethostbyname without lib or in the nsl lib?
239AC_CHECK_FUNC(gethostbyname,
240 [HAVE_GETHOSTBYNAME="1"
241 ],
242 [ AC_CHECK_LIB(nsl, gethostbyname,
243 [HAVE_GETHOSTBYNAME="1"
244 LIBS="$LIBS -lnsl"
245 ])
246 ])
247
248if test "$HAVE_GETHOSTBYNAME" != "1"
249then
61fb8fea 250 dnl gethostbyname in the socket lib?
9f2780a2
DS
251 AC_CHECK_LIB(socket, gethostbyname,
252 [HAVE_GETHOSTBYNAME="1"
253 LIBS="$LIBS -lsocket"
254 ])
61fb8fea
DS
255fi
256
9f2780a2
DS
257dnl At least one system has been identified to require BOTH nsl and socket
258dnl libs at the same time to link properly.
259if test "$HAVE_GETHOSTBYNAME" != "1"
260then
261 AC_MSG_CHECKING([trying gethostbyname with both nsl and socket libs])
caf8c01e
DS
262 my_ac_save_LIBS=$LIBS
263 LIBS="-lnsl -lsocket $LIBS"
264 AC_TRY_LINK( ,
265 [gethostbyname();],
9f2780a2
DS
266 [ dnl found it!
267 HAVE_GETHOSTBYNAME="1",
268 AC_MSG_RESULT([yes])],
269 [ dnl failed!
270 AC_MSG_RESULT([no])
271 dnl restore LIBS
272 LIBS=$my_ac_save_LIBS]
273 )
274fi
caf8c01e 275
9f2780a2
DS
276if test "$HAVE_GETHOSTBYNAME" != "1"
277then
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");],
284 [ dnl worked!
a3d39efa 285 AC_MSG_RESULT([yes])
9f2780a2
DS
286 HAVE_GETHOSTBYNAME="1"],
287 [ dnl failed, restore LIBS
288 LIBS=$my_ac_save_LIBS
289 AC_MSG_RESULT(no)]
290 )
291fi
292
293if test "$HAVE_GETHOSTBYNAME" = "1"; then
294 AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
295else
296 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
caf8c01e
DS
297fi
298
ae1912cb 299dnl resolve lib?
22a32389 300AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
ae1912cb 301
b174aeaa
DS
302if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
303 AC_CHECK_LIB(resolve, strcasecmp,
304 [LIBS="-lresolve $LIBS"],
305 ,
306 -lnsl)
307fi
308
ae1912cb 309dnl socket lib?
22a32389 310AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
ae1912cb 311
ae1912cb 312dnl dl lib?
22a32389 313AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
ae1912cb 314
075c5342
DS
315AC_MSG_CHECKING([whether to use libgcc])
316AC_ARG_ENABLE(libgcc,
317AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
318[ case "$enableval" in
319 yes)
320 LIBS="$LIBS -lgcc"
321 AC_MSG_RESULT(yes)
322 ;;
323 *) AC_MSG_RESULT(no)
324 ;;
325 esac ],
326 AC_MSG_RESULT(no)
327)
328
3ec605de
DS
329dnl **********************************************************************
330dnl Check for the presence of the winmm library.
331dnl **********************************************************************
332
333AC_MSG_CHECKING([for timeGetTime in winmm])
334my_ac_save_LIBS=$LIBS
335LIBS="-lwinmm $LIBS"
336AC_TRY_LINK([#include <windef.h>
337 #include <mmsystem.h>
338 ],
339 [timeGetTime();],
340 [ dnl worked!
341 AC_MSG_RESULT([yes])
342 ],
343 [ dnl failed, restore LIBS
344 LIBS=$my_ac_save_LIBS
345 AC_MSG_RESULT(no)]
346 )
347
d1b17779
DS
348dnl **********************************************************************
349dnl Checks for IPv6
350dnl **********************************************************************
351
352AC_MSG_CHECKING([whether to enable ipv6])
353AC_ARG_ENABLE(ipv6,
354AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
355AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
356[ case "$enableval" in
357 no)
358 AC_MSG_RESULT(no)
359 ipv6=no
360 ;;
361 *) AC_MSG_RESULT(yes)
362 ipv6=yes
363 ;;
364 esac ],
365
366 AC_TRY_RUN([ /* is AF_INET6 available? */
367#include <sys/types.h>
368#include <sys/socket.h>
369main()
370{
371 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
372 exit(1);
373 else
374 exit(0);
375}
376],
377 AC_MSG_RESULT(yes)
378 ipv6=yes,
379 AC_MSG_RESULT(no)
380 ipv6=no,
381 AC_MSG_RESULT(no)
382 ipv6=no
383))
384
385if test "$ipv6" = "yes"; then
386 CURL_CHECK_WORKING_GETADDRINFO
387fi
388
6ca45bea
DS
389dnl **********************************************************************
390dnl Check how non-blocking sockets are set
391dnl **********************************************************************
392AC_ARG_ENABLE(nonblocking,
f136f435
DS
393AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
394AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
6ca45bea
DS
395[
396 if test "$enableval" = "no" ; then
397 AC_MSG_WARN([non-blocking sockets disabled])
22a32389
DS
398 AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
399 [to disable NON-BLOCKING connections])
6ca45bea
DS
400 else
401 CURL_CHECK_NONBLOCKING_SOCKET
402 fi
403],
404[
405 CURL_CHECK_NONBLOCKING_SOCKET
406])
407
2ef13230
DS
408dnl **********************************************************************
409dnl Check for the random seed preferences
410dnl **********************************************************************
411
412AC_ARG_WITH(egd-socket,
f136f435
DS
413AC_HELP_STRING([--with-egd-socket=FILE],
414 [Entropy Gathering Daemon socket pathname]),
2ef13230
DS
415 [ EGD_SOCKET="$withval" ]
416)
417if test -n "$EGD_SOCKET" ; then
22a32389
DS
418 AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
419 [your Entropy Gathering Daemon socket pathname] )
2ef13230
DS
420fi
421
422dnl Check for user-specified random device
423AC_ARG_WITH(random,
f136f435 424AC_HELP_STRING([--with-random=FILE],[read randomness from FILE (default=/dev/urandom)]),
2ef13230
DS
425 [ RANDOM_FILE="$withval" ],
426 [
427 dnl Check for random device
22a32389 428 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
2ef13230
DS
429 ]
430)
431if test -n "$RANDOM_FILE" ; then
432 AC_SUBST(RANDOM_FILE)
22a32389
DS
433 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
434 [a suitable file to read random data from])
2ef13230
DS
435fi
436
7f67a28c
DS
437dnl **********************************************************************
438dnl Check if the operating system allows programs to write to their own argv[]
439dnl **********************************************************************
440
441AC_MSG_CHECKING([if argv can be written to])
0717e469 442AC_CACHE_VAL(curl_cv_writable_argv, [
a139ce90 443AC_RUN_IFELSE([[
7f67a28c
DS
444int main(int argc, char ** argv) {
445 argv[0][0] = ' ';
446 return (argv[0][0] == ' ')?0:1;
447}
a139ce90 448 ]],
0717e469
DS
449 curl_cv_writable_argv=yes,
450 curl_cv_writable_argv=no,
451 curl_cv_writable_argv=cross)
452])
453case $curl_cv_writable_argv in
454yes)
7f67a28c 455 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
0717e469
DS
456 AC_MSG_RESULT(yes)
457 ;;
458no)
459 AC_MSG_RESULT(no)
460 ;;
461*)
a139ce90
DS
462 AC_MSG_RESULT(no)
463 AC_MSG_WARN([the previous check could not be made default was used])
0717e469
DS
464 ;;
465esac
7f67a28c 466
00505c92
DS
467dnl **********************************************************************
468dnl Check for the presence of Kerberos4 libraries and headers
469dnl **********************************************************************
470
471AC_ARG_WITH(krb4-includes,
f136f435
DS
472AC_HELP_STRING([--with-krb4-includes=DIR],
473 [Specify location of kerberos4 headers]),[
00505c92
DS
474 CPPFLAGS="$CPPFLAGS -I$withval"
475 KRB4INC="$withval"
476 want_krb4=yes
477 ])
478
479AC_ARG_WITH(krb4-libs,
f136f435 480AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
00505c92
DS
481 LDFLAGS="$LDFLAGS -L$withval"
482 KRB4LIB="$withval"
483 want_krb4=yes
484 ])
485
486
487OPT_KRB4=off
488AC_ARG_WITH(krb4,dnl
f136f435 489AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
00505c92
DS
490 OPT_KRB4="$withval"
491 if test X"$OPT_KRB4" != Xyes
492 then
81f83506
DS
493 LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
494 KRB4LIB="$OPT_KRB4/lib$libsuff"
00505c92
DS
495 CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
496 KRB4INC="$OPT_KRB4/include"
497 fi
498 want_krb4="yes"
499 ])
500
501AC_MSG_CHECKING([if Kerberos4 support is requested])
502
503if test "$want_krb4" = yes
504then
f6e2bfd4
DS
505 if test "$ipv6" = "yes"; then
506 echo krb4 is not compatible with IPv6
507 exit 1
508 fi
00505c92
DS
509 AC_MSG_RESULT(yes)
510
511 dnl Check for & handle argument to --with-krb4
512
513 AC_MSG_CHECKING(where to look for Kerberos4)
514 if test X"$OPT_KRB4" = Xyes
515 then
516 AC_MSG_RESULT([defaults])
517 else
518 AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
519 fi
520
521 dnl Check for DES library
522 AC_CHECK_LIB(des, des_pcbc_encrypt,
523 [
524 AC_CHECK_HEADERS(des.h)
525
526 dnl resolv lib?
22a32389 527 AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
00505c92
DS
528
529 dnl Check for the Kerberos4 library
530 AC_CHECK_LIB(krb, krb_net_read,
531 [
532 dnl Check for header files
533 AC_CHECK_HEADERS(krb.h)
534
535 dnl we found the required libraries, add to LIBS
536 LIBS="-lkrb -ldes $LIBS"
537
538 dnl Check for function krb_get_our_ip_for_realm
539 dnl this is needed for NAT networks
540 AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
541
542 dnl add define KRB4
d4629fd3 543 AC_DEFINE(HAVE_KRB4, 1,
22a32389 544 [if you have the Kerberos4 libraries (including -ldes)])
00505c92 545
1ee7f92c
DS
546 dnl substitute it too!
547 KRB4_ENABLED=1
548 AC_SUBST(KRB4_ENABLED)
549
00505c92
DS
550 dnl the krb4 stuff needs a strlcpy()
551 AC_CHECK_FUNCS(strlcpy)
552
553 ])
554 ])
555else
556 AC_MSG_RESULT(no)
557fi
558
09ccfcdc
DS
559dnl **********************************************************************
560dnl Check for FBopenssl(SPNEGO) libraries
561dnl **********************************************************************
562
563AC_ARG_WITH(spnego,
564 AC_HELP_STRING([--with-spnego=DIR],
565 [Specify location of SPNEGO library fbopenssl]),
566 [ SPNEGO_ROOT="$withval"
567 want_spnego="yes" ]
568)
569AC_MSG_CHECKING([if SPNEGO support is requested])
570if test x"$want_spnego" = xyes; then
f6413f2c
DS
571
572 if test X"$SPNEGO_ROOT" = Xyes; then
573 AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
574 AC_MSG_RESULT(no)
09ccfcdc 575 else
f6413f2c 576 if test -z "$SPNEGO_LIB_DIR"; then
202e54cf 577 LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
f6413f2c
DS
578 else
579 LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
580 fi
09ccfcdc 581
f6413f2c
DS
582 AC_MSG_RESULT(yes)
583 AC_DEFINE(HAVE_SPNEGO, 1, [Define this if you have the SPNEGO library fbopenssl])
584 fi
09ccfcdc
DS
585else
586 AC_MSG_RESULT(no)
587fi
588
e56ae142
DS
589dnl **********************************************************************
590dnl Check for GSS-API libraries
591dnl **********************************************************************
592
593AC_ARG_WITH(gssapi-includes,
594 AC_HELP_STRING([--with-gssapi-includes=DIR],
595 [Specify location of GSSAPI header]),
596 [ GSSAPI_INCS="-I$withval"
597 want_gss="yes" ]
598)
599
600AC_ARG_WITH(gssapi-libs,
601 AC_HELP_STRING([--with-gssapi-libs=DIR],
602 [Specify location of GSSAPI libs]),
603 [ GSSAPI_LIBS="-L$withval -lgssapi"
604 want_gss="yes" ]
605)
606
607AC_ARG_WITH(gssapi,
608 AC_HELP_STRING([--with-gssapi=DIR],
609 [Where to look for GSSAPI]),
610 [ GSSAPI_ROOT="$withval"
611 want_gss="yes" ]
612)
613
614AC_MSG_CHECKING([if GSSAPI support is requested])
615if test x"$want_gss" = xyes; then
616 if test -z "$GSSAPI_INCS"; then
617 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
f4046763 618 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
e56ae142 619 else
533519cc 620 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
e56ae142 621 fi
e56ae142 622 fi
f4046763 623 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
e56ae142
DS
624
625 if test -z "$GSSAPI_LIB_DIR"; then
626 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
627 gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
628 LDFLAGS="$LDFLAGS $gss_ldflags"
629 else
81f83506 630 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
e56ae142
DS
631 fi
632 else
633 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
634 fi
635
636 AC_MSG_RESULT(yes)
09ccfcdc 637 AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
f4046763
DS
638
639 if test -n "$GSSAPI_INCS"; then
640 # cut off the preceding -I from the include path
641 GSSAPI_INCS=`echo $GSSAPI_INCS | sed -e s/^-I//g`
642 fi
643
09ccfcdc
DS
644 if test -f "$GSSAPI_INCS/gssapi.h"; then
645 AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
646 else
647 AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
648 fi
e56ae142
DS
649
650else
651 AC_MSG_RESULT(no)
652fi
653
654
8b6cf239
DS
655dnl Detect the pkg-config tool, as it may have extra info about the
656dnl openssl installation we can use. I *believe* this is what we are
657dnl expected to do on really recent Redhat Linux hosts.
658AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
659if test "$PKGCONFIG" != "no" ; then
660 AC_MSG_CHECKING([for OpenSSL options using pkg-config])
661
662 $PKGCONFIG --exists openssl
663 SSL_EXISTS=$?
664
665 if test "$SSL_EXISTS" -eq "0"; then
666 SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
667 SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
7d7ebbe9 668 SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
8b6cf239
DS
669
670 LIBS="$LIBS $SSL_LIBS"
7d7ebbe9 671 CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
8b6cf239
DS
672 LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
673
674 AC_MSG_RESULT([yes])
675 else
676 AC_MSG_RESULT([no])
677 fi
678
679fi
23903306 680
ae1912cb
DS
681dnl **********************************************************************
682dnl Check for the presence of SSL libraries and headers
683dnl **********************************************************************
684
685dnl Default to compiler & linker defaults for SSL files & libraries.
686OPT_SSL=off
2c2baa93
DS
687dnl Default to no CA bundle
688ca="no"
ae1912cb 689AC_ARG_WITH(ssl,dnl
f136f435 690AC_HELP_STRING([--with-ssl=PATH],[where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
e890113f
DS
691AC_HELP_STRING([--without-ssl], [disable SSL]),
692 OPT_SSL=$withval)
ae1912cb
DS
693
694if test X"$OPT_SSL" = Xno
695then
696 AC_MSG_WARN(SSL/https support disabled)
697else
698
4836154c 699 dnl Check for and handle argument to --with-ssl.
4ac7a087
DS
700
701 dnl save the pre-ssl check flags for a while
702 CLEANLDFLAGS="$LDFLAGS"
703 CLEANCPPFLAGS="$CPPFLAGS"
4836154c
DS
704
705 case "$OPT_SSL" in
706 yes)
707 EXTRA_SSL=/usr/local/ssl ;;
4398151f
DS
708 off)
709 EXTRA_SSL= ;;
4836154c 710 *)
4ac7a087
DS
711 dnl check the given spot right away!
712 EXTRA_SSL=$OPT_SSL
81f83506 713 LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
4ac7a087
DS
714 CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
715 ;;
4836154c
DS
716 esac
717
718 AC_CHECK_LIB(crypto, CRYPTO_lock,[
719 HAVECRYPTO="yes"
720 ],[
721 OLDLDFLAGS="$LDFLAGS"
722 OLDCPPFLAGS="$CPPFLAGS"
81f83506 723 LDFLAGS="$CLEANLDFLAGS -L$EXTRA_SSL/lib$libsuff"
4ac7a087 724 CPPFLAGS="$CLEANCPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
4836154c
DS
725 AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
726 HAVECRYPTO="yes" ], [
727 LDFLAGS="$OLDLDFLAGS"
728 CPPFLAGS="$OLDCPPFLAGS"
729 ])
730 ])
ae1912cb 731
ae1912cb 732
4836154c 733 if test "$HAVECRYPTO" = "yes"; then
ae1912cb
DS
734 dnl This is only reasonable to do if crypto actually is there: check for
735 dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
4836154c 736
a3d39efa
DS
737 dnl This is for Msys/Mingw
738 AC_MSG_CHECKING([for gdi32])
739 my_ac_save_LIBS=$LIBS
740 LIBS="-lgdi32 $LIBS"
741 AC_TRY_LINK([#include <windef.h>
742 #include <wingdi.h>],
743 [GdiFlush();],
744 [ dnl worked!
745 AC_MSG_RESULT([yes])],
746 [ dnl failed, restore LIBS
747 LIBS=$my_ac_save_LIBS
748 AC_MSG_RESULT(no)]
749 )
750
1b9e26a2 751 AC_CHECK_LIB(crypto, CRYPTO_add_lock)
ae1912cb
DS
752 AC_CHECK_LIB(ssl, SSL_connect)
753
b32bf427
DS
754 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
755 dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
756 AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
757 OLIBS=$LIBS
758 LIBS="$LIBS -lRSAglue -lrsaref"
759 AC_CHECK_LIB(ssl, SSL_connect)
760 if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
761 dnl still no SSL_connect
762 AC_MSG_RESULT(no)
763 LIBS=$OLIBS
764 else
765 AC_MSG_RESULT(yes)
766 fi
767 fi
768
769
ae1912cb 770 dnl Check for SSLeay headers
1ee7f92c 771 AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
23903306
DS
772 openssl/pem.h openssl/ssl.h openssl/err.h,
773 OPENSSL_ENABLED=1)
ae1912cb
DS
774
775 if test $ac_cv_header_openssl_x509_h = no; then
23903306
DS
776 AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
777 OPENSSL_ENABLED=1)
1ee7f92c
DS
778 fi
779
e157aabd
DS
780 dnl If the ENGINE library seems to be around, check for the OpenSSL engine
781 dnl header, it is kind of "separated" from the main SSL check
22a32389 782 AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ])
af6c3947 783
1ee7f92c
DS
784 AC_SUBST(OPENSSL_ENABLED)
785
2c2baa93
DS
786 AC_MSG_CHECKING([CA cert bundle install path])
787
788 AC_ARG_WITH(ca-bundle,
789AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
790AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
791 [ ca="$withval" ],
792 [
793 if test "x$prefix" != xNONE; then
794 ca="\${prefix}/share/curl/curl-ca-bundle.crt"
795 else
796 ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
797 fi
798 ] )
799
800 if test X"$OPT_SSL" = Xno; then
801 ca="no"
802 fi
803
804 if test "x$ca" != "xno"; then
805 CURL_CA_BUNDLE='"'$ca'"'
806 AC_SUBST(CURL_CA_BUNDLE)
807 fi
808 AC_MSG_RESULT([$ca])
809
810 dnl these can only exist if openssl exists
811
812 AC_CHECK_FUNCS( RAND_status \
813 RAND_screen \
e16bc916
DS
814 RAND_egd \
815 CRYPTO_cleanup_all_ex_data )
2c2baa93 816
ae1912cb 817 fi
00505c92 818
1ee7f92c
DS
819 if test X"$OPT_SSL" != Xoff &&
820 test "$OPENSSL_ENABLED" != "1"; then
821 AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
822 fi
823
ae1912cb
DS
824fi
825
2c2baa93
DS
826AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
827
ae1912cb
DS
828dnl **********************************************************************
829dnl Check for the presence of ZLIB libraries and headers
830dnl **********************************************************************
831
ae1912cb 832dnl Check for & handle argument to --with-zlib.
ae1912cb 833
e157aabd
DS
834_cppflags=$CPPFLAGS
835_ldflags=$LDFLAGS
836OPT_ZLIB="/usr/local"
837AC_ARG_WITH(zlib,
f136f435
DS
838AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
839AC_HELP_STRING([--without-zlib],[disable use of zlib]),
840 [OPT_ZLIB="$withval"])
e890113f 841
e157aabd
DS
842case "$OPT_ZLIB" in
843 no)
844 AC_MSG_WARN([zlib disabled]) ;;
845 *)
846 dnl check for the lib first without setting any new path, since many
847 dnl people have it in the default path
848
de100f8b
DS
849 AC_CHECK_LIB(z, inflateEnd,
850 dnl libz found, set the variable
851 [HAVE_LIBZ="1"],
852 dnl if no lib found, try to add the given library
e157aabd
DS
853 [if test -d "$OPT_ZLIB"; then
854 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
81f83506 855 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
e157aabd
DS
856 fi])
857
de100f8b
DS
858 AC_CHECK_HEADER(zlib.h,
859 [
860 dnl zlib.h was found
861 HAVE_ZLIB_H="1"
862 dnl if the lib wasn't found already, try again with the new paths
863 if test "$HAVE_LIBZ" != "1"; then
864 AC_CHECK_LIB(z, gzread,
865 [
866 dnl the lib was found!
867 HAVE_LIBZ="1"
868 ],
869 [ CPPFLAGS=$_cppflags
870 LDFLAGS=$_ldflags])
871 fi
872 ],
873 [
874 dnl zlib.h was not found, restore the flags
875 CPPFLAGS=$_cppflags
876 LDFLAGS=$_ldflags]
877 )
878
879 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
880 then
881 AC_MSG_WARN([configure found only the libz lib, not the header file!])
882 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
883 then
884 AC_MSG_WARN([configure found only the libz header file, not the lib!])
885 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
886 then
887 dnl both header and lib were found!
888 AC_SUBST(HAVE_LIBZ)
889 AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
890 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
891
892 LIBS="$LIBS -lz"
893
894 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
895 AMFIXLIB="1"
896 AC_MSG_NOTICE([found both libz and libz.h header])
897 fi
e157aabd
DS
898 ;;
899esac
b174aeaa 900
4a8155b5 901dnl set variable for use in automakefile(s)
de100f8b 902AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
4a8155b5 903
b174aeaa
DS
904dnl Default is to try the thread-safe versions of a few functions
905OPT_THREAD=on
243942a7
DS
906
907dnl detect AIX 4.3 or later
908dnl see full docs on this reasoning in the lib/hostip.c source file
909AC_MSG_CHECKING([AIX 4.3 or later])
910AC_PREPROC_IFELSE([
911#if defined(_AIX) && defined(_AIX43)
912printf("just fine");
913#else
914#error "this is not AIX 4.3 or later"
915#endif
916],
917 [ AC_MSG_RESULT([yes])
abd65e21 918 RECENTAIX=yes
243942a7
DS
919 OPT_THREAD=off ],
920 [ AC_MSG_RESULT([no]) ]
921)
922
b174aeaa 923AC_ARG_ENABLE(thread,dnl
a53d7848
DS
924AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
925AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
926[ case "$enableval" in
927 no)
928 OPT_THREAD=off
929 AC_MSG_WARN(libcurl will not get built using thread-safe functions)
930 ;;
931 *)
932 ;;
933 esac
934]
b174aeaa
DS
935)
936
937if test X"$OPT_THREAD" = Xoff
938then
b174aeaa
DS
939 AC_DEFINE(DISABLED_THREADSAFE, 1, \
940Set to explicitly specify we don't want to use thread-safe functions)
941else
9f2780a2
DS
942 if test "$ipv6" != "yes"; then
943 dnl dig around for gethostbyname_r()
944 CURL_CHECK_GETHOSTBYNAME_R()
b174aeaa 945
9f2780a2
DS
946 dnl dig around for gethostbyaddr_r()
947 CURL_CHECK_GETHOSTBYADDR_R()
948 fi
d4731b70 949
61fb8fea
DS
950 dnl poke around for inet_ntoa_r()
951 CURL_CHECK_INET_NTOA_R()
d4731b70 952
61fb8fea
DS
953 dnl is there a localtime_r()
954 CURL_CHECK_LOCALTIME_R()
d4731b70 955
242be557
DS
956 dnl is there a strerror_r()
957 CURL_CHECK_STRERROR_R()
958
650b9504 959 AC_CHECK_FUNCS( gmtime_r )
b174aeaa
DS
960fi
961
abd65e21 962dnl for recent AIX versions, we skip all the thread-safe checks above since
0eace2fe
DS
963dnl they claim a thread-safe libc using the standard API. But there are
964dnl some functions still not thread-safe. Check for these!
965
966dnl Let's hope this split URL remains working:
967dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
968dnl genprogc/thread_quick_ref.htm
abd65e21
DS
969
970if test "x$RECENTAIX" = "xyes"; then
0eace2fe
DS
971 dnl is there a localtime_r()
972 CURL_CHECK_LOCALTIME_R()
973
abd65e21
DS
974 dnl is there a strerror_r()
975 CURL_CHECK_STRERROR_R()
0eace2fe
DS
976
977 AC_CHECK_FUNCS( gmtime_r )
abd65e21
DS
978fi
979
980
ae1912cb
DS
981dnl **********************************************************************
982dnl Back to "normal" configuring
983dnl **********************************************************************
984
985dnl Checks for header files.
986AC_HEADER_STDC
075c5342
DS
987
988dnl First check for the very most basic headers. Then we can use these
989dnl ones as default-headers when checking for the rest!
990AC_CHECK_HEADERS(
991 sys/types.h \
992 sys/time.h \
993 sys/select.h \
994 sys/socket.h \
a4351517 995 sys/ioctl.h \
24ac5b8a 996 assert.h \
ae1912cb 997 unistd.h \
8898ff9e
DS
998 malloc.h \
999 stdlib.h \
3d66d10f 1000 limits.h \
ae1912cb
DS
1001 arpa/inet.h \
1002 net/if.h \
1003 netinet/in.h \
1004 netdb.h \
ae1912cb
DS
1005 sys/sockio.h \
1006 sys/stat.h \
ae1912cb
DS
1007 sys/param.h \
1008 termios.h \
1009 termio.h \
1010 sgtty.h \
1011 fcntl.h \
1012 dlfcn.h \
1013 alloca.h \
1014 winsock.h \
1015 time.h \
1016 io.h \
5900c0f7 1017 pwd.h \
82d3ded9 1018 utime.h \
3c49b405 1019 sys/utime.h \
99dfdebc 1020 sys/poll.h \
075c5342
DS
1021 setjmp.h,
1022dnl to do if not found
1023[],
1024dnl to do if found
1025[],
1026dnl default includes
1027[
1028#ifdef HAVE_SYS_TYPES_H
1029#include <sys/types.h>
1030#endif
1031#ifdef HAVE_SYS_TIME_H
1032#include <sys/time.h>
1033#endif
1034#ifdef HAVE_SYS_SELECT_H
1035#include <sys/select.h>
1036#endif
1037#ifdef HAVE_SYS_SOCKET_H
1038#include <sys/socket.h>
1039#endif
1040]
ae1912cb
DS
1041)
1042
ae1912cb
DS
1043dnl Checks for typedefs, structures, and compiler characteristics.
1044AC_C_CONST
1045AC_TYPE_SIZE_T
1046AC_HEADER_TIME
1047
6cd0a90b
DS
1048AC_CHECK_SIZEOF(curl_off_t, ,[
1049#include <stdio.h>
1050#include "$srcdir/include/curl/curl.h"
1051])
ae1912cb 1052
a147a079
DS
1053AC_CHECK_TYPE(long long,
1054 [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])])
ae1912cb 1055
61e2a810 1056# check for ssize_t
a147a079
DS
1057AC_CHECK_TYPE(ssize_t, ,
1058 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
61e2a810 1059
a1cec0e4 1060TYPE_SOCKLEN_T
d09b4369 1061TYPE_IN_ADDR_T
11693c0f 1062
ad05d0a8
DS
1063AC_FUNC_SELECT_ARGTYPES
1064
ae1912cb
DS
1065dnl Checks for library functions.
1066dnl AC_PROG_GCC_TRADITIONAL
1067AC_TYPE_SIGNAL
f8e916db 1068dnl AC_FUNC_VPRINTF
4eb9ac08
DS
1069AC_CHECK_FUNCS( strtoll \
1070 socket \
ae1912cb
DS
1071 select \
1072 strdup \
1073 strstr \
4e376a2f 1074 strtok_r \
ae1912cb
DS
1075 strftime \
1076 uname \
1077 strcasecmp \
95c2534a
DS
1078 stricmp \
1079 strcmpi \
ae1912cb 1080 gethostbyaddr \
ae1912cb
DS
1081 gettimeofday \
1082 inet_addr \
1083 inet_ntoa \
c86768d8 1084 inet_pton \
ae1912cb
DS
1085 tcsetattr \
1086 tcgetattr \
1087 perror \
0e31dadf 1088 closesocket \
02437b2d 1089 siginterrupt \
852b664e 1090 sigaction \
1ff573c6 1091 signal \
f6e2bfd4 1092 getpass_r \
92186dc3
DS
1093 strlcat \
1094 getpwuid \
43d0d756 1095 geteuid \
5900c0f7 1096 dlopen \
3c49b405 1097 utime \
6a3e2272 1098 sigsetjmp \
70b80b01
DS
1099 poll,
1100dnl if found
1101[],
1102dnl if not found, $ac_func is the name we check for
1103 func="$ac_func"
1104 AC_MSG_CHECKING([deeper for $func])
1105 AC_TRY_LINK( [],
1106 [ $func ();],
1107 AC_MSG_RESULT(yes!)
d65587b0 1108 eval "ac_cv_func_$func=yes"
70b80b01 1109 def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
d65587b0 1110 AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
70b80b01
DS
1111 AC_MSG_RESULT(but still no)
1112 )
1113
ae1912cb
DS
1114)
1115
3c49b405
DS
1116dnl sigsetjmp() might be a macro and no function so if it isn't found already
1117dnl we make an extra check here!
1118if test "$ac_cv_func_sigsetjmp" != "yes"; then
1119 AC_MSG_CHECKING([for sigsetjmp defined as macro])
1120 AC_TRY_LINK( [#include <setjmp.h>],
1121 [sigjmp_buf jmpenv;
1122 sigsetjmp(jmpenv, 1);],
1123 AC_MSG_RESULT(yes)
22a32389 1124 AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
3c49b405
DS
1125 AC_MSG_RESULT(no)
1126 )
1127fi
1128
7dc36344
DS
1129AC_PATH_PROG( PERL, perl, ,
1130 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
1131AC_SUBST(PERL)
ae1912cb 1132
90719eb3 1133AC_PATH_PROGS( NROFF, gnroff nroff, ,
ae1912cb 1134 $PATH:/usr/bin/:/usr/local/bin )
96dde76b 1135AC_SUBST(NROFF)
ae1912cb 1136
773e7e87
DS
1137if test -n "$NROFF"; then
1138 dnl only check for nroff options if an nroff command was found
1139
1140 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
1141 MANOPT="-man"
37685848
DS
1142 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1143 if test -z "$mancheck"; then
773e7e87
DS
1144 MANOPT="-mandoc"
1145 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1146 if test -z "$mancheck"; then
1147 MANOPT=""
1148 AC_MSG_RESULT([failed])
1149 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
1150 else
1151 AC_MSG_RESULT([$MANOPT])
1152 fi
37685848
DS
1153 else
1154 AC_MSG_RESULT([$MANOPT])
1155 fi
773e7e87
DS
1156 AC_SUBST(MANOPT)
1157fi
1158
1159if test -z "$MANOPT"
1160then
1161 dnl if no nroff tool was found, or no option that could convert man pages
1162 dnl was found, then disable the built-in manual stuff
1163 AC_MSG_WARN([disabling built-in manual])
1164 USE_MANUAL="no";
37685848 1165fi
37685848 1166
ae1912cb
DS
1167AC_PROG_YACC
1168
de373087
DS
1169if test -z "$YACC"
1170then
1171 AC_MSG_CHECKING([if OK to build without bison/yacc])
1172 dnl no yacc is a big deal if we have no pre-fixed getdate.y
1173 if test -r "$srcdir/lib/getdate.c"
1174 then
1175 dnl all is well, we don't have to generate it!
1176 AC_MSG_RESULT(yes)
1177 else
1178 AC_MSG_RESULT(no)
1179 AC_MSG_ERROR([no yacc or bison found, can't build libcurl!])
1180 fi
1181fi
1182
f3663a9d
DS
1183dnl *************************************************************************
1184dnl If the manual variable still is set, then we go with providing a built-in
1185dnl manual
1186
1187if test "$USE_MANUAL" = "1"; then
1188 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
1189fi
1190
1191dnl set variable for use in automakefile(s)
1192AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
1193
1194
ae1912cb
DS
1195dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib,
1196dnl $PATH:/usr/bin/:/usr/local/bin )
1197dnl AC_SUBST(RANLIB)
1198
3c49b405
DS
1199dnl ************************************************************
1200dnl lame option to switch on debug options
1201dnl
1202AC_MSG_CHECKING([whether to enable debug options])
1203AC_ARG_ENABLE(debug,
f136f435
DS
1204AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
1205AC_HELP_STRING([--disable-debug],[Disable debug options]),
3c49b405
DS
1206[ case "$enableval" in
1207 no)
1208 AC_MSG_RESULT(no)
1209 ;;
1210 *) AC_MSG_RESULT(yes)
1211
f8c3b3aa 1212 CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
4fa58560 1213 CFLAGS="$CFLAGS -g"
455b1af2 1214
4fa58560
DS
1215 dnl set compiler "debug" options to become more picky, and remove
1216 dnl optimize options from CFLAGS
1217 CURL_CC_DEBUG_OPTS
3c49b405 1218 ;;
4fa58560
DS
1219 esac
1220 ],
3c49b405
DS
1221 AC_MSG_RESULT(no)
1222)
1223
f85935f0
DS
1224AC_MSG_CHECKING([whether to enable ares])
1225AC_ARG_ENABLE(ares,
d46a7354
DS
1226AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
1227AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
f85935f0
DS
1228[ case "$enableval" in
1229 no)
1230 AC_MSG_RESULT(no)
1231 ;;
1232 *) AC_MSG_RESULT(yes)
1233
a147a079 1234 if test "x$IPV6_ENABLED" = "x1"; then
f85935f0
DS
1235 AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
1236 fi
1237
2617b379 1238 AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
437afe07
DS
1239 dnl substitute HAVE_ARES for curl-config and similar
1240 HAVE_ARES="1"
1241 AC_SUBST(HAVE_ARES)
d46a7354 1242
7e01548d 1243 LIBS="$LIBS -lcares"
d46a7354
DS
1244
1245 dnl For backwards compatibility default to includes/lib in srcdir/ares
1246 dnl If a value is specified it is assumed that the libs are in $val/lib
1247 dnl and the includes are in $val/include. This is the default setup for
1248 dnl ares so it should not be a problem.
1249 if test "x$enableval" = "xyes" ; then
a3c09e63
DS
1250 if test -d "$srcdir/ares"; then
1251 AC_CONFIG_SUBDIRS(ares)
1252 aresinc=`cd $srcdir/ares && pwd`
1253 CPPFLAGS="$CPPFLAGS -I$aresinc"
0839d6e6
DS
1254
1255 dnl the pwd= below cannot 'cd' into the ares dir to get the full
1256 dnl path to it, since it may not exist yet if we build outside of
1257 dnl the source tree
1258 pwd=`pwd`
1259 LDFLAGS="$LDFLAGS -L$pwd/ares"
a3c09e63 1260 fi
d46a7354
DS
1261 else
1262 CPPFLAGS="$CPPFLAGS -I$enableval/include"
1263 LDFLAGS="$LDFLAGS -L$enableval/lib"
1264 fi
f85935f0
DS
1265 ;;
1266 esac ],
1267 AC_MSG_RESULT(no)
1268)
1269
93c53424 1270AC_CONFIG_FILES([Makefile \
f71a1485 1271 docs/Makefile \
d54cdf29 1272 docs/examples/Makefile \
e22657ea 1273 docs/libcurl/Makefile \
c3c77398
DS
1274 include/Makefile \
1275 include/curl/Makefile \
ae1912cb 1276 src/Makefile \
172f0ba1 1277 lib/Makefile \
044ca343 1278 tests/Makefile \
b915ca68 1279 tests/data/Makefile \
fd8bf5f1 1280 tests/server/Makefile \
2aa0c6c4 1281 tests/libtest/Makefile \
9ade752f
DS
1282 packages/Makefile \
1283 packages/Win32/Makefile \
fbb9d23a 1284 packages/Win32/cygwin/Makefile \
9ade752f
DS
1285 packages/Linux/Makefile \
1286 packages/Linux/RPM/Makefile \
d54cdf29 1287 packages/Linux/RPM/curl.spec \
aa860990 1288 packages/Linux/RPM/curl-ssl.spec \
c503930b 1289 packages/Solaris/Makefile \
d78ec593 1290 packages/DOS/Makefile \
34f9ab10
DS
1291 packages/EPM/curl.list \
1292 packages/EPM/Makefile \
f19cade5 1293 packages/vms/Makefile \
5ab751f5 1294 curl-config
93c53424
DS
1295])
1296AC_OUTPUT