# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
-# are also available at http://curl.haxx.se/docs/copyright.html.
+# are also available at https://curl.haxx.se/docs/copyright.html.
#
# 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
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
-# $Id$
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 9
+# serial 19
+dnl CURL_CHECK_OPTION_THREADED_RESOLVER
+dnl -------------------------------------------------
+dnl Verify if configure has been invoked with option
+dnl --enable-threaded-resolver or --disable-threaded-resolver, and
+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,
+AC_HELP_STRING([--enable-threaded-resolver],[Enable threaded resolver])
+AC_HELP_STRING([--disable-threaded-resolver],[Disable threaded resolver]),
+ OPT_THRES=$enableval)
+ case "$OPT_THRES" in
+ yes)
+ dnl --enable-threaded-resolver option used
+ want_thres="yes"
+ ;;
+ *)
+ dnl configure option not specified
+ want_thres="no"
+ ;;
+ esac
+ AC_MSG_RESULT([$want_thres])
+])
dnl CURL_CHECK_OPTION_ARES
dnl -------------------------------------------------
no)
dnl --disable-ares option used
want_ares="no"
- AC_MSG_RESULT([no])
;;
default)
dnl configure option not specified
- want_ares="assume_yes"
- AC_MSG_RESULT([(assumed) yes])
+ want_ares="no"
;;
*)
dnl --enable-ares option used
want_ares="yes"
- want_ares_path="$enableval"
- AC_MSG_RESULT([yes])
+ if test -n "$enableval" && test "$enableval" != "yes"; then
+ want_ares_path="$enableval"
+ fi
;;
esac
+ AC_MSG_RESULT([$want_ares])
])
AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl
AC_BEFORE([$0],[CURL_CHECK_OPTION_CURLDEBUG])dnl
- AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl
+ AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
AC_MSG_CHECKING([whether to enable debug build options])
OPT_DEBUG_BUILD="default"
AC_ARG_ENABLE(debug,
AC_MSG_RESULT([$want_debug])
])
-
-dnl CURL_CHECK_OPTION_NONBLOCKING
-dnl -------------------------------------------------
-dnl Verify if configure has been invoked with option
-dnl --enable-nonblocking or --disable-nonblocking, and
-dnl set shell variable want_nonblocking as appropriate.
-
-AC_DEFUN([CURL_CHECK_OPTION_NONBLOCKING], [
- AC_BEFORE([$0],[CURL_CHECK_NONBLOCKING_SOCKET])dnl
- AC_MSG_CHECKING([whether to enable non-blocking communications])
- OPT_NONBLOCKING="default"
- AC_ARG_ENABLE(nonblocking,
-AC_HELP_STRING([--enable-nonblocking],[Enable non-blocking communications])
-AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking communications]),
- OPT_NONBLOCKING=$enableval)
- case "$OPT_NONBLOCKING" in
- no)
- dnl --disable-nonblocking option used
- want_nonblocking="no"
- ;;
- default)
- dnl configure option not specified
- want_nonblocking="yes"
- ;;
- *)
- dnl --enable-nonblocking option used
- want_nonblocking="yes"
- ;;
- esac
- AC_MSG_RESULT([$want_nonblocking])
-])
-
-
dnl CURL_CHECK_OPTION_OPTIMIZE
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
AC_DEFUN([CURL_CHECK_OPTION_OPTIMIZE], [
AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
- AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl
+ AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
AC_MSG_CHECKING([whether to enable compiler optimizer])
OPT_COMPILER_OPTIMIZE="default"
AC_ARG_ENABLE(optimize,
])
+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,
+AC_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols])
+AC_HELP_STRING([--disable-symbol-hiding],[Disable hiding of library internal symbols]),
+ OPT_SYMBOL_HIDING=$enableval)
+ AC_ARG_ENABLE(hidden-symbols,
+AC_HELP_STRING([--enable-hidden-symbols],[To be deprecated, use --enable-symbol-hiding])
+AC_HELP_STRING([--disable-hidden-symbols],[To be deprecated, use --disable-symbol-hiding]),
+ 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
+])
+
+
dnl CURL_CHECK_OPTION_THREADS
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl fi
dnl ])
+dnl CURL_CHECK_OPTION_RT
+dnl -------------------------------------------------
+dnl Verify if configure has been involed with option
+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,
+ AC_HELP_STRING([--disable-rt],[disable dependency on -lrt]),
+ 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"
+ AC_MSG_RESULT([(assumed no)])
+ ;;
+ *)
+ dnl --enable-rt option used (reverse logic)
+ dontwant_rt="no"
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+ dnl TODO: may require mutual exclusion
+ if test "$dontwant_rt" = "yes" && test "$want_thres" = "yes" ; then
+ AC_MSG_ERROR([options --disable-rt and --enable-thread-resolver are mutually exclusive, at most one can be selected.])
+ fi
+])
+
dnl CURL_CHECK_OPTION_WARNINGS
dnl -------------------------------------------------
AC_DEFUN([CURL_CHECK_OPTION_WARNINGS], [
AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
- AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl
+ AC_BEFORE([$0],[CURL_CHECK_OPTION_WERROR])dnl
+ AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
AC_MSG_CHECKING([whether to enable strict compiler warnings])
OPT_COMPILER_WARNINGS="default"
AC_ARG_ENABLE(warnings,
AC_MSG_RESULT([$want_warnings])
])
+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], [
+ AC_BEFORE([$0],[CURL_CHECK_COMPILER])dnl
+ AC_MSG_CHECKING([whether to enable compiler warnings as errors])
+ OPT_COMPILER_WERROR="default"
+ AC_ARG_ENABLE(werror,
+AC_HELP_STRING([--enable-werror],[Enable compiler warnings as errors])
+AC_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]),
+ OPT_COMPILER_WERROR=$enableval)
+ case "$OPT_COMPILER_WERROR" in
+ no)
+ dnl --disable-werror option used
+ want_werror="no"
+ ;;
+ default)
+ dnl configure option not specified
+ want_werror="no"
+ ;;
+ *)
+ dnl --enable-werror option used
+ want_werror="yes"
+ ;;
+ esac
+ AC_MSG_RESULT([$want_werror])
+])
+
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_OPTION_NONBLOCKING])dnl
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_SETSOCKOPT])dnl
#
tst_method="unknown"
- if test "$want_nonblocking" = "yes"; then
- AC_MSG_CHECKING([how to set a socket into non-blocking mode])
- if test "x$ac_cv_func_fcntl_o_nonblock" = "xyes"; then
- tst_method="fcntl O_NONBLOCK"
- elif test "x$ac_cv_func_ioctl_fionbio" = "xyes"; then
- tst_method="ioctl FIONBIO"
- elif test "x$ac_cv_func_ioctlsocket_fionbio" = "xyes"; then
- tst_method="ioctlsocket FIONBIO"
- elif test "x$ac_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then
- tst_method="IoctlSocket FIONBIO"
- elif test "x$ac_cv_func_setsockopt_so_nonblock" = "xyes"; then
- tst_method="setsockopt SO_NONBLOCK"
- fi
- AC_MSG_RESULT([$tst_method])
- if test "$tst_method" = "unknown"; then
- AC_MSG_WARN([cannot determine non-blocking socket method.])
- fi
+
+ AC_MSG_CHECKING([how to set a socket into non-blocking mode])
+ if test "x$curl_cv_func_fcntl_o_nonblock" = "xyes"; then
+ tst_method="fcntl O_NONBLOCK"
+ elif test "x$curl_cv_func_ioctl_fionbio" = "xyes"; then
+ tst_method="ioctl FIONBIO"
+ elif test "x$curl_cv_func_ioctlsocket_fionbio" = "xyes"; then
+ tst_method="ioctlsocket FIONBIO"
+ elif test "x$curl_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then
+ tst_method="IoctlSocket FIONBIO"
+ elif test "x$curl_cv_func_setsockopt_so_nonblock" = "xyes"; then
+ tst_method="setsockopt SO_NONBLOCK"
fi
+ AC_MSG_RESULT([$tst_method])
if test "$tst_method" = "unknown"; then
- AC_DEFINE_UNQUOTED(USE_BLOCKING_SOCKETS, 1,
- [Define to disable non-blocking sockets.])
- AC_MSG_WARN([non-blocking sockets disabled.])
+ AC_MSG_WARN([cannot determine non-blocking socket method.])
+ fi
+])
+
+
+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])
+ CFLAG_CURL_SYMBOL_HIDING=""
+ doing_symbol_hiding="no"
+ if test x"$curl_cv_native_windows" != "xyes" &&
+ test "$want_symbol_hiding" = "yes" &&
+ test "$supports_symbol_hiding" = "yes"; then
+ doing_symbol_hiding="yes"
+ CFLAG_CURL_SYMBOL_HIDING="$symbol_hiding_CFLAGS"
+ 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
+ AM_CONDITIONAL(DOING_CURL_SYMBOL_HIDING, test x$doing_symbol_hiding = xyes)
+ AC_SUBST(CFLAG_CURL_SYMBOL_HIDING)
])
AC_DEFUN([CURL_CHECK_LIB_ARES], [
#
- if test "$want_ares" = "yes" || test "$want_ares" = "assume_yes"; then
+ if test "$want_ares" = "yes"; then
dnl c-ares library support has been requested
clean_CPPFLAGS="$CPPFLAGS"
clean_LDFLAGS="$LDFLAGS"
embedded_ares="unknown"
configure_runpath=`pwd`
embedded_ares_builddir="$configure_runpath/ares"
- if test -n "$want_ares_path" && test "$want_ares_path" != "yes"; then
+ if test -n "$want_ares_path"; then
dnl c-ares library path has been specified
ares_CPPFLAGS="-I$want_ares_path/include"
ares_LDFLAGS="-L$want_ares_path/lib"
ares_channel channel;
ares_cancel(channel); /* added in 1.2.0 */
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
+ ares_dup(&channel, channel); /* added in 1.6.0 */
]])
],[
AC_MSG_RESULT([yes])
want_ares="no"
])
fi
- if test "$want_ares" != "no"; then
+ if test "$want_ares" = "yes"; then
dnl finally c-ares will be used
AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support])
AC_SUBST([USE_ARES], [1])
- curl_ares_msg="enabled"
+ curl_res_msg="c-ares"
fi
fi
])
+
+dnl CURL_CHECK_OPTION_NTLM_WB
+dnl -------------------------------------------------
+dnl Verify if configure has been invoked with option
+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,
+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)])
+AC_HELP_STRING([--disable-ntlm-wb],[Disable NTLM delegation to winbind's ntlm_auth helper]),
+ OPT_NTLM_WB=$enableval)
+ want_ntlm_wb_file="/usr/bin/ntlm_auth"
+ case "$OPT_NTLM_WB" in
+ no)
+ dnl --disable-ntlm-wb option used
+ want_ntlm_wb="no"
+ ;;
+ default)
+ dnl configure option not specified
+ want_ntlm_wb="yes"
+ ;;
+ *)
+ dnl --enable-ntlm-wb option used
+ want_ntlm_wb="yes"
+ if test -n "$enableval" && test "$enableval" != "yes"; then
+ want_ntlm_wb_file="$enableval"
+ fi
+ ;;
+ esac
+])
+
+
+dnl CURL_CHECK_NTLM_WB
+dnl -------------------------------------------------
+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.
+
+AC_DEFUN([CURL_CHECK_NTLM_WB], [
+ AC_REQUIRE([CURL_CHECK_OPTION_NTLM_WB])dnl
+ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
+ AC_MSG_CHECKING([whether to enable NTLM delegation to winbind's helper])
+ if test "$curl_cv_native_windows" = "yes" ||
+ test "x$SSL_ENABLED" = "x"; then
+ want_ntlm_wb_file=""
+ want_ntlm_wb="no"
+ fi
+ AC_MSG_RESULT([$want_ntlm_wb])
+ if test "$want_ntlm_wb" = "yes"; then
+ AC_DEFINE(NTLM_WB_ENABLED, 1,
+ [Define to enable NTLM delegation to winbind's ntlm_auth helper.])
+ AC_DEFINE_UNQUOTED(NTLM_WB_FILE, "$want_ntlm_wb_file",
+ [Define absolute filename for winbind's ntlm_auth helper.])
+ NTLM_WB_ENABLED=1
+ fi
+])
+