diff options
author | Yang Tse <yangsita@gmail.com> | 2009-06-17 12:51:24 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-06-17 12:51:24 +0000 |
commit | 37eba37019388f767f5de67b4071641044d7b026 (patch) | |
tree | d7d351073d448a931c29fae4234fe1d5b4e1a4df /m4 | |
parent | 40b2f2553b15512278d4151e985d4fa885104501 (diff) |
socket() and closesocket() prototypes might be in socket.h
Diffstat (limited to 'm4')
-rw-r--r-- | m4/curl-functions.m4 | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index c2f446a83..891493a0a 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 48 +# serial 49 dnl CURL_INCLUDES_ARPA_INET @@ -214,6 +214,27 @@ curl_includes_signal="\ ]) +dnl CURL_INCLUDES_SOCKET +dnl ------------------------------------------------- +dnl Set up variable with list of headers that must be +dnl included when socket.h is to be included. + +AC_DEFUN([CURL_INCLUDES_SOCKET], [ +curl_includes_socket="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SOCKET_H +# include <socket.h> +#endif +/* includes end */" + AC_CHECK_HEADERS( + sys/types.h socket.h, + [], [], [$curl_includes_socket]) +]) + + dnl CURL_INCLUDES_STDIO dnl ------------------------------------------------- dnl Set up variable with list of headers that must be @@ -587,6 +608,7 @@ dnl HAVE_CLOSESOCKET will be defined. AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl + AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_closesocket="unknown" tst_proto_closesocket="unknown" @@ -597,6 +619,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 + $curl_includes_socket ]],[[ if(0 != closesocket(0)) return 1; @@ -613,6 +636,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_MSG_CHECKING([if closesocket is prototyped]) AC_EGREP_CPP([closesocket],[ $curl_includes_winsock2 + $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_closesocket="yes" @@ -627,6 +651,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ $curl_includes_winsock2 + $curl_includes_socket ]],[[ if(0 != closesocket(0)) return 1; @@ -3931,6 +3956,7 @@ dnl HAVE_SOCKET will be defined. AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl + AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl # tst_links_socket="unknown" tst_proto_socket="unknown" @@ -3942,6 +3968,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket + $curl_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; @@ -3959,6 +3986,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ AC_EGREP_CPP([socket],[ $curl_includes_winsock2 $curl_includes_sys_socket + $curl_includes_socket ],[ AC_MSG_RESULT([yes]) tst_proto_socket="yes" @@ -3974,6 +4002,7 @@ AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [ AC_LANG_PROGRAM([[ $curl_includes_winsock2 $curl_includes_sys_socket + $curl_includes_socket ]],[[ if(0 != socket(0, 0, 0)) return 1; |