Git init
[external/curl.git] / configure.ac
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
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 #***************************************************************************
22 dnl Process this file with autoconf to produce a configure script.
23
24 AC_PREREQ(2.57)
25
26 dnl We don't know the version number "statically" so we use a dash here
27 AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
28
29 CURL_OVERRIDE_AUTOCONF
30
31 dnl configure script copyright
32 AC_COPYRIGHT([Copyright (c) 1998 - 2010 Daniel Stenberg, <daniel@haxx.se>
33 This configure script may be copied, distributed and modified under the
34 terms of the curl license; see COPYING for more details])
35
36 AC_CONFIG_SRCDIR([lib/urldata.h])
37 AM_CONFIG_HEADER(lib/curl_config.h src/curl_config.h include/curl/curlbuild.h)
38 AM_MAINTAINER_MODE
39
40 CURL_CHECK_OPTION_DEBUG
41 CURL_CHECK_OPTION_OPTIMIZE
42 CURL_CHECK_OPTION_WARNINGS
43 CURL_CHECK_OPTION_WERROR
44 CURL_CHECK_OPTION_CURLDEBUG
45 CURL_CHECK_OPTION_ARES
46
47 CURL_CHECK_PATH_SEPARATOR_REQUIRED
48
49 #
50 # save the configure arguments
51 #
52 CONFIGURE_OPTIONS="\"$ac_configure_args\""
53 AC_SUBST(CONFIGURE_OPTIONS)
54
55 CURL_CFLAG_EXTRAS=""
56 if test X"$want_werror" = Xyes; then
57   CURL_CFLAG_EXTRAS="-Werror"
58 fi
59 AC_SUBST(CURL_CFLAG_EXTRAS)
60
61 dnl SED is mandatory for configure process and libtool.
62 dnl Set it now, allowing it to be changed later.
63 if test -z "$SED"; then
64   dnl allow it to be overridden
65   AC_PATH_PROG([SED], [sed], [not_found],
66     [$PATH:/usr/bin:/usr/local/bin])
67   if test -z "$SED" || test "$SED" = "not_found"; then
68     AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
69   fi
70 fi
71 AC_SUBST([SED])
72
73 dnl GREP is mandatory for configure process and libtool.
74 dnl Set it now, allowing it to be changed later.
75 if test -z "$GREP"; then
76   dnl allow it to be overridden
77   AC_PATH_PROG([GREP], [grep], [not_found],
78     [$PATH:/usr/bin:/usr/local/bin])
79   if test -z "$GREP" || test "$GREP" = "not_found"; then
80     AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
81   fi
82 fi
83 AC_SUBST([GREP])
84
85 dnl EGREP is mandatory for configure process and libtool.
86 dnl Set it now, allowing it to be changed later.
87 if test -z "$EGREP"; then
88   dnl allow it to be overridden
89   if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
90     AC_MSG_CHECKING([for egrep])
91     EGREP="$GREP -E"
92     AC_MSG_RESULT([$EGREP])
93   else
94     AC_PATH_PROG([EGREP], [egrep], [not_found],
95       [$PATH:/usr/bin:/usr/local/bin])
96   fi
97 fi
98 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
99   AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
100 fi
101 AC_SUBST([EGREP])
102
103 dnl AR is mandatory for configure process and libtool.
104 dnl This is target dependent, so check it as a tool.
105 if test -z "$AR"; then
106   dnl allow it to be overridden
107   AC_PATH_TOOL([AR], [ar], [not_found],
108     [$PATH:/usr/bin:/usr/local/bin])
109   if test -z "$AR" || test "$AR" = "not_found"; then
110     AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
111   fi
112 fi
113 AC_SUBST([AR])
114
115 AC_SUBST(libext)
116
117 dnl Remove non-configure distributed curlbuild.h
118 if test -f ${srcdir}/include/curl/curlbuild.h; then
119   rm -f ${srcdir}/include/curl/curlbuild.h
120 fi
121
122 dnl figure out the libcurl version
123 VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
124 AM_INIT_AUTOMAKE(curl,$VERSION)
125 AC_MSG_CHECKING([curl version])
126 AC_MSG_RESULT($VERSION)
127
128 dnl
129 dnl we extract the numerical version for curl-config only
130 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
131 AC_SUBST(VERSIONNUM)
132
133 dnl Solaris pkgadd support definitions
134 PKGADD_PKG="HAXXcurl"
135 PKGADD_NAME="cURL - a client that groks URLs"
136 PKGADD_VENDOR="curl.haxx.se"
137 AC_SUBST(PKGADD_PKG)
138 AC_SUBST(PKGADD_NAME)
139 AC_SUBST(PKGADD_VENDOR)
140
141 dnl
142 dnl initialize all the info variables
143     curl_ssl_msg="no      (--with-{ssl,gnutls,nss,polarssl} )"
144     curl_ssh_msg="no      (--with-libssh2)"
145    curl_zlib_msg="no      (--with-zlib)"
146    curl_krb4_msg="no      (--with-krb4*)"
147     curl_gss_msg="no      (--with-gssapi)"
148  curl_spnego_msg="no      (--with-spnego)"
149     curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
150    curl_ipv6_msg="no      (--enable-ipv6)"
151     curl_idn_msg="no      (--with-libidn)"
152  curl_manual_msg="no      (--enable-manual)"
153 curl_verbose_msg="enabled (--disable-verbose)"
154    curl_sspi_msg="no      (--enable-sspi)"
155    curl_ldap_msg="no      (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
156   curl_ldaps_msg="no      (--enable-ldaps)"
157    curl_rtsp_msg="no      (--enable-rtsp)"
158    curl_rtmp_msg="no      (--with-librtmp)"
159
160 dnl
161 dnl Save anything in $LIBS for later
162 dnl
163 ALL_LIBS=$LIBS
164
165 dnl
166 dnl Detect the canonical host and target build environment
167 dnl
168
169 AC_CANONICAL_HOST
170 dnl Get system canonical name
171 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
172
173 dnl Checks for programs.
174 CURL_CHECK_PROG_CC
175
176 dnl Our curl_off_t internal and external configure settings
177 CURL_CONFIGURE_CURL_OFF_T
178
179 dnl This defines _ALL_SOURCE for AIX
180 CURL_CHECK_AIX_ALL_SOURCE
181
182 dnl Our configure and build reentrant settings
183 CURL_CONFIGURE_THREAD_SAFE
184 CURL_CONFIGURE_REENTRANT
185
186 dnl check for how to do large files
187 AC_SYS_LARGEFILE
188
189 dnl support building of Windows DLLs
190 AC_LIBTOOL_WIN32_DLL
191
192 dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
193 AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
194 case $host in
195   x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
196     AC_MSG_RESULT([yes])
197     with_pic=yes
198     ;;
199   *)
200     AC_MSG_RESULT([no])
201     ;;
202 esac
203
204 AC_MSG_CHECKING([if compiler is icc (to build with PIC)])
205 case $CC in
206   icc | */icc)
207     AC_MSG_RESULT([yes])
208     with_pic=yes
209     ;;
210   *)
211     AC_MSG_RESULT([no])
212     ;;
213 esac
214
215 dnl libtool setup
216 AC_PROG_LIBTOOL
217
218 AC_MSG_CHECKING([if we need -mimpure-text])
219 mimpure=no
220 case $host in
221   *-*-solaris2*)
222     if test "$GCC" = "yes"; then
223       mimpure="yes"
224     fi
225     ;;
226   *)
227     ;;
228 esac
229 AC_MSG_RESULT($mimpure)
230 AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
231
232 dnl 'STATICLIB' is, in spite of its name, not generic but only for static-only
233 dnl builds on Windows
234 AM_CONDITIONAL(STATICLIB, false)
235
236 AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
237 case $host in
238   *-*-mingw*)
239     AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
240     AC_MSG_RESULT(yes)
241     AC_MSG_CHECKING([if we need CURL_STATICLIB])
242     if test "X$enable_shared" = "Xno"
243     then
244       AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
245       AC_MSG_RESULT(yes)
246       AM_CONDITIONAL(STATICLIB, true)
247     else
248       AC_MSG_RESULT(no)
249     fi
250     ;;
251   *)
252     AC_MSG_RESULT(no)
253     ;;
254 esac
255
256 # Determine whether all dependent libraries must be specified when linking
257 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
258 then
259     REQUIRE_LIB_DEPS=no
260 else
261     REQUIRE_LIB_DEPS=yes
262 fi
263 AC_SUBST(REQUIRE_LIB_DEPS)
264
265 dnl The install stuff has already been taken care of by the automake stuff
266 dnl AC_PROG_INSTALL
267 AC_PROG_MAKE_SET
268
269 dnl check if there's a way to force code inline
270 AC_C_INLINE
271
272 dnl **********************************************************************
273 dnl platform/compiler/architecture specific checks/flags
274 dnl **********************************************************************
275
276 CURL_CHECK_COMPILER
277 CURL_SET_COMPILER_BASIC_OPTS
278 CURL_SET_COMPILER_DEBUG_OPTS
279 CURL_SET_COMPILER_OPTIMIZE_OPTS
280 CURL_SET_COMPILER_WARNING_OPTS
281
282 if test "$compiler_id" = "INTEL_UNIX_C"; then
283   #
284   if test "$compiler_num" -ge "1000"; then
285     dnl icc 10.X or later
286     CFLAGS="$CFLAGS -shared-intel"
287   elif test "$compiler_num" -ge "900"; then
288     dnl icc 9.X specific
289     CFLAGS="$CFLAGS -i-dynamic"
290   fi
291   #
292 fi
293
294 CURL_CHECK_COMPILER_HALT_ON_ERROR
295 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
296
297 CURL_CHECK_NO_UNDEFINED
298 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
299
300 CURL_CHECK_CURLDEBUG
301 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
302
303 dnl **********************************************************************
304 dnl Compilation based checks should not be done before this point.
305 dnl **********************************************************************
306
307 dnl **********************************************************************
308 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
309 dnl and ws2tcpip.h take precedence over any other further checks which
310 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
311 dnl this specific header files. And do them before its results are used.
312 dnl **********************************************************************
313
314 CURL_CHECK_HEADER_WINDOWS
315 CURL_CHECK_NATIVE_WINDOWS
316 case X-"$ac_cv_native_windows" in
317   X-yes)
318     CURL_CHECK_HEADER_WINSOCK
319     CURL_CHECK_HEADER_WINSOCK2
320     CURL_CHECK_HEADER_WS2TCPIP
321     CURL_CHECK_HEADER_WINLDAP
322     CURL_CHECK_HEADER_WINBER
323     ;;
324   *)
325     ac_cv_header_winsock_h="no"
326     ac_cv_header_winsock2_h="no"
327     ac_cv_header_ws2tcpip_h="no"
328     ac_cv_header_winldap_h="no"
329     ac_cv_header_winber_h="no"
330     ;;
331 esac
332 CURL_CHECK_WIN32_LARGEFILE
333
334 dnl ************************************************************
335 dnl switch off particular protocols
336 dnl
337 AC_MSG_CHECKING([whether to support http])
338 AC_ARG_ENABLE(http,
339 AC_HELP_STRING([--enable-http],[Enable HTTP support])
340 AC_HELP_STRING([--disable-http],[Disable HTTP support]),
341 [ case "$enableval" in
342   no)
343        AC_MSG_RESULT(no)
344        AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
345        AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
346        AC_SUBST(CURL_DISABLE_HTTP, [1])
347        AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
348        AC_SUBST(CURL_DISABLE_RTSP, [1])
349        ;;
350   *)   AC_MSG_RESULT(yes)
351        ;;
352   esac ],
353        AC_MSG_RESULT(yes)
354 )
355 AC_MSG_CHECKING([whether to support ftp])
356 AC_ARG_ENABLE(ftp,
357 AC_HELP_STRING([--enable-ftp],[Enable FTP support])
358 AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
359 [ case "$enableval" in
360   no)
361        AC_MSG_RESULT(no)
362        AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
363        AC_SUBST(CURL_DISABLE_FTP, [1])
364        ;;
365   *)   AC_MSG_RESULT(yes)
366        ;;
367   esac ],
368        AC_MSG_RESULT(yes)
369 )
370 AC_MSG_CHECKING([whether to support file])
371 AC_ARG_ENABLE(file,
372 AC_HELP_STRING([--enable-file],[Enable FILE support])
373 AC_HELP_STRING([--disable-file],[Disable FILE support]),
374 [ case "$enableval" in
375   no)
376        AC_MSG_RESULT(no)
377        AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
378        AC_SUBST(CURL_DISABLE_FILE, [1])
379        ;;
380   *)   AC_MSG_RESULT(yes)
381        ;;
382   esac ],
383        AC_MSG_RESULT(yes)
384 )
385 AC_MSG_CHECKING([whether to support ldap])
386 AC_ARG_ENABLE(ldap,
387 AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
388 AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
389 [ case "$enableval" in
390   no)
391        AC_MSG_RESULT(no)
392        AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
393        AC_SUBST(CURL_DISABLE_LDAP, [1])
394        ;;
395   *)
396        AC_MSG_RESULT(yes)
397        ;;
398   esac ],[
399        AC_MSG_RESULT(yes) ]
400 )
401 AC_MSG_CHECKING([whether to support ldaps])
402 AC_ARG_ENABLE(ldaps,
403 AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
404 AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
405 [ case "$enableval" in
406   no)
407        AC_MSG_RESULT(no)
408        AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
409        AC_SUBST(CURL_DISABLE_LDAPS, [1])
410        ;;
411   *)   if test "x$CURL_DISABLE_LDAP" = "x1" ; then
412          AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
413          AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
414          AC_SUBST(CURL_DISABLE_LDAPS, [1])
415        else
416          AC_MSG_RESULT(yes)
417          AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
418          AC_SUBST(HAVE_LDAP_SSL, [1])
419        fi
420        ;;
421   esac ],[
422        if test "x$CURL_DISABLE_LDAP" = "x1" ; then
423          AC_MSG_RESULT(no)
424          AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
425          AC_SUBST(CURL_DISABLE_LDAPS, [1])
426        else
427          AC_MSG_RESULT(yes)
428          AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
429          AC_SUBST(HAVE_LDAP_SSL, [1])
430        fi ]
431 )
432
433 AC_MSG_CHECKING([whether to support rtsp])
434 AC_ARG_ENABLE(rtsp,
435 AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
436 AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
437 [ case "$enableval" in
438   no)
439        AC_MSG_RESULT(no)
440        AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
441        AC_SUBST(CURL_DISABLE_RTSP, [1])
442        ;;
443   *)   if test x$CURL_DISABLE_HTTP = x1 ; then
444           AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
445        else
446           AC_MSG_RESULT(yes)
447           curl_rtsp_msg="enabled"
448        fi
449        ;;
450   esac ],
451        if test "x$CURL_DISABLE_HTTP" != "x1"; then
452           AC_MSG_RESULT(yes)
453           curl_rtsp_msg="enabled"
454        else
455           AC_MSG_RESULT(no)
456        fi
457 )
458
459 AC_MSG_CHECKING([whether to support proxies])
460 AC_ARG_ENABLE(proxy,
461 AC_HELP_STRING([--enable-proxy],[Enable proxy support])
462 AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
463 [ case "$enableval" in
464   no)
465        AC_MSG_RESULT(no)
466        AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
467        AC_SUBST(CURL_DISABLE_PROXY, [1])
468        ;;
469   *)   AC_MSG_RESULT(yes)
470        ;;
471   esac ],
472        AC_MSG_RESULT(yes)
473 )
474
475 AC_MSG_CHECKING([whether to support dict])
476 AC_ARG_ENABLE(dict,
477 AC_HELP_STRING([--enable-dict],[Enable DICT support])
478 AC_HELP_STRING([--disable-dict],[Disable DICT support]),
479 [ case "$enableval" in
480   no)
481        AC_MSG_RESULT(no)
482        AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
483        AC_SUBST(CURL_DISABLE_DICT, [1])
484        ;;
485   *)   AC_MSG_RESULT(yes)
486        ;;
487   esac ],
488        AC_MSG_RESULT(yes)
489 )
490 AC_MSG_CHECKING([whether to support telnet])
491 AC_ARG_ENABLE(telnet,
492 AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
493 AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
494 [ case "$enableval" in
495   no)
496        AC_MSG_RESULT(no)
497        AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
498        AC_SUBST(CURL_DISABLE_TELNET, [1])
499        ;;
500   *)   AC_MSG_RESULT(yes)
501        ;;
502   esac ],
503        AC_MSG_RESULT(yes)
504 )
505 AC_MSG_CHECKING([whether to support tftp])
506 AC_ARG_ENABLE(tftp,
507 AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
508 AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
509 [ case "$enableval" in
510   no)
511        AC_MSG_RESULT(no)
512        AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
513        AC_SUBST(CURL_DISABLE_TFTP, [1])
514        ;;
515   *)   AC_MSG_RESULT(yes)
516        ;;
517   esac ],
518        AC_MSG_RESULT(yes)
519 )
520
521 AC_MSG_CHECKING([whether to support pop3])
522 AC_ARG_ENABLE(pop3,
523 AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
524 AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
525 [ case "$enableval" in
526   no)
527        AC_MSG_RESULT(no)
528        AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
529        AC_SUBST(CURL_DISABLE_POP3, [1])
530        ;;
531   *)   AC_MSG_RESULT(yes)
532        ;;
533   esac ],
534        AC_MSG_RESULT(yes)
535 )
536
537
538 AC_MSG_CHECKING([whether to support imap])
539 AC_ARG_ENABLE(imap,
540 AC_HELP_STRING([--enable-imap],[Enable IMAP support])
541 AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
542 [ case "$enableval" in
543   no)
544        AC_MSG_RESULT(no)
545        AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
546        AC_SUBST(CURL_DISABLE_IMAP, [1])
547        ;;
548   *)   AC_MSG_RESULT(yes)
549        ;;
550   esac ],
551        AC_MSG_RESULT(yes)
552 )
553
554
555 AC_MSG_CHECKING([whether to support smtp])
556 AC_ARG_ENABLE(smtp,
557 AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
558 AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
559 [ case "$enableval" in
560   no)
561        AC_MSG_RESULT(no)
562        AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
563        AC_SUBST(CURL_DISABLE_SMTP, [1])
564        ;;
565   *)   AC_MSG_RESULT(yes)
566        ;;
567   esac ],
568        AC_MSG_RESULT(yes)
569 )
570
571 AC_MSG_CHECKING([whether to support gopher])
572 AC_ARG_ENABLE(gopher,
573 AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
574 AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
575 [ case "$enableval" in
576   no)
577        AC_MSG_RESULT(no)
578        AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
579        AC_SUBST(CURL_DISABLE_GOPHER, [1])
580        ;;
581   *)   AC_MSG_RESULT(yes)
582        ;;
583   esac ],
584        AC_MSG_RESULT(yes)
585 )
586
587
588 dnl **********************************************************************
589 dnl Check for built-in manual
590 dnl **********************************************************************
591
592 AC_MSG_CHECKING([whether to provide built-in manual])
593 AC_ARG_ENABLE(manual,
594 AC_HELP_STRING([--enable-manual],[Enable built-in manual])
595 AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
596 [ case "$enableval" in
597   no)
598        AC_MSG_RESULT(no)
599        ;;
600   *)   AC_MSG_RESULT(yes)
601        USE_MANUAL="1"
602        ;;
603   esac ],
604        AC_MSG_RESULT(yes)
605        USE_MANUAL="1"
606 )
607 dnl The actual use of the USE_MANUAL variable is done much later in this
608 dnl script to allow other actions to disable it as well.
609
610 dnl **********************************************************************
611 dnl Checks for libraries.
612 dnl **********************************************************************
613
614 CURL_CHECK_LIB_XNET
615
616 dnl gethostbyname without lib or in the nsl lib?
617 AC_CHECK_FUNC(gethostbyname,
618               [HAVE_GETHOSTBYNAME="1"
619               ],
620               [ AC_CHECK_LIB(nsl, gethostbyname,
621                              [HAVE_GETHOSTBYNAME="1"
622                              LIBS="$LIBS -lnsl"
623                              ])
624               ])
625
626 if test "$HAVE_GETHOSTBYNAME" != "1"
627 then
628   dnl gethostbyname in the socket lib?
629   AC_CHECK_LIB(socket, gethostbyname,
630                [HAVE_GETHOSTBYNAME="1"
631                LIBS="$LIBS -lsocket"
632                ])
633 fi
634
635 dnl At least one system has been identified to require BOTH nsl and socket
636 dnl libs at the same time to link properly.
637 if test "$HAVE_GETHOSTBYNAME" != "1"
638 then
639   AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
640   my_ac_save_LIBS=$LIBS
641   LIBS="-lnsl -lsocket $LIBS"
642   AC_LINK_IFELSE([
643     AC_LANG_PROGRAM([[
644     ]],[[
645       gethostbyname();
646     ]])
647   ],[
648     AC_MSG_RESULT([yes])
649     HAVE_GETHOSTBYNAME="1"
650   ],[
651     AC_MSG_RESULT([no])
652     LIBS=$my_ac_save_LIBS
653   ])
654 fi
655
656 if test "$HAVE_GETHOSTBYNAME" != "1"
657 then
658   dnl This is for winsock systems
659   if test "$ac_cv_header_windows_h" = "yes"; then
660     if test "$ac_cv_header_winsock_h" = "yes"; then
661       case $host in
662         *-*-mingw32ce*)
663           winsock_LIB="-lwinsock"
664           ;;
665         *)
666           winsock_LIB="-lwsock32"
667           ;;
668       esac
669     fi
670     if test "$ac_cv_header_winsock2_h" = "yes"; then
671       winsock_LIB="-lws2_32"
672     fi
673     if test ! -z "$winsock_LIB"; then
674       my_ac_save_LIBS=$LIBS
675       LIBS="$winsock_LIB $LIBS"
676       AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
677       AC_LINK_IFELSE([
678         AC_LANG_PROGRAM([[
679 #ifdef HAVE_WINDOWS_H
680 #ifndef WIN32_LEAN_AND_MEAN
681 #define WIN32_LEAN_AND_MEAN
682 #endif
683 #include <windows.h>
684 #ifdef HAVE_WINSOCK2_H
685 #include <winsock2.h>
686 #else
687 #ifdef HAVE_WINSOCK_H
688 #include <winsock.h>
689 #endif
690 #endif
691 #endif
692         ]],[[
693           gethostbyname("www.dummysite.com");
694         ]])
695       ],[
696         AC_MSG_RESULT([yes])
697         HAVE_GETHOSTBYNAME="1"
698       ],[
699         AC_MSG_RESULT([no])
700         winsock_LIB=""
701         LIBS=$my_ac_save_LIBS
702       ])
703     fi
704   fi
705 fi
706
707 if test "$HAVE_GETHOSTBYNAME" != "1"
708 then
709   dnl This is for Minix 3.1
710   AC_MSG_CHECKING([for gethostbyname for Minix 3])
711   AC_LINK_IFELSE([
712     AC_LANG_PROGRAM([[
713 /* Older Minix versions may need <net/gen/netdb.h> here instead */
714 #include <netdb.h>
715     ]],[[
716       gethostbyname("www.dummysite.com");
717     ]])
718   ],[
719     AC_MSG_RESULT([yes])
720     HAVE_GETHOSTBYNAME="1"
721   ],[
722     AC_MSG_RESULT([no])
723   ])
724 fi
725
726 if test "$HAVE_GETHOSTBYNAME" != "1"
727 then
728   dnl This is for eCos with a stubbed DNS implementation
729   AC_MSG_CHECKING([for gethostbyname for eCos])
730   AC_LINK_IFELSE([
731     AC_LANG_PROGRAM([[
732 #include <stdio.h>
733 #include <netdb.h>
734     ]],[[
735       gethostbyname("www.dummysite.com");
736     ]])
737   ],[
738     AC_MSG_RESULT([yes])
739     HAVE_GETHOSTBYNAME="1"
740   ],[
741     AC_MSG_RESULT([no])
742   ])
743 fi
744
745 if test "$HAVE_GETHOSTBYNAME" != "1"
746 then
747   dnl gethostbyname in the network lib - for Haiku OS
748   AC_CHECK_LIB(network, gethostbyname,
749                [HAVE_GETHOSTBYNAME="1"
750                LIBS="$LIBS -lnetwork"
751                ])
752 fi
753
754 if test "$HAVE_GETHOSTBYNAME" != "1"
755 then
756   dnl gethostbyname in the net lib - for BeOS
757   AC_CHECK_LIB(net, gethostbyname,
758                [HAVE_GETHOSTBYNAME="1"
759                LIBS="$LIBS -lnet"
760                ])
761 fi
762
763
764 if test "$HAVE_GETHOSTBYNAME" != "1"; then
765   AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
766 fi
767
768 dnl resolve lib?
769 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
770
771 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
772   AC_CHECK_LIB(resolve, strcasecmp,
773               [LIBS="-lresolve $LIBS"],
774                ,
775                -lnsl)
776 fi
777 ac_cv_func_strcasecmp="no"
778
779 CURL_CHECK_LIBS_CONNECT
780
781 CURL_NETWORK_LIBS=$LIBS
782
783 dnl **********************************************************************
784 dnl In case that function clock_gettime with monotonic timer is available,
785 dnl check for additional required libraries.
786 dnl **********************************************************************
787 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
788
789 dnl **********************************************************************
790 dnl The preceding library checks are all potentially useful for test
791 dnl servers (for providing networking support).  Save the list of required
792 dnl libraries at this point for use while linking those test servers.
793 dnl **********************************************************************
794 TEST_SERVER_LIBS=$LIBS
795
796 dnl **********************************************************************
797 AC_MSG_CHECKING([whether to use libgcc])
798 AC_ARG_ENABLE(libgcc,
799 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
800 [ case "$enableval" in
801   yes)
802         ALL_LIBS="$ALL_LIBS -lgcc"
803        AC_MSG_RESULT(yes)
804        ;;
805   *)   AC_MSG_RESULT(no)
806        ;;
807   esac ],
808        AC_MSG_RESULT(no)
809 )
810
811 dnl **********************************************************************
812 dnl Check for LDAP
813 dnl **********************************************************************
814
815 LDAPLIBNAME=""
816 AC_ARG_WITH(ldap-lib,
817 AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
818  [LDAPLIBNAME="$withval"])
819
820 LBERLIBNAME=""
821 AC_ARG_WITH(lber-lib,
822 AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
823  [LBERLIBNAME="$withval"])
824
825 if test x$CURL_DISABLE_LDAP != x1 ; then
826
827   CURL_CHECK_HEADER_LBER
828   CURL_CHECK_HEADER_LDAP
829   CURL_CHECK_HEADER_LDAPSSL
830   CURL_CHECK_HEADER_LDAP_SSL
831
832   if test -z "$LDAPLIBNAME" ; then
833     if test "$ac_cv_native_windows" = "yes"; then
834       dnl Windows uses a single and unique LDAP library name
835       LDAPLIBNAME="wldap32"
836       LBERLIBNAME="no"
837     fi
838   fi
839
840   if test "$LDAPLIBNAME" ; then
841     AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
842       AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
843       AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
844       AC_SUBST(CURL_DISABLE_LDAP, [1])])
845       AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
846       AC_SUBST(CURL_DISABLE_LDAPS, [1])
847   else
848     dnl Try to find the right ldap libraries for this system
849     CURL_CHECK_LIBS_LDAP
850     case X-"$curl_cv_ldap_LIBS" in
851       X-unknown)
852         AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
853         AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
854         AC_SUBST(CURL_DISABLE_LDAP, [1])
855         AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
856         AC_SUBST(CURL_DISABLE_LDAPS, [1])
857         ;;
858     esac
859   fi
860 fi
861
862 if test x$CURL_DISABLE_LDAP != x1 ; then
863
864   if test "$LBERLIBNAME" ; then
865     dnl If name is "no" then don't define this library at all
866     dnl (it's only needed if libldap.so's dependencies are broken).
867     if test "$LBERLIBNAME" != "no" ; then
868       AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
869         AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
870         AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
871         AC_SUBST(CURL_DISABLE_LDAP, [1])])
872         AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
873         AC_SUBST(CURL_DISABLE_LDAPS, [1])
874     fi
875   fi
876 fi
877
878 if test x$CURL_DISABLE_LDAP != x1 ; then
879   AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
880
881   if test "$LDAPLIBNAME" = "wldap32"; then
882     curl_ldap_msg="enabled (winldap)"
883     AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
884   else
885     curl_ldap_msg="enabled (OpenLDAP)"
886     if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
887       AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
888       AC_SUBST(USE_OPENLDAP, [1])
889     fi
890   fi
891 fi
892
893 if test x$CURL_DISABLE_LDAPS != x1 ; then
894     curl_ldaps_msg="enabled"
895 fi
896
897 dnl **********************************************************************
898 dnl Checks for IPv6
899 dnl **********************************************************************
900
901 AC_MSG_CHECKING([whether to enable ipv6])
902 AC_ARG_ENABLE(ipv6,
903 AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
904 AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
905 [ case "$enableval" in
906   no)
907        AC_MSG_RESULT(no)
908        ipv6=no
909        ;;
910   *)   AC_MSG_RESULT(yes)
911        ipv6=yes
912        ;;
913   esac ],
914
915   AC_TRY_RUN([ /* is AF_INET6 available? */
916 #include <sys/types.h>
917 #include <sys/socket.h>
918 main()
919 {
920  if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
921    exit(1);
922  else
923    exit(0);
924 }
925 ],
926   AC_MSG_RESULT(yes)
927   ipv6=yes,
928   AC_MSG_RESULT(no)
929   ipv6=no,
930   AC_MSG_RESULT(no)
931   ipv6=no
932 ))
933
934 if test "$ipv6" = "yes"; then
935   curl_ipv6_msg="enabled"
936 fi
937
938 # Check if struct sockaddr_in6 have sin6_scope_id member
939 if test "$ipv6" = yes; then
940   AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
941   AC_TRY_COMPILE([
942 #include <sys/types.h>
943 #include <netinet/in.h>] ,
944   struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
945   if test "$have_sin6_scope_id" = yes; then
946     AC_MSG_RESULT([yes])
947     AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
948   else
949     AC_MSG_RESULT([no])
950   fi
951 fi
952
953 dnl **********************************************************************
954 dnl Check if the operating system allows programs to write to their own argv[]
955 dnl **********************************************************************
956
957 AC_MSG_CHECKING([if argv can be written to])
958 AC_RUN_IFELSE([
959   AC_LANG_SOURCE([[
960 int main(int argc, char ** argv) {
961     argv[0][0] = ' ';
962     return (argv[0][0] == ' ')?0:1;
963 }
964   ]])
965 ],[
966   curl_cv_writable_argv=yes
967 ],[
968   curl_cv_writable_argv=no
969 ],[
970   curl_cv_writable_argv=cross
971 ])
972 case $curl_cv_writable_argv in
973 yes)
974         AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
975         AC_MSG_RESULT(yes)
976         ;;
977 no)
978         AC_MSG_RESULT(no)
979         ;;
980 *)
981         AC_MSG_RESULT(no)
982         AC_MSG_WARN([the previous check could not be made default was used])
983         ;;
984 esac
985
986 dnl **********************************************************************
987 dnl Check for the presence of Kerberos4 libraries and headers
988 dnl **********************************************************************
989
990 AC_ARG_WITH(krb4-includes,
991 AC_HELP_STRING([--with-krb4-includes=DIR],
992                [Specify location of kerberos4 headers]),[
993  CPPFLAGS="$CPPFLAGS -I$withval"
994  KRB4INC="$withval"
995  want_krb4=yes
996  ])
997
998 AC_ARG_WITH(krb4-libs,
999 AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
1000  LDFLAGS="$LDFLAGS -L$withval"
1001  KRB4LIB="$withval"
1002  want_krb4=yes
1003  ])
1004
1005
1006 OPT_KRB4=off
1007 AC_ARG_WITH(krb4,dnl
1008 AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
1009   OPT_KRB4="$withval"
1010   if test X"$OPT_KRB4" != Xno; then
1011     want_krb4="yes"
1012     if test X"$OPT_KRB4" != Xyes; then
1013       LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
1014       KRB4LIB="$OPT_KRB4/lib$libsuff"
1015       CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
1016       KRB4INC="$OPT_KRB4/include"
1017     fi
1018   fi
1019  ])
1020
1021 AC_MSG_CHECKING([if Kerberos4 support is requested])
1022
1023 if test "$want_krb4" = yes
1024 then
1025   if test "$ipv6" = "yes"; then
1026     echo krb4 is not compatible with IPv6
1027     exit 1
1028   fi
1029   AC_MSG_RESULT(yes)
1030
1031   dnl Check for & handle argument to --with-krb4
1032
1033   AC_MSG_CHECKING(where to look for Kerberos4)
1034   if test X"$OPT_KRB4" = Xyes
1035   then
1036     AC_MSG_RESULT([defaults])
1037   else
1038     AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
1039   fi
1040
1041   dnl Check for DES library
1042   AC_CHECK_LIB(des, des_pcbc_encrypt,
1043   [
1044     AC_CHECK_HEADERS(des.h)
1045
1046     dnl resolv lib?
1047     AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
1048
1049     dnl Check for the Kerberos4 library
1050     AC_CHECK_LIB(krb, krb_net_read,
1051     [
1052       dnl Check for header files
1053       AC_CHECK_HEADERS(krb.h)
1054
1055       dnl we found the required libraries, add to LIBS
1056       LIBS="-lkrb -lcom_err -ldes $LIBS"
1057
1058       dnl Check for function krb_get_our_ip_for_realm
1059       dnl this is needed for NAT networks
1060       AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
1061
1062       dnl add define KRB4
1063       AC_DEFINE(HAVE_KRB4, 1,
1064       [if you have the Kerberos4 libraries (including -ldes)])
1065
1066       dnl substitute it too!
1067       KRB4_ENABLED=1
1068       AC_SUBST(KRB4_ENABLED)
1069
1070       curl_krb4_msg="enabled"
1071
1072       dnl the krb4 stuff needs a strlcpy()
1073       AC_CHECK_FUNCS(strlcpy)
1074
1075     ])
1076   ])
1077 else
1078   AC_MSG_RESULT(no)
1079 fi
1080
1081 dnl **********************************************************************
1082 dnl Check for FBopenssl(SPNEGO) libraries
1083 dnl **********************************************************************
1084
1085 AC_ARG_WITH(spnego,
1086   AC_HELP_STRING([--with-spnego=DIR],
1087                  [Specify location of SPNEGO library fbopenssl]), [
1088   SPNEGO_ROOT="$withval"
1089   if test x"$SPNEGO_ROOT" != xno; then
1090     want_spnego="yes"
1091   fi
1092 ])
1093
1094 AC_MSG_CHECKING([if SPNEGO support is requested])
1095 if test x"$want_spnego" = xyes; then
1096
1097   if test X"$SPNEGO_ROOT" = Xyes; then
1098      AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
1099      AC_MSG_RESULT(no)
1100   else
1101      if test -z "$SPNEGO_LIB_DIR"; then
1102         LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
1103      else
1104         LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
1105      fi
1106
1107      AC_MSG_RESULT(yes)
1108      AC_DEFINE(HAVE_SPNEGO, 1,
1109                [Define this if you have the SPNEGO library fbopenssl])
1110      curl_spnego_msg="enabled"
1111   fi
1112 else
1113   AC_MSG_RESULT(no)
1114 fi
1115
1116 dnl **********************************************************************
1117 dnl Check for GSS-API libraries
1118 dnl **********************************************************************
1119
1120 dnl check for gss stuff in the /usr as default
1121
1122 GSSAPI_ROOT="/usr"
1123 AC_ARG_WITH(gssapi-includes,
1124   AC_HELP_STRING([--with-gssapi-includes=DIR],
1125                  [Specify location of GSSAPI header]),
1126   [ GSSAPI_INCS="-I$withval"
1127     want_gss="yes" ]
1128 )
1129
1130 AC_ARG_WITH(gssapi-libs,
1131   AC_HELP_STRING([--with-gssapi-libs=DIR],
1132                  [Specify location of GSSAPI libs]),
1133   [ GSSAPI_LIB_DIR="-L$withval"
1134     want_gss="yes" ]
1135 )
1136
1137 AC_ARG_WITH(gssapi,
1138   AC_HELP_STRING([--with-gssapi=DIR],
1139                  [Where to look for GSSAPI]), [
1140   GSSAPI_ROOT="$withval"
1141   if test x"$GSSAPI_ROOT" != xno; then
1142     want_gss="yes"
1143     if test x"$GSSAPI_ROOT" = xyes; then
1144       dnl if yes, then use default root
1145       GSSAPI_ROOT="/usr"
1146     fi
1147   fi
1148 ])
1149
1150 save_CPPFLAGS="$CPPFLAGS"
1151 AC_MSG_CHECKING([if GSSAPI support is requested])
1152 if test x"$want_gss" = xyes; then
1153   AC_MSG_RESULT(yes)
1154
1155   if test -z "$GSSAPI_INCS"; then
1156      if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1157         GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
1158      elif test "$GSSAPI_ROOT" != "yes"; then
1159         GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1160      fi
1161   fi
1162
1163   CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1164
1165   AC_CHECK_HEADER(gss.h,
1166     [
1167       dnl found in the given dirs
1168       AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
1169       gnu_gss=yes
1170     ],
1171     [
1172       dnl not found, check Heimdal or MIT
1173       AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1174       AC_CHECK_HEADERS(
1175         [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1176         [],
1177         [not_mit=1],
1178         [
1179 AC_INCLUDES_DEFAULT
1180 #ifdef HAVE_GSSAPI_GSSAPI_H
1181 #include <gssapi/gssapi.h>
1182 #endif
1183         ])
1184       if test "x$not_mit" = "x1"; then
1185         dnl MIT not found, check for Heimdal
1186         AC_CHECK_HEADER(gssapi.h,
1187             [
1188               dnl found
1189               AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
1190             ],
1191             [
1192               dnl no header found, disabling GSS
1193               want_gss=no
1194               AC_MSG_WARN(disabling GSSAPI since no header files was found)
1195             ]
1196           )
1197       else
1198         dnl MIT found
1199         AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
1200         dnl check if we have a really old MIT kerberos (<= 1.2)
1201         AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1202         AC_COMPILE_IFELSE([
1203           AC_LANG_PROGRAM([[
1204 #include <gssapi/gssapi.h>
1205 #include <gssapi/gssapi_generic.h>
1206 #include <gssapi/gssapi_krb5.h>
1207           ]],[[
1208             gss_import_name(
1209                             (OM_uint32 *)0,
1210                             (gss_buffer_t)0,
1211                             GSS_C_NT_HOSTBASED_SERVICE,
1212                             (gss_name_t *)0);
1213           ]])
1214         ],[
1215           AC_MSG_RESULT([yes])
1216         ],[
1217           AC_MSG_RESULT([no])
1218           AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1219             [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1220         ])
1221       fi
1222     ]
1223   )
1224 else
1225   AC_MSG_RESULT(no)
1226 fi
1227 if test x"$want_gss" = xyes; then
1228   AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
1229
1230   curl_gss_msg="enabled (MIT/Heimdal)"
1231
1232   if test -n "$gnu_gss"; then
1233     curl_gss_msg="enabled (GNU GSS)"
1234     LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1235     LIBS="$LIBS -lgss"
1236   elif test -z "$GSSAPI_LIB_DIR"; then
1237      case $host in
1238      *-*-darwin*)
1239         LIBS="$LIBS -lgssapi_krb5 -lresolv"
1240         ;;
1241      *)
1242         if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1243            dnl krb5-config doesn't have --libs-only-L or similar, put everything
1244            dnl into LIBS
1245            gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1246            # LIBS="$LIBS $gss_libs"
1247            LIBS="$LIBS -lgssapi_krb5"
1248         elif test "$GSSAPI_ROOT" != "yes"; then
1249            LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1250            LIBS="$LIBS -lgssapi"
1251         else
1252            LIBS="$LIBS -lgssapi"
1253         fi
1254         ;;
1255      esac
1256   else
1257      LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1258      LIBS="$LIBS -lgssapi"
1259   fi
1260 else
1261   CPPFLAGS="$save_CPPFLAGS"
1262 fi
1263
1264 dnl **********************************************************************
1265 dnl Check for the presence of SSL libraries and headers
1266 dnl **********************************************************************
1267
1268 dnl Default to compiler & linker defaults for SSL files & libraries.
1269 OPT_SSL=off
1270 dnl Default to no CA bundle
1271 ca="no"
1272 AC_ARG_WITH(ssl,dnl
1273 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])
1274 AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
1275   OPT_SSL=$withval)
1276
1277 if test X"$OPT_SSL" != Xno; then
1278   dnl backup the pre-ssl variables
1279   CLEANLDFLAGS="$LDFLAGS"
1280   CLEANCPPFLAGS="$CPPFLAGS"
1281   CLEANLIBS="$LIBS"
1282
1283   case "$OPT_SSL" in
1284   yes)
1285     dnl --with-ssl (without path) used
1286     if test x$cross_compiling != xyes; then
1287       dnl only do pkg-config magic when not cross-compiling
1288       PKGTEST="yes"
1289     fi
1290     PREFIX_OPENSSL=/usr/local/ssl
1291     LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1292     ;;
1293   off)
1294     dnl no --with-ssl option given, just check default places
1295     if test x$cross_compiling != xyes; then
1296       dnl only do pkg-config magic when not cross-compiling
1297       PKGTEST="yes"
1298     fi
1299     PREFIX_OPENSSL=
1300     ;;
1301   *)
1302     dnl check the given --with-ssl spot
1303     PKGTEST="no"
1304     PREFIX_OPENSSL=$OPT_SSL
1305
1306     dnl Try pkg-config even when cross-compiling.  Since we
1307     dnl specify PKG_CONFIG_LIBDIR we're only looking where
1308     dnl the user told us to look
1309     OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
1310     AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
1311     if test -e "$OPENSSL_PCDIR/openssl.pc"; then
1312       PKGTEST="yes"
1313     fi
1314
1315     dnl in case pkg-config comes up empty, use what we got
1316     dnl via --with-ssl
1317     LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
1318     if test "$PREFIX_OPENSSL" != "/usr" ; then
1319       SSL_LDFLAGS="-L$LIB_OPENSSL"
1320       SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
1321     fi
1322     SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
1323     ;;
1324   esac
1325
1326   if test "$PKGTEST" = "yes"; then
1327
1328     CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
1329
1330     if test "$PKGCONFIG" != "no" ; then
1331       SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1332         $PKGCONFIG --libs-only-l openssl 2>/dev/null`
1333
1334       SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1335         $PKGCONFIG --libs-only-L openssl 2>/dev/null`
1336
1337       SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
1338         $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
1339
1340       AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
1341       AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
1342       AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
1343
1344       LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
1345
1346       dnl use the values pkg-config reported.  This is here
1347       dnl instead of below with CPPFLAGS and LDFLAGS because we only
1348       dnl learn about this via pkg-config.  If we only have
1349       dnl the argument to --with-ssl we don't know what
1350       dnl additional libs may be necessary.  Hope that we
1351       dnl don't need any.
1352       LIBS="$LIBS $SSL_LIBS"
1353     fi
1354   fi
1355
1356   dnl finally, set flags to use SSL
1357   CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
1358   LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
1359
1360   dnl This is for Msys/Mingw
1361   case $host in
1362     *-*-msys* | *-*-mingw*)
1363       AC_MSG_CHECKING([for gdi32])
1364       my_ac_save_LIBS=$LIBS
1365       LIBS="-lgdi32 $LIBS"
1366       AC_TRY_LINK([#include <windef.h>
1367                    #include <wingdi.h>],
1368                    [GdiFlush();],
1369                    [ dnl worked!
1370                    AC_MSG_RESULT([yes])],
1371                    [ dnl failed, restore LIBS
1372                    LIBS=$my_ac_save_LIBS
1373                    AC_MSG_RESULT(no)]
1374                   )
1375       ;;
1376   esac
1377
1378   AC_CHECK_LIB(crypto, CRYPTO_lock,[
1379      HAVECRYPTO="yes"
1380      LIBS="-lcrypto $LIBS"
1381      ],[
1382      LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
1383      CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
1384      AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
1385        HAVECRYPTO="yes"
1386        LIBS="-lcrypto $LIBS"], [
1387        LDFLAGS="$CLEANLDFLAGS"
1388        CPPFLAGS="$CLEANCPPFLAGS"
1389        LIBS="$CLEANLIBS"
1390        ])
1391     ])
1392
1393
1394   if test X"$HAVECRYPTO" = X"yes"; then
1395     dnl This is only reasonable to do if crypto actually is there: check for
1396     dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
1397
1398     AC_CHECK_LIB(ssl, SSL_connect)
1399
1400     if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1401         dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
1402         AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
1403         OLIBS=$LIBS
1404         LIBS="$LIBS -lRSAglue -lrsaref"
1405         AC_CHECK_LIB(ssl, SSL_connect)
1406         if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
1407             dnl still no SSL_connect
1408             AC_MSG_RESULT(no)
1409             LIBS=$OLIBS
1410         else
1411             AC_MSG_RESULT(yes)
1412         fi
1413
1414     else
1415
1416       dnl Have the libraries--check for SSLeay/OpenSSL headers
1417       AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
1418                        openssl/pem.h openssl/ssl.h openssl/err.h,
1419         curl_ssl_msg="enabled (OpenSSL)"
1420         OPENSSL_ENABLED=1
1421         AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
1422
1423       if test $ac_cv_header_openssl_x509_h = no; then
1424         dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
1425         dnl since 'err.h' might in fact find a krb4 header with the same
1426         dnl name
1427         AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
1428
1429         if test $ac_cv_header_x509_h = yes &&
1430            test $ac_cv_header_crypto_h = yes &&
1431            test $ac_cv_header_ssl_h = yes; then
1432           dnl three matches
1433           curl_ssl_msg="enabled (OpenSSL)"
1434           OPENSSL_ENABLED=1
1435         fi
1436       fi
1437     fi
1438
1439     if test X"$OPENSSL_ENABLED" = X"1"; then
1440        AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
1441
1442        dnl is there a pkcs12.h header present?
1443        AC_CHECK_HEADERS(openssl/pkcs12.h)
1444     else
1445        LIBS="$CLEANLIBS"
1446     fi
1447     dnl USE_SSLEAY is the historical name for what configure calls
1448     dnl OPENSSL_ENABLED; the names should really be unified
1449     USE_SSLEAY="$OPENSSL_ENABLED"
1450     AC_SUBST(USE_SSLEAY)
1451
1452     if test X"$OPT_SSL" != Xoff &&
1453        test "$OPENSSL_ENABLED" != "1"; then
1454       AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
1455     fi
1456   fi
1457
1458   if test X"$OPENSSL_ENABLED" = X"1"; then
1459     dnl If the ENGINE library seems to be around, check for the OpenSSL engine
1460     dnl stuff, it is kind of "separated" from the main SSL check
1461     AC_CHECK_FUNC(ENGINE_init,
1462               [
1463                 AC_CHECK_HEADERS(openssl/engine.h)
1464                 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
1465               ])
1466
1467     dnl these can only exist if openssl exists
1468     dnl yassl doesn't have SSL_get_shutdown
1469
1470     AC_CHECK_FUNCS( RAND_status \
1471                     RAND_screen \
1472                     RAND_egd \
1473                     ENGINE_cleanup \
1474                     CRYPTO_cleanup_all_ex_data \
1475                     SSL_get_shutdown )
1476
1477     dnl Make an attempt to detect if this is actually yassl's headers and
1478     dnl OpenSSL emulation layer. We still leave everything else believing
1479     dnl and acting like OpenSSL.
1480
1481     AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
1482     AC_COMPILE_IFELSE([
1483       AC_LANG_PROGRAM([[
1484 #include <openssl/ssl.h>
1485       ]],[[
1486 #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
1487         int dummy = SSL_ERROR_NONE;
1488 #else
1489         Not the yaSSL OpenSSL compatibility header.
1490 #endif
1491       ]])
1492     ],[
1493       AC_MSG_RESULT([yes])
1494       AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
1495         [Define to 1 if using yaSSL in OpenSSL compatibility mode.])
1496       curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
1497     ],[
1498       AC_MSG_RESULT([no])
1499     ])
1500   fi
1501
1502   if test "$OPENSSL_ENABLED" = "1"; then
1503     if test -n "$LIB_OPENSSL"; then
1504        dnl when the ssl shared libs were found in a path that the run-time
1505        dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
1506        dnl to prevent further configure tests to fail due to this
1507
1508        LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
1509        export LD_LIBRARY_PATH
1510        AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
1511     fi
1512   fi
1513
1514 fi
1515
1516 dnl **********************************************************************
1517 dnl Check for the presence of ZLIB libraries and headers
1518 dnl **********************************************************************
1519
1520 dnl Check for & handle argument to --with-zlib.
1521
1522 _cppflags=$CPPFLAGS
1523 _ldflags=$LDFLAGS
1524 AC_ARG_WITH(zlib,
1525 AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1526 AC_HELP_STRING([--without-zlib],[disable use of zlib]),
1527                [OPT_ZLIB="$withval"])
1528
1529 if test "$OPT_ZLIB" = "no" ; then
1530     AC_MSG_WARN([zlib disabled])
1531 else
1532   if test "$OPT_ZLIB" = "yes" ; then
1533      OPT_ZLIB=""
1534   fi
1535
1536   if test -z "$OPT_ZLIB" ; then
1537     dnl check for the lib first without setting any new path, since many
1538     dnl people have it in the default path
1539
1540     AC_CHECK_LIB(z, inflateEnd,
1541                    dnl libz found, set the variable
1542                    [HAVE_LIBZ="1"],
1543                    dnl if no lib found, try /usr/local
1544                    [OPT_ZLIB="/usr/local"])
1545
1546   fi
1547
1548   dnl Add a nonempty path to the compiler flags
1549   if test -n "$OPT_ZLIB"; then
1550      CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1551      LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1552   fi
1553
1554   AC_CHECK_HEADER(zlib.h,
1555     [
1556     dnl zlib.h was found
1557     HAVE_ZLIB_H="1"
1558     dnl if the lib wasn't found already, try again with the new paths
1559     if test "$HAVE_LIBZ" != "1"; then
1560       AC_CHECK_LIB(z, gzread,
1561                    [
1562                    dnl the lib was found!
1563                    HAVE_LIBZ="1"
1564                    ],
1565                    [ CPPFLAGS=$_cppflags
1566                    LDFLAGS=$_ldflags])
1567     fi
1568     ],
1569     [
1570       dnl zlib.h was not found, restore the flags
1571       CPPFLAGS=$_cppflags
1572       LDFLAGS=$_ldflags]
1573     )
1574
1575   if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1576   then
1577     AC_MSG_WARN([configure found only the libz lib, not the header file!])
1578     HAVE_LIBZ=""
1579   elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1580   then
1581     AC_MSG_WARN([configure found only the libz header file, not the lib!])
1582   elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1583   then
1584     dnl both header and lib were found!
1585     AC_SUBST(HAVE_LIBZ)
1586     AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1587     AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1588
1589     CURL_LIBS="$CURL_LIBS -lz"
1590     LIBS="$LIBS -lz"
1591
1592     dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1593     AMFIXLIB="1"
1594     AC_MSG_NOTICE([found both libz and libz.h header])
1595     curl_zlib_msg="enabled"
1596   fi
1597 fi
1598
1599 dnl set variable for use in automakefile(s)
1600 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1601
1602 dnl **********************************************************************
1603 dnl Check for the random seed preferences
1604 dnl **********************************************************************
1605
1606 if test X"$OPENSSL_ENABLED" = X"1"; then
1607   AC_ARG_WITH(egd-socket,
1608   AC_HELP_STRING([--with-egd-socket=FILE],
1609                  [Entropy Gathering Daemon socket pathname]),
1610       [ EGD_SOCKET="$withval" ]
1611   )
1612   if test -n "$EGD_SOCKET" ; then
1613           AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
1614           [your Entropy Gathering Daemon socket pathname] )
1615   fi
1616
1617   dnl Check for user-specified random device
1618   AC_ARG_WITH(random,
1619   AC_HELP_STRING([--with-random=FILE],
1620                  [read randomness from FILE (default=/dev/urandom)]),
1621       [ RANDOM_FILE="$withval" ],
1622       [
1623           dnl Check for random device
1624           AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1625       ]
1626   )
1627   if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1628           AC_SUBST(RANDOM_FILE)
1629           AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1630           [a suitable file to read random data from])
1631   fi
1632 fi
1633
1634 dnl ----------------------------------------------------
1635 dnl check for GnuTLS
1636 dnl ----------------------------------------------------
1637
1638 dnl Default to compiler & linker defaults for GnuTLS files & libraries.
1639 OPT_GNUTLS=no
1640
1641 AC_ARG_WITH(gnutls,dnl
1642 AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root (default: /usr/local/)])
1643 AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
1644   OPT_GNUTLS=$withval)
1645
1646 if test "$OPENSSL_ENABLED" != "1"; then
1647
1648   if test X"$OPT_GNUTLS" != Xno; then
1649
1650     addld=""
1651     if test "x$OPT_GNUTLS" = "xyes"; then
1652       dnl this is with no partiular path given
1653       CURL_CHECK_PKGCONFIG(gnutls)
1654
1655       if test "$PKGCONFIG" != "no" ; then
1656         addlib=`$PKGCONFIG --libs-only-l gnutls`
1657         addld=`$PKGCONFIG --libs-only-L gnutls`
1658         addcflags=`$PKGCONFIG --cflags-only-I gnutls`
1659         version=`$PKGCONFIG --modversion gnutls`
1660         gtlslib=`echo $addld | $SED -e 's/-L//'`
1661       else
1662         dnl without pkg-config, we try libgnutls-config as that was how it
1663         dnl used to be done
1664         check=`libgnutls-config --version 2>/dev/null`
1665         if test -n "$check"; then
1666           addlib=`libgnutls-config --libs`
1667           addcflags=`libgnutls-config --cflags`
1668           version=`libgnutls-config --version`
1669           gtlslib=`libgnutls-config --prefix`/lib$libsuff
1670         fi
1671       fi
1672     else
1673       dnl this is with a given path, first check if there's a libgnutls-config
1674       dnl there and if not, make an educated guess
1675       cfg=$OPT_GNUTLS/bin/libgnutls-config
1676       check=`$cfg --version 2>/dev/null`
1677       if test -n "$check"; then
1678         addlib=`$cfg --libs`
1679         addcflags=`$cfg --cflags`
1680         version=`$cfg --version`
1681         gtlslib=`$cfg --prefix`/lib$libsuff
1682       else
1683         dnl without pkg-config and libgnutls-config, we guess a lot!
1684         addlib=-lgnutls
1685         addld=-L$OPT_GNUTLS/lib$libsuff
1686         addcflags=-I$OPT_GNUTLS/include
1687         version="" # we just don't know
1688         gtlslib=$OPT_GNUTLS/lib$libsuff
1689       fi
1690     fi
1691
1692     if test -z "$version"; then
1693       dnl lots of efforts, still no go
1694       version="unknown"
1695     fi
1696
1697     if test -n "$addlib"; then
1698
1699       CLEANLIBS="$LIBS"
1700       CLEANCPPFLAGS="$CPPFLAGS"
1701       CLEADLDFLAGS="$LDFLAGS"
1702
1703       LIBS="$LIBS $addlib"
1704       LDFLAGS="$LDFLAGS $addld"
1705       if test "$addcflags" != "-I/usr/include"; then
1706          CPPFLAGS="$CPPFLAGS $addcflags"
1707       fi
1708
1709       AC_CHECK_LIB(gnutls, gnutls_check_version,
1710        [
1711        AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
1712        AC_SUBST(USE_GNUTLS, [1])
1713        GNUTLS_ENABLED=1
1714        USE_GNUTLS="yes"
1715        curl_ssl_msg="enabled (GnuTLS)"
1716        ],
1717        [
1718          LIBS="$CLEANLIBS"
1719          CPPFLAGS="$CLEANCPPFLAGS"
1720        ])
1721
1722       if test "x$USE_GNUTLS" = "xyes"; then
1723         AC_MSG_NOTICE([detected GnuTLS version $version])
1724
1725         if test -n "$gtlslib"; then
1726           dnl when shared libs were found in a path that the run-time
1727           dnl linker doesn't search through, we need to add it to
1728           dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1729           dnl due to this
1730
1731           LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
1732           export LD_LIBRARY_PATH
1733           AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
1734         fi
1735       fi
1736
1737     fi
1738
1739   fi dnl GNUTLS not disabled
1740
1741 fi dnl OPENSSL != 1
1742
1743 dnl ---
1744 dnl If GnuTLS is enabled, we MUST verify that it uses libgcrypt since
1745 dnl curl code relies on that but recent GnuTLS versions can in fact build
1746 dnl with different crypto libraries which curl right now cannot handle
1747 dnl ---
1748
1749 if test "$GNUTLS_ENABLED" = "1"; then
1750   AC_CHECK_LIB(gcrypt,
1751                gcry_control, ,
1752     [
1753       AC_MSG_ERROR([need GnuTLS built with gcrypt to function with GnuTLS])
1754     ])
1755 fi
1756
1757 dnl ----------------------------------------------------
1758 dnl check for PolarSSL
1759 dnl ----------------------------------------------------
1760
1761 dnl Default to compiler & linker defaults for PolarSSL files & libraries.
1762 OPT_POLARSSL=no
1763
1764 _cppflags=$CPPFLAGS
1765 _ldflags=$LDFLAGS
1766 AC_ARG_WITH(polarssl,dnl
1767 AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root (default: /usr/local/)])
1768 AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
1769   OPT_POLARSSL=$withval)
1770
1771 if test "$OPENSSL_ENABLED" != "1"; then
1772
1773   if test X"$OPT_POLARSSL" != Xno; then
1774
1775     if test "$OPT_POLARSSL" = "yes"; then
1776       OPT_POLARSSL=""
1777     fi
1778
1779     if test -z "$OPT_POLARSSL" ; then
1780       dnl check for lib first without setting any new path
1781
1782       AC_CHECK_LIB(polarssl, havege_init,
1783       dnl libpolarssl found, set the variable
1784        [
1785          AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
1786          AC_SUBST(USE_POLARSSL, [1])
1787          POLARSSL_ENABLED=1
1788          USE_POLARSSL="yes"
1789          curl_ssl_msg="enabled (PolarSSL)"
1790         ])
1791     fi
1792
1793     if test "x$USE_POLARSSL" != "xyes"; then
1794       dnl add the path and test again
1795       addld=-L$OPT_POLARSSL/lib$libsuff
1796       addcflags=-I$OPT_POLARSSL/include
1797       polarssllib=$OPT_POLARSSL/lib$libsuff
1798
1799       LDFLAGS="$LDFLAGS $addld"
1800       if test "$addcflags" != "-I/usr/include"; then
1801          CPPFLAGS="$CPPFLAGS $addcflags"
1802       fi
1803
1804       AC_CHECK_LIB(polarssl, ssl_init,
1805        [
1806        AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
1807        AC_SUBST(USE_POLARSSL, [1])
1808        POLARSSL_ENABLED=1
1809        USE_POLARSSL="yes"
1810        curl_ssl_msg="enabled (PolarSSL)"
1811        ],
1812        [
1813          CPPFLAGS=$_cppflags
1814          LDFLAGS=$_ldflags
1815        ])
1816     fi
1817
1818     if test "x$USE_POLARSSL" = "xyes"; then
1819       AC_MSG_NOTICE([detected PolarSSL])
1820
1821       CURL_LIBS="$CURL_LIBS -lpolarssl"
1822       LIBS="$LIBS -lpolarssl"
1823
1824       if test -n "$polarssllib"; then
1825         dnl when shared libs were found in a path that the run-time
1826         dnl linker doesn't search through, we need to add it to
1827         dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1828         dnl due to this
1829
1830         LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
1831         export LD_LIBRARY_PATH
1832         AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
1833       fi
1834
1835     fi
1836
1837   fi dnl PolarSSL not disabled
1838
1839 fi dnl OPENSSL != 1
1840
1841 dnl ----------------------------------------------------
1842 dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
1843 dnl ----------------------------------------------------
1844
1845 dnl Default to compiler & linker defaults for NSS files & libraries.
1846 OPT_NSS=no
1847
1848 AC_ARG_WITH(nss,dnl
1849 AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root (default: /usr/local/)])
1850 AC_HELP_STRING([--without-nss], [disable NSS detection]),
1851   OPT_NSS=$withval)
1852
1853 if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
1854
1855   if test X"$OPT_NSS" != Xno; then
1856     if test "x$OPT_NSS" = "xyes"; then
1857
1858       CURL_CHECK_PKGCONFIG(nss)
1859
1860       if test "$PKGCONFIG" != "no" ; then
1861         addlib=`$PKGCONFIG --libs nss`
1862         addcflags=`$PKGCONFIG --cflags nss`
1863         version=`$PKGCONFIG --modversion nss`
1864         nssprefix=`$PKGCONFIG --variable=prefix nss`
1865       else
1866         dnl Without pkg-config, we check for nss-config
1867
1868         check=`nss-config --version 2>/dev/null`
1869         if test -n "$check"; then
1870           addlib=`nss-config --libs`
1871           addcflags=`nss-config --cflags`
1872           version=`nss-config --version`
1873           nssprefix=`nss-config --prefix`
1874         else
1875           addlib="-lnss3"
1876           addcflags=""
1877           version="unknown"
1878         fi
1879       fi
1880     else
1881         # Without pkg-config, we'll kludge in some defaults
1882         addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
1883         addcflags="-I$OPT_NSS/include"
1884         version="unknown"
1885         nssprefix=$OPT_NSS
1886     fi
1887
1888     dnl Check for functionPK11_CreateGenericObject
1889     dnl this is needed for using the PEM PKCS#11 module
1890     AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
1891      [
1892      AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject])
1893      AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1])
1894      ])
1895     if test -n "$addlib"; then
1896
1897       CLEANLIBS="$LIBS"
1898       CLEANCPPFLAGS="$CPPFLAGS"
1899
1900       LIBS="$LIBS $addlib"
1901       if test "$addcflags" != "-I/usr/include"; then
1902          CPPFLAGS="$CPPFLAGS $addcflags"
1903       fi
1904
1905       AC_CHECK_LIB(nss3, NSS_Initialize,
1906        [
1907        AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
1908        AC_SUBST(USE_NSS, [1])
1909        USE_NSS="yes"
1910        NSS_ENABLED=1
1911        curl_ssl_msg="enabled (NSS)"
1912        ],
1913        [
1914          LIBS="$CLEANLIBS"
1915          CPPFLAGS="$CLEANCPPFLAGS"
1916        ])
1917
1918       if test "x$USE_NSS" = "xyes"; then
1919         AC_MSG_NOTICE([detected NSS version $version])
1920
1921         dnl when shared libs were found in a path that the run-time
1922         dnl linker doesn't search through, we need to add it to
1923         dnl LD_LIBRARY_PATH to prevent further configure tests to fail
1924         dnl due to this
1925
1926         LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
1927         export LD_LIBRARY_PATH
1928         AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
1929       fi
1930
1931     fi
1932
1933   fi dnl NSS not disabled
1934
1935 fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
1936
1937 if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED" = "x"; then
1938   AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
1939   AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl or --with-nss to address this.])
1940 else
1941   # SSL is enabled, genericly
1942   AC_SUBST(SSL_ENABLED)
1943   SSL_ENABLED="1"
1944 fi
1945
1946 dnl **********************************************************************
1947 dnl Check for the CA bundle
1948 dnl **********************************************************************
1949
1950 CURL_CHECK_CA_BUNDLE
1951
1952 dnl **********************************************************************
1953 dnl Check for the presence of LIBSSH2 libraries and headers
1954 dnl **********************************************************************
1955
1956 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
1957 OPT_LIBSSH2=off
1958 AC_ARG_WITH(libssh2,dnl
1959 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])
1960 AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
1961   OPT_LIBSSH2=$withval)
1962
1963 if test X"$OPT_LIBSSH2" != Xno; then
1964   dnl backup the pre-libssh2 variables
1965   CLEANLDFLAGS="$LDFLAGS"
1966   CLEANCPPFLAGS="$CPPFLAGS"
1967   CLEANLIBS="$LIBS"
1968
1969   case "$OPT_LIBSSH2" in
1970   yes)
1971     dnl --with-libssh2 (without path) used
1972     CURL_CHECK_PKGCONFIG(libssh2)
1973
1974     if test "$PKGCONFIG" != "no" ; then
1975       LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
1976       LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
1977       CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
1978       version=`$PKGCONFIG --modversion libssh2`
1979       DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
1980     fi
1981
1982     ;;
1983   off)
1984     dnl no --with-libssh2 option given, just check default places
1985     ;;
1986   *)
1987     dnl use the given --with-libssh2 spot
1988     PREFIX_SSH2=$OPT_LIBSSH2
1989     ;;
1990   esac
1991
1992   dnl if given with a prefix, we set -L and -I based on that
1993   if test -n "$PREFIX_SSH2"; then
1994     LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
1995     CPP_SSH2=-I${PREFIX_SSH2}/include
1996     DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
1997   fi
1998
1999   LDFLAGS="$LDFLAGS $LD_SSH2"
2000   CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2001   LIBS="$LIBS $LIB_SSH2"
2002
2003   AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
2004
2005   AC_CHECK_HEADERS(libssh2.h,
2006     curl_ssh_msg="enabled (libSSH2)"
2007     LIBSSH2_ENABLED=1
2008     AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2009     AC_SUBST(USE_LIBSSH2, [1])
2010   )
2011
2012   if test X"$OPT_LIBSSH2" != Xoff &&
2013      test "$LIBSSH2_ENABLED" != "1"; then
2014     AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2015   fi
2016
2017   if test "$LIBSSH2_ENABLED" = "1"; then
2018     if test -n "$DIR_SSH2"; then
2019        dnl when the libssh2 shared libs were found in a path that the run-time
2020        dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
2021        dnl to prevent further configure tests to fail due to this
2022
2023        dnl libssh2_version is a post 1.0 addition
2024        dnl libssh2_init and libssh2_exit were added in 1.2.5
2025        dnl libssh2_scp_send64 was added in 1.2.6
2026        dnl libssh2_session_handshake was added in 1.2.8
2027        AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
2028                        libssh2_scp_send64 libssh2_session_handshake)
2029
2030        LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
2031        export LD_LIBRARY_PATH
2032        AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH])
2033     fi
2034   else
2035     dnl no libssh2, revert back to clean variables
2036     LDFLAGS=$CLEANLDFLAGS
2037     CPPFLAGS=$CLEANCPPFLAGS
2038     LIBS=$CLEANLIBS
2039   fi
2040 fi
2041
2042 dnl **********************************************************************
2043 dnl Check for the presence of LIBRTMP libraries and headers
2044 dnl **********************************************************************
2045
2046 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2047 OPT_LIBRTMP=off
2048 AC_ARG_WITH(librtmp,dnl
2049 AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation (default: /usr/local/lib); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2050 AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2051   OPT_LIBRTMP=$withval)
2052
2053 if test X"$OPT_LIBRTMP" != Xno; then
2054   dnl backup the pre-librtmp variables
2055   CLEANLDFLAGS="$LDFLAGS"
2056   CLEANCPPFLAGS="$CPPFLAGS"
2057   CLEANLIBS="$LIBS"
2058
2059   case "$OPT_LIBRTMP" in
2060   yes)
2061     dnl --with-librtmp (without path) used
2062     CURL_CHECK_PKGCONFIG(librtmp)
2063
2064     if test "$PKGCONFIG" != "no" ; then
2065       LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2066       LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2067       CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2068       version=`$PKGCONFIG --modversion librtmp`
2069       DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
2070     else
2071       dnl To avoid link errors, we do not allow --librtmp without
2072       dnl a pkgconfig file
2073       AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2074     fi
2075
2076     ;;
2077   off)
2078     dnl no --with-librtmp option given, just check default places
2079     LIB_RTMP="-lrtmp"
2080     ;;
2081   *)
2082     dnl use the given --with-librtmp spot
2083     PREFIX_RTMP=$OPT_LIBRTMP
2084     ;;
2085   esac
2086
2087   dnl if given with a prefix, we set -L and -I based on that
2088   if test -n "$PREFIX_RTMP"; then
2089     LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
2090     CPP_RTMP=-I${PREFIX_RTMP}/include
2091     DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
2092   fi
2093
2094   LDFLAGS="$LDFLAGS $LD_RTMP"
2095   CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2096   LIBS="$LIBS $LIB_RTMP"
2097
2098   AC_CHECK_LIB(rtmp, RTMP_Init,
2099     [
2100      AC_CHECK_HEADERS(librtmp/rtmp.h,
2101         curl_rtmp_msg="enabled (librtmp)"
2102         LIBRTMP_ENABLED=1
2103         AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
2104         AC_SUBST(USE_LIBRTMP, [1])
2105      )
2106     ],
2107       dnl not found, revert back to clean variables
2108       LDFLAGS=$CLEANLDFLAGS
2109       CPPFLAGS=$CLEANCPPFLAGS
2110       LIBS=$CLEANLIBS
2111   )
2112
2113   if test X"$OPT_LIBRTMP" != Xoff &&
2114      test "$LIBRTMP_ENABLED" != "1"; then
2115     AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
2116   fi
2117
2118 fi
2119
2120 dnl **********************************************************************
2121 dnl Check for linker switch for versioned symbols
2122 dnl **********************************************************************
2123
2124 AC_MSG_CHECKING([if libraries can be versioned])
2125 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
2126 if test -z "$GLD"; then
2127     versioned_symbols_flavour=
2128     AC_MSG_RESULT(no)
2129     AC_MSG_WARN(***
2130 *** You may want to rerun configure using --with-gnu-ld to enable versioned symbols.
2131 )
2132 else
2133     AC_MSG_RESULT(yes)
2134
2135 AC_MSG_CHECKING([whether versioned symbols are wanted])
2136 versioned_symbols_flavour=
2137
2138 AC_ARG_ENABLE(versioned-symbols,
2139 AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2140 AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2141 [ case "$enableval" in
2142   yes) AC_MSG_RESULT(yes)
2143            if test "$OPENSSL_ENABLED" = "1"; then
2144                    versioned_symbols_flavour="OPENSSL_"
2145            else
2146                    if test "$OPT_GNUTLS" != "no"; then
2147                            versioned_symbols_flavour="GNUTLS_"
2148                    fi
2149            fi
2150            versioned_symbols="yes"
2151            ;;
2152
2153   *)   AC_MSG_RESULT(no)
2154            ;;
2155   esac
2156 ], [
2157 AC_MSG_RESULT(no)
2158 ]
2159 )
2160 fi
2161
2162 AC_SUBST(VERSIONED_FLAVOUR, ["$versioned_symbols_flavour"])
2163 AM_CONDITIONAL(VERSIONED_SYMBOLS, test "$versioned_symbols" = "yes")
2164
2165
2166 dnl **********************************************************************
2167 dnl Check for the presence of IDN libraries and headers
2168 dnl **********************************************************************
2169
2170 AC_MSG_CHECKING([whether to build with libidn])
2171 AC_ARG_WITH(libidn,
2172 AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
2173 AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
2174   [LIBIDN="$withval"])
2175
2176 case "$LIBIDN" in
2177   no)
2178        AC_MSG_RESULT(no)
2179        ;;
2180   *)   AC_MSG_RESULT(yes)
2181
2182        idn=""
2183        dnl if there is a given path, check that FIRST
2184        if test -n "$LIBIDN"; then
2185          if test "x$LIBIDN" != "xyes"; then
2186             oldLDFLAGS=$LDFLAGS
2187             oldCPPFLAGS=$CPPFLAGS
2188             LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
2189             CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
2190             idn="yes"
2191             AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
2192                          idn=""
2193                          LDFLAGS=$oldLDFLAGS
2194                          CPPFLAGS=$oldCPPFLAGS)
2195          fi
2196        fi
2197
2198        if test "x$idn" != "xyes"; then
2199           dnl check with default paths
2200           idn="yes"
2201           AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
2202                        idn="")
2203        fi
2204
2205        if test "x$idn" = "xyes"; then
2206          curl_idn_msg="enabled"
2207          AC_SUBST(IDN_ENABLED, [1])
2208          dnl different versions of libidn have different setups of these:
2209          AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
2210          AC_CHECK_HEADERS( idn-free.h tld.h )
2211        fi
2212
2213        ;;
2214 esac
2215
2216
2217 dnl Let's hope this split URL remains working:
2218 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
2219 dnl genprogc/thread_quick_ref.htm
2220
2221
2222 dnl **********************************************************************
2223 dnl Back to "normal" configuring
2224 dnl **********************************************************************
2225
2226 dnl Checks for header files.
2227 AC_HEADER_STDC
2228
2229 CURL_CHECK_HEADER_MALLOC
2230 CURL_CHECK_HEADER_MEMORY
2231
2232 dnl Now check for the very most basic headers. Then we can use these
2233 dnl ones as default-headers when checking for the rest!
2234 AC_CHECK_HEADERS(
2235         sys/types.h \
2236         sys/time.h \
2237         sys/select.h \
2238         sys/socket.h \
2239         sys/ioctl.h \
2240         sys/uio.h \
2241         assert.h \
2242         unistd.h \
2243         stdlib.h \
2244         limits.h \
2245         arpa/inet.h \
2246         net/if.h \
2247         netinet/in.h \
2248         sys/un.h \
2249         netinet/tcp.h \
2250         netdb.h \
2251         sys/sockio.h \
2252         sys/stat.h \
2253         sys/param.h \
2254         termios.h \
2255         termio.h \
2256         sgtty.h \
2257         fcntl.h \
2258         alloca.h \
2259         time.h \
2260         io.h \
2261         pwd.h \
2262         utime.h \
2263         sys/utime.h \
2264         sys/poll.h \
2265         poll.h \
2266         socket.h \
2267         sys/resource.h \
2268         libgen.h \
2269         locale.h \
2270         errno.h \
2271         stdbool.h \
2272         arpa/tftp.h \
2273         sys/filio.h \
2274         setjmp.h,
2275 dnl to do if not found
2276 [],
2277 dnl to do if found
2278 [],
2279 dnl default includes
2280 [
2281 #ifdef HAVE_SYS_TYPES_H
2282 #include <sys/types.h>
2283 #endif
2284 #ifdef HAVE_SYS_TIME_H
2285 #include <sys/time.h>
2286 #endif
2287 #ifdef HAVE_SYS_SELECT_H
2288 #include <sys/select.h>
2289 #endif
2290 #ifdef HAVE_SYS_SOCKET_H
2291 #include <sys/socket.h>
2292 #endif
2293 #ifdef HAVE_NETINET_IN_H
2294 #include <netinet/in.h>
2295 #endif
2296 #ifdef HAVE_SYS_UN_H
2297 #include <sys/un.h>
2298 #endif
2299 ]
2300 )
2301
2302 dnl Checks for typedefs, structures, and compiler characteristics.
2303 AC_C_CONST
2304 CURL_CHECK_VARIADIC_MACROS
2305 AC_TYPE_SIZE_T
2306 AC_HEADER_TIME
2307 CURL_CHECK_STRUCT_TIMEVAL
2308 CURL_VERIFY_RUNTIMELIBS
2309
2310 AC_CHECK_SIZEOF(size_t)
2311 AC_CHECK_SIZEOF(long)
2312 AC_CHECK_SIZEOF(int)
2313 AC_CHECK_SIZEOF(short)
2314 CURL_CONFIGURE_LONG
2315 AC_CHECK_SIZEOF(time_t)
2316 AC_CHECK_SIZEOF(off_t)
2317
2318 soname_bump=no
2319 if test x"$ac_cv_native_windows" != "xyes" &&
2320    test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
2321   AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
2322   AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
2323   soname_bump=yes
2324 fi
2325
2326
2327 AC_CHECK_TYPE(long long,
2328    [AC_DEFINE(HAVE_LONGLONG, 1,
2329       [Define to 1 if the compiler supports the 'long long' data type.])]
2330    longlong="yes"
2331 )
2332
2333 if test "xyes" = "x$longlong"; then
2334   AC_MSG_CHECKING([if numberLL works])
2335   AC_COMPILE_IFELSE([
2336     AC_LANG_PROGRAM([[
2337     ]],[[
2338       long long val = 1000LL;
2339     ]])
2340   ],[
2341     AC_MSG_RESULT([yes])
2342     AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
2343   ],[
2344     AC_MSG_RESULT([no])
2345   ])
2346 fi
2347
2348
2349 # check for ssize_t
2350 AC_CHECK_TYPE(ssize_t, ,
2351    AC_DEFINE(ssize_t, int, [the signed version of size_t]))
2352
2353 # check for bool type
2354 AC_CHECK_TYPE([bool],[
2355   AC_DEFINE(HAVE_BOOL_T, 1,
2356     [Define to 1 if bool is an available type.])
2357 ], ,[
2358 #ifdef HAVE_SYS_TYPES_H
2359 #include <sys/types.h>
2360 #endif
2361 #ifdef HAVE_STDBOOL_H
2362 #include <stdbool.h>
2363 #endif
2364 ])
2365
2366 CURL_CONFIGURE_CURL_SOCKLEN_T
2367
2368 TYPE_IN_ADDR_T
2369
2370 TYPE_SOCKADDR_STORAGE
2371
2372 TYPE_SIG_ATOMIC_T
2373
2374 AC_TYPE_SIGNAL
2375
2376 CURL_CHECK_FUNC_SELECT
2377
2378 CURL_CHECK_FUNC_RECV
2379 CURL_CHECK_FUNC_RECVFROM
2380 CURL_CHECK_FUNC_SEND
2381 CURL_CHECK_MSG_NOSIGNAL
2382
2383 CURL_CHECK_FUNC_ALARM
2384 CURL_CHECK_FUNC_BASENAME
2385 CURL_CHECK_FUNC_CLOSESOCKET
2386 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
2387 CURL_CHECK_FUNC_CONNECT
2388 CURL_CHECK_FUNC_FCNTL
2389 CURL_CHECK_FUNC_FDOPEN
2390 CURL_CHECK_FUNC_FREEADDRINFO
2391 CURL_CHECK_FUNC_FREEIFADDRS
2392 CURL_CHECK_FUNC_FSETXATTR
2393 CURL_CHECK_FUNC_FTRUNCATE
2394 CURL_CHECK_FUNC_GETADDRINFO
2395 CURL_CHECK_FUNC_GETHOSTBYADDR
2396 CURL_CHECK_FUNC_GETHOSTBYADDR_R
2397 CURL_CHECK_FUNC_GETHOSTBYNAME
2398 CURL_CHECK_FUNC_GETHOSTBYNAME_R
2399 CURL_CHECK_FUNC_GETHOSTNAME
2400 CURL_CHECK_FUNC_GETIFADDRS
2401 CURL_CHECK_FUNC_GETSERVBYPORT_R
2402 CURL_CHECK_FUNC_GMTIME_R
2403 CURL_CHECK_FUNC_INET_NTOA_R
2404 CURL_CHECK_FUNC_INET_NTOP
2405 CURL_CHECK_FUNC_INET_PTON
2406 CURL_CHECK_FUNC_IOCTL
2407 CURL_CHECK_FUNC_IOCTLSOCKET
2408 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
2409 CURL_CHECK_FUNC_LOCALTIME_R
2410 CURL_CHECK_FUNC_MEMRCHR
2411 CURL_CHECK_FUNC_POLL
2412 CURL_CHECK_FUNC_SETSOCKOPT
2413 CURL_CHECK_FUNC_SIGACTION
2414 CURL_CHECK_FUNC_SIGINTERRUPT
2415 CURL_CHECK_FUNC_SIGNAL
2416 CURL_CHECK_FUNC_SIGSETJMP
2417 CURL_CHECK_FUNC_SOCKET
2418 CURL_CHECK_FUNC_STRCASECMP
2419 CURL_CHECK_FUNC_STRCASESTR
2420 CURL_CHECK_FUNC_STRCMPI
2421 CURL_CHECK_FUNC_STRDUP
2422 CURL_CHECK_FUNC_STRERROR_R
2423 CURL_CHECK_FUNC_STRICMP
2424 CURL_CHECK_FUNC_STRLCAT
2425 CURL_CHECK_FUNC_STRNCASECMP
2426 CURL_CHECK_FUNC_STRNCMPI
2427 CURL_CHECK_FUNC_STRNICMP
2428 CURL_CHECK_FUNC_STRSTR
2429 CURL_CHECK_FUNC_STRTOK_R
2430 CURL_CHECK_FUNC_STRTOLL
2431 CURL_CHECK_FUNC_WRITEV
2432
2433 case $host in
2434   *msdosdjgpp)
2435      ac_cv_func_pipe=no
2436      skipcheck_pipe=yes
2437      AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
2438     ;;
2439 esac
2440
2441 AC_CHECK_FUNCS([fork \
2442   geteuid \
2443   getpass_r \
2444   getppid \
2445   getprotobyname \
2446   getpwuid \
2447   getrlimit \
2448   gettimeofday \
2449   inet_addr \
2450   perror \
2451   pipe \
2452   setlocale \
2453   setmode \
2454   setrlimit \
2455   uname \
2456   utime
2457 ],[
2458 ],[
2459   func="$ac_func"
2460   eval skipcheck=\$skipcheck_$func
2461   if test "x$skipcheck" != "xyes"; then
2462     AC_MSG_CHECKING([deeper for $func])
2463     AC_LINK_IFELSE([
2464       AC_LANG_PROGRAM([[
2465       ]],[[
2466         $func ();
2467       ]])
2468     ],[
2469       AC_MSG_RESULT([yes])
2470       eval "ac_cv_func_$func=yes"
2471       AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$func]), [1],
2472         [Define to 1 if you have the $func function.])
2473     ],[
2474       AC_MSG_RESULT([but still no])
2475     ])
2476   fi
2477 ])
2478
2479 dnl Check if the getnameinfo function is available
2480 dnl and get the types of five of its arguments.
2481 CURL_CHECK_FUNC_GETNAMEINFO
2482
2483 if test "$ipv6" = "yes"; then
2484   if test "$ac_cv_func_getaddrinfo" = "yes"; then
2485     AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
2486     IPV6_ENABLED=1
2487     AC_SUBST(IPV6_ENABLED)
2488   fi
2489   CURL_CHECK_NI_WITHSCOPEID
2490 fi
2491
2492 dnl ************************************************************
2493 dnl enable non-blocking communications
2494 dnl
2495 CURL_CHECK_OPTION_NONBLOCKING
2496 CURL_CHECK_NONBLOCKING_SOCKET
2497
2498 dnl ************************************************************
2499 dnl nroff tool stuff
2500 dnl
2501
2502 AC_PATH_PROG( PERL, perl, ,
2503   $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
2504 AC_SUBST(PERL)
2505
2506 AC_PATH_PROGS( NROFF, gnroff nroff, ,
2507   $PATH:/usr/bin/:/usr/local/bin )
2508 AC_SUBST(NROFF)
2509
2510 if test -n "$NROFF"; then
2511   dnl only check for nroff options if an nroff command was found
2512
2513   AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
2514   MANOPT="-man"
2515   mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2516   if test -z "$mancheck"; then
2517     MANOPT="-mandoc"
2518    mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
2519     if test -z "$mancheck"; then
2520       MANOPT=""
2521       AC_MSG_RESULT([failed])
2522       AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
2523     else
2524       AC_MSG_RESULT([$MANOPT])
2525     fi
2526   else
2527     AC_MSG_RESULT([$MANOPT])
2528   fi
2529   AC_SUBST(MANOPT)
2530 fi
2531
2532 if test -z "$MANOPT"
2533 then
2534   dnl if no nroff tool was found, or no option that could convert man pages
2535   dnl was found, then disable the built-in manual stuff
2536   AC_MSG_WARN([disabling built-in manual])
2537   USE_MANUAL="no";
2538 fi
2539
2540 dnl *************************************************************************
2541 dnl If the manual variable still is set, then we go with providing a built-in
2542 dnl manual
2543
2544 if test "$USE_MANUAL" = "1"; then
2545   AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
2546   curl_manual_msg="enabled"
2547 fi
2548
2549 dnl set variable for use in automakefile(s)
2550 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
2551
2552 CURL_CHECK_LIB_ARES
2553 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
2554
2555 if test "x$enable_shared" = "xyes"; then
2556   build_libhostname=yes
2557 else
2558   build_libhostname=no
2559 fi
2560 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
2561
2562 CURL_CHECK_OPTION_THREADED_RESOLVER
2563
2564 if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
2565   AC_MSG_ERROR(
2566 [Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
2567 fi
2568
2569 if test "$want_thres" = "yes"; then
2570   AC_CHECK_HEADER(pthread.h,
2571     [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
2572       save_CFLAGS="$CFLAGS"
2573       CFLAGS="$CFLAGS -pthread"
2574       AC_CHECK_LIB(pthread, pthread_create,
2575         [ AC_MSG_NOTICE([using POSIX threaded DNS lookup])
2576           AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
2577           USE_THREADS_POSIX=1
2578           curl_res_msg="threaded"
2579         ],
2580         [ CFLAGS="$save_CFLAGS"])
2581   ])
2582 fi
2583
2584 dnl ************************************************************
2585 dnl disable verbose text strings
2586 dnl
2587 AC_MSG_CHECKING([whether to enable verbose strings])
2588 AC_ARG_ENABLE(verbose,
2589 AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
2590 AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
2591 [ case "$enableval" in
2592   no)
2593        AC_MSG_RESULT(no)
2594        AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
2595        curl_verbose_msg="no"
2596        ;;
2597   *)   AC_MSG_RESULT(yes)
2598        ;;
2599   esac ],
2600        AC_MSG_RESULT(yes)
2601 )
2602
2603 dnl ************************************************************
2604 dnl enable SSPI support
2605 dnl
2606 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
2607 AC_ARG_ENABLE(sspi,
2608 AC_HELP_STRING([--enable-sspi],[Enable SSPI])
2609 AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
2610 [ case "$enableval" in
2611   yes)
2612        if test "$ac_cv_native_windows" = "yes"; then
2613          AC_MSG_RESULT(yes)
2614          AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
2615          AC_SUBST(USE_WINDOWS_SSPI, [1])
2616          curl_sspi_msg="enabled"
2617        else
2618          AC_MSG_RESULT(no)
2619          AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
2620        fi
2621        ;;
2622   *)
2623        AC_MSG_RESULT(no)
2624        ;;
2625   esac ],
2626        AC_MSG_RESULT(no)
2627 )
2628
2629 dnl ************************************************************
2630 dnl disable cryptographic authentication
2631 dnl
2632 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
2633 AC_ARG_ENABLE(crypto-auth,
2634 AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
2635 AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
2636 [ case "$enableval" in
2637   no)
2638        AC_MSG_RESULT(no)
2639        AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
2640        ;;
2641   *)   AC_MSG_RESULT(yes)
2642        ;;
2643   esac ],
2644        AC_MSG_RESULT(yes)
2645 )
2646
2647 dnl ************************************************************
2648 dnl disable cookies support
2649 dnl
2650 AC_MSG_CHECKING([whether to enable support for cookies])
2651 AC_ARG_ENABLE(cookies,
2652 AC_HELP_STRING([--enable-cookies],[Enable cookies support])
2653 AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
2654 [ case "$enableval" in
2655   no)
2656        AC_MSG_RESULT(no)
2657        AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
2658        ;;
2659   *)   AC_MSG_RESULT(yes)
2660        ;;
2661   esac ],
2662        AC_MSG_RESULT(yes)
2663 )
2664
2665 dnl ************************************************************
2666 dnl Enable hiding of internal symbols in library to reduce its size and
2667 dnl speed dynamic linking of applications.  This currently is only supported
2668 dnl on gcc >= 4.0 and SunPro C.
2669 dnl
2670 AC_MSG_CHECKING([whether to enable hidden symbols in the library])
2671 AC_ARG_ENABLE(hidden-symbols,
2672 AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
2673 AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
2674 [ case "$enableval" in
2675   no)
2676        AC_MSG_RESULT(no)
2677        ;;
2678   *)
2679        AC_MSG_CHECKING([whether $CC supports it])
2680        if test "$GCC" = yes ; then
2681          if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ||
2682            dnl clang always supports -fvisibility= but it doesn't show up
2683            dnl under --help.
2684            test "$compiler_id" = "CLANG"; then
2685            AC_MSG_RESULT(yes)
2686            AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2687            AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
2688            CFLAGS="$CFLAGS -fvisibility=hidden"
2689          else
2690             AC_MSG_RESULT(no)
2691           fi
2692
2693        else
2694          dnl Test for SunPro cc
2695          if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
2696            AC_MSG_RESULT(yes)
2697            AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
2698            AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
2699            CFLAGS="$CFLAGS -xldscope=hidden"
2700          else
2701            AC_MSG_RESULT(no)
2702          fi
2703        fi
2704        ;;
2705   esac ],
2706        AC_MSG_RESULT(no)
2707 )
2708
2709 dnl ************************************************************
2710 dnl enforce SONAME bump
2711 dnl
2712
2713 AC_MSG_CHECKING([whether to enforce SONAME bump])
2714 AC_ARG_ENABLE(soname-bump,
2715 AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
2716 AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
2717 [ case "$enableval" in
2718   yes)   AC_MSG_RESULT(yes)
2719          soname_bump=yes
2720          ;;
2721   *)
2722          AC_MSG_RESULT(no)
2723          ;;
2724   esac ],
2725         AC_MSG_RESULT($soname_bump)
2726 )
2727 AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
2728
2729
2730 dnl ************************************************************
2731 if test ! -z "$winsock_LIB"; then
2732
2733   dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
2734   dnl things work when built with c-ares). But we can't just move it last
2735   dnl since then other stuff (SSL) won't build. So we simply append it to the
2736   dnl end.
2737
2738   LIBS="$LIBS $winsock_LIB"
2739   TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
2740
2741 fi
2742
2743 dnl
2744 dnl All the library dependencies put into $LIB apply to libcurl only.
2745 dnl Those in $CURL_LIBS apply to the curl command-line client only.
2746 dnl Those in $TEST_SERVER_LIBS apply to test servers only.
2747 dnl Those in $ALL_LIBS apply to all targets, including test targets.
2748 dnl
2749 LIBCURL_LIBS=$LIBS
2750
2751 AC_SUBST(LIBCURL_LIBS)
2752 AC_SUBST(CURL_LIBS)
2753 AC_SUBST(TEST_SERVER_LIBS)
2754 AC_SUBST(CURL_NETWORK_LIBS)
2755 LIBS=$ALL_LIBS  dnl LIBS is a magic variable that's used for every link
2756
2757 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
2758
2759 dnl yes or no
2760 ENABLE_SHARED="$enable_shared"
2761 AC_SUBST(ENABLE_SHARED)
2762
2763 dnl
2764 dnl For keeping supported features and protocols also in pkg-config file
2765 dnl since it is more cross-compile frient than curl-config
2766 dnl
2767
2768 if test "x$USE_SSLEAY" = "x1"; then
2769   SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2770 elif test -n "$SSL_ENABLED"; then
2771   SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
2772 fi
2773 if test "@KRB4_ENABLED@" = "x1"; then
2774   SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
2775 fi
2776 if test "x$IPV6_ENABLED" = "x1"; then
2777   SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
2778 fi
2779 if test "x$HAVE_LIBZ" = "x1"; then
2780   SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
2781 fi
2782 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then
2783   SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
2784 fi
2785 if test "x$IDN_ENABLED" = "x1"; then
2786   SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
2787 fi
2788 if test "x$USE_WINDOWS_SSPI" = "x1"; then
2789   SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
2790 fi
2791 if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
2792     -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1"; then
2793   SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
2794 fi
2795
2796 AC_SUBST(SUPPORT_FEATURES)
2797
2798 dnl For supported protocols in pkg-config file
2799 if test "x$CURL_DISABLE_HTTP" != "x1"; then
2800   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
2801   if test "x$SSL_ENABLED" = "x1"; then
2802     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
2803   fi
2804 fi
2805 if test "x$CURL_DISABLE_FTP" != "x1"; then
2806   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
2807   if test "x$SSL_ENABLED" = "x1"; then
2808     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
2809   fi
2810 fi
2811 if test "x$CURL_DISABLE_FILE" != "x1"; then
2812   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
2813 fi
2814 if test "x$CURL_DISABLE_TELNET" != "x1"; then
2815   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
2816 fi
2817 if test "x$CURL_DISABLE_LDAP" != "x1"; then
2818   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
2819   if test "x$CURL_DISABLE_LDAPS" != "x1"; then
2820     if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
2821       (test "x$USE_OPENLDAP" != "x1"  && test "x$HAVE_LDAP_SSL" = "x1"); then
2822       SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
2823     fi
2824   fi
2825 fi
2826 if test "x$CURL_DISABLE_DICT" != "x1"; then
2827   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
2828 fi
2829 if test "x$CURL_DISABLE_TFTP" != "x1"; then
2830   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
2831 fi
2832 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
2833   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
2834 fi
2835 if test "x$CURL_DISABLE_POP3" != "x1"; then
2836   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
2837   if test "x$SSL_ENABLED" = "x1"; then
2838     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
2839   fi
2840 fi
2841 if test "x$CURL_DISABLE_IMAP" != "x1"; then
2842   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
2843   if test "x$SSL_ENABLED" = "x1"; then
2844     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
2845   fi
2846 fi
2847 if test "x$CURL_DISABLE_SMTP" != "x1"; then
2848   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
2849   if test "x$SSL_ENABLED" = "x1"; then
2850     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
2851   fi
2852 fi
2853 if test "x$USE_LIBSSH2" = "x1"; then
2854   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
2855   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
2856 fi
2857 if test "x$CURL_DISABLE_RTSP" != "x1"; then
2858   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
2859 fi
2860 if test "x$USE_LIBRTMP" = "x1"; then
2861   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
2862 fi
2863
2864 dnl replace spaces with newlines
2865 dnl sort the lines
2866 dnl replace the newlines back to spaces
2867 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
2868
2869 AC_SUBST(SUPPORT_PROTOCOLS)
2870
2871 dnl squeeze whitespace out of some variables
2872
2873 squeeze CFLAGS
2874 squeeze CPPFLAGS
2875 squeeze DEFS
2876 squeeze LDFLAGS
2877 squeeze LIBS
2878
2879 squeeze CURL_LIBS
2880 squeeze LIBCURL_LIBS
2881 squeeze TEST_SERVER_LIBS
2882 squeeze CURL_NETWORK_LIBS
2883
2884 squeeze SUPPORT_FEATURES
2885 squeeze SUPPORT_PROTOCOLS
2886
2887 if test "x$want_curldebug_assumed" = "xyes" &&
2888   test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
2889   ac_configure_args="$ac_configure_args --enable-curldebug"
2890 fi
2891
2892 AC_CONFIG_FILES([Makefile \
2893            docs/Makefile \
2894            docs/examples/Makefile \
2895            docs/libcurl/Makefile \
2896            include/Makefile \
2897            include/curl/Makefile \
2898            src/Makefile \
2899            lib/Makefile \
2900            lib/libcurl.vers \
2901            tests/Makefile \
2902            tests/data/Makefile \
2903            tests/server/Makefile \
2904            tests/libtest/Makefile \
2905            packages/Makefile \
2906            packages/Win32/Makefile \
2907            packages/Win32/cygwin/Makefile \
2908            packages/Linux/Makefile \
2909            packages/Linux/RPM/Makefile \
2910            packages/Linux/RPM/curl.spec \
2911            packages/Linux/RPM/curl-ssl.spec \
2912            packages/Solaris/Makefile \
2913            packages/EPM/curl.list \
2914            packages/EPM/Makefile \
2915            packages/vms/Makefile \
2916            packages/AIX/Makefile \
2917            packages/AIX/RPM/Makefile \
2918            packages/AIX/RPM/curl.spec \
2919            curl-config \
2920            libcurl.pc
2921 ])
2922 AC_OUTPUT
2923
2924 CURL_GENERATE_CONFIGUREHELP_PM
2925
2926 AC_MSG_NOTICE([Configured to build curl/libcurl:
2927
2928   curl version:    ${VERSION}
2929   Host setup:      ${host}
2930   Install prefix:  ${prefix}
2931   Compiler:        ${CC}
2932   SSL support:     ${curl_ssl_msg}
2933   SSH support:     ${curl_ssh_msg}
2934   zlib support:    ${curl_zlib_msg}
2935   krb4 support:    ${curl_krb4_msg}
2936   GSSAPI support:  ${curl_gss_msg}
2937   SPNEGO support:  ${curl_spnego_msg}
2938   resolver:        ${curl_res_msg}
2939   ipv6 support:    ${curl_ipv6_msg}
2940   IDN support:     ${curl_idn_msg}
2941   Build libcurl:   Shared=${enable_shared}, Static=${enable_static}
2942   Built-in manual: ${curl_manual_msg}
2943   Verbose errors:  ${curl_verbose_msg}
2944   SSPI support:    ${curl_sspi_msg}
2945   ca cert bundle:  ${ca}
2946   ca cert path:    ${capath}
2947   LDAP support:    ${curl_ldap_msg}
2948   LDAPS support:   ${curl_ldaps_msg}
2949   RTSP support:    ${curl_rtsp_msg}
2950   RTMP support:    ${curl_rtmp_msg}
2951   Protocols:       ${SUPPORT_PROTOCOLS}
2952 ])
2953
2954 if test "x$soname_bump" = "xyes"; then
2955
2956 cat <<EOM
2957   SONAME bump:     yes - WARNING: this library will be built with the SONAME
2958                    number bumped due to (a detected) ABI breakage.
2959                    See lib/README.curl_off_t for details on this.
2960 EOM
2961
2962 fi
2963