2005-12-20 17:02:36 +08:00
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
2023-01-02 20:51:48 +08:00
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2005-12-20 17:02:36 +08:00
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
2020-11-04 21:02:01 +08:00
# are also available at https://curl.se/docs/copyright.html.
2005-12-20 17:02:36 +08:00
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
2003-03-25 23:54:06 +08:00
# SPDX-License-Identifier: curl
2022-05-17 17:16:50 +08:00
#
2008-07-26 20:11:22 +08:00
#***************************************************************************
1999-12-29 22:20:26 +08:00
dnl Process this file with autoconf to produce a configure script.
2001-10-23 15:54:16 +08:00
2021-03-16 00:32:26 +08:00
AC_PREREQ(2.59)
2001-10-23 15:54:16 +08:00
2007-11-30 10:31:07 +08:00
dnl We don't know the version number "statically" so we use a dash here
2020-11-04 21:02:01 +08:00
AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/])
2003-03-25 23:54:06 +08:00
2011-12-16 01:01:00 +08:00
XC_OVR_ZZ50
2013-01-14 11:28:56 +08:00
XC_OVR_ZZ60
2008-11-16 10:23:18 +08:00
CURL_OVERRIDE_AUTOCONF
2003-03-25 23:54:06 +08:00
dnl configure script copyright
2023-01-02 20:51:48 +08:00
AC_COPYRIGHT([Copyright (C) Daniel Stenberg, <daniel@haxx.se>
2007-08-21 03:30:25 +08:00
This configure script may be copied, distributed and modified under the
2003-03-25 23:54:06 +08:00
terms of the curl license; see COPYING for more details])
2013-01-04 09:50:28 +08:00
AC_CONFIG_SRCDIR([lib/urldata.h])
2017-05-22 15:05:10 +08:00
AC_CONFIG_HEADERS(lib/curl_config.h)
2011-03-27 10:36:14 +08:00
AC_CONFIG_MACRO_DIR([m4])
2002-12-20 23:54:24 +08:00
AM_MAINTAINER_MODE
2015-10-07 20:56:07 +08:00
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
2000-10-23 21:56:12 +08:00
2008-10-02 11:56:55 +08:00
CURL_CHECK_OPTION_DEBUG
2008-10-07 21:13:34 +08:00
CURL_CHECK_OPTION_OPTIMIZE
2008-10-02 11:56:55 +08:00
CURL_CHECK_OPTION_WARNINGS
2010-07-20 00:07:09 +08:00
CURL_CHECK_OPTION_WERROR
2009-06-10 01:59:28 +08:00
CURL_CHECK_OPTION_CURLDEBUG
2012-04-12 01:33:54 +08:00
CURL_CHECK_OPTION_SYMBOL_HIDING
2010-01-26 23:07:40 +08:00
CURL_CHECK_OPTION_ARES
2015-07-23 17:38:49 +08:00
CURL_CHECK_OPTION_RT
2020-09-29 16:13:18 +08:00
CURL_CHECK_OPTION_ECH
2008-10-02 11:56:55 +08:00
2013-01-28 08:08:15 +08:00
XC_CHECK_PATH_SEPARATOR
2009-11-15 03:23:26 +08:00
#
# save the configure arguments
#
CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)
2008-07-04 12:03:55 +08:00
dnl SED is mandatory for configure process and libtool.
2008-07-28 06:25:07 +08:00
dnl Set it now, allowing it to be changed later.
2010-07-13 00:39:40 +08:00
if test -z "$SED"; then
dnl allow it to be overridden
AC_PATH_PROG([SED], [sed], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$SED" || test "$SED" = "not_found"; then
AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
fi
2008-07-03 01:42:08 +08:00
fi
2008-07-28 07:43:53 +08:00
AC_SUBST([SED])
2003-03-12 21:42:07 +08:00
2008-07-04 12:03:55 +08:00
dnl GREP is mandatory for configure process and libtool.
2008-07-28 06:25:07 +08:00
dnl Set it now, allowing it to be changed later.
2010-07-13 00:39:40 +08:00
if test -z "$GREP"; then
dnl allow it to be overridden
AC_PATH_PROG([GREP], [grep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$GREP" || test "$GREP" = "not_found"; then
AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
fi
2008-07-04 12:03:55 +08:00
fi
2008-07-28 07:43:53 +08:00
AC_SUBST([GREP])
2008-07-04 12:03:55 +08:00
2022-09-11 06:10:26 +08:00
dnl 'grep -E' is mandatory for configure process and libtool.
2008-07-28 06:25:07 +08:00
dnl Set it now, allowing it to be changed later.
2010-07-13 00:39:40 +08:00
if test -z "$EGREP"; then
dnl allow it to be overridden
2022-09-11 06:10:26 +08:00
AC_MSG_CHECKING([that grep -E works])
2010-07-13 00:39:40 +08:00
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
EGREP="$GREP -E"
2022-09-11 06:10:26 +08:00
AC_MSG_RESULT([yes])
2010-07-13 00:39:40 +08:00
else
2022-09-11 06:10:26 +08:00
AC_MSG_RESULT([no])
2010-07-13 00:39:40 +08:00
AC_PATH_PROG([EGREP], [egrep], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
fi
2004-05-05 17:17:53 +08:00
fi
2008-07-04 12:03:55 +08:00
if test -z "$EGREP" || test "$EGREP" = "not_found"; then
2022-09-11 21:08:08 +08:00
AC_MSG_ERROR([grep -E is not working and egrep is not found in PATH. Cannot continue.])
2008-07-04 12:03:55 +08:00
fi
2008-07-28 07:43:53 +08:00
AC_SUBST([EGREP])
2004-05-05 17:17:53 +08:00
2008-07-04 12:03:55 +08:00
dnl AR is mandatory for configure process and libtool.
2009-10-28 00:56:20 +08:00
dnl This is target dependent, so check it as a tool.
2010-07-13 00:39:40 +08:00
if test -z "$AR"; then
dnl allow it to be overridden
AC_PATH_TOOL([AR], [ar], [not_found],
[$PATH:/usr/bin:/usr/local/bin])
if test -z "$AR" || test "$AR" = "not_found"; then
AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
fi
2004-05-05 17:17:53 +08:00
fi
2008-07-28 07:43:53 +08:00
AC_SUBST([AR])
2008-07-04 12:03:55 +08:00
2007-10-26 06:30:35 +08:00
AC_SUBST(libext)
2003-07-30 23:10:26 +08:00
2001-10-23 15:54:16 +08:00
dnl figure out the libcurl version
2017-04-15 14:32:23 +08:00
CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
2013-01-21 03:23:20 +08:00
XC_CHECK_PROG_CC
2022-04-05 21:46:03 +08:00
CURL_ATOMIC
2017-11-30 01:18:19 +08:00
2019-01-25 17:14:25 +08:00
dnl for --enable-code-coverage
CURL_COVERAGE
2017-11-30 01:18:19 +08:00
2013-07-09 06:10:38 +08:00
XC_AUTOMAKE
2003-03-12 21:42:07 +08:00
AC_MSG_CHECKING([curl version])
2011-03-21 02:32:54 +08:00
AC_MSG_RESULT($CURLVERSION)
2000-07-25 15:29:32 +08:00
2011-04-06 18:09:27 +08:00
AC_SUBST(CURLVERSION)
2001-05-28 22:58:07 +08:00
dnl
dnl we extract the numerical version for curl-config only
2017-04-15 14:32:23 +08:00
VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
2001-05-28 22:58:07 +08:00
AC_SUBST(VERSIONNUM)
2001-05-30 12:31:32 +08:00
dnl Solaris pkgadd support definitions
PKGADD_PKG="HAXXcurl"
2016-10-18 19:59:54 +08:00
PKGADD_NAME="curl - a client that groks URLs"
2020-11-04 21:02:01 +08:00
PKGADD_VENDOR="curl.se"
2001-05-30 12:31:32 +08:00
AC_SUBST(PKGADD_PKG)
AC_SUBST(PKGADD_NAME)
AC_SUBST(PKGADD_VENDOR)
2004-04-26 20:29:30 +08:00
dnl
2004-11-12 00:34:24 +08:00
dnl initialize all the info variables
2023-07-30 05:44:28 +08:00
curl_ssl_msg="no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )"
2019-12-09 18:43:29 +08:00
curl_ssh_msg="no (--with-{libssh,libssh2})"
2004-11-12 00:34:24 +08:00
curl_zlib_msg="no (--with-zlib)"
2017-11-05 22:28:16 +08:00
curl_brotli_msg="no (--with-brotli)"
2020-07-27 18:07:40 +08:00
curl_zstd_msg="no (--with-zstd)"
2004-11-12 00:34:24 +08:00
curl_gss_msg="no (--with-gssapi)"
2020-12-25 02:48:45 +08:00
curl_gsasl_msg="no (--with-gsasl)"
2011-01-20 03:35:02 +08:00
curl_tls_srp_msg="no (--enable-tls-srp)"
2010-04-26 05:24:05 +08:00
curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
2004-11-12 00:34:24 +08:00
curl_ipv6_msg="no (--enable-ipv6)"
2014-11-28 06:59:25 +08:00
curl_unix_sockets_msg="no (--enable-unix-sockets)"
2016-10-12 15:01:06 +08:00
curl_idn_msg="no (--with-{libidn2,winidn})"
2004-11-12 00:34:24 +08:00
curl_manual_msg="no (--enable-manual)"
2012-02-06 01:44:22 +08:00
curl_libcurl_msg="enabled (--disable-libcurl-option)"
2004-11-12 00:34:24 +08:00
curl_verbose_msg="enabled (--disable-verbose)"
2005-03-14 07:59:28 +08:00
curl_sspi_msg="no (--enable-sspi)"
2007-08-12 04:57:54 +08:00
curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
2007-08-31 04:28:40 +08:00
curl_ldaps_msg="no (--enable-ldaps)"
2010-01-23 00:38:32 +08:00
curl_rtsp_msg="no (--enable-rtsp)"
2010-05-13 05:07:20 +08:00
curl_rtmp_msg="no (--with-librtmp)"
2015-09-29 17:33:01 +08:00
curl_psl_msg="no (--with-libpsl)"
2021-03-08 15:30:32 +08:00
curl_altsvc_msg="enabled (--disable-alt-svc)"
2022-05-30 20:13:48 +08:00
curl_headers_msg="enabled (--disable-headers-api)"
2021-03-08 15:30:32 +08:00
curl_hsts_msg="enabled (--disable-hsts)"
2022-09-09 21:11:13 +08:00
curl_ws_msg="no (--enable-websockets)"
vtls: allow selecting which SSL backend to use at runtime
When building software for the masses, it is sometimes not possible to
decide for all users which SSL backend is appropriate.
Git for Windows, for example, uses cURL to perform clones, fetches and
pushes via HTTPS, and some users strongly prefer OpenSSL, while other
users really need to use Secure Channel because it offers
enterprise-ready tools to manage credentials via Windows' Credential
Store.
The current Git for Windows versions use the ugly work-around of
building libcurl once with OpenSSL support and once with Secure Channel
support, and switching out the binaries in the installer depending on
the user's choice.
Needless to say, this is a super ugly workaround that actually only
works in some cases: Git for Windows also comes in a portable form, and
in a form intended for third-party applications requiring Git
functionality, in which cases this "swap out libcurl-4.dll" simply is
not an option.
Therefore, the Git for Windows project has a vested interest in teaching
cURL to make the SSL backend a *runtime* option.
This patch makes that possible.
By running ./configure with multiple --with-<backend> options, cURL will
be built with multiple backends.
For the moment, the backend can be configured using the environment
variable CURL_SSL_BACKEND (valid values are e.g. "openssl" and
"schannel").
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-06-14 22:56:00 +08:00
ssl_backends=
2021-02-12 09:14:28 +08:00
curl_h1_msg="enabled (internal)"
curl_h2_msg="no (--with-nghttp2, --with-hyper)"
2023-03-23 16:39:37 +08:00
curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-msh3)"
2020-10-26 06:08:54 +08:00
enable_altsvc="yes"
2021-09-05 05:41:07 +08:00
hsts="yes"
2020-10-26 06:08:54 +08:00
2007-02-17 09:29:01 +08:00
dnl
2012-12-04 05:40:26 +08:00
dnl Save some initial values the user might have provided
2007-02-17 09:29:01 +08:00
dnl
2012-12-04 05:40:26 +08:00
INITIAL_LDFLAGS=$LDFLAGS
INITIAL_LIBS=$LIBS
2007-02-17 09:29:01 +08:00
2023-05-16 22:51:14 +08:00
dnl
dnl Generates a shell script to run the compiler with LD_LIBRARY_PATH set to
dnl the value used right now. This lets CURL_RUN_IFELSE set LD_LIBRARY_PATH to
dnl something different but only have that affect the execution of the results
dnl of the compile, not change the libraries for the compiler itself.
dnl
compilersh="run-compiler"
2023-05-31 05:56:58 +08:00
CURL_SAVED_CC="$CC"
export CURL_SAVED_CC
CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
export CURL_SAVED_LD_LIBRARY_PATH
2023-05-23 17:59:59 +08:00
cat <<\EOF > "$compilersh"
2023-05-31 05:56:58 +08:00
CC="$CURL_SAVED_CC"
export CC
LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
2023-05-23 17:59:59 +08:00
exec $CC "$@"
EOF
2023-05-16 22:51:14 +08:00
2021-04-15 15:04:30 +08:00
dnl **********************************************************************
dnl See which TLS backend(s) that are requested. Just do all the
dnl TLS AC_ARG_WITH() invokes here and do the checks later
dnl **********************************************************************
OPT_SCHANNEL=no
AC_ARG_WITH(schannel,dnl
AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]),
OPT_SCHANNEL=$withval
TLSCHOICE="schannel")
OPT_SECURETRANSPORT=no
AC_ARG_WITH(secure-transport,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]),[
2021-04-15 15:04:30 +08:00
OPT_SECURETRANSPORT=$withval
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }Secure-Transport"
])
2021-04-15 15:04:30 +08:00
OPT_AMISSL=no
AC_ARG_WITH(amissl,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[
2021-04-15 15:04:30 +08:00
OPT_AMISSL=$withval
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL"
])
2021-04-15 15:04:30 +08:00
OPT_OPENSSL=no
dnl Default to no CA bundle
ca="no"
AC_ARG_WITH(ssl,dnl
AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl])
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--without-ssl], [build without any TLS library]),[
2021-04-15 15:04:30 +08:00
OPT_SSL=$withval
OPT_OPENSSL=$withval
2021-11-12 08:24:57 +08:00
if test X"$withval" != Xno; then
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
2022-08-25 23:29:48 +08:00
else
SSL_DISABLED="D"
2021-11-12 08:24:57 +08:00
fi
2022-08-20 01:58:40 +08:00
])
2021-04-15 15:04:30 +08:00
AC_ARG_WITH(openssl,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-openssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]),[
2021-04-15 15:04:30 +08:00
OPT_OPENSSL=$withval
2021-11-12 08:24:57 +08:00
if test X"$withval" != Xno; then
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL"
2021-11-12 08:24:57 +08:00
fi
2022-08-20 01:58:40 +08:00
])
2021-04-15 15:04:30 +08:00
OPT_GNUTLS=no
AC_ARG_WITH(gnutls,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[
2021-04-15 15:04:30 +08:00
OPT_GNUTLS=$withval
2021-11-12 08:24:57 +08:00
if test X"$withval" != Xno; then
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS"
2021-11-12 08:24:57 +08:00
fi
2022-08-20 01:58:40 +08:00
])
2021-04-15 15:04:30 +08:00
OPT_MBEDTLS=no
AC_ARG_WITH(mbedtls,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[
2021-04-15 15:04:30 +08:00
OPT_MBEDTLS=$withval
2021-11-12 08:24:57 +08:00
if test X"$withval" != Xno; then
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS"
2021-11-12 08:24:57 +08:00
fi
2022-08-20 01:58:40 +08:00
])
2021-04-15 15:04:30 +08:00
OPT_WOLFSSL=no
AC_ARG_WITH(wolfssl,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]),[
2021-04-15 15:04:30 +08:00
OPT_WOLFSSL=$withval
2021-11-12 08:24:57 +08:00
if test X"$withval" != Xno; then
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL"
2021-11-12 08:24:57 +08:00
fi
2022-08-20 01:58:40 +08:00
])
2021-04-15 15:04:30 +08:00
OPT_BEARSSL=no
AC_ARG_WITH(bearssl,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root]),[
2021-04-15 15:04:30 +08:00
OPT_BEARSSL=$withval
2021-11-12 08:24:57 +08:00
if test X"$withval" != Xno; then
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }BearSSL"
2021-11-12 08:24:57 +08:00
fi
2022-08-20 01:58:40 +08:00
])
2021-04-15 15:04:30 +08:00
OPT_RUSTLS=no
AC_ARG_WITH(rustls,dnl
2022-08-20 01:58:40 +08:00
AS_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root]),[
2021-04-15 15:04:30 +08:00
OPT_RUSTLS=$withval
2021-11-12 08:24:57 +08:00
if test X"$withval" != Xno; then
2022-08-20 01:58:40 +08:00
TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls"
2022-06-16 05:33:00 +08:00
experimental="$experimental rustls"
2021-11-12 08:24:57 +08:00
fi
2022-08-20 01:58:40 +08:00
])
2021-04-15 15:04:30 +08:00
2022-11-29 23:41:15 +08:00
TEST_NGHTTPX=nghttpx
AC_ARG_WITH(test-nghttpx,dnl
AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]),
TEST_NGHTTPX=$withval
if test X"$OPT_TEST_NGHTTPX" = "Xno" ; then
TEST_NGHTTPX=""
fi
)
AC_SUBST(TEST_NGHTTPX)
connections: introduce http/3 happy eyeballs
New cfilter HTTP-CONNECT for h3/h2/http1.1 eyeballing.
- filter is installed when `--http3` in the tool is used (or
the equivalent CURLOPT_ done in the library)
- starts a QUIC/HTTP/3 connect right away. Should that not
succeed after 100ms (subject to change), a parallel attempt
is started for HTTP/2 and HTTP/1.1 via TCP
- both attempts are subject to IPv6/IPv4 eyeballing, same
as happens for other connections
- tie timeout to the ip-version HAPPY_EYEBALLS_TIMEOUT
- use a `soft` timeout at half the value. When the soft timeout
expires, the HTTPS-CONNECT filter checks if the QUIC filter
has received any data from the server. If not, it will start
the HTTP/2 attempt.
HTTP/3(ngtcp2) improvements.
- setting call_data in all cfilter calls similar to http/2 and vtls filters
for use in callback where no stream data is available.
- returning CURLE_PARTIAL_FILE for prematurely terminated transfers
- enabling pytest test_05 for h3
- shifting functionality to "connect" UDP sockets from ngtcp2
implementation into the udp socket cfilter. Because unconnected
UDP sockets are weird. For example they error when adding to a
pollset.
HTTP/3(quiche) improvements.
- fixed upload bug in quiche implementation, now passes 251 and pytest
- error codes on stream RESET
- improved debug logs
- handling of DRAIN during connect
- limiting pending event queue
HTTP/2 cfilter improvements.
- use LOG_CF macros for dynamic logging in debug build
- fix CURLcode on RST streams to be CURLE_PARTIAL_FILE
- enable pytest test_05 for h2
- fix upload pytests and improve parallel transfer performance.
GOAWAY handling for ngtcp2/quiche
- during connect, when the remote server refuses to accept new connections
and closes immediately (so the local conn goes into DRAIN phase), the
connection is torn down and a another attempt is made after a short grace
period.
This is the behaviour observed with nghttpx when we tell it to shut
down gracefully. Tested in pytest test_03_02.
TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
and connection related things based on the negotiated protocol (or lack thereof).
- new tests/tests-httpd/scorecard.py for testing h3/h2 protocol implementation.
Invoke:
python3 tests/tests-httpd/scorecard.py --help
for usage.
Improvements on gathering connect statistics and socket access.
- new CF_CTRL_CONN_REPORT_STATS cfilter control for having cfilters
report connection statistics. This is triggered when the connection
has completely connected.
- new void Curl_pgrsTimeWas(..) method to report a timer update with
a timestamp of when it happend. This allows for updating timers
"later", e.g. a connect statistic after full connectivity has been
reached.
- in case of HTTP eyeballing, the previous changes will update
statistics only from the filter chain that "won" the eyeballing.
- new cfilter query CF_QUERY_SOCKET for retrieving the socket used
by a filter chain.
Added methods Curl_conn_cf_get_socket() and Curl_conn_get_socket()
for convenient use of this query.
- Change VTLS backend to query their sub-filters for the socket when
checks during the handshake are made.
HTTP/3 documentation on how https eyeballing works.
TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
and connection related things based on the negotiated protocol (or lack thereof).
Scorecard with Caddy.
- configure can be run with `--with-test-caddy=path` to specify which caddy to use for testing
- tests/tests-httpd/scorecard.py now measures download speeds with caddy
pytest improvements
- adding Makfile to clean gen dir
- adding nghttpx rundir creation on start
- checking httpd version 2.4.55 for test_05 cases where it is needed. Skipping with message if too old.
- catch exception when checking for caddy existance on system.
Closes #10349
2023-02-02 00:13:12 +08:00
CADDY=caddy
AC_ARG_WITH(test-caddy,dnl
AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]),
CADDY=$withval
if test X"$OPT_CADDY" = "Xno" ; then
CADDY=""
fi
)
AC_SUBST(CADDY)
2023-01-09 23:58:10 +08:00
dnl we'd like a httpd+apachectl as test server
dnl
2023-04-03 17:58:21 +08:00
HTTPD_ENABLED="maybe"
2023-01-09 23:58:10 +08:00
AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH],
[where to find httpd/apache2 for testing])],
[request_httpd=$withval], [request_httpd=check])
2023-04-03 17:58:21 +08:00
if test x"$request_httpd" = "xcheck" -o x"$request_httpd" = "xyes"; then
2023-01-09 23:58:10 +08:00
if test -x "/usr/sbin/apache2" -a -x "/usr/sbin/apache2ctl"; then
# common location on distros (debian/ubuntu)
HTTPD="/usr/sbin/apache2"
APACHECTL="/usr/sbin/apache2ctl"
AC_PATH_PROG([APXS], [apxs])
2023-04-28 16:01:01 +08:00
if test "x$APXS" = "x"; then
2023-01-09 23:58:10 +08:00
AC_MSG_NOTICE([apache2-dev not installed, httpd tests disabled])
2023-04-03 17:58:21 +08:00
HTTPD_ENABLED="no"
2023-01-09 23:58:10 +08:00
fi
else
AC_PATH_PROG([HTTPD], [httpd])
if test "x$HTTPD" = "x"; then
AC_PATH_PROG([HTTPD], [apache2])
fi
AC_PATH_PROG([APACHECTL], [apachectl])
AC_PATH_PROG([APXS], [apxs])
if test "x$HTTPD" = "x" -o "x$APACHECTL" = "x"; then
2023-04-03 17:58:21 +08:00
AC_MSG_NOTICE([httpd/apache2 not in PATH, http tests disabled])
HTTPD_ENABLED="no"
2023-01-09 23:58:10 +08:00
fi
if test "x$APXS" = "x"; then
2023-04-03 17:58:21 +08:00
AC_MSG_NOTICE([apxs not in PATH, http tests disabled])
HTTPD_ENABLED="no"
2023-01-09 23:58:10 +08:00
fi
fi
2023-04-03 17:58:21 +08:00
elif test x"$request_httpd" != "xno"; then
2023-01-09 23:58:10 +08:00
HTTPD="${request_httpd}/bin/httpd"
APACHECTL="${request_httpd}/bin/apachectl"
APXS="${request_httpd}/bin/apxs"
if test ! -x "${HTTPD}"; then
2023-04-03 17:58:21 +08:00
AC_MSG_NOTICE([httpd not found as ${HTTPD}, http tests disabled])
HTTPD_ENABLED="no"
2023-01-09 23:58:10 +08:00
elif test ! -x "${APACHECTL}"; then
2023-04-03 17:58:21 +08:00
AC_MSG_NOTICE([apachectl not found as ${APACHECTL}, http tests disabled])
HTTPD_ENABLED="no"
2023-01-09 23:58:10 +08:00
elif test ! -x "${APXS}"; then
2023-04-03 17:58:21 +08:00
AC_MSG_NOTICE([apxs not found as ${APXS}, http tests disabled])
HTTPD_ENABLED="no"
2023-01-09 23:58:10 +08:00
else
AC_MSG_NOTICE([using HTTPD=$HTTPD for tests])
fi
fi
2023-04-03 17:58:21 +08:00
if test x"$HTTPD_ENABLED" = "xno"; then
HTTPD=""
APACHECTL=""
APXS=""
fi
2023-01-09 23:58:10 +08:00
AC_SUBST(HTTPD)
AC_SUBST(APACHECTL)
AC_SUBST(APXS)
dnl the nghttpx we might use in httpd testing
2023-03-09 17:50:55 +08:00
if test "x$TEST_NGHTTPX" != "x" -a "x$TEST_NGHTTPX" != "xnghttpx"; then
2023-01-09 23:58:10 +08:00
HTTPD_NGHTTPX="$TEST_NGHTTPX"
else
2023-03-09 17:50:55 +08:00
AC_PATH_PROG([HTTPD_NGHTTPX], [nghttpx], [],
[$PATH:/usr/bin:/usr/local/bin])
2023-01-09 23:58:10 +08:00
fi
AC_SUBST(HTTPD_NGHTTPX)
connections: introduce http/3 happy eyeballs
New cfilter HTTP-CONNECT for h3/h2/http1.1 eyeballing.
- filter is installed when `--http3` in the tool is used (or
the equivalent CURLOPT_ done in the library)
- starts a QUIC/HTTP/3 connect right away. Should that not
succeed after 100ms (subject to change), a parallel attempt
is started for HTTP/2 and HTTP/1.1 via TCP
- both attempts are subject to IPv6/IPv4 eyeballing, same
as happens for other connections
- tie timeout to the ip-version HAPPY_EYEBALLS_TIMEOUT
- use a `soft` timeout at half the value. When the soft timeout
expires, the HTTPS-CONNECT filter checks if the QUIC filter
has received any data from the server. If not, it will start
the HTTP/2 attempt.
HTTP/3(ngtcp2) improvements.
- setting call_data in all cfilter calls similar to http/2 and vtls filters
for use in callback where no stream data is available.
- returning CURLE_PARTIAL_FILE for prematurely terminated transfers
- enabling pytest test_05 for h3
- shifting functionality to "connect" UDP sockets from ngtcp2
implementation into the udp socket cfilter. Because unconnected
UDP sockets are weird. For example they error when adding to a
pollset.
HTTP/3(quiche) improvements.
- fixed upload bug in quiche implementation, now passes 251 and pytest
- error codes on stream RESET
- improved debug logs
- handling of DRAIN during connect
- limiting pending event queue
HTTP/2 cfilter improvements.
- use LOG_CF macros for dynamic logging in debug build
- fix CURLcode on RST streams to be CURLE_PARTIAL_FILE
- enable pytest test_05 for h2
- fix upload pytests and improve parallel transfer performance.
GOAWAY handling for ngtcp2/quiche
- during connect, when the remote server refuses to accept new connections
and closes immediately (so the local conn goes into DRAIN phase), the
connection is torn down and a another attempt is made after a short grace
period.
This is the behaviour observed with nghttpx when we tell it to shut
down gracefully. Tested in pytest test_03_02.
TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
and connection related things based on the negotiated protocol (or lack thereof).
- new tests/tests-httpd/scorecard.py for testing h3/h2 protocol implementation.
Invoke:
python3 tests/tests-httpd/scorecard.py --help
for usage.
Improvements on gathering connect statistics and socket access.
- new CF_CTRL_CONN_REPORT_STATS cfilter control for having cfilters
report connection statistics. This is triggered when the connection
has completely connected.
- new void Curl_pgrsTimeWas(..) method to report a timer update with
a timestamp of when it happend. This allows for updating timers
"later", e.g. a connect statistic after full connectivity has been
reached.
- in case of HTTP eyeballing, the previous changes will update
statistics only from the filter chain that "won" the eyeballing.
- new cfilter query CF_QUERY_SOCKET for retrieving the socket used
by a filter chain.
Added methods Curl_conn_cf_get_socket() and Curl_conn_get_socket()
for convenient use of this query.
- Change VTLS backend to query their sub-filters for the socket when
checks during the handshake are made.
HTTP/3 documentation on how https eyeballing works.
TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
and connection related things based on the negotiated protocol (or lack thereof).
Scorecard with Caddy.
- configure can be run with `--with-test-caddy=path` to specify which caddy to use for testing
- tests/tests-httpd/scorecard.py now measures download speeds with caddy
pytest improvements
- adding Makfile to clean gen dir
- adding nghttpx rundir creation on start
- checking httpd version 2.4.55 for test_05 cases where it is needed. Skipping with message if too old.
- catch exception when checking for caddy existance on system.
Closes #10349
2023-02-02 00:13:12 +08:00
dnl the Caddy server we might use in testing
if test "x$TEST_CADDY" != "x"; then
CADDY="$TEST_CADDY"
else
AC_PATH_PROG([CADDY], [caddy])
fi
AC_SUBST(CADDY)
2021-04-15 15:04:30 +08:00
dnl If no TLS choice has been made, check if it was explicitly disabled or
dnl error out to force the user to decide.
if test -z "$TLSCHOICE"; then
if test "x$OPT_SSL" != "xno"; then
2021-04-23 15:21:02 +08:00
AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl.
2021-04-15 15:04:30 +08:00
Select from these:
--with-amissl
--with-bearssl
--with-gnutls
--with-mbedtls
--with-openssl (also works for BoringSSL and libressl)
--with-rustls
--with-schannel
--with-secure-transport
--with-wolfssl
])
fi
fi
2021-06-06 18:12:01 +08:00
AC_ARG_WITH(darwinssl,,
2023-06-23 06:15:46 +08:00
AC_MSG_ERROR([--with-darwin-ssl and --without-darwin-ssl no longer work!]))
2021-06-06 18:12:01 +08:00
2000-07-25 15:29:32 +08:00
dnl
dnl Detect the canonical host and target build environment
dnl
1999-12-29 22:20:26 +08:00
2001-05-23 05:17:58 +08:00
AC_CANONICAL_HOST
2001-05-23 02:16:24 +08:00
dnl Get system canonical name
2002-10-29 04:39:23 +08:00
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
2000-08-24 20:33:16 +08:00
2018-05-29 16:26:06 +08:00
# Silence warning: ar: 'u' modifier ignored since 'D' is the default
AC_SUBST(AR_FLAGS, [cr])
2001-05-23 02:16:24 +08:00
2008-08-04 14:48:11 +08:00
dnl This defines _ALL_SOURCE for AIX
CURL_CHECK_AIX_ALL_SOURCE
2008-07-23 03:04:16 +08:00
dnl Our configure and build reentrant settings
2009-11-15 02:51:37 +08:00
CURL_CONFIGURE_THREAD_SAFE
2008-07-27 09:36:33 +08:00
CURL_CONFIGURE_REENTRANT
2008-07-23 03:04:16 +08:00
2000-08-24 21:05:24 +08:00
dnl check for how to do large files
2000-08-24 20:33:16 +08:00
AC_SYS_LARGEFILE
2000-08-24 21:05:24 +08:00
2013-03-08 20:26:08 +08:00
XC_LIBTOOL
2013-01-09 02:02:08 +08:00
2022-09-24 03:39:18 +08:00
LT_LANG([Windows Resource])
2013-03-08 20:26:08 +08:00
#
# Automake conditionals based on libtool related checks
#
2009-11-25 00:12:22 +08:00
2013-03-08 20:26:08 +08:00
AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
[test "x$xc_lt_shlib_use_version_info" = 'xyes'])
AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
[test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
[test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
2001-05-23 02:16:24 +08:00
2013-03-12 07:24:37 +08:00
#
# Due to libtool and automake machinery limitations of not allowing
# specifying separate CPPFLAGS or CFLAGS when compiling objects for
# inclusion of these in shared or static libraries, we are forced to
# build using separate configure runs for shared and static libraries
# on systems where different CPPFLAGS or CFLAGS are mandatory in order
# to compile objects for each kind of library. Notice that relying on
# the '-DPIC' CFLAG that libtool provides is not valid given that the
# user might for example choose to build static libraries with PIC.
#
#
# Make our Makefile.am files use the staticlib CPPFLAG only when strictly
# targeting a static library and not building its shared counterpart.
#
AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
[test "x$xc_lt_build_static_only" = 'xyes'])
#
# Make staticlib CPPFLAG variable and its definition visible in output
# files unconditionally, providing an empty definition unless strictly
# targeting a static library and not building its shared counterpart.
#
CPPFLAG_CURL_STATICLIB=
if test "x$xc_lt_build_static_only" = 'xyes'; then
CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
fi
AC_SUBST([CPPFLAG_CURL_STATICLIB])
2010-07-13 05:40:16 +08:00
2005-02-18 16:24:53 +08:00
2007-02-14 11:00:08 +08:00
# Determine whether all dependent libraries must be specified when linking
if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
then
REQUIRE_LIB_DEPS=no
else
REQUIRE_LIB_DEPS=yes
fi
AC_SUBST(REQUIRE_LIB_DEPS)
2012-11-30 21:34:48 +08:00
AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
2007-02-14 11:00:08 +08:00
2007-06-13 05:39:21 +08:00
dnl check if there's a way to force code inline
AC_C_INLINE
2007-10-19 00:24:14 +08:00
dnl **********************************************************************
dnl platform/compiler/architecture specific checks/flags
dnl **********************************************************************
2008-10-02 11:56:55 +08:00
CURL_CHECK_COMPILER
2008-10-07 21:13:34 +08:00
CURL_SET_COMPILER_BASIC_OPTS
CURL_SET_COMPILER_DEBUG_OPTS
CURL_SET_COMPILER_OPTIMIZE_OPTS
CURL_SET_COMPILER_WARNING_OPTS
2008-09-30 03:14:52 +08:00
2009-11-25 00:12:22 +08:00
if test "$compiler_id" = "INTEL_UNIX_C"; then
2008-10-22 19:10:56 +08:00
#
2009-11-25 00:12:22 +08:00
if test "$compiler_num" -ge "1000"; then
dnl icc 10.X or later
CFLAGS="$CFLAGS -shared-intel"
elif test "$compiler_num" -ge "900"; then
dnl icc 9.X specific
CFLAGS="$CFLAGS -i-dynamic"
fi
2008-10-22 19:10:56 +08:00
#
2009-11-25 00:12:22 +08:00
fi
2008-09-30 03:14:52 +08:00
2020-03-10 20:55:44 +08:00
CURL_CFLAG_EXTRAS=""
if test X"$want_werror" = Xyes; then
CURL_CFLAG_EXTRAS="-Werror"
if test "$compiler_id" = "GNU_C"; then
dnl enable -pedantic-errors for GCC 5 and later,
dnl as before that it was the same as -Werror=pedantic
if test "$compiler_num" -ge "500"; then
CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
fi
fi
fi
AC_SUBST(CURL_CFLAG_EXTRAS)
2008-06-21 02:09:48 +08:00
CURL_CHECK_COMPILER_HALT_ON_ERROR
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
2012-12-17 01:51:51 +08:00
CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
2012-04-12 01:33:54 +08:00
CURL_CHECK_COMPILER_SYMBOL_HIDING
2008-06-21 02:09:48 +08:00
2009-06-10 01:59:28 +08:00
CURL_CHECK_CURLDEBUG
AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
2011-06-04 02:06:42 +08:00
supports_unittests=yes
# cross-compilation of unit tests static library/programs fails when
# libcurl shared library is built. This might be due to a libtool or
# automake issue. In this case we disable unit tests.
if test "x$cross_compiling" != "xno" &&
test "x$enable_shared" != "xno"; then
supports_unittests=no
fi
2011-08-16 00:27:59 +08:00
# IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
# a problem related with OpenSSL headers and library versions not matching.
# Disable unit tests while time to further investigate this is found.
case $host in
mips-sgi-irix6.5)
if test "$compiler_id" = "GNU_C"; then
supports_unittests=no
fi
;;
esac
# All AIX autobuilds fails unit tests linking against unittests library
# due to unittests library being built with no symbols or members. Libtool ?
# Disable unit tests while time to further investigate this is found.
case $host_os in
aix*)
supports_unittests=no
;;
esac
2011-06-02 23:02:46 +08:00
dnl Build unit tests when option --enable-debug is given.
2011-06-04 02:06:42 +08:00
if test "x$want_debug" = "xyes" &&
test "x$supports_unittests" = "xyes"; then
want_unittests=yes
else
want_unittests=no
fi
AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
2011-06-02 03:39:18 +08:00
2008-06-21 02:09:48 +08:00
dnl **********************************************************************
dnl Compilation based checks should not be done before this point.
dnl **********************************************************************
dnl **********************************************************************
2021-09-29 20:53:04 +08:00
dnl Make sure that our checks for headers windows.h winsock2.h
2008-06-21 02:09:48 +08:00
dnl and ws2tcpip.h take precedence over any other further checks which
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
dnl this specific header files. And do them before its results are used.
dnl **********************************************************************
CURL_CHECK_HEADER_WINDOWS
CURL_CHECK_NATIVE_WINDOWS
2016-04-15 22:37:20 +08:00
case X-"$curl_cv_native_windows" in
2008-06-21 02:09:48 +08:00
X-yes)
CURL_CHECK_HEADER_WINSOCK2
CURL_CHECK_HEADER_WS2TCPIP
;;
*)
2016-04-15 22:37:20 +08:00
curl_cv_header_winsock2_h="no"
curl_cv_header_ws2tcpip_h="no"
2008-06-21 02:09:48 +08:00
;;
esac
2008-08-26 20:54:12 +08:00
CURL_CHECK_WIN32_LARGEFILE
2021-03-06 22:52:09 +08:00
CURL_CHECK_WIN32_CRYPTO
2008-06-21 02:09:48 +08:00
2021-04-09 22:08:32 +08:00
CURL_DARWIN_CFLAGS
2021-05-24 22:38:40 +08:00
CURL_DARWIN_SYSTEMCONFIGURATION
2017-08-17 01:24:39 +08:00
CURL_SUPPORTS_BUILTIN_AVAILABLE
2016-10-19 20:36:32 +08:00
2022-11-02 06:45:28 +08:00
AM_CONDITIONAL([HAVE_WINDRES],
[test "$curl_cv_native_windows" = "yes" && test -n "${RC}"])
if test "$curl_cv_native_windows" = "yes"; then
AM_COND_IF([HAVE_WINDRES],,
[AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])])
fi
2019-03-08 08:06:59 +08:00
2002-06-11 19:13:29 +08:00
dnl ************************************************************
dnl switch off particular protocols
dnl
AC_MSG_CHECKING([whether to support http])
AC_ARG_ENABLE(http,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-http],[Enable HTTP support])
AS_HELP_STRING([--disable-http],[Disable HTTP support]),
2002-06-11 19:13:29 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2002-10-29 04:39:23 +08:00
AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
2017-06-16 06:02:36 +08:00
disable_http="yes"
2010-01-23 00:38:32 +08:00
AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
2004-12-23 16:48:59 +08:00
AC_SUBST(CURL_DISABLE_HTTP, [1])
2010-01-23 00:38:32 +08:00
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
2020-10-26 06:08:54 +08:00
dnl toggle off alt-svc too when HTTP is disabled
AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
2021-03-08 15:30:32 +08:00
AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
2020-12-14 21:10:32 +08:00
curl_h1_msg="no (--enable-http, --with-hyper)"
2020-10-26 06:08:54 +08:00
curl_altsvc_msg="no";
2021-03-08 15:30:32 +08:00
curl_hsts_msg="no (--enable-hsts)";
2020-10-26 06:08:54 +08:00
enable_altsvc="no"
2021-09-05 05:41:07 +08:00
hsts="no"
2002-06-11 19:13:29 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support ftp])
AC_ARG_ENABLE(ftp,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-ftp],[Enable FTP support])
AS_HELP_STRING([--disable-ftp],[Disable FTP support]),
2002-06-11 19:13:29 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2002-10-29 04:39:23 +08:00
AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
2004-12-23 16:48:59 +08:00
AC_SUBST(CURL_DISABLE_FTP, [1])
2002-06-11 19:13:29 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support file])
AC_ARG_ENABLE(file,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-file],[Enable FILE support])
AS_HELP_STRING([--disable-file],[Disable FILE support]),
2002-06-11 19:13:29 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2002-10-29 04:39:23 +08:00
AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
2004-12-23 16:48:59 +08:00
AC_SUBST(CURL_DISABLE_FILE, [1])
2002-06-11 19:13:29 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support ldap])
AC_ARG_ENABLE(ldap,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-ldap],[Enable LDAP support])
AS_HELP_STRING([--disable-ldap],[Disable LDAP support]),
2002-06-11 19:13:29 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2002-10-29 04:39:23 +08:00
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
2004-12-23 16:48:59 +08:00
AC_SUBST(CURL_DISABLE_LDAP, [1])
2002-06-11 19:13:29 +08:00
;;
2021-05-12 17:15:51 +08:00
yes)
ldap_askedfor="yes"
AC_MSG_RESULT(yes)
;;
2008-01-22 04:22:33 +08:00
*)
2010-06-04 21:14:31 +08:00
AC_MSG_RESULT(yes)
2002-06-11 19:13:29 +08:00
;;
2008-01-22 04:22:33 +08:00
esac ],[
2010-06-04 21:14:31 +08:00
AC_MSG_RESULT(yes) ]
2002-06-11 19:13:29 +08:00
)
2007-08-31 04:28:40 +08:00
AC_MSG_CHECKING([whether to support ldaps])
AC_ARG_ENABLE(ldaps,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
2007-08-31 04:28:40 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
;;
2010-06-02 03:26:19 +08:00
*) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
2007-08-31 04:28:40 +08:00
else
2010-06-02 03:26:19 +08:00
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
AC_SUBST(HAVE_LDAP_SSL, [1])
2007-08-31 04:28:40 +08:00
fi
;;
2010-06-02 03:26:19 +08:00
esac ],[
if test "x$CURL_DISABLE_LDAP" = "x1" ; then
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
else
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
AC_SUBST(HAVE_LDAP_SSL, [1])
fi ]
2007-08-31 04:28:40 +08:00
)
2021-06-09 17:43:41 +08:00
dnl **********************************************************************
dnl Check for Hyper
dnl **********************************************************************
OPT_HYPER="no"
AC_ARG_WITH(hyper,
AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
[OPT_HYPER=$withval])
case "$OPT_HYPER" in
2010-01-21 21:58:30 +08:00
no)
2021-06-09 17:43:41 +08:00
dnl --without-hyper option used
want_hyper="no"
;;
yes)
dnl --with-hyper option used without path
want_hyper="default"
want_hyper_path=""
;;
*)
dnl --with-hyper option used with path
want_hyper="yes"
want_hyper_path="$withval"
;;
esac
if test X"$want_hyper" != Xno; then
if test "x$disable_http" = "xyes"; then
AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
fi
dnl backup the pre-hyper variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
if test "$PKGCONFIG" != "no" ; then
LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
$PKGCONFIG --libs-only-l hyper`
CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
$PKGCONFIG --cflags-only-I hyper`
LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
$PKGCONFIG --libs-only-L hyper`
else
dnl no hyper pkg-config found
LIB_HYPER="-lhyper -ldl -lpthread -lm"
if test X"$want_hyper" != Xdefault; then
CPP_HYPER=-I"$want_hyper_path/capi/include"
2021-11-03 13:14:02 +08:00
LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
2021-06-09 17:43:41 +08:00
fi
fi
if test -n "$LIB_HYPER"; then
AC_MSG_NOTICE([-l is $LIB_HYPER])
AC_MSG_NOTICE([-I is $CPP_HYPER])
AC_MSG_NOTICE([-L is $LD_HYPER])
LDFLAGS="$LDFLAGS $LD_HYPER"
CPPFLAGS="$CPPFLAGS $CPP_HYPER"
LIBS="$LIB_HYPER $LIBS"
if test "x$cross_compiling" != "xyes"; then
2021-11-13 18:44:34 +08:00
dnl remove -L, separate with colon if more than one
DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
2021-06-09 17:43:41 +08:00
fi
AC_CHECK_LIB(hyper, hyper_io_new,
[
AC_CHECK_HEADERS(hyper.h,
experimental="$experimental Hyper"
AC_MSG_NOTICE([Hyper support is experimental])
curl_h1_msg="enabled (Hyper)"
curl_h2_msg=$curl_h1_msg
HYPER_ENABLED=1
AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
AC_SUBST(USE_HYPER, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]),
)
],
2022-05-21 21:34:24 +08:00
for d in `echo $DIR_HYPER | $SED -e 's/:/ /'`; do
2021-11-13 18:44:34 +08:00
if test -f "$d/libhyper.a"; then
AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
fi
done
2021-06-09 17:43:41 +08:00
AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
)
fi
fi
if test X"$want_hyper" != Xno; then
AC_MSG_NOTICE([Disable RTSP support with hyper])
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
else
AC_MSG_CHECKING([whether to support rtsp])
AC_ARG_ENABLE(rtsp,
2023-05-19 03:16:56 +08:00
AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
2021-06-09 17:43:41 +08:00
[ case "$enableval" in
no)
2010-01-21 21:58:30 +08:00
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
AC_SUBST(CURL_DISABLE_RTSP, [1])
;;
2021-06-09 17:43:41 +08:00
*)
if test x$CURL_DISABLE_HTTP = x1 ; then
AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
2010-01-22 20:52:35 +08:00
else
2021-06-09 17:43:41 +08:00
AC_MSG_RESULT(yes)
curl_rtsp_msg="enabled"
2010-01-22 20:52:35 +08:00
fi
2010-01-21 21:58:30 +08:00
;;
2021-06-09 17:43:41 +08:00
esac ],
2010-01-23 00:38:32 +08:00
if test "x$CURL_DISABLE_HTTP" != "x1"; then
AC_MSG_RESULT(yes)
curl_rtsp_msg="enabled"
else
AC_MSG_RESULT(no)
fi
2021-06-09 17:43:41 +08:00
)
fi
2010-01-21 21:58:30 +08:00
2008-09-30 05:49:10 +08:00
AC_MSG_CHECKING([whether to support proxies])
2008-09-30 05:46:04 +08:00
AC_ARG_ENABLE(proxy,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-proxy],[Enable proxy support])
AS_HELP_STRING([--disable-proxy],[Disable proxy support]),
2008-09-30 05:46:04 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
AC_SUBST(CURL_DISABLE_PROXY, [1])
2020-09-30 21:31:01 +08:00
https_proxy="no"
2008-09-30 05:46:04 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2002-06-11 19:13:29 +08:00
AC_MSG_CHECKING([whether to support dict])
AC_ARG_ENABLE(dict,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-dict],[Enable DICT support])
AS_HELP_STRING([--disable-dict],[Disable DICT support]),
2002-06-11 19:13:29 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2003-01-20 23:16:56 +08:00
AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
2004-12-23 16:48:59 +08:00
AC_SUBST(CURL_DISABLE_DICT, [1])
2002-06-11 19:13:29 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support telnet])
AC_ARG_ENABLE(telnet,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-telnet],[Enable TELNET support])
AS_HELP_STRING([--disable-telnet],[Disable TELNET support]),
2002-06-11 19:13:29 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2002-10-29 04:39:23 +08:00
AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
2004-12-23 16:48:59 +08:00
AC_SUBST(CURL_DISABLE_TELNET, [1])
2002-06-11 19:13:29 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2005-09-02 23:11:08 +08:00
AC_MSG_CHECKING([whether to support tftp])
AC_ARG_ENABLE(tftp,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-tftp],[Enable TFTP support])
AS_HELP_STRING([--disable-tftp],[Disable TFTP support]),
2005-09-02 23:11:08 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
AC_SUBST(CURL_DISABLE_TFTP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2002-06-11 19:13:29 +08:00
2009-12-13 06:31:00 +08:00
AC_MSG_CHECKING([whether to support pop3])
AC_ARG_ENABLE(pop3,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-pop3],[Enable POP3 support])
AS_HELP_STRING([--disable-pop3],[Disable POP3 support]),
2009-12-13 06:31:00 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
AC_SUBST(CURL_DISABLE_POP3, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support imap])
AC_ARG_ENABLE(imap,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-imap],[Enable IMAP support])
AS_HELP_STRING([--disable-imap],[Disable IMAP support]),
2009-12-13 06:31:00 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
AC_SUBST(CURL_DISABLE_IMAP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2014-11-30 01:59:29 +08:00
AC_MSG_CHECKING([whether to support smb])
AC_ARG_ENABLE(smb,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
2014-11-30 01:59:29 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
AC_SUBST(CURL_DISABLE_SMB, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2009-12-13 06:31:00 +08:00
AC_MSG_CHECKING([whether to support smtp])
AC_ARG_ENABLE(smtp,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-smtp],[Enable SMTP support])
AS_HELP_STRING([--disable-smtp],[Disable SMTP support]),
2009-12-13 06:31:00 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
AC_SUBST(CURL_DISABLE_SMTP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2010-08-12 22:55:48 +08:00
AC_MSG_CHECKING([whether to support gopher])
AC_ARG_ENABLE(gopher,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-gopher],[Enable Gopher support])
AS_HELP_STRING([--disable-gopher],[Disable Gopher support]),
2010-08-12 22:55:48 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
AC_SUBST(CURL_DISABLE_GOPHER, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2020-04-14 17:19:12 +08:00
AC_MSG_CHECKING([whether to support mqtt])
AC_ARG_ENABLE(mqtt,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-mqtt],[Enable MQTT support])
AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
2020-04-14 17:19:12 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2020-08-31 15:45:09 +08:00
AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
AC_SUBST(CURL_DISABLE_MQTT, [1])
2020-04-14 17:19:12 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(no)
)
2009-12-13 06:31:00 +08:00
2004-02-12 22:45:50 +08:00
dnl **********************************************************************
dnl Check for built-in manual
dnl **********************************************************************
AC_MSG_CHECKING([whether to provide built-in manual])
AC_ARG_ENABLE(manual,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-manual],[Enable built-in manual])
AS_HELP_STRING([--disable-manual],[Disable built-in manual]),
2004-02-12 22:45:50 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
;;
*) AC_MSG_RESULT(yes)
USE_MANUAL="1"
;;
esac ],
AC_MSG_RESULT(yes)
USE_MANUAL="1"
)
dnl The actual use of the USE_MANUAL variable is done much later in this
dnl script to allow other actions to disable it as well.
2012-02-06 01:44:22 +08:00
dnl ************************************************************
dnl disable C code generation support
dnl
AC_MSG_CHECKING([whether to enable generation of C code])
AC_ARG_ENABLE(libcurl_option,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
2012-02-06 01:44:22 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
curl_libcurl_msg="no"
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
1999-12-29 22:20:26 +08:00
dnl **********************************************************************
dnl Checks for libraries.
dnl **********************************************************************
2012-12-04 05:40:26 +08:00
AC_MSG_CHECKING([whether to use libgcc])
AC_ARG_ENABLE(libgcc,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
2012-12-04 05:40:26 +08:00
[ case "$enableval" in
yes)
LIBS="-lgcc $LIBS"
AC_MSG_RESULT(yes)
;;
*) AC_MSG_RESULT(no)
;;
esac ],
AC_MSG_RESULT(no)
)
2009-05-04 01:35:44 +08:00
CURL_CHECK_LIB_XNET
2009-05-01 02:35:36 +08:00
2004-02-06 20:13:20 +08:00
dnl gethostbyname without lib or in the nsl lib?
AC_CHECK_FUNC(gethostbyname,
[HAVE_GETHOSTBYNAME="1"
],
[ AC_CHECK_LIB(nsl, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
2012-12-04 05:40:26 +08:00
LIBS="-lnsl $LIBS"
2004-02-06 20:13:20 +08:00
])
])
if test "$HAVE_GETHOSTBYNAME" != "1"
then
2000-11-08 22:27:46 +08:00
dnl gethostbyname in the socket lib?
2004-02-06 20:13:20 +08:00
AC_CHECK_LIB(socket, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
2012-12-04 05:40:26 +08:00
LIBS="-lsocket $LIBS"
2004-02-06 20:13:20 +08:00
])
2000-11-08 22:27:46 +08:00
fi
2012-03-23 06:33:33 +08:00
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl gethostbyname in the watt lib?
AC_CHECK_LIB(watt, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
LDFLAGS="-L/dev/env/WATT_ROOT/lib"
2012-12-04 05:40:26 +08:00
LIBS="-lwatt $LIBS"
2012-03-23 06:33:33 +08:00
])
fi
2004-02-06 20:13:20 +08:00
dnl At least one system has been identified to require BOTH nsl and socket
dnl libs at the same time to link properly.
if test "$HAVE_GETHOSTBYNAME" != "1"
then
2004-05-06 23:04:04 +08:00
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
2000-07-25 15:29:32 +08:00
my_ac_save_LIBS=$LIBS
LIBS="-lnsl -lsocket $LIBS"
2008-05-20 23:55:31 +08:00
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
]],[[
gethostbyname();
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
LIBS=$my_ac_save_LIBS
])
2004-02-06 20:13:20 +08:00
fi
2000-07-25 15:29:32 +08:00
2004-02-06 20:13:20 +08:00
if test "$HAVE_GETHOSTBYNAME" != "1"
then
2008-05-19 04:13:13 +08:00
dnl This is for winsock systems
2016-04-15 22:37:20 +08:00
if test "$curl_cv_header_windows_h" = "yes"; then
if test "$curl_cv_header_winsock2_h" = "yes"; then
2008-05-19 04:13:13 +08:00
winsock_LIB="-lws2_32"
fi
if test ! -z "$winsock_LIB"; then
my_ac_save_LIBS=$LIBS
2012-12-04 05:40:26 +08:00
LIBS="$winsock_LIB $LIBS"
2008-05-19 04:13:13 +08:00
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
2008-05-20 23:55:31 +08:00
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
2008-05-19 04:13:13 +08:00
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#endif
2008-05-20 23:55:31 +08:00
]],[[
2023-09-29 20:01:17 +08:00
gethostbyname("localhost");
2008-05-20 23:55:31 +08:00
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
winsock_LIB=""
LIBS=$my_ac_save_LIBS
2008-05-19 04:13:13 +08:00
])
fi
fi
2006-07-20 06:27:49 +08:00
fi
2007-05-17 14:04:44 +08:00
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl This is for Minix 3.1
AC_MSG_CHECKING([for gethostbyname for Minix 3])
2008-05-20 23:55:31 +08:00
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
2007-05-17 14:04:44 +08:00
/* Older Minix versions may need <net/gen/netdb.h> here instead */
2008-05-20 23:55:31 +08:00
#include <netdb.h>
]],[[
2023-09-29 20:01:17 +08:00
gethostbyname("localhost");
2008-05-20 23:55:31 +08:00
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
])
2007-05-17 14:04:44 +08:00
fi
2006-07-20 06:27:49 +08:00
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl This is for eCos with a stubbed DNS implementation
AC_MSG_CHECKING([for gethostbyname for eCos])
2008-05-20 23:55:31 +08:00
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
2006-07-20 06:27:49 +08:00
#include <stdio.h>
2008-05-20 23:55:31 +08:00
#include <netdb.h>
]],[[
2023-09-29 20:01:17 +08:00
gethostbyname("localhost");
2008-05-20 23:55:31 +08:00
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
],[
AC_MSG_RESULT([no])
])
2004-02-06 20:13:20 +08:00
fi
2020-11-19 02:44:35 +08:00
if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
2019-03-08 08:06:59 +08:00
then
dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
2022-08-08 00:15:16 +08:00
#define __USE_INLINE__
2020-11-19 02:44:35 +08:00
#include <proto/bsdsocket.h>
2022-08-08 00:15:16 +08:00
#ifdef __amigaos4__
struct SocketIFace *ISocket = NULL;
#else
2020-11-19 02:44:35 +08:00
struct Library *SocketBase = NULL;
2022-08-08 00:15:16 +08:00
#endif
2019-03-08 08:06:59 +08:00
]],[[
2023-09-29 20:01:17 +08:00
gethostbyname("localhost");
2019-03-08 08:06:59 +08:00
]])
],[
AC_MSG_RESULT([yes])
HAVE_GETHOSTBYNAME="1"
HAVE_PROTO_BSDSOCKET_H="1"
AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
],[
AC_MSG_RESULT([no])
])
fi
2008-05-26 23:09:28 +08:00
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl gethostbyname in the network lib - for Haiku OS
AC_CHECK_LIB(network, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
2012-12-04 05:40:26 +08:00
LIBS="-lnetwork $LIBS"
2008-05-26 23:09:28 +08:00
])
fi
2008-11-18 09:57:28 +08:00
if test "$HAVE_GETHOSTBYNAME" != "1"; then
2004-02-06 20:13:20 +08:00
AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
2000-07-25 15:29:32 +08:00
fi
2009-06-21 01:24:43 +08:00
CURL_CHECK_LIBS_CONNECT
1999-12-29 22:20:26 +08:00
2010-08-09 11:45:11 +08:00
CURL_NETWORK_LIBS=$LIBS
2008-05-10 23:46:08 +08:00
dnl **********************************************************************
2008-05-12 10:04:21 +08:00
dnl In case that function clock_gettime with monotonic timer is available,
dnl check for additional required libraries.
2008-05-10 23:46:08 +08:00
dnl **********************************************************************
2008-05-12 10:04:21 +08:00
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
2008-05-10 23:46:08 +08:00
2023-06-10 02:42:51 +08:00
dnl Check for even better option
CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW
2007-02-17 16:49:04 +08:00
dnl **********************************************************************
dnl The preceding library checks are all potentially useful for test
2012-11-29 01:31:23 +08:00
dnl servers and libtest cases which require networking and clock_gettime
dnl support. Save the list of required libraries at this point for use
dnl while linking those test servers and programs.
2007-02-17 16:49:04 +08:00
dnl **********************************************************************
2012-11-29 01:31:23 +08:00
CURL_NETWORK_AND_TIME_LIBS=$LIBS
1999-12-29 22:20:26 +08:00
2007-02-17 16:49:04 +08:00
dnl **********************************************************************
2012-12-04 05:40:26 +08:00
dnl Check for the presence of ZLIB libraries and headers
dnl **********************************************************************
dnl Check for & handle argument to --with-zlib.
clean_CPPFLAGS=$CPPFLAGS
clean_LDFLAGS=$LDFLAGS
clean_LIBS=$LIBS
ZLIB_LIBS=""
AC_ARG_WITH(zlib,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
AS_HELP_STRING([--without-zlib],[disable use of zlib]),
2012-12-04 05:40:26 +08:00
[OPT_ZLIB="$withval"])
if test "$OPT_ZLIB" = "no" ; then
AC_MSG_WARN([zlib disabled])
else
if test "$OPT_ZLIB" = "yes" ; then
OPT_ZLIB=""
fi
2016-08-24 19:49:53 +08:00
if test -z "$OPT_ZLIB" ; then
2017-02-27 06:39:12 +08:00
CURL_CHECK_PKGCONFIG(zlib)
if test "$PKGCONFIG" != "no" ; then
2023-09-01 07:06:02 +08:00
ZLIB_LIBS="`$PKGCONFIG --libs-only-l zlib`"
if test -n "$ZLIB_LIBS"; then
LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
else
ZLIB_LIBS="`$PKGCONFIG --libs zlib`"
fi
LIBS="$ZLIB_LIBS $LIBS"
CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags zlib`"
2017-02-27 06:39:12 +08:00
OPT_ZLIB=""
HAVE_LIBZ="1"
fi
2012-12-04 05:40:26 +08:00
2016-08-11 23:49:48 +08:00
if test -z "$HAVE_LIBZ"; then
dnl Check for the lib without setting any new path, since many
dnl people have it in the default path
AC_CHECK_LIB(z, inflateEnd,
2012-12-04 05:40:26 +08:00
dnl libz found, set the variable
[HAVE_LIBZ="1"
2023-09-01 07:06:02 +08:00
ZLIB_LIBS="-lz"
LIBS="$ZLIB_LIBS $LIBS"],
2012-12-04 05:40:26 +08:00
dnl if no lib found, try /usr/local
[OPT_ZLIB="/usr/local"])
2016-08-11 23:49:48 +08:00
fi
2012-12-04 05:40:26 +08:00
fi
dnl Add a nonempty path to the compiler flags
if test -n "$OPT_ZLIB"; then
CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
fi
AC_CHECK_HEADER(zlib.h,
[
dnl zlib.h was found
HAVE_ZLIB_H="1"
dnl if the lib wasn't found already, try again with the new paths
if test "$HAVE_LIBZ" != "1"; then
AC_CHECK_LIB(z, gzread,
[
dnl the lib was found!
HAVE_LIBZ="1"
2023-09-01 07:06:02 +08:00
ZLIB_LIBS="-lz"
LIBS="$ZLIB_LIBS $LIBS"
2012-12-04 05:40:26 +08:00
],
[ CPPFLAGS=$clean_CPPFLAGS
LDFLAGS=$clean_LDFLAGS])
fi
],
[
dnl zlib.h was not found, restore the flags
CPPFLAGS=$clean_CPPFLAGS
LDFLAGS=$clean_LDFLAGS]
)
if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
then
AC_MSG_WARN([configure found only the libz lib, not the header file!])
HAVE_LIBZ=""
CPPFLAGS=$clean_CPPFLAGS
LDFLAGS=$clean_LDFLAGS
LIBS=$clean_LIBS
2023-09-01 07:06:02 +08:00
ZLIB_LIBS=""
2012-12-04 05:40:26 +08:00
elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
then
AC_MSG_WARN([configure found only the libz header file, not the lib!])
CPPFLAGS=$clean_CPPFLAGS
LDFLAGS=$clean_LDFLAGS
LIBS=$clean_LIBS
2023-09-01 07:06:02 +08:00
ZLIB_LIBS=""
2012-12-04 05:40:26 +08:00
elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
then
dnl both header and lib were found!
AC_SUBST(HAVE_LIBZ)
AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
2023-09-01 07:06:02 +08:00
LIBS="$ZLIB_LIBS $clean_LIBS"
2012-12-04 05:40:26 +08:00
dnl replace 'HAVE_LIBZ' in the automake makefile.ams
AMFIXLIB="1"
AC_MSG_NOTICE([found both libz and libz.h header])
curl_zlib_msg="enabled"
fi
fi
dnl set variable for use in automakefile(s)
AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
AC_SUBST(ZLIB_LIBS)
2003-03-12 21:42:07 +08:00
2017-11-05 22:28:16 +08:00
dnl **********************************************************************
dnl Check for the presence of BROTLI decoder libraries and headers
dnl **********************************************************************
dnl Brotli project home page: https://github.com/google/brotli
dnl Default to compiler & linker defaults for BROTLI files & libraries.
OPT_BROTLI=off
AC_ARG_WITH(brotli,dnl
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AS_HELP_STRING([--without-brotli], [disable BROTLI]),
2017-11-05 22:28:16 +08:00
OPT_BROTLI=$withval)
if test X"$OPT_BROTLI" != Xno; then
dnl backup the pre-brotli variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
case "$OPT_BROTLI" in
yes)
dnl --with-brotli (without path) used
CURL_CHECK_PKGCONFIG(libbrotlidec)
if test "$PKGCONFIG" != "no" ; then
LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
version=`$PKGCONFIG --modversion libbrotlidec`
2020-06-05 00:11:36 +08:00
DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
2017-11-05 22:28:16 +08:00
fi
;;
off)
dnl no --with-brotli option given, just check default places
;;
*)
dnl use the given --with-brotli spot
PREFIX_BROTLI=$OPT_BROTLI
;;
esac
dnl if given with a prefix, we set -L and -I based on that
if test -n "$PREFIX_BROTLI"; then
LIB_BROTLI="-lbrotlidec"
LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
CPP_BROTLI=-I${PREFIX_BROTLI}/include
DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
fi
LDFLAGS="$LDFLAGS $LD_BROTLI"
CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
LIBS="$LIB_BROTLI $LIBS"
AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
AC_CHECK_HEADERS(brotli/decode.h,
curl_brotli_msg="enabled (libbrotlidec)"
HAVE_BROTLI=1
AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
AC_SUBST(HAVE_BROTLI, [1])
)
if test X"$OPT_BROTLI" != Xoff &&
test "$HAVE_BROTLI" != "1"; then
AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
fi
if test "$HAVE_BROTLI" = "1"; then
if test -n "$DIR_BROTLI"; then
dnl when the brotli shared libs were found in a path that the run-time
2018-04-13 20:07:39 +08:00
dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2017-11-05 22:28:16 +08:00
dnl to prevent further configure tests to fail due to this
if test "x$cross_compiling" != "xyes"; then
2018-04-13 20:07:39 +08:00
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
2017-11-05 22:28:16 +08:00
fi
fi
else
dnl no brotli, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
fi
fi
2020-05-25 23:49:46 +08:00
dnl **********************************************************************
dnl Check for libzstd
dnl **********************************************************************
dnl Default to compiler & linker defaults for libzstd
OPT_ZSTD=off
AC_ARG_WITH(zstd,dnl
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AS_HELP_STRING([--without-zstd], [disable libzstd]),
2020-05-25 23:49:46 +08:00
OPT_ZSTD=$withval)
if test X"$OPT_ZSTD" != Xno; then
dnl backup the pre-zstd variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
case "$OPT_ZSTD" in
yes)
dnl --with-zstd (without path) used
CURL_CHECK_PKGCONFIG(libzstd)
if test "$PKGCONFIG" != "no" ; then
LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
version=`$PKGCONFIG --modversion libzstd`
DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
fi
;;
off)
dnl no --with-zstd option given, just check default places
;;
*)
dnl use the given --with-zstd spot
PREFIX_ZSTD=$OPT_ZSTD
;;
esac
dnl if given with a prefix, we set -L and -I based on that
if test -n "$PREFIX_ZSTD"; then
LIB_ZSTD="-lzstd"
LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
CPP_ZSTD=-I${PREFIX_ZSTD}/include
DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
fi
LDFLAGS="$LDFLAGS $LD_ZSTD"
CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
LIBS="$LIB_ZSTD $LIBS"
AC_CHECK_LIB(zstd, ZSTD_createDStream)
AC_CHECK_HEADERS(zstd.h,
curl_zstd_msg="enabled (libzstd)"
HAVE_ZSTD=1
AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
AC_SUBST(HAVE_ZSTD, [1])
)
if test X"$OPT_ZSTD" != Xoff &&
test "$HAVE_ZSTD" != "1"; then
AC_MSG_ERROR([libzstd was not found where specified!])
fi
if test "$HAVE_ZSTD" = "1"; then
if test -n "$DIR_ZSTD"; then
dnl when the zstd shared lib were found in a path that the run-time
dnl linker doesn't search through, we need to add it to
dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
dnl this
if test "x$cross_compiling" != "xyes"; then
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
fi
fi
else
dnl no zstd, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
fi
fi
2004-02-16 06:34:58 +08:00
dnl **********************************************************************
2007-08-12 04:57:54 +08:00
dnl Check for LDAP
2005-03-11 13:28:07 +08:00
dnl **********************************************************************
LDAPLIBNAME=""
AC_ARG_WITH(ldap-lib,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
2005-03-11 13:28:07 +08:00
[LDAPLIBNAME="$withval"])
LBERLIBNAME=""
AC_ARG_WITH(lber-lib,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
2005-03-11 13:28:07 +08:00
[LBERLIBNAME="$withval"])
if test x$CURL_DISABLE_LDAP != x1 ; then
2007-10-14 10:37:04 +08:00
CURL_CHECK_HEADER_LBER
CURL_CHECK_HEADER_LDAP
CURL_CHECK_HEADER_LDAP_SSL
2007-10-10 07:44:14 +08:00
2005-03-11 13:28:07 +08:00
if test -z "$LDAPLIBNAME" ; then
2016-04-15 22:37:20 +08:00
if test "$curl_cv_native_windows" = "yes"; then
2010-06-04 21:14:31 +08:00
dnl Windows uses a single and unique LDAP library name
LDAPLIBNAME="wldap32"
LBERLIBNAME="no"
fi
2005-03-11 13:28:07 +08:00
fi
if test "$LDAPLIBNAME" ; then
2007-08-12 04:57:54 +08:00
AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
2021-05-12 17:15:51 +08:00
if test -n "$ldap_askedfor"; then
AC_MSG_ERROR([couldn't detect the LDAP libraries])
fi
2007-08-12 04:57:54 +08:00
AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
2012-05-30 23:40:13 +08:00
AC_SUBST(CURL_DISABLE_LDAP, [1])
2008-03-21 04:08:44 +08:00
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
2012-05-30 23:40:13 +08:00
AC_SUBST(CURL_DISABLE_LDAPS, [1])])
2005-03-11 13:28:07 +08:00
else
2007-10-15 05:25:10 +08:00
dnl Try to find the right ldap libraries for this system
CURL_CHECK_LIBS_LDAP
case X-"$curl_cv_ldap_LIBS" in
X-unknown)
2021-05-12 17:15:51 +08:00
if test -n "$ldap_askedfor"; then
AC_MSG_ERROR([couldn't detect the LDAP libraries])
fi
2007-10-15 05:25:10 +08:00
AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
AC_SUBST(CURL_DISABLE_LDAP, [1])
2008-03-21 04:08:44 +08:00
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
AC_SUBST(CURL_DISABLE_LDAPS, [1])
2007-10-15 05:25:10 +08:00
;;
esac
2005-03-11 13:28:07 +08:00
fi
2007-08-12 04:57:54 +08:00
fi
if test x$CURL_DISABLE_LDAP != x1 ; then
2005-03-11 13:28:07 +08:00
if test "$LBERLIBNAME" ; then
2007-08-12 04:57:54 +08:00
dnl If name is "no" then don't define this library at all
2005-03-11 13:28:07 +08:00
dnl (it's only needed if libldap.so's dependencies are broken).
2007-08-21 03:30:25 +08:00
if test "$LBERLIBNAME" != "no" ; then
2007-08-12 04:57:54 +08:00
AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
2012-05-30 23:40:13 +08:00
AC_SUBST(CURL_DISABLE_LDAP, [1])
2008-03-21 04:08:44 +08:00
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
2012-05-30 23:40:13 +08:00
AC_SUBST(CURL_DISABLE_LDAPS, [1])])
2005-03-11 13:28:07 +08:00
fi
2007-08-12 04:57:54 +08:00
fi
fi
if test x$CURL_DISABLE_LDAP != x1 ; then
2023-06-22 20:34:49 +08:00
AC_CHECK_FUNCS([ldap_url_parse \
ldap_init_fd])
2007-08-12 04:57:54 +08:00
if test "$LDAPLIBNAME" = "wldap32"; then
2007-08-31 04:28:40 +08:00
curl_ldap_msg="enabled (winldap)"
2015-01-19 04:25:37 +08:00
AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
2007-08-12 04:57:54 +08:00
else
2010-06-02 03:26:19 +08:00
if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
2023-06-22 20:34:49 +08:00
curl_ldap_msg="enabled (OpenLDAP)"
2010-05-25 06:44:42 +08:00
AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
2010-05-28 18:23:28 +08:00
AC_SUBST(USE_OPENLDAP, [1])
2023-06-22 20:34:49 +08:00
else
curl_ldap_msg="enabled (ancient OpenLDAP)"
2010-05-25 06:44:42 +08:00
fi
2005-03-11 13:28:07 +08:00
fi
fi
2010-09-21 13:27:11 +08:00
if test x$CURL_DISABLE_LDAPS != x1 ; then
curl_ldaps_msg="enabled"
fi
2003-10-03 03:04:32 +08:00
dnl **********************************************************************
dnl Checks for IPv6
dnl **********************************************************************
2014-12-27 19:09:01 +08:00
AC_MSG_CHECKING([whether to enable IPv6])
2003-10-03 03:04:32 +08:00
AC_ARG_ENABLE(ipv6,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
2003-10-03 03:04:32 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
ipv6=no
;;
*) AC_MSG_RESULT(yes)
ipv6=yes
;;
esac ],
2021-03-16 06:11:29 +08:00
AC_RUN_IFELSE([AC_LANG_SOURCE([[
/* are AF_INET6 and sockaddr_in6 available? */
2003-10-03 03:04:32 +08:00
#include <sys/types.h>
2015-09-18 02:03:34 +08:00
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
2019-11-30 22:49:32 +08:00
#include <ws2tcpip.h>
2015-09-18 02:03:34 +08:00
#else
2003-10-03 03:04:32 +08:00
#include <sys/socket.h>
2019-11-30 22:49:32 +08:00
#include <netinet/in.h>
#if defined (__TANDEM)
# include <netinet/in6.h>
#endif
2015-09-18 02:03:34 +08:00
#endif
2013-11-14 10:58:25 +08:00
#include <stdlib.h> /* for exit() */
2003-10-03 03:04:32 +08:00
main()
{
2019-11-30 22:49:32 +08:00
struct sockaddr_in6 s;
(void)s;
2003-10-03 03:04:32 +08:00
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
else
exit(0);
}
2021-03-16 06:11:29 +08:00
]])
2013-01-09 02:02:08 +08:00
],
AC_MSG_RESULT(yes)
ipv6=yes,
AC_MSG_RESULT(no)
ipv6=no,
2016-01-12 17:30:54 +08:00
AC_MSG_RESULT(yes)
ipv6=yes
2013-01-09 02:02:08 +08:00
))
2003-10-03 03:04:32 +08:00
2008-12-27 12:30:36 +08:00
if test "$ipv6" = yes; then
2019-11-30 22:49:32 +08:00
curl_ipv6_msg="enabled"
AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
IPV6_ENABLED=1
AC_SUBST(IPV6_ENABLED)
2008-12-27 12:30:36 +08:00
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
2021-03-16 06:11:29 +08:00
AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
2008-12-27 12:30:36 +08:00
#include <sys/types.h>
2015-09-18 02:03:34 +08:00
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <netinet/in.h>
2017-12-06 00:41:27 +08:00
#if defined (__TANDEM)
# include <netinet/in6.h>
#endif
2021-03-16 06:11:29 +08:00
#endif
]], [[
struct sockaddr_in6 s;
s.sin6_scope_id = 0;
]])], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
], [
2008-12-30 16:05:38 +08:00
AC_MSG_RESULT([no])
2021-03-16 06:11:29 +08:00
])
2008-12-27 12:30:36 +08:00
fi
2003-01-29 21:16:03 +08:00
dnl **********************************************************************
dnl Check if the operating system allows programs to write to their own argv[]
dnl **********************************************************************
AC_MSG_CHECKING([if argv can be written to])
2020-05-28 22:32:07 +08:00
CURL_RUN_IFELSE([[
int main(int argc, char **argv)
{
2023-04-06 15:58:13 +08:00
#ifdef _WIN32
/* on Windows, writing to the argv does not hide the argument in
process lists so it can just be skipped */
(void)argc;
(void)argv;
return 1;
#else
2020-05-28 22:32:07 +08:00
(void)argc;
argv[0][0] = ' ';
return (argv[0][0] == ' ')?0:1;
2023-04-06 15:58:13 +08:00
#endif
2003-01-29 21:16:03 +08:00
}
2020-05-28 22:32:07 +08:00
]],[
2010-11-13 11:15:48 +08:00
curl_cv_writable_argv=yes
],[
curl_cv_writable_argv=no
],[
curl_cv_writable_argv=cross
2003-11-17 13:23:06 +08:00
])
case $curl_cv_writable_argv in
yes)
2007-08-21 03:33:46 +08:00
AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
AC_MSG_RESULT(yes)
;;
2003-11-17 13:23:06 +08:00
no)
2007-08-21 03:33:46 +08:00
AC_MSG_RESULT(no)
;;
2003-11-17 13:23:06 +08:00
*)
2003-05-05 00:07:19 +08:00
AC_MSG_RESULT(no)
AC_MSG_WARN([the previous check could not be made default was used])
2007-08-21 03:33:46 +08:00
;;
2003-11-17 13:23:06 +08:00
esac
2003-01-29 21:16:03 +08:00
2003-06-10 20:22:19 +08:00
dnl **********************************************************************
dnl Check for GSS-API libraries
dnl **********************************************************************
2014-03-03 18:06:38 +08:00
dnl check for GSS-API stuff in the /usr as default
2007-11-28 18:33:47 +08:00
GSSAPI_ROOT="/usr"
2003-06-10 20:22:19 +08:00
AC_ARG_WITH(gssapi-includes,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-gssapi-includes=DIR],
2014-03-03 18:06:38 +08:00
[Specify location of GSS-API headers]),
2007-08-21 03:30:25 +08:00
[ GSSAPI_INCS="-I$withval"
2003-06-10 20:22:19 +08:00
want_gss="yes" ]
)
AC_ARG_WITH(gssapi-libs,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-gssapi-libs=DIR],
2014-03-03 18:06:38 +08:00
[Specify location of GSS-API libs]),
2006-09-25 06:03:01 +08:00
[ GSSAPI_LIB_DIR="-L$withval"
2003-06-10 20:22:19 +08:00
want_gss="yes" ]
)
AC_ARG_WITH(gssapi,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-gssapi=DIR],
2014-03-03 18:06:38 +08:00
[Where to look for GSS-API]), [
2005-07-21 07:00:27 +08:00
GSSAPI_ROOT="$withval"
if test x"$GSSAPI_ROOT" != xno; then
2007-08-21 03:30:25 +08:00
want_gss="yes"
2007-11-28 18:33:47 +08:00
if test x"$GSSAPI_ROOT" = xyes; then
dnl if yes, then use default root
GSSAPI_ROOT="/usr"
fi
2005-07-21 07:00:27 +08:00
fi
])
2003-06-10 20:22:19 +08:00
2022-02-17 01:56:02 +08:00
: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
2005-09-01 05:23:47 +08:00
save_CPPFLAGS="$CPPFLAGS"
2014-03-03 18:06:38 +08:00
AC_MSG_CHECKING([if GSS-API support is requested])
2003-06-10 20:22:19 +08:00
if test x"$want_gss" = xyes; then
2005-08-29 16:42:45 +08:00
AC_MSG_RESULT(yes)
2022-02-17 01:56:02 +08:00
if test $GSSAPI_ROOT != "/usr"; then
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
else
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
fi
2003-06-10 20:22:19 +08:00
if test -z "$GSSAPI_INCS"; then
2014-06-15 18:42:30 +08:00
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
2016-04-26 13:13:01 +08:00
elif test "$PKGCONFIG" != "no" ; then
GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
2022-02-17 01:56:02 +08:00
elif test -f "$KRB5CONFIG"; then
GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
2004-11-11 05:43:41 +08:00
elif test "$GSSAPI_ROOT" != "yes"; then
2004-03-03 17:16:36 +08:00
GSSAPI_INCS="-I$GSSAPI_ROOT/include"
2003-06-10 20:22:19 +08:00
fi
fi
2007-11-28 18:33:47 +08:00
2003-09-22 06:13:23 +08:00
CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
2005-08-29 16:42:45 +08:00
AC_CHECK_HEADER(gss.h,
[
dnl found in the given dirs
2014-03-03 18:06:38 +08:00
AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
2005-08-29 16:42:45 +08:00
gnu_gss=yes
],
[
2008-04-07 17:26:30 +08:00
dnl not found, check Heimdal or MIT
2010-04-16 21:09:32 +08:00
AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
2008-04-07 17:26:30 +08:00
AC_CHECK_HEADERS(
2010-04-16 21:09:32 +08:00
[gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
2008-04-07 17:26:30 +08:00
[],
2010-04-16 21:09:32 +08:00
[not_mit=1],
[
AC_INCLUDES_DEFAULT
#ifdef HAVE_GSSAPI_GSSAPI_H
#include <gssapi/gssapi.h>
#endif
])
2008-04-07 17:26:30 +08:00
if test "x$not_mit" = "x1"; then
dnl MIT not found, check for Heimdal
AC_CHECK_HEADER(gssapi.h,
2005-08-29 16:42:45 +08:00
[
2007-08-21 03:30:25 +08:00
dnl found
2014-03-03 18:06:38 +08:00
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
2005-08-29 16:42:45 +08:00
],
[
dnl no header found, disabling GSS
want_gss=no
2014-03-03 18:06:38 +08:00
AC_MSG_WARN(disabling GSS-API support since no header files were found)
2005-08-29 16:42:45 +08:00
]
)
2008-04-07 17:26:30 +08:00
else
dnl MIT found
2014-03-03 18:06:38 +08:00
AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
dnl check if we have a really old MIT Kerberos version (<= 1.2)
AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
2008-08-03 09:01:05 +08:00
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
2008-04-07 17:26:30 +08:00
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
#include <gssapi/gssapi_krb5.h>
2008-08-03 09:01:05 +08:00
]],[[
2008-04-07 17:26:30 +08:00
gss_import_name(
(OM_uint32 *)0,
(gss_buffer_t)0,
GSS_C_NT_HOSTBASED_SERVICE,
(gss_name_t *)0);
2008-08-03 09:01:05 +08:00
]])
],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
AC_DEFINE(HAVE_OLD_GSSMIT, 1,
2014-03-03 18:06:38 +08:00
[if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
2008-08-03 09:01:05 +08:00
])
2008-04-07 17:26:30 +08:00
fi
2005-08-29 16:42:45 +08:00
]
)
else
AC_MSG_RESULT(no)
fi
if test x"$want_gss" = xyes; then
2014-03-03 18:06:38 +08:00
AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
2014-07-21 15:53:45 +08:00
HAVE_GSSAPI=1
2014-03-03 18:06:38 +08:00
curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
2005-08-29 16:42:45 +08:00
if test -n "$gnu_gss"; then
curl_gss_msg="enabled (GNU GSS)"
2008-03-10 17:56:49 +08:00
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
2012-12-04 05:40:26 +08:00
LIBS="-lgss $LIBS"
2005-08-29 16:42:45 +08:00
elif test -z "$GSSAPI_LIB_DIR"; then
2010-03-03 06:02:56 +08:00
case $host in
*-*-darwin*)
2012-12-04 05:40:26 +08:00
LIBS="-lgssapi_krb5 -lresolv $LIBS"
2010-03-03 06:02:56 +08:00
;;
*)
2022-02-17 01:56:02 +08:00
if test $GSSAPI_ROOT != "/usr"; then
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
else
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
fi
2014-06-15 18:42:30 +08:00
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
dnl krb5-config doesn't have --libs-only-L or similar, put everything
dnl into LIBS
gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
LIBS="$gss_libs $LIBS"
2016-04-26 13:13:01 +08:00
elif test "$PKGCONFIG" != "no" ; then
gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
2012-12-04 05:40:26 +08:00
LIBS="$gss_libs $LIBS"
2022-02-17 01:56:02 +08:00
elif test -f "$KRB5CONFIG"; then
dnl krb5-config doesn't have --libs-only-L or similar, put everything
dnl into LIBS
gss_libs=`$KRB5CONFIG --libs gssapi`
LIBS="$gss_libs $LIBS"
2010-03-03 06:02:56 +08:00
else
2014-08-08 18:03:58 +08:00
case $host in
*-hp-hpux*)
gss_libname="gss"
;;
*)
gss_libname="gssapi"
;;
esac
if test "$GSSAPI_ROOT" != "yes"; then
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
LIBS="-l$gss_libname $LIBS"
else
LIBS="-l$gss_libname $LIBS"
fi
2010-03-03 06:02:56 +08:00
fi
;;
esac
2003-06-10 20:22:19 +08:00
else
2008-03-10 17:56:49 +08:00
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
2014-01-17 00:19:00 +08:00
case $host in
*-hp-hpux*)
LIBS="-lgss $LIBS"
;;
*)
LIBS="-lgssapi $LIBS"
;;
esac
2003-06-10 20:22:19 +08:00
fi
else
2005-08-29 16:42:45 +08:00
CPPFLAGS="$save_CPPFLAGS"
2003-06-10 20:22:19 +08:00
fi
2007-08-21 03:30:25 +08:00
2022-02-17 01:56:02 +08:00
if test x"$want_gss" = xyes; then
AC_MSG_CHECKING([if we can link against GSS-API library])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([gss_init_sec_context])
],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.])
])
fi
2017-07-19 02:46:21 +08:00
build_libstubgss=no
if test x"$want_gss" = "xyes"; then
build_libstubgss=yes
fi
AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
2017-08-25 04:26:48 +08:00
dnl -------------------------------------------------------------
dnl parse --with-default-ssl-backend so it can be validated below
dnl -------------------------------------------------------------
DEFAULT_SSL_BACKEND=no
VALID_DEFAULT_SSL_BACKEND=
AC_ARG_WITH(default-ssl-backend,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
2017-08-25 04:26:48 +08:00
[DEFAULT_SSL_BACKEND=$withval])
case "$DEFAULT_SSL_BACKEND" in
no)
dnl --without-default-ssl-backend option used
;;
default|yes)
dnl --with-default-ssl-backend option used without name
AC_MSG_ERROR([The name of the default SSL backend is required.])
;;
*)
dnl --with-default-ssl-backend option used with name
AC_SUBST(DEFAULT_SSL_BACKEND)
dnl needs to be validated below
VALID_DEFAULT_SSL_BACKEND=no
;;
esac
2021-04-15 17:17:29 +08:00
CURL_WITH_SCHANNEL
CURL_WITH_SECURETRANSPORT
CURL_WITH_AMISSL
CURL_WITH_OPENSSL
CURL_WITH_GNUTLS
CURL_WITH_MBEDTLS
CURL_WITH_WOLFSSL
CURL_WITH_BEARSSL
CURL_WITH_RUSTLS
2012-06-14 02:54:03 +08:00
2021-03-06 22:52:09 +08:00
dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL
if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then
LIBS="-ladvapi32 -lcrypt32 $LIBS"
fi
2022-07-04 17:38:24 +08:00
dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer)
2023-08-08 19:00:36 +08:00
if test "x$curl_cv_native_windows" = "xyes"; then
2022-07-04 17:38:24 +08:00
LIBS="-lbcrypt $LIBS"
fi
2023-07-30 05:44:28 +08:00
case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$RUSTLS_ENABLED"
2020-12-13 15:55:09 +08:00
in
2017-08-18 14:51:24 +08:00
x)
2022-08-25 23:29:48 +08:00
AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more.
2023-07-30 05:44:28 +08:00
Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl or --with-rustls to address this.])
2017-08-18 14:51:24 +08:00
;;
x1)
# one SSL backend is enabled
2007-10-30 06:13:00 +08:00
AC_SUBST(SSL_ENABLED)
SSL_ENABLED="1"
2017-09-05 16:45:09 +08:00
AC_MSG_NOTICE([built with one SSL backend])
2017-08-18 14:51:24 +08:00
;;
2022-08-25 23:29:48 +08:00
xD)
# explicitly built without TLS
;;
2022-09-02 05:32:49 +08:00
xD*)
AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library
2023-07-30 05:44:28 +08:00
(e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-secure-transport, --with-amissl, --with-bearssl, --with-rustls).
2022-09-02 05:32:49 +08:00
Since these are conflicting parameters, verify which is the desired one and drop the other.])
;;
2017-08-18 14:51:24 +08:00
*)
# more than one SSL backend is enabled
AC_SUBST(SSL_ENABLED)
SSL_ENABLED="1"
AC_SUBST(CURL_WITH_MULTI_SSL)
CURL_WITH_MULTI_SSL="1"
AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
2017-09-05 16:45:09 +08:00
AC_MSG_NOTICE([built with multiple SSL backends])
2017-08-18 14:51:24 +08:00
;;
esac
2007-02-13 06:32:37 +08:00
vtls: allow selecting which SSL backend to use at runtime
When building software for the masses, it is sometimes not possible to
decide for all users which SSL backend is appropriate.
Git for Windows, for example, uses cURL to perform clones, fetches and
pushes via HTTPS, and some users strongly prefer OpenSSL, while other
users really need to use Secure Channel because it offers
enterprise-ready tools to manage credentials via Windows' Credential
Store.
The current Git for Windows versions use the ugly work-around of
building libcurl once with OpenSSL support and once with Secure Channel
support, and switching out the binaries in the installer depending on
the user's choice.
Needless to say, this is a super ugly workaround that actually only
works in some cases: Git for Windows also comes in a portable form, and
in a form intended for third-party applications requiring Git
functionality, in which cases this "swap out libcurl-4.dll" simply is
not an option.
Therefore, the Git for Windows project has a vested interest in teaching
cURL to make the SSL backend a *runtime* option.
This patch makes that possible.
By running ./configure with multiple --with-<backend> options, cURL will
be built with multiple backends.
For the moment, the backend can be configured using the environment
variable CURL_SSL_BACKEND (valid values are e.g. "openssl" and
"schannel").
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-06-14 22:56:00 +08:00
if test -n "$ssl_backends"; then
curl_ssl_msg="enabled ($ssl_backends)"
fi
2017-08-25 04:26:48 +08:00
if test no = "$VALID_DEFAULT_SSL_BACKEND"
then
if test -n "$SSL_ENABLED"
then
AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
else
AC_MSG_ERROR([Default SSL backend requires SSL!])
fi
elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
then
AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
fi
2005-04-20 06:23:37 +08:00
dnl **********************************************************************
dnl Check for the CA bundle
dnl **********************************************************************
2019-08-11 10:14:01 +08:00
if test -n "$check_for_ca_bundle"; then
2018-05-03 20:54:10 +08:00
CURL_CHECK_CA_BUNDLE
fi
2005-04-20 06:23:37 +08:00
2015-09-29 17:33:01 +08:00
dnl **********************************************************************
dnl Check for libpsl
dnl **********************************************************************
AC_ARG_WITH(libpsl,
AS_HELP_STRING([--without-libpsl],
[disable support for libpsl cookie checking]),
with_libpsl=$withval,
with_libpsl=yes)
if test $with_libpsl != "no"; then
AC_SEARCH_LIBS(psl_builtin, psl,
2019-03-03 18:17:52 +08:00
[curl_psl_msg="enabled";
2015-09-29 17:33:01 +08:00
AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
],
[curl_psl_msg="no (libpsl not found)";
AC_MSG_WARN([libpsl was not found])
]
)
fi
2019-03-03 18:17:52 +08:00
AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
2015-09-29 17:33:01 +08:00
2020-12-25 02:48:45 +08:00
dnl **********************************************************************
dnl Check for libgsasl
dnl **********************************************************************
AC_ARG_WITH(libgsasl,
AS_HELP_STRING([--without-libgsasl],
[disable libgsasl support for SCRAM]),
with_libgsasl=$withval,
with_libgsasl=yes)
if test $with_libgsasl != "no"; then
AC_SEARCH_LIBS(gsasl_init, gsasl,
[curl_gsasl_msg="enabled";
AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
],
[curl_gsasl_msg="no (libgsasl not found)";
AC_MSG_WARN([libgsasl was not found])
]
)
fi
AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
2021-06-01 22:24:00 +08:00
AC_ARG_WITH(libmetalink,,
2023-06-23 06:15:46 +08:00
AC_MSG_ERROR([--with-libmetalink and --without-libmetalink no longer work!]))
2012-04-26 21:59:52 +08:00
2009-09-16 11:19:39 +08:00
dnl **********************************************************************
dnl Check for the presence of LIBSSH2 libraries and headers
dnl **********************************************************************
dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
OPT_LIBSSH2=off
AC_ARG_WITH(libssh2,dnl
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AS_HELP_STRING([--with-libssh2], [enable libssh2]),
2017-10-23 19:49:23 +08:00
OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
OPT_LIBSSH=off
AC_ARG_WITH(libssh,dnl
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AS_HELP_STRING([--with-libssh], [enable libssh]),
2017-10-23 19:49:23 +08:00
OPT_LIBSSH=$withval, OPT_LIBSSH=no)
2009-09-16 11:19:39 +08:00
2020-01-05 17:51:39 +08:00
OPT_WOLFSSH=off
AC_ARG_WITH(wolfssh,dnl
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AS_HELP_STRING([--with-wolfssh], [enable wolfssh]),
2020-01-05 17:51:39 +08:00
OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
2009-09-16 11:19:39 +08:00
if test X"$OPT_LIBSSH2" != Xno; then
dnl backup the pre-libssh2 variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
case "$OPT_LIBSSH2" in
yes)
dnl --with-libssh2 (without path) used
2009-10-21 22:56:25 +08:00
CURL_CHECK_PKGCONFIG(libssh2)
if test "$PKGCONFIG" != "no" ; then
2023-07-29 05:27:20 +08:00
LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
2009-10-21 22:56:25 +08:00
LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
version=`$PKGCONFIG --modversion libssh2`
2020-06-05 00:11:36 +08:00
DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
2009-10-21 22:56:25 +08:00
fi
2010-01-13 09:13:23 +08:00
2009-09-16 11:19:39 +08:00
;;
off)
dnl no --with-libssh2 option given, just check default places
;;
*)
dnl use the given --with-libssh2 spot
2009-10-21 22:56:25 +08:00
PREFIX_SSH2=$OPT_LIBSSH2
2009-09-16 11:19:39 +08:00
;;
esac
2009-10-21 22:56:25 +08:00
dnl if given with a prefix, we set -L and -I based on that
if test -n "$PREFIX_SSH2"; then
2011-04-13 04:10:29 +08:00
LIB_SSH2="-lssh2"
2009-10-28 08:33:28 +08:00
LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
2009-10-21 22:56:25 +08:00
CPP_SSH2=-I${PREFIX_SSH2}/include
2009-10-28 08:33:28 +08:00
DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
2009-10-21 22:56:25 +08:00
fi
2017-04-24 15:13:28 +08:00
LDFLAGS="$LDFLAGS $LD_SSH2"
2009-10-21 22:56:25 +08:00
CPPFLAGS="$CPPFLAGS $CPP_SSH2"
2012-12-04 05:40:26 +08:00
LIBS="$LIB_SSH2 $LIBS"
2009-10-21 22:56:25 +08:00
2020-10-22 18:29:21 +08:00
dnl check for function added in libssh2 version 1.0
AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
2009-09-16 11:19:39 +08:00
tidy-up: delete parallel/unused feature flags
Detecting headers and lib separately makes sense when headers come in
variations or with extra ones, but this wasn't the case here. These were
duplicate/parallel macros that we had to keep in sync with each other
for a working build. This patch leaves a single macro for each of these
dependencies:
- Rely on `HAVE_LIBZ`, delete parallel `HAVE_ZLIB_H`.
Also delete CMake logic making sure these two were in sync, along with
a toggle to turn off that logic, called `CURL_SPECIAL_LIBZ`.
Also delete stray `HAVE_ZLIB` defines.
There is also a `USE_ZLIB` variant in `lib/config-dos.h`. This patch
retains it for compatibility and deprecates it.
- Rely on `USE_LIBSSH2`, delete parallel `HAVE_LIBSSH2_H`.
Also delete `LIBSSH2_WIN32`, `LIBSSH2_LIBRARY` from
`winbuild/MakefileBuild.vc`, these have a role when building libssh2
itself. And `CURL_USE_LIBSSH`, which had no use at all.
Also delete stray `HAVE_LIBSSH2` defines.
- Rely on `USE_LIBSSH`, delete parallel `HAVE_LIBSSH_LIBSSH_H`.
Also delete `LIBSSH_WIN32`, `LIBSSH_LIBRARY` and `HAVE_LIBSSH` from
`winbuild/MakefileBuild.vc`, these were the result of copy-pasting the
libssh2 line, and were not having any use.
- Delete unused `HAVE_LIBPSL_H` and `HAVE_LIBPSL`.
Reviewed-by: Daniel Stenberg
Closes #9652
2022-10-06 23:30:13 +08:00
AC_CHECK_HEADER(libssh2.h,
2009-09-16 11:19:39 +08:00
curl_ssh_msg="enabled (libSSH2)"
LIBSSH2_ENABLED=1
AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
AC_SUBST(USE_LIBSSH2, [1])
)
if test X"$OPT_LIBSSH2" != Xoff &&
test "$LIBSSH2_ENABLED" != "1"; then
AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
fi
if test "$LIBSSH2_ENABLED" = "1"; then
2009-10-28 08:33:28 +08:00
if test -n "$DIR_SSH2"; then
2009-09-16 11:19:39 +08:00
dnl when the libssh2 shared libs were found in a path that the run-time
2018-04-13 20:07:39 +08:00
dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2009-09-16 11:19:39 +08:00
dnl to prevent further configure tests to fail due to this
2012-02-09 22:45:22 +08:00
if test "x$cross_compiling" != "xyes"; then
2018-04-13 20:07:39 +08:00
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
2012-02-09 22:45:22 +08:00
fi
2009-09-16 11:19:39 +08:00
fi
else
dnl no libssh2, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
fi
2017-10-23 19:49:23 +08:00
elif test X"$OPT_LIBSSH" != Xno; then
dnl backup the pre-libssh variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
case "$OPT_LIBSSH" in
yes)
dnl --with-libssh (without path) used
CURL_CHECK_PKGCONFIG(libssh)
if test "$PKGCONFIG" != "no" ; then
LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
LD_SSH=`$PKGCONFIG --libs-only-L libssh`
CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
version=`$PKGCONFIG --modversion libssh`
2020-06-05 00:11:36 +08:00
DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
2017-10-23 19:49:23 +08:00
fi
;;
off)
dnl no --with-libssh option given, just check default places
;;
*)
dnl use the given --with-libssh spot
PREFIX_SSH=$OPT_LIBSSH
;;
esac
dnl if given with a prefix, we set -L and -I based on that
if test -n "$PREFIX_SSH"; then
LIB_SSH="-lssh"
LD_SSH=-L${PREFIX_SSH}/lib$libsuff
CPP_SSH=-I${PREFIX_SSH}/include
2017-12-11 05:30:06 +08:00
DIR_SSH=${PREFIX_SSH}/lib$libsuff
2017-10-23 19:49:23 +08:00
fi
LDFLAGS="$LDFLAGS $LD_SSH"
CPPFLAGS="$CPPFLAGS $CPP_SSH"
LIBS="$LIB_SSH $LIBS"
AC_CHECK_LIB(ssh, ssh_new)
tidy-up: delete parallel/unused feature flags
Detecting headers and lib separately makes sense when headers come in
variations or with extra ones, but this wasn't the case here. These were
duplicate/parallel macros that we had to keep in sync with each other
for a working build. This patch leaves a single macro for each of these
dependencies:
- Rely on `HAVE_LIBZ`, delete parallel `HAVE_ZLIB_H`.
Also delete CMake logic making sure these two were in sync, along with
a toggle to turn off that logic, called `CURL_SPECIAL_LIBZ`.
Also delete stray `HAVE_ZLIB` defines.
There is also a `USE_ZLIB` variant in `lib/config-dos.h`. This patch
retains it for compatibility and deprecates it.
- Rely on `USE_LIBSSH2`, delete parallel `HAVE_LIBSSH2_H`.
Also delete `LIBSSH2_WIN32`, `LIBSSH2_LIBRARY` from
`winbuild/MakefileBuild.vc`, these have a role when building libssh2
itself. And `CURL_USE_LIBSSH`, which had no use at all.
Also delete stray `HAVE_LIBSSH2` defines.
- Rely on `USE_LIBSSH`, delete parallel `HAVE_LIBSSH_LIBSSH_H`.
Also delete `LIBSSH_WIN32`, `LIBSSH_LIBRARY` and `HAVE_LIBSSH` from
`winbuild/MakefileBuild.vc`, these were the result of copy-pasting the
libssh2 line, and were not having any use.
- Delete unused `HAVE_LIBPSL_H` and `HAVE_LIBPSL`.
Reviewed-by: Daniel Stenberg
Closes #9652
2022-10-06 23:30:13 +08:00
AC_CHECK_HEADER(libssh/libssh.h,
2017-10-23 19:49:23 +08:00
curl_ssh_msg="enabled (libSSH)"
LIBSSH_ENABLED=1
AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
AC_SUBST(USE_LIBSSH, [1])
)
if test X"$OPT_LIBSSH" != Xoff &&
test "$LIBSSH_ENABLED" != "1"; then
AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
fi
if test "$LIBSSH_ENABLED" = "1"; then
if test -n "$DIR_SSH"; then
dnl when the libssh shared libs were found in a path that the run-time
2018-04-13 20:07:39 +08:00
dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
2017-10-23 19:49:23 +08:00
dnl to prevent further configure tests to fail due to this
if test "x$cross_compiling" != "xyes"; then
2018-04-13 20:07:39 +08:00
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
2017-10-23 19:49:23 +08:00
fi
fi
else
dnl no libssh, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
fi
2020-01-05 17:51:39 +08:00
elif test X"$OPT_WOLFSSH" != Xno; then
dnl backup the pre-wolfssh variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
if test "$OPT_WOLFSSH" != yes; then
WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
fi
AC_CHECK_LIB(wolfssh, wolfSSH_Init)
AC_CHECK_HEADERS(wolfssh/ssh.h,
curl_ssh_msg="enabled (wolfSSH)"
WOLFSSH_ENABLED=1
AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
AC_SUBST(USE_WOLFSSH, [1])
)
2009-09-16 11:19:39 +08:00
fi
2010-05-13 05:07:20 +08:00
dnl **********************************************************************
dnl Check for the presence of LIBRTMP libraries and headers
dnl **********************************************************************
dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
OPT_LIBRTMP=off
AC_ARG_WITH(librtmp,dnl
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
2010-05-13 05:07:20 +08:00
OPT_LIBRTMP=$withval)
if test X"$OPT_LIBRTMP" != Xno; then
dnl backup the pre-librtmp variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
case "$OPT_LIBRTMP" in
yes)
dnl --with-librtmp (without path) used
CURL_CHECK_PKGCONFIG(librtmp)
if test "$PKGCONFIG" != "no" ; then
LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
version=`$PKGCONFIG --modversion librtmp`
2020-06-05 00:11:36 +08:00
DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
2010-11-18 13:13:49 +08:00
else
dnl To avoid link errors, we do not allow --librtmp without
dnl a pkgconfig file
AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
2010-05-13 05:07:20 +08:00
fi
;;
off)
dnl no --with-librtmp option given, just check default places
2010-09-21 05:20:36 +08:00
LIB_RTMP="-lrtmp"
2010-05-13 05:07:20 +08:00
;;
*)
dnl use the given --with-librtmp spot
2017-06-08 05:34:24 +08:00
LIB_RTMP="-lrtmp"
2010-05-13 05:07:20 +08:00
PREFIX_RTMP=$OPT_LIBRTMP
;;
esac
dnl if given with a prefix, we set -L and -I based on that
if test -n "$PREFIX_RTMP"; then
LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
CPP_RTMP=-I${PREFIX_RTMP}/include
DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
fi
LDFLAGS="$LDFLAGS $LD_RTMP"
CPPFLAGS="$CPPFLAGS $CPP_RTMP"
2012-12-04 05:40:26 +08:00
LIBS="$LIB_RTMP $LIBS"
2010-05-13 05:07:20 +08:00
2010-09-21 05:20:36 +08:00
AC_CHECK_LIB(rtmp, RTMP_Init,
[
AC_CHECK_HEADERS(librtmp/rtmp.h,
curl_rtmp_msg="enabled (librtmp)"
LIBRTMP_ENABLED=1
AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
AC_SUBST(USE_LIBRTMP, [1])
)
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
2010-05-13 05:07:20 +08:00
)
if test X"$OPT_LIBRTMP" != Xoff &&
test "$LIBRTMP_ENABLED" != "1"; then
AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
fi
fi
2011-12-16 22:33:48 +08:00
dnl **********************************************************************
dnl Check for linker switch for versioned symbols
dnl **********************************************************************
versioned_symbols_flavour=
2012-05-11 00:50:51 +08:00
AC_MSG_CHECKING([whether versioned symbols are wanted])
2011-12-16 22:33:48 +08:00
AC_ARG_ENABLE(versioned-symbols,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
2011-12-16 22:33:48 +08:00
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
2012-05-11 00:50:51 +08:00
AC_MSG_CHECKING([if libraries can be versioned])
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
if test -z "$GLD"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([You need an ld version supporting the --version-script option])
2011-12-16 22:33:48 +08:00
else
2012-05-11 00:50:51 +08:00
AC_MSG_RESULT(yes)
2017-08-25 04:33:19 +08:00
if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
versioned_symbols_flavour="MULTISSL_"
elif test "x$OPENSSL_ENABLED" = "x1"; then
2012-05-11 00:50:51 +08:00
versioned_symbols_flavour="OPENSSL_"
2014-02-23 21:32:51 +08:00
elif test "x$GNUTLS_ENABLED" = "x1"; then
2012-05-11 00:50:51 +08:00
versioned_symbols_flavour="GNUTLS_"
2019-06-02 22:55:05 +08:00
elif test "x$WOLFSSL_ENABLED" = "x1"; then
versioned_symbols_flavour="WOLFSSL_"
2020-08-07 23:11:52 +08:00
elif test "x$SCHANNEL_ENABLED" = "x1"; then
2019-02-26 16:21:12 +08:00
versioned_symbols_flavour="SCHANNEL_"
elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
versioned_symbols_flavour="SECURE_TRANSPORT_"
2012-05-11 00:50:51 +08:00
else
versioned_symbols_flavour=""
fi
versioned_symbols="yes"
2011-12-16 22:33:48 +08:00
fi
;;
*) AC_MSG_RESULT(no)
;;
esac
], [
AC_MSG_RESULT(no)
]
)
2013-03-08 20:26:08 +08:00
AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
["$versioned_symbols_flavour"])
AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
[test "x$versioned_symbols" = 'xyes'])
2011-12-16 22:33:48 +08:00
2022-04-20 21:26:13 +08:00
dnl Update .plist file with current version
AC_SUBST([CURL_PLIST_VERSION],
["$CURLVERSION"])
2012-07-27 09:19:21 +08:00
dnl -------------------------------------------------
dnl check winidn option before other IDN libraries
dnl -------------------------------------------------
AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
OPT_WINIDN="default"
AC_ARG_WITH(winidn,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
AS_HELP_STRING([--without-winidn], [disable Windows native IDN]),
2012-07-27 09:19:21 +08:00
OPT_WINIDN=$withval)
case "$OPT_WINIDN" in
no|default)
dnl --without-winidn option used or configure option not specified
want_winidn="no"
AC_MSG_RESULT([no])
;;
yes)
dnl --with-winidn option used without path
want_winidn="yes"
want_winidn_path="default"
AC_MSG_RESULT([yes])
;;
*)
dnl --with-winidn option used with path
want_winidn="yes"
want_winidn_path="$withval"
AC_MSG_RESULT([yes ($withval)])
;;
esac
if test "$want_winidn" = "yes"; then
dnl winidn library support has been requested
2021-08-17 14:24:48 +08:00
clean_CFLAGS="$CFLAGS"
2012-07-27 09:19:21 +08:00
clean_CPPFLAGS="$CPPFLAGS"
clean_LDFLAGS="$LDFLAGS"
clean_LIBS="$LIBS"
WINIDN_LIBS="-lnormaliz"
2021-08-17 14:24:48 +08:00
WINIDN_CPPFLAGS=""
2012-07-27 09:19:21 +08:00
#
if test "$want_winidn_path" != "default"; then
dnl path has been specified
dnl pkg-config not available or provides no info
WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
WINIDN_CPPFLAGS="-I$want_winidn_path/include"
WINIDN_DIR="$want_winidn_path/lib$libsuff"
fi
#
2021-08-17 14:24:48 +08:00
dnl WinIDN requires a minimum supported OS version of at least Vista (0x0600)
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <windows.h>
]],[[
#if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
#error
#endif
]])
],[
],[
CFLAGS=`echo $CFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
CFLAGS=`echo $CFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-DWINVER=[[^ ]]*//g'`
CPPFLAGS=`echo $CPPFLAGS | $SED -e 's/-D_WIN32_WINNT=[[^ ]]*//g'`
WINIDN_CPPFLAGS="$WINIDN_CPPFLAGS -DWINVER=0x0600"
])
#
2017-04-24 15:13:28 +08:00
CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
2012-07-27 09:19:21 +08:00
LIBS="$WINIDN_LIBS $LIBS"
#
AC_MSG_CHECKING([if IdnToUnicode can be linked])
AC_LINK_IFELSE([
2017-07-31 19:24:38 +08:00
AC_LANG_PROGRAM([[
#include <windows.h>
]],[[
IdnToUnicode(0, NULL, 0, NULL, 0);
]])
2012-07-27 09:19:21 +08:00
],[
AC_MSG_RESULT([yes])
tst_links_winidn="yes"
],[
AC_MSG_RESULT([no])
tst_links_winidn="no"
])
#
if test "$tst_links_winidn" = "yes"; then
AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
AC_SUBST([IDN_ENABLED], [1])
curl_idn_msg="enabled (Windows-native)"
else
AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
2021-08-17 14:24:48 +08:00
CFLAGS="$clean_CFLAGS"
2012-07-27 09:19:21 +08:00
CPPFLAGS="$clean_CPPFLAGS"
LDFLAGS="$clean_LDFLAGS"
LIBS="$clean_LIBS"
fi
fi
2011-12-16 22:33:48 +08:00
2007-02-17 16:49:04 +08:00
dnl **********************************************************************
dnl Check for the presence of IDN libraries and headers
dnl **********************************************************************
2016-10-12 15:01:06 +08:00
AC_MSG_CHECKING([whether to build with libidn2])
2011-11-30 02:11:34 +08:00
OPT_IDN="default"
2016-12-25 08:13:12 +08:00
AC_ARG_WITH(libidn2,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
2011-11-30 02:11:34 +08:00
[OPT_IDN=$withval])
2022-05-29 15:20:39 +08:00
if test "x$tst_links_winidn" = "xyes"; then
want_idn="no"
AC_MSG_RESULT([no (using winidn instead)])
else
case "$OPT_IDN" in
no)
dnl --without-libidn2 option used
want_idn="no"
AC_MSG_RESULT([no])
;;
default)
dnl configure option not specified
want_idn="yes"
want_idn_path="default"
AC_MSG_RESULT([(assumed) yes])
;;
yes)
dnl --with-libidn2 option used without path
want_idn="yes"
want_idn_path="default"
AC_MSG_RESULT([yes])
;;
*)
dnl --with-libidn2 option used with path
want_idn="yes"
want_idn_path="$withval"
AC_MSG_RESULT([yes ($withval)])
;;
esac
fi
2004-04-26 20:29:30 +08:00
2011-11-30 02:11:34 +08:00
if test "$want_idn" = "yes"; then
dnl idn library support has been requested
clean_CPPFLAGS="$CPPFLAGS"
clean_LDFLAGS="$LDFLAGS"
clean_LIBS="$LIBS"
PKGCONFIG="no"
#
if test "$want_idn_path" != "default"; then
dnl path has been specified
IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
2016-10-12 15:01:06 +08:00
CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
2011-11-30 02:11:34 +08:00
if test "$PKGCONFIG" != "no"; then
IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2016-10-12 15:01:06 +08:00
$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
2011-11-30 02:11:34 +08:00
IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2016-10-12 15:01:06 +08:00
$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
2011-11-30 02:11:34 +08:00
IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
2016-10-12 15:01:06 +08:00
$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2020-06-05 00:11:36 +08:00
IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2011-11-30 02:11:34 +08:00
else
dnl pkg-config not available or provides no info
2016-10-12 15:01:06 +08:00
IDN_LIBS="-lidn2"
2011-11-30 02:11:34 +08:00
IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
IDN_CPPFLAGS="-I$want_idn_path/include"
IDN_DIR="$want_idn_path/lib$libsuff"
fi
else
dnl path not specified
2016-10-12 15:01:06 +08:00
CURL_CHECK_PKGCONFIG(libidn2)
2011-11-30 02:11:34 +08:00
if test "$PKGCONFIG" != "no"; then
2016-10-12 15:01:06 +08:00
IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
2020-06-05 00:11:36 +08:00
IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
2011-11-30 02:11:34 +08:00
else
dnl pkg-config not available or provides no info
2016-10-12 15:01:06 +08:00
IDN_LIBS="-lidn2"
2011-11-30 02:11:34 +08:00
fi
fi
#
if test "$PKGCONFIG" != "no"; then
AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
else
AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
fi
#
2017-04-24 15:13:28 +08:00
CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
2011-11-30 02:11:34 +08:00
LIBS="$IDN_LIBS $LIBS"
#
2016-10-12 15:01:06 +08:00
AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
2011-11-30 02:11:34 +08:00
AC_LINK_IFELSE([
2016-10-12 15:01:06 +08:00
AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
2011-11-30 02:11:34 +08:00
],[
AC_MSG_RESULT([yes])
tst_links_libidn="yes"
],[
AC_MSG_RESULT([no])
tst_links_libidn="no"
])
#
2016-10-12 15:01:06 +08:00
AC_CHECK_HEADERS( idn2.h )
2011-11-30 02:11:34 +08:00
if test "$tst_links_libidn" = "yes"; then
2016-10-12 15:01:06 +08:00
AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
2011-11-30 02:11:34 +08:00
dnl different versions of libidn have different setups of these:
2016-10-12 15:01:06 +08:00
AC_SUBST([IDN_ENABLED], [1])
curl_idn_msg="enabled (libidn2)"
if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
2018-04-13 20:07:39 +08:00
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
2011-11-30 02:11:34 +08:00
fi
else
AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
CPPFLAGS="$clean_CPPFLAGS"
LDFLAGS="$clean_LDFLAGS"
LIBS="$clean_LIBS"
fi
fi
2013-09-03 05:14:23 +08:00
dnl **********************************************************************
dnl Check for nghttp2
dnl **********************************************************************
2014-05-22 14:56:02 +08:00
OPT_H2="yes"
2017-06-16 06:02:36 +08:00
2021-10-26 18:56:26 +08:00
if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
# without HTTP or with Hyper, nghttp2 is no use
2017-06-16 06:02:36 +08:00
OPT_H2="no"
fi
2013-09-03 05:14:23 +08:00
AC_ARG_WITH(nghttp2,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
2013-09-03 05:14:23 +08:00
[OPT_H2=$withval])
case "$OPT_H2" in
no)
dnl --without-nghttp2 option used
2021-10-26 18:56:26 +08:00
want_nghttp2="no"
2013-09-03 05:14:23 +08:00
;;
yes)
dnl --with-nghttp2 option used without path
2021-10-26 18:56:26 +08:00
want_nghttp2="default"
want_nghttp2_path=""
2022-01-28 23:31:18 +08:00
want_nghttp2_pkg_config_path=""
2013-09-03 05:14:23 +08:00
;;
*)
dnl --with-nghttp2 option used with path
2021-10-26 18:56:26 +08:00
want_nghttp2="yes"
2022-01-28 23:31:18 +08:00
want_nghttp2_path="$withval"
want_nghttp2_pkg_config_path="$withval/lib/pkgconfig"
2013-09-03 05:14:23 +08:00
;;
esac
2021-10-26 18:56:26 +08:00
if test X"$want_nghttp2" != Xno; then
2014-04-22 02:12:20 +08:00
dnl backup the pre-nghttp2 variables
2013-09-03 05:14:23 +08:00
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
2022-01-28 23:31:18 +08:00
CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path)
2013-09-03 05:14:23 +08:00
if test "$PKGCONFIG" != "no" ; then
2022-01-28 23:31:18 +08:00
LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2013-09-03 05:14:23 +08:00
$PKGCONFIG --libs-only-l libnghttp2`
AC_MSG_NOTICE([-l is $LIB_H2])
2022-01-28 23:31:18 +08:00
CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl
2013-09-03 05:14:23 +08:00
$PKGCONFIG --cflags-only-I libnghttp2`
AC_MSG_NOTICE([-I is $CPP_H2])
2022-01-28 23:31:18 +08:00
LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path])
2013-09-03 05:14:23 +08:00
$PKGCONFIG --libs-only-L libnghttp2`
AC_MSG_NOTICE([-L is $LD_H2])
2022-01-28 23:31:18 +08:00
DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'`
elif test x"$want_nghttp2_path" != x; then
LIB_H2="-lnghttp2"
LD_H2=-L${want_nghttp2_path}/lib$libsuff
CPP_H2=-I${want_nghttp2_path}/include
DIR_H2=${want_nghttp2_path}/lib$libsuff
elif test X"$want_nghttp2" != Xdefault; then
dnl no nghttp2 pkg-config found and no custom directory specified,
dnl deal with it
AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
2023-05-26 16:03:51 +08:00
else
LIB_H2="-lnghttp2"
2022-01-28 23:31:18 +08:00
fi
2013-09-03 05:14:23 +08:00
2022-01-28 23:31:18 +08:00
LDFLAGS="$LDFLAGS $LD_H2"
CPPFLAGS="$CPPFLAGS $CPP_H2"
LIBS="$LIB_H2 $LIBS"
2013-09-03 05:14:23 +08:00
2023-07-19 21:48:05 +08:00
# use nghttp2_session_get_stream_local_window_size to require nghttp2
# >= 1.15.0
AC_CHECK_LIB(nghttp2, nghttp2_session_get_stream_local_window_size,
2022-01-28 23:31:18 +08:00
[
AC_CHECK_HEADERS(nghttp2/nghttp2.h,
curl_h2_msg="enabled (nghttp2)"
NGHTTP2_ENABLED=1
AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
AC_SUBST(USE_NGHTTP2, [1])
)
2013-09-03 05:14:23 +08:00
2022-01-28 23:31:18 +08:00
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH])
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
2013-09-03 05:14:23 +08:00
fi
2019-07-22 05:48:58 +08:00
dnl **********************************************************************
dnl Check for ngtcp2 (QUIC)
dnl **********************************************************************
2022-10-05 16:30:04 +08:00
OPT_TCP2="no"
2019-07-22 05:48:58 +08:00
if test "x$disable_http" = "xyes"; then
# without HTTP, ngtcp2 is no use
OPT_TCP2="no"
fi
AC_ARG_WITH(ngtcp2,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
2019-07-22 05:48:58 +08:00
[OPT_TCP2=$withval])
case "$OPT_TCP2" in
no)
dnl --without-ngtcp2 option used
want_tcp2="no"
;;
yes)
dnl --with-ngtcp2 option used without path
want_tcp2="default"
want_tcp2_path=""
;;
*)
dnl --with-ngtcp2 option used with path
want_tcp2="yes"
want_tcp2_path="$withval/lib/pkgconfig"
;;
esac
2020-09-29 17:01:45 +08:00
curl_tcp2_msg="no (--with-ngtcp2)"
2019-07-22 05:48:58 +08:00
if test X"$want_tcp2" != Xno; then
dnl backup the pre-ngtcp2 variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
if test "$PKGCONFIG" != "no" ; then
LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-l libngtcp2`
AC_MSG_NOTICE([-l is $LIB_TCP2])
CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
$PKGCONFIG --cflags-only-I libngtcp2`
AC_MSG_NOTICE([-I is $CPP_TCP2])
LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-L libngtcp2`
AC_MSG_NOTICE([-L is $LD_TCP2])
LDFLAGS="$LDFLAGS $LD_TCP2"
CPPFLAGS="$CPPFLAGS $CPP_TCP2"
LIBS="$LIB_TCP2 $LIBS"
if test "x$cross_compiling" != "xyes"; then
2020-06-05 00:11:36 +08:00
DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
2019-07-22 05:48:58 +08:00
fi
2021-09-12 14:27:33 +08:00
AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned,
2019-07-22 05:48:58 +08:00
[
AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
NGTCP2_ENABLED=1
AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
AC_SUBST(USE_NGTCP2, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
)
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
else
dnl no ngtcp2 pkg-config found, deal with it
if test X"$want_tcp2" != Xdefault; then
dnl To avoid link errors, we do not allow --with-ngtcp2 without
dnl a pkgconfig file
AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
fi
fi
fi
2020-03-26 05:49:02 +08:00
if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
2023-07-12 17:26:28 +08:00
dnl backup the pre-ngtcp2_crypto_quictls variables
2019-08-27 21:00:34 +08:00
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
2023-07-12 17:26:28 +08:00
CURL_CHECK_PKGCONFIG(libngtcp2_crypto_quictls, $want_tcp2_path)
2019-08-27 21:00:34 +08:00
if test "$PKGCONFIG" != "no" ; then
2023-07-12 17:26:28 +08:00
LIB_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-l libngtcp2_crypto_quictls`
AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_QUICTLS])
2019-08-27 21:00:34 +08:00
2023-07-12 17:26:28 +08:00
CPP_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
$PKGCONFIG --cflags-only-I libngtcp2_crypto_quictls`
AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_QUICTLS])
2019-08-27 21:00:34 +08:00
2023-07-12 17:26:28 +08:00
LD_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-L libngtcp2_crypto_quictls`
AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_QUICTLS])
2019-08-27 21:00:34 +08:00
2023-07-12 17:26:28 +08:00
LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS"
CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS"
LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS"
2019-08-27 21:00:34 +08:00
if test "x$cross_compiling" != "xyes"; then
2023-07-12 17:26:28 +08:00
DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'`
2019-08-27 21:00:34 +08:00
fi
2023-07-12 17:26:28 +08:00
AC_CHECK_LIB(ngtcp2_crypto_quictls, ngtcp2_crypto_recv_client_initial_cb,
2019-08-27 21:00:34 +08:00
[
AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
NGTCP2_ENABLED=1
2023-07-12 17:26:28 +08:00
AC_DEFINE(USE_NGTCP2_CRYPTO_QUICTLS, 1, [if ngtcp2_crypto_quictls is in use])
AC_SUBST(USE_NGTCP2_CRYPTO_QUICTLS, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS"
2019-08-27 21:00:34 +08:00
export CURL_LIBRARY_PATH
2023-07-12 17:26:28 +08:00
AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH])
2019-08-27 21:00:34 +08:00
)
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
else
2023-07-12 17:26:28 +08:00
dnl no ngtcp2_crypto_quictls pkg-config found, deal with it
2019-08-27 21:00:34 +08:00
if test X"$want_tcp2" != Xdefault; then
dnl To avoid link errors, we do not allow --with-ngtcp2 without
dnl a pkgconfig file
2023-07-12 17:26:28 +08:00
AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_quictls pkg-config file.])
2019-08-27 21:00:34 +08:00
fi
fi
fi
2020-03-26 05:49:02 +08:00
if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
dnl backup the pre-ngtcp2_crypto_gnutls variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
if test "$PKGCONFIG" != "no" ; then
LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
$PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
if test "x$cross_compiling" != "xyes"; then
2020-06-05 00:11:36 +08:00
DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
2020-03-26 05:49:02 +08:00
fi
2022-02-02 06:44:26 +08:00
AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb,
2020-03-26 05:49:02 +08:00
[
AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
NGTCP2_ENABLED=1
AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
)
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
else
dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
if test X"$want_tcp2" != Xdefault; then
dnl To avoid link errors, we do not allow --with-ngtcp2 without
dnl a pkgconfig file
AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
fi
fi
fi
2022-08-10 16:06:52 +08:00
if test "x$NGTCP2_ENABLED" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then
dnl backup the pre-ngtcp2_crypto_wolfssl variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path)
if test "$PKGCONFIG" != "no" ; then
LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl`
AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL])
CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
$PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl`
AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL])
LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
$PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl`
AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL])
LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL"
CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL"
LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS"
if test "x$cross_compiling" != "xyes"; then
DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'`
fi
AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb,
[
AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
NGTCP2_ENABLED=1
AC_DEFINE(USE_NGTCP2_CRYPTO_WOLFSSL, 1, [if ngtcp2_crypto_wolfssl is in use])
AC_SUBST(USE_NGTCP2_CRYPTO_WOLFSSL, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH])
)
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
else
dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it
if test X"$want_tcp2" != Xdefault; then
dnl To avoid link errors, we do not allow --with-ngtcp2 without
dnl a pkgconfig file
AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.])
fi
fi
fi
2019-08-11 05:19:55 +08:00
dnl **********************************************************************
dnl Check for nghttp3 (HTTP/3 with ngtcp2)
dnl **********************************************************************
OPT_NGHTTP3="yes"
if test "x$NGTCP2_ENABLED" = "x"; then
# without ngtcp2, nghttp3 is of no use for us
OPT_NGHTTP3="no"
fi
AC_ARG_WITH(nghttp3,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
2019-08-11 05:19:55 +08:00
[OPT_NGHTTP3=$withval])
case "$OPT_NGHTTP3" in
no)
dnl --without-nghttp3 option used
want_nghttp3="no"
;;
yes)
dnl --with-nghttp3 option used without path
want_nghttp3="default"
want_nghttp3_path=""
;;
*)
dnl --with-nghttp3 option used with path
want_nghttp3="yes"
want_nghttp3_path="$withval/lib/pkgconfig"
;;
esac
2020-09-29 17:01:45 +08:00
curl_http3_msg="no (--with-nghttp3)"
2019-08-11 05:19:55 +08:00
if test X"$want_nghttp3" != Xno; then
dnl backup the pre-nghttp3 variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
if test "$PKGCONFIG" != "no" ; then
LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
$PKGCONFIG --libs-only-l libnghttp3`
AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
$PKGCONFIG --cflags-only-I libnghttp3`
AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
$PKGCONFIG --libs-only-L libnghttp3`
AC_MSG_NOTICE([-L is $LD_NGHTTP3])
LDFLAGS="$LDFLAGS $LD_NGHTTP3"
CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
LIBS="$LIB_NGHTTP3 $LIBS"
if test "x$cross_compiling" != "xyes"; then
2020-06-05 00:11:36 +08:00
DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
2019-08-11 05:19:55 +08:00
fi
2021-09-12 14:27:33 +08:00
AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned,
2019-08-11 05:19:55 +08:00
[
AC_CHECK_HEADERS(nghttp3/nghttp3.h,
curl_h3_msg="enabled (ngtcp2 + nghttp3)"
NGHTTP3_ENABLED=1
AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
AC_SUBST(USE_NGHTTP3, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
experimental="$experimental HTTP3"
)
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
else
dnl no nghttp3 pkg-config found, deal with it
if test X"$want_nghttp3" != Xdefault; then
dnl To avoid link errors, we do not allow --with-nghttp3 without
dnl a pkgconfig file
AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
fi
fi
fi
2019-07-22 05:48:58 +08:00
dnl **********************************************************************
dnl Check for quiche (QUIC)
dnl **********************************************************************
2021-02-24 18:26:52 +08:00
OPT_QUICHE="no"
2019-07-22 05:48:58 +08:00
if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
# without HTTP or with ngtcp2, quiche is no use
OPT_QUICHE="no"
fi
AC_ARG_WITH(quiche,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
AS_HELP_STRING([--without-quiche],[Disable quiche usage]),
2019-07-22 05:48:58 +08:00
[OPT_QUICHE=$withval])
case "$OPT_QUICHE" in
2019-08-18 22:03:51 +08:00
no)
dnl --without-quiche option used
want_quiche="no"
;;
yes)
2019-07-22 05:48:58 +08:00
dnl --with-quiche option used without path
want_quiche="default"
want_quiche_path=""
;;
2019-08-18 22:03:51 +08:00
*)
dnl --with-quiche option used with path
want_quiche="yes"
want_quiche_path="$withval"
2019-07-22 05:48:58 +08:00
;;
esac
if test X"$want_quiche" != Xno; then
2021-08-09 16:44:56 +08:00
if test "$NGHTTP3_ENABLED" = 1; then
AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive])
fi
2019-07-22 05:48:58 +08:00
dnl backup the pre-quiche variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
2019-08-18 22:03:51 +08:00
CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
2019-07-22 05:48:58 +08:00
2019-08-18 22:03:51 +08:00
if test "$PKGCONFIG" != "no" ; then
LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
$PKGCONFIG --libs-only-l quiche`
AC_MSG_NOTICE([-l is $LIB_QUICHE])
CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
$PKGCONFIG --cflags-only-I quiche`
AC_MSG_NOTICE([-I is $CPP_QUICHE])
LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
$PKGCONFIG --libs-only-L quiche`
AC_MSG_NOTICE([-L is $LD_QUICHE])
2019-07-22 05:48:58 +08:00
2019-08-18 22:03:51 +08:00
LDFLAGS="$LDFLAGS $LD_QUICHE"
CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
LIBS="$LIB_QUICHE $LIBS"
if test "x$cross_compiling" != "xyes"; then
2020-06-05 00:11:36 +08:00
DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
2019-08-18 22:03:51 +08:00
fi
2023-04-04 16:47:35 +08:00
AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting,
2019-08-18 22:03:51 +08:00
[
AC_CHECK_HEADERS(quiche.h,
experimental="$experimental HTTP3"
AC_MSG_NOTICE([HTTP3 support is experimental])
curl_h3_msg="enabled (quiche)"
QUICHE_ENABLED=1
AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
AC_SUBST(USE_QUICHE, [1])
2020-05-05 00:57:34 +08:00
AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
2019-08-18 22:03:51 +08:00
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
2021-05-24 20:20:36 +08:00
[],
[
AC_INCLUDES_DEFAULT
#include <sys/socket.h>
]
2019-08-18 22:03:51 +08:00
)
],
dnl not found, revert back to clean variables
2021-02-24 18:26:52 +08:00
AC_MSG_ERROR([couldn't use quiche])
2019-08-18 22:03:51 +08:00
)
else
2020-02-08 22:28:33 +08:00
dnl no quiche pkg-config found, deal with it
2019-08-18 22:03:51 +08:00
if test X"$want_quiche" != Xdefault; then
2020-02-08 22:28:33 +08:00
dnl To avoid link errors, we do not allow --with-quiche without
2019-08-18 22:03:51 +08:00
dnl a pkgconfig file
AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
fi
2019-07-22 05:48:58 +08:00
fi
fi
2022-04-11 00:21:37 +08:00
dnl **********************************************************************
dnl Check for msh3 (QUIC)
dnl **********************************************************************
OPT_MSH3="no"
if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
# without HTTP or with ngtcp2, msh3 is no use
OPT_MSH3="no"
fi
AC_ARG_WITH(msh3,
AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage])
AS_HELP_STRING([--without-msh3],[Disable msh3 usage]),
[OPT_MSH3=$withval])
case "$OPT_MSH3" in
no)
dnl --without-msh3 option used
want_msh3="no"
;;
yes)
dnl --with-msh3 option used without path
want_msh3="default"
want_msh3_path=""
;;
*)
dnl --with-msh3 option used with path
want_msh3="yes"
want_msh3_path="$withval"
;;
esac
if test X"$want_msh3" != Xno; then
if test "$NGHTTP3_ENABLED" = 1; then
AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive])
fi
dnl backup the pre-msh3 variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
if test -n "$want_msh3_path"; then
LD_MSH3="-L$want_msh3_path/lib"
CPP_MSH3="-I$want_msh3_path/include"
DIR_MSH3="$want_msh3_path/lib"
LDFLAGS="$LDFLAGS $LD_MSH3"
CPPFLAGS="$CPPFLAGS $CPP_MSH3"
fi
LIBS="-lmsh3 $LIBS"
AC_CHECK_LIB(msh3, MsH3ApiOpen,
[
AC_CHECK_HEADERS(msh3.h,
curl_h3_msg="enabled (msh3)"
MSH3_ENABLED=1
AC_DEFINE(USE_MSH3, 1, [if msh3 is in use])
AC_SUBST(USE_MSH3, [1])
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3"
export CURL_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]),
experimental="$experimental HTTP3"
)
],
dnl not found, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
fi
2015-11-20 12:56:10 +08:00
dnl **********************************************************************
dnl Check for zsh completion path
dnl **********************************************************************
OPT_ZSH_FPATH=default
AC_ARG_WITH(zsh-functions-dir,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
2015-11-20 12:56:10 +08:00
[OPT_ZSH_FPATH=$withval])
case "$OPT_ZSH_FPATH" in
no)
dnl --without-zsh-functions-dir option used
;;
default|yes)
dnl --with-zsh-functions-dir option used without path
ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
AC_SUBST(ZSH_FUNCTIONS_DIR)
;;
*)
dnl --with-zsh-functions-dir option used with path
ZSH_FUNCTIONS_DIR="$withval"
AC_SUBST(ZSH_FUNCTIONS_DIR)
;;
esac
2019-02-11 05:06:42 +08:00
dnl **********************************************************************
dnl Check for fish completion path
dnl **********************************************************************
OPT_FISH_FPATH=default
AC_ARG_WITH(fish-functions-dir,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
2019-02-11 05:06:42 +08:00
[OPT_FISH_FPATH=$withval])
case "$OPT_FISH_FPATH" in
no)
dnl --without-fish-functions-dir option used
;;
default|yes)
dnl --with-fish-functions-dir option used without path
2019-04-03 08:43:29 +08:00
CURL_CHECK_PKGCONFIG(fish)
if test "$PKGCONFIG" != "no" ; then
FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
else
FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
fi
2019-02-11 05:06:42 +08:00
AC_SUBST(FISH_FUNCTIONS_DIR)
;;
*)
dnl --with-fish-functions-dir option used with path
FISH_FUNCTIONS_DIR="$withval"
AC_SUBST(FISH_FUNCTIONS_DIR)
;;
esac
2005-12-16 12:18:44 +08:00
dnl Now check for the very most basic headers. Then we can use these
2003-03-12 21:42:07 +08:00
dnl ones as default-headers when checking for the rest!
AC_CHECK_HEADERS(
sys/types.h \
sys/time.h \
sys/select.h \
sys/socket.h \
2004-01-29 23:38:27 +08:00
sys/ioctl.h \
1999-12-29 22:20:26 +08:00
unistd.h \
2000-03-16 19:34:19 +08:00
stdlib.h \
1999-12-29 22:20:26 +08:00
arpa/inet.h \
net/if.h \
netinet/in.h \
2022-11-28 05:03:39 +08:00
netinet/in6.h \
2008-05-02 05:34:34 +08:00
sys/un.h \
2017-11-06 07:59:55 +08:00
linux/tcp.h \
2004-03-26 15:10:15 +08:00
netinet/tcp.h \
2022-05-23 19:03:05 +08:00
netinet/udp.h \
1999-12-29 22:20:26 +08:00
netdb.h \
sys/sockio.h \
sys/stat.h \
sys/param.h \
termios.h \
termio.h \
fcntl.h \
io.h \
2001-09-03 20:00:38 +08:00
pwd.h \
2001-09-07 17:53:40 +08:00
utime.h \
2002-06-11 23:10:18 +08:00
sys/utime.h \
2002-07-30 07:00:16 +08:00
sys/poll.h \
2008-01-22 22:52:54 +08:00
poll.h \
2009-06-17 20:51:24 +08:00
socket.h \
2004-11-23 06:26:46 +08:00
sys/resource.h \
2004-10-01 14:36:11 +08:00
libgen.h \
2004-10-18 21:37:18 +08:00
locale.h \
2007-02-22 10:51:54 +08:00
stdbool.h \
2005-09-16 05:50:50 +08:00
sys/filio.h \
2011-08-01 04:36:54 +08:00
sys/wait.h \
2003-03-12 21:42:07 +08:00
setjmp.h,
dnl to do if not found
[],
dnl to do if found
[],
dnl default includes
[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
2020-03-30 21:52:43 +08:00
#elif defined(HAVE_UNISTD_H)
#include <unistd.h>
2003-03-12 21:42:07 +08:00
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
2004-03-29 14:22:57 +08:00
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
2017-12-06 00:41:27 +08:00
#ifdef HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
2008-05-02 05:34:34 +08:00
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
2003-03-12 21:42:07 +08:00
]
1999-12-29 22:20:26 +08:00
)
2019-03-08 08:06:59 +08:00
1999-12-29 22:20:26 +08:00
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
2007-03-23 02:25:38 +08:00
CURL_CHECK_VARIADIC_MACROS
1999-12-29 22:20:26 +08:00
AC_TYPE_SIZE_T
2021-03-16 01:16:36 +08:00
2006-10-13 09:35:14 +08:00
CURL_CHECK_STRUCT_TIMEVAL
2006-10-16 16:30:54 +08:00
CURL_VERIFY_RUNTIMELIBS
1999-12-29 22:20:26 +08:00
2022-08-11 15:07:02 +08:00
CURL_SIZEOF(size_t)
CURL_SIZEOF(long)
CURL_SIZEOF(int)
CURL_SIZEOF(time_t)
CURL_SIZEOF(off_t)
1999-12-29 22:20:26 +08:00
2017-08-12 21:54:06 +08:00
o=$CPPFLAGS
2017-09-07 06:04:16 +08:00
CPPFLAGS="-I$srcdir/include $CPPFLAGS"
2022-08-11 15:07:02 +08:00
CURL_SIZEOF(curl_off_t, [
2017-08-12 21:54:06 +08:00
#include <curl/system.h>
])
2023-03-28 22:46:03 +08:00
CURL_SIZEOF(curl_socket_t, [
#include <curl/curl.h>
])
2017-08-12 21:54:06 +08:00
CPPFLAGS=$o
2008-08-25 20:49:13 +08:00
2003-08-15 06:44:06 +08:00
AC_CHECK_TYPE(long long,
2008-08-21 08:06:15 +08:00
[AC_DEFINE(HAVE_LONGLONG, 1,
[Define to 1 if the compiler supports the 'long long' data type.])]
2007-08-21 03:30:25 +08:00
longlong="yes"
2004-10-10 11:22:45 +08:00
)
2022-09-27 17:13:21 +08:00
if test ${ac_cv_sizeof_curl_off_t} -lt 8; then
2023-02-24 07:45:16 +08:00
AC_MSG_ERROR([64 bit curl_off_t is required])
2022-09-27 17:13:21 +08:00
fi
2001-02-07 17:49:06 +08:00
# check for ssize_t
2003-08-15 06:44:06 +08:00
AC_CHECK_TYPE(ssize_t, ,
AC_DEFINE(ssize_t, int, [the signed version of size_t]))
2001-02-07 17:49:06 +08:00
2007-02-22 10:51:54 +08:00
# check for bool type
AC_CHECK_TYPE([bool],[
AC_DEFINE(HAVE_BOOL_T, 1,
[Define to 1 if bool is an available type.])
], ,[
2007-02-23 00:44:43 +08:00
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
2007-02-22 10:51:54 +08:00
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif
])
2018-03-26 22:01:07 +08:00
# check for sa_family_t
AC_CHECK_TYPE(sa_family_t,
AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
[
# The windows name?
AC_CHECK_TYPE(ADDRESS_FAMILY,
AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
],
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
2020-05-27 23:24:21 +08:00
# check for suseconds_t
AC_CHECK_TYPE([suseconds_t],[
AC_DEFINE(HAVE_SUSECONDS_T, 1,
[Define to 1 if suseconds_t is an available type.])
], ,[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
])
2018-01-19 03:24:05 +08:00
AC_MSG_CHECKING([if time_t is unsigned])
2018-04-13 20:07:39 +08:00
CURL_RUN_IFELSE(
[
2018-01-19 03:24:05 +08:00
#include <time.h>
#include <limits.h>
2023-09-10 12:26:14 +08:00
int main(void) {
time_t t = -1;
return (t < 0);
}
2018-04-13 20:07:39 +08:00
],[
2018-01-19 03:24:05 +08:00
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
],[
AC_MSG_RESULT([no])
],[
dnl cross-compiling, most systems are unsigned
AC_MSG_RESULT([no])
])
2012-11-24 00:57:00 +08:00
CURL_CONFIGURE_PULL_SYS_POLL
2001-11-28 21:16:56 +08:00
TYPE_IN_ADDR_T
2001-03-09 23:38:59 +08:00
2005-05-02 19:56:15 +08:00
TYPE_SOCKADDR_STORAGE
2008-05-20 00:57:56 +08:00
CURL_CHECK_FUNC_SELECT
2003-03-16 05:04:01 +08:00
2006-07-04 21:03:32 +08:00
CURL_CHECK_FUNC_RECV
CURL_CHECK_FUNC_SEND
2006-07-28 22:19:02 +08:00
CURL_CHECK_MSG_NOSIGNAL
2008-09-20 02:39:24 +08:00
CURL_CHECK_FUNC_ALARM
2009-10-18 11:37:39 +08:00
CURL_CHECK_FUNC_BASENAME
2009-06-17 17:12:19 +08:00
CURL_CHECK_FUNC_CLOSESOCKET
2009-06-18 20:36:10 +08:00
CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
2008-11-14 02:56:55 +08:00
CURL_CHECK_FUNC_FCNTL
2008-10-31 01:45:47 +08:00
CURL_CHECK_FUNC_FREEADDRINFO
2010-11-11 19:11:19 +08:00
CURL_CHECK_FUNC_FSETXATTR
2008-09-11 03:26:30 +08:00
CURL_CHECK_FUNC_FTRUNCATE
2008-10-29 03:13:25 +08:00
CURL_CHECK_FUNC_GETADDRINFO
2008-11-18 09:57:28 +08:00
CURL_CHECK_FUNC_GETHOSTBYNAME
2008-09-18 00:03:49 +08:00
CURL_CHECK_FUNC_GETHOSTBYNAME_R
2008-09-17 16:14:28 +08:00
CURL_CHECK_FUNC_GETHOSTNAME
2019-05-21 16:06:06 +08:00
CURL_CHECK_FUNC_GETPEERNAME
CURL_CHECK_FUNC_GETSOCKNAME
2019-05-21 22:47:53 +08:00
CURL_CHECK_FUNC_IF_NAMETOINDEX
2008-11-08 11:27:15 +08:00
CURL_CHECK_FUNC_GETIFADDRS
2008-09-11 01:33:15 +08:00
CURL_CHECK_FUNC_GMTIME_R
2008-09-25 00:43:40 +08:00
CURL_CHECK_FUNC_INET_NTOP
2008-09-25 03:13:01 +08:00
CURL_CHECK_FUNC_INET_PTON
2023-10-02 19:24:14 +08:00
CURL_CHECK_FUNC_IOCTL
2008-11-14 02:56:55 +08:00
CURL_CHECK_FUNC_IOCTLSOCKET
CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
2009-09-28 20:16:29 +08:00
CURL_CHECK_FUNC_MEMRCHR
2009-02-13 13:49:58 +08:00
CURL_CHECK_FUNC_POLL
2008-09-11 03:03:00 +08:00
CURL_CHECK_FUNC_SIGACTION
2008-09-27 02:28:32 +08:00
CURL_CHECK_FUNC_SIGINTERRUPT
CURL_CHECK_FUNC_SIGNAL
CURL_CHECK_FUNC_SIGSETJMP
2009-06-17 17:12:19 +08:00
CURL_CHECK_FUNC_SOCKET
2011-07-29 19:25:52 +08:00
CURL_CHECK_FUNC_SOCKETPAIR
2008-09-15 08:32:08 +08:00
CURL_CHECK_FUNC_STRCASECMP
CURL_CHECK_FUNC_STRCMPI
2008-09-11 03:26:30 +08:00
CURL_CHECK_FUNC_STRDUP
2008-09-12 09:16:26 +08:00
CURL_CHECK_FUNC_STRERROR_R
2008-09-15 08:32:08 +08:00
CURL_CHECK_FUNC_STRICMP
2008-09-11 03:03:00 +08:00
CURL_CHECK_FUNC_STRTOK_R
2008-09-11 01:33:15 +08:00
CURL_CHECK_FUNC_STRTOLL
2005-11-24 18:22:46 +08:00
case $host in
*msdosdjgpp)
ac_cv_func_pipe=no
skipcheck_pipe=yes
AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
;;
esac
2008-08-02 03:01:35 +08:00
2018-05-28 01:51:04 +08:00
AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
[[#include <pwd.h>
#include <sys/types.h>]])
2023-09-25 19:03:26 +08:00
AC_CHECK_FUNCS([\
2023-09-22 21:58:49 +08:00
_fseeki64 \
2023-09-25 19:03:26 +08:00
arc4random \
2022-05-25 16:09:53 +08:00
fchmod \
2023-09-25 19:03:26 +08:00
fnmatch \
2023-09-22 21:58:49 +08:00
fseeko \
2018-05-31 21:57:54 +08:00
geteuid \
2008-08-02 03:01:35 +08:00
getpass_r \
getppid \
getpwuid \
2014-07-13 06:18:40 +08:00
getpwuid_r \
2008-08-02 03:01:35 +08:00
getrlimit \
gettimeofday \
2014-05-27 04:10:15 +08:00
if_nametoindex \
2017-10-30 20:12:41 +08:00
mach_absolute_time \
2008-08-02 03:01:35 +08:00
pipe \
2022-04-05 21:46:03 +08:00
sched_yield \
2022-06-10 15:09:39 +08:00
sendmsg \
2008-08-02 03:01:35 +08:00
setlocale \
setmode \
setrlimit \
2022-09-22 17:52:08 +08:00
snprintf \
2017-04-27 07:24:07 +08:00
utime \
2023-03-04 15:02:14 +08:00
utimes \
2008-08-02 03:01:35 +08:00
],[
],[
func="$ac_func"
eval skipcheck=\$skipcheck_$func
if test "x$skipcheck" != "xyes"; then
AC_MSG_CHECKING([deeper for $func])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
]],[[
$func ();
]])
],[
AC_MSG_RESULT([yes])
eval "ac_cv_func_$func=yes"
2011-06-18 03:01:41 +08:00
AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
2008-08-02 03:01:35 +08:00
[Define to 1 if you have the $func function.])
],[
AC_MSG_RESULT([but still no])
])
fi
])
2008-11-14 02:56:55 +08:00
CURL_CHECK_NONBLOCKING_SOCKET
dnl ************************************************************
dnl nroff tool stuff
dnl
2004-06-28 05:51:54 +08:00
2007-08-21 03:30:25 +08:00
AC_PATH_PROG( PERL, perl, ,
2000-03-13 17:12:18 +08:00
$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
AC_SUBST(PERL)
1999-12-29 22:20:26 +08:00
2007-08-21 03:30:25 +08:00
AC_PATH_PROGS( NROFF, gnroff nroff, ,
1999-12-29 22:20:26 +08:00
$PATH:/usr/bin/:/usr/local/bin )
2000-05-22 22:12:12 +08:00
AC_SUBST(NROFF)
1999-12-29 22:20:26 +08:00
2004-02-12 23:05:38 +08:00
if test -n "$NROFF"; then
dnl only check for nroff options if an nroff command was found
AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
MANOPT="-man"
2004-02-03 06:39:04 +08:00
mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
if test -z "$mancheck"; then
2004-02-12 23:05:38 +08:00
MANOPT="-mandoc"
mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
if test -z "$mancheck"; then
MANOPT=""
AC_MSG_RESULT([failed])
AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
else
AC_MSG_RESULT([$MANOPT])
fi
2004-02-03 06:39:04 +08:00
else
AC_MSG_RESULT([$MANOPT])
fi
2004-02-12 23:05:38 +08:00
AC_SUBST(MANOPT)
fi
if test -z "$MANOPT"
then
dnl if no nroff tool was found, or no option that could convert man pages
dnl was found, then disable the built-in manual stuff
AC_MSG_WARN([disabling built-in manual])
USE_MANUAL="no";
2004-02-03 06:39:04 +08:00
fi
2004-02-12 22:45:50 +08:00
dnl *************************************************************************
dnl If the manual variable still is set, then we go with providing a built-in
dnl manual
if test "$USE_MANUAL" = "1"; then
AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
2004-04-26 20:29:30 +08:00
curl_manual_msg="enabled"
2004-02-12 22:45:50 +08:00
fi
dnl set variable for use in automakefile(s)
AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
2010-01-26 23:07:40 +08:00
CURL_CHECK_LIB_ARES
2009-05-30 23:56:42 +08:00
2016-04-15 22:37:20 +08:00
if test "x$curl_cv_native_windows" != "xyes" &&
2010-12-28 23:52:20 +08:00
test "x$enable_shared" = "xyes"; then
2010-08-09 15:33:53 +08:00
build_libhostname=yes
else
build_libhostname=no
fi
2010-08-09 19:06:27 +08:00
AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
2010-08-09 15:33:53 +08:00
2017-08-10 21:07:40 +08:00
if test "x$want_ares" != xyes; then
CURL_CHECK_OPTION_THREADED_RESOLVER
2010-04-26 05:24:05 +08:00
fi
2017-02-13 03:50:56 +08:00
dnl ************************************************************
dnl disable POSIX threads
dnl
AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
AC_ARG_ENABLE(pthreads,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-pthreads],
2017-02-13 03:50:56 +08:00
[Enable POSIX threads (default for threaded resolver)])
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
2017-02-13 03:50:56 +08:00
[ case "$enableval" in
no) AC_MSG_RESULT(no)
want_pthreads=no
;;
*) AC_MSG_RESULT(yes)
want_pthreads=yes
;;
esac ], [
AC_MSG_RESULT(auto)
want_pthreads=auto
]
)
2017-03-01 16:11:36 +08:00
dnl turn off pthreads if rt is disabled
if test "$want_pthreads" != "no"; then
if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
fi
if test "$dontwant_rt" != "no"; then
dnl if --enable-pthreads was explicit then warn it's being ignored
if test "$want_pthreads" = "yes"; then
AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
fi
want_pthreads=no
fi
fi
dnl turn off pthreads if no threaded resolver
if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
want_pthreads=no
fi
dnl detect pthreads
if test "$want_pthreads" != "no"; then
2010-04-26 05:24:05 +08:00
AC_CHECK_HEADER(pthread.h,
[ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
save_CFLAGS="$CFLAGS"
2020-05-21 05:36:21 +08:00
dnl When statically linking against boringssl, -lpthread is added to LIBS.
dnl Make sure to that this does not pass the check below, we really want
dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
dnl lib1541 and lib1565 tests are built with these options. Otherwise
dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
save_LIBS="$LIBS"
LIBS=
dnl Check for libc variants without a separate pthread lib like bionic
2013-04-11 22:21:49 +08:00
AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
2020-05-21 05:36:21 +08:00
LIBS="$save_LIBS"
2013-04-11 22:21:49 +08:00
2018-09-21 15:40:56 +08:00
dnl on HPUX, life is more complicated...
case $host in
*-hp-hpux*)
dnl it doesn't actually work without -lpthread
USE_THREADS_POSIX=""
;;
*)
;;
esac
2013-04-11 22:21:49 +08:00
dnl if it wasn't found without lib, search for it in pthread lib
if test "$USE_THREADS_POSIX" != "1"
then
2022-08-07 22:42:35 +08:00
# assign PTHREAD for pkg-config use
PTHREAD=" -pthread"
2022-03-05 22:46:38 +08:00
case $host in
*-ibm-aix*)
dnl Check if compiler is xlC
COMPILER_VERSION=`"$CC" -qversion 2>/dev/null`
if test x"$COMPILER_VERSION" = "x"; then
CFLAGS="$CFLAGS -pthread"
else
CFLAGS="$CFLAGS -qthreaded"
fi
;;
2022-08-07 22:42:35 +08:00
powerpc-*amigaos*)
dnl No -pthread option, but link with -lpthread
PTHREAD=" -lpthread"
;;
2022-03-05 22:46:38 +08:00
*)
CFLAGS="$CFLAGS -pthread"
;;
esac
2013-04-11 22:21:49 +08:00
AC_CHECK_LIB(pthread, pthread_create,
[USE_THREADS_POSIX=1],
[ CFLAGS="$save_CFLAGS"])
fi
if test "x$USE_THREADS_POSIX" = "x1"
then
AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
curl_res_msg="POSIX threaded"
fi
2010-04-26 05:24:05 +08:00
])
fi
2017-03-01 16:11:36 +08:00
dnl threaded resolver check
if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
2017-02-13 03:50:56 +08:00
if test "$want_pthreads" = "yes"; then
AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
fi
2017-03-01 16:11:36 +08:00
dnl If native Windows fallback on Win32 threads since no POSIX threads
if test "$curl_cv_native_windows" = "yes"; then
USE_THREADS_WIN32=1
AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
curl_res_msg="Win32 threaded"
else
AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
2017-02-13 03:50:56 +08:00
fi
fi
2020-03-08 18:08:13 +08:00
CURL_CONVERT_INCLUDE_TO_ISYSTEM
2004-11-12 00:34:24 +08:00
dnl ************************************************************
dnl disable verbose text strings
dnl
AC_MSG_CHECKING([whether to enable verbose strings])
AC_ARG_ENABLE(verbose,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-verbose],[Enable verbose strings])
AS_HELP_STRING([--disable-verbose],[Disable verbose strings]),
2004-11-12 00:34:24 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
curl_verbose_msg="no"
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2005-03-14 07:59:28 +08:00
dnl ************************************************************
dnl enable SSPI support
dnl
2007-04-11 02:53:21 +08:00
AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
2005-03-14 07:59:28 +08:00
AC_ARG_ENABLE(sspi,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-sspi],[Enable SSPI])
AS_HELP_STRING([--disable-sspi],[Disable SSPI]),
2005-03-14 07:59:28 +08:00
[ case "$enableval" in
yes)
2016-04-15 22:37:20 +08:00
if test "$curl_cv_native_windows" = "yes"; then
2007-04-11 02:53:21 +08:00
AC_MSG_RESULT(yes)
AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
2007-09-14 09:24:59 +08:00
AC_SUBST(USE_WINDOWS_SSPI, [1])
2010-01-23 00:38:32 +08:00
curl_sspi_msg="enabled"
2007-04-11 02:53:21 +08:00
else
AC_MSG_RESULT(no)
AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
fi
2005-03-14 07:59:28 +08:00
;;
*)
2020-08-07 23:11:52 +08:00
if test "x$SCHANNEL_ENABLED" = "x1"; then
# --with-schannel implies --enable-sspi
2012-06-14 02:54:03 +08:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
2005-03-14 07:59:28 +08:00
;;
esac ],
2020-08-07 23:11:52 +08:00
if test "x$SCHANNEL_ENABLED" = "x1"; then
# --with-schannel implies --enable-sspi
2012-06-14 02:54:03 +08:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
2005-03-14 07:59:28 +08:00
)
2004-11-12 17:18:14 +08:00
dnl ************************************************************
2023-07-20 22:09:04 +08:00
dnl disable basic authentication
2004-11-12 17:18:14 +08:00
dnl
2023-07-20 22:09:04 +08:00
AC_MSG_CHECKING([whether to enable basic authentication method])
AC_ARG_ENABLE(basic-auth,
AS_HELP_STRING([--enable-basic-auth],[Enable basic authentication (default)])
AS_HELP_STRING([--disable-basic-auth],[Disable basic authentication]),
2004-11-12 17:18:14 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2023-07-20 22:09:04 +08:00
AC_DEFINE(CURL_DISABLE_BASIC_AUTH, 1, [to disable basic authentication])
CURL_DISABLE_BASIC_AUTH=1
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable bearer authentication
dnl
AC_MSG_CHECKING([whether to enable bearer authentication method])
AC_ARG_ENABLE(bearer-auth,
AS_HELP_STRING([--enable-bearer-auth],[Enable bearer authentication (default)])
AS_HELP_STRING([--disable-bearer-auth],[Disable bearer authentication]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_BEARER_AUTH, 1, [to disable bearer authentication])
CURL_DISABLE_BEARER_AUTH=1
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable digest authentication
dnl
AC_MSG_CHECKING([whether to enable digest authentication method])
AC_ARG_ENABLE(digest-auth,
AS_HELP_STRING([--enable-digest-auth],[Enable digest authentication (default)])
AS_HELP_STRING([--disable-digest-auth],[Disable digest authentication]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_DIGEST_AUTH, 1, [to disable digest authentication])
CURL_DISABLE_DIGEST_AUTH=1
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable kerberos authentication
dnl
AC_MSG_CHECKING([whether to enable kerberos authentication method])
AC_ARG_ENABLE(kerberos-auth,
AS_HELP_STRING([--enable-kerberos-auth],[Enable kerberos authentication (default)])
AS_HELP_STRING([--disable-kerberos-auth],[Disable kerberos authentication]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_KERBEROS_AUTH, 1, [to disable kerberos authentication])
CURL_DISABLE_KERBEROS_AUTH=1
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable negotiate authentication
dnl
AC_MSG_CHECKING([whether to enable negotiate authentication method])
AC_ARG_ENABLE(negotiate-auth,
AS_HELP_STRING([--enable-negotiate-auth],[Enable negotiate authentication (default)])
AS_HELP_STRING([--disable-negotiate-auth],[Disable negotiate authentication]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_NEGOTIATE_AUTH, 1, [to disable negotiate authentication])
CURL_DISABLE_NEGOTIATE_AUTH=1
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable aws
dnl
AC_MSG_CHECKING([whether to enable aws sig methods])
AC_ARG_ENABLE(aws,
AS_HELP_STRING([--enable-aws],[Enable AWS sig support (default)])
AS_HELP_STRING([--disable-aws],[Disable AWS sig support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_AWS, 1, [to disable AWS sig support])
CURL_DISABLE_AWS=1
2004-11-12 17:18:14 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2021-05-07 17:45:35 +08:00
dnl ************************************************************
dnl disable NTLM support
dnl
AC_MSG_CHECKING([whether to support NTLM])
AC_ARG_ENABLE(ntlm,
AS_HELP_STRING([--enable-ntlm],[Enable NTLM support])
AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support])
CURL_DISABLE_NTLM=1
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2011-08-27 12:31:18 +08:00
CURL_CHECK_OPTION_NTLM_WB
2011-08-01 02:44:41 +08:00
2011-08-27 12:31:18 +08:00
CURL_CHECK_NTLM_WB
2011-08-01 02:44:41 +08:00
2011-01-20 03:35:02 +08:00
dnl ************************************************************
dnl disable TLS-SRP authentication
dnl
AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
AC_ARG_ENABLE(tls-srp,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
2011-01-20 03:35:02 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
want_tls_srp=no
;;
*) AC_MSG_RESULT(yes)
want_tls_srp=yes
;;
esac ],
AC_MSG_RESULT(yes)
want_tls_srp=yes
)
2015-03-05 17:57:52 +08:00
if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
2011-01-20 03:35:02 +08:00
AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
2011-01-20 04:27:06 +08:00
USE_TLS_SRP=1
2011-01-20 03:35:02 +08:00
curl_tls_srp_msg="enabled"
fi
2014-11-28 06:59:25 +08:00
dnl ************************************************************
2014-12-27 04:45:21 +08:00
dnl disable Unix domain sockets support
2014-11-28 06:59:25 +08:00
dnl
2014-12-27 04:45:21 +08:00
AC_MSG_CHECKING([whether to enable Unix domain sockets])
2014-11-28 06:59:25 +08:00
AC_ARG_ENABLE(unix-sockets,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
2014-11-28 06:59:25 +08:00
[ case "$enableval" in
no) AC_MSG_RESULT(no)
want_unix_sockets=no
;;
*) AC_MSG_RESULT(yes)
want_unix_sockets=yes
;;
esac ], [
AC_MSG_RESULT(auto)
want_unix_sockets=auto
]
)
if test "x$want_unix_sockets" != "xno"; then
2022-10-11 15:51:33 +08:00
if test "x$curl_cv_native_windows" = "xyes"; then
USE_UNIX_SOCKETS=1
2014-12-27 04:45:21 +08:00
AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
2014-11-28 06:59:25 +08:00
curl_unix_sockets_msg="enabled"
2022-10-11 15:51:33 +08:00
else
AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
AC_SUBST(USE_UNIX_SOCKETS, [1])
curl_unix_sockets_msg="enabled"
], [
if test "x$want_unix_sockets" = "xyes"; then
AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
fi
], [
#include <sys/un.h>
])
fi
2014-11-28 06:59:25 +08:00
fi
2004-12-06 07:59:32 +08:00
dnl ************************************************************
dnl disable cookies support
dnl
2019-06-11 05:10:19 +08:00
AC_MSG_CHECKING([whether to support cookies])
2004-12-06 07:59:32 +08:00
AC_ARG_ENABLE(cookies,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-cookies],[Enable cookies support])
AS_HELP_STRING([--disable-cookies],[Disable cookies support]),
2004-12-06 07:59:32 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2019-06-11 05:10:19 +08:00
dnl ************************************************************
2020-08-14 21:45:08 +08:00
dnl disable socketpair
dnl
AC_MSG_CHECKING([whether to support socketpair])
AC_ARG_ENABLE(socketpair,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-socketpair],[Enable socketpair support])
AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
2020-08-14 21:45:08 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
2019-06-11 05:10:19 +08:00
dnl disable HTTP authentication support
dnl
AC_MSG_CHECKING([whether to support HTTP authentication])
AC_ARG_ENABLE(http-auth,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
2019-06-11 05:10:19 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable DoH support
dnl
AC_MSG_CHECKING([whether to support DoH])
AC_ARG_ENABLE(doh,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-doh],[Enable DoH support])
AS_HELP_STRING([--disable-doh],[Disable DoH support]),
2019-06-11 05:10:19 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable mime API support
dnl
AC_MSG_CHECKING([whether to support the MIME API])
AC_ARG_ENABLE(mime,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-mime],[Enable mime API support])
AS_HELP_STRING([--disable-mime],[Disable mime API support]),
2019-06-11 05:10:19 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2023-08-17 20:36:30 +08:00
dnl ************************************************************
dnl disable bindlocal
dnl
AC_MSG_CHECKING([whether to support binding connections locally])
AC_ARG_ENABLE(bindlocal,
AS_HELP_STRING([--enable-bindlocal],[Enable local binding support])
AS_HELP_STRING([--disable-bindlocal],[Disable local binding support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_BINDLOCAL, 1, [disable local binding support])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2022-11-16 00:50:22 +08:00
dnl ************************************************************
dnl disable form API support
dnl
AC_MSG_CHECKING([whether to support the form API])
AC_ARG_ENABLE(form-api,
AS_HELP_STRING([--enable-form-api],[Enable form API support])
AS_HELP_STRING([--disable-form-api],[Disable form API support]),
[ case "$enableval" in
no) AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API])
;;
*) AC_MSG_RESULT(yes)
test "$enable_mime" = no &&
AC_MSG_ERROR(MIME support needs to be enabled in order to enable form API support)
;;
esac ],
[
if test "$enable_mime" = no; then
enable_form_api=no
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API])
else
AC_MSG_RESULT(yes)
fi ]
)
2019-06-11 05:10:19 +08:00
dnl ************************************************************
dnl disable date parsing
dnl
AC_MSG_CHECKING([whether to support date parsing])
AC_ARG_ENABLE(dateparse,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-dateparse],[Enable date parsing])
AS_HELP_STRING([--disable-dateparse],[Disable date parsing]),
2019-06-11 05:10:19 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable netrc
dnl
AC_MSG_CHECKING([whether to support netrc parsing])
AC_ARG_ENABLE(netrc,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-netrc],[Enable netrc parsing])
AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
2019-06-11 05:10:19 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2019-02-11 23:38:19 +08:00
dnl ************************************************************
dnl disable progress-meter
dnl
AC_MSG_CHECKING([whether to support progress-meter])
AC_ARG_ENABLE(progress-meter,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
2019-02-11 23:38:19 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2019-06-11 05:10:19 +08:00
dnl ************************************************************
dnl disable shuffle DNS support
dnl
AC_MSG_CHECKING([whether to support DNS shuffling])
AC_ARG_ENABLE(dnsshuffle,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
2019-06-11 05:10:19 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2020-08-26 14:30:38 +08:00
dnl ************************************************************
dnl disable the curl_easy_options API
dnl
AC_MSG_CHECKING([whether to support curl_easy_option*])
2021-06-08 23:30:17 +08:00
AC_ARG_ENABLE(get-easy-options,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
2020-08-26 14:30:38 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
2019-03-03 18:17:52 +08:00
dnl ************************************************************
dnl switch on/off alt-svc
dnl
AC_MSG_CHECKING([whether to support alt-svc])
AC_ARG_ENABLE(alt-svc,
2021-03-16 00:32:26 +08:00
AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
2019-03-03 18:17:52 +08:00
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
2020-10-26 06:08:54 +08:00
AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
curl_altsvc_msg="no";
enable_altsvc="no"
2019-03-03 18:17:52 +08:00
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
2022-02-25 21:20:10 +08:00
AC_MSG_RESULT(yes)
2019-03-03 18:17:52 +08:00
)
2022-03-20 05:34:19 +08:00
dnl ************************************************************
dnl switch on/off headers-api
dnl
AC_MSG_CHECKING([whether to support headers-api])
AC_ARG_ENABLE(headers-api,
AS_HELP_STRING([--enable-headers-api],[Enable headers-api support])
AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]),
[ case "$enableval" in
2022-05-30 20:13:48 +08:00
no) AC_MSG_RESULT(no)
curl_headers_msg="no (--enable-headers-api)"
AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api])
2022-03-20 05:34:19 +08:00
;;
2022-07-12 21:53:11 +08:00
*)
AC_MSG_RESULT(yes)
;;
2022-03-20 05:34:19 +08:00
esac ],
2022-05-30 20:13:48 +08:00
AC_MSG_RESULT(yes)
2022-03-20 05:34:19 +08:00
)
2021-03-08 15:30:32 +08:00
dnl only check for HSTS if there's SSL present
if test -n "$SSL_ENABLED"; then
dnl ************************************************************
dnl switch on/off hsts
dnl
AC_MSG_CHECKING([whether to support HSTS])
AC_ARG_ENABLE(hsts,
2023-05-19 03:16:56 +08:00
AS_HELP_STRING([--enable-hsts],[Enable HSTS support])
AS_HELP_STRING([--disable-hsts],[Disable HSTS support]),
2021-03-08 15:30:32 +08:00
[ case "$enableval" in
no)
2020-11-03 06:17:01 +08:00
AC_MSG_RESULT(no)
2021-09-05 05:41:07 +08:00
hsts="no"
2020-11-03 06:17:01 +08:00
;;
2021-03-08 15:30:32 +08:00
*) AC_MSG_RESULT(yes)
2020-11-03 06:17:01 +08:00
;;
2021-03-08 15:30:32 +08:00
esac ],
2021-09-05 05:41:07 +08:00
AC_MSG_RESULT($hsts)
2021-03-08 15:30:32 +08:00
)
else
AC_MSG_NOTICE([disables HSTS due to lack of SSL])
2021-09-05 05:41:07 +08:00
hsts="no"
2021-03-08 15:30:32 +08:00
fi
2020-11-03 06:17:01 +08:00
2021-09-05 05:41:07 +08:00
if test "x$hsts" != "xyes"; then
2021-03-08 15:30:32 +08:00
curl_hsts_msg="no (--enable-hsts)";
AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
2020-11-03 06:17:01 +08:00
fi
2019-06-04 22:53:02 +08:00
dnl *************************************************************
2020-09-29 16:13:18 +08:00
dnl check whether ECH support, if desired, is actually available
2019-06-04 22:53:02 +08:00
dnl
2020-09-29 16:13:18 +08:00
if test "x$want_ech" != "xno"; then
AC_MSG_CHECKING([whether ECH support is available])
2019-06-04 22:53:02 +08:00
dnl assume NOT and look for sufficient condition
2020-09-29 16:13:18 +08:00
ECH_ENABLED=0
ECH_SUPPORT=''
2019-06-04 22:53:02 +08:00
2020-09-29 16:13:18 +08:00
dnl OpenSSL with a chosen ECH function should be enough
2019-06-04 22:53:02 +08:00
dnl so more exhaustive checking seems unnecessary for now
2019-11-07 06:53:44 +08:00
if test "x$OPENSSL_ENABLED" = "x1"; then
2020-09-29 16:13:18 +08:00
AC_CHECK_FUNCS(SSL_get_ech_status,
ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
ECH_ENABLED=1)
2019-06-04 22:53:02 +08:00
dnl add 'elif' chain here for additional implementations
fi
dnl now deal with whatever we found
2020-09-29 16:13:18 +08:00
if test "x$ECH_ENABLED" = "x1"; then
AC_DEFINE(USE_ECH, 1, [if ECH support is available])
AC_MSG_RESULT($ECH_SUPPORT)
experimental="$experimental ECH"
2019-06-04 22:53:02 +08:00
else
2020-09-29 16:13:18 +08:00
AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
2019-06-04 22:53:02 +08:00
fi
fi
2022-12-28 16:58:09 +08:00
dnl *************************************************************
dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio
dnl
if test "x$OPENSSL_ENABLED" = "x1"; then
AC_CHECK_FUNCS([SSL_set0_wbio])
fi
2022-09-09 21:11:13 +08:00
dnl *************************************************************
dnl WebSockets
dnl
AC_MSG_CHECKING([whether to support WebSockets])
AC_ARG_ENABLE(websockets,
AS_HELP_STRING([--enable-websockets],[Enable WebSockets support])
AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
;;
2022-09-09 21:11:14 +08:00
*)
if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
AC_MSG_RESULT(yes)
curl_ws_msg="enabled"
AC_DEFINE_UNQUOTED(USE_WEBSOCKETS, [1], [enable websockets support])
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS"
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS"
fi
experimental="$experimental Websockets"
else
dnl websockets requires >32 bit curl_off_t
AC_MSG_RESULT(no)
AC_MSG_WARN([Websockets disabled due to lack of >32 bit curl_off_t])
2022-09-09 21:11:13 +08:00
fi
;;
esac ],
AC_MSG_RESULT(no)
)
2006-06-13 04:33:04 +08:00
dnl ************************************************************
2012-04-12 01:33:54 +08:00
dnl hiding of library internal symbols
2006-06-13 04:33:04 +08:00
dnl
2012-04-12 01:33:54 +08:00
CURL_CONFIGURE_SYMBOL_HIDING
2006-06-13 04:33:04 +08:00
2007-02-17 09:29:01 +08:00
dnl
dnl All the library dependencies put into $LIB apply to libcurl only.
dnl
2020-11-07 07:33:16 +08:00
LIBCURL_LIBS="$LIBS$PTHREAD"
2007-02-17 09:29:01 +08:00
AC_SUBST(LIBCURL_LIBS)
2010-08-09 11:45:11 +08:00
AC_SUBST(CURL_NETWORK_LIBS)
2012-11-29 01:31:23 +08:00
AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
2007-02-17 09:29:01 +08:00
2012-12-05 06:30:05 +08:00
dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
dnl LIBS variable used in generated makefile at makefile processing
dnl time. Doing this functionally prevents LIBS from being used for
dnl all link targets in given makefile.
2012-11-30 04:56:48 +08:00
BLANK_AT_MAKETIME=
AC_SUBST(BLANK_AT_MAKETIME)
2004-06-03 22:37:14 +08:00
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
2010-07-25 23:48:07 +08:00
dnl yes or no
ENABLE_SHARED="$enable_shared"
AC_SUBST(ENABLE_SHARED)
2013-04-16 21:40:00 +08:00
dnl to let curl-config output the static libraries correctly
ENABLE_STATIC="$enable_static"
AC_SUBST(ENABLE_STATIC)
2020-05-12 03:50:02 +08:00
dnl merge the pkg-config Libs.private field into Libs when static-only
if test "x$enable_shared" = "xno"; then
LIBCURL_NO_SHARED=$LIBCURL_LIBS
else
LIBCURL_NO_SHARED=
fi
AC_SUBST(LIBCURL_NO_SHARED)
2013-04-16 21:40:00 +08:00
2023-05-16 22:51:14 +08:00
rm $compilersh
2008-09-02 20:07:08 +08:00
dnl
dnl For keeping supported features and protocols also in pkg-config file
2012-06-14 02:54:03 +08:00
dnl since it is more cross-compile friendly than curl-config
2008-09-02 20:07:08 +08:00
dnl
2015-03-05 22:38:47 +08:00
if test "x$OPENSSL_ENABLED" = "x1"; then
2008-09-02 20:07:08 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
elif test -n "$SSL_ENABLED"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
fi
if test "x$IPV6_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
fi
2014-11-28 06:59:25 +08:00
if test "x$USE_UNIX_SOCKETS" = "x1"; then
2014-12-27 04:45:21 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
2014-11-28 06:59:25 +08:00
fi
2008-09-02 20:07:08 +08:00
if test "x$HAVE_LIBZ" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
fi
2017-11-05 22:28:16 +08:00
if test "x$HAVE_BROTLI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
fi
2020-05-25 23:49:46 +08:00
if test "x$HAVE_ZSTD" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
fi
2017-02-13 03:50:56 +08:00
if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
-o "x$USE_THREADS_WIN32" = "x1"; then
2008-09-02 20:07:08 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
fi
if test "x$IDN_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
fi
if test "x$USE_WINDOWS_SSPI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
fi
2014-07-21 15:53:45 +08:00
if test "x$HAVE_GSSAPI" = "x1"; then
2014-11-11 08:04:05 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
2014-07-21 15:53:45 +08:00
fi
2019-03-03 18:17:52 +08:00
if test "x$curl_psl_msg" = "xenabled"; then
2015-10-18 06:11:13 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
fi
2020-12-25 02:48:45 +08:00
if test "x$curl_gsasl_msg" = "xenabled"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
fi
2019-03-03 18:17:52 +08:00
if test "x$enable_altsvc" = "xyes"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
fi
2021-09-05 05:41:07 +08:00
if test "x$hsts" = "xyes"; then
2020-11-03 06:17:01 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
fi
2019-03-03 18:17:52 +08:00
2023-07-20 22:09:04 +08:00
if test "x$CURL_DISABLE_NEGOTIATE_AUTH" != "x1" -a \
2014-07-21 15:53:45 +08:00
\( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
fi
2023-07-20 22:09:04 +08:00
if test "x$CURL_DISABLE_KERBEROS_AUTH" != "x1" -a \
2014-11-11 08:04:05 +08:00
\( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
2014-11-15 22:08:43 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
2014-11-07 18:42:54 +08:00
fi
2021-03-29 02:46:54 +08:00
use_curl_ntlm_core=no
2023-07-20 22:09:04 +08:00
if test "x$CURL_DISABLE_NTLM" != "x1"; then
2021-03-29 02:46:54 +08:00
if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
2023-07-30 05:44:28 +08:00
-o "x$GNUTLS_ENABLED" = "x1" \
2021-03-06 22:52:09 +08:00
-o "x$SECURETRANSPORT_ENABLED" = "x1" \
-o "x$USE_WIN32_CRYPTO" = "x1" \
2021-03-29 02:46:54 +08:00
-o "x$WOLFSSL_NTLM" = "x1"; then
use_curl_ntlm_core=yes
fi
if test "x$use_curl_ntlm_core" = "xyes" \
-o "x$USE_WINDOWS_SSPI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
2014-11-09 20:58:07 +08:00
2021-03-29 02:46:54 +08:00
if test "x$CURL_DISABLE_HTTP" != "x1" -a \
"x$NTLM_WB_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
fi
2011-04-06 13:28:26 +08:00
fi
2008-09-02 20:07:08 +08:00
fi
2014-11-09 20:58:07 +08:00
2011-01-20 03:35:02 +08:00
if test "x$USE_TLS_SRP" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
fi
2008-09-02 20:07:08 +08:00
2020-12-14 21:10:32 +08:00
if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
2013-09-05 18:03:24 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
fi
2022-04-11 00:21:37 +08:00
if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1" \
-o "x$USE_MSH3" = "x1"; then
2019-07-22 05:48:58 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
fi
2017-09-05 16:45:09 +08:00
if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
fi
2021-10-21 13:41:22 +08:00
dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends
2020-09-30 21:31:01 +08:00
if test "x$https_proxy" != "xno"; then
2022-11-25 21:06:43 +08:00
if test "x$OPENSSL_ENABLED" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" \
-o "x$SECURETRANSPORT_ENABLED" = "x1" \
-o "x$RUSTLS_ENABLED" = "x1" \
-o "x$BEARSSL_ENABLED" = "x1" \
-o "x$SCHANNEL_ENABLED" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" \
-o "x$MBEDTLS_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$WOLFSSL_FULL_BIO" = "x1"; then
2020-09-30 21:31:01 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
fi
2016-11-25 17:27:22 +08:00
fi
2020-09-29 16:13:18 +08:00
if test "x$ECH_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
2019-06-04 22:53:02 +08:00
fi
2021-03-10 07:38:21 +08:00
if test ${ac_cv_sizeof_curl_off_t} -gt 4; then
if test ${ac_cv_sizeof_off_t} -gt 4 -o \
"$curl_win32_file_api" = "win32_large_files"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile"
fi
fi
2022-04-05 22:00:37 +08:00
if test "$tst_atomic" = "yes"; then
2022-06-14 02:59:45 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
2023-10-15 09:55:42 +08:00
elif test "x$USE_THREADS_POSIX" = "x1" -a \
"x$ac_cv_header_pthread_h" = "xyes"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
2022-04-05 22:00:37 +08:00
else
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <windows.h>
]],[[
#if (WINVER < 0x600) && (_WIN32_WINNT < 0x600)
#error
#endif
]])
],[
2022-06-14 02:59:45 +08:00
SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe"
2022-04-05 22:00:37 +08:00
],[
])
fi
2020-07-06 20:15:48 +08:00
dnl replace spaces with newlines
dnl sort the lines
dnl replace the newlines back to spaces
SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
2008-09-02 20:07:08 +08:00
AC_SUBST(SUPPORT_FEATURES)
dnl For supported protocols in pkg-config file
if test "x$CURL_DISABLE_HTTP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
fi
fi
if test "x$CURL_DISABLE_FTP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
fi
fi
if test "x$CURL_DISABLE_FILE" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
fi
if test "x$CURL_DISABLE_TELNET" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
fi
2010-06-01 23:25:03 +08:00
if test "x$CURL_DISABLE_LDAP" != "x1"; then
2008-09-02 20:07:08 +08:00
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
2010-06-01 23:25:03 +08:00
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
(test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
fi
2010-05-28 18:23:28 +08:00
fi
2008-09-02 20:07:08 +08:00
fi
if test "x$CURL_DISABLE_DICT" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
fi
if test "x$CURL_DISABLE_TFTP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
fi
2010-08-12 22:55:48 +08:00
if test "x$CURL_DISABLE_GOPHER" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
2020-11-16 01:46:06 +08:00
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
fi
2010-08-12 22:55:48 +08:00
fi
2020-08-31 15:45:09 +08:00
if test "x$CURL_DISABLE_MQTT" != "x1"; then
2020-04-14 17:19:12 +08:00
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
fi
2009-12-13 06:31:00 +08:00
if test "x$CURL_DISABLE_POP3" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
2009-12-13 06:33:18 +08:00
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
fi
2009-12-13 06:31:00 +08:00
fi
if test "x$CURL_DISABLE_IMAP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
2009-12-13 06:33:18 +08:00
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
fi
2009-12-13 06:31:00 +08:00
fi
2014-12-03 02:36:24 +08:00
if test "x$CURL_DISABLE_SMB" != "x1" \
2021-03-06 22:52:09 +08:00
-a "x$use_curl_ntlm_core" = "xyes"; then
2014-11-30 01:59:29 +08:00
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
fi
fi
2009-12-13 06:31:00 +08:00
if test "x$CURL_DISABLE_SMTP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
2009-12-13 06:33:18 +08:00
if test "x$SSL_ENABLED" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
fi
2009-12-13 06:31:00 +08:00
fi
2008-09-02 20:07:08 +08:00
if test "x$USE_LIBSSH2" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
2017-10-23 19:49:23 +08:00
if test "x$USE_LIBSSH" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
2017-11-01 01:30:36 +08:00
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
2017-10-23 19:49:23 +08:00
fi
2020-01-05 17:51:39 +08:00
if test "x$USE_WOLFSSH" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
2010-01-21 21:58:30 +08:00
if test "x$CURL_DISABLE_RTSP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
fi
2010-05-13 05:07:20 +08:00
if test "x$USE_LIBRTMP" = "x1"; then
2010-05-16 04:13:17 +08:00
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
2010-05-13 05:07:20 +08:00
fi
2008-09-02 20:07:08 +08:00
2010-01-22 20:52:35 +08:00
dnl replace spaces with newlines
dnl sort the lines
dnl replace the newlines back to spaces
SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
2008-09-02 20:07:08 +08:00
AC_SUBST(SUPPORT_PROTOCOLS)
2008-10-07 21:13:34 +08:00
dnl squeeze whitespace out of some variables
2008-10-16 02:10:02 +08:00
squeeze CFLAGS
squeeze CPPFLAGS
squeeze DEFS
squeeze LDFLAGS
squeeze LIBS
squeeze LIBCURL_LIBS
2010-08-09 11:45:11 +08:00
squeeze CURL_NETWORK_LIBS
2012-11-29 01:31:23 +08:00
squeeze CURL_NETWORK_AND_TIME_LIBS
2008-10-07 21:13:34 +08:00
2010-01-23 00:38:32 +08:00
squeeze SUPPORT_FEATURES
squeeze SUPPORT_PROTOCOLS
2013-01-21 03:23:20 +08:00
XC_CHECK_BUILD_FLAGS
2012-12-22 00:26:19 +08:00
2017-11-30 15:57:36 +08:00
SSL_BACKENDS=${ssl_backends}
AC_SUBST(SSL_BACKENDS)
2009-06-10 01:59:28 +08:00
if test "x$want_curldebug_assumed" = "xyes" &&
2010-01-26 23:07:40 +08:00
test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
2009-05-26 22:50:45 +08:00
ac_configure_args="$ac_configure_args --enable-curldebug"
fi
2001-05-23 02:16:24 +08:00
AC_CONFIG_FILES([Makefile \
2007-08-21 03:33:46 +08:00
docs/Makefile \
2001-01-08 21:39:21 +08:00
docs/examples/Makefile \
2002-03-04 18:28:02 +08:00
docs/libcurl/Makefile \
2014-06-17 06:29:02 +08:00
docs/libcurl/opts/Makefile \
2016-12-17 07:23:04 +08:00
docs/cmdline-opts/Makefile \
2007-08-21 03:33:46 +08:00
include/Makefile \
include/curl/Makefile \
src/Makefile \
2000-11-10 22:42:06 +08:00
lib/Makefile \
2015-11-20 12:56:10 +08:00
scripts/Makefile \
2011-12-16 22:33:48 +08:00
lib/libcurl.vers \
2022-04-20 21:26:13 +08:00
lib/libcurl.plist \
2001-01-08 18:00:14 +08:00
tests/Makefile \
2022-11-29 23:41:15 +08:00
tests/config \
2013-01-16 02:40:41 +08:00
tests/certs/Makefile \
tests/certs/scripts/Makefile \
2001-01-09 01:38:23 +08:00
tests/data/Makefile \
2002-02-25 20:45:48 +08:00
tests/server/Makefile \
2002-12-16 18:31:25 +08:00
tests/libtest/Makefile \
2011-01-02 00:33:42 +08:00
tests/unit/Makefile \
2023-03-01 23:55:31 +08:00
tests/http/config.ini \
tests/http/Makefile \
2023-04-26 18:38:22 +08:00
tests/http/clients/Makefile \
2007-08-21 03:33:46 +08:00
packages/Makefile \
2004-03-15 18:10:24 +08:00
packages/vms/Makefile \
2004-12-12 02:47:22 +08:00
curl-config \
libcurl.pc
2001-05-23 02:16:24 +08:00
])
AC_OUTPUT
2004-04-26 20:29:30 +08:00
2010-11-26 04:05:20 +08:00
CURL_GENERATE_CONFIGUREHELP_PM
2004-04-26 20:29:30 +08:00
AC_MSG_NOTICE([Configured to build curl/libcurl:
2012-02-06 01:44:22 +08:00
Host setup: ${host}
Install prefix: ${prefix}
Compiler: ${CC}
2018-11-01 15:17:28 +08:00
CFLAGS: ${CFLAGS}
CPPFLAGS: ${CPPFLAGS}
LDFLAGS: ${LDFLAGS}
LIBS: ${LIBS}
curl version: ${CURLVERSION}
2019-03-03 18:17:52 +08:00
SSL: ${curl_ssl_msg}
SSH: ${curl_ssh_msg}
zlib: ${curl_zlib_msg}
brotli: ${curl_brotli_msg}
2020-05-25 23:49:46 +08:00
zstd: ${curl_zstd_msg}
2019-03-03 18:17:52 +08:00
GSS-API: ${curl_gss_msg}
2020-12-25 02:48:45 +08:00
GSASL: ${curl_gsasl_msg}
2019-03-03 18:17:52 +08:00
TLS-SRP: ${curl_tls_srp_msg}
2012-02-06 01:44:22 +08:00
resolver: ${curl_res_msg}
2019-03-03 18:17:52 +08:00
IPv6: ${curl_ipv6_msg}
Unix sockets: ${curl_unix_sockets_msg}
IDN: ${curl_idn_msg}
2012-02-06 01:44:22 +08:00
Build libcurl: Shared=${enable_shared}, Static=${enable_static}
Built-in manual: ${curl_manual_msg}
--libcurl option: ${curl_libcurl_msg}
Verbose errors: ${curl_verbose_msg}
2019-01-25 17:14:25 +08:00
Code coverage: ${curl_coverage_msg}
2019-03-03 18:17:52 +08:00
SSPI: ${curl_sspi_msg}
2016-02-25 14:55:38 +08:00
ca cert bundle: ${ca}${ca_warning}
ca cert path: ${capath}${capath_warning}
2015-03-24 20:25:17 +08:00
ca fallback: ${with_ca_fallback}
2019-03-03 18:17:52 +08:00
LDAP: ${curl_ldap_msg}
LDAPS: ${curl_ldaps_msg}
RTSP: ${curl_rtsp_msg}
RTMP: ${curl_rtmp_msg}
PSL: ${curl_psl_msg}
Alt-svc: ${curl_altsvc_msg}
2022-03-20 05:34:19 +08:00
Headers API: ${curl_headers_msg}
2021-03-08 15:30:32 +08:00
HSTS: ${curl_hsts_msg}
2020-12-14 21:10:32 +08:00
HTTP1: ${curl_h1_msg}
2019-03-03 18:17:52 +08:00
HTTP2: ${curl_h2_msg}
2019-07-22 05:48:58 +08:00
HTTP3: ${curl_h3_msg}
2020-09-29 16:13:18 +08:00
ECH: ${curl_ech_msg}
2022-09-09 21:11:13 +08:00
WebSockets: ${curl_ws_msg}
2012-02-06 01:44:22 +08:00
Protocols: ${SUPPORT_PROTOCOLS}
2019-02-14 18:45:49 +08:00
Features: ${SUPPORT_FEATURES}
2004-04-26 20:29:30 +08:00
])
2019-03-03 18:17:52 +08:00
if test -n "$experimental"; then
cat >&2 << _EOF
2019-07-22 05:48:58 +08:00
WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!
2019-03-03 18:17:52 +08:00
_EOF
fi