1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2016, 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 https://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>
47 #ifdef HAVE_WINSOCK2_H
53 sys/types.h sys/socket.h netinet/in.h arpa/inet.h,
54 [], [], [$curl_includes_arpa_inet])
58 dnl CURL_INCLUDES_FCNTL
59 dnl -------------------------------------------------
60 dnl Set up variable with list of headers that must be
61 dnl included when fcntl.h is to be included.
63 AC_DEFUN([CURL_INCLUDES_FCNTL], [
64 curl_includes_fcntl="\
66 #ifdef HAVE_SYS_TYPES_H
67 # include <sys/types.h>
77 sys/types.h unistd.h fcntl.h,
78 [], [], [$curl_includes_fcntl])
82 dnl CURL_INCLUDES_IFADDRS
83 dnl -------------------------------------------------
84 dnl Set up variable with list of headers that must be
85 dnl included when ifaddrs.h is to be included.
87 AC_DEFUN([CURL_INCLUDES_IFADDRS], [
88 curl_includes_ifaddrs="\
90 #ifdef HAVE_SYS_TYPES_H
91 # include <sys/types.h>
93 #ifdef HAVE_SYS_SOCKET_H
94 # include <sys/socket.h>
96 #ifdef HAVE_NETINET_IN_H
97 # include <netinet/in.h>
100 # include <ifaddrs.h>
104 sys/types.h sys/socket.h netinet/in.h ifaddrs.h,
105 [], [], [$curl_includes_ifaddrs])
109 dnl CURL_INCLUDES_INTTYPES
110 dnl -------------------------------------------------
111 dnl Set up variable with list of headers that must be
112 dnl included when inttypes.h is to be included.
114 AC_DEFUN([CURL_INCLUDES_INTTYPES], [
115 curl_includes_inttypes="\
117 #ifdef HAVE_SYS_TYPES_H
118 # include <sys/types.h>
123 #ifdef HAVE_INTTYPES_H
124 # include <inttypes.h>
129 ac_cv_header_stdint_h="no"
133 sys/types.h stdint.h inttypes.h,
134 [], [], [$curl_includes_inttypes])
138 dnl CURL_INCLUDES_LIBGEN
139 dnl -------------------------------------------------
140 dnl Set up variable with list of headers that must be
141 dnl included when libgen.h is to be included.
143 AC_DEFUN([CURL_INCLUDES_LIBGEN], [
144 curl_includes_libgen="\
146 #ifdef HAVE_SYS_TYPES_H
147 # include <sys/types.h>
154 sys/types.h libgen.h,
155 [], [], [$curl_includes_libgen])
159 dnl CURL_INCLUDES_NETDB
160 dnl -------------------------------------------------
161 dnl Set up variable with list of headers that must be
162 dnl included when netdb.h is to be included.
164 AC_DEFUN([CURL_INCLUDES_NETDB], [
165 curl_includes_netdb="\
167 #ifdef HAVE_SYS_TYPES_H
168 # include <sys/types.h>
176 [], [], [$curl_includes_netdb])
180 dnl CURL_INCLUDES_POLL
181 dnl -------------------------------------------------
182 dnl Set up variable with list of headers that must be
183 dnl included when poll.h is to be included.
185 AC_DEFUN([CURL_INCLUDES_POLL], [
186 curl_includes_poll="\
188 #ifdef HAVE_SYS_TYPES_H
189 # include <sys/types.h>
194 #ifdef HAVE_SYS_POLL_H
195 # include <sys/poll.h>
199 sys/types.h poll.h sys/poll.h,
200 [], [], [$curl_includes_poll])
204 dnl CURL_INCLUDES_SETJMP
205 dnl -------------------------------------------------
206 dnl Set up variable with list of headers that must be
207 dnl included when setjmp.h is to be included.
209 AC_DEFUN([CURL_INCLUDES_SETJMP], [
210 curl_includes_setjmp="\
212 #ifdef HAVE_SYS_TYPES_H
213 # include <sys/types.h>
220 sys/types.h setjmp.h,
221 [], [], [$curl_includes_setjmp])
225 dnl CURL_INCLUDES_SIGNAL
226 dnl -------------------------------------------------
227 dnl Set up variable with list of headers that must be
228 dnl included when signal.h is to be included.
230 AC_DEFUN([CURL_INCLUDES_SIGNAL], [
231 curl_includes_signal="\
233 #ifdef HAVE_SYS_TYPES_H
234 # include <sys/types.h>
241 sys/types.h signal.h,
242 [], [], [$curl_includes_signal])
246 dnl CURL_INCLUDES_SOCKET
247 dnl -------------------------------------------------
248 dnl Set up variable with list of headers that must be
249 dnl included when socket.h is to be included.
251 AC_DEFUN([CURL_INCLUDES_SOCKET], [
252 curl_includes_socket="\
254 #ifdef HAVE_SYS_TYPES_H
255 # include <sys/types.h>
262 sys/types.h socket.h,
263 [], [], [$curl_includes_socket])
267 dnl CURL_INCLUDES_STDIO
268 dnl -------------------------------------------------
269 dnl Set up variable with list of headers that must be
270 dnl included when stdio.h is to be included.
272 AC_DEFUN([CURL_INCLUDES_STDIO], [
273 curl_includes_stdio="\
275 #ifdef HAVE_SYS_TYPES_H
276 # include <sys/types.h>
284 [], [], [$curl_includes_stdio])
288 dnl CURL_INCLUDES_STDLIB
289 dnl -------------------------------------------------
290 dnl Set up variable with list of headers that must be
291 dnl included when stdlib.h is to be included.
293 AC_DEFUN([CURL_INCLUDES_STDLIB], [
294 curl_includes_stdlib="\
296 #ifdef HAVE_SYS_TYPES_H
297 # include <sys/types.h>
304 sys/types.h stdlib.h,
305 [], [], [$curl_includes_stdlib])
309 dnl CURL_INCLUDES_STRING
310 dnl -------------------------------------------------
311 dnl Set up variable with list of headers that must be
312 dnl included when string(s).h is to be included.
314 AC_DEFUN([CURL_INCLUDES_STRING], [
315 curl_includes_string="\
317 #ifdef HAVE_SYS_TYPES_H
318 # include <sys/types.h>
323 #ifdef HAVE_STRINGS_H
324 # include <strings.h>
328 sys/types.h string.h strings.h,
329 [], [], [$curl_includes_string])
333 dnl CURL_INCLUDES_STROPTS
334 dnl -------------------------------------------------
335 dnl Set up variable with list of headers that must be
336 dnl included when stropts.h is to be included.
338 AC_DEFUN([CURL_INCLUDES_STROPTS], [
339 curl_includes_stropts="\
341 #ifdef HAVE_SYS_TYPES_H
342 # include <sys/types.h>
347 #ifdef HAVE_SYS_SOCKET_H
348 # include <sys/socket.h>
350 #ifdef HAVE_SYS_IOCTL_H
351 # include <sys/ioctl.h>
353 #ifdef HAVE_STROPTS_H
354 # include <stropts.h>
358 sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h,
359 [], [], [$curl_includes_stropts])
363 dnl CURL_INCLUDES_SYS_SOCKET
364 dnl -------------------------------------------------
365 dnl Set up variable with list of headers that must be
366 dnl included when sys/socket.h is to be included.
368 AC_DEFUN([CURL_INCLUDES_SYS_SOCKET], [
369 curl_includes_sys_socket="\
371 #ifdef HAVE_SYS_TYPES_H
372 # include <sys/types.h>
374 #ifdef HAVE_SYS_SOCKET_H
375 # include <sys/socket.h>
379 sys/types.h sys/socket.h,
380 [], [], [$curl_includes_sys_socket])
384 dnl CURL_INCLUDES_SYS_TYPES
385 dnl -------------------------------------------------
386 dnl Set up variable with list of headers that must be
387 dnl included when sys/types.h is to be included.
389 AC_DEFUN([CURL_INCLUDES_SYS_TYPES], [
390 curl_includes_sys_types="\
392 #ifdef HAVE_SYS_TYPES_H
393 # include <sys/types.h>
398 [], [], [$curl_includes_sys_types])
402 dnl CURL_INCLUDES_SYS_UIO
403 dnl -------------------------------------------------
404 dnl Set up variable with list of headers that must be
405 dnl included when sys/uio.h is to be included.
407 AC_DEFUN([CURL_INCLUDES_SYS_UIO], [
408 curl_includes_sys_uio="\
410 #ifdef HAVE_SYS_TYPES_H
411 # include <sys/types.h>
413 #ifdef HAVE_SYS_UIO_H
414 # include <sys/uio.h>
418 sys/types.h sys/uio.h,
419 [], [], [$curl_includes_sys_uio])
423 dnl CURL_INCLUDES_SYS_XATTR
424 dnl -------------------------------------------------
425 dnl Set up variable with list of headers that must be
426 dnl included when sys/xattr.h is to be included.
428 AC_DEFUN([CURL_INCLUDES_SYS_XATTR], [
429 curl_includes_sys_xattr="\
431 #ifdef HAVE_SYS_TYPES_H
432 # include <sys/types.h>
434 #ifdef HAVE_SYS_XATTR_H
435 # include <sys/xattr.h>
439 sys/types.h sys/xattr.h,
440 [], [], [$curl_includes_sys_xattr])
443 dnl CURL_INCLUDES_TIME
444 dnl -------------------------------------------------
445 dnl Set up variable with list of headers that must be
446 dnl included when time.h is to be included.
448 AC_DEFUN([CURL_INCLUDES_TIME], [
449 AC_REQUIRE([AC_HEADER_TIME])dnl
450 curl_includes_time="\
452 #ifdef HAVE_SYS_TYPES_H
453 # include <sys/types.h>
455 #ifdef HAVE_SYS_TIME_H
456 # include <sys/time.h>
457 # ifdef TIME_WITH_SYS_TIME
467 sys/types.h sys/time.h time.h,
468 [], [], [$curl_includes_time])
472 dnl CURL_INCLUDES_UNISTD
473 dnl -------------------------------------------------
474 dnl Set up variable with list of headers that must be
475 dnl included when unistd.h is to be included.
477 AC_DEFUN([CURL_INCLUDES_UNISTD], [
478 curl_includes_unistd="\
480 #ifdef HAVE_SYS_TYPES_H
481 # include <sys/types.h>
488 sys/types.h unistd.h,
489 [], [], [$curl_includes_unistd])
493 dnl CURL_INCLUDES_WINSOCK2
494 dnl -------------------------------------------------
495 dnl Set up variable with list of headers that must be
496 dnl included when winsock(2).h is to be included.
498 AC_DEFUN([CURL_INCLUDES_WINSOCK2], [
499 curl_includes_winsock2="\
501 #ifdef HAVE_WINDOWS_H
502 # ifndef WIN32_LEAN_AND_MEAN
503 # define WIN32_LEAN_AND_MEAN
505 # include <windows.h>
506 # ifdef HAVE_WINSOCK2_H
507 # include <winsock2.h>
509 # ifdef HAVE_WINSOCK_H
510 # include <winsock.h>
515 CURL_CHECK_HEADER_WINDOWS
516 CURL_CHECK_HEADER_WINSOCK
517 CURL_CHECK_HEADER_WINSOCK2
521 dnl CURL_INCLUDES_WS2TCPIP
522 dnl -------------------------------------------------
523 dnl Set up variable with list of headers that must be
524 dnl included when ws2tcpip.h is to be included.
526 AC_DEFUN([CURL_INCLUDES_WS2TCPIP], [
527 curl_includes_ws2tcpip="\
529 #ifdef HAVE_WINDOWS_H
530 # ifndef WIN32_LEAN_AND_MEAN
531 # define WIN32_LEAN_AND_MEAN
533 # include <windows.h>
534 # ifdef HAVE_WINSOCK2_H
535 # include <winsock2.h>
536 # ifdef HAVE_WS2TCPIP_H
537 # include <ws2tcpip.h>
542 CURL_CHECK_HEADER_WINDOWS
543 CURL_CHECK_HEADER_WINSOCK2
544 CURL_CHECK_HEADER_WS2TCPIP
548 dnl CURL_PREPROCESS_CALLCONV
549 dnl -------------------------------------------------
550 dnl Set up variable with a preprocessor block which
551 dnl defines function calling convention.
553 AC_DEFUN([CURL_PREPROCESS_CALLCONV], [
554 curl_preprocess_callconv="\
555 /* preprocess start */
556 #ifdef HAVE_WINDOWS_H
557 # define FUNCALLCONV __stdcall
561 /* preprocess end */"
565 dnl CURL_CHECK_FUNC_ALARM
566 dnl -------------------------------------------------
567 dnl Verify if alarm is available, prototyped, and
568 dnl can be compiled. If all of these are true, and
569 dnl usage has not been previously disallowed with
570 dnl shell variable curl_disallow_alarm, then
571 dnl HAVE_ALARM will be defined.
573 AC_DEFUN([CURL_CHECK_FUNC_ALARM], [
574 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
576 tst_links_alarm="unknown"
577 tst_proto_alarm="unknown"
578 tst_compi_alarm="unknown"
579 tst_allow_alarm="unknown"
581 AC_MSG_CHECKING([if alarm can be linked])
583 AC_LANG_FUNC_LINK_TRY([alarm])
586 tst_links_alarm="yes"
592 if test "$tst_links_alarm" = "yes"; then
593 AC_MSG_CHECKING([if alarm is prototyped])
594 AC_EGREP_CPP([alarm],[
595 $curl_includes_unistd
598 tst_proto_alarm="yes"
605 if test "$tst_proto_alarm" = "yes"; then
606 AC_MSG_CHECKING([if alarm is compilable])
609 $curl_includes_unistd
616 tst_compi_alarm="yes"
623 if test "$tst_compi_alarm" = "yes"; then
624 AC_MSG_CHECKING([if alarm usage allowed])
625 if test "x$curl_disallow_alarm" != "xyes"; then
627 tst_allow_alarm="yes"
634 AC_MSG_CHECKING([if alarm might be used])
635 if test "$tst_links_alarm" = "yes" &&
636 test "$tst_proto_alarm" = "yes" &&
637 test "$tst_compi_alarm" = "yes" &&
638 test "$tst_allow_alarm" = "yes"; then
640 AC_DEFINE_UNQUOTED(HAVE_ALARM, 1,
641 [Define to 1 if you have the alarm function.])
642 curl_cv_func_alarm="yes"
645 curl_cv_func_alarm="no"
650 dnl CURL_CHECK_FUNC_BASENAME
651 dnl -------------------------------------------------
652 dnl Verify if basename is available, prototyped, and
653 dnl can be compiled. If all of these are true, and
654 dnl usage has not been previously disallowed with
655 dnl shell variable curl_disallow_basename, then
656 dnl HAVE_BASENAME will be defined.
658 AC_DEFUN([CURL_CHECK_FUNC_BASENAME], [
659 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
660 AC_REQUIRE([CURL_INCLUDES_LIBGEN])dnl
661 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
663 tst_links_basename="unknown"
664 tst_proto_basename="unknown"
665 tst_compi_basename="unknown"
666 tst_allow_basename="unknown"
668 AC_MSG_CHECKING([if basename can be linked])
670 AC_LANG_FUNC_LINK_TRY([basename])
673 tst_links_basename="yes"
676 tst_links_basename="no"
679 if test "$tst_links_basename" = "yes"; then
680 AC_MSG_CHECKING([if basename is prototyped])
681 AC_EGREP_CPP([basename],[
682 $curl_includes_string
683 $curl_includes_libgen
684 $curl_includes_unistd
687 tst_proto_basename="yes"
690 tst_proto_basename="no"
694 if test "$tst_proto_basename" = "yes"; then
695 AC_MSG_CHECKING([if basename is compilable])
698 $curl_includes_string
699 $curl_includes_libgen
700 $curl_includes_unistd
707 tst_compi_basename="yes"
710 tst_compi_basename="no"
714 if test "$tst_compi_basename" = "yes"; then
715 AC_MSG_CHECKING([if basename usage allowed])
716 if test "x$curl_disallow_basename" != "xyes"; then
718 tst_allow_basename="yes"
721 tst_allow_basename="no"
725 AC_MSG_CHECKING([if basename might be used])
726 if test "$tst_links_basename" = "yes" &&
727 test "$tst_proto_basename" = "yes" &&
728 test "$tst_compi_basename" = "yes" &&
729 test "$tst_allow_basename" = "yes"; then
731 AC_DEFINE_UNQUOTED(HAVE_BASENAME, 1,
732 [Define to 1 if you have the basename function.])
733 curl_cv_func_basename="yes"
736 curl_cv_func_basename="no"
741 dnl CURL_CHECK_FUNC_CLOSESOCKET
742 dnl -------------------------------------------------
743 dnl Verify if closesocket is available, prototyped, and
744 dnl can be compiled. If all of these are true, and
745 dnl usage has not been previously disallowed with
746 dnl shell variable curl_disallow_closesocket, then
747 dnl HAVE_CLOSESOCKET will be defined.
749 AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [
750 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
751 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
753 tst_links_closesocket="unknown"
754 tst_proto_closesocket="unknown"
755 tst_compi_closesocket="unknown"
756 tst_allow_closesocket="unknown"
758 AC_MSG_CHECKING([if closesocket can be linked])
761 $curl_includes_winsock2
762 $curl_includes_socket
764 if(0 != closesocket(0))
769 tst_links_closesocket="yes"
772 tst_links_closesocket="no"
775 if test "$tst_links_closesocket" = "yes"; then
776 AC_MSG_CHECKING([if closesocket is prototyped])
777 AC_EGREP_CPP([closesocket],[
778 $curl_includes_winsock2
779 $curl_includes_socket
782 tst_proto_closesocket="yes"
785 tst_proto_closesocket="no"
789 if test "$tst_proto_closesocket" = "yes"; then
790 AC_MSG_CHECKING([if closesocket is compilable])
793 $curl_includes_winsock2
794 $curl_includes_socket
796 if(0 != closesocket(0))
801 tst_compi_closesocket="yes"
804 tst_compi_closesocket="no"
808 if test "$tst_compi_closesocket" = "yes"; then
809 AC_MSG_CHECKING([if closesocket usage allowed])
810 if test "x$curl_disallow_closesocket" != "xyes"; then
812 tst_allow_closesocket="yes"
815 tst_allow_closesocket="no"
819 AC_MSG_CHECKING([if closesocket might be used])
820 if test "$tst_links_closesocket" = "yes" &&
821 test "$tst_proto_closesocket" = "yes" &&
822 test "$tst_compi_closesocket" = "yes" &&
823 test "$tst_allow_closesocket" = "yes"; then
825 AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1,
826 [Define to 1 if you have the closesocket function.])
827 curl_cv_func_closesocket="yes"
830 curl_cv_func_closesocket="no"
835 dnl CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
836 dnl -------------------------------------------------
837 dnl Verify if CloseSocket is available, prototyped, and
838 dnl can be compiled. If all of these are true, and
839 dnl usage has not been previously disallowed with
840 dnl shell variable curl_disallow_closesocket_camel,
841 dnl then HAVE_CLOSESOCKET_CAMEL will be defined.
843 AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
844 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
846 tst_links_closesocket_camel="unknown"
847 tst_proto_closesocket_camel="unknown"
848 tst_compi_closesocket_camel="unknown"
849 tst_allow_closesocket_camel="unknown"
851 AC_MSG_CHECKING([if CloseSocket can be linked])
854 $curl_includes_sys_socket
856 if(0 != CloseSocket(0))
861 tst_links_closesocket_camel="yes"
864 tst_links_closesocket_camel="no"
867 if test "$tst_links_closesocket_camel" = "yes"; then
868 AC_MSG_CHECKING([if CloseSocket is prototyped])
869 AC_EGREP_CPP([CloseSocket],[
870 $curl_includes_sys_socket
873 tst_proto_closesocket_camel="yes"
876 tst_proto_closesocket_camel="no"
880 if test "$tst_proto_closesocket_camel" = "yes"; then
881 AC_MSG_CHECKING([if CloseSocket is compilable])
884 $curl_includes_sys_socket
886 if(0 != CloseSocket(0))
891 tst_compi_closesocket_camel="yes"
894 tst_compi_closesocket_camel="no"
898 if test "$tst_compi_closesocket_camel" = "yes"; then
899 AC_MSG_CHECKING([if CloseSocket usage allowed])
900 if test "x$curl_disallow_closesocket_camel" != "xyes"; then
902 tst_allow_closesocket_camel="yes"
905 tst_allow_closesocket_camel="no"
909 AC_MSG_CHECKING([if CloseSocket might be used])
910 if test "$tst_links_closesocket_camel" = "yes" &&
911 test "$tst_proto_closesocket_camel" = "yes" &&
912 test "$tst_compi_closesocket_camel" = "yes" &&
913 test "$tst_allow_closesocket_camel" = "yes"; then
915 AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1,
916 [Define to 1 if you have the CloseSocket camel case function.])
917 curl_cv_func_closesocket_camel="yes"
920 curl_cv_func_closesocket_camel="no"
925 dnl CURL_CHECK_FUNC_CONNECT
926 dnl -------------------------------------------------
927 dnl Verify if connect is available, prototyped, and
928 dnl can be compiled. If all of these are true, and
929 dnl usage has not been previously disallowed with
930 dnl shell variable curl_disallow_connect, then
931 dnl HAVE_CONNECT will be defined.
933 AC_DEFUN([CURL_CHECK_FUNC_CONNECT], [
934 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
935 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
936 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
938 tst_links_connect="unknown"
939 tst_proto_connect="unknown"
940 tst_compi_connect="unknown"
941 tst_allow_connect="unknown"
943 AC_MSG_CHECKING([if connect can be linked])
946 $curl_includes_winsock2
947 $curl_includes_sys_socket
948 $curl_includes_socket
950 if(0 != connect(0, 0, 0))
955 tst_links_connect="yes"
958 tst_links_connect="no"
961 if test "$tst_links_connect" = "yes"; then
962 AC_MSG_CHECKING([if connect is prototyped])
963 AC_EGREP_CPP([connect],[
964 $curl_includes_winsock2
965 $curl_includes_sys_socket
966 $curl_includes_socket
969 tst_proto_connect="yes"
972 tst_proto_connect="no"
976 if test "$tst_proto_connect" = "yes"; then
977 AC_MSG_CHECKING([if connect is compilable])
980 $curl_includes_winsock2
981 $curl_includes_sys_socket
982 $curl_includes_socket
984 if(0 != connect(0, 0, 0))
989 tst_compi_connect="yes"
992 tst_compi_connect="no"
996 if test "$tst_compi_connect" = "yes"; then
997 AC_MSG_CHECKING([if connect usage allowed])
998 if test "x$curl_disallow_connect" != "xyes"; then
1000 tst_allow_connect="yes"
1003 tst_allow_connect="no"
1007 AC_MSG_CHECKING([if connect might be used])
1008 if test "$tst_links_connect" = "yes" &&
1009 test "$tst_proto_connect" = "yes" &&
1010 test "$tst_compi_connect" = "yes" &&
1011 test "$tst_allow_connect" = "yes"; then
1012 AC_MSG_RESULT([yes])
1013 AC_DEFINE_UNQUOTED(HAVE_CONNECT, 1,
1014 [Define to 1 if you have the connect function.])
1015 curl_cv_func_connect="yes"
1018 curl_cv_func_connect="no"
1023 dnl CURL_CHECK_FUNC_FCNTL
1024 dnl -------------------------------------------------
1025 dnl Verify if fcntl is available, prototyped, and
1026 dnl can be compiled. If all of these are true, and
1027 dnl usage has not been previously disallowed with
1028 dnl shell variable curl_disallow_fcntl, then
1029 dnl HAVE_FCNTL will be defined.
1031 AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [
1032 AC_REQUIRE([CURL_INCLUDES_FCNTL])dnl
1034 tst_links_fcntl="unknown"
1035 tst_proto_fcntl="unknown"
1036 tst_compi_fcntl="unknown"
1037 tst_allow_fcntl="unknown"
1039 AC_MSG_CHECKING([if fcntl can be linked])
1041 AC_LANG_FUNC_LINK_TRY([fcntl])
1043 AC_MSG_RESULT([yes])
1044 tst_links_fcntl="yes"
1047 tst_links_fcntl="no"
1050 if test "$tst_links_fcntl" = "yes"; then
1051 AC_MSG_CHECKING([if fcntl is prototyped])
1052 AC_EGREP_CPP([fcntl],[
1053 $curl_includes_fcntl
1055 AC_MSG_RESULT([yes])
1056 tst_proto_fcntl="yes"
1059 tst_proto_fcntl="no"
1063 if test "$tst_proto_fcntl" = "yes"; then
1064 AC_MSG_CHECKING([if fcntl is compilable])
1067 $curl_includes_fcntl
1069 if(0 != fcntl(0, 0, 0))
1073 AC_MSG_RESULT([yes])
1074 tst_compi_fcntl="yes"
1077 tst_compi_fcntl="no"
1081 if test "$tst_compi_fcntl" = "yes"; then
1082 AC_MSG_CHECKING([if fcntl usage allowed])
1083 if test "x$curl_disallow_fcntl" != "xyes"; then
1084 AC_MSG_RESULT([yes])
1085 tst_allow_fcntl="yes"
1088 tst_allow_fcntl="no"
1092 AC_MSG_CHECKING([if fcntl might be used])
1093 if test "$tst_links_fcntl" = "yes" &&
1094 test "$tst_proto_fcntl" = "yes" &&
1095 test "$tst_compi_fcntl" = "yes" &&
1096 test "$tst_allow_fcntl" = "yes"; then
1097 AC_MSG_RESULT([yes])
1098 AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1,
1099 [Define to 1 if you have the fcntl function.])
1100 curl_cv_func_fcntl="yes"
1101 CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
1104 curl_cv_func_fcntl="no"
1109 dnl CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
1110 dnl -------------------------------------------------
1111 dnl Verify if fcntl with status flag O_NONBLOCK is
1112 dnl available, can be compiled, and seems to work. If
1113 dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK
1114 dnl will be defined.
1116 AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [
1118 tst_compi_fcntl_o_nonblock="unknown"
1119 tst_allow_fcntl_o_nonblock="unknown"
1122 sunos4* | aix3* | beos*)
1123 dnl O_NONBLOCK does not work on these platforms
1124 curl_disallow_fcntl_o_nonblock="yes"
1128 if test "$curl_cv_func_fcntl" = "yes"; then
1129 AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable])
1132 $curl_includes_fcntl
1135 if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
1139 AC_MSG_RESULT([yes])
1140 tst_compi_fcntl_o_nonblock="yes"
1143 tst_compi_fcntl_o_nonblock="no"
1147 if test "$tst_compi_fcntl_o_nonblock" = "yes"; then
1148 AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed])
1149 if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then
1150 AC_MSG_RESULT([yes])
1151 tst_allow_fcntl_o_nonblock="yes"
1154 tst_allow_fcntl_o_nonblock="no"
1158 AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used])
1159 if test "$tst_compi_fcntl_o_nonblock" = "yes" &&
1160 test "$tst_allow_fcntl_o_nonblock" = "yes"; then
1161 AC_MSG_RESULT([yes])
1162 AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1,
1163 [Define to 1 if you have a working fcntl O_NONBLOCK function.])
1164 curl_cv_func_fcntl_o_nonblock="yes"
1167 curl_cv_func_fcntl_o_nonblock="no"
1172 dnl CURL_CHECK_FUNC_FDOPEN
1173 dnl -------------------------------------------------
1174 dnl Verify if fdopen is available, prototyped, and
1175 dnl can be compiled. If all of these are true, and
1176 dnl usage has not been previously disallowed with
1177 dnl shell variable curl_disallow_fdopen, then
1178 dnl HAVE_FDOPEN will be defined.
1180 AC_DEFUN([CURL_CHECK_FUNC_FDOPEN], [
1181 AC_REQUIRE([CURL_INCLUDES_STDIO])dnl
1183 tst_links_fdopen="unknown"
1184 tst_proto_fdopen="unknown"
1185 tst_compi_fdopen="unknown"
1186 tst_allow_fdopen="unknown"
1188 AC_MSG_CHECKING([if fdopen can be linked])
1190 AC_LANG_FUNC_LINK_TRY([fdopen])
1192 AC_MSG_RESULT([yes])
1193 tst_links_fdopen="yes"
1196 tst_links_fdopen="no"
1199 if test "$tst_links_fdopen" = "yes"; then
1200 AC_MSG_CHECKING([if fdopen is prototyped])
1201 AC_EGREP_CPP([fdopen],[
1202 $curl_includes_stdio
1204 AC_MSG_RESULT([yes])
1205 tst_proto_fdopen="yes"
1208 tst_proto_fdopen="no"
1212 if test "$tst_proto_fdopen" = "yes"; then
1213 AC_MSG_CHECKING([if fdopen is compilable])
1216 $curl_includes_stdio
1218 if(0 != fdopen(0, 0))
1222 AC_MSG_RESULT([yes])
1223 tst_compi_fdopen="yes"
1226 tst_compi_fdopen="no"
1230 if test "$tst_compi_fdopen" = "yes"; then
1231 AC_MSG_CHECKING([if fdopen usage allowed])
1232 if test "x$curl_disallow_fdopen" != "xyes"; then
1233 AC_MSG_RESULT([yes])
1234 tst_allow_fdopen="yes"
1237 tst_allow_fdopen="no"
1241 AC_MSG_CHECKING([if fdopen might be used])
1242 if test "$tst_links_fdopen" = "yes" &&
1243 test "$tst_proto_fdopen" = "yes" &&
1244 test "$tst_compi_fdopen" = "yes" &&
1245 test "$tst_allow_fdopen" = "yes"; then
1246 AC_MSG_RESULT([yes])
1247 AC_DEFINE_UNQUOTED(HAVE_FDOPEN, 1,
1248 [Define to 1 if you have the fdopen function.])
1249 curl_cv_func_fdopen="yes"
1252 curl_cv_func_fdopen="no"
1257 dnl CURL_CHECK_FUNC_FGETXATTR
1258 dnl -------------------------------------------------
1259 dnl Verify if fgetxattr is available, prototyped, and
1260 dnl can be compiled. If all of these are true, and
1261 dnl usage has not been previously disallowed with
1262 dnl shell variable curl_disallow_fgetxattr, then
1263 dnl HAVE_FGETXATTR will be defined.
1265 AC_DEFUN([CURL_CHECK_FUNC_FGETXATTR], [
1266 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1268 tst_links_fgetxattr="unknown"
1269 tst_proto_fgetxattr="unknown"
1270 tst_compi_fgetxattr="unknown"
1271 tst_allow_fgetxattr="unknown"
1272 tst_nargs_fgetxattr="unknown"
1274 AC_MSG_CHECKING([if fgetxattr can be linked])
1276 AC_LANG_FUNC_LINK_TRY([fgetxattr])
1278 AC_MSG_RESULT([yes])
1279 tst_links_fgetxattr="yes"
1282 tst_links_fgetxattr="no"
1285 if test "$tst_links_fgetxattr" = "yes"; then
1286 AC_MSG_CHECKING([if fgetxattr is prototyped])
1287 AC_EGREP_CPP([fgetxattr],[
1288 $curl_includes_sys_xattr
1290 AC_MSG_RESULT([yes])
1291 tst_proto_fgetxattr="yes"
1294 tst_proto_fgetxattr="no"
1298 if test "$tst_proto_fgetxattr" = "yes"; then
1299 if test "$tst_nargs_fgetxattr" = "unknown"; then
1300 AC_MSG_CHECKING([if fgetxattr takes 4 args.])
1303 $curl_includes_sys_xattr
1305 if(0 != fgetxattr(0, 0, 0, 0))
1309 AC_MSG_RESULT([yes])
1310 tst_compi_fgetxattr="yes"
1311 tst_nargs_fgetxattr="4"
1314 tst_compi_fgetxattr="no"
1317 if test "$tst_nargs_fgetxattr" = "unknown"; then
1318 AC_MSG_CHECKING([if fgetxattr takes 6 args.])
1321 $curl_includes_sys_xattr
1323 if(0 != fgetxattr(0, 0, 0, 0, 0, 0))
1327 AC_MSG_RESULT([yes])
1328 tst_compi_fgetxattr="yes"
1329 tst_nargs_fgetxattr="6"
1332 tst_compi_fgetxattr="no"
1335 AC_MSG_CHECKING([if fgetxattr is compilable])
1336 if test "$tst_compi_fgetxattr" = "yes"; then
1337 AC_MSG_RESULT([yes])
1343 if test "$tst_compi_fgetxattr" = "yes"; then
1344 AC_MSG_CHECKING([if fgetxattr usage allowed])
1345 if test "x$curl_disallow_fgetxattr" != "xyes"; then
1346 AC_MSG_RESULT([yes])
1347 tst_allow_fgetxattr="yes"
1350 tst_allow_fgetxattr="no"
1354 AC_MSG_CHECKING([if fgetxattr might be used])
1355 if test "$tst_links_fgetxattr" = "yes" &&
1356 test "$tst_proto_fgetxattr" = "yes" &&
1357 test "$tst_compi_fgetxattr" = "yes" &&
1358 test "$tst_allow_fgetxattr" = "yes"; then
1359 AC_MSG_RESULT([yes])
1360 AC_DEFINE_UNQUOTED(HAVE_FGETXATTR, 1,
1361 [Define to 1 if you have the fgetxattr function.])
1362 dnl AC_DEFINE_UNQUOTED(FGETXATTR_ARGS, $tst_nargs_fgetxattr,
1363 dnl [Specifies the number of arguments to fgetxattr])
1365 if test "$tst_nargs_fgetxattr" -eq "4"; then
1366 AC_DEFINE(HAVE_FGETXATTR_4, 1, [fgetxattr() takes 4 args])
1367 elif test "$tst_nargs_fgetxattr" -eq "6"; then
1368 AC_DEFINE(HAVE_FGETXATTR_6, 1, [fgetxattr() takes 6 args])
1371 curl_cv_func_fgetxattr="yes"
1374 curl_cv_func_fgetxattr="no"
1379 dnl CURL_CHECK_FUNC_FLISTXATTR
1380 dnl -------------------------------------------------
1381 dnl Verify if flistxattr is available, prototyped, and
1382 dnl can be compiled. If all of these are true, and
1383 dnl usage has not been previously disallowed with
1384 dnl shell variable curl_disallow_flistxattr, then
1385 dnl HAVE_FLISTXATTR will be defined.
1387 AC_DEFUN([CURL_CHECK_FUNC_FLISTXATTR], [
1388 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1390 tst_links_flistxattr="unknown"
1391 tst_proto_flistxattr="unknown"
1392 tst_compi_flistxattr="unknown"
1393 tst_allow_flistxattr="unknown"
1394 tst_nargs_flistxattr="unknown"
1396 AC_MSG_CHECKING([if flistxattr can be linked])
1398 AC_LANG_FUNC_LINK_TRY([flistxattr])
1400 AC_MSG_RESULT([yes])
1401 tst_links_flistxattr="yes"
1404 tst_links_flistxattr="no"
1407 if test "$tst_links_flistxattr" = "yes"; then
1408 AC_MSG_CHECKING([if flistxattr is prototyped])
1409 AC_EGREP_CPP([flistxattr],[
1410 $curl_includes_sys_xattr
1412 AC_MSG_RESULT([yes])
1413 tst_proto_flistxattr="yes"
1416 tst_proto_flistxattr="no"
1420 if test "$tst_proto_flistxattr" = "yes"; then
1421 if test "$tst_nargs_flistxattr" = "unknown"; then
1422 AC_MSG_CHECKING([if flistxattr takes 3 args.])
1425 $curl_includes_sys_xattr
1427 if(0 != flistxattr(0, 0, 0))
1431 AC_MSG_RESULT([yes])
1432 tst_compi_flistxattr="yes"
1433 tst_nargs_flistxattr="3"
1436 tst_compi_flistxattr="no"
1439 if test "$tst_nargs_flistxattr" = "unknown"; then
1440 AC_MSG_CHECKING([if flistxattr takes 4 args.])
1443 $curl_includes_sys_xattr
1445 if(0 != flistxattr(0, 0, 0, 0))
1449 AC_MSG_RESULT([yes])
1450 tst_compi_flistxattr="yes"
1451 tst_nargs_flistxattr="4"
1454 tst_compi_flistxattr="no"
1457 AC_MSG_CHECKING([if flistxattr is compilable])
1458 if test "$tst_compi_flistxattr" = "yes"; then
1459 AC_MSG_RESULT([yes])
1465 if test "$tst_compi_flistxattr" = "yes"; then
1466 AC_MSG_CHECKING([if flistxattr usage allowed])
1467 if test "x$curl_disallow_flistxattr" != "xyes"; then
1468 AC_MSG_RESULT([yes])
1469 tst_allow_flistxattr="yes"
1472 tst_allow_flistxattr="no"
1476 AC_MSG_CHECKING([if flistxattr might be used])
1477 if test "$tst_links_flistxattr" = "yes" &&
1478 test "$tst_proto_flistxattr" = "yes" &&
1479 test "$tst_compi_flistxattr" = "yes" &&
1480 test "$tst_allow_flistxattr" = "yes"; then
1481 AC_MSG_RESULT([yes])
1482 AC_DEFINE_UNQUOTED(HAVE_FLISTXATTR, 1,
1483 [Define to 1 if you have the flistxattr function.])
1484 dnl AC_DEFINE_UNQUOTED(FLISTXATTR_ARGS, $tst_nargs_flistxattr,
1485 dnl [Specifies the number of arguments to flistxattr])
1487 if test "$tst_nargs_flistxattr" -eq "3"; then
1488 AC_DEFINE(HAVE_FLISTXATTR_3, 1, [flistxattr() takes 3 args])
1489 elif test "$tst_nargs_flistxattr" -eq "4"; then
1490 AC_DEFINE(HAVE_FLISTXATTR_4, 1, [flistxattr() takes 4 args])
1493 curl_cv_func_flistxattr="yes"
1496 curl_cv_func_flistxattr="no"
1501 dnl CURL_CHECK_FUNC_FREEADDRINFO
1502 dnl -------------------------------------------------
1503 dnl Verify if freeaddrinfo is available, prototyped,
1504 dnl and can be compiled. If all of these are true,
1505 dnl and usage has not been previously disallowed with
1506 dnl shell variable curl_disallow_freeaddrinfo, then
1507 dnl HAVE_FREEADDRINFO will be defined.
1509 AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [
1510 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
1511 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
1512 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1514 tst_links_freeaddrinfo="unknown"
1515 tst_proto_freeaddrinfo="unknown"
1516 tst_compi_freeaddrinfo="unknown"
1517 tst_allow_freeaddrinfo="unknown"
1519 AC_MSG_CHECKING([if freeaddrinfo can be linked])
1522 $curl_includes_ws2tcpip
1523 $curl_includes_sys_socket
1524 $curl_includes_netdb
1529 AC_MSG_RESULT([yes])
1530 tst_links_freeaddrinfo="yes"
1533 tst_links_freeaddrinfo="no"
1536 if test "$tst_links_freeaddrinfo" = "yes"; then
1537 AC_MSG_CHECKING([if freeaddrinfo is prototyped])
1538 AC_EGREP_CPP([freeaddrinfo],[
1539 $curl_includes_ws2tcpip
1540 $curl_includes_sys_socket
1541 $curl_includes_netdb
1543 AC_MSG_RESULT([yes])
1544 tst_proto_freeaddrinfo="yes"
1547 tst_proto_freeaddrinfo="no"
1551 if test "$tst_proto_freeaddrinfo" = "yes"; then
1552 AC_MSG_CHECKING([if freeaddrinfo is compilable])
1555 $curl_includes_ws2tcpip
1556 $curl_includes_sys_socket
1557 $curl_includes_netdb
1562 AC_MSG_RESULT([yes])
1563 tst_compi_freeaddrinfo="yes"
1566 tst_compi_freeaddrinfo="no"
1570 if test "$tst_compi_freeaddrinfo" = "yes"; then
1571 AC_MSG_CHECKING([if freeaddrinfo usage allowed])
1572 if test "x$curl_disallow_freeaddrinfo" != "xyes"; then
1573 AC_MSG_RESULT([yes])
1574 tst_allow_freeaddrinfo="yes"
1577 tst_allow_freeaddrinfo="no"
1581 AC_MSG_CHECKING([if freeaddrinfo might be used])
1582 if test "$tst_links_freeaddrinfo" = "yes" &&
1583 test "$tst_proto_freeaddrinfo" = "yes" &&
1584 test "$tst_compi_freeaddrinfo" = "yes" &&
1585 test "$tst_allow_freeaddrinfo" = "yes"; then
1586 AC_MSG_RESULT([yes])
1587 AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
1588 [Define to 1 if you have the freeaddrinfo function.])
1589 curl_cv_func_freeaddrinfo="yes"
1592 curl_cv_func_freeaddrinfo="no"
1597 dnl CURL_CHECK_FUNC_FREEIFADDRS
1598 dnl -------------------------------------------------
1599 dnl Verify if freeifaddrs is available, prototyped, and
1600 dnl can be compiled. If all of these are true, and
1601 dnl usage has not been previously disallowed with
1602 dnl shell variable curl_disallow_freeifaddrs, then
1603 dnl HAVE_FREEIFADDRS will be defined.
1605 AC_DEFUN([CURL_CHECK_FUNC_FREEIFADDRS], [
1606 AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
1608 tst_links_freeifaddrs="unknown"
1609 tst_proto_freeifaddrs="unknown"
1610 tst_compi_freeifaddrs="unknown"
1611 tst_allow_freeifaddrs="unknown"
1613 AC_MSG_CHECKING([if freeifaddrs can be linked])
1615 AC_LANG_FUNC_LINK_TRY([freeifaddrs])
1617 AC_MSG_RESULT([yes])
1618 tst_links_freeifaddrs="yes"
1621 tst_links_freeifaddrs="no"
1624 if test "$tst_links_freeifaddrs" = "yes"; then
1625 AC_MSG_CHECKING([if freeifaddrs is prototyped])
1626 AC_EGREP_CPP([freeifaddrs],[
1627 $curl_includes_ifaddrs
1629 AC_MSG_RESULT([yes])
1630 tst_proto_freeifaddrs="yes"
1633 tst_proto_freeifaddrs="no"
1637 if test "$tst_proto_freeifaddrs" = "yes"; then
1638 AC_MSG_CHECKING([if freeifaddrs is compilable])
1641 $curl_includes_ifaddrs
1646 AC_MSG_RESULT([yes])
1647 tst_compi_freeifaddrs="yes"
1650 tst_compi_freeifaddrs="no"
1654 if test "$tst_compi_freeifaddrs" = "yes"; then
1655 AC_MSG_CHECKING([if freeifaddrs usage allowed])
1656 if test "x$curl_disallow_freeifaddrs" != "xyes"; then
1657 AC_MSG_RESULT([yes])
1658 tst_allow_freeifaddrs="yes"
1661 tst_allow_freeifaddrs="no"
1665 AC_MSG_CHECKING([if freeifaddrs might be used])
1666 if test "$tst_links_freeifaddrs" = "yes" &&
1667 test "$tst_proto_freeifaddrs" = "yes" &&
1668 test "$tst_compi_freeifaddrs" = "yes" &&
1669 test "$tst_allow_freeifaddrs" = "yes"; then
1670 AC_MSG_RESULT([yes])
1671 AC_DEFINE_UNQUOTED(HAVE_FREEIFADDRS, 1,
1672 [Define to 1 if you have the freeifaddrs function.])
1673 curl_cv_func_freeifaddrs="yes"
1676 curl_cv_func_freeifaddrs="no"
1681 dnl CURL_CHECK_FUNC_FREMOVEXATTR
1682 dnl -------------------------------------------------
1683 dnl Verify if fremovexattr is available, prototyped, and
1684 dnl can be compiled. If all of these are true, and
1685 dnl usage has not been previously disallowed with
1686 dnl shell variable curl_disallow_fremovexattr, then
1687 dnl HAVE_FREMOVEXATTR will be defined.
1689 AC_DEFUN([CURL_CHECK_FUNC_FREMOVEXATTR], [
1690 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1692 tst_links_fremovexattr="unknown"
1693 tst_proto_fremovexattr="unknown"
1694 tst_compi_fremovexattr="unknown"
1695 tst_allow_fremovexattr="unknown"
1696 tst_nargs_fremovexattr="unknown"
1698 AC_MSG_CHECKING([if fremovexattr can be linked])
1700 AC_LANG_FUNC_LINK_TRY([fremovexattr])
1702 AC_MSG_RESULT([yes])
1703 tst_links_fremovexattr="yes"
1706 tst_links_fremovexattr="no"
1709 if test "$tst_links_fremovexattr" = "yes"; then
1710 AC_MSG_CHECKING([if fremovexattr is prototyped])
1711 AC_EGREP_CPP([fremovexattr],[
1712 $curl_includes_sys_xattr
1714 AC_MSG_RESULT([yes])
1715 tst_proto_fremovexattr="yes"
1718 tst_proto_fremovexattr="no"
1722 if test "$tst_proto_fremovexattr" = "yes"; then
1723 if test "$tst_nargs_fremovexattr" = "unknown"; then
1724 AC_MSG_CHECKING([if fremovexattr takes 2 args.])
1727 $curl_includes_sys_xattr
1729 if(0 != fremovexattr(0, 0))
1733 AC_MSG_RESULT([yes])
1734 tst_compi_fremovexattr="yes"
1735 tst_nargs_fremovexattr="2"
1738 tst_compi_fremovexattr="no"
1741 if test "$tst_nargs_fremovexattr" = "unknown"; then
1742 AC_MSG_CHECKING([if fremovexattr takes 3 args.])
1745 $curl_includes_sys_xattr
1747 if(0 != fremovexattr(0, 0, 0))
1751 AC_MSG_RESULT([yes])
1752 tst_compi_fremovexattr="yes"
1753 tst_nargs_fremovexattr="3"
1756 tst_compi_fremovexattr="no"
1759 AC_MSG_CHECKING([if fremovexattr is compilable])
1760 if test "$tst_compi_fremovexattr" = "yes"; then
1761 AC_MSG_RESULT([yes])
1767 if test "$tst_compi_fremovexattr" = "yes"; then
1768 AC_MSG_CHECKING([if fremovexattr usage allowed])
1769 if test "x$curl_disallow_fremovexattr" != "xyes"; then
1770 AC_MSG_RESULT([yes])
1771 tst_allow_fremovexattr="yes"
1774 tst_allow_fremovexattr="no"
1778 AC_MSG_CHECKING([if fremovexattr might be used])
1779 if test "$tst_links_fremovexattr" = "yes" &&
1780 test "$tst_proto_fremovexattr" = "yes" &&
1781 test "$tst_compi_fremovexattr" = "yes" &&
1782 test "$tst_allow_fremovexattr" = "yes"; then
1783 AC_MSG_RESULT([yes])
1784 AC_DEFINE_UNQUOTED(HAVE_FREMOVEXATTR, 1,
1785 [Define to 1 if you have the fremovexattr function.])
1786 dnl AC_DEFINE_UNQUOTED(FREMOVEXATTR_ARGS, $tst_nargs_fremovexattr,
1787 dnl [Specifies the number of arguments to fremovexattr])
1789 if test "$tst_nargs_fremovexattr" -eq "2"; then
1790 AC_DEFINE(HAVE_FREMOVEXATTR_2, 1, [fremovexattr() takes 2 args])
1791 elif test "$tst_nargs_fremovexattr" -eq "3"; then
1792 AC_DEFINE(HAVE_FREMOVEXATTR_3, 1, [fremovexattr() takes 3 args])
1795 curl_cv_func_fremovexattr="yes"
1798 curl_cv_func_fremovexattr="no"
1803 dnl CURL_CHECK_FUNC_FSETXATTR
1804 dnl -------------------------------------------------
1805 dnl Verify if fsetxattr is available, prototyped, and
1806 dnl can be compiled. If all of these are true, and
1807 dnl usage has not been previously disallowed with
1808 dnl shell variable curl_disallow_fsetxattr, then
1809 dnl HAVE_FSETXATTR will be defined.
1811 AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [
1812 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
1814 tst_links_fsetxattr="unknown"
1815 tst_proto_fsetxattr="unknown"
1816 tst_compi_fsetxattr="unknown"
1817 tst_allow_fsetxattr="unknown"
1818 tst_nargs_fsetxattr="unknown"
1820 AC_MSG_CHECKING([if fsetxattr can be linked])
1822 AC_LANG_FUNC_LINK_TRY([fsetxattr])
1824 AC_MSG_RESULT([yes])
1825 tst_links_fsetxattr="yes"
1828 tst_links_fsetxattr="no"
1831 if test "$tst_links_fsetxattr" = "yes"; then
1832 AC_MSG_CHECKING([if fsetxattr is prototyped])
1833 AC_EGREP_CPP([fsetxattr],[
1834 $curl_includes_sys_xattr
1836 AC_MSG_RESULT([yes])
1837 tst_proto_fsetxattr="yes"
1840 tst_proto_fsetxattr="no"
1844 if test "$tst_proto_fsetxattr" = "yes"; then
1845 if test "$tst_nargs_fsetxattr" = "unknown"; then
1846 AC_MSG_CHECKING([if fsetxattr takes 5 args.])
1849 $curl_includes_sys_xattr
1851 if(0 != fsetxattr(0, 0, 0, 0, 0))
1855 AC_MSG_RESULT([yes])
1856 tst_compi_fsetxattr="yes"
1857 tst_nargs_fsetxattr="5"
1860 tst_compi_fsetxattr="no"
1863 if test "$tst_nargs_fsetxattr" = "unknown"; then
1864 AC_MSG_CHECKING([if fsetxattr takes 6 args.])
1867 $curl_includes_sys_xattr
1869 if(0 != fsetxattr(0, 0, 0, 0, 0, 0))
1873 AC_MSG_RESULT([yes])
1874 tst_compi_fsetxattr="yes"
1875 tst_nargs_fsetxattr="6"
1878 tst_compi_fsetxattr="no"
1881 AC_MSG_CHECKING([if fsetxattr is compilable])
1882 if test "$tst_compi_fsetxattr" = "yes"; then
1883 AC_MSG_RESULT([yes])
1889 if test "$tst_compi_fsetxattr" = "yes"; then
1890 AC_MSG_CHECKING([if fsetxattr usage allowed])
1891 if test "x$curl_disallow_fsetxattr" != "xyes"; then
1892 AC_MSG_RESULT([yes])
1893 tst_allow_fsetxattr="yes"
1896 tst_allow_fsetxattr="no"
1900 AC_MSG_CHECKING([if fsetxattr might be used])
1901 if test "$tst_links_fsetxattr" = "yes" &&
1902 test "$tst_proto_fsetxattr" = "yes" &&
1903 test "$tst_compi_fsetxattr" = "yes" &&
1904 test "$tst_allow_fsetxattr" = "yes"; then
1905 AC_MSG_RESULT([yes])
1906 AC_DEFINE_UNQUOTED(HAVE_FSETXATTR, 1,
1907 [Define to 1 if you have the fsetxattr function.])
1908 dnl AC_DEFINE_UNQUOTED(FSETXATTR_ARGS, $tst_nargs_fsetxattr,
1909 dnl [Specifies the number of arguments to fsetxattr])
1911 if test "$tst_nargs_fsetxattr" -eq "5"; then
1912 AC_DEFINE(HAVE_FSETXATTR_5, 1, [fsetxattr() takes 5 args])
1913 elif test "$tst_nargs_fsetxattr" -eq "6"; then
1914 AC_DEFINE(HAVE_FSETXATTR_6, 1, [fsetxattr() takes 6 args])
1917 curl_cv_func_fsetxattr="yes"
1920 curl_cv_func_fsetxattr="no"
1925 dnl CURL_CHECK_FUNC_FTRUNCATE
1926 dnl -------------------------------------------------
1927 dnl Verify if ftruncate is available, prototyped, and
1928 dnl can be compiled. If all of these are true, and
1929 dnl usage has not been previously disallowed with
1930 dnl shell variable curl_disallow_ftruncate, then
1931 dnl HAVE_FTRUNCATE will be defined.
1933 AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [
1934 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
1936 tst_links_ftruncate="unknown"
1937 tst_proto_ftruncate="unknown"
1938 tst_compi_ftruncate="unknown"
1939 tst_allow_ftruncate="unknown"
1941 AC_MSG_CHECKING([if ftruncate can be linked])
1943 AC_LANG_FUNC_LINK_TRY([ftruncate])
1945 AC_MSG_RESULT([yes])
1946 tst_links_ftruncate="yes"
1949 tst_links_ftruncate="no"
1952 if test "$tst_links_ftruncate" = "yes"; then
1953 AC_MSG_CHECKING([if ftruncate is prototyped])
1954 AC_EGREP_CPP([ftruncate],[
1955 $curl_includes_unistd
1957 AC_MSG_RESULT([yes])
1958 tst_proto_ftruncate="yes"
1961 tst_proto_ftruncate="no"
1965 if test "$tst_proto_ftruncate" = "yes"; then
1966 AC_MSG_CHECKING([if ftruncate is compilable])
1969 $curl_includes_unistd
1971 if(0 != ftruncate(0, 0))
1975 AC_MSG_RESULT([yes])
1976 tst_compi_ftruncate="yes"
1979 tst_compi_ftruncate="no"
1983 if test "$tst_compi_ftruncate" = "yes"; then
1984 AC_MSG_CHECKING([if ftruncate usage allowed])
1985 if test "x$curl_disallow_ftruncate" != "xyes"; then
1986 AC_MSG_RESULT([yes])
1987 tst_allow_ftruncate="yes"
1990 tst_allow_ftruncate="no"
1994 AC_MSG_CHECKING([if ftruncate might be used])
1995 if test "$tst_links_ftruncate" = "yes" &&
1996 test "$tst_proto_ftruncate" = "yes" &&
1997 test "$tst_compi_ftruncate" = "yes" &&
1998 test "$tst_allow_ftruncate" = "yes"; then
1999 AC_MSG_RESULT([yes])
2000 AC_DEFINE_UNQUOTED(HAVE_FTRUNCATE, 1,
2001 [Define to 1 if you have the ftruncate function.])
2002 curl_cv_func_ftruncate="yes"
2005 curl_cv_func_ftruncate="no"
2010 dnl CURL_CHECK_FUNC_GETADDRINFO
2011 dnl -------------------------------------------------
2012 dnl Verify if getaddrinfo is available, prototyped, can
2013 dnl be compiled and seems to work. If all of these are
2014 dnl true, and usage has not been previously disallowed
2015 dnl with shell variable curl_disallow_getaddrinfo, then
2016 dnl HAVE_GETADDRINFO will be defined. Additionally when
2017 dnl HAVE_GETADDRINFO gets defined this will also attempt
2018 dnl to find out if getaddrinfo happens to be threadsafe,
2019 dnl defining HAVE_GETADDRINFO_THREADSAFE when true.
2021 AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
2022 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
2023 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
2024 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
2025 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
2026 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2027 AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
2029 tst_links_getaddrinfo="unknown"
2030 tst_proto_getaddrinfo="unknown"
2031 tst_compi_getaddrinfo="unknown"
2032 tst_works_getaddrinfo="unknown"
2033 tst_allow_getaddrinfo="unknown"
2034 tst_tsafe_getaddrinfo="unknown"
2036 AC_MSG_CHECKING([if getaddrinfo can be linked])
2039 $curl_includes_ws2tcpip
2040 $curl_includes_sys_socket
2041 $curl_includes_netdb
2043 if(0 != getaddrinfo(0, 0, 0, 0))
2047 AC_MSG_RESULT([yes])
2048 tst_links_getaddrinfo="yes"
2051 tst_links_getaddrinfo="no"
2054 if test "$tst_links_getaddrinfo" = "yes"; then
2055 AC_MSG_CHECKING([if getaddrinfo is prototyped])
2056 AC_EGREP_CPP([getaddrinfo],[
2057 $curl_includes_ws2tcpip
2058 $curl_includes_sys_socket
2059 $curl_includes_netdb
2061 AC_MSG_RESULT([yes])
2062 tst_proto_getaddrinfo="yes"
2065 tst_proto_getaddrinfo="no"
2069 if test "$tst_proto_getaddrinfo" = "yes"; then
2070 AC_MSG_CHECKING([if getaddrinfo is compilable])
2073 $curl_includes_ws2tcpip
2074 $curl_includes_sys_socket
2075 $curl_includes_netdb
2077 if(0 != getaddrinfo(0, 0, 0, 0))
2081 AC_MSG_RESULT([yes])
2082 tst_compi_getaddrinfo="yes"
2085 tst_compi_getaddrinfo="no"
2089 dnl only do runtime verification when not cross-compiling
2090 if test "x$cross_compiling" != "xyes" &&
2091 test "$tst_compi_getaddrinfo" = "yes"; then
2092 AC_MSG_CHECKING([if getaddrinfo seems to work])
2095 $curl_includes_ws2tcpip
2096 $curl_includes_stdlib
2097 $curl_includes_string
2098 $curl_includes_sys_socket
2099 $curl_includes_netdb
2101 struct addrinfo hints;
2102 struct addrinfo *ai = 0;
2105 #ifdef HAVE_WINSOCK2_H
2107 if (WSAStartup(MAKEWORD(2,2), &wsa))
2111 memset(&hints, 0, sizeof(hints));
2112 hints.ai_flags = AI_NUMERICHOST;
2113 hints.ai_family = AF_UNSPEC;
2114 hints.ai_socktype = SOCK_STREAM;
2115 error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
2122 AC_MSG_RESULT([yes])
2123 tst_works_getaddrinfo="yes"
2126 tst_works_getaddrinfo="no"
2130 if test "$tst_compi_getaddrinfo" = "yes" &&
2131 test "$tst_works_getaddrinfo" != "no"; then
2132 AC_MSG_CHECKING([if getaddrinfo usage allowed])
2133 if test "x$curl_disallow_getaddrinfo" != "xyes"; then
2134 AC_MSG_RESULT([yes])
2135 tst_allow_getaddrinfo="yes"
2138 tst_allow_getaddrinfo="no"
2142 AC_MSG_CHECKING([if getaddrinfo might be used])
2143 if test "$tst_links_getaddrinfo" = "yes" &&
2144 test "$tst_proto_getaddrinfo" = "yes" &&
2145 test "$tst_compi_getaddrinfo" = "yes" &&
2146 test "$tst_allow_getaddrinfo" = "yes" &&
2147 test "$tst_works_getaddrinfo" != "no"; then
2148 AC_MSG_RESULT([yes])
2149 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
2150 [Define to 1 if you have a working getaddrinfo function.])
2151 curl_cv_func_getaddrinfo="yes"
2154 curl_cv_func_getaddrinfo="no"
2155 curl_cv_func_getaddrinfo_threadsafe="no"
2158 if test "$curl_cv_func_getaddrinfo" = "yes"; then
2159 AC_MSG_CHECKING([if getaddrinfo is threadsafe])
2161 aix[[1234]].* | aix5.[[01]].*)
2162 dnl aix 5.1 and older
2163 tst_tsafe_getaddrinfo="no"
2166 dnl aix 5.2 and newer
2167 tst_tsafe_getaddrinfo="yes"
2170 dnl darwin 5.0 and mac os x 10.1.X and older
2171 tst_tsafe_getaddrinfo="no"
2174 dnl darwin 6.0 and mac os x 10.2.X and newer
2175 tst_tsafe_getaddrinfo="yes"
2177 freebsd[[1234]].* | freebsd5.[[1234]]*)
2178 dnl freebsd 5.4 and older
2179 tst_tsafe_getaddrinfo="no"
2182 dnl freebsd 5.5 and newer
2183 tst_tsafe_getaddrinfo="yes"
2185 hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*)
2186 dnl hpux 11.10 and older
2187 tst_tsafe_getaddrinfo="no"
2190 dnl hpux 11.11 and newer
2191 tst_tsafe_getaddrinfo="yes"
2194 dnl netbsd 3.X and older
2195 tst_tsafe_getaddrinfo="no"
2198 dnl netbsd 4.X and newer
2199 tst_tsafe_getaddrinfo="yes"
2203 tst_tsafe_getaddrinfo="no"
2206 dnl solaris which have it
2207 tst_tsafe_getaddrinfo="yes"
2210 if test "$tst_tsafe_getaddrinfo" = "unknown" &&
2211 test "$curl_cv_native_windows" = "yes"; then
2212 tst_tsafe_getaddrinfo="yes"
2214 if test "$tst_tsafe_getaddrinfo" = "unknown"; then
2215 CURL_CHECK_DEF_CC([h_errno], [
2216 $curl_includes_sys_socket
2217 $curl_includes_netdb
2219 if test "$curl_cv_have_def_h_errno" = "yes"; then
2220 tst_h_errno_macro="yes"
2222 tst_h_errno_macro="no"
2226 $curl_includes_sys_socket
2227 $curl_includes_netdb
2234 tst_h_errno_modifiable_lvalue="yes"
2236 tst_h_errno_modifiable_lvalue="no"
2241 #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
2243 #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
2246 force compilation error
2250 tst_h_errno_sbs_issue_7="yes"
2252 tst_h_errno_sbs_issue_7="no"
2254 if test "$tst_h_errno_macro" = "no" &&
2255 test "$tst_h_errno_modifiable_lvalue" = "no" &&
2256 test "$tst_h_errno_sbs_issue_7" = "no"; then
2257 tst_tsafe_getaddrinfo="no"
2259 tst_tsafe_getaddrinfo="yes"
2262 AC_MSG_RESULT([$tst_tsafe_getaddrinfo])
2263 if test "$tst_tsafe_getaddrinfo" = "yes"; then
2264 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1,
2265 [Define to 1 if the getaddrinfo function is threadsafe.])
2266 curl_cv_func_getaddrinfo_threadsafe="yes"
2268 curl_cv_func_getaddrinfo_threadsafe="no"
2274 dnl CURL_CHECK_FUNC_GETHOSTBYADDR
2275 dnl -------------------------------------------------
2276 dnl Verify if gethostbyaddr is available, prototyped,
2277 dnl and can be compiled. If all of these are true,
2278 dnl and usage has not been previously disallowed with
2279 dnl shell variable curl_disallow_gethostbyaddr, then
2280 dnl HAVE_GETHOSTBYADDR will be defined.
2282 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR], [
2283 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2284 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2286 tst_links_gethostbyaddr="unknown"
2287 tst_proto_gethostbyaddr="unknown"
2288 tst_compi_gethostbyaddr="unknown"
2289 tst_allow_gethostbyaddr="unknown"
2291 AC_MSG_CHECKING([if gethostbyaddr can be linked])
2294 $curl_includes_winsock2
2295 $curl_includes_netdb
2297 if(0 != gethostbyaddr(0, 0, 0))
2301 AC_MSG_RESULT([yes])
2302 tst_links_gethostbyaddr="yes"
2305 tst_links_gethostbyaddr="no"
2308 if test "$tst_links_gethostbyaddr" = "yes"; then
2309 AC_MSG_CHECKING([if gethostbyaddr is prototyped])
2310 AC_EGREP_CPP([gethostbyaddr],[
2311 $curl_includes_winsock2
2312 $curl_includes_netdb
2314 AC_MSG_RESULT([yes])
2315 tst_proto_gethostbyaddr="yes"
2318 tst_proto_gethostbyaddr="no"
2322 if test "$tst_proto_gethostbyaddr" = "yes"; then
2323 AC_MSG_CHECKING([if gethostbyaddr is compilable])
2326 $curl_includes_winsock2
2327 $curl_includes_netdb
2329 if(0 != gethostbyaddr(0, 0, 0))
2333 AC_MSG_RESULT([yes])
2334 tst_compi_gethostbyaddr="yes"
2337 tst_compi_gethostbyaddr="no"
2341 if test "$tst_compi_gethostbyaddr" = "yes"; then
2342 AC_MSG_CHECKING([if gethostbyaddr usage allowed])
2343 if test "x$curl_disallow_gethostbyaddr" != "xyes"; then
2344 AC_MSG_RESULT([yes])
2345 tst_allow_gethostbyaddr="yes"
2348 tst_allow_gethostbyaddr="no"
2352 AC_MSG_CHECKING([if gethostbyaddr might be used])
2353 if test "$tst_links_gethostbyaddr" = "yes" &&
2354 test "$tst_proto_gethostbyaddr" = "yes" &&
2355 test "$tst_compi_gethostbyaddr" = "yes" &&
2356 test "$tst_allow_gethostbyaddr" = "yes"; then
2357 AC_MSG_RESULT([yes])
2358 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR, 1,
2359 [Define to 1 if you have the gethostbyaddr function.])
2360 curl_cv_func_gethostbyaddr="yes"
2363 curl_cv_func_gethostbyaddr="no"
2367 dnl CURL_CHECK_FUNC_GAI_STRERROR
2368 dnl -------------------------------------------------
2369 dnl Verify if gai_strerror is available, prototyped,
2370 dnl and can be compiled. If all of these are true,
2371 dnl and usage has not been previously disallowed with
2372 dnl shell variable curl_disallow_gai_strerror, then
2373 dnl HAVE_GAI_STRERROR will be defined.
2375 AC_DEFUN([CURL_CHECK_FUNC_GAI_STRERROR], [
2376 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2377 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2379 tst_links_gai_strerror="unknown"
2380 tst_proto_gai_strerror="unknown"
2381 tst_compi_gai_strerror="unknown"
2382 tst_allow_gai_strerror="unknown"
2384 AC_MSG_CHECKING([if gai_strerror can be linked])
2387 $curl_includes_winsock2
2388 $curl_includes_netdb
2390 if(0 != gai_strerror(0))
2394 AC_MSG_RESULT([yes])
2395 tst_links_gai_strerror="yes"
2398 tst_links_gai_strerror="no"
2401 if test "$tst_links_gai_strerror" = "yes"; then
2402 AC_MSG_CHECKING([if gai_strerror is prototyped])
2403 AC_EGREP_CPP([gai_strerror],[
2404 $curl_includes_winsock2
2405 $curl_includes_netdb
2407 AC_MSG_RESULT([yes])
2408 tst_proto_gai_strerror="yes"
2411 tst_proto_gai_strerror="no"
2415 if test "$tst_proto_gai_strerror" = "yes"; then
2416 AC_MSG_CHECKING([if gai_strerror is compilable])
2419 $curl_includes_winsock2
2420 $curl_includes_netdb
2422 if(0 != gai_strerror(0))
2426 AC_MSG_RESULT([yes])
2427 tst_compi_gai_strerror="yes"
2430 tst_compi_gai_strerror="no"
2434 if test "$tst_compi_gai_strerror" = "yes"; then
2435 AC_MSG_CHECKING([if gai_strerror usage allowed])
2436 if test "x$curl_disallow_gai_strerror" != "xyes"; then
2437 AC_MSG_RESULT([yes])
2438 tst_allow_gai_strerror="yes"
2441 tst_allow_gai_strerror="no"
2445 AC_MSG_CHECKING([if gai_strerror might be used])
2446 if test "$tst_links_gai_strerror" = "yes" &&
2447 test "$tst_proto_gai_strerror" = "yes" &&
2448 test "$tst_compi_gai_strerror" = "yes" &&
2449 test "$tst_allow_gai_strerror" = "yes"; then
2450 AC_MSG_RESULT([yes])
2451 AC_DEFINE_UNQUOTED(HAVE_GAI_STRERROR, 1,
2452 [Define to 1 if you have the gai_strerror function.])
2453 curl_cv_func_gai_strerror="yes"
2456 curl_cv_func_gai_strerror="no"
2461 dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R
2462 dnl -------------------------------------------------
2463 dnl Verify if gethostbyaddr_r is available, prototyped,
2464 dnl and can be compiled. If all of these are true, and
2465 dnl usage has not been previously disallowed with
2466 dnl shell variable curl_disallow_gethostbyaddr_r, then
2467 dnl HAVE_GETHOSTBYADDR_R will be defined.
2469 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR_R], [
2470 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2472 tst_links_gethostbyaddr_r="unknown"
2473 tst_proto_gethostbyaddr_r="unknown"
2474 tst_compi_gethostbyaddr_r="unknown"
2475 tst_allow_gethostbyaddr_r="unknown"
2476 tst_nargs_gethostbyaddr_r="unknown"
2478 AC_MSG_CHECKING([if gethostbyaddr_r can be linked])
2480 AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
2482 AC_MSG_RESULT([yes])
2483 tst_links_gethostbyaddr_r="yes"
2486 tst_links_gethostbyaddr_r="no"
2489 if test "$tst_links_gethostbyaddr_r" = "yes"; then
2490 AC_MSG_CHECKING([if gethostbyaddr_r is prototyped])
2491 AC_EGREP_CPP([gethostbyaddr_r],[
2492 $curl_includes_netdb
2494 AC_MSG_RESULT([yes])
2495 tst_proto_gethostbyaddr_r="yes"
2498 tst_proto_gethostbyaddr_r="no"
2502 if test "$tst_proto_gethostbyaddr_r" = "yes"; then
2503 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
2504 AC_MSG_CHECKING([if gethostbyaddr_r takes 5 args.])
2507 $curl_includes_netdb
2509 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0))
2513 AC_MSG_RESULT([yes])
2514 tst_compi_gethostbyaddr_r="yes"
2515 tst_nargs_gethostbyaddr_r="5"
2518 tst_compi_gethostbyaddr_r="no"
2521 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
2522 AC_MSG_CHECKING([if gethostbyaddr_r takes 7 args.])
2525 $curl_includes_netdb
2527 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0))
2531 AC_MSG_RESULT([yes])
2532 tst_compi_gethostbyaddr_r="yes"
2533 tst_nargs_gethostbyaddr_r="7"
2536 tst_compi_gethostbyaddr_r="no"
2539 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
2540 AC_MSG_CHECKING([if gethostbyaddr_r takes 8 args.])
2543 $curl_includes_netdb
2545 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0))
2549 AC_MSG_RESULT([yes])
2550 tst_compi_gethostbyaddr_r="yes"
2551 tst_nargs_gethostbyaddr_r="8"
2554 tst_compi_gethostbyaddr_r="no"
2557 AC_MSG_CHECKING([if gethostbyaddr_r is compilable])
2558 if test "$tst_compi_gethostbyaddr_r" = "yes"; then
2559 AC_MSG_RESULT([yes])
2565 if test "$tst_compi_gethostbyaddr_r" = "yes"; then
2566 AC_MSG_CHECKING([if gethostbyaddr_r usage allowed])
2567 if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then
2568 AC_MSG_RESULT([yes])
2569 tst_allow_gethostbyaddr_r="yes"
2572 tst_allow_gethostbyaddr_r="no"
2576 AC_MSG_CHECKING([if gethostbyaddr_r might be used])
2577 if test "$tst_links_gethostbyaddr_r" = "yes" &&
2578 test "$tst_proto_gethostbyaddr_r" = "yes" &&
2579 test "$tst_compi_gethostbyaddr_r" = "yes" &&
2580 test "$tst_allow_gethostbyaddr_r" = "yes"; then
2581 AC_MSG_RESULT([yes])
2582 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1,
2583 [Define to 1 if you have the gethostbyaddr_r function.])
2584 dnl AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_ARGS, $tst_nargs_gethostbyaddr_r,
2585 dnl [Specifies the number of arguments to gethostbyaddr_r])
2587 if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then
2588 AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
2589 elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then
2590 AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
2591 elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then
2592 AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
2595 curl_cv_func_gethostbyaddr_r="yes"
2598 curl_cv_func_gethostbyaddr_r="no"
2603 dnl CURL_CHECK_FUNC_GETHOSTBYNAME
2604 dnl -------------------------------------------------
2605 dnl Verify if gethostbyname is available, prototyped,
2606 dnl and can be compiled. If all of these are true,
2607 dnl and usage has not been previously disallowed with
2608 dnl shell variable curl_disallow_gethostbyname, then
2609 dnl HAVE_GETHOSTBYNAME will be defined.
2611 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME], [
2612 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2613 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2615 tst_links_gethostbyname="unknown"
2616 tst_proto_gethostbyname="unknown"
2617 tst_compi_gethostbyname="unknown"
2618 tst_allow_gethostbyname="unknown"
2620 AC_MSG_CHECKING([if gethostbyname can be linked])
2623 $curl_includes_winsock2
2624 $curl_includes_netdb
2626 if(0 != gethostbyname(0))
2630 AC_MSG_RESULT([yes])
2631 tst_links_gethostbyname="yes"
2634 tst_links_gethostbyname="no"
2637 if test "$tst_links_gethostbyname" = "yes"; then
2638 AC_MSG_CHECKING([if gethostbyname is prototyped])
2639 AC_EGREP_CPP([gethostbyname],[
2640 $curl_includes_winsock2
2641 $curl_includes_netdb
2643 AC_MSG_RESULT([yes])
2644 tst_proto_gethostbyname="yes"
2647 tst_proto_gethostbyname="no"
2651 if test "$tst_proto_gethostbyname" = "yes"; then
2652 AC_MSG_CHECKING([if gethostbyname is compilable])
2655 $curl_includes_winsock2
2656 $curl_includes_netdb
2658 if(0 != gethostbyname(0))
2662 AC_MSG_RESULT([yes])
2663 tst_compi_gethostbyname="yes"
2666 tst_compi_gethostbyname="no"
2670 if test "$tst_compi_gethostbyname" = "yes"; then
2671 AC_MSG_CHECKING([if gethostbyname usage allowed])
2672 if test "x$curl_disallow_gethostbyname" != "xyes"; then
2673 AC_MSG_RESULT([yes])
2674 tst_allow_gethostbyname="yes"
2677 tst_allow_gethostbyname="no"
2681 AC_MSG_CHECKING([if gethostbyname might be used])
2682 if test "$tst_links_gethostbyname" = "yes" &&
2683 test "$tst_proto_gethostbyname" = "yes" &&
2684 test "$tst_compi_gethostbyname" = "yes" &&
2685 test "$tst_allow_gethostbyname" = "yes"; then
2686 AC_MSG_RESULT([yes])
2687 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME, 1,
2688 [Define to 1 if you have the gethostbyname function.])
2689 curl_cv_func_gethostbyname="yes"
2692 curl_cv_func_gethostbyname="no"
2697 dnl CURL_CHECK_FUNC_GETHOSTBYNAME_R
2698 dnl -------------------------------------------------
2699 dnl Verify if gethostbyname_r is available, prototyped,
2700 dnl and can be compiled. If all of these are true, and
2701 dnl usage has not been previously disallowed with
2702 dnl shell variable curl_disallow_gethostbyname_r, then
2703 dnl HAVE_GETHOSTBYNAME_R will be defined.
2705 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [
2706 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2708 tst_links_gethostbyname_r="unknown"
2709 tst_proto_gethostbyname_r="unknown"
2710 tst_compi_gethostbyname_r="unknown"
2711 tst_allow_gethostbyname_r="unknown"
2712 tst_nargs_gethostbyname_r="unknown"
2714 AC_MSG_CHECKING([if gethostbyname_r can be linked])
2716 AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
2718 AC_MSG_RESULT([yes])
2719 tst_links_gethostbyname_r="yes"
2722 tst_links_gethostbyname_r="no"
2725 if test "$tst_links_gethostbyname_r" = "yes"; then
2726 AC_MSG_CHECKING([if gethostbyname_r is prototyped])
2727 AC_EGREP_CPP([gethostbyname_r],[
2728 $curl_includes_netdb
2730 AC_MSG_RESULT([yes])
2731 tst_proto_gethostbyname_r="yes"
2734 tst_proto_gethostbyname_r="no"
2738 if test "$tst_proto_gethostbyname_r" = "yes"; then
2739 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
2740 AC_MSG_CHECKING([if gethostbyname_r takes 3 args.])
2743 $curl_includes_netdb
2745 if(0 != gethostbyname_r(0, 0, 0))
2749 AC_MSG_RESULT([yes])
2750 tst_compi_gethostbyname_r="yes"
2751 tst_nargs_gethostbyname_r="3"
2754 tst_compi_gethostbyname_r="no"
2757 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
2758 AC_MSG_CHECKING([if gethostbyname_r takes 5 args.])
2761 $curl_includes_netdb
2763 if(0 != gethostbyname_r(0, 0, 0, 0, 0))
2767 AC_MSG_RESULT([yes])
2768 tst_compi_gethostbyname_r="yes"
2769 tst_nargs_gethostbyname_r="5"
2772 tst_compi_gethostbyname_r="no"
2775 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
2776 AC_MSG_CHECKING([if gethostbyname_r takes 6 args.])
2779 $curl_includes_netdb
2781 if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0))
2785 AC_MSG_RESULT([yes])
2786 tst_compi_gethostbyname_r="yes"
2787 tst_nargs_gethostbyname_r="6"
2790 tst_compi_gethostbyname_r="no"
2793 AC_MSG_CHECKING([if gethostbyname_r is compilable])
2794 if test "$tst_compi_gethostbyname_r" = "yes"; then
2795 AC_MSG_RESULT([yes])
2801 if test "$tst_compi_gethostbyname_r" = "yes"; then
2802 AC_MSG_CHECKING([if gethostbyname_r usage allowed])
2803 if test "x$curl_disallow_gethostbyname_r" != "xyes"; then
2804 AC_MSG_RESULT([yes])
2805 tst_allow_gethostbyname_r="yes"
2808 tst_allow_gethostbyname_r="no"
2812 AC_MSG_CHECKING([if gethostbyname_r might be used])
2813 if test "$tst_links_gethostbyname_r" = "yes" &&
2814 test "$tst_proto_gethostbyname_r" = "yes" &&
2815 test "$tst_compi_gethostbyname_r" = "yes" &&
2816 test "$tst_allow_gethostbyname_r" = "yes"; then
2817 AC_MSG_RESULT([yes])
2818 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
2819 [Define to 1 if you have the gethostbyname_r function.])
2820 dnl AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $tst_nargs_gethostbyname_r,
2821 dnl [Specifies the number of arguments to gethostbyname_r])
2823 if test "$tst_nargs_gethostbyname_r" -eq "3"; then
2824 AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
2825 elif test "$tst_nargs_gethostbyname_r" -eq "5"; then
2826 AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
2827 elif test "$tst_nargs_gethostbyname_r" -eq "6"; then
2828 AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
2831 curl_cv_func_gethostbyname_r="yes"
2834 curl_cv_func_gethostbyname_r="no"
2839 dnl CURL_CHECK_FUNC_GETHOSTNAME
2840 dnl -------------------------------------------------
2841 dnl Verify if gethostname is available, prototyped, and
2842 dnl can be compiled. If all of these are true, and
2843 dnl usage has not been previously disallowed with
2844 dnl shell variable curl_disallow_gethostname, then
2845 dnl HAVE_GETHOSTNAME will be defined.
2847 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
2848 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2849 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
2850 AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
2852 tst_links_gethostname="unknown"
2853 tst_proto_gethostname="unknown"
2854 tst_compi_gethostname="unknown"
2855 tst_allow_gethostname="unknown"
2857 AC_MSG_CHECKING([if gethostname can be linked])
2860 $curl_includes_winsock2
2861 $curl_includes_unistd
2863 if(0 != gethostname(0, 0))
2867 AC_MSG_RESULT([yes])
2868 tst_links_gethostname="yes"
2871 tst_links_gethostname="no"
2874 if test "$tst_links_gethostname" = "yes"; then
2875 AC_MSG_CHECKING([if gethostname is prototyped])
2876 AC_EGREP_CPP([gethostname],[
2877 $curl_includes_winsock2
2878 $curl_includes_unistd
2880 AC_MSG_RESULT([yes])
2881 tst_proto_gethostname="yes"
2884 tst_proto_gethostname="no"
2888 if test "$tst_proto_gethostname" = "yes"; then
2889 AC_MSG_CHECKING([if gethostname is compilable])
2892 $curl_includes_winsock2
2893 $curl_includes_unistd
2895 if(0 != gethostname(0, 0))
2899 AC_MSG_RESULT([yes])
2900 tst_compi_gethostname="yes"
2903 tst_compi_gethostname="no"
2907 if test "$tst_compi_gethostname" = "yes"; then
2908 AC_MSG_CHECKING([for gethostname arg 2 data type])
2909 tst_gethostname_type_arg2="unknown"
2910 for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do
2911 for tst_arg2 in 'int' 'unsigned int' 'size_t'; do
2912 if test "$tst_gethostname_type_arg2" = "unknown"; then
2915 $curl_includes_winsock2
2916 $curl_includes_unistd
2917 $curl_preprocess_callconv
2918 extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2);
2920 if(0 != gethostname(0, 0))
2924 tst_gethostname_type_arg2="$tst_arg2"
2929 AC_MSG_RESULT([$tst_gethostname_type_arg2])
2930 if test "$tst_gethostname_type_arg2" != "unknown"; then
2931 AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2,
2932 [Define to the type of arg 2 for gethostname.])
2936 if test "$tst_compi_gethostname" = "yes"; then
2937 AC_MSG_CHECKING([if gethostname usage allowed])
2938 if test "x$curl_disallow_gethostname" != "xyes"; then
2939 AC_MSG_RESULT([yes])
2940 tst_allow_gethostname="yes"
2943 tst_allow_gethostname="no"
2947 AC_MSG_CHECKING([if gethostname might be used])
2948 if test "$tst_links_gethostname" = "yes" &&
2949 test "$tst_proto_gethostname" = "yes" &&
2950 test "$tst_compi_gethostname" = "yes" &&
2951 test "$tst_allow_gethostname" = "yes"; then
2952 AC_MSG_RESULT([yes])
2953 AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
2954 [Define to 1 if you have the gethostname function.])
2955 curl_cv_func_gethostname="yes"
2958 curl_cv_func_gethostname="no"
2963 dnl CURL_CHECK_FUNC_GETIFADDRS
2964 dnl -------------------------------------------------
2965 dnl Verify if getifaddrs is available, prototyped, can
2966 dnl be compiled and seems to work. If all of these are
2967 dnl true, and usage has not been previously disallowed
2968 dnl with shell variable curl_disallow_getifaddrs, then
2969 dnl HAVE_GETIFADDRS will be defined.
2971 AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [
2972 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
2973 AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
2975 tst_links_getifaddrs="unknown"
2976 tst_proto_getifaddrs="unknown"
2977 tst_compi_getifaddrs="unknown"
2978 tst_works_getifaddrs="unknown"
2979 tst_allow_getifaddrs="unknown"
2981 AC_MSG_CHECKING([if getifaddrs can be linked])
2983 AC_LANG_FUNC_LINK_TRY([getifaddrs])
2985 AC_MSG_RESULT([yes])
2986 tst_links_getifaddrs="yes"
2989 tst_links_getifaddrs="no"
2992 if test "$tst_links_getifaddrs" = "yes"; then
2993 AC_MSG_CHECKING([if getifaddrs is prototyped])
2994 AC_EGREP_CPP([getifaddrs],[
2995 $curl_includes_ifaddrs
2997 AC_MSG_RESULT([yes])
2998 tst_proto_getifaddrs="yes"
3001 tst_proto_getifaddrs="no"
3005 if test "$tst_proto_getifaddrs" = "yes"; then
3006 AC_MSG_CHECKING([if getifaddrs is compilable])
3009 $curl_includes_ifaddrs
3011 if(0 != getifaddrs(0))
3015 AC_MSG_RESULT([yes])
3016 tst_compi_getifaddrs="yes"
3019 tst_compi_getifaddrs="no"
3023 dnl only do runtime verification when not cross-compiling
3024 if test "x$cross_compiling" != "xyes" &&
3025 test "$tst_compi_getifaddrs" = "yes"; then
3026 AC_MSG_CHECKING([if getifaddrs seems to work])
3029 $curl_includes_stdlib
3030 $curl_includes_ifaddrs
3032 struct ifaddrs *ifa = 0;
3035 error = getifaddrs(&ifa);
3042 AC_MSG_RESULT([yes])
3043 tst_works_getifaddrs="yes"
3046 tst_works_getifaddrs="no"
3050 if test "$tst_compi_getifaddrs" = "yes" &&
3051 test "$tst_works_getifaddrs" != "no"; then
3052 AC_MSG_CHECKING([if getifaddrs usage allowed])
3053 if test "x$curl_disallow_getifaddrs" != "xyes"; then
3054 AC_MSG_RESULT([yes])
3055 tst_allow_getifaddrs="yes"
3058 tst_allow_getifaddrs="no"
3062 AC_MSG_CHECKING([if getifaddrs might be used])
3063 if test "$tst_links_getifaddrs" = "yes" &&
3064 test "$tst_proto_getifaddrs" = "yes" &&
3065 test "$tst_compi_getifaddrs" = "yes" &&
3066 test "$tst_allow_getifaddrs" = "yes" &&
3067 test "$tst_works_getifaddrs" != "no"; then
3068 AC_MSG_RESULT([yes])
3069 AC_DEFINE_UNQUOTED(HAVE_GETIFADDRS, 1,
3070 [Define to 1 if you have a working getifaddrs function.])
3071 curl_cv_func_getifaddrs="yes"
3074 curl_cv_func_getifaddrs="no"
3079 dnl CURL_CHECK_FUNC_GETSERVBYPORT_R
3080 dnl -------------------------------------------------
3081 dnl Verify if getservbyport_r is available, prototyped,
3082 dnl and can be compiled. If all of these are true, and
3083 dnl usage has not been previously disallowed with
3084 dnl shell variable curl_disallow_getservbyport_r, then
3085 dnl HAVE_GETSERVBYPORT_R will be defined.
3087 AC_DEFUN([CURL_CHECK_FUNC_GETSERVBYPORT_R], [
3088 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
3090 tst_links_getservbyport_r="unknown"
3091 tst_proto_getservbyport_r="unknown"
3092 tst_compi_getservbyport_r="unknown"
3093 tst_allow_getservbyport_r="unknown"
3094 tst_nargs_getservbyport_r="unknown"
3096 AC_MSG_CHECKING([if getservbyport_r can be linked])
3098 AC_LANG_FUNC_LINK_TRY([getservbyport_r])
3100 AC_MSG_RESULT([yes])
3101 tst_links_getservbyport_r="yes"
3104 tst_links_getservbyport_r="no"
3107 if test "$tst_links_getservbyport_r" = "yes"; then
3108 AC_MSG_CHECKING([if getservbyport_r is prototyped])
3109 AC_EGREP_CPP([getservbyport_r],[
3110 $curl_includes_netdb
3112 AC_MSG_RESULT([yes])
3113 tst_proto_getservbyport_r="yes"
3116 tst_proto_getservbyport_r="no"
3120 if test "$tst_proto_getservbyport_r" = "yes"; then
3121 if test "$tst_nargs_getservbyport_r" = "unknown"; then
3122 AC_MSG_CHECKING([if getservbyport_r takes 4 args.])
3125 $curl_includes_netdb
3127 if(0 != getservbyport_r(0, 0, 0, 0))
3131 AC_MSG_RESULT([yes])
3132 tst_compi_getservbyport_r="yes"
3133 tst_nargs_getservbyport_r="4"
3136 tst_compi_getservbyport_r="no"
3139 if test "$tst_nargs_getservbyport_r" = "unknown"; then
3140 AC_MSG_CHECKING([if getservbyport_r takes 5 args.])
3143 $curl_includes_netdb
3145 if(0 != getservbyport_r(0, 0, 0, 0, 0))
3149 AC_MSG_RESULT([yes])
3150 tst_compi_getservbyport_r="yes"
3151 tst_nargs_getservbyport_r="5"
3154 tst_compi_getservbyport_r="no"
3157 if test "$tst_nargs_getservbyport_r" = "unknown"; then
3158 AC_MSG_CHECKING([if getservbyport_r takes 6 args.])
3161 $curl_includes_netdb
3163 if(0 != getservbyport_r(0, 0, 0, 0, 0, 0))
3167 AC_MSG_RESULT([yes])
3168 tst_compi_getservbyport_r="yes"
3169 tst_nargs_getservbyport_r="6"
3172 tst_compi_getservbyport_r="no"
3175 AC_MSG_CHECKING([if getservbyport_r is compilable])
3176 if test "$tst_compi_getservbyport_r" = "yes"; then
3177 AC_MSG_RESULT([yes])
3183 if test "$tst_compi_getservbyport_r" = "yes"; then
3184 AC_MSG_CHECKING([if getservbyport_r usage allowed])
3185 if test "x$curl_disallow_getservbyport_r" != "xyes"; then
3186 AC_MSG_RESULT([yes])
3187 tst_allow_getservbyport_r="yes"
3190 tst_allow_getservbyport_r="no"
3194 AC_MSG_CHECKING([if getservbyport_r might be used])
3195 if test "$tst_links_getservbyport_r" = "yes" &&
3196 test "$tst_proto_getservbyport_r" = "yes" &&
3197 test "$tst_compi_getservbyport_r" = "yes" &&
3198 test "$tst_allow_getservbyport_r" = "yes"; then
3199 AC_MSG_RESULT([yes])
3200 AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1,
3201 [Define to 1 if you have the getservbyport_r function.])
3202 AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r,
3203 [Specifies the number of arguments to getservbyport_r])
3204 if test "$tst_nargs_getservbyport_r" -eq "4"; then
3205 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
3206 [Specifies the size of the buffer to pass to getservbyport_r])
3208 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
3209 [Specifies the size of the buffer to pass to getservbyport_r])
3211 curl_cv_func_getservbyport_r="yes"
3214 curl_cv_func_getservbyport_r="no"
3219 dnl CURL_CHECK_FUNC_GETXATTR
3220 dnl -------------------------------------------------
3221 dnl Verify if getxattr is available, prototyped, and
3222 dnl can be compiled. If all of these are true, and
3223 dnl usage has not been previously disallowed with
3224 dnl shell variable curl_disallow_getxattr, then
3225 dnl HAVE_GETXATTR will be defined.
3227 AC_DEFUN([CURL_CHECK_FUNC_GETXATTR], [
3228 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
3230 tst_links_getxattr="unknown"
3231 tst_proto_getxattr="unknown"
3232 tst_compi_getxattr="unknown"
3233 tst_allow_getxattr="unknown"
3234 tst_nargs_getxattr="unknown"
3236 AC_MSG_CHECKING([if getxattr can be linked])
3238 AC_LANG_FUNC_LINK_TRY([getxattr])
3240 AC_MSG_RESULT([yes])
3241 tst_links_getxattr="yes"
3244 tst_links_getxattr="no"
3247 if test "$tst_links_getxattr" = "yes"; then
3248 AC_MSG_CHECKING([if getxattr is prototyped])
3249 AC_EGREP_CPP([getxattr],[
3250 $curl_includes_sys_xattr
3252 AC_MSG_RESULT([yes])
3253 tst_proto_getxattr="yes"
3256 tst_proto_getxattr="no"
3260 if test "$tst_proto_getxattr" = "yes"; then
3261 if test "$tst_nargs_getxattr" = "unknown"; then
3262 AC_MSG_CHECKING([if getxattr takes 4 args.])
3265 $curl_includes_sys_xattr
3267 if(0 != getxattr(0, 0, 0, 0))
3271 AC_MSG_RESULT([yes])
3272 tst_compi_getxattr="yes"
3273 tst_nargs_getxattr="4"
3276 tst_compi_getxattr="no"
3279 if test "$tst_nargs_getxattr" = "unknown"; then
3280 AC_MSG_CHECKING([if getxattr takes 6 args.])
3283 $curl_includes_sys_xattr
3285 if(0 != getxattr(0, 0, 0, 0, 0, 0))
3289 AC_MSG_RESULT([yes])
3290 tst_compi_getxattr="yes"
3291 tst_nargs_getxattr="6"
3294 tst_compi_getxattr="no"
3297 AC_MSG_CHECKING([if getxattr is compilable])
3298 if test "$tst_compi_getxattr" = "yes"; then
3299 AC_MSG_RESULT([yes])
3305 if test "$tst_compi_getxattr" = "yes"; then
3306 AC_MSG_CHECKING([if getxattr usage allowed])
3307 if test "x$curl_disallow_getxattr" != "xyes"; then
3308 AC_MSG_RESULT([yes])
3309 tst_allow_getxattr="yes"
3312 tst_allow_getxattr="no"
3316 AC_MSG_CHECKING([if getxattr might be used])
3317 if test "$tst_links_getxattr" = "yes" &&
3318 test "$tst_proto_getxattr" = "yes" &&
3319 test "$tst_compi_getxattr" = "yes" &&
3320 test "$tst_allow_getxattr" = "yes"; then
3321 AC_MSG_RESULT([yes])
3322 AC_DEFINE_UNQUOTED(HAVE_GETXATTR, 1,
3323 [Define to 1 if you have the getxattr function.])
3324 dnl AC_DEFINE_UNQUOTED(GETXATTR_ARGS, $tst_nargs_getxattr,
3325 dnl [Specifies the number of arguments to getxattr])
3327 if test "$tst_nargs_getxattr" -eq "4"; then
3328 AC_DEFINE(HAVE_GETXATTR_4, 1, [getxattr() takes 4 args])
3329 elif test "$tst_nargs_getxattr" -eq "6"; then
3330 AC_DEFINE(HAVE_GETXATTR_6, 1, [getxattr() takes 6 args])
3333 curl_cv_func_getxattr="yes"
3336 curl_cv_func_getxattr="no"
3341 dnl CURL_CHECK_FUNC_GMTIME_R
3342 dnl -------------------------------------------------
3343 dnl Verify if gmtime_r is available, prototyped, can
3344 dnl be compiled and seems to work. If all of these are
3345 dnl true, and usage has not been previously disallowed
3346 dnl with shell variable curl_disallow_gmtime_r, then
3347 dnl HAVE_GMTIME_R will be defined.
3349 AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
3350 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3351 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
3353 tst_links_gmtime_r="unknown"
3354 tst_proto_gmtime_r="unknown"
3355 tst_compi_gmtime_r="unknown"
3356 tst_works_gmtime_r="unknown"
3357 tst_allow_gmtime_r="unknown"
3359 AC_MSG_CHECKING([if gmtime_r can be linked])
3361 AC_LANG_FUNC_LINK_TRY([gmtime_r])
3363 AC_MSG_RESULT([yes])
3364 tst_links_gmtime_r="yes"
3367 tst_links_gmtime_r="no"
3370 if test "$tst_links_gmtime_r" = "yes"; then
3371 AC_MSG_CHECKING([if gmtime_r is prototyped])
3372 AC_EGREP_CPP([gmtime_r],[
3375 AC_MSG_RESULT([yes])
3376 tst_proto_gmtime_r="yes"
3379 tst_proto_gmtime_r="no"
3383 if test "$tst_proto_gmtime_r" = "yes"; then
3384 AC_MSG_CHECKING([if gmtime_r is compilable])
3389 if(0 != gmtime_r(0, 0))
3393 AC_MSG_RESULT([yes])
3394 tst_compi_gmtime_r="yes"
3397 tst_compi_gmtime_r="no"
3401 dnl only do runtime verification when not cross-compiling
3402 if test "x$cross_compiling" != "xyes" &&
3403 test "$tst_compi_gmtime_r" = "yes"; then
3404 AC_MSG_CHECKING([if gmtime_r seems to work])
3407 $curl_includes_stdlib
3410 time_t local = 1170352587;
3413 gmt = gmtime_r(&local, &result);
3420 AC_MSG_RESULT([yes])
3421 tst_works_gmtime_r="yes"
3424 tst_works_gmtime_r="no"
3428 if test "$tst_compi_gmtime_r" = "yes" &&
3429 test "$tst_works_gmtime_r" != "no"; then
3430 AC_MSG_CHECKING([if gmtime_r usage allowed])
3431 if test "x$curl_disallow_gmtime_r" != "xyes"; then
3432 AC_MSG_RESULT([yes])
3433 tst_allow_gmtime_r="yes"
3436 tst_allow_gmtime_r="no"
3440 AC_MSG_CHECKING([if gmtime_r might be used])
3441 if test "$tst_links_gmtime_r" = "yes" &&
3442 test "$tst_proto_gmtime_r" = "yes" &&
3443 test "$tst_compi_gmtime_r" = "yes" &&
3444 test "$tst_allow_gmtime_r" = "yes" &&
3445 test "$tst_works_gmtime_r" != "no"; then
3446 AC_MSG_RESULT([yes])
3447 AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1,
3448 [Define to 1 if you have a working gmtime_r function.])
3449 curl_cv_func_gmtime_r="yes"
3452 curl_cv_func_gmtime_r="no"
3457 dnl CURL_CHECK_FUNC_INET_NTOA_R
3458 dnl -------------------------------------------------
3459 dnl Verify if inet_ntoa_r is available, prototyped,
3460 dnl and can be compiled. If all of these are true, and
3461 dnl usage has not been previously disallowed with
3462 dnl shell variable curl_disallow_inet_ntoa_r, then
3463 dnl HAVE_INET_NTOA_R will be defined.
3465 AC_DEFUN([CURL_CHECK_FUNC_INET_NTOA_R], [
3466 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
3468 tst_links_inet_ntoa_r="unknown"
3469 tst_proto_inet_ntoa_r="unknown"
3470 tst_compi_inet_ntoa_r="unknown"
3471 tst_allow_inet_ntoa_r="unknown"
3472 tst_nargs_inet_ntoa_r="unknown"
3474 AC_MSG_CHECKING([if inet_ntoa_r can be linked])
3476 AC_LANG_FUNC_LINK_TRY([inet_ntoa_r])
3478 AC_MSG_RESULT([yes])
3479 tst_links_inet_ntoa_r="yes"
3482 tst_links_inet_ntoa_r="no"
3485 if test "$tst_links_inet_ntoa_r" = "yes"; then
3486 AC_MSG_CHECKING([if inet_ntoa_r is prototyped])
3487 AC_EGREP_CPP([inet_ntoa_r],[
3488 $curl_includes_arpa_inet
3490 AC_MSG_RESULT([yes])
3491 tst_proto_inet_ntoa_r="yes"
3494 tst_proto_inet_ntoa_r="no"
3498 if test "$tst_proto_inet_ntoa_r" = "yes"; then
3499 if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
3500 AC_MSG_CHECKING([if inet_ntoa_r takes 2 args.])
3503 $curl_includes_arpa_inet
3505 struct in_addr addr;
3506 if(0 != inet_ntoa_r(addr, 0))
3510 AC_MSG_RESULT([yes])
3511 tst_compi_inet_ntoa_r="yes"
3512 tst_nargs_inet_ntoa_r="2"
3515 tst_compi_inet_ntoa_r="no"
3518 if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
3519 AC_MSG_CHECKING([if inet_ntoa_r takes 3 args.])
3522 $curl_includes_arpa_inet
3524 struct in_addr addr;
3525 if(0 != inet_ntoa_r(addr, 0, 0))
3529 AC_MSG_RESULT([yes])
3530 tst_compi_inet_ntoa_r="yes"
3531 tst_nargs_inet_ntoa_r="3"
3534 tst_compi_inet_ntoa_r="no"
3537 AC_MSG_CHECKING([if inet_ntoa_r is compilable])
3538 if test "$tst_compi_inet_ntoa_r" = "yes"; then
3539 AC_MSG_RESULT([yes])
3545 if test "$tst_compi_inet_ntoa_r" = "yes"; then
3546 AC_MSG_CHECKING([if inet_ntoa_r usage allowed])
3547 if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then
3548 AC_MSG_RESULT([yes])
3549 tst_allow_inet_ntoa_r="yes"
3552 tst_allow_inet_ntoa_r="no"
3556 AC_MSG_CHECKING([if inet_ntoa_r might be used])
3557 if test "$tst_links_inet_ntoa_r" = "yes" &&
3558 test "$tst_proto_inet_ntoa_r" = "yes" &&
3559 test "$tst_compi_inet_ntoa_r" = "yes" &&
3560 test "$tst_allow_inet_ntoa_r" = "yes"; then
3561 AC_MSG_RESULT([yes])
3562 AC_DEFINE_UNQUOTED(HAVE_INET_NTOA_R, 1,
3563 [Define to 1 if you have the inet_ntoa_r function.])
3564 dnl AC_DEFINE_UNQUOTED(INET_NTOA_R_ARGS, $tst_nargs_inet_ntoa_r,
3565 dnl [Specifies the number of arguments to inet_ntoa_r])
3567 if test "$tst_nargs_inet_ntoa_r" -eq "2"; then
3568 AC_DEFINE(HAVE_INET_NTOA_R_2, 1, [inet_ntoa_r() takes 2 args])
3569 elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then
3570 AC_DEFINE(HAVE_INET_NTOA_R_3, 1, [inet_ntoa_r() takes 3 args])
3573 curl_cv_func_inet_ntoa_r="yes"
3576 curl_cv_func_inet_ntoa_r="no"
3581 dnl CURL_CHECK_FUNC_INET_NTOP
3582 dnl -------------------------------------------------
3583 dnl Verify if inet_ntop is available, prototyped, can
3584 dnl be compiled and seems to work. If all of these are
3585 dnl true, and usage has not been previously disallowed
3586 dnl with shell variable curl_disallow_inet_ntop, then
3587 dnl HAVE_INET_NTOP will be defined.
3589 AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [
3590 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3591 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
3592 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3594 tst_links_inet_ntop="unknown"
3595 tst_proto_inet_ntop="unknown"
3596 tst_compi_inet_ntop="unknown"
3597 tst_works_inet_ntop="unknown"
3598 tst_allow_inet_ntop="unknown"
3600 AC_MSG_CHECKING([if inet_ntop can be linked])
3602 AC_LANG_FUNC_LINK_TRY([inet_ntop])
3604 AC_MSG_RESULT([yes])
3605 tst_links_inet_ntop="yes"
3608 tst_links_inet_ntop="no"
3611 if test "$tst_links_inet_ntop" = "yes"; then
3612 AC_MSG_CHECKING([if inet_ntop is prototyped])
3613 AC_EGREP_CPP([inet_ntop],[
3614 $curl_includes_arpa_inet
3616 AC_MSG_RESULT([yes])
3617 tst_proto_inet_ntop="yes"
3620 tst_proto_inet_ntop="no"
3624 if test "$tst_proto_inet_ntop" = "yes"; then
3625 AC_MSG_CHECKING([if inet_ntop is compilable])
3628 $curl_includes_arpa_inet
3630 if(0 != inet_ntop(0, 0, 0, 0))
3634 AC_MSG_RESULT([yes])
3635 tst_compi_inet_ntop="yes"
3638 tst_compi_inet_ntop="no"
3642 dnl only do runtime verification when not cross-compiling
3643 if test "x$cross_compiling" != "xyes" &&
3644 test "$tst_compi_inet_ntop" = "yes"; then
3645 AC_MSG_CHECKING([if inet_ntop seems to work])
3648 $curl_includes_stdlib
3649 $curl_includes_arpa_inet
3650 $curl_includes_string
3652 char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
3653 char ipv4res[sizeof "255.255.255.255"];
3654 unsigned char ipv6a[26];
3655 unsigned char ipv4a[5];
3666 ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
3669 if(ipv4ptr != ipv4res)
3673 if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
3677 memset(ipv6a, 0, sizeof(ipv6a));
3690 ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
3693 if(ipv6ptr != ipv6res)
3697 if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
3703 AC_MSG_RESULT([yes])
3704 tst_works_inet_ntop="yes"
3707 tst_works_inet_ntop="no"
3711 if test "$tst_compi_inet_ntop" = "yes" &&
3712 test "$tst_works_inet_ntop" != "no"; then
3713 AC_MSG_CHECKING([if inet_ntop usage allowed])
3714 if test "x$curl_disallow_inet_ntop" != "xyes"; then
3715 AC_MSG_RESULT([yes])
3716 tst_allow_inet_ntop="yes"
3719 tst_allow_inet_ntop="no"
3723 AC_MSG_CHECKING([if inet_ntop might be used])
3724 if test "$tst_links_inet_ntop" = "yes" &&
3725 test "$tst_proto_inet_ntop" = "yes" &&
3726 test "$tst_compi_inet_ntop" = "yes" &&
3727 test "$tst_allow_inet_ntop" = "yes" &&
3728 test "$tst_works_inet_ntop" != "no"; then
3729 AC_MSG_RESULT([yes])
3730 AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1,
3731 [Define to 1 if you have a IPv6 capable working inet_ntop function.])
3732 curl_cv_func_inet_ntop="yes"
3735 curl_cv_func_inet_ntop="no"
3740 dnl CURL_CHECK_FUNC_INET_PTON
3741 dnl -------------------------------------------------
3742 dnl Verify if inet_pton is available, prototyped, can
3743 dnl be compiled and seems to work. If all of these are
3744 dnl true, and usage has not been previously disallowed
3745 dnl with shell variable curl_disallow_inet_pton, then
3746 dnl HAVE_INET_PTON will be defined.
3748 AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
3749 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3750 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
3751 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3753 tst_links_inet_pton="unknown"
3754 tst_proto_inet_pton="unknown"
3755 tst_compi_inet_pton="unknown"
3756 tst_works_inet_pton="unknown"
3757 tst_allow_inet_pton="unknown"
3759 AC_MSG_CHECKING([if inet_pton can be linked])
3761 AC_LANG_FUNC_LINK_TRY([inet_pton])
3763 AC_MSG_RESULT([yes])
3764 tst_links_inet_pton="yes"
3767 tst_links_inet_pton="no"
3770 if test "$tst_links_inet_pton" = "yes"; then
3771 AC_MSG_CHECKING([if inet_pton is prototyped])
3772 AC_EGREP_CPP([inet_pton],[
3773 $curl_includes_arpa_inet
3775 AC_MSG_RESULT([yes])
3776 tst_proto_inet_pton="yes"
3779 tst_proto_inet_pton="no"
3783 if test "$tst_proto_inet_pton" = "yes"; then
3784 AC_MSG_CHECKING([if inet_pton is compilable])
3787 $curl_includes_arpa_inet
3789 if(0 != inet_pton(0, 0, 0))
3793 AC_MSG_RESULT([yes])
3794 tst_compi_inet_pton="yes"
3797 tst_compi_inet_pton="no"
3801 dnl only do runtime verification when not cross-compiling
3802 if test "x$cross_compiling" != "xyes" &&
3803 test "$tst_compi_inet_pton" = "yes"; then
3804 AC_MSG_CHECKING([if inet_pton seems to work])
3807 $curl_includes_stdlib
3808 $curl_includes_arpa_inet
3809 $curl_includes_string
3811 unsigned char ipv6a[16+1];
3812 unsigned char ipv4a[4+1];
3813 const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
3814 const char *ipv4src = "192.168.100.1";
3816 memset(ipv4a, 1, sizeof(ipv4a));
3817 if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
3820 if( (ipv4a[0] != 0xc0) ||
3821 (ipv4a[1] != 0xa8) ||
3822 (ipv4a[2] != 0x64) ||
3823 (ipv4a[3] != 0x01) ||
3824 (ipv4a[4] != 0x01) )
3827 memset(ipv6a, 1, sizeof(ipv6a));
3828 if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
3831 if( (ipv6a[0] != 0xfe) ||
3832 (ipv6a[1] != 0x80) ||
3833 (ipv6a[8] != 0x02) ||
3834 (ipv6a[9] != 0x14) ||
3835 (ipv6a[10] != 0x4f) ||
3836 (ipv6a[11] != 0xff) ||
3837 (ipv6a[12] != 0xfe) ||
3838 (ipv6a[13] != 0x0b) ||
3839 (ipv6a[14] != 0x76) ||
3840 (ipv6a[15] != 0xc8) ||
3841 (ipv6a[16] != 0x01) )
3844 if( (ipv6a[2] != 0x0) ||
3845 (ipv6a[3] != 0x0) ||
3846 (ipv6a[4] != 0x0) ||
3847 (ipv6a[5] != 0x0) ||
3848 (ipv6a[6] != 0x0) ||
3855 AC_MSG_RESULT([yes])
3856 tst_works_inet_pton="yes"
3859 tst_works_inet_pton="no"
3863 if test "$tst_compi_inet_pton" = "yes" &&
3864 test "$tst_works_inet_pton" != "no"; then
3865 AC_MSG_CHECKING([if inet_pton usage allowed])
3866 if test "x$curl_disallow_inet_pton" != "xyes"; then
3867 AC_MSG_RESULT([yes])
3868 tst_allow_inet_pton="yes"
3871 tst_allow_inet_pton="no"
3875 AC_MSG_CHECKING([if inet_pton might be used])
3876 if test "$tst_links_inet_pton" = "yes" &&
3877 test "$tst_proto_inet_pton" = "yes" &&
3878 test "$tst_compi_inet_pton" = "yes" &&
3879 test "$tst_allow_inet_pton" = "yes" &&
3880 test "$tst_works_inet_pton" != "no"; then
3881 AC_MSG_RESULT([yes])
3882 AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1,
3883 [Define to 1 if you have a IPv6 capable working inet_pton function.])
3884 curl_cv_func_inet_pton="yes"
3887 curl_cv_func_inet_pton="no"
3892 dnl CURL_CHECK_FUNC_IOCTL
3893 dnl -------------------------------------------------
3894 dnl Verify if ioctl is available, prototyped, and
3895 dnl can be compiled. If all of these are true, and
3896 dnl usage has not been previously disallowed with
3897 dnl shell variable curl_disallow_ioctl, then
3898 dnl HAVE_IOCTL will be defined.
3900 AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [
3901 AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
3903 tst_links_ioctl="unknown"
3904 tst_proto_ioctl="unknown"
3905 tst_compi_ioctl="unknown"
3906 tst_allow_ioctl="unknown"
3908 AC_MSG_CHECKING([if ioctl can be linked])
3910 AC_LANG_FUNC_LINK_TRY([ioctl])
3912 AC_MSG_RESULT([yes])
3913 tst_links_ioctl="yes"
3916 tst_links_ioctl="no"
3919 if test "$tst_links_ioctl" = "yes"; then
3920 AC_MSG_CHECKING([if ioctl is prototyped])
3921 AC_EGREP_CPP([ioctl],[
3922 $curl_includes_stropts
3924 AC_MSG_RESULT([yes])
3925 tst_proto_ioctl="yes"
3928 tst_proto_ioctl="no"
3932 if test "$tst_proto_ioctl" = "yes"; then
3933 AC_MSG_CHECKING([if ioctl is compilable])
3936 $curl_includes_stropts
3938 if(0 != ioctl(0, 0, 0))
3942 AC_MSG_RESULT([yes])
3943 tst_compi_ioctl="yes"
3946 tst_compi_ioctl="no"
3950 if test "$tst_compi_ioctl" = "yes"; then
3951 AC_MSG_CHECKING([if ioctl usage allowed])
3952 if test "x$curl_disallow_ioctl" != "xyes"; then
3953 AC_MSG_RESULT([yes])
3954 tst_allow_ioctl="yes"
3957 tst_allow_ioctl="no"
3961 AC_MSG_CHECKING([if ioctl might be used])
3962 if test "$tst_links_ioctl" = "yes" &&
3963 test "$tst_proto_ioctl" = "yes" &&
3964 test "$tst_compi_ioctl" = "yes" &&
3965 test "$tst_allow_ioctl" = "yes"; then
3966 AC_MSG_RESULT([yes])
3967 AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1,
3968 [Define to 1 if you have the ioctl function.])
3969 curl_cv_func_ioctl="yes"
3970 CURL_CHECK_FUNC_IOCTL_FIONBIO
3971 CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
3974 curl_cv_func_ioctl="no"
3979 dnl CURL_CHECK_FUNC_IOCTL_FIONBIO
3980 dnl -------------------------------------------------
3981 dnl Verify if ioctl with the FIONBIO command is
3982 dnl available, can be compiled, and seems to work. If
3983 dnl all of these are true, then HAVE_IOCTL_FIONBIO
3984 dnl will be defined.
3986 AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [
3988 tst_compi_ioctl_fionbio="unknown"
3989 tst_allow_ioctl_fionbio="unknown"
3991 if test "$curl_cv_func_ioctl" = "yes"; then
3992 AC_MSG_CHECKING([if ioctl FIONBIO is compilable])
3995 $curl_includes_stropts
3998 if(0 != ioctl(0, FIONBIO, &flags))
4002 AC_MSG_RESULT([yes])
4003 tst_compi_ioctl_fionbio="yes"
4006 tst_compi_ioctl_fionbio="no"
4010 if test "$tst_compi_ioctl_fionbio" = "yes"; then
4011 AC_MSG_CHECKING([if ioctl FIONBIO usage allowed])
4012 if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then
4013 AC_MSG_RESULT([yes])
4014 tst_allow_ioctl_fionbio="yes"
4017 tst_allow_ioctl_fionbio="no"
4021 AC_MSG_CHECKING([if ioctl FIONBIO might be used])
4022 if test "$tst_compi_ioctl_fionbio" = "yes" &&
4023 test "$tst_allow_ioctl_fionbio" = "yes"; then
4024 AC_MSG_RESULT([yes])
4025 AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1,
4026 [Define to 1 if you have a working ioctl FIONBIO function.])
4027 curl_cv_func_ioctl_fionbio="yes"
4030 curl_cv_func_ioctl_fionbio="no"
4035 dnl CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
4036 dnl -------------------------------------------------
4037 dnl Verify if ioctl with the SIOCGIFADDR command is available,
4038 dnl struct ifreq is defined, they can be compiled, and seem to
4039 dnl work. If all of these are true, then HAVE_IOCTL_SIOCGIFADDR
4040 dnl will be defined.
4042 AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [
4044 tst_compi_ioctl_siocgifaddr="unknown"
4045 tst_allow_ioctl_siocgifaddr="unknown"
4047 if test "$curl_cv_func_ioctl" = "yes"; then
4048 AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable])
4051 $curl_includes_stropts
4055 if(0 != ioctl(0, SIOCGIFADDR, &ifr))
4059 AC_MSG_RESULT([yes])
4060 tst_compi_ioctl_siocgifaddr="yes"
4063 tst_compi_ioctl_siocgifaddr="no"
4067 if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then
4068 AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed])
4069 if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then
4070 AC_MSG_RESULT([yes])
4071 tst_allow_ioctl_siocgifaddr="yes"
4074 tst_allow_ioctl_siocgifaddr="no"
4078 AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used])
4079 if test "$tst_compi_ioctl_siocgifaddr" = "yes" &&
4080 test "$tst_allow_ioctl_siocgifaddr" = "yes"; then
4081 AC_MSG_RESULT([yes])
4082 AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1,
4083 [Define to 1 if you have a working ioctl SIOCGIFADDR function.])
4084 curl_cv_func_ioctl_siocgifaddr="yes"
4087 curl_cv_func_ioctl_siocgifaddr="no"
4092 dnl CURL_CHECK_FUNC_IOCTLSOCKET
4093 dnl -------------------------------------------------
4094 dnl Verify if ioctlsocket is available, prototyped, and
4095 dnl can be compiled. If all of these are true, and
4096 dnl usage has not been previously disallowed with
4097 dnl shell variable curl_disallow_ioctlsocket, then
4098 dnl HAVE_IOCTLSOCKET will be defined.
4100 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [
4101 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
4103 tst_links_ioctlsocket="unknown"
4104 tst_proto_ioctlsocket="unknown"
4105 tst_compi_ioctlsocket="unknown"
4106 tst_allow_ioctlsocket="unknown"
4108 AC_MSG_CHECKING([if ioctlsocket can be linked])
4111 $curl_includes_winsock2
4113 if(0 != ioctlsocket(0, 0, 0))
4117 AC_MSG_RESULT([yes])
4118 tst_links_ioctlsocket="yes"
4121 tst_links_ioctlsocket="no"
4124 if test "$tst_links_ioctlsocket" = "yes"; then
4125 AC_MSG_CHECKING([if ioctlsocket is prototyped])
4126 AC_EGREP_CPP([ioctlsocket],[
4127 $curl_includes_winsock2
4129 AC_MSG_RESULT([yes])
4130 tst_proto_ioctlsocket="yes"
4133 tst_proto_ioctlsocket="no"
4137 if test "$tst_proto_ioctlsocket" = "yes"; then
4138 AC_MSG_CHECKING([if ioctlsocket is compilable])
4141 $curl_includes_winsock2
4143 if(0 != ioctlsocket(0, 0, 0))
4147 AC_MSG_RESULT([yes])
4148 tst_compi_ioctlsocket="yes"
4151 tst_compi_ioctlsocket="no"
4155 if test "$tst_compi_ioctlsocket" = "yes"; then
4156 AC_MSG_CHECKING([if ioctlsocket usage allowed])
4157 if test "x$curl_disallow_ioctlsocket" != "xyes"; then
4158 AC_MSG_RESULT([yes])
4159 tst_allow_ioctlsocket="yes"
4162 tst_allow_ioctlsocket="no"
4166 AC_MSG_CHECKING([if ioctlsocket might be used])
4167 if test "$tst_links_ioctlsocket" = "yes" &&
4168 test "$tst_proto_ioctlsocket" = "yes" &&
4169 test "$tst_compi_ioctlsocket" = "yes" &&
4170 test "$tst_allow_ioctlsocket" = "yes"; then
4171 AC_MSG_RESULT([yes])
4172 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1,
4173 [Define to 1 if you have the ioctlsocket function.])
4174 curl_cv_func_ioctlsocket="yes"
4175 CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
4178 curl_cv_func_ioctlsocket="no"
4183 dnl CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
4184 dnl -------------------------------------------------
4185 dnl Verify if ioctlsocket with the FIONBIO command is
4186 dnl available, can be compiled, and seems to work. If
4187 dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO
4188 dnl will be defined.
4190 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [
4192 tst_compi_ioctlsocket_fionbio="unknown"
4193 tst_allow_ioctlsocket_fionbio="unknown"
4195 if test "$curl_cv_func_ioctlsocket" = "yes"; then
4196 AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable])
4199 $curl_includes_winsock2
4202 if(0 != ioctlsocket(0, FIONBIO, &flags))
4206 AC_MSG_RESULT([yes])
4207 tst_compi_ioctlsocket_fionbio="yes"
4210 tst_compi_ioctlsocket_fionbio="no"
4214 if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then
4215 AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed])
4216 if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then
4217 AC_MSG_RESULT([yes])
4218 tst_allow_ioctlsocket_fionbio="yes"
4221 tst_allow_ioctlsocket_fionbio="no"
4225 AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used])
4226 if test "$tst_compi_ioctlsocket_fionbio" = "yes" &&
4227 test "$tst_allow_ioctlsocket_fionbio" = "yes"; then
4228 AC_MSG_RESULT([yes])
4229 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1,
4230 [Define to 1 if you have a working ioctlsocket FIONBIO function.])
4231 curl_cv_func_ioctlsocket_fionbio="yes"
4234 curl_cv_func_ioctlsocket_fionbio="no"
4239 dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
4240 dnl -------------------------------------------------
4241 dnl Verify if IoctlSocket is available, prototyped, and
4242 dnl can be compiled. If all of these are true, and
4243 dnl usage has not been previously disallowed with
4244 dnl shell variable curl_disallow_ioctlsocket_camel,
4245 dnl then HAVE_IOCTLSOCKET_CAMEL will be defined.
4247 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
4248 AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
4250 tst_links_ioctlsocket_camel="unknown"
4251 tst_proto_ioctlsocket_camel="unknown"
4252 tst_compi_ioctlsocket_camel="unknown"
4253 tst_allow_ioctlsocket_camel="unknown"
4255 AC_MSG_CHECKING([if IoctlSocket can be linked])
4257 AC_LANG_FUNC_LINK_TRY([IoctlSocket])
4259 AC_MSG_RESULT([yes])
4260 tst_links_ioctlsocket_camel="yes"
4263 tst_links_ioctlsocket_camel="no"
4266 if test "$tst_links_ioctlsocket_camel" = "yes"; then
4267 AC_MSG_CHECKING([if IoctlSocket is prototyped])
4268 AC_EGREP_CPP([IoctlSocket],[
4269 $curl_includes_stropts
4271 AC_MSG_RESULT([yes])
4272 tst_proto_ioctlsocket_camel="yes"
4275 tst_proto_ioctlsocket_camel="no"
4279 if test "$tst_proto_ioctlsocket_camel" = "yes"; then
4280 AC_MSG_CHECKING([if IoctlSocket is compilable])
4283 $curl_includes_stropts
4285 if(0 != IoctlSocket(0, 0, 0))
4289 AC_MSG_RESULT([yes])
4290 tst_compi_ioctlsocket_camel="yes"
4293 tst_compi_ioctlsocket_camel="no"
4297 if test "$tst_compi_ioctlsocket_camel" = "yes"; then
4298 AC_MSG_CHECKING([if IoctlSocket usage allowed])
4299 if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then
4300 AC_MSG_RESULT([yes])
4301 tst_allow_ioctlsocket_camel="yes"
4304 tst_allow_ioctlsocket_camel="no"
4308 AC_MSG_CHECKING([if IoctlSocket might be used])
4309 if test "$tst_links_ioctlsocket_camel" = "yes" &&
4310 test "$tst_proto_ioctlsocket_camel" = "yes" &&
4311 test "$tst_compi_ioctlsocket_camel" = "yes" &&
4312 test "$tst_allow_ioctlsocket_camel" = "yes"; then
4313 AC_MSG_RESULT([yes])
4314 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1,
4315 [Define to 1 if you have the IoctlSocket camel case function.])
4316 curl_cv_func_ioctlsocket_camel="yes"
4317 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
4320 curl_cv_func_ioctlsocket_camel="no"
4325 dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
4326 dnl -------------------------------------------------
4327 dnl Verify if IoctlSocket with FIONBIO command is available,
4328 dnl can be compiled, and seems to work. If all of these are
4329 dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined.
4331 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [
4333 tst_compi_ioctlsocket_camel_fionbio="unknown"
4334 tst_allow_ioctlsocket_camel_fionbio="unknown"
4336 if test "$curl_cv_func_ioctlsocket_camel" = "yes"; then
4337 AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable])
4340 $curl_includes_stropts
4343 if(0 != ioctlsocket(0, FIONBIO, &flags))
4347 AC_MSG_RESULT([yes])
4348 tst_compi_ioctlsocket_camel_fionbio="yes"
4351 tst_compi_ioctlsocket_camel_fionbio="no"
4355 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then
4356 AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed])
4357 if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then
4358 AC_MSG_RESULT([yes])
4359 tst_allow_ioctlsocket_camel_fionbio="yes"
4362 tst_allow_ioctlsocket_camel_fionbio="no"
4366 AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used])
4367 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" &&
4368 test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then
4369 AC_MSG_RESULT([yes])
4370 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1,
4371 [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.])
4372 curl_cv_func_ioctlsocket_camel_fionbio="yes"
4375 curl_cv_func_ioctlsocket_camel_fionbio="no"
4380 dnl CURL_CHECK_FUNC_LISTXATTR
4381 dnl -------------------------------------------------
4382 dnl Verify if listxattr is available, prototyped, and
4383 dnl can be compiled. If all of these are true, and
4384 dnl usage has not been previously disallowed with
4385 dnl shell variable curl_disallow_listxattr, then
4386 dnl HAVE_LISTXATTR will be defined.
4388 AC_DEFUN([CURL_CHECK_FUNC_LISTXATTR], [
4389 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
4391 tst_links_listxattr="unknown"
4392 tst_proto_listxattr="unknown"
4393 tst_compi_listxattr="unknown"
4394 tst_allow_listxattr="unknown"
4395 tst_nargs_listxattr="unknown"
4397 AC_MSG_CHECKING([if listxattr can be linked])
4399 AC_LANG_FUNC_LINK_TRY([listxattr])
4401 AC_MSG_RESULT([yes])
4402 tst_links_listxattr="yes"
4405 tst_links_listxattr="no"
4408 if test "$tst_links_listxattr" = "yes"; then
4409 AC_MSG_CHECKING([if listxattr is prototyped])
4410 AC_EGREP_CPP([listxattr],[
4411 $curl_includes_sys_xattr
4413 AC_MSG_RESULT([yes])
4414 tst_proto_listxattr="yes"
4417 tst_proto_listxattr="no"
4421 if test "$tst_proto_listxattr" = "yes"; then
4422 if test "$tst_nargs_listxattr" = "unknown"; then
4423 AC_MSG_CHECKING([if listxattr takes 3 args.])
4426 $curl_includes_sys_xattr
4428 if(0 != listxattr(0, 0, 0))
4432 AC_MSG_RESULT([yes])
4433 tst_compi_listxattr="yes"
4434 tst_nargs_listxattr="3"
4437 tst_compi_listxattr="no"
4440 if test "$tst_nargs_listxattr" = "unknown"; then
4441 AC_MSG_CHECKING([if listxattr takes 4 args.])
4444 $curl_includes_sys_xattr
4446 if(0 != listxattr(0, 0, 0, 0))
4450 AC_MSG_RESULT([yes])
4451 tst_compi_listxattr="yes"
4452 tst_nargs_listxattr="4"
4455 tst_compi_listxattr="no"
4458 AC_MSG_CHECKING([if listxattr is compilable])
4459 if test "$tst_compi_listxattr" = "yes"; then
4460 AC_MSG_RESULT([yes])
4466 if test "$tst_compi_listxattr" = "yes"; then
4467 AC_MSG_CHECKING([if listxattr usage allowed])
4468 if test "x$curl_disallow_listxattr" != "xyes"; then
4469 AC_MSG_RESULT([yes])
4470 tst_allow_listxattr="yes"
4473 tst_allow_listxattr="no"
4477 AC_MSG_CHECKING([if listxattr might be used])
4478 if test "$tst_links_listxattr" = "yes" &&
4479 test "$tst_proto_listxattr" = "yes" &&
4480 test "$tst_compi_listxattr" = "yes" &&
4481 test "$tst_allow_listxattr" = "yes"; then
4482 AC_MSG_RESULT([yes])
4483 AC_DEFINE_UNQUOTED(HAVE_LISTXATTR, 1,
4484 [Define to 1 if you have the listxattr function.])
4485 dnl AC_DEFINE_UNQUOTED(LISTXATTR_ARGS, $tst_nargs_listxattr,
4486 dnl [Specifies the number of arguments to listxattr])
4488 if test "$tst_nargs_listxattr" -eq "3"; then
4489 AC_DEFINE(HAVE_LISTXATTR_3, 1, [listxattr() takes 3 args])
4490 elif test "$tst_nargs_listxattr" -eq "4"; then
4491 AC_DEFINE(HAVE_LISTXATTR_4, 1, [listxattr() takes 4 args])
4494 curl_cv_func_listxattr="yes"
4497 curl_cv_func_listxattr="no"
4502 dnl CURL_CHECK_FUNC_LOCALTIME_R
4503 dnl -------------------------------------------------
4504 dnl Verify if localtime_r is available, prototyped, can
4505 dnl be compiled and seems to work. If all of these are
4506 dnl true, and usage has not been previously disallowed
4507 dnl with shell variable curl_disallow_localtime_r, then
4508 dnl HAVE_LOCALTIME_R will be defined.
4510 AC_DEFUN([CURL_CHECK_FUNC_LOCALTIME_R], [
4511 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
4512 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
4514 tst_links_localtime_r="unknown"
4515 tst_proto_localtime_r="unknown"
4516 tst_compi_localtime_r="unknown"
4517 tst_works_localtime_r="unknown"
4518 tst_allow_localtime_r="unknown"
4520 AC_MSG_CHECKING([if localtime_r can be linked])
4522 AC_LANG_FUNC_LINK_TRY([localtime_r])
4524 AC_MSG_RESULT([yes])
4525 tst_links_localtime_r="yes"
4528 tst_links_localtime_r="no"
4531 if test "$tst_links_localtime_r" = "yes"; then
4532 AC_MSG_CHECKING([if localtime_r is prototyped])
4533 AC_EGREP_CPP([localtime_r],[
4536 AC_MSG_RESULT([yes])
4537 tst_proto_localtime_r="yes"
4540 tst_proto_localtime_r="no"
4544 if test "$tst_proto_localtime_r" = "yes"; then
4545 AC_MSG_CHECKING([if localtime_r is compilable])
4550 if(0 != localtime_r(0, 0))
4554 AC_MSG_RESULT([yes])
4555 tst_compi_localtime_r="yes"
4558 tst_compi_localtime_r="no"
4562 dnl only do runtime verification when not cross-compiling
4563 if test "x$cross_compiling" != "xyes" &&
4564 test "$tst_compi_localtime_r" = "yes"; then
4565 AC_MSG_CHECKING([if localtime_r seems to work])
4568 $curl_includes_stdlib
4571 time_t clock = 1170352587;
4574 tmp = localtime_r(&clock, &result);
4581 AC_MSG_RESULT([yes])
4582 tst_works_localtime_r="yes"
4585 tst_works_localtime_r="no"
4589 if test "$tst_compi_localtime_r" = "yes" &&
4590 test "$tst_works_localtime_r" != "no"; then
4591 AC_MSG_CHECKING([if localtime_r usage allowed])
4592 if test "x$curl_disallow_localtime_r" != "xyes"; then
4593 AC_MSG_RESULT([yes])
4594 tst_allow_localtime_r="yes"
4597 tst_allow_localtime_r="no"
4601 AC_MSG_CHECKING([if localtime_r might be used])
4602 if test "$tst_links_localtime_r" = "yes" &&
4603 test "$tst_proto_localtime_r" = "yes" &&
4604 test "$tst_compi_localtime_r" = "yes" &&
4605 test "$tst_allow_localtime_r" = "yes" &&
4606 test "$tst_works_localtime_r" != "no"; then
4607 AC_MSG_RESULT([yes])
4608 AC_DEFINE_UNQUOTED(HAVE_LOCALTIME_R, 1,
4609 [Define to 1 if you have a working localtime_r function.])
4610 curl_cv_func_localtime_r="yes"
4613 curl_cv_func_localtime_r="no"
4618 dnl CURL_CHECK_FUNC_MEMRCHR
4619 dnl -------------------------------------------------
4620 dnl Verify if memrchr is available, prototyped, and
4621 dnl can be compiled. If all of these are true, and
4622 dnl usage has not been previously disallowed with
4623 dnl shell variable curl_disallow_memrchr, then
4624 dnl HAVE_MEMRCHR will be defined.
4626 AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [
4627 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4629 tst_links_memrchr="unknown"
4630 tst_macro_memrchr="unknown"
4631 tst_proto_memrchr="unknown"
4632 tst_compi_memrchr="unknown"
4633 tst_allow_memrchr="unknown"
4635 AC_MSG_CHECKING([if memrchr can be linked])
4637 AC_LANG_FUNC_LINK_TRY([memrchr])
4639 AC_MSG_RESULT([yes])
4640 tst_links_memrchr="yes"
4643 tst_links_memrchr="no"
4646 if test "$tst_links_memrchr" = "no"; then
4647 AC_MSG_CHECKING([if memrchr seems a macro])
4650 $curl_includes_string
4652 if(0 != memrchr(0, 0, 0))
4656 AC_MSG_RESULT([yes])
4657 tst_macro_memrchr="yes"
4660 tst_macro_memrchr="no"
4664 if test "$tst_links_memrchr" = "yes"; then
4665 AC_MSG_CHECKING([if memrchr is prototyped])
4666 AC_EGREP_CPP([memrchr],[
4667 $curl_includes_string
4669 AC_MSG_RESULT([yes])
4670 tst_proto_memrchr="yes"
4673 tst_proto_memrchr="no"
4677 if test "$tst_proto_memrchr" = "yes" ||
4678 test "$tst_macro_memrchr" = "yes"; then
4679 AC_MSG_CHECKING([if memrchr is compilable])
4682 $curl_includes_string
4684 if(0 != memrchr(0, 0, 0))
4688 AC_MSG_RESULT([yes])
4689 tst_compi_memrchr="yes"
4692 tst_compi_memrchr="no"
4696 if test "$tst_compi_memrchr" = "yes"; then
4697 AC_MSG_CHECKING([if memrchr usage allowed])
4698 if test "x$curl_disallow_memrchr" != "xyes"; then
4699 AC_MSG_RESULT([yes])
4700 tst_allow_memrchr="yes"
4703 tst_allow_memrchr="no"
4707 AC_MSG_CHECKING([if memrchr might be used])
4708 if (test "$tst_proto_memrchr" = "yes" ||
4709 test "$tst_macro_memrchr" = "yes") &&
4710 test "$tst_compi_memrchr" = "yes" &&
4711 test "$tst_allow_memrchr" = "yes"; then
4712 AC_MSG_RESULT([yes])
4713 AC_DEFINE_UNQUOTED(HAVE_MEMRCHR, 1,
4714 [Define to 1 if you have the memrchr function or macro.])
4715 curl_cv_func_memrchr="yes"
4718 curl_cv_func_memrchr="no"
4723 dnl CURL_CHECK_FUNC_POLL
4724 dnl -------------------------------------------------
4725 dnl Verify if poll is available, prototyped, can
4726 dnl be compiled and seems to work. If all of these are
4727 dnl true, and usage has not been previously disallowed
4728 dnl with shell variable curl_disallow_poll, then
4729 dnl HAVE_POLL will be defined.
4731 AC_DEFUN([CURL_CHECK_FUNC_POLL], [
4732 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
4733 AC_REQUIRE([CURL_INCLUDES_POLL])dnl
4735 tst_links_poll="unknown"
4736 tst_proto_poll="unknown"
4737 tst_compi_poll="unknown"
4738 tst_works_poll="unknown"
4739 tst_allow_poll="unknown"
4743 dnl poll() does not work on these platforms
4744 dnl Interix: "does provide poll(), but the implementing developer must
4745 dnl have been in a bad mood, because poll() only works on the /proc
4746 dnl filesystem here"
4747 dnl macOS: poll() first didn't exist, then was broken until fixed in 10.9
4748 dnl only to break again in 10.12.
4749 curl_disallow_poll="yes"
4754 AC_MSG_CHECKING([if poll can be linked])
4759 if(0 != poll(0, 0, 0))
4763 AC_MSG_RESULT([yes])
4764 tst_links_poll="yes"
4770 if test "$tst_links_poll" = "yes"; then
4771 AC_MSG_CHECKING([if poll is prototyped])
4772 AC_EGREP_CPP([poll],[
4775 AC_MSG_RESULT([yes])
4776 tst_proto_poll="yes"
4783 if test "$tst_proto_poll" = "yes"; then
4784 AC_MSG_CHECKING([if poll is compilable])
4789 if(0 != poll(0, 0, 0))
4793 AC_MSG_RESULT([yes])
4794 tst_compi_poll="yes"
4801 dnl only do runtime verification when not cross-compiling
4802 if test "x$cross_compiling" != "xyes" &&
4803 test "$tst_compi_poll" = "yes"; then
4804 AC_MSG_CHECKING([if poll seems to work])
4807 $curl_includes_stdlib
4811 /* detect the original poll() breakage */
4812 if(0 != poll(0, 0, 10))
4815 /* detect the 10.12 poll() breakage */
4816 struct timeval before, after;
4820 gettimeofday(&before, NULL);
4821 rc = poll(NULL, 0, 500);
4822 gettimeofday(&after, NULL);
4824 us = (after.tv_sec - before.tv_sec) * 1000000 +
4825 (after.tv_usec - before.tv_usec);
4832 AC_MSG_RESULT([yes])
4833 tst_works_poll="yes"
4840 if test "$tst_compi_poll" = "yes" &&
4841 test "$tst_works_poll" != "no"; then
4842 AC_MSG_CHECKING([if poll usage allowed])
4843 if test "x$curl_disallow_poll" != "xyes"; then
4844 AC_MSG_RESULT([yes])
4845 tst_allow_poll="yes"
4852 AC_MSG_CHECKING([if poll might be used])
4853 if test "$tst_links_poll" = "yes" &&
4854 test "$tst_proto_poll" = "yes" &&
4855 test "$tst_compi_poll" = "yes" &&
4856 test "$tst_allow_poll" = "yes" &&
4857 test "$tst_works_poll" != "no"; then
4858 AC_MSG_RESULT([yes])
4859 AC_DEFINE_UNQUOTED(HAVE_POLL, 1,
4860 [Define to 1 if you have a working poll function.])
4861 AC_DEFINE_UNQUOTED(HAVE_POLL_FINE, 1,
4862 [If you have a fine poll])
4863 curl_cv_func_poll="yes"
4866 curl_cv_func_poll="no"
4871 dnl CURL_CHECK_FUNC_REMOVEXATTR
4872 dnl -------------------------------------------------
4873 dnl Verify if removexattr is available, prototyped, and
4874 dnl can be compiled. If all of these are true, and
4875 dnl usage has not been previously disallowed with
4876 dnl shell variable curl_disallow_removexattr, then
4877 dnl HAVE_REMOVEXATTR will be defined.
4879 AC_DEFUN([CURL_CHECK_FUNC_REMOVEXATTR], [
4880 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
4882 tst_links_removexattr="unknown"
4883 tst_proto_removexattr="unknown"
4884 tst_compi_removexattr="unknown"
4885 tst_allow_removexattr="unknown"
4886 tst_nargs_removexattr="unknown"
4888 AC_MSG_CHECKING([if removexattr can be linked])
4890 AC_LANG_FUNC_LINK_TRY([removexattr])
4892 AC_MSG_RESULT([yes])
4893 tst_links_removexattr="yes"
4896 tst_links_removexattr="no"
4899 if test "$tst_links_removexattr" = "yes"; then
4900 AC_MSG_CHECKING([if removexattr is prototyped])
4901 AC_EGREP_CPP([removexattr],[
4902 $curl_includes_sys_xattr
4904 AC_MSG_RESULT([yes])
4905 tst_proto_removexattr="yes"
4908 tst_proto_removexattr="no"
4912 if test "$tst_proto_removexattr" = "yes"; then
4913 if test "$tst_nargs_removexattr" = "unknown"; then
4914 AC_MSG_CHECKING([if removexattr takes 2 args.])
4917 $curl_includes_sys_xattr
4919 if(0 != removexattr(0, 0))
4923 AC_MSG_RESULT([yes])
4924 tst_compi_removexattr="yes"
4925 tst_nargs_removexattr="2"
4928 tst_compi_removexattr="no"
4931 if test "$tst_nargs_removexattr" = "unknown"; then
4932 AC_MSG_CHECKING([if removexattr takes 3 args.])
4935 $curl_includes_sys_xattr
4937 if(0 != removexattr(0, 0, 0))
4941 AC_MSG_RESULT([yes])
4942 tst_compi_removexattr="yes"
4943 tst_nargs_removexattr="3"
4946 tst_compi_removexattr="no"
4949 AC_MSG_CHECKING([if removexattr is compilable])
4950 if test "$tst_compi_removexattr" = "yes"; then
4951 AC_MSG_RESULT([yes])
4957 if test "$tst_compi_removexattr" = "yes"; then
4958 AC_MSG_CHECKING([if removexattr usage allowed])
4959 if test "x$curl_disallow_removexattr" != "xyes"; then
4960 AC_MSG_RESULT([yes])
4961 tst_allow_removexattr="yes"
4964 tst_allow_removexattr="no"
4968 AC_MSG_CHECKING([if removexattr might be used])
4969 if test "$tst_links_removexattr" = "yes" &&
4970 test "$tst_proto_removexattr" = "yes" &&
4971 test "$tst_compi_removexattr" = "yes" &&
4972 test "$tst_allow_removexattr" = "yes"; then
4973 AC_MSG_RESULT([yes])
4974 AC_DEFINE_UNQUOTED(HAVE_REMOVEXATTR, 1,
4975 [Define to 1 if you have the removexattr function.])
4976 dnl AC_DEFINE_UNQUOTED(REMOVEXATTR_ARGS, $tst_nargs_removexattr,
4977 dnl [Specifies the number of arguments to removexattr])
4979 if test "$tst_nargs_removexattr" -eq "2"; then
4980 AC_DEFINE(HAVE_REMOVEXATTR_2, 1, [removexattr() takes 2 args])
4981 elif test "$tst_nargs_removexattr" -eq "3"; then
4982 AC_DEFINE(HAVE_REMOVEXATTR_3, 1, [removexattr() takes 3 args])
4985 curl_cv_func_removexattr="yes"
4988 curl_cv_func_removexattr="no"
4993 dnl CURL_CHECK_FUNC_SETSOCKOPT
4994 dnl -------------------------------------------------
4995 dnl Verify if setsockopt is available, prototyped, and
4996 dnl can be compiled. If all of these are true, and
4997 dnl usage has not been previously disallowed with
4998 dnl shell variable curl_disallow_setsockopt, then
4999 dnl HAVE_SETSOCKOPT will be defined.
5001 AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT], [
5002 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
5003 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
5005 tst_links_setsockopt="unknown"
5006 tst_proto_setsockopt="unknown"
5007 tst_compi_setsockopt="unknown"
5008 tst_allow_setsockopt="unknown"
5010 AC_MSG_CHECKING([if setsockopt can be linked])
5013 $curl_includes_winsock2
5014 $curl_includes_sys_socket
5016 if(0 != setsockopt(0, 0, 0, 0, 0))
5020 AC_MSG_RESULT([yes])
5021 tst_links_setsockopt="yes"
5024 tst_links_setsockopt="no"
5027 if test "$tst_links_setsockopt" = "yes"; then
5028 AC_MSG_CHECKING([if setsockopt is prototyped])
5029 AC_EGREP_CPP([setsockopt],[
5030 $curl_includes_winsock2
5031 $curl_includes_sys_socket
5033 AC_MSG_RESULT([yes])
5034 tst_proto_setsockopt="yes"
5037 tst_proto_setsockopt="no"
5041 if test "$tst_proto_setsockopt" = "yes"; then
5042 AC_MSG_CHECKING([if setsockopt is compilable])
5045 $curl_includes_winsock2
5046 $curl_includes_sys_socket
5048 if(0 != setsockopt(0, 0, 0, 0, 0))
5052 AC_MSG_RESULT([yes])
5053 tst_compi_setsockopt="yes"
5056 tst_compi_setsockopt="no"
5060 if test "$tst_compi_setsockopt" = "yes"; then
5061 AC_MSG_CHECKING([if setsockopt usage allowed])
5062 if test "x$curl_disallow_setsockopt" != "xyes"; then
5063 AC_MSG_RESULT([yes])
5064 tst_allow_setsockopt="yes"
5067 tst_allow_setsockopt="no"
5071 AC_MSG_CHECKING([if setsockopt might be used])
5072 if test "$tst_links_setsockopt" = "yes" &&
5073 test "$tst_proto_setsockopt" = "yes" &&
5074 test "$tst_compi_setsockopt" = "yes" &&
5075 test "$tst_allow_setsockopt" = "yes"; then
5076 AC_MSG_RESULT([yes])
5077 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT, 1,
5078 [Define to 1 if you have the setsockopt function.])
5079 curl_cv_func_setsockopt="yes"
5080 CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
5083 curl_cv_func_setsockopt="no"
5088 dnl CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
5089 dnl -------------------------------------------------
5090 dnl Verify if setsockopt with the SO_NONBLOCK command is
5091 dnl available, can be compiled, and seems to work. If
5092 dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK
5093 dnl will be defined.
5095 AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [
5097 tst_compi_setsockopt_so_nonblock="unknown"
5098 tst_allow_setsockopt_so_nonblock="unknown"
5100 if test "$curl_cv_func_setsockopt" = "yes"; then
5101 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable])
5104 $curl_includes_winsock2
5105 $curl_includes_sys_socket
5107 if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
5111 AC_MSG_RESULT([yes])
5112 tst_compi_setsockopt_so_nonblock="yes"
5115 tst_compi_setsockopt_so_nonblock="no"
5119 if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then
5120 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed])
5121 if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then
5122 AC_MSG_RESULT([yes])
5123 tst_allow_setsockopt_so_nonblock="yes"
5126 tst_allow_setsockopt_so_nonblock="no"
5130 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used])
5131 if test "$tst_compi_setsockopt_so_nonblock" = "yes" &&
5132 test "$tst_allow_setsockopt_so_nonblock" = "yes"; then
5133 AC_MSG_RESULT([yes])
5134 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1,
5135 [Define to 1 if you have a working setsockopt SO_NONBLOCK function.])
5136 curl_cv_func_setsockopt_so_nonblock="yes"
5139 curl_cv_func_setsockopt_so_nonblock="no"
5144 dnl CURL_CHECK_FUNC_SETXATTR
5145 dnl -------------------------------------------------
5146 dnl Verify if setxattr is available, prototyped, and
5147 dnl can be compiled. If all of these are true, and
5148 dnl usage has not been previously disallowed with
5149 dnl shell variable curl_disallow_setxattr, then
5150 dnl HAVE_SETXATTR will be defined.
5152 AC_DEFUN([CURL_CHECK_FUNC_SETXATTR], [
5153 AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
5155 tst_links_setxattr="unknown"
5156 tst_proto_setxattr="unknown"
5157 tst_compi_setxattr="unknown"
5158 tst_allow_setxattr="unknown"
5159 tst_nargs_setxattr="unknown"
5161 AC_MSG_CHECKING([if setxattr can be linked])
5163 AC_LANG_FUNC_LINK_TRY([setxattr])
5165 AC_MSG_RESULT([yes])
5166 tst_links_setxattr="yes"
5169 tst_links_setxattr="no"
5172 if test "$tst_links_setxattr" = "yes"; then
5173 AC_MSG_CHECKING([if setxattr is prototyped])
5174 AC_EGREP_CPP([setxattr],[
5175 $curl_includes_sys_xattr
5177 AC_MSG_RESULT([yes])
5178 tst_proto_setxattr="yes"
5181 tst_proto_setxattr="no"
5185 if test "$tst_proto_setxattr" = "yes"; then
5186 if test "$tst_nargs_setxattr" = "unknown"; then
5187 AC_MSG_CHECKING([if setxattr takes 5 args.])
5190 $curl_includes_sys_xattr
5192 if(0 != setxattr(0, 0, 0, 0, 0))
5196 AC_MSG_RESULT([yes])
5197 tst_compi_setxattr="yes"
5198 tst_nargs_setxattr="5"
5201 tst_compi_setxattr="no"
5204 if test "$tst_nargs_setxattr" = "unknown"; then
5205 AC_MSG_CHECKING([if setxattr takes 6 args.])
5208 $curl_includes_sys_xattr
5210 if(0 != setxattr(0, 0, 0, 0, 0, 0))
5214 AC_MSG_RESULT([yes])
5215 tst_compi_setxattr="yes"
5216 tst_nargs_setxattr="6"
5219 tst_compi_setxattr="no"
5222 AC_MSG_CHECKING([if setxattr is compilable])
5223 if test "$tst_compi_setxattr" = "yes"; then
5224 AC_MSG_RESULT([yes])
5230 if test "$tst_compi_setxattr" = "yes"; then
5231 AC_MSG_CHECKING([if setxattr usage allowed])
5232 if test "x$curl_disallow_setxattr" != "xyes"; then
5233 AC_MSG_RESULT([yes])
5234 tst_allow_setxattr="yes"
5237 tst_allow_setxattr="no"
5241 AC_MSG_CHECKING([if setxattr might be used])
5242 if test "$tst_links_setxattr" = "yes" &&
5243 test "$tst_proto_setxattr" = "yes" &&
5244 test "$tst_compi_setxattr" = "yes" &&
5245 test "$tst_allow_setxattr" = "yes"; then
5246 AC_MSG_RESULT([yes])
5247 AC_DEFINE_UNQUOTED(HAVE_SETXATTR, 1,
5248 [Define to 1 if you have the setxattr function.])
5249 dnl AC_DEFINE_UNQUOTED(SETXATTR_ARGS, $tst_nargs_setxattr,
5250 dnl [Specifies the number of arguments to setxattr])
5252 if test "$tst_nargs_setxattr" -eq "5"; then
5253 AC_DEFINE(HAVE_SETXATTR_5, 1, [setxattr() takes 5 args])
5254 elif test "$tst_nargs_setxattr" -eq "6"; then
5255 AC_DEFINE(HAVE_SETXATTR_6, 1, [setxattr() takes 6 args])
5258 curl_cv_func_setxattr="yes"
5261 curl_cv_func_setxattr="no"
5266 dnl CURL_CHECK_FUNC_SIGACTION
5267 dnl -------------------------------------------------
5268 dnl Verify if sigaction is available, prototyped, and
5269 dnl can be compiled. If all of these are true, and
5270 dnl usage has not been previously disallowed with
5271 dnl shell variable curl_disallow_sigaction, then
5272 dnl HAVE_SIGACTION will be defined.
5274 AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [
5275 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
5277 tst_links_sigaction="unknown"
5278 tst_proto_sigaction="unknown"
5279 tst_compi_sigaction="unknown"
5280 tst_allow_sigaction="unknown"
5282 AC_MSG_CHECKING([if sigaction can be linked])
5284 AC_LANG_FUNC_LINK_TRY([sigaction])
5286 AC_MSG_RESULT([yes])
5287 tst_links_sigaction="yes"
5290 tst_links_sigaction="no"
5293 if test "$tst_links_sigaction" = "yes"; then
5294 AC_MSG_CHECKING([if sigaction is prototyped])
5295 AC_EGREP_CPP([sigaction],[
5296 $curl_includes_signal
5298 AC_MSG_RESULT([yes])
5299 tst_proto_sigaction="yes"
5302 tst_proto_sigaction="no"
5306 if test "$tst_proto_sigaction" = "yes"; then
5307 AC_MSG_CHECKING([if sigaction is compilable])
5310 $curl_includes_signal
5312 if(0 != sigaction(0, 0, 0))
5316 AC_MSG_RESULT([yes])
5317 tst_compi_sigaction="yes"
5320 tst_compi_sigaction="no"
5324 if test "$tst_compi_sigaction" = "yes"; then
5325 AC_MSG_CHECKING([if sigaction usage allowed])
5326 if test "x$curl_disallow_sigaction" != "xyes"; then
5327 AC_MSG_RESULT([yes])
5328 tst_allow_sigaction="yes"
5331 tst_allow_sigaction="no"
5335 AC_MSG_CHECKING([if sigaction might be used])
5336 if test "$tst_links_sigaction" = "yes" &&
5337 test "$tst_proto_sigaction" = "yes" &&
5338 test "$tst_compi_sigaction" = "yes" &&
5339 test "$tst_allow_sigaction" = "yes"; then
5340 AC_MSG_RESULT([yes])
5341 AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1,
5342 [Define to 1 if you have the sigaction function.])
5343 curl_cv_func_sigaction="yes"
5346 curl_cv_func_sigaction="no"
5351 dnl CURL_CHECK_FUNC_SIGINTERRUPT
5352 dnl -------------------------------------------------
5353 dnl Verify if siginterrupt is available, prototyped, and
5354 dnl can be compiled. If all of these are true, and
5355 dnl usage has not been previously disallowed with
5356 dnl shell variable curl_disallow_siginterrupt, then
5357 dnl HAVE_SIGINTERRUPT will be defined.
5359 AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [
5360 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
5362 tst_links_siginterrupt="unknown"
5363 tst_proto_siginterrupt="unknown"
5364 tst_compi_siginterrupt="unknown"
5365 tst_allow_siginterrupt="unknown"
5367 AC_MSG_CHECKING([if siginterrupt can be linked])
5369 AC_LANG_FUNC_LINK_TRY([siginterrupt])
5371 AC_MSG_RESULT([yes])
5372 tst_links_siginterrupt="yes"
5375 tst_links_siginterrupt="no"
5378 if test "$tst_links_siginterrupt" = "yes"; then
5379 AC_MSG_CHECKING([if siginterrupt is prototyped])
5380 AC_EGREP_CPP([siginterrupt],[
5381 $curl_includes_signal
5383 AC_MSG_RESULT([yes])
5384 tst_proto_siginterrupt="yes"
5387 tst_proto_siginterrupt="no"
5391 if test "$tst_proto_siginterrupt" = "yes"; then
5392 AC_MSG_CHECKING([if siginterrupt is compilable])
5395 $curl_includes_signal
5397 if(0 != siginterrupt(0, 0))
5401 AC_MSG_RESULT([yes])
5402 tst_compi_siginterrupt="yes"
5405 tst_compi_siginterrupt="no"
5409 if test "$tst_compi_siginterrupt" = "yes"; then
5410 AC_MSG_CHECKING([if siginterrupt usage allowed])
5411 if test "x$curl_disallow_siginterrupt" != "xyes"; then
5412 AC_MSG_RESULT([yes])
5413 tst_allow_siginterrupt="yes"
5416 tst_allow_siginterrupt="no"
5420 AC_MSG_CHECKING([if siginterrupt might be used])
5421 if test "$tst_links_siginterrupt" = "yes" &&
5422 test "$tst_proto_siginterrupt" = "yes" &&
5423 test "$tst_compi_siginterrupt" = "yes" &&
5424 test "$tst_allow_siginterrupt" = "yes"; then
5425 AC_MSG_RESULT([yes])
5426 AC_DEFINE_UNQUOTED(HAVE_SIGINTERRUPT, 1,
5427 [Define to 1 if you have the siginterrupt function.])
5428 curl_cv_func_siginterrupt="yes"
5431 curl_cv_func_siginterrupt="no"
5436 dnl CURL_CHECK_FUNC_SIGNAL
5437 dnl -------------------------------------------------
5438 dnl Verify if signal is available, prototyped, and
5439 dnl can be compiled. If all of these are true, and
5440 dnl usage has not been previously disallowed with
5441 dnl shell variable curl_disallow_signal, then
5442 dnl HAVE_SIGNAL will be defined.
5444 AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [
5445 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
5447 tst_links_signal="unknown"
5448 tst_proto_signal="unknown"
5449 tst_compi_signal="unknown"
5450 tst_allow_signal="unknown"
5452 AC_MSG_CHECKING([if signal can be linked])
5454 AC_LANG_FUNC_LINK_TRY([signal])
5456 AC_MSG_RESULT([yes])
5457 tst_links_signal="yes"
5460 tst_links_signal="no"
5463 if test "$tst_links_signal" = "yes"; then
5464 AC_MSG_CHECKING([if signal is prototyped])
5465 AC_EGREP_CPP([signal],[
5466 $curl_includes_signal
5468 AC_MSG_RESULT([yes])
5469 tst_proto_signal="yes"
5472 tst_proto_signal="no"
5476 if test "$tst_proto_signal" = "yes"; then
5477 AC_MSG_CHECKING([if signal is compilable])
5480 $curl_includes_signal
5482 if(0 != signal(0, 0))
5486 AC_MSG_RESULT([yes])
5487 tst_compi_signal="yes"
5490 tst_compi_signal="no"
5494 if test "$tst_compi_signal" = "yes"; then
5495 AC_MSG_CHECKING([if signal usage allowed])
5496 if test "x$curl_disallow_signal" != "xyes"; then
5497 AC_MSG_RESULT([yes])
5498 tst_allow_signal="yes"
5501 tst_allow_signal="no"
5505 AC_MSG_CHECKING([if signal might be used])
5506 if test "$tst_links_signal" = "yes" &&
5507 test "$tst_proto_signal" = "yes" &&
5508 test "$tst_compi_signal" = "yes" &&
5509 test "$tst_allow_signal" = "yes"; then
5510 AC_MSG_RESULT([yes])
5511 AC_DEFINE_UNQUOTED(HAVE_SIGNAL, 1,
5512 [Define to 1 if you have the signal function.])
5513 curl_cv_func_signal="yes"
5516 curl_cv_func_signal="no"
5521 dnl CURL_CHECK_FUNC_SIGSETJMP
5522 dnl -------------------------------------------------
5523 dnl Verify if sigsetjmp is available, prototyped, and
5524 dnl can be compiled. If all of these are true, and
5525 dnl usage has not been previously disallowed with
5526 dnl shell variable curl_disallow_sigsetjmp, then
5527 dnl HAVE_SIGSETJMP will be defined.
5529 AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [
5530 AC_REQUIRE([CURL_INCLUDES_SETJMP])dnl
5532 tst_links_sigsetjmp="unknown"
5533 tst_macro_sigsetjmp="unknown"
5534 tst_proto_sigsetjmp="unknown"
5535 tst_compi_sigsetjmp="unknown"
5536 tst_allow_sigsetjmp="unknown"
5538 AC_MSG_CHECKING([if sigsetjmp can be linked])
5540 AC_LANG_FUNC_LINK_TRY([sigsetjmp])
5542 AC_MSG_RESULT([yes])
5543 tst_links_sigsetjmp="yes"
5546 tst_links_sigsetjmp="no"
5549 if test "$tst_links_sigsetjmp" = "no"; then
5550 AC_MSG_CHECKING([if sigsetjmp seems a macro])
5553 $curl_includes_setjmp
5556 if(0 != sigsetjmp(env, 0))
5560 AC_MSG_RESULT([yes])
5561 tst_macro_sigsetjmp="yes"
5564 tst_macro_sigsetjmp="no"
5568 if test "$tst_links_sigsetjmp" = "yes"; then
5569 AC_MSG_CHECKING([if sigsetjmp is prototyped])
5570 AC_EGREP_CPP([sigsetjmp],[
5571 $curl_includes_setjmp
5573 AC_MSG_RESULT([yes])
5574 tst_proto_sigsetjmp="yes"
5577 tst_proto_sigsetjmp="no"
5581 if test "$tst_proto_sigsetjmp" = "yes" ||
5582 test "$tst_macro_sigsetjmp" = "yes"; then
5583 AC_MSG_CHECKING([if sigsetjmp is compilable])
5586 $curl_includes_setjmp
5589 if(0 != sigsetjmp(env, 0))
5593 AC_MSG_RESULT([yes])
5594 tst_compi_sigsetjmp="yes"
5597 tst_compi_sigsetjmp="no"
5601 if test "$tst_compi_sigsetjmp" = "yes"; then
5602 AC_MSG_CHECKING([if sigsetjmp usage allowed])
5603 if test "x$curl_disallow_sigsetjmp" != "xyes"; then
5604 AC_MSG_RESULT([yes])
5605 tst_allow_sigsetjmp="yes"
5608 tst_allow_sigsetjmp="no"
5612 AC_MSG_CHECKING([if sigsetjmp might be used])
5613 if (test "$tst_proto_sigsetjmp" = "yes" ||
5614 test "$tst_macro_sigsetjmp" = "yes") &&
5615 test "$tst_compi_sigsetjmp" = "yes" &&
5616 test "$tst_allow_sigsetjmp" = "yes"; then
5617 AC_MSG_RESULT([yes])
5618 AC_DEFINE_UNQUOTED(HAVE_SIGSETJMP, 1,
5619 [Define to 1 if you have the sigsetjmp function or macro.])
5620 curl_cv_func_sigsetjmp="yes"
5623 curl_cv_func_sigsetjmp="no"
5628 dnl CURL_CHECK_FUNC_SOCKET
5629 dnl -------------------------------------------------
5630 dnl Verify if socket is available, prototyped, and
5631 dnl can be compiled. If all of these are true, and
5632 dnl usage has not been previously disallowed with
5633 dnl shell variable curl_disallow_socket, then
5634 dnl HAVE_SOCKET will be defined.
5636 AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [
5637 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
5638 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
5639 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
5641 tst_links_socket="unknown"
5642 tst_proto_socket="unknown"
5643 tst_compi_socket="unknown"
5644 tst_allow_socket="unknown"
5646 AC_MSG_CHECKING([if socket can be linked])
5649 $curl_includes_winsock2
5650 $curl_includes_sys_socket
5651 $curl_includes_socket
5653 if(0 != socket(0, 0, 0))
5657 AC_MSG_RESULT([yes])
5658 tst_links_socket="yes"
5661 tst_links_socket="no"
5664 if test "$tst_links_socket" = "yes"; then
5665 AC_MSG_CHECKING([if socket is prototyped])
5666 AC_EGREP_CPP([socket],[
5667 $curl_includes_winsock2
5668 $curl_includes_sys_socket
5669 $curl_includes_socket
5671 AC_MSG_RESULT([yes])
5672 tst_proto_socket="yes"
5675 tst_proto_socket="no"
5679 if test "$tst_proto_socket" = "yes"; then
5680 AC_MSG_CHECKING([if socket is compilable])
5683 $curl_includes_winsock2
5684 $curl_includes_sys_socket
5685 $curl_includes_socket
5687 if(0 != socket(0, 0, 0))
5691 AC_MSG_RESULT([yes])
5692 tst_compi_socket="yes"
5695 tst_compi_socket="no"
5699 if test "$tst_compi_socket" = "yes"; then
5700 AC_MSG_CHECKING([if socket usage allowed])
5701 if test "x$curl_disallow_socket" != "xyes"; then
5702 AC_MSG_RESULT([yes])
5703 tst_allow_socket="yes"
5706 tst_allow_socket="no"
5710 AC_MSG_CHECKING([if socket might be used])
5711 if test "$tst_links_socket" = "yes" &&
5712 test "$tst_proto_socket" = "yes" &&
5713 test "$tst_compi_socket" = "yes" &&
5714 test "$tst_allow_socket" = "yes"; then
5715 AC_MSG_RESULT([yes])
5716 AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1,
5717 [Define to 1 if you have the socket function.])
5718 curl_cv_func_socket="yes"
5721 curl_cv_func_socket="no"
5726 dnl CURL_CHECK_FUNC_SOCKETPAIR
5727 dnl -------------------------------------------------
5728 dnl Verify if socketpair is available, prototyped, and
5729 dnl can be compiled. If all of these are true, and
5730 dnl usage has not been previously disallowed with
5731 dnl shell variable curl_disallow_socketpair, then
5732 dnl HAVE_SOCKETPAIR will be defined.
5734 AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [
5735 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
5736 AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
5738 tst_links_socketpair="unknown"
5739 tst_proto_socketpair="unknown"
5740 tst_compi_socketpair="unknown"
5741 tst_allow_socketpair="unknown"
5743 AC_MSG_CHECKING([if socketpair can be linked])
5745 AC_LANG_FUNC_LINK_TRY([socketpair])
5747 AC_MSG_RESULT([yes])
5748 tst_links_socketpair="yes"
5751 tst_links_socketpair="no"
5754 if test "$tst_links_socketpair" = "yes"; then
5755 AC_MSG_CHECKING([if socketpair is prototyped])
5756 AC_EGREP_CPP([socketpair],[
5757 $curl_includes_sys_socket
5758 $curl_includes_socket
5760 AC_MSG_RESULT([yes])
5761 tst_proto_socketpair="yes"
5764 tst_proto_socketpair="no"
5768 if test "$tst_proto_socketpair" = "yes"; then
5769 AC_MSG_CHECKING([if socketpair is compilable])
5772 $curl_includes_sys_socket
5773 $curl_includes_socket
5776 if(0 != socketpair(0, 0, 0, sv))
5780 AC_MSG_RESULT([yes])
5781 tst_compi_socketpair="yes"
5784 tst_compi_socketpair="no"
5788 if test "$tst_compi_socketpair" = "yes"; then
5789 AC_MSG_CHECKING([if socketpair usage allowed])
5790 if test "x$curl_disallow_socketpair" != "xyes"; then
5791 AC_MSG_RESULT([yes])
5792 tst_allow_socketpair="yes"
5795 tst_allow_socketpair="no"
5799 AC_MSG_CHECKING([if socketpair might be used])
5800 if test "$tst_links_socketpair" = "yes" &&
5801 test "$tst_proto_socketpair" = "yes" &&
5802 test "$tst_compi_socketpair" = "yes" &&
5803 test "$tst_allow_socketpair" = "yes"; then
5804 AC_MSG_RESULT([yes])
5805 AC_DEFINE_UNQUOTED(HAVE_SOCKETPAIR, 1,
5806 [Define to 1 if you have the socketpair function.])
5807 curl_cv_func_socketpair="yes"
5810 curl_cv_func_socketpair="no"
5815 dnl CURL_CHECK_FUNC_STRCASECMP
5816 dnl -------------------------------------------------
5817 dnl Verify if strcasecmp is available, prototyped, and
5818 dnl can be compiled. If all of these are true, and
5819 dnl usage has not been previously disallowed with
5820 dnl shell variable curl_disallow_strcasecmp, then
5821 dnl HAVE_STRCASECMP will be defined.
5823 AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
5824 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
5826 tst_links_strcasecmp="unknown"
5827 tst_proto_strcasecmp="unknown"
5828 tst_compi_strcasecmp="unknown"
5829 tst_allow_strcasecmp="unknown"
5831 AC_MSG_CHECKING([if strcasecmp can be linked])
5833 AC_LANG_FUNC_LINK_TRY([strcasecmp])
5835 AC_MSG_RESULT([yes])
5836 tst_links_strcasecmp="yes"
5839 tst_links_strcasecmp="no"
5842 if test "$tst_links_strcasecmp" = "yes"; then
5843 AC_MSG_CHECKING([if strcasecmp is prototyped])
5844 AC_EGREP_CPP([strcasecmp],[
5845 $curl_includes_string
5847 AC_MSG_RESULT([yes])
5848 tst_proto_strcasecmp="yes"
5851 tst_proto_strcasecmp="no"
5855 if test "$tst_proto_strcasecmp" = "yes"; then
5856 AC_MSG_CHECKING([if strcasecmp is compilable])
5859 $curl_includes_string
5861 if(0 != strcasecmp(0, 0))
5865 AC_MSG_RESULT([yes])
5866 tst_compi_strcasecmp="yes"
5869 tst_compi_strcasecmp="no"
5873 if test "$tst_compi_strcasecmp" = "yes"; then
5874 AC_MSG_CHECKING([if strcasecmp usage allowed])
5875 if test "x$curl_disallow_strcasecmp" != "xyes"; then
5876 AC_MSG_RESULT([yes])
5877 tst_allow_strcasecmp="yes"
5880 tst_allow_strcasecmp="no"
5884 AC_MSG_CHECKING([if strcasecmp might be used])
5885 if test "$tst_links_strcasecmp" = "yes" &&
5886 test "$tst_proto_strcasecmp" = "yes" &&
5887 test "$tst_compi_strcasecmp" = "yes" &&
5888 test "$tst_allow_strcasecmp" = "yes"; then
5889 AC_MSG_RESULT([yes])
5890 AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
5891 [Define to 1 if you have the strcasecmp function.])
5892 curl_cv_func_strcasecmp="yes"
5895 curl_cv_func_strcasecmp="no"
5899 dnl CURL_CHECK_FUNC_STRCMPI
5900 dnl -------------------------------------------------
5901 dnl Verify if strcmpi is available, prototyped, and
5902 dnl can be compiled. If all of these are true, and
5903 dnl usage has not been previously disallowed with
5904 dnl shell variable curl_disallow_strcmpi, then
5905 dnl HAVE_STRCMPI will be defined.
5907 AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
5908 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
5910 tst_links_strcmpi="unknown"
5911 tst_proto_strcmpi="unknown"
5912 tst_compi_strcmpi="unknown"
5913 tst_allow_strcmpi="unknown"
5915 AC_MSG_CHECKING([if strcmpi can be linked])
5917 AC_LANG_FUNC_LINK_TRY([strcmpi])
5919 AC_MSG_RESULT([yes])
5920 tst_links_strcmpi="yes"
5923 tst_links_strcmpi="no"
5926 if test "$tst_links_strcmpi" = "yes"; then
5927 AC_MSG_CHECKING([if strcmpi is prototyped])
5928 AC_EGREP_CPP([strcmpi],[
5929 $curl_includes_string
5931 AC_MSG_RESULT([yes])
5932 tst_proto_strcmpi="yes"
5935 tst_proto_strcmpi="no"
5939 if test "$tst_proto_strcmpi" = "yes"; then
5940 AC_MSG_CHECKING([if strcmpi is compilable])
5943 $curl_includes_string
5945 if(0 != strcmpi(0, 0))
5949 AC_MSG_RESULT([yes])
5950 tst_compi_strcmpi="yes"
5953 tst_compi_strcmpi="no"
5957 if test "$tst_compi_strcmpi" = "yes"; then
5958 AC_MSG_CHECKING([if strcmpi usage allowed])
5959 if test "x$curl_disallow_strcmpi" != "xyes"; then
5960 AC_MSG_RESULT([yes])
5961 tst_allow_strcmpi="yes"
5964 tst_allow_strcmpi="no"
5968 AC_MSG_CHECKING([if strcmpi might be used])
5969 if test "$tst_links_strcmpi" = "yes" &&
5970 test "$tst_proto_strcmpi" = "yes" &&
5971 test "$tst_compi_strcmpi" = "yes" &&
5972 test "$tst_allow_strcmpi" = "yes"; then
5973 AC_MSG_RESULT([yes])
5974 AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
5975 [Define to 1 if you have the strcmpi function.])
5976 curl_cv_func_strcmpi="yes"
5979 curl_cv_func_strcmpi="no"
5984 dnl CURL_CHECK_FUNC_STRDUP
5985 dnl -------------------------------------------------
5986 dnl Verify if strdup is available, prototyped, and
5987 dnl can be compiled. If all of these are true, and
5988 dnl usage has not been previously disallowed with
5989 dnl shell variable curl_disallow_strdup, then
5990 dnl HAVE_STRDUP will be defined.
5992 AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [
5993 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
5995 tst_links_strdup="unknown"
5996 tst_proto_strdup="unknown"
5997 tst_compi_strdup="unknown"
5998 tst_allow_strdup="unknown"
6000 AC_MSG_CHECKING([if strdup can be linked])
6002 AC_LANG_FUNC_LINK_TRY([strdup])
6004 AC_MSG_RESULT([yes])
6005 tst_links_strdup="yes"
6008 tst_links_strdup="no"
6011 if test "$tst_links_strdup" = "yes"; then
6012 AC_MSG_CHECKING([if strdup is prototyped])
6013 AC_EGREP_CPP([strdup],[
6014 $curl_includes_string
6016 AC_MSG_RESULT([yes])
6017 tst_proto_strdup="yes"
6020 tst_proto_strdup="no"
6024 if test "$tst_proto_strdup" = "yes"; then
6025 AC_MSG_CHECKING([if strdup is compilable])
6028 $curl_includes_string
6034 AC_MSG_RESULT([yes])
6035 tst_compi_strdup="yes"
6038 tst_compi_strdup="no"
6042 if test "$tst_compi_strdup" = "yes"; then
6043 AC_MSG_CHECKING([if strdup usage allowed])
6044 if test "x$curl_disallow_strdup" != "xyes"; then
6045 AC_MSG_RESULT([yes])
6046 tst_allow_strdup="yes"
6049 tst_allow_strdup="no"
6053 AC_MSG_CHECKING([if strdup might be used])
6054 if test "$tst_links_strdup" = "yes" &&
6055 test "$tst_proto_strdup" = "yes" &&
6056 test "$tst_compi_strdup" = "yes" &&
6057 test "$tst_allow_strdup" = "yes"; then
6058 AC_MSG_RESULT([yes])
6059 AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
6060 [Define to 1 if you have the strdup function.])
6061 curl_cv_func_strdup="yes"
6064 curl_cv_func_strdup="no"
6069 dnl CURL_CHECK_FUNC_STRERROR_R
6070 dnl -------------------------------------------------
6071 dnl Verify if strerror_r is available, prototyped, can be compiled and
6072 dnl seems to work. If all of these are true, and usage has not been
6073 dnl previously disallowed with shell variable curl_disallow_strerror_r,
6074 dnl then HAVE_STRERROR_R and STRERROR_R_TYPE_ARG3 will be defined, as
6075 dnl well as one of HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R.
6077 dnl glibc-style strerror_r:
6079 dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize);
6081 dnl glibc-style strerror_r returns a pointer to the the error string,
6082 dnl and might use the provided workbuf as a scratch area if needed. A
6083 dnl quick test on a few systems shows that it's usually not used at all.
6085 dnl POSIX-style strerror_r:
6087 dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize);
6089 dnl POSIX-style strerror_r returns 0 upon successful completion and the
6090 dnl error string in the provided resultbuf.
6093 AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
6094 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
6095 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6097 tst_links_strerror_r="unknown"
6098 tst_proto_strerror_r="unknown"
6099 tst_compi_strerror_r="unknown"
6100 tst_glibc_strerror_r="unknown"
6101 tst_posix_strerror_r="unknown"
6102 tst_allow_strerror_r="unknown"
6103 tst_works_glibc_strerror_r="unknown"
6104 tst_works_posix_strerror_r="unknown"
6105 tst_glibc_strerror_r_type_arg3="unknown"
6106 tst_posix_strerror_r_type_arg3="unknown"
6108 AC_MSG_CHECKING([if strerror_r can be linked])
6110 AC_LANG_FUNC_LINK_TRY([strerror_r])
6112 AC_MSG_RESULT([yes])
6113 tst_links_strerror_r="yes"
6116 tst_links_strerror_r="no"
6119 if test "$tst_links_strerror_r" = "yes"; then
6120 AC_MSG_CHECKING([if strerror_r is prototyped])
6121 AC_EGREP_CPP([strerror_r],[
6122 $curl_includes_string
6124 AC_MSG_RESULT([yes])
6125 tst_proto_strerror_r="yes"
6128 tst_proto_strerror_r="no"
6132 if test "$tst_proto_strerror_r" = "yes"; then
6133 AC_MSG_CHECKING([if strerror_r is compilable])
6136 $curl_includes_string
6138 if(0 != strerror_r(0, 0, 0))
6142 AC_MSG_RESULT([yes])
6143 tst_compi_strerror_r="yes"
6146 tst_compi_strerror_r="no"
6150 if test "$tst_compi_strerror_r" = "yes"; then
6151 AC_MSG_CHECKING([if strerror_r is glibc like])
6152 tst_glibc_strerror_r_type_arg3="unknown"
6153 for arg3 in 'size_t' 'int' 'unsigned int'; do
6154 if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then
6157 $curl_includes_string
6158 char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
6160 if(0 != strerror_r(0, 0, 0))
6164 tst_glibc_strerror_r_type_arg3="$arg3"
6168 case "$tst_glibc_strerror_r_type_arg3" in
6171 tst_glibc_strerror_r="no"
6174 AC_MSG_RESULT([yes])
6175 tst_glibc_strerror_r="yes"
6180 dnl only do runtime verification when not cross-compiling
6181 if test "x$cross_compiling" != "xyes" &&
6182 test "$tst_glibc_strerror_r" = "yes"; then
6183 AC_MSG_CHECKING([if strerror_r seems to work])
6186 $curl_includes_stdlib
6187 $curl_includes_string
6193 string = strerror_r(EACCES, buffer, sizeof(buffer));
6202 AC_MSG_RESULT([yes])
6203 tst_works_glibc_strerror_r="yes"
6206 tst_works_glibc_strerror_r="no"
6210 if test "$tst_compi_strerror_r" = "yes" &&
6211 test "$tst_works_glibc_strerror_r" != "yes"; then
6212 AC_MSG_CHECKING([if strerror_r is POSIX like])
6213 tst_posix_strerror_r_type_arg3="unknown"
6214 for arg3 in 'size_t' 'int' 'unsigned int'; do
6215 if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then
6218 $curl_includes_string
6219 int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
6221 if(0 != strerror_r(0, 0, 0))
6225 tst_posix_strerror_r_type_arg3="$arg3"
6229 case "$tst_posix_strerror_r_type_arg3" in
6232 tst_posix_strerror_r="no"
6235 AC_MSG_RESULT([yes])
6236 tst_posix_strerror_r="yes"
6241 dnl only do runtime verification when not cross-compiling
6242 if test "x$cross_compiling" != "xyes" &&
6243 test "$tst_posix_strerror_r" = "yes"; then
6244 AC_MSG_CHECKING([if strerror_r seems to work])
6247 $curl_includes_stdlib
6248 $curl_includes_string
6254 error = strerror_r(EACCES, buffer, sizeof(buffer));
6257 if(buffer[0] == '\0')
6263 AC_MSG_RESULT([yes])
6264 tst_works_posix_strerror_r="yes"
6267 tst_works_posix_strerror_r="no"
6271 if test "$tst_works_glibc_strerror_r" = "yes"; then
6272 tst_posix_strerror_r="no"
6274 if test "$tst_works_posix_strerror_r" = "yes"; then
6275 tst_glibc_strerror_r="no"
6277 if test "$tst_glibc_strerror_r" = "yes" &&
6278 test "$tst_works_glibc_strerror_r" != "no" &&
6279 test "$tst_posix_strerror_r" != "yes"; then
6280 tst_allow_strerror_r="check"
6282 if test "$tst_posix_strerror_r" = "yes" &&
6283 test "$tst_works_posix_strerror_r" != "no" &&
6284 test "$tst_glibc_strerror_r" != "yes"; then
6285 tst_allow_strerror_r="check"
6287 if test "$tst_allow_strerror_r" = "check"; then
6288 AC_MSG_CHECKING([if strerror_r usage allowed])
6289 if test "x$curl_disallow_strerror_r" != "xyes"; then
6290 AC_MSG_RESULT([yes])
6291 tst_allow_strerror_r="yes"
6294 tst_allow_strerror_r="no"
6298 AC_MSG_CHECKING([if strerror_r might be used])
6299 if test "$tst_links_strerror_r" = "yes" &&
6300 test "$tst_proto_strerror_r" = "yes" &&
6301 test "$tst_compi_strerror_r" = "yes" &&
6302 test "$tst_allow_strerror_r" = "yes"; then
6303 AC_MSG_RESULT([yes])
6304 if test "$tst_glibc_strerror_r" = "yes"; then
6305 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
6306 [Define to 1 if you have the strerror_r function.])
6307 AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1,
6308 [Define to 1 if you have a working glibc-style strerror_r function.])
6309 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_glibc_strerror_r_type_arg3,
6310 [Define to the type of arg 3 for strerror_r.])
6312 if test "$tst_posix_strerror_r" = "yes"; then
6313 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
6314 [Define to 1 if you have the strerror_r function.])
6315 AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1,
6316 [Define to 1 if you have a working POSIX-style strerror_r function.])
6317 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_posix_strerror_r_type_arg3,
6318 [Define to the type of arg 3 for strerror_r.])
6320 curl_cv_func_strerror_r="yes"
6323 curl_cv_func_strerror_r="no"
6326 if test "$tst_compi_strerror_r" = "yes" &&
6327 test "$tst_allow_strerror_r" = "unknown"; then
6328 AC_MSG_WARN([cannot determine strerror_r() style: edit lib/curl_config.h manually.])
6334 dnl CURL_CHECK_FUNC_STRICMP
6335 dnl -------------------------------------------------
6336 dnl Verify if stricmp is available, prototyped, and
6337 dnl can be compiled. If all of these are true, and
6338 dnl usage has not been previously disallowed with
6339 dnl shell variable curl_disallow_stricmp, then
6340 dnl HAVE_STRICMP will be defined.
6342 AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [
6343 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6345 tst_links_stricmp="unknown"
6346 tst_proto_stricmp="unknown"
6347 tst_compi_stricmp="unknown"
6348 tst_allow_stricmp="unknown"
6350 AC_MSG_CHECKING([if stricmp can be linked])
6352 AC_LANG_FUNC_LINK_TRY([stricmp])
6354 AC_MSG_RESULT([yes])
6355 tst_links_stricmp="yes"
6358 tst_links_stricmp="no"
6361 if test "$tst_links_stricmp" = "yes"; then
6362 AC_MSG_CHECKING([if stricmp is prototyped])
6363 AC_EGREP_CPP([stricmp],[
6364 $curl_includes_string
6366 AC_MSG_RESULT([yes])
6367 tst_proto_stricmp="yes"
6370 tst_proto_stricmp="no"
6374 if test "$tst_proto_stricmp" = "yes"; then
6375 AC_MSG_CHECKING([if stricmp is compilable])
6378 $curl_includes_string
6380 if(0 != stricmp(0, 0))
6384 AC_MSG_RESULT([yes])
6385 tst_compi_stricmp="yes"
6388 tst_compi_stricmp="no"
6392 if test "$tst_compi_stricmp" = "yes"; then
6393 AC_MSG_CHECKING([if stricmp usage allowed])
6394 if test "x$curl_disallow_stricmp" != "xyes"; then
6395 AC_MSG_RESULT([yes])
6396 tst_allow_stricmp="yes"
6399 tst_allow_stricmp="no"
6403 AC_MSG_CHECKING([if stricmp might be used])
6404 if test "$tst_links_stricmp" = "yes" &&
6405 test "$tst_proto_stricmp" = "yes" &&
6406 test "$tst_compi_stricmp" = "yes" &&
6407 test "$tst_allow_stricmp" = "yes"; then
6408 AC_MSG_RESULT([yes])
6409 AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
6410 [Define to 1 if you have the stricmp function.])
6411 curl_cv_func_stricmp="yes"
6414 curl_cv_func_stricmp="no"
6418 dnl CURL_CHECK_FUNC_STRNCASECMP
6419 dnl -------------------------------------------------
6420 dnl Verify if strncasecmp is available, prototyped, and
6421 dnl can be compiled. If all of these are true, and
6422 dnl usage has not been previously disallowed with
6423 dnl shell variable curl_disallow_strncasecmp, then
6424 dnl HAVE_STRNCASECMP will be defined.
6426 AC_DEFUN([CURL_CHECK_FUNC_STRNCASECMP], [
6427 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6429 tst_links_strncasecmp="unknown"
6430 tst_proto_strncasecmp="unknown"
6431 tst_compi_strncasecmp="unknown"
6432 tst_allow_strncasecmp="unknown"
6434 AC_MSG_CHECKING([if strncasecmp can be linked])
6436 AC_LANG_FUNC_LINK_TRY([strncasecmp])
6438 AC_MSG_RESULT([yes])
6439 tst_links_strncasecmp="yes"
6442 tst_links_strncasecmp="no"
6445 if test "$tst_links_strncasecmp" = "yes"; then
6446 AC_MSG_CHECKING([if strncasecmp is prototyped])
6447 AC_EGREP_CPP([strncasecmp],[
6448 $curl_includes_string
6450 AC_MSG_RESULT([yes])
6451 tst_proto_strncasecmp="yes"
6454 tst_proto_strncasecmp="no"
6458 if test "$tst_proto_strncasecmp" = "yes"; then
6459 AC_MSG_CHECKING([if strncasecmp is compilable])
6462 $curl_includes_string
6464 if(0 != strncasecmp(0, 0, 0))
6468 AC_MSG_RESULT([yes])
6469 tst_compi_strncasecmp="yes"
6472 tst_compi_strncasecmp="no"
6476 if test "$tst_compi_strncasecmp" = "yes"; then
6477 AC_MSG_CHECKING([if strncasecmp usage allowed])
6478 if test "x$curl_disallow_strncasecmp" != "xyes"; then
6479 AC_MSG_RESULT([yes])
6480 tst_allow_strncasecmp="yes"
6483 tst_allow_strncasecmp="no"
6487 AC_MSG_CHECKING([if strncasecmp might be used])
6488 if test "$tst_links_strncasecmp" = "yes" &&
6489 test "$tst_proto_strncasecmp" = "yes" &&
6490 test "$tst_compi_strncasecmp" = "yes" &&
6491 test "$tst_allow_strncasecmp" = "yes"; then
6492 AC_MSG_RESULT([yes])
6493 AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1,
6494 [Define to 1 if you have the strncasecmp function.])
6495 curl_cv_func_strncasecmp="yes"
6498 curl_cv_func_strncasecmp="no"
6503 dnl CURL_CHECK_FUNC_STRNCMPI
6504 dnl -------------------------------------------------
6505 dnl Verify if strncmpi is available, prototyped, and
6506 dnl can be compiled. If all of these are true, and
6507 dnl usage has not been previously disallowed with
6508 dnl shell variable curl_disallow_strncmpi, then
6509 dnl HAVE_STRNCMPI will be defined.
6511 AC_DEFUN([CURL_CHECK_FUNC_STRNCMPI], [
6512 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6514 tst_links_strncmpi="unknown"
6515 tst_proto_strncmpi="unknown"
6516 tst_compi_strncmpi="unknown"
6517 tst_allow_strncmpi="unknown"
6519 AC_MSG_CHECKING([if strncmpi can be linked])
6521 AC_LANG_FUNC_LINK_TRY([strncmpi])
6523 AC_MSG_RESULT([yes])
6524 tst_links_strncmpi="yes"
6527 tst_links_strncmpi="no"
6530 if test "$tst_links_strncmpi" = "yes"; then
6531 AC_MSG_CHECKING([if strncmpi is prototyped])
6532 AC_EGREP_CPP([strncmpi],[
6533 $curl_includes_string
6535 AC_MSG_RESULT([yes])
6536 tst_proto_strncmpi="yes"
6539 tst_proto_strncmpi="no"
6543 if test "$tst_proto_strncmpi" = "yes"; then
6544 AC_MSG_CHECKING([if strncmpi is compilable])
6547 $curl_includes_string
6549 if(0 != strncmpi(0, 0))
6553 AC_MSG_RESULT([yes])
6554 tst_compi_strncmpi="yes"
6557 tst_compi_strncmpi="no"
6561 if test "$tst_compi_strncmpi" = "yes"; then
6562 AC_MSG_CHECKING([if strncmpi usage allowed])
6563 if test "x$curl_disallow_strncmpi" != "xyes"; then
6564 AC_MSG_RESULT([yes])
6565 tst_allow_strncmpi="yes"
6568 tst_allow_strncmpi="no"
6572 AC_MSG_CHECKING([if strncmpi might be used])
6573 if test "$tst_links_strncmpi" = "yes" &&
6574 test "$tst_proto_strncmpi" = "yes" &&
6575 test "$tst_compi_strncmpi" = "yes" &&
6576 test "$tst_allow_strncmpi" = "yes"; then
6577 AC_MSG_RESULT([yes])
6578 AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1,
6579 [Define to 1 if you have the strncmpi function.])
6580 curl_cv_func_strncmpi="yes"
6583 curl_cv_func_strncmpi="no"
6588 dnl CURL_CHECK_FUNC_STRNICMP
6589 dnl -------------------------------------------------
6590 dnl Verify if strnicmp is available, prototyped, and
6591 dnl can be compiled. If all of these are true, and
6592 dnl usage has not been previously disallowed with
6593 dnl shell variable curl_disallow_strnicmp, then
6594 dnl HAVE_STRNICMP will be defined.
6596 AC_DEFUN([CURL_CHECK_FUNC_STRNICMP], [
6597 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6599 tst_links_strnicmp="unknown"
6600 tst_proto_strnicmp="unknown"
6601 tst_compi_strnicmp="unknown"
6602 tst_allow_strnicmp="unknown"
6604 AC_MSG_CHECKING([if strnicmp can be linked])
6606 AC_LANG_FUNC_LINK_TRY([strnicmp])
6608 AC_MSG_RESULT([yes])
6609 tst_links_strnicmp="yes"
6612 tst_links_strnicmp="no"
6615 if test "$tst_links_strnicmp" = "yes"; then
6616 AC_MSG_CHECKING([if strnicmp is prototyped])
6617 AC_EGREP_CPP([strnicmp],[
6618 $curl_includes_string
6620 AC_MSG_RESULT([yes])
6621 tst_proto_strnicmp="yes"
6624 tst_proto_strnicmp="no"
6628 if test "$tst_proto_strnicmp" = "yes"; then
6629 AC_MSG_CHECKING([if strnicmp is compilable])
6632 $curl_includes_string
6634 if(0 != strnicmp(0, 0))
6638 AC_MSG_RESULT([yes])
6639 tst_compi_strnicmp="yes"
6642 tst_compi_strnicmp="no"
6646 if test "$tst_compi_strnicmp" = "yes"; then
6647 AC_MSG_CHECKING([if strnicmp usage allowed])
6648 if test "x$curl_disallow_strnicmp" != "xyes"; then
6649 AC_MSG_RESULT([yes])
6650 tst_allow_strnicmp="yes"
6653 tst_allow_strnicmp="no"
6657 AC_MSG_CHECKING([if strnicmp might be used])
6658 if test "$tst_links_strnicmp" = "yes" &&
6659 test "$tst_proto_strnicmp" = "yes" &&
6660 test "$tst_compi_strnicmp" = "yes" &&
6661 test "$tst_allow_strnicmp" = "yes"; then
6662 AC_MSG_RESULT([yes])
6663 AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1,
6664 [Define to 1 if you have the strnicmp function.])
6665 curl_cv_func_strnicmp="yes"
6668 curl_cv_func_strnicmp="no"
6673 dnl CURL_CHECK_FUNC_STRSTR
6674 dnl -------------------------------------------------
6675 dnl Verify if strstr is available, prototyped, and
6676 dnl can be compiled. If all of these are true, and
6677 dnl usage has not been previously disallowed with
6678 dnl shell variable curl_disallow_strstr, then
6679 dnl HAVE_STRSTR will be defined.
6681 AC_DEFUN([CURL_CHECK_FUNC_STRSTR], [
6682 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6684 tst_links_strstr="unknown"
6685 tst_proto_strstr="unknown"
6686 tst_compi_strstr="unknown"
6687 tst_allow_strstr="unknown"
6689 AC_MSG_CHECKING([if strstr can be linked])
6691 AC_LANG_FUNC_LINK_TRY([strstr])
6693 AC_MSG_RESULT([yes])
6694 tst_links_strstr="yes"
6697 tst_links_strstr="no"
6700 if test "$tst_links_strstr" = "yes"; then
6701 AC_MSG_CHECKING([if strstr is prototyped])
6702 AC_EGREP_CPP([strstr],[
6703 $curl_includes_string
6705 AC_MSG_RESULT([yes])
6706 tst_proto_strstr="yes"
6709 tst_proto_strstr="no"
6713 if test "$tst_proto_strstr" = "yes"; then
6714 AC_MSG_CHECKING([if strstr is compilable])
6717 $curl_includes_string
6719 if(0 != strstr(0, 0))
6723 AC_MSG_RESULT([yes])
6724 tst_compi_strstr="yes"
6727 tst_compi_strstr="no"
6731 if test "$tst_compi_strstr" = "yes"; then
6732 AC_MSG_CHECKING([if strstr usage allowed])
6733 if test "x$curl_disallow_strstr" != "xyes"; then
6734 AC_MSG_RESULT([yes])
6735 tst_allow_strstr="yes"
6738 tst_allow_strstr="no"
6742 AC_MSG_CHECKING([if strstr might be used])
6743 if test "$tst_links_strstr" = "yes" &&
6744 test "$tst_proto_strstr" = "yes" &&
6745 test "$tst_compi_strstr" = "yes" &&
6746 test "$tst_allow_strstr" = "yes"; then
6747 AC_MSG_RESULT([yes])
6748 AC_DEFINE_UNQUOTED(HAVE_STRSTR, 1,
6749 [Define to 1 if you have the strstr function.])
6750 curl_cv_func_strstr="yes"
6753 curl_cv_func_strstr="no"
6758 dnl CURL_CHECK_FUNC_STRTOK_R
6759 dnl -------------------------------------------------
6760 dnl Verify if strtok_r is available, prototyped, and
6761 dnl can be compiled. If all of these are true, and
6762 dnl usage has not been previously disallowed with
6763 dnl shell variable curl_disallow_strtok_r, then
6764 dnl HAVE_STRTOK_R will be defined.
6766 AC_DEFUN([CURL_CHECK_FUNC_STRTOK_R], [
6767 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
6769 tst_links_strtok_r="unknown"
6770 tst_proto_strtok_r="unknown"
6771 tst_compi_strtok_r="unknown"
6772 tst_allow_strtok_r="unknown"
6774 AC_MSG_CHECKING([if strtok_r can be linked])
6776 AC_LANG_FUNC_LINK_TRY([strtok_r])
6778 AC_MSG_RESULT([yes])
6779 tst_links_strtok_r="yes"
6782 tst_links_strtok_r="no"
6785 if test "$tst_links_strtok_r" = "yes"; then
6786 AC_MSG_CHECKING([if strtok_r is prototyped])
6787 AC_EGREP_CPP([strtok_r],[
6788 $curl_includes_string
6790 AC_MSG_RESULT([yes])
6791 tst_proto_strtok_r="yes"
6794 tst_proto_strtok_r="no"
6798 if test "$tst_proto_strtok_r" = "yes"; then
6799 AC_MSG_CHECKING([if strtok_r is compilable])
6802 $curl_includes_string
6804 if(0 != strtok_r(0, 0, 0))
6808 AC_MSG_RESULT([yes])
6809 tst_compi_strtok_r="yes"
6812 tst_compi_strtok_r="no"
6816 if test "$tst_compi_strtok_r" = "yes"; then
6817 AC_MSG_CHECKING([if strtok_r usage allowed])
6818 if test "x$curl_disallow_strtok_r" != "xyes"; then
6819 AC_MSG_RESULT([yes])
6820 tst_allow_strtok_r="yes"
6823 tst_allow_strtok_r="no"
6827 AC_MSG_CHECKING([if strtok_r might be used])
6828 if test "$tst_links_strtok_r" = "yes" &&
6829 test "$tst_proto_strtok_r" = "yes" &&
6830 test "$tst_compi_strtok_r" = "yes" &&
6831 test "$tst_allow_strtok_r" = "yes"; then
6832 AC_MSG_RESULT([yes])
6833 AC_DEFINE_UNQUOTED(HAVE_STRTOK_R, 1,
6834 [Define to 1 if you have the strtok_r function.])
6835 curl_cv_func_strtok_r="yes"
6838 curl_cv_func_strtok_r="no"
6843 dnl CURL_CHECK_FUNC_STRTOLL
6844 dnl -------------------------------------------------
6845 dnl Verify if strtoll is available, prototyped, and
6846 dnl can be compiled. If all of these are true, and
6847 dnl usage has not been previously disallowed with
6848 dnl shell variable curl_disallow_strtoll, then
6849 dnl HAVE_STRTOLL will be defined.
6851 AC_DEFUN([CURL_CHECK_FUNC_STRTOLL], [
6852 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
6854 tst_links_strtoll="unknown"
6855 tst_proto_strtoll="unknown"
6856 tst_compi_strtoll="unknown"
6857 tst_allow_strtoll="unknown"
6859 AC_MSG_CHECKING([if strtoll can be linked])
6861 AC_LANG_FUNC_LINK_TRY([strtoll])
6863 AC_MSG_RESULT([yes])
6864 tst_links_strtoll="yes"
6867 tst_links_strtoll="no"
6870 if test "$tst_links_strtoll" = "yes"; then
6871 AC_MSG_CHECKING([if strtoll is prototyped])
6872 AC_EGREP_CPP([strtoll],[
6873 $curl_includes_stdlib
6875 AC_MSG_RESULT([yes])
6876 tst_proto_strtoll="yes"
6879 tst_proto_strtoll="no"
6883 if test "$tst_proto_strtoll" = "yes"; then
6884 AC_MSG_CHECKING([if strtoll is compilable])
6887 $curl_includes_stdlib
6889 if(0 != strtoll(0, 0, 0))
6893 AC_MSG_RESULT([yes])
6894 tst_compi_strtoll="yes"
6897 tst_compi_strtoll="no"
6901 if test "$tst_compi_strtoll" = "yes"; then
6902 AC_MSG_CHECKING([if strtoll usage allowed])
6903 if test "x$curl_disallow_strtoll" != "xyes"; then
6904 AC_MSG_RESULT([yes])
6905 tst_allow_strtoll="yes"
6908 tst_allow_strtoll="no"
6912 AC_MSG_CHECKING([if strtoll might be used])
6913 if test "$tst_links_strtoll" = "yes" &&
6914 test "$tst_proto_strtoll" = "yes" &&
6915 test "$tst_compi_strtoll" = "yes" &&
6916 test "$tst_allow_strtoll" = "yes"; then
6917 AC_MSG_RESULT([yes])
6918 AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
6919 [Define to 1 if you have the strtoll function.])
6920 curl_cv_func_strtoll="yes"
6923 curl_cv_func_strtoll="no"
6928 dnl CURL_CHECK_FUNC_WRITEV
6929 dnl -------------------------------------------------
6930 dnl Verify if writev is available, prototyped, and
6931 dnl can be compiled. If all of these are true, and
6932 dnl usage has not been previously disallowed with
6933 dnl shell variable curl_disallow_writev, then
6934 dnl HAVE_WRITEV will be defined.
6936 AC_DEFUN([CURL_CHECK_FUNC_WRITEV], [
6937 AC_REQUIRE([CURL_INCLUDES_SYS_UIO])dnl
6939 tst_links_writev="unknown"
6940 tst_proto_writev="unknown"
6941 tst_compi_writev="unknown"
6942 tst_allow_writev="unknown"
6944 AC_MSG_CHECKING([if writev can be linked])
6946 AC_LANG_FUNC_LINK_TRY([writev])
6948 AC_MSG_RESULT([yes])
6949 tst_links_writev="yes"
6952 tst_links_writev="no"
6955 if test "$tst_links_writev" = "yes"; then
6956 AC_MSG_CHECKING([if writev is prototyped])
6957 AC_EGREP_CPP([writev],[
6958 $curl_includes_sys_uio
6960 AC_MSG_RESULT([yes])
6961 tst_proto_writev="yes"
6964 tst_proto_writev="no"
6968 if test "$tst_proto_writev" = "yes"; then
6969 AC_MSG_CHECKING([if writev is compilable])
6972 $curl_includes_sys_uio
6974 if(0 != writev(0, 0, 0))
6978 AC_MSG_RESULT([yes])
6979 tst_compi_writev="yes"
6982 tst_compi_writev="no"
6986 if test "$tst_compi_writev" = "yes"; then
6987 AC_MSG_CHECKING([if writev usage allowed])
6988 if test "x$curl_disallow_writev" != "xyes"; then
6989 AC_MSG_RESULT([yes])
6990 tst_allow_writev="yes"
6993 tst_allow_writev="no"
6997 AC_MSG_CHECKING([if writev might be used])
6998 if test "$tst_links_writev" = "yes" &&
6999 test "$tst_proto_writev" = "yes" &&
7000 test "$tst_compi_writev" = "yes" &&
7001 test "$tst_allow_writev" = "yes"; then
7002 AC_MSG_RESULT([yes])
7003 AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1,
7004 [Define to 1 if you have the writev function.])
7005 curl_cv_func_writev="yes"
7008 curl_cv_func_writev="no"