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