]> git.ipfire.org Git - thirdparty/curl.git/blame - configure.ac
force recent AIX versions to check for strerror_r
[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
DS
959 AC_CHECK_FUNCS( gmtime_r )
960
b174aeaa
DS
961fi
962
abd65e21
DS
963dnl for recent AIX versions, we skip all the thread-safe checks above since
964dnl they claim a thread-safe libc using the standard API. But the man page
965dnl says strerror() is not thread-safe, so we check for this only!
966
967if test "x$RECENTAIX" = "xyes"; then
968 dnl is there a strerror_r()
969 CURL_CHECK_STRERROR_R()
970fi
971
972
ae1912cb
DS
973dnl **********************************************************************
974dnl Back to "normal" configuring
975dnl **********************************************************************
976
977dnl Checks for header files.
978AC_HEADER_STDC
075c5342
DS
979
980dnl First check for the very most basic headers. Then we can use these
981dnl ones as default-headers when checking for the rest!
982AC_CHECK_HEADERS(
983 sys/types.h \
984 sys/time.h \
985 sys/select.h \
986 sys/socket.h \
a4351517 987 sys/ioctl.h \
24ac5b8a 988 assert.h \
ae1912cb 989 unistd.h \
8898ff9e
DS
990 malloc.h \
991 stdlib.h \
3d66d10f 992 limits.h \
ae1912cb
DS
993 arpa/inet.h \
994 net/if.h \
995 netinet/in.h \
996 netdb.h \
ae1912cb
DS
997 sys/sockio.h \
998 sys/stat.h \
ae1912cb
DS
999 sys/param.h \
1000 termios.h \
1001 termio.h \
1002 sgtty.h \
1003 fcntl.h \
1004 dlfcn.h \
1005 alloca.h \
1006 winsock.h \
1007 time.h \
1008 io.h \
5900c0f7 1009 pwd.h \
82d3ded9 1010 utime.h \
3c49b405 1011 sys/utime.h \
99dfdebc 1012 sys/poll.h \
075c5342
DS
1013 setjmp.h,
1014dnl to do if not found
1015[],
1016dnl to do if found
1017[],
1018dnl default includes
1019[
1020#ifdef HAVE_SYS_TYPES_H
1021#include <sys/types.h>
1022#endif
1023#ifdef HAVE_SYS_TIME_H
1024#include <sys/time.h>
1025#endif
1026#ifdef HAVE_SYS_SELECT_H
1027#include <sys/select.h>
1028#endif
1029#ifdef HAVE_SYS_SOCKET_H
1030#include <sys/socket.h>
1031#endif
1032]
ae1912cb
DS
1033)
1034
ae1912cb
DS
1035dnl Checks for typedefs, structures, and compiler characteristics.
1036AC_C_CONST
1037AC_TYPE_SIZE_T
1038AC_HEADER_TIME
1039
6cd0a90b
DS
1040AC_CHECK_SIZEOF(curl_off_t, ,[
1041#include <stdio.h>
1042#include "$srcdir/include/curl/curl.h"
1043])
ae1912cb 1044
a147a079
DS
1045AC_CHECK_TYPE(long long,
1046 [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])])
ae1912cb 1047
61e2a810 1048# check for ssize_t
a147a079
DS
1049AC_CHECK_TYPE(ssize_t, ,
1050 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
61e2a810 1051
a1cec0e4 1052TYPE_SOCKLEN_T
d09b4369 1053TYPE_IN_ADDR_T
11693c0f 1054
ad05d0a8
DS
1055AC_FUNC_SELECT_ARGTYPES
1056
ae1912cb
DS
1057dnl Checks for library functions.
1058dnl AC_PROG_GCC_TRADITIONAL
1059AC_TYPE_SIGNAL
f8e916db 1060dnl AC_FUNC_VPRINTF
4eb9ac08
DS
1061AC_CHECK_FUNCS( strtoll \
1062 socket \
ae1912cb
DS
1063 select \
1064 strdup \
1065 strstr \
4e376a2f 1066 strtok_r \
ae1912cb
DS
1067 strftime \
1068 uname \
1069 strcasecmp \
95c2534a
DS
1070 stricmp \
1071 strcmpi \
ae1912cb 1072 gethostbyaddr \
ae1912cb
DS
1073 gettimeofday \
1074 inet_addr \
1075 inet_ntoa \
c86768d8 1076 inet_pton \
ae1912cb
DS
1077 tcsetattr \
1078 tcgetattr \
1079 perror \
0e31dadf 1080 closesocket \
02437b2d 1081 siginterrupt \
852b664e 1082 sigaction \
1ff573c6 1083 signal \
f6e2bfd4 1084 getpass_r \
92186dc3
DS
1085 strlcat \
1086 getpwuid \
43d0d756 1087 geteuid \
5900c0f7 1088 dlopen \
3c49b405 1089 utime \
6a3e2272 1090 sigsetjmp \
70b80b01
DS
1091 poll,
1092dnl if found
1093[],
1094dnl if not found, $ac_func is the name we check for
1095 func="$ac_func"
1096 AC_MSG_CHECKING([deeper for $func])
1097 AC_TRY_LINK( [],
1098 [ $func ();],
1099 AC_MSG_RESULT(yes!)
d65587b0 1100 eval "ac_cv_func_$func=yes"
70b80b01 1101 def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
d65587b0 1102 AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
70b80b01
DS
1103 AC_MSG_RESULT(but still no)
1104 )
1105
ae1912cb
DS
1106)
1107
3c49b405
DS
1108dnl sigsetjmp() might be a macro and no function so if it isn't found already
1109dnl we make an extra check here!
1110if test "$ac_cv_func_sigsetjmp" != "yes"; then
1111 AC_MSG_CHECKING([for sigsetjmp defined as macro])
1112 AC_TRY_LINK( [#include <setjmp.h>],
1113 [sigjmp_buf jmpenv;
1114 sigsetjmp(jmpenv, 1);],
1115 AC_MSG_RESULT(yes)
22a32389 1116 AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
3c49b405
DS
1117 AC_MSG_RESULT(no)
1118 )
1119fi
1120
7dc36344
DS
1121AC_PATH_PROG( PERL, perl, ,
1122 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
1123AC_SUBST(PERL)
ae1912cb 1124
90719eb3 1125AC_PATH_PROGS( NROFF, gnroff nroff, ,
ae1912cb 1126 $PATH:/usr/bin/:/usr/local/bin )
96dde76b 1127AC_SUBST(NROFF)
ae1912cb 1128
773e7e87
DS
1129if test -n "$NROFF"; then
1130 dnl only check for nroff options if an nroff command was found
1131
1132 AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
1133 MANOPT="-man"
37685848
DS
1134 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1135 if test -z "$mancheck"; then
773e7e87
DS
1136 MANOPT="-mandoc"
1137 mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
1138 if test -z "$mancheck"; then
1139 MANOPT=""
1140 AC_MSG_RESULT([failed])
1141 AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
1142 else
1143 AC_MSG_RESULT([$MANOPT])
1144 fi
37685848
DS
1145 else
1146 AC_MSG_RESULT([$MANOPT])
1147 fi
773e7e87
DS
1148 AC_SUBST(MANOPT)
1149fi
1150
1151if test -z "$MANOPT"
1152then
1153 dnl if no nroff tool was found, or no option that could convert man pages
1154 dnl was found, then disable the built-in manual stuff
1155 AC_MSG_WARN([disabling built-in manual])
1156 USE_MANUAL="no";
37685848 1157fi
37685848 1158
ae1912cb
DS
1159AC_PROG_YACC
1160
de373087
DS
1161if test -z "$YACC"
1162then
1163 AC_MSG_CHECKING([if OK to build without bison/yacc])
1164 dnl no yacc is a big deal if we have no pre-fixed getdate.y
1165 if test -r "$srcdir/lib/getdate.c"
1166 then
1167 dnl all is well, we don't have to generate it!
1168 AC_MSG_RESULT(yes)
1169 else
1170 AC_MSG_RESULT(no)
1171 AC_MSG_ERROR([no yacc or bison found, can't build libcurl!])
1172 fi
1173fi
1174
f3663a9d
DS
1175dnl *************************************************************************
1176dnl If the manual variable still is set, then we go with providing a built-in
1177dnl manual
1178
1179if test "$USE_MANUAL" = "1"; then
1180 AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
1181fi
1182
1183dnl set variable for use in automakefile(s)
1184AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
1185
1186
ae1912cb
DS
1187dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib,
1188dnl $PATH:/usr/bin/:/usr/local/bin )
1189dnl AC_SUBST(RANLIB)
1190
3c49b405
DS
1191dnl ************************************************************
1192dnl lame option to switch on debug options
1193dnl
1194AC_MSG_CHECKING([whether to enable debug options])
1195AC_ARG_ENABLE(debug,
f136f435
DS
1196AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
1197AC_HELP_STRING([--disable-debug],[Disable debug options]),
3c49b405
DS
1198[ case "$enableval" in
1199 no)
1200 AC_MSG_RESULT(no)
1201 ;;
1202 *) AC_MSG_RESULT(yes)
1203
f8c3b3aa 1204 CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
4fa58560 1205 CFLAGS="$CFLAGS -g"
455b1af2 1206
4fa58560
DS
1207 dnl set compiler "debug" options to become more picky, and remove
1208 dnl optimize options from CFLAGS
1209 CURL_CC_DEBUG_OPTS
3c49b405 1210 ;;
4fa58560
DS
1211 esac
1212 ],
3c49b405
DS
1213 AC_MSG_RESULT(no)
1214)
1215
f85935f0
DS
1216AC_MSG_CHECKING([whether to enable ares])
1217AC_ARG_ENABLE(ares,
d46a7354
DS
1218AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
1219AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
f85935f0
DS
1220[ case "$enableval" in
1221 no)
1222 AC_MSG_RESULT(no)
1223 ;;
1224 *) AC_MSG_RESULT(yes)
1225
a147a079 1226 if test "x$IPV6_ENABLED" = "x1"; then
f85935f0
DS
1227 AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
1228 fi
1229
2617b379 1230 AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
437afe07
DS
1231 dnl substitute HAVE_ARES for curl-config and similar
1232 HAVE_ARES="1"
1233 AC_SUBST(HAVE_ARES)
d46a7354 1234
7e01548d 1235 LIBS="$LIBS -lcares"
d46a7354
DS
1236
1237 dnl For backwards compatibility default to includes/lib in srcdir/ares
1238 dnl If a value is specified it is assumed that the libs are in $val/lib
1239 dnl and the includes are in $val/include. This is the default setup for
1240 dnl ares so it should not be a problem.
1241 if test "x$enableval" = "xyes" ; then
a3c09e63
DS
1242 if test -d "$srcdir/ares"; then
1243 AC_CONFIG_SUBDIRS(ares)
1244 aresinc=`cd $srcdir/ares && pwd`
1245 CPPFLAGS="$CPPFLAGS -I$aresinc"
0839d6e6
DS
1246
1247 dnl the pwd= below cannot 'cd' into the ares dir to get the full
1248 dnl path to it, since it may not exist yet if we build outside of
1249 dnl the source tree
1250 pwd=`pwd`
1251 LDFLAGS="$LDFLAGS -L$pwd/ares"
a3c09e63 1252 fi
d46a7354
DS
1253 else
1254 CPPFLAGS="$CPPFLAGS -I$enableval/include"
1255 LDFLAGS="$LDFLAGS -L$enableval/lib"
1256 fi
f85935f0
DS
1257 ;;
1258 esac ],
1259 AC_MSG_RESULT(no)
1260)
1261
93c53424 1262AC_CONFIG_FILES([Makefile \
f71a1485 1263 docs/Makefile \
d54cdf29 1264 docs/examples/Makefile \
e22657ea 1265 docs/libcurl/Makefile \
c3c77398
DS
1266 include/Makefile \
1267 include/curl/Makefile \
ae1912cb 1268 src/Makefile \
172f0ba1 1269 lib/Makefile \
044ca343 1270 tests/Makefile \
b915ca68 1271 tests/data/Makefile \
fd8bf5f1 1272 tests/server/Makefile \
2aa0c6c4 1273 tests/libtest/Makefile \
9ade752f
DS
1274 packages/Makefile \
1275 packages/Win32/Makefile \
fbb9d23a 1276 packages/Win32/cygwin/Makefile \
9ade752f
DS
1277 packages/Linux/Makefile \
1278 packages/Linux/RPM/Makefile \
d54cdf29 1279 packages/Linux/RPM/curl.spec \
aa860990 1280 packages/Linux/RPM/curl-ssl.spec \
c503930b 1281 packages/Solaris/Makefile \
d78ec593 1282 packages/DOS/Makefile \
34f9ab10
DS
1283 packages/EPM/curl.list \
1284 packages/EPM/Makefile \
f19cade5 1285 packages/vms/Makefile \
5ab751f5 1286 curl-config
93c53424
DS
1287])
1288AC_OUTPUT