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