1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 #***************************************************************************
23 # File version for 'aclocal' use. Keep it a single number.
27 dnl CURL_INCLUDES_ARPA_INET
28 dnl -------------------------------------------------
29 dnl Set up variable with list of headers that must be
30 dnl included when arpa/inet.h is to be included.
32 AC_DEFUN([CURL_INCLUDES_ARPA_INET], [
33 curl_includes_arpa_inet="\
35 #ifdef HAVE_SYS_TYPES_H
36 # include <sys/types.h>
38 #ifdef HAVE_SYS_SOCKET_H
39 # include <sys/socket.h>
41 #ifdef HAVE_NETINET_IN_H
42 # include <netinet/in.h>
44 #ifdef HAVE_ARPA_INET_H
45 # include <arpa/inet.h>
49 sys/types.h sys/socket.h netinet/in.h arpa/inet.h,
50 [], [], [$curl_includes_arpa_inet])
54 dnl CURL_INCLUDES_FCNTL
55 dnl -------------------------------------------------
56 dnl Set up variable with list of headers that must be
57 dnl included when fcntl.h is to be included.
59 AC_DEFUN([CURL_INCLUDES_FCNTL], [
60 curl_includes_fcntl="\
62 #ifdef HAVE_SYS_TYPES_H
63 # include <sys/types.h>
73 sys/types.h unistd.h fcntl.h,
74 [], [], [$curl_includes_fcntl])
78 dnl CURL_INCLUDES_IFADDRS
79 dnl -------------------------------------------------
80 dnl Set up variable with list of headers that must be
81 dnl included when ifaddrs.h is to be included.
83 AC_DEFUN([CURL_INCLUDES_IFADDRS], [
84 curl_includes_ifaddrs="\
86 #ifdef HAVE_SYS_TYPES_H
87 # include <sys/types.h>
89 #ifdef HAVE_SYS_SOCKET_H
90 # include <sys/socket.h>
92 #ifdef HAVE_NETINET_IN_H
93 # include <netinet/in.h>
100 sys/types.h sys/socket.h netinet/in.h ifaddrs.h,
101 [], [], [$curl_includes_ifaddrs])
105 dnl CURL_INCLUDES_INTTYPES
106 dnl -------------------------------------------------
107 dnl Set up variable with list of headers that must be
108 dnl included when inttypes.h is to be included.
110 AC_DEFUN([CURL_INCLUDES_INTTYPES], [
111 curl_includes_inttypes="\
113 #ifdef HAVE_SYS_TYPES_H
114 # include <sys/types.h>
119 #ifdef HAVE_INTTYPES_H
120 # include <inttypes.h>
125 ac_cv_header_stdint_h="no"
129 sys/types.h stdint.h inttypes.h,
130 [], [], [$curl_includes_inttypes])
134 dnl CURL_INCLUDES_LIBGEN
135 dnl -------------------------------------------------
136 dnl Set up variable with list of headers that must be
137 dnl included when libgen.h is to be included.
139 AC_DEFUN([CURL_INCLUDES_LIBGEN], [
140 curl_includes_libgen="\
142 #ifdef HAVE_SYS_TYPES_H
143 # include <sys/types.h>
150 sys/types.h libgen.h,
151 [], [], [$curl_includes_libgen])
155 dnl CURL_INCLUDES_NETDB
156 dnl -------------------------------------------------
157 dnl Set up variable with list of headers that must be
158 dnl included when netdb.h is to be included.
160 AC_DEFUN([CURL_INCLUDES_NETDB], [
161 curl_includes_netdb="\
163 #ifdef HAVE_SYS_TYPES_H
164 # include <sys/types.h>
172 [], [], [$curl_includes_netdb])
176 dnl CURL_INCLUDES_POLL
177 dnl -------------------------------------------------
178 dnl Set up variable with list of headers that must be
179 dnl included when poll.h is to be included.
181 AC_DEFUN([CURL_INCLUDES_POLL], [
182 curl_includes_poll="\
184 #ifdef HAVE_SYS_TYPES_H
185 # include <sys/types.h>
190 #ifdef HAVE_SYS_POLL_H
191 # include <sys/poll.h>
195 sys/types.h poll.h sys/poll.h,
196 [], [], [$curl_includes_poll])
200 dnl CURL_INCLUDES_SETJMP
201 dnl -------------------------------------------------
202 dnl Set up variable with list of headers that must be
203 dnl included when setjmp.h is to be included.
205 AC_DEFUN([CURL_INCLUDES_SETJMP], [
206 curl_includes_setjmp="\
208 #ifdef HAVE_SYS_TYPES_H
209 # include <sys/types.h>
216 sys/types.h setjmp.h,
217 [], [], [$curl_includes_setjmp])
221 dnl CURL_INCLUDES_SIGNAL
222 dnl -------------------------------------------------
223 dnl Set up variable with list of headers that must be
224 dnl included when signal.h is to be included.
226 AC_DEFUN([CURL_INCLUDES_SIGNAL], [
227 curl_includes_signal="\
229 #ifdef HAVE_SYS_TYPES_H
230 # include <sys/types.h>
237 sys/types.h signal.h,
238 [], [], [$curl_includes_signal])
242 dnl CURL_INCLUDES_SOCKET
243 dnl -------------------------------------------------
244 dnl Set up variable with list of headers that must be
245 dnl included when socket.h is to be included.
247 AC_DEFUN([CURL_INCLUDES_SOCKET], [
248 curl_includes_socket="\
250 #ifdef HAVE_SYS_TYPES_H
251 # include <sys/types.h>
258 sys/types.h socket.h,
259 [], [], [$curl_includes_socket])
263 dnl CURL_INCLUDES_STDIO
264 dnl -------------------------------------------------
265 dnl Set up variable with list of headers that must be
266 dnl included when stdio.h is to be included.
268 AC_DEFUN([CURL_INCLUDES_STDIO], [
269 curl_includes_stdio="\
271 #ifdef HAVE_SYS_TYPES_H
272 # include <sys/types.h>
280 [], [], [$curl_includes_stdio])
284 dnl CURL_INCLUDES_STDLIB
285 dnl -------------------------------------------------
286 dnl Set up variable with list of headers that must be
287 dnl included when stdlib.h is to be included.
289 AC_DEFUN([CURL_INCLUDES_STDLIB], [
290 curl_includes_stdlib="\
292 #ifdef HAVE_SYS_TYPES_H
293 # include <sys/types.h>
300 sys/types.h stdlib.h,
301 [], [], [$curl_includes_stdlib])
305 dnl CURL_INCLUDES_STRING
306 dnl -------------------------------------------------
307 dnl Set up variable with list of headers that must be
308 dnl included when string(s).h is to be included.
310 AC_DEFUN([CURL_INCLUDES_STRING], [
311 curl_includes_string="\
313 #ifdef HAVE_SYS_TYPES_H
314 # include <sys/types.h>
319 #ifdef HAVE_STRINGS_H
320 # include <strings.h>
324 sys/types.h string.h strings.h,
325 [], [], [$curl_includes_string])
329 dnl CURL_INCLUDES_STROPTS
330 dnl -------------------------------------------------
331 dnl Set up variable with list of headers that must be
332 dnl included when stropts.h is to be included.
334 AC_DEFUN([CURL_INCLUDES_STROPTS], [
335 curl_includes_stropts="\
337 #ifdef HAVE_SYS_TYPES_H
338 # include <sys/types.h>
343 #ifdef HAVE_SYS_SOCKET_H
344 # include <sys/socket.h>
346 #ifdef HAVE_SYS_IOCTL_H
347 # include <sys/ioctl.h>
349 #ifdef HAVE_STROPTS_H
350 # include <stropts.h>
354 sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h,
355 [], [], [$curl_includes_stropts])
359 dnl CURL_INCLUDES_SYS_SOCKET
360 dnl -------------------------------------------------
361 dnl Set up variable with list of headers that must be
362 dnl included when sys/socket.h is to be included.
364 AC_DEFUN([CURL_INCLUDES_SYS_SOCKET], [
365 curl_includes_sys_socket="\
367 #ifdef HAVE_SYS_TYPES_H
368 # include <sys/types.h>
370 #ifdef HAVE_SYS_SOCKET_H
371 # include <sys/socket.h>
375 sys/types.h sys/socket.h,
376 [], [], [$curl_includes_sys_socket])
380 dnl CURL_INCLUDES_SYS_TYPES
381 dnl -------------------------------------------------
382 dnl Set up variable with list of headers that must be
383 dnl included when sys/types.h is to be included.
385 AC_DEFUN([CURL_INCLUDES_SYS_TYPES], [
386 curl_includes_sys_types="\
388 #ifdef HAVE_SYS_TYPES_H
389 # include <sys/types.h>
394 [], [], [$curl_includes_sys_types])
398 dnl CURL_INCLUDES_SYS_UIO
399 dnl -------------------------------------------------
400 dnl Set up variable with list of headers that must be
401 dnl included when sys/uio.h is to be included.
403 AC_DEFUN([CURL_INCLUDES_SYS_UIO], [
404 curl_includes_sys_uio="\
406 #ifdef HAVE_SYS_TYPES_H
407 # include <sys/types.h>
409 #ifdef HAVE_SYS_UIO_H
410 # include <sys/uio.h>
414 sys/types.h sys/uio.h,
415 [], [], [$curl_includes_sys_uio])
419 dnl CURL_INCLUDES_SYS_XATTR
420 dnl -------------------------------------------------
421 dnl Set up variable with list of headers that must be
422 dnl included when sys/xattr.h is to be included.
424 AC_DEFUN([CURL_INCLUDES_SYS_XATTR], [
425 curl_includes_sys_xattr="\
427 #ifdef HAVE_SYS_TYPES_H
428 # include <sys/types.h>
430 #ifdef HAVE_SYS_XATTR_H
431 # include <sys/xattr.h>
435 sys/types.h sys/xattr.h,
436 [], [], [$curl_includes_sys_xattr])
439 dnl CURL_INCLUDES_TIME
440 dnl -------------------------------------------------
441 dnl Set up variable with list of headers that must be
442 dnl included when time.h is to be included.
444 AC_DEFUN([CURL_INCLUDES_TIME], [
445 AC_REQUIRE([AC_HEADER_TIME])dnl
446 curl_includes_time="\
448 #ifdef HAVE_SYS_TYPES_H
449 # include <sys/types.h>
451 #ifdef HAVE_SYS_TIME_H
452 # include <sys/time.h>
453 # ifdef TIME_WITH_SYS_TIME
463 sys/types.h sys/time.h time.h,
464 [], [], [$curl_includes_time])
468 dnl CURL_INCLUDES_UNISTD
469 dnl -------------------------------------------------
470 dnl Set up variable with list of headers that must be
471 dnl included when unistd.h is to be included.
473 AC_DEFUN([CURL_INCLUDES_UNISTD], [
474 curl_includes_unistd="\
476 #ifdef HAVE_SYS_TYPES_H
477 # include <sys/types.h>
484 sys/types.h unistd.h,
485 [], [], [$curl_includes_unistd])
489 dnl CURL_INCLUDES_WINSOCK2
490 dnl -------------------------------------------------
491 dnl Set up variable with list of headers that must be
492 dnl included when winsock(2).h is to be included.
494 AC_DEFUN([CURL_INCLUDES_WINSOCK2], [
495 curl_includes_winsock2="\
497 #ifdef HAVE_WINDOWS_H
498 # ifndef WIN32_LEAN_AND_MEAN
499 # define WIN32_LEAN_AND_MEAN
501 # include <windows.h>
502 # ifdef HAVE_WINSOCK2_H
503 # include <winsock2.h>
505 # ifdef HAVE_WINSOCK_H
506 # include <winsock.h>
511 CURL_CHECK_HEADER_WINDOWS
512 CURL_CHECK_HEADER_WINSOCK
513 CURL_CHECK_HEADER_WINSOCK2
517 dnl CURL_INCLUDES_WS2TCPIP
518 dnl -------------------------------------------------
519 dnl Set up variable with list of headers that must be
520 dnl included when ws2tcpip.h is to be included.
522 AC_DEFUN([CURL_INCLUDES_WS2TCPIP], [
523 curl_includes_ws2tcpip="\
525 #ifdef HAVE_WINDOWS_H
526 # ifndef WIN32_LEAN_AND_MEAN
527 # define WIN32_LEAN_AND_MEAN
529 # include <windows.h>
530 # ifdef HAVE_WINSOCK2_H
531 # include <winsock2.h>
532 # ifdef HAVE_WS2TCPIP_H
533 # include <ws2tcpip.h>
538 CURL_CHECK_HEADER_WINDOWS
539 CURL_CHECK_HEADER_WINSOCK2
540 CURL_CHECK_HEADER_WS2TCPIP
544 dnl CURL_PREPROCESS_CALLCONV
545 dnl -------------------------------------------------
546 dnl Set up variable with a preprocessor block which
547 dnl defines function calling convention.
549 AC_DEFUN([CURL_PREPROCESS_CALLCONV], [
550 curl_preprocess_callconv="\
551 /* preprocess start */
552 #ifdef HAVE_WINDOWS_H
553 # define FUNCALLCONV __stdcall
557 /* preprocess end */"
561 dnl CURL_CHECK_FUNC_ALARM
562 dnl -------------------------------------------------
563 dnl Verify if alarm is available, prototyped, and
564 dnl can be compiled. If all of these are true, and
565 dnl usage has not been previously disallowed with
566 dnl shell variable curl_disallow_alarm, then
567 dnl HAVE_ALARM will be defined.
569 AC_DEFUN([CURL_CHECK_FUNC_ALARM], [
570 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
572 tst_links_alarm="unknown"
573 tst_proto_alarm="unknown"
574 tst_compi_alarm="unknown"
575 tst_allow_alarm="unknown"
577 AC_MSG_CHECKING([if alarm can be linked])
579 AC_LANG_FUNC_LINK_TRY([alarm])
582 tst_links_alarm="yes"
588 if test "$tst_links_alarm" = "yes"; then
589 AC_MSG_CHECKING([if alarm is prototyped])
590 AC_EGREP_CPP([alarm],[
591 $curl_includes_unistd
594 tst_proto_alarm="yes"
601 if test "$tst_proto_alarm" = "yes"; then
602 AC_MSG_CHECKING([if alarm is compilable])
605 $curl_includes_unistd
612 tst_compi_alarm="yes"
619 if test "$tst_compi_alarm" = "yes"; then
620 AC_MSG_CHECKING([if alarm usage allowed])
621 if test "x$curl_disallow_alarm" != "xyes"; then
623 tst_allow_alarm="yes"
630 AC_MSG_CHECKING([if alarm might be used])
631 if test "$tst_links_alarm" = "yes" &&
632 test "$tst_proto_alarm" = "yes" &&
633 test "$tst_compi_alarm" = "yes" &&
634 test "$tst_allow_alarm" = "yes"; then
636 AC_DEFINE_UNQUOTED(HAVE_ALARM, 1,
637 [Define to 1 if you have the alarm function.])
638 ac_cv_func_alarm="yes"
641 ac_cv_func_alarm="no"
646 dnl CURL_CHECK_FUNC_BASENAME
647 dnl -------------------------------------------------
648 dnl Verify if basename is available, prototyped, and
649 dnl can be compiled. If all of these are true, and
650 dnl usage has not been previously disallowed with
651 dnl shell variable curl_disallow_basename, then
652 dnl HAVE_BASENAME will be defined.
654 AC_DEFUN([CURL_CHECK_FUNC_BASENAME], [
655 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
656 AC_REQUIRE([CURL_INCLUDES_LIBGEN])dnl
657 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
659 tst_links_basename="unknown"
660 tst_proto_basename="unknown"
661 tst_compi_basename="unknown"
662 tst_allow_basename="unknown"
664 AC_MSG_CHECKING([if basename can be linked])
666 AC_LANG_FUNC_LINK_TRY([basename])
669 tst_links_basename="yes"
672 tst_links_basename="no"
675 if test "$tst_links_basename" = "yes"; then
676 AC_MSG_CHECKING([if basename is prototyped])
677 AC_EGREP_CPP([basename],[
678 $curl_includes_string
679 $curl_includes_libgen
680 $curl_includes_unistd
683 tst_proto_basename="yes"
686 tst_proto_basename="no"
690 if test "$tst_proto_basename" = "yes"; then
691 AC_MSG_CHECKING([if basename is compilable])
694 $curl_includes_string
695 $curl_includes_libgen
696 $curl_includes_unistd
703 tst_compi_basename="yes"
706 tst_compi_basename="no"
710 if test "$tst_compi_basename" = "yes"; then
711 AC_MSG_CHECKING([if basename usage allowed])
712 if test "x$curl_disallow_basename" != "xyes"; then
714 tst_allow_basename="yes"
717 tst_allow_basename="no"
721 AC_MSG_CHECKING([if basename might be used])
722 if test "$tst_links_basename" = "yes" &&
723 test "$tst_proto_basename" = "yes" &&
724 test "$tst_compi_basename" = "yes" &&
725 test "$tst_allow_basename" = "yes"; then
727 AC_DEFINE_UNQUOTED(HAVE_BASENAME, 1,
728 [Define to 1 if you have the basename function.])
729 ac_cv_func_basename="yes"
732 ac_cv_func_basename="no"
737 dnl CURL_CHECK_FUNC_CLOSESOCKET
738 dnl -------------------------------------------------
739 dnl Verify if closesocket is available, prototyped, and
740 dnl can be compiled. If all of these are true, and
741 dnl usage has not been previously disallowed with
742 dnl shell variable curl_disallow_closesocket, then
743 dnl HAVE_CLOSESOCKET will be defined.
745 AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [
746 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
747 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
749 tst_links_closesocket="unknown"
750 tst_proto_closesocket="unknown"
751 tst_compi_closesocket="unknown"
752 tst_allow_closesocket="unknown"
754 AC_MSG_CHECKING([if closesocket can be linked])
757 $curl_includes_winsock2
758 $curl_includes_socket
760 if(0 != closesocket(0))
765 tst_links_closesocket="yes"
768 tst_links_closesocket="no"
771 if test "$tst_links_closesocket" = "yes"; then
772 AC_MSG_CHECKING([if closesocket is prototyped])
773 AC_EGREP_CPP([closesocket],[
774 $curl_includes_winsock2
775 $curl_includes_socket
778 tst_proto_closesocket="yes"
781 tst_proto_closesocket="no"
785 if test "$tst_proto_closesocket" = "yes"; then
786 AC_MSG_CHECKING([if closesocket is compilable])
789 $curl_includes_winsock2
790 $curl_includes_socket
792 if(0 != closesocket(0))
797 tst_compi_closesocket="yes"
800 tst_compi_closesocket="no"
804 if test "$tst_compi_closesocket" = "yes"; then
805 AC_MSG_CHECKING([if closesocket usage allowed])
806 if test "x$curl_disallow_closesocket" != "xyes"; then
808 tst_allow_closesocket="yes"
811 tst_allow_closesocket="no"
815 AC_MSG_CHECKING([if closesocket might be used])
816 if test "$tst_links_closesocket" = "yes" &&
817 test "$tst_proto_closesocket" = "yes" &&
818 test "$tst_compi_closesocket" = "yes" &&
819 test "$tst_allow_closesocket" = "yes"; then
821 AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1,
822 [Define to 1 if you have the closesocket function.])
823 ac_cv_func_closesocket="yes"
826 ac_cv_func_closesocket="no"
831 dnl CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
832 dnl -------------------------------------------------
833 dnl Verify if CloseSocket is available, prototyped, and
834 dnl can be compiled. If all of these are true, and
835 dnl usage has not been previously disallowed with
836 dnl shell variable curl_disallow_closesocket_camel,
837 dnl then HAVE_CLOSESOCKET_CAMEL will be defined.
839 AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
840 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
842 tst_links_closesocket_camel="unknown"
843 tst_proto_closesocket_camel="unknown"
844 tst_compi_closesocket_camel="unknown"
845 tst_allow_closesocket_camel="unknown"
847 AC_MSG_CHECKING([if CloseSocket can be linked])
850 $curl_includes_sys_socket
852 if(0 != CloseSocket(0))
857 tst_links_closesocket_camel="yes"
860 tst_links_closesocket_camel="no"
863 if test "$tst_links_closesocket_camel" = "yes"; then
864 AC_MSG_CHECKING([if CloseSocket is prototyped])
865 AC_EGREP_CPP([CloseSocket],[
866 $curl_includes_sys_socket
869 tst_proto_closesocket_camel="yes"
872 tst_proto_closesocket_camel="no"
876 if test "$tst_proto_closesocket_camel" = "yes"; then
877 AC_MSG_CHECKING([if CloseSocket is compilable])
880 $curl_includes_sys_socket
882 if(0 != CloseSocket(0))
887 tst_compi_closesocket_camel="yes"
890 tst_compi_closesocket_camel="no"
894 if test "$tst_compi_closesocket_camel" = "yes"; then
895 AC_MSG_CHECKING([if CloseSocket usage allowed])
896 if test "x$curl_disallow_closesocket_camel" != "xyes"; then
898 tst_allow_closesocket_camel="yes"
901 tst_allow_closesocket_camel="no"
905 AC_MSG_CHECKING([if CloseSocket might be used])
906 if test "$tst_links_closesocket_camel" = "yes" &&
907 test "$tst_proto_closesocket_camel" = "yes" &&
908 test "$tst_compi_closesocket_camel" = "yes" &&
909 test "$tst_allow_closesocket_camel" = "yes"; then
911 AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1,
912 [Define to 1 if you have the CloseSocket camel case function.])
913 ac_cv_func_closesocket_camel="yes"
916 ac_cv_func_closesocket_camel="no"
921 dnl CURL_CHECK_FUNC_CONNECT
922 dnl -------------------------------------------------
923 dnl Verify if connect is available, prototyped, and
924 dnl can be compiled. If all of these are true, and
925 dnl usage has not been previously disallowed with
926 dnl shell variable curl_disallow_connect, then
927 dnl HAVE_CONNECT will be defined.
929 AC_DEFUN([CURL_CHECK_FUNC_CONNECT], [
930 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
931 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
932 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
934 tst_links_connect="unknown"
935 tst_proto_connect="unknown"
936 tst_compi_connect="unknown"
937 tst_allow_connect="unknown"
939 AC_MSG_CHECKING([if connect can be linked])
942 $curl_includes_winsock2
943 $curl_includes_sys_socket
944 $curl_includes_socket
946 if(0 != connect(0, 0, 0))
951 tst_links_connect="yes"
954 tst_links_connect="no"
957 if test "$tst_links_connect" = "yes"; then
958 AC_MSG_CHECKING([if connect is prototyped])
959 AC_EGREP_CPP([connect],[
960 $curl_includes_winsock2
961 $curl_includes_sys_socket
962 $curl_includes_socket
965 tst_proto_connect="yes"
968 tst_proto_connect="no"
972 if test "$tst_proto_connect" = "yes"; then
973 AC_MSG_CHECKING([if connect is compilable])
976 $curl_includes_winsock2
977 $curl_includes_sys_socket
978 $curl_includes_socket
980 if(0 != connect(0, 0, 0))
985 tst_compi_connect="yes"
988 tst_compi_connect="no"
992 if test "$tst_compi_connect" = "yes"; then
993 AC_MSG_CHECKING([if connect usage allowed])
994 if test "x$curl_disallow_connect" != "xyes"; then
996 tst_allow_connect="yes"
999 tst_allow_connect="no"
1003 AC_MSG_CHECKING([if connect might be used])
1004 if test "$tst_links_connect" = "yes" &&
1005 test "$tst_proto_connect" = "yes" &&
1006 test "$tst_compi_connect" = "yes" &&
1007 test "$tst_allow_connect" = "yes"; then
1008 AC_MSG_RESULT([yes])
1009 AC_DEFINE_UNQUOTED(HAVE_CONNECT, 1,
1010 [Define to 1 if you have the connect function.])
1011 ac_cv_func_connect="yes"
1014 ac_cv_func_connect="no"
1019 dnl CURL_CHECK_FUNC_FCNTL
1020 dnl -------------------------------------------------
1021 dnl Verify if fcntl is available, prototyped, and
1022 dnl can be compiled. If all of these are true, and
1023 dnl usage has not been previously disallowed with
1024 dnl shell variable curl_disallow_fcntl, then
1025 dnl HAVE_FCNTL will be defined.
1027 AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [
1028 AC_REQUIRE([CURL_INCLUDES_FCNTL])dnl
1030 tst_links_fcntl="unknown"
1031 tst_proto_fcntl="unknown"
1032 tst_compi_fcntl="unknown"
1033 tst_allow_fcntl="unknown"
1035 AC_MSG_CHECKING([if fcntl can be linked])
1037 AC_LANG_FUNC_LINK_TRY([fcntl])
1039 AC_MSG_RESULT([yes])
1040 tst_links_fcntl="yes"
1043 tst_links_fcntl="no"
1046 if test "$tst_links_fcntl" = "yes"; then
1047 AC_MSG_CHECKING([if fcntl is prototyped])
1048 AC_EGREP_CPP([fcntl],[
1049 $curl_includes_fcntl
1051 AC_MSG_RESULT([yes])
1052 tst_proto_fcntl="yes"
1055 tst_proto_fcntl="no"
1059 if test "$tst_proto_fcntl" = "yes"; then
1060 AC_MSG_CHECKING([if fcntl is compilable])
1063 $curl_includes_fcntl
1065 if(0 != fcntl(0, 0, 0))
1069 AC_MSG_RESULT([yes])
1070 tst_compi_fcntl="yes"
1073 tst_compi_fcntl="no"
1077 if test "$tst_compi_fcntl" = "yes"; then
1078 AC_MSG_CHECKING([if fcntl usage allowed])
1079 if test "x$curl_disallow_fcntl" != "xyes"; then
1080 AC_MSG_RESULT([yes])
1081 tst_allow_fcntl="yes"
1084 tst_allow_fcntl="no"
1088 AC_MSG_CHECKING([if fcntl might be used])
1089 if test "$tst_links_fcntl" = "yes" &&
1090 test "$tst_proto_fcntl" = "yes" &&
1091 test "$tst_compi_fcntl" = "yes" &&
1092 test "$tst_allow_fcntl" = "yes"; then
1093 AC_MSG_RESULT([yes])
1094 AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1,
1095 [Define to 1 if you have the fcntl function.])
1096 ac_cv_func_fcntl="yes"
1097 CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
1100 ac_cv_func_fcntl="no"
1105 dnl CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
1106 dnl -------------------------------------------------
1107 dnl Verify if fcntl with status flag O_NONBLOCK is
1108 dnl available, can be compiled, and seems to work. If
1109 dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK
1110 dnl will be defined.
1112 AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [
1114 tst_compi_fcntl_o_nonblock="unknown"
1115 tst_allow_fcntl_o_nonblock="unknown"
1118 sunos4* | aix3* | beos*)
1119 dnl O_NONBLOCK does not work on these platforms
1120 curl_disallow_fcntl_o_nonblock="yes"
1124 if test "$ac_cv_func_fcntl" = "yes"; then
1125 AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable])
1128 $curl_includes_fcntl
1131 if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
1135 AC_MSG_RESULT([yes])
1136 tst_compi_fcntl_o_nonblock="yes"
1139 tst_compi_fcntl_o_nonblock="no"
1143 if test "$tst_compi_fcntl_o_nonblock" = "yes"; then
1144 AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed])
1145 if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then
1146 AC_MSG_RESULT([yes])
1147 tst_allow_fcntl_o_nonblock="yes"
1150 tst_allow_fcntl_o_nonblock="no"
1154 AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used])
1155 if test "$tst_compi_fcntl_o_nonblock" = "yes" &&
1156 test "$tst_allow_fcntl_o_nonblock" = "yes"; then
1157 AC_MSG_RESULT([yes])
1158 AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1,
1159 [Define to 1 if you have a working fcntl O_NONBLOCK function.])
1160 ac_cv_func_fcntl_o_nonblock="yes"
1163 ac_cv_func_fcntl_o_nonblock="no"
1168 dnl CURL_CHECK_FUNC_FDOPEN
1169 dnl -------------------------------------------------
1170 dnl Verify if fdopen is available, prototyped, and
1171 dnl can be compiled. If all of these are true, and
1172 dnl usage has not been previously disallowed with
1173 dnl shell variable curl_disallow_fdopen, then
1174 dnl HAVE_FDOPEN will be defined.
1176 AC_DEFUN([CURL_CHECK_FUNC_FDOPEN], [
1177 AC_REQUIRE([CURL_INCLUDES_STDIO])dnl
1179 tst_links_fdopen="unknown"
1180 tst_proto_fdopen="unknown"
1181 tst_compi_fdopen="unknown"
1182 tst_allow_fdopen="unknown"
1184 AC_MSG_CHECKING([if fdopen can be linked])
1186 AC_LANG_FUNC_LINK_TRY([fdopen])
1188 AC_MSG_RESULT([yes])
1189 tst_links_fdopen="yes"
1192 tst_links_fdopen="no"
1195 if test "$tst_links_fdopen" = "yes"; then
1196 AC_MSG_CHECKING([if fdopen is prototyped])
1197 AC_EGREP_CPP([fdopen],[
1198 $curl_includes_stdio
1200 AC_MSG_RESULT([yes])
1201 tst_proto_fdopen="yes"
1204 tst_proto_fdopen="no"
1208 if test "$tst_proto_fdopen" = "yes"; then
1209 AC_MSG_CHECKING([if fdopen is compilable])
1212 $curl_includes_stdio
1214 if(0 != fdopen(0, 0))
1218 AC_MSG_RESULT([yes])
1219 tst_compi_fdopen="yes"
1222 tst_compi_fdopen="no"
1226 if test "$tst_compi_fdopen" = "yes"; then
1227 AC_MSG_CHECKING([if fdopen usage allowed])
1228 if test "x$curl_disallow_fdopen" != "xyes"; then
1229 AC_MSG_RESULT([yes])
1230 tst_allow_fdopen="yes"
1233 tst_allow_fdopen="no"
1237 AC_MSG_CHECKING([if fdopen might be used])
1238 if test "$tst_links_fdopen" = "yes" &&
1239 test "$tst_proto_fdopen" = "yes" &&
1240 test "$tst_compi_fdopen" = "yes" &&
1241 test "$tst_allow_fdopen" = "yes"; then
1242 AC_MSG_RESULT([yes])
1243 AC_DEFINE_UNQUOTED(HAVE_FDOPEN, 1,
1244 [Define to 1 if you have the fdopen function.])
1245 ac_cv_func_fdopen="yes"
1248 ac_cv_func_fdopen="no"
1253 dnl CURL_CHECK_FUNC_FGETXATTR
1254 dnl -------------------------------------------------
1255 dnl Verify if fgetxattr is available, prototyped, and
1256 dnl can be compiled. If all of these are true, and
1257 dnl usage has not been previously disallowed with
1258 dnl shell variable curl_disallow_fgetxattr, then
1259 dnl HAVE_FGETXATTR will be defined.
1261 AC_DEFUN([CURL_CHECK_FUNC_FGETXATTR], [
1262 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1264 tst_links_fgetxattr="unknown"
1265 tst_proto_fgetxattr="unknown"
1266 tst_compi_fgetxattr="unknown"
1267 tst_allow_fgetxattr="unknown"
1268 tst_nargs_fgetxattr="unknown"
1270 AC_MSG_CHECKING([if fgetxattr can be linked])
1272 AC_LANG_FUNC_LINK_TRY([fgetxattr])
1274 AC_MSG_RESULT([yes])
1275 tst_links_fgetxattr="yes"
1278 tst_links_fgetxattr="no"
1281 if test "$tst_links_fgetxattr" = "yes"; then
1282 AC_MSG_CHECKING([if fgetxattr is prototyped])
1283 AC_EGREP_CPP([fgetxattr],[
1284 $curl_includes_sys_xattr
1286 AC_MSG_RESULT([yes])
1287 tst_proto_fgetxattr="yes"
1290 tst_proto_fgetxattr="no"
1294 if test "$tst_proto_fgetxattr" = "yes"; then
1295 if test "$tst_nargs_fgetxattr" = "unknown"; then
1296 AC_MSG_CHECKING([if fgetxattr takes 4 args.])
1299 $curl_includes_sys_xattr
1301 if(0 != fgetxattr(0, 0, 0, 0))
1305 AC_MSG_RESULT([yes])
1306 tst_compi_fgetxattr="yes"
1307 tst_nargs_fgetxattr="4"
1310 tst_compi_fgetxattr="no"
1313 if test "$tst_nargs_fgetxattr" = "unknown"; then
1314 AC_MSG_CHECKING([if fgetxattr takes 6 args.])
1317 $curl_includes_sys_xattr
1319 if(0 != fgetxattr(0, 0, 0, 0, 0, 0))
1323 AC_MSG_RESULT([yes])
1324 tst_compi_fgetxattr="yes"
1325 tst_nargs_fgetxattr="6"
1328 tst_compi_fgetxattr="no"
1331 AC_MSG_CHECKING([if fgetxattr is compilable])
1332 if test "$tst_compi_fgetxattr" = "yes"; then
1333 AC_MSG_RESULT([yes])
1339 if test "$tst_compi_fgetxattr" = "yes"; then
1340 AC_MSG_CHECKING([if fgetxattr usage allowed])
1341 if test "x$curl_disallow_fgetxattr" != "xyes"; then
1342 AC_MSG_RESULT([yes])
1343 tst_allow_fgetxattr="yes"
1346 tst_allow_fgetxattr="no"
1350 AC_MSG_CHECKING([if fgetxattr might be used])
1351 if test "$tst_links_fgetxattr" = "yes" &&
1352 test "$tst_proto_fgetxattr" = "yes" &&
1353 test "$tst_compi_fgetxattr" = "yes" &&
1354 test "$tst_allow_fgetxattr" = "yes"; then
1355 AC_MSG_RESULT([yes])
1356 AC_DEFINE_UNQUOTED(HAVE_FGETXATTR, 1,
1357 [Define to 1 if you have the fgetxattr function.])
1358 dnl AC_DEFINE_UNQUOTED(FGETXATTR_ARGS, $tst_nargs_fgetxattr,
1359 dnl [Specifies the number of arguments to fgetxattr])
1361 if test "$tst_nargs_fgetxattr" -eq "4"; then
1362 AC_DEFINE(HAVE_FGETXATTR_4, 1, [fgetxattr() takes 4 args])
1363 elif test "$tst_nargs_fgetxattr" -eq "6"; then
1364 AC_DEFINE(HAVE_FGETXATTR_6, 1, [fgetxattr() takes 6 args])
1367 ac_cv_func_fgetxattr="yes"
1370 ac_cv_func_fgetxattr="no"
1375 dnl CURL_CHECK_FUNC_FLISTXATTR
1376 dnl -------------------------------------------------
1377 dnl Verify if flistxattr is available, prototyped, and
1378 dnl can be compiled. If all of these are true, and
1379 dnl usage has not been previously disallowed with
1380 dnl shell variable curl_disallow_flistxattr, then
1381 dnl HAVE_FLISTXATTR will be defined.
1383 AC_DEFUN([CURL_CHECK_FUNC_FLISTXATTR], [
1384 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1386 tst_links_flistxattr="unknown"
1387 tst_proto_flistxattr="unknown"
1388 tst_compi_flistxattr="unknown"
1389 tst_allow_flistxattr="unknown"
1390 tst_nargs_flistxattr="unknown"
1392 AC_MSG_CHECKING([if flistxattr can be linked])
1394 AC_LANG_FUNC_LINK_TRY([flistxattr])
1396 AC_MSG_RESULT([yes])
1397 tst_links_flistxattr="yes"
1400 tst_links_flistxattr="no"
1403 if test "$tst_links_flistxattr" = "yes"; then
1404 AC_MSG_CHECKING([if flistxattr is prototyped])
1405 AC_EGREP_CPP([flistxattr],[
1406 $curl_includes_sys_xattr
1408 AC_MSG_RESULT([yes])
1409 tst_proto_flistxattr="yes"
1412 tst_proto_flistxattr="no"
1416 if test "$tst_proto_flistxattr" = "yes"; then
1417 if test "$tst_nargs_flistxattr" = "unknown"; then
1418 AC_MSG_CHECKING([if flistxattr takes 3 args.])
1421 $curl_includes_sys_xattr
1423 if(0 != flistxattr(0, 0, 0))
1427 AC_MSG_RESULT([yes])
1428 tst_compi_flistxattr="yes"
1429 tst_nargs_flistxattr="3"
1432 tst_compi_flistxattr="no"
1435 if test "$tst_nargs_flistxattr" = "unknown"; then
1436 AC_MSG_CHECKING([if flistxattr takes 4 args.])
1439 $curl_includes_sys_xattr
1441 if(0 != flistxattr(0, 0, 0, 0))
1445 AC_MSG_RESULT([yes])
1446 tst_compi_flistxattr="yes"
1447 tst_nargs_flistxattr="4"
1450 tst_compi_flistxattr="no"
1453 AC_MSG_CHECKING([if flistxattr is compilable])
1454 if test "$tst_compi_flistxattr" = "yes"; then
1455 AC_MSG_RESULT([yes])
1461 if test "$tst_compi_flistxattr" = "yes"; then
1462 AC_MSG_CHECKING([if flistxattr usage allowed])
1463 if test "x$curl_disallow_flistxattr" != "xyes"; then
1464 AC_MSG_RESULT([yes])
1465 tst_allow_flistxattr="yes"
1468 tst_allow_flistxattr="no"
1472 AC_MSG_CHECKING([if flistxattr might be used])
1473 if test "$tst_links_flistxattr" = "yes" &&
1474 test "$tst_proto_flistxattr" = "yes" &&
1475 test "$tst_compi_flistxattr" = "yes" &&
1476 test "$tst_allow_flistxattr" = "yes"; then
1477 AC_MSG_RESULT([yes])
1478 AC_DEFINE_UNQUOTED(HAVE_FLISTXATTR, 1,
1479 [Define to 1 if you have the flistxattr function.])
1480 dnl AC_DEFINE_UNQUOTED(FLISTXATTR_ARGS, $tst_nargs_flistxattr,
1481 dnl [Specifies the number of arguments to flistxattr])
1483 if test "$tst_nargs_flistxattr" -eq "3"; then
1484 AC_DEFINE(HAVE_FLISTXATTR_3, 1, [flistxattr() takes 3 args])
1485 elif test "$tst_nargs_flistxattr" -eq "4"; then
1486 AC_DEFINE(HAVE_FLISTXATTR_4, 1, [flistxattr() takes 4 args])
1489 ac_cv_func_flistxattr="yes"
1492 ac_cv_func_flistxattr="no"
1497 dnl CURL_CHECK_FUNC_FREEADDRINFO
1498 dnl -------------------------------------------------
1499 dnl Verify if freeaddrinfo is available, prototyped,
1500 dnl and can be compiled. If all of these are true,
1501 dnl and usage has not been previously disallowed with
1502 dnl shell variable curl_disallow_freeaddrinfo, then
1503 dnl HAVE_FREEADDRINFO will be defined.
1505 AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [
1506 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
1507 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
1508 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1510 tst_links_freeaddrinfo="unknown"
1511 tst_proto_freeaddrinfo="unknown"
1512 tst_compi_freeaddrinfo="unknown"
1513 tst_allow_freeaddrinfo="unknown"
1515 AC_MSG_CHECKING([if freeaddrinfo can be linked])
1518 $curl_includes_ws2tcpip
1519 $curl_includes_sys_socket
1520 $curl_includes_netdb
1525 AC_MSG_RESULT([yes])
1526 tst_links_freeaddrinfo="yes"
1529 tst_links_freeaddrinfo="no"
1532 if test "$tst_links_freeaddrinfo" = "yes"; then
1533 AC_MSG_CHECKING([if freeaddrinfo is prototyped])
1534 AC_EGREP_CPP([freeaddrinfo],[
1535 $curl_includes_ws2tcpip
1536 $curl_includes_sys_socket
1537 $curl_includes_netdb
1539 AC_MSG_RESULT([yes])
1540 tst_proto_freeaddrinfo="yes"
1543 tst_proto_freeaddrinfo="no"
1547 if test "$tst_proto_freeaddrinfo" = "yes"; then
1548 AC_MSG_CHECKING([if freeaddrinfo is compilable])
1551 $curl_includes_ws2tcpip
1552 $curl_includes_sys_socket
1553 $curl_includes_netdb
1558 AC_MSG_RESULT([yes])
1559 tst_compi_freeaddrinfo="yes"
1562 tst_compi_freeaddrinfo="no"
1566 if test "$tst_compi_freeaddrinfo" = "yes"; then
1567 AC_MSG_CHECKING([if freeaddrinfo usage allowed])
1568 if test "x$curl_disallow_freeaddrinfo" != "xyes"; then
1569 AC_MSG_RESULT([yes])
1570 tst_allow_freeaddrinfo="yes"
1573 tst_allow_freeaddrinfo="no"
1577 AC_MSG_CHECKING([if freeaddrinfo might be used])
1578 if test "$tst_links_freeaddrinfo" = "yes" &&
1579 test "$tst_proto_freeaddrinfo" = "yes" &&
1580 test "$tst_compi_freeaddrinfo" = "yes" &&
1581 test "$tst_allow_freeaddrinfo" = "yes"; then
1582 AC_MSG_RESULT([yes])
1583 AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
1584 [Define to 1 if you have the freeaddrinfo function.])
1585 ac_cv_func_freeaddrinfo="yes"
1588 ac_cv_func_freeaddrinfo="no"
1593 dnl CURL_CHECK_FUNC_FREEIFADDRS
1594 dnl -------------------------------------------------
1595 dnl Verify if freeifaddrs is available, prototyped, and
1596 dnl can be compiled. If all of these are true, and
1597 dnl usage has not been previously disallowed with
1598 dnl shell variable curl_disallow_freeifaddrs, then
1599 dnl HAVE_FREEIFADDRS will be defined.
1601 AC_DEFUN([CURL_CHECK_FUNC_FREEIFADDRS], [
1602 AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
1604 tst_links_freeifaddrs="unknown"
1605 tst_proto_freeifaddrs="unknown"
1606 tst_compi_freeifaddrs="unknown"
1607 tst_allow_freeifaddrs="unknown"
1609 AC_MSG_CHECKING([if freeifaddrs can be linked])
1611 AC_LANG_FUNC_LINK_TRY([freeifaddrs])
1613 AC_MSG_RESULT([yes])
1614 tst_links_freeifaddrs="yes"
1617 tst_links_freeifaddrs="no"
1620 if test "$tst_links_freeifaddrs" = "yes"; then
1621 AC_MSG_CHECKING([if freeifaddrs is prototyped])
1622 AC_EGREP_CPP([freeifaddrs],[
1623 $curl_includes_ifaddrs
1625 AC_MSG_RESULT([yes])
1626 tst_proto_freeifaddrs="yes"
1629 tst_proto_freeifaddrs="no"
1633 if test "$tst_proto_freeifaddrs" = "yes"; then
1634 AC_MSG_CHECKING([if freeifaddrs is compilable])
1637 $curl_includes_ifaddrs
1642 AC_MSG_RESULT([yes])
1643 tst_compi_freeifaddrs="yes"
1646 tst_compi_freeifaddrs="no"
1650 if test "$tst_compi_freeifaddrs" = "yes"; then
1651 AC_MSG_CHECKING([if freeifaddrs usage allowed])
1652 if test "x$curl_disallow_freeifaddrs" != "xyes"; then
1653 AC_MSG_RESULT([yes])
1654 tst_allow_freeifaddrs="yes"
1657 tst_allow_freeifaddrs="no"
1661 AC_MSG_CHECKING([if freeifaddrs might be used])
1662 if test "$tst_links_freeifaddrs" = "yes" &&
1663 test "$tst_proto_freeifaddrs" = "yes" &&
1664 test "$tst_compi_freeifaddrs" = "yes" &&
1665 test "$tst_allow_freeifaddrs" = "yes"; then
1666 AC_MSG_RESULT([yes])
1667 AC_DEFINE_UNQUOTED(HAVE_FREEIFADDRS, 1,
1668 [Define to 1 if you have the freeifaddrs function.])
1669 ac_cv_func_freeifaddrs="yes"
1672 ac_cv_func_freeifaddrs="no"
1677 dnl CURL_CHECK_FUNC_FREMOVEXATTR
1678 dnl -------------------------------------------------
1679 dnl Verify if fremovexattr is available, prototyped, and
1680 dnl can be compiled. If all of these are true, and
1681 dnl usage has not been previously disallowed with
1682 dnl shell variable curl_disallow_fremovexattr, then
1683 dnl HAVE_FREMOVEXATTR will be defined.
1685 AC_DEFUN([CURL_CHECK_FUNC_FREMOVEXATTR], [
1686 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1688 tst_links_fremovexattr="unknown"
1689 tst_proto_fremovexattr="unknown"
1690 tst_compi_fremovexattr="unknown"
1691 tst_allow_fremovexattr="unknown"
1692 tst_nargs_fremovexattr="unknown"
1694 AC_MSG_CHECKING([if fremovexattr can be linked])
1696 AC_LANG_FUNC_LINK_TRY([fremovexattr])
1698 AC_MSG_RESULT([yes])
1699 tst_links_fremovexattr="yes"
1702 tst_links_fremovexattr="no"
1705 if test "$tst_links_fremovexattr" = "yes"; then
1706 AC_MSG_CHECKING([if fremovexattr is prototyped])
1707 AC_EGREP_CPP([fremovexattr],[
1708 $curl_includes_sys_xattr
1710 AC_MSG_RESULT([yes])
1711 tst_proto_fremovexattr="yes"
1714 tst_proto_fremovexattr="no"
1718 if test "$tst_proto_fremovexattr" = "yes"; then
1719 if test "$tst_nargs_fremovexattr" = "unknown"; then
1720 AC_MSG_CHECKING([if fremovexattr takes 2 args.])
1723 $curl_includes_sys_xattr
1725 if(0 != fremovexattr(0, 0))
1729 AC_MSG_RESULT([yes])
1730 tst_compi_fremovexattr="yes"
1731 tst_nargs_fremovexattr="2"
1734 tst_compi_fremovexattr="no"
1737 if test "$tst_nargs_fremovexattr" = "unknown"; then
1738 AC_MSG_CHECKING([if fremovexattr takes 3 args.])
1741 $curl_includes_sys_xattr
1743 if(0 != fremovexattr(0, 0, 0))
1747 AC_MSG_RESULT([yes])
1748 tst_compi_fremovexattr="yes"
1749 tst_nargs_fremovexattr="3"
1752 tst_compi_fremovexattr="no"
1755 AC_MSG_CHECKING([if fremovexattr is compilable])
1756 if test "$tst_compi_fremovexattr" = "yes"; then
1757 AC_MSG_RESULT([yes])
1763 if test "$tst_compi_fremovexattr" = "yes"; then
1764 AC_MSG_CHECKING([if fremovexattr usage allowed])
1765 if test "x$curl_disallow_fremovexattr" != "xyes"; then
1766 AC_MSG_RESULT([yes])
1767 tst_allow_fremovexattr="yes"
1770 tst_allow_fremovexattr="no"
1774 AC_MSG_CHECKING([if fremovexattr might be used])
1775 if test "$tst_links_fremovexattr" = "yes" &&
1776 test "$tst_proto_fremovexattr" = "yes" &&
1777 test "$tst_compi_fremovexattr" = "yes" &&
1778 test "$tst_allow_fremovexattr" = "yes"; then
1779 AC_MSG_RESULT([yes])
1780 AC_DEFINE_UNQUOTED(HAVE_FREMOVEXATTR, 1,
1781 [Define to 1 if you have the fremovexattr function.])
1782 dnl AC_DEFINE_UNQUOTED(FREMOVEXATTR_ARGS, $tst_nargs_fremovexattr,
1783 dnl [Specifies the number of arguments to fremovexattr])
1785 if test "$tst_nargs_fremovexattr" -eq "2"; then
1786 AC_DEFINE(HAVE_FREMOVEXATTR_2, 1, [fremovexattr() takes 2 args])
1787 elif test "$tst_nargs_fremovexattr" -eq "3"; then
1788 AC_DEFINE(HAVE_FREMOVEXATTR_3, 1, [fremovexattr() takes 3 args])
1791 ac_cv_func_fremovexattr="yes"
1794 ac_cv_func_fremovexattr="no"
1799 dnl CURL_CHECK_FUNC_FSETXATTR
1800 dnl -------------------------------------------------
1801 dnl Verify if fsetxattr is available, prototyped, and
1802 dnl can be compiled. If all of these are true, and
1803 dnl usage has not been previously disallowed with
1804 dnl shell variable curl_disallow_fsetxattr, then
1805 dnl HAVE_FSETXATTR will be defined.
1807 AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [
1808 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1810 tst_links_fsetxattr="unknown"
1811 tst_proto_fsetxattr="unknown"
1812 tst_compi_fsetxattr="unknown"
1813 tst_allow_fsetxattr="unknown"
1814 tst_nargs_fsetxattr="unknown"
1816 AC_MSG_CHECKING([if fsetxattr can be linked])
1818 AC_LANG_FUNC_LINK_TRY([fsetxattr])
1820 AC_MSG_RESULT([yes])
1821 tst_links_fsetxattr="yes"
1824 tst_links_fsetxattr="no"
1827 if test "$tst_links_fsetxattr" = "yes"; then
1828 AC_MSG_CHECKING([if fsetxattr is prototyped])
1829 AC_EGREP_CPP([fsetxattr],[
1830 $curl_includes_sys_xattr
1832 AC_MSG_RESULT([yes])
1833 tst_proto_fsetxattr="yes"
1836 tst_proto_fsetxattr="no"
1840 if test "$tst_proto_fsetxattr" = "yes"; then
1841 if test "$tst_nargs_fsetxattr" = "unknown"; then
1842 AC_MSG_CHECKING([if fsetxattr takes 5 args.])
1845 $curl_includes_sys_xattr
1847 if(0 != fsetxattr(0, 0, 0, 0, 0))
1851 AC_MSG_RESULT([yes])
1852 tst_compi_fsetxattr="yes"
1853 tst_nargs_fsetxattr="5"
1856 tst_compi_fsetxattr="no"
1859 if test "$tst_nargs_fsetxattr" = "unknown"; then
1860 AC_MSG_CHECKING([if fsetxattr takes 6 args.])
1863 $curl_includes_sys_xattr
1865 if(0 != fsetxattr(0, 0, 0, 0, 0, 0))
1869 AC_MSG_RESULT([yes])
1870 tst_compi_fsetxattr="yes"
1871 tst_nargs_fsetxattr="6"
1874 tst_compi_fsetxattr="no"
1877 AC_MSG_CHECKING([if fsetxattr is compilable])
1878 if test "$tst_compi_fsetxattr" = "yes"; then
1879 AC_MSG_RESULT([yes])
1885 if test "$tst_compi_fsetxattr" = "yes"; then
1886 AC_MSG_CHECKING([if fsetxattr usage allowed])
1887 if test "x$curl_disallow_fsetxattr" != "xyes"; then
1888 AC_MSG_RESULT([yes])
1889 tst_allow_fsetxattr="yes"
1892 tst_allow_fsetxattr="no"
1896 AC_MSG_CHECKING([if fsetxattr might be used])
1897 if test "$tst_links_fsetxattr" = "yes" &&
1898 test "$tst_proto_fsetxattr" = "yes" &&
1899 test "$tst_compi_fsetxattr" = "yes" &&
1900 test "$tst_allow_fsetxattr" = "yes"; then
1901 AC_MSG_RESULT([yes])
1902 AC_DEFINE_UNQUOTED(HAVE_FSETXATTR, 1,
1903 [Define to 1 if you have the fsetxattr function.])
1904 dnl AC_DEFINE_UNQUOTED(FSETXATTR_ARGS, $tst_nargs_fsetxattr,
1905 dnl [Specifies the number of arguments to fsetxattr])
1907 if test "$tst_nargs_fsetxattr" -eq "5"; then
1908 AC_DEFINE(HAVE_FSETXATTR_5, 1, [fsetxattr() takes 5 args])
1909 elif test "$tst_nargs_fsetxattr" -eq "6"; then
1910 AC_DEFINE(HAVE_FSETXATTR_6, 1, [fsetxattr() takes 6 args])
1913 ac_cv_func_fsetxattr="yes"
1916 ac_cv_func_fsetxattr="no"
1921 dnl CURL_CHECK_FUNC_FTRUNCATE
1922 dnl -------------------------------------------------
1923 dnl Verify if ftruncate is available, prototyped, and
1924 dnl can be compiled. If all of these are true, and
1925 dnl usage has not been previously disallowed with
1926 dnl shell variable curl_disallow_ftruncate, then
1927 dnl HAVE_FTRUNCATE will be defined.
1929 AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [
1930 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
1932 tst_links_ftruncate="unknown"
1933 tst_proto_ftruncate="unknown"
1934 tst_compi_ftruncate="unknown"
1935 tst_allow_ftruncate="unknown"
1937 AC_MSG_CHECKING([if ftruncate can be linked])
1939 AC_LANG_FUNC_LINK_TRY([ftruncate])
1941 AC_MSG_RESULT([yes])
1942 tst_links_ftruncate="yes"
1945 tst_links_ftruncate="no"
1948 if test "$tst_links_ftruncate" = "yes"; then
1949 AC_MSG_CHECKING([if ftruncate is prototyped])
1950 AC_EGREP_CPP([ftruncate],[
1951 $curl_includes_unistd
1953 AC_MSG_RESULT([yes])
1954 tst_proto_ftruncate="yes"
1957 tst_proto_ftruncate="no"
1961 if test "$tst_proto_ftruncate" = "yes"; then
1962 AC_MSG_CHECKING([if ftruncate is compilable])
1965 $curl_includes_unistd
1967 if(0 != ftruncate(0, 0))
1971 AC_MSG_RESULT([yes])
1972 tst_compi_ftruncate="yes"
1975 tst_compi_ftruncate="no"
1979 if test "$tst_compi_ftruncate" = "yes"; then
1980 AC_MSG_CHECKING([if ftruncate usage allowed])
1981 if test "x$curl_disallow_ftruncate" != "xyes"; then
1982 AC_MSG_RESULT([yes])
1983 tst_allow_ftruncate="yes"
1986 tst_allow_ftruncate="no"
1990 AC_MSG_CHECKING([if ftruncate might be used])
1991 if test "$tst_links_ftruncate" = "yes" &&
1992 test "$tst_proto_ftruncate" = "yes" &&
1993 test "$tst_compi_ftruncate" = "yes" &&
1994 test "$tst_allow_ftruncate" = "yes"; then
1995 AC_MSG_RESULT([yes])
1996 AC_DEFINE_UNQUOTED(HAVE_FTRUNCATE, 1,
1997 [Define to 1 if you have the ftruncate function.])
1998 ac_cv_func_ftruncate="yes"
2001 ac_cv_func_ftruncate="no"
2006 dnl CURL_CHECK_FUNC_GETADDRINFO
2007 dnl -------------------------------------------------
2008 dnl Verify if getaddrinfo is available, prototyped, can
2009 dnl be compiled and seems to work. If all of these are
2010 dnl true, and usage has not been previously disallowed
2011 dnl with shell variable curl_disallow_getaddrinfo, then
2012 dnl HAVE_GETADDRINFO will be defined. Additionally when
2013 dnl HAVE_GETADDRINFO gets defined this will also attempt
2014 dnl to find out if getaddrinfo happens to be threadsafe,
2015 dnl defining HAVE_GETADDRINFO_THREADSAFE when true.
2017 AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
2018 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
2019 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
2020 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
2021 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
2022 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2023 AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
2025 tst_links_getaddrinfo="unknown"
2026 tst_proto_getaddrinfo="unknown"
2027 tst_compi_getaddrinfo="unknown"
2028 tst_works_getaddrinfo="unknown"
2029 tst_allow_getaddrinfo="unknown"
2030 tst_tsafe_getaddrinfo="unknown"
2032 AC_MSG_CHECKING([if getaddrinfo can be linked])
2035 $curl_includes_ws2tcpip
2036 $curl_includes_sys_socket
2037 $curl_includes_netdb
2039 if(0 != getaddrinfo(0, 0, 0, 0))
2043 AC_MSG_RESULT([yes])
2044 tst_links_getaddrinfo="yes"
2047 tst_links_getaddrinfo="no"
2050 if test "$tst_links_getaddrinfo" = "yes"; then
2051 AC_MSG_CHECKING([if getaddrinfo is prototyped])
2052 AC_EGREP_CPP([getaddrinfo],[
2053 $curl_includes_ws2tcpip
2054 $curl_includes_sys_socket
2055 $curl_includes_netdb
2057 AC_MSG_RESULT([yes])
2058 tst_proto_getaddrinfo="yes"
2061 tst_proto_getaddrinfo="no"
2065 if test "$tst_proto_getaddrinfo" = "yes"; then
2066 AC_MSG_CHECKING([if getaddrinfo is compilable])
2069 $curl_includes_ws2tcpip
2070 $curl_includes_sys_socket
2071 $curl_includes_netdb
2073 if(0 != getaddrinfo(0, 0, 0, 0))
2077 AC_MSG_RESULT([yes])
2078 tst_compi_getaddrinfo="yes"
2081 tst_compi_getaddrinfo="no"
2085 dnl only do runtime verification when not cross-compiling
2086 if test "x$cross_compiling" != "xyes" &&
2087 test "$tst_compi_getaddrinfo" = "yes"; then
2088 AC_MSG_CHECKING([if getaddrinfo seems to work])
2091 $curl_includes_ws2tcpip
2092 $curl_includes_stdlib
2093 $curl_includes_string
2094 $curl_includes_sys_socket
2095 $curl_includes_netdb
2097 struct addrinfo hints;
2098 struct addrinfo *ai = 0;
2101 memset(&hints, 0, sizeof(hints));
2102 hints.ai_flags = AI_NUMERICHOST;
2103 hints.ai_family = AF_UNSPEC;
2104 hints.ai_socktype = SOCK_STREAM;
2105 error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
2112 AC_MSG_RESULT([yes])
2113 tst_works_getaddrinfo="yes"
2116 tst_works_getaddrinfo="no"
2120 if test "$tst_compi_getaddrinfo" = "yes" &&
2121 test "$tst_works_getaddrinfo" != "no"; then
2122 AC_MSG_CHECKING([if getaddrinfo usage allowed])
2123 if test "x$curl_disallow_getaddrinfo" != "xyes"; then
2124 AC_MSG_RESULT([yes])
2125 tst_allow_getaddrinfo="yes"
2128 tst_allow_getaddrinfo="no"
2132 AC_MSG_CHECKING([if getaddrinfo might be used])
2133 if test "$tst_links_getaddrinfo" = "yes" &&
2134 test "$tst_proto_getaddrinfo" = "yes" &&
2135 test "$tst_compi_getaddrinfo" = "yes" &&
2136 test "$tst_allow_getaddrinfo" = "yes" &&
2137 test "$tst_works_getaddrinfo" != "no"; then
2138 AC_MSG_RESULT([yes])
2139 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
2140 [Define to 1 if you have a working getaddrinfo function.])
2141 ac_cv_func_getaddrinfo="yes"
2144 ac_cv_func_getaddrinfo="no"
2145 ac_cv_func_getaddrinfo_threadsafe="no"
2148 if test "$ac_cv_func_getaddrinfo" = "yes"; then
2149 AC_MSG_CHECKING([if getaddrinfo is threadsafe])
2151 aix[[1234]].* | aix5.[[01]].*)
2152 dnl aix 5.1 and older
2153 tst_tsafe_getaddrinfo="no"
2156 dnl aix 5.2 and newer
2157 tst_tsafe_getaddrinfo="yes"
2160 dnl darwin 5.0 and mac os x 10.1.X and older
2161 tst_tsafe_getaddrinfo="no"
2164 dnl darwin 6.0 and mac os x 10.2.X and newer
2165 tst_tsafe_getaddrinfo="yes"
2167 freebsd[[1234]].* | freebsd5.[[1234]]*)
2168 dnl freebsd 5.4 and older
2169 tst_tsafe_getaddrinfo="no"
2172 dnl freebsd 5.5 and newer
2173 tst_tsafe_getaddrinfo="yes"
2175 hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*)
2176 dnl hpux 11.10 and older
2177 tst_tsafe_getaddrinfo="no"
2180 dnl hpux 11.11 and newer
2181 tst_tsafe_getaddrinfo="yes"
2184 dnl netbsd 3.X and older
2185 tst_tsafe_getaddrinfo="no"
2188 dnl netbsd 4.X and newer
2189 tst_tsafe_getaddrinfo="yes"
2193 tst_tsafe_getaddrinfo="no"
2196 dnl solaris which have it
2197 tst_tsafe_getaddrinfo="yes"
2200 if test "$tst_tsafe_getaddrinfo" = "unknown" &&
2201 test "$ac_cv_native_windows" = "yes"; then
2202 tst_tsafe_getaddrinfo="yes"
2204 if test "$tst_tsafe_getaddrinfo" = "unknown"; then
2205 CURL_CHECK_DEF_CC([h_errno], [
2206 $curl_includes_sys_socket
2207 $curl_includes_netdb
2209 if test "$curl_cv_have_def_h_errno" = "yes"; then
2210 tst_h_errno_macro="yes"
2212 tst_h_errno_macro="no"
2216 $curl_includes_sys_socket
2217 $curl_includes_netdb
2224 tst_h_errno_modifiable_lvalue="yes"
2226 tst_h_errno_modifiable_lvalue="no"
2231 #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
2233 #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
2236 force compilation error
2240 tst_h_errno_sbs_issue_7="yes"
2242 tst_h_errno_sbs_issue_7="no"
2244 if test "$tst_h_errno_macro" = "no" &&
2245 test "$tst_h_errno_modifiable_lvalue" = "no" &&
2246 test "$tst_h_errno_sbs_issue_7" = "no"; then
2247 tst_tsafe_getaddrinfo="no"
2249 tst_tsafe_getaddrinfo="yes"
2252 AC_MSG_RESULT([$tst_tsafe_getaddrinfo])
2253 if test "$tst_tsafe_getaddrinfo" = "yes"; then
2254 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1,
2255 [Define to 1 if the getaddrinfo function is threadsafe.])
2256 ac_cv_func_getaddrinfo_threadsafe="yes"
2258 ac_cv_func_getaddrinfo_threadsafe="no"
2264 dnl CURL_CHECK_FUNC_GETHOSTBYADDR
2265 dnl -------------------------------------------------
2266 dnl Verify if gethostbyaddr is available, prototyped,
2267 dnl and can be compiled. If all of these are true,
2268 dnl and usage has not been previously disallowed with
2269 dnl shell variable curl_disallow_gethostbyaddr, then
2270 dnl HAVE_GETHOSTBYADDR will be defined.
2272 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR], [
2273 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2274 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2276 tst_links_gethostbyaddr="unknown"
2277 tst_proto_gethostbyaddr="unknown"
2278 tst_compi_gethostbyaddr="unknown"
2279 tst_allow_gethostbyaddr="unknown"
2281 AC_MSG_CHECKING([if gethostbyaddr can be linked])
2284 $curl_includes_winsock2
2285 $curl_includes_netdb
2287 if(0 != gethostbyaddr(0, 0, 0))
2291 AC_MSG_RESULT([yes])
2292 tst_links_gethostbyaddr="yes"
2295 tst_links_gethostbyaddr="no"
2298 if test "$tst_links_gethostbyaddr" = "yes"; then
2299 AC_MSG_CHECKING([if gethostbyaddr is prototyped])
2300 AC_EGREP_CPP([gethostbyaddr],[
2301 $curl_includes_winsock2
2302 $curl_includes_netdb
2304 AC_MSG_RESULT([yes])
2305 tst_proto_gethostbyaddr="yes"
2308 tst_proto_gethostbyaddr="no"
2312 if test "$tst_proto_gethostbyaddr" = "yes"; then
2313 AC_MSG_CHECKING([if gethostbyaddr is compilable])
2316 $curl_includes_winsock2
2317 $curl_includes_netdb
2319 if(0 != gethostbyaddr(0, 0, 0))
2323 AC_MSG_RESULT([yes])
2324 tst_compi_gethostbyaddr="yes"
2327 tst_compi_gethostbyaddr="no"
2331 if test "$tst_compi_gethostbyaddr" = "yes"; then
2332 AC_MSG_CHECKING([if gethostbyaddr usage allowed])
2333 if test "x$curl_disallow_gethostbyaddr" != "xyes"; then
2334 AC_MSG_RESULT([yes])
2335 tst_allow_gethostbyaddr="yes"
2338 tst_allow_gethostbyaddr="no"
2342 AC_MSG_CHECKING([if gethostbyaddr might be used])
2343 if test "$tst_links_gethostbyaddr" = "yes" &&
2344 test "$tst_proto_gethostbyaddr" = "yes" &&
2345 test "$tst_compi_gethostbyaddr" = "yes" &&
2346 test "$tst_allow_gethostbyaddr" = "yes"; then
2347 AC_MSG_RESULT([yes])
2348 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR, 1,
2349 [Define to 1 if you have the gethostbyaddr function.])
2350 ac_cv_func_gethostbyaddr="yes"
2353 ac_cv_func_gethostbyaddr="no"
2357 dnl CURL_CHECK_FUNC_GAI_STRERROR
2358 dnl -------------------------------------------------
2359 dnl Verify if gai_strerror is available, prototyped,
2360 dnl and can be compiled. If all of these are true,
2361 dnl and usage has not been previously disallowed with
2362 dnl shell variable curl_disallow_gai_strerror, then
2363 dnl HAVE_GAI_STRERROR will be defined.
2365 AC_DEFUN([CURL_CHECK_FUNC_GAI_STRERROR], [
2366 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2367 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2369 tst_links_gai_strerror="unknown"
2370 tst_proto_gai_strerror="unknown"
2371 tst_compi_gai_strerror="unknown"
2372 tst_allow_gai_strerror="unknown"
2374 AC_MSG_CHECKING([if gai_strerror can be linked])
2377 $curl_includes_winsock2
2378 $curl_includes_netdb
2380 if(0 != gai_strerror(0))
2384 AC_MSG_RESULT([yes])
2385 tst_links_gai_strerror="yes"
2388 tst_links_gai_strerror="no"
2391 if test "$tst_links_gai_strerror" = "yes"; then
2392 AC_MSG_CHECKING([if gai_strerror is prototyped])
2393 AC_EGREP_CPP([gai_strerror],[
2394 $curl_includes_winsock2
2395 $curl_includes_netdb
2397 AC_MSG_RESULT([yes])
2398 tst_proto_gai_strerror="yes"
2401 tst_proto_gai_strerror="no"
2405 if test "$tst_proto_gai_strerror" = "yes"; then
2406 AC_MSG_CHECKING([if gai_strerror is compilable])
2409 $curl_includes_winsock2
2410 $curl_includes_netdb
2412 if(0 != gai_strerror(0))
2416 AC_MSG_RESULT([yes])
2417 tst_compi_gai_strerror="yes"
2420 tst_compi_gai_strerror="no"
2424 if test "$tst_compi_gai_strerror" = "yes"; then
2425 AC_MSG_CHECKING([if gai_strerror usage allowed])
2426 if test "x$curl_disallow_gai_strerror" != "xyes"; then
2427 AC_MSG_RESULT([yes])
2428 tst_allow_gai_strerror="yes"
2431 tst_allow_gai_strerror="no"
2435 AC_MSG_CHECKING([if gai_strerror might be used])
2436 if test "$tst_links_gai_strerror" = "yes" &&
2437 test "$tst_proto_gai_strerror" = "yes" &&
2438 test "$tst_compi_gai_strerror" = "yes" &&
2439 test "$tst_allow_gai_strerror" = "yes"; then
2440 AC_MSG_RESULT([yes])
2441 AC_DEFINE_UNQUOTED(HAVE_GAI_STRERROR, 1,
2442 [Define to 1 if you have the gai_strerror function.])
2443 ac_cv_func_gai_strerror="yes"
2446 ac_cv_func_gai_strerror="no"
2451 dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R
2452 dnl -------------------------------------------------
2453 dnl Verify if gethostbyaddr_r is available, prototyped,
2454 dnl and can be compiled. If all of these are true, and
2455 dnl usage has not been previously disallowed with
2456 dnl shell variable curl_disallow_gethostbyaddr_r, then
2457 dnl HAVE_GETHOSTBYADDR_R will be defined.
2459 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR_R], [
2460 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2462 tst_links_gethostbyaddr_r="unknown"
2463 tst_proto_gethostbyaddr_r="unknown"
2464 tst_compi_gethostbyaddr_r="unknown"
2465 tst_allow_gethostbyaddr_r="unknown"
2466 tst_nargs_gethostbyaddr_r="unknown"
2468 AC_MSG_CHECKING([if gethostbyaddr_r can be linked])
2470 AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
2472 AC_MSG_RESULT([yes])
2473 tst_links_gethostbyaddr_r="yes"
2476 tst_links_gethostbyaddr_r="no"
2479 if test "$tst_links_gethostbyaddr_r" = "yes"; then
2480 AC_MSG_CHECKING([if gethostbyaddr_r is prototyped])
2481 AC_EGREP_CPP([gethostbyaddr_r],[
2482 $curl_includes_netdb
2484 AC_MSG_RESULT([yes])
2485 tst_proto_gethostbyaddr_r="yes"
2488 tst_proto_gethostbyaddr_r="no"
2492 if test "$tst_proto_gethostbyaddr_r" = "yes"; then
2493 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
2494 AC_MSG_CHECKING([if gethostbyaddr_r takes 5 args.])
2497 $curl_includes_netdb
2499 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0))
2503 AC_MSG_RESULT([yes])
2504 tst_compi_gethostbyaddr_r="yes"
2505 tst_nargs_gethostbyaddr_r="5"
2508 tst_compi_gethostbyaddr_r="no"
2511 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
2512 AC_MSG_CHECKING([if gethostbyaddr_r takes 7 args.])
2515 $curl_includes_netdb
2517 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0))
2521 AC_MSG_RESULT([yes])
2522 tst_compi_gethostbyaddr_r="yes"
2523 tst_nargs_gethostbyaddr_r="7"
2526 tst_compi_gethostbyaddr_r="no"
2529 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
2530 AC_MSG_CHECKING([if gethostbyaddr_r takes 8 args.])
2533 $curl_includes_netdb
2535 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0))
2539 AC_MSG_RESULT([yes])
2540 tst_compi_gethostbyaddr_r="yes"
2541 tst_nargs_gethostbyaddr_r="8"
2544 tst_compi_gethostbyaddr_r="no"
2547 AC_MSG_CHECKING([if gethostbyaddr_r is compilable])
2548 if test "$tst_compi_gethostbyaddr_r" = "yes"; then
2549 AC_MSG_RESULT([yes])
2555 if test "$tst_compi_gethostbyaddr_r" = "yes"; then
2556 AC_MSG_CHECKING([if gethostbyaddr_r usage allowed])
2557 if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then
2558 AC_MSG_RESULT([yes])
2559 tst_allow_gethostbyaddr_r="yes"
2562 tst_allow_gethostbyaddr_r="no"
2566 AC_MSG_CHECKING([if gethostbyaddr_r might be used])
2567 if test "$tst_links_gethostbyaddr_r" = "yes" &&
2568 test "$tst_proto_gethostbyaddr_r" = "yes" &&
2569 test "$tst_compi_gethostbyaddr_r" = "yes" &&
2570 test "$tst_allow_gethostbyaddr_r" = "yes"; then
2571 AC_MSG_RESULT([yes])
2572 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1,
2573 [Define to 1 if you have the gethostbyaddr_r function.])
2574 dnl AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_ARGS, $tst_nargs_gethostbyaddr_r,
2575 dnl [Specifies the number of arguments to gethostbyaddr_r])
2577 if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then
2578 AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
2579 elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then
2580 AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
2581 elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then
2582 AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
2585 ac_cv_func_gethostbyaddr_r="yes"
2588 ac_cv_func_gethostbyaddr_r="no"
2593 dnl CURL_CHECK_FUNC_GETHOSTBYNAME
2594 dnl -------------------------------------------------
2595 dnl Verify if gethostbyname is available, prototyped,
2596 dnl and can be compiled. If all of these are true,
2597 dnl and usage has not been previously disallowed with
2598 dnl shell variable curl_disallow_gethostbyname, then
2599 dnl HAVE_GETHOSTBYNAME will be defined.
2601 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME], [
2602 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2603 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2605 tst_links_gethostbyname="unknown"
2606 tst_proto_gethostbyname="unknown"
2607 tst_compi_gethostbyname="unknown"
2608 tst_allow_gethostbyname="unknown"
2610 AC_MSG_CHECKING([if gethostbyname can be linked])
2613 $curl_includes_winsock2
2614 $curl_includes_netdb
2616 if(0 != gethostbyname(0))
2620 AC_MSG_RESULT([yes])
2621 tst_links_gethostbyname="yes"
2624 tst_links_gethostbyname="no"
2627 if test "$tst_links_gethostbyname" = "yes"; then
2628 AC_MSG_CHECKING([if gethostbyname is prototyped])
2629 AC_EGREP_CPP([gethostbyname],[
2630 $curl_includes_winsock2
2631 $curl_includes_netdb
2633 AC_MSG_RESULT([yes])
2634 tst_proto_gethostbyname="yes"
2637 tst_proto_gethostbyname="no"
2641 if test "$tst_proto_gethostbyname" = "yes"; then
2642 AC_MSG_CHECKING([if gethostbyname is compilable])
2645 $curl_includes_winsock2
2646 $curl_includes_netdb
2648 if(0 != gethostbyname(0))
2652 AC_MSG_RESULT([yes])
2653 tst_compi_gethostbyname="yes"
2656 tst_compi_gethostbyname="no"
2660 if test "$tst_compi_gethostbyname" = "yes"; then
2661 AC_MSG_CHECKING([if gethostbyname usage allowed])
2662 if test "x$curl_disallow_gethostbyname" != "xyes"; then
2663 AC_MSG_RESULT([yes])
2664 tst_allow_gethostbyname="yes"
2667 tst_allow_gethostbyname="no"
2671 AC_MSG_CHECKING([if gethostbyname might be used])
2672 if test "$tst_links_gethostbyname" = "yes" &&
2673 test "$tst_proto_gethostbyname" = "yes" &&
2674 test "$tst_compi_gethostbyname" = "yes" &&
2675 test "$tst_allow_gethostbyname" = "yes"; then
2676 AC_MSG_RESULT([yes])
2677 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME, 1,
2678 [Define to 1 if you have the gethostbyname function.])
2679 ac_cv_func_gethostbyname="yes"
2682 ac_cv_func_gethostbyname="no"
2687 dnl CURL_CHECK_FUNC_GETHOSTBYNAME_R
2688 dnl -------------------------------------------------
2689 dnl Verify if gethostbyname_r is available, prototyped,
2690 dnl and can be compiled. If all of these are true, and
2691 dnl usage has not been previously disallowed with
2692 dnl shell variable curl_disallow_gethostbyname_r, then
2693 dnl HAVE_GETHOSTBYNAME_R will be defined.
2695 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [
2696 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2698 tst_links_gethostbyname_r="unknown"
2699 tst_proto_gethostbyname_r="unknown"
2700 tst_compi_gethostbyname_r="unknown"
2701 tst_allow_gethostbyname_r="unknown"
2702 tst_nargs_gethostbyname_r="unknown"
2704 AC_MSG_CHECKING([if gethostbyname_r can be linked])
2706 AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
2708 AC_MSG_RESULT([yes])
2709 tst_links_gethostbyname_r="yes"
2712 tst_links_gethostbyname_r="no"
2715 if test "$tst_links_gethostbyname_r" = "yes"; then
2716 AC_MSG_CHECKING([if gethostbyname_r is prototyped])
2717 AC_EGREP_CPP([gethostbyname_r],[
2718 $curl_includes_netdb
2720 AC_MSG_RESULT([yes])
2721 tst_proto_gethostbyname_r="yes"
2724 tst_proto_gethostbyname_r="no"
2728 if test "$tst_proto_gethostbyname_r" = "yes"; then
2729 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
2730 AC_MSG_CHECKING([if gethostbyname_r takes 3 args.])
2733 $curl_includes_netdb
2735 if(0 != gethostbyname_r(0, 0, 0))
2739 AC_MSG_RESULT([yes])
2740 tst_compi_gethostbyname_r="yes"
2741 tst_nargs_gethostbyname_r="3"
2744 tst_compi_gethostbyname_r="no"
2747 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
2748 AC_MSG_CHECKING([if gethostbyname_r takes 5 args.])
2751 $curl_includes_netdb
2753 if(0 != gethostbyname_r(0, 0, 0, 0, 0))
2757 AC_MSG_RESULT([yes])
2758 tst_compi_gethostbyname_r="yes"
2759 tst_nargs_gethostbyname_r="5"
2762 tst_compi_gethostbyname_r="no"
2765 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
2766 AC_MSG_CHECKING([if gethostbyname_r takes 6 args.])
2769 $curl_includes_netdb
2771 if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0))
2775 AC_MSG_RESULT([yes])
2776 tst_compi_gethostbyname_r="yes"
2777 tst_nargs_gethostbyname_r="6"
2780 tst_compi_gethostbyname_r="no"
2783 AC_MSG_CHECKING([if gethostbyname_r is compilable])
2784 if test "$tst_compi_gethostbyname_r" = "yes"; then
2785 AC_MSG_RESULT([yes])
2791 if test "$tst_compi_gethostbyname_r" = "yes"; then
2792 AC_MSG_CHECKING([if gethostbyname_r usage allowed])
2793 if test "x$curl_disallow_gethostbyname_r" != "xyes"; then
2794 AC_MSG_RESULT([yes])
2795 tst_allow_gethostbyname_r="yes"
2798 tst_allow_gethostbyname_r="no"
2802 AC_MSG_CHECKING([if gethostbyname_r might be used])
2803 if test "$tst_links_gethostbyname_r" = "yes" &&
2804 test "$tst_proto_gethostbyname_r" = "yes" &&
2805 test "$tst_compi_gethostbyname_r" = "yes" &&
2806 test "$tst_allow_gethostbyname_r" = "yes"; then
2807 AC_MSG_RESULT([yes])
2808 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
2809 [Define to 1 if you have the gethostbyname_r function.])
2810 dnl AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $tst_nargs_gethostbyname_r,
2811 dnl [Specifies the number of arguments to gethostbyname_r])
2813 if test "$tst_nargs_gethostbyname_r" -eq "3"; then
2814 AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
2815 elif test "$tst_nargs_gethostbyname_r" -eq "5"; then
2816 AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
2817 elif test "$tst_nargs_gethostbyname_r" -eq "6"; then
2818 AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
2821 ac_cv_func_gethostbyname_r="yes"
2824 ac_cv_func_gethostbyname_r="no"
2829 dnl CURL_CHECK_FUNC_GETHOSTNAME
2830 dnl -------------------------------------------------
2831 dnl Verify if gethostname is available, prototyped, and
2832 dnl can be compiled. If all of these are true, and
2833 dnl usage has not been previously disallowed with
2834 dnl shell variable curl_disallow_gethostname, then
2835 dnl HAVE_GETHOSTNAME will be defined.
2837 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
2838 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2839 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
2840 AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
2842 tst_links_gethostname="unknown"
2843 tst_proto_gethostname="unknown"
2844 tst_compi_gethostname="unknown"
2845 tst_allow_gethostname="unknown"
2847 AC_MSG_CHECKING([if gethostname can be linked])
2850 $curl_includes_winsock2
2851 $curl_includes_unistd
2853 if(0 != gethostname(0, 0))
2857 AC_MSG_RESULT([yes])
2858 tst_links_gethostname="yes"
2861 tst_links_gethostname="no"
2864 if test "$tst_links_gethostname" = "yes"; then
2865 AC_MSG_CHECKING([if gethostname is prototyped])
2866 AC_EGREP_CPP([gethostname],[
2867 $curl_includes_winsock2
2868 $curl_includes_unistd
2870 AC_MSG_RESULT([yes])
2871 tst_proto_gethostname="yes"
2874 tst_proto_gethostname="no"
2878 if test "$tst_proto_gethostname" = "yes"; then
2879 AC_MSG_CHECKING([if gethostname is compilable])
2882 $curl_includes_winsock2
2883 $curl_includes_unistd
2885 if(0 != gethostname(0, 0))
2889 AC_MSG_RESULT([yes])
2890 tst_compi_gethostname="yes"
2893 tst_compi_gethostname="no"
2897 if test "$tst_compi_gethostname" = "yes"; then
2898 AC_MSG_CHECKING([for gethostname arg 2 data type])
2899 tst_gethostname_type_arg2="unknown"
2900 for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do
2901 for tst_arg2 in 'int' 'unsigned int' 'size_t'; do
2902 if test "$tst_gethostname_type_arg2" = "unknown"; then
2905 $curl_includes_winsock2
2906 $curl_includes_unistd
2907 $curl_preprocess_callconv
2908 extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2);
2910 if(0 != gethostname(0, 0))
2914 tst_gethostname_type_arg2="$tst_arg2"
2919 AC_MSG_RESULT([$tst_gethostname_type_arg2])
2920 if test "$tst_gethostname_type_arg2" != "unknown"; then
2921 AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2,
2922 [Define to the type of arg 2 for gethostname.])
2926 if test "$tst_compi_gethostname" = "yes"; then
2927 AC_MSG_CHECKING([if gethostname usage allowed])
2928 if test "x$curl_disallow_gethostname" != "xyes"; then
2929 AC_MSG_RESULT([yes])
2930 tst_allow_gethostname="yes"
2933 tst_allow_gethostname="no"
2937 AC_MSG_CHECKING([if gethostname might be used])
2938 if test "$tst_links_gethostname" = "yes" &&
2939 test "$tst_proto_gethostname" = "yes" &&
2940 test "$tst_compi_gethostname" = "yes" &&
2941 test "$tst_allow_gethostname" = "yes"; then
2942 AC_MSG_RESULT([yes])
2943 AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
2944 [Define to 1 if you have the gethostname function.])
2945 ac_cv_func_gethostname="yes"
2948 ac_cv_func_gethostname="no"
2953 dnl CURL_CHECK_FUNC_GETIFADDRS
2954 dnl -------------------------------------------------
2955 dnl Verify if getifaddrs is available, prototyped, can
2956 dnl be compiled and seems to work. If all of these are
2957 dnl true, and usage has not been previously disallowed
2958 dnl with shell variable curl_disallow_getifaddrs, then
2959 dnl HAVE_GETIFADDRS will be defined.
2961 AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [
2962 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
2963 AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
2965 tst_links_getifaddrs="unknown"
2966 tst_proto_getifaddrs="unknown"
2967 tst_compi_getifaddrs="unknown"
2968 tst_works_getifaddrs="unknown"
2969 tst_allow_getifaddrs="unknown"
2971 AC_MSG_CHECKING([if getifaddrs can be linked])
2973 AC_LANG_FUNC_LINK_TRY([getifaddrs])
2975 AC_MSG_RESULT([yes])
2976 tst_links_getifaddrs="yes"
2979 tst_links_getifaddrs="no"
2982 if test "$tst_links_getifaddrs" = "yes"; then
2983 AC_MSG_CHECKING([if getifaddrs is prototyped])
2984 AC_EGREP_CPP([getifaddrs],[
2985 $curl_includes_ifaddrs
2987 AC_MSG_RESULT([yes])
2988 tst_proto_getifaddrs="yes"
2991 tst_proto_getifaddrs="no"
2995 if test "$tst_proto_getifaddrs" = "yes"; then
2996 AC_MSG_CHECKING([if getifaddrs is compilable])
2999 $curl_includes_ifaddrs
3001 if(0 != getifaddrs(0))
3005 AC_MSG_RESULT([yes])
3006 tst_compi_getifaddrs="yes"
3009 tst_compi_getifaddrs="no"
3013 dnl only do runtime verification when not cross-compiling
3014 if test "x$cross_compiling" != "xyes" &&
3015 test "$tst_compi_getifaddrs" = "yes"; then
3016 AC_MSG_CHECKING([if getifaddrs seems to work])
3019 $curl_includes_stdlib
3020 $curl_includes_ifaddrs
3022 struct ifaddrs *ifa = 0;
3025 error = getifaddrs(&ifa);
3032 AC_MSG_RESULT([yes])
3033 tst_works_getifaddrs="yes"
3036 tst_works_getifaddrs="no"
3040 if test "$tst_compi_getifaddrs" = "yes" &&
3041 test "$tst_works_getifaddrs" != "no"; then
3042 AC_MSG_CHECKING([if getifaddrs usage allowed])
3043 if test "x$curl_disallow_getifaddrs" != "xyes"; then
3044 AC_MSG_RESULT([yes])
3045 tst_allow_getifaddrs="yes"
3048 tst_allow_getifaddrs="no"
3052 AC_MSG_CHECKING([if getifaddrs might be used])
3053 if test "$tst_links_getifaddrs" = "yes" &&
3054 test "$tst_proto_getifaddrs" = "yes" &&
3055 test "$tst_compi_getifaddrs" = "yes" &&
3056 test "$tst_allow_getifaddrs" = "yes" &&
3057 test "$tst_works_getifaddrs" != "no"; then
3058 AC_MSG_RESULT([yes])
3059 AC_DEFINE_UNQUOTED(HAVE_GETIFADDRS, 1,
3060 [Define to 1 if you have a working getifaddrs function.])
3061 ac_cv_func_getifaddrs="yes"
3064 ac_cv_func_getifaddrs="no"
3069 dnl CURL_CHECK_FUNC_GETSERVBYPORT_R
3070 dnl -------------------------------------------------
3071 dnl Verify if getservbyport_r is available, prototyped,
3072 dnl and can be compiled. If all of these are true, and
3073 dnl usage has not been previously disallowed with
3074 dnl shell variable curl_disallow_getservbyport_r, then
3075 dnl HAVE_GETSERVBYPORT_R will be defined.
3077 AC_DEFUN([CURL_CHECK_FUNC_GETSERVBYPORT_R], [
3078 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
3080 tst_links_getservbyport_r="unknown"
3081 tst_proto_getservbyport_r="unknown"
3082 tst_compi_getservbyport_r="unknown"
3083 tst_allow_getservbyport_r="unknown"
3084 tst_nargs_getservbyport_r="unknown"
3086 AC_MSG_CHECKING([if getservbyport_r can be linked])
3088 AC_LANG_FUNC_LINK_TRY([getservbyport_r])
3090 AC_MSG_RESULT([yes])
3091 tst_links_getservbyport_r="yes"
3094 tst_links_getservbyport_r="no"
3097 if test "$tst_links_getservbyport_r" = "yes"; then
3098 AC_MSG_CHECKING([if getservbyport_r is prototyped])
3099 AC_EGREP_CPP([getservbyport_r],[
3100 $curl_includes_netdb
3102 AC_MSG_RESULT([yes])
3103 tst_proto_getservbyport_r="yes"
3106 tst_proto_getservbyport_r="no"
3110 if test "$tst_proto_getservbyport_r" = "yes"; then
3111 if test "$tst_nargs_getservbyport_r" = "unknown"; then
3112 AC_MSG_CHECKING([if getservbyport_r takes 4 args.])
3115 $curl_includes_netdb
3117 if(0 != getservbyport_r(0, 0, 0, 0))
3121 AC_MSG_RESULT([yes])
3122 tst_compi_getservbyport_r="yes"
3123 tst_nargs_getservbyport_r="4"
3126 tst_compi_getservbyport_r="no"
3129 if test "$tst_nargs_getservbyport_r" = "unknown"; then
3130 AC_MSG_CHECKING([if getservbyport_r takes 5 args.])
3133 $curl_includes_netdb
3135 if(0 != getservbyport_r(0, 0, 0, 0, 0))
3139 AC_MSG_RESULT([yes])
3140 tst_compi_getservbyport_r="yes"
3141 tst_nargs_getservbyport_r="5"
3144 tst_compi_getservbyport_r="no"
3147 if test "$tst_nargs_getservbyport_r" = "unknown"; then
3148 AC_MSG_CHECKING([if getservbyport_r takes 6 args.])
3151 $curl_includes_netdb
3153 if(0 != getservbyport_r(0, 0, 0, 0, 0, 0))
3157 AC_MSG_RESULT([yes])
3158 tst_compi_getservbyport_r="yes"
3159 tst_nargs_getservbyport_r="6"
3162 tst_compi_getservbyport_r="no"
3165 AC_MSG_CHECKING([if getservbyport_r is compilable])
3166 if test "$tst_compi_getservbyport_r" = "yes"; then
3167 AC_MSG_RESULT([yes])
3173 if test "$tst_compi_getservbyport_r" = "yes"; then
3174 AC_MSG_CHECKING([if getservbyport_r usage allowed])
3175 if test "x$curl_disallow_getservbyport_r" != "xyes"; then
3176 AC_MSG_RESULT([yes])
3177 tst_allow_getservbyport_r="yes"
3180 tst_allow_getservbyport_r="no"
3184 AC_MSG_CHECKING([if getservbyport_r might be used])
3185 if test "$tst_links_getservbyport_r" = "yes" &&
3186 test "$tst_proto_getservbyport_r" = "yes" &&
3187 test "$tst_compi_getservbyport_r" = "yes" &&
3188 test "$tst_allow_getservbyport_r" = "yes"; then
3189 AC_MSG_RESULT([yes])
3190 AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1,
3191 [Define to 1 if you have the getservbyport_r function.])
3192 AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r,
3193 [Specifies the number of arguments to getservbyport_r])
3194 if test "$tst_nargs_getservbyport_r" -eq "4"; then
3195 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
3196 [Specifies the size of the buffer to pass to getservbyport_r])
3198 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
3199 [Specifies the size of the buffer to pass to getservbyport_r])
3201 ac_cv_func_getservbyport_r="yes"
3204 ac_cv_func_getservbyport_r="no"
3209 dnl CURL_CHECK_FUNC_GETXATTR
3210 dnl -------------------------------------------------
3211 dnl Verify if getxattr is available, prototyped, and
3212 dnl can be compiled. If all of these are true, and
3213 dnl usage has not been previously disallowed with
3214 dnl shell variable curl_disallow_getxattr, then
3215 dnl HAVE_GETXATTR will be defined.
3217 AC_DEFUN([CURL_CHECK_FUNC_GETXATTR], [
3218 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
3220 tst_links_getxattr="unknown"
3221 tst_proto_getxattr="unknown"
3222 tst_compi_getxattr="unknown"
3223 tst_allow_getxattr="unknown"
3224 tst_nargs_getxattr="unknown"
3226 AC_MSG_CHECKING([if getxattr can be linked])
3228 AC_LANG_FUNC_LINK_TRY([getxattr])
3230 AC_MSG_RESULT([yes])
3231 tst_links_getxattr="yes"
3234 tst_links_getxattr="no"
3237 if test "$tst_links_getxattr" = "yes"; then
3238 AC_MSG_CHECKING([if getxattr is prototyped])
3239 AC_EGREP_CPP([getxattr],[
3240 $curl_includes_sys_xattr
3242 AC_MSG_RESULT([yes])
3243 tst_proto_getxattr="yes"
3246 tst_proto_getxattr="no"
3250 if test "$tst_proto_getxattr" = "yes"; then
3251 if test "$tst_nargs_getxattr" = "unknown"; then
3252 AC_MSG_CHECKING([if getxattr takes 4 args.])
3255 $curl_includes_sys_xattr
3257 if(0 != getxattr(0, 0, 0, 0))
3261 AC_MSG_RESULT([yes])
3262 tst_compi_getxattr="yes"
3263 tst_nargs_getxattr="4"
3266 tst_compi_getxattr="no"
3269 if test "$tst_nargs_getxattr" = "unknown"; then
3270 AC_MSG_CHECKING([if getxattr takes 6 args.])
3273 $curl_includes_sys_xattr
3275 if(0 != getxattr(0, 0, 0, 0, 0, 0))
3279 AC_MSG_RESULT([yes])
3280 tst_compi_getxattr="yes"
3281 tst_nargs_getxattr="6"
3284 tst_compi_getxattr="no"
3287 AC_MSG_CHECKING([if getxattr is compilable])
3288 if test "$tst_compi_getxattr" = "yes"; then
3289 AC_MSG_RESULT([yes])
3295 if test "$tst_compi_getxattr" = "yes"; then
3296 AC_MSG_CHECKING([if getxattr usage allowed])
3297 if test "x$curl_disallow_getxattr" != "xyes"; then
3298 AC_MSG_RESULT([yes])
3299 tst_allow_getxattr="yes"
3302 tst_allow_getxattr="no"
3306 AC_MSG_CHECKING([if getxattr might be used])
3307 if test "$tst_links_getxattr" = "yes" &&
3308 test "$tst_proto_getxattr" = "yes" &&
3309 test "$tst_compi_getxattr" = "yes" &&
3310 test "$tst_allow_getxattr" = "yes"; then
3311 AC_MSG_RESULT([yes])
3312 AC_DEFINE_UNQUOTED(HAVE_GETXATTR, 1,
3313 [Define to 1 if you have the getxattr function.])
3314 dnl AC_DEFINE_UNQUOTED(GETXATTR_ARGS, $tst_nargs_getxattr,
3315 dnl [Specifies the number of arguments to getxattr])
3317 if test "$tst_nargs_getxattr" -eq "4"; then
3318 AC_DEFINE(HAVE_GETXATTR_4, 1, [getxattr() takes 4 args])
3319 elif test "$tst_nargs_getxattr" -eq "6"; then
3320 AC_DEFINE(HAVE_GETXATTR_6, 1, [getxattr() takes 6 args])
3323 ac_cv_func_getxattr="yes"
3326 ac_cv_func_getxattr="no"
3331 dnl CURL_CHECK_FUNC_GMTIME_R
3332 dnl -------------------------------------------------
3333 dnl Verify if gmtime_r is available, prototyped, can
3334 dnl be compiled and seems to work. If all of these are
3335 dnl true, and usage has not been previously disallowed
3336 dnl with shell variable curl_disallow_gmtime_r, then
3337 dnl HAVE_GMTIME_R will be defined.
3339 AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
3340 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3341 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
3343 tst_links_gmtime_r="unknown"
3344 tst_proto_gmtime_r="unknown"
3345 tst_compi_gmtime_r="unknown"
3346 tst_works_gmtime_r="unknown"
3347 tst_allow_gmtime_r="unknown"
3349 AC_MSG_CHECKING([if gmtime_r can be linked])
3351 AC_LANG_FUNC_LINK_TRY([gmtime_r])
3353 AC_MSG_RESULT([yes])
3354 tst_links_gmtime_r="yes"
3357 tst_links_gmtime_r="no"
3360 if test "$tst_links_gmtime_r" = "yes"; then
3361 AC_MSG_CHECKING([if gmtime_r is prototyped])
3362 AC_EGREP_CPP([gmtime_r],[
3365 AC_MSG_RESULT([yes])
3366 tst_proto_gmtime_r="yes"
3369 tst_proto_gmtime_r="no"
3373 if test "$tst_proto_gmtime_r" = "yes"; then
3374 AC_MSG_CHECKING([if gmtime_r is compilable])
3379 if(0 != gmtime_r(0, 0))
3383 AC_MSG_RESULT([yes])
3384 tst_compi_gmtime_r="yes"
3387 tst_compi_gmtime_r="no"
3391 dnl only do runtime verification when not cross-compiling
3392 if test "x$cross_compiling" != "xyes" &&
3393 test "$tst_compi_gmtime_r" = "yes"; then
3394 AC_MSG_CHECKING([if gmtime_r seems to work])
3397 $curl_includes_stdlib
3400 time_t local = 1170352587;
3403 gmt = gmtime_r(&local, &result);
3410 AC_MSG_RESULT([yes])
3411 tst_works_gmtime_r="yes"
3414 tst_works_gmtime_r="no"
3418 if test "$tst_compi_gmtime_r" = "yes" &&
3419 test "$tst_works_gmtime_r" != "no"; then
3420 AC_MSG_CHECKING([if gmtime_r usage allowed])
3421 if test "x$curl_disallow_gmtime_r" != "xyes"; then
3422 AC_MSG_RESULT([yes])
3423 tst_allow_gmtime_r="yes"
3426 tst_allow_gmtime_r="no"
3430 AC_MSG_CHECKING([if gmtime_r might be used])
3431 if test "$tst_links_gmtime_r" = "yes" &&
3432 test "$tst_proto_gmtime_r" = "yes" &&
3433 test "$tst_compi_gmtime_r" = "yes" &&
3434 test "$tst_allow_gmtime_r" = "yes" &&
3435 test "$tst_works_gmtime_r" != "no"; then
3436 AC_MSG_RESULT([yes])
3437 AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1,
3438 [Define to 1 if you have a working gmtime_r function.])
3439 ac_cv_func_gmtime_r="yes"
3442 ac_cv_func_gmtime_r="no"
3447 dnl CURL_CHECK_FUNC_INET_NTOA_R
3448 dnl -------------------------------------------------
3449 dnl Verify if inet_ntoa_r is available, prototyped,
3450 dnl and can be compiled. If all of these are true, and
3451 dnl usage has not been previously disallowed with
3452 dnl shell variable curl_disallow_inet_ntoa_r, then
3453 dnl HAVE_INET_NTOA_R will be defined.
3455 AC_DEFUN([CURL_CHECK_FUNC_INET_NTOA_R], [
3456 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
3458 tst_links_inet_ntoa_r="unknown"
3459 tst_proto_inet_ntoa_r="unknown"
3460 tst_compi_inet_ntoa_r="unknown"
3461 tst_allow_inet_ntoa_r="unknown"
3462 tst_nargs_inet_ntoa_r="unknown"
3464 AC_MSG_CHECKING([if inet_ntoa_r can be linked])
3466 AC_LANG_FUNC_LINK_TRY([inet_ntoa_r])
3468 AC_MSG_RESULT([yes])
3469 tst_links_inet_ntoa_r="yes"
3472 tst_links_inet_ntoa_r="no"
3475 if test "$tst_links_inet_ntoa_r" = "yes"; then
3476 AC_MSG_CHECKING([if inet_ntoa_r is prototyped])
3477 AC_EGREP_CPP([inet_ntoa_r],[
3478 $curl_includes_arpa_inet
3480 AC_MSG_RESULT([yes])
3481 tst_proto_inet_ntoa_r="yes"
3484 tst_proto_inet_ntoa_r="no"
3488 if test "$tst_proto_inet_ntoa_r" = "yes"; then
3489 if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
3490 AC_MSG_CHECKING([if inet_ntoa_r takes 2 args.])
3493 $curl_includes_arpa_inet
3495 struct in_addr addr;
3496 if(0 != inet_ntoa_r(addr, 0))
3500 AC_MSG_RESULT([yes])
3501 tst_compi_inet_ntoa_r="yes"
3502 tst_nargs_inet_ntoa_r="2"
3505 tst_compi_inet_ntoa_r="no"
3508 if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
3509 AC_MSG_CHECKING([if inet_ntoa_r takes 3 args.])
3512 $curl_includes_arpa_inet
3514 struct in_addr addr;
3515 if(0 != inet_ntoa_r(addr, 0, 0))
3519 AC_MSG_RESULT([yes])
3520 tst_compi_inet_ntoa_r="yes"
3521 tst_nargs_inet_ntoa_r="3"
3524 tst_compi_inet_ntoa_r="no"
3527 AC_MSG_CHECKING([if inet_ntoa_r is compilable])
3528 if test "$tst_compi_inet_ntoa_r" = "yes"; then
3529 AC_MSG_RESULT([yes])
3535 if test "$tst_compi_inet_ntoa_r" = "yes"; then
3536 AC_MSG_CHECKING([if inet_ntoa_r usage allowed])
3537 if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then
3538 AC_MSG_RESULT([yes])
3539 tst_allow_inet_ntoa_r="yes"
3542 tst_allow_inet_ntoa_r="no"
3546 AC_MSG_CHECKING([if inet_ntoa_r might be used])
3547 if test "$tst_links_inet_ntoa_r" = "yes" &&
3548 test "$tst_proto_inet_ntoa_r" = "yes" &&
3549 test "$tst_compi_inet_ntoa_r" = "yes" &&
3550 test "$tst_allow_inet_ntoa_r" = "yes"; then
3551 AC_MSG_RESULT([yes])
3552 AC_DEFINE_UNQUOTED(HAVE_INET_NTOA_R, 1,
3553 [Define to 1 if you have the inet_ntoa_r function.])
3554 dnl AC_DEFINE_UNQUOTED(INET_NTOA_R_ARGS, $tst_nargs_inet_ntoa_r,
3555 dnl [Specifies the number of arguments to inet_ntoa_r])
3557 if test "$tst_nargs_inet_ntoa_r" -eq "2"; then
3558 AC_DEFINE(HAVE_INET_NTOA_R_2, 1, [inet_ntoa_r() takes 2 args])
3559 elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then
3560 AC_DEFINE(HAVE_INET_NTOA_R_3, 1, [inet_ntoa_r() takes 3 args])
3563 ac_cv_func_inet_ntoa_r="yes"
3566 ac_cv_func_inet_ntoa_r="no"
3571 dnl CURL_CHECK_FUNC_INET_NTOP
3572 dnl -------------------------------------------------
3573 dnl Verify if inet_ntop is available, prototyped, can
3574 dnl be compiled and seems to work. If all of these are
3575 dnl true, and usage has not been previously disallowed
3576 dnl with shell variable curl_disallow_inet_ntop, then
3577 dnl HAVE_INET_NTOP will be defined.
3579 AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [
3580 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3581 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
3582 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3584 tst_links_inet_ntop="unknown"
3585 tst_proto_inet_ntop="unknown"
3586 tst_compi_inet_ntop="unknown"
3587 tst_works_inet_ntop="unknown"
3588 tst_allow_inet_ntop="unknown"
3590 AC_MSG_CHECKING([if inet_ntop can be linked])
3592 AC_LANG_FUNC_LINK_TRY([inet_ntop])
3594 AC_MSG_RESULT([yes])
3595 tst_links_inet_ntop="yes"
3598 tst_links_inet_ntop="no"
3601 if test "$tst_links_inet_ntop" = "yes"; then
3602 AC_MSG_CHECKING([if inet_ntop is prototyped])
3603 AC_EGREP_CPP([inet_ntop],[
3604 $curl_includes_arpa_inet
3606 AC_MSG_RESULT([yes])
3607 tst_proto_inet_ntop="yes"
3610 tst_proto_inet_ntop="no"
3614 if test "$tst_proto_inet_ntop" = "yes"; then
3615 AC_MSG_CHECKING([if inet_ntop is compilable])
3618 $curl_includes_arpa_inet
3620 if(0 != inet_ntop(0, 0, 0, 0))
3624 AC_MSG_RESULT([yes])
3625 tst_compi_inet_ntop="yes"
3628 tst_compi_inet_ntop="no"
3632 dnl only do runtime verification when not cross-compiling
3633 if test "x$cross_compiling" != "xyes" &&
3634 test "$tst_compi_inet_ntop" = "yes"; then
3635 AC_MSG_CHECKING([if inet_ntop seems to work])
3638 $curl_includes_stdlib
3639 $curl_includes_arpa_inet
3640 $curl_includes_string
3642 char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
3643 char ipv4res[sizeof "255.255.255.255"];
3644 unsigned char ipv6a[26];
3645 unsigned char ipv4a[5];
3656 ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
3659 if(ipv4ptr != ipv4res)
3663 if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
3667 memset(ipv6a, 0, sizeof(ipv6a));
3680 ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
3683 if(ipv6ptr != ipv6res)
3687 if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
3693 AC_MSG_RESULT([yes])
3694 tst_works_inet_ntop="yes"
3697 tst_works_inet_ntop="no"
3701 if test "$tst_compi_inet_ntop" = "yes" &&
3702 test "$tst_works_inet_ntop" != "no"; then
3703 AC_MSG_CHECKING([if inet_ntop usage allowed])
3704 if test "x$curl_disallow_inet_ntop" != "xyes"; then
3705 AC_MSG_RESULT([yes])
3706 tst_allow_inet_ntop="yes"
3709 tst_allow_inet_ntop="no"
3713 AC_MSG_CHECKING([if inet_ntop might be used])
3714 if test "$tst_links_inet_ntop" = "yes" &&
3715 test "$tst_proto_inet_ntop" = "yes" &&
3716 test "$tst_compi_inet_ntop" = "yes" &&
3717 test "$tst_allow_inet_ntop" = "yes" &&
3718 test "$tst_works_inet_ntop" != "no"; then
3719 AC_MSG_RESULT([yes])
3720 AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1,
3721 [Define to 1 if you have a IPv6 capable working inet_ntop function.])
3722 ac_cv_func_inet_ntop="yes"
3725 ac_cv_func_inet_ntop="no"
3730 dnl CURL_CHECK_FUNC_INET_PTON
3731 dnl -------------------------------------------------
3732 dnl Verify if inet_pton is available, prototyped, can
3733 dnl be compiled and seems to work. If all of these are
3734 dnl true, and usage has not been previously disallowed
3735 dnl with shell variable curl_disallow_inet_pton, then
3736 dnl HAVE_INET_PTON will be defined.
3738 AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
3739 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3740 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
3741 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3743 tst_links_inet_pton="unknown"
3744 tst_proto_inet_pton="unknown"
3745 tst_compi_inet_pton="unknown"
3746 tst_works_inet_pton="unknown"
3747 tst_allow_inet_pton="unknown"
3749 AC_MSG_CHECKING([if inet_pton can be linked])
3751 AC_LANG_FUNC_LINK_TRY([inet_pton])
3753 AC_MSG_RESULT([yes])
3754 tst_links_inet_pton="yes"
3757 tst_links_inet_pton="no"
3760 if test "$tst_links_inet_pton" = "yes"; then
3761 AC_MSG_CHECKING([if inet_pton is prototyped])
3762 AC_EGREP_CPP([inet_pton],[
3763 $curl_includes_arpa_inet
3765 AC_MSG_RESULT([yes])
3766 tst_proto_inet_pton="yes"
3769 tst_proto_inet_pton="no"
3773 if test "$tst_proto_inet_pton" = "yes"; then
3774 AC_MSG_CHECKING([if inet_pton is compilable])
3777 $curl_includes_arpa_inet
3779 if(0 != inet_pton(0, 0, 0))
3783 AC_MSG_RESULT([yes])
3784 tst_compi_inet_pton="yes"
3787 tst_compi_inet_pton="no"
3791 dnl only do runtime verification when not cross-compiling
3792 if test "x$cross_compiling" != "xyes" &&
3793 test "$tst_compi_inet_pton" = "yes"; then
3794 AC_MSG_CHECKING([if inet_pton seems to work])
3797 $curl_includes_stdlib
3798 $curl_includes_arpa_inet
3799 $curl_includes_string
3801 unsigned char ipv6a[16+1];
3802 unsigned char ipv4a[4+1];
3803 const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
3804 const char *ipv4src = "192.168.100.1";
3806 memset(ipv4a, 1, sizeof(ipv4a));
3807 if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
3810 if( (ipv4a[0] != 0xc0) ||
3811 (ipv4a[1] != 0xa8) ||
3812 (ipv4a[2] != 0x64) ||
3813 (ipv4a[3] != 0x01) ||
3814 (ipv4a[4] != 0x01) )
3817 memset(ipv6a, 1, sizeof(ipv6a));
3818 if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
3821 if( (ipv6a[0] != 0xfe) ||
3822 (ipv6a[1] != 0x80) ||
3823 (ipv6a[8] != 0x02) ||
3824 (ipv6a[9] != 0x14) ||
3825 (ipv6a[10] != 0x4f) ||
3826 (ipv6a[11] != 0xff) ||
3827 (ipv6a[12] != 0xfe) ||
3828 (ipv6a[13] != 0x0b) ||
3829 (ipv6a[14] != 0x76) ||
3830 (ipv6a[15] != 0xc8) ||
3831 (ipv6a[16] != 0x01) )
3834 if( (ipv6a[2] != 0x0) ||
3835 (ipv6a[3] != 0x0) ||
3836 (ipv6a[4] != 0x0) ||
3837 (ipv6a[5] != 0x0) ||
3838 (ipv6a[6] != 0x0) ||
3845 AC_MSG_RESULT([yes])
3846 tst_works_inet_pton="yes"
3849 tst_works_inet_pton="no"
3853 if test "$tst_compi_inet_pton" = "yes" &&
3854 test "$tst_works_inet_pton" != "no"; then
3855 AC_MSG_CHECKING([if inet_pton usage allowed])
3856 if test "x$curl_disallow_inet_pton" != "xyes"; then
3857 AC_MSG_RESULT([yes])
3858 tst_allow_inet_pton="yes"
3861 tst_allow_inet_pton="no"
3865 AC_MSG_CHECKING([if inet_pton might be used])
3866 if test "$tst_links_inet_pton" = "yes" &&
3867 test "$tst_proto_inet_pton" = "yes" &&
3868 test "$tst_compi_inet_pton" = "yes" &&
3869 test "$tst_allow_inet_pton" = "yes" &&
3870 test "$tst_works_inet_pton" != "no"; then
3871 AC_MSG_RESULT([yes])
3872 AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1,
3873 [Define to 1 if you have a IPv6 capable working inet_pton function.])
3874 ac_cv_func_inet_pton="yes"
3877 ac_cv_func_inet_pton="no"
3882 dnl CURL_CHECK_FUNC_IOCTL
3883 dnl -------------------------------------------------
3884 dnl Verify if ioctl is available, prototyped, and
3885 dnl can be compiled. If all of these are true, and
3886 dnl usage has not been previously disallowed with
3887 dnl shell variable curl_disallow_ioctl, then
3888 dnl HAVE_IOCTL will be defined.
3890 AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [
3891 AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
3893 tst_links_ioctl="unknown"
3894 tst_proto_ioctl="unknown"
3895 tst_compi_ioctl="unknown"
3896 tst_allow_ioctl="unknown"
3898 AC_MSG_CHECKING([if ioctl can be linked])
3900 AC_LANG_FUNC_LINK_TRY([ioctl])
3902 AC_MSG_RESULT([yes])
3903 tst_links_ioctl="yes"
3906 tst_links_ioctl="no"
3909 if test "$tst_links_ioctl" = "yes"; then
3910 AC_MSG_CHECKING([if ioctl is prototyped])
3911 AC_EGREP_CPP([ioctl],[
3912 $curl_includes_stropts
3914 AC_MSG_RESULT([yes])
3915 tst_proto_ioctl="yes"
3918 tst_proto_ioctl="no"
3922 if test "$tst_proto_ioctl" = "yes"; then
3923 AC_MSG_CHECKING([if ioctl is compilable])
3926 $curl_includes_stropts
3928 if(0 != ioctl(0, 0, 0))
3932 AC_MSG_RESULT([yes])
3933 tst_compi_ioctl="yes"
3936 tst_compi_ioctl="no"
3940 if test "$tst_compi_ioctl" = "yes"; then
3941 AC_MSG_CHECKING([if ioctl usage allowed])
3942 if test "x$curl_disallow_ioctl" != "xyes"; then
3943 AC_MSG_RESULT([yes])
3944 tst_allow_ioctl="yes"
3947 tst_allow_ioctl="no"
3951 AC_MSG_CHECKING([if ioctl might be used])
3952 if test "$tst_links_ioctl" = "yes" &&
3953 test "$tst_proto_ioctl" = "yes" &&
3954 test "$tst_compi_ioctl" = "yes" &&
3955 test "$tst_allow_ioctl" = "yes"; then
3956 AC_MSG_RESULT([yes])
3957 AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1,
3958 [Define to 1 if you have the ioctl function.])
3959 ac_cv_func_ioctl="yes"
3960 CURL_CHECK_FUNC_IOCTL_FIONBIO
3961 CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
3964 ac_cv_func_ioctl="no"
3969 dnl CURL_CHECK_FUNC_IOCTL_FIONBIO
3970 dnl -------------------------------------------------
3971 dnl Verify if ioctl with the FIONBIO command is
3972 dnl available, can be compiled, and seems to work. If
3973 dnl all of these are true, then HAVE_IOCTL_FIONBIO
3974 dnl will be defined.
3976 AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [
3978 tst_compi_ioctl_fionbio="unknown"
3979 tst_allow_ioctl_fionbio="unknown"
3981 if test "$ac_cv_func_ioctl" = "yes"; then
3982 AC_MSG_CHECKING([if ioctl FIONBIO is compilable])
3985 $curl_includes_stropts
3988 if(0 != ioctl(0, FIONBIO, &flags))
3992 AC_MSG_RESULT([yes])
3993 tst_compi_ioctl_fionbio="yes"
3996 tst_compi_ioctl_fionbio="no"
4000 if test "$tst_compi_ioctl_fionbio" = "yes"; then
4001 AC_MSG_CHECKING([if ioctl FIONBIO usage allowed])
4002 if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then
4003 AC_MSG_RESULT([yes])
4004 tst_allow_ioctl_fionbio="yes"
4007 tst_allow_ioctl_fionbio="no"
4011 AC_MSG_CHECKING([if ioctl FIONBIO might be used])
4012 if test "$tst_compi_ioctl_fionbio" = "yes" &&
4013 test "$tst_allow_ioctl_fionbio" = "yes"; then
4014 AC_MSG_RESULT([yes])
4015 AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1,
4016 [Define to 1 if you have a working ioctl FIONBIO function.])
4017 ac_cv_func_ioctl_fionbio="yes"
4020 ac_cv_func_ioctl_fionbio="no"
4025 dnl CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
4026 dnl -------------------------------------------------
4027 dnl Verify if ioctl with the SIOCGIFADDR command is available,
4028 dnl struct ifreq is defined, they can be compiled, and seem to
4029 dnl work. If all of these are true, then HAVE_IOCTL_SIOCGIFADDR
4030 dnl will be defined.
4032 AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [
4034 tst_compi_ioctl_siocgifaddr="unknown"
4035 tst_allow_ioctl_siocgifaddr="unknown"
4037 if test "$ac_cv_func_ioctl" = "yes"; then
4038 AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable])
4041 $curl_includes_stropts
4045 if(0 != ioctl(0, SIOCGIFADDR, &ifr))
4049 AC_MSG_RESULT([yes])
4050 tst_compi_ioctl_siocgifaddr="yes"
4053 tst_compi_ioctl_siocgifaddr="no"
4057 if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then
4058 AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed])
4059 if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then
4060 AC_MSG_RESULT([yes])
4061 tst_allow_ioctl_siocgifaddr="yes"
4064 tst_allow_ioctl_siocgifaddr="no"
4068 AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used])
4069 if test "$tst_compi_ioctl_siocgifaddr" = "yes" &&
4070 test "$tst_allow_ioctl_siocgifaddr" = "yes"; then
4071 AC_MSG_RESULT([yes])
4072 AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1,
4073 [Define to 1 if you have a working ioctl SIOCGIFADDR function.])
4074 ac_cv_func_ioctl_siocgifaddr="yes"
4077 ac_cv_func_ioctl_siocgifaddr="no"
4082 dnl CURL_CHECK_FUNC_IOCTLSOCKET
4083 dnl -------------------------------------------------
4084 dnl Verify if ioctlsocket is available, prototyped, and
4085 dnl can be compiled. If all of these are true, and
4086 dnl usage has not been previously disallowed with
4087 dnl shell variable curl_disallow_ioctlsocket, then
4088 dnl HAVE_IOCTLSOCKET will be defined.
4090 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [
4091 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
4093 tst_links_ioctlsocket="unknown"
4094 tst_proto_ioctlsocket="unknown"
4095 tst_compi_ioctlsocket="unknown"
4096 tst_allow_ioctlsocket="unknown"
4098 AC_MSG_CHECKING([if ioctlsocket can be linked])
4101 $curl_includes_winsock2
4103 if(0 != ioctlsocket(0, 0, 0))
4107 AC_MSG_RESULT([yes])
4108 tst_links_ioctlsocket="yes"
4111 tst_links_ioctlsocket="no"
4114 if test "$tst_links_ioctlsocket" = "yes"; then
4115 AC_MSG_CHECKING([if ioctlsocket is prototyped])
4116 AC_EGREP_CPP([ioctlsocket],[
4117 $curl_includes_winsock2
4119 AC_MSG_RESULT([yes])
4120 tst_proto_ioctlsocket="yes"
4123 tst_proto_ioctlsocket="no"
4127 if test "$tst_proto_ioctlsocket" = "yes"; then
4128 AC_MSG_CHECKING([if ioctlsocket is compilable])
4131 $curl_includes_winsock2
4133 if(0 != ioctlsocket(0, 0, 0))
4137 AC_MSG_RESULT([yes])
4138 tst_compi_ioctlsocket="yes"
4141 tst_compi_ioctlsocket="no"
4145 if test "$tst_compi_ioctlsocket" = "yes"; then
4146 AC_MSG_CHECKING([if ioctlsocket usage allowed])
4147 if test "x$curl_disallow_ioctlsocket" != "xyes"; then
4148 AC_MSG_RESULT([yes])
4149 tst_allow_ioctlsocket="yes"
4152 tst_allow_ioctlsocket="no"
4156 AC_MSG_CHECKING([if ioctlsocket might be used])
4157 if test "$tst_links_ioctlsocket" = "yes" &&
4158 test "$tst_proto_ioctlsocket" = "yes" &&
4159 test "$tst_compi_ioctlsocket" = "yes" &&
4160 test "$tst_allow_ioctlsocket" = "yes"; then
4161 AC_MSG_RESULT([yes])
4162 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1,
4163 [Define to 1 if you have the ioctlsocket function.])
4164 ac_cv_func_ioctlsocket="yes"
4165 CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
4168 ac_cv_func_ioctlsocket="no"
4173 dnl CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
4174 dnl -------------------------------------------------
4175 dnl Verify if ioctlsocket with the FIONBIO command is
4176 dnl available, can be compiled, and seems to work. If
4177 dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO
4178 dnl will be defined.
4180 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [
4182 tst_compi_ioctlsocket_fionbio="unknown"
4183 tst_allow_ioctlsocket_fionbio="unknown"
4185 if test "$ac_cv_func_ioctlsocket" = "yes"; then
4186 AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable])
4189 $curl_includes_winsock2
4192 if(0 != ioctlsocket(0, FIONBIO, &flags))
4196 AC_MSG_RESULT([yes])
4197 tst_compi_ioctlsocket_fionbio="yes"
4200 tst_compi_ioctlsocket_fionbio="no"
4204 if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then
4205 AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed])
4206 if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then
4207 AC_MSG_RESULT([yes])
4208 tst_allow_ioctlsocket_fionbio="yes"
4211 tst_allow_ioctlsocket_fionbio="no"
4215 AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used])
4216 if test "$tst_compi_ioctlsocket_fionbio" = "yes" &&
4217 test "$tst_allow_ioctlsocket_fionbio" = "yes"; then
4218 AC_MSG_RESULT([yes])
4219 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1,
4220 [Define to 1 if you have a working ioctlsocket FIONBIO function.])
4221 ac_cv_func_ioctlsocket_fionbio="yes"
4224 ac_cv_func_ioctlsocket_fionbio="no"
4229 dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
4230 dnl -------------------------------------------------
4231 dnl Verify if IoctlSocket is available, prototyped, and
4232 dnl can be compiled. If all of these are true, and
4233 dnl usage has not been previously disallowed with
4234 dnl shell variable curl_disallow_ioctlsocket_camel,
4235 dnl then HAVE_IOCTLSOCKET_CAMEL will be defined.
4237 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
4238 AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
4240 tst_links_ioctlsocket_camel="unknown"
4241 tst_proto_ioctlsocket_camel="unknown"
4242 tst_compi_ioctlsocket_camel="unknown"
4243 tst_allow_ioctlsocket_camel="unknown"
4245 AC_MSG_CHECKING([if IoctlSocket can be linked])
4247 AC_LANG_FUNC_LINK_TRY([IoctlSocket])
4249 AC_MSG_RESULT([yes])
4250 tst_links_ioctlsocket_camel="yes"
4253 tst_links_ioctlsocket_camel="no"
4256 if test "$tst_links_ioctlsocket_camel" = "yes"; then
4257 AC_MSG_CHECKING([if IoctlSocket is prototyped])
4258 AC_EGREP_CPP([IoctlSocket],[
4259 $curl_includes_stropts
4261 AC_MSG_RESULT([yes])
4262 tst_proto_ioctlsocket_camel="yes"
4265 tst_proto_ioctlsocket_camel="no"
4269 if test "$tst_proto_ioctlsocket_camel" = "yes"; then
4270 AC_MSG_CHECKING([if IoctlSocket is compilable])
4273 $curl_includes_stropts
4275 if(0 != IoctlSocket(0, 0, 0))
4279 AC_MSG_RESULT([yes])
4280 tst_compi_ioctlsocket_camel="yes"
4283 tst_compi_ioctlsocket_camel="no"
4287 if test "$tst_compi_ioctlsocket_camel" = "yes"; then
4288 AC_MSG_CHECKING([if IoctlSocket usage allowed])
4289 if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then
4290 AC_MSG_RESULT([yes])
4291 tst_allow_ioctlsocket_camel="yes"
4294 tst_allow_ioctlsocket_camel="no"
4298 AC_MSG_CHECKING([if IoctlSocket might be used])
4299 if test "$tst_links_ioctlsocket_camel" = "yes" &&
4300 test "$tst_proto_ioctlsocket_camel" = "yes" &&
4301 test "$tst_compi_ioctlsocket_camel" = "yes" &&
4302 test "$tst_allow_ioctlsocket_camel" = "yes"; then
4303 AC_MSG_RESULT([yes])
4304 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1,
4305 [Define to 1 if you have the IoctlSocket camel case function.])
4306 ac_cv_func_ioctlsocket_camel="yes"
4307 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
4310 ac_cv_func_ioctlsocket_camel="no"
4315 dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
4316 dnl -------------------------------------------------
4317 dnl Verify if IoctlSocket with FIONBIO command is available,
4318 dnl can be compiled, and seems to work. If all of these are
4319 dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined.
4321 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [
4323 tst_compi_ioctlsocket_camel_fionbio="unknown"
4324 tst_allow_ioctlsocket_camel_fionbio="unknown"
4326 if test "$ac_cv_func_ioctlsocket_camel" = "yes"; then
4327 AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable])
4330 $curl_includes_stropts
4333 if(0 != ioctlsocket(0, FIONBIO, &flags))
4337 AC_MSG_RESULT([yes])
4338 tst_compi_ioctlsocket_camel_fionbio="yes"
4341 tst_compi_ioctlsocket_camel_fionbio="no"
4345 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then
4346 AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed])
4347 if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then
4348 AC_MSG_RESULT([yes])
4349 tst_allow_ioctlsocket_camel_fionbio="yes"
4352 tst_allow_ioctlsocket_camel_fionbio="no"
4356 AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used])
4357 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" &&
4358 test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then
4359 AC_MSG_RESULT([yes])
4360 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1,
4361 [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.])
4362 ac_cv_func_ioctlsocket_camel_fionbio="yes"
4365 ac_cv_func_ioctlsocket_camel_fionbio="no"
4370 dnl CURL_CHECK_FUNC_LISTXATTR
4371 dnl -------------------------------------------------
4372 dnl Verify if listxattr is available, prototyped, and
4373 dnl can be compiled. If all of these are true, and
4374 dnl usage has not been previously disallowed with
4375 dnl shell variable curl_disallow_listxattr, then
4376 dnl HAVE_LISTXATTR will be defined.
4378 AC_DEFUN([CURL_CHECK_FUNC_LISTXATTR], [
4379 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
4381 tst_links_listxattr="unknown"
4382 tst_proto_listxattr="unknown"
4383 tst_compi_listxattr="unknown"
4384 tst_allow_listxattr="unknown"
4385 tst_nargs_listxattr="unknown"
4387 AC_MSG_CHECKING([if listxattr can be linked])
4389 AC_LANG_FUNC_LINK_TRY([listxattr])
4391 AC_MSG_RESULT([yes])
4392 tst_links_listxattr="yes"
4395 tst_links_listxattr="no"
4398 if test "$tst_links_listxattr" = "yes"; then
4399 AC_MSG_CHECKING([if listxattr is prototyped])
4400 AC_EGREP_CPP([listxattr],[
4401 $curl_includes_sys_xattr
4403 AC_MSG_RESULT([yes])
4404 tst_proto_listxattr="yes"
4407 tst_proto_listxattr="no"
4411 if test "$tst_proto_listxattr" = "yes"; then
4412 if test "$tst_nargs_listxattr" = "unknown"; then
4413 AC_MSG_CHECKING([if listxattr takes 3 args.])
4416 $curl_includes_sys_xattr
4418 if(0 != listxattr(0, 0, 0))
4422 AC_MSG_RESULT([yes])
4423 tst_compi_listxattr="yes"
4424 tst_nargs_listxattr="3"
4427 tst_compi_listxattr="no"
4430 if test "$tst_nargs_listxattr" = "unknown"; then
4431 AC_MSG_CHECKING([if listxattr takes 4 args.])
4434 $curl_includes_sys_xattr
4436 if(0 != listxattr(0, 0, 0, 0))
4440 AC_MSG_RESULT([yes])
4441 tst_compi_listxattr="yes"
4442 tst_nargs_listxattr="4"
4445 tst_compi_listxattr="no"
4448 AC_MSG_CHECKING([if listxattr is compilable])
4449 if test "$tst_compi_listxattr" = "yes"; then
4450 AC_MSG_RESULT([yes])
4456 if test "$tst_compi_listxattr" = "yes"; then
4457 AC_MSG_CHECKING([if listxattr usage allowed])
4458 if test "x$curl_disallow_listxattr" != "xyes"; then
4459 AC_MSG_RESULT([yes])
4460 tst_allow_listxattr="yes"
4463 tst_allow_listxattr="no"
4467 AC_MSG_CHECKING([if listxattr might be used])
4468 if test "$tst_links_listxattr" = "yes" &&
4469 test "$tst_proto_listxattr" = "yes" &&
4470 test "$tst_compi_listxattr" = "yes" &&
4471 test "$tst_allow_listxattr" = "yes"; then
4472 AC_MSG_RESULT([yes])
4473 AC_DEFINE_UNQUOTED(HAVE_LISTXATTR, 1,
4474 [Define to 1 if you have the listxattr function.])
4475 dnl AC_DEFINE_UNQUOTED(LISTXATTR_ARGS, $tst_nargs_listxattr,
4476 dnl [Specifies the number of arguments to listxattr])
4478 if test "$tst_nargs_listxattr" -eq "3"; then
4479 AC_DEFINE(HAVE_LISTXATTR_3, 1, [listxattr() takes 3 args])
4480 elif test "$tst_nargs_listxattr" -eq "4"; then
4481 AC_DEFINE(HAVE_LISTXATTR_4, 1, [listxattr() takes 4 args])
4484 ac_cv_func_listxattr="yes"
4487 ac_cv_func_listxattr="no"
4492 dnl CURL_CHECK_FUNC_LOCALTIME_R
4493 dnl -------------------------------------------------
4494 dnl Verify if localtime_r is available, prototyped, can
4495 dnl be compiled and seems to work. If all of these are
4496 dnl true, and usage has not been previously disallowed
4497 dnl with shell variable curl_disallow_localtime_r, then
4498 dnl HAVE_LOCALTIME_R will be defined.
4500 AC_DEFUN([CURL_CHECK_FUNC_LOCALTIME_R], [
4501 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
4502 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
4504 tst_links_localtime_r="unknown"
4505 tst_proto_localtime_r="unknown"
4506 tst_compi_localtime_r="unknown"
4507 tst_works_localtime_r="unknown"
4508 tst_allow_localtime_r="unknown"
4510 AC_MSG_CHECKING([if localtime_r can be linked])
4512 AC_LANG_FUNC_LINK_TRY([localtime_r])
4514 AC_MSG_RESULT([yes])
4515 tst_links_localtime_r="yes"
4518 tst_links_localtime_r="no"
4521 if test "$tst_links_localtime_r" = "yes"; then
4522 AC_MSG_CHECKING([if localtime_r is prototyped])
4523 AC_EGREP_CPP([localtime_r],[
4526 AC_MSG_RESULT([yes])
4527 tst_proto_localtime_r="yes"
4530 tst_proto_localtime_r="no"
4534 if test "$tst_proto_localtime_r" = "yes"; then
4535 AC_MSG_CHECKING([if localtime_r is compilable])
4540 if(0 != localtime_r(0, 0))
4544 AC_MSG_RESULT([yes])
4545 tst_compi_localtime_r="yes"
4548 tst_compi_localtime_r="no"
4552 dnl only do runtime verification when not cross-compiling
4553 if test "x$cross_compiling" != "xyes" &&
4554 test "$tst_compi_localtime_r" = "yes"; then
4555 AC_MSG_CHECKING([if localtime_r seems to work])
4558 $curl_includes_stdlib
4561 time_t clock = 1170352587;
4564 tmp = localtime_r(&clock, &result);
4571 AC_MSG_RESULT([yes])
4572 tst_works_localtime_r="yes"
4575 tst_works_localtime_r="no"
4579 if test "$tst_compi_localtime_r" = "yes" &&
4580 test "$tst_works_localtime_r" != "no"; then
4581 AC_MSG_CHECKING([if localtime_r usage allowed])
4582 if test "x$curl_disallow_localtime_r" != "xyes"; then
4583 AC_MSG_RESULT([yes])
4584 tst_allow_localtime_r="yes"
4587 tst_allow_localtime_r="no"
4591 AC_MSG_CHECKING([if localtime_r might be used])
4592 if test "$tst_links_localtime_r" = "yes" &&
4593 test "$tst_proto_localtime_r" = "yes" &&
4594 test "$tst_compi_localtime_r" = "yes" &&
4595 test "$tst_allow_localtime_r" = "yes" &&
4596 test "$tst_works_localtime_r" != "no"; then
4597 AC_MSG_RESULT([yes])
4598 AC_DEFINE_UNQUOTED(HAVE_LOCALTIME_R, 1,
4599 [Define to 1 if you have a working localtime_r function.])
4600 ac_cv_func_localtime_r="yes"
4603 ac_cv_func_localtime_r="no"
4608 dnl CURL_CHECK_FUNC_MEMRCHR
4609 dnl -------------------------------------------------
4610 dnl Verify if memrchr is available, prototyped, and
4611 dnl can be compiled. If all of these are true, and
4612 dnl usage has not been previously disallowed with
4613 dnl shell variable curl_disallow_memrchr, then
4614 dnl HAVE_MEMRCHR will be defined.
4616 AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [
4617 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4619 tst_links_memrchr="unknown"
4620 tst_macro_memrchr="unknown"
4621 tst_proto_memrchr="unknown"
4622 tst_compi_memrchr="unknown"
4623 tst_allow_memrchr="unknown"
4625 AC_MSG_CHECKING([if memrchr can be linked])
4627 AC_LANG_FUNC_LINK_TRY([memrchr])
4629 AC_MSG_RESULT([yes])
4630 tst_links_memrchr="yes"
4633 tst_links_memrchr="no"
4636 if test "$tst_links_memrchr" = "no"; then
4637 AC_MSG_CHECKING([if memrchr seems a macro])
4640 $curl_includes_string
4642 if(0 != memrchr(0, 0, 0))
4646 AC_MSG_RESULT([yes])
4647 tst_macro_memrchr="yes"
4650 tst_macro_memrchr="no"
4654 if test "$tst_links_memrchr" = "yes"; then
4655 AC_MSG_CHECKING([if memrchr is prototyped])
4656 AC_EGREP_CPP([memrchr],[
4657 $curl_includes_string
4659 AC_MSG_RESULT([yes])
4660 tst_proto_memrchr="yes"
4663 tst_proto_memrchr="no"
4667 if test "$tst_proto_memrchr" = "yes" ||
4668 test "$tst_macro_memrchr" = "yes"; then
4669 AC_MSG_CHECKING([if memrchr is compilable])
4672 $curl_includes_string
4674 if(0 != memrchr(0, 0, 0))
4678 AC_MSG_RESULT([yes])
4679 tst_compi_memrchr="yes"
4682 tst_compi_memrchr="no"
4686 if test "$tst_compi_memrchr" = "yes"; then
4687 AC_MSG_CHECKING([if memrchr usage allowed])
4688 if test "x$curl_disallow_memrchr" != "xyes"; then
4689 AC_MSG_RESULT([yes])
4690 tst_allow_memrchr="yes"
4693 tst_allow_memrchr="no"
4697 AC_MSG_CHECKING([if memrchr might be used])
4698 if (test "$tst_proto_memrchr" = "yes" ||
4699 test "$tst_macro_memrchr" = "yes") &&
4700 test "$tst_compi_memrchr" = "yes" &&
4701 test "$tst_allow_memrchr" = "yes"; then
4702 AC_MSG_RESULT([yes])
4703 AC_DEFINE_UNQUOTED(HAVE_MEMRCHR, 1,
4704 [Define to 1 if you have the memrchr function or macro.])
4705 ac_cv_func_memrchr="yes"
4708 ac_cv_func_memrchr="no"
4713 dnl CURL_CHECK_FUNC_POLL
4714 dnl -------------------------------------------------
4715 dnl Verify if poll is available, prototyped, can
4716 dnl be compiled and seems to work. If all of these are
4717 dnl true, and usage has not been previously disallowed
4718 dnl with shell variable curl_disallow_poll, then
4719 dnl HAVE_POLL will be defined.
4721 AC_DEFUN([CURL_CHECK_FUNC_POLL], [
4722 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
4723 AC_REQUIRE([CURL_INCLUDES_POLL])dnl
4725 tst_links_poll="unknown"
4726 tst_proto_poll="unknown"
4727 tst_compi_poll="unknown"
4728 tst_works_poll="unknown"
4729 tst_allow_poll="unknown"
4733 dnl poll() does not work on these platforms
4734 dnl Interix: "does provide poll(), but the implementing developer must
4735 dnl have been in a bad mood, because poll() only works on the /proc
4736 dnl filesystem here"
4737 curl_disallow_poll="yes"
4741 AC_MSG_CHECKING([if poll can be linked])
4746 if(0 != poll(0, 0, 0))
4750 AC_MSG_RESULT([yes])
4751 tst_links_poll="yes"
4757 if test "$tst_links_poll" = "yes"; then
4758 AC_MSG_CHECKING([if poll is prototyped])
4759 AC_EGREP_CPP([poll],[
4762 AC_MSG_RESULT([yes])
4763 tst_proto_poll="yes"
4770 if test "$tst_proto_poll" = "yes"; then
4771 AC_MSG_CHECKING([if poll is compilable])
4776 if(0 != poll(0, 0, 0))
4780 AC_MSG_RESULT([yes])
4781 tst_compi_poll="yes"
4788 dnl only do runtime verification when not cross-compiling
4789 if test "x$cross_compiling" != "xyes" &&
4790 test "$tst_compi_poll" = "yes"; then
4791 AC_MSG_CHECKING([if poll seems to work])
4794 $curl_includes_stdlib
4797 if(0 != poll(0, 0, 10))
4803 AC_MSG_RESULT([yes])
4804 tst_works_poll="yes"
4811 if test "$tst_compi_poll" = "yes" &&
4812 test "$tst_works_poll" != "no"; then
4813 AC_MSG_CHECKING([if poll usage allowed])
4814 if test "x$curl_disallow_poll" != "xyes"; then
4815 AC_MSG_RESULT([yes])
4816 tst_allow_poll="yes"
4823 AC_MSG_CHECKING([if poll might be used])
4824 if test "$tst_links_poll" = "yes" &&
4825 test "$tst_proto_poll" = "yes" &&
4826 test "$tst_compi_poll" = "yes" &&
4827 test "$tst_allow_poll" = "yes" &&
4828 test "$tst_works_poll" != "no"; then
4829 AC_MSG_RESULT([yes])
4830 AC_DEFINE_UNQUOTED(HAVE_POLL, 1,
4831 [Define to 1 if you have a working poll function.])
4832 AC_DEFINE_UNQUOTED(HAVE_POLL_FINE, 1,
4833 [If you have a fine poll])
4834 ac_cv_func_poll="yes"
4837 ac_cv_func_poll="no"
4842 dnl CURL_CHECK_FUNC_REMOVEXATTR
4843 dnl -------------------------------------------------
4844 dnl Verify if removexattr is available, prototyped, and
4845 dnl can be compiled. If all of these are true, and
4846 dnl usage has not been previously disallowed with
4847 dnl shell variable curl_disallow_removexattr, then
4848 dnl HAVE_REMOVEXATTR will be defined.
4850 AC_DEFUN([CURL_CHECK_FUNC_REMOVEXATTR], [
4851 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
4853 tst_links_removexattr="unknown"
4854 tst_proto_removexattr="unknown"
4855 tst_compi_removexattr="unknown"
4856 tst_allow_removexattr="unknown"
4857 tst_nargs_removexattr="unknown"
4859 AC_MSG_CHECKING([if removexattr can be linked])
4861 AC_LANG_FUNC_LINK_TRY([removexattr])
4863 AC_MSG_RESULT([yes])
4864 tst_links_removexattr="yes"
4867 tst_links_removexattr="no"
4870 if test "$tst_links_removexattr" = "yes"; then
4871 AC_MSG_CHECKING([if removexattr is prototyped])
4872 AC_EGREP_CPP([removexattr],[
4873 $curl_includes_sys_xattr
4875 AC_MSG_RESULT([yes])
4876 tst_proto_removexattr="yes"
4879 tst_proto_removexattr="no"
4883 if test "$tst_proto_removexattr" = "yes"; then
4884 if test "$tst_nargs_removexattr" = "unknown"; then
4885 AC_MSG_CHECKING([if removexattr takes 2 args.])
4888 $curl_includes_sys_xattr
4890 if(0 != removexattr(0, 0))
4894 AC_MSG_RESULT([yes])
4895 tst_compi_removexattr="yes"
4896 tst_nargs_removexattr="2"
4899 tst_compi_removexattr="no"
4902 if test "$tst_nargs_removexattr" = "unknown"; then
4903 AC_MSG_CHECKING([if removexattr takes 3 args.])
4906 $curl_includes_sys_xattr
4908 if(0 != removexattr(0, 0, 0))
4912 AC_MSG_RESULT([yes])
4913 tst_compi_removexattr="yes"
4914 tst_nargs_removexattr="3"
4917 tst_compi_removexattr="no"
4920 AC_MSG_CHECKING([if removexattr is compilable])
4921 if test "$tst_compi_removexattr" = "yes"; then
4922 AC_MSG_RESULT([yes])
4928 if test "$tst_compi_removexattr" = "yes"; then
4929 AC_MSG_CHECKING([if removexattr usage allowed])
4930 if test "x$curl_disallow_removexattr" != "xyes"; then
4931 AC_MSG_RESULT([yes])
4932 tst_allow_removexattr="yes"
4935 tst_allow_removexattr="no"
4939 AC_MSG_CHECKING([if removexattr might be used])
4940 if test "$tst_links_removexattr" = "yes" &&
4941 test "$tst_proto_removexattr" = "yes" &&
4942 test "$tst_compi_removexattr" = "yes" &&
4943 test "$tst_allow_removexattr" = "yes"; then
4944 AC_MSG_RESULT([yes])
4945 AC_DEFINE_UNQUOTED(HAVE_REMOVEXATTR, 1,
4946 [Define to 1 if you have the removexattr function.])
4947 dnl AC_DEFINE_UNQUOTED(REMOVEXATTR_ARGS, $tst_nargs_removexattr,
4948 dnl [Specifies the number of arguments to removexattr])
4950 if test "$tst_nargs_removexattr" -eq "2"; then
4951 AC_DEFINE(HAVE_REMOVEXATTR_2, 1, [removexattr() takes 2 args])
4952 elif test "$tst_nargs_removexattr" -eq "3"; then
4953 AC_DEFINE(HAVE_REMOVEXATTR_3, 1, [removexattr() takes 3 args])
4956 ac_cv_func_removexattr="yes"
4959 ac_cv_func_removexattr="no"
4964 dnl CURL_CHECK_FUNC_SETSOCKOPT
4965 dnl -------------------------------------------------
4966 dnl Verify if setsockopt is available, prototyped, and
4967 dnl can be compiled. If all of these are true, and
4968 dnl usage has not been previously disallowed with
4969 dnl shell variable curl_disallow_setsockopt, then
4970 dnl HAVE_SETSOCKOPT will be defined.
4972 AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT], [
4973 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
4974 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
4976 tst_links_setsockopt="unknown"
4977 tst_proto_setsockopt="unknown"
4978 tst_compi_setsockopt="unknown"
4979 tst_allow_setsockopt="unknown"
4981 AC_MSG_CHECKING([if setsockopt can be linked])
4984 $curl_includes_winsock2
4985 $curl_includes_sys_socket
4987 if(0 != setsockopt(0, 0, 0, 0, 0))
4991 AC_MSG_RESULT([yes])
4992 tst_links_setsockopt="yes"
4995 tst_links_setsockopt="no"
4998 if test "$tst_links_setsockopt" = "yes"; then
4999 AC_MSG_CHECKING([if setsockopt is prototyped])
5000 AC_EGREP_CPP([setsockopt],[
5001 $curl_includes_winsock2
5002 $curl_includes_sys_socket
5004 AC_MSG_RESULT([yes])
5005 tst_proto_setsockopt="yes"
5008 tst_proto_setsockopt="no"
5012 if test "$tst_proto_setsockopt" = "yes"; then
5013 AC_MSG_CHECKING([if setsockopt is compilable])
5016 $curl_includes_winsock2
5017 $curl_includes_sys_socket
5019 if(0 != setsockopt(0, 0, 0, 0, 0))
5023 AC_MSG_RESULT([yes])
5024 tst_compi_setsockopt="yes"
5027 tst_compi_setsockopt="no"
5031 if test "$tst_compi_setsockopt" = "yes"; then
5032 AC_MSG_CHECKING([if setsockopt usage allowed])
5033 if test "x$curl_disallow_setsockopt" != "xyes"; then
5034 AC_MSG_RESULT([yes])
5035 tst_allow_setsockopt="yes"
5038 tst_allow_setsockopt="no"
5042 AC_MSG_CHECKING([if setsockopt might be used])
5043 if test "$tst_links_setsockopt" = "yes" &&
5044 test "$tst_proto_setsockopt" = "yes" &&
5045 test "$tst_compi_setsockopt" = "yes" &&
5046 test "$tst_allow_setsockopt" = "yes"; then
5047 AC_MSG_RESULT([yes])
5048 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT, 1,
5049 [Define to 1 if you have the setsockopt function.])
5050 ac_cv_func_setsockopt="yes"
5051 CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
5054 ac_cv_func_setsockopt="no"
5059 dnl CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
5060 dnl -------------------------------------------------
5061 dnl Verify if setsockopt with the SO_NONBLOCK command is
5062 dnl available, can be compiled, and seems to work. If
5063 dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK
5064 dnl will be defined.
5066 AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [
5068 tst_compi_setsockopt_so_nonblock="unknown"
5069 tst_allow_setsockopt_so_nonblock="unknown"
5071 if test "$ac_cv_func_setsockopt" = "yes"; then
5072 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable])
5075 $curl_includes_winsock2
5076 $curl_includes_sys_socket
5078 if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
5082 AC_MSG_RESULT([yes])
5083 tst_compi_setsockopt_so_nonblock="yes"
5086 tst_compi_setsockopt_so_nonblock="no"
5090 if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then
5091 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed])
5092 if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then
5093 AC_MSG_RESULT([yes])
5094 tst_allow_setsockopt_so_nonblock="yes"
5097 tst_allow_setsockopt_so_nonblock="no"
5101 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used])
5102 if test "$tst_compi_setsockopt_so_nonblock" = "yes" &&
5103 test "$tst_allow_setsockopt_so_nonblock" = "yes"; then
5104 AC_MSG_RESULT([yes])
5105 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1,
5106 [Define to 1 if you have a working setsockopt SO_NONBLOCK function.])
5107 ac_cv_func_setsockopt_so_nonblock="yes"
5110 ac_cv_func_setsockopt_so_nonblock="no"
5115 dnl CURL_CHECK_FUNC_SETXATTR
5116 dnl -------------------------------------------------
5117 dnl Verify if setxattr is available, prototyped, and
5118 dnl can be compiled. If all of these are true, and
5119 dnl usage has not been previously disallowed with
5120 dnl shell variable curl_disallow_setxattr, then
5121 dnl HAVE_SETXATTR will be defined.
5123 AC_DEFUN([CURL_CHECK_FUNC_SETXATTR], [
5124 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
5126 tst_links_setxattr="unknown"
5127 tst_proto_setxattr="unknown"
5128 tst_compi_setxattr="unknown"
5129 tst_allow_setxattr="unknown"
5130 tst_nargs_setxattr="unknown"
5132 AC_MSG_CHECKING([if setxattr can be linked])
5134 AC_LANG_FUNC_LINK_TRY([setxattr])
5136 AC_MSG_RESULT([yes])
5137 tst_links_setxattr="yes"
5140 tst_links_setxattr="no"
5143 if test "$tst_links_setxattr" = "yes"; then
5144 AC_MSG_CHECKING([if setxattr is prototyped])
5145 AC_EGREP_CPP([setxattr],[
5146 $curl_includes_sys_xattr
5148 AC_MSG_RESULT([yes])
5149 tst_proto_setxattr="yes"
5152 tst_proto_setxattr="no"
5156 if test "$tst_proto_setxattr" = "yes"; then
5157 if test "$tst_nargs_setxattr" = "unknown"; then
5158 AC_MSG_CHECKING([if setxattr takes 5 args.])
5161 $curl_includes_sys_xattr
5163 if(0 != setxattr(0, 0, 0, 0, 0))
5167 AC_MSG_RESULT([yes])
5168 tst_compi_setxattr="yes"
5169 tst_nargs_setxattr="5"
5172 tst_compi_setxattr="no"
5175 if test "$tst_nargs_setxattr" = "unknown"; then
5176 AC_MSG_CHECKING([if setxattr takes 6 args.])
5179 $curl_includes_sys_xattr
5181 if(0 != setxattr(0, 0, 0, 0, 0, 0))
5185 AC_MSG_RESULT([yes])
5186 tst_compi_setxattr="yes"
5187 tst_nargs_setxattr="6"
5190 tst_compi_setxattr="no"
5193 AC_MSG_CHECKING([if setxattr is compilable])
5194 if test "$tst_compi_setxattr" = "yes"; then
5195 AC_MSG_RESULT([yes])
5201 if test "$tst_compi_setxattr" = "yes"; then
5202 AC_MSG_CHECKING([if setxattr usage allowed])
5203 if test "x$curl_disallow_setxattr" != "xyes"; then
5204 AC_MSG_RESULT([yes])
5205 tst_allow_setxattr="yes"
5208 tst_allow_setxattr="no"
5212 AC_MSG_CHECKING([if setxattr might be used])
5213 if test "$tst_links_setxattr" = "yes" &&
5214 test "$tst_proto_setxattr" = "yes" &&
5215 test "$tst_compi_setxattr" = "yes" &&
5216 test "$tst_allow_setxattr" = "yes"; then
5217 AC_MSG_RESULT([yes])
5218 AC_DEFINE_UNQUOTED(HAVE_SETXATTR, 1,
5219 [Define to 1 if you have the setxattr function.])
5220 dnl AC_DEFINE_UNQUOTED(SETXATTR_ARGS, $tst_nargs_setxattr,
5221 dnl [Specifies the number of arguments to setxattr])
5223 if test "$tst_nargs_setxattr" -eq "5"; then
5224 AC_DEFINE(HAVE_SETXATTR_5, 1, [setxattr() takes 5 args])
5225 elif test "$tst_nargs_setxattr" -eq "6"; then
5226 AC_DEFINE(HAVE_SETXATTR_6, 1, [setxattr() takes 6 args])
5229 ac_cv_func_setxattr="yes"
5232 ac_cv_func_setxattr="no"
5237 dnl CURL_CHECK_FUNC_SIGACTION
5238 dnl -------------------------------------------------
5239 dnl Verify if sigaction is available, prototyped, and
5240 dnl can be compiled. If all of these are true, and
5241 dnl usage has not been previously disallowed with
5242 dnl shell variable curl_disallow_sigaction, then
5243 dnl HAVE_SIGACTION will be defined.
5245 AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [
5246 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
5248 tst_links_sigaction="unknown"
5249 tst_proto_sigaction="unknown"
5250 tst_compi_sigaction="unknown"
5251 tst_allow_sigaction="unknown"
5253 AC_MSG_CHECKING([if sigaction can be linked])
5255 AC_LANG_FUNC_LINK_TRY([sigaction])
5257 AC_MSG_RESULT([yes])
5258 tst_links_sigaction="yes"
5261 tst_links_sigaction="no"
5264 if test "$tst_links_sigaction" = "yes"; then
5265 AC_MSG_CHECKING([if sigaction is prototyped])
5266 AC_EGREP_CPP([sigaction],[
5267 $curl_includes_signal
5269 AC_MSG_RESULT([yes])
5270 tst_proto_sigaction="yes"
5273 tst_proto_sigaction="no"
5277 if test "$tst_proto_sigaction" = "yes"; then
5278 AC_MSG_CHECKING([if sigaction is compilable])
5281 $curl_includes_signal
5283 if(0 != sigaction(0, 0, 0))
5287 AC_MSG_RESULT([yes])
5288 tst_compi_sigaction="yes"
5291 tst_compi_sigaction="no"
5295 if test "$tst_compi_sigaction" = "yes"; then
5296 AC_MSG_CHECKING([if sigaction usage allowed])
5297 if test "x$curl_disallow_sigaction" != "xyes"; then
5298 AC_MSG_RESULT([yes])
5299 tst_allow_sigaction="yes"
5302 tst_allow_sigaction="no"
5306 AC_MSG_CHECKING([if sigaction might be used])
5307 if test "$tst_links_sigaction" = "yes" &&
5308 test "$tst_proto_sigaction" = "yes" &&
5309 test "$tst_compi_sigaction" = "yes" &&
5310 test "$tst_allow_sigaction" = "yes"; then
5311 AC_MSG_RESULT([yes])
5312 AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1,
5313 [Define to 1 if you have the sigaction function.])
5314 ac_cv_func_sigaction="yes"
5317 ac_cv_func_sigaction="no"
5322 dnl CURL_CHECK_FUNC_SIGINTERRUPT
5323 dnl -------------------------------------------------
5324 dnl Verify if siginterrupt is available, prototyped, and
5325 dnl can be compiled. If all of these are true, and
5326 dnl usage has not been previously disallowed with
5327 dnl shell variable curl_disallow_siginterrupt, then
5328 dnl HAVE_SIGINTERRUPT will be defined.
5330 AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [
5331 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
5333 tst_links_siginterrupt="unknown"
5334 tst_proto_siginterrupt="unknown"
5335 tst_compi_siginterrupt="unknown"
5336 tst_allow_siginterrupt="unknown"
5338 AC_MSG_CHECKING([if siginterrupt can be linked])
5340 AC_LANG_FUNC_LINK_TRY([siginterrupt])
5342 AC_MSG_RESULT([yes])
5343 tst_links_siginterrupt="yes"
5346 tst_links_siginterrupt="no"
5349 if test "$tst_links_siginterrupt" = "yes"; then
5350 AC_MSG_CHECKING([if siginterrupt is prototyped])
5351 AC_EGREP_CPP([siginterrupt],[
5352 $curl_includes_signal
5354 AC_MSG_RESULT([yes])
5355 tst_proto_siginterrupt="yes"
5358 tst_proto_siginterrupt="no"
5362 if test "$tst_proto_siginterrupt" = "yes"; then
5363 AC_MSG_CHECKING([if siginterrupt is compilable])
5366 $curl_includes_signal
5368 if(0 != siginterrupt(0, 0))
5372 AC_MSG_RESULT([yes])
5373 tst_compi_siginterrupt="yes"
5376 tst_compi_siginterrupt="no"
5380 if test "$tst_compi_siginterrupt" = "yes"; then
5381 AC_MSG_CHECKING([if siginterrupt usage allowed])
5382 if test "x$curl_disallow_siginterrupt" != "xyes"; then
5383 AC_MSG_RESULT([yes])
5384 tst_allow_siginterrupt="yes"
5387 tst_allow_siginterrupt="no"
5391 AC_MSG_CHECKING([if siginterrupt might be used])
5392 if test "$tst_links_siginterrupt" = "yes" &&
5393 test "$tst_proto_siginterrupt" = "yes" &&
5394 test "$tst_compi_siginterrupt" = "yes" &&
5395 test "$tst_allow_siginterrupt" = "yes"; then
5396 AC_MSG_RESULT([yes])
5397 AC_DEFINE_UNQUOTED(HAVE_SIGINTERRUPT, 1,
5398 [Define to 1 if you have the siginterrupt function.])
5399 ac_cv_func_siginterrupt="yes"
5402 ac_cv_func_siginterrupt="no"
5407 dnl CURL_CHECK_FUNC_SIGNAL
5408 dnl -------------------------------------------------
5409 dnl Verify if signal is available, prototyped, and
5410 dnl can be compiled. If all of these are true, and
5411 dnl usage has not been previously disallowed with
5412 dnl shell variable curl_disallow_signal, then
5413 dnl HAVE_SIGNAL will be defined.
5415 AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [
5416 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
5418 tst_links_signal="unknown"
5419 tst_proto_signal="unknown"
5420 tst_compi_signal="unknown"
5421 tst_allow_signal="unknown"
5423 AC_MSG_CHECKING([if signal can be linked])
5425 AC_LANG_FUNC_LINK_TRY([signal])
5427 AC_MSG_RESULT([yes])
5428 tst_links_signal="yes"
5431 tst_links_signal="no"
5434 if test "$tst_links_signal" = "yes"; then
5435 AC_MSG_CHECKING([if signal is prototyped])
5436 AC_EGREP_CPP([signal],[
5437 $curl_includes_signal
5439 AC_MSG_RESULT([yes])
5440 tst_proto_signal="yes"
5443 tst_proto_signal="no"
5447 if test "$tst_proto_signal" = "yes"; then
5448 AC_MSG_CHECKING([if signal is compilable])
5451 $curl_includes_signal
5453 if(0 != signal(0, 0))
5457 AC_MSG_RESULT([yes])
5458 tst_compi_signal="yes"
5461 tst_compi_signal="no"
5465 if test "$tst_compi_signal" = "yes"; then
5466 AC_MSG_CHECKING([if signal usage allowed])
5467 if test "x$curl_disallow_signal" != "xyes"; then
5468 AC_MSG_RESULT([yes])
5469 tst_allow_signal="yes"
5472 tst_allow_signal="no"
5476 AC_MSG_CHECKING([if signal might be used])
5477 if test "$tst_links_signal" = "yes" &&
5478 test "$tst_proto_signal" = "yes" &&
5479 test "$tst_compi_signal" = "yes" &&
5480 test "$tst_allow_signal" = "yes"; then
5481 AC_MSG_RESULT([yes])
5482 AC_DEFINE_UNQUOTED(HAVE_SIGNAL, 1,
5483 [Define to 1 if you have the signal function.])
5484 ac_cv_func_signal="yes"
5487 ac_cv_func_signal="no"
5492 dnl CURL_CHECK_FUNC_SIGSETJMP
5493 dnl -------------------------------------------------
5494 dnl Verify if sigsetjmp is available, prototyped, and
5495 dnl can be compiled. If all of these are true, and
5496 dnl usage has not been previously disallowed with
5497 dnl shell variable curl_disallow_sigsetjmp, then
5498 dnl HAVE_SIGSETJMP will be defined.
5500 AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [
5501 AC_REQUIRE([CURL_INCLUDES_SETJMP])dnl
5503 tst_links_sigsetjmp="unknown"
5504 tst_macro_sigsetjmp="unknown"
5505 tst_proto_sigsetjmp="unknown"
5506 tst_compi_sigsetjmp="unknown"
5507 tst_allow_sigsetjmp="unknown"
5509 AC_MSG_CHECKING([if sigsetjmp can be linked])
5511 AC_LANG_FUNC_LINK_TRY([sigsetjmp])
5513 AC_MSG_RESULT([yes])
5514 tst_links_sigsetjmp="yes"
5517 tst_links_sigsetjmp="no"
5520 if test "$tst_links_sigsetjmp" = "no"; then
5521 AC_MSG_CHECKING([if sigsetjmp seems a macro])
5524 $curl_includes_setjmp
5527 if(0 != sigsetjmp(env, 0))
5531 AC_MSG_RESULT([yes])
5532 tst_macro_sigsetjmp="yes"
5535 tst_macro_sigsetjmp="no"
5539 if test "$tst_links_sigsetjmp" = "yes"; then
5540 AC_MSG_CHECKING([if sigsetjmp is prototyped])
5541 AC_EGREP_CPP([sigsetjmp],[
5542 $curl_includes_setjmp
5544 AC_MSG_RESULT([yes])
5545 tst_proto_sigsetjmp="yes"
5548 tst_proto_sigsetjmp="no"
5552 if test "$tst_proto_sigsetjmp" = "yes" ||
5553 test "$tst_macro_sigsetjmp" = "yes"; then
5554 AC_MSG_CHECKING([if sigsetjmp is compilable])
5557 $curl_includes_setjmp
5560 if(0 != sigsetjmp(env, 0))
5564 AC_MSG_RESULT([yes])
5565 tst_compi_sigsetjmp="yes"
5568 tst_compi_sigsetjmp="no"
5572 if test "$tst_compi_sigsetjmp" = "yes"; then
5573 AC_MSG_CHECKING([if sigsetjmp usage allowed])
5574 if test "x$curl_disallow_sigsetjmp" != "xyes"; then
5575 AC_MSG_RESULT([yes])
5576 tst_allow_sigsetjmp="yes"
5579 tst_allow_sigsetjmp="no"
5583 AC_MSG_CHECKING([if sigsetjmp might be used])
5584 if (test "$tst_proto_sigsetjmp" = "yes" ||
5585 test "$tst_macro_sigsetjmp" = "yes") &&
5586 test "$tst_compi_sigsetjmp" = "yes" &&
5587 test "$tst_allow_sigsetjmp" = "yes"; then
5588 AC_MSG_RESULT([yes])
5589 AC_DEFINE_UNQUOTED(HAVE_SIGSETJMP, 1,
5590 [Define to 1 if you have the sigsetjmp function or macro.])
5591 ac_cv_func_sigsetjmp="yes"
5594 ac_cv_func_sigsetjmp="no"
5599 dnl CURL_CHECK_FUNC_SOCKET
5600 dnl -------------------------------------------------
5601 dnl Verify if socket is available, prototyped, and
5602 dnl can be compiled. If all of these are true, and
5603 dnl usage has not been previously disallowed with
5604 dnl shell variable curl_disallow_socket, then
5605 dnl HAVE_SOCKET will be defined.
5607 AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [
5608 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
5609 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
5610 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
5612 tst_links_socket="unknown"
5613 tst_proto_socket="unknown"
5614 tst_compi_socket="unknown"
5615 tst_allow_socket="unknown"
5617 AC_MSG_CHECKING([if socket can be linked])
5620 $curl_includes_winsock2
5621 $curl_includes_sys_socket
5622 $curl_includes_socket
5624 if(0 != socket(0, 0, 0))
5628 AC_MSG_RESULT([yes])
5629 tst_links_socket="yes"
5632 tst_links_socket="no"
5635 if test "$tst_links_socket" = "yes"; then
5636 AC_MSG_CHECKING([if socket is prototyped])
5637 AC_EGREP_CPP([socket],[
5638 $curl_includes_winsock2
5639 $curl_includes_sys_socket
5640 $curl_includes_socket
5642 AC_MSG_RESULT([yes])
5643 tst_proto_socket="yes"
5646 tst_proto_socket="no"
5650 if test "$tst_proto_socket" = "yes"; then
5651 AC_MSG_CHECKING([if socket is compilable])
5654 $curl_includes_winsock2
5655 $curl_includes_sys_socket
5656 $curl_includes_socket
5658 if(0 != socket(0, 0, 0))
5662 AC_MSG_RESULT([yes])
5663 tst_compi_socket="yes"
5666 tst_compi_socket="no"
5670 if test "$tst_compi_socket" = "yes"; then
5671 AC_MSG_CHECKING([if socket usage allowed])
5672 if test "x$curl_disallow_socket" != "xyes"; then
5673 AC_MSG_RESULT([yes])
5674 tst_allow_socket="yes"
5677 tst_allow_socket="no"
5681 AC_MSG_CHECKING([if socket might be used])
5682 if test "$tst_links_socket" = "yes" &&
5683 test "$tst_proto_socket" = "yes" &&
5684 test "$tst_compi_socket" = "yes" &&
5685 test "$tst_allow_socket" = "yes"; then
5686 AC_MSG_RESULT([yes])
5687 AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1,
5688 [Define to 1 if you have the socket function.])
5689 ac_cv_func_socket="yes"
5692 ac_cv_func_socket="no"
5697 dnl CURL_CHECK_FUNC_SOCKETPAIR
5698 dnl -------------------------------------------------
5699 dnl Verify if socketpair is available, prototyped, and
5700 dnl can be compiled. If all of these are true, and
5701 dnl usage has not been previously disallowed with
5702 dnl shell variable curl_disallow_socketpair, then
5703 dnl HAVE_SOCKETPAIR will be defined.
5705 AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [
5706 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
5707 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
5709 tst_links_socketpair="unknown"
5710 tst_proto_socketpair="unknown"
5711 tst_compi_socketpair="unknown"
5712 tst_allow_socketpair="unknown"
5714 AC_MSG_CHECKING([if socketpair can be linked])
5716 AC_LANG_FUNC_LINK_TRY([socketpair])
5718 AC_MSG_RESULT([yes])
5719 tst_links_socketpair="yes"
5722 tst_links_socketpair="no"
5725 if test "$tst_links_socketpair" = "yes"; then
5726 AC_MSG_CHECKING([if socketpair is prototyped])
5727 AC_EGREP_CPP([socketpair],[
5728 $curl_includes_sys_socket
5729 $curl_includes_socket
5731 AC_MSG_RESULT([yes])
5732 tst_proto_socketpair="yes"
5735 tst_proto_socketpair="no"
5739 if test "$tst_proto_socketpair" = "yes"; then
5740 AC_MSG_CHECKING([if socketpair is compilable])
5743 $curl_includes_sys_socket
5744 $curl_includes_socket
5747 if(0 != socketpair(0, 0, 0, sv))
5751 AC_MSG_RESULT([yes])
5752 tst_compi_socketpair="yes"
5755 tst_compi_socketpair="no"
5759 if test "$tst_compi_socketpair" = "yes"; then
5760 AC_MSG_CHECKING([if socketpair usage allowed])
5761 if test "x$curl_disallow_socketpair" != "xyes"; then
5762 AC_MSG_RESULT([yes])
5763 tst_allow_socketpair="yes"
5766 tst_allow_socketpair="no"
5770 AC_MSG_CHECKING([if socketpair might be used])
5771 if test "$tst_links_socketpair" = "yes" &&
5772 test "$tst_proto_socketpair" = "yes" &&
5773 test "$tst_compi_socketpair" = "yes" &&
5774 test "$tst_allow_socketpair" = "yes"; then
5775 AC_MSG_RESULT([yes])
5776 AC_DEFINE_UNQUOTED(HAVE_SOCKETPAIR, 1,
5777 [Define to 1 if you have the socketpair function.])
5778 ac_cv_func_socketpair="yes"
5781 ac_cv_func_socketpair="no"
5786 dnl CURL_CHECK_FUNC_STRCASECMP
5787 dnl -------------------------------------------------
5788 dnl Verify if strcasecmp is available, prototyped, and
5789 dnl can be compiled. If all of these are true, and
5790 dnl usage has not been previously disallowed with
5791 dnl shell variable curl_disallow_strcasecmp, then
5792 dnl HAVE_STRCASECMP will be defined.
5794 AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
5795 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
5797 tst_links_strcasecmp="unknown"
5798 tst_proto_strcasecmp="unknown"
5799 tst_compi_strcasecmp="unknown"
5800 tst_allow_strcasecmp="unknown"
5802 AC_MSG_CHECKING([if strcasecmp can be linked])
5804 AC_LANG_FUNC_LINK_TRY([strcasecmp])
5806 AC_MSG_RESULT([yes])
5807 tst_links_strcasecmp="yes"
5810 tst_links_strcasecmp="no"
5813 if test "$tst_links_strcasecmp" = "yes"; then
5814 AC_MSG_CHECKING([if strcasecmp is prototyped])
5815 AC_EGREP_CPP([strcasecmp],[
5816 $curl_includes_string
5818 AC_MSG_RESULT([yes])
5819 tst_proto_strcasecmp="yes"
5822 tst_proto_strcasecmp="no"
5826 if test "$tst_proto_strcasecmp" = "yes"; then
5827 AC_MSG_CHECKING([if strcasecmp is compilable])
5830 $curl_includes_string
5832 if(0 != strcasecmp(0, 0))
5836 AC_MSG_RESULT([yes])
5837 tst_compi_strcasecmp="yes"
5840 tst_compi_strcasecmp="no"
5844 if test "$tst_compi_strcasecmp" = "yes"; then
5845 AC_MSG_CHECKING([if strcasecmp usage allowed])
5846 if test "x$curl_disallow_strcasecmp" != "xyes"; then
5847 AC_MSG_RESULT([yes])
5848 tst_allow_strcasecmp="yes"
5851 tst_allow_strcasecmp="no"
5855 AC_MSG_CHECKING([if strcasecmp might be used])
5856 if test "$tst_links_strcasecmp" = "yes" &&
5857 test "$tst_proto_strcasecmp" = "yes" &&
5858 test "$tst_compi_strcasecmp" = "yes" &&
5859 test "$tst_allow_strcasecmp" = "yes"; then
5860 AC_MSG_RESULT([yes])
5861 AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
5862 [Define to 1 if you have the strcasecmp function.])
5863 ac_cv_func_strcasecmp="yes"
5866 ac_cv_func_strcasecmp="no"
5870 dnl CURL_CHECK_FUNC_STRCMPI
5871 dnl -------------------------------------------------
5872 dnl Verify if strcmpi is available, prototyped, and
5873 dnl can be compiled. If all of these are true, and
5874 dnl usage has not been previously disallowed with
5875 dnl shell variable curl_disallow_strcmpi, then
5876 dnl HAVE_STRCMPI will be defined.
5878 AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
5879 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
5881 tst_links_strcmpi="unknown"
5882 tst_proto_strcmpi="unknown"
5883 tst_compi_strcmpi="unknown"
5884 tst_allow_strcmpi="unknown"
5886 AC_MSG_CHECKING([if strcmpi can be linked])
5888 AC_LANG_FUNC_LINK_TRY([strcmpi])
5890 AC_MSG_RESULT([yes])
5891 tst_links_strcmpi="yes"
5894 tst_links_strcmpi="no"
5897 if test "$tst_links_strcmpi" = "yes"; then
5898 AC_MSG_CHECKING([if strcmpi is prototyped])
5899 AC_EGREP_CPP([strcmpi],[
5900 $curl_includes_string
5902 AC_MSG_RESULT([yes])
5903 tst_proto_strcmpi="yes"
5906 tst_proto_strcmpi="no"
5910 if test "$tst_proto_strcmpi" = "yes"; then
5911 AC_MSG_CHECKING([if strcmpi is compilable])
5914 $curl_includes_string
5916 if(0 != strcmpi(0, 0))
5920 AC_MSG_RESULT([yes])
5921 tst_compi_strcmpi="yes"
5924 tst_compi_strcmpi="no"
5928 if test "$tst_compi_strcmpi" = "yes"; then
5929 AC_MSG_CHECKING([if strcmpi usage allowed])
5930 if test "x$curl_disallow_strcmpi" != "xyes"; then
5931 AC_MSG_RESULT([yes])
5932 tst_allow_strcmpi="yes"
5935 tst_allow_strcmpi="no"
5939 AC_MSG_CHECKING([if strcmpi might be used])
5940 if test "$tst_links_strcmpi" = "yes" &&
5941 test "$tst_proto_strcmpi" = "yes" &&
5942 test "$tst_compi_strcmpi" = "yes" &&
5943 test "$tst_allow_strcmpi" = "yes"; then
5944 AC_MSG_RESULT([yes])
5945 AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
5946 [Define to 1 if you have the strcmpi function.])
5947 ac_cv_func_strcmpi="yes"
5950 ac_cv_func_strcmpi="no"
5955 dnl CURL_CHECK_FUNC_STRDUP
5956 dnl -------------------------------------------------
5957 dnl Verify if strdup is available, prototyped, and
5958 dnl can be compiled. If all of these are true, and
5959 dnl usage has not been previously disallowed with
5960 dnl shell variable curl_disallow_strdup, then
5961 dnl HAVE_STRDUP will be defined.
5963 AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [
5964 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
5966 tst_links_strdup="unknown"
5967 tst_proto_strdup="unknown"
5968 tst_compi_strdup="unknown"
5969 tst_allow_strdup="unknown"
5971 AC_MSG_CHECKING([if strdup can be linked])
5973 AC_LANG_FUNC_LINK_TRY([strdup])
5975 AC_MSG_RESULT([yes])
5976 tst_links_strdup="yes"
5979 tst_links_strdup="no"
5982 if test "$tst_links_strdup" = "yes"; then
5983 AC_MSG_CHECKING([if strdup is prototyped])
5984 AC_EGREP_CPP([strdup],[
5985 $curl_includes_string
5987 AC_MSG_RESULT([yes])
5988 tst_proto_strdup="yes"
5991 tst_proto_strdup="no"
5995 if test "$tst_proto_strdup" = "yes"; then
5996 AC_MSG_CHECKING([if strdup is compilable])
5999 $curl_includes_string
6005 AC_MSG_RESULT([yes])
6006 tst_compi_strdup="yes"
6009 tst_compi_strdup="no"
6013 if test "$tst_compi_strdup" = "yes"; then
6014 AC_MSG_CHECKING([if strdup usage allowed])
6015 if test "x$curl_disallow_strdup" != "xyes"; then
6016 AC_MSG_RESULT([yes])
6017 tst_allow_strdup="yes"
6020 tst_allow_strdup="no"
6024 AC_MSG_CHECKING([if strdup might be used])
6025 if test "$tst_links_strdup" = "yes" &&
6026 test "$tst_proto_strdup" = "yes" &&
6027 test "$tst_compi_strdup" = "yes" &&
6028 test "$tst_allow_strdup" = "yes"; then
6029 AC_MSG_RESULT([yes])
6030 AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
6031 [Define to 1 if you have the strdup function.])
6032 ac_cv_func_strdup="yes"
6035 ac_cv_func_strdup="no"
6040 dnl CURL_CHECK_FUNC_STRERROR_R
6041 dnl -------------------------------------------------
6042 dnl Verify if strerror_r is available, prototyped, can be compiled and
6043 dnl seems to work. If all of these are true, and usage has not been
6044 dnl previously disallowed with shell variable curl_disallow_strerror_r,
6045 dnl then HAVE_STRERROR_R and STRERROR_R_TYPE_ARG3 will be defined, as
6046 dnl well as one of HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R.
6048 dnl glibc-style strerror_r:
6050 dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize);
6052 dnl glibc-style strerror_r returns a pointer to the the error string,
6053 dnl and might use the provided workbuf as a scratch area if needed. A
6054 dnl quick test on a few systems shows that it's usually not used at all.
6056 dnl POSIX-style strerror_r:
6058 dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize);
6060 dnl POSIX-style strerror_r returns 0 upon successful completion and the
6061 dnl error string in the provided resultbuf.
6064 AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
6065 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
6066 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6068 tst_links_strerror_r="unknown"
6069 tst_proto_strerror_r="unknown"
6070 tst_compi_strerror_r="unknown"
6071 tst_glibc_strerror_r="unknown"
6072 tst_posix_strerror_r="unknown"
6073 tst_allow_strerror_r="unknown"
6074 tst_works_glibc_strerror_r="unknown"
6075 tst_works_posix_strerror_r="unknown"
6076 tst_glibc_strerror_r_type_arg3="unknown"
6077 tst_posix_strerror_r_type_arg3="unknown"
6079 AC_MSG_CHECKING([if strerror_r can be linked])
6081 AC_LANG_FUNC_LINK_TRY([strerror_r])
6083 AC_MSG_RESULT([yes])
6084 tst_links_strerror_r="yes"
6087 tst_links_strerror_r="no"
6090 if test "$tst_links_strerror_r" = "yes"; then
6091 AC_MSG_CHECKING([if strerror_r is prototyped])
6092 AC_EGREP_CPP([strerror_r],[
6093 $curl_includes_string
6095 AC_MSG_RESULT([yes])
6096 tst_proto_strerror_r="yes"
6099 tst_proto_strerror_r="no"
6103 if test "$tst_proto_strerror_r" = "yes"; then
6104 AC_MSG_CHECKING([if strerror_r is compilable])
6107 $curl_includes_string
6109 if(0 != strerror_r(0, 0, 0))
6113 AC_MSG_RESULT([yes])
6114 tst_compi_strerror_r="yes"
6117 tst_compi_strerror_r="no"
6121 if test "$tst_compi_strerror_r" = "yes"; then
6122 AC_MSG_CHECKING([if strerror_r is glibc like])
6123 tst_glibc_strerror_r_type_arg3="unknown"
6124 for arg3 in 'size_t' 'int' 'unsigned int'; do
6125 if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then
6128 $curl_includes_string
6129 char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
6131 if(0 != strerror_r(0, 0, 0))
6135 tst_glibc_strerror_r_type_arg3="$arg3"
6139 case "$tst_glibc_strerror_r_type_arg3" in
6142 tst_glibc_strerror_r="no"
6145 AC_MSG_RESULT([yes])
6146 tst_glibc_strerror_r="yes"
6151 dnl only do runtime verification when not cross-compiling
6152 if test "x$cross_compiling" != "xyes" &&
6153 test "$tst_glibc_strerror_r" = "yes"; then
6154 AC_MSG_CHECKING([if strerror_r seems to work])
6157 $curl_includes_stdlib
6158 $curl_includes_string
6164 string = strerror_r(EACCES, buffer, sizeof(buffer));
6173 AC_MSG_RESULT([yes])
6174 tst_works_glibc_strerror_r="yes"
6177 tst_works_glibc_strerror_r="no"
6181 if test "$tst_compi_strerror_r" = "yes" &&
6182 test "$tst_works_glibc_strerror_r" != "yes"; then
6183 AC_MSG_CHECKING([if strerror_r is POSIX like])
6184 tst_posix_strerror_r_type_arg3="unknown"
6185 for arg3 in 'size_t' 'int' 'unsigned int'; do
6186 if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then
6189 $curl_includes_string
6190 int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
6192 if(0 != strerror_r(0, 0, 0))
6196 tst_posix_strerror_r_type_arg3="$arg3"
6200 case "$tst_posix_strerror_r_type_arg3" in
6203 tst_posix_strerror_r="no"
6206 AC_MSG_RESULT([yes])
6207 tst_posix_strerror_r="yes"
6212 dnl only do runtime verification when not cross-compiling
6213 if test "x$cross_compiling" != "xyes" &&
6214 test "$tst_posix_strerror_r" = "yes"; then
6215 AC_MSG_CHECKING([if strerror_r seems to work])
6218 $curl_includes_stdlib
6219 $curl_includes_string
6225 error = strerror_r(EACCES, buffer, sizeof(buffer));
6228 if(buffer[0] == '\0')
6234 AC_MSG_RESULT([yes])
6235 tst_works_posix_strerror_r="yes"
6238 tst_works_posix_strerror_r="no"
6242 if test "$tst_works_glibc_strerror_r" = "yes"; then
6243 tst_posix_strerror_r="no"
6245 if test "$tst_works_posix_strerror_r" = "yes"; then
6246 tst_glibc_strerror_r="no"
6248 if test "$tst_glibc_strerror_r" = "yes" &&
6249 test "$tst_works_glibc_strerror_r" != "no" &&
6250 test "$tst_posix_strerror_r" != "yes"; then
6251 tst_allow_strerror_r="check"
6253 if test "$tst_posix_strerror_r" = "yes" &&
6254 test "$tst_works_posix_strerror_r" != "no" &&
6255 test "$tst_glibc_strerror_r" != "yes"; then
6256 tst_allow_strerror_r="check"
6258 if test "$tst_allow_strerror_r" = "check"; then
6259 AC_MSG_CHECKING([if strerror_r usage allowed])
6260 if test "x$curl_disallow_strerror_r" != "xyes"; then
6261 AC_MSG_RESULT([yes])
6262 tst_allow_strerror_r="yes"
6265 tst_allow_strerror_r="no"
6269 AC_MSG_CHECKING([if strerror_r might be used])
6270 if test "$tst_links_strerror_r" = "yes" &&
6271 test "$tst_proto_strerror_r" = "yes" &&
6272 test "$tst_compi_strerror_r" = "yes" &&
6273 test "$tst_allow_strerror_r" = "yes"; then
6274 AC_MSG_RESULT([yes])
6275 if test "$tst_glibc_strerror_r" = "yes"; then
6276 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
6277 [Define to 1 if you have the strerror_r function.])
6278 AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1,
6279 [Define to 1 if you have a working glibc-style strerror_r function.])
6280 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_glibc_strerror_r_type_arg3,
6281 [Define to the type of arg 3 for strerror_r.])
6283 if test "$tst_posix_strerror_r" = "yes"; then
6284 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
6285 [Define to 1 if you have the strerror_r function.])
6286 AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1,
6287 [Define to 1 if you have a working POSIX-style strerror_r function.])
6288 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_posix_strerror_r_type_arg3,
6289 [Define to the type of arg 3 for strerror_r.])
6291 ac_cv_func_strerror_r="yes"
6294 ac_cv_func_strerror_r="no"
6297 if test "$tst_compi_strerror_r" = "yes" &&
6298 test "$tst_allow_strerror_r" = "unknown"; then
6299 AC_MSG_WARN([cannot determine strerror_r() style: edit lib/curl_config.h manually.])
6305 dnl CURL_CHECK_FUNC_STRICMP
6306 dnl -------------------------------------------------
6307 dnl Verify if stricmp is available, prototyped, and
6308 dnl can be compiled. If all of these are true, and
6309 dnl usage has not been previously disallowed with
6310 dnl shell variable curl_disallow_stricmp, then
6311 dnl HAVE_STRICMP will be defined.
6313 AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [
6314 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6316 tst_links_stricmp="unknown"
6317 tst_proto_stricmp="unknown"
6318 tst_compi_stricmp="unknown"
6319 tst_allow_stricmp="unknown"
6321 AC_MSG_CHECKING([if stricmp can be linked])
6323 AC_LANG_FUNC_LINK_TRY([stricmp])
6325 AC_MSG_RESULT([yes])
6326 tst_links_stricmp="yes"
6329 tst_links_stricmp="no"
6332 if test "$tst_links_stricmp" = "yes"; then
6333 AC_MSG_CHECKING([if stricmp is prototyped])
6334 AC_EGREP_CPP([stricmp],[
6335 $curl_includes_string
6337 AC_MSG_RESULT([yes])
6338 tst_proto_stricmp="yes"
6341 tst_proto_stricmp="no"
6345 if test "$tst_proto_stricmp" = "yes"; then
6346 AC_MSG_CHECKING([if stricmp is compilable])
6349 $curl_includes_string
6351 if(0 != stricmp(0, 0))
6355 AC_MSG_RESULT([yes])
6356 tst_compi_stricmp="yes"
6359 tst_compi_stricmp="no"
6363 if test "$tst_compi_stricmp" = "yes"; then
6364 AC_MSG_CHECKING([if stricmp usage allowed])
6365 if test "x$curl_disallow_stricmp" != "xyes"; then
6366 AC_MSG_RESULT([yes])
6367 tst_allow_stricmp="yes"
6370 tst_allow_stricmp="no"
6374 AC_MSG_CHECKING([if stricmp might be used])
6375 if test "$tst_links_stricmp" = "yes" &&
6376 test "$tst_proto_stricmp" = "yes" &&
6377 test "$tst_compi_stricmp" = "yes" &&
6378 test "$tst_allow_stricmp" = "yes"; then
6379 AC_MSG_RESULT([yes])
6380 AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
6381 [Define to 1 if you have the stricmp function.])
6382 ac_cv_func_stricmp="yes"
6385 ac_cv_func_stricmp="no"
6389 dnl CURL_CHECK_FUNC_STRNCASECMP
6390 dnl -------------------------------------------------
6391 dnl Verify if strncasecmp is available, prototyped, and
6392 dnl can be compiled. If all of these are true, and
6393 dnl usage has not been previously disallowed with
6394 dnl shell variable curl_disallow_strncasecmp, then
6395 dnl HAVE_STRNCASECMP will be defined.
6397 AC_DEFUN([CURL_CHECK_FUNC_STRNCASECMP], [
6398 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6400 tst_links_strncasecmp="unknown"
6401 tst_proto_strncasecmp="unknown"
6402 tst_compi_strncasecmp="unknown"
6403 tst_allow_strncasecmp="unknown"
6405 AC_MSG_CHECKING([if strncasecmp can be linked])
6407 AC_LANG_FUNC_LINK_TRY([strncasecmp])
6409 AC_MSG_RESULT([yes])
6410 tst_links_strncasecmp="yes"
6413 tst_links_strncasecmp="no"
6416 if test "$tst_links_strncasecmp" = "yes"; then
6417 AC_MSG_CHECKING([if strncasecmp is prototyped])
6418 AC_EGREP_CPP([strncasecmp],[
6419 $curl_includes_string
6421 AC_MSG_RESULT([yes])
6422 tst_proto_strncasecmp="yes"
6425 tst_proto_strncasecmp="no"
6429 if test "$tst_proto_strncasecmp" = "yes"; then
6430 AC_MSG_CHECKING([if strncasecmp is compilable])
6433 $curl_includes_string
6435 if(0 != strncasecmp(0, 0, 0))
6439 AC_MSG_RESULT([yes])
6440 tst_compi_strncasecmp="yes"
6443 tst_compi_strncasecmp="no"
6447 if test "$tst_compi_strncasecmp" = "yes"; then
6448 AC_MSG_CHECKING([if strncasecmp usage allowed])
6449 if test "x$curl_disallow_strncasecmp" != "xyes"; then
6450 AC_MSG_RESULT([yes])
6451 tst_allow_strncasecmp="yes"
6454 tst_allow_strncasecmp="no"
6458 AC_MSG_CHECKING([if strncasecmp might be used])
6459 if test "$tst_links_strncasecmp" = "yes" &&
6460 test "$tst_proto_strncasecmp" = "yes" &&
6461 test "$tst_compi_strncasecmp" = "yes" &&
6462 test "$tst_allow_strncasecmp" = "yes"; then
6463 AC_MSG_RESULT([yes])
6464 AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1,
6465 [Define to 1 if you have the strncasecmp function.])
6466 ac_cv_func_strncasecmp="yes"
6469 ac_cv_func_strncasecmp="no"
6474 dnl CURL_CHECK_FUNC_STRNCMPI
6475 dnl -------------------------------------------------
6476 dnl Verify if strncmpi is available, prototyped, and
6477 dnl can be compiled. If all of these are true, and
6478 dnl usage has not been previously disallowed with
6479 dnl shell variable curl_disallow_strncmpi, then
6480 dnl HAVE_STRNCMPI will be defined.
6482 AC_DEFUN([CURL_CHECK_FUNC_STRNCMPI], [
6483 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6485 tst_links_strncmpi="unknown"
6486 tst_proto_strncmpi="unknown"
6487 tst_compi_strncmpi="unknown"
6488 tst_allow_strncmpi="unknown"
6490 AC_MSG_CHECKING([if strncmpi can be linked])
6492 AC_LANG_FUNC_LINK_TRY([strncmpi])
6494 AC_MSG_RESULT([yes])
6495 tst_links_strncmpi="yes"
6498 tst_links_strncmpi="no"
6501 if test "$tst_links_strncmpi" = "yes"; then
6502 AC_MSG_CHECKING([if strncmpi is prototyped])
6503 AC_EGREP_CPP([strncmpi],[
6504 $curl_includes_string
6506 AC_MSG_RESULT([yes])
6507 tst_proto_strncmpi="yes"
6510 tst_proto_strncmpi="no"
6514 if test "$tst_proto_strncmpi" = "yes"; then
6515 AC_MSG_CHECKING([if strncmpi is compilable])
6518 $curl_includes_string
6520 if(0 != strncmpi(0, 0))
6524 AC_MSG_RESULT([yes])
6525 tst_compi_strncmpi="yes"
6528 tst_compi_strncmpi="no"
6532 if test "$tst_compi_strncmpi" = "yes"; then
6533 AC_MSG_CHECKING([if strncmpi usage allowed])
6534 if test "x$curl_disallow_strncmpi" != "xyes"; then
6535 AC_MSG_RESULT([yes])
6536 tst_allow_strncmpi="yes"
6539 tst_allow_strncmpi="no"
6543 AC_MSG_CHECKING([if strncmpi might be used])
6544 if test "$tst_links_strncmpi" = "yes" &&
6545 test "$tst_proto_strncmpi" = "yes" &&
6546 test "$tst_compi_strncmpi" = "yes" &&
6547 test "$tst_allow_strncmpi" = "yes"; then
6548 AC_MSG_RESULT([yes])
6549 AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1,
6550 [Define to 1 if you have the strncmpi function.])
6551 ac_cv_func_strncmpi="yes"
6554 ac_cv_func_strncmpi="no"
6559 dnl CURL_CHECK_FUNC_STRNICMP
6560 dnl -------------------------------------------------
6561 dnl Verify if strnicmp is available, prototyped, and
6562 dnl can be compiled. If all of these are true, and
6563 dnl usage has not been previously disallowed with
6564 dnl shell variable curl_disallow_strnicmp, then
6565 dnl HAVE_STRNICMP will be defined.
6567 AC_DEFUN([CURL_CHECK_FUNC_STRNICMP], [
6568 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6570 tst_links_strnicmp="unknown"
6571 tst_proto_strnicmp="unknown"
6572 tst_compi_strnicmp="unknown"
6573 tst_allow_strnicmp="unknown"
6575 AC_MSG_CHECKING([if strnicmp can be linked])
6577 AC_LANG_FUNC_LINK_TRY([strnicmp])
6579 AC_MSG_RESULT([yes])
6580 tst_links_strnicmp="yes"
6583 tst_links_strnicmp="no"
6586 if test "$tst_links_strnicmp" = "yes"; then
6587 AC_MSG_CHECKING([if strnicmp is prototyped])
6588 AC_EGREP_CPP([strnicmp],[
6589 $curl_includes_string
6591 AC_MSG_RESULT([yes])
6592 tst_proto_strnicmp="yes"
6595 tst_proto_strnicmp="no"
6599 if test "$tst_proto_strnicmp" = "yes"; then
6600 AC_MSG_CHECKING([if strnicmp is compilable])
6603 $curl_includes_string
6605 if(0 != strnicmp(0, 0))
6609 AC_MSG_RESULT([yes])
6610 tst_compi_strnicmp="yes"
6613 tst_compi_strnicmp="no"
6617 if test "$tst_compi_strnicmp" = "yes"; then
6618 AC_MSG_CHECKING([if strnicmp usage allowed])
6619 if test "x$curl_disallow_strnicmp" != "xyes"; then
6620 AC_MSG_RESULT([yes])
6621 tst_allow_strnicmp="yes"
6624 tst_allow_strnicmp="no"
6628 AC_MSG_CHECKING([if strnicmp might be used])
6629 if test "$tst_links_strnicmp" = "yes" &&
6630 test "$tst_proto_strnicmp" = "yes" &&
6631 test "$tst_compi_strnicmp" = "yes" &&
6632 test "$tst_allow_strnicmp" = "yes"; then
6633 AC_MSG_RESULT([yes])
6634 AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1,
6635 [Define to 1 if you have the strnicmp function.])
6636 ac_cv_func_strnicmp="yes"
6639 ac_cv_func_strnicmp="no"
6644 dnl CURL_CHECK_FUNC_STRSTR
6645 dnl -------------------------------------------------
6646 dnl Verify if strstr is available, prototyped, and
6647 dnl can be compiled. If all of these are true, and
6648 dnl usage has not been previously disallowed with
6649 dnl shell variable curl_disallow_strstr, then
6650 dnl HAVE_STRSTR will be defined.
6652 AC_DEFUN([CURL_CHECK_FUNC_STRSTR], [
6653 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6655 tst_links_strstr="unknown"
6656 tst_proto_strstr="unknown"
6657 tst_compi_strstr="unknown"
6658 tst_allow_strstr="unknown"
6660 AC_MSG_CHECKING([if strstr can be linked])
6662 AC_LANG_FUNC_LINK_TRY([strstr])
6664 AC_MSG_RESULT([yes])
6665 tst_links_strstr="yes"
6668 tst_links_strstr="no"
6671 if test "$tst_links_strstr" = "yes"; then
6672 AC_MSG_CHECKING([if strstr is prototyped])
6673 AC_EGREP_CPP([strstr],[
6674 $curl_includes_string
6676 AC_MSG_RESULT([yes])
6677 tst_proto_strstr="yes"
6680 tst_proto_strstr="no"
6684 if test "$tst_proto_strstr" = "yes"; then
6685 AC_MSG_CHECKING([if strstr is compilable])
6688 $curl_includes_string
6690 if(0 != strstr(0, 0))
6694 AC_MSG_RESULT([yes])
6695 tst_compi_strstr="yes"
6698 tst_compi_strstr="no"
6702 if test "$tst_compi_strstr" = "yes"; then
6703 AC_MSG_CHECKING([if strstr usage allowed])
6704 if test "x$curl_disallow_strstr" != "xyes"; then
6705 AC_MSG_RESULT([yes])
6706 tst_allow_strstr="yes"
6709 tst_allow_strstr="no"
6713 AC_MSG_CHECKING([if strstr might be used])
6714 if test "$tst_links_strstr" = "yes" &&
6715 test "$tst_proto_strstr" = "yes" &&
6716 test "$tst_compi_strstr" = "yes" &&
6717 test "$tst_allow_strstr" = "yes"; then
6718 AC_MSG_RESULT([yes])
6719 AC_DEFINE_UNQUOTED(HAVE_STRSTR, 1,
6720 [Define to 1 if you have the strstr function.])
6721 ac_cv_func_strstr="yes"
6724 ac_cv_func_strstr="no"
6729 dnl CURL_CHECK_FUNC_STRTOK_R
6730 dnl -------------------------------------------------
6731 dnl Verify if strtok_r is available, prototyped, and
6732 dnl can be compiled. If all of these are true, and
6733 dnl usage has not been previously disallowed with
6734 dnl shell variable curl_disallow_strtok_r, then
6735 dnl HAVE_STRTOK_R will be defined.
6737 AC_DEFUN([CURL_CHECK_FUNC_STRTOK_R], [
6738 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6740 tst_links_strtok_r="unknown"
6741 tst_proto_strtok_r="unknown"
6742 tst_compi_strtok_r="unknown"
6743 tst_allow_strtok_r="unknown"
6745 AC_MSG_CHECKING([if strtok_r can be linked])
6747 AC_LANG_FUNC_LINK_TRY([strtok_r])
6749 AC_MSG_RESULT([yes])
6750 tst_links_strtok_r="yes"
6753 tst_links_strtok_r="no"
6756 if test "$tst_links_strtok_r" = "yes"; then
6757 AC_MSG_CHECKING([if strtok_r is prototyped])
6758 AC_EGREP_CPP([strtok_r],[
6759 $curl_includes_string
6761 AC_MSG_RESULT([yes])
6762 tst_proto_strtok_r="yes"
6765 tst_proto_strtok_r="no"
6769 if test "$tst_proto_strtok_r" = "yes"; then
6770 AC_MSG_CHECKING([if strtok_r is compilable])
6773 $curl_includes_string
6775 if(0 != strtok_r(0, 0, 0))
6779 AC_MSG_RESULT([yes])
6780 tst_compi_strtok_r="yes"
6783 tst_compi_strtok_r="no"
6787 if test "$tst_compi_strtok_r" = "yes"; then
6788 AC_MSG_CHECKING([if strtok_r usage allowed])
6789 if test "x$curl_disallow_strtok_r" != "xyes"; then
6790 AC_MSG_RESULT([yes])
6791 tst_allow_strtok_r="yes"
6794 tst_allow_strtok_r="no"
6798 AC_MSG_CHECKING([if strtok_r might be used])
6799 if test "$tst_links_strtok_r" = "yes" &&
6800 test "$tst_proto_strtok_r" = "yes" &&
6801 test "$tst_compi_strtok_r" = "yes" &&
6802 test "$tst_allow_strtok_r" = "yes"; then
6803 AC_MSG_RESULT([yes])
6804 AC_DEFINE_UNQUOTED(HAVE_STRTOK_R, 1,
6805 [Define to 1 if you have the strtok_r function.])
6806 ac_cv_func_strtok_r="yes"
6809 ac_cv_func_strtok_r="no"
6814 dnl CURL_CHECK_FUNC_STRTOLL
6815 dnl -------------------------------------------------
6816 dnl Verify if strtoll is available, prototyped, and
6817 dnl can be compiled. If all of these are true, and
6818 dnl usage has not been previously disallowed with
6819 dnl shell variable curl_disallow_strtoll, then
6820 dnl HAVE_STRTOLL will be defined.
6822 AC_DEFUN([CURL_CHECK_FUNC_STRTOLL], [
6823 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
6825 tst_links_strtoll="unknown"
6826 tst_proto_strtoll="unknown"
6827 tst_compi_strtoll="unknown"
6828 tst_allow_strtoll="unknown"
6830 AC_MSG_CHECKING([if strtoll can be linked])
6832 AC_LANG_FUNC_LINK_TRY([strtoll])
6834 AC_MSG_RESULT([yes])
6835 tst_links_strtoll="yes"
6838 tst_links_strtoll="no"
6841 if test "$tst_links_strtoll" = "yes"; then
6842 AC_MSG_CHECKING([if strtoll is prototyped])
6843 AC_EGREP_CPP([strtoll],[
6844 $curl_includes_stdlib
6846 AC_MSG_RESULT([yes])
6847 tst_proto_strtoll="yes"
6850 tst_proto_strtoll="no"
6854 if test "$tst_proto_strtoll" = "yes"; then
6855 AC_MSG_CHECKING([if strtoll is compilable])
6858 $curl_includes_stdlib
6860 if(0 != strtoll(0, 0, 0))
6864 AC_MSG_RESULT([yes])
6865 tst_compi_strtoll="yes"
6868 tst_compi_strtoll="no"
6872 if test "$tst_compi_strtoll" = "yes"; then
6873 AC_MSG_CHECKING([if strtoll usage allowed])
6874 if test "x$curl_disallow_strtoll" != "xyes"; then
6875 AC_MSG_RESULT([yes])
6876 tst_allow_strtoll="yes"
6879 tst_allow_strtoll="no"
6883 AC_MSG_CHECKING([if strtoll might be used])
6884 if test "$tst_links_strtoll" = "yes" &&
6885 test "$tst_proto_strtoll" = "yes" &&
6886 test "$tst_compi_strtoll" = "yes" &&
6887 test "$tst_allow_strtoll" = "yes"; then
6888 AC_MSG_RESULT([yes])
6889 AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
6890 [Define to 1 if you have the strtoll function.])
6891 ac_cv_func_strtoll="yes"
6894 ac_cv_func_strtoll="no"
6899 dnl CURL_CHECK_FUNC_WRITEV
6900 dnl -------------------------------------------------
6901 dnl Verify if writev is available, prototyped, and
6902 dnl can be compiled. If all of these are true, and
6903 dnl usage has not been previously disallowed with
6904 dnl shell variable curl_disallow_writev, then
6905 dnl HAVE_WRITEV will be defined.
6907 AC_DEFUN([CURL_CHECK_FUNC_WRITEV], [
6908 AC_REQUIRE([CURL_INCLUDES_SYS_UIO])dnl
6910 tst_links_writev="unknown"
6911 tst_proto_writev="unknown"
6912 tst_compi_writev="unknown"
6913 tst_allow_writev="unknown"
6915 AC_MSG_CHECKING([if writev can be linked])
6917 AC_LANG_FUNC_LINK_TRY([writev])
6919 AC_MSG_RESULT([yes])
6920 tst_links_writev="yes"
6923 tst_links_writev="no"
6926 if test "$tst_links_writev" = "yes"; then
6927 AC_MSG_CHECKING([if writev is prototyped])
6928 AC_EGREP_CPP([writev],[
6929 $curl_includes_sys_uio
6931 AC_MSG_RESULT([yes])
6932 tst_proto_writev="yes"
6935 tst_proto_writev="no"
6939 if test "$tst_proto_writev" = "yes"; then
6940 AC_MSG_CHECKING([if writev is compilable])
6943 $curl_includes_sys_uio
6945 if(0 != writev(0, 0, 0))
6949 AC_MSG_RESULT([yes])
6950 tst_compi_writev="yes"
6953 tst_compi_writev="no"
6957 if test "$tst_compi_writev" = "yes"; then
6958 AC_MSG_CHECKING([if writev usage allowed])
6959 if test "x$curl_disallow_writev" != "xyes"; then
6960 AC_MSG_RESULT([yes])
6961 tst_allow_writev="yes"
6964 tst_allow_writev="no"
6968 AC_MSG_CHECKING([if writev might be used])
6969 if test "$tst_links_writev" = "yes" &&
6970 test "$tst_proto_writev" = "yes" &&
6971 test "$tst_compi_writev" = "yes" &&
6972 test "$tst_allow_writev" = "yes"; then
6973 AC_MSG_RESULT([yes])
6974 AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1,
6975 [Define to 1 if you have the writev function.])
6976 ac_cv_func_writev="yes"
6979 ac_cv_func_writev="no"