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_NETDB
50 dnl -------------------------------------------------
51 dnl Set up variable with list of headers that must be
52 dnl included when netdb.h is to be included.
54 AC_DEFUN([CARES_INCLUDES_NETDB], [
55 cares_includes_netdb="\
57 #ifdef HAVE_SYS_TYPES_H
58 # include <sys/types.h>
66 [], [], [$cares_includes_netdb])
70 dnl CARES_INCLUDES_STDLIB
71 dnl -------------------------------------------------
72 dnl Set up variable with list of headers that must be
73 dnl included when stdlib.h is to be included.
75 AC_DEFUN([CARES_INCLUDES_STDLIB], [
76 cares_includes_stdlib="\
78 #ifdef HAVE_SYS_TYPES_H
79 # include <sys/types.h>
87 [], [], [$cares_includes_stdlib])
91 dnl CARES_INCLUDES_STRING
92 dnl -------------------------------------------------
93 dnl Set up variable with list of headers that must be
94 dnl included when string(s).h is to be included.
96 AC_DEFUN([CARES_INCLUDES_STRING], [
97 cares_includes_string="\
99 #ifdef HAVE_SYS_TYPES_H
100 # include <sys/types.h>
105 #ifdef HAVE_STRINGS_H
106 # include <strings.h>
110 sys/types.h string.h strings.h,
111 [], [], [$cares_includes_string])
115 dnl CARES_INCLUDES_SYS_SOCKET
116 dnl -------------------------------------------------
117 dnl Set up variable with list of headers that must be
118 dnl included when sys/socket.h is to be included.
120 AC_DEFUN([CARES_INCLUDES_SYS_SOCKET], [
121 cares_includes_sys_socket="\
123 #ifdef HAVE_SYS_TYPES_H
124 # include <sys/types.h>
126 #ifdef HAVE_SYS_SOCKET_H
127 # include <sys/socket.h>
131 sys/types.h sys/socket.h,
132 [], [], [$cares_includes_sys_socket])
136 dnl CARES_INCLUDES_SYS_UIO
137 dnl -------------------------------------------------
138 dnl Set up variable with list of headers that must be
139 dnl included when sys/uio.h is to be included.
141 AC_DEFUN([CARES_INCLUDES_SYS_UIO], [
142 cares_includes_sys_uio="\
144 #ifdef HAVE_SYS_TYPES_H
145 # include <sys/types.h>
147 #ifdef HAVE_SYS_UIO_H
148 # include <sys/uio.h>
152 sys/types.h sys/uio.h,
153 [], [], [$cares_includes_sys_uio])
157 dnl CARES_INCLUDES_UNISTD
158 dnl -------------------------------------------------
159 dnl Set up variable with list of headers that must be
160 dnl included when unistd.h is to be included.
162 AC_DEFUN([CARES_INCLUDES_UNISTD], [
163 cares_includes_unistd="\
165 #ifdef HAVE_SYS_TYPES_H
166 # include <sys/types.h>
173 sys/types.h unistd.h,
174 [], [], [$cares_includes_unistd])
178 dnl CARES_INCLUDES_WINSOCK2
179 dnl -------------------------------------------------
180 dnl Set up variable with list of headers that must be
181 dnl included when winsock(2).h is to be included.
183 AC_DEFUN([CARES_INCLUDES_WINSOCK2], [
184 cares_includes_winsock2="\
186 #ifdef HAVE_WINDOWS_H
187 # ifndef WIN32_LEAN_AND_MEAN
188 # define WIN32_LEAN_AND_MEAN
190 # include <windows.h>
191 # ifdef HAVE_WINSOCK2_H
192 # include <winsock2.h>
194 # ifdef HAVE_WINSOCK_H
195 # include <winsock.h>
200 CURL_CHECK_HEADER_WINDOWS
201 CURL_CHECK_HEADER_WINSOCK
202 CURL_CHECK_HEADER_WINSOCK2
206 dnl CARES_INCLUDES_WS2TCPIP
207 dnl -------------------------------------------------
208 dnl Set up variable with list of headers that must be
209 dnl included when ws2tcpip.h is to be included.
211 AC_DEFUN([CARES_INCLUDES_WS2TCPIP], [
212 cares_includes_ws2tcpip="\
214 #ifdef HAVE_WINDOWS_H
215 # ifndef WIN32_LEAN_AND_MEAN
216 # define WIN32_LEAN_AND_MEAN
218 # include <windows.h>
219 # ifdef HAVE_WINSOCK2_H
220 # include <winsock2.h>
221 # ifdef HAVE_WS2TCPIP_H
222 # include <ws2tcpip.h>
227 CURL_CHECK_HEADER_WINDOWS
228 CURL_CHECK_HEADER_WINSOCK2
229 CURL_CHECK_HEADER_WS2TCPIP
233 dnl CARES_CHECK_FUNC_FREEADDRINFO
234 dnl -------------------------------------------------
235 dnl Verify if freeaddrinfo is available, prototyped,
236 dnl and can be compiled. If all of these are true,
237 dnl and usage has not been previously disallowed with
238 dnl shell variable cares_disallow_freeaddrinfo, then
239 dnl HAVE_FREEADDRINFO will be defined.
241 AC_DEFUN([CARES_CHECK_FUNC_FREEADDRINFO], [
242 AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl
243 AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
244 AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
246 tst_links_freeaddrinfo="unknown"
247 tst_proto_freeaddrinfo="unknown"
248 tst_compi_freeaddrinfo="unknown"
249 tst_allow_freeaddrinfo="unknown"
251 AC_MSG_CHECKING([if freeaddrinfo can be linked])
254 $cares_includes_ws2tcpip
255 $cares_includes_sys_socket
256 $cares_includes_netdb
262 tst_links_freeaddrinfo="yes"
265 tst_links_freeaddrinfo="no"
268 if test "$tst_links_freeaddrinfo" = "yes"; then
269 AC_MSG_CHECKING([if freeaddrinfo is prototyped])
270 AC_EGREP_CPP([freeaddrinfo],[
271 $cares_includes_ws2tcpip
272 $cares_includes_sys_socket
273 $cares_includes_netdb
276 tst_proto_freeaddrinfo="yes"
279 tst_proto_freeaddrinfo="no"
283 if test "$tst_proto_freeaddrinfo" = "yes"; then
284 AC_MSG_CHECKING([if freeaddrinfo is compilable])
287 $cares_includes_ws2tcpip
288 $cares_includes_sys_socket
289 $cares_includes_netdb
295 tst_compi_freeaddrinfo="yes"
298 tst_compi_freeaddrinfo="no"
302 if test "$tst_compi_freeaddrinfo" = "yes"; then
303 AC_MSG_CHECKING([if freeaddrinfo usage allowed])
304 if test "x$cares_disallow_freeaddrinfo" != "xyes"; then
306 tst_allow_freeaddrinfo="yes"
309 tst_allow_freeaddrinfo="no"
313 AC_MSG_CHECKING([if freeaddrinfo might be used])
314 if test "$tst_links_freeaddrinfo" = "yes" &&
315 test "$tst_proto_freeaddrinfo" = "yes" &&
316 test "$tst_compi_freeaddrinfo" = "yes" &&
317 test "$tst_allow_freeaddrinfo" = "yes"; then
319 AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
320 [Define to 1 if you have the freeaddrinfo function.])
321 ac_cv_func_freeaddrinfo="yes"
324 ac_cv_func_freeaddrinfo="no"
329 dnl CARES_CHECK_FUNC_GETADDRINFO
330 dnl -------------------------------------------------
331 dnl Verify if getaddrinfo is available, prototyped, can
332 dnl be compiled and seems to work. If all of these are
333 dnl true, and usage has not been previously disallowed
334 dnl with shell variable cares_disallow_getaddrinfo, then
335 dnl HAVE_GETADDRINFO will be defined.
337 AC_DEFUN([CARES_CHECK_FUNC_GETADDRINFO], [
338 AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl
339 AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl
340 AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
341 AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
343 tst_links_getaddrinfo="unknown"
344 tst_proto_getaddrinfo="unknown"
345 tst_compi_getaddrinfo="unknown"
346 tst_works_getaddrinfo="unknown"
347 tst_allow_getaddrinfo="unknown"
349 AC_MSG_CHECKING([if getaddrinfo can be linked])
352 $cares_includes_ws2tcpip
353 $cares_includes_sys_socket
354 $cares_includes_netdb
356 if(0 != getaddrinfo(0, 0, 0, 0))
361 tst_links_getaddrinfo="yes"
364 tst_links_getaddrinfo="no"
367 if test "$tst_links_getaddrinfo" = "yes"; then
368 AC_MSG_CHECKING([if getaddrinfo is prototyped])
369 AC_EGREP_CPP([getaddrinfo],[
370 $cares_includes_ws2tcpip
371 $cares_includes_sys_socket
372 $cares_includes_netdb
375 tst_proto_getaddrinfo="yes"
378 tst_proto_getaddrinfo="no"
382 if test "$tst_proto_getaddrinfo" = "yes"; then
383 AC_MSG_CHECKING([if getaddrinfo is compilable])
386 $cares_includes_ws2tcpip
387 $cares_includes_sys_socket
388 $cares_includes_netdb
390 if(0 != getaddrinfo(0, 0, 0, 0))
395 tst_compi_getaddrinfo="yes"
398 tst_compi_getaddrinfo="no"
402 dnl only do runtime verification when not cross-compiling
403 if test "x$cross_compiling" != "xyes" &&
404 test "$tst_compi_getaddrinfo" = "yes"; then
405 AC_MSG_CHECKING([if getaddrinfo seems to work])
408 $cares_includes_ws2tcpip
409 $cares_includes_stdlib
410 $cares_includes_sys_socket
411 $cares_includes_netdb
413 struct addrinfo hints;
414 struct addrinfo *ai = 0;
417 memset(&hints, 0, sizeof(hints));
418 hints.ai_flags = AI_NUMERICHOST;
419 hints.ai_family = AF_UNSPEC;
420 hints.ai_socktype = SOCK_STREAM;
421 error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
429 tst_works_getaddrinfo="yes"
432 tst_works_getaddrinfo="no"
436 if test "$tst_compi_getaddrinfo" = "yes" &&
437 test "$tst_works_getaddrinfo" != "no"; then
438 AC_MSG_CHECKING([if getaddrinfo usage allowed])
439 if test "x$cares_disallow_getaddrinfo" != "xyes"; then
441 tst_allow_getaddrinfo="yes"
444 tst_allow_getaddrinfo="no"
448 AC_MSG_CHECKING([if getaddrinfo might be used])
449 if test "$tst_links_getaddrinfo" = "yes" &&
450 test "$tst_proto_getaddrinfo" = "yes" &&
451 test "$tst_compi_getaddrinfo" = "yes" &&
452 test "$tst_allow_getaddrinfo" = "yes" &&
453 test "$tst_works_getaddrinfo" != "no"; then
455 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
456 [Define to 1 if you have a working getaddrinfo function.])
457 ac_cv_func_getaddrinfo="yes"
460 ac_cv_func_getaddrinfo="no"
465 dnl CARES_CHECK_FUNC_GETHOSTNAME
466 dnl -------------------------------------------------
467 dnl Verify if gethostname is available, prototyped, and
468 dnl can be compiled. If all of these are true, and
469 dnl usage has not been previously disallowed with
470 dnl shell variable cares_disallow_gethostname, then
471 dnl HAVE_GETHOSTNAME will be defined.
473 AC_DEFUN([CARES_CHECK_FUNC_GETHOSTNAME], [
474 AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
475 AC_REQUIRE([CARES_INCLUDES_UNISTD])dnl
477 tst_links_gethostname="unknown"
478 tst_proto_gethostname="unknown"
479 tst_compi_gethostname="unknown"
480 tst_allow_gethostname="unknown"
482 AC_MSG_CHECKING([if gethostname can be linked])
485 $cares_includes_winsock2
486 $cares_includes_unistd
488 if(0 != gethostname(0, 0))
493 tst_links_gethostname="yes"
496 tst_links_gethostname="no"
499 if test "$tst_links_gethostname" = "yes"; then
500 AC_MSG_CHECKING([if gethostname is prototyped])
501 AC_EGREP_CPP([gethostname],[
502 $cares_includes_winsock2
503 $cares_includes_unistd
506 tst_proto_gethostname="yes"
509 tst_proto_gethostname="no"
513 if test "$tst_proto_gethostname" = "yes"; then
514 AC_MSG_CHECKING([if gethostname is compilable])
517 $cares_includes_winsock2
518 $cares_includes_unistd
520 if(0 != gethostname(0, 0))
525 tst_compi_gethostname="yes"
528 tst_compi_gethostname="no"
532 if test "$tst_compi_gethostname" = "yes"; then
533 AC_MSG_CHECKING([if gethostname usage allowed])
534 if test "x$cares_disallow_gethostname" != "xyes"; then
536 tst_allow_gethostname="yes"
539 tst_allow_gethostname="no"
543 AC_MSG_CHECKING([if gethostname might be used])
544 if test "$tst_links_gethostname" = "yes" &&
545 test "$tst_proto_gethostname" = "yes" &&
546 test "$tst_compi_gethostname" = "yes" &&
547 test "$tst_allow_gethostname" = "yes"; then
549 AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
550 [Define to 1 if you have the gethostname function.])
551 ac_cv_func_gethostname="yes"
554 ac_cv_func_gethostname="no"
559 dnl CARES_CHECK_FUNC_GETSERVBYPORT_R
560 dnl -------------------------------------------------
561 dnl Verify if getservbyport_r is available, prototyped,
562 dnl and can be compiled. If all of these are true, and
563 dnl usage has not been previously disallowed with
564 dnl shell variable cares_disallow_getservbyport_r, then
565 dnl HAVE_GETSERVBYPORT_R will be defined.
567 AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYPORT_R], [
568 AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
570 tst_links_getservbyport_r="unknown"
571 tst_proto_getservbyport_r="unknown"
572 tst_compi_getservbyport_r="unknown"
573 tst_allow_getservbyport_r="unknown"
574 tst_nargs_getservbyport_r="unknown"
576 AC_MSG_CHECKING([if getservbyport_r can be linked])
578 AC_LANG_FUNC_LINK_TRY([getservbyport_r])
581 tst_links_getservbyport_r="yes"
584 tst_links_getservbyport_r="no"
587 if test "$tst_links_getservbyport_r" = "yes"; then
588 AC_MSG_CHECKING([if getservbyport_r is prototyped])
589 AC_EGREP_CPP([getservbyport_r],[
590 $cares_includes_netdb
593 tst_proto_getservbyport_r="yes"
596 tst_proto_getservbyport_r="no"
600 if test "$tst_proto_getservbyport_r" = "yes"; then
601 if test "$tst_nargs_getservbyport_r" = "unknown"; then
602 AC_MSG_CHECKING([if getservbyport_r takes 4 args.])
605 $cares_includes_netdb
607 if(0 != getservbyport_r(0, 0, 0, 0))
612 tst_compi_getservbyport_r="yes"
613 tst_nargs_getservbyport_r="4"
616 tst_compi_getservbyport_r="no"
619 if test "$tst_nargs_getservbyport_r" = "unknown"; then
620 AC_MSG_CHECKING([if getservbyport_r takes 5 args.])
623 $cares_includes_netdb
625 if(0 != getservbyport_r(0, 0, 0, 0, 0))
630 tst_compi_getservbyport_r="yes"
631 tst_nargs_getservbyport_r="5"
634 tst_compi_getservbyport_r="no"
637 if test "$tst_nargs_getservbyport_r" = "unknown"; then
638 AC_MSG_CHECKING([if getservbyport_r takes 6 args.])
641 $cares_includes_netdb
643 if(0 != getservbyport_r(0, 0, 0, 0, 0, 0))
648 tst_compi_getservbyport_r="yes"
649 tst_nargs_getservbyport_r="6"
652 tst_compi_getservbyport_r="no"
655 AC_MSG_CHECKING([if getservbyport_r is compilable])
656 if test "$tst_compi_getservbyport_r" = "yes"; then
663 if test "$tst_compi_getservbyport_r" = "yes"; then
664 AC_MSG_CHECKING([if getservbyport_r usage allowed])
665 if test "x$cares_disallow_getservbyport_r" != "xyes"; then
667 tst_allow_getservbyport_r="yes"
670 tst_allow_getservbyport_r="no"
674 AC_MSG_CHECKING([if getservbyport_r might be used])
675 if test "$tst_links_getservbyport_r" = "yes" &&
676 test "$tst_proto_getservbyport_r" = "yes" &&
677 test "$tst_compi_getservbyport_r" = "yes" &&
678 test "$tst_allow_getservbyport_r" = "yes"; then
680 AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1,
681 [Define to 1 if you have the getservbyport_r function.])
682 AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r,
683 [Specifies the number of arguments to getservbyport_r])
684 if test "$tst_nargs_getservbyport_r" -eq "4"; then
685 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
686 [Specifies the size of the buffer to pass to getservbyport_r])
688 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
689 [Specifies the size of the buffer to pass to getservbyport_r])
691 ac_cv_func_getservbyport_r="yes"
694 ac_cv_func_getservbyport_r="no"
699 dnl CARES_CHECK_FUNC_INET_NTOP
700 dnl -------------------------------------------------
701 dnl Verify if inet_ntop is available, prototyped, can
702 dnl be compiled and seems to work. If all of these are
703 dnl true, and usage has not been previously disallowed
704 dnl with shell variable cares_disallow_inet_ntop, then
705 dnl HAVE_INET_NTOP will be defined.
707 AC_DEFUN([CARES_CHECK_FUNC_INET_NTOP], [
708 AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl
709 AC_REQUIRE([CARES_INCLUDES_ARPA_INET])dnl
710 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
712 tst_links_inet_ntop="unknown"
713 tst_proto_inet_ntop="unknown"
714 tst_compi_inet_ntop="unknown"
715 tst_works_inet_ntop="unknown"
716 tst_allow_inet_ntop="unknown"
718 AC_MSG_CHECKING([if inet_ntop can be linked])
720 AC_LANG_FUNC_LINK_TRY([inet_ntop])
723 tst_links_inet_ntop="yes"
726 tst_links_inet_ntop="no"
729 if test "$tst_links_inet_ntop" = "yes"; then
730 AC_MSG_CHECKING([if inet_ntop is prototyped])
731 AC_EGREP_CPP([inet_ntop],[
732 $cares_includes_arpa_inet
735 tst_proto_inet_ntop="yes"
738 tst_proto_inet_ntop="no"
742 if test "$tst_proto_inet_ntop" = "yes"; then
743 AC_MSG_CHECKING([if inet_ntop is compilable])
746 $cares_includes_arpa_inet
748 if(0 != inet_ntop(0, 0, 0, 0))
753 tst_compi_inet_ntop="yes"
756 tst_compi_inet_ntop="no"
760 dnl only do runtime verification when not cross-compiling
761 if test "x$cross_compiling" != "xyes" &&
762 test "$tst_compi_inet_ntop" = "yes"; then
763 AC_MSG_CHECKING([if inet_ntop seems to work])
766 $cares_includes_stdlib
767 $cares_includes_arpa_inet
768 $cares_includes_string
770 char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
771 char ipv4res[sizeof "255.255.255.255"];
772 unsigned char ipv6a[26];
773 unsigned char ipv4a[5];
784 ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
787 if(ipv4ptr != ipv4res)
791 if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
795 memset(ipv6a, 0, sizeof(ipv6a));
808 ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
811 if(ipv6ptr != ipv6res)
815 if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
822 tst_works_inet_ntop="yes"
825 tst_works_inet_ntop="no"
829 if test "$tst_compi_inet_ntop" = "yes" &&
830 test "$tst_works_inet_ntop" != "no"; then
831 AC_MSG_CHECKING([if inet_ntop usage allowed])
832 if test "x$cares_disallow_inet_ntop" != "xyes"; then
834 tst_allow_inet_ntop="yes"
837 tst_allow_inet_ntop="no"
841 AC_MSG_CHECKING([if inet_ntop might be used])
842 if test "$tst_links_inet_ntop" = "yes" &&
843 test "$tst_proto_inet_ntop" = "yes" &&
844 test "$tst_compi_inet_ntop" = "yes" &&
845 test "$tst_allow_inet_ntop" = "yes" &&
846 test "$tst_works_inet_ntop" != "no"; then
848 AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1,
849 [Define to 1 if you have a IPv6 capable working inet_ntop function.])
850 ac_cv_func_inet_ntop="yes"
853 ac_cv_func_inet_ntop="no"
858 dnl CARES_CHECK_FUNC_INET_PTON
859 dnl -------------------------------------------------
860 dnl Verify if inet_pton is available, prototyped, can
861 dnl be compiled and seems to work. If all of these are
862 dnl true, and usage has not been previously disallowed
863 dnl with shell variable cares_disallow_inet_pton, then
864 dnl HAVE_INET_PTON will be defined.
866 AC_DEFUN([CARES_CHECK_FUNC_INET_PTON], [
867 AC_REQUIRE([CARES_INCLUDES_STDLIB])dnl
868 AC_REQUIRE([CARES_INCLUDES_ARPA_INET])dnl
869 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
871 tst_links_inet_pton="unknown"
872 tst_proto_inet_pton="unknown"
873 tst_compi_inet_pton="unknown"
874 tst_works_inet_pton="unknown"
875 tst_allow_inet_pton="unknown"
877 AC_MSG_CHECKING([if inet_pton can be linked])
879 AC_LANG_FUNC_LINK_TRY([inet_pton])
882 tst_links_inet_pton="yes"
885 tst_links_inet_pton="no"
888 if test "$tst_links_inet_pton" = "yes"; then
889 AC_MSG_CHECKING([if inet_pton is prototyped])
890 AC_EGREP_CPP([inet_pton],[
891 $cares_includes_arpa_inet
894 tst_proto_inet_pton="yes"
897 tst_proto_inet_pton="no"
901 if test "$tst_proto_inet_pton" = "yes"; then
902 AC_MSG_CHECKING([if inet_pton is compilable])
905 $cares_includes_arpa_inet
907 if(0 != inet_pton(0, 0, 0))
912 tst_compi_inet_pton="yes"
915 tst_compi_inet_pton="no"
919 dnl only do runtime verification when not cross-compiling
920 if test "x$cross_compiling" != "xyes" &&
921 test "$tst_compi_inet_pton" = "yes"; then
922 AC_MSG_CHECKING([if inet_pton seems to work])
925 $cares_includes_stdlib
926 $cares_includes_arpa_inet
927 $cares_includes_string
929 unsigned char ipv6a[26];
930 unsigned char ipv4a[5];
931 const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
932 const char *ipv4src = "192.168.100.1";
934 memset(ipv4a, 1, sizeof(ipv4a));
935 if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
938 if( (ipv4a[0] != 0xc0) ||
939 (ipv4a[1] != 0xa8) ||
940 (ipv4a[2] != 0x64) ||
941 (ipv4a[3] != 0x01) ||
945 memset(ipv6a, 1, sizeof(ipv6a));
946 if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
950 memset(ipv6a, 0, sizeof(ipv6a));
951 if( (ipv6a[0] != 0xfe) ||
952 (ipv6a[1] != 0x80) ||
953 (ipv6a[8] != 0x02) ||
954 (ipv6a[9] != 0x14) ||
955 (ipv6a[10] != 0x4f) ||
956 (ipv6a[11] != 0xff) ||
957 (ipv6a[12] != 0xfe) ||
958 (ipv6a[13] != 0x0b) ||
959 (ipv6a[14] != 0x76) ||
960 (ipv6a[15] != 0xc8) ||
961 (ipv6a[25] != 0x01) )
964 if( (ipv6a[2] != 0x0) ||
970 (ipv6a[16] != 0x0) ||
971 (ipv6a[17] != 0x0) ||
972 (ipv6a[18] != 0x0) ||
973 (ipv6a[19] != 0x0) ||
974 (ipv6a[20] != 0x0) ||
975 (ipv6a[21] != 0x0) ||
976 (ipv6a[22] != 0x0) ||
977 (ipv6a[23] != 0x0) ||
985 tst_works_inet_pton="yes"
988 tst_works_inet_pton="no"
992 if test "$tst_compi_inet_pton" = "yes" &&
993 test "$tst_works_inet_pton" != "no"; then
994 AC_MSG_CHECKING([if inet_pton usage allowed])
995 if test "x$cares_disallow_inet_pton" != "xyes"; then
997 tst_allow_inet_pton="yes"
1000 tst_allow_inet_pton="no"
1004 AC_MSG_CHECKING([if inet_pton might be used])
1005 if test "$tst_links_inet_pton" = "yes" &&
1006 test "$tst_proto_inet_pton" = "yes" &&
1007 test "$tst_compi_inet_pton" = "yes" &&
1008 test "$tst_allow_inet_pton" = "yes" &&
1009 test "$tst_works_inet_pton" != "no"; then
1010 AC_MSG_RESULT([yes])
1011 AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1,
1012 [Define to 1 if you have a IPv6 capable working inet_pton function.])
1013 ac_cv_func_inet_pton="yes"
1016 ac_cv_func_inet_pton="no"
1021 dnl CARES_CHECK_FUNC_STRCASECMP
1022 dnl -------------------------------------------------
1023 dnl Verify if strcasecmp is available, prototyped, and
1024 dnl can be compiled. If all of these are true, and
1025 dnl usage has not been previously disallowed with
1026 dnl shell variable cares_disallow_strcasecmp, then
1027 dnl HAVE_STRCASECMP will be defined.
1029 AC_DEFUN([CARES_CHECK_FUNC_STRCASECMP], [
1030 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1032 tst_links_strcasecmp="unknown"
1033 tst_proto_strcasecmp="unknown"
1034 tst_compi_strcasecmp="unknown"
1035 tst_allow_strcasecmp="unknown"
1037 AC_MSG_CHECKING([if strcasecmp can be linked])
1039 AC_LANG_FUNC_LINK_TRY([strcasecmp])
1041 AC_MSG_RESULT([yes])
1042 tst_links_strcasecmp="yes"
1045 tst_links_strcasecmp="no"
1048 if test "$tst_links_strcasecmp" = "yes"; then
1049 AC_MSG_CHECKING([if strcasecmp is prototyped])
1050 AC_EGREP_CPP([strcasecmp],[
1051 $cares_includes_string
1053 AC_MSG_RESULT([yes])
1054 tst_proto_strcasecmp="yes"
1057 tst_proto_strcasecmp="no"
1061 if test "$tst_proto_strcasecmp" = "yes"; then
1062 AC_MSG_CHECKING([if strcasecmp is compilable])
1065 $cares_includes_string
1067 if(0 != strcasecmp(0, 0))
1071 AC_MSG_RESULT([yes])
1072 tst_compi_strcasecmp="yes"
1075 tst_compi_strcasecmp="no"
1079 if test "$tst_compi_strcasecmp" = "yes"; then
1080 AC_MSG_CHECKING([if strcasecmp usage allowed])
1081 if test "x$cares_disallow_strcasecmp" != "xyes"; then
1082 AC_MSG_RESULT([yes])
1083 tst_allow_strcasecmp="yes"
1086 tst_allow_strcasecmp="no"
1090 AC_MSG_CHECKING([if strcasecmp might be used])
1091 if test "$tst_links_strcasecmp" = "yes" &&
1092 test "$tst_proto_strcasecmp" = "yes" &&
1093 test "$tst_compi_strcasecmp" = "yes" &&
1094 test "$tst_allow_strcasecmp" = "yes"; then
1095 AC_MSG_RESULT([yes])
1096 AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
1097 [Define to 1 if you have the strcasecmp function.])
1098 ac_cv_func_strcasecmp="yes"
1101 ac_cv_func_strcasecmp="no"
1106 dnl CARES_CHECK_FUNC_STRCMPI
1107 dnl -------------------------------------------------
1108 dnl Verify if strcmpi is available, prototyped, and
1109 dnl can be compiled. If all of these are true, and
1110 dnl usage has not been previously disallowed with
1111 dnl shell variable cares_disallow_strcmpi, then
1112 dnl HAVE_STRCMPI will be defined.
1114 AC_DEFUN([CARES_CHECK_FUNC_STRCMPI], [
1115 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1117 tst_links_strcmpi="unknown"
1118 tst_proto_strcmpi="unknown"
1119 tst_compi_strcmpi="unknown"
1120 tst_allow_strcmpi="unknown"
1122 AC_MSG_CHECKING([if strcmpi can be linked])
1124 AC_LANG_FUNC_LINK_TRY([strcmpi])
1126 AC_MSG_RESULT([yes])
1127 tst_links_strcmpi="yes"
1130 tst_links_strcmpi="no"
1133 if test "$tst_links_strcmpi" = "yes"; then
1134 AC_MSG_CHECKING([if strcmpi is prototyped])
1135 AC_EGREP_CPP([strcmpi],[
1136 $cares_includes_string
1138 AC_MSG_RESULT([yes])
1139 tst_proto_strcmpi="yes"
1142 tst_proto_strcmpi="no"
1146 if test "$tst_proto_strcmpi" = "yes"; then
1147 AC_MSG_CHECKING([if strcmpi is compilable])
1150 $cares_includes_string
1152 if(0 != strcmpi(0, 0))
1156 AC_MSG_RESULT([yes])
1157 tst_compi_strcmpi="yes"
1160 tst_compi_strcmpi="no"
1164 if test "$tst_compi_strcmpi" = "yes"; then
1165 AC_MSG_CHECKING([if strcmpi usage allowed])
1166 if test "x$cares_disallow_strcmpi" != "xyes"; then
1167 AC_MSG_RESULT([yes])
1168 tst_allow_strcmpi="yes"
1171 tst_allow_strcmpi="no"
1175 AC_MSG_CHECKING([if strcmpi might be used])
1176 if test "$tst_links_strcmpi" = "yes" &&
1177 test "$tst_proto_strcmpi" = "yes" &&
1178 test "$tst_compi_strcmpi" = "yes" &&
1179 test "$tst_allow_strcmpi" = "yes"; then
1180 AC_MSG_RESULT([yes])
1181 AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
1182 [Define to 1 if you have the strcmpi function.])
1183 ac_cv_func_strcmpi="yes"
1186 ac_cv_func_strcmpi="no"
1191 dnl CARES_CHECK_FUNC_STRDUP
1192 dnl -------------------------------------------------
1193 dnl Verify if strdup is available, prototyped, and
1194 dnl can be compiled. If all of these are true, and
1195 dnl usage has not been previously disallowed with
1196 dnl shell variable cares_disallow_strdup, then
1197 dnl HAVE_STRDUP will be defined.
1199 AC_DEFUN([CARES_CHECK_FUNC_STRDUP], [
1200 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1202 tst_links_strdup="unknown"
1203 tst_proto_strdup="unknown"
1204 tst_compi_strdup="unknown"
1205 tst_allow_strdup="unknown"
1207 AC_MSG_CHECKING([if strdup can be linked])
1209 AC_LANG_FUNC_LINK_TRY([strdup])
1211 AC_MSG_RESULT([yes])
1212 tst_links_strdup="yes"
1215 tst_links_strdup="no"
1218 if test "$tst_links_strdup" = "yes"; then
1219 AC_MSG_CHECKING([if strdup is prototyped])
1220 AC_EGREP_CPP([strdup],[
1221 $cares_includes_string
1223 AC_MSG_RESULT([yes])
1224 tst_proto_strdup="yes"
1227 tst_proto_strdup="no"
1231 if test "$tst_proto_strdup" = "yes"; then
1232 AC_MSG_CHECKING([if strdup is compilable])
1235 $cares_includes_string
1241 AC_MSG_RESULT([yes])
1242 tst_compi_strdup="yes"
1245 tst_compi_strdup="no"
1249 if test "$tst_compi_strdup" = "yes"; then
1250 AC_MSG_CHECKING([if strdup usage allowed])
1251 if test "x$cares_disallow_strdup" != "xyes"; then
1252 AC_MSG_RESULT([yes])
1253 tst_allow_strdup="yes"
1256 tst_allow_strdup="no"
1260 AC_MSG_CHECKING([if strdup might be used])
1261 if test "$tst_links_strdup" = "yes" &&
1262 test "$tst_proto_strdup" = "yes" &&
1263 test "$tst_compi_strdup" = "yes" &&
1264 test "$tst_allow_strdup" = "yes"; then
1265 AC_MSG_RESULT([yes])
1266 AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
1267 [Define to 1 if you have the strdup function.])
1268 ac_cv_func_strdup="yes"
1271 ac_cv_func_strdup="no"
1276 dnl CARES_CHECK_FUNC_STRICMP
1277 dnl -------------------------------------------------
1278 dnl Verify if stricmp is available, prototyped, and
1279 dnl can be compiled. If all of these are true, and
1280 dnl usage has not been previously disallowed with
1281 dnl shell variable cares_disallow_stricmp, then
1282 dnl HAVE_STRICMP will be defined.
1284 AC_DEFUN([CARES_CHECK_FUNC_STRICMP], [
1285 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1287 tst_links_stricmp="unknown"
1288 tst_proto_stricmp="unknown"
1289 tst_compi_stricmp="unknown"
1290 tst_allow_stricmp="unknown"
1292 AC_MSG_CHECKING([if stricmp can be linked])
1294 AC_LANG_FUNC_LINK_TRY([stricmp])
1296 AC_MSG_RESULT([yes])
1297 tst_links_stricmp="yes"
1300 tst_links_stricmp="no"
1303 if test "$tst_links_stricmp" = "yes"; then
1304 AC_MSG_CHECKING([if stricmp is prototyped])
1305 AC_EGREP_CPP([stricmp],[
1306 $cares_includes_string
1308 AC_MSG_RESULT([yes])
1309 tst_proto_stricmp="yes"
1312 tst_proto_stricmp="no"
1316 if test "$tst_proto_stricmp" = "yes"; then
1317 AC_MSG_CHECKING([if stricmp is compilable])
1320 $cares_includes_string
1322 if(0 != stricmp(0, 0))
1326 AC_MSG_RESULT([yes])
1327 tst_compi_stricmp="yes"
1330 tst_compi_stricmp="no"
1334 if test "$tst_compi_stricmp" = "yes"; then
1335 AC_MSG_CHECKING([if stricmp usage allowed])
1336 if test "x$cares_disallow_stricmp" != "xyes"; then
1337 AC_MSG_RESULT([yes])
1338 tst_allow_stricmp="yes"
1341 tst_allow_stricmp="no"
1345 AC_MSG_CHECKING([if stricmp might be used])
1346 if test "$tst_links_stricmp" = "yes" &&
1347 test "$tst_proto_stricmp" = "yes" &&
1348 test "$tst_compi_stricmp" = "yes" &&
1349 test "$tst_allow_stricmp" = "yes"; then
1350 AC_MSG_RESULT([yes])
1351 AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
1352 [Define to 1 if you have the stricmp function.])
1353 ac_cv_func_stricmp="yes"
1356 ac_cv_func_stricmp="no"
1361 dnl CARES_CHECK_FUNC_STRNCASECMP
1362 dnl -------------------------------------------------
1363 dnl Verify if strncasecmp is available, prototyped, and
1364 dnl can be compiled. If all of these are true, and
1365 dnl usage has not been previously disallowed with
1366 dnl shell variable cares_disallow_strncasecmp, then
1367 dnl HAVE_STRNCASECMP will be defined.
1369 AC_DEFUN([CARES_CHECK_FUNC_STRNCASECMP], [
1370 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1372 tst_links_strncasecmp="unknown"
1373 tst_proto_strncasecmp="unknown"
1374 tst_compi_strncasecmp="unknown"
1375 tst_allow_strncasecmp="unknown"
1377 AC_MSG_CHECKING([if strncasecmp can be linked])
1379 AC_LANG_FUNC_LINK_TRY([strncasecmp])
1381 AC_MSG_RESULT([yes])
1382 tst_links_strncasecmp="yes"
1385 tst_links_strncasecmp="no"
1388 if test "$tst_links_strncasecmp" = "yes"; then
1389 AC_MSG_CHECKING([if strncasecmp is prototyped])
1390 AC_EGREP_CPP([strncasecmp],[
1391 $cares_includes_string
1393 AC_MSG_RESULT([yes])
1394 tst_proto_strncasecmp="yes"
1397 tst_proto_strncasecmp="no"
1401 if test "$tst_proto_strncasecmp" = "yes"; then
1402 AC_MSG_CHECKING([if strncasecmp is compilable])
1405 $cares_includes_string
1407 if(0 != strncasecmp(0, 0, 0))
1411 AC_MSG_RESULT([yes])
1412 tst_compi_strncasecmp="yes"
1415 tst_compi_strncasecmp="no"
1419 if test "$tst_compi_strncasecmp" = "yes"; then
1420 AC_MSG_CHECKING([if strncasecmp usage allowed])
1421 if test "x$cares_disallow_strncasecmp" != "xyes"; then
1422 AC_MSG_RESULT([yes])
1423 tst_allow_strncasecmp="yes"
1426 tst_allow_strncasecmp="no"
1430 AC_MSG_CHECKING([if strncasecmp might be used])
1431 if test "$tst_links_strncasecmp" = "yes" &&
1432 test "$tst_proto_strncasecmp" = "yes" &&
1433 test "$tst_compi_strncasecmp" = "yes" &&
1434 test "$tst_allow_strncasecmp" = "yes"; then
1435 AC_MSG_RESULT([yes])
1436 AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1,
1437 [Define to 1 if you have the strncasecmp function.])
1438 ac_cv_func_strncasecmp="yes"
1441 ac_cv_func_strncasecmp="no"
1446 dnl CARES_CHECK_FUNC_STRNCMPI
1447 dnl -------------------------------------------------
1448 dnl Verify if strncmpi is available, prototyped, and
1449 dnl can be compiled. If all of these are true, and
1450 dnl usage has not been previously disallowed with
1451 dnl shell variable cares_disallow_strncmpi, then
1452 dnl HAVE_STRNCMPI will be defined.
1454 AC_DEFUN([CARES_CHECK_FUNC_STRNCMPI], [
1455 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1457 tst_links_strncmpi="unknown"
1458 tst_proto_strncmpi="unknown"
1459 tst_compi_strncmpi="unknown"
1460 tst_allow_strncmpi="unknown"
1462 AC_MSG_CHECKING([if strncmpi can be linked])
1464 AC_LANG_FUNC_LINK_TRY([strncmpi])
1466 AC_MSG_RESULT([yes])
1467 tst_links_strncmpi="yes"
1470 tst_links_strncmpi="no"
1473 if test "$tst_links_strncmpi" = "yes"; then
1474 AC_MSG_CHECKING([if strncmpi is prototyped])
1475 AC_EGREP_CPP([strncmpi],[
1476 $cares_includes_string
1478 AC_MSG_RESULT([yes])
1479 tst_proto_strncmpi="yes"
1482 tst_proto_strncmpi="no"
1486 if test "$tst_proto_strncmpi" = "yes"; then
1487 AC_MSG_CHECKING([if strncmpi is compilable])
1490 $cares_includes_string
1492 if(0 != strncmpi(0, 0))
1496 AC_MSG_RESULT([yes])
1497 tst_compi_strncmpi="yes"
1500 tst_compi_strncmpi="no"
1504 if test "$tst_compi_strncmpi" = "yes"; then
1505 AC_MSG_CHECKING([if strncmpi usage allowed])
1506 if test "x$cares_disallow_strncmpi" != "xyes"; then
1507 AC_MSG_RESULT([yes])
1508 tst_allow_strncmpi="yes"
1511 tst_allow_strncmpi="no"
1515 AC_MSG_CHECKING([if strncmpi might be used])
1516 if test "$tst_links_strncmpi" = "yes" &&
1517 test "$tst_proto_strncmpi" = "yes" &&
1518 test "$tst_compi_strncmpi" = "yes" &&
1519 test "$tst_allow_strncmpi" = "yes"; then
1520 AC_MSG_RESULT([yes])
1521 AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1,
1522 [Define to 1 if you have the strncmpi function.])
1523 ac_cv_func_strncmpi="yes"
1526 ac_cv_func_strncmpi="no"
1531 dnl CARES_CHECK_FUNC_STRNICMP
1532 dnl -------------------------------------------------
1533 dnl Verify if strnicmp is available, prototyped, and
1534 dnl can be compiled. If all of these are true, and
1535 dnl usage has not been previously disallowed with
1536 dnl shell variable cares_disallow_strnicmp, then
1537 dnl HAVE_STRNICMP will be defined.
1539 AC_DEFUN([CARES_CHECK_FUNC_STRNICMP], [
1540 AC_REQUIRE([CARES_INCLUDES_STRING])dnl
1542 tst_links_strnicmp="unknown"
1543 tst_proto_strnicmp="unknown"
1544 tst_compi_strnicmp="unknown"
1545 tst_allow_strnicmp="unknown"
1547 AC_MSG_CHECKING([if strnicmp can be linked])
1549 AC_LANG_FUNC_LINK_TRY([strnicmp])
1551 AC_MSG_RESULT([yes])
1552 tst_links_strnicmp="yes"
1555 tst_links_strnicmp="no"
1558 if test "$tst_links_strnicmp" = "yes"; then
1559 AC_MSG_CHECKING([if strnicmp is prototyped])
1560 AC_EGREP_CPP([strnicmp],[
1561 $cares_includes_string
1563 AC_MSG_RESULT([yes])
1564 tst_proto_strnicmp="yes"
1567 tst_proto_strnicmp="no"
1571 if test "$tst_proto_strnicmp" = "yes"; then
1572 AC_MSG_CHECKING([if strnicmp is compilable])
1575 $cares_includes_string
1577 if(0 != strnicmp(0, 0))
1581 AC_MSG_RESULT([yes])
1582 tst_compi_strnicmp="yes"
1585 tst_compi_strnicmp="no"
1589 if test "$tst_compi_strnicmp" = "yes"; then
1590 AC_MSG_CHECKING([if strnicmp usage allowed])
1591 if test "x$cares_disallow_strnicmp" != "xyes"; then
1592 AC_MSG_RESULT([yes])
1593 tst_allow_strnicmp="yes"
1596 tst_allow_strnicmp="no"
1600 AC_MSG_CHECKING([if strnicmp might be used])
1601 if test "$tst_links_strnicmp" = "yes" &&
1602 test "$tst_proto_strnicmp" = "yes" &&
1603 test "$tst_compi_strnicmp" = "yes" &&
1604 test "$tst_allow_strnicmp" = "yes"; then
1605 AC_MSG_RESULT([yes])
1606 AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1,
1607 [Define to 1 if you have the strnicmp function.])
1608 ac_cv_func_strnicmp="yes"
1611 ac_cv_func_strnicmp="no"
1616 dnl CARES_CHECK_FUNC_WRITEV
1617 dnl -------------------------------------------------
1618 dnl Verify if writev is available, prototyped, and
1619 dnl can be compiled. If all of these are true, and
1620 dnl usage has not been previously disallowed with
1621 dnl shell variable cares_disallow_writev, then
1622 dnl HAVE_WRITEV will be defined.
1624 AC_DEFUN([CARES_CHECK_FUNC_WRITEV], [
1625 AC_REQUIRE([CARES_INCLUDES_SYS_UIO])dnl
1627 tst_links_writev="unknown"
1628 tst_proto_writev="unknown"
1629 tst_compi_writev="unknown"
1630 tst_allow_writev="unknown"
1632 AC_MSG_CHECKING([if writev can be linked])
1634 AC_LANG_FUNC_LINK_TRY([writev])
1636 AC_MSG_RESULT([yes])
1637 tst_links_writev="yes"
1640 tst_links_writev="no"
1643 if test "$tst_links_writev" = "yes"; then
1644 AC_MSG_CHECKING([if writev is prototyped])
1645 AC_EGREP_CPP([writev],[
1646 $cares_includes_sys_uio
1648 AC_MSG_RESULT([yes])
1649 tst_proto_writev="yes"
1652 tst_proto_writev="no"
1656 if test "$tst_proto_writev" = "yes"; then
1657 AC_MSG_CHECKING([if writev is compilable])
1660 $cares_includes_sys_uio
1662 if(0 != writev(0, 0, 0))
1666 AC_MSG_RESULT([yes])
1667 tst_compi_writev="yes"
1670 tst_compi_writev="no"
1674 if test "$tst_compi_writev" = "yes"; then
1675 AC_MSG_CHECKING([if writev usage allowed])
1676 if test "x$cares_disallow_writev" != "xyes"; then
1677 AC_MSG_RESULT([yes])
1678 tst_allow_writev="yes"
1681 tst_allow_writev="no"
1685 AC_MSG_CHECKING([if writev might be used])
1686 if test "$tst_links_writev" = "yes" &&
1687 test "$tst_proto_writev" = "yes" &&
1688 test "$tst_compi_writev" = "yes" &&
1689 test "$tst_allow_writev" = "yes"; then
1690 AC_MSG_RESULT([yes])
1691 AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1,
1692 [Define to 1 if you have the writev function.])
1693 ac_cv_func_writev="yes"
1696 ac_cv_func_writev="no"