• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
25# File version for 'aclocal' use. Keep it a single number.
26# serial 19
27
28dnl CURL_CHECK_OPTION_THREADED_RESOLVER
29dnl -------------------------------------------------
30dnl Verify if configure has been invoked with option
31dnl --enable-threaded-resolver or --disable-threaded-resolver, and
32dnl set shell variable want_thres as appropriate.
33
34AC_DEFUN([CURL_CHECK_OPTION_THREADED_RESOLVER], [
35  AC_MSG_CHECKING([whether to enable the threaded resolver])
36  OPT_THRES="default"
37  AC_ARG_ENABLE(threaded_resolver,
38AS_HELP_STRING([--enable-threaded-resolver],[Enable threaded resolver])
39AS_HELP_STRING([--disable-threaded-resolver],[Disable threaded resolver]),
40  OPT_THRES=$enableval)
41  case "$OPT_THRES" in
42    no)
43      dnl --disable-threaded-resolver option used
44      want_thres="no"
45      ;;
46    *)
47      dnl configure option not specified
48      want_thres="yes"
49      ;;
50  esac
51  AC_MSG_RESULT([$want_thres])
52])
53
54dnl CURL_CHECK_OPTION_ARES
55dnl -------------------------------------------------
56dnl Verify if configure has been invoked with option
57dnl --enable-ares or --disable-ares, and
58dnl set shell variable want_ares as appropriate.
59
60AC_DEFUN([CURL_CHECK_OPTION_ARES], [
61dnl   AC_BEFORE([$0],[CURL_CHECK_OPTION_THREADS])dnl
62  AC_BEFORE([$0],[CURL_CHECK_LIB_ARES])dnl
63  AC_MSG_CHECKING([whether to enable c-ares for DNS lookups])
64  OPT_ARES="default"
65  AC_ARG_ENABLE(ares,
66AS_HELP_STRING([--enable-ares@<:@=PATH@:>@],[Enable c-ares for DNS lookups])
67AS_HELP_STRING([--disable-ares],[Disable c-ares for DNS lookups]),
68  OPT_ARES=$enableval)
69  case "$OPT_ARES" in
70    no)
71      dnl --disable-ares option used
72      want_ares="no"
73      ;;
74    default)
75      dnl configure option not specified
76      want_ares="no"
77      ;;
78    *)
79      dnl --enable-ares option used
80      want_ares="yes"
81      if test -n "$enableval" && test "$enableval" != "yes"; then
82        want_ares_path="$enableval"
83      fi
84      ;;
85  esac
86  AC_MSG_RESULT([$want_ares])
87])
88
89
90dnl CURL_CHECK_OPTION_CURLDEBUG
91dnl -------------------------------------------------
92dnl Verify if configure has been invoked with option
93dnl --enable-curldebug or --disable-curldebug, and set
94dnl shell variable want_curldebug value as appropriate.
95
96AC_DEFUN([CURL_CHECK_OPTION_CURLDEBUG], [
97  AC_BEFORE([$0],[CURL_CHECK_CURLDEBUG])dnl
98  AC_MSG_CHECKING([whether to enable curl debug memory tracking])
99  OPT_CURLDEBUG_BUILD="default"
100  AC_ARG_ENABLE(curldebug,
101AS_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
102AS_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
103  OPT_CURLDEBUG_BUILD=$enableval)
104  case "$OPT_CURLDEBUG_BUILD" in
105    no)
106      dnl --disable-curldebug option used
107      want_curldebug="no"
108      AC_MSG_RESULT([no])
109      ;;
110    default)
111      dnl configure's curldebug option not specified. Initially we will
112      dnl handle this as a request to use the same setting as option
113      dnl --enable-debug. IOW, initially, for debug-enabled builds
114      dnl this will be handled as a request to enable curldebug if
115      dnl possible, and for debug-disabled builds this will be handled
116      dnl as a request to disable curldebug.
117      if test "$want_debug" = "yes"; then
118        AC_MSG_RESULT([(assumed) yes])
119        AC_DEFINE(CURLDEBUG, 1, [to enable curl debug memory tracking])
120      else
121        AC_MSG_RESULT([no])
122      fi
123      want_curldebug_assumed="yes"
124      want_curldebug="$want_debug"
125      ;;
126    *)
127      dnl --enable-curldebug option used.
128      dnl The use of this option value is a request to enable curl's
129      dnl debug memory tracking for the libcurl library. This can only
130      dnl be done when some requisites are simultaneously satisfied.
131      dnl Later on, these requisites are verified and if they are not
132      dnl fully satisfied the option will be ignored and act as if
133      dnl --disable-curldebug had been given setting shell variable
134      dnl want_curldebug to 'no'.
135      want_curldebug="yes"
136      AC_DEFINE(CURLDEBUG, 1, [to enable curl debug memory tracking])
137      AC_MSG_RESULT([yes])
138      ;;
139  esac
140])
141
142
143dnl CURL_CHECK_OPTION_DEBUG
144dnl -------------------------------------------------
145dnl Verify if configure has been invoked with option
146dnl --enable-debug or --disable-debug, and set shell
147dnl variable want_debug value as appropriate.
148
149AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
150  AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl
151  AC_BEFORE([$0],[CURL_CHECK_OPTION_CURLDEBUG])dnl
152  AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
153  AC_MSG_CHECKING([whether to enable debug build options])
154  OPT_DEBUG_BUILD="default"
155  AC_ARG_ENABLE(debug,
156AS_HELP_STRING([--enable-debug],[Enable debug build options])
157AS_HELP_STRING([--disable-debug],[Disable debug build options]),
158  OPT_DEBUG_BUILD=$enableval)
159  case "$OPT_DEBUG_BUILD" in
160    no)
161      dnl --disable-debug option used
162      want_debug="no"
163      ;;
164    default)
165      dnl configure option not specified
166      want_debug="no"
167      ;;
168    *)
169      dnl --enable-debug option used
170      want_debug="yes"
171      AC_DEFINE(DEBUGBUILD, 1, [enable debug build options])
172      ;;
173  esac
174  AC_MSG_RESULT([$want_debug])
175])
176
177dnl CURL_CHECK_OPTION_OPTIMIZE
178dnl -------------------------------------------------
179dnl Verify if configure has been invoked with option
180dnl --enable-optimize or --disable-optimize, and set
181dnl shell variable want_optimize value as appropriate.
182
183AC_DEFUN([CURL_CHECK_OPTION_OPTIMIZE], [
184  AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
185  AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
186  AC_MSG_CHECKING([whether to enable compiler optimizer])
187  OPT_COMPILER_OPTIMIZE="default"
188  AC_ARG_ENABLE(optimize,
189AS_HELP_STRING([--enable-optimize],[Enable compiler optimizations])
190AS_HELP_STRING([--disable-optimize],[Disable compiler optimizations]),
191  OPT_COMPILER_OPTIMIZE=$enableval)
192  case "$OPT_COMPILER_OPTIMIZE" in
193    no)
194      dnl --disable-optimize option used. We will handle this as
195      dnl a request to disable compiler optimizations if possible.
196      dnl If the compiler is known CFLAGS and CPPFLAGS will be
197      dnl overridden, otherwise this can not be honored.
198      want_optimize="no"
199      AC_MSG_RESULT([no])
200      ;;
201    default)
202      dnl configure's optimize option not specified. Initially we will
203      dnl handle this as a request contrary to configure's setting
204      dnl for --enable-debug. IOW, initially, for debug-enabled builds
205      dnl this will be handled as a request to disable optimizations if
206      dnl possible, and for debug-disabled builds this will be handled
207      dnl initially as a request to enable optimizations if possible.
208      dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do
209      dnl not have any optimizer flag the request will be honored, in
210      dnl any other case the request can not be honored.
211      dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS
212      dnl will always take precedence over any initial assumption.
213      if test "$want_debug" = "yes"; then
214        want_optimize="assume_no"
215        AC_MSG_RESULT([(assumed) no])
216      else
217        want_optimize="assume_yes"
218        AC_MSG_RESULT([(assumed) yes])
219      fi
220      ;;
221    *)
222      dnl --enable-optimize option used. We will handle this as
223      dnl a request to enable compiler optimizations if possible.
224      dnl If the compiler is known CFLAGS and CPPFLAGS will be
225      dnl overridden, otherwise this can not be honored.
226      want_optimize="yes"
227      AC_MSG_RESULT([yes])
228      ;;
229  esac
230])
231
232
233dnl CURL_CHECK_OPTION_SYMBOL_HIDING
234dnl -------------------------------------------------
235dnl Verify if configure has been invoked with option
236dnl --enable-symbol-hiding or --disable-symbol-hiding,
237dnl setting shell variable want_symbol_hiding value.
238
239AC_DEFUN([CURL_CHECK_OPTION_SYMBOL_HIDING], [
240  AC_BEFORE([$0],[CURL_CHECK_COMPILER_SYMBOL_HIDING])dnl
241  AC_MSG_CHECKING([whether to enable hiding of library internal symbols])
242  OPT_SYMBOL_HIDING="default"
243  AC_ARG_ENABLE(symbol-hiding,
244AS_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols])
245AS_HELP_STRING([--disable-symbol-hiding],[Disable hiding of library internal symbols]),
246  OPT_SYMBOL_HIDING=$enableval)
247  case "$OPT_SYMBOL_HIDING" in
248    no)
249      dnl --disable-symbol-hiding option used.
250      dnl This is an indication to not attempt hiding of library internal
251      dnl symbols. Default symbol visibility will be used, which normally
252      dnl exposes all library internal symbols.
253      want_symbol_hiding="no"
254      AC_MSG_RESULT([no])
255      ;;
256    default)
257      dnl configure's symbol-hiding option not specified.
258      dnl Handle this as if --enable-symbol-hiding option was given.
259      want_symbol_hiding="yes"
260      AC_MSG_RESULT([yes])
261      ;;
262    *)
263      dnl --enable-symbol-hiding option used.
264      dnl This is an indication to attempt hiding of library internal
265      dnl symbols. This is only supported on some compilers/linkers.
266      want_symbol_hiding="yes"
267      AC_MSG_RESULT([yes])
268      ;;
269  esac
270])
271
272
273dnl CURL_CHECK_OPTION_THREADS
274dnl -------------------------------------------------
275dnl Verify if configure has been invoked with option
276dnl --enable-threads or --disable-threads, and
277dnl set shell variable want_threads as appropriate.
278
279dnl AC_DEFUN([CURL_CHECK_OPTION_THREADS], [
280dnl   AC_BEFORE([$0],[CURL_CHECK_LIB_THREADS])dnl
281dnl   AC_MSG_CHECKING([whether to enable threads for DNS lookups])
282dnl   OPT_THREADS="default"
283dnl   AC_ARG_ENABLE(threads,
284dnl AS_HELP_STRING([--enable-threads@<:@=PATH@:>@],[Enable threads for DNS lookups])
285dnl AS_HELP_STRING([--disable-threads],[Disable threads for DNS lookups]),
286dnl   OPT_THREADS=$enableval)
287dnl   case "$OPT_THREADS" in
288dnl     no)
289dnl       dnl --disable-threads option used
290dnl       want_threads="no"
291dnl       AC_MSG_RESULT([no])
292dnl       ;;
293dnl     default)
294dnl       dnl configure option not specified
295dnl       want_threads="no"
296dnl       AC_MSG_RESULT([(assumed) no])
297dnl       ;;
298dnl     *)
299dnl       dnl --enable-threads option used
300dnl       want_threads="yes"
301dnl       want_threads_path="$enableval"
302dnl       AC_MSG_RESULT([yes])
303dnl       ;;
304dnl   esac
305dnl   #
306dnl   if test "$want_ares" = "assume_yes"; then
307dnl     if test "$want_threads" = "yes"; then
308dnl       AC_MSG_CHECKING([whether to ignore c-ares enabling assumed setting])
309dnl       AC_MSG_RESULT([yes])
310dnl       want_ares="no"
311dnl     else
312dnl       want_ares="yes"
313dnl     fi
314dnl   fi
315dnl   if test "$want_threads" = "yes" && test "$want_ares" = "yes"; then
316dnl     AC_MSG_ERROR([options --enable-ares and --enable-threads are mutually exclusive, at most one may be enabled.])
317dnl   fi
318dnl ])
319
320dnl CURL_CHECK_OPTION_RT
321dnl -------------------------------------------------
322dnl Verify if configure has been invoked with option
323dnl --disable-rt and set shell variable dontwant_rt
324dnl as appropriate.
325
326AC_DEFUN([CURL_CHECK_OPTION_RT], [
327  AC_BEFORE([$0], [CURL_CHECK_LIB_THREADS])dnl
328  AC_MSG_CHECKING([whether to disable dependency on -lrt])
329  OPT_RT="default"
330  AC_ARG_ENABLE(rt,
331 AS_HELP_STRING([--disable-rt],[disable dependency on -lrt]),
332  OPT_RT=$enableval)
333  case "$OPT_RT" in
334    no)
335      dnl --disable-rt used (reverse logic)
336      dontwant_rt="yes"
337      AC_MSG_RESULT([yes])
338      ;;
339    default)
340      dnl configure option not specified (so not disabled)
341      dontwant_rt="no"
342      AC_MSG_RESULT([(assumed no)])
343      ;;
344    *)
345      dnl --enable-rt option used (reverse logic)
346      dontwant_rt="no"
347      AC_MSG_RESULT([no])
348      ;;
349  esac
350])
351
352dnl CURL_CHECK_OPTION_WARNINGS
353dnl -------------------------------------------------
354dnl Verify if configure has been invoked with option
355dnl --enable-warnings or --disable-warnings, and set
356dnl shell variable want_warnings as appropriate.
357
358AC_DEFUN([CURL_CHECK_OPTION_WARNINGS], [
359  AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
360  AC_BEFORE([$0],[CURL_CHECK_OPTION_WERROR])dnl
361  AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
362  AC_MSG_CHECKING([whether to enable strict compiler warnings])
363  OPT_COMPILER_WARNINGS="default"
364  AC_ARG_ENABLE(warnings,
365AS_HELP_STRING([--enable-warnings],[Enable strict compiler warnings])
366AS_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
367  OPT_COMPILER_WARNINGS=$enableval)
368  case "$OPT_COMPILER_WARNINGS" in
369    no)
370      dnl --disable-warnings option used
371      want_warnings="no"
372      ;;
373    default)
374      dnl configure option not specified, so
375      dnl use same setting as --enable-debug
376      want_warnings="$want_debug"
377      ;;
378    *)
379      dnl --enable-warnings option used
380      want_warnings="yes"
381      ;;
382  esac
383  AC_MSG_RESULT([$want_warnings])
384])
385
386dnl CURL_CHECK_OPTION_WERROR
387dnl -------------------------------------------------
388dnl Verify if configure has been invoked with option
389dnl --enable-werror or --disable-werror, and set
390dnl shell variable want_werror as appropriate.
391
392AC_DEFUN([CURL_CHECK_OPTION_WERROR], [
393  AC_BEFORE([$0],[CURL_CHECK_COMPILER])dnl
394  AC_MSG_CHECKING([whether to enable compiler warnings as errors])
395  OPT_COMPILER_WERROR="default"
396  AC_ARG_ENABLE(werror,
397AS_HELP_STRING([--enable-werror],[Enable compiler warnings as errors])
398AS_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]),
399  OPT_COMPILER_WERROR=$enableval)
400  case "$OPT_COMPILER_WERROR" in
401    no)
402      dnl --disable-werror option used
403      want_werror="no"
404      ;;
405    default)
406      dnl configure option not specified
407      want_werror="no"
408      ;;
409    *)
410      dnl --enable-werror option used
411      want_werror="yes"
412      ;;
413  esac
414  AC_MSG_RESULT([$want_werror])
415])
416
417
418dnl CURL_CHECK_NONBLOCKING_SOCKET
419dnl -------------------------------------------------
420dnl Check for how to set a socket into non-blocking state.
421
422AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [
423  AC_REQUIRE([CURL_CHECK_FUNC_FCNTL])dnl
424  AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET])dnl
425  AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL])dnl
426  #
427  tst_method="unknown"
428
429  AC_MSG_CHECKING([how to set a socket into non-blocking mode])
430  if test "x$curl_cv_func_fcntl_o_nonblock" = "xyes"; then
431    tst_method="fcntl O_NONBLOCK"
432  elif test "x$curl_cv_func_ioctl_fionbio" = "xyes"; then
433    tst_method="ioctl FIONBIO"
434  elif test "x$curl_cv_func_ioctlsocket_fionbio" = "xyes"; then
435    tst_method="ioctlsocket FIONBIO"
436  elif test "x$curl_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then
437    tst_method="IoctlSocket FIONBIO"
438  elif test "x$curl_cv_func_setsockopt_so_nonblock" = "xyes"; then
439    tst_method="setsockopt SO_NONBLOCK"
440  fi
441  AC_MSG_RESULT([$tst_method])
442  if test "$tst_method" = "unknown"; then
443    AC_MSG_WARN([cannot determine non-blocking socket method.])
444  fi
445])
446
447
448dnl CURL_CONFIGURE_SYMBOL_HIDING
449dnl -------------------------------------------------
450dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding
451dnl configure option, and compiler capability to actually honor such
452dnl option, this will modify compiler flags as appropriate and also
453dnl provide needed definitions for configuration and Makefile.am files.
454dnl This macro should not be used until all compilation tests have
455dnl been done to prevent interferences on other tests.
456
457AC_DEFUN([CURL_CONFIGURE_SYMBOL_HIDING], [
458  AC_MSG_CHECKING([whether hiding of library internal symbols will actually happen])
459  CFLAG_CURL_SYMBOL_HIDING=""
460  doing_symbol_hiding="no"
461  if test "$want_symbol_hiding" = "yes" &&
462    test "$supports_symbol_hiding" = "yes"; then
463    doing_symbol_hiding="yes"
464    CFLAG_CURL_SYMBOL_HIDING="$symbol_hiding_CFLAGS"
465    AC_DEFINE_UNQUOTED(CURL_EXTERN_SYMBOL, $symbol_hiding_EXTERN,
466      [Definition to make a library symbol externally visible.])
467    AC_MSG_RESULT([yes])
468  else
469    AC_MSG_RESULT([no])
470  fi
471  AM_CONDITIONAL(DOING_CURL_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes)
472  AC_SUBST(CFLAG_CURL_SYMBOL_HIDING)
473])
474
475
476dnl CURL_CHECK_LIB_ARES
477dnl -------------------------------------------------
478dnl When c-ares library support has been requested, performs necessary checks
479dnl and adjustments needed to enable support of this library.
480
481AC_DEFUN([CURL_CHECK_LIB_ARES], [
482  #
483  if test "$want_ares" = "yes"; then
484    dnl c-ares library support has been requested
485    clean_CPPFLAGS="$CPPFLAGS"
486    clean_LDFLAGS="$LDFLAGS"
487    clean_LIBS="$LIBS"
488    configure_runpath=`pwd`
489    if test -n "$want_ares_path"; then
490      dnl c-ares library path has been specified
491      ARES_PCDIR="$want_ares_path/lib/pkgconfig"
492      CURL_CHECK_PKGCONFIG(libcares, [$ARES_PCDIR])
493      if test "$PKGCONFIG" != "no" ; then
494        ares_LIBS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
495          $PKGCONFIG --libs-only-l libcares`
496        ares_LDFLAGS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
497          $PKGCONFIG --libs-only-L libcares`
498        ares_CPPFLAGS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
499          $PKGCONFIG --cflags-only-I libcares`
500        AC_MSG_NOTICE([pkg-config: ares LIBS: "$ares_LIBS"])
501        AC_MSG_NOTICE([pkg-config: ares LDFLAGS: "$ares_LDFLAGS"])
502        AC_MSG_NOTICE([pkg-config: ares CPPFLAGS: "$ares_CPPFLAGS"])
503      else
504        dnl ... path without pkg-config
505        ares_CPPFLAGS="-I$want_ares_path/include"
506        ares_LDFLAGS="-L$want_ares_path/lib"
507        ares_LIBS="-lcares"
508      fi
509    else
510      dnl c-ares path not specified, use defaults
511      CURL_CHECK_PKGCONFIG(libcares)
512      if test "$PKGCONFIG" != "no" ; then
513        ares_LIBS=`$PKGCONFIG --libs-only-l libcares`
514        ares_LDFLAGS=`$PKGCONFIG --libs-only-L libcares`
515        ares_CPPFLAGS=`$PKGCONFIG --cflags-only-I libcares`
516        AC_MSG_NOTICE([pkg-config: ares_LIBS: "$ares_LIBS"])
517        AC_MSG_NOTICE([pkg-config: ares_LDFLAGS: "$ares_LDFLAGS"])
518        AC_MSG_NOTICE([pkg-config: ares_CPPFLAGS: "$ares_CPPFLAGS"])
519      else
520        ares_CPPFLAGS=""
521        ares_LDFLAGS=""
522        ares_LIBS="-lcares"
523      fi
524    fi
525    #
526    CPPFLAGS="$clean_CPPFLAGS $ares_CPPFLAGS"
527    LDFLAGS="$clean_LDFLAGS $ares_LDFLAGS"
528    LIBS="$ares_LIBS $clean_LIBS"
529    #
530
531    dnl check if c-ares new enough
532    AC_MSG_CHECKING([that c-ares is good and recent enough])
533    AC_LINK_IFELSE([
534      AC_LANG_PROGRAM([[
535#include <ares.h>
536        /* set of dummy functions in case c-ares was built with debug */
537        void curl_dofree() { }
538        void curl_sclose() { }
539        void curl_domalloc() { }
540        void curl_docalloc() { }
541        void curl_socket() { }
542      ]],[[
543        ares_channel channel;
544        ares_cancel(channel); /* added in 1.2.0 */
545        ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
546        ares_dup(&channel, channel); /* added in 1.6.0 */
547      ]])
548    ],[
549      AC_MSG_RESULT([yes])
550    ],[
551      AC_MSG_RESULT([no])
552      AC_MSG_ERROR([c-ares library defective or too old])
553      dnl restore initial settings
554      CPPFLAGS="$clean_CPPFLAGS"
555      LDFLAGS="$clean_LDFLAGS"
556      LIBS="$clean_LIBS"
557      # prevent usage
558      want_ares="no"
559    ])
560
561    if test "$want_ares" = "yes"; then
562      dnl finally c-ares will be used
563      AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support])
564      AC_SUBST([USE_ARES], [1])
565      curl_res_msg="c-ares"
566    fi
567  fi
568])
569
570
571dnl CURL_CHECK_OPTION_NTLM_WB
572dnl -------------------------------------------------
573dnl Verify if configure has been invoked with option
574dnl --enable-ntlm-wb or --disable-ntlm-wb, and set
575dnl shell variable want_ntlm_wb and want_ntlm_wb_file
576dnl as appropriate.
577
578AC_DEFUN([CURL_CHECK_OPTION_NTLM_WB], [
579  AC_BEFORE([$0],[CURL_CHECK_NTLM_WB])dnl
580  OPT_NTLM_WB="default"
581  AC_ARG_ENABLE(ntlm-wb,
582AS_HELP_STRING([--enable-ntlm-wb@<:@=FILE@:>@],[Enable NTLM delegation to winbind's ntlm_auth helper, where FILE is ntlm_auth's absolute filename (default: /usr/bin/ntlm_auth)])
583AS_HELP_STRING([--disable-ntlm-wb],[Disable NTLM delegation to winbind's ntlm_auth helper]),
584  OPT_NTLM_WB=$enableval)
585  want_ntlm_wb_file="/usr/bin/ntlm_auth"
586  case "$OPT_NTLM_WB" in
587    no)
588      dnl --disable-ntlm-wb option used
589      want_ntlm_wb="no"
590      ;;
591    default)
592      dnl configure option not specified
593      want_ntlm_wb="yes"
594      ;;
595    *)
596      dnl --enable-ntlm-wb option used
597      want_ntlm_wb="yes"
598      if test -n "$enableval" && test "$enableval" != "yes"; then
599        want_ntlm_wb_file="$enableval"
600      fi
601      ;;
602  esac
603])
604
605
606dnl CURL_CHECK_NTLM_WB
607dnl -------------------------------------------------
608dnl Check if support for NTLM delegation to winbind's
609dnl ntlm_auth helper will finally be enabled depending
610dnl on given configure options and target platform.
611
612AC_DEFUN([CURL_CHECK_NTLM_WB], [
613  AC_REQUIRE([CURL_CHECK_OPTION_NTLM_WB])dnl
614  AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
615  AC_MSG_CHECKING([whether to enable NTLM delegation to winbind's helper])
616  if test "$curl_cv_native_windows" = "yes" ||
617    test "x$SSL_ENABLED" = "x"; then
618    want_ntlm_wb_file=""
619    want_ntlm_wb="no"
620  elif test "x$ac_cv_func_fork" != "xyes"; then
621    dnl ntlm_wb requires fork
622    want_ntlm_wb="no"
623  fi
624  AC_MSG_RESULT([$want_ntlm_wb])
625  if test "$want_ntlm_wb" = "yes"; then
626    AC_DEFINE(NTLM_WB_ENABLED, 1,
627      [Define to enable NTLM delegation to winbind's ntlm_auth helper.])
628    AC_DEFINE_UNQUOTED(NTLM_WB_FILE, "$want_ntlm_wb_file",
629      [Define absolute filename for winbind's ntlm_auth helper.])
630    NTLM_WB_ENABLED=1
631  fi
632])
633
634dnl CURL_CHECK_OPTION_ECH
635dnl -----------------------------------------------------
636dnl Verify whether configure has been invoked with option
637dnl --enable-ech or --disable-ech, and set
638dnl shell variable want_ech as appropriate.
639
640AC_DEFUN([CURL_CHECK_OPTION_ECH], [
641  AC_MSG_CHECKING([whether to enable ECH support])
642  OPT_ECH="default"
643  AC_ARG_ENABLE(ech,
644AS_HELP_STRING([--enable-ech],[Enable ECH support])
645AS_HELP_STRING([--disable-ech],[Disable ECH support]),
646  OPT_ECH=$enableval)
647  case "$OPT_ECH" in
648    no)
649      dnl --disable-ech option used
650      want_ech="no"
651      curl_ech_msg="no      (--enable-ech)"
652      AC_MSG_RESULT([no])
653      ;;
654    default)
655      dnl configure option not specified
656      want_ech="no"
657      curl_ech_msg="no      (--enable-ech)"
658      AC_MSG_RESULT([no])
659      ;;
660    *)
661      dnl --enable-ech option used
662      want_ech="yes"
663      curl_ech_msg="enabled (--disable-ech)"
664      experimental="ech"
665      AC_MSG_RESULT([yes])
666      ;;
667  esac
668])
669