# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# 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
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 65
+# serial 73
dnl CURL_INCLUDES_ARPA_INET
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
+ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
#
tst_links_getaddrinfo="unknown"
tst_proto_getaddrinfo="unknown"
tst_tsafe_getaddrinfo="yes"
;;
esac
+ if test "$tst_tsafe_getaddrinfo" = "unknown" &&
+ test "$ac_cv_native_windows" = "yes"; then
+ tst_tsafe_getaddrinfo="yes"
+ fi
if test "$tst_tsafe_getaddrinfo" = "unknown"; then
CURL_CHECK_DEF_CC([h_errno], [
- $curl_includes_ws2tcpip
$curl_includes_sys_socket
$curl_includes_netdb
], [silent])
- if test "$curl_cv_have_def_h_errno" = "no"; then
+ if test "$curl_cv_have_def_h_errno" = "yes"; then
+ tst_h_errno_macro="yes"
+ else
+ tst_h_errno_macro="no"
+ fi
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $curl_includes_sys_socket
+ $curl_includes_netdb
+ ]],[[
+ h_errno = 2;
+ if(0 != h_errno)
+ return 1;
+ ]])
+ ],[
+ tst_h_errno_modifiable_lvalue="yes"
+ ],[
+ tst_h_errno_modifiable_lvalue="no"
+ ])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ ]],[[
+#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
+ return 0;
+#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
+ return 0;
+#else
+ force compilation error
+#endif
+ ]])
+ ],[
+ tst_h_errno_sbs_issue_7="yes"
+ ],[
+ tst_h_errno_sbs_issue_7="no"
+ ])
+ if test "$tst_h_errno_macro" = "no" &&
+ test "$tst_h_errno_modifiable_lvalue" = "no" &&
+ test "$tst_h_errno_sbs_issue_7" = "no"; then
tst_tsafe_getaddrinfo="no"
+ else
+ tst_tsafe_getaddrinfo="yes"
fi
fi
- if test "$tst_tsafe_getaddrinfo" = "unknown"; then
- tst_tsafe_getaddrinfo="yes"
- fi
AC_MSG_RESULT([$tst_tsafe_getaddrinfo])
if test "$tst_tsafe_getaddrinfo" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1,
fi
])
+dnl CURL_CHECK_FUNC_GAI_STRERROR
+dnl -------------------------------------------------
+dnl Verify if gai_strerror is available, prototyped,
+dnl and can be compiled. If all of these are true,
+dnl and usage has not been previously disallowed with
+dnl shell variable curl_disallow_gai_strerror, then
+dnl HAVE_GAI_STRERROR will be defined.
+
+AC_DEFUN([CURL_CHECK_FUNC_GAI_STRERROR], [
+ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
+ AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
+ #
+ tst_links_gai_strerror="unknown"
+ tst_proto_gai_strerror="unknown"
+ tst_compi_gai_strerror="unknown"
+ tst_allow_gai_strerror="unknown"
+ #
+ AC_MSG_CHECKING([if gai_strerror can be linked])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[
+ $curl_includes_winsock2
+ $curl_includes_netdb
+ ]],[[
+ if(0 != gai_strerror(0))
+ return 1;
+ ]])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_links_gai_strerror="yes"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_links_gai_strerror="no"
+ ])
+ #
+ if test "$tst_links_gai_strerror" = "yes"; then
+ AC_MSG_CHECKING([if gai_strerror is prototyped])
+ AC_EGREP_CPP([gai_strerror],[
+ $curl_includes_winsock2
+ $curl_includes_netdb
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_proto_gai_strerror="yes"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_proto_gai_strerror="no"
+ ])
+ fi
+ #
+ if test "$tst_proto_gai_strerror" = "yes"; then
+ AC_MSG_CHECKING([if gai_strerror is compilable])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $curl_includes_winsock2
+ $curl_includes_netdb
+ ]],[[
+ if(0 != gai_strerror(0))
+ return 1;
+ ]])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_compi_gai_strerror="yes"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_compi_gai_strerror="no"
+ ])
+ fi
+ #
+ if test "$tst_compi_gai_strerror" = "yes"; then
+ AC_MSG_CHECKING([if gai_strerror usage allowed])
+ if test "x$curl_disallow_gai_strerror" != "xyes"; then
+ AC_MSG_RESULT([yes])
+ tst_allow_gai_strerror="yes"
+ else
+ AC_MSG_RESULT([no])
+ tst_allow_gai_strerror="no"
+ fi
+ fi
+ #
+ AC_MSG_CHECKING([if gai_strerror might be used])
+ if test "$tst_links_gai_strerror" = "yes" &&
+ test "$tst_proto_gai_strerror" = "yes" &&
+ test "$tst_compi_gai_strerror" = "yes" &&
+ test "$tst_allow_gai_strerror" = "yes"; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE_UNQUOTED(HAVE_GAI_STRERROR, 1,
+ [Define to 1 if you have the gai_strerror function.])
+ ac_cv_func_gai_strerror="yes"
+ else
+ AC_MSG_RESULT([no])
+ ac_cv_func_gai_strerror="no"
+ fi
+])
+
dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R
dnl -------------------------------------------------
AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
+ AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
#
tst_links_gethostname="unknown"
tst_proto_gethostname="unknown"
fi
#
if test "$tst_compi_gethostname" = "yes"; then
+ AC_MSG_CHECKING([for gethostname arg 2 data type])
+ tst_gethostname_type_arg2="unknown"
+ for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do
+ for tst_arg2 in 'int' 'unsigned int' 'size_t'; do
+ if test "$tst_gethostname_type_arg2" = "unknown"; then
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $curl_includes_winsock2
+ $curl_includes_unistd
+ $curl_preprocess_callconv
+ extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2);
+ ]],[[
+ if(0 != gethostname(0, 0))
+ return 1;
+ ]])
+ ],[
+ tst_gethostname_type_arg2="$tst_arg2"
+ ])
+ fi
+ done
+ done
+ AC_MSG_RESULT([$tst_gethostname_type_arg2])
+ if test "$tst_gethostname_type_arg2" != "unknown"; then
+ AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2,
+ [Define to the type of arg 2 for gethostname.])
+ fi
+ fi
+ #
+ if test "$tst_compi_gethostname" = "yes"; then
AC_MSG_CHECKING([if gethostname usage allowed])
if test "x$curl_disallow_gethostname" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_poll="unknown"
#
case $host_os in
- darwin*|interix*)
+ darwin[[123456789]].*|darwin10.*|darwin11.*|darwin12.*|interix*)
dnl poll() does not work on these platforms
dnl Interix: "does provide poll(), but the implementing developer must
dnl have been in a bad mood, because poll() only works on the /proc
])
-dnl CURL_CHECK_FUNC_STRCASECMP
+dnl CURL_CHECK_FUNC_SOCKETPAIR
dnl -------------------------------------------------
-dnl Verify if strcasecmp is available, prototyped, and
+dnl Verify if socketpair is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
-dnl shell variable curl_disallow_strcasecmp, then
-dnl HAVE_STRCASECMP will be defined.
+dnl shell variable curl_disallow_socketpair, then
+dnl HAVE_SOCKETPAIR will be defined.
-AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
- AC_REQUIRE([CURL_INCLUDES_STRING])dnl
+AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [
+ AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
+ AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
#
- tst_links_strcasecmp="unknown"
- tst_proto_strcasecmp="unknown"
- tst_compi_strcasecmp="unknown"
- tst_allow_strcasecmp="unknown"
+ tst_links_socketpair="unknown"
+ tst_proto_socketpair="unknown"
+ tst_compi_socketpair="unknown"
+ tst_allow_socketpair="unknown"
#
- AC_MSG_CHECKING([if strcasecmp can be linked])
+ AC_MSG_CHECKING([if socketpair can be linked])
AC_LINK_IFELSE([
- AC_LANG_FUNC_LINK_TRY([strcasecmp])
+ AC_LANG_FUNC_LINK_TRY([socketpair])
],[
AC_MSG_RESULT([yes])
- tst_links_strcasecmp="yes"
+ tst_links_socketpair="yes"
],[
AC_MSG_RESULT([no])
- tst_links_strcasecmp="no"
+ tst_links_socketpair="no"
])
#
- if test "$tst_links_strcasecmp" = "yes"; then
- AC_MSG_CHECKING([if strcasecmp is prototyped])
- AC_EGREP_CPP([strcasecmp],[
- $curl_includes_string
+ if test "$tst_links_socketpair" = "yes"; then
+ AC_MSG_CHECKING([if socketpair is prototyped])
+ AC_EGREP_CPP([socketpair],[
+ $curl_includes_sys_socket
+ $curl_includes_socket
],[
AC_MSG_RESULT([yes])
- tst_proto_strcasecmp="yes"
+ tst_proto_socketpair="yes"
],[
AC_MSG_RESULT([no])
- tst_proto_strcasecmp="no"
+ tst_proto_socketpair="no"
])
fi
#
- if test "$tst_proto_strcasecmp" = "yes"; then
- AC_MSG_CHECKING([if strcasecmp is compilable])
+ if test "$tst_proto_socketpair" = "yes"; then
+ AC_MSG_CHECKING([if socketpair is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
- $curl_includes_string
+ $curl_includes_sys_socket
+ $curl_includes_socket
]],[[
- if(0 != strcasecmp(0, 0))
+ int sv[2];
+ if(0 != socketpair(0, 0, 0, sv))
return 1;
]])
],[
AC_MSG_RESULT([yes])
- tst_compi_strcasecmp="yes"
+ tst_compi_socketpair="yes"
],[
AC_MSG_RESULT([no])
- tst_compi_strcasecmp="no"
+ tst_compi_socketpair="no"
])
fi
#
- if test "$tst_compi_strcasecmp" = "yes"; then
- AC_MSG_CHECKING([if strcasecmp usage allowed])
- if test "x$curl_disallow_strcasecmp" != "xyes"; then
+ if test "$tst_compi_socketpair" = "yes"; then
+ AC_MSG_CHECKING([if socketpair usage allowed])
+ if test "x$curl_disallow_socketpair" != "xyes"; then
AC_MSG_RESULT([yes])
- tst_allow_strcasecmp="yes"
+ tst_allow_socketpair="yes"
else
AC_MSG_RESULT([no])
- tst_allow_strcasecmp="no"
+ tst_allow_socketpair="no"
fi
fi
#
- AC_MSG_CHECKING([if strcasecmp might be used])
- if test "$tst_links_strcasecmp" = "yes" &&
- test "$tst_proto_strcasecmp" = "yes" &&
- test "$tst_compi_strcasecmp" = "yes" &&
- test "$tst_allow_strcasecmp" = "yes"; then
+ AC_MSG_CHECKING([if socketpair might be used])
+ if test "$tst_links_socketpair" = "yes" &&
+ test "$tst_proto_socketpair" = "yes" &&
+ test "$tst_compi_socketpair" = "yes" &&
+ test "$tst_allow_socketpair" = "yes"; then
AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
- [Define to 1 if you have the strcasecmp function.])
- ac_cv_func_strcasecmp="yes"
+ AC_DEFINE_UNQUOTED(HAVE_SOCKETPAIR, 1,
+ [Define to 1 if you have the socketpair function.])
+ ac_cv_func_socketpair="yes"
else
AC_MSG_RESULT([no])
- ac_cv_func_strcasecmp="no"
+ ac_cv_func_socketpair="no"
fi
])
-dnl CURL_CHECK_FUNC_STRCASESTR
+dnl CURL_CHECK_FUNC_STRCASECMP
dnl -------------------------------------------------
-dnl Verify if strcasestr is available, prototyped, and
+dnl Verify if strcasecmp is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
-dnl shell variable curl_disallow_strcasestr, then
-dnl HAVE_STRCASESTR will be defined.
+dnl shell variable curl_disallow_strcasecmp, then
+dnl HAVE_STRCASECMP will be defined.
-AC_DEFUN([CURL_CHECK_FUNC_STRCASESTR], [
+AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
AC_REQUIRE([CURL_INCLUDES_STRING])dnl
#
- tst_links_strcasestr="unknown"
- tst_proto_strcasestr="unknown"
- tst_compi_strcasestr="unknown"
- tst_allow_strcasestr="unknown"
+ tst_links_strcasecmp="unknown"
+ tst_proto_strcasecmp="unknown"
+ tst_compi_strcasecmp="unknown"
+ tst_allow_strcasecmp="unknown"
#
- AC_MSG_CHECKING([if strcasestr can be linked])
+ AC_MSG_CHECKING([if strcasecmp can be linked])
AC_LINK_IFELSE([
- AC_LANG_FUNC_LINK_TRY([strcasestr])
+ AC_LANG_FUNC_LINK_TRY([strcasecmp])
],[
AC_MSG_RESULT([yes])
- tst_links_strcasestr="yes"
+ tst_links_strcasecmp="yes"
],[
AC_MSG_RESULT([no])
- tst_links_strcasestr="no"
+ tst_links_strcasecmp="no"
])
#
- if test "$tst_links_strcasestr" = "yes"; then
- AC_MSG_CHECKING([if strcasestr is prototyped])
- AC_EGREP_CPP([strcasestr],[
+ if test "$tst_links_strcasecmp" = "yes"; then
+ AC_MSG_CHECKING([if strcasecmp is prototyped])
+ AC_EGREP_CPP([strcasecmp],[
$curl_includes_string
],[
AC_MSG_RESULT([yes])
- tst_proto_strcasestr="yes"
+ tst_proto_strcasecmp="yes"
],[
AC_MSG_RESULT([no])
- tst_proto_strcasestr="no"
+ tst_proto_strcasecmp="no"
])
fi
#
- if test "$tst_proto_strcasestr" = "yes"; then
- AC_MSG_CHECKING([if strcasestr is compilable])
+ if test "$tst_proto_strcasecmp" = "yes"; then
+ AC_MSG_CHECKING([if strcasecmp is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
- if(0 != strcasestr(0, 0))
+ if(0 != strcasecmp(0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
- tst_compi_strcasestr="yes"
+ tst_compi_strcasecmp="yes"
],[
AC_MSG_RESULT([no])
- tst_compi_strcasestr="no"
+ tst_compi_strcasecmp="no"
])
fi
#
- if test "$tst_compi_strcasestr" = "yes"; then
- AC_MSG_CHECKING([if strcasestr usage allowed])
- if test "x$curl_disallow_strcasestr" != "xyes"; then
+ if test "$tst_compi_strcasecmp" = "yes"; then
+ AC_MSG_CHECKING([if strcasecmp usage allowed])
+ if test "x$curl_disallow_strcasecmp" != "xyes"; then
AC_MSG_RESULT([yes])
- tst_allow_strcasestr="yes"
+ tst_allow_strcasecmp="yes"
else
AC_MSG_RESULT([no])
- tst_allow_strcasestr="no"
+ tst_allow_strcasecmp="no"
fi
fi
#
- AC_MSG_CHECKING([if strcasestr might be used])
- if test "$tst_links_strcasestr" = "yes" &&
- test "$tst_proto_strcasestr" = "yes" &&
- test "$tst_compi_strcasestr" = "yes" &&
- test "$tst_allow_strcasestr" = "yes"; then
+ AC_MSG_CHECKING([if strcasecmp might be used])
+ if test "$tst_links_strcasecmp" = "yes" &&
+ test "$tst_proto_strcasecmp" = "yes" &&
+ test "$tst_compi_strcasecmp" = "yes" &&
+ test "$tst_allow_strcasecmp" = "yes"; then
AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED(HAVE_STRCASESTR, 1,
- [Define to 1 if you have the strcasestr function.])
- ac_cv_func_strcasestr="yes"
+ AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
+ [Define to 1 if you have the strcasecmp function.])
+ ac_cv_func_strcasecmp="yes"
else
AC_MSG_RESULT([no])
- ac_cv_func_strcasestr="no"
+ ac_cv_func_strcasecmp="no"
fi
])
-
dnl CURL_CHECK_FUNC_STRCMPI
dnl -------------------------------------------------
dnl Verify if strcmpi is available, prototyped, and
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
- ]],[[
char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
+ ]],[[
if(0 != strerror_r(0, 0, 0))
return 1;
]])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_string
- ]],[[
int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
+ ]],[[
if(0 != strerror_r(0, 0, 0))
return 1;
]])
fi
])
-
-dnl CURL_CHECK_FUNC_STRLCAT
-dnl -------------------------------------------------
-dnl Verify if strlcat is available, prototyped, and
-dnl can be compiled. If all of these are true, and
-dnl usage has not been previously disallowed with
-dnl shell variable curl_disallow_strlcat, then
-dnl HAVE_STRLCAT will be defined.
-
-AC_DEFUN([CURL_CHECK_FUNC_STRLCAT], [
- AC_REQUIRE([CURL_INCLUDES_STRING])dnl
- #
- tst_links_strlcat="unknown"
- tst_proto_strlcat="unknown"
- tst_compi_strlcat="unknown"
- tst_allow_strlcat="unknown"
- #
- AC_MSG_CHECKING([if strlcat can be linked])
- AC_LINK_IFELSE([
- AC_LANG_FUNC_LINK_TRY([strlcat])
- ],[
- AC_MSG_RESULT([yes])
- tst_links_strlcat="yes"
- ],[
- AC_MSG_RESULT([no])
- tst_links_strlcat="no"
- ])
- #
- if test "$tst_links_strlcat" = "yes"; then
- AC_MSG_CHECKING([if strlcat is prototyped])
- AC_EGREP_CPP([strlcat],[
- $curl_includes_string
- ],[
- AC_MSG_RESULT([yes])
- tst_proto_strlcat="yes"
- ],[
- AC_MSG_RESULT([no])
- tst_proto_strlcat="no"
- ])
- fi
- #
- if test "$tst_proto_strlcat" = "yes"; then
- AC_MSG_CHECKING([if strlcat is compilable])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
- $curl_includes_string
- ]],[[
- if(0 != strlcat(0, 0, 0))
- return 1;
- ]])
- ],[
- AC_MSG_RESULT([yes])
- tst_compi_strlcat="yes"
- ],[
- AC_MSG_RESULT([no])
- tst_compi_strlcat="no"
- ])
- fi
- #
- if test "$tst_compi_strlcat" = "yes"; then
- AC_MSG_CHECKING([if strlcat usage allowed])
- if test "x$curl_disallow_strlcat" != "xyes"; then
- AC_MSG_RESULT([yes])
- tst_allow_strlcat="yes"
- else
- AC_MSG_RESULT([no])
- tst_allow_strlcat="no"
- fi
- fi
- #
- AC_MSG_CHECKING([if strlcat might be used])
- if test "$tst_links_strlcat" = "yes" &&
- test "$tst_proto_strlcat" = "yes" &&
- test "$tst_compi_strlcat" = "yes" &&
- test "$tst_allow_strlcat" = "yes"; then
- AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED(HAVE_STRLCAT, 1,
- [Define to 1 if you have the strlcat function.])
- ac_cv_func_strlcat="yes"
- else
- AC_MSG_RESULT([no])
- ac_cv_func_strlcat="no"
- fi
-])
-
-
dnl CURL_CHECK_FUNC_STRNCASECMP
dnl -------------------------------------------------
dnl Verify if strncasecmp is available, prototyped, and