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