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 & FreeBSD
144 AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
146 x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
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 platform/compiler/architecture specific checks/flags
172 dnl **********************************************************************
174 ac_cv_compiler="unknown"
175 ac_cv_compiler_num="unknown"
177 AC_MSG_CHECKING([whether we are using the IBM C compiler])
178 CURL_CHECK_DEF([__IBMC__], [], [silent])
179 if test "$curl_cv_have_def___IBMC__" = "yes"; then
181 ac_cv_compiler="IBMC"
182 dnl Ensure that compiler optimizations are always thread-safe.
183 CFLAGS="$CFLAGS -qthreaded"
184 dnl Disable type based strict aliasing optimizations, using worst
185 dnl case aliasing assumptions when compiling. Type based aliasing
186 dnl would restrict the lvalues that could be safely used to access
188 CFLAGS="$CFLAGS -qnoansialias"
189 dnl Force compiler to stop after the compilation phase, without
190 dnl generating an object code file when compilation has errors.
191 CFLAGS="$CFLAGS -qhalt=e"
196 AC_MSG_CHECKING([whether we are using the Intel C compiler])
197 CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent])
198 if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then
201 ac_cv_compiler_num="$curl_cv_def___INTEL_COMPILER"
202 dnl On unix this compiler uses gcc's header files, so
203 dnl we select ANSI C89 dialect plus GNU extensions.
204 CPPFLAGS="$CPPFLAGS -std=gnu89"
205 if test "$ac_cv_compiler_num" -gt "600"; then
206 dnl Show errors, warnings, and remarks
207 CPPFLAGS="$CPPFLAGS -Wall"
208 dnl Perform extra compile-time code checking
209 CPPFLAGS="$CPPFLAGS -Wcheck"
211 dnl Change some warnings into errors
212 dnl #140: too many arguments in function call
213 dnl #147: declaration is incompatible with 'previous one'
214 dnl #165: too few arguments in function call
215 dnl #266: function declared implicitly
216 CPPFLAGS="$CPPFLAGS -we 140,147,165,266"
217 dnl Disable some remarks
218 dnl #279: controlling expression is constant
219 dnl #981: operands are evaluated in unspecified order
220 dnl #1469: "cc" clobber ignored
221 if test "$ac_cv_compiler_num" -lt "910"; then
222 CPPFLAGS="$CPPFLAGS -wd 279"
224 CPPFLAGS="$CPPFLAGS -wd 981,1469"
225 dnl Disable use of ANSI C aliasing rules in optimizations
226 CFLAGS="$CFLAGS -no-ansi-alias"
227 dnl Disable floating point optimizations
228 CFLAGS="$CFLAGS -fp-model precise -mp"
233 AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
234 CURL_CHECK_DEF([__DECC], [], [silent])
235 CURL_CHECK_DEF([__DECC_VER], [], [silent])
236 if test "$curl_cv_have_def___DECC" = "yes" &&
237 test "$curl_cv_have_def___DECC_VER" = "yes"; then
239 ac_cv_compiler="DECC"
240 dnl Select strict ANSI C compiler mode
241 CFLAGS="$CFLAGS -std1"
242 dnl Turn off optimizer ANSI C aliasing rules
243 CFLAGS="$CFLAGS -noansi_alias"
244 dnl Select a higher warning level than default level2
245 CFLAGS="$CFLAGS -msg_enable level3"
246 dnl Generate warnings for missing function prototypes
247 CFLAGS="$CFLAGS -warnprotos"
248 dnl Change some warnings into fatal errors
249 CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs"
254 AC_MSG_CHECKING([whether we are using the GNU C compiler])
255 CURL_CHECK_DEF([__GNUC__], [], [silent])
256 if test "$curl_cv_have_def___GNUC__" = "yes" &&
257 test "$ac_cv_compiler" = "unknown"; then
259 ac_cv_compiler="GNUC"
260 gccver=`$CC -dumpversion`
261 gccvhi=`echo $gccver | cut -d . -f1`
262 gccvlo=`echo $gccver | cut -d . -f2`
263 gccnum=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
264 ac_cv_compiler_num="$gccnum"
265 dnl this is a set of options we believe *ALL* gcc versions support:
266 WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes"
267 dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
268 if test "$ac_cv_compiler_num" -ge "207"; then
270 WARN="$WARN -Wmissing-declarations"
272 if test "$ac_cv_compiler_num" -gt "295"; then
273 dnl only if the compiler is newer than 2.95 since we got lots of
274 dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
275 dnl gcc 2.95.4 on FreeBSD 4.9!
276 WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar"
278 if test "$ac_cv_compiler_num" -ge "296"; then
279 dnl gcc 2.96 or later
280 WARN="$WARN -Wfloat-equal"
282 if test "$ac_cv_compiler_num" -gt "296"; then
283 dnl this option does not exist in 2.96
284 WARN="$WARN -Wno-format-nonliteral"
286 dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
287 dnl on i686-Linux as it gives us heaps with false positives.
288 dnl Also, on gcc 4.0.X it is totally unbearable and complains all
289 dnl over making it unusable for generic purposes. Let's not use it.
290 if test "$ac_cv_compiler_num" -ge "303"; then
291 dnl gcc 3.3 and later
292 WARN="$WARN -Wendif-labels -Wstrict-prototypes"
294 if test "$ac_cv_compiler_num" -ge "304"; then
295 # try these on gcc 3.4
296 WARN="$WARN -Wdeclaration-after-statement"
298 for flag in $CPPFLAGS; do
301 dnl Include path, provide a -isystem option for the same dir
302 dnl to prevent warnings in those dirs. The -isystem was not very
303 dnl reliable on earlier gcc versions.
304 add=`echo $flag | sed 's/^-I/-isystem /g'`
309 CFLAGS="$CFLAGS $WARN"
310 AC_MSG_NOTICE([Added this set of compiler options: $WARN])
317 x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
319 if test "$ac_cv_compiler" = "ICC"; then
321 if test "$ac_cv_compiler_num" -ge "900" &&
322 test "$ac_cv_compiler_num" -lt "1000"; then
324 CFLAGS="$CFLAGS -i-dynamic"
327 if test "$ac_cv_compiler_num" -ge "1000"; then
328 dnl icc 10.X or later
329 CFLAGS="$CFLAGS -shared-intel"
337 CURL_CHECK_COMPILER_HALT_ON_ERROR
338 CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
340 dnl **********************************************************************
341 dnl Compilation based checks should not be done before this point.
342 dnl **********************************************************************
344 dnl **********************************************************************
345 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
346 dnl and ws2tcpip.h take precedence over any other further checks which
347 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
348 dnl this specific header files. And do them before its results are used.
349 dnl **********************************************************************
351 CURL_CHECK_HEADER_WINDOWS
352 CURL_CHECK_NATIVE_WINDOWS
353 case X-"$ac_cv_native_windows" in
355 CURL_CHECK_HEADER_WINSOCK
356 CURL_CHECK_HEADER_WINSOCK2
357 CURL_CHECK_HEADER_WS2TCPIP
360 ac_cv_header_winsock_h="no"
361 ac_cv_header_winsock2_h="no"
362 ac_cv_header_ws2tcpip_h="no"
366 dnl **********************************************************************
367 dnl Checks for libraries.
368 dnl **********************************************************************
370 dnl gethostbyname without lib or in the nsl lib?
371 AC_CHECK_FUNC(gethostbyname,
372 [HAVE_GETHOSTBYNAME="1"
374 [ AC_CHECK_LIB(nsl, gethostbyname,
375 [HAVE_GETHOSTBYNAME="1"
380 if test "$HAVE_GETHOSTBYNAME" != "1"
382 dnl gethostbyname in the socket lib?
383 AC_CHECK_LIB(socket, gethostbyname,
384 [HAVE_GETHOSTBYNAME="1"
385 LIBS="$LIBS -lsocket"
389 dnl At least one system has been identified to require BOTH nsl and socket
390 dnl libs at the same time to link properly.
391 if test "$HAVE_GETHOSTBYNAME" != "1"
393 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
394 my_ac_save_LIBS=$LIBS
395 LIBS="-lnsl -lsocket $LIBS"
403 HAVE_GETHOSTBYNAME="1"
406 LIBS=$my_ac_save_LIBS
410 if test "$HAVE_GETHOSTBYNAME" != "1"
412 dnl This is for winsock systems
413 if test "$ac_cv_header_windows_h" = "yes"; then
414 if test "$ac_cv_header_winsock_h" = "yes"; then
417 winsock_LIB="-lwinsock"
420 winsock_LIB="-lwsock32"
424 if test "$ac_cv_header_winsock2_h" = "yes"; then
425 winsock_LIB="-lws2_32"
427 if test ! -z "$winsock_LIB"; then
428 my_ac_save_LIBS=$LIBS
429 LIBS="$winsock_LIB $LIBS"
430 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
433 #ifdef HAVE_WINDOWS_H
434 #ifndef WIN32_LEAN_AND_MEAN
435 #define WIN32_LEAN_AND_MEAN
438 #ifdef HAVE_WINSOCK2_H
439 #include <winsock2.h>
441 #ifdef HAVE_WINSOCK_H
447 gethostbyname("www.dummysite.com");
451 HAVE_GETHOSTBYNAME="1"
455 LIBS=$my_ac_save_LIBS
461 if test "$HAVE_GETHOSTBYNAME" != "1"
463 dnl This is for Minix 3.1
464 AC_MSG_CHECKING([for gethostbyname for Minix 3])
467 /* Older Minix versions may need <net/gen/netdb.h> here instead */
470 gethostbyname("www.dummysite.com");
474 HAVE_GETHOSTBYNAME="1"
480 if test "$HAVE_GETHOSTBYNAME" != "1"
482 dnl This is for eCos with a stubbed DNS implementation
483 AC_MSG_CHECKING([for gethostbyname for eCos])
489 gethostbyname("www.dummysite.com");
493 HAVE_GETHOSTBYNAME="1"
499 if test "$HAVE_GETHOSTBYNAME" != "1"
501 dnl gethostbyname in the net lib - for BeOS
502 AC_CHECK_LIB(net, gethostbyname,
503 [HAVE_GETHOSTBYNAME="1"
509 if test "$HAVE_GETHOSTBYNAME" = "1"; then
510 AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
512 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
516 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
518 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
519 AC_CHECK_LIB(resolve, strcasecmp,
520 [LIBS="-lresolve $LIBS"],
524 ac_cv_func_strcasecmp="no"
527 AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
529 dnl **********************************************************************
530 dnl In case that function clock_gettime with monotonic timer is available,
531 dnl check for additional required libraries.
532 dnl **********************************************************************
533 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
535 AC_MSG_CHECKING([whether to use libgcc])
536 AC_ARG_ENABLE(libgcc,
537 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
538 [ case "$enableval" in
550 dnl Default is to try the thread-safe versions of a few functions
553 dnl detect AIX 4.3 or later
554 AC_MSG_CHECKING([AIX 4.3 or later])
556 #if defined(_AIX) && defined(_AIX43)
559 #error "this is not AIX 4.3 or later"
562 [ AC_MSG_RESULT([yes])
565 [ AC_MSG_RESULT([no]) ]
568 AC_ARG_ENABLE(thread,dnl
569 AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
570 AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
571 [ case "$enableval" in
574 AC_MSG_WARN(c-ares will not get built using thread-safe functions)
582 if test X"$OPT_THREAD" = Xoff
584 AC_DEFINE(DISABLED_THREADSAFE, 1,
585 [Set to explicitly specify we don't want to use thread-safe functions])
588 dnl for recent AIX versions, we skip all the thread-safe checks above since
589 dnl they claim a thread-safe libc using the standard API. But there are
590 dnl some functions still not thread-safe. Check for these!
592 dnl Let's hope this split URL remains working:
593 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
594 dnl genprogc/thread_quick_ref.htm
596 if test "x$RECENTAIX" = "xyes"; then
598 AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
603 dnl **********************************************************************
604 dnl Back to "normal" configuring
605 dnl **********************************************************************
607 dnl Checks for header files.
610 CURL_CHECK_HEADER_MALLOC
612 dnl check for a few basic system headers we need
630 arpa/nameser_compat.h \
632 dnl to do if not found
638 #ifdef HAVE_SYS_TYPES_H
639 #include <sys/types.h>
641 #ifdef HAVE_SYS_TIME_H
642 #include <sys/time.h>
644 dnl We do this default-include simply to make sure that the nameser_compat.h
645 dnl header *REALLY* can be include after the new nameser.h. It seems AIX 5.1
646 dnl (and others?) is not designed to allow this.
647 #ifdef HAVE_ARPA_NAMESER_H
648 #include <arpa/nameser.h>
651 dnl *Sigh* these are needed in order for net/if.h to get properly detected.
652 #ifdef HAVE_SYS_SOCKET_H
653 #include <sys/socket.h>
655 #ifdef HAVE_NETINET_IN_H
656 #include <netinet/in.h>
661 dnl Checks for typedefs, structures, and compiler characteristics.
665 CURL_CHECK_STRUCT_TIMEVAL
667 AC_CHECK_SIZEOF(size_t)
668 AC_CHECK_SIZEOF(long)
669 AC_CHECK_SIZEOF(time_t)
671 AC_CHECK_TYPE(long long,
672 [AC_DEFINE(HAVE_LONGLONG, 1,
673 [Define to 1 if the compiler supports the 'long long' data type.])]
677 if test "xyes" = "x$longlong"; then
678 AC_MSG_CHECKING([if numberLL works])
679 AC_COMPILE_IFELSE([long long val = 1000LL;],
680 [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
688 AC_CHECK_TYPE(ssize_t, ,
689 AC_DEFINE(ssize_t, int, [the signed version of size_t]))
691 # check for bool type
692 AC_CHECK_TYPE([bool],[
693 AC_DEFINE(HAVE_BOOL_T, 1,
694 [Define to 1 if bool is an available type.])
696 #ifdef HAVE_SYS_TYPES_H
697 #include <sys/types.h>
699 #ifdef HAVE_STDBOOL_H
704 # Check for socklen_t or equivalent
705 CURL_CHECK_TYPE_SOCKLEN_T
709 TYPE_SOCKADDR_STORAGE
716 CURL_CHECK_FUNC_RECVFROM
718 CURL_CHECK_MSG_NOSIGNAL
720 CARES_CHECK_FUNC_GETHOSTNAME
721 CARES_CHECK_FUNC_GETSERVBYPORT_R
722 CARES_CHECK_FUNC_INET_NTOP
723 CARES_CHECK_FUNC_INET_PTON
724 CARES_CHECK_FUNC_STRCASECMP
725 CARES_CHECK_FUNC_STRCMPI
726 CARES_CHECK_FUNC_STRDUP
727 CARES_CHECK_FUNC_STRICMP
728 CARES_CHECK_FUNC_STRNCASECMP
729 CARES_CHECK_FUNC_STRNCMPI
730 CARES_CHECK_FUNC_STRNICMP
731 CARES_CHECK_FUNC_WRITEV
734 dnl check for AF_INET6
735 CARES_CHECK_CONSTANT(
738 #ifdef HAVE_WINDOWS_H
739 #ifndef WIN32_LEAN_AND_MEAN
740 #define WIN32_LEAN_AND_MEAN
743 #ifdef HAVE_WINSOCK2_H
744 #include <winsock2.h>
747 #ifdef HAVE_SYS_TYPES_H
748 #include <sys/types.h>
750 #ifdef HAVE_SYS_SOCKET_H
751 #include <sys/socket.h>
755 AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.])
758 dnl check for PF_INET6
759 CARES_CHECK_CONSTANT(
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>
771 #ifdef HAVE_SYS_TYPES_H
772 #include <sys/types.h>
774 #ifdef HAVE_SYS_SOCKET_H
775 #include <sys/socket.h>
779 AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.])
783 dnl check for the in6_addr structure
787 #ifdef HAVE_WINDOWS_H
788 #ifndef WIN32_LEAN_AND_MEAN
789 #define WIN32_LEAN_AND_MEAN
792 #ifdef HAVE_WINSOCK2_H
793 #include <winsock2.h>
794 #ifdef HAVE_WS2TCPIP_H
795 #include <ws2tcpip.h>
799 #ifdef HAVE_SYS_TYPES_H
800 #include <sys/types.h>
802 #ifdef HAVE_NETINET_IN_H
803 #include <netinet/in.h>
807 AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.])
810 dnl check for the sockaddr_in6 structure
814 #ifdef HAVE_WINDOWS_H
815 #ifndef WIN32_LEAN_AND_MEAN
816 #define WIN32_LEAN_AND_MEAN
819 #ifdef HAVE_WINSOCK2_H
820 #include <winsock2.h>
821 #ifdef HAVE_WS2TCPIP_H
822 #include <ws2tcpip.h>
826 #ifdef HAVE_SYS_TYPES_H
827 #include <sys/types.h>
829 #ifdef HAVE_NETINET_IN_H
830 #include <netinet/in.h>
834 AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1,
835 [Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes
838 AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id,
839 AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1,
840 [Define to 1 if your struct sockaddr_in6 has sin6_scope_id.])
844 #ifdef HAVE_WINDOWS_H
845 #ifndef WIN32_LEAN_AND_MEAN
846 #define WIN32_LEAN_AND_MEAN
849 #ifdef HAVE_WINSOCK2_H
850 #include <winsock2.h>
851 #ifdef HAVE_WS2TCPIP_H
852 #include <ws2tcpip.h>
856 #ifdef HAVE_SYS_TYPES_H
857 #include <sys/types.h>
859 #ifdef HAVE_NETINET_IN_H
860 #include <netinet/in.h>
865 dnl check for the addrinfo structure
866 AC_CHECK_MEMBER(struct addrinfo.ai_flags,
867 AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1,
868 [Define to 1 if you have struct addrinfo.]),,
871 #ifdef HAVE_WINDOWS_H
872 #ifndef WIN32_LEAN_AND_MEAN
873 #define WIN32_LEAN_AND_MEAN
876 #ifdef HAVE_WINSOCK2_H
877 #include <winsock2.h>
878 #ifdef HAVE_WS2TCPIP_H
879 #include <ws2tcpip.h>
883 #ifdef HAVE_SYS_TYPES_H
884 #include <sys/types.h>
886 #ifdef HAVE_NETINET_IN_H
887 #include <netinet/in.h>
889 #ifdef HAVE_SYS_SOCKET_H
890 #include <sys/socket.h>
900 AC_CHECK_FUNCS([bitncmp \
906 AC_MSG_CHECKING([deeper for $func])
914 eval "ac_cv_func_$func=yes"
915 AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$func])], [1],
916 [Define to 1 if you have the $func function.])
918 AC_MSG_RESULT([but still no])
923 dnl Check for inet_net_pton
924 AC_CHECK_FUNCS(inet_net_pton)
925 dnl Again, some systems have it, but not IPv6
926 if test "$ac_cv_func_inet_net_pton" = "yes" ; then
927 AC_MSG_CHECKING(if inet_net_pton supports IPv6)
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>
941 struct in6_addr addr6;
942 if (inet_net_pton(AF_INET6, "::1", &addr6, sizeof(addr6)) < 1)
949 AC_DEFINE_UNQUOTED(HAVE_INET_NET_PTON_IPV6,1,[Define to 1 if inet_net_pton supports IPv6.])
950 ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
954 AC_CHECK_SIZEOF(struct in6_addr, ,
957 #ifdef HAVE_WINDOWS_H
958 #ifndef WIN32_LEAN_AND_MEAN
959 #define WIN32_LEAN_AND_MEAN
962 #ifdef HAVE_WINSOCK2_H
963 #include <winsock2.h>
964 #ifdef HAVE_WS2TCPIP_H
965 #include <ws2tcpip.h>
969 #ifdef HAVE_SYS_TYPES_H
970 #include <sys/types.h>
972 #ifdef HAVE_SYS_SOCKET_H
973 #include <sys/socket.h>
975 #ifdef HAVE_NETINET_IN_H
976 #include <netinet/in.h>
982 AC_CHECK_SIZEOF(struct in_addr, ,
985 #ifdef HAVE_WINDOWS_H
986 #ifndef WIN32_LEAN_AND_MEAN
987 #define WIN32_LEAN_AND_MEAN
990 #ifdef HAVE_WINSOCK2_H
991 #include <winsock2.h>
992 #ifdef HAVE_WS2TCPIP_H
993 #include <ws2tcpip.h>
997 #ifdef HAVE_SYS_TYPES_H
998 #include <sys/types.h>
1000 #ifdef HAVE_SYS_SOCKET_H
1001 #include <sys/socket.h>
1003 #ifdef HAVE_NETINET_IN_H
1004 #include <netinet/in.h>
1011 dnl Check if the getnameinfo function is available
1012 dnl and get the types of five of its arguments.
1013 CURL_CHECK_FUNC_GETNAMEINFO
1016 CURL_CHECK_NONBLOCKING_SOCKET
1019 [AC_DEFINE(ARES_BIG_ENDIAN, 1,
1020 [define this if ares is built for a big endian system])],
1022 [AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])]
1025 dnl Check for user-specified random device
1027 AC_HELP_STRING([--with-random=FILE],
1028 [read randomness from FILE (default=/dev/urandom)]),
1029 [ RANDOM_FILE="$withval" ],
1031 dnl Check for random device. If we're cross compiling, we can't
1032 dnl check, and it's better to assume it doesn't exist than it is
1033 dnl to fail on AC_CHECK_FILE or later.
1034 if test "$cross_compiling" = "no"; then
1035 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
1037 AC_MSG_WARN([cannot check for /dev/urandom while cross compiling; assuming none])
1042 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
1043 AC_SUBST(RANDOM_FILE)
1044 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
1045 [a suitable file/device to read random data from])
1048 CARES_PRIVATE_LIBS="$LIBS"
1049 AC_SUBST(CARES_PRIVATE_LIBS)
1051 AC_CONFIG_FILES([Makefile libcares.pc])