You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

curl-confopts.m4 21KB

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