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