configure.ac (165297B)
1 #*************************************************************************** 2 # _ _ ____ _ 3 # Project ___| | | | _ \| | 4 # / __| | | | |_) | | 5 # | (__| |_| | _ <| |___ 6 # \___|\___/|_| \_\_____| 7 # 8 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 9 # 10 # This software is licensed as described in the file COPYING, which 11 # you should have received as part of this distribution. The terms 12 # are also available at https://curl.se/docs/copyright.html. 13 # 14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 # copies of the Software, and permit persons to whom the Software is 16 # furnished to do so, under the terms of the COPYING file. 17 # 18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 # KIND, either express or implied. 20 # 21 # SPDX-License-Identifier: curl 22 # 23 #*************************************************************************** 24 dnl Process this file with autoconf to produce a configure script. 25 26 AC_PREREQ(2.59) 27 28 dnl We don't know the version number "statically" so we use a dash here 29 AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/]) 30 31 XC_OVR_ZZ50 32 XC_OVR_ZZ60 33 CURL_OVERRIDE_AUTOCONF 34 35 dnl configure script copyright 36 AC_COPYRIGHT([Copyright (C) Daniel Stenberg, <daniel@haxx.se> 37 This configure script may be copied, distributed and modified under the 38 terms of the curl license; see COPYING for more details]) 39 40 AC_CONFIG_SRCDIR([lib/urldata.h]) 41 AC_CONFIG_HEADERS(lib/curl_config.h) 42 AH_TOP([/* !checksrc! disable COPYRIGHT all */]) 43 AC_CONFIG_MACRO_DIR([m4]) 44 AM_MAINTAINER_MODE 45 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 46 47 CURL_CHECK_OPTION_DEBUG 48 AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes) 49 CURL_CHECK_OPTION_OPTIMIZE 50 CURL_CHECK_OPTION_WARNINGS 51 CURL_CHECK_OPTION_WERROR 52 CURL_CHECK_OPTION_CURLDEBUG 53 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) 54 CURL_CHECK_OPTION_SYMBOL_HIDING 55 CURL_CHECK_OPTION_ARES 56 CURL_CHECK_OPTION_RT 57 CURL_CHECK_OPTION_HTTPSRR 58 CURL_CHECK_OPTION_ECH 59 CURL_CHECK_OPTION_SSLS_EXPORT 60 61 XC_CHECK_PATH_SEPARATOR 62 63 # 64 # save the configure arguments 65 # 66 CONFIGURE_OPTIONS="\"$ac_configure_args\"" 67 AC_SUBST(CONFIGURE_OPTIONS) 68 69 dnl SED is mandatory for configure process and libtool. 70 dnl Set it now, allowing it to be changed later. 71 if test -z "$SED"; then 72 dnl allow it to be overridden 73 AC_PATH_PROG([SED], [sed], [not_found], 74 [$PATH:/usr/bin:/usr/local/bin]) 75 if test -z "$SED" || test "$SED" = "not_found"; then 76 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.]) 77 fi 78 fi 79 AC_SUBST([SED]) 80 81 dnl GREP is mandatory for configure process and libtool. 82 dnl Set it now, allowing it to be changed later. 83 if test -z "$GREP"; then 84 dnl allow it to be overridden 85 AC_PATH_PROG([GREP], [grep], [not_found], 86 [$PATH:/usr/bin:/usr/local/bin]) 87 if test -z "$GREP" || test "$GREP" = "not_found"; then 88 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.]) 89 fi 90 fi 91 AC_SUBST([GREP]) 92 93 dnl 'grep -E' is mandatory for configure process and libtool. 94 dnl Set it now, allowing it to be changed later. 95 if test -z "$EGREP"; then 96 dnl allow it to be overridden 97 AC_MSG_CHECKING([that grep -E works]) 98 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then 99 EGREP="$GREP -E" 100 AC_MSG_RESULT([yes]) 101 else 102 AC_MSG_RESULT([no]) 103 AC_PATH_PROG([EGREP], [egrep], [not_found], 104 [$PATH:/usr/bin:/usr/local/bin]) 105 fi 106 fi 107 if test -z "$EGREP" || test "$EGREP" = "not_found"; then 108 AC_MSG_ERROR([grep -E is not working and egrep is not found in PATH. Cannot continue.]) 109 fi 110 AC_SUBST([EGREP]) 111 112 dnl AR is mandatory for configure process and libtool. 113 dnl This is target dependent, so check it as a tool. 114 if test -z "$AR"; then 115 dnl allow it to be overridden 116 AC_PATH_TOOL([AR], [ar], [not_found], 117 [$PATH:/usr/bin:/usr/local/bin]) 118 if test -z "$AR" || test "$AR" = "not_found"; then 119 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.]) 120 fi 121 fi 122 AC_SUBST([AR]) 123 124 AC_SUBST(libext) 125 126 dnl figure out the libcurl version 127 CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h` 128 XC_CHECK_PROG_CC 129 CURL_ATOMIC 130 131 dnl for --enable-code-coverage 132 CURL_COVERAGE 133 134 XC_AUTOMAKE 135 AC_MSG_CHECKING([curl version]) 136 AC_MSG_RESULT($CURLVERSION) 137 138 AC_SUBST(CURLVERSION) 139 140 dnl 141 dnl we extract the numerical version for curl-config only 142 VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h` 143 AC_SUBST(VERSIONNUM) 144 145 dnl 146 dnl initialize all the info variables 147 curl_ssl_msg="no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,amissl,rustls} )" 148 curl_ssh_msg="no (--with-{libssh,libssh2})" 149 curl_zlib_msg="no (--with-zlib)" 150 curl_brotli_msg="no (--with-brotli)" 151 curl_zstd_msg="no (--with-zstd)" 152 curl_gss_msg="no (--with-gssapi)" 153 curl_gsasl_msg="no (--with-gsasl)" 154 curl_tls_srp_msg="no (--enable-tls-srp)" 155 curl_res_msg="blocking (--enable-ares / --enable-threaded-resolver)" 156 curl_ipv6_msg="no (--enable-ipv6)" 157 curl_unix_sockets_msg="no (--enable-unix-sockets)" 158 curl_idn_msg="no (--with-{libidn2,winidn})" 159 curl_docs_msg="enabled (--disable-docs)" 160 curl_manual_msg="no (--enable-manual)" 161 curl_libcurl_msg="enabled (--disable-libcurl-option)" 162 curl_verbose_msg="enabled (--disable-verbose)" 163 curl_sspi_msg="no (--enable-sspi)" 164 curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" 165 curl_ldaps_msg="no (--enable-ldaps)" 166 curl_ipfs_msg="no (--enable-ipfs)" 167 curl_rtsp_msg="no (--enable-rtsp)" 168 curl_rtmp_msg="no (--with-librtmp)" 169 curl_psl_msg="no (--with-libpsl)" 170 curl_altsvc_msg="enabled (--disable-alt-svc)" 171 curl_headers_msg="enabled (--disable-headers-api)" 172 curl_hsts_msg="enabled (--disable-hsts)" 173 ssl_backends= 174 curl_h1_msg="enabled (internal)" 175 curl_h2_msg="no (--with-nghttp2)" 176 curl_h3_msg="no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic, --with-msh3)" 177 178 enable_altsvc="yes" 179 hsts="yes" 180 181 dnl 182 dnl Save some initial values the user might have provided 183 dnl 184 INITIAL_LDFLAGS=$LDFLAGS 185 INITIAL_LIBS=$LIBS 186 187 dnl 188 dnl Generates a shell script to run the compiler with LD_LIBRARY_PATH set to 189 dnl the value used right now. This lets CURL_RUN_IFELSE set LD_LIBRARY_PATH to 190 dnl something different but only have that affect the execution of the results 191 dnl of the compile, not change the libraries for the compiler itself. 192 dnl 193 compilersh="run-compiler" 194 CURL_SAVED_CC="$CC" 195 export CURL_SAVED_CC 196 CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" 197 export CURL_SAVED_LD_LIBRARY_PATH 198 cat <<\EOF > "$compilersh" 199 CC="$CURL_SAVED_CC" 200 export CC 201 LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH" 202 export LD_LIBRARY_PATH 203 exec $CC "$@" 204 EOF 205 206 dnl ********************************************************************** 207 dnl See which TLS backend(s) that are requested. Just do all the 208 dnl TLS AC_ARG_WITH() invokes here and do the checks later 209 dnl ********************************************************************** 210 OPT_SCHANNEL=no 211 AC_ARG_WITH(schannel,dnl 212 AS_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]), 213 OPT_SCHANNEL=$withval 214 TLSCHOICE="schannel") 215 216 OPT_AMISSL=no 217 AC_ARG_WITH(amissl,dnl 218 AS_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]),[ 219 OPT_AMISSL=$withval 220 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }AmiSSL" 221 ]) 222 223 OPT_OPENSSL=no 224 dnl Default to no CA bundle 225 ca="no" 226 AC_ARG_WITH(ssl,dnl 227 AS_HELP_STRING([--with-ssl=PATH],[old version of --with-openssl]) 228 AS_HELP_STRING([--without-ssl], [build without any TLS library]),[ 229 OPT_SSL=$withval 230 OPT_OPENSSL=$withval 231 if test X"$withval" != Xno; then 232 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" 233 else 234 SSL_DISABLED="D" 235 fi 236 ]) 237 238 AC_ARG_WITH(openssl,dnl 239 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]),[ 240 OPT_OPENSSL=$withval 241 if test X"$withval" != Xno; then 242 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }OpenSSL" 243 fi 244 ]) 245 246 OPT_GNUTLS=no 247 AC_ARG_WITH(gnutls,dnl 248 AS_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]),[ 249 OPT_GNUTLS=$withval 250 if test X"$withval" != Xno; then 251 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }GnuTLS" 252 fi 253 ]) 254 255 OPT_MBEDTLS=no 256 AC_ARG_WITH(mbedtls,dnl 257 AS_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]),[ 258 OPT_MBEDTLS=$withval 259 if test X"$withval" != Xno; then 260 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }mbedTLS" 261 fi 262 ]) 263 264 OPT_WOLFSSL=no 265 AC_ARG_WITH(wolfssl,dnl 266 AS_HELP_STRING([--with-wolfssl=PATH],[where to look for wolfSSL, PATH points to the installation root (default: system lib default)]),[ 267 OPT_WOLFSSL=$withval 268 if test X"$withval" != Xno; then 269 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }wolfSSL" 270 fi 271 ]) 272 273 OPT_RUSTLS=no 274 AC_ARG_WITH(rustls,dnl 275 AS_HELP_STRING([--with-rustls=PATH],[where to look for Rustls, PATH points to the installation root]),[ 276 OPT_RUSTLS=$withval 277 if test X"$withval" != Xno; then 278 TLSCHOICE="${TLSCHOICE:+$TLSCHOICE, }rustls" 279 experimental="$experimental rustls" 280 fi 281 ]) 282 283 TEST_NGHTTPX=nghttpx 284 AC_ARG_WITH(test-nghttpx,dnl 285 AS_HELP_STRING([--with-test-nghttpx=PATH],[where to find nghttpx for testing]), 286 TEST_NGHTTPX=$withval 287 if test X"$TEST_NGHTTPX" = "Xno"; then 288 TEST_NGHTTPX="" 289 fi 290 ) 291 AC_SUBST(TEST_NGHTTPX) 292 293 if test -x /usr/bin/caddy; then 294 CADDY=/usr/bin/caddy 295 elif test -x /usr/local/bin/caddy; then 296 CADDY=/usr/local/bin/caddy 297 elif test -x "`brew --prefix 2>/dev/null`/bin/caddy"; then 298 CADDY=`brew --prefix`/bin/caddy 299 fi 300 AC_ARG_WITH(test-caddy,dnl 301 AS_HELP_STRING([--with-test-caddy=PATH],[where to find caddy for testing]), 302 CADDY=$withval 303 if test X"$CADDY" = "Xno"; then 304 CADDY="" 305 fi 306 ) 307 AC_SUBST(CADDY) 308 309 if test -x /usr/sbin/vsftpd; then 310 VSFTPD=/usr/sbin/vsftpd 311 elif test -x /usr/local/sbin/vsftpd; then 312 VSFTPD=/usr/local/sbin/vsftpd 313 elif test -x "`brew --prefix 2>/dev/null`/sbin/vsftpd"; then 314 VSFTPD=`brew --prefix`/sbin/vsftpd 315 fi 316 AC_ARG_WITH(test-vsftpd,dnl 317 AS_HELP_STRING([--with-test-vsftpd=PATH],[where to find vsftpd for testing]), 318 VSFTPD=$withval 319 if test X"$VSFTPD" = "Xno"; then 320 VSFTPD="" 321 fi 322 ) 323 AC_SUBST(VSFTPD) 324 325 dnl we'd like a httpd as test server 326 dnl 327 HTTPD_ENABLED="maybe" 328 AC_ARG_WITH(test-httpd, [AS_HELP_STRING([--with-test-httpd=PATH], 329 [where to find httpd/apache2 for testing])], 330 [request_httpd=$withval], [request_httpd=check]) 331 if test x"$request_httpd" = "xcheck" -o x"$request_httpd" = "xyes"; then 332 if test -x "/usr/sbin/apache2"; then 333 # common location on distros (debian/ubuntu) 334 HTTPD="/usr/sbin/apache2" 335 AC_PATH_PROG([APXS], [apxs]) 336 if test "x$APXS" = "x"; then 337 AC_MSG_NOTICE([apache2-dev not installed, httpd tests disabled]) 338 HTTPD_ENABLED="no" 339 fi 340 else 341 AC_PATH_PROG([HTTPD], [httpd]) 342 if test "x$HTTPD" = "x"; then 343 AC_PATH_PROG([HTTPD], [apache2]) 344 fi 345 AC_PATH_PROG([APXS], [apxs]) 346 if test "x$HTTPD" = "x"; then 347 AC_MSG_NOTICE([httpd/apache2 not in PATH, http tests disabled]) 348 HTTPD_ENABLED="no" 349 fi 350 if test "x$APXS" = "x"; then 351 AC_MSG_NOTICE([apxs not in PATH, http tests disabled]) 352 HTTPD_ENABLED="no" 353 fi 354 fi 355 elif test x"$request_httpd" != "xno"; then 356 HTTPD="${request_httpd}/bin/httpd" 357 APXS="${request_httpd}/bin/apxs" 358 if test ! -x "${HTTPD}"; then 359 AC_MSG_NOTICE([httpd not found as ${HTTPD}, http tests disabled]) 360 HTTPD_ENABLED="no" 361 elif test ! -x "${APXS}"; then 362 AC_MSG_NOTICE([apxs not found as ${APXS}, http tests disabled]) 363 HTTPD_ENABLED="no" 364 else 365 AC_MSG_NOTICE([using HTTPD=$HTTPD for tests]) 366 fi 367 fi 368 if test x"$HTTPD_ENABLED" = "xno"; then 369 HTTPD="" 370 APXS="" 371 fi 372 AC_SUBST(HTTPD) 373 AC_SUBST(APXS) 374 375 dnl the nghttpx we might use in httpd testing 376 if test "x$TEST_NGHTTPX" != "x" -a "x$TEST_NGHTTPX" != "xnghttpx"; then 377 HTTPD_NGHTTPX="$TEST_NGHTTPX" 378 else 379 AC_PATH_PROG([HTTPD_NGHTTPX], [nghttpx], [], 380 [$PATH:/usr/bin:/usr/local/bin]) 381 fi 382 AC_SUBST(HTTPD_NGHTTPX) 383 384 dnl the Caddy server we might use in testing 385 if test "x$TEST_CADDY" != "x"; then 386 CADDY="$TEST_CADDY" 387 else 388 AC_PATH_PROG([CADDY], [caddy]) 389 fi 390 AC_SUBST(CADDY) 391 392 dnl If no TLS choice has been made, check if it was explicitly disabled or 393 dnl error out to force the user to decide. 394 if test -z "$TLSCHOICE"; then 395 if test "x$OPT_SSL" != "xno"; then 396 AC_MSG_ERROR([select TLS backend(s) or disable TLS with --without-ssl. 397 398 Select from these: 399 400 --with-amissl 401 --with-gnutls 402 --with-mbedtls 403 --with-openssl (also works for BoringSSL and LibreSSL) 404 --with-rustls 405 --with-schannel 406 --with-wolfssl 407 ]) 408 fi 409 fi 410 411 AC_ARG_WITH(darwinssl,, 412 AC_MSG_ERROR([--with-darwin-ssl and --without-darwin-ssl no longer work!])) 413 414 dnl 415 dnl Detect the canonical host and target build environment 416 dnl 417 418 AC_CANONICAL_HOST 419 dnl Get system canonical name 420 AC_DEFINE_UNQUOTED(CURL_OS, "${host}", [cpu-machine-OS]) 421 422 # Silence warning: ar: 'u' modifier ignored since 'D' is the default 423 AC_SUBST(AR_FLAGS, [cr]) 424 425 dnl This defines _ALL_SOURCE for AIX 426 CURL_CHECK_AIX_ALL_SOURCE 427 428 dnl Our configure and build reentrant settings 429 CURL_CONFIGURE_THREAD_SAFE 430 CURL_CONFIGURE_REENTRANT 431 432 dnl check for how to do large files 433 AC_SYS_LARGEFILE 434 435 XC_LIBTOOL 436 437 LT_LANG([Windows Resource]) 438 439 AM_CONDITIONAL(NOT_CURL_CI, test -z "$CURL_CI") 440 441 # 442 # Automake conditionals based on libtool related checks 443 # 444 445 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO], 446 [test "x$xc_lt_shlib_use_version_info" = 'xyes']) 447 AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED], 448 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes']) 449 AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT], 450 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes']) 451 452 # 453 # Due to libtool and automake machinery limitations of not allowing 454 # specifying separate CPPFLAGS or CFLAGS when compiling objects for 455 # inclusion of these in shared or static libraries, we are forced to 456 # build using separate configure runs for shared and static libraries 457 # on systems where different CPPFLAGS or CFLAGS are mandatory in order 458 # to compile objects for each kind of library. Notice that relying on 459 # the '-DPIC' CFLAG that libtool provides is not valid given that the 460 # user might for example choose to build static libraries with PIC. 461 # 462 463 # 464 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly 465 # targeting a static library and not building its shared counterpart. 466 # 467 468 AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB], 469 [test "x$xc_lt_build_static_only" = 'xyes']) 470 471 # 472 # Make staticlib CPPFLAG variable and its definition visible in output 473 # files unconditionally, providing an empty definition unless strictly 474 # targeting a static library and not building its shared counterpart. 475 # 476 477 LIBCURL_PC_CFLAGS_PRIVATE='-DCURL_STATICLIB' 478 AC_SUBST(LIBCURL_PC_CFLAGS_PRIVATE) 479 480 LIBCURL_PC_CFLAGS= 481 if test "x$xc_lt_build_static_only" = 'xyes'; then 482 LIBCURL_PC_CFLAGS="${LIBCURL_PC_CFLAGS_PRIVATE}" 483 fi 484 AC_SUBST([LIBCURL_PC_CFLAGS]) 485 486 487 dnl ********************************************************************** 488 dnl platform/compiler/architecture specific checks/flags 489 dnl ********************************************************************** 490 491 CURL_CHECK_COMPILER 492 CURL_CHECK_NATIVE_WINDOWS 493 494 curl_cv_wince='no' 495 curl_cv_winuwp='no' 496 if test "$curl_cv_native_windows" = "yes"; then 497 case $host_os in 498 mingw32ce*) curl_cv_wince='yes';; 499 esac 500 case "$CPPFLAGS" in 501 *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';; 502 esac 503 fi 504 505 CURL_SET_COMPILER_BASIC_OPTS 506 CURL_SET_COMPILER_DEBUG_OPTS 507 CURL_SET_COMPILER_OPTIMIZE_OPTS 508 CURL_SET_COMPILER_WARNING_OPTS 509 510 if test "$compiler_id" = "INTEL_UNIX_C"; then 511 # 512 if test "$compiler_num" -ge "1000"; then 513 dnl icc 10.X or later 514 CFLAGS="$CFLAGS -shared-intel" 515 elif test "$compiler_num" -ge "900"; then 516 dnl icc 9.X specific 517 CFLAGS="$CFLAGS -i-dynamic" 518 fi 519 # 520 fi 521 522 CURL_CFLAG_EXTRAS="" 523 if test X"$want_werror" = Xyes; then 524 CURL_CFLAG_EXTRAS="-Werror" 525 if test "$compiler_id" = "GNU_C"; then 526 dnl enable -pedantic-errors for GCC 5 and later, 527 dnl as before that it was the same as -Werror=pedantic 528 if test "$compiler_num" -ge "500"; then 529 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" 530 fi 531 elif test "$compiler_id" = "CLANG" -o "$compiler_id" = "APPLECLANG"; then 532 CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" 533 fi 534 fi 535 AC_SUBST(CURL_CFLAG_EXTRAS) 536 AM_CONDITIONAL(CURL_WERROR, test X"$want_werror" = Xyes) 537 538 CURL_CHECK_COMPILER_HALT_ON_ERROR 539 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE 540 CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH 541 CURL_CHECK_COMPILER_SYMBOL_HIDING 542 543 supports_unittests=yes 544 # cross-compilation of unit tests static library/programs fails when 545 # libcurl shared library is built. This might be due to a libtool or 546 # automake issue. In this case we disable unit tests. 547 if test "x$cross_compiling" != "xno" && 548 test "x$enable_shared" != "xno"; then 549 supports_unittests=no 550 fi 551 552 # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to 553 # a problem related with OpenSSL headers and library versions not matching. 554 # Disable unit tests while time to further investigate this is found. 555 case $host in 556 mips-sgi-irix6.5) 557 if test "$compiler_id" = "GNU_C"; then 558 supports_unittests=no 559 fi 560 ;; 561 esac 562 563 # All AIX autobuilds fails unit tests linking against unittests library 564 # due to unittests library being built with no symbols or members. Libtool ? 565 # Disable unit tests while time to further investigate this is found. 566 case $host_os in 567 aix*) 568 supports_unittests=no 569 ;; 570 esac 571 572 AM_CONDITIONAL(BUILD_UNITTESTS, test x$supports_unittests = xyes) 573 574 # In order to detect support of sendmmsg() and accept4(), we need to escape the POSIX 575 # jail by defining _GNU_SOURCE or <sys/socket.h> will not expose it. 576 case $host_os in 577 *linux*|cygwin*|msys*) 578 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" 579 ;; 580 esac 581 582 dnl ********************************************************************** 583 dnl Compilation based checks should not be done before this point. 584 dnl ********************************************************************** 585 586 CURL_CHECK_WIN32_LARGEFILE 587 CURL_CHECK_WIN32_CRYPTO 588 589 curl_cv_apple='no' 590 case $host in 591 *-apple-*) curl_cv_apple='yes';; 592 esac 593 594 if test "$curl_cv_apple" = 'yes'; then 595 CURL_DARWIN_CFLAGS 596 CURL_SUPPORTS_BUILTIN_AVAILABLE 597 fi 598 599 curl_cv_cygwin='no' 600 case $host_os in 601 cygwin*|msys*) curl_cv_cygwin='yes';; 602 esac 603 604 AM_CONDITIONAL([HAVE_WINDRES], 605 [test "$curl_cv_native_windows" = "yes" && test -n "${RC}"]) 606 607 if test "$curl_cv_native_windows" = "yes"; then 608 AM_COND_IF([HAVE_WINDRES],, 609 [AC_MSG_ERROR([windres not found in PATH. Windows builds require windres. Cannot continue.])]) 610 fi 611 612 dnl ---------------------------------------- 613 dnl whether use "unity" mode for lib and src 614 dnl ---------------------------------------- 615 616 want_unity='no' 617 AC_MSG_CHECKING([whether to build libcurl and curl in "unity" mode]) 618 AC_ARG_ENABLE(unity, 619 AS_HELP_STRING([--enable-unity],[Enable unity mode]) 620 AS_HELP_STRING([--disable-unity],[Disable unity (default)]), 621 [ case "$enableval" in 622 yes) 623 want_unity='yes' 624 AC_MSG_RESULT([yes]) 625 ;; 626 *) 627 AC_MSG_RESULT([no]) 628 ;; 629 esac ], 630 AC_MSG_RESULT([no]) 631 ) 632 633 AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = 'yes']) 634 635 dnl ************************************************************ 636 dnl switch off particular protocols 637 dnl 638 AC_MSG_CHECKING([whether to support http]) 639 AC_ARG_ENABLE(http, 640 AS_HELP_STRING([--enable-http],[Enable HTTP support]) 641 AS_HELP_STRING([--disable-http],[Disable HTTP support]), 642 [ case "$enableval" in 643 no) 644 AC_MSG_RESULT(no) 645 AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) 646 disable_http="yes" 647 AC_MSG_WARN([disable HTTP disables FTP over proxy, IPFS and RTSP]) 648 CURL_DISABLE_HTTP=1 649 AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS]) 650 CURL_DISABLE_IPFS=1 651 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) 652 CURL_DISABLE_RTSP=1 653 dnl toggle off alt-svc too when HTTP is disabled 654 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) 655 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS]) 656 curl_h1_msg="no (--enable-http)" 657 curl_altsvc_msg="no"; 658 curl_hsts_msg="no (--enable-hsts)"; 659 enable_altsvc="no" 660 hsts="no" 661 ;; 662 *) 663 AC_MSG_RESULT(yes) 664 ;; 665 esac ], 666 AC_MSG_RESULT(yes) 667 ) 668 AC_MSG_CHECKING([whether to support ftp]) 669 AC_ARG_ENABLE(ftp, 670 AS_HELP_STRING([--enable-ftp],[Enable FTP support]) 671 AS_HELP_STRING([--disable-ftp],[Disable FTP support]), 672 [ case "$enableval" in 673 no) 674 AC_MSG_RESULT(no) 675 AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) 676 CURL_DISABLE_FTP=1 677 ;; 678 *) 679 AC_MSG_RESULT(yes) 680 ;; 681 esac ], 682 AC_MSG_RESULT(yes) 683 ) 684 AC_MSG_CHECKING([whether to support file]) 685 AC_ARG_ENABLE(file, 686 AS_HELP_STRING([--enable-file],[Enable FILE support]) 687 AS_HELP_STRING([--disable-file],[Disable FILE support]), 688 [ case "$enableval" in 689 no) 690 AC_MSG_RESULT(no) 691 AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) 692 CURL_DISABLE_FILE=1 693 ;; 694 *) 695 AC_MSG_RESULT(yes) 696 ;; 697 esac ], 698 AC_MSG_RESULT(yes) 699 ) 700 AC_MSG_CHECKING([whether to support IPFS]) 701 AC_ARG_ENABLE(ipfs, 702 AS_HELP_STRING([--enable-ipfs],[Enable IPFS support]) 703 AS_HELP_STRING([--disable-ipfs],[Disable IPFS support]), 704 [ case "$enableval" in 705 no) 706 AC_MSG_RESULT(no) 707 AC_DEFINE(CURL_DISABLE_IPFS, 1, [to disable IPFS]) 708 CURL_DISABLE_IPFS=1 709 ;; 710 *) 711 if test x$CURL_DISABLE_HTTP = x1; then 712 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable IPFS support!) 713 else 714 AC_MSG_RESULT(yes) 715 curl_ipfs_msg="enabled" 716 fi 717 ;; 718 esac ], 719 if test "x$CURL_DISABLE_HTTP" != "x1"; then 720 AC_MSG_RESULT(yes) 721 curl_ipfs_msg="enabled" 722 else 723 AC_MSG_RESULT(no) 724 fi 725 ) 726 AC_MSG_CHECKING([whether to support ldap]) 727 AC_ARG_ENABLE(ldap, 728 AS_HELP_STRING([--enable-ldap],[Enable LDAP support]) 729 AS_HELP_STRING([--disable-ldap],[Disable LDAP support]), 730 [ case "$enableval" in 731 no) 732 AC_MSG_RESULT(no) 733 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) 734 CURL_DISABLE_LDAP=1 735 ;; 736 yes) 737 ldap_askedfor="yes" 738 AC_MSG_RESULT(yes) 739 ;; 740 *) 741 AC_MSG_RESULT(yes) 742 ;; 743 esac ],[ 744 AC_MSG_RESULT(yes) ] 745 ) 746 AC_MSG_CHECKING([whether to support ldaps]) 747 AC_ARG_ENABLE(ldaps, 748 AS_HELP_STRING([--enable-ldaps],[Enable LDAPS support]) 749 AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), 750 [ case "$enableval" in 751 no) 752 AC_MSG_RESULT(no) 753 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) 754 CURL_DISABLE_LDAPS=1 755 ;; 756 *) 757 if test "x$CURL_DISABLE_LDAP" = "x1"; then 758 AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) 759 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) 760 CURL_DISABLE_LDAPS=1 761 else 762 AC_MSG_RESULT(yes) 763 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) 764 HAVE_LDAP_SSL=1 765 fi 766 ;; 767 esac ],[ 768 if test "x$CURL_DISABLE_LDAP" = "x1"; then 769 AC_MSG_RESULT(no) 770 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) 771 CURL_DISABLE_LDAPS=1 772 else 773 AC_MSG_RESULT(yes) 774 AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) 775 HAVE_LDAP_SSL=1 776 fi ] 777 ) 778 779 AC_MSG_CHECKING([whether to support rtsp]) 780 AC_ARG_ENABLE(rtsp, 781 AS_HELP_STRING([--enable-rtsp],[Enable RTSP support]) 782 AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]), 783 [ case "$enableval" in 784 no) 785 AC_MSG_RESULT(no) 786 AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) 787 CURL_DISABLE_RTSP=1 788 ;; 789 *) 790 if test x$CURL_DISABLE_HTTP = x1; then 791 AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!) 792 else 793 AC_MSG_RESULT(yes) 794 curl_rtsp_msg="enabled" 795 fi 796 ;; 797 esac ], 798 if test "x$CURL_DISABLE_HTTP" != "x1"; then 799 AC_MSG_RESULT(yes) 800 curl_rtsp_msg="enabled" 801 else 802 AC_MSG_RESULT(no) 803 fi 804 ) 805 806 AC_MSG_CHECKING([whether to support proxies]) 807 AC_ARG_ENABLE(proxy, 808 AS_HELP_STRING([--enable-proxy],[Enable proxy support]) 809 AS_HELP_STRING([--disable-proxy],[Disable proxy support]), 810 [ case "$enableval" in 811 no) 812 AC_MSG_RESULT(no) 813 AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) 814 CURL_DISABLE_PROXY=1 815 https_proxy="no" 816 ;; 817 *) 818 AC_MSG_RESULT(yes) 819 ;; 820 esac ], 821 AC_MSG_RESULT(yes) 822 ) 823 824 AC_MSG_CHECKING([whether to support dict]) 825 AC_ARG_ENABLE(dict, 826 AS_HELP_STRING([--enable-dict],[Enable DICT support]) 827 AS_HELP_STRING([--disable-dict],[Disable DICT support]), 828 [ case "$enableval" in 829 no) 830 AC_MSG_RESULT(no) 831 AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) 832 CURL_DISABLE_DICT=1 833 ;; 834 *) 835 AC_MSG_RESULT(yes) 836 ;; 837 esac ], 838 AC_MSG_RESULT(yes) 839 ) 840 841 AC_MSG_CHECKING([whether to support telnet]) 842 AC_ARG_ENABLE(telnet, 843 AS_HELP_STRING([--enable-telnet],[Enable TELNET support]) 844 AS_HELP_STRING([--disable-telnet],[Disable TELNET support]), 845 [ case "$enableval" in 846 no) 847 AC_MSG_RESULT(no) 848 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) 849 CURL_DISABLE_TELNET=1 850 ;; 851 *) 852 AC_MSG_RESULT(yes) 853 ;; 854 esac ], 855 AC_MSG_RESULT(yes) 856 ) 857 858 if test "$curl_cv_winuwp" = 'yes' -o "$curl_cv_wince" = 'yes'; then 859 AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) 860 CURL_DISABLE_TELNET=1 861 fi 862 863 AC_MSG_CHECKING([whether to support tftp]) 864 AC_ARG_ENABLE(tftp, 865 AS_HELP_STRING([--enable-tftp],[Enable TFTP support]) 866 AS_HELP_STRING([--disable-tftp],[Disable TFTP support]), 867 [ case "$enableval" in 868 no) 869 AC_MSG_RESULT(no) 870 AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) 871 CURL_DISABLE_TFTP=1 872 ;; 873 *) 874 AC_MSG_RESULT(yes) 875 ;; 876 esac ], 877 AC_MSG_RESULT(yes) 878 ) 879 880 AC_MSG_CHECKING([whether to support pop3]) 881 AC_ARG_ENABLE(pop3, 882 AS_HELP_STRING([--enable-pop3],[Enable POP3 support]) 883 AS_HELP_STRING([--disable-pop3],[Disable POP3 support]), 884 [ case "$enableval" in 885 no) 886 AC_MSG_RESULT(no) 887 AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3]) 888 CURL_DISABLE_POP3=1 889 ;; 890 *) 891 AC_MSG_RESULT(yes) 892 ;; 893 esac ], 894 AC_MSG_RESULT(yes) 895 ) 896 897 AC_MSG_CHECKING([whether to support imap]) 898 AC_ARG_ENABLE(imap, 899 AS_HELP_STRING([--enable-imap],[Enable IMAP support]) 900 AS_HELP_STRING([--disable-imap],[Disable IMAP support]), 901 [ case "$enableval" in 902 no) 903 AC_MSG_RESULT(no) 904 AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP]) 905 CURL_DISABLE_IMAP=1 906 ;; 907 *) 908 AC_MSG_RESULT(yes) 909 ;; 910 esac ], 911 AC_MSG_RESULT(yes) 912 ) 913 914 AC_MSG_CHECKING([whether to support smb]) 915 AC_ARG_ENABLE(smb, 916 AS_HELP_STRING([--enable-smb],[Enable SMB/CIFS support]) 917 AS_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]), 918 [ case "$enableval" in 919 no) 920 AC_MSG_RESULT(no) 921 AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS]) 922 CURL_DISABLE_SMB=1 923 ;; 924 *) 925 AC_MSG_RESULT(yes) 926 ;; 927 esac ], 928 AC_MSG_RESULT(yes) 929 ) 930 931 AC_MSG_CHECKING([whether to support smtp]) 932 AC_ARG_ENABLE(smtp, 933 AS_HELP_STRING([--enable-smtp],[Enable SMTP support]) 934 AS_HELP_STRING([--disable-smtp],[Disable SMTP support]), 935 [ case "$enableval" in 936 no) 937 AC_MSG_RESULT(no) 938 AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP]) 939 CURL_DISABLE_SMTP=1 940 ;; 941 *) 942 AC_MSG_RESULT(yes) 943 ;; 944 esac ], 945 AC_MSG_RESULT(yes) 946 ) 947 948 AC_MSG_CHECKING([whether to support gopher]) 949 AC_ARG_ENABLE(gopher, 950 AS_HELP_STRING([--enable-gopher],[Enable Gopher support]) 951 AS_HELP_STRING([--disable-gopher],[Disable Gopher support]), 952 [ case "$enableval" in 953 no) 954 AC_MSG_RESULT(no) 955 AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher]) 956 CURL_DISABLE_GOPHER=1 957 ;; 958 *) 959 AC_MSG_RESULT(yes) 960 ;; 961 esac ], 962 AC_MSG_RESULT(yes) 963 ) 964 965 AC_MSG_CHECKING([whether to support mqtt]) 966 AC_ARG_ENABLE(mqtt, 967 AS_HELP_STRING([--enable-mqtt],[Enable MQTT support]) 968 AS_HELP_STRING([--disable-mqtt],[Disable MQTT support]), 969 [ case "$enableval" in 970 no) 971 AC_MSG_RESULT(no) 972 AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT]) 973 CURL_DISABLE_MQTT=1 974 ;; 975 *) 976 AC_MSG_RESULT(yes) 977 ;; 978 esac ], 979 AC_MSG_RESULT(no) 980 ) 981 982 dnl ********************************************************************** 983 dnl Check for built-in manual 984 dnl ********************************************************************** 985 986 AC_MSG_CHECKING([whether to provide built-in manual]) 987 AC_ARG_ENABLE(manual, 988 AS_HELP_STRING([--enable-manual],[Enable built-in manual]) 989 AS_HELP_STRING([--disable-manual],[Disable built-in manual]), 990 [ case "$enableval" in 991 no) 992 AC_MSG_RESULT(no) 993 ;; 994 *) 995 AC_MSG_RESULT(yes) 996 USE_MANUAL="1" 997 ;; 998 esac ], 999 AC_MSG_RESULT(yes) 1000 USE_MANUAL="1" 1001 ) 1002 dnl The actual use of the USE_MANUAL variable is done much later in this 1003 dnl script to allow other actions to disable it as well. 1004 1005 dnl ********************************************************************** 1006 dnl Check whether to build documentation 1007 dnl ********************************************************************** 1008 1009 AC_MSG_CHECKING([whether to build documentation]) 1010 AC_ARG_ENABLE(docs, 1011 AS_HELP_STRING([--enable-docs],[Enable documentation]) 1012 AS_HELP_STRING([--disable-docs],[Disable documentation]), 1013 [ case "$enableval" in 1014 no) 1015 AC_MSG_RESULT(no) 1016 BUILD_DOCS=0 1017 dnl disable manual too because it needs built documentation 1018 USE_MANUAL=0 1019 curl_docs_msg="no" 1020 ;; 1021 *) 1022 AC_MSG_RESULT(yes) 1023 BUILD_DOCS=1 1024 ;; 1025 esac ], 1026 AC_MSG_RESULT(yes) 1027 BUILD_DOCS=1 1028 ) 1029 1030 1031 dnl ************************************************************ 1032 dnl disable C code generation support 1033 dnl 1034 AC_MSG_CHECKING([whether to enable generation of C code]) 1035 AC_ARG_ENABLE(libcurl_option, 1036 AS_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support]) 1037 AS_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]), 1038 [ case "$enableval" in 1039 no) 1040 AC_MSG_RESULT(no) 1041 AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option]) 1042 curl_libcurl_msg="no" 1043 ;; 1044 *) 1045 AC_MSG_RESULT(yes) 1046 ;; 1047 esac ], 1048 AC_MSG_RESULT(yes) 1049 ) 1050 1051 dnl ********************************************************************** 1052 dnl Checks for libraries. 1053 dnl ********************************************************************** 1054 1055 AC_MSG_CHECKING([whether to use libgcc]) 1056 AC_ARG_ENABLE(libgcc, 1057 AS_HELP_STRING([--enable-libgcc],[use libgcc when linking]), 1058 [ case "$enableval" in 1059 yes) 1060 LIBS="-lgcc $LIBS" 1061 AC_MSG_RESULT(yes) 1062 ;; 1063 *) 1064 AC_MSG_RESULT(no) 1065 ;; 1066 esac ], 1067 AC_MSG_RESULT(no) 1068 ) 1069 1070 CURL_CHECK_LIB_XNET 1071 1072 dnl gethostbyname without lib or in the nsl lib? 1073 AC_CHECK_FUNC(gethostbyname, 1074 [ 1075 HAVE_GETHOSTBYNAME="1" 1076 ], 1077 [ 1078 AC_CHECK_LIB(nsl, gethostbyname, 1079 [ 1080 HAVE_GETHOSTBYNAME="1" 1081 LIBS="-lnsl $LIBS" 1082 ] 1083 ) 1084 ] 1085 ) 1086 1087 if test "$HAVE_GETHOSTBYNAME" != "1"; then 1088 dnl gethostbyname in the socket lib? 1089 AC_CHECK_LIB(socket, gethostbyname, 1090 [ 1091 HAVE_GETHOSTBYNAME="1" 1092 LIBS="-lsocket $LIBS" 1093 ] 1094 ) 1095 fi 1096 1097 if test "$HAVE_GETHOSTBYNAME" != "1"; then 1098 dnl gethostbyname in the watt lib? 1099 clean_CPPFLAGS=$CPPFLAGS 1100 clean_LDFLAGS=$LDFLAGS 1101 CPPFLAGS="-I${WATT_ROOT}/inc" 1102 LDFLAGS="-L${WATT_ROOT}/lib" 1103 AC_CHECK_LIB(watt, gethostbyname, 1104 [ 1105 HAVE_GETHOSTBYNAME="1" 1106 LIBS="-lwatt $LIBS" 1107 AC_DEFINE(USE_WATT32, 1, [if Watt-32 is in use]) 1108 ], 1109 [ 1110 CPPFLAGS=$clean_CPPFLAGS 1111 LDFLAGS=$clean_LDFLAGS 1112 ] 1113 ) 1114 fi 1115 1116 dnl At least one system has been identified to require BOTH nsl and socket 1117 dnl libs at the same time to link properly. 1118 if test "$HAVE_GETHOSTBYNAME" != "1"; then 1119 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) 1120 my_ac_save_LIBS=$LIBS 1121 LIBS="-lnsl -lsocket $LIBS" 1122 AC_LINK_IFELSE([ 1123 AC_LANG_PROGRAM([[ 1124 ]],[[ 1125 gethostbyname(); 1126 ]]) 1127 ],[ 1128 AC_MSG_RESULT([yes]) 1129 HAVE_GETHOSTBYNAME="1" 1130 ],[ 1131 AC_MSG_RESULT([no]) 1132 LIBS=$my_ac_save_LIBS 1133 ]) 1134 fi 1135 1136 if test "$HAVE_GETHOSTBYNAME" != "1"; then 1137 if test "$curl_cv_wince" = 'yes'; then 1138 dnl This is for Windows CE systems 1139 winsock_LIB="-lws2" 1140 if test ! -z "$winsock_LIB"; then 1141 my_ac_save_LIBS=$LIBS 1142 LIBS="$winsock_LIB $LIBS" 1143 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) 1144 AC_LINK_IFELSE([ 1145 AC_LANG_PROGRAM([[ 1146 #ifdef _WIN32 1147 #ifndef WIN32_LEAN_AND_MEAN 1148 #define WIN32_LEAN_AND_MEAN 1149 #endif 1150 #include <winsock2.h> 1151 #endif 1152 ]],[[ 1153 gethostbyname("localhost"); 1154 ]]) 1155 ],[ 1156 AC_MSG_RESULT([yes]) 1157 HAVE_GETHOSTBYNAME="1" 1158 ],[ 1159 AC_MSG_RESULT([no]) 1160 winsock_LIB="" 1161 LIBS=$my_ac_save_LIBS 1162 ]) 1163 fi 1164 fi 1165 fi 1166 1167 # In UWP mode gethostbyname gets detected via the core libs, but some 1168 # code (in6addr_any) still need ws2_32, so let us detect and add it. 1169 if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then 1170 if test "$curl_cv_native_windows" = "yes"; then 1171 dnl This is for Winsock systems 1172 winsock_LIB="-lws2_32" 1173 if test "$curl_cv_winuwp" != "yes"; then 1174 winsock_LIB="$winsock_LIB -liphlpapi" 1175 fi 1176 if test ! -z "$winsock_LIB"; then 1177 my_ac_save_LIBS=$LIBS 1178 LIBS="$winsock_LIB $LIBS" 1179 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) 1180 AC_LINK_IFELSE([ 1181 AC_LANG_PROGRAM([[ 1182 #ifdef _WIN32 1183 #ifndef WIN32_LEAN_AND_MEAN 1184 #define WIN32_LEAN_AND_MEAN 1185 #endif 1186 #include <winsock2.h> 1187 #endif 1188 ]],[[ 1189 gethostbyname("localhost"); 1190 ]]) 1191 ],[ 1192 AC_MSG_RESULT([yes]) 1193 HAVE_GETHOSTBYNAME="1" 1194 ],[ 1195 AC_MSG_RESULT([no]) 1196 winsock_LIB="" 1197 LIBS=$my_ac_save_LIBS 1198 ]) 1199 fi 1200 fi 1201 fi 1202 1203 if test "$HAVE_GETHOSTBYNAME" != "1"; then 1204 dnl This is for Minix 3.1 1205 AC_MSG_CHECKING([for gethostbyname for Minix 3]) 1206 AC_LINK_IFELSE([ 1207 AC_LANG_PROGRAM([[ 1208 /* Older Minix versions may need <net/gen/netdb.h> here instead */ 1209 #include <netdb.h> 1210 ]],[[ 1211 gethostbyname("localhost"); 1212 ]]) 1213 ],[ 1214 AC_MSG_RESULT([yes]) 1215 HAVE_GETHOSTBYNAME="1" 1216 ],[ 1217 AC_MSG_RESULT([no]) 1218 ]) 1219 fi 1220 1221 if test "$HAVE_GETHOSTBYNAME" != "1"; then 1222 dnl This is for eCos with a stubbed DNS implementation 1223 AC_MSG_CHECKING([for gethostbyname for eCos]) 1224 AC_LINK_IFELSE([ 1225 AC_LANG_PROGRAM([[ 1226 #include <stdio.h> 1227 #include <netdb.h> 1228 ]],[[ 1229 gethostbyname("localhost"); 1230 ]]) 1231 ],[ 1232 AC_MSG_RESULT([yes]) 1233 HAVE_GETHOSTBYNAME="1" 1234 ],[ 1235 AC_MSG_RESULT([no]) 1236 ]) 1237 fi 1238 1239 if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set; then 1240 dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet 1241 AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library]) 1242 AC_LINK_IFELSE([ 1243 AC_LANG_PROGRAM([[ 1244 #define __USE_INLINE__ 1245 #include <proto/bsdsocket.h> 1246 #ifdef __amigaos4__ 1247 struct SocketIFace *ISocket = NULL; 1248 #else 1249 struct Library *SocketBase = NULL; 1250 #endif 1251 ]],[[ 1252 unsigned char host[] = "localhost"; 1253 gethostbyname(host); 1254 ]]) 1255 ],[ 1256 AC_MSG_RESULT([yes]) 1257 HAVE_GETHOSTBYNAME="1" 1258 HAVE_PROTO_BSDSOCKET_H="1" 1259 AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use]) 1260 ],[ 1261 AC_MSG_RESULT([no]) 1262 ]) 1263 fi 1264 1265 if test "$HAVE_GETHOSTBYNAME" != "1"; then 1266 dnl gethostbyname in the network lib - for Haiku OS 1267 AC_CHECK_LIB(network, gethostbyname, 1268 [ 1269 HAVE_GETHOSTBYNAME="1" 1270 LIBS="-lnetwork $LIBS" 1271 ] 1272 ) 1273 fi 1274 1275 CURL_CHECK_LIBS_CONNECT 1276 1277 dnl ********************************************************************** 1278 dnl In case that function clock_gettime with monotonic timer is available, 1279 dnl check for additional required libraries. 1280 dnl ********************************************************************** 1281 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC 1282 1283 dnl Check for even better option 1284 CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW 1285 1286 dnl ********************************************************************** 1287 dnl The preceding library checks are all potentially useful for test 1288 dnl servers and libtest cases which require networking and clock_gettime 1289 dnl support. Save the list of required libraries at this point for use 1290 dnl while linking those test servers and programs. 1291 dnl ********************************************************************** 1292 CURL_NETWORK_AND_TIME_LIBS=$LIBS 1293 1294 dnl ********************************************************************** 1295 dnl Check for the presence of ZLIB libraries and headers 1296 dnl ********************************************************************** 1297 1298 dnl Check for & handle argument to --with-zlib. 1299 1300 clean_CPPFLAGS=$CPPFLAGS 1301 clean_LDFLAGS=$LDFLAGS 1302 clean_LIBS=$LIBS 1303 ZLIB_LIBS="" 1304 AC_ARG_WITH(zlib, 1305 AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) 1306 AS_HELP_STRING([--without-zlib],[disable use of zlib]), 1307 [OPT_ZLIB="$withval"]) 1308 1309 if test "$OPT_ZLIB" = "no"; then 1310 AC_MSG_WARN([zlib disabled]) 1311 else 1312 if test "$OPT_ZLIB" = "yes"; then 1313 OPT_ZLIB="" 1314 fi 1315 1316 if test -z "$OPT_ZLIB"; then 1317 CURL_CHECK_PKGCONFIG(zlib) 1318 1319 if test "$PKGCONFIG" != "no"; then 1320 ZLIB_LIBS="`$PKGCONFIG --libs-only-l zlib`" 1321 if test -n "$ZLIB_LIBS"; then 1322 LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`" 1323 else 1324 ZLIB_LIBS="`$PKGCONFIG --libs zlib`" 1325 fi 1326 LIBS="$ZLIB_LIBS $LIBS" 1327 CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags zlib`" 1328 OPT_ZLIB="" 1329 HAVE_LIBZ="1" 1330 fi 1331 1332 if test -z "$HAVE_LIBZ"; then 1333 1334 dnl Check for the lib without setting any new path, since many 1335 dnl people have it in the default path 1336 1337 AC_CHECK_LIB(z, inflateEnd, 1338 dnl libz found, set the variable 1339 [ 1340 HAVE_LIBZ="1" 1341 ZLIB_LIBS="-lz" 1342 LIBS="$ZLIB_LIBS $LIBS" 1343 ], 1344 dnl if no lib found, try /usr/local 1345 [ 1346 OPT_ZLIB="/usr/local" 1347 ] 1348 ) 1349 fi 1350 fi 1351 1352 dnl Add a nonempty path to the compiler flags 1353 if test -n "$OPT_ZLIB"; then 1354 CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" 1355 LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" 1356 fi 1357 1358 AC_CHECK_HEADER(zlib.h, 1359 [ 1360 dnl zlib.h was found 1361 HAVE_ZLIB_H="1" 1362 dnl if the lib wasn't found already, try again with the new paths 1363 if test "$HAVE_LIBZ" != "1"; then 1364 AC_CHECK_LIB(z, gzread, 1365 [ 1366 dnl the lib was found! 1367 HAVE_LIBZ="1" 1368 ZLIB_LIBS="-lz" 1369 LIBS="$ZLIB_LIBS $LIBS" 1370 ], 1371 [ 1372 CPPFLAGS=$clean_CPPFLAGS 1373 LDFLAGS=$clean_LDFLAGS 1374 ] 1375 ) 1376 fi 1377 ], 1378 [ 1379 dnl zlib.h was not found, restore the flags 1380 CPPFLAGS=$clean_CPPFLAGS 1381 LDFLAGS=$clean_LDFLAGS] 1382 ) 1383 1384 if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"; then 1385 AC_MSG_WARN([configure found only the libz lib, not the header file!]) 1386 HAVE_LIBZ="" 1387 CPPFLAGS=$clean_CPPFLAGS 1388 LDFLAGS=$clean_LDFLAGS 1389 LIBS=$clean_LIBS 1390 ZLIB_LIBS="" 1391 elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"; then 1392 AC_MSG_WARN([configure found only the libz header file, not the lib!]) 1393 CPPFLAGS=$clean_CPPFLAGS 1394 LDFLAGS=$clean_LDFLAGS 1395 LIBS=$clean_LIBS 1396 ZLIB_LIBS="" 1397 elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"; then 1398 dnl both header and lib were found! 1399 AC_SUBST(HAVE_LIBZ) 1400 AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available]) 1401 LIBS="$ZLIB_LIBS $clean_LIBS" 1402 1403 dnl replace 'HAVE_LIBZ' in the automake makefile.ams 1404 AMFIXLIB="1" 1405 AC_MSG_NOTICE([found both libz and libz.h header]) 1406 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE zlib" 1407 curl_zlib_msg="enabled" 1408 fi 1409 fi 1410 1411 dnl set variable for use in automakefile(s) 1412 AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1) 1413 AC_SUBST(ZLIB_LIBS) 1414 1415 dnl ********************************************************************** 1416 dnl Check for the presence of BROTLI decoder libraries and headers 1417 dnl ********************************************************************** 1418 1419 dnl Brotli project home page: https://github.com/google/brotli 1420 1421 dnl Default to compiler & linker defaults for BROTLI files & libraries. 1422 OPT_BROTLI=off 1423 AC_ARG_WITH(brotli,dnl 1424 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]) 1425 AS_HELP_STRING([--without-brotli], [disable BROTLI]), 1426 OPT_BROTLI=$withval) 1427 1428 if test X"$OPT_BROTLI" != Xno; then 1429 dnl backup the pre-brotli variables 1430 CLEANLDFLAGS="$LDFLAGS" 1431 CLEANLDFLAGSPC="$LDFLAGSPC" 1432 CLEANCPPFLAGS="$CPPFLAGS" 1433 CLEANLIBS="$LIBS" 1434 1435 case "$OPT_BROTLI" in 1436 yes) 1437 dnl --with-brotli (without path) used 1438 CURL_CHECK_PKGCONFIG(libbrotlidec) 1439 1440 if test "$PKGCONFIG" != "no"; then 1441 LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec` 1442 LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec` 1443 CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec` 1444 version=`$PKGCONFIG --modversion libbrotlidec` 1445 fi 1446 1447 CURL_CHECK_PKGCONFIG(libbrotlicommon) 1448 1449 if test "$PKGCONFIG" != "no"; then 1450 LIB_BROTLI="$LIB_BROTLI `$PKGCONFIG --libs-only-l libbrotlicommon`" 1451 LD_BROTLI="$LD_BROTLI `$PKGCONFIG --libs-only-L libbrotlicommon`" 1452 CPP_BROTLI="$CPP_BROTLI `$PKGCONFIG --cflags-only-I libbrotlicommon`" 1453 fi 1454 1455 DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'` 1456 ;; 1457 off) 1458 dnl no --with-brotli option given, just check default places 1459 ;; 1460 *) 1461 dnl use the given --with-brotli spot 1462 PREFIX_BROTLI=$OPT_BROTLI 1463 ;; 1464 esac 1465 1466 dnl if given with a prefix, we set -L and -I based on that 1467 if test -n "$PREFIX_BROTLI"; then 1468 LIB_BROTLI="-lbrotlidec -lbrotlicommon" 1469 LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff 1470 CPP_BROTLI=-I${PREFIX_BROTLI}/include 1471 DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff 1472 fi 1473 1474 LDFLAGS="$LDFLAGS $LD_BROTLI" 1475 LDFLAGSPC="$LDFLAGSPC $LD_BROTLI" 1476 CPPFLAGS="$CPPFLAGS $CPP_BROTLI" 1477 LIBS="$LIB_BROTLI $LIBS" 1478 1479 AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress) 1480 1481 AC_CHECK_HEADERS(brotli/decode.h, 1482 curl_brotli_msg="enabled (libbrotlidec)" 1483 HAVE_BROTLI=1 1484 AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use]) 1485 ) 1486 1487 if test X"$OPT_BROTLI" != Xoff && 1488 test "$HAVE_BROTLI" != "1"; then 1489 AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!]) 1490 fi 1491 1492 if test "$HAVE_BROTLI" = "1"; then 1493 if test -n "$DIR_BROTLI"; then 1494 dnl when the brotli shared libs were found in a path that the run-time 1495 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH 1496 dnl to prevent further configure tests to fail due to this 1497 1498 if test "x$cross_compiling" != "xyes"; then 1499 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI" 1500 export CURL_LIBRARY_PATH 1501 AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH]) 1502 fi 1503 fi 1504 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libbrotlidec libbrotlicommon" 1505 else 1506 dnl no brotli, revert back to clean variables 1507 LDFLAGS=$CLEANLDFLAGS 1508 LDFLAGSPC=$CLEANLDFLAGSPC 1509 CPPFLAGS=$CLEANCPPFLAGS 1510 LIBS=$CLEANLIBS 1511 fi 1512 fi 1513 1514 dnl ********************************************************************** 1515 dnl Check for libzstd 1516 dnl ********************************************************************** 1517 1518 dnl Default to compiler & linker defaults for libzstd 1519 OPT_ZSTD=off 1520 AC_ARG_WITH(zstd,dnl 1521 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]) 1522 AS_HELP_STRING([--without-zstd], [disable libzstd]), 1523 OPT_ZSTD=$withval) 1524 1525 if test X"$OPT_ZSTD" != Xno; then 1526 dnl backup the pre-zstd variables 1527 CLEANLDFLAGS="$LDFLAGS" 1528 CLEANLDFLAGSPC="$LDFLAGSPC" 1529 CLEANCPPFLAGS="$CPPFLAGS" 1530 CLEANLIBS="$LIBS" 1531 1532 case "$OPT_ZSTD" in 1533 yes) 1534 dnl --with-zstd (without path) used 1535 CURL_CHECK_PKGCONFIG(libzstd) 1536 1537 if test "$PKGCONFIG" != "no"; then 1538 LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd` 1539 LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd` 1540 CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd` 1541 version=`$PKGCONFIG --modversion libzstd` 1542 DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'` 1543 fi 1544 1545 ;; 1546 off) 1547 dnl no --with-zstd option given, just check default places 1548 ;; 1549 *) 1550 dnl use the given --with-zstd spot 1551 PREFIX_ZSTD=$OPT_ZSTD 1552 ;; 1553 esac 1554 1555 dnl if given with a prefix, we set -L and -I based on that 1556 if test -n "$PREFIX_ZSTD"; then 1557 LIB_ZSTD="-lzstd" 1558 LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff 1559 CPP_ZSTD=-I${PREFIX_ZSTD}/include 1560 DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff 1561 fi 1562 1563 LDFLAGS="$LDFLAGS $LD_ZSTD" 1564 LDFLAGSPC="$LDFLAGSPC $LD_ZSTD" 1565 CPPFLAGS="$CPPFLAGS $CPP_ZSTD" 1566 LIBS="$LIB_ZSTD $LIBS" 1567 1568 AC_CHECK_LIB(zstd, ZSTD_createDStream) 1569 1570 AC_CHECK_HEADERS(zstd.h, 1571 curl_zstd_msg="enabled (libzstd)" 1572 HAVE_ZSTD=1 1573 AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use]) 1574 ) 1575 1576 if test X"$OPT_ZSTD" != Xoff && 1577 test "$HAVE_ZSTD" != "1"; then 1578 AC_MSG_ERROR([libzstd was not found where specified!]) 1579 fi 1580 1581 if test "$HAVE_ZSTD" = "1"; then 1582 if test -n "$DIR_ZSTD"; then 1583 dnl when the zstd shared lib were found in a path that the run-time 1584 dnl linker doesn't search through, we need to add it to 1585 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to 1586 dnl this 1587 1588 if test "x$cross_compiling" != "xyes"; then 1589 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD" 1590 export CURL_LIBRARY_PATH 1591 AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH]) 1592 fi 1593 fi 1594 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libzstd" 1595 else 1596 dnl no zstd, revert back to clean variables 1597 LDFLAGS=$CLEANLDFLAGS 1598 LDFLAGSPC=$CLEANLDFLAGSPC 1599 CPPFLAGS=$CLEANCPPFLAGS 1600 LIBS=$CLEANLIBS 1601 fi 1602 fi 1603 1604 dnl ********************************************************************** 1605 dnl Checks for IPv6 1606 dnl ********************************************************************** 1607 1608 AC_MSG_CHECKING([whether to enable IPv6]) 1609 AC_ARG_ENABLE(ipv6, 1610 AS_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support]) 1611 AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), 1612 [ case "$enableval" in 1613 no) 1614 AC_MSG_RESULT(no) 1615 ipv6=no 1616 ;; 1617 *) 1618 AC_MSG_RESULT(yes) 1619 ipv6=yes 1620 ;; 1621 esac ], 1622 1623 AC_COMPILE_IFELSE([ 1624 AC_LANG_SOURCE([[ 1625 /* are AF_INET6 and sockaddr_in6 available? */ 1626 #include <sys/types.h> 1627 #ifdef _WIN32 1628 #include <winsock2.h> 1629 #include <ws2tcpip.h> 1630 #else 1631 #include <sys/socket.h> 1632 #include <netinet/in.h> 1633 #ifdef __TANDEM 1634 #include <netinet/in6.h> 1635 #endif 1636 #endif 1637 int main(void) 1638 { 1639 int s = (int)sizeof(struct sockaddr_in6); 1640 (void)s; 1641 return socket(AF_INET6, SOCK_STREAM, 0) > 0; 1642 } 1643 ]]) 1644 ], 1645 AC_MSG_RESULT(yes) 1646 ipv6=yes, 1647 AC_MSG_RESULT(no) 1648 ipv6=no 1649 ) 1650 ) 1651 1652 if test "$curl_cv_wince" = 'yes'; then 1653 ipv6=no 1654 fi 1655 1656 if test "$ipv6" = yes; then 1657 curl_ipv6_msg="enabled" 1658 AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support]) 1659 IPV6_ENABLED=1 1660 1661 AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) 1662 AC_COMPILE_IFELSE([ 1663 AC_LANG_PROGRAM([[ 1664 #include <sys/types.h> 1665 #ifdef _WIN32 1666 #include <winsock2.h> 1667 #include <ws2tcpip.h> 1668 #else 1669 #include <netinet/in.h> 1670 #ifdef __TANDEM 1671 #include <netinet/in6.h> 1672 #endif 1673 #endif 1674 ]], [[ 1675 struct sockaddr_in6 s; 1676 s.sin6_scope_id = 0; 1677 (void)s; 1678 ]]) 1679 ],[ 1680 AC_MSG_RESULT([yes]) 1681 AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) 1682 ],[ 1683 AC_MSG_RESULT([no]) 1684 ]) 1685 fi 1686 1687 dnl ********************************************************************** 1688 dnl Check if the operating system allows programs to write to their own argv[] 1689 dnl ********************************************************************** 1690 1691 AC_MSG_CHECKING([if argv can be written to]) 1692 CURL_RUN_IFELSE([[ 1693 int main(int argc, char **argv) 1694 { 1695 #ifdef _WIN32 1696 /* on Windows, writing to the argv does not hide the argument in 1697 process lists so it can just be skipped */ 1698 (void)argc; 1699 (void)argv; 1700 return 1; 1701 #else 1702 (void)argc; 1703 argv[0][0] = ' '; 1704 return (argv[0][0] == ' ')?0:1; 1705 #endif 1706 } 1707 ]],[ 1708 curl_cv_writable_argv=yes 1709 ],[ 1710 curl_cv_writable_argv=no 1711 ],[ 1712 curl_cv_writable_argv=cross 1713 ]) 1714 if test "$curl_cv_writable_argv" = 'cross' -a "$curl_cv_apple" = 'yes'; then 1715 curl_cv_writable_argv=yes 1716 fi 1717 case $curl_cv_writable_argv in 1718 yes) 1719 AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) 1720 AC_MSG_RESULT(yes) 1721 ;; 1722 no) 1723 AC_MSG_RESULT(no) 1724 ;; 1725 *) 1726 AC_MSG_RESULT(no) 1727 AC_MSG_WARN([the previous check could not be made default was used]) 1728 ;; 1729 esac 1730 1731 dnl ********************************************************************** 1732 dnl Check for GSS-API libraries 1733 dnl ********************************************************************** 1734 1735 dnl check for GSS-API stuff in the /usr as default 1736 1737 GSSAPI_ROOT="/usr" 1738 AC_ARG_WITH(gssapi-includes, 1739 AS_HELP_STRING([--with-gssapi-includes=DIR], [Specify location of GSS-API headers]), [ 1740 GSSAPI_INCS="-I$withval" 1741 want_gss="yes" 1742 ] 1743 ) 1744 1745 AC_ARG_WITH(gssapi-libs, 1746 AS_HELP_STRING([--with-gssapi-libs=DIR], [Specify location of GSS-API libs]), [ 1747 GSSAPI_LIB_DIR="-L$withval" 1748 want_gss="yes" 1749 ] 1750 ) 1751 1752 AC_ARG_WITH(gssapi, 1753 AS_HELP_STRING([--with-gssapi=DIR], [Where to look for GSS-API]), [ 1754 GSSAPI_ROOT="$withval" 1755 if test x"$GSSAPI_ROOT" != xno; then 1756 want_gss="yes" 1757 if test x"$GSSAPI_ROOT" = xyes; then 1758 dnl if yes, then use default root 1759 GSSAPI_ROOT="/usr" 1760 fi 1761 fi 1762 ] 1763 ) 1764 1765 : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"} 1766 1767 save_CPPFLAGS="$CPPFLAGS" 1768 AC_MSG_CHECKING([if GSS-API support is requested]) 1769 if test x"$want_gss" = xyes; then 1770 AC_MSG_RESULT(yes) 1771 1772 if test $GSSAPI_ROOT != "/usr"; then 1773 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig) 1774 else 1775 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) 1776 fi 1777 if test -z "$GSSAPI_INCS"; then 1778 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then 1779 GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` 1780 elif test "$PKGCONFIG" != "no"; then 1781 GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi` 1782 elif test -f "$KRB5CONFIG"; then 1783 GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` 1784 elif test "$GSSAPI_ROOT" != "yes"; then 1785 GSSAPI_INCS="-I$GSSAPI_ROOT/include" 1786 fi 1787 fi 1788 1789 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" 1790 1791 AC_CHECK_HEADER(gss.h, 1792 [ 1793 dnl found in the given dirs 1794 AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS]) 1795 gnu_gss=yes 1796 ], 1797 [ 1798 dnl not found, check Heimdal or MIT 1799 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1]) 1800 AC_CHECK_HEADERS( 1801 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h], 1802 [], 1803 [not_mit=1], 1804 [ 1805 AC_INCLUDES_DEFAULT 1806 #ifdef HAVE_GSSAPI_GSSAPI_H 1807 #include <gssapi/gssapi.h> 1808 #endif 1809 ]) 1810 if test "x$not_mit" = "x1"; then 1811 dnl MIT not found, check for Heimdal 1812 AC_CHECK_HEADER(gssapi.h, 1813 [], 1814 [ 1815 dnl no header found, disabling GSS 1816 want_gss=no 1817 AC_MSG_WARN(disabling GSS-API support since no header files were found) 1818 ] 1819 ) 1820 else 1821 dnl MIT found 1822 dnl check if we have a really old MIT Kerberos version (<= 1.2) 1823 AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE]) 1824 AC_COMPILE_IFELSE([ 1825 AC_LANG_PROGRAM([[ 1826 #include <gssapi/gssapi.h> 1827 #include <gssapi/gssapi_generic.h> 1828 #include <gssapi/gssapi_krb5.h> 1829 ]],[[ 1830 gss_import_name( 1831 (OM_uint32 *)0, 1832 (gss_buffer_t)0, 1833 GSS_C_NT_HOSTBASED_SERVICE, 1834 (gss_name_t *)0); 1835 ]]) 1836 ],[ 1837 AC_MSG_RESULT([yes]) 1838 ],[ 1839 AC_MSG_RESULT([no]) 1840 AC_DEFINE(HAVE_OLD_GSSMIT, 1, 1841 [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE]) 1842 ]) 1843 fi 1844 ] 1845 ) 1846 else 1847 AC_MSG_RESULT(no) 1848 fi 1849 if test x"$want_gss" = xyes; then 1850 AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries]) 1851 HAVE_GSSAPI=1 1852 curl_gss_msg="enabled (MIT Kerberos/Heimdal)" 1853 link_pkgconfig='' 1854 1855 if test -n "$gnu_gss"; then 1856 curl_gss_msg="enabled (GNU GSS)" 1857 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" 1858 LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR" 1859 LIBS="-lgss $LIBS" 1860 link_pkgconfig=1 1861 elif test -z "$GSSAPI_LIB_DIR"; then 1862 if test "$curl_cv_apple" = 'yes'; then 1863 LIBS="-lgssapi_krb5 -lresolv $LIBS" 1864 else 1865 if test $GSSAPI_ROOT != "/usr"; then 1866 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig) 1867 else 1868 CURL_CHECK_PKGCONFIG(mit-krb5-gssapi) 1869 fi 1870 if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then 1871 dnl krb5-config doesn't have --libs-only-L or similar, put everything 1872 dnl into LIBS 1873 gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` 1874 LIBS="$gss_libs $LIBS" 1875 elif test "$PKGCONFIG" != "no"; then 1876 gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi` 1877 LIBS="$gss_libs $LIBS" 1878 link_pkgconfig=1 1879 elif test -f "$KRB5CONFIG"; then 1880 dnl krb5-config doesn't have --libs-only-L or similar, put everything 1881 dnl into LIBS 1882 gss_libs=`$KRB5CONFIG --libs gssapi` 1883 LIBS="$gss_libs $LIBS" 1884 link_pkgconfig=1 1885 else 1886 case $host in 1887 *-hp-hpux*) 1888 gss_libname="gss" 1889 ;; 1890 *) 1891 gss_libname="gssapi" 1892 ;; 1893 esac 1894 1895 if test "$GSSAPI_ROOT" != "yes"; then 1896 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" 1897 LDFLAGSPC="$LDFLAGSPC -L$GSSAPI_ROOT/lib$libsuff" 1898 LIBS="-l$gss_libname $LIBS" 1899 else 1900 LIBS="-l$gss_libname $LIBS" 1901 fi 1902 fi 1903 fi 1904 else 1905 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" 1906 LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR" 1907 case $host in 1908 *-hp-hpux*) 1909 LIBS="-lgss $LIBS" 1910 ;; 1911 *) 1912 LIBS="-lgssapi $LIBS" 1913 ;; 1914 esac 1915 fi 1916 if test -n "$link_pkgconfig"; then 1917 if test -n "$gnu_gss"; then 1918 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gss" 1919 elif test "x$not_mit" = "x1"; then 1920 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE heimdal-gssapi" 1921 else 1922 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mit-krb5-gssapi" 1923 fi 1924 fi 1925 else 1926 CPPFLAGS="$save_CPPFLAGS" 1927 fi 1928 1929 if test x"$want_gss" = xyes; then 1930 AC_MSG_CHECKING([if we can link against GSS-API library]) 1931 AC_LINK_IFELSE([ 1932 AC_LANG_FUNC_LINK_TRY([gss_init_sec_context]) 1933 ],[ 1934 AC_MSG_RESULT([yes]) 1935 ],[ 1936 AC_MSG_RESULT([no]) 1937 AC_MSG_ERROR([--with-gssapi was specified, but a GSS-API library was not found.]) 1938 ]) 1939 fi 1940 1941 build_libstubgss=no 1942 if test x"$want_gss" = "xyes"; then 1943 build_libstubgss=yes 1944 fi 1945 1946 AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes") 1947 1948 dnl ------------------------------------------------------------- 1949 dnl parse --with-default-ssl-backend so it can be validated below 1950 dnl ------------------------------------------------------------- 1951 1952 DEFAULT_SSL_BACKEND=no 1953 VALID_DEFAULT_SSL_BACKEND= 1954 AC_ARG_WITH(default-ssl-backend, 1955 AS_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend]) 1956 AS_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]), 1957 [DEFAULT_SSL_BACKEND=$withval]) 1958 case "$DEFAULT_SSL_BACKEND" in 1959 no) 1960 dnl --without-default-ssl-backend option used 1961 ;; 1962 default|yes) 1963 dnl --with-default-ssl-backend option used without name 1964 AC_MSG_ERROR([The name of the default SSL backend is required.]) 1965 ;; 1966 *) 1967 dnl --with-default-ssl-backend option used with name 1968 dnl needs to be validated below 1969 VALID_DEFAULT_SSL_BACKEND=no 1970 ;; 1971 esac 1972 1973 CURL_WITH_SCHANNEL 1974 CURL_WITH_AMISSL 1975 CURL_WITH_OPENSSL 1976 CURL_WITH_GNUTLS 1977 CURL_WITH_MBEDTLS 1978 CURL_WITH_WOLFSSL 1979 CURL_WITH_RUSTLS 1980 1981 dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED 1982 if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then 1983 LIBS="-lcrypt32 $LIBS" 1984 if test "$curl_cv_wince" = 'no'; then 1985 LIBS="-ladvapi32 $LIBS" 1986 fi 1987 fi 1988 1989 dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer) 1990 if test "x$curl_cv_native_windows" = "xyes" -a "$curl_cv_wince" = 'no'; then 1991 LIBS="-lbcrypt $LIBS" 1992 fi 1993 1994 case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$RUSTLS_ENABLED" in 1995 x) 1996 AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more. 1997 Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl or --with-rustls to address this.]) 1998 ;; 1999 x1) 2000 # one SSL backend is enabled 2001 SSL_ENABLED="1" 2002 AC_MSG_NOTICE([built with one SSL backend]) 2003 ;; 2004 xD) 2005 # explicitly built without TLS 2006 ;; 2007 xD*) 2008 AC_MSG_ERROR([--without-ssl has been set together with an explicit option to use an ssl library 2009 (e.g. --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl, --with-rustls). 2010 Since these are conflicting parameters, verify which is the desired one and drop the other.]) 2011 ;; 2012 *) 2013 # more than one SSL backend is enabled 2014 SSL_ENABLED="1" 2015 CURL_WITH_MULTI_SSL="1" 2016 AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends]) 2017 AC_MSG_NOTICE([built with multiple SSL backends]) 2018 ;; 2019 esac 2020 2021 if test -n "$ssl_backends"; then 2022 curl_ssl_msg="enabled ($ssl_backends)" 2023 fi 2024 2025 if test no = "$VALID_DEFAULT_SSL_BACKEND"; then 2026 if test -n "$SSL_ENABLED"; then 2027 AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!]) 2028 else 2029 AC_MSG_ERROR([Default SSL backend requires SSL!]) 2030 fi 2031 elif test yes = "$VALID_DEFAULT_SSL_BACKEND"; then 2032 AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend]) 2033 fi 2034 2035 dnl ********************************************************************** 2036 dnl Check for the CA bundle 2037 dnl ********************************************************************** 2038 2039 if test -n "$check_for_ca_bundle"; then 2040 CURL_CHECK_CA_BUNDLE 2041 CURL_CHECK_CA_EMBED 2042 fi 2043 2044 AM_CONDITIONAL(CURL_CA_EMBED_SET, test "x$CURL_CA_EMBED" != "x") 2045 2046 dnl ---------------------- 2047 dnl check unsafe CA search 2048 dnl ---------------------- 2049 2050 if test "$curl_cv_native_windows" = "yes"; then 2051 AC_MSG_CHECKING([whether to enable unsafe CA bundle search in PATH on Windows]) 2052 AC_ARG_ENABLE(ca-search, 2053 AS_HELP_STRING([--enable-ca-search],[Enable unsafe CA bundle search in PATH on Windows (default)]) 2054 AS_HELP_STRING([--disable-ca-search],[Disable unsafe CA bundle search in PATH on Windows]), 2055 [ case "$enableval" in 2056 no) 2057 AC_MSG_RESULT([no]) 2058 AC_DEFINE(CURL_DISABLE_CA_SEARCH, 1, [If unsafe CA bundle search in PATH on Windows is disabled]) 2059 ;; 2060 *) 2061 AC_MSG_RESULT([yes]) 2062 ;; 2063 esac ], 2064 AC_MSG_RESULT([yes]) 2065 ) 2066 fi 2067 2068 dnl -------------------- 2069 dnl check safe CA search 2070 dnl -------------------- 2071 2072 if test "$curl_cv_native_windows" = "yes"; then 2073 AC_MSG_CHECKING([whether to enable safe CA bundle search (within the curl tool directory) on Windows]) 2074 AC_ARG_ENABLE(ca-search-safe, 2075 AS_HELP_STRING([--enable-ca-search-safe],[Enable safe CA bundle search]) 2076 AS_HELP_STRING([--disable-ca-search-safe],[Disable safe CA bundle search (default)]), 2077 [ case "$enableval" in 2078 yes) 2079 AC_MSG_RESULT([yes]) 2080 AC_DEFINE(CURL_CA_SEARCH_SAFE, 1, [If safe CA bundle search is enabled]) 2081 ;; 2082 *) 2083 AC_MSG_RESULT([no]) 2084 ;; 2085 esac ], 2086 AC_MSG_RESULT([no]) 2087 ) 2088 fi 2089 2090 dnl ********************************************************************** 2091 dnl Check for libpsl 2092 dnl ********************************************************************** 2093 2094 dnl Default to compiler & linker defaults for LIBPSL files & libraries. 2095 OPT_LIBPSL=off 2096 AC_ARG_WITH(libpsl,dnl 2097 AS_HELP_STRING([--with-libpsl=PATH],[Where to look for libpsl, PATH points to the LIBPSL installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) 2098 AS_HELP_STRING([--without-libpsl], [disable LIBPSL]), 2099 OPT_LIBPSL=$withval) 2100 2101 if test X"$OPT_LIBPSL" != Xno; then 2102 dnl backup the pre-libpsl variables 2103 CLEANLDFLAGS="$LDFLAGS" 2104 CLEANLDFLAGSPC="$LDFLAGSPC" 2105 CLEANCPPFLAGS="$CPPFLAGS" 2106 CLEANLIBS="$LIBS" 2107 2108 case "$OPT_LIBPSL" in 2109 yes|off) 2110 dnl --with-libpsl (without path) used 2111 CURL_CHECK_PKGCONFIG(libpsl) 2112 2113 if test "$PKGCONFIG" != "no"; then 2114 LIB_PSL=`$PKGCONFIG --libs-only-l libpsl` 2115 LD_PSL=`$PKGCONFIG --libs-only-L libpsl` 2116 CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl` 2117 else 2118 dnl no libpsl pkg-config found 2119 LIB_PSL="-lpsl" 2120 fi 2121 2122 ;; 2123 *) 2124 dnl use the given --with-libpsl spot 2125 LIB_PSL="-lpsl" 2126 PREFIX_PSL=$OPT_LIBPSL 2127 ;; 2128 esac 2129 2130 dnl if given with a prefix, we set -L and -I based on that 2131 if test -n "$PREFIX_PSL"; then 2132 LD_PSL=-L${PREFIX_PSL}/lib$libsuff 2133 CPP_PSL=-I${PREFIX_PSL}/include 2134 fi 2135 2136 LDFLAGS="$LDFLAGS $LD_PSL" 2137 LDFLAGSPC="$LDFLAGSPC $LD_PSL" 2138 CPPFLAGS="$CPPFLAGS $CPP_PSL" 2139 LIBS="$LIB_PSL $LIBS" 2140 2141 AC_CHECK_LIB(psl, psl_builtin, 2142 [ 2143 AC_CHECK_HEADERS(libpsl.h, 2144 curl_psl_msg="enabled" 2145 AC_DEFINE(USE_LIBPSL, 1, [if libpsl is in use]) 2146 USE_LIBPSL=1 2147 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libpsl" 2148 ) 2149 ], 2150 dnl not found, revert back to clean variables 2151 LDFLAGS=$CLEANLDFLAGS 2152 LDFLAGSPC=$CLEANLDFLAGSPC 2153 CPPFLAGS=$CLEANCPPFLAGS 2154 LIBS=$CLEANLIBS 2155 ) 2156 2157 if test "$USE_LIBPSL" != "1"; then 2158 AC_MSG_ERROR([libpsl libs and/or directories were not found where specified!]) 2159 fi 2160 fi 2161 AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"]) 2162 2163 2164 dnl ********************************************************************** 2165 dnl Check for libgsasl 2166 dnl ********************************************************************** 2167 2168 AC_ARG_WITH(libgsasl, 2169 AS_HELP_STRING([--without-libgsasl], 2170 [disable libgsasl support for SCRAM]), 2171 with_libgsasl=$withval, 2172 with_libgsasl=yes) 2173 if test $with_libgsasl != "no"; then 2174 AC_SEARCH_LIBS(gsasl_init, gsasl, 2175 [curl_gsasl_msg="enabled"; 2176 AC_DEFINE([USE_GSASL], [1], [GSASL support enabled]) 2177 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libgsasl" 2178 ], 2179 [curl_gsasl_msg="no (libgsasl not found)"; 2180 AC_MSG_WARN([libgsasl was not found]) 2181 ] 2182 ) 2183 fi 2184 AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"]) 2185 2186 AC_ARG_WITH(libmetalink,, 2187 AC_MSG_ERROR([--with-libmetalink and --without-libmetalink no longer work!])) 2188 2189 dnl ********************************************************************** 2190 dnl Check for the presence of libssh2 libraries and headers 2191 dnl ********************************************************************** 2192 2193 dnl Default to compiler & linker defaults for libssh2 files & libraries. 2194 OPT_LIBSSH2=off 2195 AC_ARG_WITH(libssh2,dnl 2196 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]) 2197 AS_HELP_STRING([--with-libssh2], [enable libssh2]), 2198 OPT_LIBSSH2=$withval, OPT_LIBSSH2=no) 2199 2200 2201 OPT_LIBSSH=off 2202 AC_ARG_WITH(libssh,dnl 2203 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]) 2204 AS_HELP_STRING([--with-libssh], [enable libssh]), 2205 OPT_LIBSSH=$withval, OPT_LIBSSH=no) 2206 2207 OPT_WOLFSSH=off 2208 AC_ARG_WITH(wolfssh,dnl 2209 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]) 2210 AS_HELP_STRING([--with-wolfssh], [enable wolfssh]), 2211 OPT_WOLFSSH=$withval, OPT_WOLFSSH=no) 2212 2213 if test X"$OPT_LIBSSH2" != Xno; then 2214 dnl backup the pre-libssh2 variables 2215 CLEANLDFLAGS="$LDFLAGS" 2216 CLEANLDFLAGSPC="$LDFLAGSPC" 2217 CLEANCPPFLAGS="$CPPFLAGS" 2218 CLEANLIBS="$LIBS" 2219 2220 case "$OPT_LIBSSH2" in 2221 yes) 2222 dnl --with-libssh2 (without path) used 2223 CURL_CHECK_PKGCONFIG(libssh2) 2224 2225 if test "$PKGCONFIG" != "no"; then 2226 LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2` 2227 LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` 2228 CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` 2229 version=`$PKGCONFIG --modversion libssh2` 2230 DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'` 2231 fi 2232 2233 ;; 2234 off) 2235 dnl no --with-libssh2 option given, just check default places 2236 ;; 2237 *) 2238 dnl use the given --with-libssh2 spot 2239 PREFIX_SSH2=$OPT_LIBSSH2 2240 ;; 2241 esac 2242 2243 dnl if given with a prefix, we set -L and -I based on that 2244 if test -n "$PREFIX_SSH2"; then 2245 LIB_SSH2="-lssh2" 2246 LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff 2247 CPP_SSH2=-I${PREFIX_SSH2}/include 2248 DIR_SSH2=${PREFIX_SSH2}/lib$libsuff 2249 fi 2250 2251 LDFLAGS="$LDFLAGS $LD_SSH2" 2252 LDFLAGSPC="$LDFLAGSPC $LD_SSH2" 2253 CPPFLAGS="$CPPFLAGS $CPP_SSH2" 2254 LIBS="$LIB_SSH2 $LIBS" 2255 2256 dnl check for function added in libssh2 version 1.2.8 2257 AC_CHECK_LIB(ssh2, libssh2_free) 2258 2259 AC_CHECK_HEADER(libssh2.h, 2260 curl_ssh_msg="enabled (libssh2)" 2261 AC_DEFINE(USE_LIBSSH2, 1, [if libssh2 is in use]) 2262 USE_LIBSSH2=1 2263 ) 2264 2265 if test X"$OPT_LIBSSH2" != Xoff && 2266 test "$USE_LIBSSH2" != "1"; then 2267 AC_MSG_ERROR([libssh2 libs and/or directories were not found where specified!]) 2268 fi 2269 2270 if test "$USE_LIBSSH2" = "1"; then 2271 if test -n "$DIR_SSH2"; then 2272 dnl when the libssh2 shared libs were found in a path that the run-time 2273 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH 2274 dnl to prevent further configure tests to fail due to this 2275 2276 if test "x$cross_compiling" != "xyes"; then 2277 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2" 2278 export CURL_LIBRARY_PATH 2279 AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH]) 2280 fi 2281 fi 2282 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh2" 2283 else 2284 dnl no libssh2, revert back to clean variables 2285 LDFLAGS=$CLEANLDFLAGS 2286 LDFLAGSPC=$CLEANLDFLAGSPC 2287 CPPFLAGS=$CLEANCPPFLAGS 2288 LIBS=$CLEANLIBS 2289 fi 2290 elif test X"$OPT_LIBSSH" != Xno; then 2291 dnl backup the pre-libssh variables 2292 CLEANLDFLAGS="$LDFLAGS" 2293 CLEANLDFLAGSPC="$LDFLAGSPC" 2294 CLEANCPPFLAGS="$CPPFLAGS" 2295 CLEANLIBS="$LIBS" 2296 2297 case "$OPT_LIBSSH" in 2298 yes) 2299 dnl --with-libssh (without path) used 2300 CURL_CHECK_PKGCONFIG(libssh) 2301 2302 if test "$PKGCONFIG" != "no"; then 2303 LIB_SSH=`$PKGCONFIG --libs-only-l libssh` 2304 LD_SSH=`$PKGCONFIG --libs-only-L libssh` 2305 CPP_SSH=`$PKGCONFIG --cflags-only-I libssh` 2306 version=`$PKGCONFIG --modversion libssh` 2307 DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'` 2308 fi 2309 2310 ;; 2311 off) 2312 dnl no --with-libssh option given, just check default places 2313 ;; 2314 *) 2315 dnl use the given --with-libssh spot 2316 PREFIX_SSH=$OPT_LIBSSH 2317 ;; 2318 esac 2319 2320 dnl if given with a prefix, we set -L and -I based on that 2321 if test -n "$PREFIX_SSH"; then 2322 LIB_SSH="-lssh" 2323 LD_SSH=-L${PREFIX_SSH}/lib$libsuff 2324 CPP_SSH=-I${PREFIX_SSH}/include 2325 DIR_SSH=${PREFIX_SSH}/lib$libsuff 2326 fi 2327 2328 LDFLAGS="$LDFLAGS $LD_SSH" 2329 LDFLAGSPC="$LDFLAGSPC $LD_SSH" 2330 CPPFLAGS="$CPPFLAGS $CPP_SSH" 2331 LIBS="$LIB_SSH $LIBS" 2332 2333 AC_CHECK_LIB(ssh, ssh_new) 2334 2335 AC_CHECK_HEADER(libssh/libssh.h, 2336 curl_ssh_msg="enabled (libssh)" 2337 AC_DEFINE(USE_LIBSSH, 1, [if libssh is in use]) 2338 USE_LIBSSH=1 2339 ) 2340 2341 if test X"$OPT_LIBSSH" != Xoff && 2342 test "$USE_LIBSSH" != "1"; then 2343 AC_MSG_ERROR([libssh libs and/or directories were not found where specified!]) 2344 fi 2345 2346 if test "$USE_LIBSSH" = "1"; then 2347 if test "$curl_cv_native_windows" = "yes"; then 2348 dnl for if_nametoindex 2349 LIBS="-liphlpapi $LIBS" 2350 fi 2351 if test -n "$DIR_SSH"; then 2352 dnl when the libssh shared libs were found in a path that the run-time 2353 dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH 2354 dnl to prevent further configure tests to fail due to this 2355 2356 if test "x$cross_compiling" != "xyes"; then 2357 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH" 2358 export CURL_LIBRARY_PATH 2359 AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH]) 2360 fi 2361 fi 2362 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libssh" 2363 else 2364 dnl no libssh, revert back to clean variables 2365 LDFLAGS=$CLEANLDFLAGS 2366 LDFLAGSPC=$CLEANLDFLAGSPC 2367 CPPFLAGS=$CLEANCPPFLAGS 2368 LIBS=$CLEANLIBS 2369 fi 2370 elif test X"$OPT_WOLFSSH" != Xno; then 2371 dnl backup the pre-wolfssh variables 2372 CLEANLDFLAGS="$LDFLAGS" 2373 CLEANLDFLAGSPC="$LDFLAGSPC" 2374 CLEANCPPFLAGS="$CPPFLAGS" 2375 CLEANLIBS="$LIBS" 2376 2377 if test "$OPT_WOLFSSH" != yes; then 2378 WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config" 2379 WOLFSSH_LIBS=`$WOLFCONFIG --libs` 2380 LDFLAGS="$LDFLAGS $WOLFSSH_LIBS" 2381 LDFLAGSPC="$LDFLAGSPC $WOLFSSH_LIBS" 2382 CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`" 2383 fi 2384 2385 AC_CHECK_LIB(wolfssh, wolfSSH_Init) 2386 2387 AC_CHECK_HEADERS(wolfssh/ssh.h, 2388 curl_ssh_msg="enabled (wolfSSH)" 2389 AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use]) 2390 USE_WOLFSSH=1 2391 ) 2392 fi 2393 2394 dnl ********************************************************************** 2395 dnl Check for LDAP (after the SSL libraries) 2396 dnl ********************************************************************** 2397 2398 LDAPLIBNAME="" 2399 AC_ARG_WITH(ldap-lib, 2400 AS_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]), 2401 [LDAPLIBNAME="$withval"]) 2402 2403 LBERLIBNAME="" 2404 AC_ARG_WITH(lber-lib, 2405 AS_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]), 2406 [LBERLIBNAME="$withval"]) 2407 2408 dnl Handle argument to --with-ldap. 2409 clean_LDAP_CPPFLAGS=$CPPFLAGS 2410 clean_LDAP_LDFLAGS=$LDFLAGS 2411 clean_LDAP_LIBS=$LIBS 2412 OPT_LDAP=off 2413 AC_ARG_WITH(ldap, 2414 AS_HELP_STRING([--with-ldap=PATH],[Where to look for LDAP, PATH points to the LDAP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) 2415 AS_HELP_STRING([--without-ldap], [disable LDAP]), 2416 OPT_LDAP=$withval) 2417 2418 case "$OPT_LDAP" in 2419 no) 2420 dnl --without-ldap option used 2421 want_ldap="no" 2422 ;; 2423 yes) 2424 dnl --with-ldap option used without path 2425 want_ldap="yes" 2426 ;; 2427 off) 2428 dnl no --with-ldap option given, don't change anything 2429 want_ldap="default" 2430 ;; 2431 *) 2432 dnl --with-ldap option used with path 2433 want_ldap="yes" 2434 if test -d "$OPT_LDAP/lib$libsuff"; then 2435 LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib$libsuff" 2436 DIR_LDAP="$OPT_LDAP/lib$libsuff" 2437 elif test -d "$OPT_LDAP/lib"; then 2438 LDFLAGS="$LDFLAGS -L$OPT_LDAP/lib" 2439 DIR_LDAP="$OPT_LDAP/lib" 2440 fi 2441 if test -d "$OPT_LDAP/include"; then 2442 CPPFLAGS="$CPPFLAGS -I$OPT_LDAP/include" 2443 fi 2444 ldap_askedfor="yes" 2445 ;; 2446 esac 2447 2448 if test x$CURL_DISABLE_LDAP != x1 && test "$want_ldap" != "no"; then 2449 2450 CURL_CHECK_HEADER_LBER 2451 CURL_CHECK_HEADER_LDAP 2452 CURL_CHECK_HEADER_LDAP_SSL 2453 2454 if test -z "$LDAPLIBNAME"; then 2455 if test "$curl_cv_native_windows" = "yes" -a "$curl_cv_winuwp" != "yes"; then 2456 dnl Windows uses a single and unique LDAP library name 2457 LDAPLIBNAME="wldap32" 2458 LBERLIBNAME="no" 2459 fi 2460 fi 2461 2462 if test "$LDAPLIBNAME"; then 2463 dnl If we have both LDAP and LBER library names, check if we need both 2464 if test "$LBERLIBNAME" -a "$LBERLIBNAME" != "no"; then 2465 dnl Try LDAP first, then with LBER if needed 2466 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init, [ldap_lib_ok=yes], [ldap_lib_ok=no]) 2467 if test "$ldap_lib_ok" = "no"; then 2468 dnl LDAP alone failed, try with LBER using a different function 2469 AC_CHECK_LIB("$LDAPLIBNAME", ldap_unbind, [ldap_lib_ok=yes], [ldap_lib_ok=no], [-l$LBERLIBNAME]) 2470 if test "$ldap_lib_ok" = "yes"; then 2471 dnl We need both libraries 2472 LIBS="-l$LDAPLIBNAME -l$LBERLIBNAME $LIBS" 2473 fi 2474 else 2475 dnl LDAP alone is sufficient 2476 LIBS="-l$LDAPLIBNAME $LIBS" 2477 fi 2478 else 2479 dnl Only check LDAP library 2480 AC_CHECK_LIB("$LDAPLIBNAME", ldap_init, [ldap_lib_ok=yes; LIBS="-l$LDAPLIBNAME $LIBS"], [ldap_lib_ok=no]) 2481 fi 2482 2483 if test "$ldap_lib_ok" = "no"; then 2484 if test -n "$ldap_askedfor"; then 2485 AC_MSG_ERROR([couldn't detect the LDAP libraries]) 2486 fi 2487 AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled]) 2488 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) 2489 CURL_DISABLE_LDAP=1 2490 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) 2491 CURL_DISABLE_LDAPS=1 2492 dnl restore original flags 2493 CPPFLAGS=$clean_LDAP_CPPFLAGS 2494 LDFLAGS=$clean_LDAP_LDFLAGS 2495 LIBS=$clean_LDAP_LIBS 2496 fi 2497 else 2498 dnl Try to find the right ldap libraries for this system 2499 CURL_CHECK_LIBS_LDAP 2500 case X-"$curl_cv_ldap_LIBS" in 2501 X-unknown) 2502 if test -n "$ldap_askedfor"; then 2503 AC_MSG_ERROR([couldn't detect the LDAP libraries]) 2504 fi 2505 AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled]) 2506 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) 2507 CURL_DISABLE_LDAP=1 2508 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) 2509 CURL_DISABLE_LDAPS=1 2510 dnl restore original flags 2511 CPPFLAGS=$clean_LDAP_CPPFLAGS 2512 LDFLAGS=$clean_LDAP_LDFLAGS 2513 LIBS=$clean_LDAP_LIBS 2514 ;; 2515 esac 2516 fi 2517 fi 2518 2519 if test x$CURL_DISABLE_LDAP != x1; then 2520 dnl Add to library path if needed 2521 if test -n "$DIR_LDAP"; then 2522 dnl when the ldap shared lib were found in a path that the run-time 2523 dnl linker doesn't search through, we need to add it to 2524 dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to 2525 dnl this 2526 2527 if test "x$cross_compiling" != "xyes"; then 2528 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LDAP" 2529 export CURL_LIBRARY_PATH 2530 AC_MSG_NOTICE([Added $DIR_LDAP to CURL_LIBRARY_PATH]) 2531 fi 2532 fi 2533 2534 if test "$LBERLIBNAME"; then 2535 dnl If name is "no" then don't define this library at all 2536 dnl (it's only needed if libldap.so's dependencies are broken). 2537 dnl Skip this check if we already determined we need both libraries above 2538 if test "$LBERLIBNAME" != "no" -a "$ldap_lib_ok" != "yes"; then 2539 AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ 2540 AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled]) 2541 AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) 2542 CURL_DISABLE_LDAP=1 2543 AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) 2544 CURL_DISABLE_LDAPS=1 2545 dnl restore original flags 2546 CPPFLAGS=$clean_LDAP_CPPFLAGS 2547 LDFLAGS=$clean_LDAP_LDFLAGS 2548 LIBS=$clean_LDAP_LIBS 2549 ] 2550 ) 2551 fi 2552 fi 2553 fi 2554 2555 if test x$CURL_DISABLE_LDAP != x1; then 2556 AC_CHECK_FUNCS([ldap_url_parse \ 2557 ldap_init_fd]) 2558 2559 if test "$LDAPLIBNAME" = "wldap32"; then 2560 curl_ldap_msg="enabled (winldap)" 2561 AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation]) 2562 else 2563 if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then 2564 curl_ldap_msg="enabled (OpenLDAP)" 2565 AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code]) 2566 USE_OPENLDAP=1 2567 else 2568 curl_ldap_msg="enabled (ancient OpenLDAP)" 2569 fi 2570 fi 2571 fi 2572 2573 if test x$CURL_DISABLE_LDAPS != x1; then 2574 curl_ldaps_msg="enabled" 2575 fi 2576 2577 dnl ********************************************************************** 2578 dnl Check for the presence of LIBRTMP libraries and headers 2579 dnl ********************************************************************** 2580 2581 dnl Default to compiler & linker defaults for LIBRTMP files & libraries. 2582 OPT_LIBRTMP=off 2583 AC_ARG_WITH(librtmp,dnl 2584 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]) 2585 AS_HELP_STRING([--without-librtmp], [disable LIBRTMP]), 2586 OPT_LIBRTMP=$withval) 2587 2588 if test X"$OPT_LIBRTMP" != Xno; then 2589 dnl backup the pre-librtmp variables 2590 CLEANLDFLAGS="$LDFLAGS" 2591 CLEANLDFLAGSPC="$LDFLAGSPC" 2592 CLEANCPPFLAGS="$CPPFLAGS" 2593 CLEANLIBS="$LIBS" 2594 2595 case "$OPT_LIBRTMP" in 2596 yes) 2597 dnl --with-librtmp (without path) used 2598 CURL_CHECK_PKGCONFIG(librtmp) 2599 2600 if test "$PKGCONFIG" != "no"; then 2601 LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` 2602 LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` 2603 CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` 2604 version=`$PKGCONFIG --modversion librtmp` 2605 DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'` 2606 else 2607 dnl To avoid link errors, we do not allow --librtmp without 2608 dnl a pkgconfig file 2609 AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) 2610 fi 2611 2612 ;; 2613 off) 2614 dnl no --with-librtmp option given, just check default places 2615 LIB_RTMP="-lrtmp" 2616 ;; 2617 *) 2618 dnl use the given --with-librtmp spot 2619 LIB_RTMP="-lrtmp" 2620 PREFIX_RTMP=$OPT_LIBRTMP 2621 ;; 2622 esac 2623 2624 dnl if given with a prefix, we set -L and -I based on that 2625 if test -n "$PREFIX_RTMP"; then 2626 LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff 2627 CPP_RTMP=-I${PREFIX_RTMP}/include 2628 DIR_RTMP=${PREFIX_RTMP}/lib$libsuff 2629 fi 2630 2631 LDFLAGS="$LDFLAGS $LD_RTMP" 2632 LDFLAGSPC="$LDFLAGSPC $LD_RTMP" 2633 CPPFLAGS="$CPPFLAGS $CPP_RTMP" 2634 LIBS="$LIB_RTMP $LIBS" 2635 2636 AC_CHECK_LIB(rtmp, RTMP_Init, 2637 [ 2638 AC_CHECK_HEADERS(librtmp/rtmp.h, 2639 curl_rtmp_msg="enabled (librtmp)" 2640 AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use]) 2641 USE_LIBRTMP=1 2642 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE librtmp" 2643 ) 2644 ], 2645 dnl not found, revert back to clean variables 2646 LDFLAGS=$CLEANLDFLAGS 2647 LDFLAGSPC=$CLEANLDFLAGSPC 2648 CPPFLAGS=$CLEANCPPFLAGS 2649 LIBS=$CLEANLIBS 2650 ) 2651 2652 if test X"$OPT_LIBRTMP" != Xoff && 2653 test "$USE_LIBRTMP" != "1"; then 2654 AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) 2655 fi 2656 fi 2657 2658 dnl ********************************************************************** 2659 dnl Check for linker switch for versioned symbols 2660 dnl ********************************************************************** 2661 2662 versioned_symbols_flavour= 2663 AC_MSG_CHECKING([whether versioned symbols are wanted]) 2664 AC_ARG_ENABLE(versioned-symbols, 2665 AS_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library]) 2666 AS_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]), 2667 [ case "$enableval" in 2668 no) 2669 AC_MSG_RESULT(no) 2670 ;; 2671 *) 2672 AC_MSG_RESULT(yes) 2673 AC_MSG_CHECKING([if libraries can be versioned]) 2674 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` 2675 if test -z "$GLD"; then 2676 AC_MSG_RESULT(no) 2677 AC_MSG_WARN([You need an ld version supporting the --version-script option]) 2678 else 2679 AC_MSG_RESULT(yes) 2680 if test "x$enableval" != "xyes"; then 2681 versioned_symbols_flavour="$enableval" 2682 elif test "x$CURL_WITH_MULTI_SSL" = "x1"; then 2683 versioned_symbols_flavour="MULTISSL_" 2684 elif test "x$OPENSSL_ENABLED" = "x1"; then 2685 versioned_symbols_flavour="OPENSSL_" 2686 elif test "x$MBEDTLS_ENABLED" = "x1"; then 2687 versioned_symbols_flavour="MBEDTLS_" 2688 elif test "x$WOLFSSL_ENABLED" = "x1"; then 2689 versioned_symbols_flavour="WOLFSSL_" 2690 elif test "x$GNUTLS_ENABLED" = "x1"; then 2691 versioned_symbols_flavour="GNUTLS_" 2692 elif test "x$RUSTLS_ENABLED" = "x1"; then 2693 versioned_symbols_flavour="RUSTLS_" 2694 else 2695 versioned_symbols_flavour="" 2696 fi 2697 versioned_symbols="yes" 2698 fi 2699 ;; 2700 2701 esac 2702 ], [ 2703 AC_MSG_RESULT(no) 2704 ] 2705 ) 2706 2707 AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX], ["$versioned_symbols_flavour"]) 2708 AC_SUBST([CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME], ["4"]) dnl Keep in sync with VERSIONCHANGE - VERSIONDEL in lib/Makefile.soname 2709 AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS], 2710 [test "x$versioned_symbols" = 'xyes']) 2711 2712 dnl ---------------------------- 2713 dnl check Windows Unicode option 2714 dnl ---------------------------- 2715 2716 if test "$curl_cv_wince" = 'yes'; then 2717 want_winuni="yes" 2718 else 2719 want_winuni="no" 2720 fi 2721 if test "$curl_cv_native_windows" = "yes"; then 2722 if test "$curl_cv_winuwp" = 'yes'; then 2723 want_winuni="yes" 2724 else 2725 AC_MSG_CHECKING([whether to enable Windows Unicode (Windows native builds only)]) 2726 AC_ARG_ENABLE(windows-unicode, 2727 AS_HELP_STRING([--enable-windows-unicode],[Enable Windows Unicode]) 2728 AS_HELP_STRING([--disable-windows-unicode],[Disable Windows Unicode (default)]), 2729 [ case "$enableval" in 2730 yes) 2731 want_winuni="yes" 2732 AC_MSG_RESULT([yes]) 2733 ;; 2734 *) 2735 AC_MSG_RESULT([no]) 2736 ;; 2737 esac ], 2738 AC_MSG_RESULT([no]) 2739 ) 2740 fi 2741 2742 if test "$want_winuni" = "yes"; then 2743 CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE" 2744 fi 2745 fi 2746 2747 AM_CONDITIONAL([USE_UNICODE], [test "$want_winuni" = "yes"]) 2748 2749 dnl ------------------------------------------------- 2750 dnl check WinIDN option before other IDN libraries 2751 dnl ------------------------------------------------- 2752 2753 tst_links_winidn='no' 2754 if test "$curl_cv_native_windows" = 'yes'; then 2755 AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)]) 2756 OPT_WINIDN="default" 2757 AC_ARG_WITH(winidn, 2758 AS_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN]) 2759 AS_HELP_STRING([--without-winidn], [disable Windows native IDN]), 2760 OPT_WINIDN=$withval) 2761 case "$OPT_WINIDN" in 2762 no|default) 2763 dnl --without-winidn option used or configure option not specified 2764 want_winidn="no" 2765 AC_MSG_RESULT([no]) 2766 ;; 2767 yes) 2768 dnl --with-winidn option used without path 2769 want_winidn="yes" 2770 want_winidn_path="default" 2771 AC_MSG_RESULT([yes]) 2772 ;; 2773 *) 2774 dnl --with-winidn option used with path 2775 want_winidn="yes" 2776 want_winidn_path="$withval" 2777 AC_MSG_RESULT([yes ($withval)]) 2778 ;; 2779 esac 2780 2781 if test "$want_winidn" = "yes"; then 2782 dnl WinIDN library support has been requested 2783 clean_CPPFLAGS="$CPPFLAGS" 2784 clean_LDFLAGS="$LDFLAGS" 2785 clean_LDFLAGSPC="$LDFLAGSPC" 2786 clean_LIBS="$LIBS" 2787 WINIDN_LIBS="-lnormaliz" 2788 WINIDN_CPPFLAGS="" 2789 # 2790 if test "$want_winidn_path" != "default"; then 2791 dnl path has been specified 2792 dnl pkg-config not available or provides no info 2793 WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" 2794 WINIDN_CPPFLAGS="-I$want_winidn_path/include" 2795 fi 2796 # 2797 CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" 2798 LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" 2799 LDFLAGSPC="$LDFLAGSPC $WINIDN_LDFLAGS" 2800 LIBS="$WINIDN_LIBS $LIBS" 2801 # 2802 AC_MSG_CHECKING([if IdnToUnicode can be linked]) 2803 AC_LINK_IFELSE([ 2804 AC_LANG_PROGRAM([[ 2805 #include <windows.h> 2806 ]],[[ 2807 #if (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x600) && \ 2808 (!defined(WINVER) || WINVER < 0x600) 2809 WINBASEAPI int WINAPI IdnToUnicode(DWORD dwFlags, 2810 const WCHAR *lpASCIICharStr, 2811 int cchASCIIChar, 2812 WCHAR *lpUnicodeCharStr, 2813 int cchUnicodeChar); 2814 #endif 2815 IdnToUnicode(0, NULL, 0, NULL, 0); 2816 ]]) 2817 ],[ 2818 AC_MSG_RESULT([yes]) 2819 tst_links_winidn="yes" 2820 ],[ 2821 AC_MSG_RESULT([no]) 2822 tst_links_winidn="no" 2823 ]) 2824 # 2825 if test "$tst_links_winidn" = "yes"; then 2826 AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).]) 2827 IDN_ENABLED=1 2828 curl_idn_msg="enabled (Windows-native)" 2829 else 2830 AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) 2831 CPPFLAGS="$clean_CPPFLAGS" 2832 LDFLAGS="$clean_LDFLAGS" 2833 LDFLAGSPC="$clean_LDFLAGSPC" 2834 LIBS="$clean_LIBS" 2835 fi 2836 fi 2837 fi 2838 2839 dnl ********************************************************************** 2840 dnl Check for the presence of AppleIDN 2841 dnl ********************************************************************** 2842 2843 tst_links_appleidn='no' 2844 if test "$curl_cv_apple" = 'yes'; then 2845 AC_MSG_CHECKING([whether to build with Apple IDN]) 2846 OPT_IDN="default" 2847 AC_ARG_WITH(apple-idn, 2848 AS_HELP_STRING([--with-apple-idn],[Enable AppleIDN]) 2849 AS_HELP_STRING([--without-apple-idn],[Disable AppleIDN]), 2850 [OPT_IDN=$withval]) 2851 case "$OPT_IDN" in 2852 yes) 2853 dnl --with-apple-idn option used 2854 AC_MSG_RESULT([yes, check]) 2855 AC_CHECK_LIB(icucore, uidna_openUTS46, 2856 [ 2857 AC_CHECK_HEADERS(unicode/uidna.h, 2858 curl_idn_msg="enabled (AppleIDN)" 2859 AC_DEFINE(USE_APPLE_IDN, 1, [if AppleIDN]) 2860 USE_APPLE_IDN=1 2861 IDN_ENABLED=1 2862 LIBS="-licucore -liconv $LIBS" 2863 tst_links_appleidn='yes' 2864 ) 2865 ]) 2866 ;; 2867 *) 2868 AC_MSG_RESULT([no]) 2869 ;; 2870 esac 2871 fi 2872 2873 dnl ********************************************************************** 2874 dnl Check for the presence of libidn2 2875 dnl ********************************************************************** 2876 2877 AC_MSG_CHECKING([whether to build with libidn2]) 2878 OPT_IDN="default" 2879 AC_ARG_WITH(libidn2, 2880 AS_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage]) 2881 AS_HELP_STRING([--without-libidn2],[Disable libidn2 usage]), 2882 [OPT_IDN=$withval]) 2883 if test "x$tst_links_winidn" = "xyes"; then 2884 want_idn="no" 2885 AC_MSG_RESULT([no (using WinIDN instead)]) 2886 elif test "x$tst_links_appleidn" = "xyes"; then 2887 want_idn="no" 2888 AC_MSG_RESULT([no (using AppleIDN instead)]) 2889 else 2890 case "$OPT_IDN" in 2891 no) 2892 dnl --without-libidn2 option used 2893 want_idn="no" 2894 AC_MSG_RESULT([no]) 2895 ;; 2896 default) 2897 dnl configure option not specified 2898 want_idn="yes" 2899 want_idn_path="default" 2900 AC_MSG_RESULT([(assumed) yes]) 2901 ;; 2902 yes) 2903 dnl --with-libidn2 option used without path 2904 want_idn="yes" 2905 want_idn_path="default" 2906 AC_MSG_RESULT([yes]) 2907 ;; 2908 *) 2909 dnl --with-libidn2 option used with path 2910 want_idn="yes" 2911 want_idn_path="$withval" 2912 AC_MSG_RESULT([yes ($withval)]) 2913 ;; 2914 esac 2915 fi 2916 2917 if test "$want_idn" = "yes"; then 2918 dnl idn library support has been requested 2919 clean_CPPFLAGS="$CPPFLAGS" 2920 clean_LDFLAGS="$LDFLAGS" 2921 clean_LDFLAGSPC="$LDFLAGSPC" 2922 clean_LIBS="$LIBS" 2923 PKGCONFIG="no" 2924 # 2925 if test "$want_idn_path" != "default"; then 2926 dnl path has been specified 2927 IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig" 2928 CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR]) 2929 if test "$PKGCONFIG" != "no"; then 2930 IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl 2931 $PKGCONFIG --libs-only-l libidn2 2>/dev/null` 2932 IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl 2933 $PKGCONFIG --libs-only-L libidn2 2>/dev/null` 2934 IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl 2935 $PKGCONFIG --cflags-only-I libidn2 2>/dev/null` 2936 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'` 2937 else 2938 dnl pkg-config not available or provides no info 2939 IDN_LIBS="-lidn2" 2940 IDN_LDFLAGS="-L$want_idn_path/lib$libsuff" 2941 IDN_CPPFLAGS="-I$want_idn_path/include" 2942 IDN_DIR="$want_idn_path/lib$libsuff" 2943 fi 2944 else 2945 dnl path not specified 2946 CURL_CHECK_PKGCONFIG(libidn2) 2947 if test "$PKGCONFIG" != "no"; then 2948 IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null` 2949 IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null` 2950 IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null` 2951 IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'` 2952 else 2953 dnl pkg-config not available or provides no info 2954 IDN_LIBS="-lidn2" 2955 fi 2956 fi 2957 # 2958 if test "$PKGCONFIG" != "no"; then 2959 AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"]) 2960 AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"]) 2961 AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"]) 2962 AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"]) 2963 else 2964 AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"]) 2965 AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"]) 2966 AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"]) 2967 AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"]) 2968 fi 2969 # 2970 CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS" 2971 LDFLAGS="$LDFLAGS $IDN_LDFLAGS" 2972 LDFLAGSPC="$LDFLAGSPC $IDN_LDFLAGS" 2973 LIBS="$IDN_LIBS $LIBS" 2974 # 2975 AC_MSG_CHECKING([if idn2_lookup_ul can be linked]) 2976 AC_LINK_IFELSE([ 2977 AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul]) 2978 ],[ 2979 AC_MSG_RESULT([yes]) 2980 tst_links_libidn="yes" 2981 ],[ 2982 AC_MSG_RESULT([no]) 2983 tst_links_libidn="no" 2984 ]) 2985 # 2986 AC_CHECK_HEADERS( idn2.h ) 2987 2988 if test "$tst_links_libidn" = "yes"; then 2989 AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).]) 2990 dnl different versions of libidn have different setups of these: 2991 2992 IDN_ENABLED=1 2993 curl_idn_msg="enabled (libidn2)" 2994 if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then 2995 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR" 2996 export CURL_LIBRARY_PATH 2997 AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH]) 2998 fi 2999 LIBCURL_PC_REQUIRES_PRIVATE="libidn2 $LIBCURL_PC_REQUIRES_PRIVATE" 3000 else 3001 AC_MSG_WARN([Cannot find libidn2]) 3002 CPPFLAGS="$clean_CPPFLAGS" 3003 LDFLAGS="$clean_LDFLAGS" 3004 LDFLAGSPC="$clean_LDFLAGSPC" 3005 LIBS="$clean_LIBS" 3006 want_idn="no" 3007 fi 3008 fi 3009 3010 dnl ********************************************************************** 3011 dnl Check for nghttp2 3012 dnl ********************************************************************** 3013 3014 OPT_H2="yes" 3015 3016 if test "x$disable_http" = "xyes"; then 3017 # without HTTP nghttp2 is no use 3018 OPT_H2="no" 3019 fi 3020 3021 AC_ARG_WITH(nghttp2, 3022 AS_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage]) 3023 AS_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]), 3024 [OPT_H2=$withval]) 3025 case "$OPT_H2" in 3026 no) 3027 dnl --without-nghttp2 option used 3028 want_nghttp2="no" 3029 ;; 3030 yes) 3031 dnl --with-nghttp2 option used without path 3032 want_nghttp2="default" 3033 want_nghttp2_path="" 3034 want_nghttp2_pkg_config_path="" 3035 ;; 3036 *) 3037 dnl --with-nghttp2 option used with path 3038 want_nghttp2="yes" 3039 want_nghttp2_path="$withval" 3040 want_nghttp2_pkg_config_path="$withval/lib/pkgconfig" 3041 ;; 3042 esac 3043 3044 if test X"$want_nghttp2" != Xno; then 3045 dnl backup the pre-nghttp2 variables 3046 CLEANLDFLAGS="$LDFLAGS" 3047 CLEANLDFLAGSPC="$LDFLAGSPC" 3048 CLEANCPPFLAGS="$CPPFLAGS" 3049 CLEANLIBS="$LIBS" 3050 3051 CURL_CHECK_PKGCONFIG(libnghttp2, $want_nghttp2_pkg_config_path) 3052 3053 if test "$PKGCONFIG" != "no"; then 3054 LIB_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) 3055 $PKGCONFIG --libs-only-l libnghttp2` 3056 AC_MSG_NOTICE([-l is $LIB_H2]) 3057 3058 CPP_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) dnl 3059 $PKGCONFIG --cflags-only-I libnghttp2` 3060 AC_MSG_NOTICE([-I is $CPP_H2]) 3061 3062 LD_H2=`CURL_EXPORT_PCDIR([$want_nghttp2_pkg_config_path]) 3063 $PKGCONFIG --libs-only-L libnghttp2` 3064 AC_MSG_NOTICE([-L is $LD_H2]) 3065 3066 DIR_H2=`echo $LD_H2 | $SED -e 's/^-L//'` 3067 elif test x"$want_nghttp2_path" != x; then 3068 LIB_H2="-lnghttp2" 3069 LD_H2=-L${want_nghttp2_path}/lib$libsuff 3070 CPP_H2=-I${want_nghttp2_path}/include 3071 DIR_H2=${want_nghttp2_path}/lib$libsuff 3072 elif test X"$want_nghttp2" != Xdefault; then 3073 dnl no nghttp2 pkg-config found and no custom directory specified, 3074 dnl deal with it 3075 AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.]) 3076 else 3077 LIB_H2="-lnghttp2" 3078 fi 3079 3080 LDFLAGS="$LDFLAGS $LD_H2" 3081 LDFLAGSPC="$LDFLAGSPC $LD_H2" 3082 CPPFLAGS="$CPPFLAGS $CPP_H2" 3083 LIBS="$LIB_H2 $LIBS" 3084 3085 # use nghttp2_session_get_stream_local_window_size to require nghttp2 3086 # >= 1.15.0 3087 AC_CHECK_LIB(nghttp2, nghttp2_session_get_stream_local_window_size, 3088 [ 3089 AC_CHECK_HEADERS(nghttp2/nghttp2.h, 3090 curl_h2_msg="enabled (nghttp2)" 3091 AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use]) 3092 USE_NGHTTP2=1 3093 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp2" 3094 ) 3095 3096 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_H2" 3097 export CURL_LIBRARY_PATH 3098 AC_MSG_NOTICE([Added $DIR_H2 to CURL_LIBRARY_PATH]) 3099 ], 3100 dnl not found, revert back to clean variables 3101 LDFLAGS=$CLEANLDFLAGS 3102 LDFLAGSPC=$CLEANLDFLAGSPC 3103 CPPFLAGS=$CLEANCPPFLAGS 3104 LIBS=$CLEANLIBS 3105 ) 3106 fi 3107 3108 dnl ********************************************************************** 3109 dnl Check for ngtcp2 (QUIC) 3110 dnl ********************************************************************** 3111 3112 OPT_TCP2="no" 3113 3114 if test "x$disable_http" = "xyes"; then 3115 # without HTTP, ngtcp2 is no use 3116 OPT_TCP2="no" 3117 fi 3118 3119 AC_ARG_WITH(ngtcp2, 3120 AS_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage]) 3121 AS_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]), 3122 [OPT_TCP2=$withval]) 3123 case "$OPT_TCP2" in 3124 no) 3125 dnl --without-ngtcp2 option used 3126 want_tcp2="no" 3127 ;; 3128 yes) 3129 dnl --with-ngtcp2 option used without path 3130 want_tcp2="default" 3131 want_tcp2_path="" 3132 ;; 3133 *) 3134 dnl --with-ngtcp2 option used with path 3135 want_tcp2="yes" 3136 want_tcp2_path="$withval/lib/pkgconfig" 3137 ;; 3138 esac 3139 3140 curl_tcp2_msg="no (--with-ngtcp2)" 3141 if test X"$want_tcp2" != Xno; then 3142 3143 if test "$QUIC_ENABLED" != "yes"; then 3144 AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-ngtcp2 a no-no]) 3145 fi 3146 3147 dnl backup the pre-ngtcp2 variables 3148 CLEANLDFLAGS="$LDFLAGS" 3149 CLEANLDFLAGSPC="$LDFLAGSPC" 3150 CLEANCPPFLAGS="$CPPFLAGS" 3151 CLEANLIBS="$LIBS" 3152 3153 CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path) 3154 3155 if test "$PKGCONFIG" != "no"; then 3156 LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3157 $PKGCONFIG --libs-only-l libngtcp2` 3158 AC_MSG_NOTICE([-l is $LIB_TCP2]) 3159 3160 CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl 3161 $PKGCONFIG --cflags-only-I libngtcp2` 3162 AC_MSG_NOTICE([-I is $CPP_TCP2]) 3163 3164 LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3165 $PKGCONFIG --libs-only-L libngtcp2` 3166 AC_MSG_NOTICE([-L is $LD_TCP2]) 3167 3168 LDFLAGS="$LDFLAGS $LD_TCP2" 3169 LDFLAGSPC="$LDFLAGSPC $LD_TCP2" 3170 CPPFLAGS="$CPPFLAGS $CPP_TCP2" 3171 LIBS="$LIB_TCP2 $LIBS" 3172 3173 if test "x$cross_compiling" != "xyes"; then 3174 DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'` 3175 fi 3176 AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new_versioned, 3177 [ 3178 AC_CHECK_HEADERS(ngtcp2/ngtcp2.h, 3179 AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use]) 3180 USE_NGTCP2=1 3181 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2" 3182 export CURL_LIBRARY_PATH 3183 AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH]) 3184 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2" 3185 ) 3186 ], 3187 dnl not found, revert back to clean variables 3188 LDFLAGS=$CLEANLDFLAGS 3189 LDFLAGSPC=$CLEANLDFLAGSPC 3190 CPPFLAGS=$CLEANCPPFLAGS 3191 LIBS=$CLEANLIBS 3192 ) 3193 3194 else 3195 dnl no ngtcp2 pkg-config found, deal with it 3196 if test X"$want_tcp2" != Xdefault; then 3197 dnl To avoid link errors, we do not allow --with-ngtcp2 without 3198 dnl a pkgconfig file 3199 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.]) 3200 fi 3201 fi 3202 fi 3203 3204 if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ 3205 "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" != "x1"; then 3206 dnl backup the pre-ngtcp2_crypto_quictls variables 3207 CLEANLDFLAGS="$LDFLAGS" 3208 CLEANLDFLAGSPC="$LDFLAGSPC" 3209 CLEANCPPFLAGS="$CPPFLAGS" 3210 CLEANLIBS="$LIBS" 3211 3212 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_quictls, $want_tcp2_path) 3213 3214 if test "$PKGCONFIG" != "no"; then 3215 LIB_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3216 $PKGCONFIG --libs-only-l libngtcp2_crypto_quictls` 3217 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_QUICTLS]) 3218 3219 CPP_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl 3220 $PKGCONFIG --cflags-only-I libngtcp2_crypto_quictls` 3221 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_QUICTLS]) 3222 3223 LD_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3224 $PKGCONFIG --libs-only-L libngtcp2_crypto_quictls` 3225 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_QUICTLS]) 3226 3227 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS" 3228 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_QUICTLS" 3229 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS" 3230 LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS" 3231 3232 if test "x$cross_compiling" != "xyes"; then 3233 DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'` 3234 fi 3235 AC_CHECK_LIB(ngtcp2_crypto_quictls, ngtcp2_crypto_recv_client_initial_cb, 3236 [ 3237 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, 3238 USE_NGTCP2=1 3239 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS" 3240 export CURL_LIBRARY_PATH 3241 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH]) 3242 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_quictls" 3243 ) 3244 ], 3245 dnl not found, revert back to clean variables 3246 LDFLAGS=$CLEANLDFLAGS 3247 LDFLAGSPC=$CLEANLDFLAGSPC 3248 CPPFLAGS=$CLEANCPPFLAGS 3249 LIBS=$CLEANLIBS 3250 ) 3251 3252 else 3253 dnl no ngtcp2_crypto_quictls pkg-config found, deal with it 3254 if test X"$want_tcp2" != Xdefault; then 3255 dnl To avoid link errors, we do not allow --with-ngtcp2 without 3256 dnl a pkgconfig file 3257 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_quictls pkg-config file.]) 3258 fi 3259 fi 3260 fi 3261 3262 if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a \ 3263 "x$OPENSSL_IS_BORINGSSL" != "x1" -a "x$OPENSSL_QUIC_API2" = "x1"; then 3264 dnl backup the pre-ngtcp2_crypto_ossl variables 3265 CLEANLDFLAGS="$LDFLAGS" 3266 CLEANLDFLAGSPC="$LDFLAGSPC" 3267 CLEANCPPFLAGS="$CPPFLAGS" 3268 CLEANLIBS="$LIBS" 3269 3270 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_ossl, $want_tcp2_path) 3271 3272 if test "$PKGCONFIG" != "no"; then 3273 LIB_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3274 $PKGCONFIG --libs-only-l libngtcp2_crypto_ossl` 3275 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_QUICTLS]) 3276 3277 CPP_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl 3278 $PKGCONFIG --cflags-only-I libngtcp2_crypto_ossl` 3279 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_QUICTLS]) 3280 3281 LD_NGTCP2_CRYPTO_QUICTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3282 $PKGCONFIG --libs-only-L libngtcp2_crypto_ossl` 3283 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_QUICTLS]) 3284 3285 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_QUICTLS" 3286 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_QUICTLS" 3287 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_QUICTLS" 3288 LIBS="$LIB_NGTCP2_CRYPTO_QUICTLS $LIBS" 3289 3290 if test "x$cross_compiling" != "xyes"; then 3291 DIR_NGTCP2_CRYPTO_QUICTLS=`echo $LD_NGTCP2_CRYPTO_QUICTLS | $SED -e 's/^-L//'` 3292 fi 3293 AC_CHECK_LIB(ngtcp2_crypto_ossl, ngtcp2_crypto_recv_client_initial_cb, 3294 [ 3295 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, 3296 USE_NGTCP2=1 3297 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_QUICTLS" 3298 export CURL_LIBRARY_PATH 3299 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_QUICTLS to CURL_LIBRARY_PATH]) 3300 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_ossl" 3301 AC_DEFINE(OPENSSL_QUIC_API2, 1, [openssl with new QUIC API]) 3302 ) 3303 ], 3304 dnl not found, revert back to clean variables 3305 LDFLAGS=$CLEANLDFLAGS 3306 LDFLAGSPC=$CLEANLDFLAGSPC 3307 CPPFLAGS=$CLEANCPPFLAGS 3308 LIBS=$CLEANLIBS 3309 ) 3310 3311 else 3312 dnl no ngtcp2_crypto_ossl pkg-config found, deal with it 3313 if test X"$want_tcp2" != Xdefault; then 3314 dnl To avoid link errors, we do not allow --with-ngtcp2 without 3315 dnl a pkgconfig file 3316 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_ossl pkg-config file.]) 3317 fi 3318 fi 3319 fi 3320 3321 if test "x$USE_NGTCP2" = "x1" -a "x$OPENSSL_ENABLED" = "x1" -a "x$OPENSSL_IS_BORINGSSL" = "x1"; then 3322 dnl backup the pre-ngtcp2_crypto_boringssl variables 3323 CLEANLDFLAGS="$LDFLAGS" 3324 CLEANLDFLAGSPC="$LDFLAGSPC" 3325 CLEANCPPFLAGS="$CPPFLAGS" 3326 CLEANLIBS="$LIBS" 3327 3328 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_boringssl, $want_tcp2_path) 3329 3330 if test "$PKGCONFIG" != "no"; then 3331 LIB_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3332 $PKGCONFIG --libs-only-l libngtcp2_crypto_boringssl` 3333 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_BORINGSSL]) 3334 3335 CPP_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl 3336 $PKGCONFIG --cflags-only-I libngtcp2_crypto_boringssl` 3337 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_BORINGSSL]) 3338 3339 LD_NGTCP2_CRYPTO_BORINGSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3340 $PKGCONFIG --libs-only-L libngtcp2_crypto_boringssl` 3341 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_BORINGSSL]) 3342 3343 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_BORINGSSL" 3344 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_BORINGSSL" 3345 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_BORINGSSL" 3346 LIBS="$LIB_NGTCP2_CRYPTO_BORINGSSL $LIBS" 3347 3348 if test "x$cross_compiling" != "xyes"; then 3349 DIR_NGTCP2_CRYPTO_BORINGSSL=`echo $LD_NGTCP2_CRYPTO_BORINGSSL | $SED -e 's/^-L//'` 3350 fi 3351 AC_CHECK_LIB(ngtcp2_crypto_boringssl, ngtcp2_crypto_recv_client_initial_cb, 3352 [ 3353 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, 3354 USE_NGTCP2=1 3355 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_BORINGSSL" 3356 export CURL_LIBRARY_PATH 3357 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_BORINGSSL to CURL_LIBRARY_PATH]) 3358 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_boringssl" 3359 ) 3360 ], 3361 dnl not found, revert back to clean variables 3362 LDFLAGS=$CLEANLDFLAGS 3363 LDFLAGSPC=$CLEANLDFLAGSPC 3364 CPPFLAGS=$CLEANCPPFLAGS 3365 LIBS=$CLEANLIBS 3366 ) 3367 3368 else 3369 dnl no ngtcp2_crypto_boringssl pkg-config found, deal with it 3370 if test X"$want_tcp2" != Xdefault; then 3371 dnl To avoid link errors, we do not allow --with-ngtcp2 without 3372 dnl a pkgconfig file 3373 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file.]) 3374 fi 3375 fi 3376 fi 3377 3378 if test "x$USE_NGTCP2" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then 3379 dnl backup the pre-ngtcp2_crypto_gnutls variables 3380 CLEANLDFLAGS="$LDFLAGS" 3381 CLEANLDFLAGSPC="$LDFLAGSPC" 3382 CLEANCPPFLAGS="$CPPFLAGS" 3383 CLEANLIBS="$LIBS" 3384 3385 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path) 3386 3387 if test "$PKGCONFIG" != "no"; then 3388 LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3389 $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls` 3390 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS]) 3391 3392 CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl 3393 $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls` 3394 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS]) 3395 3396 LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3397 $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls` 3398 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS]) 3399 3400 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS" 3401 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_GNUTLS" 3402 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS" 3403 LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS" 3404 3405 if test "x$cross_compiling" != "xyes"; then 3406 DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'` 3407 fi 3408 AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_recv_client_initial_cb, 3409 [ 3410 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, 3411 USE_NGTCP2=1 3412 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS" 3413 export CURL_LIBRARY_PATH 3414 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH]) 3415 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_gnutls" 3416 ) 3417 ], 3418 dnl not found, revert back to clean variables 3419 LDFLAGS=$CLEANLDFLAGS 3420 LDFLAGSPC=$CLEANLDFLAGSPC 3421 CPPFLAGS=$CLEANCPPFLAGS 3422 LIBS=$CLEANLIBS 3423 ) 3424 3425 else 3426 dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it 3427 if test X"$want_tcp2" != Xdefault; then 3428 dnl To avoid link errors, we do not allow --with-ngtcp2 without 3429 dnl a pkgconfig file 3430 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.]) 3431 fi 3432 fi 3433 fi 3434 3435 if test "x$USE_NGTCP2" = "x1" -a "x$WOLFSSL_ENABLED" = "x1"; then 3436 dnl backup the pre-ngtcp2_crypto_wolfssl variables 3437 CLEANLDFLAGS="$LDFLAGS" 3438 CLEANLDFLAGSPC="$LDFLAGSPC" 3439 CLEANCPPFLAGS="$CPPFLAGS" 3440 CLEANLIBS="$LIBS" 3441 3442 CURL_CHECK_PKGCONFIG(libngtcp2_crypto_wolfssl, $want_tcp2_path) 3443 3444 if test "$PKGCONFIG" != "no"; then 3445 LIB_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3446 $PKGCONFIG --libs-only-l libngtcp2_crypto_wolfssl` 3447 AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_WOLFSSL]) 3448 3449 CPP_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl 3450 $PKGCONFIG --cflags-only-I libngtcp2_crypto_wolfssl` 3451 AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_WOLFSSL]) 3452 3453 LD_NGTCP2_CRYPTO_WOLFSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) 3454 $PKGCONFIG --libs-only-L libngtcp2_crypto_wolfssl` 3455 AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_WOLFSSL]) 3456 3457 LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_WOLFSSL" 3458 LDFLAGSPC="$LDFLAGSPC $LD_NGTCP2_CRYPTO_WOLFSSL" 3459 CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_WOLFSSL" 3460 LIBS="$LIB_NGTCP2_CRYPTO_WOLFSSL $LIBS" 3461 3462 if test "x$cross_compiling" != "xyes"; then 3463 DIR_NGTCP2_CRYPTO_WOLFSSL=`echo $LD_NGTCP2_CRYPTO_WOLFSSL | $SED -e 's/^-L//'` 3464 fi 3465 AC_CHECK_LIB(ngtcp2_crypto_wolfssl, ngtcp2_crypto_recv_client_initial_cb, 3466 [ 3467 AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, 3468 USE_NGTCP2=1 3469 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_WOLFSSL" 3470 export CURL_LIBRARY_PATH 3471 AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_WOLFSSL to CURL_LIBRARY_PATH]) 3472 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libngtcp2_crypto_wolfssl" 3473 ) 3474 ], 3475 dnl not found, revert back to clean variables 3476 LDFLAGS=$CLEANLDFLAGS 3477 LDFLAGSPC=$CLEANLDFLAGSPC 3478 CPPFLAGS=$CLEANCPPFLAGS 3479 LIBS=$CLEANLIBS 3480 ) 3481 3482 else 3483 dnl no ngtcp2_crypto_wolfssl pkg-config found, deal with it 3484 if test X"$want_tcp2" != Xdefault; then 3485 dnl To avoid link errors, we do not allow --with-ngtcp2 without 3486 dnl a pkgconfig file 3487 AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_wolfssl pkg-config file.]) 3488 fi 3489 fi 3490 fi 3491 3492 dnl ********************************************************************** 3493 dnl Check for OpenSSL QUIC 3494 dnl ********************************************************************** 3495 3496 OPT_OPENSSL_QUIC="no" 3497 3498 if test "x$disable_http" = "xyes" -o "x$OPENSSL_ENABLED" != "x1"; then 3499 # without HTTP or without openssl, no use 3500 OPT_OPENSSL_QUIC="no" 3501 fi 3502 3503 AC_ARG_WITH(openssl-quic, 3504 AS_HELP_STRING([--with-openssl-quic],[Enable OpenSSL QUIC usage]) 3505 AS_HELP_STRING([--without-openssl-quic],[Disable OpenSSL QUIC usage]), 3506 [OPT_OPENSSL_QUIC=$withval]) 3507 case "$OPT_OPENSSL_QUIC" in 3508 no) 3509 dnl --without-openssl-quic option used 3510 want_openssl_quic="no" 3511 ;; 3512 yes) 3513 dnl --with-openssl-quic option used 3514 want_openssl_quic="yes" 3515 ;; 3516 esac 3517 3518 curl_openssl_quic_msg="no (--with-openssl-quic)" 3519 if test "x$want_openssl_quic" = "xyes"; then 3520 3521 if test "$USE_NGTCP2" = 1; then 3522 AC_MSG_ERROR([--with-openssl-quic and --with-ngtcp2 are mutually exclusive]) 3523 fi 3524 if test "$have_openssl_quic" != 1; then 3525 AC_MSG_ERROR([--with-openssl-quic requires quic support and OpenSSL >= 3.3.0]) 3526 fi 3527 AC_DEFINE(USE_OPENSSL_QUIC, 1, [if openssl QUIC is in use]) 3528 USE_OPENSSL_QUIC=1 3529 fi 3530 3531 dnl ********************************************************************** 3532 dnl Check for nghttp3 (HTTP/3 with ngtcp2) 3533 dnl ********************************************************************** 3534 3535 OPT_NGHTTP3="yes" 3536 3537 if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then 3538 # without ngtcp2 or openssl quic, nghttp3 is of no use for us 3539 OPT_NGHTTP3="no" 3540 want_nghttp3="no" 3541 fi 3542 3543 AC_ARG_WITH(nghttp3, 3544 AS_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage]) 3545 AS_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]), 3546 [OPT_NGHTTP3=$withval]) 3547 case "$OPT_NGHTTP3" in 3548 no) 3549 dnl --without-nghttp3 option used 3550 want_nghttp3="no" 3551 ;; 3552 yes) 3553 dnl --with-nghttp3 option used without path 3554 want_nghttp3="default" 3555 want_nghttp3_path="" 3556 ;; 3557 *) 3558 dnl --with-nghttp3 option used with path 3559 want_nghttp3="yes" 3560 want_nghttp3_path="$withval/lib/pkgconfig" 3561 ;; 3562 esac 3563 3564 curl_http3_msg="no (--with-nghttp3)" 3565 if test X"$want_nghttp3" != Xno; then 3566 3567 if test "x$USE_NGTCP2" != "x1" -a "x$USE_OPENSSL_QUIC" != "x1"; then 3568 # without ngtcp2 or openssl quic, nghttp3 is of no use for us 3569 AC_MSG_ERROR([nghttp3 enabled without a QUIC library; enable ngtcp2 or OpenSSL-QUIC]) 3570 fi 3571 3572 dnl backup the pre-nghttp3 variables 3573 CLEANLDFLAGS="$LDFLAGS" 3574 CLEANLDFLAGSPC="$LDFLAGSPC" 3575 CLEANCPPFLAGS="$CPPFLAGS" 3576 CLEANLIBS="$LIBS" 3577 3578 CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path) 3579 3580 if test "$PKGCONFIG" != "no"; then 3581 LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) 3582 $PKGCONFIG --libs-only-l libnghttp3` 3583 AC_MSG_NOTICE([-l is $LIB_NGHTTP3]) 3584 3585 CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl 3586 $PKGCONFIG --cflags-only-I libnghttp3` 3587 AC_MSG_NOTICE([-I is $CPP_NGHTTP3]) 3588 3589 LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) 3590 $PKGCONFIG --libs-only-L libnghttp3` 3591 AC_MSG_NOTICE([-L is $LD_NGHTTP3]) 3592 3593 LDFLAGS="$LDFLAGS $LD_NGHTTP3" 3594 LDFLAGSPC="$LDFLAGSPC $LD_NGHTTP3" 3595 CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3" 3596 LIBS="$LIB_NGHTTP3 $LIBS" 3597 3598 if test "x$cross_compiling" != "xyes"; then 3599 DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'` 3600 fi 3601 AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new_versioned, 3602 [ 3603 AC_CHECK_HEADERS(nghttp3/nghttp3.h, 3604 AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use]) 3605 USE_NGHTTP3=1 3606 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3" 3607 export CURL_LIBRARY_PATH 3608 AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH]) 3609 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libnghttp3" 3610 ) 3611 ], 3612 dnl not found, revert back to clean variables 3613 LDFLAGS=$CLEANLDFLAGS 3614 LDFLAGSPC=$CLEANLDFLAGSPC 3615 CPPFLAGS=$CLEANCPPFLAGS 3616 LIBS=$CLEANLIBS 3617 ) 3618 3619 else 3620 dnl no nghttp3 pkg-config found, deal with it 3621 if test X"$want_nghttp3" != Xdefault; then 3622 dnl To avoid link errors, we do not allow --with-nghttp3 without 3623 dnl a pkgconfig file 3624 AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.]) 3625 fi 3626 fi 3627 fi 3628 3629 dnl ********************************************************************** 3630 dnl Check for ngtcp2 and nghttp3 (HTTP/3 with ngtcp2 + nghttp3) 3631 dnl ********************************************************************** 3632 3633 if test "x$USE_NGTCP2" = "x1" -a "x$USE_NGHTTP3" = "x1"; then 3634 USE_NGTCP2_H3=1 3635 AC_MSG_NOTICE([HTTP3 support is experimental]) 3636 curl_h3_msg="enabled (ngtcp2 + nghttp3)" 3637 fi 3638 3639 dnl ********************************************************************** 3640 dnl Check for OpenSSL and nghttp3 (HTTP/3 with nghttp3 using OpenSSL QUIC) 3641 dnl ********************************************************************** 3642 3643 if test "x$USE_OPENSSL_QUIC" = "x1" -a "x$USE_NGHTTP3" = "x1"; then 3644 experimental="$experimental HTTP3" 3645 USE_OPENSSL_H3=1 3646 AC_MSG_NOTICE([HTTP3 support is experimental]) 3647 curl_h3_msg="enabled (openssl + nghttp3)" 3648 fi 3649 3650 dnl ********************************************************************** 3651 dnl Check for quiche (QUIC) 3652 dnl ********************************************************************** 3653 3654 OPT_QUICHE="no" 3655 3656 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then 3657 # without HTTP or with ngtcp2, quiche is no use 3658 OPT_QUICHE="no" 3659 fi 3660 3661 AC_ARG_WITH(quiche, 3662 AS_HELP_STRING([--with-quiche=PATH],[Enable quiche usage]) 3663 AS_HELP_STRING([--without-quiche],[Disable quiche usage]), 3664 [OPT_QUICHE=$withval]) 3665 case "$OPT_QUICHE" in 3666 no) 3667 dnl --without-quiche option used 3668 want_quiche="no" 3669 ;; 3670 yes) 3671 dnl --with-quiche option used without path 3672 want_quiche="default" 3673 want_quiche_path="" 3674 ;; 3675 *) 3676 dnl --with-quiche option used with path 3677 want_quiche="yes" 3678 want_quiche_path="$withval" 3679 ;; 3680 esac 3681 3682 if test X"$want_quiche" != Xno; then 3683 3684 if test "$QUIC_ENABLED" != "yes"; then 3685 AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-quiche a no-no]) 3686 fi 3687 3688 if test "$NGHTTP3_ENABLED" = 1; then 3689 AC_MSG_ERROR([--with-quiche and --with-ngtcp2 are mutually exclusive]) 3690 fi 3691 3692 dnl backup the pre-quiche variables 3693 CLEANLDFLAGS="$LDFLAGS" 3694 CLEANLDFLAGSPC="$LDFLAGSPC" 3695 CLEANCPPFLAGS="$CPPFLAGS" 3696 CLEANLIBS="$LIBS" 3697 3698 CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path) 3699 3700 if test "$PKGCONFIG" != "no"; then 3701 LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) 3702 $PKGCONFIG --libs-only-l quiche` 3703 AC_MSG_NOTICE([-l is $LIB_QUICHE]) 3704 3705 CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl 3706 $PKGCONFIG --cflags-only-I quiche` 3707 AC_MSG_NOTICE([-I is $CPP_QUICHE]) 3708 3709 LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) 3710 $PKGCONFIG --libs-only-L quiche` 3711 AC_MSG_NOTICE([-L is $LD_QUICHE]) 3712 3713 LDFLAGS="$LDFLAGS $LD_QUICHE" 3714 LDFLAGSPC="$LDFLAGSPC $LD_QUICHE" 3715 CPPFLAGS="$CPPFLAGS $CPP_QUICHE" 3716 LIBS="$LIB_QUICHE $LIBS" 3717 3718 if test "x$cross_compiling" != "xyes"; then 3719 DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'` 3720 fi 3721 AC_CHECK_LIB(quiche, quiche_conn_send_ack_eliciting, 3722 [ 3723 AC_CHECK_HEADERS(quiche.h, 3724 experimental="$experimental HTTP3" 3725 AC_MSG_NOTICE([HTTP3 support is experimental]) 3726 curl_h3_msg="enabled (quiche)" 3727 AC_DEFINE(USE_QUICHE, 1, [if quiche is in use]) 3728 USE_QUICHE=1 3729 AC_CHECK_FUNCS([quiche_conn_set_qlog_fd]) 3730 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE" 3731 export CURL_LIBRARY_PATH 3732 AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]) 3733 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE quiche", 3734 [], 3735 [ 3736 AC_INCLUDES_DEFAULT 3737 #include <sys/socket.h> 3738 ] 3739 ) 3740 ], 3741 dnl not found, revert back to clean variables 3742 AC_MSG_ERROR([couldn't use quiche]) 3743 ) 3744 else 3745 dnl no quiche pkg-config found, deal with it 3746 if test X"$want_quiche" != Xdefault; then 3747 dnl To avoid link errors, we do not allow --with-quiche without 3748 dnl a pkgconfig file 3749 AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.]) 3750 fi 3751 fi 3752 fi 3753 3754 dnl ********************************************************************** 3755 dnl Check for msh3/msquic (QUIC) 3756 dnl ********************************************************************** 3757 3758 OPT_MSH3="no" 3759 3760 if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then 3761 # without HTTP or with ngtcp2, msh3 is no use 3762 OPT_MSH3="no" 3763 fi 3764 3765 AC_ARG_WITH(msh3, 3766 AS_HELP_STRING([--with-msh3=PATH],[Enable msh3 usage]) 3767 AS_HELP_STRING([--without-msh3],[Disable msh3 usage]), 3768 [OPT_MSH3=$withval]) 3769 case "$OPT_MSH3" in 3770 no) 3771 dnl --without-msh3 option used 3772 want_msh3="no" 3773 ;; 3774 yes) 3775 dnl --with-msh3 option used without path 3776 want_msh3="default" 3777 want_msh3_path="" 3778 ;; 3779 *) 3780 dnl --with-msh3 option used with path 3781 want_msh3="yes" 3782 want_msh3_path="$withval" 3783 ;; 3784 esac 3785 3786 if test X"$want_msh3" != Xno; then 3787 3788 dnl msh3 on non-Windows needs an OpenSSL with the QUIC API 3789 if test "$curl_cv_native_windows" != "yes"; then 3790 if test "$QUIC_ENABLED" != "yes"; then 3791 AC_MSG_ERROR([the detected TLS library does not support QUIC, making --with-msh3 a no-no]) 3792 fi 3793 if test "$OPENSSL_ENABLED" != "1"; then 3794 AC_MSG_ERROR([msh3/msquic requires OpenSSL]) 3795 fi 3796 fi 3797 3798 if test "$NGHTTP3_ENABLED" = 1; then 3799 AC_MSG_ERROR([--with-msh3 and --with-ngtcp2 are mutually exclusive]) 3800 fi 3801 if test "$USE_QUICHE" = 1; then 3802 AC_MSG_ERROR([--with-msh3 and --with-quiche are mutually exclusive]) 3803 fi 3804 3805 dnl backup the pre-msh3 variables 3806 CLEANLDFLAGS="$LDFLAGS" 3807 CLEANLDFLAGSPC="$LDFLAGSPC" 3808 CLEANCPPFLAGS="$CPPFLAGS" 3809 CLEANLIBS="$LIBS" 3810 3811 if test -n "$want_msh3_path"; then 3812 LD_MSH3="-L$want_msh3_path/lib" 3813 CPP_MSH3="-I$want_msh3_path/include" 3814 DIR_MSH3="$want_msh3_path/lib" 3815 LDFLAGS="$LDFLAGS $LD_MSH3" 3816 LDFLAGSPC="$LDFLAGSPC $LD_MSH3" 3817 CPPFLAGS="$CPPFLAGS $CPP_MSH3" 3818 fi 3819 LIBS="-lmsh3 $LIBS" 3820 3821 AC_CHECK_LIB(msh3, MsH3ApiOpen, 3822 [ 3823 AC_CHECK_HEADERS(msh3.h, 3824 curl_h3_msg="enabled (msh3)" 3825 AC_DEFINE(USE_MSH3, 1, [if msh3 is in use]) 3826 USE_MSH3=1 3827 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_MSH3" 3828 export CURL_LIBRARY_PATH 3829 AC_MSG_NOTICE([Added $DIR_MSH3 to CURL_LIBRARY_PATH]) 3830 dnl FIXME: Enable when msh3 was detected via pkg-config 3831 if false; then 3832 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libmsh3" 3833 fi 3834 experimental="$experimental HTTP3" 3835 ) 3836 ], 3837 dnl not found, revert back to clean variables 3838 LDFLAGS=$CLEANLDFLAGS 3839 LDFLAGSPC=$CLEANLDFLAGSPC 3840 CPPFLAGS=$CLEANCPPFLAGS 3841 LIBS=$CLEANLIBS 3842 ) 3843 fi 3844 3845 dnl ********************************************************************** 3846 dnl libuv is only ever used for debug purposes 3847 dnl ********************************************************************** 3848 3849 OPT_LIBUV=no 3850 AC_ARG_WITH(libuv, 3851 AS_HELP_STRING([--with-libuv=PATH],[Enable libuv]) 3852 AS_HELP_STRING([--without-libuv],[Disable libuv]), 3853 [OPT_LIBUV=$withval]) 3854 case "$OPT_LIBUV" in 3855 no) 3856 dnl --without-libuv option used 3857 want_libuv="no" 3858 ;; 3859 yes) 3860 dnl --with-libuv option used without path 3861 want_libuv="default" 3862 want_libuv_path="" 3863 ;; 3864 *) 3865 dnl --with-libuv option used with path 3866 want_libuv="yes" 3867 want_libuv_path="$withval" 3868 ;; 3869 esac 3870 3871 if test X"$want_libuv" != Xno; then 3872 if test x$want_debug != xyes; then 3873 AC_MSG_ERROR([Using libuv without debug support enabled is useless]) 3874 fi 3875 3876 dnl backup the pre-libuv variables 3877 CLEANLDFLAGS="$LDFLAGS" 3878 CLEANLDFLAGSPC="$LDFLAGSPC" 3879 CLEANCPPFLAGS="$CPPFLAGS" 3880 CLEANLIBS="$LIBS" 3881 3882 CURL_CHECK_PKGCONFIG(libuv, $want_libuv_path) 3883 3884 if test "$PKGCONFIG" != "no"; then 3885 LIB_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) 3886 $PKGCONFIG --libs-only-l libuv` 3887 AC_MSG_NOTICE([-l is $LIB_LIBUV]) 3888 3889 CPP_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) dnl 3890 $PKGCONFIG --cflags-only-I libuv` 3891 AC_MSG_NOTICE([-I is $CPP_LIBUV]) 3892 3893 LD_LIBUV=`CURL_EXPORT_PCDIR([$want_libuv_path]) 3894 $PKGCONFIG --libs-only-L libuv` 3895 AC_MSG_NOTICE([-L is $LD_LIBUV]) 3896 3897 LDFLAGS="$LDFLAGS $LD_LIBUV" 3898 LDFLAGSPC="$LDFLAGSPC $LD_LIBUV" 3899 CPPFLAGS="$CPPFLAGS $CPP_LIBUV" 3900 LIBS="$LIB_LIBUV $LIBS" 3901 3902 if test "x$cross_compiling" != "xyes"; then 3903 DIR_LIBUV=`echo $LD_LIBUV | $SED -e 's/^-L//'` 3904 fi 3905 AC_CHECK_LIB(uv, uv_default_loop, 3906 [ 3907 AC_CHECK_HEADERS(uv.h, 3908 AC_DEFINE(USE_LIBUV, 1, [if libuv is in use]) 3909 USE_LIBUV=1 3910 CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_LIBUV" 3911 export CURL_LIBRARY_PATH 3912 AC_MSG_NOTICE([Added $DIR_LIBUV to CURL_LIBRARY_PATH]) 3913 LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libuv" 3914 ) 3915 ], 3916 dnl not found, revert back to clean variables 3917 LDFLAGS=$CLEANLDFLAGS 3918 LDFLAGSPC=$CLEANLDFLAGSPC 3919 CPPFLAGS=$CLEANCPPFLAGS 3920 LIBS=$CLEANLIBS 3921 ) 3922 3923 else 3924 dnl no libuv pkg-config found, deal with it 3925 if test X"$want_libuv" != Xdefault; then 3926 dnl To avoid link errors, we do not allow --with-libuv without 3927 dnl a pkgconfig file 3928 AC_MSG_ERROR([--with-libuv was specified but could not find libuv pkg-config file.]) 3929 fi 3930 fi 3931 3932 fi 3933 3934 dnl ********************************************************************** 3935 dnl Check for zsh completion path 3936 dnl ********************************************************************** 3937 3938 OPT_ZSH_FPATH=default 3939 AC_ARG_WITH(zsh-functions-dir, 3940 AS_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH]) 3941 AS_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]), 3942 [OPT_ZSH_FPATH=$withval]) 3943 case "$OPT_ZSH_FPATH" in 3944 default|no) 3945 dnl --without-zsh-functions-dir option used 3946 ;; 3947 yes) 3948 dnl --with-zsh-functions-dir option used without path 3949 ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions" 3950 AC_SUBST(ZSH_FUNCTIONS_DIR) 3951 ;; 3952 *) 3953 dnl --with-zsh-functions-dir option used with path 3954 ZSH_FUNCTIONS_DIR="$withval" 3955 AC_SUBST(ZSH_FUNCTIONS_DIR) 3956 ;; 3957 esac 3958 AM_CONDITIONAL(USE_ZSH_COMPLETION, test x"$ZSH_FUNCTIONS_DIR" != x) 3959 3960 dnl ********************************************************************** 3961 dnl Check for fish completion path 3962 dnl ********************************************************************** 3963 3964 OPT_FISH_FPATH=default 3965 AC_ARG_WITH(fish-functions-dir, 3966 AS_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH]) 3967 AS_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]), 3968 [OPT_FISH_FPATH=$withval]) 3969 case "$OPT_FISH_FPATH" in 3970 default|no) 3971 dnl --without-fish-functions-dir option used 3972 ;; 3973 yes) 3974 dnl --with-fish-functions-dir option used without path 3975 CURL_CHECK_PKGCONFIG(fish) 3976 if test "$PKGCONFIG" != "no"; then 3977 FISH_FUNCTIONS_DIR=`$PKGCONFIG --variable completionsdir fish` 3978 else 3979 FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d" 3980 fi 3981 AC_SUBST(FISH_FUNCTIONS_DIR) 3982 ;; 3983 *) 3984 dnl --with-fish-functions-dir option used with path 3985 FISH_FUNCTIONS_DIR="$withval" 3986 AC_SUBST(FISH_FUNCTIONS_DIR) 3987 ;; 3988 esac 3989 AM_CONDITIONAL(USE_FISH_COMPLETION, test x"$FISH_FUNCTIONS_DIR" != x) 3990 3991 dnl Now check for the very most basic headers. Then we can use these 3992 dnl ones as default-headers when checking for the rest! 3993 AC_CHECK_HEADERS( 3994 sys/types.h \ 3995 sys/select.h \ 3996 sys/ioctl.h \ 3997 unistd.h \ 3998 arpa/inet.h \ 3999 net/if.h \ 4000 netinet/in.h \ 4001 netinet/in6.h \ 4002 sys/un.h \ 4003 linux/tcp.h \ 4004 netinet/tcp.h \ 4005 netinet/udp.h \ 4006 netdb.h \ 4007 sys/sockio.h \ 4008 sys/param.h \ 4009 termios.h \ 4010 termio.h \ 4011 fcntl.h \ 4012 io.h \ 4013 pwd.h \ 4014 utime.h \ 4015 sys/utime.h \ 4016 sys/poll.h \ 4017 poll.h \ 4018 sys/resource.h \ 4019 libgen.h \ 4020 locale.h \ 4021 stdbool.h \ 4022 stdint.h \ 4023 sys/filio.h \ 4024 sys/eventfd.h, 4025 dnl to do if not found 4026 [], 4027 dnl to do if found 4028 [], 4029 dnl default includes 4030 [ 4031 #include <stdlib.h> 4032 #ifdef HAVE_SYS_TYPES_H 4033 #include <sys/types.h> 4034 #endif 4035 #if !defined(_WIN32) || defined(__MINGW32__) 4036 #include <sys/time.h> 4037 #endif 4038 #ifdef HAVE_SYS_SELECT_H 4039 #include <sys/select.h> 4040 #elif defined(HAVE_UNISTD_H) 4041 #include <unistd.h> 4042 #endif 4043 #ifndef _WIN32 4044 #include <sys/socket.h> 4045 #endif 4046 #ifdef HAVE_NETINET_IN_H 4047 #include <netinet/in.h> 4048 #endif 4049 #ifdef HAVE_NETINET_IN6_H 4050 #include <netinet/in6.h> /* is this really required to detect other headers? */ 4051 #endif 4052 #ifdef HAVE_SYS_UN_H 4053 #include <sys/un.h> /* is this really required to detect other headers? */ 4054 #endif 4055 ] 4056 ) 4057 4058 4059 dnl Checks for typedefs, structures, and compiler characteristics. 4060 AC_C_CONST 4061 AC_TYPE_SIZE_T 4062 4063 CURL_CHECK_STRUCT_TIMEVAL 4064 CURL_VERIFY_RUNTIMELIBS 4065 4066 CURL_SIZEOF(size_t) 4067 CURL_SIZEOF(long) 4068 CURL_SIZEOF(int) 4069 CURL_SIZEOF(time_t) 4070 CURL_SIZEOF(off_t) 4071 4072 o=$CPPFLAGS 4073 CPPFLAGS="-I$srcdir/include $CPPFLAGS" 4074 CURL_SIZEOF(curl_off_t, [ 4075 #include <curl/system.h> 4076 ]) 4077 CURL_SIZEOF(curl_socket_t, [ 4078 #include <curl/curl.h> 4079 ]) 4080 CPPFLAGS=$o 4081 4082 AC_CHECK_TYPE(long long, 4083 [AC_DEFINE(HAVE_LONGLONG, 1, 4084 [Define to 1 if the compiler supports the 'long long' data type.])] 4085 longlong="yes" 4086 ) 4087 4088 if test ${ac_cv_sizeof_curl_off_t} -lt 8; then 4089 AC_MSG_ERROR([64 bit curl_off_t is required]) 4090 fi 4091 4092 # check for ssize_t 4093 AC_CHECK_TYPE(ssize_t, , 4094 AC_DEFINE(ssize_t, int, [the signed version of size_t])) 4095 4096 # check for bool type 4097 AC_CHECK_TYPE([bool],[ 4098 AC_DEFINE(HAVE_BOOL_T, 1, 4099 [Define to 1 if bool is an available type.]) 4100 ], ,[ 4101 #ifdef HAVE_SYS_TYPES_H 4102 #include <sys/types.h> 4103 #endif 4104 #ifdef HAVE_STDBOOL_H 4105 #include <stdbool.h> 4106 #endif 4107 ]) 4108 4109 # check for sa_family_t 4110 AC_CHECK_TYPE(sa_family_t, 4111 AC_DEFINE(HAVE_SA_FAMILY_T, 1, [Define to 1 if symbol `sa_family_t' exists]), 4112 [ 4113 # The Windows name? 4114 AC_CHECK_TYPE(ADDRESS_FAMILY, 4115 AC_DEFINE(HAVE_ADDRESS_FAMILY, 1, [Define to 1 if symbol `ADDRESS_FAMILY' exists]), 4116 [], 4117 [ 4118 #ifdef _WIN32 4119 #ifndef WIN32_LEAN_AND_MEAN 4120 #define WIN32_LEAN_AND_MEAN 4121 #endif 4122 #include <winsock2.h> 4123 #else 4124 #include <sys/socket.h> 4125 #endif 4126 ]) 4127 ], 4128 [ 4129 #ifndef _WIN32 4130 #include <sys/socket.h> 4131 #endif 4132 ]) 4133 4134 # check for suseconds_t 4135 AC_CHECK_TYPE([suseconds_t],[ 4136 AC_DEFINE(HAVE_SUSECONDS_T, 1, 4137 [Define to 1 if suseconds_t is an available type.]) 4138 ], ,[ 4139 #ifdef HAVE_SYS_TYPES_H 4140 #include <sys/types.h> 4141 #endif 4142 #ifndef _WIN32 4143 #include <sys/time.h> 4144 #endif 4145 ]) 4146 4147 case $host_os in 4148 amigaos*|msdos*) 4149 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned]) 4150 ;; 4151 *) 4152 AC_MSG_CHECKING([if time_t is unsigned]) 4153 CURL_RUN_IFELSE( 4154 [ 4155 #include <time.h> 4156 int main(void) { 4157 time_t t = -1; 4158 return t < 0; 4159 } 4160 ],[ 4161 AC_MSG_RESULT([yes]) 4162 AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned]) 4163 ],[ 4164 AC_MSG_RESULT([no]) 4165 ],[ 4166 dnl cross-compiling, most systems are signed 4167 AC_MSG_RESULT([no]) 4168 ]) 4169 ;; 4170 esac 4171 4172 TYPE_SOCKADDR_STORAGE 4173 4174 CURL_CHECK_FUNC_SELECT 4175 4176 CURL_CHECK_FUNC_RECV 4177 CURL_CHECK_FUNC_SEND 4178 CURL_CHECK_MSG_NOSIGNAL 4179 4180 CURL_CHECK_FUNC_ALARM 4181 CURL_CHECK_FUNC_BASENAME 4182 CURL_CHECK_FUNC_CLOSESOCKET 4183 CURL_CHECK_FUNC_CLOSESOCKET_CAMEL 4184 CURL_CHECK_FUNC_FCNTL 4185 CURL_CHECK_FUNC_FREEADDRINFO 4186 CURL_CHECK_FUNC_FSETXATTR 4187 CURL_CHECK_FUNC_FTRUNCATE 4188 CURL_CHECK_FUNC_GETADDRINFO 4189 CURL_CHECK_FUNC_GETHOSTBYNAME_R 4190 CURL_CHECK_FUNC_GETHOSTNAME 4191 CURL_CHECK_FUNC_GETIFADDRS 4192 CURL_CHECK_FUNC_GETPEERNAME 4193 CURL_CHECK_FUNC_GETSOCKNAME 4194 CURL_CHECK_FUNC_GMTIME_R 4195 CURL_CHECK_FUNC_IOCTL 4196 CURL_CHECK_FUNC_IOCTLSOCKET 4197 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL 4198 CURL_CHECK_FUNC_MEMRCHR 4199 CURL_CHECK_FUNC_SIGACTION 4200 CURL_CHECK_FUNC_SIGINTERRUPT 4201 CURL_CHECK_FUNC_SIGNAL 4202 CURL_CHECK_FUNC_SIGSETJMP 4203 CURL_CHECK_FUNC_SOCKET 4204 CURL_CHECK_FUNC_SOCKETPAIR 4205 CURL_CHECK_FUNC_STRDUP 4206 CURL_CHECK_FUNC_STRERROR_R 4207 4208 case $host in 4209 *msdosdjgpp) 4210 ac_cv_func_pipe=no 4211 skipcheck_pipe=yes 4212 AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) 4213 ;; 4214 esac 4215 4216 AC_CHECK_FUNCS([\ 4217 accept4 \ 4218 eventfd \ 4219 fnmatch \ 4220 geteuid \ 4221 getpass_r \ 4222 getppid \ 4223 getpwuid \ 4224 getpwuid_r \ 4225 getrlimit \ 4226 gettimeofday \ 4227 if_nametoindex \ 4228 mach_absolute_time \ 4229 pipe \ 4230 pipe2 \ 4231 poll \ 4232 sendmmsg \ 4233 sendmsg \ 4234 setlocale \ 4235 setrlimit \ 4236 snprintf \ 4237 utime \ 4238 utimes \ 4239 ]) 4240 4241 if test "$curl_cv_native_windows" != 'yes'; then 4242 AC_CHECK_FUNCS([\ 4243 realpath \ 4244 sched_yield \ 4245 ]) 4246 CURL_CHECK_FUNC_INET_NTOP 4247 CURL_CHECK_FUNC_INET_PTON 4248 CURL_CHECK_FUNC_STRCASECMP 4249 CURL_CHECK_FUNC_STRCMPI 4250 CURL_CHECK_FUNC_STRICMP 4251 fi 4252 4253 if test "$curl_cv_wince" = 'no'; then 4254 AC_CHECK_FUNCS([setmode]) 4255 if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then 4256 AC_CHECK_FUNCS([_setmode]) 4257 fi 4258 fi 4259 4260 if test -z "$ssl_backends"; then 4261 AC_CHECK_FUNCS([arc4random]) 4262 fi 4263 4264 if test "$curl_cv_native_windows" != 'yes'; then 4265 AC_CHECK_FUNCS([fseeko]) 4266 4267 dnl On Android, the only way to know if fseeko can be used is to see if it is 4268 dnl declared or not (for this API level), as the symbol always exists in the 4269 dnl lib. 4270 AC_CHECK_DECL([fseeko], 4271 [AC_DEFINE([HAVE_DECL_FSEEKO], [1], 4272 [Define to 1 if you have the fseeko declaration])], 4273 [], 4274 [[#include <stdio.h>]]) 4275 fi 4276 4277 CURL_CHECK_NONBLOCKING_SOCKET 4278 4279 AC_PATH_PROG(PERL, perl,, 4280 $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin) 4281 AC_SUBST(PERL) 4282 4283 if test "x$BUILD_DOCS" != "x0" -o "x$USE_MANUAL" != "x0" -o "x$CURL_CA_EMBED" != "x"; then 4284 if test -z "$PERL"; then 4285 AC_MSG_ERROR([perl was not found, needed for docs, manual and CA embed]) 4286 fi 4287 fi 4288 4289 dnl set variable for use in automakefile(s) 4290 AM_CONDITIONAL(BUILD_DOCS, test x"$BUILD_DOCS" = x1) 4291 4292 dnl ************************************************************************* 4293 dnl If the manual variable still is set, then we go with providing a built-in 4294 dnl manual 4295 4296 if test "$USE_MANUAL" = "1"; then 4297 curl_manual_msg="enabled" 4298 fi 4299 4300 dnl set variable for use in automakefile(s) 4301 AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) 4302 4303 CURL_CHECK_LIB_ARES 4304 CURL_CHECK_OPTION_THREADED_RESOLVER 4305 4306 if test "$ipv6" = yes -a "$curl_cv_apple" = 'yes'; then 4307 CURL_DARWIN_SYSTEMCONFIGURATION 4308 fi 4309 4310 dnl Windows threaded resolver check 4311 if test "$want_threaded_resolver" = "yes" && test "$curl_cv_native_windows" = "yes"; then 4312 USE_THREADS_WIN32=1 4313 AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup]) 4314 curl_res_msg="Win32 threaded" 4315 fi 4316 4317 dnl detect pthreads 4318 if test "$want_threaded_resolver" = "yes" && test "$USE_THREADS_WIN32" != "1"; then 4319 AC_CHECK_HEADER(pthread.h, 4320 [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>]) 4321 save_CFLAGS="$CFLAGS" 4322 dnl When statically linking against BoringSSL, -lpthread is added to LIBS. 4323 dnl Make sure to that this does not pass the check below, we really want 4324 dnl -pthread in CFLAGS as recommended for GCC. This also ensures that 4325 dnl lib1541 and lib1565 tests are built with these options. Otherwise 4326 dnl they fail the build since tests/libtest/Makefile.am clears LIBS. 4327 save_LIBS="$LIBS" 4328 4329 LIBS= 4330 dnl Check for libc variants without a separate pthread lib like bionic 4331 AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] ) 4332 LIBS="$save_LIBS" 4333 4334 dnl on HP-UX, life is more complicated... 4335 case $host in 4336 *-hp-hpux*) 4337 dnl it doesn't actually work without -lpthread 4338 USE_THREADS_POSIX="" 4339 ;; 4340 *) 4341 ;; 4342 esac 4343 4344 dnl if it wasn't found without lib, search for it in pthread lib 4345 if test "$USE_THREADS_POSIX" != "1"; then 4346 # assign PTHREAD for pkg-config use 4347 PTHREAD=" -pthread" 4348 4349 case $host in 4350 *-ibm-aix*) 4351 dnl Check if compiler is xlC 4352 COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` 4353 if test x"$COMPILER_VERSION" = "x"; then 4354 CFLAGS="$CFLAGS -pthread" 4355 else 4356 CFLAGS="$CFLAGS -qthreaded" 4357 fi 4358 ;; 4359 powerpc-*amigaos*) 4360 dnl No -pthread option, but link with -lpthread 4361 PTHREAD=" -lpthread" 4362 ;; 4363 *) 4364 CFLAGS="$CFLAGS -pthread" 4365 ;; 4366 esac 4367 AC_CHECK_LIB(pthread, pthread_create, 4368 [USE_THREADS_POSIX=1], 4369 [ CFLAGS="$save_CFLAGS"]) 4370 fi 4371 4372 if test "x$USE_THREADS_POSIX" = "x1"; then 4373 AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup]) 4374 curl_res_msg="POSIX threaded" 4375 fi 4376 ]) 4377 fi 4378 4379 dnl Did we find a threading option? 4380 if test "$want_threaded_resolver" != "no" -a "x$USE_THREADS_POSIX" != "x1" -a "x$USE_THREADS_WIN32" != "x1"; then 4381 AC_MSG_ERROR([Threaded resolver enabled but no thread library found]) 4382 fi 4383 4384 AC_CHECK_HEADER(dirent.h, 4385 [ AC_DEFINE(HAVE_DIRENT_H, 1, [if you have <dirent.h>]) 4386 AC_CHECK_FUNC(opendir, AC_DEFINE(HAVE_OPENDIR, 1, [if you have opendir]) ) 4387 ] 4388 ) 4389 4390 CURL_CONVERT_INCLUDE_TO_ISYSTEM 4391 4392 dnl ************************************************************ 4393 dnl disable verbose text strings 4394 dnl 4395 AC_MSG_CHECKING([whether to enable verbose strings]) 4396 AC_ARG_ENABLE(verbose, 4397 AS_HELP_STRING([--enable-verbose],[Enable verbose strings]) 4398 AS_HELP_STRING([--disable-verbose],[Disable verbose strings]), 4399 [ case "$enableval" in 4400 no) 4401 AC_MSG_RESULT(no) 4402 AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) 4403 curl_verbose_msg="no" 4404 ;; 4405 *) 4406 AC_MSG_RESULT(yes) 4407 ;; 4408 esac ], 4409 AC_MSG_RESULT(yes) 4410 ) 4411 4412 dnl ************************************************************ 4413 dnl enable SSPI support 4414 dnl 4415 AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)]) 4416 AC_ARG_ENABLE(sspi, 4417 AS_HELP_STRING([--enable-sspi],[Enable SSPI]) 4418 AS_HELP_STRING([--disable-sspi],[Disable SSPI]), 4419 [ case "$enableval" in 4420 yes) 4421 if test "$curl_cv_native_windows" = "yes"; then 4422 AC_MSG_RESULT(yes) 4423 AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) 4424 USE_WINDOWS_SSPI=1 4425 curl_sspi_msg="enabled" 4426 else 4427 AC_MSG_RESULT(no) 4428 AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) 4429 fi 4430 ;; 4431 *) 4432 if test "x$SCHANNEL_ENABLED" = "x1"; then 4433 # --with-schannel implies --enable-sspi 4434 AC_MSG_RESULT(yes) 4435 else 4436 AC_MSG_RESULT(no) 4437 fi 4438 ;; 4439 esac ], 4440 if test "x$SCHANNEL_ENABLED" = "x1"; then 4441 # --with-schannel implies --enable-sspi 4442 AC_MSG_RESULT(yes) 4443 else 4444 AC_MSG_RESULT(no) 4445 fi 4446 ) 4447 4448 if test "x$USE_WINDOWS_SSPI" = "x1"; then 4449 LIBS="-lsecur32 $LIBS" 4450 fi 4451 4452 dnl ************************************************************ 4453 dnl disable basic authentication 4454 dnl 4455 AC_MSG_CHECKING([whether to enable basic authentication method]) 4456 AC_ARG_ENABLE(basic-auth, 4457 AS_HELP_STRING([--enable-basic-auth],[Enable basic authentication (default)]) 4458 AS_HELP_STRING([--disable-basic-auth],[Disable basic authentication]), 4459 [ case "$enableval" in 4460 no) 4461 AC_MSG_RESULT(no) 4462 AC_DEFINE(CURL_DISABLE_BASIC_AUTH, 1, [to disable basic authentication]) 4463 ;; 4464 *) 4465 AC_MSG_RESULT(yes) 4466 ;; 4467 esac ], 4468 AC_MSG_RESULT(yes) 4469 ) 4470 4471 dnl ************************************************************ 4472 dnl disable bearer authentication 4473 dnl 4474 AC_MSG_CHECKING([whether to enable bearer authentication method]) 4475 AC_ARG_ENABLE(bearer-auth, 4476 AS_HELP_STRING([--enable-bearer-auth],[Enable bearer authentication (default)]) 4477 AS_HELP_STRING([--disable-bearer-auth],[Disable bearer authentication]), 4478 [ case "$enableval" in 4479 no) 4480 AC_MSG_RESULT(no) 4481 AC_DEFINE(CURL_DISABLE_BEARER_AUTH, 1, [to disable bearer authentication]) 4482 ;; 4483 *) 4484 AC_MSG_RESULT(yes) 4485 ;; 4486 esac ], 4487 AC_MSG_RESULT(yes) 4488 ) 4489 4490 dnl ************************************************************ 4491 dnl disable digest authentication 4492 dnl 4493 AC_MSG_CHECKING([whether to enable digest authentication method]) 4494 AC_ARG_ENABLE(digest-auth, 4495 AS_HELP_STRING([--enable-digest-auth],[Enable digest authentication (default)]) 4496 AS_HELP_STRING([--disable-digest-auth],[Disable digest authentication]), 4497 [ case "$enableval" in 4498 no) 4499 AC_MSG_RESULT(no) 4500 AC_DEFINE(CURL_DISABLE_DIGEST_AUTH, 1, [to disable digest authentication]) 4501 ;; 4502 *) 4503 AC_MSG_RESULT(yes) 4504 ;; 4505 esac ], 4506 AC_MSG_RESULT(yes) 4507 ) 4508 4509 dnl ************************************************************ 4510 dnl disable kerberos authentication 4511 dnl 4512 AC_MSG_CHECKING([whether to enable kerberos authentication method]) 4513 AC_ARG_ENABLE(kerberos-auth, 4514 AS_HELP_STRING([--enable-kerberos-auth],[Enable kerberos authentication (default)]) 4515 AS_HELP_STRING([--disable-kerberos-auth],[Disable kerberos authentication]), 4516 [ case "$enableval" in 4517 no) 4518 AC_MSG_RESULT(no) 4519 AC_DEFINE(CURL_DISABLE_KERBEROS_AUTH, 1, [to disable kerberos authentication]) 4520 CURL_DISABLE_KERBEROS_AUTH=1 4521 ;; 4522 *) 4523 AC_MSG_RESULT(yes) 4524 ;; 4525 esac ], 4526 AC_MSG_RESULT(yes) 4527 ) 4528 4529 dnl ************************************************************ 4530 dnl disable negotiate authentication 4531 dnl 4532 AC_MSG_CHECKING([whether to enable negotiate authentication method]) 4533 AC_ARG_ENABLE(negotiate-auth, 4534 AS_HELP_STRING([--enable-negotiate-auth],[Enable negotiate authentication (default)]) 4535 AS_HELP_STRING([--disable-negotiate-auth],[Disable negotiate authentication]), 4536 [ case "$enableval" in 4537 no) 4538 AC_MSG_RESULT(no) 4539 AC_DEFINE(CURL_DISABLE_NEGOTIATE_AUTH, 1, [to disable negotiate authentication]) 4540 CURL_DISABLE_NEGOTIATE_AUTH=1 4541 ;; 4542 *) 4543 AC_MSG_RESULT(yes) 4544 ;; 4545 esac ], 4546 AC_MSG_RESULT(yes) 4547 ) 4548 4549 dnl ************************************************************ 4550 dnl disable aws 4551 dnl 4552 AC_MSG_CHECKING([whether to enable aws sig methods]) 4553 AC_ARG_ENABLE(aws, 4554 AS_HELP_STRING([--enable-aws],[Enable AWS sig support (default)]) 4555 AS_HELP_STRING([--disable-aws],[Disable AWS sig support]), 4556 [ case "$enableval" in 4557 no) 4558 AC_MSG_RESULT(no) 4559 AC_DEFINE(CURL_DISABLE_AWS, 1, [to disable AWS sig support]) 4560 ;; 4561 *) 4562 AC_MSG_RESULT(yes) 4563 ;; 4564 esac ], 4565 AC_MSG_RESULT(yes) 4566 ) 4567 4568 dnl ************************************************************ 4569 dnl disable NTLM support 4570 dnl 4571 AC_MSG_CHECKING([whether to support NTLM]) 4572 AC_ARG_ENABLE(ntlm, 4573 AS_HELP_STRING([--enable-ntlm],[Enable NTLM support]) 4574 AS_HELP_STRING([--disable-ntlm],[Disable NTLM support]), 4575 [ case "$enableval" in 4576 no) 4577 AC_MSG_RESULT(no) 4578 AC_DEFINE(CURL_DISABLE_NTLM, 1, [to disable NTLM support]) 4579 CURL_DISABLE_NTLM=1 4580 ;; 4581 *) 4582 AC_MSG_RESULT(yes) 4583 ;; 4584 esac ], 4585 AC_MSG_RESULT(yes) 4586 ) 4587 4588 dnl ************************************************************ 4589 dnl disable TLS-SRP authentication 4590 dnl 4591 AC_MSG_CHECKING([whether to enable TLS-SRP authentication]) 4592 AC_ARG_ENABLE(tls-srp, 4593 AS_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication]) 4594 AS_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), 4595 [ case "$enableval" in 4596 no) 4597 AC_MSG_RESULT(no) 4598 want_tls_srp=no 4599 ;; 4600 *) 4601 AC_MSG_RESULT(yes) 4602 want_tls_srp=yes 4603 ;; 4604 esac ], 4605 AC_MSG_RESULT(yes) 4606 want_tls_srp=yes 4607 ) 4608 4609 if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1"); then 4610 AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) 4611 USE_TLS_SRP=1 4612 curl_tls_srp_msg="enabled" 4613 fi 4614 4615 dnl ************************************************************ 4616 dnl disable Unix domain sockets support 4617 dnl 4618 AC_MSG_CHECKING([whether to enable Unix domain sockets]) 4619 AC_ARG_ENABLE(unix-sockets, 4620 AS_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets]) 4621 AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), 4622 [ case "$enableval" in 4623 no) 4624 AC_MSG_RESULT(no) 4625 want_unix_sockets=no 4626 ;; 4627 *) 4628 AC_MSG_RESULT(yes) 4629 want_unix_sockets=yes 4630 ;; 4631 esac ], [ 4632 AC_MSG_RESULT(auto) 4633 want_unix_sockets=auto 4634 ] 4635 ) 4636 if test "x$want_unix_sockets" != "xno" -a "$curl_cv_wince" = 'no'; then 4637 if test "x$curl_cv_native_windows" = "xyes"; then 4638 USE_UNIX_SOCKETS=1 4639 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) 4640 curl_unix_sockets_msg="enabled" 4641 else 4642 AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [ 4643 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) 4644 USE_UNIX_SOCKETS=1 4645 curl_unix_sockets_msg="enabled" 4646 ], [ 4647 if test "x$want_unix_sockets" = "xyes"; then 4648 AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!]) 4649 fi 4650 ], [ 4651 #include <sys/un.h> 4652 ]) 4653 fi 4654 fi 4655 4656 dnl ************************************************************ 4657 dnl disable cookies support 4658 dnl 4659 AC_MSG_CHECKING([whether to support cookies]) 4660 AC_ARG_ENABLE(cookies, 4661 AS_HELP_STRING([--enable-cookies],[Enable cookies support]) 4662 AS_HELP_STRING([--disable-cookies],[Disable cookies support]), 4663 [ case "$enableval" in 4664 no) 4665 AC_MSG_RESULT(no) 4666 AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) 4667 ;; 4668 *) 4669 AC_MSG_RESULT(yes) 4670 ;; 4671 esac ], 4672 AC_MSG_RESULT(yes) 4673 ) 4674 4675 dnl ************************************************************ 4676 dnl disable socketpair 4677 dnl 4678 AC_MSG_CHECKING([whether to support socketpair]) 4679 AC_ARG_ENABLE(socketpair, 4680 AS_HELP_STRING([--enable-socketpair],[Enable socketpair support]) 4681 AS_HELP_STRING([--disable-socketpair],[Disable socketpair support]), 4682 [ case "$enableval" in 4683 no) 4684 AC_MSG_RESULT(no) 4685 AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support]) 4686 ;; 4687 *) 4688 AC_MSG_RESULT(yes) 4689 ;; 4690 esac ], 4691 AC_MSG_RESULT(yes) 4692 ) 4693 4694 dnl ************************************************************ 4695 dnl disable HTTP authentication support 4696 dnl 4697 AC_MSG_CHECKING([whether to support HTTP authentication]) 4698 AC_ARG_ENABLE(http-auth, 4699 AS_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support]) 4700 AS_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]), 4701 [ case "$enableval" in 4702 no) 4703 AC_MSG_RESULT(no) 4704 AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication]) 4705 ;; 4706 *) 4707 AC_MSG_RESULT(yes) 4708 ;; 4709 esac ], 4710 AC_MSG_RESULT(yes) 4711 ) 4712 4713 dnl ************************************************************ 4714 dnl disable DoH support 4715 dnl 4716 AC_MSG_CHECKING([whether to support DoH]) 4717 AC_ARG_ENABLE(doh, 4718 AS_HELP_STRING([--enable-doh],[Enable DoH support]) 4719 AS_HELP_STRING([--disable-doh],[Disable DoH support]), 4720 [ case "$enableval" in 4721 no) 4722 AC_MSG_RESULT(no) 4723 AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH]) 4724 ;; 4725 *) 4726 AC_MSG_RESULT(yes) 4727 ;; 4728 esac ], 4729 AC_MSG_RESULT(yes) 4730 ) 4731 4732 dnl ************************************************************ 4733 dnl disable mime API support 4734 dnl 4735 AC_MSG_CHECKING([whether to support the MIME API]) 4736 AC_ARG_ENABLE(mime, 4737 AS_HELP_STRING([--enable-mime],[Enable mime API support]) 4738 AS_HELP_STRING([--disable-mime],[Disable mime API support]), 4739 [ case "$enableval" in 4740 no) 4741 AC_MSG_RESULT(no) 4742 AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API]) 4743 ;; 4744 *) 4745 AC_MSG_RESULT(yes) 4746 ;; 4747 esac ], 4748 AC_MSG_RESULT(yes) 4749 ) 4750 4751 dnl ************************************************************ 4752 dnl disable bindlocal 4753 dnl 4754 AC_MSG_CHECKING([whether to support binding connections locally]) 4755 AC_ARG_ENABLE(bindlocal, 4756 AS_HELP_STRING([--enable-bindlocal],[Enable local binding support]) 4757 AS_HELP_STRING([--disable-bindlocal],[Disable local binding support]), 4758 [ case "$enableval" in 4759 no) 4760 AC_MSG_RESULT(no) 4761 AC_DEFINE(CURL_DISABLE_BINDLOCAL, 1, [disable local binding support]) 4762 ;; 4763 *) 4764 AC_MSG_RESULT(yes) 4765 ;; 4766 esac ], 4767 AC_MSG_RESULT(yes) 4768 ) 4769 4770 dnl ************************************************************ 4771 dnl disable form API support 4772 dnl 4773 AC_MSG_CHECKING([whether to support the form API]) 4774 AC_ARG_ENABLE(form-api, 4775 AS_HELP_STRING([--enable-form-api],[Enable form API support]) 4776 AS_HELP_STRING([--disable-form-api],[Disable form API support]), 4777 [ case "$enableval" in 4778 no) 4779 AC_MSG_RESULT(no) 4780 AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API]) 4781 ;; 4782 *) 4783 AC_MSG_RESULT(yes) 4784 test "$enable_mime" = no && 4785 AC_MSG_ERROR(MIME support needs to be enabled in order to enable form API support) 4786 ;; 4787 esac ], 4788 [ 4789 if test "$enable_mime" = no; then 4790 enable_form_api=no 4791 AC_MSG_RESULT(no) 4792 AC_DEFINE(CURL_DISABLE_FORM_API, 1, [disable form API]) 4793 else 4794 AC_MSG_RESULT(yes) 4795 fi ] 4796 ) 4797 4798 dnl ************************************************************ 4799 dnl disable date parsing 4800 dnl 4801 AC_MSG_CHECKING([whether to support date parsing]) 4802 AC_ARG_ENABLE(dateparse, 4803 AS_HELP_STRING([--enable-dateparse],[Enable date parsing]) 4804 AS_HELP_STRING([--disable-dateparse],[Disable date parsing]), 4805 [ case "$enableval" in 4806 no) 4807 AC_MSG_RESULT(no) 4808 AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing]) 4809 ;; 4810 *) 4811 AC_MSG_RESULT(yes) 4812 ;; 4813 esac ], 4814 AC_MSG_RESULT(yes) 4815 ) 4816 4817 dnl ************************************************************ 4818 dnl disable netrc 4819 dnl 4820 AC_MSG_CHECKING([whether to support netrc parsing]) 4821 AC_ARG_ENABLE(netrc, 4822 AS_HELP_STRING([--enable-netrc],[Enable netrc parsing]) 4823 AS_HELP_STRING([--disable-netrc],[Disable netrc parsing]), 4824 [ case "$enableval" in 4825 no) 4826 AC_MSG_RESULT(no) 4827 AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing]) 4828 ;; 4829 *) 4830 AC_MSG_RESULT(yes) 4831 ;; 4832 esac ], 4833 AC_MSG_RESULT(yes) 4834 ) 4835 4836 dnl ************************************************************ 4837 dnl disable progress-meter 4838 dnl 4839 AC_MSG_CHECKING([whether to support progress-meter]) 4840 AC_ARG_ENABLE(progress-meter, 4841 AS_HELP_STRING([--enable-progress-meter],[Enable progress-meter]) 4842 AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]), 4843 [ case "$enableval" in 4844 no) 4845 AC_MSG_RESULT(no) 4846 AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter]) 4847 ;; 4848 *) 4849 AC_MSG_RESULT(yes) 4850 ;; 4851 esac ], 4852 AC_MSG_RESULT(yes) 4853 ) 4854 4855 dnl ************************************************************ 4856 dnl disable SHA-512/256 hash algorithm 4857 dnl 4858 AC_MSG_CHECKING([whether to support the SHA-512/256 hash algorithm]) 4859 AC_ARG_ENABLE(sha512-256, 4860 AS_HELP_STRING([--enable-sha512-256],[Enable SHA-512/256 hash algorithm (default)]) 4861 AS_HELP_STRING([--disable-sha512-256],[Disable SHA-512/256 hash algorithm]), 4862 [ case "$enableval" in 4863 no) 4864 AC_MSG_RESULT(no) 4865 AC_DEFINE(CURL_DISABLE_SHA512_256, 1, [disable SHA-512/256 hash algorithm]) 4866 ;; 4867 *) 4868 AC_MSG_RESULT(yes) 4869 ;; 4870 esac ], 4871 AC_MSG_RESULT(yes) 4872 ) 4873 4874 dnl ************************************************************ 4875 dnl disable shuffle DNS support 4876 dnl 4877 AC_MSG_CHECKING([whether to support DNS shuffling]) 4878 AC_ARG_ENABLE(dnsshuffle, 4879 AS_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling]) 4880 AS_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]), 4881 [ case "$enableval" in 4882 no) 4883 AC_MSG_RESULT(no) 4884 AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling]) 4885 ;; 4886 *) 4887 AC_MSG_RESULT(yes) 4888 ;; 4889 esac ], 4890 AC_MSG_RESULT(yes) 4891 ) 4892 4893 dnl ************************************************************ 4894 dnl disable the curl_easy_options API 4895 dnl 4896 AC_MSG_CHECKING([whether to support curl_easy_option*]) 4897 AC_ARG_ENABLE(get-easy-options, 4898 AS_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options]) 4899 AS_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]), 4900 [ case "$enableval" in 4901 no) 4902 AC_MSG_RESULT(no) 4903 AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options]) 4904 ;; 4905 *) 4906 AC_MSG_RESULT(yes) 4907 ;; 4908 esac ], 4909 AC_MSG_RESULT(yes) 4910 ) 4911 4912 dnl ************************************************************ 4913 dnl switch on/off alt-svc 4914 dnl 4915 AC_MSG_CHECKING([whether to support alt-svc]) 4916 AC_ARG_ENABLE(alt-svc, 4917 AS_HELP_STRING([--enable-alt-svc],[Enable alt-svc support]) 4918 AS_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]), 4919 [ case "$enableval" in 4920 no) 4921 AC_MSG_RESULT(no) 4922 AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc]) 4923 curl_altsvc_msg="no"; 4924 enable_altsvc="no" 4925 ;; 4926 *) 4927 AC_MSG_RESULT(yes) 4928 ;; 4929 esac ], 4930 AC_MSG_RESULT(yes) 4931 ) 4932 4933 dnl ************************************************************ 4934 dnl switch on/off headers-api 4935 dnl 4936 AC_MSG_CHECKING([whether to support headers-api]) 4937 AC_ARG_ENABLE(headers-api, 4938 AS_HELP_STRING([--enable-headers-api],[Enable headers-api support]) 4939 AS_HELP_STRING([--disable-headers-api],[Disable headers-api support]), 4940 [ case "$enableval" in 4941 no) 4942 AC_MSG_RESULT(no) 4943 curl_headers_msg="no (--enable-headers-api)" 4944 AC_DEFINE(CURL_DISABLE_HEADERS_API, 1, [disable headers-api]) 4945 ;; 4946 *) 4947 AC_MSG_RESULT(yes) 4948 ;; 4949 esac ], 4950 AC_MSG_RESULT(yes) 4951 ) 4952 4953 dnl only check for HSTS if there's SSL present 4954 if test -n "$SSL_ENABLED"; then 4955 dnl ************************************************************ 4956 dnl switch on/off hsts 4957 dnl 4958 AC_MSG_CHECKING([whether to support HSTS]) 4959 AC_ARG_ENABLE(hsts, 4960 AS_HELP_STRING([--enable-hsts],[Enable HSTS support]) 4961 AS_HELP_STRING([--disable-hsts],[Disable HSTS support]), 4962 [ case "$enableval" in 4963 no) 4964 AC_MSG_RESULT(no) 4965 hsts="no" 4966 ;; 4967 *) 4968 AC_MSG_RESULT(yes) 4969 ;; 4970 esac ], 4971 AC_MSG_RESULT($hsts) 4972 ) 4973 else 4974 AC_MSG_NOTICE([disables HSTS due to lack of SSL]) 4975 hsts="no" 4976 fi 4977 4978 if test "x$hsts" != "xyes"; then 4979 curl_hsts_msg="no (--enable-hsts)"; 4980 AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc]) 4981 fi 4982 4983 4984 dnl ************************************************************* 4985 dnl check whether ECH support, if desired, is actually available 4986 dnl 4987 if test "x$want_ech" != "xno"; then 4988 AC_MSG_CHECKING([whether ECH support is available]) 4989 4990 dnl assume NOT and look for sufficient condition 4991 ECH_ENABLED=0 4992 ECH_ENABLED_OPENSSL=0 4993 ECH_ENABLED_WOLFSSL=0 4994 ECH_ENABLED_RUSTLS=0 4995 ECH_SUPPORT='' 4996 4997 dnl check for OpenSSL equivalent 4998 if test "x$OPENSSL_ENABLED" = "x1"; then 4999 AC_CHECK_FUNCS(SSL_set1_ech_config_list, 5000 ECH_SUPPORT="$ECH_SUPPORT OpenSSL" 5001 ECH_ENABLED_OPENSSL=1) 5002 fi 5003 if test "x$WOLFSSL_ENABLED" = "x1"; then 5004 AC_CHECK_FUNCS(wolfSSL_CTX_GenerateEchConfig, 5005 ECH_SUPPORT="$ECH_SUPPORT wolfSSL" 5006 ECH_ENABLED_WOLFSSL=1) 5007 fi 5008 if test "x$RUSTLS_ENABLED" = "x1"; then 5009 ECH_SUPPORT="$ECH_SUPPORT rustls-ffi" 5010 ECH_ENABLED_RUSTLS=1 5011 fi 5012 5013 dnl now deal with whatever we found 5014 if test "x$ECH_ENABLED_OPENSSL" = "x1" -o \ 5015 "x$ECH_ENABLED_WOLFSSL" = "x1" -o \ 5016 "x$ECH_ENABLED_RUSTLS" = "x1"; then 5017 AC_DEFINE(USE_ECH, 1, [if ECH support is available]) 5018 AC_MSG_RESULT(ECH support available via:$ECH_SUPPORT) 5019 experimental="$experimental ECH" 5020 ECH_ENABLED=1 5021 dnl ECH wants HTTPSRR 5022 want_httpsrr="yes" 5023 else 5024 AC_MSG_ERROR([--enable-ech ignored: No ECH support found]) 5025 fi 5026 fi 5027 5028 AC_MSG_CHECKING([whether to enable HTTPS-RR support]) 5029 dnl ************************************************************* 5030 dnl check whether HTTPSRR support if desired 5031 dnl 5032 if test "x$want_httpsrr" != "xno"; then 5033 AC_MSG_RESULT([yes]) 5034 AC_DEFINE(USE_HTTPSRR, 1, [enable HTTPS RR support]) 5035 experimental="$experimental HTTPSRR" 5036 curl_httpsrr_msg="enabled (--disable-httpsrr)" 5037 else 5038 AC_MSG_RESULT([no]) 5039 # no HTTPSRR wanted 5040 if test "$want_threaded_resolver" = "yes"; then 5041 # and using the threaded resolver 5042 if test "x$USE_ARES" = "x1"; then 5043 AC_MSG_ERROR([without HTTPS-RR support, asking for both threaded resolver and c-ares support is ambivalent. Please drop one of them.]) 5044 fi 5045 fi 5046 fi 5047 5048 5049 dnl ************************************************************* 5050 dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio 5051 dnl 5052 if test "x$OPENSSL_ENABLED" = "x1"; then 5053 AC_CHECK_FUNCS([SSL_set0_wbio]) 5054 fi 5055 5056 if test "x$CURL_DISABLE_HTTP" != "x1"; then 5057 dnl ************************************************************* 5058 dnl WebSockets 5059 dnl 5060 AC_MSG_CHECKING([whether to support WebSockets]) 5061 AC_ARG_ENABLE(websockets, 5062 AS_HELP_STRING([--enable-websockets],[Enable WebSockets support]) 5063 AS_HELP_STRING([--disable-websockets],[Disable WebSockets support]), 5064 [ case "$enableval" in 5065 no) 5066 AC_MSG_RESULT(no) 5067 AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) 5068 CURL_DISABLE_WEBSOCKETS=1 5069 ;; 5070 *) 5071 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then 5072 AC_MSG_RESULT(yes) 5073 else 5074 dnl WebSockets requires >32 bit curl_off_t 5075 AC_MSG_RESULT(no) 5076 AC_MSG_WARN([WebSockets disabled due to lack of >32 bit curl_off_t]) 5077 AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) 5078 CURL_DISABLE_WEBSOCKETS=1 5079 fi 5080 ;; 5081 esac ], 5082 AC_MSG_RESULT(yes) 5083 ) 5084 else 5085 AC_MSG_WARN([WebSockets disabled because HTTP is disabled]) 5086 AC_DEFINE(CURL_DISABLE_WEBSOCKETS, [1], [disable WebSockets]) 5087 CURL_DISABLE_WEBSOCKETS=1 5088 fi 5089 5090 dnl ************************************************************* 5091 dnl check whether experimental SSL Session Im-/Export is enabled 5092 dnl 5093 if test "x$want_ssls_export" != "xno"; then 5094 AC_MSG_CHECKING([whether SSL session export support is available]) 5095 5096 dnl assume NOT and look for sufficient condition 5097 SSLS_EXPORT_ENABLED=0 5098 SSLS_EXPORT_SUPPORT='' 5099 5100 if test "x$SSL_ENABLED" != "x1"; then 5101 AC_MSG_ERROR([--enable-ssls-export ignored: No SSL support]) 5102 else 5103 SSLS_EXPORT_ENABLED=1 5104 AC_DEFINE(USE_SSLS_EXPORT, 1, [if SSL session export support is available]) 5105 AC_MSG_RESULT("SSL session im-/export enabled") 5106 experimental="$experimental SSLS-EXPORT" 5107 fi 5108 fi 5109 5110 dnl ************************************************************ 5111 dnl hiding of library internal symbols 5112 dnl 5113 CURL_CONFIGURE_SYMBOL_HIDING 5114 5115 dnl 5116 dnl All the library dependencies put into $LIB apply to libcurl only. 5117 dnl 5118 LIBCURL_PC_LDFLAGS_PRIVATE='' 5119 dnl Do not quote $INITIAL_LDFLAGS 5120 set -- $INITIAL_LDFLAGS 5121 while test -n "$1"; do 5122 case "$1" in 5123 -L* | --library-path=* | -F*) 5124 LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1" 5125 ;; 5126 -framework) 5127 if test -n "$2"; then 5128 LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $1 $2" 5129 shift 5130 fi 5131 ;; 5132 esac 5133 shift 5134 done 5135 LIBCURL_PC_LDFLAGS_PRIVATE="$LIBCURL_PC_LDFLAGS_PRIVATE $LDFLAGSPC" 5136 LIBCURL_PC_LIBS_PRIVATE="$LIBS$PTHREAD" 5137 5138 AC_SUBST(LIBCURL_PC_LDFLAGS_PRIVATE) 5139 AC_SUBST(LIBCURL_PC_LIBS_PRIVATE) 5140 AC_SUBST(CURL_NETWORK_AND_TIME_LIBS) 5141 5142 dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank 5143 dnl LIBS variable used in generated makefile at makefile processing 5144 dnl time. Doing this functionally prevents LIBS from being used for 5145 dnl all link targets in given makefile. 5146 BLANK_AT_MAKETIME= 5147 AC_SUBST(BLANK_AT_MAKETIME) 5148 5149 AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes) 5150 5151 dnl yes or no 5152 ENABLE_SHARED="$enable_shared" 5153 AC_SUBST(ENABLE_SHARED) 5154 5155 dnl to let curl-config output the static libraries correctly 5156 ENABLE_STATIC="$enable_static" 5157 AC_SUBST(ENABLE_STATIC) 5158 5159 squeeze LIBCURL_PC_REQUIRES_PRIVATE 5160 LIBCURL_PC_REQUIRES_PRIVATE=`echo $LIBCURL_PC_REQUIRES_PRIVATE | tr ' ' ','` 5161 5162 AC_SUBST(LIBCURL_PC_REQUIRES_PRIVATE) 5163 5164 dnl Merge pkg-config private fields into public ones when static-only 5165 if test "x$enable_shared" = "xno"; then 5166 LIBCURL_PC_REQUIRES=$LIBCURL_PC_REQUIRES_PRIVATE 5167 LIBCURL_PC_LIBS=$LIBCURL_PC_LIBS_PRIVATE 5168 else 5169 LIBCURL_PC_REQUIRES= 5170 LIBCURL_PC_LIBS= 5171 fi 5172 AC_SUBST(LIBCURL_PC_REQUIRES) 5173 AC_SUBST(LIBCURL_PC_LIBS) 5174 5175 rm $compilersh 5176 5177 dnl 5178 dnl For keeping supported features and protocols also in pkg-config file 5179 dnl since it is more cross-compile friendly than curl-config 5180 dnl 5181 5182 if test "x$OPENSSL_ENABLED" = "x1"; then 5183 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" 5184 elif test -n "$SSL_ENABLED"; then 5185 SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" 5186 fi 5187 if test "x$IPV6_ENABLED" = "x1"; then 5188 SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6" 5189 fi 5190 if test "x$USE_UNIX_SOCKETS" = "x1"; then 5191 SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets" 5192 fi 5193 if test "x$HAVE_LIBZ" = "x1"; then 5194 SUPPORT_FEATURES="$SUPPORT_FEATURES libz" 5195 fi 5196 if test "x$HAVE_BROTLI" = "x1"; then 5197 SUPPORT_FEATURES="$SUPPORT_FEATURES brotli" 5198 fi 5199 if test "x$HAVE_ZSTD" = "x1"; then 5200 SUPPORT_FEATURES="$SUPPORT_FEATURES zstd" 5201 fi 5202 if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \ 5203 -o "x$USE_THREADS_WIN32" = "x1"; then 5204 SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" 5205 fi 5206 if test "x$USE_ARES" = "x1" -a "$want_threaded_resolver" = "yes" -a "x$want_httpsrr" != "xno"; then 5207 SUPPORT_FEATURES="$SUPPORT_FEATURES asyn-rr" 5208 fi 5209 if test "x$IDN_ENABLED" = "x1"; then 5210 SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" 5211 fi 5212 if test "x$USE_WINDOWS_SSPI" = "x1"; then 5213 SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI" 5214 fi 5215 5216 if test "x$HAVE_GSSAPI" = "x1"; then 5217 SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API" 5218 fi 5219 5220 if test "x$curl_psl_msg" = "xenabled"; then 5221 SUPPORT_FEATURES="$SUPPORT_FEATURES PSL" 5222 fi 5223 5224 if test "x$curl_gsasl_msg" = "xenabled"; then 5225 SUPPORT_FEATURES="$SUPPORT_FEATURES gsasl" 5226 fi 5227 5228 if test "x$enable_altsvc" = "xyes"; then 5229 SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc" 5230 fi 5231 if test "x$hsts" = "xyes"; then 5232 SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS" 5233 fi 5234 5235 if test "x$CURL_DISABLE_NEGOTIATE_AUTH" != "x1" -a \ 5236 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then 5237 SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO" 5238 fi 5239 5240 if test "x$CURL_DISABLE_KERBEROS_AUTH" != "x1" -a \ 5241 \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then 5242 SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos" 5243 fi 5244 5245 use_curl_ntlm_core=no 5246 5247 if test "x$CURL_DISABLE_NTLM" != "x1"; then 5248 if test "x$OPENSSL_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ 5249 -o "x$GNUTLS_ENABLED" = "x1" \ 5250 -o "x$USE_WIN32_CRYPTO" = "x1" \ 5251 -o "x$HAVE_WOLFSSL_DES_ECB_ENCRYPT" = "x1"; then 5252 use_curl_ntlm_core=yes 5253 fi 5254 5255 if test "x$use_curl_ntlm_core" = "xyes" \ 5256 -o "x$USE_WINDOWS_SSPI" = "x1"; then 5257 SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" 5258 fi 5259 fi 5260 5261 if test "x$USE_TLS_SRP" = "x1"; then 5262 SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP" 5263 fi 5264 5265 if test "x$USE_NGHTTP2" = "x1"; then 5266 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2" 5267 fi 5268 5269 if test "x$USE_NGTCP2_H3" = "x1" -o "x$USE_QUICHE" = "x1" \ 5270 -o "x$USE_OPENSSL_H3" = "x1" -o "x$USE_MSH3" = "x1"; then 5271 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then 5272 AC_MSG_ERROR([MultiSSL cannot be enabled with HTTP/3 and vice versa]) 5273 fi 5274 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3" 5275 fi 5276 5277 if test "x$CURL_WITH_MULTI_SSL" = "x1"; then 5278 SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL" 5279 fi 5280 5281 AC_MSG_CHECKING([if this build supports HTTPS-proxy]) 5282 dnl if not explicitly turned off, HTTPS-proxy comes with some TLS backends 5283 if test "x$CURL_DISABLE_HTTP" != "x1"; then 5284 if test "x$https_proxy" != "xno"; then 5285 if test "x$OPENSSL_ENABLED" = "x1" \ 5286 -o "x$GNUTLS_ENABLED" = "x1" \ 5287 -o "x$RUSTLS_ENABLED" = "x1" \ 5288 -o "x$SCHANNEL_ENABLED" = "x1" \ 5289 -o "x$GNUTLS_ENABLED" = "x1" \ 5290 -o "x$MBEDTLS_ENABLED" = "x1"; then 5291 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" 5292 AC_MSG_RESULT([yes]) 5293 elif test "x$WOLFSSL_ENABLED" = "x1" -a "x$HAVE_WOLFSSL_BIO_NEW" = "x1"; then 5294 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" 5295 AC_MSG_RESULT([yes]) 5296 else 5297 AC_MSG_RESULT([no]) 5298 fi 5299 else 5300 AC_MSG_RESULT([no]) 5301 fi 5302 else 5303 AC_MSG_RESULT([no]) 5304 fi 5305 5306 if test "x$OPENSSL_ENABLED" = "x1" -o -n "$SSL_ENABLED"; then 5307 if test "x$ECH_ENABLED" = "x1"; then 5308 SUPPORT_FEATURES="$SUPPORT_FEATURES ECH" 5309 fi 5310 fi 5311 5312 if test "x$want_httpsrr" != "xno"; then 5313 SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPSRR" 5314 fi 5315 5316 if test "x$SSLS_EXPORT_ENABLED" = "x1"; then 5317 SUPPORT_FEATURES="$SUPPORT_FEATURES SSLS-EXPORT" 5318 fi 5319 5320 if test ${ac_cv_sizeof_curl_off_t} -gt 4; then 5321 if test ${ac_cv_sizeof_off_t} -gt 4 -o \ 5322 "$curl_win32_file_api" = "win32_large_files"; then 5323 SUPPORT_FEATURES="$SUPPORT_FEATURES Largefile" 5324 fi 5325 fi 5326 5327 if test "$tst_atomic" = "yes"; then 5328 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" 5329 elif test "x$USE_THREADS_POSIX" = "x1" -a \ 5330 "x$ac_cv_header_pthread_h" = "xyes"; then 5331 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" 5332 else 5333 AC_COMPILE_IFELSE([ 5334 AC_LANG_PROGRAM([[ 5335 #include <windows.h> 5336 ]],[[ 5337 #if (WINVER < 0x600) && (_WIN32_WINNT < 0x600) 5338 #error 5339 #endif 5340 ]]) 5341 ],[ 5342 SUPPORT_FEATURES="$SUPPORT_FEATURES threadsafe" 5343 ],[ 5344 ]) 5345 fi 5346 5347 if test "x$want_winuni" = "xyes"; then 5348 SUPPORT_FEATURES="$SUPPORT_FEATURES Unicode" 5349 fi 5350 if test "x$want_debug" = "xyes"; then 5351 SUPPORT_FEATURES="$SUPPORT_FEATURES Debug" 5352 fi 5353 if test "x$want_curldebug" = "xyes"; then 5354 SUPPORT_FEATURES="$SUPPORT_FEATURES TrackMemory" 5355 fi 5356 if test "x$CURL_CA_EMBED" != "x"; then 5357 SUPPORT_FEATURES="$SUPPORT_FEATURES CAcert" 5358 CURL_CA_EMBED_msg="$CURL_CA_EMBED" 5359 else 5360 CURL_CA_EMBED_msg='no' 5361 fi 5362 5363 dnl replace spaces with newlines 5364 dnl sort the lines 5365 dnl replace the newlines back to spaces 5366 if sort -f </dev/null >/dev/null 2>&1; then 5367 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort -f | tr '\012' ' '` 5368 else 5369 SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '` 5370 fi 5371 AC_SUBST(SUPPORT_FEATURES) 5372 5373 dnl For supported protocols in pkg-config file 5374 if test "x$CURL_DISABLE_HTTP" != "x1"; then 5375 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP" 5376 if test "x$SSL_ENABLED" = "x1"; then 5377 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS" 5378 fi 5379 fi 5380 if test "x$CURL_DISABLE_FTP" != "x1"; then 5381 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP" 5382 if test "x$SSL_ENABLED" = "x1"; then 5383 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS" 5384 fi 5385 fi 5386 if test "x$CURL_DISABLE_FILE" != "x1"; then 5387 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE" 5388 fi 5389 if test "x$CURL_DISABLE_TELNET" != "x1"; then 5390 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET" 5391 fi 5392 if test "x$CURL_DISABLE_LDAP" != "x1"; then 5393 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" 5394 if test "x$CURL_DISABLE_LDAPS" != "x1"; then 5395 if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") || 5396 (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then 5397 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" 5398 fi 5399 fi 5400 fi 5401 if test "x$CURL_DISABLE_DICT" != "x1"; then 5402 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT" 5403 fi 5404 if test "x$CURL_DISABLE_TFTP" != "x1"; then 5405 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP" 5406 fi 5407 if test "x$CURL_DISABLE_GOPHER" != "x1"; then 5408 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER" 5409 if test "x$SSL_ENABLED" = "x1"; then 5410 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS" 5411 fi 5412 fi 5413 if test "x$CURL_DISABLE_MQTT" != "x1"; then 5414 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT" 5415 fi 5416 if test "x$CURL_DISABLE_POP3" != "x1"; then 5417 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3" 5418 if test "x$SSL_ENABLED" = "x1"; then 5419 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S" 5420 fi 5421 fi 5422 if test "x$CURL_DISABLE_IMAP" != "x1"; then 5423 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP" 5424 if test "x$SSL_ENABLED" = "x1"; then 5425 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS" 5426 fi 5427 fi 5428 if test "x$CURL_DISABLE_SMB" != "x1" \ 5429 -a "x$use_curl_ntlm_core" = "xyes"; then 5430 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB" 5431 if test "x$SSL_ENABLED" = "x1"; then 5432 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS" 5433 fi 5434 fi 5435 if test "x$CURL_DISABLE_SMTP" != "x1"; then 5436 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP" 5437 if test "x$SSL_ENABLED" = "x1"; then 5438 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS" 5439 fi 5440 fi 5441 if test "x$USE_LIBSSH2" = "x1"; then 5442 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" 5443 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" 5444 fi 5445 if test "x$USE_LIBSSH" = "x1"; then 5446 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" 5447 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" 5448 fi 5449 if test "x$USE_WOLFSSH" = "x1"; then 5450 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" 5451 fi 5452 if test "x$CURL_DISABLE_IPFS" != "x1"; then 5453 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IPFS IPNS" 5454 fi 5455 if test "x$CURL_DISABLE_RTSP" != "x1"; then 5456 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" 5457 fi 5458 if test "x$USE_LIBRTMP" = "x1"; then 5459 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" 5460 fi 5461 if test "x$CURL_DISABLE_WEBSOCKETS" != "x1"; then 5462 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WS" 5463 if test "x$SSL_ENABLED" = "x1"; then 5464 SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS WSS" 5465 fi 5466 fi 5467 5468 dnl replace spaces with newlines 5469 dnl sort the lines 5470 dnl replace the newlines back to spaces 5471 SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '` 5472 5473 AC_SUBST(SUPPORT_PROTOCOLS) 5474 5475 dnl squeeze whitespace out of some variables 5476 5477 squeeze CFLAGS 5478 squeeze CPPFLAGS 5479 squeeze DEFS 5480 squeeze LDFLAGS 5481 squeeze LIBS 5482 5483 squeeze LIBCURL_PC_LDFLAGS_PRIVATE 5484 squeeze LIBCURL_PC_LIBS_PRIVATE 5485 squeeze CURL_NETWORK_AND_TIME_LIBS 5486 5487 squeeze SUPPORT_FEATURES 5488 squeeze SUPPORT_PROTOCOLS 5489 5490 XC_CHECK_BUILD_FLAGS 5491 5492 SSL_BACKENDS=${ssl_backends} 5493 AC_SUBST(SSL_BACKENDS) 5494 5495 if test "x$want_curldebug_assumed" = "xyes" && 5496 test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then 5497 ac_configure_args="$ac_configure_args --enable-curldebug" 5498 fi 5499 5500 CURL_PREPARE_CONFIGUREHELP_PM 5501 5502 AC_CONFIG_FILES([\ 5503 Makefile \ 5504 docs/Makefile \ 5505 docs/examples/Makefile \ 5506 docs/libcurl/Makefile \ 5507 docs/libcurl/opts/Makefile \ 5508 docs/cmdline-opts/Makefile \ 5509 include/Makefile \ 5510 include/curl/Makefile \ 5511 src/Makefile \ 5512 lib/Makefile \ 5513 scripts/Makefile \ 5514 lib/libcurl.vers \ 5515 tests/Makefile \ 5516 tests/config \ 5517 tests/configurehelp.pm \ 5518 tests/certs/Makefile \ 5519 tests/data/Makefile \ 5520 tests/server/Makefile \ 5521 tests/libtest/Makefile \ 5522 tests/unit/Makefile \ 5523 tests/tunit/Makefile \ 5524 tests/client/Makefile \ 5525 tests/http/config.ini \ 5526 tests/http/Makefile \ 5527 packages/Makefile \ 5528 packages/vms/Makefile \ 5529 curl-config \ 5530 libcurl.pc 5531 ]) 5532 AC_OUTPUT 5533 5534 SUPPORT_PROTOCOLS_LOWER=`echo "$SUPPORT_PROTOCOLS" | tr A-Z a-z` 5535 5536 AC_MSG_NOTICE([Configured to build curl/libcurl: 5537 5538 Host setup: ${host} 5539 Install prefix: ${prefix} 5540 Compiler: ${CC} 5541 CFLAGS: ${CFLAGS} 5542 CFLAGS extras: ${CURL_CFLAG_EXTRAS} 5543 CPPFLAGS: ${CPPFLAGS} 5544 LDFLAGS: ${LDFLAGS} 5545 curl-config: ${LIBCURL_PC_LDFLAGS_PRIVATE} 5546 LIBS: ${LIBS} 5547 5548 curl version: ${CURLVERSION} 5549 SSL: ${curl_ssl_msg} 5550 SSH: ${curl_ssh_msg} 5551 zlib: ${curl_zlib_msg} 5552 brotli: ${curl_brotli_msg} 5553 zstd: ${curl_zstd_msg} 5554 GSS-API: ${curl_gss_msg} 5555 GSASL: ${curl_gsasl_msg} 5556 TLS-SRP: ${curl_tls_srp_msg} 5557 resolver: ${curl_res_msg} 5558 IPv6: ${curl_ipv6_msg} 5559 Unix sockets: ${curl_unix_sockets_msg} 5560 IDN: ${curl_idn_msg} 5561 Build docs: ${curl_docs_msg} 5562 Build libcurl: Shared=${enable_shared}, Static=${enable_static} 5563 Built-in manual: ${curl_manual_msg} 5564 --libcurl option: ${curl_libcurl_msg} 5565 Verbose errors: ${curl_verbose_msg} 5566 Code coverage: ${curl_coverage_msg} 5567 SSPI: ${curl_sspi_msg} 5568 ca cert bundle: ${ca}${ca_warning} 5569 ca cert path: ${capath}${capath_warning} 5570 ca cert embed: ${CURL_CA_EMBED_msg} 5571 ca fallback: ${with_ca_fallback} 5572 LDAP: ${curl_ldap_msg} 5573 LDAPS: ${curl_ldaps_msg} 5574 IPFS/IPNS: ${curl_ipfs_msg} 5575 RTSP: ${curl_rtsp_msg} 5576 RTMP: ${curl_rtmp_msg} 5577 PSL: ${curl_psl_msg} 5578 Alt-svc: ${curl_altsvc_msg} 5579 Headers API: ${curl_headers_msg} 5580 HSTS: ${curl_hsts_msg} 5581 HTTP1: ${curl_h1_msg} 5582 HTTP2: ${curl_h2_msg} 5583 HTTP3: ${curl_h3_msg} 5584 ECH: ${curl_ech_msg} 5585 HTTPS RR: ${curl_httpsrr_msg} 5586 SSLS-EXPORT: ${curl_ssls_export_msg} 5587 Protocols: ${SUPPORT_PROTOCOLS_LOWER} 5588 Features: ${SUPPORT_FEATURES} 5589 ]) 5590 5591 if test -n "$experimental"; then 5592 for a in $experimental; do 5593 AC_MSG_WARN([$a is enabled but marked EXPERIMENTAL. Use with caution!]) 5594 done 5595 fi 5596 5597 CURL_PREPARE_BUILDINFO 5598 echo "[@%:@] This is a generated file. Do not edit.${curl_buildinfo}" > ./buildinfo.txt 5599 if test -n "$CURL_BUILDINFO$CURL_CI$CI"; then 5600 AC_MSG_NOTICE([${curl_buildinfo}]) 5601 fi