3 dnl Version not hardcoded here. Fetched later from ares_version.h
5 [c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares])
7 AC_CONFIG_SRCDIR([ares_ipv6.h])
8 AM_CONFIG_HEADER([config.h])
11 dnl SED is mandatory for configure process and libtool.
12 dnl Set it now, allowing it to be changed later.
13 AC_PATH_PROG([SED], [sed], [not_found],
14 [$PATH:/usr/bin:/usr/local/bin])
15 if test -z "$SED" || test "$SED" = "not_found"; then
16 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
20 dnl GREP is mandatory for configure process and libtool.
21 dnl Set it now, allowing it to be changed later.
22 AC_PATH_PROG([GREP], [grep], [not_found],
23 [$PATH:/usr/bin:/usr/local/bin])
24 if test -z "$GREP" || test "$GREP" = "not_found"; then
25 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
29 dnl EGREP is mandatory for configure process and libtool.
30 dnl Set it now, allowing it to be changed later.
31 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
32 AC_MSG_CHECKING([for egrep])
34 AC_MSG_RESULT([$EGREP])
36 AC_PATH_PROG([EGREP], [egrep], [not_found],
37 [$PATH:/usr/bin:/usr/local/bin])
39 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
40 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
44 dnl AR is mandatory for configure process and libtool.
45 dnl This is target dependant, so check it as a tool.
46 AC_PATH_TOOL([AR], [ar], [not_found],
47 [$PATH:/usr/bin:/usr/local/bin])
48 if test -z "$AR" || test "$AR" = "not_found"; then
49 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
53 dnl Fetch c-ares version from ares_version.h
54 VERSION=`$SED -ne 's/^#define ARES_VERSION_STR "\(.*\)"/\1/p' ${srcdir}/ares_version.h`
55 AM_INIT_AUTOMAKE([c-ares], [$VERSION])
56 AC_MSG_CHECKING([c-ares version])
57 AC_MSG_RESULT([$VERSION])
60 dnl Detect the canonical host and target build environment
64 dnl Get system canonical name
65 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
71 dnl This defines _ALL_SOURCE for AIX
72 CARES_CHECK_AIX_ALL_SOURCE
74 dnl Our configure and build reentrant settings
75 CARES_CONFIGURE_REENTRANT
77 dnl check for how to do large files
82 AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
86 dnl support building of Windows DLLs
89 dnl ************************************************************
90 dnl Option to switch on debug options. This makes an assumption that
91 dnl this is built as an 'ares' subdir in the curl source tree. Subject for
92 dnl improval in the future!
94 AC_MSG_CHECKING([whether to enable debug options])
96 AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
97 AC_HELP_STRING([--disable-debug],[Disable debug options]),
98 [ case "$enableval" in
102 *) AC_MSG_RESULT(yes)
104 dnl when doing the debug stuff, use static library only
109 dnl the entire --enable-debug is a hack that lives and runs on top of
110 dnl libcurl stuff so this BUILDING_LIBCURL is not THAT much uglier
111 AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
113 CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I$srcdir/../include"
116 dnl set compiler "debug" options to become more picky, and remove
117 dnl optimize options from CFLAGS
124 AM_CONDITIONAL(DEBUGBUILD, test x$debugbuild = xyes)
125 AM_CONDITIONAL(CURLDEBUG, test x$debugbuild = xyes)
127 dnl skip libtool C++ and Fortran compiler checks
128 m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
129 m4_defun([AC_PROG_CXX],[])
130 m4_ifdef([AC_PROG_CXXCPP], [m4_undefine([AC_PROG_CXXCPP])])
131 m4_defun([AC_PROG_CXXCPP],[true])
132 m4_ifdef([AC_PROG_F77], [m4_undefine([AC_PROG_F77])])
133 m4_defun([AC_PROG_F77],[])
135 dnl skip libtool C++ and Fortran linker checks
136 m4_ifdef([AC_LIBTOOL_CXX], [m4_undefine([AC_LIBTOOL_CXX])])
137 m4_defun([AC_LIBTOOL_CXX],[])
138 m4_ifdef([AC_LIBTOOL_CXXCPP], [m4_undefine([AC_LIBTOOL_CXXCPP])])
139 m4_defun([AC_LIBTOOL_CXXCPP],[true])
140 m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
141 m4_defun([AC_LIBTOOL_F77],[])
143 dnl force libtool to build static libraries with PIC on AMD64-linux
144 AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
158 AC_MSG_CHECKING([if we need -no-undefined])
160 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
161 need_no_undefined=yes
167 AC_MSG_RESULT($need_no_undefined)
168 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
170 dnl **********************************************************************
171 dnl check if this is the Intel ICC compiler, and if so make it stricter
172 dnl (convert warning 147 into an error) so that it properly can detect the
173 dnl gethostbyname_r() version
174 dnl **********************************************************************
175 CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
177 dnl **********************************************************************
178 dnl platform/compiler/architecture specific checks/flags
179 dnl **********************************************************************
185 dnl find out if icc is being used
186 if test "z$ICC" = "z"; then
190 if test "$ICC" = "yes"; then
191 dnl figure out icc version
192 AC_MSG_CHECKING([icc version])
193 iccver=`$CC -dumpversion`
194 iccnhi=`echo $iccver | cut -d . -f1`
195 iccnlo=`echo $iccver | cut -d . -f2`
196 iccnum=`(expr $iccnhi "*" 100 + $iccnlo) 2>/dev/null`
197 AC_MSG_RESULT($iccver)
199 if test "$iccnum" -ge "900" && test "$iccnum" -lt "1000"; then
201 CFLAGS="$CFLAGS -i-dynamic"
204 if test "$iccnum" -ge "1000"; then
205 dnl icc 10.X or later
206 CFLAGS="$CFLAGS -shared-intel"
214 AC_MSG_CHECKING([whether we are using the IBM C compiler])
215 CURL_CHECK_DEF([__IBMC__], [], [silent])
216 if test "$curl_cv_have_def___IBMC__" = "yes"; then
218 dnl Ensure that compiler optimizations are always thread-safe.
219 CFLAGS="$CFLAGS -qthreaded"
220 dnl Disable type based strict aliasing optimizations, using worst
221 dnl case aliasing assumptions when compiling. Type based aliasing
222 dnl would restrict the lvalues that could be safely used to access
224 CFLAGS="$CFLAGS -qnoansialias"
225 dnl Force compiler to stop after the compilation phase, without
226 dnl generating an object code file when compilation has errors.
227 CFLAGS="$CFLAGS -qhalt=e"
232 AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
233 CURL_CHECK_DEF([__DECC], [], [silent])
234 CURL_CHECK_DEF([__DECC_VER], [], [silent])
235 if test "$curl_cv_have_def___DECC" = "yes" &&
236 test "$curl_cv_have_def___DECC_VER" = "yes"; then
238 dnl Select strict ANSI C compiler mode
239 CFLAGS="$CFLAGS -std1"
240 dnl Turn off optimizer ANSI C aliasing rules
241 CFLAGS="$CFLAGS -noansi_alias"
242 dnl Select a higher warning level than default level2
243 CFLAGS="$CFLAGS -msg_enable level3"
244 dnl Generate warnings for missing function prototypes
245 CFLAGS="$CFLAGS -warnprotos"
246 dnl Change some warnings into fatal errors
247 CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs"
252 CURL_CHECK_COMPILER_HALT_ON_ERROR
253 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
255 dnl **********************************************************************
256 dnl Compilation based checks should not be done before this point.
257 dnl **********************************************************************
259 dnl **********************************************************************
260 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
261 dnl and ws2tcpip.h take precedence over any other further checks which
262 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
263 dnl this specific header files. And do them before its results are used.
264 dnl **********************************************************************
266 CURL_CHECK_HEADER_WINDOWS
267 CURL_CHECK_NATIVE_WINDOWS
268 case X-"$ac_cv_native_windows" in
270 CURL_CHECK_HEADER_WINSOCK
271 CURL_CHECK_HEADER_WINSOCK2
272 CURL_CHECK_HEADER_WS2TCPIP
275 ac_cv_header_winsock_h="no"
276 ac_cv_header_winsock2_h="no"
277 ac_cv_header_ws2tcpip_h="no"
281 dnl **********************************************************************
282 dnl Checks for libraries.
283 dnl **********************************************************************
285 dnl gethostbyname without lib or in the nsl lib?
286 AC_CHECK_FUNC(gethostbyname,
287 [HAVE_GETHOSTBYNAME="1"
289 [ AC_CHECK_LIB(nsl, gethostbyname,
290 [HAVE_GETHOSTBYNAME="1"
295 if test "$HAVE_GETHOSTBYNAME" != "1"
297 dnl gethostbyname in the socket lib?
298 AC_CHECK_LIB(socket, gethostbyname,
299 [HAVE_GETHOSTBYNAME="1"
300 LIBS="$LIBS -lsocket"
304 dnl At least one system has been identified to require BOTH nsl and socket
305 dnl libs at the same time to link properly.
306 if test "$HAVE_GETHOSTBYNAME" != "1"
308 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
309 my_ac_save_LIBS=$LIBS
310 LIBS="-lnsl -lsocket $LIBS"
318 HAVE_GETHOSTBYNAME="1"
321 LIBS=$my_ac_save_LIBS
325 if test "$HAVE_GETHOSTBYNAME" != "1"
327 dnl This is for winsock systems
328 if test "$ac_cv_header_windows_h" = "yes"; then
329 if test "$ac_cv_header_winsock_h" = "yes"; then
332 winsock_LIB="-lwinsock"
335 winsock_LIB="-lwsock32"
339 if test "$ac_cv_header_winsock2_h" = "yes"; then
340 winsock_LIB="-lws2_32"
342 if test ! -z "$winsock_LIB"; then
343 my_ac_save_LIBS=$LIBS
344 LIBS="$winsock_LIB $LIBS"
345 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
348 #ifdef HAVE_WINDOWS_H
349 #ifndef WIN32_LEAN_AND_MEAN
350 #define WIN32_LEAN_AND_MEAN
353 #ifdef HAVE_WINSOCK2_H
354 #include <winsock2.h>
356 #ifdef HAVE_WINSOCK_H
362 gethostbyname("www.dummysite.com");
366 HAVE_GETHOSTBYNAME="1"
370 LIBS=$my_ac_save_LIBS
376 if test "$HAVE_GETHOSTBYNAME" != "1"
378 dnl This is for Minix 3.1
379 AC_MSG_CHECKING([for gethostbyname for Minix 3])
382 /* Older Minix versions may need <net/gen/netdb.h> here instead */
385 gethostbyname("www.dummysite.com");
389 HAVE_GETHOSTBYNAME="1"
395 if test "$HAVE_GETHOSTBYNAME" != "1"
397 dnl This is for eCos with a stubbed DNS implementation
398 AC_MSG_CHECKING([for gethostbyname for eCos])
404 gethostbyname("www.dummysite.com");
408 HAVE_GETHOSTBYNAME="1"
414 if test "$HAVE_GETHOSTBYNAME" != "1"
416 dnl gethostbyname in the net lib - for BeOS
417 AC_CHECK_LIB(net, gethostbyname,
418 [HAVE_GETHOSTBYNAME="1"
424 if test "$HAVE_GETHOSTBYNAME" = "1"; then
425 AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
427 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
431 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
433 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
434 AC_CHECK_LIB(resolve, strcasecmp,
435 [LIBS="-lresolve $LIBS"],
441 AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
443 dnl **********************************************************************
444 dnl In case that function clock_gettime with monotonic timer is available,
445 dnl check for additional required libraries.
446 dnl **********************************************************************
447 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
449 AC_MSG_CHECKING([whether to use libgcc])
450 AC_ARG_ENABLE(libgcc,
451 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
452 [ case "$enableval" in
464 dnl Default is to try the thread-safe versions of a few functions
467 dnl detect AIX 4.3 or later
468 AC_MSG_CHECKING([AIX 4.3 or later])
470 #if defined(_AIX) && defined(_AIX43)
473 #error "this is not AIX 4.3 or later"
476 [ AC_MSG_RESULT([yes])
479 [ AC_MSG_RESULT([no]) ]
482 AC_ARG_ENABLE(thread,dnl
483 AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
484 AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
485 [ case "$enableval" in
488 AC_MSG_WARN(c-ares will not get built using thread-safe functions)
496 if test X"$OPT_THREAD" = Xoff
498 AC_DEFINE(DISABLED_THREADSAFE, 1,
499 [Set to explicitly specify we don't want to use thread-safe functions])
502 dnl for recent AIX versions, we skip all the thread-safe checks above since
503 dnl they claim a thread-safe libc using the standard API. But there are
504 dnl some functions still not thread-safe. Check for these!
506 dnl Let's hope this split URL remains working:
507 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
508 dnl genprogc/thread_quick_ref.htm
510 if test "x$RECENTAIX" = "xyes"; then
512 AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
517 dnl **********************************************************************
518 dnl Back to "normal" configuring
519 dnl **********************************************************************
521 dnl Checks for header files.
524 CURL_CHECK_HEADER_MALLOC
526 dnl check for a few basic system headers we need
543 arpa/nameser_compat.h \
545 dnl to do if not found
551 #ifdef HAVE_SYS_TYPES_H
552 #include <sys/types.h>
554 #ifdef HAVE_SYS_TIME_H
555 #include <sys/time.h>
557 dnl We do this default-include simply to make sure that the nameser_compat.h
558 dnl header *REALLY* can be include after the new nameser.h. It seems AIX 5.1
559 dnl (and others?) is not designed to allow this.
560 #ifdef HAVE_ARPA_NAMESER_H
561 #include <arpa/nameser.h>
564 dnl *Sigh* these are needed in order for net/if.h to get properly detected.
565 #ifdef HAVE_SYS_SOCKET_H
566 #include <sys/socket.h>
568 #ifdef HAVE_NETINET_IN_H
569 #include <netinet/in.h>
574 dnl Checks for typedefs, structures, and compiler characteristics.
578 CURL_CHECK_STRUCT_TIMEVAL
580 AC_CHECK_SIZEOF(size_t)
581 AC_CHECK_SIZEOF(long)
582 AC_CHECK_SIZEOF(time_t)
584 AC_CHECK_TYPE(long long,
585 [AC_DEFINE(HAVE_LONGLONG, 1,
586 [Define to 1 if the compiler supports the 'long long' data type.])]
590 if test "xyes" = "x$longlong"; then
591 AC_MSG_CHECKING([if numberLL works])
592 AC_COMPILE_IFELSE([long long val = 1000LL;],
593 [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
601 AC_CHECK_TYPE(ssize_t, ,
602 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
604 # check for bool type
605 AC_CHECK_TYPE([bool],[
606 AC_DEFINE(HAVE_BOOL_T, 1,
607 [Define to 1 if bool is an available type.])
609 #ifdef HAVE_SYS_TYPES_H
610 #include <sys/types.h>
612 #ifdef HAVE_STDBOOL_H
617 # Check for socklen_t or equivalent
618 CURL_CHECK_TYPE_SOCKLEN_T
622 TYPE_SOCKADDR_STORAGE
629 CURL_CHECK_FUNC_RECVFROM
631 CURL_CHECK_MSG_NOSIGNAL
633 dnl check for AF_INET6
634 CARES_CHECK_CONSTANT(
637 #ifdef HAVE_WINDOWS_H
638 #ifndef WIN32_LEAN_AND_MEAN
639 #define WIN32_LEAN_AND_MEAN
642 #ifdef HAVE_WINSOCK2_H
643 #include <winsock2.h>
646 #ifdef HAVE_SYS_TYPES_H
647 #include <sys/types.h>
649 #ifdef HAVE_SYS_SOCKET_H
650 #include <sys/socket.h>
654 AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.])
657 dnl check for PF_INET6
658 CARES_CHECK_CONSTANT(
661 #ifdef HAVE_WINDOWS_H
662 #ifndef WIN32_LEAN_AND_MEAN
663 #define WIN32_LEAN_AND_MEAN
666 #ifdef HAVE_WINSOCK2_H
667 #include <winsock2.h>
670 #ifdef HAVE_SYS_TYPES_H
671 #include <sys/types.h>
673 #ifdef HAVE_SYS_SOCKET_H
674 #include <sys/socket.h>
678 AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.])
682 dnl check for the in6_addr structure
686 #ifdef HAVE_WINDOWS_H
687 #ifndef WIN32_LEAN_AND_MEAN
688 #define WIN32_LEAN_AND_MEAN
691 #ifdef HAVE_WINSOCK2_H
692 #include <winsock2.h>
693 #ifdef HAVE_WS2TCPIP_H
694 #include <ws2tcpip.h>
698 #ifdef HAVE_SYS_TYPES_H
699 #include <sys/types.h>
701 #ifdef HAVE_NETINET_IN_H
702 #include <netinet/in.h>
706 AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.])
709 dnl check for the sockaddr_in6 structure
713 #ifdef HAVE_WINDOWS_H
714 #ifndef WIN32_LEAN_AND_MEAN
715 #define WIN32_LEAN_AND_MEAN
718 #ifdef HAVE_WINSOCK2_H
719 #include <winsock2.h>
720 #ifdef HAVE_WS2TCPIP_H
721 #include <ws2tcpip.h>
725 #ifdef HAVE_SYS_TYPES_H
726 #include <sys/types.h>
728 #ifdef HAVE_NETINET_IN_H
729 #include <netinet/in.h>
733 AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1,
734 [Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes
737 AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id,
738 AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1,
739 [Define to 1 if your struct sockaddr_in6 has sin6_scope_id.])
743 #ifdef HAVE_WINDOWS_H
744 #ifndef WIN32_LEAN_AND_MEAN
745 #define WIN32_LEAN_AND_MEAN
748 #ifdef HAVE_WINSOCK2_H
749 #include <winsock2.h>
750 #ifdef HAVE_WS2TCPIP_H
751 #include <ws2tcpip.h>
755 #ifdef HAVE_SYS_TYPES_H
756 #include <sys/types.h>
758 #ifdef HAVE_NETINET_IN_H
759 #include <netinet/in.h>
764 dnl check for the addrinfo structure
765 AC_CHECK_MEMBER(struct addrinfo.ai_flags,
766 AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1,
767 [Define to 1 if you have struct addrinfo.]),,
770 #ifdef HAVE_WINDOWS_H
771 #ifndef WIN32_LEAN_AND_MEAN
772 #define WIN32_LEAN_AND_MEAN
775 #ifdef HAVE_WINSOCK2_H
776 #include <winsock2.h>
777 #ifdef HAVE_WS2TCPIP_H
778 #include <ws2tcpip.h>
782 #ifdef HAVE_SYS_TYPES_H
783 #include <sys/types.h>
785 #ifdef HAVE_NETINET_IN_H
786 #include <netinet/in.h>
788 #ifdef HAVE_SYS_SOCKET_H
789 #include <sys/socket.h>
799 AC_CHECK_FUNCS([bitncmp \
805 AC_MSG_CHECKING([deeper for $func])
813 eval "ac_cv_func_$func=yes"
814 AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$func])], [1],
815 [Define to 1 if you have the $func function.])
817 AC_MSG_RESULT([but still no])
822 dnl check for inet_pton
823 AC_CHECK_FUNCS(inet_pton)
824 dnl Some systems have it, but not IPv6
825 if test "$ac_cv_func_inet_pton" = "yes" ; then
826 AC_MSG_CHECKING(if inet_pton supports IPv6)
829 #ifdef HAVE_SYS_TYPES_H
830 #include <sys/types.h>
832 #ifdef HAVE_SYS_SOCKET_H
833 #include <sys/socket.h>
835 #ifdef HAVE_NETINET_IN_H
836 #include <netinet/in.h>
840 struct in6_addr addr6;
841 if (inet_pton(AF_INET6, "::1", &addr6) < 1)
848 AC_DEFINE_UNQUOTED(HAVE_INET_PTON_IPV6,1,[Define to 1 if inet_pton supports IPv6.])
849 ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
851 dnl Check for inet_net_pton
852 AC_CHECK_FUNCS(inet_net_pton)
853 dnl Again, some systems have it, but not IPv6
854 if test "$ac_cv_func_inet_net_pton" = "yes" ; then
855 AC_MSG_CHECKING(if inet_net_pton supports IPv6)
858 #ifdef HAVE_SYS_TYPES_H
859 #include <sys/types.h>
861 #ifdef HAVE_SYS_SOCKET_H
862 #include <sys/socket.h>
864 #ifdef HAVE_NETINET_IN_H
865 #include <netinet/in.h>
869 struct in6_addr addr6;
870 if (inet_net_pton(AF_INET6, "::1", &addr6, sizeof(addr6)) < 1)
877 AC_DEFINE_UNQUOTED(HAVE_INET_NET_PTON_IPV6,1,[Define to 1 if inet_net_pton supports IPv6.])
878 ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
882 dnl Check for inet_ntop
883 AC_CHECK_FUNCS(inet_ntop)
884 dnl Again, some systems have it, but not IPv6
885 if test "$ac_cv_func_inet_ntop" = "yes" ; then
886 AC_MSG_CHECKING(if inet_ntop supports IPv6)
889 #ifdef HAVE_SYS_TYPES_H
890 #include <sys/types.h>
892 #ifdef HAVE_SYS_SOCKET_H
893 #include <sys/socket.h>
895 #ifdef HAVE_NETINET_IN_H
896 #include <netinet/in.h>
901 struct in6_addr addr6;
903 if (inet_ntop(AF_INET6, &addr6, buf, 128) == 0 && errno == EAFNOSUPPORT)
910 AC_DEFINE_UNQUOTED(HAVE_INET_NTOP_IPV6,1,
911 [Define to 1 if inet_ntop supports IPv6.])
912 ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
915 AC_CHECK_SIZEOF(struct in6_addr, ,
918 #ifdef HAVE_WINDOWS_H
919 #ifndef WIN32_LEAN_AND_MEAN
920 #define WIN32_LEAN_AND_MEAN
923 #ifdef HAVE_WINSOCK2_H
924 #include <winsock2.h>
925 #ifdef HAVE_WS2TCPIP_H
926 #include <ws2tcpip.h>
930 #ifdef HAVE_SYS_TYPES_H
931 #include <sys/types.h>
933 #ifdef HAVE_SYS_SOCKET_H
934 #include <sys/socket.h>
936 #ifdef HAVE_NETINET_IN_H
937 #include <netinet/in.h>
943 AC_CHECK_SIZEOF(struct in_addr, ,
946 #ifdef HAVE_WINDOWS_H
947 #ifndef WIN32_LEAN_AND_MEAN
948 #define WIN32_LEAN_AND_MEAN
951 #ifdef HAVE_WINSOCK2_H
952 #include <winsock2.h>
953 #ifdef HAVE_WS2TCPIP_H
954 #include <ws2tcpip.h>
958 #ifdef HAVE_SYS_TYPES_H
959 #include <sys/types.h>
961 #ifdef HAVE_SYS_SOCKET_H
962 #include <sys/socket.h>
964 #ifdef HAVE_NETINET_IN_H
965 #include <netinet/in.h>
972 dnl Check if the getnameinfo function is available
973 dnl and get the types of five of its arguments.
974 CURL_CHECK_FUNC_GETNAMEINFO
977 dnl God bless non-standardized functions! We need to see which getservbyport_r
978 dnl variant is available
979 CARES_CHECK_GETSERVBYPORT_R
981 CURL_CHECK_NONBLOCKING_SOCKET
984 [AC_DEFINE(ARES_BIG_ENDIAN, 1,
985 [define this if ares is built for a big endian system])],
987 [AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])]
990 dnl Check for user-specified random device
992 AC_HELP_STRING([--with-random=FILE],
993 [read randomness from FILE (default=/dev/urandom)]),
994 [ RANDOM_FILE="$withval" ],
996 dnl Check for random device. If we're cross compiling, we can't
997 dnl check, and it's better to assume it doesn't exist than it is
998 dnl to fail on AC_CHECK_FILE or later.
999 if test "$cross_compiling" = "no"; then
1000 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1002 AC_MSG_WARN([cannot check for /dev/urandom while cross compiling; assuming none])
1007 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1008 AC_SUBST(RANDOM_FILE)
1009 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1010 [a suitable file/device to read random data from])
1013 CARES_PRIVATE_LIBS="$LIBS"
1014 AC_SUBST(CARES_PRIVATE_LIBS)
1016 AC_CONFIG_FILES([Makefile libcares.pc])