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.])
19 dnl GREP is mandatory for configure process and libtool.
20 dnl Set it now, allowing it to be changed later.
21 AC_PATH_PROG([GREP], [grep], [not_found],
22 [$PATH:/usr/bin:/usr/local/bin])
23 if test -z "$GREP" || test "$GREP" = "not_found"; then
24 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
27 dnl EGREP is mandatory for configure process and libtool.
28 dnl Set it now, allowing it to be changed later.
29 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
30 AC_MSG_CHECKING([for egrep])
32 AC_MSG_RESULT([$EGREP])
34 AC_PATH_PROG([EGREP], [egrep], [not_found],
35 [$PATH:/usr/bin:/usr/local/bin])
37 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
38 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
41 dnl AR is mandatory for configure process and libtool.
42 dnl This is target dependant, so check it as a tool.
43 AC_PATH_TOOL([AR], [ar], [not_found],
44 [$PATH:/usr/bin:/usr/local/bin])
45 if test -z "$AR" || test "$AR" = "not_found"; then
46 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
49 dnl Fetch c-ares version from ares_version.h
50 VERSION=`$SED -ne 's/^#define ARES_VERSION_STR "\(.*\)"/\1/p' ${srcdir}/ares_version.h`
51 AM_INIT_AUTOMAKE([c-ares], [$VERSION])
52 AC_MSG_CHECKING([c-ares version])
53 AC_MSG_RESULT([$VERSION])
56 dnl Detect the canonical host and target build environment
60 dnl Get system canonical name
61 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
68 dnl Our configure and build reentrant settings
69 CARES_CONFIGURE_REENTRANT
71 dnl check for how to do large files
76 AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
80 dnl support building of Windows DLLs
83 dnl ************************************************************
84 dnl Option to switch on debug options. This makes an assumption that
85 dnl this is built as an 'ares' subdir in the curl source tree. Subject for
86 dnl improval in the future!
88 AC_MSG_CHECKING([whether to enable debug options])
90 AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
91 AC_HELP_STRING([--disable-debug],[Disable debug options]),
92 [ case "$enableval" in
98 dnl when doing the debug stuff, use static library only
103 dnl the entire --enable-debug is a hack that lives and runs on top of
104 dnl libcurl stuff so this BUILDING_LIBCURL is not THAT much uglier
105 AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
107 CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I$srcdir/../include"
110 dnl set compiler "debug" options to become more picky, and remove
111 dnl optimize options from CFLAGS
118 AM_CONDITIONAL(DEBUGBUILD, test x$debugbuild = xyes)
120 dnl skip libtool C++ and Fortran compiler checks
121 m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
122 m4_defun([AC_PROG_CXX],[])
123 m4_ifdef([AC_PROG_CXXCPP], [m4_undefine([AC_PROG_CXXCPP])])
124 m4_defun([AC_PROG_CXXCPP],[true])
125 m4_ifdef([AC_PROG_F77], [m4_undefine([AC_PROG_F77])])
126 m4_defun([AC_PROG_F77],[])
128 dnl skip libtool C++ and Fortran linker checks
129 m4_ifdef([AC_LIBTOOL_CXX], [m4_undefine([AC_LIBTOOL_CXX])])
130 m4_defun([AC_LIBTOOL_CXX],[])
131 m4_ifdef([AC_LIBTOOL_CXXCPP], [m4_undefine([AC_LIBTOOL_CXXCPP])])
132 m4_defun([AC_LIBTOOL_CXXCPP],[true])
133 m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
134 m4_defun([AC_LIBTOOL_F77],[])
136 dnl force libtool to build static libraries with PIC on AMD64-linux
137 AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
151 AC_MSG_CHECKING([if we need -no-undefined])
153 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
154 need_no_undefined=yes
160 AC_MSG_RESULT($need_no_undefined)
161 AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
163 dnl **********************************************************************
164 dnl check if this is the Intel ICC compiler, and if so make it stricter
165 dnl (convert warning 147 into an error) so that it properly can detect the
166 dnl gethostbyname_r() version
167 dnl **********************************************************************
168 CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
170 dnl **********************************************************************
171 dnl platform/compiler/architecture specific checks/flags
172 dnl **********************************************************************
178 dnl find out if icc is being used
179 if test "z$ICC" = "z"; then
183 if test "$ICC" = "yes"; then
184 dnl figure out icc version
185 AC_MSG_CHECKING([icc version])
186 iccver=`$CC -dumpversion`
187 iccnhi=`echo $iccver | cut -d . -f1`
188 iccnlo=`echo $iccver | cut -d . -f2`
189 iccnum=`(expr $iccnhi "*" 100 + $iccnlo) 2>/dev/null`
190 AC_MSG_RESULT($iccver)
192 if test "$iccnum" -ge "900" && test "$iccnum" -lt "1000"; then
194 CFLAGS="$CFLAGS -i-dynamic"
197 if test "$iccnum" -ge "1000"; then
198 dnl icc 10.X or later
199 CFLAGS="$CFLAGS -shared-intel"
207 AC_MSG_CHECKING([whether we are using the IBM C compiler])
208 CURL_CHECK_DEF([__IBMC__], [], [silent])
209 CURL_CHECK_DEF([__IBMCPP__], [], [silent])
210 if test "$curl_cv_have_def___IBMC__" = "yes" ||
211 test "$curl_cv_have_def___IBMCPP__" = "yes"; then
213 dnl Ensure that compiler optimizations are always thread-safe.
214 CFLAGS="$CFLAGS -qthreaded"
215 dnl Disable type based strict aliasing optimizations, using worst
216 dnl case aliasing assumptions when compiling. Type based aliasing
217 dnl would restrict the lvalues that could be safely used to access
219 CFLAGS="$CFLAGS -qnoansialias"
220 dnl Force compiler to stop after the compilation phase, without
221 dnl generating an object code file when compilation has errors.
222 CFLAGS="$CFLAGS -qhalt=e"
227 AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
228 CURL_CHECK_DEF([__DECC], [], [silent])
229 CURL_CHECK_DEF([__DECC_VER], [], [silent])
230 if test "$curl_cv_have_def___DECC" = "yes" ||
231 test "$curl_cv_have_def___DECC_VER" = "yes"; then
233 dnl Select strict ANSI C compiler mode
234 CFLAGS="$CFLAGS -std1"
235 dnl Select a higher warning level than default level2
236 CFLAGS="$CFLAGS -msg_enable level3"
237 dnl Generate warnings for missing function prototypes
238 CFLAGS="$CFLAGS -warnprotos"
239 dnl Change some warnings into fatal errors
240 CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs"
245 CURL_CHECK_COMPILER_HALT_ON_ERROR
246 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
248 dnl **********************************************************************
249 dnl Compilation based checks should not be done before this point.
250 dnl **********************************************************************
252 dnl **********************************************************************
253 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
254 dnl and ws2tcpip.h take precedence over any other further checks which
255 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
256 dnl this specific header files. And do them before its results are used.
257 dnl **********************************************************************
259 CURL_CHECK_HEADER_WINDOWS
260 CURL_CHECK_NATIVE_WINDOWS
261 case X-"$ac_cv_native_windows" in
263 CURL_CHECK_HEADER_WINSOCK
264 CURL_CHECK_HEADER_WINSOCK2
265 CURL_CHECK_HEADER_WS2TCPIP
268 ac_cv_header_winsock_h="no"
269 ac_cv_header_winsock2_h="no"
270 ac_cv_header_ws2tcpip_h="no"
274 dnl **********************************************************************
275 dnl Checks for libraries.
276 dnl **********************************************************************
278 dnl gethostbyname without lib or in the nsl lib?
279 AC_CHECK_FUNC(gethostbyname,
280 [HAVE_GETHOSTBYNAME="1"
282 [ AC_CHECK_LIB(nsl, gethostbyname,
283 [HAVE_GETHOSTBYNAME="1"
288 if test "$HAVE_GETHOSTBYNAME" != "1"
290 dnl gethostbyname in the socket lib?
291 AC_CHECK_LIB(socket, gethostbyname,
292 [HAVE_GETHOSTBYNAME="1"
293 LIBS="$LIBS -lsocket"
297 dnl At least one system has been identified to require BOTH nsl and socket
298 dnl libs at the same time to link properly.
299 if test "$HAVE_GETHOSTBYNAME" != "1"
301 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
302 my_ac_save_LIBS=$LIBS
303 LIBS="-lnsl -lsocket $LIBS"
311 HAVE_GETHOSTBYNAME="1"
314 LIBS=$my_ac_save_LIBS
318 if test "$HAVE_GETHOSTBYNAME" != "1"
320 dnl This is for winsock systems
321 if test "$ac_cv_header_windows_h" = "yes"; then
322 if test "$ac_cv_header_winsock_h" = "yes"; then
325 winsock_LIB="-lwinsock"
328 winsock_LIB="-lwsock32"
332 if test "$ac_cv_header_winsock2_h" = "yes"; then
333 winsock_LIB="-lws2_32"
335 if test ! -z "$winsock_LIB"; then
336 my_ac_save_LIBS=$LIBS
337 LIBS="$winsock_LIB $LIBS"
338 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
341 #ifdef HAVE_WINDOWS_H
342 #ifndef WIN32_LEAN_AND_MEAN
343 #define WIN32_LEAN_AND_MEAN
346 #ifdef HAVE_WINSOCK2_H
347 #include <winsock2.h>
349 #ifdef HAVE_WINSOCK_H
355 gethostbyname("www.dummysite.com");
359 HAVE_GETHOSTBYNAME="1"
363 LIBS=$my_ac_save_LIBS
369 if test "$HAVE_GETHOSTBYNAME" != "1"
371 dnl This is for Minix 3.1
372 AC_MSG_CHECKING([for gethostbyname for Minix 3])
375 /* Older Minix versions may need <net/gen/netdb.h> here instead */
378 gethostbyname("www.dummysite.com");
382 HAVE_GETHOSTBYNAME="1"
388 if test "$HAVE_GETHOSTBYNAME" != "1"
390 dnl This is for eCos with a stubbed DNS implementation
391 AC_MSG_CHECKING([for gethostbyname for eCos])
397 gethostbyname("www.dummysite.com");
401 HAVE_GETHOSTBYNAME="1"
407 if test "$HAVE_GETHOSTBYNAME" != "1"
409 dnl gethostbyname in the net lib - for BeOS
410 AC_CHECK_LIB(net, gethostbyname,
411 [HAVE_GETHOSTBYNAME="1"
417 if test "$HAVE_GETHOSTBYNAME" = "1"; then
418 AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
420 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
424 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
426 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
427 AC_CHECK_LIB(resolve, strcasecmp,
428 [LIBS="-lresolve $LIBS"],
434 AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
436 dnl **********************************************************************
437 dnl In case that function clock_gettime with monotonic timer is available,
438 dnl check for additional required libraries.
439 dnl **********************************************************************
440 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
442 AC_MSG_CHECKING([whether to use libgcc])
443 AC_ARG_ENABLE(libgcc,
444 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
445 [ case "$enableval" in
457 dnl Default is to try the thread-safe versions of a few functions
460 dnl detect AIX 4.3 or later
461 AC_MSG_CHECKING([AIX 4.3 or later])
463 #if defined(_AIX) && defined(_AIX43)
466 #error "this is not AIX 4.3 or later"
469 [ AC_MSG_RESULT([yes])
472 [ AC_MSG_RESULT([no]) ]
475 AC_ARG_ENABLE(thread,dnl
476 AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
477 AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
478 [ case "$enableval" in
481 AC_MSG_WARN(c-ares will not get built using thread-safe functions)
489 if test X"$OPT_THREAD" = Xoff
491 AC_DEFINE(DISABLED_THREADSAFE, 1,
492 [Set to explicitly specify we don't want to use thread-safe functions])
495 dnl for recent AIX versions, we skip all the thread-safe checks above since
496 dnl they claim a thread-safe libc using the standard API. But there are
497 dnl some functions still not thread-safe. Check for these!
499 dnl Let's hope this split URL remains working:
500 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
501 dnl genprogc/thread_quick_ref.htm
503 if test "x$RECENTAIX" = "xyes"; then
505 AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
510 dnl **********************************************************************
511 dnl Back to "normal" configuring
512 dnl **********************************************************************
514 dnl Checks for header files.
517 CURL_CHECK_HEADER_MALLOC
519 dnl check for a few basic system headers we need
536 arpa/nameser_compat.h \
538 dnl to do if not found
544 #ifdef HAVE_SYS_TYPES_H
545 #include <sys/types.h>
547 #ifdef HAVE_SYS_TIME_H
548 #include <sys/time.h>
550 dnl We do this default-include simply to make sure that the nameser_compat.h
551 dnl header *REALLY* can be include after the new nameser.h. It seems AIX 5.1
552 dnl (and others?) is not designed to allow this.
553 #ifdef HAVE_ARPA_NAMESER_H
554 #include <arpa/nameser.h>
557 dnl *Sigh* these are needed in order for net/if.h to get properly detected.
558 #ifdef HAVE_SYS_SOCKET_H
559 #include <sys/socket.h>
561 #ifdef HAVE_NETINET_IN_H
562 #include <netinet/in.h>
567 dnl Checks for typedefs, structures, and compiler characteristics.
571 CURL_CHECK_STRUCT_TIMEVAL
573 AC_CHECK_SIZEOF(size_t)
574 AC_CHECK_SIZEOF(long)
575 AC_CHECK_SIZEOF(time_t)
577 AC_CHECK_TYPE(long long,
578 [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
582 if test "xyes" = "x$longlong"; then
583 AC_MSG_CHECKING([if numberLL works])
584 AC_COMPILE_IFELSE([long long val = 1000LL;],
585 [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
593 AC_CHECK_TYPE(ssize_t, ,
594 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
596 # check for bool type
597 AC_CHECK_TYPE([bool],[
598 AC_DEFINE(HAVE_BOOL_T, 1,
599 [Define to 1 if bool is an available type.])
601 #ifdef HAVE_SYS_TYPES_H
602 #include <sys/types.h>
604 #ifdef HAVE_STDBOOL_H
609 # Check for socklen_t or equivalent
610 CURL_CHECK_TYPE_SOCKLEN_T
614 TYPE_SOCKADDR_STORAGE
621 CURL_CHECK_FUNC_RECVFROM
623 CURL_CHECK_MSG_NOSIGNAL
625 dnl check for AF_INET6
626 CARES_CHECK_CONSTANT(
629 #ifdef HAVE_WINDOWS_H
630 #ifndef WIN32_LEAN_AND_MEAN
631 #define WIN32_LEAN_AND_MEAN
634 #ifdef HAVE_WINSOCK2_H
635 #include <winsock2.h>
638 #ifdef HAVE_SYS_TYPES_H
639 #include <sys/types.h>
641 #ifdef HAVE_SYS_SOCKET_H
642 #include <sys/socket.h>
646 AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.])
649 dnl check for PF_INET6
650 CARES_CHECK_CONSTANT(
653 #ifdef HAVE_WINDOWS_H
654 #ifndef WIN32_LEAN_AND_MEAN
655 #define WIN32_LEAN_AND_MEAN
658 #ifdef HAVE_WINSOCK2_H
659 #include <winsock2.h>
662 #ifdef HAVE_SYS_TYPES_H
663 #include <sys/types.h>
665 #ifdef HAVE_SYS_SOCKET_H
666 #include <sys/socket.h>
670 AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.])
674 dnl check for the in6_addr structure
678 #ifdef HAVE_WINDOWS_H
679 #ifndef WIN32_LEAN_AND_MEAN
680 #define WIN32_LEAN_AND_MEAN
683 #ifdef HAVE_WINSOCK2_H
684 #include <winsock2.h>
685 #ifdef HAVE_WS2TCPIP_H
686 #include <ws2tcpip.h>
690 #ifdef HAVE_SYS_TYPES_H
691 #include <sys/types.h>
693 #ifdef HAVE_NETINET_IN_H
694 #include <netinet/in.h>
698 AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.])
701 dnl check for the sockaddr_in6 structure
705 #ifdef HAVE_WINDOWS_H
706 #ifndef WIN32_LEAN_AND_MEAN
707 #define WIN32_LEAN_AND_MEAN
710 #ifdef HAVE_WINSOCK2_H
711 #include <winsock2.h>
712 #ifdef HAVE_WS2TCPIP_H
713 #include <ws2tcpip.h>
717 #ifdef HAVE_SYS_TYPES_H
718 #include <sys/types.h>
720 #ifdef HAVE_NETINET_IN_H
721 #include <netinet/in.h>
725 AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1,
726 [Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes
729 AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id,
730 AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1,
731 [Define to 1 if your struct sockaddr_in6 has sin6_scope_id.])
735 #ifdef HAVE_WINDOWS_H
736 #ifndef WIN32_LEAN_AND_MEAN
737 #define WIN32_LEAN_AND_MEAN
740 #ifdef HAVE_WINSOCK2_H
741 #include <winsock2.h>
742 #ifdef HAVE_WS2TCPIP_H
743 #include <ws2tcpip.h>
747 #ifdef HAVE_SYS_TYPES_H
748 #include <sys/types.h>
750 #ifdef HAVE_NETINET_IN_H
751 #include <netinet/in.h>
756 dnl check for the addrinfo structure
757 AC_CHECK_MEMBER(struct addrinfo.ai_flags,
758 AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1,
759 [Define to 1 if you have struct addrinfo.]),,
762 #ifdef HAVE_WINDOWS_H
763 #ifndef WIN32_LEAN_AND_MEAN
764 #define WIN32_LEAN_AND_MEAN
767 #ifdef HAVE_WINSOCK2_H
768 #include <winsock2.h>
769 #ifdef HAVE_WS2TCPIP_H
770 #include <ws2tcpip.h>
774 #ifdef HAVE_SYS_TYPES_H
775 #include <sys/types.h>
777 #ifdef HAVE_NETINET_IN_H
778 #include <netinet/in.h>
780 #ifdef HAVE_SYS_SOCKET_H
781 #include <sys/socket.h>
791 AC_CHECK_FUNCS( bitncmp \
796 dnl if not found, $ac_func is the name we check for
798 AC_MSG_CHECKING([deeper for $func])
802 eval "ac_cv_func_$func=yes"
803 def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'`
804 AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
805 AC_MSG_RESULT(but still no)
810 dnl check for inet_pton
811 AC_CHECK_FUNCS(inet_pton)
812 dnl Some systems have it, but not IPv6
813 if test "$ac_cv_func_inet_pton" = "yes" ; then
814 AC_MSG_CHECKING(if inet_pton supports IPv6)
817 #ifdef HAVE_SYS_TYPES_H
818 #include <sys/types.h>
820 #ifdef HAVE_SYS_SOCKET_H
821 #include <sys/socket.h>
823 #ifdef HAVE_NETINET_IN_H
824 #include <netinet/in.h>
828 struct in6_addr addr6;
829 if (inet_pton(AF_INET6, "::1", &addr6) < 1)
836 AC_DEFINE_UNQUOTED(HAVE_INET_PTON_IPV6,1,[Define to 1 if inet_pton supports IPv6.])
837 ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
839 dnl Check for inet_net_pton
840 AC_CHECK_FUNCS(inet_net_pton)
841 dnl Again, some systems have it, but not IPv6
842 if test "$ac_cv_func_inet_net_pton" = "yes" ; then
843 AC_MSG_CHECKING(if inet_net_pton supports IPv6)
846 #ifdef HAVE_SYS_TYPES_H
847 #include <sys/types.h>
849 #ifdef HAVE_SYS_SOCKET_H
850 #include <sys/socket.h>
852 #ifdef HAVE_NETINET_IN_H
853 #include <netinet/in.h>
857 struct in6_addr addr6;
858 if (inet_net_pton(AF_INET6, "::1", &addr6, sizeof(addr6)) < 1)
865 AC_DEFINE_UNQUOTED(HAVE_INET_NET_PTON_IPV6,1,[Define to 1 if inet_net_pton supports IPv6.])
866 ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
870 dnl Check for inet_ntop
871 AC_CHECK_FUNCS(inet_ntop)
872 dnl Again, some systems have it, but not IPv6
873 if test "$ac_cv_func_inet_ntop" = "yes" ; then
874 AC_MSG_CHECKING(if inet_ntop supports IPv6)
877 #ifdef HAVE_SYS_TYPES_H
878 #include <sys/types.h>
880 #ifdef HAVE_SYS_SOCKET_H
881 #include <sys/socket.h>
883 #ifdef HAVE_NETINET_IN_H
884 #include <netinet/in.h>
889 struct in6_addr addr6;
891 if (inet_ntop(AF_INET6, &addr6, buf, 128) == 0 && errno == EAFNOSUPPORT)
898 AC_DEFINE_UNQUOTED(HAVE_INET_NTOP_IPV6,1,
899 [Define to 1 if inet_ntop supports IPv6.])
900 ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
903 AC_CHECK_SIZEOF(struct in6_addr, ,
906 #ifdef HAVE_WINDOWS_H
907 #ifndef WIN32_LEAN_AND_MEAN
908 #define WIN32_LEAN_AND_MEAN
911 #ifdef HAVE_WINSOCK2_H
912 #include <winsock2.h>
913 #ifdef HAVE_WS2TCPIP_H
914 #include <ws2tcpip.h>
918 #ifdef HAVE_SYS_TYPES_H
919 #include <sys/types.h>
921 #ifdef HAVE_SYS_SOCKET_H
922 #include <sys/socket.h>
924 #ifdef HAVE_NETINET_IN_H
925 #include <netinet/in.h>
931 AC_CHECK_SIZEOF(struct in_addr, ,
934 #ifdef HAVE_WINDOWS_H
935 #ifndef WIN32_LEAN_AND_MEAN
936 #define WIN32_LEAN_AND_MEAN
939 #ifdef HAVE_WINSOCK2_H
940 #include <winsock2.h>
941 #ifdef HAVE_WS2TCPIP_H
942 #include <ws2tcpip.h>
946 #ifdef HAVE_SYS_TYPES_H
947 #include <sys/types.h>
949 #ifdef HAVE_SYS_SOCKET_H
950 #include <sys/socket.h>
952 #ifdef HAVE_NETINET_IN_H
953 #include <netinet/in.h>
960 dnl Check if the getnameinfo function is available
961 dnl and get the types of five of its arguments.
962 CURL_CHECK_FUNC_GETNAMEINFO
965 dnl God bless non-standardized functions! We need to see which getservbyport_r
966 dnl variant is available
967 CARES_CHECK_GETSERVBYPORT_R
969 CURL_CHECK_NONBLOCKING_SOCKET
972 [AC_DEFINE(ARES_BIG_ENDIAN, 1,
973 [define this if ares is built for a big endian system])],
975 [AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])]
978 dnl Check for user-specified random device
980 AC_HELP_STRING([--with-random=FILE],
981 [read randomness from FILE (default=/dev/urandom)]),
982 [ RANDOM_FILE="$withval" ],
984 dnl Check for random device. If we're cross compiling, we can't
985 dnl check, and it's better to assume it doesn't exist than it is
986 dnl to fail on AC_CHECK_FILE or later.
987 if test "$cross_compiling" = "no"; then
988 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
990 AC_MSG_WARN([cannot check for /dev/urandom while cross compiling; assuming none])
995 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
996 AC_SUBST(RANDOM_FILE)
997 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
998 [a suitable file/device to read random data from])
1001 CARES_PRIVATE_LIBS="$LIBS"
1002 AC_SUBST(CARES_PRIVATE_LIBS)
1004 AC_CONFIG_FILES([Makefile libcares.pc])