diff options
author | Yang Tse <yangsita@gmail.com> | 2009-06-18 12:36:10 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-06-18 12:36:10 +0000 |
commit | 0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17 (patch) | |
tree | 97823cc0ac502e1d3d95648f24b252ac1a759d72 | |
parent | d96073913339cb935c5e2f767188b6747ce4387b (diff) | |
download | c-ares-0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17.tar.gz c-ares-0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17.tar.bz2 c-ares-0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17.zip |
add CloseSocket camel case function check
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | m4/cares-functions.m4 | 92 |
2 files changed, 92 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index d4bd4d2..eda89eb 100644 --- a/configure.ac +++ b/configure.ac @@ -536,6 +536,7 @@ CURL_CHECK_FUNC_SEND CURL_CHECK_MSG_NOSIGNAL CARES_CHECK_FUNC_CLOSESOCKET +CARES_CHECK_FUNC_CLOSESOCKET_CAMEL CARES_CHECK_FUNC_FCNTL CARES_CHECK_FUNC_FREEADDRINFO CARES_CHECK_FUNC_GETADDRINFO diff --git a/m4/cares-functions.m4 b/m4/cares-functions.m4 index 40545d9..1da3f5a 100644 --- a/m4/cares-functions.m4 +++ b/m4/cares-functions.m4 @@ -16,7 +16,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 30 +# serial 31 dnl CARES_INCLUDES_ARPA_INET @@ -434,6 +434,96 @@ AC_DEFUN([CARES_CHECK_FUNC_CLOSESOCKET], [ ]) +dnl CARES_CHECK_FUNC_CLOSESOCKET_CAMEL +dnl ------------------------------------------------- +dnl Verify if CloseSocket 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 cares_disallow_closesocket_camel, +dnl then HAVE_CLOSESOCKET_CAMEL will be defined. + +AC_DEFUN([CARES_CHECK_FUNC_CLOSESOCKET_CAMEL], [ + AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl + # + tst_links_closesocket_camel="unknown" + tst_proto_closesocket_camel="unknown" + tst_compi_closesocket_camel="unknown" + tst_allow_closesocket_camel="unknown" + # + AC_MSG_CHECKING([if CloseSocket can be linked]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + $cares_includes_sys_socket + ]],[[ + if(0 != CloseSocket(0)) + return 1; + ]]) + ],[ + AC_MSG_RESULT([yes]) + tst_links_closesocket_camel="yes" + ],[ + AC_MSG_RESULT([no]) + tst_links_closesocket_camel="no" + ]) + # + if test "$tst_links_closesocket_camel" = "yes"; then + AC_MSG_CHECKING([if CloseSocket is prototyped]) + AC_EGREP_CPP([CloseSocket],[ + $cares_includes_sys_socket + ],[ + AC_MSG_RESULT([yes]) + tst_proto_closesocket_camel="yes" + ],[ + AC_MSG_RESULT([no]) + tst_proto_closesocket_camel="no" + ]) + fi + # + if test "$tst_proto_closesocket_camel" = "yes"; then + AC_MSG_CHECKING([if CloseSocket is compilable]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + $cares_includes_sys_socket + ]],[[ + if(0 != CloseSocket(0)) + return 1; + ]]) + ],[ + AC_MSG_RESULT([yes]) + tst_compi_closesocket_camel="yes" + ],[ + AC_MSG_RESULT([no]) + tst_compi_closesocket_camel="no" + ]) + fi + # + if test "$tst_compi_closesocket_camel" = "yes"; then + AC_MSG_CHECKING([if CloseSocket usage allowed]) + if test "x$cares_disallow_closesocket_camel" != "xyes"; then + AC_MSG_RESULT([yes]) + tst_allow_closesocket_camel="yes" + else + AC_MSG_RESULT([no]) + tst_allow_closesocket_camel="no" + fi + fi + # + AC_MSG_CHECKING([if CloseSocket might be used]) + if test "$tst_links_closesocket_camel" = "yes" && + test "$tst_proto_closesocket_camel" = "yes" && + test "$tst_compi_closesocket_camel" = "yes" && + test "$tst_allow_closesocket_camel" = "yes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1, + [Define to 1 if you have the CloseSocket camel case function.]) + ac_cv_func_closesocket_camel="yes" + else + AC_MSG_RESULT([no]) + ac_cv_func_closesocket_camel="no" + fi +]) + + dnl CARES_CHECK_FUNC_FCNTL dnl ------------------------------------------------- dnl Verify if fcntl is available, prototyped, and |