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