]>
Commit | Line | Data |
---|---|---|
d551412a DS |
1 | #*************************************************************************** |
2 | # _ _ ____ _ | |
3 | # Project ___| | | | _ \| | | |
4 | # / __| | | | |_) | | | |
5 | # | (__| |_| | _ <| |___ | |
6 | # \___|\___/|_| \_\_____| | |
7 | # | |
b9fdc0c2 | 8 | # Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. |
d551412a DS |
9 | # |
10 | # This software is licensed as described in the file COPYING, which | |
11 | # you should have received as part of this distribution. The terms | |
12 | # are also available at http://curl.haxx.se/docs/copyright.html. | |
13 | # | |
14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell | |
15 | # copies of the Software, and permit persons to whom the Software is | |
16 | # furnished to do so, under the terms of the COPYING file. | |
17 | # | |
18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | |
19 | # KIND, either express or implied. | |
20 | # | |
21 | # $Id$ | |
b377e857 | 22 | #*************************************************************************** |
ae1912cb | 23 | dnl Process this file with autoconf to produce a configure script. |
7349940b | 24 | |
a147a079 | 25 | AC_PREREQ(2.57) |
7349940b | 26 | |
380ed8be | 27 | dnl We don't know the version number "statically" so we use a dash here |
d70f3374 | 28 | AC_INIT([curl], [-], [a suitable curl mailing list => http://curl.haxx.se/mail/]) |
d5ba0309 | 29 | |
3f01d9a0 YT |
30 | CURL_OVERRIDE_AUTOCONF |
31 | ||
d5ba0309 | 32 | dnl configure script copyright |
34cd99d1 | 33 | AC_COPYRIGHT([Copyright (c) 1998 - 2009 Daniel Stenberg, <daniel@haxx.se> |
e16c1b8e | 34 | This configure script may be copied, distributed and modified under the |
d5ba0309 DS |
35 | terms of the curl license; see COPYING for more details]) |
36 | ||
93c53424 | 37 | AC_CONFIG_SRCDIR([lib/urldata.h]) |
f671d051 | 38 | AM_CONFIG_HEADER(lib/curl_config.h src/curl_config.h include/curl/curlbuild.h) |
ed29552b | 39 | AM_MAINTAINER_MODE |
8f5ffd94 | 40 | |
2245ac2f | 41 | CURL_CHECK_OPTION_DEBUG |
d930280a | 42 | CURL_CHECK_OPTION_OPTIMIZE |
2245ac2f | 43 | CURL_CHECK_OPTION_WARNINGS |
065047dc | 44 | CURL_CHECK_OPTION_CURLDEBUG |
2245ac2f | 45 | |
f49427d3 | 46 | CURL_CHECK_PATH_SEPARATOR_REQUIRED |
4e4b6de5 | 47 | |
0b57c475 | 48 | dnl SED is mandatory for configure process and libtool. |
d2661cb4 | 49 | dnl Set it now, allowing it to be changed later. |
0b57c475 | 50 | AC_PATH_PROG([SED], [sed], [not_found], |
bfaab6ed | 51 | [$PATH:/usr/bin:/usr/local/bin]) |
0b57c475 YT |
52 | if test -z "$SED" || test "$SED" = "not_found"; then |
53 | AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.]) | |
bfaab6ed | 54 | fi |
817efbc2 | 55 | AC_SUBST([SED]) |
075c5342 | 56 | |
0b57c475 | 57 | dnl GREP is mandatory for configure process and libtool. |
d2661cb4 | 58 | dnl Set it now, allowing it to be changed later. |
0b57c475 | 59 | AC_PATH_PROG([GREP], [grep], [not_found], |
bfaab6ed | 60 | [$PATH:/usr/bin:/usr/local/bin]) |
0b57c475 YT |
61 | if test -z "$GREP" || test "$GREP" = "not_found"; then |
62 | AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.]) | |
63 | fi | |
817efbc2 | 64 | AC_SUBST([GREP]) |
0b57c475 YT |
65 | |
66 | dnl EGREP is mandatory for configure process and libtool. | |
d2661cb4 | 67 | dnl Set it now, allowing it to be changed later. |
0b57c475 YT |
68 | if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then |
69 | AC_MSG_CHECKING([for egrep]) | |
70 | EGREP="$GREP -E" | |
71 | AC_MSG_RESULT([$EGREP]) | |
72 | else | |
73 | AC_PATH_PROG([EGREP], [egrep], [not_found], | |
74 | [$PATH:/usr/bin:/usr/local/bin]) | |
3fc39a6e | 75 | fi |
0b57c475 YT |
76 | if test -z "$EGREP" || test "$EGREP" = "not_found"; then |
77 | AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.]) | |
78 | fi | |
817efbc2 | 79 | AC_SUBST([EGREP]) |
3fc39a6e | 80 | |
0b57c475 YT |
81 | dnl AR is mandatory for configure process and libtool. |
82 | dnl This is target dependant, so check it as a tool. | |
83 | AC_PATH_TOOL([AR], [ar], [not_found], | |
84 | [$PATH:/usr/bin:/usr/local/bin]) | |
85 | if test -z "$AR" || test "$AR" = "not_found"; then | |
86 | AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.]) | |
3fc39a6e | 87 | fi |
817efbc2 | 88 | AC_SUBST([AR]) |
0b57c475 | 89 | |
faaaf626 | 90 | AC_SUBST(libext) |
9f7c6341 | 91 | |
7349940b | 92 | dnl figure out the libcurl version |
593170d1 | 93 | VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h` |
8f5ffd94 | 94 | AM_INIT_AUTOMAKE(curl,$VERSION) |
075c5342 DS |
95 | AC_MSG_CHECKING([curl version]) |
96 | AC_MSG_RESULT($VERSION) | |
caf8c01e | 97 | |
1e5e0f9a DS |
98 | dnl |
99 | dnl we extract the numerical version for curl-config only | |
593170d1 | 100 | VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h` |
1e5e0f9a DS |
101 | AC_SUBST(VERSIONNUM) |
102 | ||
c503930b CB |
103 | dnl Solaris pkgadd support definitions |
104 | PKGADD_PKG="HAXXcurl" | |
105 | PKGADD_NAME="cURL - a client that groks URLs" | |
106 | PKGADD_VENDOR="curl.haxx.se" | |
107 | AC_SUBST(PKGADD_PKG) | |
108 | AC_SUBST(PKGADD_NAME) | |
109 | AC_SUBST(PKGADD_VENDOR) | |
110 | ||
cff90cf3 | 111 | dnl |
710e370c | 112 | dnl initialize all the info variables |
223c0b98 | 113 | curl_ssl_msg="no (--with-ssl / --with-gnutls / --with-nss)" |
2147284c | 114 | curl_ssh_msg="no (--with-libssh2)" |
710e370c DS |
115 | curl_zlib_msg="no (--with-zlib)" |
116 | curl_krb4_msg="no (--with-krb4*)" | |
117 | curl_gss_msg="no (--with-gssapi)" | |
118 | curl_spnego_msg="no (--with-spnego)" | |
119 | curl_ares_msg="no (--enable-ares)" | |
120 | curl_ipv6_msg="no (--enable-ipv6)" | |
121 | curl_idn_msg="no (--with-libidn)" | |
122 | curl_manual_msg="no (--enable-manual)" | |
123 | curl_verbose_msg="enabled (--disable-verbose)" | |
8ed31c48 | 124 | curl_sspi_msg="no (--enable-sspi)" |
d0edb478 | 125 | curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" |
4b60c3e9 | 126 | curl_ldaps_msg="no (--enable-ldaps)" |
c503930b | 127 | |
a0a47f27 DF |
128 | dnl |
129 | dnl Save anything in $LIBS for later | |
130 | dnl | |
131 | ALL_LIBS=$LIBS | |
132 | ||
caf8c01e DS |
133 | dnl |
134 | dnl Detect the canonical host and target build environment | |
135 | dnl | |
ae1912cb | 136 | |
c77f77a1 | 137 | AC_CANONICAL_HOST |
93c53424 | 138 | dnl Get system canonical name |
22a32389 | 139 | AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) |
1b1f143c | 140 | |
93c53424 | 141 | dnl Checks for programs. |
d930280a | 142 | CURL_CHECK_PROG_CC |
93c53424 | 143 | |
14240e9e YT |
144 | dnl Our curl_off_t internal and external configure settings |
145 | CURL_CONFIGURE_CURL_OFF_T | |
146 | ||
b4fdccf8 YT |
147 | dnl This defines _ALL_SOURCE for AIX |
148 | CURL_CHECK_AIX_ALL_SOURCE | |
149 | ||
1bc49007 | 150 | dnl Our configure and build reentrant settings |
052f9dde | 151 | CURL_CONFIGURE_REENTRANT |
1bc49007 | 152 | |
d4ffc5ef | 153 | dnl check for how to do large files |
1b1f143c | 154 | AC_SYS_LARGEFILE |
d4ffc5ef | 155 | |
c84f84c7 | 156 | dnl support building of Windows DLLs |
1e8f0c57 DS |
157 | AC_LIBTOOL_WIN32_DLL |
158 | ||
6cea5158 DF |
159 | dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD |
160 | AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)]) | |
74befdfb | 161 | case $host in |
6cea5158 | 162 | x86_64*linux*|amd64*freebsd*|ia64*freebsd*) |
74befdfb YT |
163 | AC_MSG_RESULT([yes]) |
164 | with_pic=yes | |
165 | ;; | |
166 | *) | |
167 | AC_MSG_RESULT([no]) | |
168 | ;; | |
169 | esac | |
170 | ||
1e8f0c57 | 171 | dnl libtool setup |
d20a0516 | 172 | AC_PROG_LIBTOOL |
93c53424 | 173 | |
fcfc6de9 | 174 | AC_MSG_CHECKING([if we need -mimpure-text]) |
5ab9d72e | 175 | mimpure=no |
fcfc6de9 DS |
176 | case $host in |
177 | *-*-solaris2*) | |
178 | if test "$GCC" = "yes"; then | |
179 | mimpure="yes" | |
180 | fi | |
181 | ;; | |
182 | *) | |
fcfc6de9 DS |
183 | ;; |
184 | esac | |
185 | AC_MSG_RESULT($mimpure) | |
186 | AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes) | |
bff96239 | 187 | AM_CONDITIONAL(STATICLIB, false) |
fcfc6de9 | 188 | |
4d815c99 DS |
189 | AC_MSG_CHECKING([if we need BUILDING_LIBCURL]) |
190 | case $host in | |
191 | *-*-mingw*) | |
192 | AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself]) | |
193 | AC_MSG_RESULT(yes) | |
b29017f1 | 194 | AC_MSG_CHECKING([if we need CURL_STATICLIB]) |
0bb04082 DS |
195 | if test "X$enable_shared" = "Xno" |
196 | then | |
197 | AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library]) | |
198 | AC_MSG_RESULT(yes) | |
bff96239 | 199 | AM_CONDITIONAL(STATICLIB, true) |
b29017f1 DS |
200 | else |
201 | AC_MSG_RESULT(no) | |
0bb04082 | 202 | fi |
4d815c99 DS |
203 | ;; |
204 | *) | |
205 | AC_MSG_RESULT(no) | |
206 | ;; | |
207 | esac | |
208 | ||
9de4e5eb DF |
209 | # Determine whether all dependent libraries must be specified when linking |
210 | if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" | |
211 | then | |
212 | REQUIRE_LIB_DEPS=no | |
213 | else | |
214 | REQUIRE_LIB_DEPS=yes | |
215 | fi | |
216 | AC_SUBST(REQUIRE_LIB_DEPS) | |
217 | ||
d1a1fcc6 DS |
218 | dnl The install stuff has already been taken care of by the automake stuff |
219 | dnl AC_PROG_INSTALL | |
ae1912cb DS |
220 | AC_PROG_MAKE_SET |
221 | ||
375cdf89 DS |
222 | dnl check if there's a way to force code inline |
223 | AC_C_INLINE | |
224 | ||
33ddeb6d YT |
225 | dnl ********************************************************************** |
226 | dnl platform/compiler/architecture specific checks/flags | |
227 | dnl ********************************************************************** | |
228 | ||
2245ac2f | 229 | CURL_CHECK_COMPILER |
d930280a YT |
230 | CURL_SET_COMPILER_BASIC_OPTS |
231 | CURL_SET_COMPILER_DEBUG_OPTS | |
232 | CURL_SET_COMPILER_OPTIMIZE_OPTS | |
233 | CURL_SET_COMPILER_WARNING_OPTS | |
9f8c40ed | 234 | |
1054dc5e YT |
235 | case $host in |
236 | # | |
237 | x86_64*linux*|amd64*freebsd*|ia64*freebsd*) | |
238 | # | |
231a51fe | 239 | if test "$compiler_id" = "INTEL_UNIX_C"; then |
9f8c40ed | 240 | # |
2245ac2f YT |
241 | if test "$compiler_num" -ge "900" && |
242 | test "$compiler_num" -lt "1000"; then | |
9f8c40ed | 243 | dnl icc 9.X specific |
beb14ca6 | 244 | CFLAGS="$CFLAGS -i-dynamic" |
9f8c40ed YT |
245 | fi |
246 | # | |
2245ac2f | 247 | if test "$compiler_num" -ge "1000"; then |
9f8c40ed | 248 | dnl icc 10.X or later |
beb14ca6 | 249 | CFLAGS="$CFLAGS -shared-intel" |
9f8c40ed YT |
250 | fi |
251 | # | |
252 | fi | |
1054dc5e YT |
253 | ;; |
254 | # | |
255 | esac | |
9f8c40ed | 256 | |
2c61e9c7 YT |
257 | CURL_CHECK_COMPILER_HALT_ON_ERROR |
258 | CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE | |
259 | ||
065047dc YT |
260 | CURL_CHECK_NO_UNDEFINED |
261 | AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) | |
262 | ||
263 | CURL_CHECK_CURLDEBUG | |
264 | AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) | |
265 | ||
2c61e9c7 YT |
266 | dnl ********************************************************************** |
267 | dnl Compilation based checks should not be done before this point. | |
268 | dnl ********************************************************************** | |
269 | ||
270 | dnl ********************************************************************** | |
271 | dnl Make sure that our checks for headers windows.h winsock.h winsock2.h | |
272 | dnl and ws2tcpip.h take precedence over any other further checks which | |
273 | dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for | |
274 | dnl this specific header files. And do them before its results are used. | |
275 | dnl ********************************************************************** | |
276 | ||
277 | CURL_CHECK_HEADER_WINDOWS | |
278 | CURL_CHECK_NATIVE_WINDOWS | |
279 | case X-"$ac_cv_native_windows" in | |
280 | X-yes) | |
281 | CURL_CHECK_HEADER_WINSOCK | |
282 | CURL_CHECK_HEADER_WINSOCK2 | |
283 | CURL_CHECK_HEADER_WS2TCPIP | |
284 | CURL_CHECK_HEADER_WINLDAP | |
285 | CURL_CHECK_HEADER_WINBER | |
286 | ;; | |
287 | *) | |
288 | ac_cv_header_winsock_h="no" | |
289 | ac_cv_header_winsock2_h="no" | |
290 | ac_cv_header_ws2tcpip_h="no" | |
291 | ac_cv_header_winldap_h="no" | |
292 | ac_cv_header_winber_h="no" | |
293 | ;; | |
294 | esac | |
fef60d9d | 295 | CURL_CHECK_WIN32_LARGEFILE |
2c61e9c7 | 296 | |
fd3881ea DS |
297 | dnl ************************************************************ |
298 | dnl switch off particular protocols | |
299 | dnl | |
300 | AC_MSG_CHECKING([whether to support http]) | |
301 | AC_ARG_ENABLE(http, | |
f136f435 DS |
302 | AC_HELP_STRING([--enable-http],[Enable HTTP support]) |
303 | AC_HELP_STRING([--disable-http],[Disable HTTP support]), | |
fd3881ea DS |
304 | [ case "$enableval" in |
305 | no) | |
306 | AC_MSG_RESULT(no) | |
22a32389 | 307 | AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) |
67a83c1b | 308 | AC_MSG_WARN([disable HTTP disables FTP over proxy]) |
3955b313 | 309 | AC_SUBST(CURL_DISABLE_HTTP, [1]) |
fd3881ea DS |
310 | ;; |
311 | *) AC_MSG_RESULT(yes) | |
312 | ;; | |
313 | esac ], | |
314 | AC_MSG_RESULT(yes) | |
315 | ) | |
316 | AC_MSG_CHECKING([whether to support ftp]) | |
317 | AC_ARG_ENABLE(ftp, | |
f136f435 DS |
318 | AC_HELP_STRING([--enable-ftp],[Enable FTP support]) |
319 | AC_HELP_STRING([--disable-ftp],[Disable FTP support]), | |
fd3881ea DS |
320 | [ case "$enableval" in |
321 | no) | |
322 | AC_MSG_RESULT(no) | |
22a32389 | 323 | AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) |
3955b313 | 324 | AC_SUBST(CURL_DISABLE_FTP, [1]) |
fd3881ea DS |
325 | ;; |
326 | *) AC_MSG_RESULT(yes) | |
327 | ;; | |
328 | esac ], | |
329 | AC_MSG_RESULT(yes) | |
330 | ) | |
fd3881ea DS |
331 | AC_MSG_CHECKING([whether to support file]) |
332 | AC_ARG_ENABLE(file, | |
f136f435 DS |
333 | AC_HELP_STRING([--enable-file],[Enable FILE support]) |
334 | AC_HELP_STRING([--disable-file],[Disable FILE support]), | |
fd3881ea DS |
335 | [ case "$enableval" in |
336 | no) | |
337 | AC_MSG_RESULT(no) | |
22a32389 | 338 | AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) |
3955b313 | 339 | AC_SUBST(CURL_DISABLE_FILE, [1]) |
fd3881ea DS |
340 | ;; |
341 | *) AC_MSG_RESULT(yes) | |
342 | ;; | |
343 | esac ], | |
344 | AC_MSG_RESULT(yes) | |
345 | ) | |
346 | AC_MSG_CHECKING([whether to support ldap]) | |
347 | AC_ARG_ENABLE(ldap, | |
f136f435 DS |
348 | AC_HELP_STRING([--enable-ldap],[Enable LDAP support]) |
349 | AC_HELP_STRING([--disable-ldap],[Disable LDAP support]), | |
fd3881ea DS |
350 | [ case "$enableval" in |
351 | no) | |
352 | AC_MSG_RESULT(no) | |
22a32389 | 353 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) |
3955b313 | 354 | AC_SUBST(CURL_DISABLE_LDAP, [1]) |
fd3881ea | 355 | ;; |
a674654f YT |
356 | *) |
357 | case $host in | |
358 | *-*-cygwin*) | |
359 | # Force no ldap. config/build process is broken for cygwin | |
360 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) | |
361 | AC_SUBST(CURL_DISABLE_LDAP, [1]) | |
362 | AC_MSG_RESULT(no) | |
363 | ;; | |
364 | *) | |
365 | AC_MSG_RESULT(yes) | |
366 | esac | |
fd3881ea | 367 | ;; |
a674654f YT |
368 | esac ],[ |
369 | case $host in | |
370 | *-*-cygwin*) | |
371 | # Force no ldap. config/build process is broken for cygwin | |
372 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) | |
373 | AC_SUBST(CURL_DISABLE_LDAP, [1]) | |
374 | AC_MSG_RESULT(no) | |
375 | ;; | |
376 | *) | |
377 | AC_MSG_RESULT(yes) | |
378 | esac ] | |
fd3881ea | 379 | ) |
4b60c3e9 GK |
380 | AC_MSG_CHECKING([whether to support ldaps]) |
381 | AC_ARG_ENABLE(ldaps, | |
382 | AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support]) | |
383 | AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), | |
384 | [ case "$enableval" in | |
385 | no) | |
386 | AC_MSG_RESULT(no) | |
387 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) | |
388 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) | |
389 | ;; | |
390 | *) if test x$CURL_DISABLE_LDAP = x1 ; then | |
391 | AC_MSG_RESULT(LDAP support needs to be enabled in order to enable LDAPS support!) | |
392 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) | |
393 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) | |
394 | else | |
395 | AC_MSG_RESULT(yes) | |
396 | AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) | |
397 | curl_ldaps_msg="enabled" | |
398 | fi | |
399 | ;; | |
400 | esac ], | |
401 | AC_MSG_RESULT(no) | |
402 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) | |
403 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) | |
404 | ) | |
405 | ||
6f8d4397 | 406 | AC_MSG_CHECKING([whether to support proxies]) |
f3ab5d55 DS |
407 | AC_ARG_ENABLE(proxy, |
408 | AC_HELP_STRING([--enable-proxy],[Enable proxy support]) | |
409 | AC_HELP_STRING([--disable-proxy],[Disable proxy support]), | |
410 | [ case "$enableval" in | |
411 | no) | |
412 | AC_MSG_RESULT(no) | |
413 | AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) | |
414 | AC_SUBST(CURL_DISABLE_PROXY, [1]) | |
415 | ;; | |
416 | *) AC_MSG_RESULT(yes) | |
417 | ;; | |
418 | esac ], | |
419 | AC_MSG_RESULT(yes) | |
420 | ) | |
421 | ||
fd3881ea DS |
422 | AC_MSG_CHECKING([whether to support dict]) |
423 | AC_ARG_ENABLE(dict, | |
f136f435 DS |
424 | AC_HELP_STRING([--enable-dict],[Enable DICT support]) |
425 | AC_HELP_STRING([--disable-dict],[Disable DICT support]), | |
fd3881ea DS |
426 | [ case "$enableval" in |
427 | no) | |
428 | AC_MSG_RESULT(no) | |
b9c60df0 | 429 | AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) |
3955b313 | 430 | AC_SUBST(CURL_DISABLE_DICT, [1]) |
fd3881ea DS |
431 | ;; |
432 | *) AC_MSG_RESULT(yes) | |
433 | ;; | |
434 | esac ], | |
435 | AC_MSG_RESULT(yes) | |
436 | ) | |
437 | AC_MSG_CHECKING([whether to support telnet]) | |
438 | AC_ARG_ENABLE(telnet, | |
f136f435 DS |
439 | AC_HELP_STRING([--enable-telnet],[Enable TELNET support]) |
440 | AC_HELP_STRING([--disable-telnet],[Disable TELNET support]), | |
fd3881ea DS |
441 | [ case "$enableval" in |
442 | no) | |
443 | AC_MSG_RESULT(no) | |
22a32389 | 444 | AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) |
3955b313 | 445 | AC_SUBST(CURL_DISABLE_TELNET, [1]) |
fd3881ea DS |
446 | ;; |
447 | *) AC_MSG_RESULT(yes) | |
448 | ;; | |
449 | esac ], | |
450 | AC_MSG_RESULT(yes) | |
451 | ) | |
56d9624b DS |
452 | AC_MSG_CHECKING([whether to support tftp]) |
453 | AC_ARG_ENABLE(tftp, | |
454 | AC_HELP_STRING([--enable-tftp],[Enable TFTP support]) | |
455 | AC_HELP_STRING([--disable-tftp],[Disable TFTP support]), | |
456 | [ case "$enableval" in | |
457 | no) | |
458 | AC_MSG_RESULT(no) | |
459 | AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) | |
460 | AC_SUBST(CURL_DISABLE_TFTP, [1]) | |
461 | ;; | |
462 | *) AC_MSG_RESULT(yes) | |
463 | ;; | |
464 | esac ], | |
465 | AC_MSG_RESULT(yes) | |
466 | ) | |
fd3881ea | 467 | |
f3663a9d DS |
468 | dnl ********************************************************************** |
469 | dnl Check for built-in manual | |
470 | dnl ********************************************************************** | |
471 | ||
472 | AC_MSG_CHECKING([whether to provide built-in manual]) | |
473 | AC_ARG_ENABLE(manual, | |
474 | AC_HELP_STRING([--enable-manual],[Enable built-in manual]) | |
475 | AC_HELP_STRING([--disable-manual],[Disable built-in manual]), | |
476 | [ case "$enableval" in | |
477 | no) | |
478 | AC_MSG_RESULT(no) | |
479 | ;; | |
480 | *) AC_MSG_RESULT(yes) | |
481 | USE_MANUAL="1" | |
482 | ;; | |
483 | esac ], | |
484 | AC_MSG_RESULT(yes) | |
485 | USE_MANUAL="1" | |
486 | ) | |
487 | dnl The actual use of the USE_MANUAL variable is done much later in this | |
488 | dnl script to allow other actions to disable it as well. | |
489 | ||
ae1912cb DS |
490 | dnl ********************************************************************** |
491 | dnl Checks for libraries. | |
492 | dnl ********************************************************************** | |
493 | ||
9b4253fe | 494 | CURL_CHECK_LIB_XNET |
c76e5382 | 495 | |
9f2780a2 DS |
496 | dnl gethostbyname without lib or in the nsl lib? |
497 | AC_CHECK_FUNC(gethostbyname, | |
498 | [HAVE_GETHOSTBYNAME="1" | |
499 | ], | |
500 | [ AC_CHECK_LIB(nsl, gethostbyname, | |
501 | [HAVE_GETHOSTBYNAME="1" | |
502 | LIBS="$LIBS -lnsl" | |
503 | ]) | |
504 | ]) | |
505 | ||
506 | if test "$HAVE_GETHOSTBYNAME" != "1" | |
507 | then | |
61fb8fea | 508 | dnl gethostbyname in the socket lib? |
9f2780a2 DS |
509 | AC_CHECK_LIB(socket, gethostbyname, |
510 | [HAVE_GETHOSTBYNAME="1" | |
511 | LIBS="$LIBS -lsocket" | |
512 | ]) | |
61fb8fea DS |
513 | fi |
514 | ||
9f2780a2 DS |
515 | dnl At least one system has been identified to require BOTH nsl and socket |
516 | dnl libs at the same time to link properly. | |
517 | if test "$HAVE_GETHOSTBYNAME" != "1" | |
518 | then | |
af43ce73 | 519 | AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) |
caf8c01e DS |
520 | my_ac_save_LIBS=$LIBS |
521 | LIBS="-lnsl -lsocket $LIBS" | |
8ad1928d YT |
522 | AC_LINK_IFELSE([ |
523 | AC_LANG_PROGRAM([[ | |
524 | ]],[[ | |
525 | gethostbyname(); | |
526 | ]]) | |
527 | ],[ | |
528 | AC_MSG_RESULT([yes]) | |
529 | HAVE_GETHOSTBYNAME="1" | |
530 | ],[ | |
531 | AC_MSG_RESULT([no]) | |
532 | LIBS=$my_ac_save_LIBS | |
533 | ]) | |
9f2780a2 | 534 | fi |
caf8c01e | 535 | |
9f2780a2 DS |
536 | if test "$HAVE_GETHOSTBYNAME" != "1" |
537 | then | |
560a82ae YT |
538 | dnl This is for winsock systems |
539 | if test "$ac_cv_header_windows_h" = "yes"; then | |
540 | if test "$ac_cv_header_winsock_h" = "yes"; then | |
512b9ac1 YT |
541 | case $host in |
542 | *-*-mingw32ce*) | |
543 | winsock_LIB="-lwinsock" | |
544 | ;; | |
545 | *) | |
546 | winsock_LIB="-lwsock32" | |
547 | ;; | |
548 | esac | |
560a82ae YT |
549 | fi |
550 | if test "$ac_cv_header_winsock2_h" = "yes"; then | |
551 | winsock_LIB="-lws2_32" | |
552 | fi | |
553 | if test ! -z "$winsock_LIB"; then | |
554 | my_ac_save_LIBS=$LIBS | |
555 | LIBS="$winsock_LIB $LIBS" | |
556 | AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) | |
8ad1928d YT |
557 | AC_LINK_IFELSE([ |
558 | AC_LANG_PROGRAM([[ | |
560a82ae YT |
559 | #ifdef HAVE_WINDOWS_H |
560 | #ifndef WIN32_LEAN_AND_MEAN | |
561 | #define WIN32_LEAN_AND_MEAN | |
562 | #endif | |
563 | #include <windows.h> | |
564 | #ifdef HAVE_WINSOCK2_H | |
565 | #include <winsock2.h> | |
566 | #else | |
567 | #ifdef HAVE_WINSOCK_H | |
568 | #include <winsock.h> | |
569 | #endif | |
570 | #endif | |
571 | #endif | |
8ad1928d | 572 | ]],[[ |
560a82ae | 573 | gethostbyname("www.dummysite.com"); |
8ad1928d YT |
574 | ]]) |
575 | ],[ | |
576 | AC_MSG_RESULT([yes]) | |
577 | HAVE_GETHOSTBYNAME="1" | |
578 | ],[ | |
579 | AC_MSG_RESULT([no]) | |
580 | winsock_LIB="" | |
581 | LIBS=$my_ac_save_LIBS | |
560a82ae YT |
582 | ]) |
583 | fi | |
584 | fi | |
684245d6 DF |
585 | fi |
586 | ||
0427e944 DF |
587 | if test "$HAVE_GETHOSTBYNAME" != "1" |
588 | then | |
589 | dnl This is for Minix 3.1 | |
590 | AC_MSG_CHECKING([for gethostbyname for Minix 3]) | |
8ad1928d YT |
591 | AC_LINK_IFELSE([ |
592 | AC_LANG_PROGRAM([[ | |
0427e944 | 593 | /* Older Minix versions may need <net/gen/netdb.h> here instead */ |
8ad1928d YT |
594 | #include <netdb.h> |
595 | ]],[[ | |
596 | gethostbyname("www.dummysite.com"); | |
597 | ]]) | |
598 | ],[ | |
599 | AC_MSG_RESULT([yes]) | |
600 | HAVE_GETHOSTBYNAME="1" | |
601 | ],[ | |
602 | AC_MSG_RESULT([no]) | |
603 | ]) | |
0427e944 DF |
604 | fi |
605 | ||
684245d6 DF |
606 | if test "$HAVE_GETHOSTBYNAME" != "1" |
607 | then | |
608 | dnl This is for eCos with a stubbed DNS implementation | |
609 | AC_MSG_CHECKING([for gethostbyname for eCos]) | |
8ad1928d YT |
610 | AC_LINK_IFELSE([ |
611 | AC_LANG_PROGRAM([[ | |
684245d6 | 612 | #include <stdio.h> |
8ad1928d YT |
613 | #include <netdb.h> |
614 | ]],[[ | |
615 | gethostbyname("www.dummysite.com"); | |
616 | ]]) | |
617 | ],[ | |
618 | AC_MSG_RESULT([yes]) | |
619 | HAVE_GETHOSTBYNAME="1" | |
620 | ],[ | |
621 | AC_MSG_RESULT([no]) | |
622 | ]) | |
9f2780a2 DS |
623 | fi |
624 | ||
b97606f0 DS |
625 | if test "$HAVE_GETHOSTBYNAME" != "1" |
626 | then | |
627 | dnl gethostbyname in the network lib - for Haiku OS | |
628 | AC_CHECK_LIB(network, gethostbyname, | |
629 | [HAVE_GETHOSTBYNAME="1" | |
630 | LIBS="$LIBS -lnetwork" | |
631 | ]) | |
632 | fi | |
633 | ||
58f4af79 DS |
634 | if test "$HAVE_GETHOSTBYNAME" != "1" |
635 | then | |
636 | dnl gethostbyname in the net lib - for BeOS | |
637 | AC_CHECK_LIB(net, gethostbyname, | |
638 | [HAVE_GETHOSTBYNAME="1" | |
639 | LIBS="$LIBS -lnet" | |
640 | ]) | |
641 | fi | |
642 | ||
643 | ||
9b12f096 | 644 | if test "$HAVE_GETHOSTBYNAME" != "1"; then |
9f2780a2 | 645 | AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) |
caf8c01e DS |
646 | fi |
647 | ||
ae1912cb | 648 | dnl resolve lib? |
22a32389 | 649 | AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ]) |
ae1912cb | 650 | |
b174aeaa DS |
651 | if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then |
652 | AC_CHECK_LIB(resolve, strcasecmp, | |
653 | [LIBS="-lresolve $LIBS"], | |
654 | , | |
655 | -lnsl) | |
656 | fi | |
4c621bc6 | 657 | ac_cv_func_strcasecmp="no" |
b174aeaa | 658 | |
1ff4e900 | 659 | CURL_CHECK_LIBS_CONNECT |
ae1912cb | 660 | |
b380dd03 | 661 | dnl ********************************************************************** |
ed80eb5b YT |
662 | dnl In case that function clock_gettime with monotonic timer is available, |
663 | dnl check for additional required libraries. | |
b380dd03 | 664 | dnl ********************************************************************** |
ed80eb5b | 665 | CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC |
b380dd03 | 666 | |
c461254d DF |
667 | dnl ********************************************************************** |
668 | dnl The preceding library checks are all potentially useful for test | |
669 | dnl servers (for providing networking support). Save the list of required | |
670 | dnl libraries at this point for use while linking those test servers. | |
671 | dnl ********************************************************************** | |
672 | TEST_SERVER_LIBS=$LIBS | |
ae1912cb | 673 | |
c461254d | 674 | dnl ********************************************************************** |
075c5342 DS |
675 | AC_MSG_CHECKING([whether to use libgcc]) |
676 | AC_ARG_ENABLE(libgcc, | |
677 | AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]), | |
678 | [ case "$enableval" in | |
679 | yes) | |
a0a47f27 | 680 | ALL_LIBS="$ALL_LIBS -lgcc" |
075c5342 DS |
681 | AC_MSG_RESULT(yes) |
682 | ;; | |
683 | *) AC_MSG_RESULT(no) | |
684 | ;; | |
685 | esac ], | |
686 | AC_MSG_RESULT(no) | |
687 | ) | |
688 | ||
3ec605de | 689 | dnl ********************************************************************** |
d0edb478 | 690 | dnl Check for LDAP |
205f8b26 DF |
691 | dnl ********************************************************************** |
692 | ||
693 | LDAPLIBNAME="" | |
694 | AC_ARG_WITH(ldap-lib, | |
d0edb478 | 695 | AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]), |
205f8b26 DF |
696 | [LDAPLIBNAME="$withval"]) |
697 | ||
698 | LBERLIBNAME="" | |
699 | AC_ARG_WITH(lber-lib, | |
d0edb478 | 700 | AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]), |
205f8b26 DF |
701 | [LBERLIBNAME="$withval"]) |
702 | ||
703 | if test x$CURL_DISABLE_LDAP != x1 ; then | |
704 | ||
a171f60b YT |
705 | CURL_CHECK_HEADER_LBER |
706 | CURL_CHECK_HEADER_LDAP | |
707 | CURL_CHECK_HEADER_LDAPSSL | |
708 | CURL_CHECK_HEADER_LDAP_SSL | |
3337be81 | 709 | |
205f8b26 DF |
710 | if test -z "$LDAPLIBNAME" ; then |
711 | case $host in | |
d0edb478 | 712 | *-*-cygwin* | *-*-mingw* | *-*-pw32*) |
205f8b26 | 713 | dnl Windows uses a single and unique OpenLDAP DLL name |
d0edb478 | 714 | LDAPLIBNAME="wldap32" |
205f8b26 DF |
715 | LBERLIBNAME="no" |
716 | ;; | |
717 | esac | |
718 | fi | |
719 | ||
720 | if test "$LDAPLIBNAME" ; then | |
d0edb478 DS |
721 | AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [ |
722 | AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled]) | |
723 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) | |
724 | AC_SUBST(CURL_DISABLE_LDAP, [1])]) | |
c37cdbe2 DF |
725 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
726 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) | |
205f8b26 | 727 | else |
4db954f8 YT |
728 | dnl Try to find the right ldap libraries for this system |
729 | CURL_CHECK_LIBS_LDAP | |
730 | case X-"$curl_cv_ldap_LIBS" in | |
731 | X-unknown) | |
732 | AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled]) | |
733 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) | |
734 | AC_SUBST(CURL_DISABLE_LDAP, [1]) | |
c37cdbe2 DF |
735 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
736 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) | |
4db954f8 YT |
737 | ;; |
738 | esac | |
205f8b26 | 739 | fi |
d0edb478 DS |
740 | fi |
741 | ||
742 | if test x$CURL_DISABLE_LDAP != x1 ; then | |
205f8b26 DF |
743 | |
744 | if test "$LBERLIBNAME" ; then | |
d0edb478 | 745 | dnl If name is "no" then don't define this library at all |
205f8b26 | 746 | dnl (it's only needed if libldap.so's dependencies are broken). |
e16c1b8e | 747 | if test "$LBERLIBNAME" != "no" ; then |
d0edb478 DS |
748 | AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ |
749 | AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled]) | |
750 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) | |
751 | AC_SUBST(CURL_DISABLE_LDAP, [1])]) | |
c37cdbe2 DF |
752 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
753 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) | |
205f8b26 | 754 | fi |
d0edb478 DS |
755 | fi |
756 | fi | |
757 | ||
758 | if test x$CURL_DISABLE_LDAP != x1 ; then | |
759 | AC_CHECK_FUNCS([ldap_url_parse]) | |
760 | ||
761 | if test "$LDAPLIBNAME" = "wldap32"; then | |
4b60c3e9 | 762 | curl_ldap_msg="enabled (winldap)" |
d0edb478 DS |
763 | AC_DEFINE(CURL_LDAP_WIN, 1, [Use W$ LDAP implementation]) |
764 | case $host in | |
72e675ca | 765 | *-*-cygwin* | *-*-pw32*) |
d0edb478 DS |
766 | AC_DEFINE(CURL_LDAP_HYBRID, 1, [W$ LDAP with non-W$ compiler]) |
767 | ;; | |
768 | esac | |
769 | else | |
4b60c3e9 | 770 | curl_ldap_msg="enabled (OpenLDAP)" |
205f8b26 DF |
771 | fi |
772 | fi | |
773 | ||
d1b17779 DS |
774 | dnl ********************************************************************** |
775 | dnl Checks for IPv6 | |
776 | dnl ********************************************************************** | |
777 | ||
778 | AC_MSG_CHECKING([whether to enable ipv6]) | |
779 | AC_ARG_ENABLE(ipv6, | |
780 | AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support]) | |
781 | AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]), | |
782 | [ case "$enableval" in | |
783 | no) | |
784 | AC_MSG_RESULT(no) | |
785 | ipv6=no | |
786 | ;; | |
787 | *) AC_MSG_RESULT(yes) | |
788 | ipv6=yes | |
789 | ;; | |
790 | esac ], | |
791 | ||
792 | AC_TRY_RUN([ /* is AF_INET6 available? */ | |
793 | #include <sys/types.h> | |
794 | #include <sys/socket.h> | |
795 | main() | |
796 | { | |
797 | if (socket(AF_INET6, SOCK_STREAM, 0) < 0) | |
798 | exit(1); | |
799 | else | |
800 | exit(0); | |
801 | } | |
802 | ], | |
803 | AC_MSG_RESULT(yes) | |
804 | ipv6=yes, | |
805 | AC_MSG_RESULT(no) | |
806 | ipv6=no, | |
807 | AC_MSG_RESULT(no) | |
808 | ipv6=no | |
809 | )) | |
810 | ||
811 | if test "$ipv6" = "yes"; then | |
cff90cf3 | 812 | curl_ipv6_msg="enabled" |
d1b17779 DS |
813 | fi |
814 | ||
6efde612 GK |
815 | # Check if struct sockaddr_in6 have sin6_scope_id member |
816 | if test "$ipv6" = yes; then | |
817 | AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) | |
818 | AC_TRY_COMPILE([ | |
819 | #include <sys/types.h> | |
820 | #include <netinet/in.h>] , | |
821 | struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes) | |
822 | if test "$have_sin6_scope_id" = yes; then | |
1cc50d31 GK |
823 | AC_MSG_RESULT([yes]) |
824 | AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) | |
6efde612 | 825 | else |
1cc50d31 | 826 | AC_MSG_RESULT([no]) |
6efde612 GK |
827 | fi |
828 | fi | |
829 | ||
7f67a28c DS |
830 | dnl ********************************************************************** |
831 | dnl Check if the operating system allows programs to write to their own argv[] | |
832 | dnl ********************************************************************** | |
833 | ||
834 | AC_MSG_CHECKING([if argv can be written to]) | |
0717e469 | 835 | AC_CACHE_VAL(curl_cv_writable_argv, [ |
a139ce90 | 836 | AC_RUN_IFELSE([[ |
7f67a28c | 837 | int main(int argc, char ** argv) { |
77431568 GK |
838 | argv[0][0] = ' '; |
839 | return (argv[0][0] == ' ')?0:1; | |
7f67a28c | 840 | } |
77431568 GK |
841 | ]], |
842 | curl_cv_writable_argv=yes, | |
843 | curl_cv_writable_argv=no, | |
844 | curl_cv_writable_argv=cross) | |
0717e469 DS |
845 | ]) |
846 | case $curl_cv_writable_argv in | |
847 | yes) | |
77431568 GK |
848 | AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) |
849 | AC_MSG_RESULT(yes) | |
850 | ;; | |
0717e469 | 851 | no) |
77431568 GK |
852 | AC_MSG_RESULT(no) |
853 | ;; | |
0717e469 | 854 | *) |
a139ce90 DS |
855 | AC_MSG_RESULT(no) |
856 | AC_MSG_WARN([the previous check could not be made default was used]) | |
77431568 | 857 | ;; |
0717e469 | 858 | esac |
7f67a28c | 859 | |
00505c92 DS |
860 | dnl ********************************************************************** |
861 | dnl Check for the presence of Kerberos4 libraries and headers | |
862 | dnl ********************************************************************** | |
863 | ||
864 | AC_ARG_WITH(krb4-includes, | |
f136f435 DS |
865 | AC_HELP_STRING([--with-krb4-includes=DIR], |
866 | [Specify location of kerberos4 headers]),[ | |
00505c92 DS |
867 | CPPFLAGS="$CPPFLAGS -I$withval" |
868 | KRB4INC="$withval" | |
869 | want_krb4=yes | |
870 | ]) | |
871 | ||
872 | AC_ARG_WITH(krb4-libs, | |
f136f435 | 873 | AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[ |
00505c92 DS |
874 | LDFLAGS="$LDFLAGS -L$withval" |
875 | KRB4LIB="$withval" | |
876 | want_krb4=yes | |
877 | ]) | |
878 | ||
879 | ||
880 | OPT_KRB4=off | |
881 | AC_ARG_WITH(krb4,dnl | |
f136f435 | 882 | AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[ |
00505c92 | 883 | OPT_KRB4="$withval" |
5872e8dd DF |
884 | if test X"$OPT_KRB4" != Xno; then |
885 | want_krb4="yes" | |
886 | if test X"$OPT_KRB4" != Xyes; then | |
887 | LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff" | |
888 | KRB4LIB="$OPT_KRB4/lib$libsuff" | |
889 | CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include" | |
890 | KRB4INC="$OPT_KRB4/include" | |
891 | fi | |
00505c92 | 892 | fi |
00505c92 DS |
893 | ]) |
894 | ||
895 | AC_MSG_CHECKING([if Kerberos4 support is requested]) | |
896 | ||
897 | if test "$want_krb4" = yes | |
898 | then | |
f6e2bfd4 DS |
899 | if test "$ipv6" = "yes"; then |
900 | echo krb4 is not compatible with IPv6 | |
901 | exit 1 | |
902 | fi | |
00505c92 DS |
903 | AC_MSG_RESULT(yes) |
904 | ||
905 | dnl Check for & handle argument to --with-krb4 | |
906 | ||
907 | AC_MSG_CHECKING(where to look for Kerberos4) | |
908 | if test X"$OPT_KRB4" = Xyes | |
909 | then | |
910 | AC_MSG_RESULT([defaults]) | |
911 | else | |
912 | AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC]) | |
913 | fi | |
914 | ||
915 | dnl Check for DES library | |
916 | AC_CHECK_LIB(des, des_pcbc_encrypt, | |
917 | [ | |
918 | AC_CHECK_HEADERS(des.h) | |
919 | ||
920 | dnl resolv lib? | |
22a32389 | 921 | AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)]) |
00505c92 DS |
922 | |
923 | dnl Check for the Kerberos4 library | |
924 | AC_CHECK_LIB(krb, krb_net_read, | |
925 | [ | |
926 | dnl Check for header files | |
927 | AC_CHECK_HEADERS(krb.h) | |
928 | ||
929 | dnl we found the required libraries, add to LIBS | |
b55507c8 | 930 | LIBS="-lkrb -lcom_err -ldes $LIBS" |
00505c92 DS |
931 | |
932 | dnl Check for function krb_get_our_ip_for_realm | |
933 | dnl this is needed for NAT networks | |
934 | AC_CHECK_FUNCS(krb_get_our_ip_for_realm) | |
935 | ||
936 | dnl add define KRB4 | |
d4629fd3 | 937 | AC_DEFINE(HAVE_KRB4, 1, |
22a32389 | 938 | [if you have the Kerberos4 libraries (including -ldes)]) |
00505c92 | 939 | |
1ee7f92c DS |
940 | dnl substitute it too! |
941 | KRB4_ENABLED=1 | |
942 | AC_SUBST(KRB4_ENABLED) | |
943 | ||
cff90cf3 DS |
944 | curl_krb4_msg="enabled" |
945 | ||
00505c92 DS |
946 | dnl the krb4 stuff needs a strlcpy() |
947 | AC_CHECK_FUNCS(strlcpy) | |
948 | ||
949 | ]) | |
950 | ]) | |
951 | else | |
952 | AC_MSG_RESULT(no) | |
953 | fi | |
954 | ||
09ccfcdc DS |
955 | dnl ********************************************************************** |
956 | dnl Check for FBopenssl(SPNEGO) libraries | |
957 | dnl ********************************************************************** | |
958 | ||
959 | AC_ARG_WITH(spnego, | |
960 | AC_HELP_STRING([--with-spnego=DIR], | |
5872e8dd DF |
961 | [Specify location of SPNEGO library fbopenssl]), [ |
962 | SPNEGO_ROOT="$withval" | |
963 | if test x"$SPNEGO_ROOT" != xno; then | |
964 | want_spnego="yes" | |
965 | fi | |
966 | ]) | |
967 | ||
09ccfcdc DS |
968 | AC_MSG_CHECKING([if SPNEGO support is requested]) |
969 | if test x"$want_spnego" = xyes; then | |
f6413f2c DS |
970 | |
971 | if test X"$SPNEGO_ROOT" = Xyes; then | |
972 | AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!]) | |
973 | AC_MSG_RESULT(no) | |
09ccfcdc | 974 | else |
f6413f2c | 975 | if test -z "$SPNEGO_LIB_DIR"; then |
202e54cf | 976 | LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl" |
f6413f2c DS |
977 | else |
978 | LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR" | |
979 | fi | |
e16c1b8e | 980 | |
f6413f2c | 981 | AC_MSG_RESULT(yes) |
cff90cf3 DS |
982 | AC_DEFINE(HAVE_SPNEGO, 1, |
983 | [Define this if you have the SPNEGO library fbopenssl]) | |
984 | curl_spnego_msg="enabled" | |
f6413f2c | 985 | fi |
09ccfcdc DS |
986 | else |
987 | AC_MSG_RESULT(no) | |
988 | fi | |
989 | ||
e56ae142 DS |
990 | dnl ********************************************************************** |
991 | dnl Check for GSS-API libraries | |
992 | dnl ********************************************************************** | |
993 | ||
c1b734a3 DS |
994 | dnl check for gss stuff in the /usr as default |
995 | ||
996 | GSSAPI_ROOT="/usr" | |
e56ae142 DS |
997 | AC_ARG_WITH(gssapi-includes, |
998 | AC_HELP_STRING([--with-gssapi-includes=DIR], | |
999 | [Specify location of GSSAPI header]), | |
e16c1b8e | 1000 | [ GSSAPI_INCS="-I$withval" |
e56ae142 DS |
1001 | want_gss="yes" ] |
1002 | ) | |
1003 | ||
1004 | AC_ARG_WITH(gssapi-libs, | |
1005 | AC_HELP_STRING([--with-gssapi-libs=DIR], | |
77431568 | 1006 | [Specify location of GSSAPI libs]), |
2723eda1 | 1007 | [ GSSAPI_LIB_DIR="-L$withval" |
e56ae142 DS |
1008 | want_gss="yes" ] |
1009 | ) | |
1010 | ||
1011 | AC_ARG_WITH(gssapi, | |
1012 | AC_HELP_STRING([--with-gssapi=DIR], | |
5872e8dd DF |
1013 | [Where to look for GSSAPI]), [ |
1014 | GSSAPI_ROOT="$withval" | |
1015 | if test x"$GSSAPI_ROOT" != xno; then | |
e16c1b8e | 1016 | want_gss="yes" |
c1b734a3 DS |
1017 | if test x"$GSSAPI_ROOT" = xyes; then |
1018 | dnl if yes, then use default root | |
1019 | GSSAPI_ROOT="/usr" | |
1020 | fi | |
5872e8dd DF |
1021 | fi |
1022 | ]) | |
e56ae142 | 1023 | |
982ba214 | 1024 | save_CPPFLAGS="$CPPFLAGS" |
e56ae142 DS |
1025 | AC_MSG_CHECKING([if GSSAPI support is requested]) |
1026 | if test x"$want_gss" = xyes; then | |
5effe8f3 DS |
1027 | AC_MSG_RESULT(yes) |
1028 | ||
e56ae142 DS |
1029 | if test -z "$GSSAPI_INCS"; then |
1030 | if test -f "$GSSAPI_ROOT/bin/krb5-config"; then | |
f4046763 | 1031 | GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi` |
c1b734a3 | 1032 | GSSAPI_LIBS=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` |
49111a63 | 1033 | elif test "$GSSAPI_ROOT" != "yes"; then |
533519cc | 1034 | GSSAPI_INCS="-I$GSSAPI_ROOT/include" |
c1b734a3 | 1035 | GSSAPI_LIBS="-lgssapi" |
e56ae142 | 1036 | fi |
e56ae142 | 1037 | fi |
c1b734a3 | 1038 | |
f4046763 | 1039 | CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" |
c1b734a3 | 1040 | LIBS="$LIBS $GSSAPI_LIBS" |
5effe8f3 DS |
1041 | |
1042 | AC_CHECK_HEADER(gss.h, | |
1043 | [ | |
1044 | dnl found in the given dirs | |
1045 | AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries]) | |
1046 | gnu_gss=yes | |
1047 | ], | |
1048 | [ | |
d0a4b50e MM |
1049 | dnl not found, check Heimdal or MIT |
1050 | AC_CHECK_HEADERS( | |
1051 | [gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h], | |
1052 | [], | |
1053 | [not_mit=1]) | |
1054 | if test "x$not_mit" = "x1"; then | |
1055 | dnl MIT not found, check for Heimdal | |
1056 | AC_CHECK_HEADER(gssapi.h, | |
5effe8f3 | 1057 | [ |
e16c1b8e | 1058 | dnl found |
40e1a016 | 1059 | AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries]) |
5effe8f3 DS |
1060 | ], |
1061 | [ | |
1062 | dnl no header found, disabling GSS | |
1063 | want_gss=no | |
1064 | AC_MSG_WARN(disabling GSSAPI since no header files was found) | |
1065 | ] | |
1066 | ) | |
d0a4b50e MM |
1067 | else |
1068 | dnl MIT found | |
1069 | AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries]) | |
1070 | dnl check if we have a really old MIT kerberos (<= 1.2) | |
1071 | AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE]) | |
7ad3abfd YT |
1072 | AC_COMPILE_IFELSE([ |
1073 | AC_LANG_PROGRAM([[ | |
d0a4b50e MM |
1074 | #include <gssapi/gssapi.h> |
1075 | #include <gssapi/gssapi_generic.h> | |
1076 | #include <gssapi/gssapi_krb5.h> | |
7ad3abfd | 1077 | ]],[[ |
d0a4b50e MM |
1078 | gss_import_name( |
1079 | (OM_uint32 *)0, | |
1080 | (gss_buffer_t)0, | |
1081 | GSS_C_NT_HOSTBASED_SERVICE, | |
1082 | (gss_name_t *)0); | |
7ad3abfd YT |
1083 | ]]) |
1084 | ],[ | |
1085 | AC_MSG_RESULT([yes]) | |
1086 | ],[ | |
1087 | AC_MSG_RESULT([no]) | |
1088 | AC_DEFINE(HAVE_OLD_GSSMIT, 1, | |
1089 | [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE]) | |
1090 | ]) | |
d0a4b50e | 1091 | fi |
5effe8f3 DS |
1092 | ] |
1093 | ) | |
1094 | else | |
1095 | AC_MSG_RESULT(no) | |
1096 | fi | |
1097 | if test x"$want_gss" = xyes; then | |
1098 | AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries]) | |
1099 | ||
1100 | curl_gss_msg="enabled (MIT/Heimdal)" | |
1101 | ||
1102 | if test -n "$gnu_gss"; then | |
1103 | curl_gss_msg="enabled (GNU GSS)" | |
9bb51d76 MM |
1104 | LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" |
1105 | LIBS="$LIBS -lgss" | |
5effe8f3 | 1106 | elif test -z "$GSSAPI_LIB_DIR"; then |
e56ae142 | 1107 | if test -f "$GSSAPI_ROOT/bin/krb5-config"; then |
9bb51d76 MM |
1108 | dnl krb5-config doesn't have --libs-only-L or similar, put everything |
1109 | dnl into LIBS | |
1110 | gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi` | |
1111 | LIBS="$LIBS $gss_libs" | |
49111a63 | 1112 | elif test "$GSSAPI_ROOT" != "yes"; then |
9bb51d76 MM |
1113 | LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" |
1114 | LIBS="$LIBS -lgssapi" | |
49111a63 | 1115 | else |
9bb51d76 | 1116 | LIBS="$LIBS -lgssapi" |
e56ae142 DS |
1117 | fi |
1118 | else | |
9bb51d76 MM |
1119 | LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" |
1120 | LIBS="$LIBS -lgssapi" | |
e56ae142 | 1121 | fi |
e56ae142 | 1122 | else |
5effe8f3 | 1123 | CPPFLAGS="$save_CPPFLAGS" |
e56ae142 | 1124 | fi |
e16c1b8e | 1125 | |
ae1912cb DS |
1126 | dnl ********************************************************************** |
1127 | dnl Check for the presence of SSL libraries and headers | |
1128 | dnl ********************************************************************** | |
1129 | ||
1130 | dnl Default to compiler & linker defaults for SSL files & libraries. | |
1131 | OPT_SSL=off | |
2c2baa93 DS |
1132 | dnl Default to no CA bundle |
1133 | ca="no" | |
ae1912cb | 1134 | AC_ARG_WITH(ssl,dnl |
d7a29388 | 1135 | AC_HELP_STRING([--with-ssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) |
0abccc67 | 1136 | AC_HELP_STRING([--without-ssl], [disable OpenSSL]), |
e890113f | 1137 | OPT_SSL=$withval) |
ae1912cb | 1138 | |
bebd5dbc | 1139 | if test X"$OPT_SSL" != Xno; then |
6bd02a3a | 1140 | dnl backup the pre-ssl variables |
4ac7a087 DS |
1141 | CLEANLDFLAGS="$LDFLAGS" |
1142 | CLEANCPPFLAGS="$CPPFLAGS" | |
6bd02a3a DS |
1143 | CLEANLIBS="$LIBS" |
1144 | ||
4836154c DS |
1145 | case "$OPT_SSL" in |
1146 | yes) | |
75e5967a | 1147 | dnl --with-ssl (without path) used |
736a40fe DS |
1148 | if test x$cross_compiling != xyes; then |
1149 | dnl only do pkg-config magic when not cross-compiling | |
1150 | PKGTEST="yes" | |
1151 | fi | |
4370e92d DS |
1152 | PREFIX_OPENSSL=/usr/local/ssl |
1153 | LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" | |
1154 | ;; | |
4398151f | 1155 | off) |
75e5967a | 1156 | dnl no --with-ssl option given, just check default places |
736a40fe DS |
1157 | if test x$cross_compiling != xyes; then |
1158 | dnl only do pkg-config magic when not cross-compiling | |
1159 | PKGTEST="yes" | |
1160 | fi | |
4370e92d DS |
1161 | PREFIX_OPENSSL= |
1162 | ;; | |
4836154c | 1163 | *) |
75e5967a DS |
1164 | dnl check the given --with-ssl spot |
1165 | PKGTEST="no" | |
4370e92d DS |
1166 | PREFIX_OPENSSL=$OPT_SSL |
1167 | LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" | |
b98e0aa0 | 1168 | if test "$PREFIX_OPENSSL" != "/usr" ; then |
4b441eba DF |
1169 | LDFLAGS="$LDFLAGS -L$LIB_OPENSSL" |
1170 | CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include" | |
1171 | fi | |
1172 | CPPFLAGS="$CPPFLAGS -I$PREFIX_OPENSSL/include/openssl" | |
4ac7a087 | 1173 | ;; |
4836154c DS |
1174 | esac |
1175 | ||
75e5967a DS |
1176 | if test "$PKGTEST" = "yes"; then |
1177 | ||
b9fdc0c2 | 1178 | CURL_CHECK_PKGCONFIG(openssl) |
75e5967a | 1179 | |
75e5967a | 1180 | if test "$PKGCONFIG" != "no" ; then |
b9fdc0c2 DS |
1181 | SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null` |
1182 | SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null` | |
1183 | SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null` | |
75e5967a | 1184 | |
b9fdc0c2 | 1185 | LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` |
75e5967a | 1186 | |
b9fdc0c2 DS |
1187 | dnl use the values pkg-config reported |
1188 | LIBS="$LIBS $SSL_LIBS" | |
1189 | CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" | |
1190 | LDFLAGS="$LDFLAGS $SSL_LDFLAGS" | |
75e5967a DS |
1191 | fi |
1192 | fi | |
1193 | ||
6abbbaad YT |
1194 | dnl This is for Msys/Mingw |
1195 | case $host in | |
1196 | *-*-msys* | *-*-mingw*) | |
1197 | AC_MSG_CHECKING([for gdi32]) | |
1198 | my_ac_save_LIBS=$LIBS | |
1199 | LIBS="-lgdi32 $LIBS" | |
1200 | AC_TRY_LINK([#include <windef.h> | |
1201 | #include <wingdi.h>], | |
1202 | [GdiFlush();], | |
1203 | [ dnl worked! | |
1204 | AC_MSG_RESULT([yes])], | |
1205 | [ dnl failed, restore LIBS | |
1206 | LIBS=$my_ac_save_LIBS | |
1207 | AC_MSG_RESULT(no)] | |
1208 | ) | |
1209 | ;; | |
1210 | esac | |
1211 | ||
4836154c DS |
1212 | AC_CHECK_LIB(crypto, CRYPTO_lock,[ |
1213 | HAVECRYPTO="yes" | |
c4f7570a | 1214 | LIBS="-lcrypto $LIBS" |
4836154c | 1215 | ],[ |
4370e92d DS |
1216 | LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" |
1217 | CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include" | |
4836154c | 1218 | AC_CHECK_LIB(crypto, CRYPTO_add_lock,[ |
c4f7570a DF |
1219 | HAVECRYPTO="yes" |
1220 | LIBS="-lcrypto $LIBS"], [ | |
6bd02a3a DS |
1221 | LDFLAGS="$CLEANLDFLAGS" |
1222 | CPPFLAGS="$CLEANCPPFLAGS" | |
1223 | LIBS="$CLEANLIBS" | |
4836154c DS |
1224 | ]) |
1225 | ]) | |
ae1912cb | 1226 | |
ae1912cb | 1227 | |
21337f47 | 1228 | if test X"$HAVECRYPTO" = X"yes"; then |
ae1912cb DS |
1229 | dnl This is only reasonable to do if crypto actually is there: check for |
1230 | dnl SSL libs NOTE: it is important to do this AFTER the crypto lib | |
4836154c | 1231 | |
ae1912cb DS |
1232 | AC_CHECK_LIB(ssl, SSL_connect) |
1233 | ||
b32bf427 DS |
1234 | if test "$ac_cv_lib_ssl_SSL_connect" != yes; then |
1235 | dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff | |
1236 | AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use); | |
1237 | OLIBS=$LIBS | |
1238 | LIBS="$LIBS -lRSAglue -lrsaref" | |
1239 | AC_CHECK_LIB(ssl, SSL_connect) | |
1240 | if test "$ac_cv_lib_ssl_SSL_connect" != yes; then | |
1241 | dnl still no SSL_connect | |
1242 | AC_MSG_RESULT(no) | |
1243 | LIBS=$OLIBS | |
1244 | else | |
1245 | AC_MSG_RESULT(yes) | |
1246 | fi | |
b32bf427 | 1247 | |
df3ca591 | 1248 | else |
b32bf427 | 1249 | |
df3ca591 DS |
1250 | dnl Have the libraries--check for SSLeay/OpenSSL headers |
1251 | AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ | |
1252 | openssl/pem.h openssl/ssl.h openssl/err.h, | |
bebd5dbc | 1253 | curl_ssl_msg="enabled (OpenSSL)" |
df3ca591 DS |
1254 | OPENSSL_ENABLED=1 |
1255 | AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])) | |
1256 | ||
1257 | if test $ac_cv_header_openssl_x509_h = no; then | |
d99c20f6 DS |
1258 | dnl we don't use the "action" part of the AC_CHECK_HEADERS macro |
1259 | dnl since 'err.h' might in fact find a krb4 header with the same | |
1260 | dnl name | |
1261 | AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h) | |
1262 | ||
e16c1b8e | 1263 | if test $ac_cv_header_x509_h = yes && |
d99c20f6 DS |
1264 | test $ac_cv_header_crypto_h = yes && |
1265 | test $ac_cv_header_ssl_h = yes; then | |
1266 | dnl three matches | |
bebd5dbc | 1267 | curl_ssl_msg="enabled (OpenSSL)" |
d99c20f6 DS |
1268 | OPENSSL_ENABLED=1 |
1269 | fi | |
df3ca591 DS |
1270 | fi |
1271 | fi | |
1272 | ||
f966dad3 DS |
1273 | if test X"$OPENSSL_ENABLED" = X"1"; then |
1274 | AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled]) | |
090a7f38 DS |
1275 | |
1276 | dnl is there a pkcs12.h header present? | |
1277 | AC_CHECK_HEADERS(openssl/pkcs12.h) | |
c4f7570a DF |
1278 | else |
1279 | LIBS="$CLEANLIBS" | |
f966dad3 | 1280 | fi |
c4f7570a DF |
1281 | dnl USE_SSLEAY is the historical name for what configure calls |
1282 | dnl OPENSSL_ENABLED; the names should really be unified | |
df3ca591 | 1283 | USE_SSLEAY="$OPENSSL_ENABLED" |
df3ca591 | 1284 | AC_SUBST(USE_SSLEAY) |
df3ca591 DS |
1285 | |
1286 | if test X"$OPT_SSL" != Xoff && | |
1287 | test "$OPENSSL_ENABLED" != "1"; then | |
1288 | AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!]) | |
1ee7f92c | 1289 | fi |
df3ca591 DS |
1290 | fi |
1291 | ||
df3ca591 | 1292 | if test X"$OPENSSL_ENABLED" = X"1"; then |
e157aabd | 1293 | dnl If the ENGINE library seems to be around, check for the OpenSSL engine |
f169b750 DS |
1294 | dnl stuff, it is kind of "separated" from the main SSL check |
1295 | AC_CHECK_FUNC(ENGINE_init, | |
1296 | [ | |
1297 | AC_CHECK_HEADERS(openssl/engine.h) | |
1298 | AC_CHECK_FUNCS( ENGINE_load_builtin_engines ) | |
1299 | ]) | |
af6c3947 | 1300 | |
2c2baa93 | 1301 | dnl these can only exist if openssl exists |
d052e545 | 1302 | dnl yassl doesn't have SSL_get_shutdown |
2c2baa93 DS |
1303 | |
1304 | AC_CHECK_FUNCS( RAND_status \ | |
1305 | RAND_screen \ | |
e16bc916 | 1306 | RAND_egd \ |
d052e545 DS |
1307 | CRYPTO_cleanup_all_ex_data \ |
1308 | SSL_get_shutdown ) | |
1309 | ||
1310 | dnl Make an attempt to detect if this is actually yassl's headers and | |
1311 | dnl OpenSSL emulation layer. We still leave everything else believing | |
1312 | dnl and acting like OpenSSL. | |
2c2baa93 | 1313 | |
248f0571 | 1314 | AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode]) |
8ad1928d YT |
1315 | AC_COMPILE_IFELSE([ |
1316 | AC_LANG_PROGRAM([[ | |
d052e545 | 1317 | #include <openssl/ssl.h> |
8ad1928d | 1318 | ]],[[ |
248f0571 YT |
1319 | #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER) |
1320 | int dummy = SSL_ERROR_NONE; | |
1321 | #else | |
1322 | Not the yaSSL OpenSSL compatibility header. | |
1323 | #endif | |
8ad1928d YT |
1324 | ]]) |
1325 | ],[ | |
1326 | AC_MSG_RESULT([yes]) | |
1327 | AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1, | |
1328 | [Define to 1 if using yaSSL in OpenSSL compatibility mode.]) | |
1329 | curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)" | |
1330 | ],[ | |
1331 | AC_MSG_RESULT([no]) | |
248f0571 | 1332 | ]) |
ae1912cb | 1333 | fi |
00505c92 | 1334 | |
df3ca591 | 1335 | if test "$OPENSSL_ENABLED" = "1"; then |
8882d1fa DS |
1336 | if test -n "$LIB_OPENSSL"; then |
1337 | dnl when the ssl shared libs were found in a path that the run-time | |
1338 | dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH | |
1339 | dnl to prevent further configure tests to fail due to this | |
1340 | ||
1341 | LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" | |
1342 | export LD_LIBRARY_PATH | |
1343 | AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH]) | |
1344 | fi | |
1ee7f92c DS |
1345 | fi |
1346 | ||
ae1912cb DS |
1347 | fi |
1348 | ||
c518c52a DS |
1349 | dnl ********************************************************************** |
1350 | dnl Check for the presence of ZLIB libraries and headers | |
1351 | dnl ********************************************************************** | |
1352 | ||
1353 | dnl Check for & handle argument to --with-zlib. | |
1354 | ||
1355 | _cppflags=$CPPFLAGS | |
1356 | _ldflags=$LDFLAGS | |
1357 | AC_ARG_WITH(zlib, | |
1358 | AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) | |
1359 | AC_HELP_STRING([--without-zlib],[disable use of zlib]), | |
1360 | [OPT_ZLIB="$withval"]) | |
1361 | ||
1362 | if test "$OPT_ZLIB" = "no" ; then | |
1363 | AC_MSG_WARN([zlib disabled]) | |
1364 | else | |
1365 | if test "$OPT_ZLIB" = "yes" ; then | |
1366 | OPT_ZLIB="" | |
1367 | fi | |
1368 | ||
1369 | if test -z "$OPT_ZLIB" ; then | |
1370 | dnl check for the lib first without setting any new path, since many | |
1371 | dnl people have it in the default path | |
1372 | ||
1373 | AC_CHECK_LIB(z, inflateEnd, | |
1374 | dnl libz found, set the variable | |
1375 | [HAVE_LIBZ="1"], | |
1376 | dnl if no lib found, try /usr/local | |
1377 | [OPT_ZLIB="/usr/local"]) | |
1378 | ||
1379 | fi | |
1380 | ||
1381 | dnl Add a nonempty path to the compiler flags | |
1382 | if test -n "$OPT_ZLIB"; then | |
1383 | CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" | |
1384 | LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" | |
1385 | fi | |
1386 | ||
1387 | AC_CHECK_HEADER(zlib.h, | |
1388 | [ | |
1389 | dnl zlib.h was found | |
1390 | HAVE_ZLIB_H="1" | |
1391 | dnl if the lib wasn't found already, try again with the new paths | |
1392 | if test "$HAVE_LIBZ" != "1"; then | |
1393 | AC_CHECK_LIB(z, gzread, | |
1394 | [ | |
1395 | dnl the lib was found! | |
1396 | HAVE_LIBZ="1" | |
1397 | ], | |
1398 | [ CPPFLAGS=$_cppflags | |
1399 | LDFLAGS=$_ldflags]) | |
1400 | fi | |
1401 | ], | |
1402 | [ | |
1403 | dnl zlib.h was not found, restore the flags | |
1404 | CPPFLAGS=$_cppflags | |
1405 | LDFLAGS=$_ldflags] | |
1406 | ) | |
1407 | ||
1408 | if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1" | |
1409 | then | |
1410 | AC_MSG_WARN([configure found only the libz lib, not the header file!]) | |
48dd0c56 | 1411 | HAVE_LIBZ="" |
c518c52a DS |
1412 | elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" |
1413 | then | |
1414 | AC_MSG_WARN([configure found only the libz header file, not the lib!]) | |
1415 | elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1" | |
1416 | then | |
1417 | dnl both header and lib were found! | |
1418 | AC_SUBST(HAVE_LIBZ) | |
1419 | AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file]) | |
1420 | AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available]) | |
1421 | ||
1422 | CURL_LIBS="$CURL_LIBS -lz" | |
1423 | LIBS="$LIBS -lz" | |
1424 | ||
1425 | dnl replace 'HAVE_LIBZ' in the automake makefile.ams | |
1426 | AMFIXLIB="1" | |
1427 | AC_MSG_NOTICE([found both libz and libz.h header]) | |
1428 | curl_zlib_msg="enabled" | |
1429 | fi | |
1430 | fi | |
1431 | ||
1432 | dnl set variable for use in automakefile(s) | |
1433 | AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1) | |
1434 | ||
df3ca591 | 1435 | dnl ********************************************************************** |
e16c1b8e | 1436 | dnl Check for the random seed preferences |
df3ca591 DS |
1437 | dnl ********************************************************************** |
1438 | ||
1439 | if test X"$OPENSSL_ENABLED" = X"1"; then | |
1440 | AC_ARG_WITH(egd-socket, | |
1441 | AC_HELP_STRING([--with-egd-socket=FILE], | |
1442 | [Entropy Gathering Daemon socket pathname]), | |
1443 | [ EGD_SOCKET="$withval" ] | |
1444 | ) | |
1445 | if test -n "$EGD_SOCKET" ; then | |
1446 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET", | |
1447 | [your Entropy Gathering Daemon socket pathname] ) | |
1448 | fi | |
1449 | ||
1450 | dnl Check for user-specified random device | |
1451 | AC_ARG_WITH(random, | |
1452 | AC_HELP_STRING([--with-random=FILE], | |
1453 | [read randomness from FILE (default=/dev/urandom)]), | |
1454 | [ RANDOM_FILE="$withval" ], | |
1455 | [ | |
1456 | dnl Check for random device | |
1457 | AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) | |
1458 | ] | |
1459 | ) | |
1460 | if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then | |
1461 | AC_SUBST(RANDOM_FILE) | |
1462 | AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE", | |
1463 | [a suitable file to read random data from]) | |
1464 | fi | |
1465 | fi | |
1466 | ||
bebd5dbc | 1467 | dnl ---------------------------------------------------- |
b9fdc0c2 | 1468 | dnl check for GnuTLS |
bebd5dbc DS |
1469 | dnl ---------------------------------------------------- |
1470 | ||
1471 | dnl Default to compiler & linker defaults for GnuTLS files & libraries. | |
e49a7e36 | 1472 | OPT_GNUTLS=no |
bebd5dbc DS |
1473 | |
1474 | AC_ARG_WITH(gnutls,dnl | |
1475 | AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)]) | |
1476 | AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]), | |
1477 | OPT_GNUTLS=$withval) | |
1478 | ||
1479 | if test "$OPENSSL_ENABLED" != "1"; then | |
1480 | ||
e49a7e36 | 1481 | if test X"$OPT_GNUTLS" != Xno; then |
b9fdc0c2 | 1482 | |
b9fdc0c2 | 1483 | addld="" |
bebd5dbc | 1484 | if test "x$OPT_GNUTLS" = "xyes"; then |
966cc10f | 1485 | dnl this is with no partiular path given |
b9fdc0c2 DS |
1486 | CURL_CHECK_PKGCONFIG(gnutls) |
1487 | ||
1488 | if test "$PKGCONFIG" != "no" ; then | |
1489 | addlib=`$PKGCONFIG --libs-only-l gnutls` | |
1490 | addld=`$PKGCONFIG --libs-only-L gnutls` | |
1491 | addcflags=`$PKGCONFIG --cflags-only-I gnutls` | |
1492 | version=`$PKGCONFIG --modversion gnutls` | |
1493 | gtlslib=`echo $addld | $SED -e 's/-L//'` | |
966cc10f DS |
1494 | else |
1495 | dnl without pkg-config, we try libgnutls-config as that was how it | |
1496 | dnl used to be done | |
1497 | check=`libgnutls-config --version 2>/dev/null` | |
1498 | if test -n "$check"; then | |
1499 | addlib=`libgnutls-config --libs` | |
1500 | addcflags=`libgnutls-config --cflags` | |
1501 | version=`libgnutls-config --version` | |
1502 | gtlslib=`libgnutls-config --prefix`/lib$libsuff | |
1503 | fi | |
c2fcdf3a | 1504 | fi |
f90551ff | 1505 | else |
966cc10f DS |
1506 | dnl this is with a given path, first check if there's a libgnutls-config |
1507 | dnl there and if not, make an educated guess | |
0cb6f305 DS |
1508 | cfg=$OPT_GNUTLS/bin/libgnutls-config |
1509 | check=`$cfg --version 2>/dev/null` | |
966cc10f | 1510 | if test -n "$check"; then |
0cb6f305 DS |
1511 | addlib=`$cfg --libs` |
1512 | addcflags=`$cfg --cflags` | |
1513 | version=`$cfg --version` | |
1514 | gtlslib=`$cfg --prefix`/lib$libsuff | |
966cc10f DS |
1515 | else |
1516 | dnl without pkg-config and libgnutls-config, we guess a lot! | |
1517 | addlib=-lgnutls | |
1518 | addld=-L$OPT_GNUTLS/lib$libsuff | |
1519 | addcflags=-I$OPT_GNUTLS/include | |
1520 | version="" # we just don't know | |
1521 | gtlslib=$OPT_GNUTLS/lib$libsuff | |
1522 | fi | |
b9fdc0c2 DS |
1523 | fi |
1524 | ||
1525 | if test -z "$version"; then | |
1526 | dnl lots of efforts, still no go | |
1527 | version="unknown" | |
bebd5dbc | 1528 | fi |
b9fdc0c2 | 1529 | |
313f1a1e | 1530 | if test -n "$addlib"; then |
bebd5dbc | 1531 | |
b0bc2f00 | 1532 | CLEANLIBS="$LIBS" |
313f1a1e | 1533 | CLEANCPPFLAGS="$CPPFLAGS" |
b9fdc0c2 | 1534 | CLEADLDFLAGS="$LDFLAGS" |
e16c1b8e | 1535 | |
b0bc2f00 | 1536 | LIBS="$LIBS $addlib" |
b9fdc0c2 | 1537 | LDFLAGS="$LDFLAGS $addld" |
313f1a1e DS |
1538 | if test "$addcflags" != "-I/usr/include"; then |
1539 | CPPFLAGS="$CPPFLAGS $addcflags" | |
1540 | fi | |
e16c1b8e | 1541 | |
313f1a1e | 1542 | AC_CHECK_LIB(gnutls, gnutls_check_version, |
bebd5dbc DS |
1543 | [ |
1544 | AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) | |
1545 | AC_SUBST(USE_GNUTLS, [1]) | |
02267eba | 1546 | GNUTLS_ENABLED=1 |
bebd5dbc | 1547 | USE_GNUTLS="yes" |
313f1a1e | 1548 | curl_ssl_msg="enabled (GnuTLS)" |
bebd5dbc DS |
1549 | ], |
1550 | [ | |
b0bc2f00 | 1551 | LIBS="$CLEANLIBS" |
bebd5dbc DS |
1552 | CPPFLAGS="$CLEANCPPFLAGS" |
1553 | ]) | |
e16c1b8e | 1554 | |
313f1a1e DS |
1555 | if test "x$USE_GNUTLS" = "xyes"; then |
1556 | AC_MSG_NOTICE([detected GnuTLS version $version]) | |
241b2b4a | 1557 | |
b9fdc0c2 DS |
1558 | if test -n "$gtlslib"; then |
1559 | dnl when shared libs were found in a path that the run-time | |
1560 | dnl linker doesn't search through, we need to add it to | |
1561 | dnl LD_LIBRARY_PATH to prevent further configure tests to fail | |
1562 | dnl due to this | |
313f1a1e | 1563 | |
b9fdc0c2 DS |
1564 | LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" |
1565 | export LD_LIBRARY_PATH | |
1566 | AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH]) | |
1567 | fi | |
313f1a1e | 1568 | fi |
241b2b4a | 1569 | |
bebd5dbc | 1570 | fi |
313f1a1e | 1571 | |
bebd5dbc DS |
1572 | fi dnl GNUTLS not disabled |
1573 | ||
bebd5dbc | 1574 | fi dnl OPENSSL != 1 |
779ca097 | 1575 | |
7f70dbca DS |
1576 | dnl ---------------------------------------------------- |
1577 | dnl NSS. Only check if GnuTLS and OpenSSL are not enabled | |
1578 | dnl ---------------------------------------------------- | |
1579 | ||
1580 | dnl Default to compiler & linker defaults for NSS files & libraries. | |
1581 | OPT_NSS=no | |
1582 | ||
1583 | AC_ARG_WITH(nss,dnl | |
1584 | AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root (default: /usr/local/)]) | |
1585 | AC_HELP_STRING([--without-nss], [disable NSS detection]), | |
1586 | OPT_NSS=$withval) | |
1587 | ||
1588 | if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then | |
1589 | ||
1590 | if test X"$OPT_NSS" != Xno; then | |
1591 | if test "x$OPT_NSS" = "xyes"; then | |
b9fdc0c2 DS |
1592 | |
1593 | CURL_CHECK_PKGCONFIG(nss) | |
1594 | ||
1595 | if test "$PKGCONFIG" != "no" ; then | |
1596 | addlib=`$PKGCONFIG --libs nss` | |
1597 | addcflags=`$PKGCONFIG --cflags nss` | |
1598 | version=`$PKGCONFIG --modversion nss` | |
1599 | nssprefix=`$PKGCONFIG --variable=prefix nss` | |
ceda7e98 DS |
1600 | else |
1601 | dnl Without pkg-config, we check for nss-config | |
1602 | ||
1603 | check=`nss-config --version 2>/dev/null` | |
1604 | if test -n "$check"; then | |
1605 | addlib=`nss-config --libs` | |
1606 | addcflags=`nss-config --cflags` | |
1607 | version=`nss-config --version` | |
1608 | nssprefix=`nss-config --prefix` | |
1609 | else | |
1610 | addlib="-lnss3" | |
1611 | addcflags="" | |
1612 | version="unknown" | |
1613 | fi | |
b9fdc0c2 | 1614 | fi |
7f70dbca | 1615 | fi |
8c3f40ee DS |
1616 | |
1617 | dnl Check for functionPK11_CreateGenericObject | |
1618 | dnl this is needed for using the PEM PKCS#11 module | |
20695098 | 1619 | AC_CHECK_LIB(nss3, PK11_CreateGenericObject, |
8c3f40ee DS |
1620 | [ |
1621 | AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject]) | |
1622 | AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1]) | |
1623 | ]) | |
7f70dbca DS |
1624 | if test -n "$addlib"; then |
1625 | ||
1626 | CLEANLIBS="$LIBS" | |
1627 | CLEANCPPFLAGS="$CPPFLAGS" | |
e16c1b8e | 1628 | |
7f70dbca DS |
1629 | LIBS="$LIBS $addlib" |
1630 | if test "$addcflags" != "-I/usr/include"; then | |
1631 | CPPFLAGS="$CPPFLAGS $addcflags" | |
1632 | fi | |
e16c1b8e | 1633 | |
7f70dbca DS |
1634 | AC_CHECK_LIB(nss3, NSS_Initialize, |
1635 | [ | |
1636 | AC_DEFINE(USE_NSS, 1, [if NSS is enabled]) | |
1637 | AC_SUBST(USE_NSS, [1]) | |
1638 | USE_NSS="yes" | |
1639 | NSS_ENABLED=1 | |
1640 | curl_ssl_msg="enabled (NSS)" | |
1641 | ], | |
1642 | [ | |
1643 | LIBS="$CLEANLIBS" | |
1644 | CPPFLAGS="$CLEANCPPFLAGS" | |
1645 | ]) | |
e16c1b8e | 1646 | |
7f70dbca DS |
1647 | if test "x$USE_NSS" = "xyes"; then |
1648 | AC_MSG_NOTICE([detected NSS version $version]) | |
1649 | ||
1650 | dnl when shared libs were found in a path that the run-time | |
1651 | dnl linker doesn't search through, we need to add it to | |
1652 | dnl LD_LIBRARY_PATH to prevent further configure tests to fail | |
1653 | dnl due to this | |
1654 | ||
1655 | LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" | |
1656 | export LD_LIBRARY_PATH | |
1657 | AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH]) | |
1658 | fi | |
1659 | ||
1660 | fi | |
1661 | ||
1662 | fi dnl NSS not disabled | |
1663 | ||
1664 | fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1 | |
1665 | ||
1666 | if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then | |
1667 | AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.]) | |
1668 | AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.]) | |
57d2fb41 DS |
1669 | else |
1670 | # SSL is enabled, genericly | |
1671 | AC_SUBST(SSL_ENABLED) | |
1672 | SSL_ENABLED="1" | |
7f70dbca DS |
1673 | fi |
1674 | ||
779ca097 DS |
1675 | dnl ********************************************************************** |
1676 | dnl Check for the CA bundle | |
1677 | dnl ********************************************************************** | |
1678 | ||
fb23b857 | 1679 | CURL_CHECK_CA_BUNDLE |
779ca097 | 1680 | |
62ed5530 DF |
1681 | dnl ********************************************************************** |
1682 | dnl Check for the presence of LIBSSH2 libraries and headers | |
1683 | dnl ********************************************************************** | |
1684 | ||
1685 | dnl Default to compiler & linker defaults for LIBSSH2 files & libraries. | |
1686 | OPT_LIBSSH2=off | |
1687 | AC_ARG_WITH(libssh2,dnl | |
1688 | AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation (default: /usr/local/lib); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) | |
1689 | AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]), | |
1690 | OPT_LIBSSH2=$withval) | |
1691 | ||
1692 | if test X"$OPT_LIBSSH2" != Xno; then | |
1693 | dnl backup the pre-libssh2 variables | |
1694 | CLEANLDFLAGS="$LDFLAGS" | |
1695 | CLEANCPPFLAGS="$CPPFLAGS" | |
1696 | CLEANLIBS="$LIBS" | |
1697 | ||
1698 | case "$OPT_LIBSSH2" in | |
1699 | yes) | |
1700 | dnl --with-libssh2 (without path) used | |
1951cd1e DS |
1701 | CURL_CHECK_PKGCONFIG(libssh2) |
1702 | ||
1703 | if test "$PKGCONFIG" != "no" ; then | |
1704 | LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` | |
1705 | LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` | |
1706 | CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` | |
1707 | version=`$PKGCONFIG --modversion libssh2` | |
1708 | DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'` | |
1709 | fi | |
1710 | ||
62ed5530 DF |
1711 | ;; |
1712 | off) | |
1713 | dnl no --with-libssh2 option given, just check default places | |
62ed5530 DF |
1714 | ;; |
1715 | *) | |
1716 | dnl use the given --with-libssh2 spot | |
1951cd1e | 1717 | PREFIX_SSH2=$OPT_LIBSSH2 |
62ed5530 DF |
1718 | ;; |
1719 | esac | |
1720 | ||
1951cd1e DS |
1721 | dnl if given with a prefix, we set -L and -I based on that |
1722 | if test -n "$PREFIX_SSH2"; then | |
1723 | LD_SSH2=-L${PREFIX_SSH2}/lib | |
1724 | CPP_SSH2=-I${PREFIX_SSH2}/include | |
1725 | DIR_SSH2=${PREFIX_SSH2}/lib | |
1726 | fi | |
1727 | ||
1728 | LDFLAGS="$LDFLAGS $LD_SSH2" | |
1729 | CPPFLAGS="$CPPFLAGS $CPP_SSH2" | |
1730 | LIBS="$LIBS $LIB_SSH2" | |
1731 | ||
62ed5530 DF |
1732 | AC_CHECK_LIB(ssh2, libssh2_channel_open_ex) |
1733 | ||
1734 | AC_CHECK_HEADERS(libssh2.h, | |
1735 | curl_ssh_msg="enabled (libSSH2)" | |
1736 | LIBSSH2_ENABLED=1 | |
1737 | AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use]) | |
1738 | AC_SUBST(USE_LIBSSH2, [1]) | |
1739 | ) | |
1740 | ||
1741 | if test X"$OPT_LIBSSH2" != Xoff && | |
1742 | test "$LIBSSH2_ENABLED" != "1"; then | |
1743 | AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!]) | |
1744 | fi | |
1745 | ||
1746 | if test "$LIBSSH2_ENABLED" = "1"; then | |
1747 | if test -n "$LIB_LIBSSH2"; then | |
1748 | dnl when the libssh2 shared libs were found in a path that the run-time | |
1749 | dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH | |
1750 | dnl to prevent further configure tests to fail due to this | |
1751 | ||
1752 | dnl libssh2_version is a post 1.0 addition | |
1753 | AC_CHECK_FUNCS( libssh2_version ) | |
1754 | ||
1951cd1e | 1755 | LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" |
62ed5530 | 1756 | export LD_LIBRARY_PATH |
1951cd1e | 1757 | AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH]) |
62ed5530 DF |
1758 | fi |
1759 | else | |
1760 | dnl no libssh2, revert back to clean variables | |
1761 | LDFLAGS=$CLEANLDFLAGS | |
1762 | CPPFLAGS=$CLEANCPPFLAGS | |
1763 | LIBS=$CLEANLIBS | |
1764 | fi | |
1765 | fi | |
1766 | ||
c461254d DF |
1767 | dnl ********************************************************************** |
1768 | dnl Check for the presence of IDN libraries and headers | |
1769 | dnl ********************************************************************** | |
1770 | ||
cff90cf3 | 1771 | AC_MSG_CHECKING([whether to build with libidn]) |
96002646 | 1772 | AC_ARG_WITH(libidn, |
cff90cf3 DS |
1773 | AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage]) |
1774 | AC_HELP_STRING([--without-libidn],[Disable libidn usage]), | |
96002646 | 1775 | [LIBIDN="$withval"]) |
cff90cf3 DS |
1776 | |
1777 | case "$LIBIDN" in | |
1778 | no) | |
1779 | AC_MSG_RESULT(no) | |
1780 | ;; | |
1781 | *) AC_MSG_RESULT(yes) | |
19a568a9 DS |
1782 | |
1783 | idn="" | |
1784 | dnl if there is a given path, check that FIRST | |
7bb6d76d DS |
1785 | if test -n "$LIBIDN"; then |
1786 | if test "x$LIBIDN" != "xyes"; then | |
7bb6d76d DS |
1787 | oldLDFLAGS=$LDFLAGS |
1788 | oldCPPFLAGS=$CPPFLAGS | |
1789 | LDFLAGS="$LDFLAGS -L$LIBIDN/lib" | |
1790 | CPPFLAGS="$CPPFLAGS -I$LIBIDN/include" | |
1791 | idn="yes" | |
1792 | AC_CHECK_LIB(idn, idna_to_ascii_4i, , | |
1793 | idn="" | |
1794 | LDFLAGS=$oldLDFLAGS | |
1795 | CPPFLAGS=$oldCPPFLAGS) | |
1796 | fi | |
19a568a9 DS |
1797 | fi |
1798 | ||
1799 | if test "x$idn" != "xyes"; then | |
1800 | dnl check with default paths | |
8c16696f | 1801 | idn="yes" |
19a568a9 DS |
1802 | AC_CHECK_LIB(idn, idna_to_ascii_lz, , |
1803 | idn="") | |
1804 | fi | |
1805 | ||
1806 | if test "x$idn" = "xyes"; then | |
cff90cf3 | 1807 | curl_idn_msg="enabled" |
d6460aff | 1808 | AC_SUBST(IDN_ENABLED, [1]) |
4e7575fc | 1809 | dnl different versions of libidn have different setups of these: |
1239e483 | 1810 | AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror) |
c6881660 | 1811 | AC_CHECK_HEADERS( idn-free.h tld.h ) |
cff90cf3 | 1812 | fi |
e16c1b8e GK |
1813 | |
1814 | ;; | |
cff90cf3 DS |
1815 | esac |
1816 | ||
b174aeaa DS |
1817 | dnl Default is to try the thread-safe versions of a few functions |
1818 | OPT_THREAD=on | |
243942a7 DS |
1819 | |
1820 | dnl detect AIX 4.3 or later | |
1821 | dnl see full docs on this reasoning in the lib/hostip.c source file | |
1822 | AC_MSG_CHECKING([AIX 4.3 or later]) | |
1823 | AC_PREPROC_IFELSE([ | |
1824 | #if defined(_AIX) && defined(_AIX43) | |
1825 | printf("just fine"); | |
1826 | #else | |
1827 | #error "this is not AIX 4.3 or later" | |
1828 | #endif | |
1829 | ], | |
1830 | [ AC_MSG_RESULT([yes]) | |
abd65e21 | 1831 | RECENTAIX=yes |
243942a7 DS |
1832 | OPT_THREAD=off ], |
1833 | [ AC_MSG_RESULT([no]) ] | |
1834 | ) | |
1835 | ||
b174aeaa | 1836 | AC_ARG_ENABLE(thread,dnl |
a53d7848 DS |
1837 | AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions]) |
1838 | AC_HELP_STRING([--enable-thread],[look for thread-safe functions]), | |
1839 | [ case "$enableval" in | |
1840 | no) | |
1841 | OPT_THREAD=off | |
1842 | AC_MSG_WARN(libcurl will not get built using thread-safe functions) | |
1843 | ;; | |
1844 | *) | |
1845 | ;; | |
1846 | esac | |
1847 | ] | |
b174aeaa DS |
1848 | ) |
1849 | ||
1850 | if test X"$OPT_THREAD" = Xoff | |
1851 | then | |
fd0d560b YT |
1852 | AC_DEFINE(DISABLED_THREADSAFE, 1, |
1853 | [Set to explicitly specify we don't want to use thread-safe functions]) | |
b174aeaa | 1854 | else |
33b658a3 | 1855 | dnl if test "$ipv6" != "yes"; then |
9f2780a2 | 1856 | dnl dig around for gethostbyname_r() |
d84440d5 | 1857 | dnl the old gethostbyname_r check was done here |
b174aeaa | 1858 | |
9f2780a2 | 1859 | dnl dig around for gethostbyaddr_r() |
d84440d5 | 1860 | dnl the old gethostbyaddr_r check was here BUT COMMENTED OUT |
33b658a3 | 1861 | dnl fi |
d4731b70 | 1862 | |
61fb8fea | 1863 | dnl poke around for inet_ntoa_r() |
4e909ee8 | 1864 | dnl the old inet_ntoa_r check was done here |
d4731b70 | 1865 | |
61fb8fea | 1866 | dnl is there a localtime_r() |
d7e406e0 | 1867 | dnl the old localtime_r check was done here |
d4731b70 | 1868 | |
242be557 | 1869 | dnl is there a strerror_r() |
b93ad10f | 1870 | dnl the old strerror_r check was done here |
242be557 | 1871 | |
f425a25c | 1872 | checkfor_gmtime_r="yes" |
b174aeaa DS |
1873 | fi |
1874 | ||
abd65e21 | 1875 | dnl for recent AIX versions, we skip all the thread-safe checks above since |
0eace2fe DS |
1876 | dnl they claim a thread-safe libc using the standard API. But there are |
1877 | dnl some functions still not thread-safe. Check for these! | |
1878 | ||
1879 | dnl Let's hope this split URL remains working: | |
1880 | dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \ | |
1881 | dnl genprogc/thread_quick_ref.htm | |
abd65e21 DS |
1882 | |
1883 | if test "x$RECENTAIX" = "xyes"; then | |
db302a10 DS |
1884 | |
1885 | AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code]) | |
62af3fb7 | 1886 | |
62ff567c | 1887 | dnl is there a localtime_r() |
d7e406e0 | 1888 | dnl the old localtime_r check was done here |
62ff567c DS |
1889 | |
1890 | dnl is there a strerror_r() | |
b93ad10f | 1891 | dnl the old strerror_r check was done here |
62ff567c | 1892 | |
f425a25c | 1893 | checkfor_gmtime_r="yes" |
abd65e21 DS |
1894 | fi |
1895 | ||
1896 | ||
ae1912cb DS |
1897 | dnl ********************************************************************** |
1898 | dnl Back to "normal" configuring | |
1899 | dnl ********************************************************************** | |
1900 | ||
1901 | dnl Checks for header files. | |
1902 | AC_HEADER_STDC | |
075c5342 | 1903 | |
4d95d23d | 1904 | CURL_CHECK_HEADER_MALLOC |
9770899a | 1905 | CURL_CHECK_HEADER_MEMORY |
a6a5bba0 YT |
1906 | |
1907 | dnl Now check for the very most basic headers. Then we can use these | |
075c5342 DS |
1908 | dnl ones as default-headers when checking for the rest! |
1909 | AC_CHECK_HEADERS( | |
1910 | sys/types.h \ | |
1911 | sys/time.h \ | |
1912 | sys/select.h \ | |
1913 | sys/socket.h \ | |
a4351517 | 1914 | sys/ioctl.h \ |
aa41743e | 1915 | sys/uio.h \ |
24ac5b8a | 1916 | assert.h \ |
ae1912cb | 1917 | unistd.h \ |
8898ff9e | 1918 | stdlib.h \ |
3d66d10f | 1919 | limits.h \ |
ae1912cb DS |
1920 | arpa/inet.h \ |
1921 | net/if.h \ | |
1922 | netinet/in.h \ | |
3d29bda9 | 1923 | sys/un.h \ |
43137cf5 | 1924 | netinet/tcp.h \ |
ae1912cb | 1925 | netdb.h \ |
ae1912cb DS |
1926 | sys/sockio.h \ |
1927 | sys/stat.h \ | |
ae1912cb DS |
1928 | sys/param.h \ |
1929 | termios.h \ | |
1930 | termio.h \ | |
1931 | sgtty.h \ | |
1932 | fcntl.h \ | |
ae1912cb | 1933 | alloca.h \ |
ae1912cb DS |
1934 | time.h \ |
1935 | io.h \ | |
5900c0f7 | 1936 | pwd.h \ |
82d3ded9 | 1937 | utime.h \ |
3c49b405 | 1938 | sys/utime.h \ |
99dfdebc | 1939 | sys/poll.h \ |
bdb2beb8 | 1940 | poll.h \ |
37eba370 | 1941 | socket.h \ |
a4e1ac79 | 1942 | sys/resource.h \ |
8e872231 | 1943 | libgen.h \ |
82d6cfa7 | 1944 | locale.h \ |
65dbee01 | 1945 | errno.h \ |
69565afa | 1946 | stdbool.h \ |
528a149d DS |
1947 | arpa/tftp.h \ |
1948 | sys/filio.h \ | |
075c5342 DS |
1949 | setjmp.h, |
1950 | dnl to do if not found | |
1951 | [], | |
1952 | dnl to do if found | |
1953 | [], | |
1954 | dnl default includes | |
1955 | [ | |
1956 | #ifdef HAVE_SYS_TYPES_H | |
1957 | #include <sys/types.h> | |
1958 | #endif | |
1959 | #ifdef HAVE_SYS_TIME_H | |
1960 | #include <sys/time.h> | |
1961 | #endif | |
1962 | #ifdef HAVE_SYS_SELECT_H | |
1963 | #include <sys/select.h> | |
1964 | #endif | |
1965 | #ifdef HAVE_SYS_SOCKET_H | |
1966 | #include <sys/socket.h> | |
1967 | #endif | |
d85c2199 DS |
1968 | #ifdef HAVE_NETINET_IN_H |
1969 | #include <netinet/in.h> | |
1970 | #endif | |
3d29bda9 DS |
1971 | #ifdef HAVE_SYS_UN_H |
1972 | #include <sys/un.h> | |
1973 | #endif | |
075c5342 | 1974 | ] |
ae1912cb DS |
1975 | ) |
1976 | ||
ae1912cb DS |
1977 | dnl Checks for typedefs, structures, and compiler characteristics. |
1978 | AC_C_CONST | |
273b2b23 | 1979 | CURL_CHECK_VARIADIC_MACROS |
ae1912cb DS |
1980 | AC_TYPE_SIZE_T |
1981 | AC_HEADER_TIME | |
32ac4ede | 1982 | CURL_CHECK_STRUCT_TIMEVAL |
67e8d229 | 1983 | CURL_VERIFY_RUNTIMELIBS |
ae1912cb | 1984 | |
78e6508e | 1985 | AC_CHECK_SIZEOF(size_t) |
95cef39d | 1986 | AC_CHECK_SIZEOF(int) |
af677c4e | 1987 | AC_CHECK_SIZEOF(long) |
a06e0779 | 1988 | CURL_CONFIGURE_LONG |
cd73a733 | 1989 | AC_CHECK_SIZEOF(time_t) |
e2c81773 | 1990 | AC_CHECK_SIZEOF(off_t) |
ae1912cb | 1991 | |
3f3d6ebe | 1992 | soname_bump=no |
243cf297 YT |
1993 | if test x"$ac_cv_native_windows" != "xyes" && |
1994 | test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then | |
3f3d6ebe DS |
1995 | AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous]) |
1996 | AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.]) | |
1997 | soname_bump=yes | |
1998 | fi | |
1999 | ||
2000 | ||
a147a079 | 2001 | AC_CHECK_TYPE(long long, |
ceb49d37 YT |
2002 | [AC_DEFINE(HAVE_LONGLONG, 1, |
2003 | [Define to 1 if the compiler supports the 'long long' data type.])] | |
e16c1b8e | 2004 | longlong="yes" |
af677c4e DS |
2005 | ) |
2006 | ||
2007 | if test "xyes" = "x$longlong"; then | |
2008 | AC_MSG_CHECKING([if numberLL works]) | |
2009 | AC_COMPILE_IFELSE([long long val = 1000LL;], | |
2010 | [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])] | |
2011 | AC_MSG_RESULT(yes), | |
2012 | AC_MSG_RESULT(no) | |
2013 | ) | |
2014 | fi | |
2015 | ||
ae1912cb | 2016 | |
61e2a810 | 2017 | # check for ssize_t |
a147a079 DS |
2018 | AC_CHECK_TYPE(ssize_t, , |
2019 | AC_DEFINE(ssize_t, int, [the signed version of size_t])) | |
61e2a810 | 2020 | |
69565afa YT |
2021 | # check for bool type |
2022 | AC_CHECK_TYPE([bool],[ | |
2023 | AC_DEFINE(HAVE_BOOL_T, 1, | |
2024 | [Define to 1 if bool is an available type.]) | |
2025 | ], ,[ | |
2a6a22a3 YT |
2026 | #ifdef HAVE_SYS_TYPES_H |
2027 | #include <sys/types.h> | |
2028 | #endif | |
69565afa YT |
2029 | #ifdef HAVE_STDBOOL_H |
2030 | #include <stdbool.h> | |
2031 | #endif | |
2032 | ]) | |
2033 | ||
8611631f YT |
2034 | CURL_CONFIGURE_CURL_SOCKLEN_T |
2035 | ||
d09b4369 | 2036 | TYPE_IN_ADDR_T |
11693c0f | 2037 | |
a31ddd36 DS |
2038 | TYPE_SOCKADDR_STORAGE |
2039 | ||
73226415 YT |
2040 | TYPE_SIG_ATOMIC_T |
2041 | ||
a46f55b9 YT |
2042 | AC_TYPE_SIGNAL |
2043 | ||
9346e55d | 2044 | CURL_CHECK_FUNC_SELECT |
ad05d0a8 | 2045 | |
01fa02d0 | 2046 | CURL_CHECK_FUNC_RECV |
a9dc9005 | 2047 | CURL_CHECK_FUNC_RECVFROM |
01fa02d0 | 2048 | CURL_CHECK_FUNC_SEND |
77b3bc23 YT |
2049 | CURL_CHECK_MSG_NOSIGNAL |
2050 | ||
4e4f6c1e | 2051 | CURL_CHECK_FUNC_ALARM |
6d4e6cc8 | 2052 | CURL_CHECK_FUNC_BASENAME |
40b2f255 | 2053 | CURL_CHECK_FUNC_CLOSESOCKET |
d6d63147 | 2054 | CURL_CHECK_FUNC_CLOSESOCKET_CAMEL |
1ff4e900 | 2055 | CURL_CHECK_FUNC_CONNECT |
17d2a464 | 2056 | CURL_CHECK_FUNC_FCNTL |
b93ad10f | 2057 | CURL_CHECK_FUNC_FDOPEN |
33319f5d | 2058 | CURL_CHECK_FUNC_FREEADDRINFO |
9717ccb7 | 2059 | CURL_CHECK_FUNC_FREEIFADDRS |
fce9c3a9 | 2060 | CURL_CHECK_FUNC_FTRUNCATE |
0989cd35 | 2061 | CURL_CHECK_FUNC_GETADDRINFO |
9b12f096 | 2062 | CURL_CHECK_FUNC_GETHOSTBYADDR |
d84440d5 | 2063 | CURL_CHECK_FUNC_GETHOSTBYADDR_R |
9b12f096 | 2064 | CURL_CHECK_FUNC_GETHOSTBYNAME |
d84440d5 | 2065 | CURL_CHECK_FUNC_GETHOSTBYNAME_R |
d7e406e0 | 2066 | CURL_CHECK_FUNC_GETHOSTNAME |
9717ccb7 | 2067 | CURL_CHECK_FUNC_GETIFADDRS |
0c1ae21c | 2068 | CURL_CHECK_FUNC_GETSERVBYPORT_R |
ea1362a9 | 2069 | CURL_CHECK_FUNC_GMTIME_R |
006cab3e | 2070 | CURL_CHECK_FUNC_INET_NTOA_R |
267b9423 | 2071 | CURL_CHECK_FUNC_INET_NTOP |
4d437416 | 2072 | CURL_CHECK_FUNC_INET_PTON |
17d2a464 YT |
2073 | CURL_CHECK_FUNC_IOCTL |
2074 | CURL_CHECK_FUNC_IOCTLSOCKET | |
2075 | CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL | |
d7e406e0 | 2076 | CURL_CHECK_FUNC_LOCALTIME_R |
b64dd3c6 | 2077 | CURL_CHECK_FUNC_MEMRCHR |
debe0b56 | 2078 | CURL_CHECK_FUNC_POLL |
17d2a464 | 2079 | CURL_CHECK_FUNC_SETSOCKOPT |
969903eb | 2080 | CURL_CHECK_FUNC_SIGACTION |
83c199bb YT |
2081 | CURL_CHECK_FUNC_SIGINTERRUPT |
2082 | CURL_CHECK_FUNC_SIGNAL | |
2083 | CURL_CHECK_FUNC_SIGSETJMP | |
40b2f255 | 2084 | CURL_CHECK_FUNC_SOCKET |
4c621bc6 YT |
2085 | CURL_CHECK_FUNC_STRCASECMP |
2086 | CURL_CHECK_FUNC_STRCASESTR | |
2087 | CURL_CHECK_FUNC_STRCMPI | |
fce9c3a9 | 2088 | CURL_CHECK_FUNC_STRDUP |
b93ad10f | 2089 | CURL_CHECK_FUNC_STRERROR_R |
4c621bc6 YT |
2090 | CURL_CHECK_FUNC_STRICMP |
2091 | CURL_CHECK_FUNC_STRLCAT | |
2092 | CURL_CHECK_FUNC_STRNCASECMP | |
2093 | CURL_CHECK_FUNC_STRNCMPI | |
2094 | CURL_CHECK_FUNC_STRNICMP | |
d7e406e0 | 2095 | CURL_CHECK_FUNC_STRSTR |
969903eb | 2096 | CURL_CHECK_FUNC_STRTOK_R |
ea1362a9 | 2097 | CURL_CHECK_FUNC_STRTOLL |
aa41743e | 2098 | CURL_CHECK_FUNC_WRITEV |
ea1362a9 | 2099 | |
ae1912cb DS |
2100 | dnl Checks for library functions. |
2101 | dnl AC_PROG_GCC_TRADITIONAL | |
a46f55b9 | 2102 | |
f8e916db | 2103 | dnl AC_FUNC_VPRINTF |
74e5beab DS |
2104 | case $host in |
2105 | *msdosdjgpp) | |
2106 | ac_cv_func_pipe=no | |
2107 | skipcheck_pipe=yes | |
2108 | AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) | |
2109 | ;; | |
2110 | esac | |
357389a9 | 2111 | |
6d4e6cc8 | 2112 | AC_CHECK_FUNCS([fork \ |
357389a9 | 2113 | geteuid \ |
357389a9 YT |
2114 | getpass_r \ |
2115 | getppid \ | |
2116 | getprotobyname \ | |
2117 | getpwuid \ | |
2118 | getrlimit \ | |
2119 | gettimeofday \ | |
2120 | inet_addr \ | |
357389a9 YT |
2121 | perror \ |
2122 | pipe \ | |
357389a9 YT |
2123 | setlocale \ |
2124 | setmode \ | |
2125 | setrlimit \ | |
357389a9 YT |
2126 | uname \ |
2127 | utime | |
2128 | ],[ | |
2129 | ],[ | |
2130 | func="$ac_func" | |
2131 | eval skipcheck=\$skipcheck_$func | |
2132 | if test "x$skipcheck" != "xyes"; then | |
2133 | AC_MSG_CHECKING([deeper for $func]) | |
2134 | AC_LINK_IFELSE([ | |
2135 | AC_LANG_PROGRAM([[ | |
2136 | ]],[[ | |
2137 | $func (); | |
2138 | ]]) | |
2139 | ],[ | |
2140 | AC_MSG_RESULT([yes]) | |
2141 | eval "ac_cv_func_$func=yes" | |
f32dc6b8 | 2142 | AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$func]), [1], |
357389a9 YT |
2143 | [Define to 1 if you have the $func function.]) |
2144 | ],[ | |
2145 | AC_MSG_RESULT([but still no]) | |
2146 | ]) | |
2147 | fi | |
2148 | ]) | |
2149 | ||
e4388643 YT |
2150 | dnl Check if the getnameinfo function is available |
2151 | dnl and get the types of five of its arguments. | |
2152 | CURL_CHECK_FUNC_GETNAMEINFO | |
2e5cccd1 | 2153 | |
bec19771 | 2154 | if test "$ipv6" = "yes"; then |
0989cd35 YT |
2155 | if test "$ac_cv_func_getaddrinfo" = "yes"; then |
2156 | AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) | |
2157 | IPV6_ENABLED=1 | |
2158 | AC_SUBST(IPV6_ENABLED) | |
2159 | fi | |
bec19771 YT |
2160 | CURL_CHECK_NI_WITHSCOPEID |
2161 | fi | |
2162 | ||
17d2a464 YT |
2163 | dnl ************************************************************ |
2164 | dnl enable non-blocking communications | |
2165 | dnl | |
2166 | CURL_CHECK_OPTION_NONBLOCKING | |
2167 | CURL_CHECK_NONBLOCKING_SOCKET | |
2168 | ||
2169 | dnl ************************************************************ | |
2170 | dnl nroff tool stuff | |
2171 | dnl | |
a7b99fc4 | 2172 | |
e16c1b8e | 2173 | AC_PATH_PROG( PERL, perl, , |
7dc36344 DS |
2174 | $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin ) |
2175 | AC_SUBST(PERL) | |
ae1912cb | 2176 | |
e16c1b8e | 2177 | AC_PATH_PROGS( NROFF, gnroff nroff, , |
ae1912cb | 2178 | $PATH:/usr/bin/:/usr/local/bin ) |
96dde76b | 2179 | AC_SUBST(NROFF) |
ae1912cb | 2180 | |
773e7e87 DS |
2181 | if test -n "$NROFF"; then |
2182 | dnl only check for nroff options if an nroff command was found | |
2183 | ||
2184 | AC_MSG_CHECKING([how to use *nroff to get plain text from man pages]) | |
2185 | MANOPT="-man" | |
37685848 DS |
2186 | mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` |
2187 | if test -z "$mancheck"; then | |
773e7e87 DS |
2188 | MANOPT="-mandoc" |
2189 | mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` | |
2190 | if test -z "$mancheck"; then | |
2191 | MANOPT="" | |
2192 | AC_MSG_RESULT([failed]) | |
2193 | AC_MSG_WARN([found no *nroff option to get plaintext from man pages]) | |
2194 | else | |
2195 | AC_MSG_RESULT([$MANOPT]) | |
2196 | fi | |
37685848 DS |
2197 | else |
2198 | AC_MSG_RESULT([$MANOPT]) | |
2199 | fi | |
773e7e87 DS |
2200 | AC_SUBST(MANOPT) |
2201 | fi | |
2202 | ||
2203 | if test -z "$MANOPT" | |
2204 | then | |
2205 | dnl if no nroff tool was found, or no option that could convert man pages | |
2206 | dnl was found, then disable the built-in manual stuff | |
2207 | AC_MSG_WARN([disabling built-in manual]) | |
2208 | USE_MANUAL="no"; | |
37685848 | 2209 | fi |
37685848 | 2210 | |
f3663a9d DS |
2211 | dnl ************************************************************************* |
2212 | dnl If the manual variable still is set, then we go with providing a built-in | |
2213 | dnl manual | |
2214 | ||
2215 | if test "$USE_MANUAL" = "1"; then | |
2216 | AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual]) | |
cff90cf3 | 2217 | curl_manual_msg="enabled" |
f3663a9d DS |
2218 | fi |
2219 | ||
2220 | dnl set variable for use in automakefile(s) | |
2221 | AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) | |
2222 | ||
cd5e6743 | 2223 | aresembedded="unknown" |
8d581f7f YT |
2224 | configure_rundir=`pwd` |
2225 | embedded_ares_builddir="$configure_rundir/ares" | |
4c663ba9 | 2226 | AC_MSG_CHECKING([whether to enable c-ares]) |
673ff5eb | 2227 | AC_ARG_ENABLE(ares, |
4c663ba9 DS |
2228 | AC_HELP_STRING([--enable-ares=PATH],[Enable c-ares for name lookups]) |
2229 | AC_HELP_STRING([--disable-ares],[Disable c-ares for name lookups]), | |
673ff5eb DS |
2230 | [ case "$enableval" in |
2231 | no) | |
2232 | AC_MSG_RESULT(no) | |
2233 | ;; | |
2234 | *) AC_MSG_RESULT(yes) | |
2235 | ||
2236 | if test "x$IPV6_ENABLED" = "x1"; then | |
4c663ba9 | 2237 | AC_MSG_NOTICE([c-ares may not work properly with ipv6]) |
673ff5eb DS |
2238 | fi |
2239 | ||
4c663ba9 | 2240 | AC_DEFINE(USE_ARES, 1, [Define if you want to enable c-ares support]) |
673ff5eb DS |
2241 | dnl substitute HAVE_ARES for curl-config and similar |
2242 | HAVE_ARES="1" | |
2243 | AC_SUBST(HAVE_ARES) | |
2244 | curl_ares_msg="enabled" | |
2245 | ||
8d581f7f YT |
2246 | LIBS="-lcares $LIBS" |
2247 | ||
673ff5eb DS |
2248 | dnl For backwards compatibility default to includes/lib in srcdir/ares |
2249 | dnl If a value is specified it is assumed that the libs are in $val/lib | |
2250 | dnl and the includes are in $val/include. This is the default setup for | |
2251 | dnl ares so it should not be a problem. | |
2252 | if test "x$enableval" = "xyes" ; then | |
2253 | if test -d "$srcdir/ares"; then | |
2254 | aresembedded="yes" | |
2255 | AC_CONFIG_SUBDIRS(ares) | |
13fdb9d8 YT |
2256 | dnl Since c-ares has installable configured header files, path |
2257 | dnl inclusion is fully done in makefiles for in-tree builds. | |
8d581f7f | 2258 | LDFLAGS="$LDFLAGS -L$embedded_ares_builddir" |
673ff5eb DS |
2259 | fi |
2260 | else | |
2261 | CPPFLAGS="$CPPFLAGS -I$enableval/include" | |
2262 | LDFLAGS="$LDFLAGS -L$enableval/lib" | |
2263 | fi | |
2264 | ||
2265 | if test -z "$aresembedded"; then | |
2266 | dnl verify that a sufficient c-ares is here if we have pointed one | |
2267 | dnl out and don't use the "embedded" ares dir (in which case we don't | |
2268 | dnl check it because it might not have been built yet) | |
2269 | AC_MSG_CHECKING([that c-ares is good and recent enough]) | |
d70f3374 | 2270 | AC_LINK_IFELSE([ |
862049c4 | 2271 | AC_LANG_PROGRAM([[ |
673ff5eb | 2272 | #include <ares.h> |
d70f3374 YT |
2273 | /* set of dummy functions in case c-ares was built with debug */ |
2274 | void curl_dofree() { } | |
2275 | void curl_sclose() { } | |
2276 | void curl_domalloc() { } | |
2277 | void curl_docalloc() { } | |
2278 | void curl_socket() { } | |
862049c4 | 2279 | ]],[[ |
d70f3374 YT |
2280 | ares_channel channel; |
2281 | ares_cancel(channel); /* added in 1.2.0 */ | |
2282 | ares_process_fd(channel, 0, 0); /* added in 1.4.0 */ | |
862049c4 | 2283 | ]]) |
d70f3374 YT |
2284 | ],[ |
2285 | AC_MSG_RESULT([yes]) | |
2286 | ],[ | |
2287 | AC_MSG_RESULT([no]) | |
2288 | AC_MSG_ERROR([c-ares library defective or too old]) | |
2289 | ]) | |
673ff5eb DS |
2290 | fi |
2291 | ;; | |
2292 | esac ], | |
2293 | AC_MSG_RESULT(no) | |
2294 | ) | |
ae1912cb | 2295 | |
cd5e6743 YT |
2296 | dnl set variable for use in automakefile(s) |
2297 | AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$aresembedded = xyes) | |
2298 | ||
710e370c DS |
2299 | dnl ************************************************************ |
2300 | dnl disable verbose text strings | |
2301 | dnl | |
2302 | AC_MSG_CHECKING([whether to enable verbose strings]) | |
2303 | AC_ARG_ENABLE(verbose, | |
2304 | AC_HELP_STRING([--enable-verbose],[Enable verbose strings]) | |
2305 | AC_HELP_STRING([--disable-verbose],[Disable verbose strings]), | |
2306 | [ case "$enableval" in | |
2307 | no) | |
2308 | AC_MSG_RESULT(no) | |
2309 | AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) | |
710e370c DS |
2310 | curl_verbose_msg="no" |
2311 | ;; | |
2312 | *) AC_MSG_RESULT(yes) | |
2313 | ;; | |
2314 | esac ], | |
2315 | AC_MSG_RESULT(yes) | |
2316 | ) | |
2317 | ||
8ed31c48 DS |
2318 | dnl ************************************************************ |
2319 | dnl enable SSPI support | |
2320 | dnl | |
d8d3dc93 | 2321 | AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)]) |
8ed31c48 DS |
2322 | AC_ARG_ENABLE(sspi, |
2323 | AC_HELP_STRING([--enable-sspi],[Enable SSPI]) | |
2324 | AC_HELP_STRING([--disable-sspi],[Disable SSPI]), | |
2325 | [ case "$enableval" in | |
2326 | yes) | |
d8d3dc93 YT |
2327 | if test "$ac_cv_native_windows" = "yes"; then |
2328 | AC_MSG_RESULT(yes) | |
2329 | AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) | |
9b23b310 | 2330 | AC_SUBST(USE_WINDOWS_SSPI, [1]) |
d8d3dc93 YT |
2331 | curl_sspi_msg="yes" |
2332 | else | |
2333 | AC_MSG_RESULT(no) | |
2334 | AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) | |
2335 | fi | |
8ed31c48 DS |
2336 | ;; |
2337 | *) | |
2338 | AC_MSG_RESULT(no) | |
2339 | ;; | |
2340 | esac ], | |
2341 | AC_MSG_RESULT(no) | |
2342 | ) | |
2343 | ||
94043b11 DS |
2344 | dnl ************************************************************ |
2345 | dnl disable cryptographic authentication | |
2346 | dnl | |
2347 | AC_MSG_CHECKING([whether to enable cryptographic authentication methods]) | |
2348 | AC_ARG_ENABLE(crypto-auth, | |
2349 | AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication]) | |
2350 | AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]), | |
2351 | [ case "$enableval" in | |
2352 | no) | |
2353 | AC_MSG_RESULT(no) | |
2354 | AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication]) | |
94043b11 DS |
2355 | ;; |
2356 | *) AC_MSG_RESULT(yes) | |
2357 | ;; | |
2358 | esac ], | |
2359 | AC_MSG_RESULT(yes) | |
2360 | ) | |
2361 | ||
ac269a8f DS |
2362 | dnl ************************************************************ |
2363 | dnl disable cookies support | |
2364 | dnl | |
2365 | AC_MSG_CHECKING([whether to enable support for cookies]) | |
2366 | AC_ARG_ENABLE(cookies, | |
2367 | AC_HELP_STRING([--enable-cookies],[Enable cookies support]) | |
2368 | AC_HELP_STRING([--disable-cookies],[Disable cookies support]), | |
2369 | [ case "$enableval" in | |
2370 | no) | |
2371 | AC_MSG_RESULT(no) | |
2372 | AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) | |
ac269a8f DS |
2373 | ;; |
2374 | *) AC_MSG_RESULT(yes) | |
2375 | ;; | |
2376 | esac ], | |
2377 | AC_MSG_RESULT(yes) | |
2378 | ) | |
2379 | ||
59582a9d DF |
2380 | dnl ************************************************************ |
2381 | dnl Enable hiding of internal symbols in library to reduce its size and | |
2382 | dnl speed dynamic linking of applications. This currently is only supported | |
10489879 | 2383 | dnl on gcc >= 4.0 and SunPro C. |
59582a9d DF |
2384 | dnl |
2385 | AC_MSG_CHECKING([whether to enable hidden symbols in the library]) | |
2386 | AC_ARG_ENABLE(hidden-symbols, | |
10489879 | 2387 | AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library]) |
59582a9d DF |
2388 | AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]), |
2389 | [ case "$enableval" in | |
2390 | no) | |
2391 | AC_MSG_RESULT(no) | |
2392 | ;; | |
e16c1b8e | 2393 | *) |
10489879 | 2394 | AC_MSG_CHECKING([whether $CC supports it]) |
f13ac35e | 2395 | if test "$GCC" = yes ; then |
f13ac35e | 2396 | if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then |
77431568 GK |
2397 | AC_MSG_RESULT(yes) |
2398 | AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols]) | |
77431568 | 2399 | AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) |
77431568 | 2400 | CFLAGS="$CFLAGS -fvisibility=hidden" |
f13ac35e DF |
2401 | else |
2402 | AC_MSG_RESULT(no) | |
2403 | fi | |
10489879 | 2404 | |
f13ac35e | 2405 | else |
77431568 GK |
2406 | dnl Test for SunPro cc |
2407 | if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then | |
10489879 | 2408 | AC_MSG_RESULT(yes) |
77431568 | 2409 | AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols]) |
77431568 | 2410 | AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible]) |
77431568 | 2411 | CFLAGS="$CFLAGS -xldscope=hidden" |
10489879 DF |
2412 | else |
2413 | AC_MSG_RESULT(no) | |
2414 | fi | |
f13ac35e | 2415 | fi |
59582a9d DF |
2416 | ;; |
2417 | esac ], | |
2418 | AC_MSG_RESULT(no) | |
2419 | ) | |
2420 | ||
8dabd344 DS |
2421 | dnl ************************************************************ |
2422 | dnl enforce SONAME bump | |
966cc10f | 2423 | dnl |
8dabd344 | 2424 | |
8dabd344 DS |
2425 | AC_MSG_CHECKING([whether to enforce SONAME bump]) |
2426 | AC_ARG_ENABLE(soname-bump, | |
2427 | AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump]) | |
2428 | AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]), | |
2429 | [ case "$enableval" in | |
2430 | yes) AC_MSG_RESULT(yes) | |
2431 | soname_bump=yes | |
2432 | ;; | |
2433 | *) | |
d7d56184 | 2434 | AC_MSG_RESULT(no) |
8dabd344 DS |
2435 | ;; |
2436 | esac ], | |
3f3d6ebe | 2437 | AC_MSG_RESULT($soname_bump) |
8dabd344 DS |
2438 | ) |
2439 | AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes) | |
2440 | ||
2441 | ||
59582a9d | 2442 | dnl ************************************************************ |
560a82ae | 2443 | if test ! -z "$winsock_LIB"; then |
9f3d9da1 DS |
2444 | |
2445 | dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes | |
2446 | dnl things work when built with c-ares). But we can't just move it last | |
2447 | dnl since then other stuff (SSL) won't build. So we simply append it to the | |
2448 | dnl end. | |
2449 | ||
560a82ae YT |
2450 | LIBS="$LIBS $winsock_LIB" |
2451 | TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB" | |
9f3d9da1 DS |
2452 | |
2453 | fi | |
2454 | ||
a0a47f27 DF |
2455 | dnl |
2456 | dnl All the library dependencies put into $LIB apply to libcurl only. | |
2457 | dnl Those in $CURL_LIBS apply to the curl command-line client only. | |
c461254d | 2458 | dnl Those in $TEST_SERVER_LIBS apply to test servers only. |
a0a47f27 DF |
2459 | dnl Those in $ALL_LIBS apply to all targets, including test targets. |
2460 | dnl | |
2461 | LIBCURL_LIBS=$LIBS | |
a0a47f27 DF |
2462 | |
2463 | AC_SUBST(LIBCURL_LIBS) | |
2464 | AC_SUBST(CURL_LIBS) | |
2465 | AC_SUBST(TEST_SERVER_LIBS) | |
c461254d | 2466 | LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link |
a0a47f27 | 2467 | |
20705ca3 DS |
2468 | AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes) |
2469 | ||
bbc002a5 DS |
2470 | dnl |
2471 | dnl For keeping supported features and protocols also in pkg-config file | |
2472 | dnl since it is more cross-compile frient than curl-config | |
2473 | dnl | |
2474 | ||
2475 | if test "x$USE_SSLEAY" = "x1"; then | |
2476 | SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" | |
2477 | elif test -n "$SSL_ENABLED"; then | |
2478 | SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" | |
2479 | fi | |
2480 | if test "@KRB4_ENABLED@" = "x1"; then | |
2481 | SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4" | |
2482 | fi | |
2483 | if test "x$IPV6_ENABLED" = "x1"; then | |
2484 | SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6" | |
2485 | fi | |
2486 | if test "x$HAVE_LIBZ" = "x1"; then | |
2487 | SUPPORT_FEATURES="$SUPPORT_FEATURES libz" | |
2488 | fi | |
2489 | if test "x$HAVE_ARES" = "x1"; then | |
2490 | SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" | |
2491 | fi | |
2492 | if test "x$IDN_ENABLED" = "x1"; then | |
2493 | SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" | |
2494 | fi | |
2495 | if test "x$USE_WINDOWS_SSPI" = "x1"; then | |
2496 | SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI" | |
2497 | fi | |
9ddc7ad0 | 2498 | if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then |
bbc002a5 DS |
2499 | SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" |
2500 | fi | |
2501 | ||
2502 | AC_SUBST(SUPPORT_FEATURES) | |
2503 | ||
2504 | dnl For supported protocols in pkg-config file | |
2505 | if test "x$CURL_DISABLE_HTTP" != "x1"; then | |
2506 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP" | |
2507 | if test "x$SSL_ENABLED" = "x1"; then | |
2508 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS" | |
2509 | fi | |
2510 | fi | |
2511 | if test "x$CURL_DISABLE_FTP" != "x1"; then | |
2512 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP" | |
2513 | if test "x$SSL_ENABLED" = "x1"; then | |
2514 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS" | |
2515 | fi | |
2516 | fi | |
2517 | if test "x$CURL_DISABLE_FILE" != "x1"; then | |
2518 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE" | |
2519 | fi | |
2520 | if test "x$CURL_DISABLE_TELNET" != "x1"; then | |
2521 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET" | |
2522 | fi | |
2523 | if test "x$CURL_DISABLE_LDAP" != "x1"; then | |
2524 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" | |
2525 | fi | |
2526 | if test "x$CURL_DISABLE_LDAPS" != "x1"; then | |
2527 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" | |
2528 | fi | |
2529 | if test "x$CURL_DISABLE_DICT" != "x1"; then | |
2530 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT" | |
2531 | fi | |
2532 | if test "x$CURL_DISABLE_TFTP" != "x1"; then | |
2533 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP" | |
2534 | fi | |
2535 | if test "x$USE_LIBSSH2" = "x1"; then | |
2536 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" | |
2537 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" | |
2538 | fi | |
2539 | ||
2540 | AC_SUBST(SUPPORT_PROTOCOLS) | |
2541 | ||
d930280a YT |
2542 | dnl squeeze whitespace out of some variables |
2543 | ||
be760bed YT |
2544 | squeeze CFLAGS |
2545 | squeeze CPPFLAGS | |
2546 | squeeze DEFS | |
2547 | squeeze LDFLAGS | |
2548 | squeeze LIBS | |
2549 | ||
2550 | squeeze CURL_LIBS | |
2551 | squeeze LIBCURL_LIBS | |
2552 | squeeze TEST_SERVER_LIBS | |
d930280a | 2553 | |
065047dc YT |
2554 | if test "x$want_curldebug_assumed" = "xyes" && |
2555 | test "x$want_curldebug" = "xyes" && test "x$HAVE_ARES" = "x1"; then | |
675d6ec5 YT |
2556 | ac_configure_args="$ac_configure_args --enable-curldebug" |
2557 | fi | |
2558 | ||
93c53424 | 2559 | AC_CONFIG_FILES([Makefile \ |
77431568 | 2560 | docs/Makefile \ |
d54cdf29 | 2561 | docs/examples/Makefile \ |
e22657ea | 2562 | docs/libcurl/Makefile \ |
77431568 GK |
2563 | include/Makefile \ |
2564 | include/curl/Makefile \ | |
2565 | src/Makefile \ | |
172f0ba1 | 2566 | lib/Makefile \ |
044ca343 | 2567 | tests/Makefile \ |
b915ca68 | 2568 | tests/data/Makefile \ |
fd8bf5f1 | 2569 | tests/server/Makefile \ |
2aa0c6c4 | 2570 | tests/libtest/Makefile \ |
77431568 GK |
2571 | packages/Makefile \ |
2572 | packages/Win32/Makefile \ | |
2573 | packages/Win32/cygwin/Makefile \ | |
2574 | packages/Linux/Makefile \ | |
2575 | packages/Linux/RPM/Makefile \ | |
2576 | packages/Linux/RPM/curl.spec \ | |
2577 | packages/Linux/RPM/curl-ssl.spec \ | |
c503930b | 2578 | packages/Solaris/Makefile \ |
34f9ab10 DS |
2579 | packages/EPM/curl.list \ |
2580 | packages/EPM/Makefile \ | |
f19cade5 | 2581 | packages/vms/Makefile \ |
c7e9e60b DS |
2582 | packages/AIX/Makefile \ |
2583 | packages/AIX/RPM/Makefile \ | |
15f2647d | 2584 | packages/AIX/RPM/curl.spec \ |
df3ca591 DS |
2585 | curl-config \ |
2586 | libcurl.pc | |
93c53424 DS |
2587 | ]) |
2588 | AC_OUTPUT | |
cff90cf3 DS |
2589 | |
2590 | AC_MSG_NOTICE([Configured to build curl/libcurl: | |
2591 | ||
2592 | curl version: ${VERSION} | |
2593 | Host setup: ${host} | |
2594 | Install prefix: ${prefix} | |
2595 | Compiler: ${CC} | |
2596 | SSL support: ${curl_ssl_msg} | |
2147284c | 2597 | SSH support: ${curl_ssh_msg} |
cff90cf3 DS |
2598 | zlib support: ${curl_zlib_msg} |
2599 | krb4 support: ${curl_krb4_msg} | |
2600 | GSSAPI support: ${curl_gss_msg} | |
48975876 | 2601 | SPNEGO support: ${curl_spnego_msg} |
cff90cf3 DS |
2602 | c-ares support: ${curl_ares_msg} |
2603 | ipv6 support: ${curl_ipv6_msg} | |
96002646 | 2604 | IDN support: ${curl_idn_msg} |
e16c1b8e | 2605 | Build libcurl: Shared=${enable_shared}, Static=${enable_static} |
cff90cf3 | 2606 | Built-in manual: ${curl_manual_msg} |
710e370c | 2607 | Verbose errors: ${curl_verbose_msg} |
8ed31c48 | 2608 | SSPI support: ${curl_sspi_msg} |
86cbb232 MM |
2609 | ca cert bundle: ${ca} |
2610 | ca cert path: ${capath} | |
d0edb478 | 2611 | LDAP support: ${curl_ldap_msg} |
966cc10f | 2612 | LDAPS support: ${curl_ldaps_msg} |
cff90cf3 | 2613 | ]) |
3f3d6ebe DS |
2614 | |
2615 | if test "x$soname_bump" = "xyes"; then | |
2616 | ||
2617 | cat <<EOM | |
2618 | SONAME bump: yes - WARNING: this library will be built with the SONAME | |
2619 | number bumped due to (a detected) ABI breakage. | |
2620 | See lib/README.curl_off_t for details on this. | |
2621 | EOM | |
2622 | ||
2623 | fi | |
2624 |