Loading acinclude.m4 +81 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [ AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> ],[ Loading Loading @@ -35,6 +36,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [ AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock.h> Loading Loading @@ -63,6 +65,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [ AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock2.h> Loading Loading @@ -91,6 +94,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [ AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock2.h> Loading @@ -111,6 +115,83 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [ ]) dnl CURL_CHECK_TYPE_SOCKLEN_T dnl ------------------------------------------------- dnl Checks for existing socklen_t type, and provides dnl an equivalent type if socklen_t is not available dnl This function is experimental and shall not be dnl used while this notice is in place -------------- AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [ AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl AC_CHECK_TYPE([socklen_t], ,[ AC_CACHE_CHECK([for socklen_t equivalent bis], [curl_cv_socklen_t_equiv_bis], [ curl_cv_socklen_t_equiv_bis= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #ifdef HAVE_WINDOWS_H #define WIN32_LEAN_AND_MEAN #include <windows.h> #ifdef HAVE_WINSOCK2_H #include <winsock2.h> #else #ifdef HAVE_WINSOCK_H #include <winsock.h> #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #endif int getpeername (int, $arg2 *, $t *); int getsockname (int, $arg2 *, $t *); int bind (int, $arg2 *, $t *); int accept (int, $arg2 *, $t *); ],[ $t len; getpeername(0,0,&len); getsockname(0,0,&len); bind(0,0,&len); accept(0,0,&len); ]) ],[ curl_cv_socklen_t_equiv_bis="$t" break 2 ]) done done ]) if test "x$curl_cv_socklen_t_equiv_bis" = "x"; then AC_MSG_ERROR([Cannot find a type to use in place of socklen_t bis]) else AC_DEFINE_UNQUOTED(socklen_t_bis, $curl_cv_socklen_t_equiv_bis, [type to use in place of socklen_t if not defined]) fi ],[ #ifdef HAVE_WINDOWS_H #ifdef HAVE_WS2TCPIP_H #include <ws2tcpip.h> #endif #else #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #endif ]) ]) dnl Check for how to set a socket to non-blocking state. There seems to exist dnl four known different ways, with the one used almost everywhere being POSIX dnl and XPG3, while the other different ways for different systems (old BSD, Loading configure.ac +15 −18 Original line number Diff line number Diff line Loading @@ -289,23 +289,6 @@ AC_HELP_STRING([--disable-manual],[Disable built-in manual]), dnl The actual use of the USE_MANUAL variable is done much later in this dnl script to allow other actions to disable it as well. dnl ********************************************************************** dnl Make sure that our checks for headers windows.h winsock.h winsock2.h dnl and ws2tcpip.h take precedence over any other further check done later. dnl ********************************************************************** dnl Do we have a compilable and valid windows.h header ? CURL_CHECK_HEADER_WINDOWS dnl Do we have a compilable and valid winsock.h header ? CURL_CHECK_HEADER_WINSOCK dnl Do we have a compilable and valid winsock2.h header ? CURL_CHECK_HEADER_WINSOCK2 dnl Do we have a compilable and valid ws2tcpip.h header ? CURL_CHECK_HEADER_WS2TCPIP dnl ********************************************************************** dnl Checks for libraries. dnl ********************************************************************** Loading Loading @@ -1411,7 +1394,18 @@ dnl ********************************************************************** dnl Checks for header files. AC_HEADER_STDC dnl First check for the very most basic headers. Then we can use these dnl ********************************************************************** dnl Make sure that our checks for headers windows.h winsock.h winsock2.h dnl and ws2tcpip.h take precedence over any other further check which dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS. dnl ********************************************************************** CURL_CHECK_HEADER_WINDOWS CURL_CHECK_HEADER_WINSOCK CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WS2TCPIP dnl Now check for the very most basic headers. Then we can use these dnl ones as default-headers when checking for the rest! AC_CHECK_HEADERS( sys/types.h \ Loading Loading @@ -1509,6 +1503,9 @@ fi AC_CHECK_TYPE(ssize_t, , AC_DEFINE(ssize_t, int, [the signed version of size_t])) # Experimental check CURL_CHECK_TYPE_SOCKLEN_T TYPE_SOCKLEN_T TYPE_IN_ADDR_T Loading Loading
acinclude.m4 +81 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [ AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> ],[ Loading Loading @@ -35,6 +36,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [ AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock.h> Loading Loading @@ -63,6 +65,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [ AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock2.h> Loading Loading @@ -91,6 +94,7 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [ AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock2.h> Loading @@ -111,6 +115,83 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [ ]) dnl CURL_CHECK_TYPE_SOCKLEN_T dnl ------------------------------------------------- dnl Checks for existing socklen_t type, and provides dnl an equivalent type if socklen_t is not available dnl This function is experimental and shall not be dnl used while this notice is in place -------------- AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [ AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl AC_CHECK_TYPE([socklen_t], ,[ AC_CACHE_CHECK([for socklen_t equivalent bis], [curl_cv_socklen_t_equiv_bis], [ curl_cv_socklen_t_equiv_bis= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #undef inline #ifdef HAVE_WINDOWS_H #define WIN32_LEAN_AND_MEAN #include <windows.h> #ifdef HAVE_WINSOCK2_H #include <winsock2.h> #else #ifdef HAVE_WINSOCK_H #include <winsock.h> #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #endif int getpeername (int, $arg2 *, $t *); int getsockname (int, $arg2 *, $t *); int bind (int, $arg2 *, $t *); int accept (int, $arg2 *, $t *); ],[ $t len; getpeername(0,0,&len); getsockname(0,0,&len); bind(0,0,&len); accept(0,0,&len); ]) ],[ curl_cv_socklen_t_equiv_bis="$t" break 2 ]) done done ]) if test "x$curl_cv_socklen_t_equiv_bis" = "x"; then AC_MSG_ERROR([Cannot find a type to use in place of socklen_t bis]) else AC_DEFINE_UNQUOTED(socklen_t_bis, $curl_cv_socklen_t_equiv_bis, [type to use in place of socklen_t if not defined]) fi ],[ #ifdef HAVE_WINDOWS_H #ifdef HAVE_WS2TCPIP_H #include <ws2tcpip.h> #endif #else #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #endif ]) ]) dnl Check for how to set a socket to non-blocking state. There seems to exist dnl four known different ways, with the one used almost everywhere being POSIX dnl and XPG3, while the other different ways for different systems (old BSD, Loading
configure.ac +15 −18 Original line number Diff line number Diff line Loading @@ -289,23 +289,6 @@ AC_HELP_STRING([--disable-manual],[Disable built-in manual]), dnl The actual use of the USE_MANUAL variable is done much later in this dnl script to allow other actions to disable it as well. dnl ********************************************************************** dnl Make sure that our checks for headers windows.h winsock.h winsock2.h dnl and ws2tcpip.h take precedence over any other further check done later. dnl ********************************************************************** dnl Do we have a compilable and valid windows.h header ? CURL_CHECK_HEADER_WINDOWS dnl Do we have a compilable and valid winsock.h header ? CURL_CHECK_HEADER_WINSOCK dnl Do we have a compilable and valid winsock2.h header ? CURL_CHECK_HEADER_WINSOCK2 dnl Do we have a compilable and valid ws2tcpip.h header ? CURL_CHECK_HEADER_WS2TCPIP dnl ********************************************************************** dnl Checks for libraries. dnl ********************************************************************** Loading Loading @@ -1411,7 +1394,18 @@ dnl ********************************************************************** dnl Checks for header files. AC_HEADER_STDC dnl First check for the very most basic headers. Then we can use these dnl ********************************************************************** dnl Make sure that our checks for headers windows.h winsock.h winsock2.h dnl and ws2tcpip.h take precedence over any other further check which dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS. dnl ********************************************************************** CURL_CHECK_HEADER_WINDOWS CURL_CHECK_HEADER_WINSOCK CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WS2TCPIP dnl Now check for the very most basic headers. Then we can use these dnl ones as default-headers when checking for the rest! AC_CHECK_HEADERS( sys/types.h \ Loading Loading @@ -1509,6 +1503,9 @@ fi AC_CHECK_TYPE(ssize_t, , AC_DEFINE(ssize_t, int, [the signed version of size_t])) # Experimental check CURL_CHECK_TYPE_SOCKLEN_T TYPE_SOCKLEN_T TYPE_IN_ADDR_T Loading