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)
want_thres="yes"
;;
*)
want_thres="no"
;;
esac
AC_MSG_RESULT([$want_thres])
])
AC_DEFUN([CURL_CHECK_OPTION_ARES], [
AC_BEFORE([$0],[CURL_CHECK_LIB_ARES]) AC_MSG_CHECKING([whether to enable c-ares for DNS lookups])
OPT_ARES="default"
AC_ARG_ENABLE(ares,
AC_HELP_STRING([--enable-ares@<:@=PATH@:>@],[Enable c-ares for DNS lookups])
AC_HELP_STRING([--disable-ares],[Disable c-ares for DNS lookups]),
OPT_ARES=$enableval)
case "$OPT_ARES" in
no)
want_ares="no"
;;
default)
want_ares="no"
;;
*)
want_ares="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_CURLDEBUG], [
AC_BEFORE([$0],[CURL_CHECK_CURLDEBUG]) AC_MSG_CHECKING([whether to enable curl debug memory tracking])
OPT_CURLDEBUG_BUILD="default"
AC_ARG_ENABLE(curldebug,
AC_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
AC_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
OPT_CURLDEBUG_BUILD=$enableval)
case "$OPT_CURLDEBUG_BUILD" in
no)
want_curldebug="no"
AC_MSG_RESULT([no])
;;
default)
if test "$want_debug" = "yes"; then
AC_MSG_RESULT([(assumed) yes])
else
AC_MSG_RESULT([no])
fi
want_curldebug_assumed="yes"
want_curldebug="$want_debug"
;;
*)
want_curldebug="yes"
AC_MSG_RESULT([yes])
;;
esac
])
AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS]) AC_BEFORE([$0],[CURL_CHECK_OPTION_CURLDEBUG]) AC_BEFORE([$0],[CURL_CHECK_PROG_CC]) AC_MSG_CHECKING([whether to enable debug build options])
OPT_DEBUG_BUILD="default"
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],[Enable debug build options])
AC_HELP_STRING([--disable-debug],[Disable debug build options]),
OPT_DEBUG_BUILD=$enableval)
case "$OPT_DEBUG_BUILD" in
no)
want_debug="no"
;;
default)
want_debug="no"
;;
*)
want_debug="yes"
;;
esac
AC_MSG_RESULT([$want_debug])
])
AC_DEFUN([CURL_CHECK_OPTION_NONBLOCKING], [
AC_BEFORE([$0],[CURL_CHECK_NONBLOCKING_SOCKET]) 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)
want_nonblocking="no"
;;
default)
want_nonblocking="yes"
;;
*)
want_nonblocking="yes"
;;
esac
AC_MSG_RESULT([$want_nonblocking])
])
AC_DEFUN([CURL_CHECK_OPTION_OPTIMIZE], [
AC_REQUIRE([CURL_CHECK_OPTION_DEBUG]) AC_BEFORE([$0],[CURL_CHECK_PROG_CC]) AC_MSG_CHECKING([whether to enable compiler optimizer])
OPT_COMPILER_OPTIMIZE="default"
AC_ARG_ENABLE(optimize,
AC_HELP_STRING([--enable-optimize],[Enable compiler optimizations])
AC_HELP_STRING([--disable-optimize],[Disable compiler optimizations]),
OPT_COMPILER_OPTIMIZE=$enableval)
case "$OPT_COMPILER_OPTIMIZE" in
no)
want_optimize="no"
AC_MSG_RESULT([no])
;;
default)
if test "$want_debug" = "yes"; then
want_optimize="assume_no"
AC_MSG_RESULT([(assumed) no])
else
want_optimize="assume_yes"
AC_MSG_RESULT([(assumed) yes])
fi
;;
*)
want_optimize="yes"
AC_MSG_RESULT([yes])
;;
esac
])
AC_DEFUN([CURL_CHECK_OPTION_WARNINGS], [
AC_REQUIRE([CURL_CHECK_OPTION_DEBUG]) AC_BEFORE([$0],[CURL_CHECK_OPTION_WERROR]) AC_BEFORE([$0],[CURL_CHECK_PROG_CC]) AC_MSG_CHECKING([whether to enable strict compiler warnings])
OPT_COMPILER_WARNINGS="default"
AC_ARG_ENABLE(warnings,
AC_HELP_STRING([--enable-warnings],[Enable strict compiler warnings])
AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
OPT_COMPILER_WARNINGS=$enableval)
case "$OPT_COMPILER_WARNINGS" in
no)
want_warnings="no"
;;
default)
want_warnings="$want_debug"
;;
*)
want_warnings="yes"
;;
esac
AC_MSG_RESULT([$want_warnings])
])
AC_DEFUN([CURL_CHECK_OPTION_WERROR], [
AC_BEFORE([$0],[CURL_CHECK_COMPILER]) 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)
want_werror="no"
;;
default)
want_werror="no"
;;
*)
want_werror="yes"
;;
esac
AC_MSG_RESULT([$want_werror])
])
AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [
AC_REQUIRE([CURL_CHECK_OPTION_NONBLOCKING]) AC_REQUIRE([CURL_CHECK_FUNC_FCNTL]) AC_REQUIRE([CURL_CHECK_FUNC_IOCTL]) AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET]) AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL]) AC_REQUIRE([CURL_CHECK_FUNC_SETSOCKOPT]) 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
fi
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.])
fi
])
AC_DEFUN([CURL_CHECK_LIB_ARES], [
if test "$want_ares" = "yes"; then
clean_CPPFLAGS="$CPPFLAGS"
clean_LDFLAGS="$LDFLAGS"
clean_LIBS="$LIBS"
embedded_ares="unknown"
configure_runpath=`pwd`
embedded_ares_builddir="$configure_runpath/ares"
if test -n "$want_ares_path"; then
ares_CPPFLAGS="-I$want_ares_path/include"
ares_LDFLAGS="-L$want_ares_path/lib"
ares_LIBS="-lcares"
else
if test -d "$srcdir/ares"; then
embedded_ares="yes"
AC_CONFIG_SUBDIRS(ares)
ares_CPPFLAGS=""
ares_LDFLAGS="-L$embedded_ares_builddir"
ares_LIBS="-lcares"
else
ares_CPPFLAGS=""
ares_LDFLAGS=""
ares_LIBS="-lcares"
fi
fi
CPPFLAGS="$ares_CPPFLAGS $clean_CPPFLAGS"
LDFLAGS="$ares_LDFLAGS $clean_LDFLAGS"
LIBS="$ares_LIBS $clean_LIBS"
if test "$embedded_ares" != "yes"; then
AC_MSG_CHECKING([that c-ares is good and recent enough])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
/* 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 */
ares_dup(&channel, channel); /* added in 1.6.0 */
]])
],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
AC_MSG_ERROR([c-ares library defective or too old])
CPPFLAGS="$clean_CPPFLAGS"
LDFLAGS="$clean_LDFLAGS"
LIBS="$clean_LIBS"
want_ares="no"
])
fi
if test "$want_ares" = "yes"; then
AC_DEFINE(USE_ARES, 1, [Define to enable c-ares support])
AC_SUBST([USE_ARES], [1])
curl_res_msg="c-ares"
fi
fi
])
AC_DEFUN([CURL_CHECK_OPTION_NTLM_WB], [
AC_BEFORE([$0],[CURL_CHECK_NTLM_WB]) 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)
want_ntlm_wb="no"
;;
default)
want_ntlm_wb="yes"
;;
*)
want_ntlm_wb="yes"
if test -n "$enableval" && test "$enableval" != "yes"; then
want_ntlm_wb_file="$enableval"
fi
;;
esac
])
AC_DEFUN([CURL_CHECK_NTLM_WB], [
AC_REQUIRE([CURL_CHECK_OPTION_NTLM_WB]) AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS]) AC_MSG_CHECKING([whether to enable NTLM delegation to winbind's helper])
if test "$ac_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
])