xref: /curl/m4/curl-confopts.m4 (revision e244d500)
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_LDFLAGSPC="$LDFLAGSPC"
488    clean_LIBS="$LIBS"
489    configure_runpath=`pwd`
490    if test -n "$want_ares_path"; then
491      dnl c-ares library path has been specified
492      ARES_PCDIR="$want_ares_path/lib/pkgconfig"
493      CURL_CHECK_PKGCONFIG(libcares, [$ARES_PCDIR])
494      if test "$PKGCONFIG" != "no" ; then
495        ares_LIBS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
496          $PKGCONFIG --libs-only-l libcares`
497        ares_LDFLAGS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
498          $PKGCONFIG --libs-only-L libcares`
499        ares_CPPFLAGS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
500          $PKGCONFIG --cflags-only-I libcares`
501        AC_MSG_NOTICE([pkg-config: ares LIBS: "$ares_LIBS"])
502        AC_MSG_NOTICE([pkg-config: ares LDFLAGS: "$ares_LDFLAGS"])
503        AC_MSG_NOTICE([pkg-config: ares CPPFLAGS: "$ares_CPPFLAGS"])
504      else
505        dnl ... path without pkg-config
506        ares_CPPFLAGS="-I$want_ares_path/include"
507        ares_LDFLAGS="-L$want_ares_path/lib"
508        ares_LIBS="-lcares"
509      fi
510    else
511      dnl c-ares path not specified, use defaults
512      CURL_CHECK_PKGCONFIG(libcares)
513      if test "$PKGCONFIG" != "no" ; then
514        ares_LIBS=`$PKGCONFIG --libs-only-l libcares`
515        ares_LDFLAGS=`$PKGCONFIG --libs-only-L libcares`
516        ares_CPPFLAGS=`$PKGCONFIG --cflags-only-I libcares`
517        AC_MSG_NOTICE([pkg-config: ares_LIBS: "$ares_LIBS"])
518        AC_MSG_NOTICE([pkg-config: ares_LDFLAGS: "$ares_LDFLAGS"])
519        AC_MSG_NOTICE([pkg-config: ares_CPPFLAGS: "$ares_CPPFLAGS"])
520      else
521        ares_CPPFLAGS=""
522        ares_LDFLAGS=""
523        ares_LIBS="-lcares"
524      fi
525    fi
526    #
527    CPPFLAGS="$clean_CPPFLAGS $ares_CPPFLAGS"
528    LDFLAGS="$clean_LDFLAGS $ares_LDFLAGS"
529    LDFLAGSPC="$clean_LDFLAGSPC $ares_LDFLAGS"
530    LIBS="$ares_LIBS $clean_LIBS"
531    #
532
533    dnl check if c-ares new enough
534    AC_MSG_CHECKING([that c-ares is good and recent enough])
535    AC_LINK_IFELSE([
536      AC_LANG_PROGRAM([[
537        #include <ares.h>
538        /* set of dummy functions in case c-ares was built with debug */
539        void curl_dofree() { }
540        void curl_sclose() { }
541        void curl_domalloc() { }
542        void curl_docalloc() { }
543        void curl_socket() { }
544      ]],[[
545        ares_channel channel;
546        ares_cancel(channel); /* added in 1.2.0 */
547        ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
548        ares_dup(&channel, channel); /* added in 1.6.0 */
549      ]])
550    ],[
551      AC_MSG_RESULT([yes])
552    ],[
553      AC_MSG_RESULT([no])
554      AC_MSG_ERROR([c-ares library defective or too old])
555      dnl restore initial settings
556      CPPFLAGS="$clean_CPPFLAGS"
557      LDFLAGS="$clean_LDFLAGS"
558      LDFLAGSPC="$clean_LDFLAGSPC"
559      LIBS="$clean_LIBS"
560      # prevent usage
561      want_ares="no"
562    ])
563
564    if test "$want_ares" = "yes"; then
565      dnl finally c-ares will be used
566      AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support])
567      AC_DEFINE(CARES_NO_DEPRECATED, 1, [Ignore c-ares deprecation warnings])
568      AC_SUBST([USE_ARES], [1])
569      LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE libcares"
570      curl_res_msg="c-ares"
571    fi
572  fi
573])
574
575dnl CURL_CHECK_OPTION_NTLM_WB
576dnl -------------------------------------------------
577dnl Verify if configure has been invoked with option
578dnl --enable-ntlm-wb or --disable-ntlm-wb, and set
579dnl shell variable want_ntlm_wb and want_ntlm_wb_file
580dnl as appropriate.
581
582AC_DEFUN([CURL_CHECK_OPTION_NTLM_WB], [
583  AC_BEFORE([$0],[CURL_CHECK_NTLM_WB])dnl
584  OPT_NTLM_WB="default"
585  AC_ARG_ENABLE(ntlm-wb,
586AS_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)])
587AS_HELP_STRING([--disable-ntlm-wb],[Disable NTLM delegation to winbind's ntlm_auth helper]),
588  OPT_NTLM_WB=$enableval)
589  want_ntlm_wb_file="/usr/bin/ntlm_auth"
590  case "$OPT_NTLM_WB" in
591    no)
592      dnl --disable-ntlm-wb option used
593      want_ntlm_wb="no"
594      ;;
595    default)
596      dnl configure option not specified
597      want_ntlm_wb="yes"
598      ;;
599    *)
600      dnl --enable-ntlm-wb option used
601      want_ntlm_wb="yes"
602      if test -n "$enableval" && test "$enableval" != "yes"; then
603        want_ntlm_wb_file="$enableval"
604      fi
605      ;;
606  esac
607])
608
609
610dnl CURL_CHECK_NTLM_WB
611dnl -------------------------------------------------
612dnl Check if support for NTLM delegation to winbind's
613dnl ntlm_auth helper will finally be enabled depending
614dnl on given configure options and target platform.
615
616AC_DEFUN([CURL_CHECK_NTLM_WB], [
617  AC_REQUIRE([CURL_CHECK_OPTION_NTLM_WB])dnl
618  AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
619  AC_MSG_CHECKING([whether to enable NTLM delegation to winbind's helper])
620  if test "$curl_cv_native_windows" = "yes" ||
621    test "x$SSL_ENABLED" = "x"; then
622    want_ntlm_wb_file=""
623    want_ntlm_wb="no"
624  elif test "x$ac_cv_func_fork" != "xyes"; then
625    dnl ntlm_wb requires fork
626    want_ntlm_wb="no"
627  fi
628  AC_MSG_RESULT([$want_ntlm_wb])
629  if test "$want_ntlm_wb" = "yes"; then
630    AC_DEFINE(NTLM_WB_ENABLED, 1,
631      [Define to enable NTLM delegation to winbind's ntlm_auth helper.])
632    AC_DEFINE_UNQUOTED(NTLM_WB_FILE, "$want_ntlm_wb_file",
633      [Define absolute filename for winbind's ntlm_auth helper.])
634    NTLM_WB_ENABLED=1
635  fi
636])
637
638dnl CURL_CHECK_OPTION_HTTPSRR
639dnl -----------------------------------------------------
640dnl Verify whether configure has been invoked with option
641dnl --enable-httpsrr or --disable-httpsrr, and set
642dnl shell variable want_httpsrr as appropriate.
643
644AC_DEFUN([CURL_CHECK_OPTION_HTTPSRR], [
645  AC_MSG_CHECKING([whether to enable HTTPSRR support])
646  OPT_HTTPSRR="default"
647  AC_ARG_ENABLE(httpsrr,
648AS_HELP_STRING([--enable-httpsrr],[Enable HTTPSRR support])
649AS_HELP_STRING([--disable-httpsrr],[Disable HTTPSRR support]),
650  OPT_HTTPSRR=$enableval)
651  case "$OPT_HTTPSRR" in
652    no)
653      dnl --disable-httpsrr option used
654      want_httpsrr="no"
655      curl_httpsrr_msg="no      (--enable-httpsrr)"
656      AC_MSG_RESULT([no])
657      ;;
658    default)
659      dnl configure option not specified
660      want_httpsrr="no"
661      curl_httpsrr_msg="no      (--enable-httpsrr)"
662      AC_MSG_RESULT([no])
663      ;;
664    *)
665      dnl --enable-httpsrr option used
666      want_httpsrr="yes"
667      curl_httpsrr_msg="enabled (--disable-httpsrr)"
668      AC_MSG_RESULT([yes])
669      ;;
670  esac
671])
672
673dnl CURL_CHECK_OPTION_ECH
674dnl -----------------------------------------------------
675dnl Verify whether configure has been invoked with option
676dnl --enable-ech or --disable-ech, and set
677dnl shell variable want_ech as appropriate.
678
679AC_DEFUN([CURL_CHECK_OPTION_ECH], [
680  AC_MSG_CHECKING([whether to enable ECH support])
681  OPT_ECH="default"
682  AC_ARG_ENABLE(ech,
683AS_HELP_STRING([--enable-ech],[Enable ECH support])
684AS_HELP_STRING([--disable-ech],[Disable ECH support]),
685  OPT_ECH=$enableval)
686  case "$OPT_ECH" in
687    no)
688      dnl --disable-ech option used
689      want_ech="no"
690      curl_ech_msg="no      (--enable-ech)"
691      AC_MSG_RESULT([no])
692      ;;
693    default)
694      dnl configure option not specified
695      want_ech="no"
696      curl_ech_msg="no      (--enable-ech)"
697      AC_MSG_RESULT([no])
698      ;;
699    *)
700      dnl --enable-ech option used
701      want_ech="yes"
702      curl_ech_msg="enabled (--disable-ech)"
703      AC_MSG_RESULT([yes])
704      ;;
705  esac
706])
707])
708