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