Artifactspublic-v0

curl

master
ply4 git calls35 ms323 KiB2 cachedprotocol v2
5590 lines162 KiBRaw

Showing 4000 of 5590 lines.

1#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) 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.
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.
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
21# SPDX-License-Identifier: curl
23#***************************************************************************
24dnl Process this file with autoconf to produce a configure script.
26AC_PREREQ(2.59)
28dnl We do not know the version number "statically" so we use a dash here
29AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/])
31XC_OVR_ZZ50
32CURL_OVERRIDE_AUTOCONF
34dnl configure script copyright
35AC_COPYRIGHT([Copyright (C) Daniel Stenberg, <daniel@haxx.se>
36This configure script may be copied, distributed and modified under the
37terms of the curl license; see COPYING for more details])
39AC_CONFIG_SRCDIR([lib/urldata.h])
40AC_CONFIG_HEADERS(lib/curl_config.h)
41AH_TOP([/* !checksrc! disable COPYRIGHT all */])
42AC_CONFIG_MACRO_DIR([m4])
43AM_MAINTAINER_MODE
44m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
46CURL_CHECK_OPTION_DEBUG
47AM_CONDITIONAL(DEBUGBUILD, test "$want_debug" = "yes")
48CURL_CHECK_OPTION_OPTIMIZE
49CURL_CHECK_OPTION_WARNINGS
50CURL_CHECK_OPTION_WERROR
51CURL_CHECK_OPTION_SYMBOL_HIDING
52CURL_CHECK_OPTION_ARES
53CURL_CHECK_OPTION_RT
54CURL_CHECK_OPTION_HTTPSRR
55CURL_CHECK_OPTION_ECH
56CURL_CHECK_OPTION_SSLS_EXPORT
57AC_MSG_CHECKING([whether to enable HTTP/3 proxy support])
58OPT_PROXY_HTTP3="default"
59AC_ARG_ENABLE(proxy-http3,
60AS_HELP_STRING([--enable-proxy-http3],[Enable HTTP/3 proxy support (experimental)])
61AS_HELP_STRING([--disable-proxy-http3],[Disable HTTP/3 proxy support (experimental)]),
62 OPT_PROXY_HTTP3=$enableval)
63case "$OPT_PROXY_HTTP3" in
64 no)
65 want_proxy_http3="no"
66 curl_proxy_http3_msg="no (--enable-proxy-http3)"
67 AC_MSG_RESULT([no])
68 ;;
69 default)
70 want_proxy_http3="no"
71 curl_proxy_http3_msg="no (--enable-proxy-http3)"
72 AC_MSG_RESULT([no])
73 ;;
74 *)
75 want_proxy_http3="yes"
76 curl_proxy_http3_msg="enabled (--disable-proxy-http3)"
77 AC_MSG_RESULT([yes])
78 ;;
79esac
80USE_PROXY_HTTP3=0
82XC_CHECK_PATH_SEPARATOR
84dnl
85dnl save the configure arguments
86dnl
87CONFIGURE_OPTIONS="\"$ac_configure_args\""
88AC_SUBST(CONFIGURE_OPTIONS)
90dnl SED is mandatory for configure process and libtool.
91dnl Set it now, allowing it to be changed later.
92if test -z "$SED"; then
93 dnl allow it to be overridden
94 AC_PATH_PROG([SED], [sed], [not_found],
95 [$PATH:/usr/bin:/usr/local/bin])
96 if test -z "$SED" || test "$SED" = "not_found"; then
97 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
98 fi
99fi
100AC_SUBST([SED])
102dnl GREP is mandatory for configure process and libtool.
103dnl Set it now, allowing it to be changed later.
104if test -z "$GREP"; then
105 dnl allow it to be overridden
106 AC_PATH_PROG([GREP], [grep], [not_found],
107 [$PATH:/usr/bin:/usr/local/bin])
108 if test -z "$GREP" || test "$GREP" = "not_found"; then
109 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
110 fi
111fi
112AC_SUBST([GREP])
114dnl 'grep -E' is mandatory for configure process and libtool.
115dnl Set it now, allowing it to be changed later.
116if test -z "$EGREP"; then
117 dnl allow it to be overridden
118 AC_MSG_CHECKING([that grep -E works])
119 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
120 EGREP="$GREP -E"
121 AC_MSG_RESULT([yes])
122 else
123 AC_MSG_RESULT([no])
124 AC_PATH_PROG([EGREP], [egrep], [not_found],
125 [$PATH:/usr/bin:/usr/local/bin])
126 fi
127fi
128if test -z "$EGREP" || test "$EGREP" = "not_found"; then
129 AC_MSG_ERROR([grep -E is not working and egrep is not found in PATH. Cannot continue.])
130fi
131AC_SUBST([EGREP])
133dnl AR is mandatory for configure process and libtool.
134dnl This is target dependent, so check it as a tool.
135if test -z "$AR"; then
136 dnl allow it to be overridden
137 AC_PATH_TOOL([AR], [ar], [not_found],
138 [$PATH:/usr/bin:/usr/local/bin])
139 if test -z "$AR" || test "$AR" = "not_found"; then
140 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
141 fi
142fi
143AC_SUBST([AR])
145AC_SUBST(libext)
147if test -z "$CLANG_TIDY"; then
148 CLANG_TIDY=clang-tidy
149fi
150AC_SUBST(CLANG_TIDY)
152dnl figure out the libcurl version
153CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
154XC_CHECK_PROG_CC
155CURL_ATOMIC
157XC_AUTOMAKE
158AC_MSG_CHECKING([curl version])
159AC_MSG_RESULT($CURLVERSION)
161AC_SUBST(CURLVERSION)
163dnl
164dnl we extract the numerical version for curl-config only
165VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
166AC_SUBST(VERSIONNUM)
168dnl
169dnl initialize all the info variables
170 curl_ssl_msg="no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,amissl,rustls} )"
171 curl_ssh_msg="no (--with-{libssh,libssh2})"
172 curl_zlib_msg="no (--with-zlib)"
173 curl_brotli_msg="no (--with-brotli)"
174 curl_zstd_msg="no (--with-zstd)"
175 curl_gss_msg="no (--with-gssapi)"
176 curl_gsasl_msg="no (--with-gsasl)"
177 curl_res_msg="blocking (--enable-ares / --enable-threaded-resolver)"
178 curl_ipv6_msg="no (--enable-ipv6)"
179curl_unix_sockets_msg="no (--enable-unix-sockets)"
180 curl_idn_msg="no (--with-{libidn2,winidn})"
181 curl_docs_msg="enabled (--disable-docs)"
182 curl_manual_msg="no (--enable-manual)"
183 curl_libcurl_msg="enabled (--disable-libcurl-option)"
184 curl_typecheck_msg="enabled (--disable-typecheck)"
185 curl_verbose_msg="enabled (--disable-verbose)"
186 curl_sspi_msg="no (--enable-sspi)"
187 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
188 curl_ldaps_msg="no (--enable-ldaps)"
189 curl_ipfs_msg="no (--enable-ipfs)"
190 curl_rtsp_msg="no (--enable-rtsp)"
191 curl_psl_msg="no (--with-libpsl)"
192 curl_altsvc_msg="enabled (--disable-alt-svc)"
193 curl_headers_msg="enabled (--disable-headers-api)"
194 curl_hsts_msg="enabled (--disable-hsts)"
195 ssl_backends=
196 curl_h1_msg="enabled (internal)"
197 curl_h2_msg="no (--with-nghttp2)"
198 curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche)"
200enable_altsvc="yes"
201hsts="yes"
203dnl
204dnl Save some initial values the user might have provided
205dnl
206INITIAL_LDFLAGS=$LDFLAGS
207INITIAL_LIBS=$LIBS
209dnl
210dnl Generates a shell script to run the compiler with LD_LIBRARY_PATH set to
211dnl the value used right now. This lets CURL_RUN_IFELSE set LD_LIBRARY_PATH to
212dnl something different but only have that affect the execution of the results
213dnl of the compile, not change the libraries for the compiler itself.
214dnl
215compilersh="run-compiler"
216CURL_SAVED_CC="$CC"
217export CURL_SAVED_CC
218CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
219export CURL_SAVED_LD_LIBRARY_PATH
220cat <<\EOF > "$compilersh"
221CC="$CURL_SAVED_CC"
222export CC
223LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH"
224export LD_LIBRARY_PATH
225exec $CC "$@"
226EOF
228dnl **********************************************************************
229dnl See which TLS backend(s) that are requested. Do all the
230dnl TLS AC_ARG_WITH() invokes here and do the checks later
231dnl **********************************************************************
232OPT_SCHANNEL=no
233AC_ARG_WITH(schannel,
234AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
235 OPT_SCHANNEL=$withval
236 TLSCHOICE="Schannel")
238OPT_AMISSL=no
239AC_ARG_WITH(amissl,
240AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
241 OPT_AMISSL=$withval
242 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
243])
245OPT_OPENSSL=no
246dnl Default to no CA bundle
247ca="no"
248AC_ARG_WITH(ssl,
249AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
250AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
251 OPT_SSL=$withval
252 OPT_OPENSSL=$withval
253 if test "x$withval" != "xno"; then
254 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
255 else
256 SSL_DISABLED="D"
257 fi
258])
260AC_ARG_WITH(openssl,
261AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points
262 to the SSL installation (default: /usr/local/ssl); when possible, set
263 the PKG_CONFIG_PATH environment variable instead of using this option]),
265 OPT_OPENSSL=$withval
266 if test "x$withval" != "xno"; then
267 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
268 fi
269])
271OPT_GNUTLS=no
272AC_ARG_WITH(gnutls,
273AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
274 OPT_GNUTLS=$withval
275 if test "x$withval" != "xno"; then
276 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
277 fi
278])
280OPT_MBEDTLS=no
281AC_ARG_WITH(mbedtls,
282AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
283 OPT_MBEDTLS=$withval
284 if test "x$withval" != "xno"; then
285 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
286 fi
287])
289OPT_WOLFSSL=no
290AC_ARG_WITH(wolfssl,
291AS_HELP_STRING([--with-wolfssl=PATH],[where to look for wolfSSL, PATH points to the installation root (default: system lib default)]),[
292 OPT_WOLFSSL=$withval
293 if test "x$withval" != "xno"; then
294 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
295 fi
296])
298OPT_RUSTLS=no
299AC_ARG_WITH(rustls,
300AS_HELP_STRING([--with-rustls=PATH],[where to look for Rustls, PATH points to the installation root]),[
301 OPT_RUSTLS=$withval
302 if test "x$withval" != "xno"; then
303 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Rustls"
304 experimental="$experimental Rustls"
305 fi
306])
308OPT_APPLE_SECTRUST=no
309AC_ARG_WITH(apple-sectrust,
310AS_HELP_STRING([--with-apple-sectrust],[enable Apple OS native certificate verification]),[
311 OPT_APPLE_SECTRUST=$withval
312])
314AC_PATH_PROG(PERL, perl,, $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin)
315AC_SUBST(PERL)
316AM_CONDITIONAL(PERL, test -n "$PERL")
318TEST_NGHTTPX=nghttpx
319AC_ARG_WITH(test-nghttpx,
320AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]),
321 TEST_NGHTTPX=$withval
322 if test "x$TEST_NGHTTPX" = "xno"; then
323 TEST_NGHTTPX=""
324 fi
326AC_SUBST(TEST_NGHTTPX)
328if test -x /usr/bin/caddy; then
329 CADDY=/usr/bin/caddy
330elif test -x /usr/local/bin/caddy; then
331 CADDY=/usr/local/bin/caddy
332elif test -x "`brew --prefix 2>/dev/null`/bin/caddy"; then
333 CADDY=`brew --prefix`/bin/caddy
334fi
335AC_ARG_WITH(test-caddy,
336AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]),
337 CADDY=$withval
338 if test "x$CADDY" = "xno"; then
339 CADDY=""
340 fi
342AC_SUBST(CADDY)
344if test -x /usr/local/bin/h2o; then
345 H2O=/usr/local/bin/h2o
346elif test -x /usr/bin/h2o; then
347 H2O=/usr/bin/h2o
348elif test -x "`brew --prefix 2>/dev/null`/bin/h2o"; then
349 H2O=`brew --prefix`/bin/h2o
350fi
351AC_ARG_WITH(test-h2o,dnl
352AS_HELP_STRING([--with-test-h2o=PATH],[where to find h2o for testing]),
353 H2O=$withval
354 if test "x$H2O" = "xno"; then
355 H2O=""
356 fi
358AC_SUBST(H2O)
360if test -x /usr/sbin/vsftpd; then
361 VSFTPD=/usr/sbin/vsftpd
362elif test -x /usr/local/sbin/vsftpd; then
363 VSFTPD=/usr/local/sbin/vsftpd
364elif test -x "`brew --prefix 2>/dev/null`/sbin/vsftpd"; then
365 VSFTPD=`brew --prefix`/sbin/vsftpd
366fi
367AC_ARG_WITH(test-vsftpd,
368AS_HELP_STRING([--with-test-vsftpd=PATH],[where to find vsftpd for testing]),
369 VSFTPD=$withval
370 if test "x$VSFTPD" = "xno"; then
371 VSFTPD=""
372 fi
374AC_SUBST(VSFTPD)
376dnl we would like an httpd as test server
377dnl
378HTTPD_ENABLED="maybe"
379AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH],
380 [where to find httpd/apache2 for testing])],
381 [request_httpd=$withval], [request_httpd=check])
382if test "x$request_httpd" = "xcheck" || test "x$request_httpd" = "xyes"; then
383 if test -x "/usr/sbin/apache2"; then
384 dnl common location on distros (debian/ubuntu)
385 HTTPD="/usr/sbin/apache2"
386 AC_PATH_PROG([APXS], [apxs])
387 if test -z "$APXS"; then
388 AC_MSG_NOTICE([apache2-dev not installed, httpd tests disabled])
389 HTTPD_ENABLED="no"
390 fi
391 else
392 AC_PATH_PROG([HTTPD], [httpd])
393 if test -z "$HTTPD"; then
394 AC_PATH_PROG([HTTPD], [apache2])
395 fi
396 AC_PATH_PROG([APXS], [apxs])
397 if test -z "$HTTPD"; then
398 AC_MSG_NOTICE([httpd/apache2 not in PATH, http tests disabled])
399 HTTPD_ENABLED="no"
400 fi
401 if test -z "$APXS"; then
402 AC_MSG_NOTICE([apxs not in PATH, http tests disabled])
403 HTTPD_ENABLED="no"
404 fi
405 fi
406elif test "x$request_httpd" != "xno"; then
407 HTTPD="${request_httpd}/bin/httpd"
408 APXS="${request_httpd}/bin/apxs"
409 if test ! -x "${HTTPD}"; then
410 AC_MSG_NOTICE([httpd not found as ${HTTPD}, http tests disabled])
411 HTTPD_ENABLED="no"
412 elif test ! -x "${APXS}"; then
413 AC_MSG_NOTICE([apxs not found as ${APXS}, http tests disabled])
414 HTTPD_ENABLED="no"
415 else
416 AC_MSG_NOTICE([using HTTPD=$HTTPD for tests])
417 fi
418fi
419if test "$HTTPD_ENABLED" = "no"; then
420 HTTPD=""
421 APXS=""
422fi
423AC_SUBST(HTTPD)
424AC_SUBST(APXS)
426dnl we would like a dante as test socks server
427dnl
428DANTED_ENABLED="maybe"
429AC_ARG_WITH(test-danted, [AS_HELP_STRING([--with-test-danted=PATH],
430 [where to find danted socks daemon for testing])],
431 [request_danted=$withval], [request_danted=check])
432if test "x$request_danted" = "xcheck" || test "x$request_danted" = "xyes"; then
433 if test -x "/usr/sbin/danted"; then
434 dnl common location on distros (debian/ubuntu)
435 DANTED="/usr/sbin/danted"
436 else
437 AC_PATH_PROG([DANTED], [danted])
438 if test -z "$DANTED"; then
439 AC_PATH_PROG([DANTED], [danted])
440 fi
441 fi
442elif test "x$request_danted" != "xno"; then
443 DANTED="${request_danted}"
444 if test ! -x "${DANTED}"; then
445 AC_MSG_NOTICE([danted not found as ${DANTED}, danted tests disabled])
446 DANTED_ENABLED="no"
447 else
448 AC_MSG_NOTICE([using DANTED=$DANTED for tests])
449 fi
450fi
451if test "$DANTED_ENABLED" = "no"; then
452 DANTED=""
453fi
454AC_SUBST(DANTED)
456dnl we would like a sshd as test server
457dnl
458SSHD_ENABLED="maybe"
459AC_ARG_WITH(test-sshd, [AS_HELP_STRING([--with-test-sshd=PATH],
460 [where to find sshd for testing])],
461 [request_sshd=$withval], [request_sshd=check])
462if test "x$request_sshd" = "xcheck" || test "x$request_sshd" = "xyes"; then
463 if test -x "/usr/sbin/sshd"; then
464 dnl common location on distros (debian/ubuntu)
465 SSHD="/usr/sbin/sshd"
466 else
467 AC_PATH_PROG([SSHD], [sshd])
468 if test -z "$SSHD"; then
469 AC_PATH_PROG([SSHD], [sshd])
470 fi
471 fi
472elif test "x$request_sshd" != "xno"; then
473 SSHD="${request_sshd}"
474 if test ! -x "${SSHD}"; then
475 AC_MSG_NOTICE([sshd not found as ${SSHD}, sshd tests disabled])
476 SSHD_ENABLED="no"
477 else
478 AC_MSG_NOTICE([using SSHD=$SSHD for tests])
479 fi
480fi
481if test "$SSHD_ENABLED" = "no"; then
482 SSHD=""
483 SFTPD=""
484else
485 if test -x "/usr/libexec/sftp-server"; then
486 dnl common location on macOS)
487 SFTPD="/usr/libexec/sftp-server"
488 elif test -x "/usr/lib/openssh/sftp-server"; then
489 dnl common location on debian
490 SFTPD="/usr/lib/openssh/sftp-server"
491 else
492 AC_PATH_PROG([SFTPD], [sftp-server])
493 if test -z "$SFTPD"; then
494 AC_PATH_PROG([SFTPD], [sftp-server])
495 fi
496 fi
497fi
498AC_SUBST(SSHD)
499AC_SUBST(SFTPD)
501dnl the nghttpx we might use in httpd testing
502if test -n "$TEST_NGHTTPX" && test "x$TEST_NGHTTPX" != "xnghttpx"; then
503 HTTPD_NGHTTPX="$TEST_NGHTTPX"
504else
505 AC_PATH_PROG([HTTPD_NGHTTPX], [nghttpx], [],
506 [$PATH:/usr/bin:/usr/local/bin])
507fi
508AC_SUBST(HTTPD_NGHTTPX)
510dnl the Caddy server we might use in testing
511if test -n "$TEST_CADDY"; then
512 CADDY="$TEST_CADDY"
513else
514 AC_PATH_PROG([CADDY], [caddy])
515fi
516AC_SUBST(CADDY)
518dnl If no TLS choice has been made, check if it was explicitly disabled or
519dnl error out to force the user to decide.
520if test -z "$TLSCHOICE"; then
521 if test "x$OPT_SSL" != "xno"; then
522 AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
524Select from these:
526 --with-amissl
527 --with-gnutls
528 --with-mbedtls
529 --with-openssl (also works for AWS-LC, BoringSSL and LibreSSL)
530 --with-rustls
531 --with-schannel
532 --with-wolfssl
533])
534 fi
535fi
537AC_ARG_WITH(darwinssl,,
538 AC_MSG_ERROR([--with-darwin-ssl and --without-darwin-ssl no longer work!]))
540dnl
541dnl Detect the canonical host and target build environment
542dnl
544AC_CANONICAL_HOST
545dnl Get system canonical name
546AC_DEFINE_UNQUOTED(CURL_OS, "${host}", [cpu-machine-OS])
548dnl Silence warning: ar: 'u' modifier ignored since 'D' is the default
549AC_SUBST(AR_FLAGS, [cr])
551dnl This defines _ALL_SOURCE for AIX
552CURL_CHECK_AIX_ALL_SOURCE
554dnl Our configure and build reentrant settings
555CURL_CONFIGURE_THREAD_SAFE
556CURL_CONFIGURE_REENTRANT
558dnl check for how to do large files
559AC_SYS_LARGEFILE
561XC_LIBTOOL
563LT_LANG([Windows Resource])
565AM_CONDITIONAL(NOT_CURL_CI, test -z "$CURL_CI")
567dnl
568dnl Automake conditionals based on libtool related checks
569dnl
571AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
572 [test "$xc_lt_shlib_use_version_info" = "yes"])
573AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
574 [test "$xc_lt_shlib_use_no_undefined" = "yes"])
575AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
576 [test "$xc_lt_shlib_use_mimpure_text" = "yes"])
578dnl
579dnl Due to libtool and automake machinery limitations of not allowing
580dnl specifying separate CPPFLAGS or CFLAGS when compiling objects for
581dnl inclusion of these in shared or static libraries, we are forced to
582dnl build using separate configure runs for shared and static libraries
583dnl on systems where different CPPFLAGS or CFLAGS are mandatory in order
584dnl to compile objects for each kind of library. Notice that relying on
585dnl the '-DPIC' CFLAG that libtool provides is not valid given that the
586dnl user might for example choose to build static libraries with PIC.
587dnl
589dnl
590dnl Make our Makefile.am files use the staticlib CPPFLAG only when strictly
591dnl targeting a static library and not building its shared counterpart.
592dnl
594AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
595 [test "$xc_lt_build_static_only" = "yes"])
597dnl
598dnl Make staticlib CPPFLAG variable and its definition visible in output
599dnl files unconditionally, providing an empty definition unless strictly
600dnl targeting a static library and not building its shared counterpart.
601dnl
603LIBCURL_PC_CFLAGS_PRIVATE='-DCURL_STATICLIB'
604AC_SUBST(LIBCURL_PC_CFLAGS_PRIVATE)
606LIBCURL_PC_CFLAGS=
607if test "$xc_lt_build_static_only" = "yes"; then
608 LIBCURL_PC_CFLAGS="${LIBCURL_PC_CFLAGS_PRIVATE}"
609fi
610AC_SUBST([LIBCURL_PC_CFLAGS])
612dnl **********************************************************************
613dnl platform/compiler/architecture specific checks/flags
614dnl **********************************************************************
616CURL_CHECK_COMPILER
617dnl for --enable-code-coverage
618CURL_COVERAGE
619CURL_CHECK_NATIVE_WINDOWS
621curl_cv_winuwp='no'
622if test "$curl_cv_native_windows" = "yes"; then
623 case "$CPPFLAGS" in
624 *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';;
625 esac
627 AC_MSG_CHECKING([if building for Windows Vista or newer])
628 AC_COMPILE_IFELSE([
629 AC_LANG_PROGRAM([[
630 #include <windows.h>
631 ]],[[
632 #if (_WIN32_WINNT < 0x600)
633 #error
634 #endif
635 ]])
636 ],[
637 AC_MSG_RESULT([yes])
638 ],[
639 AC_MSG_RESULT([no])
640 AC_MSG_ERROR([Building for Windows Vista or newer is required.])
641 ])
642fi
644CURL_SET_COMPILER_BASIC_OPTS
645CURL_SET_COMPILER_DEBUG_OPTS
646CURL_SET_COMPILER_OPTIMIZE_OPTS
647CURL_SET_COMPILER_WARNING_OPTS
649if test "$compiler_id" = "INTEL_UNIX_C"; then
650 if test "$compiler_num" -ge "1000"; then
651 dnl icc 10.X or later
652 CFLAGS="$CFLAGS -shared-intel"
653 elif test "$compiler_num" -ge "900"; then
654 dnl icc 9.X specific
655 CFLAGS="$CFLAGS -i-dynamic"
656 fi
657fi
659case $host in
660 *msdosdjgpp)
661 if test "$compiler_num" -ge "1000"; then
662 dnl Avoid warnings in DJGPP's built-in FD_SET() macro
663 CFLAGS="$CFLAGS -Wno-arith-conversion"
664 fi
665 ;;
666esac
668CURL_CFLAG_EXTRAS=""
669if test "$want_werror" = "yes"; then
670 CURL_CFLAG_EXTRAS="-Werror"
671 if test "$compiler_id" = "GNU_C"; then
672 dnl enable -pedantic-errors for GCC 5 and later,
673 dnl as before that it was the same as -Werror=pedantic
674 if test "$compiler_num" -ge "500"; then
675 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
676 fi
677 elif test "$compiler_id" = "CLANG" || test "$compiler_id" = "APPLECLANG"; then
678 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
679 fi
680fi
681AC_SUBST(CURL_CFLAG_EXTRAS)
682AM_CONDITIONAL(CURL_WERROR, test "$want_werror" = "yes")
684CURL_CHECK_COMPILER_HALT_ON_ERROR
685CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
686CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
687CURL_CHECK_COMPILER_SYMBOL_HIDING
689supports_unittests=yes
690dnl cross-compilation of unit tests static library/programs fails when
691dnl libcurl shared library is built. This might be due to a libtool or
692dnl automake issue. In this case we disable unit tests.
693if test "$cross_compiling" != "no" &&
694 test "$enable_shared" != "no"; then
695 supports_unittests=no
696fi
698dnl IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
699dnl a problem related with OpenSSL headers and library versions not matching.
700dnl Disable unit tests while time to further investigate this is found.
701case $host in
702 mips-sgi-irix6.5)
703 if test "$compiler_id" = "GNU_C"; then
704 supports_unittests=no
705 fi
706 ;;
707esac
709dnl All AIX autobuilds fails unit tests linking against unittests library
710dnl due to unittests library being built with no symbols or members. Libtool ?
711dnl Disable unit tests while time to further investigate this is found.
712case $host_os in
713 aix*)
714 supports_unittests=no
715 ;;
716esac
718AM_CONDITIONAL(BUILD_UNITTESTS, test "$supports_unittests" = "yes")
720dnl In order to detect support of sendmmsg() and accept4(), we need to escape
721dnl the POSIX jail by defining _GNU_SOURCE or <sys/socket.h> does not expose it.
722case $host_os in
723 *linux*|cygwin*|msys*|gnu*)
724 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
725 ;;
726esac
728AM_CONDITIONAL(CLANG, test "$compiler_id" = "APPLECLANG" || test "$compiler_id" = "CLANG")
730dnl **********************************************************************
731dnl Compilation based checks should not be done before this point.
732dnl **********************************************************************
734CURL_CHECK_WIN32_CRYPTO
736curl_cv_android='no'
737curl_cv_apple='no'
738case $host in
739 *-*-android*) curl_cv_android='yes';;
740 *-apple-*) curl_cv_apple='yes';;
741esac
743if test "$curl_cv_apple" = "yes"; then
744 CURL_DARWIN_CFLAGS
745 CURL_SUPPORTS_BUILTIN_AVAILABLE
746fi
748AM_CONDITIONAL([HAVE_WINDRES],
749 [test "$curl_cv_native_windows" = "yes" && test -n "${RC}"])
751if test "$curl_cv_native_windows" = "yes"; then
752 AM_COND_IF([HAVE_WINDRES],,
753 [AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])])
754fi
756dnl ----------------------------------------
757dnl whether use "unity" mode for lib and src
758dnl ----------------------------------------
760want_unity='no'
761AC_MSG_CHECKING([whether to build libcurl and curl in "unity" mode])
762AC_ARG_ENABLE(unity,
763AS_HELP_STRING([--enable-unity],[Enable unity mode])
764AS_HELP_STRING([--disable-unity],[Disable unity (default)]),
765[ case "$enableval" in
766 yes)
767 want_unity='yes'
768 AC_MSG_RESULT([yes])
769 ;;
770 *)
771 AC_MSG_RESULT([no])
772 ;;
773 esac ],
774 AC_MSG_RESULT([no])
776if test -z "$PERL" && test "$want_unity" = "yes"; then
777 AC_MSG_WARN([perl was not found. Cannot enable unity.])
778 want_unity='no'
779fi
780AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = "yes"])
782dnl ************************************************************
783dnl switch off particular protocols
784dnl
785AC_MSG_CHECKING([whether to support http])
786AC_ARG_ENABLE(http,
787AS_HELP_STRING([--enable-http],[Enable HTTP support])
788AS_HELP_STRING([--disable-http],[Disable HTTP support]),
789[ case "$enableval" in
790 no)
791 AC_MSG_RESULT(no)
792 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
793 disable_http="yes"
794 AC_MSG_WARN([disable HTTP disables FTP over proxy, IPFS and RTSP])
795 CURL_DISABLE_HTTP=1
796 AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS])
797 CURL_DISABLE_IPFS=1
798 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
799 CURL_DISABLE_RTSP=1
800 dnl toggle off alt-svc too when HTTP is disabled
801 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
802 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
803 curl_h1_msg="no (--enable-http)"
804 curl_altsvc_msg="no";
805 curl_hsts_msg="no (--enable-hsts)";
806 enable_altsvc="no"
807 hsts="no"
808 ;;
809 *)
810 AC_MSG_RESULT(yes)
811 ;;
812 esac ],
813 AC_MSG_RESULT(yes)
815AC_MSG_CHECKING([whether to support ftp])
816AC_ARG_ENABLE(ftp,
817AS_HELP_STRING([--enable-ftp],[Enable FTP support])
818AS_HELP_STRING([--disable-ftp],[Disable FTP support]),
819[ case "$enableval" in
820 no)
821 AC_MSG_RESULT(no)
822 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
823 CURL_DISABLE_FTP=1
824 ;;
825 *)
826 AC_MSG_RESULT(yes)
827 ;;
828 esac ],
829 AC_MSG_RESULT(yes)
831AC_MSG_CHECKING([whether to support file])
832AC_ARG_ENABLE(file,
833AS_HELP_STRING([--enable-file],[Enable FILE support])
834AS_HELP_STRING([--disable-file],[Disable FILE support]),
835[ case "$enableval" in
836 no)
837 AC_MSG_RESULT(no)
838 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
839 CURL_DISABLE_FILE=1
840 ;;
841 *)
842 AC_MSG_RESULT(yes)
843 ;;
844 esac ],
845 AC_MSG_RESULT(yes)
847AC_MSG_CHECKING([whether to support IPFS])
848AC_ARG_ENABLE(ipfs,
849AS_HELP_STRING([--enable-ipfs],[Enable IPFS support])
850AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]),
851[ case "$enableval" in
852 no)
853 AC_MSG_RESULT(no)
854 AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS])
855 CURL_DISABLE_IPFS=1
856 ;;
857 *)
858 if test "$CURL_DISABLE_HTTP" = "1"; then
859 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable IPFS support!)
860 else
861 AC_MSG_RESULT(yes)
862 curl_ipfs_msg="enabled"
863 fi
864 ;;
865 esac ],
866 if test "$CURL_DISABLE_HTTP" != "1"; then
867 AC_MSG_RESULT(yes)
868 curl_ipfs_msg="enabled"
869 else
870 AC_MSG_RESULT(no)
871 fi
873AC_MSG_CHECKING([whether to support ldap])
874AC_ARG_ENABLE(ldap,
875AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
876AS_HELP_STRING([--disable-ldap],[Disable LDAP support]),
877[ case "$enableval" in
878 no)
879 AC_MSG_RESULT(no)
880 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
881 CURL_DISABLE_LDAP=1
882 ;;
883 yes)
884 ldap_askedfor="yes"
885 AC_MSG_RESULT(yes)
886 ;;
887 *)
888 AC_MSG_RESULT(yes)
889 ;;
890 esac ],[
891 AC_MSG_RESULT(yes) ]
893AC_MSG_CHECKING([whether to support ldaps])
894AC_ARG_ENABLE(ldaps,
895AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
896AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
897[ case "$enableval" in
898 no)
899 AC_MSG_RESULT(no)
900 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
901 CURL_DISABLE_LDAPS=1
902 ;;
903 *)
904 if test "$CURL_DISABLE_LDAP" = "1"; then
905 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
906 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
907 CURL_DISABLE_LDAPS=1
908 else
909 AC_MSG_RESULT(yes)
910 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
911 HAVE_LDAP_SSL=1
912 fi
913 ;;
914 esac ],[
915 if test "$CURL_DISABLE_LDAP" = "1"; then
916 AC_MSG_RESULT(no)
917 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
918 CURL_DISABLE_LDAPS=1
919 else
920 AC_MSG_RESULT(yes)
921 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
922 HAVE_LDAP_SSL=1
923 fi ]
926AC_MSG_CHECKING([whether to support rtsp])
927AC_ARG_ENABLE(rtsp,
928AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
929AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
930[ case "$enableval" in
931 no)
932 AC_MSG_RESULT(no)
933 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
934 CURL_DISABLE_RTSP=1
935 ;;
936 *)
937 if test "$CURL_DISABLE_HTTP" = "1"; then
938 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
939 else
940 AC_MSG_RESULT(yes)
941 curl_rtsp_msg="enabled"
942 fi
943 ;;
944 esac ],
945 if test "$CURL_DISABLE_HTTP" != "1"; then
946 AC_MSG_RESULT(yes)
947 curl_rtsp_msg="enabled"
948 else
949 AC_MSG_RESULT(no)
950 fi
953AC_MSG_CHECKING([whether to support proxies])
954AC_ARG_ENABLE(proxy,
955AS_HELP_STRING([--enable-proxy],[Enable proxy support])
956AS_HELP_STRING([--disable-proxy],[Disable proxy support]),
957[ case "$enableval" in
958 no)
959 AC_MSG_RESULT(no)
960 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
961 CURL_DISABLE_PROXY=1
962 https_proxy="no"
963 ;;
964 *)
965 AC_MSG_RESULT(yes)
966 ;;
967 esac ],
968 AC_MSG_RESULT(yes)
971AC_MSG_CHECKING([whether to support dict])
972AC_ARG_ENABLE(dict,
973AS_HELP_STRING([--enable-dict],[Enable DICT support])
974AS_HELP_STRING([--disable-dict],[Disable DICT support]),
975[ case "$enableval" in
976 no)
977 AC_MSG_RESULT(no)
978 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
979 CURL_DISABLE_DICT=1
980 ;;
981 *)
982 AC_MSG_RESULT(yes)
983 ;;
984 esac ],
985 AC_MSG_RESULT(yes)
988AC_MSG_CHECKING([whether to support telnet])
989AC_ARG_ENABLE(telnet,
990AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
991AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
992[ case "$enableval" in
993 no)
994 AC_MSG_RESULT(no)
995 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
996 CURL_DISABLE_TELNET=1
997 ;;
998 *)
999 AC_MSG_RESULT(yes)
1000 ;;
1001 esac ],
1002 AC_MSG_RESULT(yes)
1005if test "$curl_cv_winuwp" = "yes"; then
1006 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
1007 CURL_DISABLE_TELNET=1
1010AC_MSG_CHECKING([whether to support tftp])
1011AC_ARG_ENABLE(tftp,
1012AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
1013AS_HELP_STRING([--disable-tftp],[Disable TFTP support]),
1014[ case "$enableval" in
1015 no)
1016 AC_MSG_RESULT(no)
1017 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
1018 CURL_DISABLE_TFTP=1
1019 ;;
1020 *)
1021 AC_MSG_RESULT(yes)
1022 ;;
1023 esac ],
1024 AC_MSG_RESULT(yes)
1027AC_MSG_CHECKING([whether to support pop3])
1028AC_ARG_ENABLE(pop3,
1029AS_HELP_STRING([--enable-pop3],[Enable POP3 support])
1030AS_HELP_STRING([--disable-pop3],[Disable POP3 support]),
1031[ case "$enableval" in
1032 no)
1033 AC_MSG_RESULT(no)
1034 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
1035 CURL_DISABLE_POP3=1
1036 ;;
1037 *)
1038 AC_MSG_RESULT(yes)
1039 ;;
1040 esac ],
1041 AC_MSG_RESULT(yes)
1044AC_MSG_CHECKING([whether to support imap])
1045AC_ARG_ENABLE(imap,
1046AS_HELP_STRING([--enable-imap],[Enable IMAP support])
1047AS_HELP_STRING([--disable-imap],[Disable IMAP support]),
1048[ case "$enableval" in
1049 no)
1050 AC_MSG_RESULT(no)
1051 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
1052 CURL_DISABLE_IMAP=1
1053 ;;
1054 *)
1055 AC_MSG_RESULT(yes)
1056 ;;
1057 esac ],
1058 AC_MSG_RESULT(yes)
1061AC_MSG_CHECKING([whether to support smtp])
1062AC_ARG_ENABLE(smtp,
1063AS_HELP_STRING([--enable-smtp],[Enable SMTP support])
1064AS_HELP_STRING([--disable-smtp],[Disable SMTP support]),
1065[ case "$enableval" in
1066 no)
1067 AC_MSG_RESULT(no)
1068 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
1069 CURL_DISABLE_SMTP=1
1070 ;;
1071 *)
1072 AC_MSG_RESULT(yes)
1073 ;;
1074 esac ],
1075 AC_MSG_RESULT(yes)
1078AC_MSG_CHECKING([whether to support gopher])
1079AC_ARG_ENABLE(gopher,
1080AS_HELP_STRING([--enable-gopher],[Enable Gopher support])
1081AS_HELP_STRING([--disable-gopher],[Disable Gopher support]),
1082[ case "$enableval" in
1083 no)
1084 AC_MSG_RESULT(no)
1085 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
1086 CURL_DISABLE_GOPHER=1
1087 ;;
1088 *)
1089 AC_MSG_RESULT(yes)
1090 ;;
1091 esac ],
1092 AC_MSG_RESULT(yes)
1095AC_MSG_CHECKING([whether to support mqtt])
1096AC_ARG_ENABLE(mqtt,
1097AS_HELP_STRING([--enable-mqtt],[Enable MQTT support])
1098AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
1099[ case "$enableval" in
1100 no)
1101 AC_MSG_RESULT(no)
1102 AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
1103 CURL_DISABLE_MQTT=1
1104 ;;
1105 *)
1106 AC_MSG_RESULT(yes)
1107 ;;
1108 esac ],
1109 AC_MSG_RESULT(no)
1112AC_MSG_CHECKING([enable curl_global_init_mem debug build])
1113AC_ARG_ENABLE(init-mem-debug,
1114AS_HELP_STRING([--enable-init-mem-debug],[curl_global_init_mem debug])
1115AS_HELP_STRING([--disable-init-mem-debug],[]),
1116[ case "$enableval" in
1117 yes)
1118 AC_MSG_RESULT(yes)
1119 AC_DEFINE(CURL_DEBUG_GLOBAL_MEM, 1, [curl_debug_global_mem debug build])
1120 SUPPORT_FEATURES="$SUPPORT_FEATURES global-mem-debug"
1121 ;;
1122 *)
1123 AC_MSG_RESULT(no)
1124 ;;
1125 esac ],
1126 AC_MSG_RESULT(no)
1129dnl **********************************************************************
1130dnl Check for built-in manual
1131dnl **********************************************************************
1133AC_MSG_CHECKING([whether to provide built-in manual])
1134AC_ARG_ENABLE(manual,
1135AS_HELP_STRING([--enable-manual],[Enable built-in manual])
1136AS_HELP_STRING([--disable-manual],[Disable built-in manual]),
1137[ case "$enableval" in
1138 no)
1139 AC_MSG_RESULT(no)
1140 ;;
1141 *)
1142 AC_MSG_RESULT(yes)
1143 USE_MANUAL="1"
1144 ;;
1145 esac ],
1146 AC_MSG_RESULT(yes)
1147 USE_MANUAL="1"
1149dnl The actual use of the USE_MANUAL variable is done much later in this
1150dnl script to allow other actions to disable it as well.
1152dnl **********************************************************************
1153dnl Check whether to build documentation
1154dnl **********************************************************************
1156AC_MSG_CHECKING([whether to build documentation])
1157AC_ARG_ENABLE(docs,
1158AS_HELP_STRING([--enable-docs],[Enable documentation])
1159AS_HELP_STRING([--disable-docs],[Disable documentation]),
1160[ case "$enableval" in
1161 no)
1162 AC_MSG_RESULT(no)
1163 BUILD_DOCS=0
1164 dnl disable manual too because it needs built documentation
1165 USE_MANUAL=0
1166 curl_docs_msg="no"
1167 ;;
1168 *)
1169 AC_MSG_RESULT(yes)
1170 BUILD_DOCS=1
1171 ;;
1172 esac ],
1173 AC_MSG_RESULT(yes)
1174 BUILD_DOCS=1
1176if test -z "$PERL" && test "$BUILD_DOCS" != "0"; then
1177 AC_MSG_WARN([perl was not found. Cannot build documentation.])
1178 BUILD_DOCS=0
1181dnl ************************************************************
1182dnl disable C code generation support
1183dnl
1184AC_MSG_CHECKING([whether to enable generation of C code])
1185AC_ARG_ENABLE(libcurl_option,
1186AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
1187AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
1188[ case "$enableval" in
1189 no)
1190 AC_MSG_RESULT(no)
1191 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
1192 curl_libcurl_msg="no"
1193 ;;
1194 *)
1195 AC_MSG_RESULT(yes)
1196 ;;
1197 esac ],
1198 AC_MSG_RESULT(yes)
1201dnl **********************************************************************
1202dnl Checks for libraries.
1203dnl **********************************************************************
1205AC_MSG_CHECKING([whether to use libgcc])
1206AC_ARG_ENABLE(libgcc,
1207AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
1208[ case "$enableval" in
1209 yes)
1210 LIBS="-lgcc $LIBS"
1211 AC_MSG_RESULT(yes)
1212 ;;
1213 *)
1214 AC_MSG_RESULT(no)
1215 ;;
1216 esac ],
1217 AC_MSG_RESULT(no)
1220AC_MSG_CHECKING([whether to use libbacktrace])
1221AC_ARG_WITH(backtrace,
1222AS_HELP_STRING([--enable-backtrace],[use libbacktrace when linking]),
1223[ case "$enableval" in
1224 yes)
1225 LIBS="-lbacktrace $LIBS"
1226 AC_DEFINE(USE_BACKTRACE, 1, [if libbacktrace is in use])
1227 AC_MSG_RESULT(yes)
1228 ;;
1229 *)
1230 AC_MSG_RESULT(no)
1231 ;;
1232 esac ],
1233 AC_MSG_RESULT(no)
1236CURL_CHECK_LIB_XNET
1238dnl gethostbyname without lib or in the nsl lib?
1239AC_CHECK_FUNC(gethostbyname,
1241 HAVE_GETHOSTBYNAME="1"
1242 ],
1244 AC_CHECK_LIB(nsl, gethostbyname,
1246 HAVE_GETHOSTBYNAME="1"
1247 LIBS="-lnsl $LIBS"
1253if test "$HAVE_GETHOSTBYNAME" != "1"; then
1254 dnl gethostbyname in the socket lib?
1255 AC_CHECK_LIB(socket, gethostbyname,
1257 HAVE_GETHOSTBYNAME="1"
1258 LIBS="-lsocket $LIBS"
1263if test "$HAVE_GETHOSTBYNAME" != "1" && test -n "$WATT_ROOT"; then
1264 dnl gethostbyname in the watt lib?
1265 clean_CPPFLAGS=$CPPFLAGS
1266 clean_LDFLAGS=$LDFLAGS
1267 CPPFLAGS="-I${WATT_ROOT}/inc"
1268 LDFLAGS="-L${WATT_ROOT}/lib"
1269 AC_CHECK_LIB(watt, gethostbyname,
1271 HAVE_GETHOSTBYNAME="1"
1272 LIBS="-lwatt $LIBS"
1273 AC_DEFINE(USE_WATT32, 1, [if Watt-32 is in use])
1274 ],
1276 CPPFLAGS=$clean_CPPFLAGS
1277 LDFLAGS=$clean_LDFLAGS
1282dnl At least one system has been identified to require BOTH nsl and socket
1283dnl libs at the same time to link properly.
1284if test "$HAVE_GETHOSTBYNAME" != "1"; then
1285 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
1286 my_ac_save_LIBS=$LIBS
1287 LIBS="-lnsl -lsocket $LIBS"
1288 AC_LINK_IFELSE([
1289 AC_LANG_PROGRAM([[
1290 ]],[[
1291 gethostbyname();
1292 ]])
1293 ],[
1294 AC_MSG_RESULT([yes])
1295 HAVE_GETHOSTBYNAME="1"
1296 ],[
1297 AC_MSG_RESULT([no])
1298 LIBS=$my_ac_save_LIBS
1299 ])
1302dnl In UWP mode gethostbyname gets detected via the core libs, but some
1303dnl code (in6addr_any) still need ws2_32, so let us detect and add it.
1304if test "$HAVE_GETHOSTBYNAME" != "1" || test "$curl_cv_winuwp" = "yes"; then
1305 if test "$curl_cv_native_windows" = "yes"; then
1306 dnl This is for Winsock systems
1307 winsock_LIB="-lws2_32"
1308 if test "$curl_cv_winuwp" != "yes"; then
1309 winsock_LIB="$winsock_LIB -liphlpapi"
1310 fi
1311 my_ac_save_LIBS=$LIBS
1312 LIBS="$winsock_LIB $LIBS"
1313 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
1314 AC_LINK_IFELSE([
1315 AC_LANG_PROGRAM([[
1316 #ifdef _WIN32
1317 #ifndef WIN32_LEAN_AND_MEAN
1318 #define WIN32_LEAN_AND_MEAN
1319 #endif
1320 #include <winsock2.h>
1321 #endif
1322 ]],[[
1323 gethostbyname("localhost");
1324 ]])
1325 ],[
1326 AC_MSG_RESULT([yes])
1327 HAVE_GETHOSTBYNAME="1"
1328 ],[
1329 AC_MSG_RESULT([no])
1330 winsock_LIB=""
1331 LIBS=$my_ac_save_LIBS
1332 ])
1333 fi
1336if test "$HAVE_GETHOSTBYNAME" != "1"; then
1337 dnl This is for Minix 3.1
1338 AC_MSG_CHECKING([for gethostbyname for Minix 3])
1339 AC_LINK_IFELSE([
1340 AC_LANG_PROGRAM([[
1341 /* Older Minix versions may need <net/gen/netdb.h> here instead */
1342 #include <netdb.h>
1343 ]],[[
1344 gethostbyname("localhost");
1345 ]])
1346 ],[
1347 AC_MSG_RESULT([yes])
1348 HAVE_GETHOSTBYNAME="1"
1349 ],[
1350 AC_MSG_RESULT([no])
1351 ])
1354if test "$HAVE_GETHOSTBYNAME" != "1"; then
1355 dnl This is for eCos with a stubbed DNS implementation
1356 AC_MSG_CHECKING([for gethostbyname for eCos])
1357 AC_LINK_IFELSE([
1358 AC_LANG_PROGRAM([[
1359 #include <stdio.h>
1360 #include <netdb.h>
1361 ]],[[
1362 gethostbyname("localhost");
1363 ]])
1364 ],[
1365 AC_MSG_RESULT([yes])
1366 HAVE_GETHOSTBYNAME="1"
1367 ],[
1368 AC_MSG_RESULT([no])
1369 ])
1372if test "$HAVE_GETHOSTBYNAME" != "1" || test "${with_amissl+set}" = "set"; then
1373 dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
1374 AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
1375 AC_LINK_IFELSE([
1376 AC_LANG_PROGRAM([[
1377 #define __USE_INLINE__
1378 #include <proto/bsdsocket.h>
1379 #ifdef __amigaos4__
1380 struct SocketIFace *ISocket = NULL;
1381 #else
1382 struct Library *SocketBase = NULL;
1383 #endif
1384 ]],[[
1385 unsigned char host[] = "localhost";
1386 gethostbyname(host);
1387 ]])
1388 ],[
1389 AC_MSG_RESULT([yes])
1390 HAVE_GETHOSTBYNAME="1"
1391 HAVE_PROTO_BSDSOCKET_H="1"
1392 AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
1393 ],[
1394 AC_MSG_RESULT([no])
1395 ])
1398if test "$HAVE_GETHOSTBYNAME" != "1"; then
1399 dnl gethostbyname in the network lib - for Haiku OS
1400 AC_CHECK_LIB(network, gethostbyname,
1402 HAVE_GETHOSTBYNAME="1"
1403 LIBS="-lnetwork $LIBS"
1408CURL_CHECK_LIBS_CONNECT
1410dnl **********************************************************************
1411dnl In case that function clock_gettime with monotonic timer is available,
1412dnl check for additional required libraries.
1413dnl **********************************************************************
1414CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
1416dnl Check for even better option
1417CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW
1419dnl **********************************************************************
1420dnl The preceding library checks are all potentially useful for test
1421dnl servers and libtest cases which require networking and clock_gettime
1422dnl support. Save the list of required libraries at this point for use
1423dnl while linking those test servers and programs.
1424dnl **********************************************************************
1425CURL_NETWORK_AND_TIME_LIBS=$LIBS
1427dnl **********************************************************************
1428dnl Check for the presence of ZLIB libraries and headers
1429dnl **********************************************************************
1431dnl Check for & handle argument to --with-zlib.
1433clean_CPPFLAGS=$CPPFLAGS
1434clean_LDFLAGS=$LDFLAGS
1435clean_LIBS=$LIBS
1436ZLIB_LIBS=""
1437AC_ARG_WITH(zlib,
1438AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
1439AS_HELP_STRING([--without-zlib],[disable use of zlib]),
1440 [OPT_ZLIB="$withval"])
1442if test "x$OPT_ZLIB" = "xno"; then
1443 AC_MSG_WARN([zlib disabled])
1444else
1445 if test "x$OPT_ZLIB" = "xyes"; then
1446 OPT_ZLIB=""
1447 fi
1449 if test -z "$OPT_ZLIB"; then
1450 CURL_CHECK_PKGCONFIG(zlib)
1452 if test "$PKGCONFIG" != "no"; then
1453 ZLIB_LIBS="`$PKGCONFIG --libs-only-l zlib`"
1454 if test -n "$ZLIB_LIBS"; then
1455 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
1456 else
1457 ZLIB_LIBS="`$PKGCONFIG --libs zlib`"
1458 fi
1459 LIBS="$ZLIB_LIBS $LIBS"
1460 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags zlib`"
1461 OPT_ZLIB=""
1462 HAVE_LIBZ="1"
1463 fi
1465 if test -z "$HAVE_LIBZ"; then
1467 dnl Check for the lib without setting any new path, since many
1468 dnl people have it in the default path
1470 AC_CHECK_LIB(z, inflateEnd,
1471 dnl libz found, set the variable
1473 HAVE_LIBZ="1"
1474 ZLIB_LIBS="-lz"
1475 LIBS="$ZLIB_LIBS $LIBS"
1476 ],
1477 dnl if no lib found, try /usr/local
1479 OPT_ZLIB="/usr/local"
1482 fi
1483 fi
1485 dnl Add a nonempty path to the compiler flags
1486 if test -n "$OPT_ZLIB"; then
1487 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
1488 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
1489 fi
1491 AC_CHECK_HEADER(zlib.h,
1493 dnl zlib.h was found
1494 HAVE_ZLIB_H="1"
1495 dnl if the lib was not found already, try again with the new paths
1496 if test "$HAVE_LIBZ" != "1"; then
1497 AC_CHECK_LIB(z, gzread,
1499 dnl the lib was found!
1500 HAVE_LIBZ="1"
1501 ZLIB_LIBS="-lz"
1502 LIBS="$ZLIB_LIBS $LIBS"
1503 ],
1505 CPPFLAGS=$clean_CPPFLAGS
1506 LDFLAGS=$clean_LDFLAGS
1509 fi
1510 ],
1512 dnl zlib.h was not found, restore the flags
1513 CPPFLAGS=$clean_CPPFLAGS
1514 LDFLAGS=$clean_LDFLAGS]
1517 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"; then
1518 AC_MSG_WARN([configure found only the libz lib, not the header file!])
1519 HAVE_LIBZ=""
1520 CPPFLAGS=$clean_CPPFLAGS
1521 LDFLAGS=$clean_LDFLAGS
1522 LIBS=$clean_LIBS
1523 ZLIB_LIBS=""
1524 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"; then
1525 AC_MSG_WARN([configure found only the libz header file, not the lib!])
1526 CPPFLAGS=$clean_CPPFLAGS
1527 LDFLAGS=$clean_LDFLAGS
1528 LIBS=$clean_LIBS
1529 ZLIB_LIBS=""
1530 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"; then
1531 dnl both header and lib were found!
1532 AC_SUBST(HAVE_LIBZ)
1533 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
1534 LIBS="$ZLIB_LIBS $clean_LIBS"
1536 dnl replace 'HAVE_LIBZ' in the automake makefile.ams
1537 AMFIXLIB="1"
1538 AC_MSG_NOTICE([found both libz and libz.h header])
1539 dnl Android does not provide zlib.pc
1540 if test "$curl_cv_android" = "no"; then
1541 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE zlib"
1542 fi
1543 curl_zlib_msg="enabled"
1544 fi
1547dnl set variable for use in automakefile(s)
1548AM_CONDITIONAL(HAVE_LIBZ, test "$AMFIXLIB" = "1")
1549AC_SUBST(ZLIB_LIBS)
1551dnl **********************************************************************
1552dnl Check for the presence of BROTLI decoder libraries and headers
1553dnl **********************************************************************
1555dnl Brotli project home page: https://github.com/google/brotli
1557dnl Default to compiler & linker defaults for BROTLI files & libraries.
1558OPT_BROTLI=off
1559AC_ARG_WITH(brotli,
1560AS_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation;
1561 when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1562AS_HELP_STRING([--without-brotli], [disable BROTLI]),
1563 OPT_BROTLI=$withval)
1565if test "x$OPT_BROTLI" != "xno"; then
1566 dnl backup the pre-brotli variables
1567 CLEANLDFLAGS="$LDFLAGS"
1568 CLEANLDFLAGSPC="$LDFLAGSPC"
1569 CLEANCPPFLAGS="$CPPFLAGS"
1570 CLEANLIBS="$LIBS"
1572 case "$OPT_BROTLI" in
1573 yes)
1574 dnl --with-brotli (without path) used
1575 CURL_CHECK_PKGCONFIG(libbrotlidec)
1577 if test "$PKGCONFIG" != "no"; then
1578 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
1579 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
1580 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
1581 version=`$PKGCONFIG --modversion libbrotlidec`
1582 fi
1584 CURL_CHECK_PKGCONFIG(libbrotlicommon)
1586 if test "$PKGCONFIG" != "no"; then
1587 LIB_BROTLI="$LIB_BROTLI `$PKGCONFIG --libs-only-l libbrotlicommon`"
1588 LD_BROTLI="$LD_BROTLI `$PKGCONFIG --libs-only-L libbrotlicommon`"
1589 CPP_BROTLI="$CPP_BROTLI `$PKGCONFIG --cflags-only-I libbrotlicommon`"
1590 fi
1592 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
1593 ;;
1594 off)
1595 dnl no --with-brotli option given, check default places
1596 ;;
1597 *)
1598 dnl use the given --with-brotli spot
1599 PREFIX_BROTLI=$OPT_BROTLI
1600 ;;
1601 esac
1603 dnl if given with a prefix, we set -L and -I based on that
1604 if test -n "$PREFIX_BROTLI"; then
1605 LIB_BROTLI="-lbrotlidec -lbrotlicommon"
1606 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
1607 CPP_BROTLI=-I${PREFIX_BROTLI}/include
1608 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
1609 fi
1611 LDFLAGS="$LDFLAGS $LD_BROTLI"
1612 LDFLAGSPC="$LDFLAGSPC $LD_BROTLI"
1613 CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
1614 LIBS="$LIB_BROTLI $LIBS"
1616 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
1618 AC_CHECK_HEADERS(brotli/decode.h,
1619 curl_brotli_msg="enabled (libbrotlidec)"
1620 HAVE_BROTLI=1
1621 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
1624 if test "x$OPT_BROTLI" != "xoff" &&
1625 test "$HAVE_BROTLI" != "1"; then
1626 AC_MSG_ERROR([BROTLI libs and/or directories were not found!])
1627 fi
1629 if test "$HAVE_BROTLI" = "1"; then
1630 if test -n "$DIR_BROTLI"; then
1631 dnl when the brotli shared libs were found in a path that the runtime
1632 dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH
1633 dnl to prevent further configure tests to fail due to this
1635 if test "$cross_compiling" != "yes"; then
1636 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
1637 export CURL_LIBRARY_PATH
1638 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
1639 fi
1640 fi
1641 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libbrotlidec libbrotlicommon"
1642 else
1643 dnl no brotli, revert back to clean variables
1644 LDFLAGS=$CLEANLDFLAGS
1645 LDFLAGSPC=$CLEANLDFLAGSPC
1646 CPPFLAGS=$CLEANCPPFLAGS
1647 LIBS=$CLEANLIBS
1648 fi
1651dnl **********************************************************************
1652dnl Check for libzstd
1653dnl **********************************************************************
1655dnl Default to compiler & linker defaults for libzstd
1656OPT_ZSTD=off
1657AC_ARG_WITH(zstd,
1658AS_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation;
1659 when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
1660AS_HELP_STRING([--without-zstd], [disable libzstd]),
1661 OPT_ZSTD=$withval)
1663if test "x$OPT_ZSTD" != "xno"; then
1664 dnl backup the pre-zstd variables
1665 CLEANLDFLAGS="$LDFLAGS"
1666 CLEANLDFLAGSPC="$LDFLAGSPC"
1667 CLEANCPPFLAGS="$CPPFLAGS"
1668 CLEANLIBS="$LIBS"
1670 case "$OPT_ZSTD" in
1671 yes)
1672 dnl --with-zstd (without path) used
1673 CURL_CHECK_PKGCONFIG(libzstd)
1675 if test "$PKGCONFIG" != "no"; then
1676 LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
1677 LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
1678 CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
1679 version=`$PKGCONFIG --modversion libzstd`
1680 DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
1681 fi
1683 ;;
1684 off)
1685 dnl no --with-zstd option given, check default places
1686 ;;
1687 *)
1688 dnl use the given --with-zstd spot
1689 PREFIX_ZSTD=$OPT_ZSTD
1690 ;;
1691 esac
1693 dnl if given with a prefix, we set -L and -I based on that
1694 if test -n "$PREFIX_ZSTD"; then
1695 LIB_ZSTD="-lzstd"
1696 LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
1697 CPP_ZSTD=-I${PREFIX_ZSTD}/include
1698 DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
1699 fi
1701 LDFLAGS="$LDFLAGS $LD_ZSTD"
1702 LDFLAGSPC="$LDFLAGSPC $LD_ZSTD"
1703 CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
1704 LIBS="$LIB_ZSTD $LIBS"
1706 AC_CHECK_LIB(zstd, ZSTD_createDStream)
1708 AC_CHECK_HEADERS(zstd.h,
1709 curl_zstd_msg="enabled (libzstd)"
1710 HAVE_ZSTD=1
1711 AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
1714 if test "x$OPT_ZSTD" != "xoff" &&
1715 test "$HAVE_ZSTD" != "1"; then
1716 AC_MSG_ERROR([libzstd was not found where specified!])
1717 fi
1719 if test "$HAVE_ZSTD" = "1"; then
1720 if test -n "$DIR_ZSTD"; then
1721 dnl when the zstd shared lib were found in a path that the runtime
1722 dnl linker does not search through, we need to add it to
1723 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
1724 dnl this
1726 if test "$cross_compiling" != "yes"; then
1727 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
1728 export CURL_LIBRARY_PATH
1729 AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
1730 fi
1731 fi
1732 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libzstd"
1733 else
1734 dnl no zstd, revert back to clean variables
1735 LDFLAGS=$CLEANLDFLAGS
1736 LDFLAGSPC=$CLEANLDFLAGSPC
1737 CPPFLAGS=$CLEANCPPFLAGS
1738 LIBS=$CLEANLIBS
1739 fi
1742dnl **********************************************************************
1743dnl Checks for IPv6
1744dnl **********************************************************************
1746AC_MSG_CHECKING([whether to enable IPv6])
1747AC_ARG_ENABLE(ipv6,
1748AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
1749AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
1750[ case "$enableval" in
1751 no)
1752 AC_MSG_RESULT(no)
1753 ipv6=no
1754 ;;
1755 *)
1756 AC_MSG_RESULT(yes)
1757 ipv6=yes
1758 ;;
1759 esac ],
1761 AC_COMPILE_IFELSE([
1762 AC_LANG_SOURCE([[
1763 /* are AF_INET6 and sockaddr_in6 available? */
1764 #include <sys/types.h>
1765 #ifdef _WIN32
1766 #include <winsock2.h>
1767 #include <ws2tcpip.h>
1768 #else
1769 #include <sys/socket.h>
1770 #include <netinet/in.h>
1771 #ifdef __TANDEM
1772 #include <netinet/in6.h>
1773 #endif
1774 #endif
1775 int main(void)
1777 int s = (int)sizeof(struct sockaddr_in6);
1778 (void)s;
1779 return socket(AF_INET6, SOCK_STREAM, 0) > 0;
1781 ]])
1782 ],
1783 AC_MSG_RESULT(yes)
1784 ipv6=yes,
1785 AC_MSG_RESULT(no)
1786 ipv6=no
1790if test "$ipv6" = "yes"; then
1791 curl_ipv6_msg="enabled"
1792 AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support])
1793 IPV6_ENABLED=1
1795 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
1796 AC_COMPILE_IFELSE([
1797 AC_LANG_PROGRAM([[
1798 #include <sys/types.h>
1799 #ifdef _WIN32
1800 #include <winsock2.h>
1801 #include <ws2tcpip.h>
1802 #else
1803 #include <netinet/in.h>
1804 #ifdef __TANDEM
1805 #include <netinet/in6.h>
1806 #endif
1807 #endif
1808 ]], [[
1809 struct sockaddr_in6 s;
1810 s.sin6_scope_id = 0;
1811 (void)s;
1812 ]])
1813 ],[
1814 AC_MSG_RESULT([yes])
1815 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
1816 ],[
1817 AC_MSG_RESULT([no])
1818 ])
1821dnl **********************************************************************
1822dnl Check if the operating system allows programs to write to their own argv[]
1823dnl **********************************************************************
1825AC_MSG_CHECKING([if argv can be written to])
1826CURL_RUN_IFELSE([[
1827int main(int argc, char *argv[])
1829#ifdef _WIN32
1830 /* on Windows, writing to the argv does not hide the argument in
1831 process lists so it can be skipped */
1832 (void)argc;
1833 (void)argv;
1834 return 1;
1835#else
1836 (void)argc;
1837 argv[0][0] = ' ';
1838 return (argv[0][0] == ' ') ? 0 : 1;
1839#endif
1841]],[
1842 curl_cv_writable_argv=yes
1843],[
1844 curl_cv_writable_argv=no
1845],[
1846 curl_cv_writable_argv=cross
1848if test "$curl_cv_writable_argv" = "cross" && test "$curl_cv_apple" = "yes"; then
1849 curl_cv_writable_argv=yes
1851case $curl_cv_writable_argv in
1852 yes)
1853 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
1854 AC_MSG_RESULT(yes)
1855 ;;
1856 no)
1857 AC_MSG_RESULT(no)
1858 ;;
1859 *)
1860 AC_MSG_RESULT(no)
1861 AC_MSG_WARN([the previous check could not be made default was used])
1862 ;;
1863esac
1865dnl **********************************************************************
1866dnl Check for GSS-API libraries
1867dnl **********************************************************************
1869dnl check for GSS-API stuff in the /usr as default
1871GSSAPI_ROOT="/usr"
1872AC_ARG_WITH(gssapi-includes,
1873 AS_HELP_STRING([--with-gssapi-includes=DIR], [Specify location of GSS-API headers]), [
1874 GSSAPI_INCS="-I$withval"
1875 want_gss="yes"
1879AC_ARG_WITH(gssapi-libs,
1880 AS_HELP_STRING([--with-gssapi-libs=DIR], [Specify location of GSS-API libs]), [
1881 GSSAPI_LIB_DIR="-L$withval"
1882 want_gss="yes"
1886AC_ARG_WITH(gssapi,
1887 AS_HELP_STRING([--with-gssapi=DIR], [Where to look for GSS-API]), [
1888 GSSAPI_ROOT="$withval"
1889 if test "$GSSAPI_ROOT" != "no"; then
1890 want_gss="yes"
1891 if test "$GSSAPI_ROOT" = "yes"; then
1892 dnl if yes, then use default root
1893 GSSAPI_ROOT="/usr"
1894 fi
1895 fi
1899want_gss_apple="no"
1900if test "$curl_cv_apple" = "yes"; then
1901 AC_MSG_CHECKING([whether to use Apple GSS Framework for GSS-API])
1902 AC_ARG_ENABLE(gssapi-apple,
1903AS_HELP_STRING([--enable-gssapi-apple],[Enable Apple GSS Framework (experimental)])
1904AS_HELP_STRING([--disable-gssapi-apple],[Disable Apple GSS Framework (experimental) (default)]), [
1905 case "$enableval" in
1906 yes)
1907 want_gss="yes"
1908 want_gss_apple="yes"
1909 AC_MSG_RESULT([yes])
1910 ;;
1911 *)
1912 AC_MSG_RESULT([no])
1913 ;;
1914 esac
1915 ],
1916 AC_MSG_RESULT([no])
1920: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
1922save_CPPFLAGS="$CPPFLAGS"
1923AC_MSG_CHECKING([if GSS-API support is requested])
1924if test "$want_gss" = "yes"; then
1925 AC_MSG_RESULT(yes)
1927 if test "$want_gss_apple" = "yes"; then
1928 AC_CHECK_HEADER(GSS/gssapi.h, [
1929 AC_DEFINE(HAVE_GSSAPPLE, 1, [if you have Apple GSS Framework])
1930 ],[
1931 AC_MSG_ERROR([--enable-gssapi-apple was specified, but GSS/gssapi.h was not found])
1932 ])
1933 else
1934 if test "$GSSAPI_ROOT" != "/usr"; then
1935 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
1936 else
1937 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
1938 fi
1939 if test -z "$GSSAPI_INCS"; then
1940 if test -n "$host_alias" && test -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
1941 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
1942 elif test "$PKGCONFIG" != "no"; then
1943 GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
1944 elif test -f "$KRB5CONFIG"; then
1945 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
1946 elif test "$GSSAPI_ROOT" != "yes"; then
1947 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1948 fi
1949 fi
1951 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1953 AC_CHECK_HEADER(gss.h,
1955 dnl found in the given dirs
1956 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
1957 gnu_gss=yes
1958 ],
1960 dnl not found, check for MIT
1961 AC_CHECK_HEADERS(
1962 [gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1963 [],
1964 [not_mit=1])
1965 if test "$not_mit" = "1"; then
1966 dnl MIT not found
1967 AC_MSG_ERROR([MIT or GNU GSS library required, but not found])
1968 fi
1971 fi
1972else
1973 AC_MSG_RESULT(no)
1975if test "$want_gss" = "yes"; then
1976 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
1977 HAVE_GSSAPI=1
1979 if test "$want_gss_apple" = "yes"; then
1980 curl_gss_msg="enabled (Apple GSS)"
1981 GSS_LDFLAGS='-framework GSS'
1982 LDFLAGS="$LDFLAGS $GSS_LDFLAGS"
1983 LDFLAGSPC="$LDFLAGSPC $GSS_LDFLAGS"
1984 else
1985 curl_gss_msg="enabled (MIT Kerberos)"
1986 link_pkgconfig=''
1988 if test -n "$gnu_gss"; then
1989 curl_gss_msg="enabled (GNU GSS)"
1990 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1991 LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR"
1992 LIBS="-lgss $LIBS"
1993 link_pkgconfig=1
1994 elif test -z "$GSSAPI_LIB_DIR"; then
1995 if test "$curl_cv_apple" = "yes"; then
1996 LIBS="-lgssapi_krb5 -lresolv $LIBS"
1997 else
1998 if test "$GSSAPI_ROOT" != "/usr"; then
1999 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
2000 else
2001 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
2002 fi
2003 if test -n "$host_alias" && test -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
2004 dnl krb5-config does not have --libs-only-L or similar, put everything
2005 dnl into LIBS
2006 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
2007 LIBS="$gss_libs $LIBS"
2008 elif test "$PKGCONFIG" != "no"; then
2009 gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
2010 LIBS="$gss_libs $LIBS"
2011 link_pkgconfig=1
2012 elif test -f "$KRB5CONFIG"; then
2013 dnl krb5-config does not have --libs-only-L or similar, put everything
2014 dnl into LIBS
2015 gss_libs=`$KRB5CONFIG --libs gssapi`
2016 LIBS="$gss_libs $LIBS"
2017 link_pkgconfig=1
2018 else
2019 case $host in
2020 *-hp-hpux*)
2021 gss_libname="gss"
2022 ;;
2023 *)
2024 gss_libname="gssapi"
2025 ;;
2026 esac
2028 if test "$GSSAPI_ROOT" != "yes"; then
2029 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
2030 LDFLAGSPC="$LDFLAGSPC -L$GSSAPI_ROOT/lib$libsuff"
2031 LIBS="-l$gss_libname $LIBS"
2032 else
2033 LIBS="-l$gss_libname $LIBS"
2034 fi
2035 fi
2036 fi
2037 gss_version=""
2038 if test -n "$host_alias" && test -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
2039 gss_version=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --version | $SED 's/Kerberos 5 release //'`
2040 elif test "$PKGCONFIG" != "no"; then
2041 gss_version=`$PKGCONFIG --modversion mit-krb5-gssapi`
2042 elif test -f "$KRB5CONFIG"; then
2043 gss_version=`$KRB5CONFIG --version | $SED 's/Kerberos 5 release //'`
2044 fi
2045 if test -n "$gss_version"; then
2046 AC_MSG_NOTICE([GSS-API MIT Kerberos version detected: $gss_version])
2047 AC_DEFINE_UNQUOTED([CURL_KRB5_VERSION], ["$gss_version"], [MIT Kerberos version])
2048 fi
2049 else
2050 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
2051 LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR"
2052 case $host in
2053 *-hp-hpux*)
2054 LIBS="-lgss $LIBS"
2055 ;;
2056 *)
2057 LIBS="-lgssapi $LIBS"
2058 ;;
2059 esac
2060 fi
2061 if test -n "$link_pkgconfig"; then
2062 if test -n "$gnu_gss"; then
2063 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gss"
2064 else
2065 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mit-krb5-gssapi"
2066 fi
2067 fi
2068 fi
2069else
2070 CPPFLAGS="$save_CPPFLAGS"
2073if test "$want_gss" = "yes"; then
2074 AC_MSG_CHECKING([if we can link against GSS-API library])
2075 AC_LINK_IFELSE([
2076 AC_LANG_FUNC_LINK_TRY([gss_init_sec_context])
2077 ],[
2078 AC_MSG_RESULT([yes])
2079 ],[
2080 AC_MSG_RESULT([no])
2081 AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.])
2082 ])
2083 AC_CHECK_FUNCS([gss_set_neg_mechs])
2086build_libstubgss=no
2087if test "$want_gss" = "yes"; then
2088 build_libstubgss=yes
2091AM_CONDITIONAL(BUILD_STUB_GSS, test "$build_libstubgss" = "yes")
2093dnl -------------------------------------------------------------
2094dnl parse --with-default-ssl-backend so it can be validated below
2095dnl -------------------------------------------------------------
2097DEFAULT_SSL_BACKEND=no
2098VALID_DEFAULT_SSL_BACKEND=
2099AC_ARG_WITH(default-ssl-backend,
2100AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
2101AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
2102 [DEFAULT_SSL_BACKEND=$withval])
2103case "$DEFAULT_SSL_BACKEND" in
2104 no)
2105 dnl --without-default-ssl-backend option used
2106 ;;
2107 default|yes)
2108 dnl --with-default-ssl-backend option used without name
2109 AC_MSG_ERROR([The name of the default SSL backend is required.])
2110 ;;
2111 *)
2112 dnl --with-default-ssl-backend option used with name
2113 dnl needs to be validated below
2114 VALID_DEFAULT_SSL_BACKEND=no
2115 ;;
2116esac
2118CURL_WITH_SCHANNEL
2119CURL_WITH_AMISSL
2120CURL_WITH_OPENSSL
2121CURL_WITH_GNUTLS
2122CURL_WITH_MBEDTLS
2123CURL_WITH_WOLFSSL
2124CURL_WITH_RUSTLS
2125CURL_WITH_APPLE_SECTRUST
2127dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED
2128if test "$USE_WIN32_CRYPTO" = "1" || test "$SCHANNEL_ENABLED" = "1"; then
2129 LIBS="-ladvapi32 -lcrypt32 $LIBS"
2132if test "$curl_cv_native_windows" = "yes"; then
2133 dnl for BCryptGenRandom()
2134 LIBS="-lbcrypt $LIBS"
2137case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$RUSTLS_ENABLED" in
2138 x)
2139 AC_MSG_ERROR([TLS not detected. Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl or --with-rustls to address this.])
2140 ;;
2141 x1)
2142 dnl one SSL backend is enabled
2143 SSL_ENABLED="1"
2144 AC_MSG_NOTICE([built with one SSL backend])
2145 ;;
2146 xD)
2147 dnl explicitly built without TLS
2148 ;;
2149 xD*)
2150 AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an SSL library
2151(e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl, --with-rustls).
2152Since these are conflicting parameters, verify which is the desired one and drop the other.])
2153 ;;
2154 *)
2155 dnl more than one SSL backend is enabled
2156 SSL_ENABLED="1"
2157 CURL_WITH_MULTI_SSL="1"
2158 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
2159 AC_MSG_NOTICE([built with multiple SSL backends])
2160 ;;
2161esac
2163if test -n "$ssl_backends"; then
2164 curl_ssl_msg="enabled ($ssl_backends)"
2167if test "$VALID_DEFAULT_SSL_BACKEND" = "no"; then
2168 if test -n "$SSL_ENABLED"; then
2169 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
2170 else
2171 AC_MSG_ERROR([Default SSL backend requires SSL!])
2172 fi
2173elif test "$VALID_DEFAULT_SSL_BACKEND" = "yes"; then
2174 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
2177dnl ---------------------
2178dnl check native CA store
2179dnl ---------------------
2181ca_native_opt=0
2182AC_MSG_CHECKING([whether to use native CA store])
2183AC_ARG_ENABLE(ca-native,
2184AS_HELP_STRING([--enable-ca-native],[Enable native CA store])
2185AS_HELP_STRING([--disable-ca-native],[Disable native CA store (default)]),
2186[ case "$enableval" in
2187 yes)
2188 AC_MSG_RESULT([yes])
2189 AC_DEFINE(CURL_CA_NATIVE, 1, [If native CA store is enabled])
2190 ca_native_opt=1
2191 ;;
2192 *)
2193 AC_MSG_RESULT([no])
2194 ;;
2195 esac ],
2196 AC_MSG_RESULT([no])
2199dnl **********************************************************************
2200dnl Check for the CA bundle
2201dnl **********************************************************************
2203if test -n "$check_for_ca_bundle"; then
2204 CURL_CHECK_CA_BUNDLE
2205 CURL_CHECK_CA_EMBED
2208AM_CONDITIONAL(CURL_CA_EMBED_SET, test -n "$CURL_CA_EMBED")
2210dnl ----------------------
2211dnl check unsafe CA search
2212dnl ----------------------
2214if test "$curl_cv_native_windows" = "yes"; then
2215 ca_search=1
2216 AC_MSG_CHECKING([whether to enable unsafe CA bundle search in PATH on Windows])
2217 AC_ARG_ENABLE(ca-search,
2218AS_HELP_STRING([--enable-ca-search],[Enable unsafe CA bundle search in PATH on Windows])
2219AS_HELP_STRING([--disable-ca-search],[Disable unsafe CA bundle search in PATH on Windows]),
2220 [ case "$enableval" in
2221 no)
2222 AC_MSG_RESULT([no])
2223 ca_search=0
2224 ;;
2225 yes)
2226 AC_MSG_RESULT([yes])
2227 ;;
2228 *)
2229 if test "$ca_native_opt" = "1"; then
2230 AC_MSG_RESULT([no])
2231 ca_search=0
2232 else
2233 AC_MSG_RESULT([yes])
2234 fi
2235 ;;
2236 esac ],
2237 if test "$ca_native_opt" = "1"; then
2238 AC_MSG_RESULT([no])
2239 ca_search=0
2240 else
2241 AC_MSG_RESULT([yes])
2242 fi
2244 if test "$ca_search" = "0"; then
2245 AC_DEFINE(CURL_DISABLE_CA_SEARCH, 1, [If unsafe CA bundle search in PATH on Windows is disabled])
2246 fi
2249dnl --------------------
2250dnl check safe CA search
2251dnl --------------------
2253if test "$curl_cv_native_windows" = "yes"; then
2254 AC_MSG_CHECKING([whether to enable safe CA bundle search (within the curl tool directory) on Windows])
2255 AC_ARG_ENABLE(ca-search-safe,
2256AS_HELP_STRING([--enable-ca-search-safe],[Enable safe CA bundle search])
2257AS_HELP_STRING([--disable-ca-search-safe],[Disable safe CA bundle search (default)]),
2258 [ case "$enableval" in
2259 yes)
2260 AC_MSG_RESULT([yes])
2261 AC_DEFINE(CURL_CA_SEARCH_SAFE, 1, [If safe CA bundle search is enabled])
2262 ;;
2263 *)
2264 AC_MSG_RESULT([no])
2265 ;;
2266 esac ],
2267 AC_MSG_RESULT([no])
2271dnl **********************************************************************
2272dnl Check for libpsl
2273dnl **********************************************************************
2275dnl Default to compiler & linker defaults for LIBPSL files & libraries.
2276OPT_LIBPSL=off
2277AC_ARG_WITH(libpsl,
2278AS_HELP_STRING([--with-libpsl=PATH],[Where to look for libpsl, PATH points to the LIBPSL installation;
2279 when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2280AS_HELP_STRING([--without-libpsl], [disable LIBPSL]),
2281 OPT_LIBPSL=$withval)
2283if test "x$OPT_LIBPSL" != "xno"; then
2284 dnl backup the pre-libpsl variables
2285 CLEANLDFLAGS="$LDFLAGS"
2286 CLEANLDFLAGSPC="$LDFLAGSPC"
2287 CLEANCPPFLAGS="$CPPFLAGS"
2288 CLEANLIBS="$LIBS"
2290 case "$OPT_LIBPSL" in
2291 yes|off)
2292 dnl --with-libpsl (without path) used
2293 CURL_CHECK_PKGCONFIG(libpsl)
2295 if test "$PKGCONFIG" != "no"; then
2296 LIB_PSL=`$PKGCONFIG --libs-only-l libpsl`
2297 LD_PSL=`$PKGCONFIG --libs-only-L libpsl`
2298 CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl`
2299 else
2300 dnl no libpsl pkg-config found
2301 LIB_PSL="-lpsl"
2302 fi
2304 ;;
2305 *)
2306 dnl use the given --with-libpsl spot
2307 LIB_PSL="-lpsl"
2308 PREFIX_PSL=$OPT_LIBPSL
2309 ;;
2310 esac
2312 dnl if given with a prefix, we set -L and -I based on that
2313 if test -n "$PREFIX_PSL"; then
2314 LD_PSL=-L${PREFIX_PSL}/lib$libsuff
2315 CPP_PSL=-I${PREFIX_PSL}/include
2316 fi
2318 LDFLAGS="$LDFLAGS $LD_PSL"
2319 LDFLAGSPC="$LDFLAGSPC $LD_PSL"
2320 CPPFLAGS="$CPPFLAGS $CPP_PSL"
2321 LIBS="$LIB_PSL $LIBS"
2323 AC_CHECK_LIB(psl, psl_builtin,
2325 AC_CHECK_HEADERS(libpsl.h,
2326 curl_psl_msg="enabled"
2327 AC_DEFINE(USE_LIBPSL, 1, [if libpsl is in use])
2328 USE_LIBPSL=1
2329 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libpsl"
2331 ],
2332 dnl not found, revert back to clean variables
2333 LDFLAGS=$CLEANLDFLAGS
2334 LDFLAGSPC=$CLEANLDFLAGSPC
2335 CPPFLAGS=$CLEANCPPFLAGS
2336 LIBS=$CLEANLIBS
2339 if test "$USE_LIBPSL" != "1"; then
2340 AC_MSG_ERROR([libpsl libs and/or directories were not found!])
2341 fi
2343AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
2345dnl **********************************************************************
2346dnl Check for libgsasl
2347dnl **********************************************************************
2349OPT_LIBGSASL=no
2350AC_ARG_WITH(libgsasl,
2351AS_HELP_STRING([--with-libgsasl=PATH],[Where to look for libgsasl, PATH points to the libgsasl installation;
2352 when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2353AS_HELP_STRING([--without-libgsasl], [disable libgsasl support for SCRAM]),
2354 OPT_LIBGSASL=$withval)
2356if test "x$OPT_LIBGSASL" != "xno"; then
2357 dnl backup the pre-libgsasl variables
2358 CLEANLDFLAGS="$LDFLAGS"
2359 CLEANLDFLAGSPC="$LDFLAGSPC"
2360 CLEANCPPFLAGS="$CPPFLAGS"
2361 CLEANLIBS="$LIBS"
2363 case "$OPT_LIBGSASL" in
2364 yes)
2365 dnl --with-libgsasl (without path) used
2366 CURL_CHECK_PKGCONFIG(libgsasl)
2368 if test "$PKGCONFIG" != "no"; then
2369 LIB_GSASL=`$PKGCONFIG --libs-only-l libgsasl`
2370 LD_GSASL=`$PKGCONFIG --libs-only-L libgsasl`
2371 CPP_GSASL=`$PKGCONFIG --cflags-only-I libgsasl`
2372 else
2373 dnl no libgsasl pkg-config found
2374 LIB_GSASL="-lgsasl"
2375 fi
2376 ;;
2377 *)
2378 dnl use the given --with-libgsasl spot
2379 PREFIX_GSASL=$OPT_LIBGSASL
2380 ;;
2381 esac
2383 dnl if given with a prefix, we set -L and -I based on that
2384 if test -n "$PREFIX_GSASL"; then
2385 LIB_GSASL="-lgsasl"
2386 LD_GSASL=-L${PREFIX_GSASL}/lib$libsuff
2387 CPP_GSASL=-I${PREFIX_GSASL}/include
2388 fi
2390 LDFLAGS="$LDFLAGS $LD_GSASL"
2391 LDFLAGSPC="$LDFLAGSPC $LD_GSASL"
2392 CPPFLAGS="$CPPFLAGS $CPP_GSASL"
2393 LIBS="$LIB_GSASL $LIBS"
2395 AC_CHECK_LIB(gsasl, gsasl_init,
2397 AC_CHECK_HEADERS(gsasl.h,
2398 curl_gsasl_msg="enabled"
2399 AC_DEFINE(USE_GSASL, 1, [GSASL support enabled])
2400 USE_LIBGSASL=1
2401 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libgsasl"
2403 ],
2404 dnl not found, revert back to clean variables
2405 LDFLAGS=$CLEANLDFLAGS
2406 LDFLAGSPC=$CLEANLDFLAGSPC
2407 CPPFLAGS=$CLEANCPPFLAGS
2408 LIBS=$CLEANLIBS
2409 curl_gsasl_msg="no (libgsasl not found)"
2410 AC_MSG_WARN([libgsasl was not found])
2413AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
2415AC_ARG_WITH(libmetalink,,
2416 AC_MSG_ERROR([--with-libmetalink and --without-libmetalink no longer work!]))
2418dnl **********************************************************************
2419dnl Check for the presence of libssh2 libraries and headers
2420dnl **********************************************************************
2422dnl Default to compiler & linker defaults for libssh2 files & libraries.
2423OPT_LIBSSH2=off
2424AC_ARG_WITH(libssh2,
2425AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation;
2426 when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2427AS_HELP_STRING([--with-libssh2], [enable libssh2]),
2428 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
2430OPT_LIBSSH=off
2431AC_ARG_WITH(libssh,
2432AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation;
2433 when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2434AS_HELP_STRING([--with-libssh], [enable libssh]),
2435 OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2437if test "x$OPT_LIBSSH2" != "xno"; then
2438 dnl backup the pre-libssh2 variables
2439 CLEANLDFLAGS="$LDFLAGS"
2440 CLEANLDFLAGSPC="$LDFLAGSPC"
2441 CLEANCPPFLAGS="$CPPFLAGS"
2442 CLEANLIBS="$LIBS"
2444 case "$OPT_LIBSSH2" in
2445 yes)
2446 dnl --with-libssh2 (without path) used
2447 CURL_CHECK_PKGCONFIG(libssh2)
2449 if test "$PKGCONFIG" != "no"; then
2450 LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
2451 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
2452 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
2453 version=`$PKGCONFIG --modversion libssh2`
2454 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
2455 fi
2457 ;;
2458 off)
2459 dnl no --with-libssh2 option given, check default places
2460 ;;
2461 *)
2462 dnl use the given --with-libssh2 spot
2463 PREFIX_SSH2=$OPT_LIBSSH2
2464 ;;
2465 esac
2467 dnl if given with a prefix, we set -L and -I based on that
2468 if test -n "$PREFIX_SSH2"; then
2469 LIB_SSH2="-lssh2"
2470 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2471 CPP_SSH2=-I${PREFIX_SSH2}/include
2472 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2473 fi
2475 LDFLAGS="$LDFLAGS $LD_SSH2"
2476 LDFLAGSPC="$LDFLAGSPC $LD_SSH2"
2477 CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2478 LIBS="$LIB_SSH2 $LIBS"
2480 dnl check for function added in libssh2 1.9.0
2481 AC_CHECK_LIB(ssh2, libssh2_agent_get_identity_path)
2483 AC_CHECK_HEADER(libssh2.h,
2484 curl_ssh_msg="enabled (libssh2)"
2485 AC_DEFINE(USE_LIBSSH2, 1, [if libssh2 is in use])
2486 USE_LIBSSH2=1
2489 if test "x$OPT_LIBSSH2" != "xoff" &&
2490 test "$USE_LIBSSH2" != "1"; then
2491 AC_MSG_ERROR([libssh2 libs and/or directories were not found!])
2492 fi
2494 if test "$USE_LIBSSH2" = "1"; then
2495 if test -n "$DIR_SSH2"; then
2496 dnl when the libssh2 shared libs were found in a path that the runtime
2497 dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH
2498 dnl to prevent further configure tests to fail due to this
2500 if test "$cross_compiling" != "yes"; then
2501 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
2502 export CURL_LIBRARY_PATH
2503 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2504 fi
2505 fi
2506 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh2"
2507 else
2508 dnl no libssh2, revert back to clean variables
2509 LDFLAGS=$CLEANLDFLAGS
2510 LDFLAGSPC=$CLEANLDFLAGSPC
2511 CPPFLAGS=$CLEANCPPFLAGS
2512 LIBS=$CLEANLIBS
2513 fi
2514elif test "x$OPT_LIBSSH" != "xno"; then
2515 dnl backup the pre-libssh variables
2516 CLEANLDFLAGS="$LDFLAGS"
2517 CLEANLDFLAGSPC="$LDFLAGSPC"
2518 CLEANCPPFLAGS="$CPPFLAGS"
2519 CLEANLIBS="$LIBS"
2521 case "$OPT_LIBSSH" in
2522 yes)
2523 dnl --with-libssh (without path) used
2524 CURL_CHECK_PKGCONFIG(libssh)
2526 if test "$PKGCONFIG" != "no"; then
2527 LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
2528 LD_SSH=`$PKGCONFIG --libs-only-L libssh`
2529 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
2530 version=`$PKGCONFIG --modversion libssh`
2531 DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
2532 fi
2534 ;;
2535 off)
2536 dnl no --with-libssh option given, check default places
2537 ;;
2538 *)
2539 dnl use the given --with-libssh spot
2540 PREFIX_SSH=$OPT_LIBSSH
2541 ;;
2542 esac
2544 dnl if given with a prefix, we set -L and -I based on that
2545 if test -n "$PREFIX_SSH"; then
2546 LIB_SSH="-lssh"
2547 LD_SSH=-L${PREFIX_SSH}/lib$libsuff
2548 CPP_SSH=-I${PREFIX_SSH}/include
2549 DIR_SSH=${PREFIX_SSH}/lib$libsuff
2550 fi
2552 LDFLAGS="$LDFLAGS $LD_SSH"
2553 LDFLAGSPC="$LDFLAGSPC $LD_SSH"
2554 CPPFLAGS="$CPPFLAGS $CPP_SSH"
2555 LIBS="$LIB_SSH $LIBS"
2557 AC_CHECK_LIB(ssh, ssh_new)
2559 AC_CHECK_HEADER(libssh/libssh.h,
2560 curl_ssh_msg="enabled (libssh)"
2561 AC_DEFINE(USE_LIBSSH, 1, [if libssh is in use])
2562 USE_LIBSSH=1
2565 if test "x$OPT_LIBSSH" != "xoff" &&
2566 test "$USE_LIBSSH" != "1"; then
2567 AC_MSG_ERROR([libssh libs and/or directories were not found!])
2568 fi
2570 if test "$USE_LIBSSH" = "1"; then
2571 if test "$curl_cv_native_windows" = "yes"; then
2572 dnl for if_nametoindex
2573 LIBS="-liphlpapi $LIBS"
2574 fi
2575 if test -n "$DIR_SSH"; then
2576 dnl when the libssh shared libs were found in a path that the runtime
2577 dnl linker does not search through, we need to add it to CURL_LIBRARY_PATH
2578 dnl to prevent further configure tests to fail due to this
2580 if test "$cross_compiling" != "yes"; then
2581 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
2582 export CURL_LIBRARY_PATH
2583 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
2584 fi
2585 fi
2586 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh"
2587 else
2588 dnl no libssh, revert back to clean variables
2589 LDFLAGS=$CLEANLDFLAGS
2590 LDFLAGSPC=$CLEANLDFLAGSPC
2591 CPPFLAGS=$CLEANCPPFLAGS
2592 LIBS=$CLEANLIBS
2593 fi
2596dnl **********************************************************************
2597dnl Check for LDAP (after the SSL libraries)
2598dnl **********************************************************************
2600LDAPLIBNAME=""
2601AC_ARG_WITH(ldap-lib,
2602AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
2603 [LDAPLIBNAME="$withval"])
2605LBERLIBNAME=""
2606AC_ARG_WITH(lber-lib,
2607AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
2608 [LBERLIBNAME="$withval"])
2610dnl Handle argument to --with-ldap.
2611clean_LDAP_CPPFLAGS=$CPPFLAGS
2612clean_LDAP_LDFLAGS=$LDFLAGS
2613clean_LDAP_LIBS=$LIBS
2614OPT_LDAP=off
2615AC_ARG_WITH(ldap,
2616AS_HELP_STRING([--with-ldap=PATH],[Where to look for LDAP, PATH points to the LDAP installation;
2617 when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
2618AS_HELP_STRING([--without-ldap], [disable LDAP]),
2619 OPT_LDAP=$withval)
2621case "$OPT_LDAP" in
2622 no)
2623 dnl --without-ldap option used
2624 want_ldap="no"
2625 ;;
2626 yes)
2627 dnl --with-ldap option used without path
2628 want_ldap="yes"
2629 ;;
2630 off)
2631 dnl no --with-ldap option given, do not change anything
2632 want_ldap="default"
2633 ;;
2634 *)
2635 dnl --with-ldap option used with path
2636 want_ldap="yes"
2637 if test -d "$OPT_LDAP/lib$libsuff"; then
2638 LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib$libsuff"
2639 DIR_LDAP="$OPT_LDAP/lib$libsuff"
2640 elif test -d "$OPT_LDAP/lib"; then
2641 LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib"
2642 DIR_LDAP="$OPT_LDAP/lib"
2643 fi
2644 if test -d "$OPT_LDAP/include"; then
2645 CPPFLAGS="$CPPFLAGS -I$OPT_LDAP/include"
2646 fi
2647 ldap_askedfor="yes"
2648 ;;
2649esac
2651if test "$CURL_DISABLE_LDAP" != "1" && test "$want_ldap" != "no"; then
2653 CURL_CHECK_HEADER_LBER
2654 CURL_CHECK_HEADER_LDAP
2655 CURL_CHECK_HEADER_LDAP_SSL
2657 dnl Default to failure; AC_CHECK_LIB success paths set this to yes.
2658 ldap_lib_ok="no"
2660 if test -z "$LDAPLIBNAME"; then
2661 if test "$curl_cv_native_windows" = "yes" && test "$curl_cv_winuwp" != "yes"; then
2662 dnl Windows uses a single and unique LDAP library name
2663 LDAPLIBNAME="wldap32"
2664 LBERLIBNAME="no"
2665 fi
2666 fi
2668 if test "$LDAPLIBNAME"; then
2669 dnl If we have both LDAP and LBER library names, check if we need both
2670 if test "$LBERLIBNAME" && test "$LBERLIBNAME" != "no"; then
2671 dnl Try LDAP first, then with LBER if needed
2672 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init, [ldap_lib_ok=yes], [ldap_lib_ok=no])
2673 if test "$ldap_lib_ok" = "no"; then
2674 dnl LDAP alone failed, try with LBER using a different function
2675 AC_CHECK_LIB("$LDAPLIBNAME", ldap_unbind, [ldap_lib_ok=yes], [ldap_lib_ok=no], [-l$LBERLIBNAME])
2676 if test "$ldap_lib_ok" = "yes"; then
2677 dnl We need both libraries
2678 LIBS="-l$LDAPLIBNAME -l$LBERLIBNAME $LIBS"
2679 fi
2680 else
2681 dnl LDAP alone is sufficient
2682 LIBS="-l$LDAPLIBNAME $LIBS"
2683 fi
2684 else
2685 dnl Only check LDAP library
2686 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init, [ldap_lib_ok=yes; LIBS="-l$LDAPLIBNAME $LIBS"], [ldap_lib_ok=no])
2687 fi
2689 if test "$ldap_lib_ok" = "no"; then
2690 if test -n "$ldap_askedfor"; then
2691 AC_MSG_ERROR([could not detect the LDAP libraries])
2692 fi
2693 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
2694 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
2695 CURL_DISABLE_LDAP=1
2696 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
2697 CURL_DISABLE_LDAPS=1
2698 dnl restore original flags
2699 CPPFLAGS=$clean_LDAP_CPPFLAGS
2700 LDFLAGS=$clean_LDAP_LDFLAGS
2701 LIBS=$clean_LDAP_LIBS
2702 fi
2703 else
2704 dnl Try to find the right ldap libraries for this system
2705 CURL_CHECK_LIBS_LDAP
2706 case X-"$curl_cv_ldap_LIBS" in
2707 X-unknown)
2708 if test -n "$ldap_askedfor"; then
2709 AC_MSG_ERROR([could not detect the LDAP libraries])
2710 fi
2711 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
2712 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
2713 CURL_DISABLE_LDAP=1
2714 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
2715 CURL_DISABLE_LDAPS=1
2716 dnl restore original flags
2717 CPPFLAGS=$clean_LDAP_CPPFLAGS
2718 LDFLAGS=$clean_LDAP_LDFLAGS
2719 LIBS=$clean_LDAP_LIBS
2720 ;;
2721 esac
2722 fi
2725if test "$CURL_DISABLE_LDAP" != "1"; then
2726 dnl Add to library path if needed
2727 if test -n "$DIR_LDAP"; then
2728 dnl when the ldap shared lib were found in a path that the runtime
2729 dnl linker does not search through, we need to add it to
2730 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
2731 dnl this
2733 if test "$cross_compiling" != "yes"; then
2734 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LDAP"
2735 export CURL_LIBRARY_PATH
2736 AC_MSG_NOTICE([Added $DIR_LDAP to CURL_LIBRARY_PATH])
2737 fi
2738 fi
2740 if test "$LBERLIBNAME"; then
2741 dnl If name is "no" then do not define this library at all
2742 dnl (it is only needed if libldap.so's dependencies are broken).
2743 dnl Skip this check if we already determined we need both libraries above
2744 if test "$LBERLIBNAME" != "no" && test "$ldap_lib_ok" != "yes"; then
2745 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
2746 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
2747 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
2748 CURL_DISABLE_LDAP=1
2749 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
2750 CURL_DISABLE_LDAPS=1
2751 dnl restore original flags
2752 CPPFLAGS=$clean_LDAP_CPPFLAGS
2753 LDFLAGS=$clean_LDAP_LDFLAGS
2754 LIBS=$clean_LDAP_LIBS
2757 fi
2758 fi
2761if test "$CURL_DISABLE_LDAP" != "1"; then
2762 AC_CHECK_FUNCS([ldap_url_parse \
2763 ldap_init_fd])
2765 if test "$LDAPLIBNAME" = "wldap32"; then
2766 curl_ldap_msg="enabled (winldap)"
2767 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
2768 else
2769 if test "$ac_cv_func_ldap_init_fd" = "yes"; then
2770 curl_ldap_msg="enabled (OpenLDAP)"
2771 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
2772 USE_OPENLDAP=1
2773 else
2774 curl_ldap_msg="enabled (ancient OpenLDAP)"
2775 fi
2776 fi
2779if test "$CURL_DISABLE_LDAPS" != "1"; then
2780 curl_ldaps_msg="enabled"
2783dnl **********************************************************************
2784dnl Check for linker switch for versioned symbols
2785dnl **********************************************************************
2787versioned_symbols_flavor=
2788AC_MSG_CHECKING([whether versioned symbols are wanted])
2789AC_ARG_ENABLE(versioned-symbols,
2790AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
2791AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2792[ case "$enableval" in
2793 no)
2794 AC_MSG_RESULT(no)
2795 ;;
2796 *)
2797 AC_MSG_RESULT(yes)
2798 AC_MSG_CHECKING([if libraries can be versioned])
2799 GLD=`$LD --help < /dev/null 2>/dev/null | $GREP version-script`
2800 if test -z "$GLD"; then
2801 AC_MSG_RESULT(no)
2802 AC_MSG_WARN([You need an ld version supporting the --version-script option])
2803 else
2804 AC_MSG_RESULT(yes)
2805 if test "x$enableval" != "xyes"; then
2806 versioned_symbols_flavor="$enableval"
2807 elif test "$CURL_WITH_MULTI_SSL" = "1"; then
2808 versioned_symbols_flavor="MULTISSL_"
2809 elif test "$OPENSSL_ENABLED" = "1"; then
2810 versioned_symbols_flavor="OPENSSL_"
2811 elif test "$MBEDTLS_ENABLED" = "1"; then
2812 versioned_symbols_flavor="MBEDTLS_"
2813 elif test "$WOLFSSL_ENABLED" = "1"; then
2814 versioned_symbols_flavor="WOLFSSL_"
2815 elif test "$GNUTLS_ENABLED" = "1"; then
2816 versioned_symbols_flavor="GNUTLS_"
2817 elif test "$RUSTLS_ENABLED" = "1"; then
2818 versioned_symbols_flavor="RUSTLS_"
2819 else
2820 versioned_symbols_flavor=""
2821 fi
2822 versioned_symbols="yes"
2823 fi
2824 ;;
2826 esac
2827], [
2828 AC_MSG_RESULT(no)
2832AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX], ["$versioned_symbols_flavor"])
2833AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME], ["4"]) dnl Keep in sync with VERSIONCHANGE - VERSIONDEL in lib/Makefile.soname
2834AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
2835 [test "$versioned_symbols" = "yes"])
2837dnl ---------------------------
2838dnl check Apple fast UDP option
2839dnl ---------------------------
2841if test "$curl_cv_apple" = "yes"; then
2842 AC_MSG_CHECKING([whether to use Apple fast UDP])
2843 AC_ARG_ENABLE(apple-fast-udp,
2844AS_HELP_STRING([--enable-apple-fast-udp],[Enable using Apple fast UDP (experimental)])
2845AS_HELP_STRING([--disable-apple-fast-udp],[Disable using Apple fast UDP (experimental) (default)]),
2846 [ case "$enableval" in
2847 yes)
2848 AC_MSG_RESULT([yes])
2849 AC_DEFINE(USE_APPLE_FAST_UDP, 1, [to use Apple fast UDP (SYS_recvmsg_x, SYS_sendmsg_x)])
2850 ;;
2851 *)
2852 AC_MSG_RESULT([no])
2853 ;;
2854 esac ],
2855 AC_MSG_RESULT([no])
2859dnl ----------------------------
2860dnl check Windows Unicode option
2861dnl ----------------------------
2863want_winuni="no"
2864if test "$curl_cv_native_windows" = "yes"; then
2865 if test "$curl_cv_winuwp" = "yes"; then
2866 want_winuni="yes"
2867 else
2868 AC_MSG_CHECKING([whether to enable Windows Unicode (Windows native builds only)])
2869 AC_ARG_ENABLE(windows-unicode,
2870AS_HELP_STRING([--enable-windows-unicode],[Enable Windows Unicode])
2871AS_HELP_STRING([--disable-windows-unicode],[Disable Windows Unicode (default)]),
2872 [ case "$enableval" in
2873 yes)
2874 want_winuni="yes"
2875 AC_MSG_RESULT([yes])
2876 ;;
2877 *)
2878 AC_MSG_RESULT([no])
2879 ;;
2880 esac ],
2881 AC_MSG_RESULT([no])
2883 fi
2885 if test "$want_winuni" = "yes"; then
2886 CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE"
2887 fi
2890AM_CONDITIONAL([USE_UNICODE], [test "$want_winuni" = "yes"])
2892dnl -------------------------------------------------
2893dnl check WinIDN option before other IDN libraries
2894dnl -------------------------------------------------
2896tst_links_winidn='no'
2897if test "$curl_cv_native_windows" = "yes"; then
2898 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
2899 OPT_WINIDN="default"
2900 AC_ARG_WITH(winidn,
2901AS_HELP_STRING([--with-winidn],[enable Windows native IDN])
2902AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
2903 OPT_WINIDN=$withval)
2904 case "$OPT_WINIDN" in
2905 no|default)
2906 dnl --without-winidn option used or configure option not specified
2907 want_winidn="no"
2908 AC_MSG_RESULT([no])
2909 ;;
2910 *)
2911 dnl --with-winidn option
2912 want_winidn="yes"
2913 AC_MSG_RESULT([yes])
2914 ;;
2915 esac
2917 if test "$want_winidn" = "yes"; then
2918 LIBS="-lnormaliz $LIBS"
2919 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
2920 IDN_ENABLED=1
2921 curl_idn_msg="enabled (Windows-native)"
2922 fi
2925dnl **********************************************************************
2926dnl Check for the presence of AppleIDN
2927dnl **********************************************************************
2929tst_links_appleidn='no'
2930if test "$curl_cv_apple" = "yes"; then
2931 AC_MSG_CHECKING([whether to build with Apple IDN])
2932 OPT_IDN="default"
2933 AC_ARG_WITH(apple-idn,
2934AS_HELP_STRING([--with-apple-idn],[Enable AppleIDN])
2935AS_HELP_STRING([--without-apple-idn],[Disable AppleIDN]),
2936 [OPT_IDN=$withval])
2937 case "$OPT_IDN" in
2938 yes)
2939 dnl --with-apple-idn option used
2940 AC_MSG_RESULT([yes, check])
2941 AC_CHECK_LIB(icucore, uidna_openUTS46,
2943 AC_CHECK_HEADERS(unicode/uidna.h,
2944 curl_idn_msg="enabled (AppleIDN)"
2945 AC_DEFINE(USE_APPLE_IDN, 1, [if AppleIDN])
2946 USE_APPLE_IDN=1
2947 IDN_ENABLED=1
2948 LIBS="-licucore -liconv $LIBS"
2949 tst_links_appleidn='yes'
2951 ])
2952 ;;
2953 *)
2954 AC_MSG_RESULT([no])
2955 ;;
2956 esac
2959dnl **********************************************************************
2960dnl Check for the presence of libidn2
2961dnl **********************************************************************
2963AC_MSG_CHECKING([whether to build with libidn2])
2964OPT_IDN="default"
2965AC_ARG_WITH(libidn2,
2966AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
2967AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2968 [OPT_IDN=$withval])
2969if test "$tst_links_winidn" = "yes"; then
2970 want_idn="no"
2971 AC_MSG_RESULT([no (using WinIDN instead)])
2972elif test "$tst_links_appleidn" = "yes"; then
2973 want_idn="no"
2974 AC_MSG_RESULT([no (using AppleIDN instead)])
2975else
2976 case "$OPT_IDN" in
2977 no)
2978 dnl --without-libidn2 option used
2979 want_idn="no"
2980 AC_MSG_RESULT([no])
2981 ;;
2982 default)
2983 dnl configure option not specified
2984 want_idn="yes"
2985 want_idn_path="default"
2986 AC_MSG_RESULT([(assumed) yes])
2987 ;;
2988 yes)
2989 dnl --with-libidn2 option used without path
2990 want_idn="yes"
2991 want_idn_path="default"
2992 AC_MSG_RESULT([yes])
2993 ;;
2994 *)
2995 dnl --with-libidn2 option used with path
2996 want_idn="yes"
2997 want_idn_path="$withval"
2998 AC_MSG_RESULT([yes ($withval)])
2999 ;;
3000 esac
3003if test "$want_idn" = "yes"; then
3004 dnl idn library support has been requested
3005 clean_CPPFLAGS="$CPPFLAGS"
3006 clean_LDFLAGS="$LDFLAGS"
3007 clean_LDFLAGSPC="$LDFLAGSPC"
3008 clean_LIBS="$LIBS"
3009 PKGCONFIG="no"
3011 if test "$want_idn_path" != "default"; then
3012 dnl path has been specified
3013 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
3014 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
3015 if test "$PKGCONFIG" != "no"; then
3016 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR])
3017 $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3018 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR])
3019 $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3020 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR])
3021 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3022 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
3023 else
3024 dnl pkg-config not available or provides no info
3025 IDN_LIBS="-lidn2"
3026 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
3027 IDN_CPPFLAGS="-I$want_idn_path/include"
3028 IDN_DIR="$want_idn_path/lib$libsuff"
3029 fi
3030 else
3031 dnl path not specified
3032 CURL_CHECK_PKGCONFIG(libidn2)
3033 if test "$PKGCONFIG" != "no"; then
3034 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
3035 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
3036 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
3037 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
3038 else
3039 dnl pkg-config not available or provides no info
3040 IDN_LIBS="-lidn2"
3041 fi
3042 fi
3044 if test "$PKGCONFIG" != "no"; then
3045 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
3046 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
3047 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3048 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
3049 else
3050 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
3051 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
3052 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
3053 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
3054 fi
3056 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
3057 LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
3058 LDFLAGSPC="$LDFLAGSPC $IDN_LDFLAGS"
3059 LIBS="$IDN_LIBS $LIBS"
3061 AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
3062 AC_LINK_IFELSE([
3063 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
3064 ],[
3065 AC_MSG_RESULT([yes])
3066 tst_links_libidn="yes"
3067 ],[
3068 AC_MSG_RESULT([no])
3069 tst_links_libidn="no"
3070 ])
3072 AC_CHECK_HEADERS(idn2.h)
3074 if test "$tst_links_libidn" = "yes"; then
3075 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
3076 dnl different versions of libidn have different setups of these:
3078 IDN_ENABLED=1
3079 curl_idn_msg="enabled (libidn2)"
3080 if test -n "$IDN_DIR" && test "$cross_compiling" != "yes"; then
3081 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
3082 export CURL_LIBRARY_PATH
3083 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
3084 fi
3085 LIBCURL_PC_REQUIRES_PRIVATE="libidn2 $LIBCURL_PC_REQUIRES_PRIVATE"
3086 else
3087 AC_MSG_WARN([Cannot find libidn2])
3088 CPPFLAGS="$clean_CPPFLAGS"
3089 LDFLAGS="$clean_LDFLAGS"
3090 LDFLAGSPC="$clean_LDFLAGSPC"
3091 LIBS="$clean_LIBS"
3092 want_idn="no"
3093 fi
3096dnl **********************************************************************
3097dnl Check for nghttp2
3098dnl **********************************************************************
3100OPT_H2="yes"
3102if test "$disable_http" = "yes"; then
3103 dnl without HTTP nghttp2 is no use
3104 OPT_H2="no"
3107AC_ARG_WITH(nghttp2,
3108AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
3109AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
3110 [OPT_H2=$withval])
3111case "$OPT_H2" in
3112 no)
3113 dnl --without-nghttp2 option used
3114 want_nghttp2="no"
3115 ;;
3116 yes)
3117 dnl --with-nghttp2 option used without path
3118 want_nghttp2="default"
3119 want_nghttp2_path=""
3120 want_nghttp2_pkg_config_path=""
3121 ;;
3122 *)
3123 dnl --with-nghttp2 option used with path
3124 want_nghttp2="yes"
3125 want_nghttp2_path="$withval"
3126 want_nghttp2_pkg_config_path="$OPT_H2/lib/pkgconfig"
3127 ;;
3128esac
3130if test "$want_nghttp2" != "no"; then
3131 dnl backup the pre-nghttp2 variables
3132 CLEANLDFLAGS="$LDFLAGS"
3133 CLEANLDFLAGSPC="$LDFLAGSPC"
3134 CLEANCPPFLAGS="$CPPFLAGS"
3135 CLEANLIBS="$LIBS"
3137 CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path)
3139 if test "$PKGCONFIG" != "no"; then
3140 LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
3141 $PKGCONFIG --libs-only-l libnghttp2`
3142 AC_MSG_NOTICE([-l is $LIB_H2])
3144 CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
3145 $PKGCONFIG --cflags-only-I libnghttp2`
3146 AC_MSG_NOTICE([-I is $CPP_H2])
3148 LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
3149 $PKGCONFIG --libs-only-L libnghttp2`
3150 AC_MSG_NOTICE([-L is $LD_H2])
3152 DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'`
3153 elif test -n "$want_nghttp2_path"; then
3154 LIB_H2="-lnghttp2"
3155 LD_H2=-L${want_nghttp2_path}/lib$libsuff
3156 CPP_H2=-I${want_nghttp2_path}/include
3157 DIR_H2=${want_nghttp2_path}/lib$libsuff
3158 elif test "$want_nghttp2" != "default"; then
3159 dnl no nghttp2 pkg-config found and no custom directory specified,
3160 dnl deal with it
3161 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
3162 else
3163 LIB_H2="-lnghttp2"
3164 fi
3166 LDFLAGS="$LDFLAGS $LD_H2"
3167 LDFLAGSPC="$LDFLAGSPC $LD_H2"
3168 CPPFLAGS="$CPPFLAGS $CPP_H2"
3169 LIBS="$LIB_H2 $LIBS"
3171 dnl use nghttp2_session_get_stream_local_window_size to require nghttp2
3172 dnl >= 1.15.0
3173 AC_CHECK_LIB(nghttp2, nghttp2_session_get_stream_local_window_size,
3175 AC_CHECK_HEADERS(nghttp2/nghttp2.h,
3176 curl_h2_msg="enabled (nghttp2)"
3177 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
3178 USE_NGHTTP2=1
3179 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp2"
3182 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2"
3183 export CURL_LIBRARY_PATH
3184 AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH])
3185 ],
3186 dnl not found, revert back to clean variables
3187 LDFLAGS=$CLEANLDFLAGS
3188 LDFLAGSPC=$CLEANLDFLAGSPC
3189 CPPFLAGS=$CLEANCPPFLAGS
3190 LIBS=$CLEANLIBS
3194dnl **********************************************************************
3195dnl Check for ngtcp2 (QUIC)
3196dnl **********************************************************************
3198OPT_TCP2="no"
3200if test "$disable_http" = "yes"; then
3201 dnl without HTTP, ngtcp2 is no use
3202 OPT_TCP2="no"
3205AC_ARG_WITH(ngtcp2,
3206AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
3207AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
3208 [OPT_TCP2=$withval])
3209case "$OPT_TCP2" in
3210 no)
3211 dnl --without-ngtcp2 option used
3212 want_tcp2="no"
3213 ;;
3214 yes)
3215 dnl --with-ngtcp2 option used without path
3216 want_tcp2="default"
3217 want_tcp2_path=""
3218 ;;
3219 *)
3220 dnl --with-ngtcp2 option used with path
3221 want_tcp2="yes"
3222 want_tcp2_path="$OPT_TCP2/lib/pkgconfig"
3223 ;;
3224esac
3226curl_tcp2_msg="no (--with-ngtcp2)"
3227if test "$want_tcp2" != "no"; then
3229 if test "$QUIC_ENABLED" != "yes"; then
3230 AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-ngtcp2 a no-no])
3231 fi
3233 dnl backup the pre-ngtcp2 variables
3234 CLEANLDFLAGS="$LDFLAGS"
3235 CLEANLDFLAGSPC="$LDFLAGSPC"
3236 CLEANCPPFLAGS="$CPPFLAGS"
3237 CLEANLIBS="$LIBS"
3239 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
3241 if test "$PKGCONFIG" != "no"; then
3242 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3243 $PKGCONFIG --libs-only-l libngtcp2`
3244 AC_MSG_NOTICE([-l is $LIB_TCP2])
3246 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3247 $PKGCONFIG --cflags-only-I libngtcp2`
3248 AC_MSG_NOTICE([-I is $CPP_TCP2])
3250 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
3251 $PKGCONFIG --libs-only-L libngtcp2`
3252 AC_MSG_NOTICE([-L is $LD_TCP2])
3254 LDFLAGS="$LDFLAGS $LD_TCP2"
3255 LDFLAGSPC="$LDFLAGSPC $LD_TCP2"
3256 CPPFLAGS="$CPPFLAGS $CPP_TCP2"
3257 LIBS="$LIB_TCP2 $LIBS"
3259 if test "$cross_compiling" != "yes"; then
3260 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
3261 fi
3262 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
3264 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
3265 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
3266 USE_NGTCP2=1
3267 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
3268 export CURL_LIBRARY_PATH
3269 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
3270 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2"
3272 ],
3273 dnl not found, revert back to clean variables
3274 LDFLAGS=$CLEANLDFLAGS
3275 LDFLAGSPC=$CLEANLDFLAGSPC
3276 CPPFLAGS=$CLEANCPPFLAGS
3277 LIBS=$CLEANLIBS
3280 else
3281 dnl no ngtcp2 pkg-config found, deal with it
3282 if test "$want_tcp2" != "default"; then
3283 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3284 dnl a pkgconfig file
3285 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
3286 fi
3287 fi
3290if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" && test "$HAVE_LIBRESSL" = "1"; then
3292 dnl backup the pre-ngtcp2_crypto_libressl variables
3293 CLEANLDFLAGS="$LDFLAGS"
3294 CLEANLDFLAGSPC="$LDFLAGSPC"
3295 CLEANCPPFLAGS="$CPPFLAGS"
3296 CLEANLIBS="$LIBS"
3298 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_libressl, $want_tcp2_path, 1)
3300 if test "$PKGCONFIG" != "no"; then
3301 LIB_NGTCP2_CRYPTO_LIBRESSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3302 $PKGCONFIG --libs-only-l libngtcp2_crypto_libressl`
3303 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_LIBRESSL])
3305 CPP_NGTCP2_CRYPTO_LIBRESSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3306 $PKGCONFIG --cflags-only-I libngtcp2_crypto_libressl`
3307 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_LIBRESSL])
3309 LD_NGTCP2_CRYPTO_LIBRESSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3310 $PKGCONFIG --libs-only-L libngtcp2_crypto_libressl`
3311 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_LIBRESSL])
3313 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_LIBRESSL"
3314 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_LIBRESSL"
3315 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_LIBRESSL"
3316 LIBS="$LIB_NGTCP2_CRYPTO_LIBRESSL $LIBS"
3318 if test "$cross_compiling" != "yes"; then
3319 DIR_NGTCP2_CRYPTO_LIBRESSL=`echo $LD_NGTCP2_CRYPTO_LIBRESSL | $SED -e 's/^-L//'`
3320 fi
3321 AC_CHECK_LIB(ngtcp2_crypto_libressl, ngtcp2_crypto_recv_client_initial_cb,
3323 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3324 USE_NGTCP2=1
3325 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_LIBRESSL"
3326 export CURL_LIBRARY_PATH
3327 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_LIBRESSL to CURL_LIBRARY_PATH])
3328 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_libressl"
3330 ],
3331 dnl not found, revert back to clean variables
3332 LDFLAGS=$CLEANLDFLAGS
3333 LDFLAGSPC=$CLEANLDFLAGSPC
3334 CPPFLAGS=$CLEANCPPFLAGS
3335 LIBS=$CLEANLIBS
3338 else
3339 dnl no ngtcp2_crypto_libressl pkg-config found, deal with it
3340 if test "$want_tcp2" != "default"; then
3341 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3342 dnl a pkgconfig file
3343 AC_MSG_WARN([--with-ngtcp2 was specified but could not find ngtcp2_crypto_libressl pkg-config file.])
3344 dnl Pretend to be quictls to fall back to using ngtcp2_crypto_quictls
3345 fi
3346 HAVE_LIBRESSL=0
3347 fi
3350if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" && test "$HAVE_LIBRESSL" != "1" &&
3351 test "$OPENSSL_IS_AWSLC" != "1" && test "$OPENSSL_IS_BORINGSSL" != "1" && test "$OPENSSL_QUIC_API2" != "1"; then
3353 dnl backup the pre-ngtcp2_crypto_quictls variables
3354 CLEANLDFLAGS="$LDFLAGS"
3355 CLEANLDFLAGSPC="$LDFLAGSPC"
3356 CLEANCPPFLAGS="$CPPFLAGS"
3357 CLEANLIBS="$LIBS"
3359 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_quictls, $want_tcp2_path, 1)
3361 if test "$PKGCONFIG" != "no"; then
3362 LIB_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3363 $PKGCONFIG --libs-only-l libngtcp2_crypto_quictls`
3364 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_QUICTLS])
3366 CPP_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3367 $PKGCONFIG --cflags-only-I libngtcp2_crypto_quictls`
3368 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_QUICTLS])
3370 LD_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3371 $PKGCONFIG --libs-only-L libngtcp2_crypto_quictls`
3372 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_QUICTLS])
3374 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS"
3375 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_QUICTLS"
3376 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS"
3377 LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS"
3379 if test "$cross_compiling" != "yes"; then
3380 DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'`
3381 fi
3382 AC_CHECK_LIB(ngtcp2_crypto_quictls, ngtcp2_crypto_recv_client_initial_cb,
3384 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3385 USE_NGTCP2=1
3386 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS"
3387 export CURL_LIBRARY_PATH
3388 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH])
3389 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_quictls"
3391 ],
3392 dnl not found, revert back to clean variables
3393 LDFLAGS=$CLEANLDFLAGS
3394 LDFLAGSPC=$CLEANLDFLAGSPC
3395 CPPFLAGS=$CLEANCPPFLAGS
3396 LIBS=$CLEANLIBS
3399 else
3400 dnl no ngtcp2_crypto_quictls pkg-config found, deal with it
3401 if test "$want_tcp2" != "default"; then
3402 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3403 dnl a pkgconfig file
3404 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_quictls pkg-config file.])
3405 fi
3406 fi
3409if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" &&
3410 test "$OPENSSL_IS_AWSLC" != "1" && test "$OPENSSL_IS_BORINGSSL" != "1" && test "$OPENSSL_QUIC_API2" = "1"; then
3412 dnl backup the pre-ngtcp2_crypto_ossl variables
3413 CLEANLDFLAGS="$LDFLAGS"
3414 CLEANLDFLAGSPC="$LDFLAGSPC"
3415 CLEANCPPFLAGS="$CPPFLAGS"
3416 CLEANLIBS="$LIBS"
3418 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_ossl, $want_tcp2_path, 1)
3420 if test "$PKGCONFIG" != "no"; then
3421 LIB_NGTCP2_CRYPTO_OSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3422 $PKGCONFIG --libs-only-l libngtcp2_crypto_ossl`
3423 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OSSL])
3425 CPP_NGTCP2_CRYPTO_OSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3426 $PKGCONFIG --cflags-only-I libngtcp2_crypto_ossl`
3427 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OSSL])
3429 LD_NGTCP2_CRYPTO_OSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3430 $PKGCONFIG --libs-only-L libngtcp2_crypto_ossl`
3431 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OSSL])
3433 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OSSL"
3434 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_OSSL"
3435 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OSSL"
3436 LIBS="$LIB_NGTCP2_CRYPTO_OSSL $LIBS"
3438 if test "$cross_compiling" != "yes"; then
3439 DIR_NGTCP2_CRYPTO_OSSL=`echo $LD_NGTCP2_CRYPTO_OSSL | $SED -e 's/^-L//'`
3440 fi
3441 AC_CHECK_LIB(ngtcp2_crypto_ossl, ngtcp2_crypto_recv_client_initial_cb,
3443 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3444 USE_NGTCP2=1
3445 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OSSL"
3446 export CURL_LIBRARY_PATH
3447 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OSSL to CURL_LIBRARY_PATH])
3448 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_ossl"
3449 AC_DEFINE(OPENSSL_QUIC_API2, 1, [openssl with new QUIC API])
3451 ],
3452 dnl not found, revert back to clean variables
3453 LDFLAGS=$CLEANLDFLAGS
3454 LDFLAGSPC=$CLEANLDFLAGSPC
3455 CPPFLAGS=$CLEANCPPFLAGS
3456 LIBS=$CLEANLIBS
3459 else
3460 dnl no ngtcp2_crypto_ossl pkg-config found, deal with it
3461 if test "$want_tcp2" != "default"; then
3462 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3463 dnl a pkgconfig file
3464 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_ossl pkg-config file.])
3465 fi
3466 fi
3469if test "$USE_NGTCP2" = "1" && test "$OPENSSL_ENABLED" = "1" &&
3470 (test "$OPENSSL_IS_AWSLC" = "1" || test "$OPENSSL_IS_BORINGSSL" = "1"); then
3472 dnl backup the pre-ngtcp2_crypto_boringssl variables
3473 CLEANLDFLAGS="$LDFLAGS"
3474 CLEANLDFLAGSPC="$LDFLAGSPC"
3475 CLEANCPPFLAGS="$CPPFLAGS"
3476 CLEANLIBS="$LIBS"
3478 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_boringssl, $want_tcp2_path, 1)
3480 if test "$PKGCONFIG" != "no"; then
3481 LIB_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3482 $PKGCONFIG --libs-only-l libngtcp2_crypto_boringssl`
3483 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_BORINGSSL])
3485 CPP_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3486 $PKGCONFIG --cflags-only-I libngtcp2_crypto_boringssl`
3487 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_BORINGSSL])
3489 LD_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3490 $PKGCONFIG --libs-only-L libngtcp2_crypto_boringssl`
3491 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_BORINGSSL])
3493 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_BORINGSSL"
3494 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_BORINGSSL"
3495 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_BORINGSSL"
3496 LIBS="$LIB_NGTCP2_CRYPTO_BORINGSSL $LIBS"
3498 if test "$cross_compiling" != "yes"; then
3499 DIR_NGTCP2_CRYPTO_BORINGSSL=`echo $LD_NGTCP2_CRYPTO_BORINGSSL | $SED -e 's/^-L//'`
3500 fi
3501 AC_CHECK_LIB(ngtcp2_crypto_boringssl, ngtcp2_crypto_recv_client_initial_cb,
3503 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3504 USE_NGTCP2=1
3505 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_BORINGSSL"
3506 export CURL_LIBRARY_PATH
3507 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_BORINGSSL to CURL_LIBRARY_PATH])
3508 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_boringssl"
3510 ],
3511 dnl not found, revert back to clean variables
3512 LDFLAGS=$CLEANLDFLAGS
3513 LDFLAGSPC=$CLEANLDFLAGSPC
3514 CPPFLAGS=$CLEANCPPFLAGS
3515 LIBS=$CLEANLIBS
3518 else
3519 dnl no ngtcp2_crypto_boringssl pkg-config found, deal with it
3520 if test "$want_tcp2" != "default"; then
3521 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3522 dnl a pkgconfig file
3523 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file.])
3524 fi
3525 fi
3528if test "$USE_NGTCP2" = "1" && test "$GNUTLS_ENABLED" = "1"; then
3529 dnl backup the pre-ngtcp2_crypto_gnutls variables
3530 CLEANLDFLAGS="$LDFLAGS"
3531 CLEANLDFLAGSPC="$LDFLAGSPC"
3532 CLEANCPPFLAGS="$CPPFLAGS"
3533 CLEANLIBS="$LIBS"
3535 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path, 1)
3537 if test "$PKGCONFIG" != "no"; then
3538 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3539 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
3540 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
3542 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3543 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
3544 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
3546 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3547 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
3548 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
3550 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
3551 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_GNUTLS"
3552 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
3553 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
3555 if test "$cross_compiling" != "yes"; then
3556 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
3557 fi
3558 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb,
3560 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3561 USE_NGTCP2=1
3562 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
3563 export CURL_LIBRARY_PATH
3564 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
3565 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_gnutls"
3567 ],
3568 dnl not found, revert back to clean variables
3569 LDFLAGS=$CLEANLDFLAGS
3570 LDFLAGSPC=$CLEANLDFLAGSPC
3571 CPPFLAGS=$CLEANCPPFLAGS
3572 LIBS=$CLEANLIBS
3575 else
3576 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
3577 if test "$want_tcp2" != "default"; then
3578 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3579 dnl a pkgconfig file
3580 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
3581 fi
3582 fi
3585if test "$USE_NGTCP2" = "1" && test "$WOLFSSL_ENABLED" = "1"; then
3586 dnl backup the pre-ngtcp2_crypto_wolfssl variables
3587 CLEANLDFLAGS="$LDFLAGS"
3588 CLEANLDFLAGSPC="$LDFLAGSPC"
3589 CLEANCPPFLAGS="$CPPFLAGS"
3590 CLEANLIBS="$LIBS"
3592 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path, 1)
3594 if test "$PKGCONFIG" != "no"; then
3595 LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3596 $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl`
3597 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL])
3599 CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3600 $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl`
3601 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL])
3603 LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path], 1)
3604 $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl`
3605 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL])
3607 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL"
3608 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_WOLFSSL"
3609 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL"
3610 LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS"
3612 if test "$cross_compiling" != "yes"; then
3613 DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'`
3614 fi
3615 AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb,
3617 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
3618 USE_NGTCP2=1
3619 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL"
3620 export CURL_LIBRARY_PATH
3621 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH])
3622 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_wolfssl"
3624 ],
3625 dnl not found, revert back to clean variables
3626 LDFLAGS=$CLEANLDFLAGS
3627 LDFLAGSPC=$CLEANLDFLAGSPC
3628 CPPFLAGS=$CLEANCPPFLAGS
3629 LIBS=$CLEANLIBS
3632 else
3633 dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it
3634 if test "$want_tcp2" != "default"; then
3635 dnl To avoid link errors, we do not allow --with-ngtcp2 without
3636 dnl a pkgconfig file
3637 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.])
3638 fi
3639 fi
3642dnl **********************************************************************
3643dnl Check for nghttp3 (HTTP/3 with ngtcp2)
3644dnl **********************************************************************
3646OPT_NGHTTP3="yes"
3648if test "$USE_NGTCP2" != "1"; then
3649 dnl without ngtcp2, nghttp3 is of no use for us
3650 OPT_NGHTTP3="no"
3651 want_nghttp3="no"
3654AC_ARG_WITH(nghttp3,
3655AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
3656AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
3657 [OPT_NGHTTP3=$withval])
3658case "$OPT_NGHTTP3" in
3659 no)
3660 dnl --without-nghttp3 option used
3661 want_nghttp3="no"
3662 ;;
3663 yes)
3664 dnl --with-nghttp3 option used without path
3665 want_nghttp3="default"
3666 want_nghttp3_path=""
3667 ;;
3668 *)
3669 dnl --with-nghttp3 option used with path
3670 want_nghttp3="yes"
3671 want_nghttp3_path="$OPT_NGHTTP3/lib/pkgconfig"
3672 ;;
3673esac
3675curl_http3_msg="no (--with-nghttp3)"
3676if test "$want_nghttp3" != "no"; then
3678 if test "x$USE_NGTCP2" != "x1"; then
3679 dnl without ngtcp2, nghttp3 is of no use for us
3680 AC_MSG_ERROR([nghttp3 enabled without a QUIC library; enable ngtcp2])
3681 fi
3683 dnl backup the pre-nghttp3 variables
3684 CLEANLDFLAGS="$LDFLAGS"
3685 CLEANLDFLAGSPC="$LDFLAGSPC"
3686 CLEANCPPFLAGS="$CPPFLAGS"
3687 CLEANLIBS="$LIBS"
3689 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
3691 if test "$PKGCONFIG" != "no"; then
3692 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3693 $PKGCONFIG --libs-only-l libnghttp3`
3694 AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
3696 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3697 $PKGCONFIG --cflags-only-I libnghttp3`
3698 AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
3700 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
3701 $PKGCONFIG --libs-only-L libnghttp3`
3702 AC_MSG_NOTICE([-L is $LD_NGHTTP3])
3704 LDFLAGS="$LDFLAGS $LD_NGHTTP3"
3705 LDFLAGSPC="$LDFLAGSPC $LD_NGHTTP3"
3706 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
3707 LIBS="$LIB_NGHTTP3 $LIBS"
3709 if test "$cross_compiling" != "yes"; then
3710 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
3711 fi
3712 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
3714 AC_CHECK_HEADERS(nghttp3/nghttp3.h,
3715 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
3716 USE_NGHTTP3=1
3717 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
3718 export CURL_LIBRARY_PATH
3719 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
3720 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp3"
3722 ],
3723 dnl not found, revert back to clean variables
3724 LDFLAGS=$CLEANLDFLAGS
3725 LDFLAGSPC=$CLEANLDFLAGSPC
3726 CPPFLAGS=$CLEANCPPFLAGS
3727 LIBS=$CLEANLIBS
3729 else
3730 dnl no nghttp3 pkg-config found, deal with it
3731 if test "$want_nghttp3" != "default"; then
3732 dnl To avoid link errors, we do not allow --with-nghttp3 without
3733 dnl a pkgconfig file
3734 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
3735 fi
3736 fi
3739dnl **********************************************************************
3740dnl Check for ngtcp2 and nghttp3 (HTTP/3 with ngtcp2 + nghttp3)
3741dnl **********************************************************************
3743if test "$USE_NGTCP2" = "1" && test "$USE_NGHTTP3" = "1"; then
3744 USE_NGTCP2_H3=1
3745 curl_h3_msg="enabled (ngtcp2 + nghttp3)"
3748dnl **********************************************************************
3749dnl Check for quiche (QUIC)
3750dnl **********************************************************************
3752OPT_QUICHE="no"
3754if test "$disable_http" = "yes" || test "$USE_NGTCP" = "1"; then
3755 dnl without HTTP or with ngtcp2, quiche is no use
3756 OPT_QUICHE="no"
3759AC_ARG_WITH(quiche,
3760AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage (experimental)])
3761AS_HELP_STRING([--without-quiche],[Disable quiche usage (experimental)]),
3762 [OPT_QUICHE=$withval])
3763case "$OPT_QUICHE" in
3764 no)
3765 dnl --without-quiche option used
3766 want_quiche="no"
3767 ;;
3768 yes)
3769 dnl --with-quiche option used without path
3770 want_quiche="default"
3771 want_quiche_path=""
3772 ;;
3773 *)
3774 dnl --with-quiche option used with path
3775 want_quiche="yes"
3776 want_quiche_path="$withval"
3777 ;;
3778esac
3780if test "$want_quiche" != "no"; then
3782 if test "$QUIC_ENABLED" != "yes"; then
3783 AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-quiche a no-no])
3784 fi
3786 if test "$NGHTTP3_ENABLED" = "1"; then
3787 AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
3788 fi
3790 dnl backup the pre-quiche variables
3791 CLEANLDFLAGS="$LDFLAGS"
3792 CLEANLDFLAGSPC="$LDFLAGSPC"
3793 CLEANCPPFLAGS="$CPPFLAGS"
3794 CLEANLIBS="$LIBS"
3796 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
3798 if test "$PKGCONFIG" != "no"; then
3799 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3800 $PKGCONFIG --libs-only-l quiche`
3801 AC_MSG_NOTICE([-l is $LIB_QUICHE])
3803 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3804 $PKGCONFIG --cflags-only-I quiche`
3805 AC_MSG_NOTICE([-I is $CPP_QUICHE])
3807 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
3808 $PKGCONFIG --libs-only-L quiche`
3809 AC_MSG_NOTICE([-L is $LD_QUICHE])
3811 LDFLAGS="$LDFLAGS $LD_QUICHE"
3812 LDFLAGSPC="$LDFLAGSPC $LD_QUICHE"
3813 CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
3814 LIBS="$LIB_QUICHE $LIBS"
3816 if test "$cross_compiling" != "yes"; then
3817 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
3818 fi
3819 AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting,
3821 AC_CHECK_HEADERS(quiche.h,
3822 experimental="$experimental quiche"
3823 AC_MSG_NOTICE([HTTP3 support is experimental])
3824 curl_h3_msg="enabled (quiche)"
3825 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
3826 USE_QUICHE=1
3827 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
3828 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
3829 export CURL_LIBRARY_PATH
3830 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH])
3831 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE quiche",
3832 [],
3834 AC_INCLUDES_DEFAULT
3835 #include <sys/socket.h>
3838 ],
3839 dnl not found, revert back to clean variables
3840 AC_MSG_ERROR([could not use quiche])
3842 else
3843 dnl no quiche pkg-config found, deal with it
3844 if test "$want_quiche" != "default"; then
3845 dnl To avoid link errors, we do not allow --with-quiche without
3846 dnl a pkgconfig file
3847 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
3848 fi
3849 fi
3852dnl **********************************************************************
3853dnl libuv is only ever used for debug purposes
3854dnl **********************************************************************
3856OPT_LIBUV=no
3857AC_ARG_WITH(libuv,
3858AS_HELP_STRING([--with-libuv=PATH],[Enable libuv])
3859AS_HELP_STRING([--without-libuv],[Disable libuv]),
3860 [OPT_LIBUV=$withval])
3861case "$OPT_LIBUV" in
3862 no)
3863 dnl --without-libuv option used
3864 want_libuv="no"
3865 ;;
3866 yes)
3867 dnl --with-libuv option used without path
3868 want_libuv="default"
3869 want_libuv_path=""
3870 ;;
3871 *)
3872 dnl --with-libuv option used with path
3873 want_libuv="yes"
3874 want_libuv_path="$withval"
3875 ;;
3876esac
3878if test "$want_libuv" != "no"; then
3879 if test "$want_debug" != "yes"; then
3880 AC_MSG_ERROR([Using libuv without debug support enabled is useless])
3881 fi
3883 dnl backup the pre-libuv variables
3884 CLEANLDFLAGS="$LDFLAGS"
3885 CLEANLDFLAGSPC="$LDFLAGSPC"
3886 CLEANCPPFLAGS="$CPPFLAGS"
3887 CLEANLIBS="$LIBS"
3889 CURL_CHECK_PKGCONFIG(libuv, $want_libuv_path)
3891 if test "$PKGCONFIG" != "no"; then
3892 LIB_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path])
3893 $PKGCONFIG --libs-only-l libuv`
3894 AC_MSG_NOTICE([-l is $LIB_LIBUV])
3896 CPP_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path])
3897 $PKGCONFIG --cflags-only-I libuv`
3898 AC_MSG_NOTICE([-I is $CPP_LIBUV])
3900 LD_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path])
3901 $PKGCONFIG --libs-only-L libuv`
3902 AC_MSG_NOTICE([-L is $LD_LIBUV])
3904 LDFLAGS="$LDFLAGS $LD_LIBUV"
3905 LDFLAGSPC="$LDFLAGSPC $LD_LIBUV"
3906 CPPFLAGS="$CPPFLAGS $CPP_LIBUV"
3907 LIBS="$LIB_LIBUV $LIBS"
3909 if test "$cross_compiling" != "yes"; then
3910 DIR_LIBUV=`echo $LD_LIBUV | $SED -e 's/^-L//'`
3911 fi
3912 AC_CHECK_LIB(uv, uv_default_loop,
3914 AC_CHECK_HEADERS(uv.h,
3915 AC_DEFINE(USE_LIBUV, 1, [if libuv is in use])
3916 USE_LIBUV=1
3917 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LIBUV"
3918 export CURL_LIBRARY_PATH
3919 AC_MSG_NOTICE([Added $DIR_LIBUV to CURL_LIBRARY_PATH])
3920 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libuv"
3922 ],
3923 dnl not found, revert back to clean variables
3924 LDFLAGS=$CLEANLDFLAGS
3925 LDFLAGSPC=$CLEANLDFLAGSPC
3926 CPPFLAGS=$CLEANCPPFLAGS
3927 LIBS=$CLEANLIBS
3929 else
3930 dnl no libuv pkg-config found, deal with it
3931 if test "$want_libuv" != "default"; then
3932 dnl To avoid link errors, we do not allow --with-libuv without
3933 dnl a pkgconfig file
3934 AC_MSG_ERROR([--with-libuv was specified but could not find libuv pkg-config file.])
3935 fi
3936 fi
3940dnl **********************************************************************
3941dnl Check for zsh completion path
3942dnl **********************************************************************
3944OPT_ZSH_FPATH=default
3945AC_ARG_WITH(zsh-functions-dir,
3946AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
3947AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
3948 [OPT_ZSH_FPATH=$withval])
3949case "$OPT_ZSH_FPATH" in
3950 default|no)
3951 dnl --without-zsh-functions-dir option used
3952 ;;
3953 yes)
3954 dnl --with-zsh-functions-dir option used without path
3955 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
3956 AC_SUBST(ZSH_FUNCTIONS_DIR)
3957 ;;
3958 *)
3959 dnl --with-zsh-functions-dir option used with path
3960 ZSH_FUNCTIONS_DIR="$withval"
3961 AC_SUBST(ZSH_FUNCTIONS_DIR)
3962 ;;
3963esac
3964if test -z "$PERL" && test -n "$ZSH_FUNCTIONS_DIR"; then
3965 AC_MSG_WARN([perl was not found. Cannot install zsh completions.])
3966 ZSH_FUNCTIONS_DIR=''
3968AM_CONDITIONAL(USE_ZSH_COMPLETION, test -n "$ZSH_FUNCTIONS_DIR")
3970dnl **********************************************************************
3971dnl Check for fish completion path
3972dnl **********************************************************************
3974OPT_FISH_FPATH=default
3975AC_ARG_WITH(fish-functions-dir,
3976AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
3977AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
3978 [OPT_FISH_FPATH=$withval])
3979case "$OPT_FISH_FPATH" in
3980 default|no)
3981 dnl --without-fish-functions-dir option used
3982 ;;
3983 yes)
3984 dnl --with-fish-functions-dir option used without path
3985 CURL_CHECK_PKGCONFIG(fish)
3986 if test "$PKGCONFIG" != "no"; then
3987 FISH_FUNCTIONS_DIR=`$PKGCONFIG --variable completionsdir fish`
3988 else
3989 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
3990 fi
3991 AC_SUBST(FISH_FUNCTIONS_DIR)
3992 ;;
3993 *)
3994 dnl --with-fish-functions-dir option used with path
3995 FISH_FUNCTIONS_DIR="$withval"
3996 AC_SUBST(FISH_FUNCTIONS_DIR)
3997 ;;
3998esac
3999if test -z "$PERL" && test -n "$FISH_FUNCTIONS_DIR"; then
4000 AC_MSG_WARN([perl was not found. Cannot install fish completions.])
Diagnostics4 git calls · 35 ms
CallStatusSizeTime035 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=UPDATING
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit5 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=5
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=5
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch20036 KiB · hit27 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=25
git.response.bytes=36666
git.response.cache=HIT
git.response.duration_ms=27
git.fetch.wants=41c7544fa270180847b11a298943776074ed7c64
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=36666
git.pkt.payload.max=36645
git.sideband.band1.bytes=36644
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e2cd389b3a7929
Request
3c639bb9…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format