Upgrade to 7.81.0
[platform/upstream/curl.git] / configure.ac
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2021, 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 https://curl.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.59)
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: https://curl.se/mail/])
28
29 XC_OVR_ZZ50
30 XC_OVR_ZZ60
31 CURL_OVERRIDE_AUTOCONF
32
33 dnl configure script copyright
34 AC_COPYRIGHT([Copyright (c) 1998 - 2021 Daniel Stenberg, <daniel@haxx.se>
35 This configure script may be copied, distributed and modified under the
36 terms of the curl license; see COPYING for more details])
37
38 AC_CONFIG_SRCDIR([lib/urldata.h])
39 AC_CONFIG_HEADERS(lib/curl_config.h)
40 AC_CONFIG_MACRO_DIR([m4])
41 AM_MAINTAINER_MODE
42 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
43
44 CURL_CHECK_OPTION_DEBUG
45 CURL_CHECK_OPTION_OPTIMIZE
46 CURL_CHECK_OPTION_WARNINGS
47 CURL_CHECK_OPTION_WERROR
48 CURL_CHECK_OPTION_CURLDEBUG
49 CURL_CHECK_OPTION_SYMBOL_HIDING
50 CURL_CHECK_OPTION_ARES
51 CURL_CHECK_OPTION_RT
52 CURL_CHECK_OPTION_ECH
53
54 XC_CHECK_PATH_SEPARATOR
55
56 #
57 # save the configure arguments
58 #
59 CONFIGURE_OPTIONS="\"$ac_configure_args\""
60 AC_SUBST(CONFIGURE_OPTIONS)
61
62 dnl SED is mandatory for configure process and libtool.
63 dnl Set it now, allowing it to be changed later.
64 if test -z "$SED"; then
65   dnl allow it to be overridden
66   AC_PATH_PROG([SED], [sed], [not_found],
67     [$PATH:/usr/bin:/usr/local/bin])
68   if test -z "$SED" || test "$SED" = "not_found"; then
69     AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
70   fi
71 fi
72 AC_SUBST([SED])
73
74 dnl GREP is mandatory for configure process and libtool.
75 dnl Set it now, allowing it to be changed later.
76 if test -z "$GREP"; then
77   dnl allow it to be overridden
78   AC_PATH_PROG([GREP], [grep], [not_found],
79     [$PATH:/usr/bin:/usr/local/bin])
80   if test -z "$GREP" || test "$GREP" = "not_found"; then
81     AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
82   fi
83 fi
84 AC_SUBST([GREP])
85
86 dnl EGREP is mandatory for configure process and libtool.
87 dnl Set it now, allowing it to be changed later.
88 if test -z "$EGREP"; then
89   dnl allow it to be overridden
90   if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
91     AC_MSG_CHECKING([for egrep])
92     EGREP="$GREP -E"
93     AC_MSG_RESULT([$EGREP])
94   else
95     AC_PATH_PROG([EGREP], [egrep], [not_found],
96       [$PATH:/usr/bin:/usr/local/bin])
97   fi
98 fi
99 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
100   AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
101 fi
102 AC_SUBST([EGREP])
103
104 dnl AR is mandatory for configure process and libtool.
105 dnl This is target dependent, so check it as a tool.
106 if test -z "$AR"; then
107   dnl allow it to be overridden
108   AC_PATH_TOOL([AR], [ar], [not_found],
109     [$PATH:/usr/bin:/usr/local/bin])
110   if test -z "$AR" || test "$AR" = "not_found"; then
111     AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
112   fi
113 fi
114 AC_SUBST([AR])
115
116 AC_SUBST(libext)
117
118 dnl figure out the libcurl version
119 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
120 XC_CHECK_PROG_CC
121
122 dnl for --enable-code-coverage
123 CURL_COVERAGE
124
125 XC_AUTOMAKE
126 AC_MSG_CHECKING([curl version])
127 AC_MSG_RESULT($CURLVERSION)
128
129 AC_SUBST(CURLVERSION)
130
131 dnl
132 dnl we extract the numerical version for curl-config only
133 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
134 AC_SUBST(VERSIONNUM)
135
136 dnl Solaris pkgadd support definitions
137 PKGADD_PKG="HAXXcurl"
138 PKGADD_NAME="curl - a client that groks URLs"
139 PKGADD_VENDOR="curl.se"
140 AC_SUBST(PKGADD_PKG)
141 AC_SUBST(PKGADD_NAME)
142 AC_SUBST(PKGADD_VENDOR)
143
144 dnl
145 dnl initialize all the info variables
146     curl_ssl_msg="no      (--with-{openssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,mesalink,amissl,bearssl,rustls} )"
147     curl_ssh_msg="no      (--with-{libssh,libssh2})"
148    curl_zlib_msg="no      (--with-zlib)"
149  curl_brotli_msg="no      (--with-brotli)"
150    curl_zstd_msg="no      (--with-zstd)"
151     curl_gss_msg="no      (--with-gssapi)"
152   curl_gsasl_msg="no      (--with-gsasl)"
153 curl_tls_srp_msg="no      (--enable-tls-srp)"
154     curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
155    curl_ipv6_msg="no      (--enable-ipv6)"
156 curl_unix_sockets_msg="no      (--enable-unix-sockets)"
157     curl_idn_msg="no      (--with-{libidn2,winidn})"
158  curl_manual_msg="no      (--enable-manual)"
159 curl_libcurl_msg="enabled (--disable-libcurl-option)"
160 curl_verbose_msg="enabled (--disable-verbose)"
161    curl_sspi_msg="no      (--enable-sspi)"
162    curl_ldap_msg="no      (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
163   curl_ldaps_msg="no      (--enable-ldaps)"
164    curl_rtsp_msg="no      (--enable-rtsp)"
165    curl_rtmp_msg="no      (--with-librtmp)"
166     curl_psl_msg="no      (--with-libpsl)"
167  curl_altsvc_msg="enabled (--disable-alt-svc)"
168    curl_hsts_msg="enabled (--disable-hsts)"
169     ssl_backends=
170      curl_h1_msg="enabled (internal)"
171      curl_h2_msg="no      (--with-nghttp2, --with-hyper)"
172      curl_h3_msg="no      (--with-ngtcp2, --with-quiche)"
173
174 enable_altsvc="yes"
175 hsts="yes"
176
177 dnl
178 dnl Save some initial values the user might have provided
179 dnl
180 INITIAL_LDFLAGS=$LDFLAGS
181 INITIAL_LIBS=$LIBS
182
183 dnl **********************************************************************
184 dnl See which TLS backend(s) that are requested. Just do all the
185 dnl TLS AC_ARG_WITH() invokes here and do the checks later
186 dnl **********************************************************************
187 OPT_SCHANNEL=no
188 AC_ARG_WITH(schannel,dnl
189 AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
190   OPT_SCHANNEL=$withval
191   TLSCHOICE="schannel")
192
193 OPT_SECURETRANSPORT=no
194 AC_ARG_WITH(secure-transport,dnl
195 AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),
196   OPT_SECURETRANSPORT=$withval
197   test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
198 )
199
200 OPT_AMISSL=no
201 AC_ARG_WITH(amissl,dnl
202 AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),
203   OPT_AMISSL=$withval
204   test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL")
205
206 OPT_OPENSSL=no
207 dnl Default to no CA bundle
208 ca="no"
209 AC_ARG_WITH(ssl,dnl
210 AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
211 AS_HELP_STRING([--without-ssl], [build without any TLS library]),
212   OPT_SSL=$withval
213   OPT_OPENSSL=$withval
214   if test X"$withval" != Xno; then
215     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
216   fi
217
218 AC_ARG_WITH(openssl,dnl
219 AS_HELP_STRING([--with-openssl=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]),
220   OPT_OPENSSL=$withval
221   if test X"$withval" != Xno; then
222     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL")
223   fi
224
225 OPT_GNUTLS=no
226 AC_ARG_WITH(gnutls,dnl
227 AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),
228   OPT_GNUTLS=$withval
229   if test X"$withval" != Xno; then
230     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS")
231   fi
232
233 OPT_MBEDTLS=no
234 AC_ARG_WITH(mbedtls,dnl
235 AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),
236   OPT_MBEDTLS=$withval
237   if test X"$withval" != Xno; then
238     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS")
239   fi
240
241 OPT_WOLFSSL=no
242 AC_ARG_WITH(wolfssl,dnl
243 AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),
244   OPT_WOLFSSL=$withval
245   if test X"$withval" != Xno; then
246     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL")
247   fi
248
249 OPT_MESALINK=no
250 AC_ARG_WITH(mesalink,dnl
251 AS_HELP_STRING([--with-mesalink=PATH],[where to look for MesaLink, PATH points to the installation root]),
252   OPT_MESALINK=$withval
253   if test X"$withval" != Xno; then
254     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }MesaLink")
255   fi
256
257 OPT_BEARSSL=no
258 AC_ARG_WITH(bearssl,dnl
259 AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),
260   OPT_BEARSSL=$withval
261   if test X"$withval" != Xno; then
262     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL")
263   fi
264
265 OPT_RUSTLS=no
266 AC_ARG_WITH(rustls,dnl
267 AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),
268   OPT_RUSTLS=$withval
269   if test X"$withval" != Xno; then
270     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls")
271   fi
272
273 OPT_NSS=no
274 AC_ARG_WITH(nss,dnl
275 AS_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]),
276   OPT_NSS=$withval
277   if test X"$withval" != Xno; then
278     test -z "TLSCHOICE" || TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }NSS")
279   fi
280
281 dnl If no TLS choice has been made, check if it was explicitly disabled or
282 dnl error out to force the user to decide.
283 if test -z "$TLSCHOICE"; then
284   if test "x$OPT_SSL" != "xno"; then
285     AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
286
287 Select from these:
288
289   --with-amissl
290   --with-bearssl
291   --with-gnutls
292   --with-mbedtls
293   --with-mesalink
294   --with-nss
295   --with-openssl (also works for BoringSSL and libressl)
296   --with-rustls
297   --with-schannel
298   --with-secure-transport
299   --with-wolfssl
300 ])
301   fi
302 fi
303
304 AC_ARG_WITH(darwinssl,,
305   AC_MSG_ERROR([--with-darwin-ssl no longer works!]))
306
307 dnl
308 dnl Detect the canonical host and target build environment
309 dnl
310
311 AC_CANONICAL_HOST
312 dnl Get system canonical name
313 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
314
315 # Silence warning: ar: 'u' modifier ignored since 'D' is the default
316 AC_SUBST(AR_FLAGS, [cr])
317
318 dnl This defines _ALL_SOURCE for AIX
319 CURL_CHECK_AIX_ALL_SOURCE
320
321 dnl Our configure and build reentrant settings
322 CURL_CONFIGURE_THREAD_SAFE
323 CURL_CONFIGURE_REENTRANT
324
325 dnl check for how to do large files
326 AC_SYS_LARGEFILE
327
328 XC_LIBTOOL
329
330 #
331 # Automake conditionals based on libtool related checks
332 #
333
334 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
335   [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
336 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
337   [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
338 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
339   [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
340
341 #
342 # Due to libtool and automake machinery limitations of not allowing
343 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
344 # inclusion of these in shared or static libraries, we are forced to
345 # build using separate configure runs for shared and static libraries
346 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
347 # to compile objects for each kind of library. Notice that relying on
348 # the '-DPIC' CFLAG that libtool provides is not valid given that the
349 # user might for example choose to build static libraries with PIC.
350 #
351
352 #
353 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
354 # targeting a static library and not building its shared counterpart.
355 #
356
357 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
358   [test "x$xc_lt_build_static_only" = 'xyes'])
359
360 #
361 # Make staticlib CPPFLAG variable and its definition visible in output
362 # files unconditionally, providing an empty definition unless strictly
363 # targeting a static library and not building its shared counterpart.
364 #
365
366 CPPFLAG_CURL_STATICLIB=
367 if test "x$xc_lt_build_static_only" = 'xyes'; then
368   CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
369 fi
370 AC_SUBST([CPPFLAG_CURL_STATICLIB])
371
372
373 # Determine whether all dependent libraries must be specified when linking
374 if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
375 then
376     REQUIRE_LIB_DEPS=no
377 else
378     REQUIRE_LIB_DEPS=yes
379 fi
380 AC_SUBST(REQUIRE_LIB_DEPS)
381 AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
382
383 dnl check if there's a way to force code inline
384 AC_C_INLINE
385
386 dnl **********************************************************************
387 dnl platform/compiler/architecture specific checks/flags
388 dnl **********************************************************************
389
390 CURL_CHECK_COMPILER
391 CURL_SET_COMPILER_BASIC_OPTS
392 CURL_SET_COMPILER_DEBUG_OPTS
393 CURL_SET_COMPILER_OPTIMIZE_OPTS
394 CURL_SET_COMPILER_WARNING_OPTS
395
396 if test "$compiler_id" = "INTEL_UNIX_C"; then
397   #
398   if test "$compiler_num" -ge "1000"; then
399     dnl icc 10.X or later
400     CFLAGS="$CFLAGS -shared-intel"
401   elif test "$compiler_num" -ge "900"; then
402     dnl icc 9.X specific
403     CFLAGS="$CFLAGS -i-dynamic"
404   fi
405   #
406 fi
407
408 CURL_CFLAG_EXTRAS=""
409 if test X"$want_werror" = Xyes; then
410   CURL_CFLAG_EXTRAS="-Werror"
411   if test "$compiler_id" = "GNU_C"; then
412     dnl enable -pedantic-errors for GCC 5 and later,
413     dnl as before that it was the same as -Werror=pedantic
414     if test "$compiler_num" -ge "500"; then
415       CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
416     fi
417   fi
418 fi
419 AC_SUBST(CURL_CFLAG_EXTRAS)
420
421 CURL_CHECK_COMPILER_HALT_ON_ERROR
422 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
423 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
424 CURL_CHECK_COMPILER_SYMBOL_HIDING
425
426 CURL_CHECK_CURLDEBUG
427 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
428
429 supports_unittests=yes
430 # cross-compilation of unit tests static library/programs fails when
431 # libcurl shared library is built. This might be due to a libtool or
432 # automake issue. In this case we disable unit tests.
433 if test "x$cross_compiling" != "xno" &&
434    test "x$enable_shared" != "xno"; then
435   supports_unittests=no
436 fi
437
438 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
439 # a problem related with OpenSSL headers and library versions not matching.
440 # Disable unit tests while time to further investigate this is found.
441 case $host in
442   mips-sgi-irix6.5)
443     if test "$compiler_id" = "GNU_C"; then
444       supports_unittests=no
445     fi
446     ;;
447 esac
448
449 # All AIX autobuilds fails unit tests linking against unittests library
450 # due to unittests library being built with no symbols or members. Libtool ?
451 # Disable unit tests while time to further investigate this is found.
452 case $host_os in
453   aix*)
454     supports_unittests=no
455     ;;
456 esac
457
458 dnl Build unit tests when option --enable-debug is given.
459 if test "x$want_debug" = "xyes" &&
460    test "x$supports_unittests" = "xyes"; then
461   want_unittests=yes
462 else
463   want_unittests=no
464 fi
465 AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
466
467 # For original MinGW (ie not MinGW-w64) define the Windows minimum supported OS
468 # version to Windows XP (0x501) if it hasn't already been defined by the user.
469 # Without this override original MinGW defaults the version to Windows NT 4.0.
470 # Note original MinGW sets _WIN32_WINNT if not defined to whatever WINVER is.
471 case $host in
472   *-*-mingw32*)
473     AC_MSG_CHECKING([if MinGW minimum supported OS should be set to XP])
474     AC_COMPILE_IFELSE([
475       AC_LANG_PROGRAM([[
476 #include <_mingw.h>
477       ]],[[
478 #if defined(__MINGW64_VERSION_MAJOR) || \
479     defined(WINVER) || \
480     defined(_WIN32_WINNT)
481 #error
482 #endif
483       ]])
484     ],[
485       CPPFLAGS="$CPPFLAGS -DWINVER=0x501"
486       AC_MSG_RESULT([yes])
487     ],[
488       AC_MSG_RESULT([no])
489     ])
490     ;;
491 esac
492
493 dnl **********************************************************************
494 dnl Compilation based checks should not be done before this point.
495 dnl **********************************************************************
496
497 dnl **********************************************************************
498 dnl Make sure that our checks for headers windows.h winsock2.h
499 dnl and ws2tcpip.h take precedence over any other further checks which
500 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
501 dnl this specific header files. And do them before its results are used.
502 dnl **********************************************************************
503
504 CURL_CHECK_HEADER_WINDOWS
505 CURL_CHECK_NATIVE_WINDOWS
506 case X-"$curl_cv_native_windows" in
507   X-yes)
508     CURL_CHECK_HEADER_WINSOCK2
509     CURL_CHECK_HEADER_WS2TCPIP
510     CURL_CHECK_HEADER_WINCRYPT
511     CURL_CHECK_HEADER_WINLDAP
512     CURL_CHECK_HEADER_WINBER
513     ;;
514   *)
515     curl_cv_header_winsock2_h="no"
516     curl_cv_header_ws2tcpip_h="no"
517     curl_cv_header_wincrypt_h="no"
518     curl_cv_header_winldap_h="no"
519     curl_cv_header_winber_h="no"
520     ;;
521 esac
522 CURL_CHECK_WIN32_LARGEFILE
523 CURL_CHECK_WIN32_CRYPTO
524
525 CURL_DARWIN_CFLAGS
526 CURL_DARWIN_SYSTEMCONFIGURATION
527 CURL_SUPPORTS_BUILTIN_AVAILABLE
528
529
530 dnl ************************************************************
531 dnl switch off particular protocols
532 dnl
533 AC_MSG_CHECKING([whether to support http])
534 AC_ARG_ENABLE(http,
535 AS_HELP_STRING([--enable-http],[Enable HTTP support])
536 AS_HELP_STRING([--disable-http],[Disable HTTP support]),
537 [ case "$enableval" in
538   no)
539        AC_MSG_RESULT(no)
540        AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
541        disable_http="yes"
542        AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
543        AC_SUBST(CURL_DISABLE_HTTP, [1])
544        AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
545        AC_SUBST(CURL_DISABLE_RTSP, [1])
546        dnl toggle off alt-svc too when HTTP is disabled
547        AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
548        AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
549        curl_h1_msg="no      (--enable-http, --with-hyper)"
550        curl_altsvc_msg="no";
551        curl_hsts_msg="no      (--enable-hsts)";
552        enable_altsvc="no"
553        hsts="no"
554        ;;
555   *)   AC_MSG_RESULT(yes)
556        ;;
557   esac ],
558        AC_MSG_RESULT(yes)
559 )
560 AC_MSG_CHECKING([whether to support ftp])
561 AC_ARG_ENABLE(ftp,
562 AS_HELP_STRING([--enable-ftp],[Enable FTP support])
563 AS_HELP_STRING([--disable-ftp],[Disable FTP support]),
564 [ case "$enableval" in
565   no)
566        AC_MSG_RESULT(no)
567        AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
568        AC_SUBST(CURL_DISABLE_FTP, [1])
569        ;;
570   *)   AC_MSG_RESULT(yes)
571        ;;
572   esac ],
573        AC_MSG_RESULT(yes)
574 )
575 AC_MSG_CHECKING([whether to support file])
576 AC_ARG_ENABLE(file,
577 AS_HELP_STRING([--enable-file],[Enable FILE support])
578 AS_HELP_STRING([--disable-file],[Disable FILE support]),
579 [ case "$enableval" in
580   no)
581        AC_MSG_RESULT(no)
582        AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
583        AC_SUBST(CURL_DISABLE_FILE, [1])
584        ;;
585   *)   AC_MSG_RESULT(yes)
586        ;;
587   esac ],
588        AC_MSG_RESULT(yes)
589 )
590 AC_MSG_CHECKING([whether to support ldap])
591 AC_ARG_ENABLE(ldap,
592 AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
593 AS_HELP_STRING([--disable-ldap],[Disable LDAP support]),
594 [ case "$enableval" in
595   no)
596        AC_MSG_RESULT(no)
597        AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
598        AC_SUBST(CURL_DISABLE_LDAP, [1])
599        ;;
600   yes)
601        ldap_askedfor="yes"
602        AC_MSG_RESULT(yes)
603        ;;
604   *)
605        AC_MSG_RESULT(yes)
606        ;;
607   esac ],[
608        AC_MSG_RESULT(yes) ]
609 )
610 AC_MSG_CHECKING([whether to support ldaps])
611 AC_ARG_ENABLE(ldaps,
612 AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
613 AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
614 [ case "$enableval" in
615   no)
616        AC_MSG_RESULT(no)
617        AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
618        AC_SUBST(CURL_DISABLE_LDAPS, [1])
619        ;;
620   *)   if test "x$CURL_DISABLE_LDAP" = "x1" ; then
621          AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
622          AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
623          AC_SUBST(CURL_DISABLE_LDAPS, [1])
624        else
625          AC_MSG_RESULT(yes)
626          AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
627          AC_SUBST(HAVE_LDAP_SSL, [1])
628        fi
629        ;;
630   esac ],[
631        if test "x$CURL_DISABLE_LDAP" = "x1" ; then
632          AC_MSG_RESULT(no)
633          AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
634          AC_SUBST(CURL_DISABLE_LDAPS, [1])
635        else
636          AC_MSG_RESULT(yes)
637          AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
638          AC_SUBST(HAVE_LDAP_SSL, [1])
639        fi ]
640 )
641
642 dnl **********************************************************************
643 dnl Check for Hyper
644 dnl **********************************************************************
645
646 OPT_HYPER="no"
647
648 AC_ARG_WITH(hyper,
649 AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
650 AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
651   [OPT_HYPER=$withval])
652 case "$OPT_HYPER" in
653   no)
654     dnl --without-hyper option used
655     want_hyper="no"
656     ;;
657   yes)
658     dnl --with-hyper option used without path
659     want_hyper="default"
660     want_hyper_path=""
661     ;;
662   *)
663     dnl --with-hyper option used with path
664     want_hyper="yes"
665     want_hyper_path="$withval"
666     ;;
667 esac
668
669 if test X"$want_hyper" != Xno; then
670   if test "x$disable_http" = "xyes"; then
671     AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
672   fi
673
674   dnl backup the pre-hyper variables
675   CLEANLDFLAGS="$LDFLAGS"
676   CLEANCPPFLAGS="$CPPFLAGS"
677   CLEANLIBS="$LIBS"
678
679   CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
680
681   if test "$PKGCONFIG" != "no" ; then
682     LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
683       $PKGCONFIG --libs-only-l hyper`
684     CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
685       $PKGCONFIG --cflags-only-I hyper`
686     LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
687       $PKGCONFIG --libs-only-L hyper`
688   else
689     dnl no hyper pkg-config found
690     LIB_HYPER="-lhyper -ldl -lpthread -lm"
691     if test X"$want_hyper" != Xdefault; then
692       CPP_HYPER=-I"$want_hyper_path/capi/include"
693       LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
694     fi
695   fi
696   if test -n "$LIB_HYPER"; then
697     AC_MSG_NOTICE([-l is $LIB_HYPER])
698     AC_MSG_NOTICE([-I is $CPP_HYPER])
699     AC_MSG_NOTICE([-L is $LD_HYPER])
700
701     LDFLAGS="$LDFLAGS $LD_HYPER"
702     CPPFLAGS="$CPPFLAGS $CPP_HYPER"
703     LIBS="$LIB_HYPER $LIBS"
704
705     if test "x$cross_compiling" != "xyes"; then
706       dnl remove -L, separate with colon if more than one
707       DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
708     fi
709
710     AC_CHECK_LIB(hyper, hyper_io_new,
711       [
712        AC_CHECK_HEADERS(hyper.h,
713           experimental="$experimental Hyper"
714           AC_MSG_NOTICE([Hyper support is experimental])
715           curl_h1_msg="enabled (Hyper)"
716           curl_h2_msg=$curl_h1_msg
717           HYPER_ENABLED=1
718           AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
719           AC_SUBST(USE_HYPER, [1])
720           CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
721           export CURL_LIBRARY_PATH
722           AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]),
723        )
724       ],
725       for d in `echo $DIR_HYPER | sed -e 's/:/ /'`; do
726         if test -f "$d/libhyper.a"; then
727           AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
728         fi
729       done
730       AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
731     )
732   fi
733 fi
734
735 if test X"$want_hyper" != Xno; then
736   AC_MSG_NOTICE([Disable RTSP support with hyper])
737   AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
738   AC_SUBST(CURL_DISABLE_RTSP, [1])
739
740 else
741
742   AC_MSG_CHECKING([whether to support rtsp])
743   AC_ARG_ENABLE(rtsp,
744   AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
745   AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
746   [ case "$enableval" in
747     no)
748        AC_MSG_RESULT(no)
749        AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
750        AC_SUBST(CURL_DISABLE_RTSP, [1])
751        ;;
752     *)
753        if test x$CURL_DISABLE_HTTP = x1 ; then
754          AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
755        else
756          AC_MSG_RESULT(yes)
757          curl_rtsp_msg="enabled"
758        fi
759        ;;
760     esac ],
761        if test "x$CURL_DISABLE_HTTP" != "x1"; then
762           AC_MSG_RESULT(yes)
763           curl_rtsp_msg="enabled"
764        else
765           AC_MSG_RESULT(no)
766        fi
767   )
768 fi
769
770 AC_MSG_CHECKING([whether to support proxies])
771 AC_ARG_ENABLE(proxy,
772 AS_HELP_STRING([--enable-proxy],[Enable proxy support])
773 AS_HELP_STRING([--disable-proxy],[Disable proxy support]),
774 [ case "$enableval" in
775   no)
776        AC_MSG_RESULT(no)
777        AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
778        AC_SUBST(CURL_DISABLE_PROXY, [1])
779        https_proxy="no"
780        ;;
781   *)   AC_MSG_RESULT(yes)
782        ;;
783   esac ],
784        AC_MSG_RESULT(yes)
785 )
786
787 AC_MSG_CHECKING([whether to support dict])
788 AC_ARG_ENABLE(dict,
789 AS_HELP_STRING([--enable-dict],[Enable DICT support])
790 AS_HELP_STRING([--disable-dict],[Disable DICT support]),
791 [ case "$enableval" in
792   no)
793        AC_MSG_RESULT(no)
794        AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
795        AC_SUBST(CURL_DISABLE_DICT, [1])
796        ;;
797   *)   AC_MSG_RESULT(yes)
798        ;;
799   esac ],
800        AC_MSG_RESULT(yes)
801 )
802 AC_MSG_CHECKING([whether to support telnet])
803 AC_ARG_ENABLE(telnet,
804 AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
805 AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
806 [ case "$enableval" in
807   no)
808        AC_MSG_RESULT(no)
809        AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
810        AC_SUBST(CURL_DISABLE_TELNET, [1])
811        ;;
812   *)   AC_MSG_RESULT(yes)
813        ;;
814   esac ],
815        AC_MSG_RESULT(yes)
816 )
817 AC_MSG_CHECKING([whether to support tftp])
818 AC_ARG_ENABLE(tftp,
819 AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
820 AS_HELP_STRING([--disable-tftp],[Disable TFTP support]),
821 [ case "$enableval" in
822   no)
823        AC_MSG_RESULT(no)
824        AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
825        AC_SUBST(CURL_DISABLE_TFTP, [1])
826        ;;
827   *)   AC_MSG_RESULT(yes)
828        ;;
829   esac ],
830        AC_MSG_RESULT(yes)
831 )
832
833 AC_MSG_CHECKING([whether to support pop3])
834 AC_ARG_ENABLE(pop3,
835 AS_HELP_STRING([--enable-pop3],[Enable POP3 support])
836 AS_HELP_STRING([--disable-pop3],[Disable POP3 support]),
837 [ case "$enableval" in
838   no)
839        AC_MSG_RESULT(no)
840        AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
841        AC_SUBST(CURL_DISABLE_POP3, [1])
842        ;;
843   *)   AC_MSG_RESULT(yes)
844        ;;
845   esac ],
846        AC_MSG_RESULT(yes)
847 )
848
849
850 AC_MSG_CHECKING([whether to support imap])
851 AC_ARG_ENABLE(imap,
852 AS_HELP_STRING([--enable-imap],[Enable IMAP support])
853 AS_HELP_STRING([--disable-imap],[Disable IMAP support]),
854 [ case "$enableval" in
855   no)
856        AC_MSG_RESULT(no)
857        AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
858        AC_SUBST(CURL_DISABLE_IMAP, [1])
859        ;;
860   *)   AC_MSG_RESULT(yes)
861        ;;
862   esac ],
863        AC_MSG_RESULT(yes)
864 )
865
866
867 AC_MSG_CHECKING([whether to support smb])
868 AC_ARG_ENABLE(smb,
869 AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
870 AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
871 [ case "$enableval" in
872   no)
873        AC_MSG_RESULT(no)
874        AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
875        AC_SUBST(CURL_DISABLE_SMB, [1])
876        ;;
877   *)   AC_MSG_RESULT(yes)
878        ;;
879   esac ],
880        AC_MSG_RESULT(yes)
881 )
882
883 AC_MSG_CHECKING([whether to support smtp])
884 AC_ARG_ENABLE(smtp,
885 AS_HELP_STRING([--enable-smtp],[Enable SMTP support])
886 AS_HELP_STRING([--disable-smtp],[Disable SMTP support]),
887 [ case "$enableval" in
888   no)
889        AC_MSG_RESULT(no)
890        AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
891        AC_SUBST(CURL_DISABLE_SMTP, [1])
892        ;;
893   *)   AC_MSG_RESULT(yes)
894        ;;
895   esac ],
896        AC_MSG_RESULT(yes)
897 )
898
899 AC_MSG_CHECKING([whether to support gopher])
900 AC_ARG_ENABLE(gopher,
901 AS_HELP_STRING([--enable-gopher],[Enable Gopher support])
902 AS_HELP_STRING([--disable-gopher],[Disable Gopher support]),
903 [ case "$enableval" in
904   no)
905        AC_MSG_RESULT(no)
906        AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
907        AC_SUBST(CURL_DISABLE_GOPHER, [1])
908        ;;
909   *)   AC_MSG_RESULT(yes)
910        ;;
911   esac ],
912        AC_MSG_RESULT(yes)
913 )
914
915 AC_MSG_CHECKING([whether to support mqtt])
916 AC_ARG_ENABLE(mqtt,
917 AS_HELP_STRING([--enable-mqtt],[Enable MQTT support])
918 AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
919 [ case "$enableval" in
920   no)
921        AC_MSG_RESULT(no)
922        AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
923        AC_SUBST(CURL_DISABLE_MQTT, [1])
924        ;;
925   *)   AC_MSG_RESULT(yes)
926        ;;
927   esac ],
928        AC_MSG_RESULT(no)
929 )
930
931 dnl **********************************************************************
932 dnl Check for built-in manual
933 dnl **********************************************************************
934
935 AC_MSG_CHECKING([whether to provide built-in manual])
936 AC_ARG_ENABLE(manual,
937 AS_HELP_STRING([--enable-manual],[Enable built-in manual])
938 AS_HELP_STRING([--disable-manual],[Disable built-in manual]),
939 [ case "$enableval" in
940   no)
941        AC_MSG_RESULT(no)
942        ;;
943   *)   AC_MSG_RESULT(yes)
944        USE_MANUAL="1"
945        ;;
946   esac ],
947        AC_MSG_RESULT(yes)
948        USE_MANUAL="1"
949 )
950 dnl The actual use of the USE_MANUAL variable is done much later in this
951 dnl script to allow other actions to disable it as well.
952
953 dnl ************************************************************
954 dnl disable C code generation support
955 dnl
956 AC_MSG_CHECKING([whether to enable generation of C code])
957 AC_ARG_ENABLE(libcurl_option,
958 AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
959 AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
960 [ case "$enableval" in
961   no)
962        AC_MSG_RESULT(no)
963        AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
964        curl_libcurl_msg="no"
965        ;;
966   *)   AC_MSG_RESULT(yes)
967        ;;
968   esac ],
969        AC_MSG_RESULT(yes)
970 )
971
972 dnl **********************************************************************
973 dnl Checks for libraries.
974 dnl **********************************************************************
975
976 AC_MSG_CHECKING([whether to use libgcc])
977 AC_ARG_ENABLE(libgcc,
978 AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
979 [ case "$enableval" in
980   yes)
981        LIBS="-lgcc $LIBS"
982        AC_MSG_RESULT(yes)
983        ;;
984   *)   AC_MSG_RESULT(no)
985        ;;
986   esac ],
987        AC_MSG_RESULT(no)
988 )
989
990 CURL_CHECK_LIB_XNET
991
992 dnl gethostbyname without lib or in the nsl lib?
993 AC_CHECK_FUNC(gethostbyname,
994               [HAVE_GETHOSTBYNAME="1"
995               ],
996               [ AC_CHECK_LIB(nsl, gethostbyname,
997                              [HAVE_GETHOSTBYNAME="1"
998                              LIBS="-lnsl $LIBS"
999                              ])
1000               ])
1001
1002 if test "$HAVE_GETHOSTBYNAME" != "1"
1003 then
1004   dnl gethostbyname in the socket lib?
1005   AC_CHECK_LIB(socket, gethostbyname,
1006                [HAVE_GETHOSTBYNAME="1"
1007                LIBS="-lsocket $LIBS"
1008                ])
1009 fi
1010
1011 if test "$HAVE_GETHOSTBYNAME" != "1"
1012 then
1013   dnl gethostbyname in the watt lib?
1014   AC_CHECK_LIB(watt, gethostbyname,
1015                [HAVE_GETHOSTBYNAME="1"
1016                CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
1017                LDFLAGS="-L/dev/env/WATT_ROOT/lib"
1018                LIBS="-lwatt $LIBS"
1019                ])
1020 fi
1021
1022 dnl At least one system has been identified to require BOTH nsl and socket
1023 dnl libs at the same time to link properly.
1024 if test "$HAVE_GETHOSTBYNAME" != "1"
1025 then
1026   AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
1027   my_ac_save_LIBS=$LIBS
1028   LIBS="-lnsl -lsocket $LIBS"
1029   AC_LINK_IFELSE([
1030     AC_LANG_PROGRAM([[
1031     ]],[[
1032       gethostbyname();
1033     ]])
1034   ],[
1035     AC_MSG_RESULT([yes])
1036     HAVE_GETHOSTBYNAME="1"
1037   ],[
1038     AC_MSG_RESULT([no])
1039     LIBS=$my_ac_save_LIBS
1040   ])
1041 fi
1042
1043 if test "$HAVE_GETHOSTBYNAME" != "1"
1044 then
1045   dnl This is for winsock systems
1046   if test "$curl_cv_header_windows_h" = "yes"; then
1047     if test "$curl_cv_header_winsock2_h" = "yes"; then
1048       winsock_LIB="-lws2_32"
1049     fi
1050     if test ! -z "$winsock_LIB"; then
1051       my_ac_save_LIBS=$LIBS
1052       LIBS="$winsock_LIB $LIBS"
1053       AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
1054       AC_LINK_IFELSE([
1055         AC_LANG_PROGRAM([[
1056 #ifdef HAVE_WINDOWS_H
1057 #ifndef WIN32_LEAN_AND_MEAN
1058 #define WIN32_LEAN_AND_MEAN
1059 #endif
1060 #include <windows.h>
1061 #ifdef HAVE_WINSOCK2_H
1062 #include <winsock2.h>
1063 #endif
1064 #endif
1065         ]],[[
1066           gethostbyname("www.dummysite.com");
1067         ]])
1068       ],[
1069         AC_MSG_RESULT([yes])
1070         HAVE_GETHOSTBYNAME="1"
1071       ],[
1072         AC_MSG_RESULT([no])
1073         winsock_LIB=""
1074         LIBS=$my_ac_save_LIBS
1075       ])
1076     fi
1077   fi
1078 fi
1079
1080 if test "$HAVE_GETHOSTBYNAME" != "1"
1081 then
1082   dnl This is for Minix 3.1
1083   AC_MSG_CHECKING([for gethostbyname for Minix 3])
1084   AC_LINK_IFELSE([
1085     AC_LANG_PROGRAM([[
1086 /* Older Minix versions may need <net/gen/netdb.h> here instead */
1087 #include <netdb.h>
1088     ]],[[
1089       gethostbyname("www.dummysite.com");
1090     ]])
1091   ],[
1092     AC_MSG_RESULT([yes])
1093     HAVE_GETHOSTBYNAME="1"
1094   ],[
1095     AC_MSG_RESULT([no])
1096   ])
1097 fi
1098
1099 if test "$HAVE_GETHOSTBYNAME" != "1"
1100 then
1101   dnl This is for eCos with a stubbed DNS implementation
1102   AC_MSG_CHECKING([for gethostbyname for eCos])
1103   AC_LINK_IFELSE([
1104     AC_LANG_PROGRAM([[
1105 #include <stdio.h>
1106 #include <netdb.h>
1107     ]],[[
1108       gethostbyname("www.dummysite.com");
1109     ]])
1110   ],[
1111     AC_MSG_RESULT([yes])
1112     HAVE_GETHOSTBYNAME="1"
1113   ],[
1114     AC_MSG_RESULT([no])
1115   ])
1116 fi
1117
1118 if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
1119 then
1120   dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
1121   AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
1122   AC_LINK_IFELSE([
1123     AC_LANG_PROGRAM([[
1124   #include <proto/bsdsocket.h>
1125   struct Library *SocketBase = NULL;
1126     ]],[[
1127       gethostbyname("www.dummysite.com");
1128     ]])
1129   ],[
1130     AC_MSG_RESULT([yes])
1131     HAVE_GETHOSTBYNAME="1"
1132     HAVE_PROTO_BSDSOCKET_H="1"
1133     AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
1134     AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
1135   ],[
1136     AC_MSG_RESULT([no])
1137   ])
1138 fi
1139
1140 if test "$HAVE_GETHOSTBYNAME" != "1"
1141 then
1142   dnl gethostbyname in the network lib - for Haiku OS
1143   AC_CHECK_LIB(network, gethostbyname,
1144                [HAVE_GETHOSTBYNAME="1"
1145                LIBS="-lnetwork $LIBS"
1146                ])
1147 fi
1148
1149 if test "$HAVE_GETHOSTBYNAME" != "1"
1150 then
1151   dnl gethostbyname in the net lib - for BeOS
1152   AC_CHECK_LIB(net, gethostbyname,
1153                [HAVE_GETHOSTBYNAME="1"
1154                LIBS="-lnet $LIBS"
1155                ])
1156 fi
1157
1158
1159 if test "$HAVE_GETHOSTBYNAME" != "1"; then
1160   AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
1161 fi
1162
1163 CURL_CHECK_LIBS_CONNECT
1164
1165 CURL_NETWORK_LIBS=$LIBS
1166
1167 dnl **********************************************************************
1168 dnl In case that function clock_gettime with monotonic timer is available,
1169 dnl check for additional required libraries.
1170 dnl **********************************************************************
1171 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
1172
1173 dnl **********************************************************************
1174 dnl The preceding library checks are all potentially useful for test
1175 dnl servers and libtest cases which require networking and clock_gettime
1176 dnl support.  Save the list of required libraries at this point for use
1177 dnl while linking those test servers and programs.
1178 dnl **********************************************************************
1179 CURL_NETWORK_AND_TIME_LIBS=$LIBS
1180
1181 dnl **********************************************************************
1182 dnl Check for the presence of ZLIB libraries and headers
1183 dnl **********************************************************************
1184
1185 dnl Check for & handle argument to --with-zlib.
1186
1187 clean_CPPFLAGS=$CPPFLAGS
1188 clean_LDFLAGS=$LDFLAGS
1189 clean_LIBS=$LIBS
1190 ZLIB_LIBS=""
1191 AC_ARG_WITH(zlib,
1192 AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1193 AS_HELP_STRING([--without-zlib],[disable use of zlib]),
1194                [OPT_ZLIB="$withval"])
1195
1196 if test "$OPT_ZLIB" = "no" ; then
1197     AC_MSG_WARN([zlib disabled])
1198 else
1199   if test "$OPT_ZLIB" = "yes" ; then
1200     OPT_ZLIB=""
1201   fi
1202
1203   if test -z "$OPT_ZLIB" ; then
1204     CURL_CHECK_PKGCONFIG(zlib)
1205
1206     if test "$PKGCONFIG" != "no" ; then
1207       LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
1208       LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
1209       CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
1210       OPT_ZLIB=""
1211       HAVE_LIBZ="1"
1212     fi
1213
1214     if test -z "$HAVE_LIBZ"; then
1215
1216       dnl Check for the lib without setting any new path, since many
1217       dnl people have it in the default path
1218
1219       AC_CHECK_LIB(z, inflateEnd,
1220                    dnl libz found, set the variable
1221                    [HAVE_LIBZ="1"
1222                     LIBS="-lz $LIBS"],
1223                    dnl if no lib found, try /usr/local
1224                    [OPT_ZLIB="/usr/local"])
1225     fi
1226   fi
1227
1228   dnl Add a nonempty path to the compiler flags
1229   if test -n "$OPT_ZLIB"; then
1230      CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1231      LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1232   fi
1233
1234   AC_CHECK_HEADER(zlib.h,
1235     [
1236     dnl zlib.h was found
1237     HAVE_ZLIB_H="1"
1238     dnl if the lib wasn't found already, try again with the new paths
1239     if test "$HAVE_LIBZ" != "1"; then
1240       AC_CHECK_LIB(z, gzread,
1241                    [
1242                    dnl the lib was found!
1243                    HAVE_LIBZ="1"
1244                    LIBS="-lz $LIBS"
1245                    ],
1246                    [ CPPFLAGS=$clean_CPPFLAGS
1247                    LDFLAGS=$clean_LDFLAGS])
1248     fi
1249     ],
1250     [
1251       dnl zlib.h was not found, restore the flags
1252       CPPFLAGS=$clean_CPPFLAGS
1253       LDFLAGS=$clean_LDFLAGS]
1254     )
1255
1256   if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
1257   then
1258     AC_MSG_WARN([configure found only the libz lib, not the header file!])
1259     HAVE_LIBZ=""
1260     CPPFLAGS=$clean_CPPFLAGS
1261     LDFLAGS=$clean_LDFLAGS
1262     LIBS=$clean_LIBS
1263   elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
1264   then
1265     AC_MSG_WARN([configure found only the libz header file, not the lib!])
1266     CPPFLAGS=$clean_CPPFLAGS
1267     LDFLAGS=$clean_LDFLAGS
1268     LIBS=$clean_LIBS
1269   elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
1270   then
1271     dnl both header and lib were found!
1272     AC_SUBST(HAVE_LIBZ)
1273     AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
1274     AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1275
1276     ZLIB_LIBS="-lz"
1277     LIBS="-lz $clean_LIBS"
1278
1279     dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1280     AMFIXLIB="1"
1281     AC_MSG_NOTICE([found both libz and libz.h header])
1282     curl_zlib_msg="enabled"
1283   fi
1284 fi
1285
1286 dnl set variable for use in automakefile(s)
1287 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
1288 AC_SUBST(ZLIB_LIBS)
1289
1290 dnl **********************************************************************
1291 dnl Check for the presence of BROTLI decoder libraries and headers
1292 dnl **********************************************************************
1293
1294 dnl Brotli project home page: https://github.com/google/brotli
1295
1296 dnl Default to compiler & linker defaults for BROTLI files & libraries.
1297 OPT_BROTLI=off
1298 AC_ARG_WITH(brotli,dnl
1299 AS_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1300 AS_HELP_STRING([--without-brotli], [disable BROTLI]),
1301   OPT_BROTLI=$withval)
1302
1303 if test X"$OPT_BROTLI" != Xno; then
1304   dnl backup the pre-brotli variables
1305   CLEANLDFLAGS="$LDFLAGS"
1306   CLEANCPPFLAGS="$CPPFLAGS"
1307   CLEANLIBS="$LIBS"
1308
1309   case "$OPT_BROTLI" in
1310   yes)
1311     dnl --with-brotli (without path) used
1312     CURL_CHECK_PKGCONFIG(libbrotlidec)
1313
1314     if test "$PKGCONFIG" != "no" ; then
1315       LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1316       LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1317       CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1318       version=`$PKGCONFIG --modversion libbrotlidec`
1319       DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
1320     fi
1321
1322     ;;
1323   off)
1324     dnl no --with-brotli option given, just check default places
1325     ;;
1326   *)
1327     dnl use the given --with-brotli spot
1328     PREFIX_BROTLI=$OPT_BROTLI
1329     ;;
1330   esac
1331
1332   dnl if given with a prefix, we set -L and -I based on that
1333   if test -n "$PREFIX_BROTLI"; then
1334     LIB_BROTLI="-lbrotlidec"
1335     LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1336     CPP_BROTLI=-I${PREFIX_BROTLI}/include
1337     DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1338   fi
1339
1340   LDFLAGS="$LDFLAGS $LD_BROTLI"
1341   CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1342   LIBS="$LIB_BROTLI $LIBS"
1343
1344   AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1345
1346   AC_CHECK_HEADERS(brotli/decode.h,
1347     curl_brotli_msg="enabled (libbrotlidec)"
1348     HAVE_BROTLI=1
1349     AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1350     AC_SUBST(HAVE_BROTLI, [1])
1351   )
1352
1353   if test X"$OPT_BROTLI" != Xoff &&
1354      test "$HAVE_BROTLI" != "1"; then
1355     AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
1356   fi
1357
1358   if test "$HAVE_BROTLI" = "1"; then
1359     if test -n "$DIR_BROTLI"; then
1360        dnl when the brotli shared libs were found in a path that the run-time
1361        dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
1362        dnl to prevent further configure tests to fail due to this
1363
1364        if test "x$cross_compiling" != "xyes"; then
1365          CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1366          export CURL_LIBRARY_PATH
1367          AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1368        fi
1369     fi
1370   else
1371     dnl no brotli, revert back to clean variables
1372     LDFLAGS=$CLEANLDFLAGS
1373     CPPFLAGS=$CLEANCPPFLAGS
1374     LIBS=$CLEANLIBS
1375   fi
1376 fi
1377
1378 dnl **********************************************************************
1379 dnl Check for libzstd
1380 dnl **********************************************************************
1381
1382 dnl Default to compiler & linker defaults for libzstd
1383 OPT_ZSTD=off
1384 AC_ARG_WITH(zstd,dnl
1385 AS_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1386 AS_HELP_STRING([--without-zstd], [disable libzstd]),
1387   OPT_ZSTD=$withval)
1388
1389 if test X"$OPT_ZSTD" != Xno; then
1390   dnl backup the pre-zstd variables
1391   CLEANLDFLAGS="$LDFLAGS"
1392   CLEANCPPFLAGS="$CPPFLAGS"
1393   CLEANLIBS="$LIBS"
1394
1395   case "$OPT_ZSTD" in
1396   yes)
1397     dnl --with-zstd (without path) used
1398     CURL_CHECK_PKGCONFIG(libzstd)
1399
1400     if test "$PKGCONFIG" != "no" ; then
1401       LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
1402       LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
1403       CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
1404       version=`$PKGCONFIG --modversion libzstd`
1405       DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
1406     fi
1407
1408     ;;
1409   off)
1410     dnl no --with-zstd option given, just check default places
1411     ;;
1412   *)
1413     dnl use the given --with-zstd spot
1414     PREFIX_ZSTD=$OPT_ZSTD
1415     ;;
1416   esac
1417
1418   dnl if given with a prefix, we set -L and -I based on that
1419   if test -n "$PREFIX_ZSTD"; then
1420     LIB_ZSTD="-lzstd"
1421     LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
1422     CPP_ZSTD=-I${PREFIX_ZSTD}/include
1423     DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
1424   fi
1425
1426   LDFLAGS="$LDFLAGS $LD_ZSTD"
1427   CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
1428   LIBS="$LIB_ZSTD $LIBS"
1429
1430   AC_CHECK_LIB(zstd, ZSTD_createDStream)
1431
1432   AC_CHECK_HEADERS(zstd.h,
1433     curl_zstd_msg="enabled (libzstd)"
1434     HAVE_ZSTD=1
1435     AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
1436     AC_SUBST(HAVE_ZSTD, [1])
1437   )
1438
1439   if test X"$OPT_ZSTD" != Xoff &&
1440      test "$HAVE_ZSTD" != "1"; then
1441     AC_MSG_ERROR([libzstd was not found where specified!])
1442   fi
1443
1444   if test "$HAVE_ZSTD" = "1"; then
1445     if test -n "$DIR_ZSTD"; then
1446        dnl when the zstd shared lib were found in a path that the run-time
1447        dnl linker doesn't search through, we need to add it to
1448        dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
1449        dnl this
1450
1451        if test "x$cross_compiling" != "xyes"; then
1452          CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
1453          export CURL_LIBRARY_PATH
1454          AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
1455        fi
1456     fi
1457   else
1458     dnl no zstd, revert back to clean variables
1459     LDFLAGS=$CLEANLDFLAGS
1460     CPPFLAGS=$CLEANCPPFLAGS
1461     LIBS=$CLEANLIBS
1462   fi
1463 fi
1464
1465 dnl **********************************************************************
1466 dnl Check for LDAP
1467 dnl **********************************************************************
1468
1469 LDAPLIBNAME=""
1470 AC_ARG_WITH(ldap-lib,
1471 AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
1472  [LDAPLIBNAME="$withval"])
1473
1474 LBERLIBNAME=""
1475 AC_ARG_WITH(lber-lib,
1476 AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
1477  [LBERLIBNAME="$withval"])
1478
1479 if test x$CURL_DISABLE_LDAP != x1 ; then
1480
1481   CURL_CHECK_HEADER_LBER
1482   CURL_CHECK_HEADER_LDAP
1483   CURL_CHECK_HEADER_LDAPSSL
1484   CURL_CHECK_HEADER_LDAP_SSL
1485
1486   if test -z "$LDAPLIBNAME" ; then
1487     if test "$curl_cv_native_windows" = "yes"; then
1488       dnl Windows uses a single and unique LDAP library name
1489       LDAPLIBNAME="wldap32"
1490       LBERLIBNAME="no"
1491     fi
1492   fi
1493
1494   if test "$LDAPLIBNAME" ; then
1495     AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
1496       if test -n "$ldap_askedfor"; then
1497         AC_MSG_ERROR([couldn't detect the LDAP libraries])
1498       fi
1499       AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
1500       AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1501       AC_SUBST(CURL_DISABLE_LDAP, [1])
1502       AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1503       AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1504   else
1505     dnl Try to find the right ldap libraries for this system
1506     CURL_CHECK_LIBS_LDAP
1507     case X-"$curl_cv_ldap_LIBS" in
1508       X-unknown)
1509         if test -n "$ldap_askedfor"; then
1510           AC_MSG_ERROR([couldn't detect the LDAP libraries])
1511         fi
1512         AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
1513         AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1514         AC_SUBST(CURL_DISABLE_LDAP, [1])
1515         AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1516         AC_SUBST(CURL_DISABLE_LDAPS, [1])
1517         ;;
1518     esac
1519   fi
1520 fi
1521
1522 if test x$CURL_DISABLE_LDAP != x1 ; then
1523
1524   if test "$LBERLIBNAME" ; then
1525     dnl If name is "no" then don't define this library at all
1526     dnl (it's only needed if libldap.so's dependencies are broken).
1527     if test "$LBERLIBNAME" != "no" ; then
1528       AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
1529         AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
1530         AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
1531         AC_SUBST(CURL_DISABLE_LDAP, [1])
1532         AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
1533         AC_SUBST(CURL_DISABLE_LDAPS, [1])])
1534     fi
1535   fi
1536 fi
1537
1538 if test x$CURL_DISABLE_LDAP != x1 ; then
1539   AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
1540
1541   if test "$LDAPLIBNAME" = "wldap32"; then
1542     curl_ldap_msg="enabled (winldap)"
1543     AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
1544   else
1545     curl_ldap_msg="enabled (OpenLDAP)"
1546     if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
1547       AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
1548       AC_SUBST(USE_OPENLDAP, [1])
1549     fi
1550   fi
1551 fi
1552
1553 if test x$CURL_DISABLE_LDAPS != x1 ; then
1554     curl_ldaps_msg="enabled"
1555 fi
1556
1557 dnl **********************************************************************
1558 dnl Checks for IPv6
1559 dnl **********************************************************************
1560
1561 AC_MSG_CHECKING([whether to enable IPv6])
1562 AC_ARG_ENABLE(ipv6,
1563 AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1564 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1565 [ case "$enableval" in
1566   no)
1567        AC_MSG_RESULT(no)
1568        ipv6=no
1569        ;;
1570   *)   AC_MSG_RESULT(yes)
1571        ipv6=yes
1572        ;;
1573   esac ],
1574
1575   AC_RUN_IFELSE([AC_LANG_SOURCE([[
1576 /* are AF_INET6 and sockaddr_in6 available? */
1577 #include <sys/types.h>
1578 #ifdef HAVE_WINSOCK2_H
1579 #include <winsock2.h>
1580 #include <ws2tcpip.h>
1581 #else
1582 #include <sys/socket.h>
1583 #include <netinet/in.h>
1584 #if defined (__TANDEM)
1585 # include <netinet/in6.h>
1586 #endif
1587 #endif
1588 #include <stdlib.h> /* for exit() */
1589 main()
1590 {
1591  struct sockaddr_in6 s;
1592  (void)s;
1593  if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1594    exit(1);
1595  else
1596    exit(0);
1597 }
1598 ]])
1599 ],
1600   AC_MSG_RESULT(yes)
1601   ipv6=yes,
1602   AC_MSG_RESULT(no)
1603   ipv6=no,
1604   AC_MSG_RESULT(yes)
1605   ipv6=yes
1606 ))
1607
1608 if test "$ipv6" = yes; then
1609   curl_ipv6_msg="enabled"
1610   AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
1611   IPV6_ENABLED=1
1612   AC_SUBST(IPV6_ENABLED)
1613
1614   AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1615   AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
1616 #include <sys/types.h>
1617 #ifdef HAVE_WINSOCK2_H
1618 #include <winsock2.h>
1619 #include <ws2tcpip.h>
1620 #else
1621 #include <netinet/in.h>
1622 #if defined (__TANDEM)
1623 # include <netinet/in6.h>
1624 #endif
1625 #endif
1626 ]], [[
1627   struct sockaddr_in6 s;
1628   s.sin6_scope_id = 0;
1629 ]])], [
1630   AC_MSG_RESULT([yes])
1631   AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1632  ], [
1633     AC_MSG_RESULT([no])
1634  ])
1635 fi
1636
1637 dnl **********************************************************************
1638 dnl Check if the operating system allows programs to write to their own argv[]
1639 dnl **********************************************************************
1640
1641 AC_MSG_CHECKING([if argv can be written to])
1642 CURL_RUN_IFELSE([[
1643 int main(int argc, char **argv)
1644 {
1645   (void)argc;
1646   argv[0][0] = ' ';
1647   return (argv[0][0] == ' ')?0:1;
1648 }
1649 ]],[
1650   curl_cv_writable_argv=yes
1651 ],[
1652   curl_cv_writable_argv=no
1653 ],[
1654   curl_cv_writable_argv=cross
1655 ])
1656 case $curl_cv_writable_argv in
1657 yes)
1658         AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1659         AC_MSG_RESULT(yes)
1660         ;;
1661 no)
1662         AC_MSG_RESULT(no)
1663         ;;
1664 *)
1665         AC_MSG_RESULT(no)
1666         AC_MSG_WARN([the previous check could not be made default was used])
1667         ;;
1668 esac
1669
1670 dnl **********************************************************************
1671 dnl Check for GSS-API libraries
1672 dnl **********************************************************************
1673
1674 dnl check for GSS-API stuff in the /usr as default
1675
1676 GSSAPI_ROOT="/usr"
1677 AC_ARG_WITH(gssapi-includes,
1678   AS_HELP_STRING([--with-gssapi-includes=DIR],
1679                  [Specify location of GSS-API headers]),
1680   [ GSSAPI_INCS="-I$withval"
1681     want_gss="yes" ]
1682 )
1683
1684 AC_ARG_WITH(gssapi-libs,
1685   AS_HELP_STRING([--with-gssapi-libs=DIR],
1686                  [Specify location of GSS-API libs]),
1687   [ GSSAPI_LIB_DIR="-L$withval"
1688     want_gss="yes" ]
1689 )
1690
1691 AC_ARG_WITH(gssapi,
1692   AS_HELP_STRING([--with-gssapi=DIR],
1693                  [Where to look for GSS-API]), [
1694   GSSAPI_ROOT="$withval"
1695   if test x"$GSSAPI_ROOT" != xno; then
1696     want_gss="yes"
1697     if test x"$GSSAPI_ROOT" = xyes; then
1698       dnl if yes, then use default root
1699       GSSAPI_ROOT="/usr"
1700     fi
1701   fi
1702 ])
1703
1704 save_CPPFLAGS="$CPPFLAGS"
1705 AC_MSG_CHECKING([if GSS-API support is requested])
1706 if test x"$want_gss" = xyes; then
1707   AC_MSG_RESULT(yes)
1708
1709   CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1710   if test -z "$GSSAPI_INCS"; then
1711      if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1712         GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1713      elif test "$PKGCONFIG" != "no" ; then
1714         GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
1715      elif test "$GSSAPI_ROOT" != "yes"; then
1716         GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1717      fi
1718   fi
1719
1720   CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1721
1722   AC_CHECK_HEADER(gss.h,
1723     [
1724       dnl found in the given dirs
1725       AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1726       gnu_gss=yes
1727     ],
1728     [
1729       dnl not found, check Heimdal or MIT
1730       AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1731       AC_CHECK_HEADERS(
1732         [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1733         [],
1734         [not_mit=1],
1735         [
1736 AC_INCLUDES_DEFAULT
1737 #ifdef HAVE_GSSAPI_GSSAPI_H
1738 #include <gssapi/gssapi.h>
1739 #endif
1740         ])
1741       if test "x$not_mit" = "x1"; then
1742         dnl MIT not found, check for Heimdal
1743         AC_CHECK_HEADER(gssapi.h,
1744             [
1745               dnl found
1746               AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
1747             ],
1748             [
1749               dnl no header found, disabling GSS
1750               want_gss=no
1751               AC_MSG_WARN(disabling GSS-API support since no header files were found)
1752             ]
1753           )
1754       else
1755         dnl MIT found
1756         AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
1757         dnl check if we have a really old MIT Kerberos version (<= 1.2)
1758         AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
1759         AC_COMPILE_IFELSE([
1760           AC_LANG_PROGRAM([[
1761 #include <gssapi/gssapi.h>
1762 #include <gssapi/gssapi_generic.h>
1763 #include <gssapi/gssapi_krb5.h>
1764           ]],[[
1765             gss_import_name(
1766                             (OM_uint32 *)0,
1767                             (gss_buffer_t)0,
1768                             GSS_C_NT_HOSTBASED_SERVICE,
1769                             (gss_name_t *)0);
1770           ]])
1771         ],[
1772           AC_MSG_RESULT([yes])
1773         ],[
1774           AC_MSG_RESULT([no])
1775           AC_DEFINE(HAVE_OLD_GSSMIT, 1,
1776             [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
1777         ])
1778       fi
1779     ]
1780   )
1781 else
1782   AC_MSG_RESULT(no)
1783 fi
1784 if test x"$want_gss" = xyes; then
1785   AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1786   HAVE_GSSAPI=1
1787   curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
1788
1789   if test -n "$gnu_gss"; then
1790     curl_gss_msg="enabled (GNU GSS)"
1791     LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1792     LIBS="-lgss $LIBS"
1793   elif test -z "$GSSAPI_LIB_DIR"; then
1794      case $host in
1795      *-*-darwin*)
1796         LIBS="-lgssapi_krb5 -lresolv $LIBS"
1797         ;;
1798      *)
1799         CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1800         if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1801            dnl krb5-config doesn't have --libs-only-L or similar, put everything
1802            dnl into LIBS
1803            gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
1804            LIBS="$gss_libs $LIBS"
1805         elif test "$PKGCONFIG" != "no" ; then
1806            gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
1807            LIBS="$gss_libs $LIBS"
1808         else
1809            case $host in
1810            *-hp-hpux*)
1811               gss_libname="gss"
1812               ;;
1813            *)
1814               gss_libname="gssapi"
1815               ;;
1816            esac
1817
1818            if test "$GSSAPI_ROOT" != "yes"; then
1819               LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1820               LIBS="-l$gss_libname $LIBS"
1821            else
1822               LIBS="-l$gss_libname $LIBS"
1823            fi
1824         fi
1825         ;;
1826      esac
1827   else
1828      LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1829      case $host in
1830      *-hp-hpux*)
1831         LIBS="-lgss $LIBS"
1832         ;;
1833      *)
1834         LIBS="-lgssapi $LIBS"
1835         ;;
1836      esac
1837   fi
1838 else
1839   CPPFLAGS="$save_CPPFLAGS"
1840 fi
1841
1842 build_libstubgss=no
1843 if test x"$want_gss" = "xyes"; then
1844   build_libstubgss=yes
1845 fi
1846
1847 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
1848
1849 dnl -------------------------------------------------------------
1850 dnl parse --with-default-ssl-backend so it can be validated below
1851 dnl -------------------------------------------------------------
1852
1853 DEFAULT_SSL_BACKEND=no
1854 VALID_DEFAULT_SSL_BACKEND=
1855 AC_ARG_WITH(default-ssl-backend,
1856 AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
1857 AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
1858   [DEFAULT_SSL_BACKEND=$withval])
1859 case "$DEFAULT_SSL_BACKEND" in
1860   no)
1861     dnl --without-default-ssl-backend option used
1862     ;;
1863   default|yes)
1864     dnl --with-default-ssl-backend option used without name
1865     AC_MSG_ERROR([The name of the default SSL backend is required.])
1866     ;;
1867   *)
1868     dnl --with-default-ssl-backend option used with name
1869     AC_SUBST(DEFAULT_SSL_BACKEND)
1870     dnl needs to be validated below
1871     VALID_DEFAULT_SSL_BACKEND=no
1872     ;;
1873 esac
1874
1875 CURL_WITH_SCHANNEL
1876 CURL_WITH_SECURETRANSPORT
1877 CURL_WITH_AMISSL
1878 CURL_WITH_OPENSSL
1879 CURL_WITH_GNUTLS
1880 CURL_WITH_MBEDTLS
1881 CURL_WITH_WOLFSSL
1882 CURL_WITH_MESALINK
1883 CURL_WITH_BEARSSL
1884 CURL_WITH_RUSTLS
1885 CURL_WITH_NSS
1886
1887 dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
1888 if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then
1889   LIBS="-ladvapi32 -lcrypt32 $LIBS"
1890 fi
1891
1892 case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$MESALINK_ENABLED$BEARSSL_ENABLED$AMISSL_ENABLED$RUSTLS_ENABLED"
1893 in
1894 x)
1895   AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
1896   AC_MSG_WARN([Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-mesalink, --with-amissl, --with-bearssl or --with-rustls to address this.])
1897   ;;
1898 x1)
1899   # one SSL backend is enabled
1900   AC_SUBST(SSL_ENABLED)
1901   SSL_ENABLED="1"
1902   AC_MSG_NOTICE([built with one SSL backend])
1903   ;;
1904 *)
1905   # more than one SSL backend is enabled
1906   AC_SUBST(SSL_ENABLED)
1907   SSL_ENABLED="1"
1908   AC_SUBST(CURL_WITH_MULTI_SSL)
1909   CURL_WITH_MULTI_SSL="1"
1910   AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
1911   AC_MSG_NOTICE([built with multiple SSL backends])
1912   ;;
1913 esac
1914
1915 if test -n "$ssl_backends"; then
1916   curl_ssl_msg="enabled ($ssl_backends)"
1917 fi
1918
1919 if test no = "$VALID_DEFAULT_SSL_BACKEND"
1920 then
1921   if test -n "$SSL_ENABLED"
1922   then
1923     AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
1924   else
1925     AC_MSG_ERROR([Default SSL backend requires SSL!])
1926   fi
1927 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
1928 then
1929   AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
1930 fi
1931
1932 dnl **********************************************************************
1933 dnl Check for the CA bundle
1934 dnl **********************************************************************
1935
1936 if test -n "$check_for_ca_bundle"; then
1937   CURL_CHECK_CA_BUNDLE
1938 fi
1939
1940 dnl **********************************************************************
1941 dnl Check for libpsl
1942 dnl **********************************************************************
1943
1944 AC_ARG_WITH(libpsl,
1945            AS_HELP_STRING([--without-libpsl],
1946            [disable support for libpsl cookie checking]),
1947            with_libpsl=$withval,
1948            with_libpsl=yes)
1949 if test $with_libpsl != "no"; then
1950   AC_SEARCH_LIBS(psl_builtin, psl,
1951     [curl_psl_msg="enabled";
1952      AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
1953      ],
1954     [curl_psl_msg="no      (libpsl not found)";
1955      AC_MSG_WARN([libpsl was not found])
1956      ]
1957   )
1958 fi
1959 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
1960
1961
1962 dnl **********************************************************************
1963 dnl Check for libgsasl
1964 dnl **********************************************************************
1965
1966 AC_ARG_WITH(libgsasl,
1967            AS_HELP_STRING([--without-libgsasl],
1968            [disable libgsasl support for SCRAM]),
1969            with_libgsasl=$withval,
1970            with_libgsasl=yes)
1971 if test $with_libgsasl != "no"; then
1972   AC_SEARCH_LIBS(gsasl_init, gsasl,
1973     [curl_gsasl_msg="enabled";
1974      AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
1975      ],
1976     [curl_gsasl_msg="no      (libgsasl not found)";
1977      AC_MSG_WARN([libgsasl was not found])
1978      ]
1979   )
1980 fi
1981 AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
1982
1983 AC_ARG_WITH(libmetalink,,
1984   AC_MSG_ERROR([--with-libmetalink no longer works!]))
1985
1986 dnl **********************************************************************
1987 dnl Check for the presence of LIBSSH2 libraries and headers
1988 dnl **********************************************************************
1989
1990 dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
1991 OPT_LIBSSH2=off
1992 AC_ARG_WITH(libssh2,dnl
1993 AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1994 AS_HELP_STRING([--with-libssh2], [enable libssh2]),
1995   OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
1996
1997
1998 OPT_LIBSSH=off
1999 AC_ARG_WITH(libssh,dnl
2000 AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2001 AS_HELP_STRING([--with-libssh], [enable libssh]),
2002   OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2003
2004 OPT_WOLFSSH=off
2005 AC_ARG_WITH(wolfssh,dnl
2006 AS_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2007 AS_HELP_STRING([--with-wolfssh], [enable wolfssh]),
2008   OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
2009
2010 if test X"$OPT_LIBSSH2" != Xno; then
2011   dnl backup the pre-libssh2 variables
2012   CLEANLDFLAGS="$LDFLAGS"
2013   CLEANCPPFLAGS="$CPPFLAGS"
2014   CLEANLIBS="$LIBS"
2015
2016   case "$OPT_LIBSSH2" in
2017   yes)
2018     dnl --with-libssh2 (without path) used
2019     CURL_CHECK_PKGCONFIG(libssh2)
2020
2021     if test "$PKGCONFIG" != "no" ; then
2022       LIB_SSH2=`$PKGCONFIG --libs libssh2`
2023       LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2024       CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2025       version=`$PKGCONFIG --modversion libssh2`
2026       DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
2027     fi
2028
2029     ;;
2030   off)
2031     dnl no --with-libssh2 option given, just check default places
2032     ;;
2033   *)
2034     dnl use the given --with-libssh2 spot
2035     PREFIX_SSH2=$OPT_LIBSSH2
2036     ;;
2037   esac
2038
2039   dnl if given with a prefix, we set -L and -I based on that
2040   if test -n "$PREFIX_SSH2"; then
2041     LIB_SSH2="-lssh2"
2042     LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2043     CPP_SSH2=-I${PREFIX_SSH2}/include
2044     DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2045   fi
2046
2047   LDFLAGS="$LDFLAGS $LD_SSH2"
2048   CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2049   LIBS="$LIB_SSH2 $LIBS"
2050
2051   dnl check for function added in libssh2 version 1.0
2052   AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
2053
2054   AC_CHECK_HEADERS(libssh2.h,
2055     curl_ssh_msg="enabled (libSSH2)"
2056     LIBSSH2_ENABLED=1
2057     AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
2058     AC_SUBST(USE_LIBSSH2, [1])
2059   )
2060
2061   if test X"$OPT_LIBSSH2" != Xoff &&
2062      test "$LIBSSH2_ENABLED" != "1"; then
2063     AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
2064   fi
2065
2066   if test "$LIBSSH2_ENABLED" = "1"; then
2067     if test -n "$DIR_SSH2"; then
2068        dnl when the libssh2 shared libs were found in a path that the run-time
2069        dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2070        dnl to prevent further configure tests to fail due to this
2071
2072        if test "x$cross_compiling" != "xyes"; then
2073          CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
2074          export CURL_LIBRARY_PATH
2075          AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2076        fi
2077     fi
2078   else
2079     dnl no libssh2, revert back to clean variables
2080     LDFLAGS=$CLEANLDFLAGS
2081     CPPFLAGS=$CLEANCPPFLAGS
2082     LIBS=$CLEANLIBS
2083   fi
2084 elif test X"$OPT_LIBSSH" != Xno; then
2085   dnl backup the pre-libssh variables
2086   CLEANLDFLAGS="$LDFLAGS"
2087   CLEANCPPFLAGS="$CPPFLAGS"
2088   CLEANLIBS="$LIBS"
2089
2090   case "$OPT_LIBSSH" in
2091   yes)
2092     dnl --with-libssh (without path) used
2093     CURL_CHECK_PKGCONFIG(libssh)
2094
2095     if test "$PKGCONFIG" != "no" ; then
2096       LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2097       LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2098       CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2099       version=`$PKGCONFIG --modversion libssh`
2100       DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
2101     fi
2102
2103     ;;
2104   off)
2105     dnl no --with-libssh option given, just check default places
2106     ;;
2107   *)
2108     dnl use the given --with-libssh spot
2109     PREFIX_SSH=$OPT_LIBSSH
2110     ;;
2111   esac
2112
2113   dnl if given with a prefix, we set -L and -I based on that
2114   if test -n "$PREFIX_SSH"; then
2115     LIB_SSH="-lssh"
2116     LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2117     CPP_SSH=-I${PREFIX_SSH}/include
2118     DIR_SSH=${PREFIX_SSH}/lib$libsuff
2119   fi
2120
2121   LDFLAGS="$LDFLAGS $LD_SSH"
2122   CPPFLAGS="$CPPFLAGS $CPP_SSH"
2123   LIBS="$LIB_SSH $LIBS"
2124
2125   AC_CHECK_LIB(ssh, ssh_new)
2126
2127   AC_CHECK_HEADERS(libssh/libssh.h,
2128     curl_ssh_msg="enabled (libSSH)"
2129     LIBSSH_ENABLED=1
2130     AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
2131     AC_SUBST(USE_LIBSSH, [1])
2132   )
2133
2134   if test X"$OPT_LIBSSH" != Xoff &&
2135      test "$LIBSSH_ENABLED" != "1"; then
2136     AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
2137   fi
2138
2139   if test "$LIBSSH_ENABLED" = "1"; then
2140     if test -n "$DIR_SSH"; then
2141        dnl when the libssh shared libs were found in a path that the run-time
2142        dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2143        dnl to prevent further configure tests to fail due to this
2144
2145        if test "x$cross_compiling" != "xyes"; then
2146          CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
2147          export CURL_LIBRARY_PATH
2148          AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
2149        fi
2150     fi
2151   else
2152     dnl no libssh, revert back to clean variables
2153     LDFLAGS=$CLEANLDFLAGS
2154     CPPFLAGS=$CLEANCPPFLAGS
2155     LIBS=$CLEANLIBS
2156   fi
2157 elif test X"$OPT_WOLFSSH" != Xno; then
2158   dnl backup the pre-wolfssh variables
2159   CLEANLDFLAGS="$LDFLAGS"
2160   CLEANCPPFLAGS="$CPPFLAGS"
2161   CLEANLIBS="$LIBS"
2162
2163
2164   if test "$OPT_WOLFSSH" != yes; then
2165      WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
2166      LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
2167      CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
2168   fi
2169
2170   AC_CHECK_LIB(wolfssh, wolfSSH_Init)
2171
2172   AC_CHECK_HEADERS(wolfssh/ssh.h,
2173     curl_ssh_msg="enabled (wolfSSH)"
2174     WOLFSSH_ENABLED=1
2175     AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
2176     AC_SUBST(USE_WOLFSSH, [1])
2177   )
2178
2179 fi
2180
2181 dnl **********************************************************************
2182 dnl Check for the presence of LIBRTMP libraries and headers
2183 dnl **********************************************************************
2184
2185 dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
2186 OPT_LIBRTMP=off
2187 AC_ARG_WITH(librtmp,dnl
2188 AS_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2189 AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2190   OPT_LIBRTMP=$withval)
2191
2192 if test X"$OPT_LIBRTMP" != Xno; then
2193   dnl backup the pre-librtmp variables
2194   CLEANLDFLAGS="$LDFLAGS"
2195   CLEANCPPFLAGS="$CPPFLAGS"
2196   CLEANLIBS="$LIBS"
2197
2198   case "$OPT_LIBRTMP" in
2199   yes)
2200     dnl --with-librtmp (without path) used
2201     CURL_CHECK_PKGCONFIG(librtmp)
2202
2203     if test "$PKGCONFIG" != "no" ; then
2204       LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
2205       LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
2206       CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
2207       version=`$PKGCONFIG --modversion librtmp`
2208       DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
2209     else
2210       dnl To avoid link errors, we do not allow --librtmp without
2211       dnl a pkgconfig file
2212       AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2213     fi
2214
2215     ;;
2216   off)
2217     dnl no --with-librtmp option given, just check default places
2218     LIB_RTMP="-lrtmp"
2219     ;;
2220   *)
2221     dnl use the given --with-librtmp spot
2222     LIB_RTMP="-lrtmp"
2223     PREFIX_RTMP=$OPT_LIBRTMP
2224     ;;
2225   esac
2226
2227   dnl if given with a prefix, we set -L and -I based on that
2228   if test -n "$PREFIX_RTMP"; then
2229     LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
2230     CPP_RTMP=-I${PREFIX_RTMP}/include
2231     DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
2232   fi
2233
2234   LDFLAGS="$LDFLAGS $LD_RTMP"
2235   CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2236   LIBS="$LIB_RTMP $LIBS"
2237
2238   AC_CHECK_LIB(rtmp, RTMP_Init,
2239     [
2240      AC_CHECK_HEADERS(librtmp/rtmp.h,
2241         curl_rtmp_msg="enabled (librtmp)"
2242         LIBRTMP_ENABLED=1
2243         AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
2244         AC_SUBST(USE_LIBRTMP, [1])
2245      )
2246     ],
2247       dnl not found, revert back to clean variables
2248       LDFLAGS=$CLEANLDFLAGS
2249       CPPFLAGS=$CLEANCPPFLAGS
2250       LIBS=$CLEANLIBS
2251   )
2252
2253   if test X"$OPT_LIBRTMP" != Xoff &&
2254      test "$LIBRTMP_ENABLED" != "1"; then
2255     AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
2256   fi
2257
2258 fi
2259
2260 dnl **********************************************************************
2261 dnl Check for linker switch for versioned symbols
2262 dnl **********************************************************************
2263
2264 versioned_symbols_flavour=
2265 AC_MSG_CHECKING([whether versioned symbols are wanted])
2266 AC_ARG_ENABLE(versioned-symbols,
2267 AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2268 AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2269 [ case "$enableval" in
2270   yes) AC_MSG_RESULT(yes)
2271     AC_MSG_CHECKING([if libraries can be versioned])
2272     GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
2273     if test -z "$GLD"; then
2274         AC_MSG_RESULT(no)
2275         AC_MSG_WARN([You need an ld version supporting the --version-script option])
2276     else
2277         AC_MSG_RESULT(yes)
2278         if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
2279           versioned_symbols_flavour="MULTISSL_"
2280         elif test "x$OPENSSL_ENABLED" = "x1"; then
2281           versioned_symbols_flavour="OPENSSL_"
2282         elif test "x$GNUTLS_ENABLED" = "x1"; then
2283           versioned_symbols_flavour="GNUTLS_"
2284         elif test "x$NSS_ENABLED" = "x1"; then
2285           versioned_symbols_flavour="NSS_"
2286         elif test "x$WOLFSSL_ENABLED" = "x1"; then
2287           versioned_symbols_flavour="WOLFSSL_"
2288         elif test "x$SCHANNEL_ENABLED" = "x1"; then
2289           versioned_symbols_flavour="SCHANNEL_"
2290         elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
2291           versioned_symbols_flavour="SECURE_TRANSPORT_"
2292         else
2293           versioned_symbols_flavour=""
2294         fi
2295         versioned_symbols="yes"
2296     fi
2297     ;;
2298
2299   *)   AC_MSG_RESULT(no)
2300     ;;
2301   esac
2302 ], [
2303 AC_MSG_RESULT(no)
2304 ]
2305 )
2306
2307 AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
2308   ["$versioned_symbols_flavour"])
2309 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
2310   [test "x$versioned_symbols" = 'xyes'])
2311
2312 dnl -------------------------------------------------
2313 dnl check winidn option before other IDN libraries
2314 dnl -------------------------------------------------
2315
2316 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
2317 OPT_WINIDN="default"
2318 AC_ARG_WITH(winidn,
2319 AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
2320 AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
2321   OPT_WINIDN=$withval)
2322 case "$OPT_WINIDN" in
2323   no|default)
2324     dnl --without-winidn option used or configure option not specified
2325     want_winidn="no"
2326     AC_MSG_RESULT([no])
2327     ;;
2328   yes)
2329     dnl --with-winidn option used without path
2330     want_winidn="yes"
2331     want_winidn_path="default"
2332     AC_MSG_RESULT([yes])
2333     ;;
2334   *)
2335     dnl --with-winidn option used with path
2336     want_winidn="yes"
2337     want_winidn_path="$withval"
2338     AC_MSG_RESULT([yes ($withval)])
2339     ;;
2340 esac
2341
2342 if test "$want_winidn" = "yes"; then
2343   dnl winidn library support has been requested
2344   clean_CFLAGS="$CFLAGS"
2345   clean_CPPFLAGS="$CPPFLAGS"
2346   clean_LDFLAGS="$LDFLAGS"
2347   clean_LIBS="$LIBS"
2348   WINIDN_LIBS="-lnormaliz"
2349   WINIDN_CPPFLAGS=""
2350   #
2351   if test "$want_winidn_path" != "default"; then
2352     dnl path has been specified
2353     dnl pkg-config not available or provides no info
2354     WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
2355     WINIDN_CPPFLAGS="-I$want_winidn_path/include"
2356     WINIDN_DIR="$want_winidn_path/lib$libsuff"
2357   fi
2358   #
2359   dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
2360   AC_COMPILE_IFELSE([
2361     AC_LANG_PROGRAM([[
2362       #include <windows.h>
2363     ]],[[
2364       #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
2365       #error
2366       #endif
2367     ]])
2368   ],[
2369   ],[
2370      CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2371      CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2372      CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
2373      CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
2374      WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
2375   ])
2376   #
2377   CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
2378   LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
2379   LIBS="$WINIDN_LIBS $LIBS"
2380   #
2381   AC_MSG_CHECKING([if IdnToUnicode can be linked])
2382   AC_LINK_IFELSE([
2383     AC_LANG_PROGRAM([[
2384       #include <windows.h>
2385     ]],[[
2386       IdnToUnicode(0, NULL, 0, NULL, 0);
2387     ]])
2388   ],[
2389     AC_MSG_RESULT([yes])
2390     tst_links_winidn="yes"
2391   ],[
2392     AC_MSG_RESULT([no])
2393     tst_links_winidn="no"
2394   ])
2395   #
2396   if test "$tst_links_winidn" = "yes"; then
2397     AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
2398     AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
2399     AC_SUBST([IDN_ENABLED], [1])
2400     curl_idn_msg="enabled (Windows-native)"
2401   else
2402     AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2403     CFLAGS="$clean_CFLAGS"
2404     CPPFLAGS="$clean_CPPFLAGS"
2405     LDFLAGS="$clean_LDFLAGS"
2406     LIBS="$clean_LIBS"
2407   fi
2408 fi
2409
2410 dnl **********************************************************************
2411 dnl Check for ICU-UC (IDN support)
2412 dnl **********************************************************************
2413
2414 AC_MSG_CHECKING([whether to build with icu-uc])
2415 OPT_IDN="default"
2416 AC_ARG_WITH(icu-uc,
2417 AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
2418 AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
2419   [OPT_IDN=$withval])
2420 case "$OPT_IDN" in
2421   no)
2422     dnl --without-icu-uc option used
2423     want_idn="no"
2424     AC_MSG_RESULT([no])
2425     ;;
2426   default)
2427     dnl configure option not specified
2428     want_idn="yes"
2429     want_idn_path="default"
2430     AC_MSG_RESULT([(assumed) yes])
2431     ;;
2432   yes)
2433     dnl --with-icu-uc option used without path
2434     want_idn="yes"
2435     want_idn_path="default"
2436     AC_MSG_RESULT([yes])
2437     ;;
2438   *)
2439     dnl --with-icu-uc option used with path
2440     want_idn="yes"
2441     want_idn_path="$withval"
2442     AC_MSG_RESULT([yes ($withval)])
2443     ;;
2444 esac
2445
2446 if test "$want_idn" = "yes"; then
2447   dnl idn library support has been requested
2448   clean_CPPFLAGS="$CPPFLAGS"
2449   clean_LDFLAGS="$LDFLAGS"
2450   clean_LIBS="$LIBS"
2451   PKGCONFIG="no"
2452   #
2453   if test "$want_idn_path" != "default"; then
2454     dnl path has been specified
2455     IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2456     CURL_CHECK_PKGCONFIG(icu-uc, [$IDN_PCDIR])
2457     if test "$PKGCONFIG" != "no"; then
2458       IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2459         $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
2460       IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2461         $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
2462       IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2463         $PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
2464       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
2465     else
2466       dnl pkg-config not available or provides no info
2467       IDN_LIBS="-licu-uc"
2468       IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2469       IDN_CPPFLAGS="-I$want_idn_path/include"
2470       IDN_DIR="$want_idn_path/lib$libsuff"
2471     fi
2472   else
2473     dnl path not specified
2474     CURL_CHECK_PKGCONFIG(icu-uc)
2475     if test "$PKGCONFIG" != "no"; then
2476       IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
2477       IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
2478       IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
2479       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
2480     else
2481       dnl pkg-config not available or provides no info
2482       IDN_LIBS="-licu-uc"
2483     fi
2484   fi
2485   #
2486   if test "$PKGCONFIG" != "no"; then
2487     AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2488     AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2489     AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2490     AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2491   else
2492     AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2493     AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2494     AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2495     AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2496   fi
2497   #
2498   CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
2499   LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
2500   LIBS="$IDN_LIBS $LIBS"
2501   #
2502   AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
2503   AC_LINK_IFELSE([
2504     AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
2505   ],[
2506     AC_MSG_RESULT([yes])
2507     tst_links_icu="yes"
2508   ],[
2509     AC_MSG_RESULT([no])
2510     tst_links_icu="no"
2511   ])
2512   #
2513   if test "$tst_links_icu" = "yes"; then
2514     AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
2515     dnl different versions of libidn have different setups of these:
2516
2517     AC_SUBST([IDN_ENABLED], [1])
2518     curl_idn_msg="enabled (icu-uc)"
2519     if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2520       LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
2521       export LD_LIBRARY_PATH
2522       AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
2523     fi
2524   else
2525     AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2526     CPPFLAGS="$clean_CPPFLAGS"
2527     LDFLAGS="$clean_LDFLAGS"
2528     LIBS="$clean_LIBS"
2529   fi
2530
2531 fi
2532
2533 dnl **********************************************************************
2534 dnl Check for the presence of IDN libraries and headers
2535 dnl **********************************************************************
2536
2537 AC_MSG_CHECKING([whether to build with libidn2])
2538 OPT_IDN="default"
2539 AC_ARG_WITH(libidn2,
2540 AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
2541 AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2542   [OPT_IDN=$withval])
2543 case "$OPT_IDN" in
2544   no)
2545     dnl --without-libidn2 option used
2546     want_idn="no"
2547     AC_MSG_RESULT([no])
2548     ;;
2549   default)
2550     dnl configure option not specified
2551     want_idn="yes"
2552     want_idn_path="default"
2553     AC_MSG_RESULT([(assumed) yes])
2554     ;;
2555   yes)
2556     dnl --with-libidn2 option used without path
2557     want_idn="yes"
2558     want_idn_path="default"
2559     AC_MSG_RESULT([yes])
2560     ;;
2561   *)
2562     dnl --with-libidn2 option used with path
2563     want_idn="yes"
2564     want_idn_path="$withval"
2565     AC_MSG_RESULT([yes ($withval)])
2566     ;;
2567 esac
2568
2569 if test "$want_idn" = "yes"; then
2570   dnl idn library support has been requested
2571   clean_CPPFLAGS="$CPPFLAGS"
2572   clean_LDFLAGS="$LDFLAGS"
2573   clean_LIBS="$LIBS"
2574   PKGCONFIG="no"
2575   #
2576   if test "$want_idn_path" != "default"; then
2577     dnl path has been specified
2578     IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2579     CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
2580     if test "$PKGCONFIG" != "no"; then
2581       IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2582         $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2583       IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2584         $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2585       IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2586         $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2587       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2588     else
2589       dnl pkg-config not available or provides no info
2590       IDN_LIBS="-lidn2"
2591       IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
2592       IDN_CPPFLAGS="-I$want_idn_path/include"
2593       IDN_DIR="$want_idn_path/lib$libsuff"
2594     fi
2595   else
2596     dnl path not specified
2597     CURL_CHECK_PKGCONFIG(libidn2)
2598     if test "$PKGCONFIG" != "no"; then
2599       IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2600       IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2601       IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2602       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2603     else
2604       dnl pkg-config not available or provides no info
2605       IDN_LIBS="-lidn2"
2606     fi
2607   fi
2608   #
2609   if test "$PKGCONFIG" != "no"; then
2610     AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
2611     AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
2612     AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2613     AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
2614   else
2615     AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
2616     AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
2617     AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
2618     AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
2619   fi
2620   #
2621   CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
2622   LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
2623   LIBS="$IDN_LIBS $LIBS"
2624   #
2625   AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
2626   AC_LINK_IFELSE([
2627     AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
2628   ],[
2629     AC_MSG_RESULT([yes])
2630     tst_links_libidn="yes"
2631   ],[
2632     AC_MSG_RESULT([no])
2633     tst_links_libidn="no"
2634   ])
2635   #
2636   AC_CHECK_HEADERS( idn2.h )
2637
2638   if test "$tst_links_libidn" = "yes"; then
2639     AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
2640     dnl different versions of libidn have different setups of these:
2641
2642     AC_SUBST([IDN_ENABLED], [1])
2643     curl_idn_msg="enabled (libidn2)"
2644     if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2645       CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
2646       export CURL_LIBRARY_PATH
2647       AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
2648     fi
2649   else
2650     AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2651     CPPFLAGS="$clean_CPPFLAGS"
2652     LDFLAGS="$clean_LDFLAGS"
2653     LIBS="$clean_LIBS"
2654   fi
2655 fi
2656
2657 dnl Let's hope this split URL remains working:
2658 dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
2659 dnl genprogc/thread_quick_ref.htm
2660
2661 dnl **********************************************************************
2662 dnl Check for strict SSL check
2663 dnl **********************************************************************
2664 AC_ARG_ENABLE([strict-ssl-check],
2665     AS_HELP_STRING([--enable-strict-ssl-check], [Enable strict SSL check usage]),
2666     [enable_strict_ssl_check=yes],
2667     [enable_strict_ssl_check=no])
2668
2669 AS_IF([test "x$enable_strict_ssl_check" = "xyes"], [
2670     CPPFLAGS+=" -DUSE_TIZEN_FEATURE_STRICT_SSL_CHECK"
2671     SUPPORT_TIZEN_FEATURES="$SUPPORT_TIZEN_FEATURES strict-ssl-check"
2672 ])
2673
2674 AM_CONDITIONAL(USE_TIZEN_FEATURE_STRICT_SSL_CHECK, test "x$enable_strict_ssl_check" = "xyes")
2675
2676 dnl **********************************************************************
2677 dnl Check for DLP
2678 dnl **********************************************************************
2679
2680 AC_ARG_ENABLE([dlp],
2681     AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
2682
2683 AS_IF([test "x$enable_dlp" = "xyes"], [
2684     AC_DEFINE(HAVE_TIZEN_DLP, 1, [Enadle DLP])
2685     LIBS="-ldl $LIBS"
2686 ])
2687
2688 AM_CONDITIONAL(HAVE_TIZEN_DLP, test "x$enable_dlp" = "xyes")
2689
2690 dnl **********************************************************************
2691 dnl Check for nghttp2
2692 dnl **********************************************************************
2693
2694 OPT_H2="yes"
2695
2696 if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
2697   # without HTTP or with Hyper, nghttp2 is no use
2698   OPT_H2="no"
2699 fi
2700
2701 AC_ARG_WITH(nghttp2,
2702 AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
2703 AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2704   [OPT_H2=$withval])
2705 case "$OPT_H2" in
2706   no)
2707     dnl --without-nghttp2 option used
2708     want_nghttp2="no"
2709     ;;
2710   yes)
2711     dnl --with-nghttp2 option used without path
2712     want_nghttp2="default"
2713     want_nghttp2_path=""
2714     ;;
2715   *)
2716     dnl --with-nghttp2 option used with path
2717     want_nghttp2="yes"
2718     want_nghttp2_path="$withval/lib/pkgconfig"
2719     ;;
2720 esac
2721
2722 if test X"$want_nghttp2" != Xno; then
2723   dnl backup the pre-nghttp2 variables
2724   CLEANLDFLAGS="$LDFLAGS"
2725   CLEANCPPFLAGS="$CPPFLAGS"
2726   CLEANLIBS="$LIBS"
2727
2728   CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_path)
2729
2730   if test "$PKGCONFIG" != "no" ; then
2731     LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path])
2732       $PKGCONFIG --libs-only-l libnghttp2`
2733     AC_MSG_NOTICE([-l is $LIB_H2])
2734
2735     CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path]) dnl
2736       $PKGCONFIG --cflags-only-I libnghttp2`
2737     AC_MSG_NOTICE([-I is $CPP_H2])
2738
2739     LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_path])
2740       $PKGCONFIG --libs-only-L libnghttp2`
2741     AC_MSG_NOTICE([-L is $LD_H2])
2742
2743     LDFLAGS="$LDFLAGS $LD_H2"
2744     CPPFLAGS="$CPPFLAGS $CPP_H2"
2745     LIBS="$LIB_H2 $LIBS"
2746
2747     # use nghttp2_session_set_local_window_size to require nghttp2
2748     # >= 1.12.0
2749     AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
2750       [
2751        AC_CHECK_HEADERS(nghttp2/nghttp2.h,
2752           curl_h2_msg="enabled (nghttp2)"
2753           NGHTTP2_ENABLED=1
2754           AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
2755           AC_SUBST(USE_NGHTTP2, [1])
2756        )
2757       ],
2758         dnl not found, revert back to clean variables
2759         LDFLAGS=$CLEANLDFLAGS
2760         CPPFLAGS=$CLEANCPPFLAGS
2761         LIBS=$CLEANLIBS
2762     )
2763
2764   else
2765     dnl no nghttp2 pkg-config found, deal with it
2766     if test X"$want_nghttp2" != Xdefault; then
2767       dnl To avoid link errors, we do not allow --with-nghttp2 without
2768       dnl a pkgconfig file
2769       AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2770     fi
2771   fi
2772
2773 fi
2774
2775 dnl **********************************************************************
2776 dnl Check for ngtcp2 (QUIC)
2777 dnl **********************************************************************
2778
2779 OPT_TCP2="yes"
2780
2781 if test "x$disable_http" = "xyes"; then
2782   # without HTTP, ngtcp2 is no use
2783   OPT_TCP2="no"
2784 fi
2785
2786 AC_ARG_WITH(ngtcp2,
2787 AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
2788 AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
2789   [OPT_TCP2=$withval])
2790 case "$OPT_TCP2" in
2791   no)
2792     dnl --without-ngtcp2 option used
2793     want_tcp2="no"
2794     ;;
2795   yes)
2796     dnl --with-ngtcp2 option used without path
2797     want_tcp2="default"
2798     want_tcp2_path=""
2799     ;;
2800   *)
2801     dnl --with-ngtcp2 option used with path
2802     want_tcp2="yes"
2803     want_tcp2_path="$withval/lib/pkgconfig"
2804     ;;
2805 esac
2806
2807 curl_tcp2_msg="no      (--with-ngtcp2)"
2808 if test X"$want_tcp2" != Xno; then
2809   dnl backup the pre-ngtcp2 variables
2810   CLEANLDFLAGS="$LDFLAGS"
2811   CLEANCPPFLAGS="$CPPFLAGS"
2812   CLEANLIBS="$LIBS"
2813
2814   CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
2815
2816   if test "$PKGCONFIG" != "no" ; then
2817     LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2818       $PKGCONFIG --libs-only-l libngtcp2`
2819     AC_MSG_NOTICE([-l is $LIB_TCP2])
2820
2821     CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2822       $PKGCONFIG --cflags-only-I libngtcp2`
2823     AC_MSG_NOTICE([-I is $CPP_TCP2])
2824
2825     LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2826       $PKGCONFIG --libs-only-L libngtcp2`
2827     AC_MSG_NOTICE([-L is $LD_TCP2])
2828
2829     LDFLAGS="$LDFLAGS $LD_TCP2"
2830     CPPFLAGS="$CPPFLAGS $CPP_TCP2"
2831     LIBS="$LIB_TCP2 $LIBS"
2832
2833     if test "x$cross_compiling" != "xyes"; then
2834       DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
2835     fi
2836     AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
2837       [
2838        AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
2839           NGTCP2_ENABLED=1
2840           AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
2841           AC_SUBST(USE_NGTCP2, [1])
2842           CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
2843           export CURL_LIBRARY_PATH
2844           AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
2845        )
2846       ],
2847         dnl not found, revert back to clean variables
2848         LDFLAGS=$CLEANLDFLAGS
2849         CPPFLAGS=$CLEANCPPFLAGS
2850         LIBS=$CLEANLIBS
2851     )
2852
2853   else
2854     dnl no ngtcp2 pkg-config found, deal with it
2855     if test X"$want_tcp2" != Xdefault; then
2856       dnl To avoid link errors, we do not allow --with-ngtcp2 without
2857       dnl a pkgconfig file
2858       AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
2859     fi
2860   fi
2861
2862 fi
2863
2864 if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
2865   dnl backup the pre-ngtcp2_crypto_openssl variables
2866   CLEANLDFLAGS="$LDFLAGS"
2867   CLEANCPPFLAGS="$CPPFLAGS"
2868   CLEANLIBS="$LIBS"
2869
2870   CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
2871
2872   if test "$PKGCONFIG" != "no" ; then
2873     LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2874       $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
2875     AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
2876
2877     CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2878       $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
2879     AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
2880
2881     LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2882       $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
2883     AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
2884
2885     LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
2886     CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
2887     LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
2888
2889     if test "x$cross_compiling" != "xyes"; then
2890       DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
2891     fi
2892     AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
2893       [
2894        AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2895           NGTCP2_ENABLED=1
2896           AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
2897           AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
2898           CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
2899           export CURL_LIBRARY_PATH
2900           AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
2901        )
2902       ],
2903         dnl not found, revert back to clean variables
2904         LDFLAGS=$CLEANLDFLAGS
2905         CPPFLAGS=$CLEANCPPFLAGS
2906         LIBS=$CLEANLIBS
2907     )
2908
2909   else
2910     dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
2911     if test X"$want_tcp2" != Xdefault; then
2912       dnl To avoid link errors, we do not allow --with-ngtcp2 without
2913       dnl a pkgconfig file
2914       AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
2915     fi
2916   fi
2917 fi
2918
2919 if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
2920   dnl backup the pre-ngtcp2_crypto_gnutls variables
2921   CLEANLDFLAGS="$LDFLAGS"
2922   CLEANCPPFLAGS="$CPPFLAGS"
2923   CLEANLIBS="$LIBS"
2924
2925   CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
2926
2927   if test "$PKGCONFIG" != "no" ; then
2928     LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2929       $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
2930     AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
2931
2932     CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
2933       $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
2934     AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
2935
2936     LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
2937       $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
2938     AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
2939
2940     LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
2941     CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
2942     LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
2943
2944     if test "x$cross_compiling" != "xyes"; then
2945       DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
2946     fi
2947     AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_ctx_initial,
2948       [
2949        AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
2950           NGTCP2_ENABLED=1
2951           AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
2952           AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
2953           CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
2954           export CURL_LIBRARY_PATH
2955           AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
2956        )
2957       ],
2958         dnl not found, revert back to clean variables
2959         LDFLAGS=$CLEANLDFLAGS
2960         CPPFLAGS=$CLEANCPPFLAGS
2961         LIBS=$CLEANLIBS
2962     )
2963
2964   else
2965     dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
2966     if test X"$want_tcp2" != Xdefault; then
2967       dnl To avoid link errors, we do not allow --with-ngtcp2 without
2968       dnl a pkgconfig file
2969       AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
2970     fi
2971   fi
2972 fi
2973
2974 dnl **********************************************************************
2975 dnl Check for nghttp3 (HTTP/3 with ngtcp2)
2976 dnl **********************************************************************
2977
2978 OPT_NGHTTP3="yes"
2979
2980 if test "x$NGTCP2_ENABLED" = "x"; then
2981   # without ngtcp2, nghttp3 is of no use for us
2982   OPT_NGHTTP3="no"
2983 fi
2984
2985 AC_ARG_WITH(nghttp3,
2986 AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
2987 AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
2988   [OPT_NGHTTP3=$withval])
2989 case "$OPT_NGHTTP3" in
2990   no)
2991     dnl --without-nghttp3 option used
2992     want_nghttp3="no"
2993     ;;
2994   yes)
2995     dnl --with-nghttp3 option used without path
2996     want_nghttp3="default"
2997     want_nghttp3_path=""
2998     ;;
2999   *)
3000     dnl --with-nghttp3 option used with path
3001     want_nghttp3="yes"
3002     want_nghttp3_path="$withval/lib/pkgconfig"
3003     ;;
3004 esac
3005
3006 curl_http3_msg="no      (--with-nghttp3)"
3007 if test X"$want_nghttp3" != Xno; then
3008   dnl backup the pre-nghttp3 variables
3009   CLEANLDFLAGS="$LDFLAGS"
3010   CLEANCPPFLAGS="$CPPFLAGS"
3011   CLEANLIBS="$LIBS"
3012
3013   CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3014
3015   if test "$PKGCONFIG" != "no" ; then
3016     LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3017       $PKGCONFIG --libs-only-l libnghttp3`
3018     AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3019
3020     CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
3021       $PKGCONFIG --cflags-only-I libnghttp3`
3022     AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3023
3024     LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3025       $PKGCONFIG --libs-only-L libnghttp3`
3026     AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3027
3028     LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3029     CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3030     LIBS="$LIB_NGHTTP3 $LIBS"
3031
3032     if test "x$cross_compiling" != "xyes"; then
3033       DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
3034     fi
3035     AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
3036       [
3037        AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3038           curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3039           NGHTTP3_ENABLED=1
3040           AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3041           AC_SUBST(USE_NGHTTP3, [1])
3042           CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3043           export CURL_LIBRARY_PATH
3044           AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3045           experimental="$experimental HTTP3"
3046        )
3047       ],
3048         dnl not found, revert back to clean variables
3049         LDFLAGS=$CLEANLDFLAGS
3050         CPPFLAGS=$CLEANCPPFLAGS
3051         LIBS=$CLEANLIBS
3052     )
3053
3054   else
3055     dnl no nghttp3 pkg-config found, deal with it
3056     if test X"$want_nghttp3" != Xdefault; then
3057       dnl To avoid link errors, we do not allow --with-nghttp3 without
3058       dnl a pkgconfig file
3059       AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3060     fi
3061   fi
3062
3063 fi
3064
3065 dnl **********************************************************************
3066 dnl Check for quiche (QUIC)
3067 dnl **********************************************************************
3068
3069 OPT_QUICHE="no"
3070
3071 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
3072   # without HTTP or with ngtcp2, quiche is no use
3073   OPT_QUICHE="no"
3074 fi
3075
3076 AC_ARG_WITH(quiche,
3077 AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
3078 AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
3079   [OPT_QUICHE=$withval])
3080 case "$OPT_QUICHE" in
3081   no)
3082     dnl --without-quiche option used
3083     want_quiche="no"
3084     ;;
3085   yes)
3086     dnl --with-quiche option used without path
3087     want_quiche="default"
3088     want_quiche_path=""
3089     ;;
3090   *)
3091     dnl --with-quiche option used with path
3092     want_quiche="yes"
3093     want_quiche_path="$withval"
3094     ;;
3095 esac
3096
3097 if test X"$want_quiche" != Xno; then
3098
3099   if test "$NGHTTP3_ENABLED" = 1; then
3100     AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
3101   fi
3102
3103   dnl backup the pre-quiche variables
3104   CLEANLDFLAGS="$LDFLAGS"
3105   CLEANCPPFLAGS="$CPPFLAGS"
3106   CLEANLIBS="$LIBS"
3107
3108   CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3109
3110   if test "$PKGCONFIG" != "no" ; then
3111     LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3112       $PKGCONFIG --libs-only-l quiche`
3113     AC_MSG_NOTICE([-l is $LIB_QUICHE])
3114
3115     CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
3116       $PKGCONFIG --cflags-only-I quiche`
3117     AC_MSG_NOTICE([-I is $CPP_QUICHE])
3118
3119     LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3120       $PKGCONFIG --libs-only-L quiche`
3121     AC_MSG_NOTICE([-L is $LD_QUICHE])
3122
3123     LDFLAGS="$LDFLAGS $LD_QUICHE"
3124     CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3125     LIBS="$LIB_QUICHE $LIBS"
3126
3127     if test "x$cross_compiling" != "xyes"; then
3128       DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
3129     fi
3130     AC_CHECK_LIB(quiche, quiche_connect,
3131       [
3132        AC_CHECK_HEADERS(quiche.h,
3133           experimental="$experimental HTTP3"
3134           AC_MSG_NOTICE([HTTP3 support is experimental])
3135           curl_h3_msg="enabled (quiche)"
3136           QUICHE_ENABLED=1
3137           AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3138           AC_SUBST(USE_QUICHE, [1])
3139           AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
3140           CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3141           export CURL_LIBRARY_PATH
3142           AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
3143           [],
3144           [
3145 AC_INCLUDES_DEFAULT
3146 #include <sys/socket.h>
3147           ]
3148        )
3149       ],
3150         dnl not found, revert back to clean variables
3151         AC_MSG_ERROR([couldn't use quiche])
3152     )
3153   else
3154     dnl no quiche pkg-config found, deal with it
3155     if test X"$want_quiche" != Xdefault; then
3156       dnl To avoid link errors, we do not allow --with-quiche without
3157       dnl a pkgconfig file
3158       AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3159     fi
3160   fi
3161 fi
3162
3163 dnl **********************************************************************
3164 dnl Check for zsh completion path
3165 dnl **********************************************************************
3166
3167 OPT_ZSH_FPATH=default
3168 AC_ARG_WITH(zsh-functions-dir,
3169 AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3170 AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3171   [OPT_ZSH_FPATH=$withval])
3172 case "$OPT_ZSH_FPATH" in
3173   no)
3174     dnl --without-zsh-functions-dir option used
3175     ;;
3176   default|yes)
3177     dnl --with-zsh-functions-dir option used without path
3178     ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3179     AC_SUBST(ZSH_FUNCTIONS_DIR)
3180     ;;
3181   *)
3182     dnl --with-zsh-functions-dir option used with path
3183     ZSH_FUNCTIONS_DIR="$withval"
3184     AC_SUBST(ZSH_FUNCTIONS_DIR)
3185     ;;
3186 esac
3187
3188 dnl **********************************************************************
3189 dnl Check for fish completion path
3190 dnl **********************************************************************
3191
3192 OPT_FISH_FPATH=default
3193 AC_ARG_WITH(fish-functions-dir,
3194 AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3195 AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3196   [OPT_FISH_FPATH=$withval])
3197 case "$OPT_FISH_FPATH" in
3198   no)
3199     dnl --without-fish-functions-dir option used
3200     ;;
3201   default|yes)
3202     dnl --with-fish-functions-dir option used without path
3203     CURL_CHECK_PKGCONFIG(fish)
3204     if test "$PKGCONFIG" != "no" ; then
3205       FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
3206     else
3207       FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3208     fi
3209     AC_SUBST(FISH_FUNCTIONS_DIR)
3210     ;;
3211   *)
3212     dnl --with-fish-functions-dir option used with path
3213     FISH_FUNCTIONS_DIR="$withval"
3214     AC_SUBST(FISH_FUNCTIONS_DIR)
3215     ;;
3216 esac
3217
3218 CURL_CHECK_HEADER_MALLOC
3219 CURL_CHECK_HEADER_MEMORY
3220
3221 dnl Now check for the very most basic headers. Then we can use these
3222 dnl ones as default-headers when checking for the rest!
3223 AC_CHECK_HEADERS(
3224         sys/types.h \
3225         sys/time.h \
3226         sys/select.h \
3227         sys/socket.h \
3228         sys/ioctl.h \
3229         sys/uio.h \
3230         assert.h \
3231         unistd.h \
3232         stdlib.h \
3233         arpa/inet.h \
3234         net/if.h \
3235         netinet/in.h \
3236         netinet/in6.h \
3237         sys/un.h \
3238         linux/tcp.h \
3239         netinet/tcp.h \
3240         netdb.h \
3241         sys/sockio.h \
3242         sys/stat.h \
3243         sys/param.h \
3244         termios.h \
3245         termio.h \
3246         fcntl.h \
3247         alloca.h \
3248         io.h \
3249         pwd.h \
3250         utime.h \
3251         sys/utime.h \
3252         sys/poll.h \
3253         poll.h \
3254         socket.h \
3255         sys/resource.h \
3256         libgen.h \
3257         locale.h \
3258         errno.h \
3259         stdbool.h \
3260         arpa/tftp.h \
3261         sys/filio.h \
3262         sys/wait.h \
3263         setjmp.h,
3264 dnl to do if not found
3265 [],
3266 dnl to do if found
3267 [],
3268 dnl default includes
3269 [
3270 #ifdef HAVE_SYS_TYPES_H
3271 #include <sys/types.h>
3272 #endif
3273 #ifdef HAVE_SYS_TIME_H
3274 #include <sys/time.h>
3275 #endif
3276 #ifdef HAVE_SYS_SELECT_H
3277 #include <sys/select.h>
3278 #elif defined(HAVE_UNISTD_H)
3279 #include <unistd.h>
3280 #endif
3281 #ifdef HAVE_SYS_SOCKET_H
3282 #include <sys/socket.h>
3283 #endif
3284 #ifdef HAVE_NETINET_IN_H
3285 #include <netinet/in.h>
3286 #endif
3287 #ifdef HAVE_NETINET_IN6_H
3288 #include <netinet/in6.h>
3289 #endif
3290 #ifdef HAVE_SYS_UN_H
3291 #include <sys/un.h>
3292 #endif
3293 ]
3294 )
3295
3296
3297 dnl Checks for typedefs, structures, and compiler characteristics.
3298 AC_C_CONST
3299 CURL_CHECK_VARIADIC_MACROS
3300 AC_TYPE_SIZE_T
3301
3302 CURL_CHECK_STRUCT_TIMEVAL
3303 CURL_VERIFY_RUNTIMELIBS
3304
3305 AX_COMPILE_CHECK_SIZEOF(size_t)
3306 AX_COMPILE_CHECK_SIZEOF(long)
3307 AX_COMPILE_CHECK_SIZEOF(int)
3308 AX_COMPILE_CHECK_SIZEOF(short)
3309 AX_COMPILE_CHECK_SIZEOF(time_t)
3310 AX_COMPILE_CHECK_SIZEOF(off_t)
3311
3312 o=$CPPFLAGS
3313 CPPFLAGS="-I$srcdir/include $CPPFLAGS"
3314 AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
3315 #include <curl/system.h>
3316 ])
3317 CPPFLAGS=$o
3318
3319 AC_CHECK_TYPE(long long,
3320    [AC_DEFINE(HAVE_LONGLONG, 1,
3321       [Define to 1 if the compiler supports the 'long long' data type.])]
3322    longlong="yes"
3323 )
3324
3325 if test "xyes" = "x$longlong"; then
3326   AC_MSG_CHECKING([if numberLL works])
3327   AC_COMPILE_IFELSE([
3328     AC_LANG_PROGRAM([[
3329     ]],[[
3330       long long val = 1000LL;
3331     ]])
3332   ],[
3333     AC_MSG_RESULT([yes])
3334     AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
3335   ],[
3336     AC_MSG_RESULT([no])
3337   ])
3338 fi
3339
3340
3341 # check for ssize_t
3342 AC_CHECK_TYPE(ssize_t, ,
3343    AC_DEFINE(ssize_t, int, [the signed version of size_t]))
3344
3345 # check for bool type
3346 AC_CHECK_TYPE([bool],[
3347   AC_DEFINE(HAVE_BOOL_T, 1,
3348     [Define to 1 if bool is an available type.])
3349 ], ,[
3350 #ifdef HAVE_SYS_TYPES_H
3351 #include <sys/types.h>
3352 #endif
3353 #ifdef HAVE_STDBOOL_H
3354 #include <stdbool.h>
3355 #endif
3356 ])
3357
3358 # check for sa_family_t
3359 AC_CHECK_TYPE(sa_family_t,
3360    AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
3361    [
3362    # The windows name?
3363    AC_CHECK_TYPE(ADDRESS_FAMILY,
3364      AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
3365      AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
3366     [
3367 #ifdef HAVE_SYS_SOCKET_H
3368 #include <sys/socket.h>
3369 #endif
3370     ])
3371    ],
3372 [
3373 #ifdef HAVE_SYS_SOCKET_H
3374 #include <sys/socket.h>
3375 #endif
3376 ])
3377
3378 # check for suseconds_t
3379 AC_CHECK_TYPE([suseconds_t],[
3380   AC_DEFINE(HAVE_SUSECONDS_T, 1,
3381     [Define to 1 if suseconds_t is an available type.])
3382 ], ,[
3383 #ifdef HAVE_SYS_TYPES_H
3384 #include <sys/types.h>
3385 #endif
3386 #ifdef HAVE_SYS_TIME_H
3387 #include <sys/time.h>
3388 #endif
3389 ])
3390
3391 AC_MSG_CHECKING([if time_t is unsigned])
3392 CURL_RUN_IFELSE(
3393   [
3394   #include <time.h>
3395   #include <limits.h>
3396   time_t t = -1;
3397   return (t > 0);
3398   ],[
3399   AC_MSG_RESULT([yes])
3400   AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
3401 ],[
3402   AC_MSG_RESULT([no])
3403 ],[
3404   dnl cross-compiling, most systems are unsigned
3405   AC_MSG_RESULT([no])
3406 ])
3407
3408 CURL_CONFIGURE_PULL_SYS_POLL
3409
3410 TYPE_IN_ADDR_T
3411
3412 TYPE_SOCKADDR_STORAGE
3413
3414 CURL_CHECK_FUNC_SELECT
3415
3416 CURL_CHECK_FUNC_RECV
3417 CURL_CHECK_FUNC_SEND
3418 CURL_CHECK_MSG_NOSIGNAL
3419
3420 CURL_CHECK_FUNC_ALARM
3421 CURL_CHECK_FUNC_BASENAME
3422 CURL_CHECK_FUNC_CLOSESOCKET
3423 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
3424 CURL_CHECK_FUNC_CONNECT
3425 CURL_CHECK_FUNC_FCNTL
3426 CURL_CHECK_FUNC_FREEADDRINFO
3427 CURL_CHECK_FUNC_FSETXATTR
3428 CURL_CHECK_FUNC_FTRUNCATE
3429 CURL_CHECK_FUNC_GETADDRINFO
3430 CURL_CHECK_FUNC_GETHOSTBYNAME
3431 CURL_CHECK_FUNC_GETHOSTBYNAME_R
3432 CURL_CHECK_FUNC_GETHOSTNAME
3433 CURL_CHECK_FUNC_GETPEERNAME
3434 CURL_CHECK_FUNC_GETSOCKNAME
3435 CURL_CHECK_FUNC_IF_NAMETOINDEX
3436 CURL_CHECK_FUNC_GETIFADDRS
3437 CURL_CHECK_FUNC_GMTIME_R
3438 CURL_CHECK_FUNC_INET_NTOP
3439 CURL_CHECK_FUNC_INET_PTON
3440 CURL_CHECK_FUNC_IOCTL
3441 CURL_CHECK_FUNC_IOCTLSOCKET
3442 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
3443 CURL_CHECK_FUNC_LOCALTIME_R
3444 CURL_CHECK_FUNC_MEMRCHR
3445 CURL_CHECK_FUNC_POLL
3446 CURL_CHECK_FUNC_SETSOCKOPT
3447 CURL_CHECK_FUNC_SIGACTION
3448 CURL_CHECK_FUNC_SIGINTERRUPT
3449 CURL_CHECK_FUNC_SIGNAL
3450 CURL_CHECK_FUNC_SIGSETJMP
3451 CURL_CHECK_FUNC_SOCKET
3452 CURL_CHECK_FUNC_SOCKETPAIR
3453 CURL_CHECK_FUNC_STRCASECMP
3454 CURL_CHECK_FUNC_STRCMPI
3455 CURL_CHECK_FUNC_STRDUP
3456 CURL_CHECK_FUNC_STRERROR_R
3457 CURL_CHECK_FUNC_STRICMP
3458 CURL_CHECK_FUNC_STRNCMPI
3459 CURL_CHECK_FUNC_STRNICMP
3460 CURL_CHECK_FUNC_STRSTR
3461 CURL_CHECK_FUNC_STRTOK_R
3462 CURL_CHECK_FUNC_STRTOLL
3463 CURL_CHECK_FUNC_WRITEV
3464
3465 case $host in
3466   *msdosdjgpp)
3467      ac_cv_func_pipe=no
3468      skipcheck_pipe=yes
3469      AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
3470     ;;
3471 esac
3472
3473 AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
3474         [[#include <pwd.h>
3475           #include <sys/types.h>]])
3476
3477
3478 AC_CHECK_FUNCS([fnmatch \
3479   geteuid \
3480   getpass_r \
3481   getppid \
3482   getpwuid \
3483   getpwuid_r \
3484   getrlimit \
3485   gettimeofday \
3486   if_nametoindex \
3487   mach_absolute_time \
3488   pipe \
3489   setlocale \
3490   setmode \
3491   setrlimit \
3492   usleep \
3493   utime \
3494   utimes
3495 ],[
3496 ],[
3497   func="$ac_func"
3498   eval skipcheck=\$skipcheck_$func
3499   if test "x$skipcheck" != "xyes"; then
3500     AC_MSG_CHECKING([deeper for $func])
3501     AC_LINK_IFELSE([
3502       AC_LANG_PROGRAM([[
3503       ]],[[
3504         $func ();
3505       ]])
3506     ],[
3507       AC_MSG_RESULT([yes])
3508       eval "ac_cv_func_$func=yes"
3509       AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
3510         [Define to 1 if you have the $func function.])
3511     ],[
3512       AC_MSG_RESULT([but still no])
3513     ])
3514   fi
3515 ])
3516
3517 CURL_CHECK_NONBLOCKING_SOCKET
3518
3519 dnl ************************************************************
3520 dnl nroff tool stuff
3521 dnl
3522
3523 AC_PATH_PROG( PERL, perl, ,
3524   $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
3525 AC_SUBST(PERL)
3526
3527 AC_PATH_PROGS( NROFF, gnroff nroff, ,
3528   $PATH:/usr/bin/:/usr/local/bin )
3529 AC_SUBST(NROFF)
3530
3531 if test -n "$NROFF"; then
3532   dnl only check for nroff options if an nroff command was found
3533
3534   AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
3535   MANOPT="-man"
3536   mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3537   if test -z "$mancheck"; then
3538     MANOPT="-mandoc"
3539    mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
3540     if test -z "$mancheck"; then
3541       MANOPT=""
3542       AC_MSG_RESULT([failed])
3543       AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
3544     else
3545       AC_MSG_RESULT([$MANOPT])
3546     fi
3547   else
3548     AC_MSG_RESULT([$MANOPT])
3549   fi
3550   AC_SUBST(MANOPT)
3551 fi
3552
3553 if test -z "$MANOPT"
3554 then
3555   dnl if no nroff tool was found, or no option that could convert man pages
3556   dnl was found, then disable the built-in manual stuff
3557   AC_MSG_WARN([disabling built-in manual])
3558   USE_MANUAL="no";
3559 fi
3560
3561 dnl *************************************************************************
3562 dnl If the manual variable still is set, then we go with providing a built-in
3563 dnl manual
3564
3565 if test "$USE_MANUAL" = "1"; then
3566   AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
3567   curl_manual_msg="enabled"
3568 fi
3569
3570 dnl set variable for use in automakefile(s)
3571 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
3572
3573 CURL_CHECK_LIB_ARES
3574 AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
3575
3576 if test "x$curl_cv_native_windows" != "xyes" &&
3577    test "x$enable_shared" = "xyes"; then
3578   build_libhostname=yes
3579 else
3580   build_libhostname=no
3581 fi
3582 AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
3583
3584 if test "x$want_ares" != xyes; then
3585   CURL_CHECK_OPTION_THREADED_RESOLVER
3586 fi
3587
3588 dnl ************************************************************
3589 dnl disable POSIX threads
3590 dnl
3591 AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
3592 AC_ARG_ENABLE(pthreads,
3593 AS_HELP_STRING([--enable-pthreads],
3594                [Enable POSIX threads (default for threaded resolver)])
3595 AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
3596 [ case "$enableval" in
3597   no)  AC_MSG_RESULT(no)
3598        want_pthreads=no
3599        ;;
3600   *)   AC_MSG_RESULT(yes)
3601        want_pthreads=yes
3602        ;;
3603   esac ], [
3604        AC_MSG_RESULT(auto)
3605        want_pthreads=auto
3606        ]
3607 )
3608
3609 dnl turn off pthreads if rt is disabled
3610 if test "$want_pthreads" != "no"; then
3611   if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
3612     AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
3613   fi
3614   if test "$dontwant_rt" != "no"; then
3615     dnl if --enable-pthreads was explicit then warn it's being ignored
3616     if test "$want_pthreads" = "yes"; then
3617       AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
3618     fi
3619     want_pthreads=no
3620   fi
3621 fi
3622
3623 dnl turn off pthreads if no threaded resolver
3624 if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
3625   want_pthreads=no
3626 fi
3627
3628 dnl detect pthreads
3629 if test "$want_pthreads" != "no"; then
3630   AC_CHECK_HEADER(pthread.h,
3631     [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
3632       save_CFLAGS="$CFLAGS"
3633       dnl When statically linking against boringssl, -lpthread is added to LIBS.
3634       dnl Make sure to that this does not pass the check below, we really want
3635       dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
3636       dnl lib1541 and lib1565 tests are built with these options. Otherwise
3637       dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
3638       save_LIBS="$LIBS"
3639
3640       LIBS=
3641       dnl Check for libc variants without a separate pthread lib like bionic
3642       AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
3643       LIBS="$save_LIBS"
3644
3645       dnl on HPUX, life is more complicated...
3646       case $host in
3647       *-hp-hpux*)
3648          dnl it doesn't actually work without -lpthread
3649          USE_THREADS_POSIX=""
3650          ;;
3651       *)
3652          ;;
3653       esac
3654
3655       dnl if it wasn't found without lib, search for it in pthread lib
3656       if test "$USE_THREADS_POSIX" != "1"
3657       then
3658         CFLAGS="$CFLAGS -pthread"
3659         # assign PTHREAD for pkg-config use
3660         PTHREAD=" -pthread"
3661         AC_CHECK_LIB(pthread, pthread_create,
3662                      [USE_THREADS_POSIX=1],
3663                      [ CFLAGS="$save_CFLAGS"])
3664       fi
3665
3666       if test "x$USE_THREADS_POSIX" = "x1"
3667       then
3668         AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
3669         curl_res_msg="POSIX threaded"
3670       fi
3671   ])
3672 fi
3673
3674 dnl threaded resolver check
3675 if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
3676   if test "$want_pthreads" = "yes"; then
3677     AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
3678   fi
3679   dnl If native Windows fallback on Win32 threads since no POSIX threads
3680   if test "$curl_cv_native_windows" = "yes"; then
3681     USE_THREADS_WIN32=1
3682     AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
3683     curl_res_msg="Win32 threaded"
3684   else
3685     AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
3686   fi
3687 fi
3688
3689 CURL_CONVERT_INCLUDE_TO_ISYSTEM
3690
3691 dnl ************************************************************
3692 dnl disable verbose text strings
3693 dnl
3694 AC_MSG_CHECKING([whether to enable verbose strings])
3695 AC_ARG_ENABLE(verbose,
3696 AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
3697 AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
3698 [ case "$enableval" in
3699   no)
3700        AC_MSG_RESULT(no)
3701        AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
3702        curl_verbose_msg="no"
3703        ;;
3704   *)   AC_MSG_RESULT(yes)
3705        ;;
3706   esac ],
3707        AC_MSG_RESULT(yes)
3708 )
3709
3710 dnl ************************************************************
3711 dnl enable SSPI support
3712 dnl
3713 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
3714 AC_ARG_ENABLE(sspi,
3715 AS_HELP_STRING([--enable-sspi],[Enable SSPI])
3716 AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
3717 [ case "$enableval" in
3718   yes)
3719        if test "$curl_cv_native_windows" = "yes"; then
3720          AC_MSG_RESULT(yes)
3721          AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
3722          AC_SUBST(USE_WINDOWS_SSPI, [1])
3723          curl_sspi_msg="enabled"
3724        else
3725          AC_MSG_RESULT(no)
3726          AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
3727        fi
3728        ;;
3729   *)
3730        if test "x$SCHANNEL_ENABLED" = "x1"; then
3731          # --with-schannel implies --enable-sspi
3732          AC_MSG_RESULT(yes)
3733        else
3734          AC_MSG_RESULT(no)
3735        fi
3736        ;;
3737   esac ],
3738        if test "x$SCHANNEL_ENABLED" = "x1"; then
3739          # --with-schannel implies --enable-sspi
3740          AC_MSG_RESULT(yes)
3741        else
3742          AC_MSG_RESULT(no)
3743        fi
3744 )
3745
3746 dnl ************************************************************
3747 dnl disable cryptographic authentication
3748 dnl
3749 AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
3750 AC_ARG_ENABLE(crypto-auth,
3751 AS_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
3752 AS_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
3753 [ case "$enableval" in
3754   no)
3755        AC_MSG_RESULT(no)
3756        AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
3757        CURL_DISABLE_CRYPTO_AUTH=1
3758        ;;
3759   *)   AC_MSG_RESULT(yes)
3760        ;;
3761   esac ],
3762        AC_MSG_RESULT(yes)
3763 )
3764
3765 dnl ************************************************************
3766 dnl disable NTLM support
3767 dnl
3768 AC_MSG_CHECKING([whether to support NTLM])
3769 AC_ARG_ENABLE(ntlm,
3770 AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
3771 AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
3772 [ case "$enableval" in
3773   no)
3774        AC_MSG_RESULT(no)
3775        AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
3776        CURL_DISABLE_NTLM=1
3777        ;;
3778   *)   AC_MSG_RESULT(yes)
3779        ;;
3780   esac ],
3781        AC_MSG_RESULT(yes)
3782 )
3783
3784 CURL_CHECK_OPTION_NTLM_WB
3785
3786 CURL_CHECK_NTLM_WB
3787
3788 dnl ************************************************************
3789 dnl disable TLS-SRP authentication
3790 dnl
3791 AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
3792 AC_ARG_ENABLE(tls-srp,
3793 AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
3794 AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
3795 [ case "$enableval" in
3796   no)
3797        AC_MSG_RESULT(no)
3798        want_tls_srp=no
3799        ;;
3800   *)   AC_MSG_RESULT(yes)
3801        want_tls_srp=yes
3802        ;;
3803   esac ],
3804        AC_MSG_RESULT(yes)
3805        want_tls_srp=yes
3806 )
3807
3808 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
3809    AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
3810    USE_TLS_SRP=1
3811    curl_tls_srp_msg="enabled"
3812 fi
3813
3814 dnl ************************************************************
3815 dnl disable Unix domain sockets support
3816 dnl
3817 AC_MSG_CHECKING([whether to enable Unix domain sockets])
3818 AC_ARG_ENABLE(unix-sockets,
3819 AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
3820 AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
3821 [ case "$enableval" in
3822   no)  AC_MSG_RESULT(no)
3823        want_unix_sockets=no
3824        ;;
3825   *)   AC_MSG_RESULT(yes)
3826        want_unix_sockets=yes
3827        ;;
3828   esac ], [
3829        AC_MSG_RESULT(auto)
3830        want_unix_sockets=auto
3831        ]
3832 )
3833 if test "x$want_unix_sockets" != "xno"; then
3834   AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
3835     AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
3836     AC_SUBST(USE_UNIX_SOCKETS, [1])
3837     curl_unix_sockets_msg="enabled"
3838   ], [
3839     if test "x$want_unix_sockets" = "xyes"; then
3840       AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
3841     fi
3842   ], [
3843     #include <sys/un.h>
3844   ])
3845 fi
3846
3847 dnl ************************************************************
3848 dnl disable cookies support
3849 dnl
3850 AC_MSG_CHECKING([whether to support cookies])
3851 AC_ARG_ENABLE(cookies,
3852 AS_HELP_STRING([--enable-cookies],[Enable cookies support])
3853 AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
3854 [ case "$enableval" in
3855   no)
3856        AC_MSG_RESULT(no)
3857        AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
3858        ;;
3859   *)   AC_MSG_RESULT(yes)
3860        ;;
3861   esac ],
3862        AC_MSG_RESULT(yes)
3863 )
3864
3865 dnl ************************************************************
3866 dnl disable socketpair
3867 dnl
3868 AC_MSG_CHECKING([whether to support socketpair])
3869 AC_ARG_ENABLE(socketpair,
3870 AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
3871 AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
3872 [ case "$enableval" in
3873   no)
3874        AC_MSG_RESULT(no)
3875        AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
3876        ;;
3877   *)   AC_MSG_RESULT(yes)
3878        ;;
3879   esac ],
3880        AC_MSG_RESULT(yes)
3881 )
3882
3883 dnl ************************************************************
3884 dnl disable HTTP authentication support
3885 dnl
3886 AC_MSG_CHECKING([whether to support HTTP authentication])
3887 AC_ARG_ENABLE(http-auth,
3888 AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
3889 AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
3890 [ case "$enableval" in
3891   no)
3892        AC_MSG_RESULT(no)
3893        AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
3894        ;;
3895   *)   AC_MSG_RESULT(yes)
3896        ;;
3897   esac ],
3898        AC_MSG_RESULT(yes)
3899 )
3900
3901 dnl ************************************************************
3902 dnl disable DoH support
3903 dnl
3904 AC_MSG_CHECKING([whether to support DoH])
3905 AC_ARG_ENABLE(doh,
3906 AS_HELP_STRING([--enable-doh],[Enable DoH support])
3907 AS_HELP_STRING([--disable-doh],[Disable DoH support]),
3908 [ case "$enableval" in
3909   no)
3910        AC_MSG_RESULT(no)
3911        AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
3912        ;;
3913   *)   AC_MSG_RESULT(yes)
3914        ;;
3915   esac ],
3916        AC_MSG_RESULT(yes)
3917 )
3918
3919 dnl ************************************************************
3920 dnl disable mime API support
3921 dnl
3922 AC_MSG_CHECKING([whether to support the MIME API])
3923 AC_ARG_ENABLE(mime,
3924 AS_HELP_STRING([--enable-mime],[Enable mime API support])
3925 AS_HELP_STRING([--disable-mime],[Disable mime API support]),
3926 [ case "$enableval" in
3927   no)
3928        AC_MSG_RESULT(no)
3929        AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
3930        ;;
3931   *)   AC_MSG_RESULT(yes)
3932        ;;
3933   esac ],
3934        AC_MSG_RESULT(yes)
3935 )
3936
3937 dnl ************************************************************
3938 dnl disable date parsing
3939 dnl
3940 AC_MSG_CHECKING([whether to support date parsing])
3941 AC_ARG_ENABLE(dateparse,
3942 AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
3943 AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
3944 [ case "$enableval" in
3945   no)
3946        AC_MSG_RESULT(no)
3947        AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
3948        ;;
3949   *)   AC_MSG_RESULT(yes)
3950        ;;
3951   esac ],
3952        AC_MSG_RESULT(yes)
3953 )
3954
3955 dnl ************************************************************
3956 dnl disable netrc
3957 dnl
3958 AC_MSG_CHECKING([whether to support netrc parsing])
3959 AC_ARG_ENABLE(netrc,
3960 AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
3961 AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
3962 [ case "$enableval" in
3963   no)
3964        AC_MSG_RESULT(no)
3965        AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
3966        ;;
3967   *)   AC_MSG_RESULT(yes)
3968        ;;
3969   esac ],
3970        AC_MSG_RESULT(yes)
3971 )
3972
3973 dnl ************************************************************
3974 dnl disable progress-meter
3975 dnl
3976 AC_MSG_CHECKING([whether to support progress-meter])
3977 AC_ARG_ENABLE(progress-meter,
3978 AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
3979 AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
3980 [ case "$enableval" in
3981   no)
3982        AC_MSG_RESULT(no)
3983        AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
3984        ;;
3985   *)   AC_MSG_RESULT(yes)
3986        ;;
3987   esac ],
3988        AC_MSG_RESULT(yes)
3989 )
3990
3991 dnl ************************************************************
3992 dnl disable shuffle DNS support
3993 dnl
3994 AC_MSG_CHECKING([whether to support DNS shuffling])
3995 AC_ARG_ENABLE(dnsshuffle,
3996 AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
3997 AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
3998 [ case "$enableval" in
3999   no)
4000        AC_MSG_RESULT(no)
4001        AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
4002        ;;
4003   *)   AC_MSG_RESULT(yes)
4004        ;;
4005   esac ],
4006        AC_MSG_RESULT(yes)
4007 )
4008
4009 dnl ************************************************************
4010 dnl disable the curl_easy_options API
4011 dnl
4012 AC_MSG_CHECKING([whether to support curl_easy_option*])
4013 AC_ARG_ENABLE(get-easy-options,
4014 AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
4015 AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
4016 [ case "$enableval" in
4017   no)
4018        AC_MSG_RESULT(no)
4019        AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
4020        ;;
4021   *)   AC_MSG_RESULT(yes)
4022        ;;
4023   esac ],
4024        AC_MSG_RESULT(yes)
4025 )
4026
4027 dnl ************************************************************
4028 dnl switch on/off alt-svc
4029 dnl
4030 AC_MSG_CHECKING([whether to support alt-svc])
4031 AC_ARG_ENABLE(alt-svc,
4032 AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
4033 AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
4034 [ case "$enableval" in
4035   no)
4036        AC_MSG_RESULT(no)
4037        AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
4038        curl_altsvc_msg="no";
4039        enable_altsvc="no"
4040        ;;
4041   *) AC_MSG_RESULT(yes)
4042        ;;
4043   esac ],
4044        AC_MSG_RESULT(no)
4045 )
4046
4047 dnl only check for HSTS if there's SSL present
4048 if test -n "$SSL_ENABLED"; then
4049
4050   dnl ************************************************************
4051   dnl switch on/off hsts
4052   dnl
4053   AC_MSG_CHECKING([whether to support HSTS])
4054   AC_ARG_ENABLE(hsts,
4055   AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
4056   AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
4057   [ case "$enableval" in
4058     no)
4059        AC_MSG_RESULT(no)
4060        hsts="no"
4061        ;;
4062     *) AC_MSG_RESULT(yes)
4063        ;;
4064     esac ],
4065        AC_MSG_RESULT($hsts)
4066   )
4067 else
4068   AC_MSG_NOTICE([disables HSTS due to lack of SSL])
4069   hsts="no"
4070 fi
4071
4072 if test "x$hsts" != "xyes"; then
4073   curl_hsts_msg="no      (--enable-hsts)";
4074   AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
4075 fi
4076
4077 dnl *************************************************************
4078 dnl check whether ECH support, if desired, is actually available
4079 dnl
4080 if test "x$want_ech" != "xno"; then
4081   AC_MSG_CHECKING([whether ECH support is available])
4082
4083   dnl assume NOT and look for sufficient condition
4084   ECH_ENABLED=0
4085   ECH_SUPPORT=''
4086
4087   dnl OpenSSL with a chosen ECH function should be enough
4088   dnl so more exhaustive checking seems unnecessary for now
4089   if test "x$OPENSSL_ENABLED" = "x1"; then
4090     AC_CHECK_FUNCS(SSL_get_ech_status,
4091       ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
4092       ECH_ENABLED=1)
4093
4094   dnl add 'elif' chain here for additional implementations
4095   fi
4096
4097   dnl now deal with whatever we found
4098   if test "x$ECH_ENABLED" = "x1"; then
4099     AC_DEFINE(USE_ECH, 1, [if ECH support is available])
4100     AC_MSG_RESULT($ECH_SUPPORT)
4101     experimental="$experimental ECH"
4102   else
4103     AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
4104   fi
4105 fi
4106
4107 dnl ************************************************************
4108 dnl hiding of library internal symbols
4109 dnl
4110 CURL_CONFIGURE_SYMBOL_HIDING
4111
4112 dnl
4113 dnl All the library dependencies put into $LIB apply to libcurl only.
4114 dnl
4115 LIBCURL_LIBS="$LIBS$PTHREAD"
4116
4117 AC_SUBST(LIBCURL_LIBS)
4118 AC_SUBST(CURL_NETWORK_LIBS)
4119 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
4120
4121 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
4122 dnl LIBS variable used in generated makefile at makefile processing
4123 dnl time. Doing this functionally prevents LIBS from being used for
4124 dnl all link targets in given makefile.
4125 BLANK_AT_MAKETIME=
4126 AC_SUBST(BLANK_AT_MAKETIME)
4127
4128 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
4129
4130 dnl yes or no
4131 ENABLE_SHARED="$enable_shared"
4132 AC_SUBST(ENABLE_SHARED)
4133
4134 dnl to let curl-config output the static libraries correctly
4135 ENABLE_STATIC="$enable_static"
4136 AC_SUBST(ENABLE_STATIC)
4137
4138 dnl merge the pkg-config Libs.private field into Libs when static-only
4139 if test "x$enable_shared" = "xno"; then
4140   LIBCURL_NO_SHARED=$LIBCURL_LIBS
4141 else
4142   LIBCURL_NO_SHARED=
4143 fi
4144 AC_SUBST(LIBCURL_NO_SHARED)
4145
4146 dnl
4147 dnl For keeping supported features and protocols also in pkg-config file
4148 dnl since it is more cross-compile friendly than curl-config
4149 dnl
4150
4151 if test "x$OPENSSL_ENABLED" = "x1"; then
4152   SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4153 elif test -n "$SSL_ENABLED"; then
4154   SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
4155 fi
4156 if test "x$IPV6_ENABLED" = "x1"; then
4157   SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
4158 fi
4159 if test "x$USE_UNIX_SOCKETS" = "x1"; then
4160   SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
4161 fi
4162 if test "x$HAVE_LIBZ" = "x1"; then
4163   SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
4164 fi
4165 if test "x$HAVE_BROTLI" = "x1"; then
4166   SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
4167 fi
4168 if test "x$HAVE_ZSTD" = "x1"; then
4169   SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
4170 fi
4171 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
4172                             -o "x$USE_THREADS_WIN32" = "x1"; then
4173   SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
4174 fi
4175 if test "x$IDN_ENABLED" = "x1"; then
4176   SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
4177 fi
4178 if test "x$USE_WINDOWS_SSPI" = "x1"; then
4179   SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
4180 fi
4181
4182 if test "x$HAVE_GSSAPI" = "x1"; then
4183   SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
4184 fi
4185
4186 if test "x$curl_psl_msg" = "xenabled"; then
4187   SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
4188 fi
4189
4190 if test "x$curl_gsasl_msg" = "xenabled"; then
4191   SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
4192 fi
4193
4194 if test "x$enable_altsvc" = "xyes"; then
4195   SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
4196 fi
4197 if test "x$hsts" = "xyes"; then
4198   SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
4199 fi
4200
4201 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4202     \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4203   SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
4204 fi
4205
4206 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4207     \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
4208   SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
4209 fi
4210
4211 use_curl_ntlm_core=no
4212
4213 if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
4214     "x$CURL_DISABLE_NTLM" != "x1"; then
4215   if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
4216       -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
4217       -o "x$SECURETRANSPORT_ENABLED" = "x1" \
4218       -o "x$USE_WIN32_CRYPTO" = "x1" \
4219       -o "x$WOLFSSL_NTLM" = "x1"; then
4220     use_curl_ntlm_core=yes
4221   fi
4222
4223   if test "x$use_curl_ntlm_core" = "xyes" \
4224       -o "x$USE_WINDOWS_SSPI" = "x1"; then
4225     SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
4226
4227     if test "x$CURL_DISABLE_HTTP" != "x1" -a \
4228         "x$NTLM_WB_ENABLED" = "x1"; then
4229       SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
4230     fi
4231   fi
4232 fi
4233
4234 if test "x$USE_TLS_SRP" = "x1"; then
4235   SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
4236 fi
4237
4238 if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
4239   SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
4240 fi
4241
4242 if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then
4243   SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
4244 fi
4245
4246 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
4247   SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
4248 fi
4249
4250 dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
4251 if test "x$https_proxy" != "xno"; then
4252   if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
4253       -o "x$NSS_ENABLED" = "x1"; then
4254     SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
4255   fi
4256 fi
4257
4258 if test "x$ECH_ENABLED" = "x1"; then
4259   SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
4260 fi
4261
4262 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
4263   if test ${ac_cv_sizeof_off_t} -gt 4 -o \
4264      "$curl_win32_file_api" = "win32_large_files"; then
4265     SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
4266   fi
4267 fi
4268
4269 dnl replace spaces with newlines
4270 dnl sort the lines
4271 dnl replace the newlines back to spaces
4272 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
4273 AC_SUBST(SUPPORT_FEATURES)
4274
4275 dnl For supported protocols in pkg-config file
4276 if test "x$CURL_DISABLE_HTTP" != "x1"; then
4277   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
4278   if test "x$SSL_ENABLED" = "x1"; then
4279     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
4280   fi
4281 fi
4282 if test "x$CURL_DISABLE_FTP" != "x1"; then
4283   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
4284   if test "x$SSL_ENABLED" = "x1"; then
4285     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
4286   fi
4287 fi
4288 if test "x$CURL_DISABLE_FILE" != "x1"; then
4289   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
4290 fi
4291 if test "x$CURL_DISABLE_TELNET" != "x1"; then
4292   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
4293 fi
4294 if test "x$CURL_DISABLE_LDAP" != "x1"; then
4295   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
4296   if test "x$CURL_DISABLE_LDAPS" != "x1"; then
4297     if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
4298       (test "x$USE_OPENLDAP" != "x1"  && test "x$HAVE_LDAP_SSL" = "x1"); then
4299       SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
4300     fi
4301   fi
4302 fi
4303 if test "x$CURL_DISABLE_DICT" != "x1"; then
4304   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
4305 fi
4306 if test "x$CURL_DISABLE_TFTP" != "x1"; then
4307   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
4308 fi
4309 if test "x$CURL_DISABLE_GOPHER" != "x1"; then
4310   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
4311   if test "x$SSL_ENABLED" = "x1"; then
4312     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
4313   fi
4314 fi
4315 if test "x$CURL_DISABLE_MQTT" != "x1"; then
4316   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
4317 fi
4318 if test "x$CURL_DISABLE_POP3" != "x1"; then
4319   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
4320   if test "x$SSL_ENABLED" = "x1"; then
4321     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
4322   fi
4323 fi
4324 if test "x$CURL_DISABLE_IMAP" != "x1"; then
4325   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
4326   if test "x$SSL_ENABLED" = "x1"; then
4327     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
4328   fi
4329 fi
4330 if test "x$CURL_DISABLE_SMB" != "x1" \
4331     -a "x$use_curl_ntlm_core" = "xyes"; then
4332   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
4333   if test "x$SSL_ENABLED" = "x1"; then
4334     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
4335   fi
4336 fi
4337 if test "x$CURL_DISABLE_SMTP" != "x1"; then
4338   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
4339   if test "x$SSL_ENABLED" = "x1"; then
4340     SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
4341   fi
4342 fi
4343 if test "x$USE_LIBSSH2" = "x1"; then
4344   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4345   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4346 fi
4347 if test "x$USE_LIBSSH" = "x1"; then
4348   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
4349   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4350 fi
4351 if test "x$USE_WOLFSSH" = "x1"; then
4352   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
4353 fi
4354 if test "x$CURL_DISABLE_RTSP" != "x1"; then
4355   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
4356 fi
4357 if test "x$USE_LIBRTMP" = "x1"; then
4358   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
4359 fi
4360
4361 dnl replace spaces with newlines
4362 dnl sort the lines
4363 dnl replace the newlines back to spaces
4364 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
4365
4366 AC_SUBST(SUPPORT_PROTOCOLS)
4367
4368 dnl squeeze whitespace out of some variables
4369
4370 squeeze CFLAGS
4371 squeeze CPPFLAGS
4372 squeeze DEFS
4373 squeeze LDFLAGS
4374 squeeze LIBS
4375
4376 squeeze LIBCURL_LIBS
4377 squeeze CURL_NETWORK_LIBS
4378 squeeze CURL_NETWORK_AND_TIME_LIBS
4379
4380 squeeze SUPPORT_FEATURES
4381 squeeze SUPPORT_PROTOCOLS
4382
4383 XC_CHECK_BUILD_FLAGS
4384
4385 SSL_BACKENDS=${ssl_backends}
4386 AC_SUBST(SSL_BACKENDS)
4387
4388 if test "x$want_curldebug_assumed" = "xyes" &&
4389   test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
4390   ac_configure_args="$ac_configure_args --enable-curldebug"
4391 fi
4392
4393 AC_CONFIG_FILES([Makefile \
4394            docs/Makefile \
4395            docs/examples/Makefile \
4396            docs/libcurl/Makefile \
4397            docs/libcurl/opts/Makefile \
4398            docs/cmdline-opts/Makefile \
4399            include/Makefile \
4400            include/curl/Makefile \
4401            src/Makefile \
4402            lib/Makefile \
4403            extensions/Makefile \
4404            scripts/Makefile \
4405            lib/libcurl.vers \
4406            tests/Makefile \
4407            tests/certs/Makefile \
4408            tests/certs/scripts/Makefile \
4409            tests/data/Makefile \
4410            tests/server/Makefile \
4411            tests/libtest/Makefile \
4412            tests/unit/Makefile \
4413            packages/Makefile \
4414            packages/vms/Makefile \
4415            curl-config \
4416            libcurl.pc
4417 ])
4418 AC_OUTPUT
4419
4420 CURL_GENERATE_CONFIGUREHELP_PM
4421
4422 XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
4423
4424 AC_MSG_NOTICE([Configured to build curl/libcurl:
4425
4426   Host setup:       ${host}
4427   Install prefix:   ${prefix}
4428   Compiler:         ${CC}
4429    CFLAGS:          ${CFLAGS}
4430    CPPFLAGS:        ${CPPFLAGS}
4431    LDFLAGS:         ${LDFLAGS}
4432    LIBS:            ${LIBS}
4433
4434   curl version:     ${CURLVERSION}
4435   SSL:              ${curl_ssl_msg}
4436   SSH:              ${curl_ssh_msg}
4437   zlib:             ${curl_zlib_msg}
4438   brotli:           ${curl_brotli_msg}
4439   zstd:             ${curl_zstd_msg}
4440   GSS-API:          ${curl_gss_msg}
4441   GSASL:            ${curl_gsasl_msg}
4442   TLS-SRP:          ${curl_tls_srp_msg}
4443   resolver:         ${curl_res_msg}
4444   IPv6:             ${curl_ipv6_msg}
4445   Unix sockets:     ${curl_unix_sockets_msg}
4446   IDN:              ${curl_idn_msg}
4447   Build libcurl:    Shared=${enable_shared}, Static=${enable_static}
4448   Built-in manual:  ${curl_manual_msg}
4449   --libcurl option: ${curl_libcurl_msg}
4450   Verbose errors:   ${curl_verbose_msg}
4451   Code coverage:    ${curl_coverage_msg}
4452   SSPI:             ${curl_sspi_msg}
4453   ca cert bundle:   ${ca}${ca_warning}
4454   ca cert path:     ${capath}${capath_warning}
4455   ca fallback:      ${with_ca_fallback}
4456   LDAP:             ${curl_ldap_msg}
4457   LDAPS:            ${curl_ldaps_msg}
4458   RTSP:             ${curl_rtsp_msg}
4459   RTMP:             ${curl_rtmp_msg}
4460   PSL:              ${curl_psl_msg}
4461   Alt-svc:          ${curl_altsvc_msg}
4462   HSTS:             ${curl_hsts_msg}
4463   HTTP1:            ${curl_h1_msg}
4464   HTTP2:            ${curl_h2_msg}
4465   HTTP3:            ${curl_h3_msg}
4466   ECH:              ${curl_ech_msg}
4467   Protocols:        ${SUPPORT_PROTOCOLS}
4468   Features:         ${SUPPORT_FEATURES}
4469   Tizen Features:   ${SUPPORT_TIZEN_FEATURES}
4470 ])
4471 if test -n "$experimental"; then
4472  cat >&2 << _EOF
4473   WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!
4474 _EOF
4475 fi