2008-10-02 07:56:55 +04:00
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
2021-03-15 19:32:26 +03:00
# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
2008-10-02 07:56:55 +04:00
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
2020-11-04 16:02:01 +03:00
# are also available at https://curl.se/docs/copyright.html.
2008-10-02 07:56:55 +04:00
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
2013-01-20 23:23:20 +04:00
# serial 19
2010-01-26 18:07:40 +03:00
2010-04-26 01:24:05 +04:00
dnl CURL_CHECK_OPTION_THREADED_RESOLVER
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
2010-06-17 17:07:05 +04:00
dnl --enable-threaded-resolver or --disable-threaded-resolver, and
2010-04-26 01:24:05 +04:00
dnl set shell variable want_thres as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_THREADED_RESOLVER], [
AC_MSG_CHECKING([whether to enable the threaded resolver])
OPT_THRES="default"
AC_ARG_ENABLE(threaded_resolver,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-threaded-resolver],[Enable threaded resolver])
AS_HELP_STRING([--disable-threaded-resolver],[Disable threaded resolver]),
2010-04-26 01:24:05 +04:00
OPT_THRES=$enableval)
case "$OPT_THRES" in
2017-08-10 16:07:40 +03:00
no)
dnl --disable-threaded-resolver option used
2010-04-26 01:24:05 +04:00
want_thres="no"
;;
2017-08-15 20:21:33 +03:00
*)
dnl configure option not specified
want_thres="yes"
;;
2010-04-26 01:24:05 +04:00
esac
AC_MSG_RESULT([$want_thres])
])
2010-01-26 18:07:40 +03:00
dnl CURL_CHECK_OPTION_ARES
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-ares or --disable-ares, and
dnl set shell variable want_ares as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_ARES], [
dnl AC_BEFORE([$0],[CURL_CHECK_OPTION_THREADS])dnl
AC_BEFORE([$0],[CURL_CHECK_LIB_ARES])dnl
AC_MSG_CHECKING([whether to enable c-ares for DNS lookups])
OPT_ARES="default"
AC_ARG_ENABLE(ares,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-ares@<:@=PATH@:>@],[Enable c-ares for DNS lookups])
AS_HELP_STRING([--disable-ares],[Disable c-ares for DNS lookups]),
2010-01-26 18:07:40 +03:00
OPT_ARES=$enableval)
case "$OPT_ARES" in
no)
dnl --disable-ares option used
want_ares="no"
;;
default)
dnl configure option not specified
2010-01-27 09:59:02 +03:00
want_ares="no"
2010-01-26 18:07:40 +03:00
;;
*)
dnl --enable-ares option used
want_ares="yes"
2010-01-27 09:59:02 +03:00
if test -n "$enableval" && test "$enableval" != "yes"; then
want_ares_path="$enableval"
fi
2010-01-26 18:07:40 +03:00
;;
esac
2010-01-27 09:59:02 +03:00
AC_MSG_RESULT([$want_ares])
2010-01-26 18:07:40 +03:00
])
2009-06-09 21:59:28 +04:00
dnl CURL_CHECK_OPTION_CURLDEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-curldebug or --disable-curldebug, and set
dnl shell variable want_curldebug value as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_CURLDEBUG], [
AC_BEFORE([$0],[CURL_CHECK_CURLDEBUG])dnl
AC_MSG_CHECKING([whether to enable curl debug memory tracking])
OPT_CURLDEBUG_BUILD="default"
AC_ARG_ENABLE(curldebug,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
AS_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
2009-06-09 21:59:28 +04:00
OPT_CURLDEBUG_BUILD=$enableval)
case "$OPT_CURLDEBUG_BUILD" in
no)
dnl --disable-curldebug option used
want_curldebug="no"
AC_MSG_RESULT([no])
;;
default)
dnl configure's curldebug option not specified. Initially we will
2020-02-02 11:49:28 +03:00
dnl handle this as a request to use the same setting as option
2009-06-09 21:59:28 +04:00
dnl --enable-debug. IOW, initially, for debug-enabled builds
dnl this will be handled as a request to enable curldebug if
dnl possible, and for debug-disabled builds this will be handled
dnl as a request to disable curldebug.
if test "$want_debug" = "yes"; then
2010-01-26 18:07:40 +03:00
AC_MSG_RESULT([(assumed) yes])
2018-05-04 15:31:16 +03:00
AC_DEFINE(CURLDEBUG, 1, [to enable curl debug memory tracking])
2009-06-09 21:59:28 +04:00
else
AC_MSG_RESULT([no])
fi
want_curldebug_assumed="yes"
want_curldebug="$want_debug"
;;
*)
dnl --enable-curldebug option used.
dnl The use of this option value is a request to enable curl's
dnl debug memory tracking for the libcurl library. This can only
dnl be done when some requisites are simultaneously satisfied.
dnl Later on, these requisites are verified and if they are not
2009-06-10 08:25:01 +04:00
dnl fully satisfied the option will be ignored and act as if
2009-06-09 21:59:28 +04:00
dnl --disable-curldebug had been given setting shell variable
dnl want_curldebug to 'no'.
want_curldebug="yes"
2018-05-04 15:31:16 +03:00
AC_DEFINE(CURLDEBUG, 1, [to enable curl debug memory tracking])
2009-06-09 21:59:28 +04:00
AC_MSG_RESULT([yes])
;;
esac
])
2008-10-02 07:56:55 +04:00
dnl CURL_CHECK_OPTION_DEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-debug or --disable-debug, and set shell
dnl variable want_debug value as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
2008-10-02 08:17:36 +04:00
AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl
2009-06-09 21:59:28 +04:00
AC_BEFORE([$0],[CURL_CHECK_OPTION_CURLDEBUG])dnl
2013-01-20 23:23:20 +04:00
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
2008-10-02 07:56:55 +04:00
AC_MSG_CHECKING([whether to enable debug build options])
OPT_DEBUG_BUILD="default"
AC_ARG_ENABLE(debug,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-debug],[Enable debug build options])
AS_HELP_STRING([--disable-debug],[Disable debug build options]),
2008-10-07 17:13:34 +04:00
OPT_DEBUG_BUILD=$enableval)
2008-10-02 07:56:55 +04:00
case "$OPT_DEBUG_BUILD" in
no)
dnl --disable-debug option used
want_debug="no"
;;
default)
dnl configure option not specified
want_debug="no"
;;
*)
dnl --enable-debug option used
want_debug="yes"
2018-05-04 15:31:16 +03:00
AC_DEFINE(DEBUGBUILD, 1, [enable debug build options])
2008-10-02 07:56:55 +04:00
;;
esac
AC_MSG_RESULT([$want_debug])
])
2008-10-07 17:13:34 +04:00
dnl CURL_CHECK_OPTION_OPTIMIZE
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-optimize or --disable-optimize, and set
dnl shell variable want_optimize value as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_OPTIMIZE], [
AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
2013-01-20 23:23:20 +04:00
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
2008-10-07 17:13:34 +04:00
AC_MSG_CHECKING([whether to enable compiler optimizer])
OPT_COMPILER_OPTIMIZE="default"
AC_ARG_ENABLE(optimize,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-optimize],[Enable compiler optimizations])
AS_HELP_STRING([--disable-optimize],[Disable compiler optimizations]),
2008-10-07 17:13:34 +04:00
OPT_COMPILER_OPTIMIZE=$enableval)
case "$OPT_COMPILER_OPTIMIZE" in
no)
dnl --disable-optimize option used. We will handle this as
dnl a request to disable compiler optimizations if possible.
dnl If the compiler is known CFLAGS and CPPFLAGS will be
dnl overridden, otherwise this can not be honored.
want_optimize="no"
AC_MSG_RESULT([no])
;;
default)
dnl configure's optimize option not specified. Initially we will
2020-02-02 11:49:28 +03:00
dnl handle this as a request contrary to configure's setting
2008-10-07 17:13:34 +04:00
dnl for --enable-debug. IOW, initially, for debug-enabled builds
dnl this will be handled as a request to disable optimizations if
dnl possible, and for debug-disabled builds this will be handled
dnl initially as a request to enable optimizations if possible.
dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do
dnl not have any optimizer flag the request will be honored, in
dnl any other case the request can not be honored.
dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS
dnl will always take precedence over any initial assumption.
if test "$want_debug" = "yes"; then
want_optimize="assume_no"
2010-01-26 18:07:40 +03:00
AC_MSG_RESULT([(assumed) no])
2008-10-07 17:13:34 +04:00
else
want_optimize="assume_yes"
2010-01-26 18:07:40 +03:00
AC_MSG_RESULT([(assumed) yes])
2008-10-07 17:13:34 +04:00
fi
;;
*)
dnl --enable-optimize option used. We will handle this as
dnl a request to enable compiler optimizations if possible.
dnl If the compiler is known CFLAGS and CPPFLAGS will be
dnl overridden, otherwise this can not be honored.
want_optimize="yes"
AC_MSG_RESULT([yes])
;;
esac
])
2012-04-11 21:33:54 +04:00
dnl CURL_CHECK_OPTION_SYMBOL_HIDING
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-symbol-hiding or --disable-symbol-hiding,
dnl setting shell variable want_symbol_hiding value.
AC_DEFUN([CURL_CHECK_OPTION_SYMBOL_HIDING], [
AC_BEFORE([$0],[CURL_CHECK_COMPILER_SYMBOL_HIDING])dnl
AC_MSG_CHECKING([whether to enable hiding of library internal symbols])
OPT_SYMBOL_HIDING="default"
AC_ARG_ENABLE(symbol-hiding,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols])
AS_HELP_STRING([--disable-symbol-hiding],[Disable hiding of library internal symbols]),
2012-04-11 21:33:54 +04:00
OPT_SYMBOL_HIDING=$enableval)
case "$OPT_SYMBOL_HIDING" in
no)
dnl --disable-symbol-hiding option used.
dnl This is an indication to not attempt hiding of library internal
dnl symbols. Default symbol visibility will be used, which normally
dnl exposes all library internal symbols.
want_symbol_hiding="no"
AC_MSG_RESULT([no])
;;
default)
dnl configure's symbol-hiding option not specified.
dnl Handle this as if --enable-symbol-hiding option was given.
want_symbol_hiding="yes"
AC_MSG_RESULT([yes])
;;
*)
dnl --enable-symbol-hiding option used.
dnl This is an indication to attempt hiding of library internal
dnl symbols. This is only supported on some compilers/linkers.
want_symbol_hiding="yes"
AC_MSG_RESULT([yes])
;;
esac
])
2010-01-26 18:07:40 +03:00
dnl CURL_CHECK_OPTION_THREADS
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-threads or --disable-threads, and
dnl set shell variable want_threads as appropriate.
dnl AC_DEFUN([CURL_CHECK_OPTION_THREADS], [
dnl AC_BEFORE([$0],[CURL_CHECK_LIB_THREADS])dnl
dnl AC_MSG_CHECKING([whether to enable threads for DNS lookups])
dnl OPT_THREADS="default"
dnl AC_ARG_ENABLE(threads,
2021-03-15 19:32:26 +03:00
dnl AS_HELP_STRING([--enable-threads@<:@=PATH@:>@],[Enable threads for DNS lookups])
dnl AS_HELP_STRING([--disable-threads],[Disable threads for DNS lookups]),
2010-01-26 18:07:40 +03:00
dnl OPT_THREADS=$enableval)
dnl case "$OPT_THREADS" in
dnl no)
dnl dnl --disable-threads option used
dnl want_threads="no"
dnl AC_MSG_RESULT([no])
dnl ;;
dnl default)
dnl dnl configure option not specified
dnl want_threads="no"
dnl AC_MSG_RESULT([(assumed) no])
dnl ;;
dnl *)
dnl dnl --enable-threads option used
dnl want_threads="yes"
dnl want_threads_path="$enableval"
dnl AC_MSG_RESULT([yes])
dnl ;;
dnl esac
dnl #
dnl if test "$want_ares" = "assume_yes"; then
dnl if test "$want_threads" = "yes"; then
dnl AC_MSG_CHECKING([whether to ignore c-ares enabling assumed setting])
dnl AC_MSG_RESULT([yes])
dnl want_ares="no"
dnl else
dnl want_ares="yes"
dnl fi
dnl fi
dnl if test "$want_threads" = "yes" && test "$want_ares" = "yes"; then
dnl AC_MSG_ERROR([options --enable-ares and --enable-threads are mutually exclusive, at most one may be enabled.])
dnl fi
dnl ])
2015-07-23 12:38:49 +03:00
dnl CURL_CHECK_OPTION_RT
dnl -------------------------------------------------
2018-11-21 14:23:54 +03:00
dnl Verify if configure has been invoked with option
2015-07-23 12:38:49 +03:00
dnl --disable-rt and set shell variable dontwant_rt
dnl as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_RT], [
AC_BEFORE([$0], [CURL_CHECK_LIB_THREADS])dnl
AC_MSG_CHECKING([whether to disable dependency on -lrt])
OPT_RT="default"
AC_ARG_ENABLE(rt,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--disable-rt],[disable dependency on -lrt]),
2015-07-23 12:38:49 +03:00
OPT_RT=$enableval)
case "$OPT_RT" in
no)
dnl --disable-rt used (reverse logic)
dontwant_rt="yes"
AC_MSG_RESULT([yes])
;;
default)
dnl configure option not specified (so not disabled)
dontwant_rt="no"
2015-09-26 11:23:35 +03:00
AC_MSG_RESULT([(assumed no)])
2015-07-23 12:38:49 +03:00
;;
*)
dnl --enable-rt option used (reverse logic)
dontwant_rt="no"
AC_MSG_RESULT([no])
;;
esac
])
2010-01-26 18:07:40 +03:00
2008-10-02 07:56:55 +04:00
dnl CURL_CHECK_OPTION_WARNINGS
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-warnings or --disable-warnings, and set
2008-10-07 17:13:34 +04:00
dnl shell variable want_warnings as appropriate.
2008-10-02 07:56:55 +04:00
AC_DEFUN([CURL_CHECK_OPTION_WARNINGS], [
AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
2010-08-11 16:08:05 +04:00
AC_BEFORE([$0],[CURL_CHECK_OPTION_WERROR])dnl
2013-01-20 23:23:20 +04:00
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
2008-10-02 07:56:55 +04:00
AC_MSG_CHECKING([whether to enable strict compiler warnings])
OPT_COMPILER_WARNINGS="default"
AC_ARG_ENABLE(warnings,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-warnings],[Enable strict compiler warnings])
AS_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
2008-10-07 17:13:34 +04:00
OPT_COMPILER_WARNINGS=$enableval)
2008-10-02 07:56:55 +04:00
case "$OPT_COMPILER_WARNINGS" in
no)
dnl --disable-warnings option used
want_warnings="no"
;;
default)
dnl configure option not specified, so
dnl use same setting as --enable-debug
want_warnings="$want_debug"
;;
*)
dnl --enable-warnings option used
want_warnings="yes"
;;
esac
AC_MSG_RESULT([$want_warnings])
])
2010-07-19 20:07:09 +04:00
dnl CURL_CHECK_OPTION_WERROR
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-werror or --disable-werror, and set
dnl shell variable want_werror as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_WERROR], [
2010-08-11 16:08:05 +04:00
AC_BEFORE([$0],[CURL_CHECK_COMPILER])dnl
2010-07-19 20:07:09 +04:00
AC_MSG_CHECKING([whether to enable compiler warnings as errors])
OPT_COMPILER_WERROR="default"
AC_ARG_ENABLE(werror,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-werror],[Enable compiler warnings as errors])
AS_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]),
2010-07-19 20:07:09 +04:00
OPT_COMPILER_WERROR=$enableval)
case "$OPT_COMPILER_WERROR" in
no)
dnl --disable-werror option used
want_werror="no"
;;
default)
2010-08-11 16:08:05 +04:00
dnl configure option not specified
2010-07-19 20:07:09 +04:00
want_werror="no"
;;
*)
dnl --enable-werror option used
want_werror="yes"
;;
esac
AC_MSG_RESULT([$want_werror])
])
2008-11-13 21:56:55 +03:00
dnl CURL_CHECK_NONBLOCKING_SOCKET
dnl -------------------------------------------------
dnl Check for how to set a socket into non-blocking state.
AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [
AC_REQUIRE([CURL_CHECK_FUNC_FCNTL])dnl
AC_REQUIRE([CURL_CHECK_FUNC_IOCTL])dnl
AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET])dnl
AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL])dnl
AC_REQUIRE([CURL_CHECK_FUNC_SETSOCKOPT])dnl
#
tst_method="unknown"
2012-08-16 21:24:33 +04:00
AC_MSG_CHECKING([how to set a socket into non-blocking mode])
2016-04-17 22:58:15 +03:00
if test "x$curl_cv_func_fcntl_o_nonblock" = "xyes"; then
2012-08-16 21:24:33 +04:00
tst_method="fcntl O_NONBLOCK"
2016-04-17 22:58:15 +03:00
elif test "x$curl_cv_func_ioctl_fionbio" = "xyes"; then
2012-08-16 21:24:33 +04:00
tst_method="ioctl FIONBIO"
2016-04-17 22:58:15 +03:00
elif test "x$curl_cv_func_ioctlsocket_fionbio" = "xyes"; then
2012-08-16 21:24:33 +04:00
tst_method="ioctlsocket FIONBIO"
2016-04-17 22:58:15 +03:00
elif test "x$curl_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then
2012-08-16 21:24:33 +04:00
tst_method="IoctlSocket FIONBIO"
2016-04-17 22:58:15 +03:00
elif test "x$curl_cv_func_setsockopt_so_nonblock" = "xyes"; then
2012-08-16 21:24:33 +04:00
tst_method="setsockopt SO_NONBLOCK"
2008-11-13 21:56:55 +03:00
fi
2012-08-16 21:24:33 +04:00
AC_MSG_RESULT([$tst_method])
2008-11-13 21:56:55 +03:00
if test "$tst_method" = "unknown"; then
2012-08-16 21:24:33 +04:00
AC_MSG_WARN([cannot determine non-blocking socket method.])
2008-11-13 21:56:55 +03:00
fi
])
2010-01-26 18:07:40 +03:00
2012-04-11 21:33:54 +04:00
dnl CURL_CONFIGURE_SYMBOL_HIDING
dnl -------------------------------------------------
dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding
dnl configure option, and compiler capability to actually honor such
dnl option, this will modify compiler flags as appropriate and also
dnl provide needed definitions for configuration and Makefile.am files.
dnl This macro should not be used until all compilation tests have
dnl been done to prevent interferences on other tests.
AC_DEFUN([CURL_CONFIGURE_SYMBOL_HIDING], [
AC_MSG_CHECKING([whether hiding of library internal symbols will actually happen])
2012-04-17 14:42:14 +04:00
CFLAG_CURL_SYMBOL_HIDING=""
2012-04-11 21:33:54 +04:00
doing_symbol_hiding="no"
2016-04-15 17:37:20 +03:00
if test x"$curl_cv_native_windows" != "xyes" &&
2012-04-11 21:33:54 +04:00
test "$want_symbol_hiding" = "yes" &&
test "$supports_symbol_hiding" = "yes"; then
doing_symbol_hiding="yes"
2012-04-17 14:42:14 +04:00
CFLAG_CURL_SYMBOL_HIDING="$symbol_hiding_CFLAGS"
2012-04-11 21:33:54 +04:00
AC_DEFINE_UNQUOTED(CURL_EXTERN_SYMBOL, $symbol_hiding_EXTERN,
[Definition to make a library symbol externally visible.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
2012-04-17 14:42:14 +04:00
AM_CONDITIONAL(DOING_CURL_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes)
AC_SUBST(CFLAG_CURL_SYMBOL_HIDING)
2012-04-11 21:33:54 +04:00
])
2010-01-26 18:07:40 +03:00
dnl CURL_CHECK_LIB_ARES
dnl -------------------------------------------------
dnl When c-ares library support has been requested,
dnl performs necessary checks and adjustsments needed
dnl to enable support of this library.
AC_DEFUN([CURL_CHECK_LIB_ARES], [
#
2010-01-27 09:59:02 +03:00
if test "$want_ares" = "yes"; then
2010-01-26 18:07:40 +03:00
dnl c-ares library support has been requested
clean_CPPFLAGS="$CPPFLAGS"
2010-01-27 06:41:05 +03:00
clean_LDFLAGS="$LDFLAGS"
2010-01-26 18:07:40 +03:00
clean_LIBS="$LIBS"
embedded_ares="unknown"
configure_runpath=`pwd`
embedded_ares_builddir="$configure_runpath/ares"
2010-01-27 09:59:02 +03:00
if test -n "$want_ares_path"; then
2010-01-26 18:07:40 +03:00
dnl c-ares library path has been specified
2018-06-14 14:19:09 +03:00
ARES_PCDIR="$want_ares_path/lib/pkgconfig"
2018-06-15 18:14:05 +03:00
CURL_CHECK_PKGCONFIG(libcares, [$ARES_PCDIR])
2018-06-14 14:19:09 +03:00
if test "$PKGCONFIG" != "no" ; then
ares_LIBS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
$PKGCONFIG --libs-only-l libcares`
ares_LDFLAGS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
$PKGCONFIG --libs-only-L libcares`
ares_CPPFLAGS=`CURL_EXPORT_PCDIR([$ARES_PCDIR])
$PKGCONFIG --cflags-only-I libcares`
AC_MSG_NOTICE([pkg-config: ares LIBS: "$ares_LIBS"])
AC_MSG_NOTICE([pkg-config: ares LDFLAGS: "$ares_LDFLAGS"])
AC_MSG_NOTICE([pkg-config: ares CPPFLAGS: "$ares_CPPFLAGS"])
else
dnl ... path without pkg-config
ares_CPPFLAGS="-I$want_ares_path/include"
ares_LDFLAGS="-L$want_ares_path/lib"
ares_LIBS="-lcares"
fi
2010-01-26 18:07:40 +03:00
else
dnl c-ares library path has not been given
if test -d "$srcdir/ares"; then
dnl c-ares sources embedded in curl tree
embedded_ares="yes"
AC_CONFIG_SUBDIRS(ares)
dnl c-ares has installable configured header files, path
dnl inclusion fully done in makefiles for in-tree builds.
ares_CPPFLAGS=""
ares_LDFLAGS="-L$embedded_ares_builddir"
ares_LIBS="-lcares"
else
dnl c-ares path not specified, use defaults
2018-06-14 14:19:09 +03:00
CURL_CHECK_PKGCONFIG(libcares)
if test "$PKGCONFIG" != "no" ; then
ares_LIBS=`$PKGCONFIG --libs-only-l libcares`
ares_LDFLAGS=`$PKGCONFIG --libs-only-L libcares`
ares_CPPFLAGS=`$PKGCONFIG --cflags-only-I libcares`
AC_MSG_NOTICE([pkg-config: ares_LIBS: "$ares_LIBS"])
AC_MSG_NOTICE([pkg-config: ares_LDFLAGS: "$ares_LDFLAGS"])
AC_MSG_NOTICE([pkg-config: ares_CPPFLAGS: "$ares_CPPFLAGS"])
else
ares_CPPFLAGS=""
ares_LDFLAGS=""
ares_LIBS="-lcares"
fi
2010-01-26 18:07:40 +03:00
fi
fi
#
2017-04-24 10:13:28 +03:00
CPPFLAGS="$clean_CPPFLAGS $ares_CPPFLAGS"
LDFLAGS="$clean_LDFLAGS $ares_LDFLAGS"
2010-01-26 18:07:40 +03:00
LIBS="$ares_LIBS $clean_LIBS"
#
if test "$embedded_ares" != "yes"; then
dnl check if c-ares new enough when not using an embedded
dnl source tree one which normally has not been built yet.
AC_MSG_CHECKING([that c-ares is good and recent enough])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#include <ares.h>
/* set of dummy functions in case c-ares was built with debug */
void curl_dofree() { }
void curl_sclose() { }
void curl_domalloc() { }
void curl_docalloc() { }
void curl_socket() { }
]],[[
ares_channel channel;
ares_cancel(channel); /* added in 1.2.0 */
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
2010-09-21 18:41:14 +04:00
ares_dup(&channel, channel); /* added in 1.6.0 */
2010-01-26 18:07:40 +03:00
]])
],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
AC_MSG_ERROR([c-ares library defective or too old])
dnl restore initial settings
CPPFLAGS="$clean_CPPFLAGS"
2010-01-27 06:41:05 +03:00
LDFLAGS="$clean_LDFLAGS"
2010-01-26 18:07:40 +03:00
LIBS="$clean_LIBS"
# prevent usage
want_ares="no"
])
fi
2010-01-27 09:59:02 +03:00
if test "$want_ares" = "yes"; then
2010-01-26 18:07:40 +03:00
dnl finally c-ares will be used
AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support])
AC_SUBST([USE_ARES], [1])
2010-04-26 01:24:05 +04:00
curl_res_msg="c-ares"
2010-01-26 18:07:40 +03:00
fi
fi
])
2011-07-31 22:44:41 +04:00
2011-08-27 08:31:18 +04:00
dnl CURL_CHECK_OPTION_NTLM_WB
2011-07-31 22:44:41 +04:00
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
2011-08-27 08:31:18 +04:00
dnl --enable-ntlm-wb or --disable-ntlm-wb, and set
dnl shell variable want_ntlm_wb and want_ntlm_wb_file
dnl as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_NTLM_WB], [
AC_BEFORE([$0],[CURL_CHECK_NTLM_WB])dnl
OPT_NTLM_WB="default"
AC_ARG_ENABLE(ntlm-wb,
2021-03-15 19:32:26 +03:00
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)])
AS_HELP_STRING([--disable-ntlm-wb],[Disable NTLM delegation to winbind's ntlm_auth helper]),
2011-08-27 08:31:18 +04:00
OPT_NTLM_WB=$enableval)
want_ntlm_wb_file="/usr/bin/ntlm_auth"
case "$OPT_NTLM_WB" in
2011-07-31 22:44:41 +04:00
no)
2011-08-27 08:31:18 +04:00
dnl --disable-ntlm-wb option used
want_ntlm_wb="no"
2011-07-31 22:44:41 +04:00
;;
default)
dnl configure option not specified
2011-08-27 08:31:18 +04:00
want_ntlm_wb="yes"
2011-07-31 22:44:41 +04:00
;;
*)
2011-08-27 08:31:18 +04:00
dnl --enable-ntlm-wb option used
want_ntlm_wb="yes"
2011-07-31 22:44:41 +04:00
if test -n "$enableval" && test "$enableval" != "yes"; then
2011-08-27 08:31:18 +04:00
want_ntlm_wb_file="$enableval"
2011-07-31 22:44:41 +04:00
fi
;;
esac
])
2011-08-27 08:31:18 +04:00
dnl CURL_CHECK_NTLM_WB
2011-07-31 22:44:41 +04:00
dnl -------------------------------------------------
2011-08-27 08:31:18 +04:00
dnl Check if support for NTLM delegation to winbind's
dnl ntlm_auth helper will finally be enabled depending
dnl on given configure options and target platform.
2011-07-31 22:44:41 +04:00
2011-08-27 08:31:18 +04:00
AC_DEFUN([CURL_CHECK_NTLM_WB], [
AC_REQUIRE([CURL_CHECK_OPTION_NTLM_WB])dnl
2011-07-31 22:44:41 +04:00
AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
2011-08-27 03:32:49 +04:00
AC_MSG_CHECKING([whether to enable NTLM delegation to winbind's helper])
2016-04-15 17:37:20 +03:00
if test "$curl_cv_native_windows" = "yes" ||
2011-08-27 03:32:49 +04:00
test "x$SSL_ENABLED" = "x"; then
2011-08-27 08:31:18 +04:00
want_ntlm_wb_file=""
want_ntlm_wb="no"
2011-07-31 22:44:41 +04:00
fi
2011-08-27 08:31:18 +04:00
AC_MSG_RESULT([$want_ntlm_wb])
if test "$want_ntlm_wb" = "yes"; then
AC_DEFINE(NTLM_WB_ENABLED, 1,
2011-08-27 03:32:49 +04:00
[Define to enable NTLM delegation to winbind's ntlm_auth helper.])
2011-08-27 08:31:18 +04:00
AC_DEFINE_UNQUOTED(NTLM_WB_FILE, "$want_ntlm_wb_file",
2011-07-31 22:44:41 +04:00
[Define absolute filename for winbind's ntlm_auth helper.])
2011-08-27 08:31:18 +04:00
NTLM_WB_ENABLED=1
2011-07-31 22:44:41 +04:00
fi
])
2019-06-04 17:53:02 +03:00
2020-09-29 11:13:18 +03:00
dnl CURL_CHECK_OPTION_ECH
2019-06-04 17:53:02 +03:00
dnl -----------------------------------------------------
dnl Verify whether configure has been invoked with option
2020-09-29 11:13:18 +03:00
dnl --enable-ech or --disable-ech, and set
dnl shell variable want_ech as appropriate.
AC_DEFUN([CURL_CHECK_OPTION_ECH], [
AC_MSG_CHECKING([whether to enable ECH support])
OPT_ECH="default"
AC_ARG_ENABLE(ech,
2021-03-15 19:32:26 +03:00
AS_HELP_STRING([--enable-ech],[Enable ECH support])
AS_HELP_STRING([--disable-ech],[Disable ECH support]),
2020-09-29 11:13:18 +03:00
OPT_ECH=$enableval)
case "$OPT_ECH" in
2019-06-04 17:53:02 +03:00
no)
2020-09-29 11:13:18 +03:00
dnl --disable-ech option used
want_ech="no"
curl_ech_msg="no (--enable-ech)"
2019-06-04 17:53:02 +03:00
AC_MSG_RESULT([no])
;;
default)
dnl configure option not specified
2020-09-29 11:13:18 +03:00
want_ech="no"
curl_ech_msg="no (--enable-ech)"
2019-06-04 17:53:02 +03:00
AC_MSG_RESULT([no])
;;
*)
2020-09-29 11:13:18 +03:00
dnl --enable-ech option used
want_ech="yes"
curl_ech_msg="enabled (--disable-ech)"
experimental="ech"
2019-06-04 17:53:02 +03:00
AC_MSG_RESULT([yes])
;;
esac
])