From 74ed5b5ebd0265af4a1605aa15d03f0188a52338 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 19 Dec 2005 21:38:10 +0000 Subject: Adjust more windows header includes --- ares/configure.ac | 208 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 163 insertions(+), 45 deletions(-) (limited to 'ares/configure.ac') diff --git a/ares/configure.ac b/ares/configure.ac index fe21513a5..094294253 100644 --- a/ares/configure.ac +++ b/ares/configure.ac @@ -1,3 +1,4 @@ + dnl Process this file with autoconf to produce a configure script. AC_INIT(ares_init.c) AM_CONFIG_HEADER(config.h) @@ -13,13 +14,15 @@ solaris*) ;; esac -# check for ssize_t -AC_CHECK_TYPE(ssize_t, , - AC_DEFINE(ssize_t, int, [the signed version of size_t])) - AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(socket, socket) +dnl check for cygwin stuff +AC_LIBTOOL_WIN32_DLL + +dnl libtool setup +AC_PROG_LIBTOOL + dnl ************************************************************ dnl Option to switch on debug options. This makes an assumption that dnl this is built as an 'ares' subdir in the curl source tree. Subject for @@ -38,9 +41,6 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]), dnl when doing the debug stuff, use static library only AC_DISABLE_SHARED - dnl Checks for standard header files, to make memdebug.h inclusions bettter - AC_HEADER_STDC - dnl the entire --enable-debug is a hack that lives and runs on top of dnl libcurl stuff so this BUILDING_LIBCURL is not THAT much uglier AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl]) @@ -57,7 +57,8 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]), AC_MSG_RESULT(no) ) -AC_PROG_LIBTOOL +dnl Checks for header files. +AC_HEADER_STDC dnl ********************************************************************** dnl Make sure that our checks for headers windows.h winsock.h winsock2.h @@ -83,11 +84,19 @@ AC_CHECK_HEADERS( net/if.h \ arpa/nameser.h \ arpa/nameser_compat.h \ - arpa/inet.h, , , + arpa/inet.h, +dnl to do if not found +[], +dnl to do if found +[], +dnl default includes [ #ifdef HAVE_SYS_TYPES_H #include #endif +#ifdef HAVE_SYS_TIME_H +#include +#endif dnl We do this default-include simply to make sure that the nameser_compat.h dnl header *REALLY* can be include after the new nameser.h. It seems AIX 5.1 dnl (and others?) is not designed to allow this. @@ -99,28 +108,72 @@ dnl *Sigh* these are needed in order for net/if.h to get properly detected. #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK2_H -#include +#ifdef HAVE_NETINET_IN_H +#include #endif ] +) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_HEADER_TIME + +AC_CHECK_SIZEOF(curl_off_t, ,[ +#include +#include "$srcdir/include/curl/curl.h" +]) +AC_CHECK_SIZEOF(size_t) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(time_t) + +AC_CHECK_TYPE(long long, + [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])] + longlong="yes" +) + +if test "xyes" = "x$longlong"; then + AC_MSG_CHECKING([if numberLL works]) + AC_COMPILE_IFELSE([long long val = 1000LL;], + [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])] + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) ) +fi + + +# check for ssize_t +AC_CHECK_TYPE(ssize_t, , + AC_DEFINE(ssize_t, int, [the signed version of size_t])) # Check for socklen_t or equivalent CURL_CHECK_TYPE_SOCKLEN_T +TYPE_IN_ADDR_T + +TYPE_SOCKADDR_STORAGE + + dnl check for AF_INET6 CARES_CHECK_CONSTANT( [ +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#ifdef HAVE_WINSOCK2_H +#include +#endif +#else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK2_H -#include #endif - ], [PF_INET6], AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.]) ) @@ -128,16 +181,23 @@ CARES_CHECK_CONSTANT( dnl check for PF_INET6 CARES_CHECK_CONSTANT( [ +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#ifdef HAVE_WINSOCK2_H +#include +#endif +#else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK2_H -#include #endif - ], [AF_INET6], AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.]) ) @@ -146,17 +206,25 @@ CARES_CHECK_CONSTANT( dnl check for the in6_addr structure CARES_CHECK_STRUCT( [ -#ifdef HAVE_SYS_TYPES_H -#include +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #endif +#include #ifdef HAVE_WINSOCK2_H #include -#endif #ifdef HAVE_WS2TCPIP_H #include #endif +#endif +#else +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef HAVE_NETINET_IN_H #include +#endif #endif ], [in6_addr], AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.]) @@ -165,17 +233,25 @@ CARES_CHECK_STRUCT( dnl check for the sockaddr_in6 structure CARES_CHECK_STRUCT( [ -#ifdef HAVE_SYS_TYPES_H -#include +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #endif +#include #ifdef HAVE_WINSOCK2_H #include -#endif #ifdef HAVE_WS2TCPIP_H #include #endif +#endif +#else +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef HAVE_NETINET_IN_H #include +#endif #endif ], [sockaddr_in6], AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1, @@ -187,17 +263,25 @@ AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id, [Define to 1 if your struct sockaddr_in6 has sin6_scope_id.]) , , [ -#ifdef HAVE_SYS_TYPES_H -#include +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #endif +#include #ifdef HAVE_WINSOCK2_H #include -#endif #ifdef HAVE_WS2TCPIP_H #include #endif +#endif +#else +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef HAVE_NETINET_IN_H #include +#endif #endif ]) @@ -206,15 +290,22 @@ AC_CHECK_MEMBER(struct addrinfo.ai_flags, AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1, [Define to 1 if you have struct addrinfo.]),, [ -#ifdef HAVE_SYS_TYPES_H -#include +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #endif -#ifdef HAVE_WINSOCaK2_H +#include +#ifdef HAVE_WINSOCK2_H #include -#endif #ifdef HAVE_WS2TCPIP_H #include #endif +#endif +#else +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -223,6 +314,7 @@ AC_CHECK_MEMBER(struct addrinfo.ai_flags, #endif #ifdef HAVE_NETDB_H #include +#endif #endif ] ) @@ -254,14 +346,26 @@ if test "$ac_cv_func_getnameinfo" = "no"; then AC_TRY_LINK([ #undef inline #ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include +#ifdef HAVE_WINSOCK2_H #include +#ifdef HAVE_WS2TCPIP_H #include +#endif +#endif #else +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETDB_H #include +#endif #endif ],[ getnameinfo(0, 0, 0, 0, 0, 0, 0); @@ -289,9 +393,6 @@ AC_TRY_RUN( #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -321,9 +422,6 @@ AC_TRY_RUN( #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -355,9 +453,6 @@ AC_TRY_RUN( #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -379,34 +474,57 @@ fi AC_CHECK_SIZEOF(struct in6_addr, , [ +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#ifdef HAVE_WINSOCK2_H +#include +#ifdef HAVE_WS2TCPIP_H +#include +#endif +#endif +#else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif +#endif ] ) + AC_CHECK_SIZEOF(struct in_addr, , [ +#undef inline +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#ifdef HAVE_WINSOCK2_H +#include +#ifdef HAVE_WS2TCPIP_H +#include +#endif +#endif +#else #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif -#ifdef HAVE_WINSOCK_H -#include -#endif #ifdef HAVE_NETINET_IN_H #include #endif +#endif ] ) -- cgit v1.2.3