3 AC_INIT([c-ares], [1.17.1],
4 [c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares])
6 CARES_VERSION_INFO="6:2:4"
7 dnl This flag accepts an argument of the form current[:revision[:age]]. So,
8 dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
11 dnl If either revision or age are omitted, they default to 0. Also note that age
12 dnl must be less than or equal to the current interface number.
14 dnl Here are a set of rules to help you update your library version information:
16 dnl 1.Start with version information of 0:0:0 for each libtool library.
18 dnl 2.Update the version information only immediately before a public release of
19 dnl your software. More frequent updates are unnecessary, and only guarantee
20 dnl that the current interface number gets larger faster.
22 dnl 3.If the library source code has changed at all since the last update, then
23 dnl increment revision (c:r+1:a)
25 dnl 4.If any interfaces have been added, removed, or changed since the last
26 dnl update, increment current, and set revision to 0. (c+1:r=0:a)
28 dnl 5.If any interfaces have been added since the last public release, then
29 dnl increment age. (c:r:a+1)
31 dnl 6.If any interfaces have been removed since the last public release, then
32 dnl set age to 0. (c:r:a=0)
34 AC_SUBST([CARES_VERSION_INFO])
38 CARES_OVERRIDE_AUTOCONF
40 AC_CONFIG_SRCDIR([src/lib/ares_ipv6.h])
41 AC_CONFIG_HEADERS([src/lib/ares_config.h include/ares_build.h])
42 AC_CONFIG_MACRO_DIR([m4])
44 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
46 CARES_CHECK_OPTION_DEBUG
47 CARES_CHECK_OPTION_OPTIMIZE
48 CARES_CHECK_OPTION_WARNINGS
49 CARES_CHECK_OPTION_WERROR
50 CARES_CHECK_OPTION_SYMBOL_HIDING
51 CARES_CHECK_OPTION_EXPOSE_STATICS
53 XC_CHECK_PATH_SEPARATOR
55 dnl SED is mandatory for configure process and libtool.
56 dnl Set it now, allowing it to be changed later.
57 AC_PATH_PROG([SED], [sed], [not_found],
58 [$PATH:/usr/bin:/usr/local/bin])
59 if test -z "$SED" || test "$SED" = "not_found"; then
60 AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
64 dnl GREP is mandatory for configure process and libtool.
65 dnl Set it now, allowing it to be changed later.
66 AC_PATH_PROG([GREP], [grep], [not_found],
67 [$PATH:/usr/bin:/usr/local/bin])
68 if test -z "$GREP" || test "$GREP" = "not_found"; then
69 AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
73 dnl EGREP is mandatory for configure process and libtool.
74 dnl Set it now, allowing it to be changed later.
75 if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
76 AC_MSG_CHECKING([for egrep])
78 AC_MSG_RESULT([$EGREP])
80 AC_PATH_PROG([EGREP], [egrep], [not_found],
81 [$PATH:/usr/bin:/usr/local/bin])
83 if test -z "$EGREP" || test "$EGREP" = "not_found"; then
84 AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
88 dnl AR is mandatory for configure process and libtool.
89 dnl This is target dependent, so check it as a tool.
90 if test -z "$AR"; then
91 dnl allow it to be overridden
92 AC_PATH_TOOL([AR], [ar], [not_found],
93 [$PATH:/usr/bin:/usr/local/bin])
94 if test -z "$AR" || test "$AR" = "not_found"; then
95 AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
104 dnl Detect the canonical host and target build environment
108 dnl Get system canonical name
109 AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
112 AX_CXX_COMPILE_STDCXX_11([noext],[optional])
116 dnl This defines _ALL_SOURCE for AIX
117 CARES_CHECK_AIX_ALL_SOURCE
119 dnl Our configure and build reentrant settings
120 CARES_CONFIGURE_THREAD_SAFE
121 CARES_CONFIGURE_REENTRANT
123 dnl check for how to do large files
128 AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
136 # Automake conditionals based on libtool related checks
139 AM_CONDITIONAL([CARES_LT_SHLIB_USE_VERSION_INFO],
140 [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
141 AM_CONDITIONAL([CARES_LT_SHLIB_USE_NO_UNDEFINED],
142 [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
143 AM_CONDITIONAL([CARES_LT_SHLIB_USE_MIMPURE_TEXT],
144 [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
147 # Due to libtool and automake machinery limitations of not allowing
148 # specifying separate CPPFLAGS or CFLAGS when compiling objects for
149 # inclusion of these in shared or static libraries, we are forced to
150 # build using separate configure runs for shared and static libraries
151 # on systems where different CPPFLAGS or CFLAGS are mandatory in order
152 # to compile objects for each kind of library. Notice that relying on
153 # the '-DPIC' CFLAG that libtool provides is not valid given that the
154 # user might for example choose to build static libraries with PIC.
158 # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
159 # targeting a static library and not building its shared counterpart.
162 AM_CONDITIONAL([USE_CPPFLAG_CARES_STATICLIB],
163 [test "x$xc_lt_build_static_only" = 'xyes'])
166 # Make staticlib CPPFLAG variable and its definition visible in output
167 # files unconditionally, providing an empty definition unless strictly
168 # targeting a static library and not building its shared counterpart.
171 CPPFLAG_CARES_STATICLIB=
172 if test "x$xc_lt_build_static_only" = 'xyes'; then
173 CPPFLAG_CARES_STATICLIB='-DCARES_STATICLIB'
175 AC_SUBST([CPPFLAG_CARES_STATICLIB])
177 dnl **********************************************************************
178 dnl platform/compiler/architecture specific checks/flags
179 dnl **********************************************************************
182 CARES_SET_COMPILER_BASIC_OPTS
183 CARES_SET_COMPILER_DEBUG_OPTS
184 CARES_SET_COMPILER_OPTIMIZE_OPTS
185 CARES_SET_COMPILER_WARNING_OPTS
187 if test "$compiler_id" = "INTEL_UNIX_C"; then
189 if test "$compiler_num" -ge "1000"; then
190 dnl icc 10.X or later
191 CFLAGS="$CFLAGS -shared-intel"
192 elif test "$compiler_num" -ge "900"; then
194 CFLAGS="$CFLAGS -i-dynamic"
199 CARES_CHECK_COMPILER_HALT_ON_ERROR
200 CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
201 CARES_CHECK_COMPILER_PROTOTYPE_MISMATCH
202 CARES_CHECK_COMPILER_SYMBOL_HIDING
204 dnl **********************************************************************
205 dnl Compilation based checks should not be done before this point.
206 dnl **********************************************************************
208 dnl **********************************************************************
209 dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
210 dnl and ws2tcpip.h take precedence over any other further checks which
211 dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
212 dnl this specific header files. And do them before its results are used.
213 dnl **********************************************************************
215 CURL_CHECK_HEADER_WINDOWS
216 CURL_CHECK_NATIVE_WINDOWS
217 case X-"$ac_cv_native_windows" in
219 CURL_CHECK_HEADER_WINSOCK
220 CURL_CHECK_HEADER_WINSOCK2
221 CURL_CHECK_HEADER_WS2TCPIP
222 CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600"
225 ac_cv_header_winsock_h="no"
226 ac_cv_header_winsock2_h="no"
227 ac_cv_header_ws2tcpip_h="no"
231 dnl **********************************************************************
232 dnl Checks for libraries.
233 dnl **********************************************************************
237 dnl gethostbyname without lib or in the nsl lib?
238 AC_CHECK_FUNC(gethostbyname,
239 [HAVE_GETHOSTBYNAME="1"
241 [ AC_CHECK_LIB(nsl, gethostbyname,
242 [HAVE_GETHOSTBYNAME="1"
247 if test "$HAVE_GETHOSTBYNAME" != "1"
249 dnl gethostbyname in the socket lib?
250 AC_CHECK_LIB(socket, gethostbyname,
251 [HAVE_GETHOSTBYNAME="1"
252 LIBS="$LIBS -lsocket"
256 dnl At least one system has been identified to require BOTH nsl and socket
257 dnl libs at the same time to link properly.
258 if test "$HAVE_GETHOSTBYNAME" != "1"
260 AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
261 my_ac_save_LIBS=$LIBS
262 LIBS="-lnsl -lsocket $LIBS"
270 HAVE_GETHOSTBYNAME="1"
273 LIBS=$my_ac_save_LIBS
277 if test "$HAVE_GETHOSTBYNAME" != "1"
279 dnl This is for winsock systems
280 if test "$ac_cv_header_windows_h" = "yes"; then
281 if test "$ac_cv_header_winsock_h" = "yes"; then
284 winsock_LIB="-lwinsock"
287 winsock_LIB="-lwsock32"
291 if test "$ac_cv_header_winsock2_h" = "yes"; then
292 winsock_LIB="-lws2_32"
294 if test ! -z "$winsock_LIB"; then
295 my_ac_save_LIBS=$LIBS
296 LIBS="$winsock_LIB $LIBS"
297 AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
300 #ifdef HAVE_WINDOWS_H
301 #ifndef WIN32_LEAN_AND_MEAN
302 #define WIN32_LEAN_AND_MEAN
305 #ifdef HAVE_WINSOCK2_H
306 #include <winsock2.h>
308 #ifdef HAVE_WINSOCK_H
314 gethostbyname("www.dummysite.com");
318 HAVE_GETHOSTBYNAME="1"
322 LIBS=$my_ac_save_LIBS
328 if test "$HAVE_GETHOSTBYNAME" != "1"
330 dnl This is for Minix 3.1
331 AC_MSG_CHECKING([for gethostbyname for Minix 3])
334 /* Older Minix versions may need <net/gen/netdb.h> here instead */
337 gethostbyname("www.dummysite.com");
341 HAVE_GETHOSTBYNAME="1"
347 if test "$HAVE_GETHOSTBYNAME" != "1"
349 dnl This is for eCos with a stubbed DNS implementation
350 AC_MSG_CHECKING([for gethostbyname for eCos])
356 gethostbyname("www.dummysite.com");
360 HAVE_GETHOSTBYNAME="1"
366 if test "$HAVE_GETHOSTBYNAME" != "1"
368 dnl gethostbyname in the net lib - for BeOS
369 AC_CHECK_LIB(net, gethostbyname,
370 [HAVE_GETHOSTBYNAME="1"
376 if test "$HAVE_GETHOSTBYNAME" != "1"; then
377 AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
380 dnl resolv lib for Apple (MacOS and iOS)
381 AS_IF([test "x$host_vendor" = "xapple"], [
382 AC_SEARCH_LIBS([res_servicename], [resolv], [
383 AC_DEFINE([CARES_USE_LIBRESOLV], [1], [Use resolver library to configure cares])
385 AC_MSG_ERROR([Unable to find libresolv which is required for iPhone targets])
390 AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
392 if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
393 AC_CHECK_LIB(resolve, strcasecmp,
394 [LIBS="-lresolve $LIBS"],
398 ac_cv_func_strcasecmp="no"
400 CARES_CHECK_LIBS_CONNECT
403 AS_IF([test "x$host_vendor" = "xapple"], [
404 AC_MSG_CHECKING([for iOS minimum version 10 or later])
408 #include <TargetConditionals.h>
410 #if TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000
411 #error Not iOS 10 or later
424 AS_IF([test "x$host_vendor" = "xapple"], [
425 AC_MSG_CHECKING([for macOS minimum version 10.12 or later])
429 #include <TargetConditionals.h>
431 #ifndef MAC_OS_X_VERSION_10_12
432 # define MAC_OS_X_VERSION_10_12 101200
434 #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
435 #error Not macOS 10.12 or later
441 ac_cv_macos_10_12="yes"
447 dnl **********************************************************************
448 dnl In case that function clock_gettime with monotonic timer is available,
449 dnl check for additional required libraries.
450 dnl **********************************************************************
451 dnl Xcode 8 bug: iOS when targeting less than 10, or macOS when targeting less than 10.12 will
452 dnl say clock_gettime exists, it is a weak symbol that only exists in iOS 10 or macOS 10.12 and will
453 dnl cause a crash at runtime when running on older versions. Skip finding CLOCK_MONOTONIC on older
455 if test "x$host_vendor" != "xapple" || test "x$ac_cv_ios_10" = "xyes" || test "x$ac_cv_macos_10_12" = "xyes"; then
456 CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
459 AC_MSG_CHECKING([whether to use libgcc])
460 AC_ARG_ENABLE(libgcc,
461 AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
462 [ case "$enableval" in
474 dnl Let's hope this split URL remains working:
475 dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
476 dnl genprogc/thread_quick_ref.htm
479 dnl **********************************************************************
480 dnl Back to "normal" configuring
481 dnl **********************************************************************
483 dnl Checks for header files.
486 CURL_CHECK_HEADER_MALLOC
487 CURL_CHECK_HEADER_MEMORY
489 dnl check for a few basic system headers we need
510 arpa/nameser_compat.h \
512 dnl to do if not found
518 #ifdef HAVE_SYS_TYPES_H
519 #include <sys/types.h>
521 #ifdef HAVE_SYS_TIME_H
522 #include <sys/time.h>
524 dnl We do this default-include simply to make sure that the nameser_compat.h
525 dnl header *REALLY* can be include after the new nameser.h. It seems AIX 5.1
526 dnl (and others?) is not designed to allow this.
527 #ifdef HAVE_ARPA_NAMESER_H
528 #include <arpa/nameser.h>
531 dnl *Sigh* these are needed in order for net/if.h to get properly detected.
532 #ifdef HAVE_SYS_SOCKET_H
533 #include <sys/socket.h>
535 #ifdef HAVE_NETINET_IN_H
536 #include <netinet/in.h>
541 dnl Checks for typedefs, structures, and compiler characteristics.
545 CURL_CHECK_STRUCT_TIMEVAL
547 AC_CHECK_TYPE(long long,
548 [AC_DEFINE(HAVE_LONGLONG, 1,
549 [Define to 1 if the compiler supports the 'long long' data type.])]
553 if test "xyes" = "x$longlong"; then
554 AC_MSG_CHECKING([if numberLL works])
558 long long val = 1000LL;
562 AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
570 AC_CHECK_TYPE(ssize_t, [ CARES_TYPEOF_ARES_SSIZE_T=ssize_t ],
571 [ CARES_TYPEOF_ARES_SSIZE_T=int ])
573 AC_DEFINE_UNQUOTED([CARES_TYPEOF_ARES_SSIZE_T], ${CARES_TYPEOF_ARES_SSIZE_T},
574 [the signed version of size_t])
577 # check for bool type
578 AC_CHECK_TYPE([bool],[
579 AC_DEFINE(HAVE_BOOL_T, 1,
580 [Define to 1 if bool is an available type.])
582 #ifdef HAVE_SYS_TYPES_H
583 #include <sys/types.h>
585 #ifdef HAVE_STDBOOL_H
590 CARES_CONFIGURE_ARES_SOCKLEN_T
594 TYPE_SOCKADDR_STORAGE
601 CURL_CHECK_FUNC_RECVFROM
603 CURL_CHECK_MSG_NOSIGNAL
605 CARES_CHECK_FUNC_CLOSESOCKET
606 CARES_CHECK_FUNC_CLOSESOCKET_CAMEL
607 CARES_CHECK_FUNC_CONNECT
608 CARES_CHECK_FUNC_FCNTL
609 CARES_CHECK_FUNC_FREEADDRINFO
610 CARES_CHECK_FUNC_GETADDRINFO
611 CARES_CHECK_FUNC_GETENV
612 CARES_CHECK_FUNC_GETHOSTBYADDR
613 CARES_CHECK_FUNC_GETHOSTBYNAME
614 CARES_CHECK_FUNC_GETHOSTNAME
615 CARES_CHECK_FUNC_GETSERVBYPORT_R
616 CARES_CHECK_FUNC_INET_NET_PTON
617 CARES_CHECK_FUNC_INET_NTOP
618 CARES_CHECK_FUNC_INET_PTON
619 CARES_CHECK_FUNC_IOCTL
620 CARES_CHECK_FUNC_IOCTLSOCKET
621 CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL
622 CARES_CHECK_FUNC_SETSOCKOPT
623 CARES_CHECK_FUNC_SOCKET
624 CARES_CHECK_FUNC_STRCASECMP
625 CARES_CHECK_FUNC_STRCMPI
626 CARES_CHECK_FUNC_STRDUP
627 CARES_CHECK_FUNC_STRICMP
628 CARES_CHECK_FUNC_STRNCASECMP
629 CARES_CHECK_FUNC_STRNCMPI
630 CARES_CHECK_FUNC_STRNICMP
631 CARES_CHECK_FUNC_WRITEV
634 dnl check for AF_INET6
635 CARES_CHECK_CONSTANT(
638 #ifdef HAVE_WINDOWS_H
639 #ifndef WIN32_LEAN_AND_MEAN
640 #define WIN32_LEAN_AND_MEAN
643 #ifdef HAVE_WINSOCK2_H
644 #include <winsock2.h>
647 #ifdef HAVE_SYS_TYPES_H
648 #include <sys/types.h>
650 #ifdef HAVE_SYS_SOCKET_H
651 #include <sys/socket.h>
655 AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.])
658 dnl check for PF_INET6
659 CARES_CHECK_CONSTANT(
662 #ifdef HAVE_WINDOWS_H
663 #ifndef WIN32_LEAN_AND_MEAN
664 #define WIN32_LEAN_AND_MEAN
667 #ifdef HAVE_WINSOCK2_H
668 #include <winsock2.h>
671 #ifdef HAVE_SYS_TYPES_H
672 #include <sys/types.h>
674 #ifdef HAVE_SYS_SOCKET_H
675 #include <sys/socket.h>
679 AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.])
683 dnl check for the in6_addr structure
687 #ifdef HAVE_WINDOWS_H
688 #ifndef WIN32_LEAN_AND_MEAN
689 #define WIN32_LEAN_AND_MEAN
692 #ifdef HAVE_WINSOCK2_H
693 #include <winsock2.h>
694 #ifdef HAVE_WS2TCPIP_H
695 #include <ws2tcpip.h>
699 #ifdef HAVE_SYS_TYPES_H
700 #include <sys/types.h>
702 #ifdef HAVE_NETINET_IN_H
703 #include <netinet/in.h>
707 AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.])
710 dnl check for the sockaddr_in6 structure
714 #ifdef HAVE_WINDOWS_H
715 #ifndef WIN32_LEAN_AND_MEAN
716 #define WIN32_LEAN_AND_MEAN
719 #ifdef HAVE_WINSOCK2_H
720 #include <winsock2.h>
721 #ifdef HAVE_WS2TCPIP_H
722 #include <ws2tcpip.h>
726 #ifdef HAVE_SYS_TYPES_H
727 #include <sys/types.h>
729 #ifdef HAVE_NETINET_IN_H
730 #include <netinet/in.h>
734 AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1,
735 [Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes
738 AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id,
739 AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1,
740 [Define to 1 if your struct sockaddr_in6 has sin6_scope_id.])
744 #ifdef HAVE_WINDOWS_H
745 #ifndef WIN32_LEAN_AND_MEAN
746 #define WIN32_LEAN_AND_MEAN
749 #ifdef HAVE_WINSOCK2_H
750 #include <winsock2.h>
751 #ifdef HAVE_WS2TCPIP_H
752 #include <ws2tcpip.h>
756 #ifdef HAVE_SYS_TYPES_H
757 #include <sys/types.h>
759 #ifdef HAVE_NETINET_IN_H
760 #include <netinet/in.h>
765 dnl check for the addrinfo structure
766 AC_CHECK_MEMBER(struct addrinfo.ai_flags,
767 AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1,
768 [Define to 1 if you have struct addrinfo.]),,
771 #ifdef HAVE_WINDOWS_H
772 #ifndef WIN32_LEAN_AND_MEAN
773 #define WIN32_LEAN_AND_MEAN
776 #ifdef HAVE_WINSOCK2_H
777 #include <winsock2.h>
778 #ifdef HAVE_WS2TCPIP_H
779 #include <ws2tcpip.h>
783 #ifdef HAVE_SYS_TYPES_H
784 #include <sys/types.h>
786 #ifdef HAVE_NETINET_IN_H
787 #include <netinet/in.h>
789 #ifdef HAVE_SYS_SOCKET_H
790 #include <sys/socket.h>
800 AC_CHECK_FUNCS([bitncmp \
806 AC_MSG_CHECKING([deeper for $func])
814 eval "ac_cv_func_$func=yes"
815 AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
816 [Define to 1 if you have the $func function.])
818 AC_MSG_RESULT([but still no])
822 dnl Android. Some variants like arm64 may no longer have __system_property_get
823 dnl in libc, but they are defined in the headers. Perform a link check.
824 AC_CHECK_FUNC([__system_property_get], [
825 AC_DEFINE([HAVE___SYSTEM_PROPERTY_GET], [1], [Define if __system_property_get exists.])
828 dnl Check if the getnameinfo function is available
829 dnl and get the types of five of its arguments.
830 CURL_CHECK_FUNC_GETNAMEINFO
834 [AC_DEFINE(ARES_BIG_ENDIAN, 1,
835 [define this if ares is built for a big endian system])],
837 [AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])]
840 dnl Check for user-specified random device
842 AC_HELP_STRING([--with-random=FILE],
843 [read randomness from FILE (default=/dev/urandom)]),
844 [ RANDOM_FILE="$withval" ],
846 dnl Check for random device. If we're cross compiling, we can't
847 dnl check, and it's better to assume it doesn't exist than it is
848 dnl to fail on AC_CHECK_FILE or later.
849 if test "$cross_compiling" = "no"; then
850 AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
852 AC_MSG_WARN([cannot check for /dev/urandom while cross compiling; assuming none])
857 if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
858 AC_SUBST(RANDOM_FILE)
859 AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
860 [a suitable file/device to read random data from])
863 CARES_CHECK_OPTION_NONBLOCKING
864 CARES_CHECK_NONBLOCKING_SOCKET
866 CARES_CONFIGURE_SYMBOL_HIDING
868 CARES_PRIVATE_LIBS="$LIBS"
869 AC_SUBST(CARES_PRIVATE_LIBS)
871 CARES_CFLAG_EXTRAS=""
872 if test X"$want_werror" = Xyes; then
873 CARES_CFLAG_EXTRAS="-Werror"
875 AC_SUBST(CARES_CFLAG_EXTRAS)
877 dnl squeeze whitespace out of some variables
885 squeeze CARES_PRIVATE_LIBS
889 AC_MSG_CHECKING([whether to build tests])
891 AC_HELP_STRING([--enable-tests], [build test suite]),
892 [ build_tests="$enableval" ],
893 [ if test "x$HAVE_CXX11" = "x1" && test "x$cross_compiling" = "xno" ; then
901 if test "x$build_tests" = "xyes" ; then
902 if test "x$HAVE_CXX11" = "0" ; then
903 AC_MSG_ERROR([*** Building tests requires a CXX11 compiler])
905 if test "x$cross_compiling" = "xyes" ; then
906 AC_MSG_ERROR([*** Tests not supported when cross compiling])
909 AC_MSG_RESULT([$build_tests])
912 BUILD_SUBDIRS="include src docs"
913 if test "x$build_tests" = "xyes" ; then
914 AC_CONFIG_SUBDIRS([test])
915 BUILD_SUBDIRS="${BUILD_SUBDIRS} test"
918 AC_SUBST(BUILD_SUBDIRS)
920 AC_CONFIG_FILES([Makefile \
929 XC_AMEND_DISTCLEAN(['.'])