| xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | #*************************************************************************** | 
|  | 2 | #                                  _   _ ____  _ | 
|  | 3 | #  Project                     ___| | | |  _ \| | | 
|  | 4 | #                             / __| | | | |_) | | | 
|  | 5 | #                            | (__| |_| |  _ <| |___ | 
|  | 6 | #                             \___|\___/|_| \_\_____| | 
|  | 7 | # | 
|  | 8 | # Copyright (C) 1998 - 2022, 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 |  | 
|  | 28 | dnl CURL_CHECK_OPTION_THREADED_RESOLVER | 
|  | 29 | dnl ------------------------------------------------- | 
|  | 30 | dnl Verify if configure has been invoked with option | 
|  | 31 | dnl --enable-threaded-resolver or --disable-threaded-resolver, and | 
|  | 32 | dnl set shell variable want_thres as appropriate. | 
|  | 33 |  | 
|  | 34 | AC_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, | 
|  | 38 | AS_HELP_STRING([--enable-threaded-resolver],[Enable threaded resolver]) | 
|  | 39 | AS_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 |  | 
|  | 54 | dnl CURL_CHECK_OPTION_ARES | 
|  | 55 | dnl ------------------------------------------------- | 
|  | 56 | dnl Verify if configure has been invoked with option | 
|  | 57 | dnl --enable-ares or --disable-ares, and | 
|  | 58 | dnl set shell variable want_ares as appropriate. | 
|  | 59 |  | 
|  | 60 | AC_DEFUN([CURL_CHECK_OPTION_ARES], [ | 
|  | 61 | dnl   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, | 
|  | 66 | AS_HELP_STRING([--enable-ares@<:@=PATH@:>@],[Enable c-ares for DNS lookups]) | 
|  | 67 | AS_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 |  | 
|  | 90 | dnl CURL_CHECK_OPTION_CURLDEBUG | 
|  | 91 | dnl ------------------------------------------------- | 
|  | 92 | dnl Verify if configure has been invoked with option | 
|  | 93 | dnl --enable-curldebug or --disable-curldebug, and set | 
|  | 94 | dnl shell variable want_curldebug value as appropriate. | 
|  | 95 |  | 
|  | 96 | AC_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, | 
|  | 101 | AS_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking]) | 
|  | 102 | AS_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 |  | 
|  | 143 | dnl CURL_CHECK_OPTION_DEBUG | 
|  | 144 | dnl ------------------------------------------------- | 
|  | 145 | dnl Verify if configure has been invoked with option | 
|  | 146 | dnl --enable-debug or --disable-debug, and set shell | 
|  | 147 | dnl variable want_debug value as appropriate. | 
|  | 148 |  | 
|  | 149 | AC_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, | 
|  | 156 | AS_HELP_STRING([--enable-debug],[Enable debug build options]) | 
|  | 157 | AS_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 |  | 
|  | 177 | dnl CURL_CHECK_OPTION_OPTIMIZE | 
|  | 178 | dnl ------------------------------------------------- | 
|  | 179 | dnl Verify if configure has been invoked with option | 
|  | 180 | dnl --enable-optimize or --disable-optimize, and set | 
|  | 181 | dnl shell variable want_optimize value as appropriate. | 
|  | 182 |  | 
|  | 183 | AC_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, | 
|  | 189 | AS_HELP_STRING([--enable-optimize],[Enable compiler optimizations]) | 
|  | 190 | AS_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 |  | 
|  | 233 | dnl CURL_CHECK_OPTION_SYMBOL_HIDING | 
|  | 234 | dnl ------------------------------------------------- | 
|  | 235 | dnl Verify if configure has been invoked with option | 
|  | 236 | dnl --enable-symbol-hiding or --disable-symbol-hiding, | 
|  | 237 | dnl setting shell variable want_symbol_hiding value. | 
|  | 238 |  | 
|  | 239 | AC_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, | 
|  | 244 | AS_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols]) | 
|  | 245 | AS_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 |  | 
|  | 273 | dnl CURL_CHECK_OPTION_THREADS | 
|  | 274 | dnl ------------------------------------------------- | 
|  | 275 | dnl Verify if configure has been invoked with option | 
|  | 276 | dnl --enable-threads or --disable-threads, and | 
|  | 277 | dnl set shell variable want_threads as appropriate. | 
|  | 278 |  | 
|  | 279 | dnl AC_DEFUN([CURL_CHECK_OPTION_THREADS], [ | 
|  | 280 | dnl   AC_BEFORE([$0],[CURL_CHECK_LIB_THREADS])dnl | 
|  | 281 | dnl   AC_MSG_CHECKING([whether to enable threads for DNS lookups]) | 
|  | 282 | dnl   OPT_THREADS="default" | 
|  | 283 | dnl   AC_ARG_ENABLE(threads, | 
|  | 284 | dnl AS_HELP_STRING([--enable-threads@<:@=PATH@:>@],[Enable threads for DNS lookups]) | 
|  | 285 | dnl AS_HELP_STRING([--disable-threads],[Disable threads for DNS lookups]), | 
|  | 286 | dnl   OPT_THREADS=$enableval) | 
|  | 287 | dnl   case "$OPT_THREADS" in | 
|  | 288 | dnl     no) | 
|  | 289 | dnl       dnl --disable-threads option used | 
|  | 290 | dnl       want_threads="no" | 
|  | 291 | dnl       AC_MSG_RESULT([no]) | 
|  | 292 | dnl       ;; | 
|  | 293 | dnl     default) | 
|  | 294 | dnl       dnl configure option not specified | 
|  | 295 | dnl       want_threads="no" | 
|  | 296 | dnl       AC_MSG_RESULT([(assumed) no]) | 
|  | 297 | dnl       ;; | 
|  | 298 | dnl     *) | 
|  | 299 | dnl       dnl --enable-threads option used | 
|  | 300 | dnl       want_threads="yes" | 
|  | 301 | dnl       want_threads_path="$enableval" | 
|  | 302 | dnl       AC_MSG_RESULT([yes]) | 
|  | 303 | dnl       ;; | 
|  | 304 | dnl   esac | 
|  | 305 | dnl   # | 
|  | 306 | dnl   if test "$want_ares" = "assume_yes"; then | 
|  | 307 | dnl     if test "$want_threads" = "yes"; then | 
|  | 308 | dnl       AC_MSG_CHECKING([whether to ignore c-ares enabling assumed setting]) | 
|  | 309 | dnl       AC_MSG_RESULT([yes]) | 
|  | 310 | dnl       want_ares="no" | 
|  | 311 | dnl     else | 
|  | 312 | dnl       want_ares="yes" | 
|  | 313 | dnl     fi | 
|  | 314 | dnl   fi | 
|  | 315 | dnl   if test "$want_threads" = "yes" && test "$want_ares" = "yes"; then | 
|  | 316 | dnl     AC_MSG_ERROR([options --enable-ares and --enable-threads are mutually exclusive, at most one may be enabled.]) | 
|  | 317 | dnl   fi | 
|  | 318 | dnl ]) | 
|  | 319 |  | 
|  | 320 | dnl CURL_CHECK_OPTION_RT | 
|  | 321 | dnl ------------------------------------------------- | 
|  | 322 | dnl Verify if configure has been invoked with option | 
|  | 323 | dnl --disable-rt and set shell variable dontwant_rt | 
|  | 324 | dnl as appropriate. | 
|  | 325 |  | 
|  | 326 | AC_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 |  | 
|  | 352 | dnl CURL_CHECK_OPTION_WARNINGS | 
|  | 353 | dnl ------------------------------------------------- | 
|  | 354 | dnl Verify if configure has been invoked with option | 
|  | 355 | dnl --enable-warnings or --disable-warnings, and set | 
|  | 356 | dnl shell variable want_warnings as appropriate. | 
|  | 357 |  | 
|  | 358 | AC_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, | 
|  | 365 | AS_HELP_STRING([--enable-warnings],[Enable strict compiler warnings]) | 
|  | 366 | AS_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 |  | 
|  | 386 | dnl CURL_CHECK_OPTION_WERROR | 
|  | 387 | dnl ------------------------------------------------- | 
|  | 388 | dnl Verify if configure has been invoked with option | 
|  | 389 | dnl --enable-werror or --disable-werror, and set | 
|  | 390 | dnl shell variable want_werror as appropriate. | 
|  | 391 |  | 
|  | 392 | AC_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, | 
|  | 397 | AS_HELP_STRING([--enable-werror],[Enable compiler warnings as errors]) | 
|  | 398 | AS_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 |  | 
|  | 418 | dnl CURL_CHECK_NONBLOCKING_SOCKET | 
|  | 419 | dnl ------------------------------------------------- | 
|  | 420 | dnl Check for how to set a socket into non-blocking state. | 
|  | 421 |  | 
|  | 422 | AC_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 |  | 
|  | 448 | dnl CURL_CONFIGURE_SYMBOL_HIDING | 
|  | 449 | dnl ------------------------------------------------- | 
|  | 450 | dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding | 
|  | 451 | dnl configure option, and compiler capability to actually honor such | 
|  | 452 | dnl option, this will modify compiler flags as appropriate and also | 
|  | 453 | dnl provide needed definitions for configuration and Makefile.am files. | 
|  | 454 | dnl This macro should not be used until all compilation tests have | 
|  | 455 | dnl been done to prevent interferences on other tests. | 
|  | 456 |  | 
|  | 457 | AC_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 |  | 
|  | 476 | dnl CURL_CHECK_LIB_ARES | 
|  | 477 | dnl ------------------------------------------------- | 
|  | 478 | dnl When c-ares library support has been requested, | 
|  | 479 | dnl performs necessary checks and adjustsments needed | 
|  | 480 | dnl to enable support of this library. | 
|  | 481 |  | 
|  | 482 | AC_DEFUN([CURL_CHECK_LIB_ARES], [ | 
|  | 483 | # | 
|  | 484 | if test "$want_ares" = "yes"; then | 
|  | 485 | dnl c-ares library support has been requested | 
|  | 486 | clean_CPPFLAGS="$CPPFLAGS" | 
|  | 487 | clean_LDFLAGS="$LDFLAGS" | 
|  | 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 | LIBS="$ares_LIBS $clean_LIBS" | 
|  | 530 | # | 
|  | 531 |  | 
|  | 532 | dnl check if c-ares new enough | 
|  | 533 | AC_MSG_CHECKING([that c-ares is good and recent enough]) | 
|  | 534 | AC_LINK_IFELSE([ | 
|  | 535 | AC_LANG_PROGRAM([[ | 
|  | 536 | #include <ares.h> | 
|  | 537 | /* set of dummy functions in case c-ares was built with debug */ | 
|  | 538 | void curl_dofree() { } | 
|  | 539 | void curl_sclose() { } | 
|  | 540 | void curl_domalloc() { } | 
|  | 541 | void curl_docalloc() { } | 
|  | 542 | void curl_socket() { } | 
|  | 543 | ]],[[ | 
|  | 544 | ares_channel channel; | 
|  | 545 | ares_cancel(channel); /* added in 1.2.0 */ | 
|  | 546 | ares_process_fd(channel, 0, 0); /* added in 1.4.0 */ | 
|  | 547 | ares_dup(&channel, channel); /* added in 1.6.0 */ | 
|  | 548 | ]]) | 
|  | 549 | ],[ | 
|  | 550 | AC_MSG_RESULT([yes]) | 
|  | 551 | ],[ | 
|  | 552 | AC_MSG_RESULT([no]) | 
|  | 553 | AC_MSG_ERROR([c-ares library defective or too old]) | 
|  | 554 | dnl restore initial settings | 
|  | 555 | CPPFLAGS="$clean_CPPFLAGS" | 
|  | 556 | LDFLAGS="$clean_LDFLAGS" | 
|  | 557 | LIBS="$clean_LIBS" | 
|  | 558 | # prevent usage | 
|  | 559 | want_ares="no" | 
|  | 560 | ]) | 
|  | 561 |  | 
|  | 562 | if test "$want_ares" = "yes"; then | 
|  | 563 | dnl finally c-ares will be used | 
|  | 564 | AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support]) | 
|  | 565 | AC_SUBST([USE_ARES], [1]) | 
|  | 566 | curl_res_msg="c-ares" | 
|  | 567 | fi | 
|  | 568 | fi | 
|  | 569 | ]) | 
|  | 570 |  | 
|  | 571 |  | 
|  | 572 | dnl CURL_CHECK_OPTION_NTLM_WB | 
|  | 573 | dnl ------------------------------------------------- | 
|  | 574 | dnl Verify if configure has been invoked with option | 
|  | 575 | dnl --enable-ntlm-wb or --disable-ntlm-wb, and set | 
|  | 576 | dnl shell variable want_ntlm_wb and want_ntlm_wb_file | 
|  | 577 | dnl as appropriate. | 
|  | 578 |  | 
|  | 579 | AC_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, | 
|  | 583 | AS_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)]) | 
|  | 584 | AS_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 |  | 
|  | 607 | dnl CURL_CHECK_NTLM_WB | 
|  | 608 | dnl ------------------------------------------------- | 
|  | 609 | dnl Check if support for NTLM delegation to winbind's | 
|  | 610 | dnl ntlm_auth helper will finally be enabled depending | 
|  | 611 | dnl on given configure options and target platform. | 
|  | 612 |  | 
|  | 613 | AC_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 | fi | 
|  | 622 | AC_MSG_RESULT([$want_ntlm_wb]) | 
|  | 623 | if test "$want_ntlm_wb" = "yes"; then | 
|  | 624 | AC_DEFINE(NTLM_WB_ENABLED, 1, | 
|  | 625 | [Define to enable NTLM delegation to winbind's ntlm_auth helper.]) | 
|  | 626 | AC_DEFINE_UNQUOTED(NTLM_WB_FILE, "$want_ntlm_wb_file", | 
|  | 627 | [Define absolute filename for winbind's ntlm_auth helper.]) | 
|  | 628 | NTLM_WB_ENABLED=1 | 
|  | 629 | fi | 
|  | 630 | ]) | 
|  | 631 |  | 
|  | 632 | dnl CURL_CHECK_OPTION_ECH | 
|  | 633 | dnl ----------------------------------------------------- | 
|  | 634 | dnl Verify whether configure has been invoked with option | 
|  | 635 | dnl --enable-ech or --disable-ech, and set | 
|  | 636 | dnl shell variable want_ech as appropriate. | 
|  | 637 |  | 
|  | 638 | AC_DEFUN([CURL_CHECK_OPTION_ECH], [ | 
|  | 639 | AC_MSG_CHECKING([whether to enable ECH support]) | 
|  | 640 | OPT_ECH="default" | 
|  | 641 | AC_ARG_ENABLE(ech, | 
|  | 642 | AS_HELP_STRING([--enable-ech],[Enable ECH support]) | 
|  | 643 | AS_HELP_STRING([--disable-ech],[Disable ECH support]), | 
|  | 644 | OPT_ECH=$enableval) | 
|  | 645 | case "$OPT_ECH" in | 
|  | 646 | no) | 
|  | 647 | dnl --disable-ech option used | 
|  | 648 | want_ech="no" | 
|  | 649 | curl_ech_msg="no      (--enable-ech)" | 
|  | 650 | AC_MSG_RESULT([no]) | 
|  | 651 | ;; | 
|  | 652 | default) | 
|  | 653 | dnl configure option not specified | 
|  | 654 | want_ech="no" | 
|  | 655 | curl_ech_msg="no      (--enable-ech)" | 
|  | 656 | AC_MSG_RESULT([no]) | 
|  | 657 | ;; | 
|  | 658 | *) | 
|  | 659 | dnl --enable-ech option used | 
|  | 660 | want_ech="yes" | 
|  | 661 | curl_ech_msg="enabled (--disable-ech)" | 
|  | 662 | experimental="ech" | 
|  | 663 | AC_MSG_RESULT([yes]) | 
|  | 664 | ;; | 
|  | 665 | esac | 
|  | 666 | ]) |