xref: /curl/m4/curl-confopts.m4 (revision 68a224c2)
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_DEFINE(CARES_NO_DEPRECATED, 1, [Ignore c-ares deprecation warnings])
565      AC_SUBST([USE_ARES], [1])
566      LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libcares"
567      curl_res_msg="c-ares"
568    fi
569  fi
570])
571
572dnl CURL_CHECK_OPTION_NTLM_WB
573dnl -------------------------------------------------
574dnl Verify if configure has been invoked with option
575dnl --enable-ntlm-wb or --disable-ntlm-wb, and set
576dnl shell variable want_ntlm_wb and want_ntlm_wb_file
577dnl as appropriate.
578
579AC_DEFUN([CURL_CHECK_OPTION_NTLM_WB], [
580  AC_BEFORE([$0],[CURL_CHECK_NTLM_WB])dnl
581  OPT_NTLM_WB="default"
582  AC_ARG_ENABLE(ntlm-wb,
583AS_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)])
584AS_HELP_STRING([--disable-ntlm-wb],[Disable NTLM delegation to winbind's ntlm_auth helper]),
585  OPT_NTLM_WB=$enableval)
586  want_ntlm_wb_file="/usr/bin/ntlm_auth"
587  case "$OPT_NTLM_WB" in
588    no)
589      dnl --disable-ntlm-wb option used
590      want_ntlm_wb="no"
591      ;;
592    default)
593      dnl configure option not specified
594      want_ntlm_wb="yes"
595      ;;
596    *)
597      dnl --enable-ntlm-wb option used
598      want_ntlm_wb="yes"
599      if test -n "$enableval" && test "$enableval" != "yes"; then
600        want_ntlm_wb_file="$enableval"
601      fi
602      ;;
603  esac
604])
605
606
607dnl CURL_CHECK_NTLM_WB
608dnl -------------------------------------------------
609dnl Check if support for NTLM delegation to winbind's
610dnl ntlm_auth helper will finally be enabled depending
611dnl on given configure options and target platform.
612
613AC_DEFUN([CURL_CHECK_NTLM_WB], [
614  AC_REQUIRE([CURL_CHECK_OPTION_NTLM_WB])dnl
615  AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
616  AC_MSG_CHECKING([whether to enable NTLM delegation to winbind's helper])
617  if test "$curl_cv_native_windows" = "yes" ||
618    test "x$SSL_ENABLED" = "x"; then
619    want_ntlm_wb_file=""
620    want_ntlm_wb="no"
621  elif test "x$ac_cv_func_fork" != "xyes"; then
622    dnl ntlm_wb requires fork
623    want_ntlm_wb="no"
624  fi
625  AC_MSG_RESULT([$want_ntlm_wb])
626  if test "$want_ntlm_wb" = "yes"; then
627    AC_DEFINE(NTLM_WB_ENABLED, 1,
628      [Define to enable NTLM delegation to winbind's ntlm_auth helper.])
629    AC_DEFINE_UNQUOTED(NTLM_WB_FILE, "$want_ntlm_wb_file",
630      [Define absolute filename for winbind's ntlm_auth helper.])
631    NTLM_WB_ENABLED=1
632  fi
633])
634
635dnl CURL_CHECK_OPTION_HTTPSRR
636dnl -----------------------------------------------------
637dnl Verify whether configure has been invoked with option
638dnl --enable-httpsrr or --disable-httpsrr, and set
639dnl shell variable want_httpsrr as appropriate.
640
641AC_DEFUN([CURL_CHECK_OPTION_HTTPSRR], [
642  AC_MSG_CHECKING([whether to enable HTTPSRR support])
643  OPT_HTTPSRR="default"
644  AC_ARG_ENABLE(httpsrr,
645AS_HELP_STRING([--enable-httpsrr],[Enable HTTPSRR support])
646AS_HELP_STRING([--disable-httpsrr],[Disable HTTPSRR support]),
647  OPT_HTTPSRR=$enableval)
648  case "$OPT_HTTPSRR" in
649    no)
650      dnl --disable-httpsrr option used
651      want_httpsrr="no"
652      curl_httpsrr_msg="no      (--enable-httpsrr)"
653      AC_MSG_RESULT([no])
654      ;;
655    default)
656      dnl configure option not specified
657      want_httpsrr="no"
658      curl_httpsrr_msg="no      (--enable-httpsrr)"
659      AC_MSG_RESULT([no])
660      ;;
661    *)
662      dnl --enable-httpsrr option used
663      want_httpsrr="yes"
664      curl_httpsrr_msg="enabled (--disable-httpsrr)"
665      AC_MSG_RESULT([yes])
666      ;;
667  esac
668])
669
670dnl CURL_CHECK_OPTION_ECH
671dnl -----------------------------------------------------
672dnl Verify whether configure has been invoked with option
673dnl --enable-ech or --disable-ech, and set
674dnl shell variable want_ech as appropriate.
675
676AC_DEFUN([CURL_CHECK_OPTION_ECH], [
677  AC_MSG_CHECKING([whether to enable ECH support])
678  OPT_ECH="default"
679  AC_ARG_ENABLE(ech,
680AS_HELP_STRING([--enable-ech],[Enable ECH support])
681AS_HELP_STRING([--disable-ech],[Disable ECH support]),
682  OPT_ECH=$enableval)
683  case "$OPT_ECH" in
684    no)
685      dnl --disable-ech option used
686      want_ech="no"
687      curl_ech_msg="no      (--enable-ech)"
688      AC_MSG_RESULT([no])
689      ;;
690    default)
691      dnl configure option not specified
692      want_ech="no"
693      curl_ech_msg="no      (--enable-ech)"
694      AC_MSG_RESULT([no])
695      ;;
696    *)
697      dnl --enable-ech option used
698      want_ech="yes"
699      curl_ech_msg="enabled (--disable-ech)"
700      AC_MSG_RESULT([yes])
701      ;;
702  esac
703])
704])
705