From 37eba37019388f767f5de67b4071641044d7b026 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 17 Jun 2009 12:51:24 +0000 Subject: socket() and closesocket() prototypes might be in socket.h --- configure.ac | 1 + m4/curl-functions.m4 | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 46431100c..3dfd087ac 100644 --- a/configure.ac +++ b/configure.ac @@ -1889,6 +1889,7 @@ AC_CHECK_HEADERS( sys/utime.h \ sys/poll.h \ poll.h \ + socket.h \ sys/resource.h \ libgen.h \ locale.h \ 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 +#endif +#ifdef HAVE_SOCKET_H +# include +#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; -- cgit v1.2.3