1 #***************************************************************************
4 # Copyright (C) 2008 by Daniel Stenberg et al
6 # Permission to use, copy, modify, and distribute this software and its
7 # documentation for any purpose and without fee is hereby granted, provided
8 # that the above copyright notice appear in all copies and that both that
9 # copyright notice and this permission notice appear in supporting
10 # documentation, and that the name of M.I.T. not be used in advertising or
11 # publicity pertaining to distribution of the software without specific,
12 # written prior permission. M.I.T. makes no representations about the
13 # suitability of this software for any purpose. It is provided "as is"
14 # without express or implied warranty.
16 #***************************************************************************
18 # File version for 'aclocal' use. Keep it a single number.
22 dnl CARES_INCLUDES_ARPA_INET
23 dnl -------------------------------------------------
24 dnl Set up variable with list of headers that must be
25 dnl included when arpa/inet.h is to be included.
27 AC_DEFUN([CARES_INCLUDES_ARPA_INET], [
28 cares_includes_arpa_inet="\
30 #ifdef HAVE_SYS_TYPES_H
31 # include <sys/types.h>
33 #ifdef HAVE_SYS_SOCKET_H
34 # include <sys/socket.h>
36 #ifdef HAVE_NETINET_IN_H
37 # include <netinet/in.h>
39 #ifdef HAVE_ARPA_INET_H
40 # include <arpa_inet.h>
44 sys/types.h sys/socket.h netinet/in.h arpa/inet.h,
45 [], [], [$cares_includes_arpa_inet])
49 dnl CARES_INCLUDES_FCNTL
50 dnl -------------------------------------------------
51 dnl Set up variable with list of headers that must be
52 dnl included when fcntl.h is to be included.
54 AC_DEFUN([CARES_INCLUDES_FCNTL], [
55 cares_includes_fcntl="\
57 #ifdef HAVE_SYS_TYPES_H
58 # include <sys/types.h>
68 sys/types.h unistd.h fcntl.h,
69 [], [], [$cares_includes_fcntl])
73 dnl CARES_INCLUDES_NETDB
74 dnl -------------------------------------------------
75 dnl Set up variable with list of headers that must be
76 dnl included when netdb.h is to be included.
78 AC_DEFUN([CARES_INCLUDES_NETDB], [
79 cares_includes_netdb="\
81 #ifdef HAVE_SYS_TYPES_H
82 # include <sys/types.h>
90 [], [], [$cares_includes_netdb])
94 dnl CARES_INCLUDES_STDLIB
95 dnl -------------------------------------------------
96 dnl Set up variable with list of headers that must be
97 dnl included when stdlib.h is to be included.
99 AC_DEFUN([CARES_INCLUDES_STDLIB], [
100 cares_includes_stdlib="\
102 #ifdef HAVE_SYS_TYPES_H
103 # include <sys/types.h>
110 sys/types.h stdlib.h,
111 [], [], [$cares_includes_stdlib])
115 dnl CARES_INCLUDES_STRING
116 dnl -------------------------------------------------
117 dnl Set up variable with list of headers that must be
118 dnl included when string(s).h is to be included.
120 AC_DEFUN([CARES_INCLUDES_STRING], [
121 cares_includes_string="\
123 #ifdef HAVE_SYS_TYPES_H
124 # include <sys/types.h>
129 #ifdef HAVE_STRINGS_H
130 # include <strings.h>
134 sys/types.h string.h strings.h,
135 [], [], [$cares_includes_string])
139 dnl CARES_INCLUDES_STROPTS
140 dnl -------------------------------------------------
141 dnl Set up variable with list of headers that must be
142 dnl included when stropts.h is to be included.
144 AC_DEFUN([CARES_INCLUDES_STROPTS], [
145 cares_includes_stropts="\
147 #ifdef HAVE_SYS_TYPES_H
148 # include <sys/types.h>
153 #ifdef HAVE_SYS_SOCKET_H
154 # include <sys/socket.h>
156 #ifdef HAVE_SYS_IOCTL_H
157 # include <sys/ioctl.h>
159 #ifdef HAVE_STROPTS_H
160 # include <stropts.h>
164 sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h,
165 [], [], [$cares_includes_stropts])
169 dnl CARES_INCLUDES_SYS_SOCKET
170 dnl -------------------------------------------------
171 dnl Set up variable with list of headers that must be
172 dnl included when sys/socket.h is to be included.
174 AC_DEFUN([CARES_INCLUDES_SYS_SOCKET], [
175 cares_includes_sys_socket="\
177 #ifdef HAVE_SYS_TYPES_H
178 # include <sys/types.h>
180 #ifdef HAVE_SYS_SOCKET_H
181 # include <sys/socket.h>
185 sys/types.h sys/socket.h,
186 [], [], [$cares_includes_sys_socket])
190 dnl CARES_INCLUDES_SYS_UIO
191 dnl -------------------------------------------------
192 dnl Set up variable with list of headers that must be
193 dnl included when sys/uio.h is to be included.
195 AC_DEFUN([CARES_INCLUDES_SYS_UIO], [
196 cares_includes_sys_uio="\
198 #ifdef HAVE_SYS_TYPES_H
199 # include <sys/types.h>
201 #ifdef HAVE_SYS_UIO_H
202 # include <sys/uio.h>
206 sys/types.h sys/uio.h,
207 [], [], [$cares_includes_sys_uio])
211 dnl CARES_INCLUDES_UNISTD
212 dnl -------------------------------------------------
213 dnl Set up variable with list of headers that must be
214 dnl included when unistd.h is to be included.
216 AC_DEFUN([CARES_INCLUDES_UNISTD], [
217 cares_includes_unistd="\
219 #ifdef HAVE_SYS_TYPES_H
220 # include <sys/types.h>
227 sys/types.h unistd.h,
228 [], [], [$cares_includes_unistd])
232 dnl CARES_INCLUDES_WINSOCK2
233 dnl -------------------------------------------------
234 dnl Set up variable with list of headers that must be
235 dnl included when winsock(2).h is to be included.
237 AC_DEFUN([CARES_INCLUDES_WINSOCK2], [
238 cares_includes_winsock2="\
240 #ifdef HAVE_WINDOWS_H
241 # ifndef WIN32_LEAN_AND_MEAN
242 # define WIN32_LEAN_AND_MEAN
244 # include <windows.h>
245 # ifdef HAVE_WINSOCK2_H
246 # include <winsock2.h>
248 # ifdef HAVE_WINSOCK_H
249 # include <winsock.h>
254 CURL_CHECK_HEADER_WINDOWS
255 CURL_CHECK_HEADER_WINSOCK
256 CURL_CHECK_HEADER_WINSOCK2
260 dnl CARES_INCLUDES_WS2TCPIP
261 dnl -------------------------------------------------
262 dnl Set up variable with list of headers that must be
263 dnl included when ws2tcpip.h is to be included.
265 AC_DEFUN([CARES_INCLUDES_WS2TCPIP], [
266 cares_includes_ws2tcpip="\
268 #ifdef HAVE_WINDOWS_H
269 # ifndef WIN32_LEAN_AND_MEAN
270 # define WIN32_LEAN_AND_MEAN
272 # include <windows.h>
273 # ifdef HAVE_WINSOCK2_H
274 # include <winsock2.h>
275 # ifdef HAVE_WS2TCPIP_H
276 # include <ws2tcpip.h>
281 CURL_CHECK_HEADER_WINDOWS
282 CURL_CHECK_HEADER_WINSOCK2
283 CURL_CHECK_HEADER_WS2TCPIP
287 dnl CARES_CHECK_FUNC_FCNTL
288 dnl -------------------------------------------------
289 dnl Verify if fcntl is available, prototyped, and
290 dnl can be compiled. If all of these are true, and
291 dnl usage has not been previously disallowed with
292 dnl shell variable cares_disallow_fcntl, then
293 dnl HAVE_FCNTL will be defined.
295 AC_DEFUN([CARES_CHECK_FUNC_FCNTL], [
296 AC_REQUIRE([CARES_INCLUDES_FCNTL])dnl
298 tst_links_fcntl="unknown"
299 tst_proto_fcntl="unknown"
300 tst_compi_fcntl="unknown"
301 tst_allow_fcntl="unknown"
303 AC_MSG_CHECKING([if fcntl can be linked])
305 AC_LANG_FUNC_LINK_TRY([fcntl])
308 tst_links_fcntl="yes"
314 if test "$tst_links_fcntl" = "yes"; then
315 AC_MSG_CHECKING([if fcntl is prototyped])
316 AC_EGREP_CPP([fcntl],[
317 $cares_includes_fcntl
320 tst_proto_fcntl="yes"
327 if test "$tst_proto_fcntl" = "yes"; then
328 AC_MSG_CHECKING([if fcntl is compilable])
331 $cares_includes_fcntl
333 if(0 != fcntl(0, 0, 0))
338 tst_compi_fcntl="yes"
345 if test "$tst_compi_fcntl" = "yes"; then
346 AC_MSG_CHECKING([if fcntl usage allowed])
347 if test "x$cares_disallow_fcntl" != "xyes"; then
349 tst_allow_fcntl="yes"
356 AC_MSG_CHECKING([if fcntl might be used])
357 if test "$tst_links_fcntl" = "yes" &&
358 test "$tst_proto_fcntl" = "yes" &&
359 test "$tst_compi_fcntl" = "yes" &&
360 test "$tst_allow_fcntl" = "yes"; then
362 AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1,
363 [Define to 1 if you have the fcntl function.])
364 ac_cv_func_fcntl="yes"
365 CARES_CHECK_FUNC_FCNTL_O_NONBLOCK
368 ac_cv_func_fcntl="no"
373 dnl CARES_CHECK_FUNC_FCNTL_O_NONBLOCK
374 dnl -------------------------------------------------
375 dnl Verify if fcntl with status flag O_NONBLOCK is
376 dnl available, can be compiled, and seems to work. If
377 dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK
380 AC_DEFUN([CARES_CHECK_FUNC_FCNTL_O_NONBLOCK], [
382 tst_compi_fcntl_o_nonblock="unknown"
383 tst_allow_fcntl_o_nonblock="unknown"
386 sunos4* | aix3* | beos*)
387 dnl O_NONBLOCK does not work on these platforms
388 cares_disallow_fcntl_o_nonblock="yes"
392 if test "$ac_cv_func_fcntl" = "yes"; then
393 AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable])
396 $cares_includes_fcntl
399 if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
404 tst_compi_fcntl_o_nonblock="yes"
407 tst_compi_fcntl_o_nonblock="no"
411 if test "$tst_compi_fcntl_o_nonblock" = "yes"; then
412 AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed])
413 if test "x$cares_disallow_fcntl_o_nonblock" != "xyes"; then
415 tst_allow_fcntl_o_nonblock="yes"
418 tst_allow_fcntl_o_nonblock="no"
422 AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used])
423 if test "$tst_compi_fcntl_o_nonblock" = "yes" &&
424 test "$tst_allow_fcntl_o_nonblock" = "yes"; then
426 AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1,
427 [Define to 1 if you have a working fcntl O_NONBLOCK function.])
428 ac_cv_func_fcntl_o_nonblock="yes"
431 ac_cv_func_fcntl_o_nonblock="no"
436 dnl CARES_CHECK_FUNC_FREEADDRINFO
437 dnl -------------------------------------------------
438 dnl Verify if freeaddrinfo is available, prototyped,
439 dnl and can be compiled. If all of these are true,
440 dnl and usage has not been previously disallowed with
441 dnl shell variable cares_disallow_freeaddrinfo, then
442 dnl HAVE_FREEADDRINFO will be defined.
444 AC_DEFUN([CARES_CHECK_FUNC_FREEADDRINFO], [
445 AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl
446 AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
447 AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
449 tst_links_freeaddrinfo="unknown"
450 tst_proto_freeaddrinfo="unknown"
451 tst_compi_freeaddrinfo="unknown"
452 tst_allow_freeaddrinfo="unknown"
454 AC_MSG_CHECKING([if freeaddrinfo can be linked])
457 $cares_includes_ws2tcpip
458 $cares_includes_sys_socket
459 $cares_includes_netdb
465 tst_links_freeaddrinfo="yes"
468 tst_links_freeaddrinfo="no"
471 if test "$tst_links_freeaddrinfo" = "yes"; then
472 AC_MSG_CHECKING([if freeaddrinfo is prototyped])
473 AC_EGREP_CPP([freeaddrinfo],[
474 $cares_includes_ws2tcpip
475 $cares_includes_sys_socket
476 $cares_includes_netdb
479 tst_proto_freeaddrinfo="yes"
482 tst_proto_freeaddrinfo="no"
486 if test "$tst_proto_freeaddrinfo" = "yes"; then
487 AC_MSG_CHECKING([if freeaddrinfo is compilable])
490 $cares_includes_ws2tcpip
491 $cares_includes_sys_socket
492 $cares_includes_netdb
498 tst_compi_freeaddrinfo="yes"
501 tst_compi_freeaddrinfo="no"
505 if test "$tst_compi_freeaddrinfo" = "yes"; then
506 AC_MSG_CHECKING([if freeaddrinfo usage allowed])
507 if test "x$cares_disallow_freeaddrinfo" != "xyes"; then
509 tst_allow_freeaddrinfo="yes"
512 tst_allow_freeaddrinfo="no"
516 AC_MSG_CHECKING([if freeaddrinfo might be used])
517 if test "$tst_links_freeaddrinfo" = "yes" &&
518 test "$tst_proto_freeaddrinfo" = "yes" &&
519 test "$tst_compi_freeaddrinfo" = "yes" &&
520 test "$tst_allow_freeaddrinfo" = "yes"; then
522 AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
523 [Define to 1 if you have the freeaddrinfo function.])
524 ac_cv_func_freeaddrinfo="yes"
527 ac_cv_func_freeaddrinfo="no"
532 dnl CARES_CHECK_FUNC_GETADDRINFO
533 dnl -------------------------------------------------
534 dnl Verify if getaddrinfo is available, prototyped, can
535 dnl be compiled and seems to work. If all of these are
536 dnl true, and usage has not been previously disallowed
537 dnl with shell variable cares_disallow_getaddrinfo, then
538 dnl HAVE_GETADDRINFO will be defined.
540 AC_DEFUN([CARES_CHECK_FUNC_GETADDRINFO], [
541 AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl
542 AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl
543 AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
544 AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
546 tst_links_getaddrinfo="unknown"
547 tst_proto_getaddrinfo="unknown"
548 tst_compi_getaddrinfo="unknown"
549 tst_works_getaddrinfo="unknown"
550 tst_allow_getaddrinfo="unknown"
552 AC_MSG_CHECKING([if getaddrinfo can be linked])
555 $cares_includes_ws2tcpip
556 $cares_includes_sys_socket
557 $cares_includes_netdb
559 if(0 != getaddrinfo(0, 0, 0, 0))
564 tst_links_getaddrinfo="yes"
567 tst_links_getaddrinfo="no"
570 if test "$tst_links_getaddrinfo" = "yes"; then
571 AC_MSG_CHECKING([if getaddrinfo is prototyped])
572 AC_EGREP_CPP([getaddrinfo],[
573 $cares_includes_ws2tcpip
574 $cares_includes_sys_socket
575 $cares_includes_netdb
578 tst_proto_getaddrinfo="yes"
581 tst_proto_getaddrinfo="no"
585 if test "$tst_proto_getaddrinfo" = "yes"; then
586 AC_MSG_CHECKING([if getaddrinfo is compilable])
589 $cares_includes_ws2tcpip
590 $cares_includes_sys_socket
591 $cares_includes_netdb
593 if(0 != getaddrinfo(0, 0, 0, 0))
598 tst_compi_getaddrinfo="yes"
601 tst_compi_getaddrinfo="no"
605 dnl only do runtime verification when not cross-compiling
606 if test "x$cross_compiling" != "xyes" &&
607 test "$tst_compi_getaddrinfo" = "yes"; then
608 AC_MSG_CHECKING([if getaddrinfo seems to work])
611 $cares_includes_ws2tcpip
612 $cares_includes_stdlib
613 $cares_includes_sys_socket
614 $cares_includes_netdb
616 struct addrinfo hints;
617 struct addrinfo *ai = 0;
620 memset(&hints, 0, sizeof(hints));
621 hints.ai_flags = AI_NUMERICHOST;
622 hints.ai_family = AF_UNSPEC;
623 hints.ai_socktype = SOCK_STREAM;
624 error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
632 tst_works_getaddrinfo="yes"
635 tst_works_getaddrinfo="no"
639 if test "$tst_compi_getaddrinfo" = "yes" &&
640 test "$tst_works_getaddrinfo" != "no"; then
641 AC_MSG_CHECKING([if getaddrinfo usage allowed])
642 if test "x$cares_disallow_getaddrinfo" != "xyes"; then
644 tst_allow_getaddrinfo="yes"
647 tst_allow_getaddrinfo="no"
651 AC_MSG_CHECKING([if getaddrinfo might be used])
652 if test "$tst_links_getaddrinfo" = "yes" &&
653 test "$tst_proto_getaddrinfo" = "yes" &&
654 test "$tst_compi_getaddrinfo" = "yes" &&
655 test "$tst_allow_getaddrinfo" = "yes" &&
656 test "$tst_works_getaddrinfo" != "no"; then
658 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
659 [Define to 1 if you have a working getaddrinfo function.])
660 ac_cv_func_getaddrinfo="yes"
663 ac_cv_func_getaddrinfo="no"
668 dnl CARES_CHECK_FUNC_GETHOSTNAME
669 dnl -------------------------------------------------
670 dnl Verify if gethostname is available, prototyped, and
671 dnl can be compiled. If all of these are true, and
672 dnl usage has not been previously disallowed with
673 dnl shell variable cares_disallow_gethostname, then
674 dnl HAVE_GETHOSTNAME will be defined.
676 AC_DEFUN([CARES_CHECK_FUNC_GETHOSTNAME], [
677 AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
678 AC_REQUIRE([CARES_INCLUDES_UNISTD])dnl
680 tst_links_gethostname="unknown"
681 tst_proto_gethostname="unknown"
682 tst_compi_gethostname="unknown"
683 tst_allow_gethostname="unknown"
685 AC_MSG_CHECKING([if gethostname can be linked])
688 $cares_includes_winsock2
689 $cares_includes_unistd
691 if(0 != gethostname(0, 0))
696 tst_links_gethostname="yes"
699 tst_links_gethostname="no"
702 if test "$tst_links_gethostname" = "yes"; then
703 AC_MSG_CHECKING([if gethostname is prototyped])
704 AC_EGREP_CPP([gethostname],[
705 $cares_includes_winsock2
706 $cares_includes_unistd
709 tst_proto_gethostname="yes"
712 tst_proto_gethostname="no"
716 if test "$tst_proto_gethostname" = "yes"; then
717 AC_MSG_CHECKING([if gethostname is compilable])
720 $cares_includes_winsock2
721 $cares_includes_unistd
723 if(0 != gethostname(0, 0))
728 tst_compi_gethostname="yes"
731 tst_compi_gethostname="no"
735 if test "$tst_compi_gethostname" = "yes"; then
736 AC_MSG_CHECKING([if gethostname usage allowed])
737 if test "x$cares_disallow_gethostname" != "xyes"; then
739 tst_allow_gethostname="yes"
742 tst_allow_gethostname="no"
746 AC_MSG_CHECKING([if gethostname might be used])
747 if test "$tst_links_gethostname" = "yes" &&
748 test "$tst_proto_gethostname" = "yes" &&
749 test "$tst_compi_gethostname" = "yes" &&
750 test "$tst_allow_gethostname" = "yes"; then
752 AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
753 [Define to 1 if you have the gethostname function.])
754 ac_cv_func_gethostname="yes"
757 ac_cv_func_gethostname="no"
762 dnl CARES_CHECK_FUNC_GETSERVBYPORT_R
763 dnl -------------------------------------------------
764 dnl Verify if getservbyport_r is available, prototyped,
765 dnl and can be compiled. If all of these are true, and
766 dnl usage has not been previously disallowed with
767 dnl shell variable cares_disallow_getservbyport_r, then
768 dnl HAVE_GETSERVBYPORT_R will be defined.
770 AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYPORT_R], [
771 AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
773 tst_links_getservbyport_r="unknown"
774 tst_proto_getservbyport_r="unknown"
775 tst_compi_getservbyport_r="unknown"
776 tst_allow_getservbyport_r="unknown"
777 tst_nargs_getservbyport_r="unknown"
779 AC_MSG_CHECKING([if getservbyport_r can be linked])
781 AC_LANG_FUNC_LINK_TRY([getservbyport_r])
784 tst_links_getservbyport_r="yes"
787 tst_links_getservbyport_r="no"
790 if test "$tst_links_getservbyport_r" = "yes"; then
791 AC_MSG_CHECKING([if getservbyport_r is prototyped])
792 AC_EGREP_CPP([getservbyport_r],[
793 $cares_includes_netdb
796 tst_proto_getservbyport_r="yes"
799 tst_proto_getservbyport_r="no"
803 if test "$tst_proto_getservbyport_r" = "yes"; then
804 if test "$tst_nargs_getservbyport_r" = "unknown"; then
805 AC_MSG_CHECKING([if getservbyport_r takes 4 args.])
808 $cares_includes_netdb
810 if(0 != getservbyport_r(0, 0, 0, 0))
815 tst_compi_getservbyport_r="yes"
816 tst_nargs_getservbyport_r="4"
819 tst_compi_getservbyport_r="no"
822 if test "$tst_nargs_getservbyport_r" = "unknown"; then
823 AC_MSG_CHECKING([if getservbyport_r takes 5 args.])
826 $cares_includes_netdb
828 if(0 != getservbyport_r(0, 0, 0, 0, 0))
833 tst_compi_getservbyport_r="yes"
834 tst_nargs_getservbyport_r="5"
837 tst_compi_getservbyport_r="no"
840 if test "$tst_nargs_getservbyport_r" = "unknown"; then
841 AC_MSG_CHECKING([if getservbyport_r takes 6 args.])
844 $cares_includes_netdb
846 if(0 != getservbyport_r(0, 0, 0, 0, 0, 0))
851 tst_compi_getservbyport_r="yes"
852 tst_nargs_getservbyport_r="6"
855 tst_compi_getservbyport_r="no"
858 AC_MSG_CHECKING([if getservbyport_r is compilable])
859 if test "$tst_compi_getservbyport_r" = "yes"; then
866 if test "$tst_compi_getservbyport_r" = "yes"; then
867 AC_MSG_CHECKING([if getservbyport_r usage allowed])
868 if test "x$cares_disallow_getservbyport_r" != "xyes"; then
870 tst_allow_getservbyport_r="yes"
873 tst_allow_getservbyport_r="no"
877 AC_MSG_CHECKING([if getservbyport_r might be used])
878 if test "$tst_links_getservbyport_r" = "yes" &&
879 test "$tst_proto_getservbyport_r" = "yes" &&
880 test "$tst_compi_getservbyport_r" = "yes" &&
881 test "$tst_allow_getservbyport_r" = "yes"; then
883 AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1,
884 [Define to 1 if you have the getservbyport_r function.])
885 AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r,
886 [Specifies the number of arguments to getservbyport_r])
887 if test "$tst_nargs_getservbyport_r" -eq "4"; then
888 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
889 [Specifies the size of the buffer to pass to getservbyport_r])
891 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
892 [Specifies the size of the buffer to pass to getservbyport_r])
894 ac_cv_func_getservbyport_r="yes"
897 ac_cv_func_getservbyport_r="no"
902 dnl CARES_CHECK_FUNC_INET_NTOP
903 dnl -------------------------------------------------
904 dnl Verify if inet_ntop is available, prototyped, can
905 dnl be compiled and seems to work. If all of these are
906 dnl true, and usage has not been previously disallowed
907 dnl with shell variable cares_disallow_inet_ntop, then
908 dnl HAVE_INET_NTOP will be defined.
910 AC_DEFUN([CARES_CHECK_FUNC_INET_NTOP], [
911 AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl
912 AC_REQUIRE([CARES_INCLUDES_ARPA_INET])dnl
913 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
915 tst_links_inet_ntop="unknown"
916 tst_proto_inet_ntop="unknown"
917 tst_compi_inet_ntop="unknown"
918 tst_works_inet_ntop="unknown"
919 tst_allow_inet_ntop="unknown"
921 AC_MSG_CHECKING([if inet_ntop can be linked])
923 AC_LANG_FUNC_LINK_TRY([inet_ntop])
926 tst_links_inet_ntop="yes"
929 tst_links_inet_ntop="no"
932 if test "$tst_links_inet_ntop" = "yes"; then
933 AC_MSG_CHECKING([if inet_ntop is prototyped])
934 AC_EGREP_CPP([inet_ntop],[
935 $cares_includes_arpa_inet
938 tst_proto_inet_ntop="yes"
941 tst_proto_inet_ntop="no"
945 if test "$tst_proto_inet_ntop" = "yes"; then
946 AC_MSG_CHECKING([if inet_ntop is compilable])
949 $cares_includes_arpa_inet
951 if(0 != inet_ntop(0, 0, 0, 0))
956 tst_compi_inet_ntop="yes"
959 tst_compi_inet_ntop="no"
963 dnl only do runtime verification when not cross-compiling
964 if test "x$cross_compiling" != "xyes" &&
965 test "$tst_compi_inet_ntop" = "yes"; then
966 AC_MSG_CHECKING([if inet_ntop seems to work])
969 $cares_includes_stdlib
970 $cares_includes_arpa_inet
971 $cares_includes_string
973 char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
974 char ipv4res[sizeof "255.255.255.255"];
975 unsigned char ipv6a[26];
976 unsigned char ipv4a[5];
987 ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
990 if(ipv4ptr != ipv4res)
994 if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
998 memset(ipv6a, 0, sizeof(ipv6a));
1011 ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
1014 if(ipv6ptr != ipv6res)
1018 if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
1024 AC_MSG_RESULT([yes])
1025 tst_works_inet_ntop="yes"
1028 tst_works_inet_ntop="no"
1032 if test "$tst_compi_inet_ntop" = "yes" &&
1033 test "$tst_works_inet_ntop" != "no"; then
1034 AC_MSG_CHECKING([if inet_ntop usage allowed])
1035 if test "x$cares_disallow_inet_ntop" != "xyes"; then
1036 AC_MSG_RESULT([yes])
1037 tst_allow_inet_ntop="yes"
1040 tst_allow_inet_ntop="no"
1044 AC_MSG_CHECKING([if inet_ntop might be used])
1045 if test "$tst_links_inet_ntop" = "yes" &&
1046 test "$tst_proto_inet_ntop" = "yes" &&
1047 test "$tst_compi_inet_ntop" = "yes" &&
1048 test "$tst_allow_inet_ntop" = "yes" &&
1049 test "$tst_works_inet_ntop" != "no"; then
1050 AC_MSG_RESULT([yes])
1051 AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1,
1052 [Define to 1 if you have a IPv6 capable working inet_ntop function.])
1053 ac_cv_func_inet_ntop="yes"
1056 ac_cv_func_inet_ntop="no"
1061 dnl CARES_CHECK_FUNC_INET_PTON
1062 dnl -------------------------------------------------
1063 dnl Verify if inet_pton is available, prototyped, can
1064 dnl be compiled and seems to work. If all of these are
1065 dnl true, and usage has not been previously disallowed
1066 dnl with shell variable cares_disallow_inet_pton, then
1067 dnl HAVE_INET_PTON will be defined.
1069 AC_DEFUN([CARES_CHECK_FUNC_INET_PTON], [
1070 AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl
1071 AC_REQUIRE([CARES_INCLUDES_ARPA_INET])dnl
1072 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1074 tst_links_inet_pton="unknown"
1075 tst_proto_inet_pton="unknown"
1076 tst_compi_inet_pton="unknown"
1077 tst_works_inet_pton="unknown"
1078 tst_allow_inet_pton="unknown"
1080 AC_MSG_CHECKING([if inet_pton can be linked])
1082 AC_LANG_FUNC_LINK_TRY([inet_pton])
1084 AC_MSG_RESULT([yes])
1085 tst_links_inet_pton="yes"
1088 tst_links_inet_pton="no"
1091 if test "$tst_links_inet_pton" = "yes"; then
1092 AC_MSG_CHECKING([if inet_pton is prototyped])
1093 AC_EGREP_CPP([inet_pton],[
1094 $cares_includes_arpa_inet
1096 AC_MSG_RESULT([yes])
1097 tst_proto_inet_pton="yes"
1100 tst_proto_inet_pton="no"
1104 if test "$tst_proto_inet_pton" = "yes"; then
1105 AC_MSG_CHECKING([if inet_pton is compilable])
1108 $cares_includes_arpa_inet
1110 if(0 != inet_pton(0, 0, 0))
1114 AC_MSG_RESULT([yes])
1115 tst_compi_inet_pton="yes"
1118 tst_compi_inet_pton="no"
1122 dnl only do runtime verification when not cross-compiling
1123 if test "x$cross_compiling" != "xyes" &&
1124 test "$tst_compi_inet_pton" = "yes"; then
1125 AC_MSG_CHECKING([if inet_pton seems to work])
1128 $cares_includes_stdlib
1129 $cares_includes_arpa_inet
1130 $cares_includes_string
1132 unsigned char ipv6a[26];
1133 unsigned char ipv4a[5];
1134 const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
1135 const char *ipv4src = "192.168.100.1";
1137 memset(ipv4a, 1, sizeof(ipv4a));
1138 if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
1141 if( (ipv4a[0] != 0xc0) ||
1142 (ipv4a[1] != 0xa8) ||
1143 (ipv4a[2] != 0x64) ||
1144 (ipv4a[3] != 0x01) ||
1145 (ipv4a[4] != 0x01) )
1148 memset(ipv6a, 1, sizeof(ipv6a));
1149 if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
1153 memset(ipv6a, 0, sizeof(ipv6a));
1154 if( (ipv6a[0] != 0xfe) ||
1155 (ipv6a[1] != 0x80) ||
1156 (ipv6a[8] != 0x02) ||
1157 (ipv6a[9] != 0x14) ||
1158 (ipv6a[10] != 0x4f) ||
1159 (ipv6a[11] != 0xff) ||
1160 (ipv6a[12] != 0xfe) ||
1161 (ipv6a[13] != 0x0b) ||
1162 (ipv6a[14] != 0x76) ||
1163 (ipv6a[15] != 0xc8) ||
1164 (ipv6a[25] != 0x01) )
1167 if( (ipv6a[2] != 0x0) ||
1168 (ipv6a[3] != 0x0) ||
1169 (ipv6a[4] != 0x0) ||
1170 (ipv6a[5] != 0x0) ||
1171 (ipv6a[6] != 0x0) ||
1172 (ipv6a[7] != 0x0) ||
1173 (ipv6a[16] != 0x0) ||
1174 (ipv6a[17] != 0x0) ||
1175 (ipv6a[18] != 0x0) ||
1176 (ipv6a[19] != 0x0) ||
1177 (ipv6a[20] != 0x0) ||
1178 (ipv6a[21] != 0x0) ||
1179 (ipv6a[22] != 0x0) ||
1180 (ipv6a[23] != 0x0) ||
1181 (ipv6a[24] != 0x0) )
1187 AC_MSG_RESULT([yes])
1188 tst_works_inet_pton="yes"
1191 tst_works_inet_pton="no"
1195 if test "$tst_compi_inet_pton" = "yes" &&
1196 test "$tst_works_inet_pton" != "no"; then
1197 AC_MSG_CHECKING([if inet_pton usage allowed])
1198 if test "x$cares_disallow_inet_pton" != "xyes"; then
1199 AC_MSG_RESULT([yes])
1200 tst_allow_inet_pton="yes"
1203 tst_allow_inet_pton="no"
1207 AC_MSG_CHECKING([if inet_pton might be used])
1208 if test "$tst_links_inet_pton" = "yes" &&
1209 test "$tst_proto_inet_pton" = "yes" &&
1210 test "$tst_compi_inet_pton" = "yes" &&
1211 test "$tst_allow_inet_pton" = "yes" &&
1212 test "$tst_works_inet_pton" != "no"; then
1213 AC_MSG_RESULT([yes])
1214 AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1,
1215 [Define to 1 if you have a IPv6 capable working inet_pton function.])
1216 ac_cv_func_inet_pton="yes"
1219 ac_cv_func_inet_pton="no"
1224 dnl CARES_CHECK_FUNC_IOCTL
1225 dnl -------------------------------------------------
1226 dnl Verify if ioctl is available, prototyped, and
1227 dnl can be compiled. If all of these are true, and
1228 dnl usage has not been previously disallowed with
1229 dnl shell variable cares_disallow_ioctl, then
1230 dnl HAVE_IOCTL will be defined.
1232 AC_DEFUN([CARES_CHECK_FUNC_IOCTL], [
1233 AC_REQUIRE([CARES_INCLUDES_STROPTS])dnl
1235 tst_links_ioctl="unknown"
1236 tst_proto_ioctl="unknown"
1237 tst_compi_ioctl="unknown"
1238 tst_allow_ioctl="unknown"
1240 AC_MSG_CHECKING([if ioctl can be linked])
1242 AC_LANG_FUNC_LINK_TRY([ioctl])
1244 AC_MSG_RESULT([yes])
1245 tst_links_ioctl="yes"
1248 tst_links_ioctl="no"
1251 if test "$tst_links_ioctl" = "yes"; then
1252 AC_MSG_CHECKING([if ioctl is prototyped])
1253 AC_EGREP_CPP([ioctl],[
1254 $cares_includes_stropts
1256 AC_MSG_RESULT([yes])
1257 tst_proto_ioctl="yes"
1260 tst_proto_ioctl="no"
1264 if test "$tst_proto_ioctl" = "yes"; then
1265 AC_MSG_CHECKING([if ioctl is compilable])
1268 $cares_includes_stropts
1270 if(0 != ioctl(0, 0, 0))
1274 AC_MSG_RESULT([yes])
1275 tst_compi_ioctl="yes"
1278 tst_compi_ioctl="no"
1282 if test "$tst_compi_ioctl" = "yes"; then
1283 AC_MSG_CHECKING([if ioctl usage allowed])
1284 if test "x$cares_disallow_ioctl" != "xyes"; then
1285 AC_MSG_RESULT([yes])
1286 tst_allow_ioctl="yes"
1289 tst_allow_ioctl="no"
1293 AC_MSG_CHECKING([if ioctl might be used])
1294 if test "$tst_links_ioctl" = "yes" &&
1295 test "$tst_proto_ioctl" = "yes" &&
1296 test "$tst_compi_ioctl" = "yes" &&
1297 test "$tst_allow_ioctl" = "yes"; then
1298 AC_MSG_RESULT([yes])
1299 AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1,
1300 [Define to 1 if you have the ioctl function.])
1301 ac_cv_func_ioctl="yes"
1302 CARES_CHECK_FUNC_IOCTL_FIONBIO
1305 ac_cv_func_ioctl="no"
1310 dnl CARES_CHECK_FUNC_IOCTL_FIONBIO
1311 dnl -------------------------------------------------
1312 dnl Verify if ioctl with the FIONBIO command is
1313 dnl available, can be compiled, and seems to work. If
1314 dnl all of these are true, then HAVE_IOCTL_FIONBIO
1315 dnl will be defined.
1317 AC_DEFUN([CARES_CHECK_FUNC_IOCTL_FIONBIO], [
1319 tst_compi_ioctl_fionbio="unknown"
1320 tst_allow_ioctl_fionbio="unknown"
1322 if test "$ac_cv_func_ioctl" = "yes"; then
1323 AC_MSG_CHECKING([if ioctl FIONBIO is compilable])
1326 $cares_includes_stropts
1329 if(0 != ioctl(0, FIONBIO, &flags))
1333 AC_MSG_RESULT([yes])
1334 tst_compi_ioctl_fionbio="yes"
1337 tst_compi_ioctl_fionbio="no"
1341 if test "$tst_compi_ioctl_fionbio" = "yes"; then
1342 AC_MSG_CHECKING([if ioctl FIONBIO usage allowed])
1343 if test "x$cares_disallow_ioctl_fionbio" != "xyes"; then
1344 AC_MSG_RESULT([yes])
1345 tst_allow_ioctl_fionbio="yes"
1348 tst_allow_ioctl_fionbio="no"
1352 AC_MSG_CHECKING([if ioctl FIONBIO might be used])
1353 if test "$tst_compi_ioctl_fionbio" = "yes" &&
1354 test "$tst_allow_ioctl_fionbio" = "yes"; then
1355 AC_MSG_RESULT([yes])
1356 AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1,
1357 [Define to 1 if you have a working ioctl FIONBIO function.])
1358 ac_cv_func_ioctl_fionbio="yes"
1361 ac_cv_func_ioctl_fionbio="no"
1366 dnl CARES_CHECK_FUNC_IOCTLSOCKET
1367 dnl -------------------------------------------------
1368 dnl Verify if ioctlsocket is available, prototyped, and
1369 dnl can be compiled. If all of these are true, and
1370 dnl usage has not been previously disallowed with
1371 dnl shell variable cares_disallow_ioctlsocket, then
1372 dnl HAVE_IOCTLSOCKET will be defined.
1374 AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET], [
1375 AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
1377 tst_links_ioctlsocket="unknown"
1378 tst_proto_ioctlsocket="unknown"
1379 tst_compi_ioctlsocket="unknown"
1380 tst_allow_ioctlsocket="unknown"
1382 AC_MSG_CHECKING([if ioctlsocket can be linked])
1385 $cares_includes_winsock2
1387 if(0 != ioctlsocket(0, 0, 0))
1391 AC_MSG_RESULT([yes])
1392 tst_links_ioctlsocket="yes"
1395 tst_links_ioctlsocket="no"
1398 if test "$tst_links_ioctlsocket" = "yes"; then
1399 AC_MSG_CHECKING([if ioctlsocket is prototyped])
1400 AC_EGREP_CPP([ioctlsocket],[
1401 $cares_includes_winsock2
1403 AC_MSG_RESULT([yes])
1404 tst_proto_ioctlsocket="yes"
1407 tst_proto_ioctlsocket="no"
1411 if test "$tst_proto_ioctlsocket" = "yes"; then
1412 AC_MSG_CHECKING([if ioctlsocket is compilable])
1415 $cares_includes_winsock2
1417 if(0 != ioctlsocket(0, 0, 0))
1421 AC_MSG_RESULT([yes])
1422 tst_compi_ioctlsocket="yes"
1425 tst_compi_ioctlsocket="no"
1429 if test "$tst_compi_ioctlsocket" = "yes"; then
1430 AC_MSG_CHECKING([if ioctlsocket usage allowed])
1431 if test "x$cares_disallow_ioctlsocket" != "xyes"; then
1432 AC_MSG_RESULT([yes])
1433 tst_allow_ioctlsocket="yes"
1436 tst_allow_ioctlsocket="no"
1440 AC_MSG_CHECKING([if ioctlsocket might be used])
1441 if test "$tst_links_ioctlsocket" = "yes" &&
1442 test "$tst_proto_ioctlsocket" = "yes" &&
1443 test "$tst_compi_ioctlsocket" = "yes" &&
1444 test "$tst_allow_ioctlsocket" = "yes"; then
1445 AC_MSG_RESULT([yes])
1446 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1,
1447 [Define to 1 if you have the ioctlsocket function.])
1448 ac_cv_func_ioctlsocket="yes"
1449 CARES_CHECK_FUNC_IOCTLSOCKET_FIONBIO
1452 ac_cv_func_ioctlsocket="no"
1457 dnl CARES_CHECK_FUNC_IOCTLSOCKET_FIONBIO
1458 dnl -------------------------------------------------
1459 dnl Verify if ioctlsocket with the FIONBIO command is
1460 dnl available, can be compiled, and seems to work. If
1461 dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO
1462 dnl will be defined.
1464 AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [
1466 tst_compi_ioctlsocket_fionbio="unknown"
1467 tst_allow_ioctlsocket_fionbio="unknown"
1469 if test "$ac_cv_func_ioctlsocket" = "yes"; then
1470 AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable])
1473 $cares_includes_winsock2
1476 if(0 != ioctlsocket(0, FIONBIO, &flags))
1480 AC_MSG_RESULT([yes])
1481 tst_compi_ioctlsocket_fionbio="yes"
1484 tst_compi_ioctlsocket_fionbio="no"
1488 if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then
1489 AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed])
1490 if test "x$cares_disallow_ioctlsocket_fionbio" != "xyes"; then
1491 AC_MSG_RESULT([yes])
1492 tst_allow_ioctlsocket_fionbio="yes"
1495 tst_allow_ioctlsocket_fionbio="no"
1499 AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used])
1500 if test "$tst_compi_ioctlsocket_fionbio" = "yes" &&
1501 test "$tst_allow_ioctlsocket_fionbio" = "yes"; then
1502 AC_MSG_RESULT([yes])
1503 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1,
1504 [Define to 1 if you have a working ioctlsocket FIONBIO function.])
1505 ac_cv_func_ioctlsocket_fionbio="yes"
1508 ac_cv_func_ioctlsocket_fionbio="no"
1513 dnl CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL
1514 dnl -------------------------------------------------
1515 dnl Verify if IoctlSocket is available, prototyped, and
1516 dnl can be compiled. If all of these are true, and
1517 dnl usage has not been previously disallowed with
1518 dnl shell variable cares_disallow_ioctlsocket_camel,
1519 dnl then HAVE_IOCTLSOCKET_CAMEL will be defined.
1521 AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
1522 AC_REQUIRE([CARES_INCLUDES_STROPTS])dnl
1524 tst_links_ioctlsocket_camel="unknown"
1525 tst_proto_ioctlsocket_camel="unknown"
1526 tst_compi_ioctlsocket_camel="unknown"
1527 tst_allow_ioctlsocket_camel="unknown"
1529 AC_MSG_CHECKING([if IoctlSocket can be linked])
1531 AC_LANG_FUNC_LINK_TRY([IoctlSocket])
1533 AC_MSG_RESULT([yes])
1534 tst_links_ioctlsocket_camel="yes"
1537 tst_links_ioctlsocket_camel="no"
1540 if test "$tst_links_ioctlsocket_camel" = "yes"; then
1541 AC_MSG_CHECKING([if IoctlSocket is prototyped])
1542 AC_EGREP_CPP([IoctlSocket],[
1543 $cares_includes_stropts
1545 AC_MSG_RESULT([yes])
1546 tst_proto_ioctlsocket_camel="yes"
1549 tst_proto_ioctlsocket_camel="no"
1553 if test "$tst_proto_ioctlsocket_camel" = "yes"; then
1554 AC_MSG_CHECKING([if IoctlSocket is compilable])
1557 $cares_includes_stropts
1559 if(0 != IoctlSocket(0, 0, 0))
1563 AC_MSG_RESULT([yes])
1564 tst_compi_ioctlsocket_camel="yes"
1567 tst_compi_ioctlsocket_camel="no"
1571 if test "$tst_compi_ioctlsocket_camel" = "yes"; then
1572 AC_MSG_CHECKING([if IoctlSocket usage allowed])
1573 if test "x$cares_disallow_ioctlsocket_camel" != "xyes"; then
1574 AC_MSG_RESULT([yes])
1575 tst_allow_ioctlsocket_camel="yes"
1578 tst_allow_ioctlsocket_camel="no"
1582 AC_MSG_CHECKING([if IoctlSocket might be used])
1583 if test "$tst_links_ioctlsocket_camel" = "yes" &&
1584 test "$tst_proto_ioctlsocket_camel" = "yes" &&
1585 test "$tst_compi_ioctlsocket_camel" = "yes" &&
1586 test "$tst_allow_ioctlsocket_camel" = "yes"; then
1587 AC_MSG_RESULT([yes])
1588 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1,
1589 [Define to 1 if you have the IoctlSocket camel case function.])
1590 ac_cv_func_ioctlsocket_camel="yes"
1591 CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
1594 ac_cv_func_ioctlsocket_camel="no"
1599 dnl CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
1600 dnl -------------------------------------------------
1601 dnl Verify if IoctlSocket with FIONBIO command is available,
1602 dnl can be compiled, and seems to work. If all of these are
1603 dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined.
1605 AC_DEFUN([CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [
1607 tst_compi_ioctlsocket_camel_fionbio="unknown"
1608 tst_allow_ioctlsocket_camel_fionbio="unknown"
1610 if test "$ac_cv_func_ioctlsocket_camel" = "yes"; then
1611 AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable])
1614 $cares_includes_stropts
1617 if(0 != ioctlsocket(0, FIONBIO, &flags))
1621 AC_MSG_RESULT([yes])
1622 tst_compi_ioctlsocket_camel_fionbio="yes"
1625 tst_compi_ioctlsocket_camel_fionbio="no"
1629 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then
1630 AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed])
1631 if test "x$cares_disallow_ioctlsocket_camel_fionbio" != "xyes"; then
1632 AC_MSG_RESULT([yes])
1633 tst_allow_ioctlsocket_camel_fionbio="yes"
1636 tst_allow_ioctlsocket_camel_fionbio="no"
1640 AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used])
1641 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" &&
1642 test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then
1643 AC_MSG_RESULT([yes])
1644 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1,
1645 [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.])
1646 ac_cv_func_ioctlsocket_camel_fionbio="yes"
1649 ac_cv_func_ioctlsocket_camel_fionbio="no"
1654 dnl CARES_CHECK_FUNC_SETSOCKOPT
1655 dnl -------------------------------------------------
1656 dnl Verify if setsockopt is available, prototyped, and
1657 dnl can be compiled. If all of these are true, and
1658 dnl usage has not been previously disallowed with
1659 dnl shell variable cares_disallow_setsockopt, then
1660 dnl HAVE_SETSOCKOPT will be defined.
1662 AC_DEFUN([CARES_CHECK_FUNC_SETSOCKOPT], [
1663 AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
1664 AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
1666 tst_links_setsockopt="unknown"
1667 tst_proto_setsockopt="unknown"
1668 tst_compi_setsockopt="unknown"
1669 tst_allow_setsockopt="unknown"
1671 AC_MSG_CHECKING([if setsockopt can be linked])
1674 $cares_includes_winsock2
1675 $cares_includes_sys_socket
1677 if(0 != setsockopt(0, 0, 0, 0, 0))
1681 AC_MSG_RESULT([yes])
1682 tst_links_setsockopt="yes"
1685 tst_links_setsockopt="no"
1688 if test "$tst_links_setsockopt" = "yes"; then
1689 AC_MSG_CHECKING([if setsockopt is prototyped])
1690 AC_EGREP_CPP([setsockopt],[
1691 $cares_includes_winsock2
1692 $cares_includes_sys_socket
1694 AC_MSG_RESULT([yes])
1695 tst_proto_setsockopt="yes"
1698 tst_proto_setsockopt="no"
1702 if test "$tst_proto_setsockopt" = "yes"; then
1703 AC_MSG_CHECKING([if setsockopt is compilable])
1706 $cares_includes_winsock2
1707 $cares_includes_sys_socket
1709 if(0 != setsockopt(0, 0, 0, 0, 0))
1713 AC_MSG_RESULT([yes])
1714 tst_compi_setsockopt="yes"
1717 tst_compi_setsockopt="no"
1721 if test "$tst_compi_setsockopt" = "yes"; then
1722 AC_MSG_CHECKING([if setsockopt usage allowed])
1723 if test "x$cares_disallow_setsockopt" != "xyes"; then
1724 AC_MSG_RESULT([yes])
1725 tst_allow_setsockopt="yes"
1728 tst_allow_setsockopt="no"
1732 AC_MSG_CHECKING([if setsockopt might be used])
1733 if test "$tst_links_setsockopt" = "yes" &&
1734 test "$tst_proto_setsockopt" = "yes" &&
1735 test "$tst_compi_setsockopt" = "yes" &&
1736 test "$tst_allow_setsockopt" = "yes"; then
1737 AC_MSG_RESULT([yes])
1738 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT, 1,
1739 [Define to 1 if you have the setsockopt function.])
1740 ac_cv_func_setsockopt="yes"
1741 CARES_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
1744 ac_cv_func_setsockopt="no"
1749 dnl CARES_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
1750 dnl -------------------------------------------------
1751 dnl Verify if setsockopt with the SO_NONBLOCK command is
1752 dnl available, can be compiled, and seems to work. If
1753 dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK
1754 dnl will be defined.
1756 AC_DEFUN([CARES_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [
1758 tst_compi_setsockopt_so_nonblock="unknown"
1759 tst_allow_setsockopt_so_nonblock="unknown"
1761 if test "$ac_cv_func_setsockopt" = "yes"; then
1762 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable])
1765 $cares_includes_winsock2
1766 $cares_includes_sys_socket
1768 if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
1772 AC_MSG_RESULT([yes])
1773 tst_compi_setsockopt_so_nonblock="yes"
1776 tst_compi_setsockopt_so_nonblock="no"
1780 if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then
1781 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed])
1782 if test "x$cares_disallow_setsockopt_so_nonblock" != "xyes"; then
1783 AC_MSG_RESULT([yes])
1784 tst_allow_setsockopt_so_nonblock="yes"
1787 tst_allow_setsockopt_so_nonblock="no"
1791 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used])
1792 if test "$tst_compi_setsockopt_so_nonblock" = "yes" &&
1793 test "$tst_allow_setsockopt_so_nonblock" = "yes"; then
1794 AC_MSG_RESULT([yes])
1795 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1,
1796 [Define to 1 if you have a working setsockopt SO_NONBLOCK function.])
1797 ac_cv_func_setsockopt_so_nonblock="yes"
1800 ac_cv_func_setsockopt_so_nonblock="no"
1805 dnl CARES_CHECK_FUNC_STRCASECMP
1806 dnl -------------------------------------------------
1807 dnl Verify if strcasecmp is available, prototyped, and
1808 dnl can be compiled. If all of these are true, and
1809 dnl usage has not been previously disallowed with
1810 dnl shell variable cares_disallow_strcasecmp, then
1811 dnl HAVE_STRCASECMP will be defined.
1813 AC_DEFUN([CARES_CHECK_FUNC_STRCASECMP], [
1814 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1816 tst_links_strcasecmp="unknown"
1817 tst_proto_strcasecmp="unknown"
1818 tst_compi_strcasecmp="unknown"
1819 tst_allow_strcasecmp="unknown"
1821 AC_MSG_CHECKING([if strcasecmp can be linked])
1823 AC_LANG_FUNC_LINK_TRY([strcasecmp])
1825 AC_MSG_RESULT([yes])
1826 tst_links_strcasecmp="yes"
1829 tst_links_strcasecmp="no"
1832 if test "$tst_links_strcasecmp" = "yes"; then
1833 AC_MSG_CHECKING([if strcasecmp is prototyped])
1834 AC_EGREP_CPP([strcasecmp],[
1835 $cares_includes_string
1837 AC_MSG_RESULT([yes])
1838 tst_proto_strcasecmp="yes"
1841 tst_proto_strcasecmp="no"
1845 if test "$tst_proto_strcasecmp" = "yes"; then
1846 AC_MSG_CHECKING([if strcasecmp is compilable])
1849 $cares_includes_string
1851 if(0 != strcasecmp(0, 0))
1855 AC_MSG_RESULT([yes])
1856 tst_compi_strcasecmp="yes"
1859 tst_compi_strcasecmp="no"
1863 if test "$tst_compi_strcasecmp" = "yes"; then
1864 AC_MSG_CHECKING([if strcasecmp usage allowed])
1865 if test "x$cares_disallow_strcasecmp" != "xyes"; then
1866 AC_MSG_RESULT([yes])
1867 tst_allow_strcasecmp="yes"
1870 tst_allow_strcasecmp="no"
1874 AC_MSG_CHECKING([if strcasecmp might be used])
1875 if test "$tst_links_strcasecmp" = "yes" &&
1876 test "$tst_proto_strcasecmp" = "yes" &&
1877 test "$tst_compi_strcasecmp" = "yes" &&
1878 test "$tst_allow_strcasecmp" = "yes"; then
1879 AC_MSG_RESULT([yes])
1880 AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
1881 [Define to 1 if you have the strcasecmp function.])
1882 ac_cv_func_strcasecmp="yes"
1885 ac_cv_func_strcasecmp="no"
1890 dnl CARES_CHECK_FUNC_STRCMPI
1891 dnl -------------------------------------------------
1892 dnl Verify if strcmpi is available, prototyped, and
1893 dnl can be compiled. If all of these are true, and
1894 dnl usage has not been previously disallowed with
1895 dnl shell variable cares_disallow_strcmpi, then
1896 dnl HAVE_STRCMPI will be defined.
1898 AC_DEFUN([CARES_CHECK_FUNC_STRCMPI], [
1899 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1901 tst_links_strcmpi="unknown"
1902 tst_proto_strcmpi="unknown"
1903 tst_compi_strcmpi="unknown"
1904 tst_allow_strcmpi="unknown"
1906 AC_MSG_CHECKING([if strcmpi can be linked])
1908 AC_LANG_FUNC_LINK_TRY([strcmpi])
1910 AC_MSG_RESULT([yes])
1911 tst_links_strcmpi="yes"
1914 tst_links_strcmpi="no"
1917 if test "$tst_links_strcmpi" = "yes"; then
1918 AC_MSG_CHECKING([if strcmpi is prototyped])
1919 AC_EGREP_CPP([strcmpi],[
1920 $cares_includes_string
1922 AC_MSG_RESULT([yes])
1923 tst_proto_strcmpi="yes"
1926 tst_proto_strcmpi="no"
1930 if test "$tst_proto_strcmpi" = "yes"; then
1931 AC_MSG_CHECKING([if strcmpi is compilable])
1934 $cares_includes_string
1936 if(0 != strcmpi(0, 0))
1940 AC_MSG_RESULT([yes])
1941 tst_compi_strcmpi="yes"
1944 tst_compi_strcmpi="no"
1948 if test "$tst_compi_strcmpi" = "yes"; then
1949 AC_MSG_CHECKING([if strcmpi usage allowed])
1950 if test "x$cares_disallow_strcmpi" != "xyes"; then
1951 AC_MSG_RESULT([yes])
1952 tst_allow_strcmpi="yes"
1955 tst_allow_strcmpi="no"
1959 AC_MSG_CHECKING([if strcmpi might be used])
1960 if test "$tst_links_strcmpi" = "yes" &&
1961 test "$tst_proto_strcmpi" = "yes" &&
1962 test "$tst_compi_strcmpi" = "yes" &&
1963 test "$tst_allow_strcmpi" = "yes"; then
1964 AC_MSG_RESULT([yes])
1965 AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
1966 [Define to 1 if you have the strcmpi function.])
1967 ac_cv_func_strcmpi="yes"
1970 ac_cv_func_strcmpi="no"
1975 dnl CARES_CHECK_FUNC_STRDUP
1976 dnl -------------------------------------------------
1977 dnl Verify if strdup is available, prototyped, and
1978 dnl can be compiled. If all of these are true, and
1979 dnl usage has not been previously disallowed with
1980 dnl shell variable cares_disallow_strdup, then
1981 dnl HAVE_STRDUP will be defined.
1983 AC_DEFUN([CARES_CHECK_FUNC_STRDUP], [
1984 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1986 tst_links_strdup="unknown"
1987 tst_proto_strdup="unknown"
1988 tst_compi_strdup="unknown"
1989 tst_allow_strdup="unknown"
1991 AC_MSG_CHECKING([if strdup can be linked])
1993 AC_LANG_FUNC_LINK_TRY([strdup])
1995 AC_MSG_RESULT([yes])
1996 tst_links_strdup="yes"
1999 tst_links_strdup="no"
2002 if test "$tst_links_strdup" = "yes"; then
2003 AC_MSG_CHECKING([if strdup is prototyped])
2004 AC_EGREP_CPP([strdup],[
2005 $cares_includes_string
2007 AC_MSG_RESULT([yes])
2008 tst_proto_strdup="yes"
2011 tst_proto_strdup="no"
2015 if test "$tst_proto_strdup" = "yes"; then
2016 AC_MSG_CHECKING([if strdup is compilable])
2019 $cares_includes_string
2025 AC_MSG_RESULT([yes])
2026 tst_compi_strdup="yes"
2029 tst_compi_strdup="no"
2033 if test "$tst_compi_strdup" = "yes"; then
2034 AC_MSG_CHECKING([if strdup usage allowed])
2035 if test "x$cares_disallow_strdup" != "xyes"; then
2036 AC_MSG_RESULT([yes])
2037 tst_allow_strdup="yes"
2040 tst_allow_strdup="no"
2044 AC_MSG_CHECKING([if strdup might be used])
2045 if test "$tst_links_strdup" = "yes" &&
2046 test "$tst_proto_strdup" = "yes" &&
2047 test "$tst_compi_strdup" = "yes" &&
2048 test "$tst_allow_strdup" = "yes"; then
2049 AC_MSG_RESULT([yes])
2050 AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
2051 [Define to 1 if you have the strdup function.])
2052 ac_cv_func_strdup="yes"
2055 ac_cv_func_strdup="no"
2060 dnl CARES_CHECK_FUNC_STRICMP
2061 dnl -------------------------------------------------
2062 dnl Verify if stricmp is available, prototyped, and
2063 dnl can be compiled. If all of these are true, and
2064 dnl usage has not been previously disallowed with
2065 dnl shell variable cares_disallow_stricmp, then
2066 dnl HAVE_STRICMP will be defined.
2068 AC_DEFUN([CARES_CHECK_FUNC_STRICMP], [
2069 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
2071 tst_links_stricmp="unknown"
2072 tst_proto_stricmp="unknown"
2073 tst_compi_stricmp="unknown"
2074 tst_allow_stricmp="unknown"
2076 AC_MSG_CHECKING([if stricmp can be linked])
2078 AC_LANG_FUNC_LINK_TRY([stricmp])
2080 AC_MSG_RESULT([yes])
2081 tst_links_stricmp="yes"
2084 tst_links_stricmp="no"
2087 if test "$tst_links_stricmp" = "yes"; then
2088 AC_MSG_CHECKING([if stricmp is prototyped])
2089 AC_EGREP_CPP([stricmp],[
2090 $cares_includes_string
2092 AC_MSG_RESULT([yes])
2093 tst_proto_stricmp="yes"
2096 tst_proto_stricmp="no"
2100 if test "$tst_proto_stricmp" = "yes"; then
2101 AC_MSG_CHECKING([if stricmp is compilable])
2104 $cares_includes_string
2106 if(0 != stricmp(0, 0))
2110 AC_MSG_RESULT([yes])
2111 tst_compi_stricmp="yes"
2114 tst_compi_stricmp="no"
2118 if test "$tst_compi_stricmp" = "yes"; then
2119 AC_MSG_CHECKING([if stricmp usage allowed])
2120 if test "x$cares_disallow_stricmp" != "xyes"; then
2121 AC_MSG_RESULT([yes])
2122 tst_allow_stricmp="yes"
2125 tst_allow_stricmp="no"
2129 AC_MSG_CHECKING([if stricmp might be used])
2130 if test "$tst_links_stricmp" = "yes" &&
2131 test "$tst_proto_stricmp" = "yes" &&
2132 test "$tst_compi_stricmp" = "yes" &&
2133 test "$tst_allow_stricmp" = "yes"; then
2134 AC_MSG_RESULT([yes])
2135 AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
2136 [Define to 1 if you have the stricmp function.])
2137 ac_cv_func_stricmp="yes"
2140 ac_cv_func_stricmp="no"
2145 dnl CARES_CHECK_FUNC_STRNCASECMP
2146 dnl -------------------------------------------------
2147 dnl Verify if strncasecmp is available, prototyped, and
2148 dnl can be compiled. If all of these are true, and
2149 dnl usage has not been previously disallowed with
2150 dnl shell variable cares_disallow_strncasecmp, then
2151 dnl HAVE_STRNCASECMP will be defined.
2153 AC_DEFUN([CARES_CHECK_FUNC_STRNCASECMP], [
2154 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
2156 tst_links_strncasecmp="unknown"
2157 tst_proto_strncasecmp="unknown"
2158 tst_compi_strncasecmp="unknown"
2159 tst_allow_strncasecmp="unknown"
2161 AC_MSG_CHECKING([if strncasecmp can be linked])
2163 AC_LANG_FUNC_LINK_TRY([strncasecmp])
2165 AC_MSG_RESULT([yes])
2166 tst_links_strncasecmp="yes"
2169 tst_links_strncasecmp="no"
2172 if test "$tst_links_strncasecmp" = "yes"; then
2173 AC_MSG_CHECKING([if strncasecmp is prototyped])
2174 AC_EGREP_CPP([strncasecmp],[
2175 $cares_includes_string
2177 AC_MSG_RESULT([yes])
2178 tst_proto_strncasecmp="yes"
2181 tst_proto_strncasecmp="no"
2185 if test "$tst_proto_strncasecmp" = "yes"; then
2186 AC_MSG_CHECKING([if strncasecmp is compilable])
2189 $cares_includes_string
2191 if(0 != strncasecmp(0, 0, 0))
2195 AC_MSG_RESULT([yes])
2196 tst_compi_strncasecmp="yes"
2199 tst_compi_strncasecmp="no"
2203 if test "$tst_compi_strncasecmp" = "yes"; then
2204 AC_MSG_CHECKING([if strncasecmp usage allowed])
2205 if test "x$cares_disallow_strncasecmp" != "xyes"; then
2206 AC_MSG_RESULT([yes])
2207 tst_allow_strncasecmp="yes"
2210 tst_allow_strncasecmp="no"
2214 AC_MSG_CHECKING([if strncasecmp might be used])
2215 if test "$tst_links_strncasecmp" = "yes" &&
2216 test "$tst_proto_strncasecmp" = "yes" &&
2217 test "$tst_compi_strncasecmp" = "yes" &&
2218 test "$tst_allow_strncasecmp" = "yes"; then
2219 AC_MSG_RESULT([yes])
2220 AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1,
2221 [Define to 1 if you have the strncasecmp function.])
2222 ac_cv_func_strncasecmp="yes"
2225 ac_cv_func_strncasecmp="no"
2230 dnl CARES_CHECK_FUNC_STRNCMPI
2231 dnl -------------------------------------------------
2232 dnl Verify if strncmpi is available, prototyped, and
2233 dnl can be compiled. If all of these are true, and
2234 dnl usage has not been previously disallowed with
2235 dnl shell variable cares_disallow_strncmpi, then
2236 dnl HAVE_STRNCMPI will be defined.
2238 AC_DEFUN([CARES_CHECK_FUNC_STRNCMPI], [
2239 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
2241 tst_links_strncmpi="unknown"
2242 tst_proto_strncmpi="unknown"
2243 tst_compi_strncmpi="unknown"
2244 tst_allow_strncmpi="unknown"
2246 AC_MSG_CHECKING([if strncmpi can be linked])
2248 AC_LANG_FUNC_LINK_TRY([strncmpi])
2250 AC_MSG_RESULT([yes])
2251 tst_links_strncmpi="yes"
2254 tst_links_strncmpi="no"
2257 if test "$tst_links_strncmpi" = "yes"; then
2258 AC_MSG_CHECKING([if strncmpi is prototyped])
2259 AC_EGREP_CPP([strncmpi],[
2260 $cares_includes_string
2262 AC_MSG_RESULT([yes])
2263 tst_proto_strncmpi="yes"
2266 tst_proto_strncmpi="no"
2270 if test "$tst_proto_strncmpi" = "yes"; then
2271 AC_MSG_CHECKING([if strncmpi is compilable])
2274 $cares_includes_string
2276 if(0 != strncmpi(0, 0))
2280 AC_MSG_RESULT([yes])
2281 tst_compi_strncmpi="yes"
2284 tst_compi_strncmpi="no"
2288 if test "$tst_compi_strncmpi" = "yes"; then
2289 AC_MSG_CHECKING([if strncmpi usage allowed])
2290 if test "x$cares_disallow_strncmpi" != "xyes"; then
2291 AC_MSG_RESULT([yes])
2292 tst_allow_strncmpi="yes"
2295 tst_allow_strncmpi="no"
2299 AC_MSG_CHECKING([if strncmpi might be used])
2300 if test "$tst_links_strncmpi" = "yes" &&
2301 test "$tst_proto_strncmpi" = "yes" &&
2302 test "$tst_compi_strncmpi" = "yes" &&
2303 test "$tst_allow_strncmpi" = "yes"; then
2304 AC_MSG_RESULT([yes])
2305 AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1,
2306 [Define to 1 if you have the strncmpi function.])
2307 ac_cv_func_strncmpi="yes"
2310 ac_cv_func_strncmpi="no"
2315 dnl CARES_CHECK_FUNC_STRNICMP
2316 dnl -------------------------------------------------
2317 dnl Verify if strnicmp is available, prototyped, and
2318 dnl can be compiled. If all of these are true, and
2319 dnl usage has not been previously disallowed with
2320 dnl shell variable cares_disallow_strnicmp, then
2321 dnl HAVE_STRNICMP will be defined.
2323 AC_DEFUN([CARES_CHECK_FUNC_STRNICMP], [
2324 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
2326 tst_links_strnicmp="unknown"
2327 tst_proto_strnicmp="unknown"
2328 tst_compi_strnicmp="unknown"
2329 tst_allow_strnicmp="unknown"
2331 AC_MSG_CHECKING([if strnicmp can be linked])
2333 AC_LANG_FUNC_LINK_TRY([strnicmp])
2335 AC_MSG_RESULT([yes])
2336 tst_links_strnicmp="yes"
2339 tst_links_strnicmp="no"
2342 if test "$tst_links_strnicmp" = "yes"; then
2343 AC_MSG_CHECKING([if strnicmp is prototyped])
2344 AC_EGREP_CPP([strnicmp],[
2345 $cares_includes_string
2347 AC_MSG_RESULT([yes])
2348 tst_proto_strnicmp="yes"
2351 tst_proto_strnicmp="no"
2355 if test "$tst_proto_strnicmp" = "yes"; then
2356 AC_MSG_CHECKING([if strnicmp is compilable])
2359 $cares_includes_string
2361 if(0 != strnicmp(0, 0))
2365 AC_MSG_RESULT([yes])
2366 tst_compi_strnicmp="yes"
2369 tst_compi_strnicmp="no"
2373 if test "$tst_compi_strnicmp" = "yes"; then
2374 AC_MSG_CHECKING([if strnicmp usage allowed])
2375 if test "x$cares_disallow_strnicmp" != "xyes"; then
2376 AC_MSG_RESULT([yes])
2377 tst_allow_strnicmp="yes"
2380 tst_allow_strnicmp="no"
2384 AC_MSG_CHECKING([if strnicmp might be used])
2385 if test "$tst_links_strnicmp" = "yes" &&
2386 test "$tst_proto_strnicmp" = "yes" &&
2387 test "$tst_compi_strnicmp" = "yes" &&
2388 test "$tst_allow_strnicmp" = "yes"; then
2389 AC_MSG_RESULT([yes])
2390 AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1,
2391 [Define to 1 if you have the strnicmp function.])
2392 ac_cv_func_strnicmp="yes"
2395 ac_cv_func_strnicmp="no"
2400 dnl CARES_CHECK_FUNC_WRITEV
2401 dnl -------------------------------------------------
2402 dnl Verify if writev is available, prototyped, and
2403 dnl can be compiled. If all of these are true, and
2404 dnl usage has not been previously disallowed with
2405 dnl shell variable cares_disallow_writev, then
2406 dnl HAVE_WRITEV will be defined.
2408 AC_DEFUN([CARES_CHECK_FUNC_WRITEV], [
2409 AC_REQUIRE([CARES_INCLUDES_SYS_UIO])dnl
2411 tst_links_writev="unknown"
2412 tst_proto_writev="unknown"
2413 tst_compi_writev="unknown"
2414 tst_allow_writev="unknown"
2416 AC_MSG_CHECKING([if writev can be linked])
2418 AC_LANG_FUNC_LINK_TRY([writev])
2420 AC_MSG_RESULT([yes])
2421 tst_links_writev="yes"
2424 tst_links_writev="no"
2427 if test "$tst_links_writev" = "yes"; then
2428 AC_MSG_CHECKING([if writev is prototyped])
2429 AC_EGREP_CPP([writev],[
2430 $cares_includes_sys_uio
2432 AC_MSG_RESULT([yes])
2433 tst_proto_writev="yes"
2436 tst_proto_writev="no"
2440 if test "$tst_proto_writev" = "yes"; then
2441 AC_MSG_CHECKING([if writev is compilable])
2444 $cares_includes_sys_uio
2446 if(0 != writev(0, 0, 0))
2450 AC_MSG_RESULT([yes])
2451 tst_compi_writev="yes"
2454 tst_compi_writev="no"
2458 if test "$tst_compi_writev" = "yes"; then
2459 AC_MSG_CHECKING([if writev usage allowed])
2460 if test "x$cares_disallow_writev" != "xyes"; then
2461 AC_MSG_RESULT([yes])
2462 tst_allow_writev="yes"
2465 tst_allow_writev="no"
2469 AC_MSG_CHECKING([if writev might be used])
2470 if test "$tst_links_writev" = "yes" &&
2471 test "$tst_proto_writev" = "yes" &&
2472 test "$tst_compi_writev" = "yes" &&
2473 test "$tst_allow_writev" = "yes"; then
2474 AC_MSG_RESULT([yes])
2475 AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1,
2476 [Define to 1 if you have the writev function.])
2477 ac_cv_func_writev="yes"
2480 ac_cv_func_writev="no"