1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
22 #***************************************************************************
24 # File version for 'aclocal' use. Keep it a single number.
28 dnl CURL_INCLUDES_ARPA_INET
29 dnl -------------------------------------------------
30 dnl Set up variable with list of headers that must be
31 dnl included when arpa/inet.h is to be included.
33 AC_DEFUN([CURL_INCLUDES_ARPA_INET], [
34 curl_includes_arpa_inet="\
36 #ifdef HAVE_SYS_TYPES_H
37 # include <sys/types.h>
39 #ifdef HAVE_SYS_SOCKET_H
40 # include <sys/socket.h>
42 #ifdef HAVE_NETINET_IN_H
43 # include <netinet/in.h>
45 #ifdef HAVE_ARPA_INET_H
46 # include <arpa/inet.h>
50 sys/types.h sys/socket.h netinet/in.h arpa/inet.h,
51 [], [], [$curl_includes_arpa_inet])
55 dnl CURL_INCLUDES_FCNTL
56 dnl -------------------------------------------------
57 dnl Set up variable with list of headers that must be
58 dnl included when fcntl.h is to be included.
60 AC_DEFUN([CURL_INCLUDES_FCNTL], [
61 curl_includes_fcntl="\
63 #ifdef HAVE_SYS_TYPES_H
64 # include <sys/types.h>
74 sys/types.h unistd.h fcntl.h,
75 [], [], [$curl_includes_fcntl])
79 dnl CURL_INCLUDES_IFADDRS
80 dnl -------------------------------------------------
81 dnl Set up variable with list of headers that must be
82 dnl included when ifaddrs.h is to be included.
84 AC_DEFUN([CURL_INCLUDES_IFADDRS], [
85 curl_includes_ifaddrs="\
87 #ifdef HAVE_SYS_TYPES_H
88 # include <sys/types.h>
90 #ifdef HAVE_SYS_SOCKET_H
91 # include <sys/socket.h>
93 #ifdef HAVE_NETINET_IN_H
94 # include <netinet/in.h>
101 sys/types.h sys/socket.h netinet/in.h ifaddrs.h,
102 [], [], [$curl_includes_ifaddrs])
106 dnl CURL_INCLUDES_NETDB
107 dnl -------------------------------------------------
108 dnl Set up variable with list of headers that must be
109 dnl included when netdb.h is to be included.
111 AC_DEFUN([CURL_INCLUDES_NETDB], [
112 curl_includes_netdb="\
114 #ifdef HAVE_SYS_TYPES_H
115 # include <sys/types.h>
123 [], [], [$curl_includes_netdb])
127 dnl CURL_INCLUDES_SETJMP
128 dnl -------------------------------------------------
129 dnl Set up variable with list of headers that must be
130 dnl included when setjmp.h is to be included.
132 AC_DEFUN([CURL_INCLUDES_SETJMP], [
133 curl_includes_setjmp="\
135 #ifdef HAVE_SYS_TYPES_H
136 # include <sys/types.h>
143 sys/types.h setjmp.h,
144 [], [], [$curl_includes_setjmp])
148 dnl CURL_INCLUDES_SIGNAL
149 dnl -------------------------------------------------
150 dnl Set up variable with list of headers that must be
151 dnl included when signal.h is to be included.
153 AC_DEFUN([CURL_INCLUDES_SIGNAL], [
154 curl_includes_signal="\
156 #ifdef HAVE_SYS_TYPES_H
157 # include <sys/types.h>
164 sys/types.h signal.h,
165 [], [], [$curl_includes_signal])
169 dnl CURL_INCLUDES_STDIO
170 dnl -------------------------------------------------
171 dnl Set up variable with list of headers that must be
172 dnl included when stdio.h is to be included.
174 AC_DEFUN([CURL_INCLUDES_STDIO], [
175 curl_includes_stdio="\
177 #ifdef HAVE_SYS_TYPES_H
178 # include <sys/types.h>
186 [], [], [$curl_includes_stdio])
190 dnl CURL_INCLUDES_STDLIB
191 dnl -------------------------------------------------
192 dnl Set up variable with list of headers that must be
193 dnl included when stdlib.h is to be included.
195 AC_DEFUN([CURL_INCLUDES_STDLIB], [
196 curl_includes_stdlib="\
198 #ifdef HAVE_SYS_TYPES_H
199 # include <sys/types.h>
206 sys/types.h stdlib.h,
207 [], [], [$curl_includes_stdlib])
211 dnl CURL_INCLUDES_STRING
212 dnl -------------------------------------------------
213 dnl Set up variable with list of headers that must be
214 dnl included when string(s).h is to be included.
216 AC_DEFUN([CURL_INCLUDES_STRING], [
217 curl_includes_string="\
219 #ifdef HAVE_SYS_TYPES_H
220 # include <sys/types.h>
225 #ifdef HAVE_STRINGS_H
226 # include <strings.h>
230 sys/types.h string.h strings.h,
231 [], [], [$curl_includes_string])
235 dnl CURL_INCLUDES_STROPTS
236 dnl -------------------------------------------------
237 dnl Set up variable with list of headers that must be
238 dnl included when stropts.h is to be included.
240 AC_DEFUN([CURL_INCLUDES_STROPTS], [
241 curl_includes_stropts="\
243 #ifdef HAVE_SYS_TYPES_H
244 # include <sys/types.h>
249 #ifdef HAVE_SYS_SOCKET_H
250 # include <sys/socket.h>
252 #ifdef HAVE_SYS_IOCTL_H
253 # include <sys/ioctl.h>
255 #ifdef HAVE_STROPTS_H
256 # include <stropts.h>
260 sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h,
261 [], [], [$curl_includes_stropts])
265 dnl CURL_INCLUDES_SYS_SOCKET
266 dnl -------------------------------------------------
267 dnl Set up variable with list of headers that must be
268 dnl included when sys/socket.h is to be included.
270 AC_DEFUN([CURL_INCLUDES_SYS_SOCKET], [
271 curl_includes_sys_socket="\
273 #ifdef HAVE_SYS_TYPES_H
274 # include <sys/types.h>
276 #ifdef HAVE_SYS_SOCKET_H
277 # include <sys/socket.h>
281 sys/types.h sys/socket.h,
282 [], [], [$curl_includes_sys_socket])
286 dnl CURL_INCLUDES_SYS_UIO
287 dnl -------------------------------------------------
288 dnl Set up variable with list of headers that must be
289 dnl included when sys/uio.h is to be included.
291 AC_DEFUN([CURL_INCLUDES_SYS_UIO], [
292 curl_includes_sys_uio="\
294 #ifdef HAVE_SYS_TYPES_H
295 # include <sys/types.h>
297 #ifdef HAVE_SYS_UIO_H
298 # include <sys/uio.h>
302 sys/types.h sys/uio.h,
303 [], [], [$curl_includes_sys_uio])
307 dnl CURL_INCLUDES_TIME
308 dnl -------------------------------------------------
309 dnl Set up variable with list of headers that must be
310 dnl included when time.h is to be included.
312 AC_DEFUN([CURL_INCLUDES_TIME], [
313 AC_REQUIRE([AC_HEADER_TIME])dnl
314 curl_includes_time="\
316 #ifdef HAVE_SYS_TYPES_H
317 # include <sys/types.h>
319 #ifdef HAVE_SYS_TIME_H
320 # include <sys/time.h>
321 # ifdef TIME_WITH_SYS_TIME
331 sys/types.h sys/time.h time.h,
332 [], [], [$curl_includes_time])
336 dnl CURL_INCLUDES_UNISTD
337 dnl -------------------------------------------------
338 dnl Set up variable with list of headers that must be
339 dnl included when unistd.h is to be included.
341 AC_DEFUN([CURL_INCLUDES_UNISTD], [
342 curl_includes_unistd="\
344 #ifdef HAVE_SYS_TYPES_H
345 # include <sys/types.h>
352 sys/types.h unistd.h,
353 [], [], [$curl_includes_unistd])
357 dnl CURL_INCLUDES_WINSOCK2
358 dnl -------------------------------------------------
359 dnl Set up variable with list of headers that must be
360 dnl included when winsock(2).h is to be included.
362 AC_DEFUN([CURL_INCLUDES_WINSOCK2], [
363 curl_includes_winsock2="\
365 #ifdef HAVE_WINDOWS_H
366 # ifndef WIN32_LEAN_AND_MEAN
367 # define WIN32_LEAN_AND_MEAN
369 # include <windows.h>
370 # ifdef HAVE_WINSOCK2_H
371 # include <winsock2.h>
373 # ifdef HAVE_WINSOCK_H
374 # include <winsock.h>
379 CURL_CHECK_HEADER_WINDOWS
380 CURL_CHECK_HEADER_WINSOCK
381 CURL_CHECK_HEADER_WINSOCK2
385 dnl CURL_INCLUDES_WS2TCPIP
386 dnl -------------------------------------------------
387 dnl Set up variable with list of headers that must be
388 dnl included when ws2tcpip.h is to be included.
390 AC_DEFUN([CURL_INCLUDES_WS2TCPIP], [
391 curl_includes_ws2tcpip="\
393 #ifdef HAVE_WINDOWS_H
394 # ifndef WIN32_LEAN_AND_MEAN
395 # define WIN32_LEAN_AND_MEAN
397 # include <windows.h>
398 # ifdef HAVE_WINSOCK2_H
399 # include <winsock2.h>
400 # ifdef HAVE_WS2TCPIP_H
401 # include <ws2tcpip.h>
406 CURL_CHECK_HEADER_WINDOWS
407 CURL_CHECK_HEADER_WINSOCK2
408 CURL_CHECK_HEADER_WS2TCPIP
412 dnl CURL_CHECK_FUNC_ALARM
413 dnl -------------------------------------------------
414 dnl Verify if alarm is available, prototyped, and
415 dnl can be compiled. If all of these are true, and
416 dnl usage has not been previously disallowed with
417 dnl shell variable curl_disallow_alarm, then
418 dnl HAVE_ALARM will be defined.
420 AC_DEFUN([CURL_CHECK_FUNC_ALARM], [
421 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
423 tst_links_alarm="unknown"
424 tst_proto_alarm="unknown"
425 tst_compi_alarm="unknown"
426 tst_allow_alarm="unknown"
428 AC_MSG_CHECKING([if alarm can be linked])
430 AC_LANG_FUNC_LINK_TRY([alarm])
433 tst_links_alarm="yes"
439 if test "$tst_links_alarm" = "yes"; then
440 AC_MSG_CHECKING([if alarm is prototyped])
441 AC_EGREP_CPP([alarm],[
442 $curl_includes_unistd
445 tst_proto_alarm="yes"
452 if test "$tst_proto_alarm" = "yes"; then
453 AC_MSG_CHECKING([if alarm is compilable])
456 $curl_includes_unistd
463 tst_compi_alarm="yes"
470 if test "$tst_compi_alarm" = "yes"; then
471 AC_MSG_CHECKING([if alarm usage allowed])
472 if test "x$curl_disallow_alarm" != "xyes"; then
474 tst_allow_alarm="yes"
481 AC_MSG_CHECKING([if alarm might be used])
482 if test "$tst_links_alarm" = "yes" &&
483 test "$tst_proto_alarm" = "yes" &&
484 test "$tst_compi_alarm" = "yes" &&
485 test "$tst_allow_alarm" = "yes"; then
487 AC_DEFINE_UNQUOTED(HAVE_ALARM, 1,
488 [Define to 1 if you have the alarm function.])
489 ac_cv_func_alarm="yes"
492 ac_cv_func_alarm="no"
497 dnl CURL_CHECK_FUNC_FCNTL
498 dnl -------------------------------------------------
499 dnl Verify if fcntl is available, prototyped, and
500 dnl can be compiled. If all of these are true, and
501 dnl usage has not been previously disallowed with
502 dnl shell variable curl_disallow_fcntl, then
503 dnl HAVE_FCNTL will be defined.
505 AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [
506 AC_REQUIRE([CURL_INCLUDES_FCNTL])dnl
508 tst_links_fcntl="unknown"
509 tst_proto_fcntl="unknown"
510 tst_compi_fcntl="unknown"
511 tst_allow_fcntl="unknown"
513 AC_MSG_CHECKING([if fcntl can be linked])
515 AC_LANG_FUNC_LINK_TRY([fcntl])
518 tst_links_fcntl="yes"
524 if test "$tst_links_fcntl" = "yes"; then
525 AC_MSG_CHECKING([if fcntl is prototyped])
526 AC_EGREP_CPP([fcntl],[
530 tst_proto_fcntl="yes"
537 if test "$tst_proto_fcntl" = "yes"; then
538 AC_MSG_CHECKING([if fcntl is compilable])
543 if(0 != fcntl(0, 0, 0))
548 tst_compi_fcntl="yes"
555 if test "$tst_compi_fcntl" = "yes"; then
556 AC_MSG_CHECKING([if fcntl usage allowed])
557 if test "x$curl_disallow_fcntl" != "xyes"; then
559 tst_allow_fcntl="yes"
566 AC_MSG_CHECKING([if fcntl might be used])
567 if test "$tst_links_fcntl" = "yes" &&
568 test "$tst_proto_fcntl" = "yes" &&
569 test "$tst_compi_fcntl" = "yes" &&
570 test "$tst_allow_fcntl" = "yes"; then
572 AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1,
573 [Define to 1 if you have the fcntl function.])
574 ac_cv_func_fcntl="yes"
575 CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
578 ac_cv_func_fcntl="no"
583 dnl CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
584 dnl -------------------------------------------------
585 dnl Verify if fcntl with status flag O_NONBLOCK is
586 dnl available, can be compiled, and seems to work. If
587 dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK
590 AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [
592 tst_compi_fcntl_o_nonblock="unknown"
593 tst_allow_fcntl_o_nonblock="unknown"
596 sunos4* | aix3* | beos*)
597 dnl O_NONBLOCK does not work on these platforms
598 curl_disallow_fcntl_o_nonblock="yes"
602 if test "$ac_cv_func_fcntl" = "yes"; then
603 AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable])
609 if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
614 tst_compi_fcntl_o_nonblock="yes"
617 tst_compi_fcntl_o_nonblock="no"
621 if test "$tst_compi_fcntl_o_nonblock" = "yes"; then
622 AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed])
623 if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then
625 tst_allow_fcntl_o_nonblock="yes"
628 tst_allow_fcntl_o_nonblock="no"
632 AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used])
633 if test "$tst_compi_fcntl_o_nonblock" = "yes" &&
634 test "$tst_allow_fcntl_o_nonblock" = "yes"; then
636 AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1,
637 [Define to 1 if you have a working fcntl O_NONBLOCK function.])
638 ac_cv_func_fcntl_o_nonblock="yes"
641 ac_cv_func_fcntl_o_nonblock="no"
646 dnl CURL_CHECK_FUNC_FDOPEN
647 dnl -------------------------------------------------
648 dnl Verify if fdopen is available, prototyped, and
649 dnl can be compiled. If all of these are true, and
650 dnl usage has not been previously disallowed with
651 dnl shell variable curl_disallow_fdopen, then
652 dnl HAVE_FDOPEN will be defined.
654 AC_DEFUN([CURL_CHECK_FUNC_FDOPEN], [
655 AC_REQUIRE([CURL_INCLUDES_STDIO])dnl
657 tst_links_fdopen="unknown"
658 tst_proto_fdopen="unknown"
659 tst_compi_fdopen="unknown"
660 tst_allow_fdopen="unknown"
662 AC_MSG_CHECKING([if fdopen can be linked])
664 AC_LANG_FUNC_LINK_TRY([fdopen])
667 tst_links_fdopen="yes"
670 tst_links_fdopen="no"
673 if test "$tst_links_fdopen" = "yes"; then
674 AC_MSG_CHECKING([if fdopen is prototyped])
675 AC_EGREP_CPP([fdopen],[
679 tst_proto_fdopen="yes"
682 tst_proto_fdopen="no"
686 if test "$tst_proto_fdopen" = "yes"; then
687 AC_MSG_CHECKING([if fdopen is compilable])
692 if(0 != fdopen(0, 0))
697 tst_compi_fdopen="yes"
700 tst_compi_fdopen="no"
704 if test "$tst_compi_fdopen" = "yes"; then
705 AC_MSG_CHECKING([if fdopen usage allowed])
706 if test "x$curl_disallow_fdopen" != "xyes"; then
708 tst_allow_fdopen="yes"
711 tst_allow_fdopen="no"
715 AC_MSG_CHECKING([if fdopen might be used])
716 if test "$tst_links_fdopen" = "yes" &&
717 test "$tst_proto_fdopen" = "yes" &&
718 test "$tst_compi_fdopen" = "yes" &&
719 test "$tst_allow_fdopen" = "yes"; then
721 AC_DEFINE_UNQUOTED(HAVE_FDOPEN, 1,
722 [Define to 1 if you have the fdopen function.])
723 ac_cv_func_fdopen="yes"
726 ac_cv_func_fdopen="no"
731 dnl CURL_CHECK_FUNC_FREEADDRINFO
732 dnl -------------------------------------------------
733 dnl Verify if freeaddrinfo is available, prototyped,
734 dnl and can be compiled. If all of these are true,
735 dnl and usage has not been previously disallowed with
736 dnl shell variable curl_disallow_freeaddrinfo, then
737 dnl HAVE_FREEADDRINFO will be defined.
739 AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [
740 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
741 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
742 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
744 tst_links_freeaddrinfo="unknown"
745 tst_proto_freeaddrinfo="unknown"
746 tst_compi_freeaddrinfo="unknown"
747 tst_allow_freeaddrinfo="unknown"
749 AC_MSG_CHECKING([if freeaddrinfo can be linked])
752 $curl_includes_ws2tcpip
753 $curl_includes_sys_socket
760 tst_links_freeaddrinfo="yes"
763 tst_links_freeaddrinfo="no"
766 if test "$tst_links_freeaddrinfo" = "yes"; then
767 AC_MSG_CHECKING([if freeaddrinfo is prototyped])
768 AC_EGREP_CPP([freeaddrinfo],[
769 $curl_includes_ws2tcpip
770 $curl_includes_sys_socket
774 tst_proto_freeaddrinfo="yes"
777 tst_proto_freeaddrinfo="no"
781 if test "$tst_proto_freeaddrinfo" = "yes"; then
782 AC_MSG_CHECKING([if freeaddrinfo is compilable])
785 $curl_includes_ws2tcpip
786 $curl_includes_sys_socket
793 tst_compi_freeaddrinfo="yes"
796 tst_compi_freeaddrinfo="no"
800 if test "$tst_compi_freeaddrinfo" = "yes"; then
801 AC_MSG_CHECKING([if freeaddrinfo usage allowed])
802 if test "x$curl_disallow_freeaddrinfo" != "xyes"; then
804 tst_allow_freeaddrinfo="yes"
807 tst_allow_freeaddrinfo="no"
811 AC_MSG_CHECKING([if freeaddrinfo might be used])
812 if test "$tst_links_freeaddrinfo" = "yes" &&
813 test "$tst_proto_freeaddrinfo" = "yes" &&
814 test "$tst_compi_freeaddrinfo" = "yes" &&
815 test "$tst_allow_freeaddrinfo" = "yes"; then
817 AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
818 [Define to 1 if you have the freeaddrinfo function.])
819 ac_cv_func_freeaddrinfo="yes"
822 ac_cv_func_freeaddrinfo="no"
827 dnl CURL_CHECK_FUNC_FREEIFADDRS
828 dnl -------------------------------------------------
829 dnl Verify if freeifaddrs is available, prototyped, and
830 dnl can be compiled. If all of these are true, and
831 dnl usage has not been previously disallowed with
832 dnl shell variable curl_disallow_freeifaddrs, then
833 dnl HAVE_FREEIFADDRS will be defined.
835 AC_DEFUN([CURL_CHECK_FUNC_FREEIFADDRS], [
836 AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
838 tst_links_freeifaddrs="unknown"
839 tst_proto_freeifaddrs="unknown"
840 tst_compi_freeifaddrs="unknown"
841 tst_allow_freeifaddrs="unknown"
843 AC_MSG_CHECKING([if freeifaddrs can be linked])
845 AC_LANG_FUNC_LINK_TRY([freeifaddrs])
848 tst_links_freeifaddrs="yes"
851 tst_links_freeifaddrs="no"
854 if test "$tst_links_freeifaddrs" = "yes"; then
855 AC_MSG_CHECKING([if freeifaddrs is prototyped])
856 AC_EGREP_CPP([freeifaddrs],[
857 $curl_includes_ifaddrs
860 tst_proto_freeifaddrs="yes"
863 tst_proto_freeifaddrs="no"
867 if test "$tst_proto_freeifaddrs" = "yes"; then
868 AC_MSG_CHECKING([if freeifaddrs is compilable])
871 $curl_includes_ifaddrs
877 tst_compi_freeifaddrs="yes"
880 tst_compi_freeifaddrs="no"
884 if test "$tst_compi_freeifaddrs" = "yes"; then
885 AC_MSG_CHECKING([if freeifaddrs usage allowed])
886 if test "x$curl_disallow_freeifaddrs" != "xyes"; then
888 tst_allow_freeifaddrs="yes"
891 tst_allow_freeifaddrs="no"
895 AC_MSG_CHECKING([if freeifaddrs might be used])
896 if test "$tst_links_freeifaddrs" = "yes" &&
897 test "$tst_proto_freeifaddrs" = "yes" &&
898 test "$tst_compi_freeifaddrs" = "yes" &&
899 test "$tst_allow_freeifaddrs" = "yes"; then
901 AC_DEFINE_UNQUOTED(HAVE_FREEIFADDRS, 1,
902 [Define to 1 if you have the freeifaddrs function.])
903 ac_cv_func_freeifaddrs="yes"
906 ac_cv_func_freeifaddrs="no"
911 dnl CURL_CHECK_FUNC_FTRUNCATE
912 dnl -------------------------------------------------
913 dnl Verify if ftruncate is available, prototyped, and
914 dnl can be compiled. If all of these are true, and
915 dnl usage has not been previously disallowed with
916 dnl shell variable curl_disallow_ftruncate, then
917 dnl HAVE_FTRUNCATE will be defined.
919 AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [
920 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
922 tst_links_ftruncate="unknown"
923 tst_proto_ftruncate="unknown"
924 tst_compi_ftruncate="unknown"
925 tst_allow_ftruncate="unknown"
927 AC_MSG_CHECKING([if ftruncate can be linked])
929 AC_LANG_FUNC_LINK_TRY([ftruncate])
932 tst_links_ftruncate="yes"
935 tst_links_ftruncate="no"
938 if test "$tst_links_ftruncate" = "yes"; then
939 AC_MSG_CHECKING([if ftruncate is prototyped])
940 AC_EGREP_CPP([ftruncate],[
941 $curl_includes_unistd
944 tst_proto_ftruncate="yes"
947 tst_proto_ftruncate="no"
951 if test "$tst_proto_ftruncate" = "yes"; then
952 AC_MSG_CHECKING([if ftruncate is compilable])
955 $curl_includes_unistd
957 if(0 != ftruncate(0, 0))
962 tst_compi_ftruncate="yes"
965 tst_compi_ftruncate="no"
969 if test "$tst_compi_ftruncate" = "yes"; then
970 AC_MSG_CHECKING([if ftruncate usage allowed])
971 if test "x$curl_disallow_ftruncate" != "xyes"; then
973 tst_allow_ftruncate="yes"
976 tst_allow_ftruncate="no"
980 AC_MSG_CHECKING([if ftruncate might be used])
981 if test "$tst_links_ftruncate" = "yes" &&
982 test "$tst_proto_ftruncate" = "yes" &&
983 test "$tst_compi_ftruncate" = "yes" &&
984 test "$tst_allow_ftruncate" = "yes"; then
986 AC_DEFINE_UNQUOTED(HAVE_FTRUNCATE, 1,
987 [Define to 1 if you have the ftruncate function.])
988 ac_cv_func_ftruncate="yes"
991 ac_cv_func_ftruncate="no"
996 dnl CURL_CHECK_FUNC_GETADDRINFO
997 dnl -------------------------------------------------
998 dnl Verify if getaddrinfo is available, prototyped, can
999 dnl be compiled and seems to work. If all of these are
1000 dnl true, and usage has not been previously disallowed
1001 dnl with shell variable curl_disallow_getaddrinfo, then
1002 dnl HAVE_GETADDRINFO will be defined.
1004 AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
1005 AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
1006 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
1007 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
1008 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
1009 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1011 tst_links_getaddrinfo="unknown"
1012 tst_proto_getaddrinfo="unknown"
1013 tst_compi_getaddrinfo="unknown"
1014 tst_works_getaddrinfo="unknown"
1015 tst_allow_getaddrinfo="unknown"
1017 AC_MSG_CHECKING([if getaddrinfo can be linked])
1020 $curl_includes_ws2tcpip
1021 $curl_includes_sys_socket
1022 $curl_includes_netdb
1024 if(0 != getaddrinfo(0, 0, 0, 0))
1028 AC_MSG_RESULT([yes])
1029 tst_links_getaddrinfo="yes"
1032 tst_links_getaddrinfo="no"
1035 if test "$tst_links_getaddrinfo" = "yes"; then
1036 AC_MSG_CHECKING([if getaddrinfo is prototyped])
1037 AC_EGREP_CPP([getaddrinfo],[
1038 $curl_includes_ws2tcpip
1039 $curl_includes_sys_socket
1040 $curl_includes_netdb
1042 AC_MSG_RESULT([yes])
1043 tst_proto_getaddrinfo="yes"
1046 tst_proto_getaddrinfo="no"
1050 if test "$tst_proto_getaddrinfo" = "yes"; then
1051 AC_MSG_CHECKING([if getaddrinfo is compilable])
1054 $curl_includes_ws2tcpip
1055 $curl_includes_sys_socket
1056 $curl_includes_netdb
1058 if(0 != getaddrinfo(0, 0, 0, 0))
1062 AC_MSG_RESULT([yes])
1063 tst_compi_getaddrinfo="yes"
1066 tst_compi_getaddrinfo="no"
1070 dnl only do runtime verification when not cross-compiling
1071 if test "x$cross_compiling" != "xyes" &&
1072 test "$tst_compi_getaddrinfo" = "yes"; then
1073 AC_MSG_CHECKING([if getaddrinfo seems to work])
1076 $curl_includes_ws2tcpip
1077 $curl_includes_stdlib
1078 $curl_includes_string
1079 $curl_includes_sys_socket
1080 $curl_includes_netdb
1082 struct addrinfo hints;
1083 struct addrinfo *ai = 0;
1086 memset(&hints, 0, sizeof(hints));
1087 hints.ai_flags = AI_NUMERICHOST;
1088 hints.ai_family = AF_UNSPEC;
1089 hints.ai_socktype = SOCK_STREAM;
1090 error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
1097 AC_MSG_RESULT([yes])
1098 tst_works_getaddrinfo="yes"
1101 tst_works_getaddrinfo="no"
1105 if test "$tst_compi_getaddrinfo" = "yes" &&
1106 test "$tst_works_getaddrinfo" != "no"; then
1107 AC_MSG_CHECKING([if getaddrinfo usage allowed])
1108 if test "x$curl_disallow_getaddrinfo" != "xyes"; then
1109 AC_MSG_RESULT([yes])
1110 tst_allow_getaddrinfo="yes"
1113 tst_allow_getaddrinfo="no"
1117 AC_MSG_CHECKING([if getaddrinfo might be used])
1118 if test "$tst_links_getaddrinfo" = "yes" &&
1119 test "$tst_proto_getaddrinfo" = "yes" &&
1120 test "$tst_compi_getaddrinfo" = "yes" &&
1121 test "$tst_allow_getaddrinfo" = "yes" &&
1122 test "$tst_works_getaddrinfo" != "no"; then
1123 AC_MSG_RESULT([yes])
1124 AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
1125 [Define to 1 if you have a working getaddrinfo function.])
1126 ac_cv_func_getaddrinfo="yes"
1129 ac_cv_func_getaddrinfo="no"
1134 dnl CURL_CHECK_FUNC_GETHOSTBYADDR
1135 dnl -------------------------------------------------
1136 dnl Verify if gethostbyaddr is available, prototyped,
1137 dnl and can be compiled. If all of these are true,
1138 dnl and usage has not been previously disallowed with
1139 dnl shell variable curl_disallow_gethostbyaddr, then
1140 dnl HAVE_GETHOSTBYADDR will be defined.
1142 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR], [
1143 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
1144 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1146 tst_links_gethostbyaddr="unknown"
1147 tst_proto_gethostbyaddr="unknown"
1148 tst_compi_gethostbyaddr="unknown"
1149 tst_allow_gethostbyaddr="unknown"
1151 AC_MSG_CHECKING([if gethostbyaddr can be linked])
1154 $curl_includes_winsock2
1155 $curl_includes_netdb
1157 if(0 != gethostbyaddr(0, 0, 0))
1161 AC_MSG_RESULT([yes])
1162 tst_links_gethostbyaddr="yes"
1165 tst_links_gethostbyaddr="no"
1168 if test "$tst_links_gethostbyaddr" = "yes"; then
1169 AC_MSG_CHECKING([if gethostbyaddr is prototyped])
1170 AC_EGREP_CPP([gethostbyaddr],[
1171 $curl_includes_winsock2
1172 $curl_includes_netdb
1174 AC_MSG_RESULT([yes])
1175 tst_proto_gethostbyaddr="yes"
1178 tst_proto_gethostbyaddr="no"
1182 if test "$tst_proto_gethostbyaddr" = "yes"; then
1183 AC_MSG_CHECKING([if gethostbyaddr is compilable])
1186 $curl_includes_winsock2
1187 $curl_includes_netdb
1189 if(0 != gethostbyaddr(0, 0, 0))
1193 AC_MSG_RESULT([yes])
1194 tst_compi_gethostbyaddr="yes"
1197 tst_compi_gethostbyaddr="no"
1201 if test "$tst_compi_gethostbyaddr" = "yes"; then
1202 AC_MSG_CHECKING([if gethostbyaddr usage allowed])
1203 if test "x$curl_disallow_gethostbyaddr" != "xyes"; then
1204 AC_MSG_RESULT([yes])
1205 tst_allow_gethostbyaddr="yes"
1208 tst_allow_gethostbyaddr="no"
1212 AC_MSG_CHECKING([if gethostbyaddr might be used])
1213 if test "$tst_links_gethostbyaddr" = "yes" &&
1214 test "$tst_proto_gethostbyaddr" = "yes" &&
1215 test "$tst_compi_gethostbyaddr" = "yes" &&
1216 test "$tst_allow_gethostbyaddr" = "yes"; then
1217 AC_MSG_RESULT([yes])
1218 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR, 1,
1219 [Define to 1 if you have the gethostbyaddr function.])
1220 ac_cv_func_gethostbyaddr="yes"
1223 ac_cv_func_gethostbyaddr="no"
1228 dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R
1229 dnl -------------------------------------------------
1230 dnl Verify if gethostbyaddr_r is available, prototyped,
1231 dnl and can be compiled. If all of these are true, and
1232 dnl usage has not been previously disallowed with
1233 dnl shell variable curl_disallow_gethostbyaddr_r, then
1234 dnl HAVE_GETHOSTBYADDR_R will be defined.
1236 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR_R], [
1237 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1239 tst_links_gethostbyaddr_r="unknown"
1240 tst_proto_gethostbyaddr_r="unknown"
1241 tst_compi_gethostbyaddr_r="unknown"
1242 tst_allow_gethostbyaddr_r="unknown"
1243 tst_nargs_gethostbyaddr_r="unknown"
1245 AC_MSG_CHECKING([if gethostbyaddr_r can be linked])
1247 AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
1249 AC_MSG_RESULT([yes])
1250 tst_links_gethostbyaddr_r="yes"
1253 tst_links_gethostbyaddr_r="no"
1256 if test "$tst_links_gethostbyaddr_r" = "yes"; then
1257 AC_MSG_CHECKING([if gethostbyaddr_r is prototyped])
1258 AC_EGREP_CPP([gethostbyaddr_r],[
1259 $curl_includes_netdb
1261 AC_MSG_RESULT([yes])
1262 tst_proto_gethostbyaddr_r="yes"
1265 tst_proto_gethostbyaddr_r="no"
1269 if test "$tst_proto_gethostbyaddr_r" = "yes"; then
1270 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
1271 AC_MSG_CHECKING([if gethostbyaddr_r takes 5 args.])
1274 $curl_includes_netdb
1276 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0))
1280 AC_MSG_RESULT([yes])
1281 tst_compi_gethostbyaddr_r="yes"
1282 tst_nargs_gethostbyaddr_r="5"
1285 tst_compi_gethostbyaddr_r="no"
1288 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
1289 AC_MSG_CHECKING([if gethostbyaddr_r takes 7 args.])
1292 $curl_includes_netdb
1294 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0))
1298 AC_MSG_RESULT([yes])
1299 tst_compi_gethostbyaddr_r="yes"
1300 tst_nargs_gethostbyaddr_r="7"
1303 tst_compi_gethostbyaddr_r="no"
1306 if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
1307 AC_MSG_CHECKING([if gethostbyaddr_r takes 8 args.])
1310 $curl_includes_netdb
1312 if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0))
1316 AC_MSG_RESULT([yes])
1317 tst_compi_gethostbyaddr_r="yes"
1318 tst_nargs_gethostbyaddr_r="8"
1321 tst_compi_gethostbyaddr_r="no"
1324 AC_MSG_CHECKING([if gethostbyaddr_r is compilable])
1325 if test "$tst_compi_gethostbyaddr_r" = "yes"; then
1326 AC_MSG_RESULT([yes])
1332 if test "$tst_compi_gethostbyaddr_r" = "yes"; then
1333 AC_MSG_CHECKING([if gethostbyaddr_r usage allowed])
1334 if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then
1335 AC_MSG_RESULT([yes])
1336 tst_allow_gethostbyaddr_r="yes"
1339 tst_allow_gethostbyaddr_r="no"
1343 AC_MSG_CHECKING([if gethostbyaddr_r might be used])
1344 if test "$tst_links_gethostbyaddr_r" = "yes" &&
1345 test "$tst_proto_gethostbyaddr_r" = "yes" &&
1346 test "$tst_compi_gethostbyaddr_r" = "yes" &&
1347 test "$tst_allow_gethostbyaddr_r" = "yes"; then
1348 AC_MSG_RESULT([yes])
1349 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1,
1350 [Define to 1 if you have the gethostbyaddr_r function.])
1351 dnl AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_ARGS, $tst_nargs_gethostbyaddr_r,
1352 dnl [Specifies the number of arguments to gethostbyaddr_r])
1354 if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then
1355 AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
1356 elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then
1357 AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
1358 elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then
1359 AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
1362 ac_cv_func_gethostbyaddr_r="yes"
1365 ac_cv_func_gethostbyaddr_r="no"
1370 dnl CURL_CHECK_FUNC_GETHOSTBYNAME
1371 dnl -------------------------------------------------
1372 dnl Verify if gethostbyname is available, prototyped,
1373 dnl and can be compiled. If all of these are true,
1374 dnl and usage has not been previously disallowed with
1375 dnl shell variable curl_disallow_gethostbyname, then
1376 dnl HAVE_GETHOSTBYNAME will be defined.
1378 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME], [
1379 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
1380 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1382 tst_links_gethostbyname="unknown"
1383 tst_proto_gethostbyname="unknown"
1384 tst_compi_gethostbyname="unknown"
1385 tst_allow_gethostbyname="unknown"
1387 AC_MSG_CHECKING([if gethostbyname can be linked])
1390 $curl_includes_winsock2
1391 $curl_includes_netdb
1393 if(0 != gethostbyname(0))
1397 AC_MSG_RESULT([yes])
1398 tst_links_gethostbyname="yes"
1401 tst_links_gethostbyname="no"
1404 if test "$tst_links_gethostbyname" = "yes"; then
1405 AC_MSG_CHECKING([if gethostbyname is prototyped])
1406 AC_EGREP_CPP([gethostbyname],[
1407 $curl_includes_winsock2
1408 $curl_includes_netdb
1410 AC_MSG_RESULT([yes])
1411 tst_proto_gethostbyname="yes"
1414 tst_proto_gethostbyname="no"
1418 if test "$tst_proto_gethostbyname" = "yes"; then
1419 AC_MSG_CHECKING([if gethostbyname is compilable])
1422 $curl_includes_winsock2
1423 $curl_includes_netdb
1425 if(0 != gethostbyname(0))
1429 AC_MSG_RESULT([yes])
1430 tst_compi_gethostbyname="yes"
1433 tst_compi_gethostbyname="no"
1437 if test "$tst_compi_gethostbyname" = "yes"; then
1438 AC_MSG_CHECKING([if gethostbyname usage allowed])
1439 if test "x$curl_disallow_gethostbyname" != "xyes"; then
1440 AC_MSG_RESULT([yes])
1441 tst_allow_gethostbyname="yes"
1444 tst_allow_gethostbyname="no"
1448 AC_MSG_CHECKING([if gethostbyname might be used])
1449 if test "$tst_links_gethostbyname" = "yes" &&
1450 test "$tst_proto_gethostbyname" = "yes" &&
1451 test "$tst_compi_gethostbyname" = "yes" &&
1452 test "$tst_allow_gethostbyname" = "yes"; then
1453 AC_MSG_RESULT([yes])
1454 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME, 1,
1455 [Define to 1 if you have the gethostbyname function.])
1456 ac_cv_func_gethostbyname="yes"
1459 ac_cv_func_gethostbyname="no"
1464 dnl CURL_CHECK_FUNC_GETHOSTBYNAME_R
1465 dnl -------------------------------------------------
1466 dnl Verify if gethostbyname_r is available, prototyped,
1467 dnl and can be compiled. If all of these are true, and
1468 dnl usage has not been previously disallowed with
1469 dnl shell variable curl_disallow_gethostbyname_r, then
1470 dnl HAVE_GETHOSTBYNAME_R will be defined.
1472 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [
1473 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1475 tst_links_gethostbyname_r="unknown"
1476 tst_proto_gethostbyname_r="unknown"
1477 tst_compi_gethostbyname_r="unknown"
1478 tst_allow_gethostbyname_r="unknown"
1479 tst_nargs_gethostbyname_r="unknown"
1481 AC_MSG_CHECKING([if gethostbyname_r can be linked])
1483 AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
1485 AC_MSG_RESULT([yes])
1486 tst_links_gethostbyname_r="yes"
1489 tst_links_gethostbyname_r="no"
1492 if test "$tst_links_gethostbyname_r" = "yes"; then
1493 AC_MSG_CHECKING([if gethostbyname_r is prototyped])
1494 AC_EGREP_CPP([gethostbyname_r],[
1495 $curl_includes_netdb
1497 AC_MSG_RESULT([yes])
1498 tst_proto_gethostbyname_r="yes"
1501 tst_proto_gethostbyname_r="no"
1505 if test "$tst_proto_gethostbyname_r" = "yes"; then
1506 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
1507 AC_MSG_CHECKING([if gethostbyname_r takes 3 args.])
1510 $curl_includes_netdb
1512 if(0 != gethostbyname_r(0, 0, 0))
1516 AC_MSG_RESULT([yes])
1517 tst_compi_gethostbyname_r="yes"
1518 tst_nargs_gethostbyname_r="3"
1521 tst_compi_gethostbyname_r="no"
1524 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
1525 AC_MSG_CHECKING([if gethostbyname_r takes 5 args.])
1528 $curl_includes_netdb
1530 if(0 != gethostbyname_r(0, 0, 0, 0, 0))
1534 AC_MSG_RESULT([yes])
1535 tst_compi_gethostbyname_r="yes"
1536 tst_nargs_gethostbyname_r="5"
1539 tst_compi_gethostbyname_r="no"
1542 if test "$tst_nargs_gethostbyname_r" = "unknown"; then
1543 AC_MSG_CHECKING([if gethostbyname_r takes 6 args.])
1546 $curl_includes_netdb
1548 if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0))
1552 AC_MSG_RESULT([yes])
1553 tst_compi_gethostbyname_r="yes"
1554 tst_nargs_gethostbyname_r="6"
1557 tst_compi_gethostbyname_r="no"
1560 AC_MSG_CHECKING([if gethostbyname_r is compilable])
1561 if test "$tst_compi_gethostbyname_r" = "yes"; then
1562 AC_MSG_RESULT([yes])
1568 if test "$tst_compi_gethostbyname_r" = "yes"; then
1569 AC_MSG_CHECKING([if gethostbyname_r usage allowed])
1570 if test "x$curl_disallow_gethostbyname_r" != "xyes"; then
1571 AC_MSG_RESULT([yes])
1572 tst_allow_gethostbyname_r="yes"
1575 tst_allow_gethostbyname_r="no"
1579 AC_MSG_CHECKING([if gethostbyname_r might be used])
1580 if test "$tst_links_gethostbyname_r" = "yes" &&
1581 test "$tst_proto_gethostbyname_r" = "yes" &&
1582 test "$tst_compi_gethostbyname_r" = "yes" &&
1583 test "$tst_allow_gethostbyname_r" = "yes"; then
1584 AC_MSG_RESULT([yes])
1585 AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
1586 [Define to 1 if you have the gethostbyname_r function.])
1587 dnl AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $tst_nargs_gethostbyname_r,
1588 dnl [Specifies the number of arguments to gethostbyname_r])
1590 if test "$tst_nargs_gethostbyname_r" -eq "3"; then
1591 AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
1592 elif test "$tst_nargs_gethostbyname_r" -eq "5"; then
1593 AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
1594 elif test "$tst_nargs_gethostbyname_r" -eq "6"; then
1595 AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
1598 ac_cv_func_gethostbyname_r="yes"
1601 ac_cv_func_gethostbyname_r="no"
1606 dnl CURL_CHECK_FUNC_GETHOSTNAME
1607 dnl -------------------------------------------------
1608 dnl Verify if gethostname is available, prototyped, and
1609 dnl can be compiled. If all of these are true, and
1610 dnl usage has not been previously disallowed with
1611 dnl shell variable curl_disallow_gethostname, then
1612 dnl HAVE_GETHOSTNAME will be defined.
1614 AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
1615 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
1616 AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
1618 tst_links_gethostname="unknown"
1619 tst_proto_gethostname="unknown"
1620 tst_compi_gethostname="unknown"
1621 tst_allow_gethostname="unknown"
1623 AC_MSG_CHECKING([if gethostname can be linked])
1626 $curl_includes_winsock2
1627 $curl_includes_unistd
1629 if(0 != gethostname(0, 0))
1633 AC_MSG_RESULT([yes])
1634 tst_links_gethostname="yes"
1637 tst_links_gethostname="no"
1640 if test "$tst_links_gethostname" = "yes"; then
1641 AC_MSG_CHECKING([if gethostname is prototyped])
1642 AC_EGREP_CPP([gethostname],[
1643 $curl_includes_winsock2
1644 $curl_includes_unistd
1646 AC_MSG_RESULT([yes])
1647 tst_proto_gethostname="yes"
1650 tst_proto_gethostname="no"
1654 if test "$tst_proto_gethostname" = "yes"; then
1655 AC_MSG_CHECKING([if gethostname is compilable])
1658 $curl_includes_winsock2
1659 $curl_includes_unistd
1661 if(0 != gethostname(0, 0))
1665 AC_MSG_RESULT([yes])
1666 tst_compi_gethostname="yes"
1669 tst_compi_gethostname="no"
1673 if test "$tst_compi_gethostname" = "yes"; then
1674 AC_MSG_CHECKING([if gethostname usage allowed])
1675 if test "x$curl_disallow_gethostname" != "xyes"; then
1676 AC_MSG_RESULT([yes])
1677 tst_allow_gethostname="yes"
1680 tst_allow_gethostname="no"
1684 AC_MSG_CHECKING([if gethostname might be used])
1685 if test "$tst_links_gethostname" = "yes" &&
1686 test "$tst_proto_gethostname" = "yes" &&
1687 test "$tst_compi_gethostname" = "yes" &&
1688 test "$tst_allow_gethostname" = "yes"; then
1689 AC_MSG_RESULT([yes])
1690 AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
1691 [Define to 1 if you have the gethostname function.])
1692 ac_cv_func_gethostname="yes"
1695 ac_cv_func_gethostname="no"
1700 dnl CURL_CHECK_FUNC_GETIFADDRS
1701 dnl -------------------------------------------------
1702 dnl Verify if getifaddrs is available, prototyped, can
1703 dnl be compiled and seems to work. If all of these are
1704 dnl true, and usage has not been previously disallowed
1705 dnl with shell variable curl_disallow_getifaddrs, then
1706 dnl HAVE_GETIFADDRS will be defined.
1708 AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [
1709 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
1710 AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
1712 tst_links_getifaddrs="unknown"
1713 tst_proto_getifaddrs="unknown"
1714 tst_compi_getifaddrs="unknown"
1715 tst_works_getifaddrs="unknown"
1716 tst_allow_getifaddrs="unknown"
1718 AC_MSG_CHECKING([if getifaddrs can be linked])
1720 AC_LANG_FUNC_LINK_TRY([getifaddrs])
1722 AC_MSG_RESULT([yes])
1723 tst_links_getifaddrs="yes"
1726 tst_links_getifaddrs="no"
1729 if test "$tst_links_getifaddrs" = "yes"; then
1730 AC_MSG_CHECKING([if getifaddrs is prototyped])
1731 AC_EGREP_CPP([getifaddrs],[
1732 $curl_includes_ifaddrs
1734 AC_MSG_RESULT([yes])
1735 tst_proto_getifaddrs="yes"
1738 tst_proto_getifaddrs="no"
1742 if test "$tst_proto_getifaddrs" = "yes"; then
1743 AC_MSG_CHECKING([if getifaddrs is compilable])
1746 $curl_includes_ifaddrs
1748 if(0 != getifaddrs(0))
1752 AC_MSG_RESULT([yes])
1753 tst_compi_getifaddrs="yes"
1756 tst_compi_getifaddrs="no"
1760 dnl only do runtime verification when not cross-compiling
1761 if test "x$cross_compiling" != "xyes" &&
1762 test "$tst_compi_getifaddrs" = "yes"; then
1763 AC_MSG_CHECKING([if getifaddrs seems to work])
1766 $curl_includes_stdlib
1767 $curl_includes_ifaddrs
1769 struct ifaddrs *ifa = 0;
1772 error = getifaddrs(&ifa);
1779 AC_MSG_RESULT([yes])
1780 tst_works_getifaddrs="yes"
1783 tst_works_getifaddrs="no"
1787 if test "$tst_compi_getifaddrs" = "yes" &&
1788 test "$tst_works_getifaddrs" != "no"; then
1789 AC_MSG_CHECKING([if getifaddrs usage allowed])
1790 if test "x$curl_disallow_getifaddrs" != "xyes"; then
1791 AC_MSG_RESULT([yes])
1792 tst_allow_getifaddrs="yes"
1795 tst_allow_getifaddrs="no"
1799 AC_MSG_CHECKING([if getifaddrs might be used])
1800 if test "$tst_links_getifaddrs" = "yes" &&
1801 test "$tst_proto_getifaddrs" = "yes" &&
1802 test "$tst_compi_getifaddrs" = "yes" &&
1803 test "$tst_allow_getifaddrs" = "yes" &&
1804 test "$tst_works_getifaddrs" != "no"; then
1805 AC_MSG_RESULT([yes])
1806 AC_DEFINE_UNQUOTED(HAVE_GETIFADDRS, 1,
1807 [Define to 1 if you have a working getifaddrs function.])
1808 ac_cv_func_getifaddrs="yes"
1811 ac_cv_func_getifaddrs="no"
1816 dnl CURL_CHECK_FUNC_GETSERVBYPORT_R
1817 dnl -------------------------------------------------
1818 dnl Verify if getservbyport_r is available, prototyped,
1819 dnl and can be compiled. If all of these are true, and
1820 dnl usage has not been previously disallowed with
1821 dnl shell variable curl_disallow_getservbyport_r, then
1822 dnl HAVE_GETSERVBYPORT_R will be defined.
1824 AC_DEFUN([CURL_CHECK_FUNC_GETSERVBYPORT_R], [
1825 AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
1827 tst_links_getservbyport_r="unknown"
1828 tst_proto_getservbyport_r="unknown"
1829 tst_compi_getservbyport_r="unknown"
1830 tst_allow_getservbyport_r="unknown"
1831 tst_nargs_getservbyport_r="unknown"
1833 AC_MSG_CHECKING([if getservbyport_r can be linked])
1835 AC_LANG_FUNC_LINK_TRY([getservbyport_r])
1837 AC_MSG_RESULT([yes])
1838 tst_links_getservbyport_r="yes"
1841 tst_links_getservbyport_r="no"
1844 if test "$tst_links_getservbyport_r" = "yes"; then
1845 AC_MSG_CHECKING([if getservbyport_r is prototyped])
1846 AC_EGREP_CPP([getservbyport_r],[
1847 $curl_includes_netdb
1849 AC_MSG_RESULT([yes])
1850 tst_proto_getservbyport_r="yes"
1853 tst_proto_getservbyport_r="no"
1857 if test "$tst_proto_getservbyport_r" = "yes"; then
1858 if test "$tst_nargs_getservbyport_r" = "unknown"; then
1859 AC_MSG_CHECKING([if getservbyport_r takes 4 args.])
1862 $curl_includes_netdb
1864 if(0 != getservbyport_r(0, 0, 0, 0))
1868 AC_MSG_RESULT([yes])
1869 tst_compi_getservbyport_r="yes"
1870 tst_nargs_getservbyport_r="4"
1873 tst_compi_getservbyport_r="no"
1876 if test "$tst_nargs_getservbyport_r" = "unknown"; then
1877 AC_MSG_CHECKING([if getservbyport_r takes 5 args.])
1880 $curl_includes_netdb
1882 if(0 != getservbyport_r(0, 0, 0, 0, 0))
1886 AC_MSG_RESULT([yes])
1887 tst_compi_getservbyport_r="yes"
1888 tst_nargs_getservbyport_r="5"
1891 tst_compi_getservbyport_r="no"
1894 if test "$tst_nargs_getservbyport_r" = "unknown"; then
1895 AC_MSG_CHECKING([if getservbyport_r takes 6 args.])
1898 $curl_includes_netdb
1900 if(0 != getservbyport_r(0, 0, 0, 0, 0, 0))
1904 AC_MSG_RESULT([yes])
1905 tst_compi_getservbyport_r="yes"
1906 tst_nargs_getservbyport_r="6"
1909 tst_compi_getservbyport_r="no"
1912 AC_MSG_CHECKING([if getservbyport_r is compilable])
1913 if test "$tst_compi_getservbyport_r" = "yes"; then
1914 AC_MSG_RESULT([yes])
1920 if test "$tst_compi_getservbyport_r" = "yes"; then
1921 AC_MSG_CHECKING([if getservbyport_r usage allowed])
1922 if test "x$curl_disallow_getservbyport_r" != "xyes"; then
1923 AC_MSG_RESULT([yes])
1924 tst_allow_getservbyport_r="yes"
1927 tst_allow_getservbyport_r="no"
1931 AC_MSG_CHECKING([if getservbyport_r might be used])
1932 if test "$tst_links_getservbyport_r" = "yes" &&
1933 test "$tst_proto_getservbyport_r" = "yes" &&
1934 test "$tst_compi_getservbyport_r" = "yes" &&
1935 test "$tst_allow_getservbyport_r" = "yes"; then
1936 AC_MSG_RESULT([yes])
1937 AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1,
1938 [Define to 1 if you have the getservbyport_r function.])
1939 AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r,
1940 [Specifies the number of arguments to getservbyport_r])
1941 if test "$tst_nargs_getservbyport_r" -eq "4"; then
1942 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
1943 [Specifies the size of the buffer to pass to getservbyport_r])
1945 AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
1946 [Specifies the size of the buffer to pass to getservbyport_r])
1948 ac_cv_func_getservbyport_r="yes"
1951 ac_cv_func_getservbyport_r="no"
1956 dnl CURL_CHECK_FUNC_GMTIME_R
1957 dnl -------------------------------------------------
1958 dnl Verify if gmtime_r is available, prototyped, can
1959 dnl be compiled and seems to work. If all of these are
1960 dnl true, and usage has not been previously disallowed
1961 dnl with shell variable curl_disallow_gmtime_r, then
1962 dnl HAVE_GMTIME_R will be defined.
1964 AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
1965 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
1966 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
1968 tst_links_gmtime_r="unknown"
1969 tst_proto_gmtime_r="unknown"
1970 tst_compi_gmtime_r="unknown"
1971 tst_works_gmtime_r="unknown"
1972 tst_allow_gmtime_r="unknown"
1974 AC_MSG_CHECKING([if gmtime_r can be linked])
1976 AC_LANG_FUNC_LINK_TRY([gmtime_r])
1978 AC_MSG_RESULT([yes])
1979 tst_links_gmtime_r="yes"
1982 tst_links_gmtime_r="no"
1985 if test "$tst_links_gmtime_r" = "yes"; then
1986 AC_MSG_CHECKING([if gmtime_r is prototyped])
1987 AC_EGREP_CPP([gmtime_r],[
1990 AC_MSG_RESULT([yes])
1991 tst_proto_gmtime_r="yes"
1994 tst_proto_gmtime_r="no"
1998 if test "$tst_proto_gmtime_r" = "yes"; then
1999 AC_MSG_CHECKING([if gmtime_r is compilable])
2004 if(0 != gmtime_r(0, 0))
2008 AC_MSG_RESULT([yes])
2009 tst_compi_gmtime_r="yes"
2012 tst_compi_gmtime_r="no"
2016 dnl only do runtime verification when not cross-compiling
2017 if test "x$cross_compiling" != "xyes" &&
2018 test "$tst_compi_gmtime_r" = "yes"; then
2019 AC_MSG_CHECKING([if gmtime_r seems to work])
2022 $curl_includes_stdlib
2025 time_t local = 1170352587;
2028 gmt = gmtime_r(&local, &result);
2035 AC_MSG_RESULT([yes])
2036 tst_works_gmtime_r="yes"
2039 tst_works_gmtime_r="no"
2043 if test "$tst_compi_gmtime_r" = "yes" &&
2044 test "$tst_works_gmtime_r" != "no"; then
2045 AC_MSG_CHECKING([if gmtime_r usage allowed])
2046 if test "x$curl_disallow_gmtime_r" != "xyes"; then
2047 AC_MSG_RESULT([yes])
2048 tst_allow_gmtime_r="yes"
2051 tst_allow_gmtime_r="no"
2055 AC_MSG_CHECKING([if gmtime_r might be used])
2056 if test "$tst_links_gmtime_r" = "yes" &&
2057 test "$tst_proto_gmtime_r" = "yes" &&
2058 test "$tst_compi_gmtime_r" = "yes" &&
2059 test "$tst_allow_gmtime_r" = "yes" &&
2060 test "$tst_works_gmtime_r" != "no"; then
2061 AC_MSG_RESULT([yes])
2062 AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1,
2063 [Define to 1 if you have a working gmtime_r function.])
2064 ac_cv_func_gmtime_r="yes"
2067 ac_cv_func_gmtime_r="no"
2072 dnl CURL_CHECK_FUNC_INET_NTOA_R
2073 dnl -------------------------------------------------
2074 dnl Verify if inet_ntoa_r is available, prototyped,
2075 dnl and can be compiled. If all of these are true, and
2076 dnl usage has not been previously disallowed with
2077 dnl shell variable curl_disallow_inet_ntoa_r, then
2078 dnl HAVE_INET_NTOA_R will be defined.
2080 AC_DEFUN([CURL_CHECK_FUNC_INET_NTOA_R], [
2081 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
2083 tst_links_inet_ntoa_r="unknown"
2084 tst_proto_inet_ntoa_r="unknown"
2085 tst_compi_inet_ntoa_r="unknown"
2086 tst_allow_inet_ntoa_r="unknown"
2087 tst_nargs_inet_ntoa_r="unknown"
2089 AC_MSG_CHECKING([if inet_ntoa_r can be linked])
2091 AC_LANG_FUNC_LINK_TRY([inet_ntoa_r])
2093 AC_MSG_RESULT([yes])
2094 tst_links_inet_ntoa_r="yes"
2097 tst_links_inet_ntoa_r="no"
2100 if test "$tst_links_inet_ntoa_r" = "yes"; then
2101 AC_MSG_CHECKING([if inet_ntoa_r is prototyped])
2102 AC_EGREP_CPP([inet_ntoa_r],[
2103 $curl_includes_arpa_inet
2105 AC_MSG_RESULT([yes])
2106 tst_proto_inet_ntoa_r="yes"
2109 tst_proto_inet_ntoa_r="no"
2113 if test "$tst_proto_inet_ntoa_r" = "yes"; then
2114 if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
2115 AC_MSG_CHECKING([if inet_ntoa_r takes 2 args.])
2118 $curl_includes_arpa_inet
2120 struct in_addr addr;
2121 if(0 != inet_ntoa_r(addr, 0))
2125 AC_MSG_RESULT([yes])
2126 tst_compi_inet_ntoa_r="yes"
2127 tst_nargs_inet_ntoa_r="2"
2130 tst_compi_inet_ntoa_r="no"
2133 if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
2134 AC_MSG_CHECKING([if inet_ntoa_r takes 3 args.])
2137 $curl_includes_arpa_inet
2139 struct in_addr addr;
2140 if(0 != inet_ntoa_r(addr, 0, 0))
2144 AC_MSG_RESULT([yes])
2145 tst_compi_inet_ntoa_r="yes"
2146 tst_nargs_inet_ntoa_r="3"
2149 tst_compi_inet_ntoa_r="no"
2152 AC_MSG_CHECKING([if inet_ntoa_r is compilable])
2153 if test "$tst_compi_inet_ntoa_r" = "yes"; then
2154 AC_MSG_RESULT([yes])
2160 if test "$tst_compi_inet_ntoa_r" = "yes"; then
2161 AC_MSG_CHECKING([if inet_ntoa_r usage allowed])
2162 if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then
2163 AC_MSG_RESULT([yes])
2164 tst_allow_inet_ntoa_r="yes"
2167 tst_allow_inet_ntoa_r="no"
2171 AC_MSG_CHECKING([if inet_ntoa_r might be used])
2172 if test "$tst_links_inet_ntoa_r" = "yes" &&
2173 test "$tst_proto_inet_ntoa_r" = "yes" &&
2174 test "$tst_compi_inet_ntoa_r" = "yes" &&
2175 test "$tst_allow_inet_ntoa_r" = "yes"; then
2176 AC_MSG_RESULT([yes])
2177 AC_DEFINE_UNQUOTED(HAVE_INET_NTOA_R, 1,
2178 [Define to 1 if you have the inet_ntoa_r function.])
2179 dnl AC_DEFINE_UNQUOTED(INET_NTOA_R_ARGS, $tst_nargs_inet_ntoa_r,
2180 dnl [Specifies the number of arguments to inet_ntoa_r])
2182 if test "$tst_nargs_inet_ntoa_r" -eq "2"; then
2183 AC_DEFINE(HAVE_INET_NTOA_R_2, 1, [inet_ntoa_r() takes 2 args])
2184 elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then
2185 AC_DEFINE(HAVE_INET_NTOA_R_3, 1, [inet_ntoa_r() takes 3 args])
2188 ac_cv_func_inet_ntoa_r="yes"
2191 ac_cv_func_inet_ntoa_r="no"
2196 dnl CURL_CHECK_FUNC_INET_NTOP
2197 dnl -------------------------------------------------
2198 dnl Verify if inet_ntop is available, prototyped, can
2199 dnl be compiled and seems to work. If all of these are
2200 dnl true, and usage has not been previously disallowed
2201 dnl with shell variable curl_disallow_inet_ntop, then
2202 dnl HAVE_INET_NTOP will be defined.
2204 AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [
2205 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
2206 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
2207 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
2209 tst_links_inet_ntop="unknown"
2210 tst_proto_inet_ntop="unknown"
2211 tst_compi_inet_ntop="unknown"
2212 tst_works_inet_ntop="unknown"
2213 tst_allow_inet_ntop="unknown"
2215 AC_MSG_CHECKING([if inet_ntop can be linked])
2217 AC_LANG_FUNC_LINK_TRY([inet_ntop])
2219 AC_MSG_RESULT([yes])
2220 tst_links_inet_ntop="yes"
2223 tst_links_inet_ntop="no"
2226 if test "$tst_links_inet_ntop" = "yes"; then
2227 AC_MSG_CHECKING([if inet_ntop is prototyped])
2228 AC_EGREP_CPP([inet_ntop],[
2229 $curl_includes_arpa_inet
2231 AC_MSG_RESULT([yes])
2232 tst_proto_inet_ntop="yes"
2235 tst_proto_inet_ntop="no"
2239 if test "$tst_proto_inet_ntop" = "yes"; then
2240 AC_MSG_CHECKING([if inet_ntop is compilable])
2243 $curl_includes_arpa_inet
2245 if(0 != inet_ntop(0, 0, 0, 0))
2249 AC_MSG_RESULT([yes])
2250 tst_compi_inet_ntop="yes"
2253 tst_compi_inet_ntop="no"
2257 dnl only do runtime verification when not cross-compiling
2258 if test "x$cross_compiling" != "xyes" &&
2259 test "$tst_compi_inet_ntop" = "yes"; then
2260 AC_MSG_CHECKING([if inet_ntop seems to work])
2263 $curl_includes_stdlib
2264 $curl_includes_arpa_inet
2265 $curl_includes_string
2267 char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
2268 char ipv4res[sizeof "255.255.255.255"];
2269 unsigned char ipv6a[26];
2270 unsigned char ipv4a[5];
2281 ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
2284 if(ipv4ptr != ipv4res)
2288 if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
2292 memset(ipv6a, 0, sizeof(ipv6a));
2305 ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
2308 if(ipv6ptr != ipv6res)
2312 if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
2318 AC_MSG_RESULT([yes])
2319 tst_works_inet_ntop="yes"
2322 tst_works_inet_ntop="no"
2326 if test "$tst_compi_inet_ntop" = "yes" &&
2327 test "$tst_works_inet_ntop" != "no"; then
2328 AC_MSG_CHECKING([if inet_ntop usage allowed])
2329 if test "x$curl_disallow_inet_ntop" != "xyes"; then
2330 AC_MSG_RESULT([yes])
2331 tst_allow_inet_ntop="yes"
2334 tst_allow_inet_ntop="no"
2338 AC_MSG_CHECKING([if inet_ntop might be used])
2339 if test "$tst_links_inet_ntop" = "yes" &&
2340 test "$tst_proto_inet_ntop" = "yes" &&
2341 test "$tst_compi_inet_ntop" = "yes" &&
2342 test "$tst_allow_inet_ntop" = "yes" &&
2343 test "$tst_works_inet_ntop" != "no"; then
2344 AC_MSG_RESULT([yes])
2345 AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1,
2346 [Define to 1 if you have a IPv6 capable working inet_ntop function.])
2347 ac_cv_func_inet_ntop="yes"
2350 ac_cv_func_inet_ntop="no"
2355 dnl CURL_CHECK_FUNC_INET_PTON
2356 dnl -------------------------------------------------
2357 dnl Verify if inet_pton is available, prototyped, can
2358 dnl be compiled and seems to work. If all of these are
2359 dnl true, and usage has not been previously disallowed
2360 dnl with shell variable curl_disallow_inet_pton, then
2361 dnl HAVE_INET_PTON will be defined.
2363 AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
2364 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
2365 AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
2366 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
2368 tst_links_inet_pton="unknown"
2369 tst_proto_inet_pton="unknown"
2370 tst_compi_inet_pton="unknown"
2371 tst_works_inet_pton="unknown"
2372 tst_allow_inet_pton="unknown"
2374 AC_MSG_CHECKING([if inet_pton can be linked])
2376 AC_LANG_FUNC_LINK_TRY([inet_pton])
2378 AC_MSG_RESULT([yes])
2379 tst_links_inet_pton="yes"
2382 tst_links_inet_pton="no"
2385 if test "$tst_links_inet_pton" = "yes"; then
2386 AC_MSG_CHECKING([if inet_pton is prototyped])
2387 AC_EGREP_CPP([inet_pton],[
2388 $curl_includes_arpa_inet
2390 AC_MSG_RESULT([yes])
2391 tst_proto_inet_pton="yes"
2394 tst_proto_inet_pton="no"
2398 if test "$tst_proto_inet_pton" = "yes"; then
2399 AC_MSG_CHECKING([if inet_pton is compilable])
2402 $curl_includes_arpa_inet
2404 if(0 != inet_pton(0, 0, 0))
2408 AC_MSG_RESULT([yes])
2409 tst_compi_inet_pton="yes"
2412 tst_compi_inet_pton="no"
2416 dnl only do runtime verification when not cross-compiling
2417 if test "x$cross_compiling" != "xyes" &&
2418 test "$tst_compi_inet_pton" = "yes"; then
2419 AC_MSG_CHECKING([if inet_pton seems to work])
2422 $curl_includes_stdlib
2423 $curl_includes_arpa_inet
2424 $curl_includes_string
2426 unsigned char ipv6a[16+1];
2427 unsigned char ipv4a[4+1];
2428 const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
2429 const char *ipv4src = "192.168.100.1";
2431 memset(ipv4a, 1, sizeof(ipv4a));
2432 if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
2435 if( (ipv4a[0] != 0xc0) ||
2436 (ipv4a[1] != 0xa8) ||
2437 (ipv4a[2] != 0x64) ||
2438 (ipv4a[3] != 0x01) ||
2439 (ipv4a[4] != 0x01) )
2442 memset(ipv6a, 1, sizeof(ipv6a));
2443 if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
2446 if( (ipv6a[0] != 0xfe) ||
2447 (ipv6a[1] != 0x80) ||
2448 (ipv6a[8] != 0x02) ||
2449 (ipv6a[9] != 0x14) ||
2450 (ipv6a[10] != 0x4f) ||
2451 (ipv6a[11] != 0xff) ||
2452 (ipv6a[12] != 0xfe) ||
2453 (ipv6a[13] != 0x0b) ||
2454 (ipv6a[14] != 0x76) ||
2455 (ipv6a[15] != 0xc8) ||
2456 (ipv6a[16] != 0x01) )
2459 if( (ipv6a[2] != 0x0) ||
2460 (ipv6a[3] != 0x0) ||
2461 (ipv6a[4] != 0x0) ||
2462 (ipv6a[5] != 0x0) ||
2463 (ipv6a[6] != 0x0) ||
2470 AC_MSG_RESULT([yes])
2471 tst_works_inet_pton="yes"
2474 tst_works_inet_pton="no"
2478 if test "$tst_compi_inet_pton" = "yes" &&
2479 test "$tst_works_inet_pton" != "no"; then
2480 AC_MSG_CHECKING([if inet_pton usage allowed])
2481 if test "x$curl_disallow_inet_pton" != "xyes"; then
2482 AC_MSG_RESULT([yes])
2483 tst_allow_inet_pton="yes"
2486 tst_allow_inet_pton="no"
2490 AC_MSG_CHECKING([if inet_pton might be used])
2491 if test "$tst_links_inet_pton" = "yes" &&
2492 test "$tst_proto_inet_pton" = "yes" &&
2493 test "$tst_compi_inet_pton" = "yes" &&
2494 test "$tst_allow_inet_pton" = "yes" &&
2495 test "$tst_works_inet_pton" != "no"; then
2496 AC_MSG_RESULT([yes])
2497 AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1,
2498 [Define to 1 if you have a IPv6 capable working inet_pton function.])
2499 ac_cv_func_inet_pton="yes"
2502 ac_cv_func_inet_pton="no"
2507 dnl CURL_CHECK_FUNC_IOCTL
2508 dnl -------------------------------------------------
2509 dnl Verify if ioctl is available, prototyped, and
2510 dnl can be compiled. If all of these are true, and
2511 dnl usage has not been previously disallowed with
2512 dnl shell variable curl_disallow_ioctl, then
2513 dnl HAVE_IOCTL will be defined.
2515 AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [
2516 AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
2518 tst_links_ioctl="unknown"
2519 tst_proto_ioctl="unknown"
2520 tst_compi_ioctl="unknown"
2521 tst_allow_ioctl="unknown"
2523 AC_MSG_CHECKING([if ioctl can be linked])
2525 AC_LANG_FUNC_LINK_TRY([ioctl])
2527 AC_MSG_RESULT([yes])
2528 tst_links_ioctl="yes"
2531 tst_links_ioctl="no"
2534 if test "$tst_links_ioctl" = "yes"; then
2535 AC_MSG_CHECKING([if ioctl is prototyped])
2536 AC_EGREP_CPP([ioctl],[
2537 $curl_includes_stropts
2539 AC_MSG_RESULT([yes])
2540 tst_proto_ioctl="yes"
2543 tst_proto_ioctl="no"
2547 if test "$tst_proto_ioctl" = "yes"; then
2548 AC_MSG_CHECKING([if ioctl is compilable])
2551 $curl_includes_stropts
2553 if(0 != ioctl(0, 0, 0))
2557 AC_MSG_RESULT([yes])
2558 tst_compi_ioctl="yes"
2561 tst_compi_ioctl="no"
2565 if test "$tst_compi_ioctl" = "yes"; then
2566 AC_MSG_CHECKING([if ioctl usage allowed])
2567 if test "x$curl_disallow_ioctl" != "xyes"; then
2568 AC_MSG_RESULT([yes])
2569 tst_allow_ioctl="yes"
2572 tst_allow_ioctl="no"
2576 AC_MSG_CHECKING([if ioctl might be used])
2577 if test "$tst_links_ioctl" = "yes" &&
2578 test "$tst_proto_ioctl" = "yes" &&
2579 test "$tst_compi_ioctl" = "yes" &&
2580 test "$tst_allow_ioctl" = "yes"; then
2581 AC_MSG_RESULT([yes])
2582 AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1,
2583 [Define to 1 if you have the ioctl function.])
2584 ac_cv_func_ioctl="yes"
2585 CURL_CHECK_FUNC_IOCTL_FIONBIO
2586 CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
2589 ac_cv_func_ioctl="no"
2594 dnl CURL_CHECK_FUNC_IOCTL_FIONBIO
2595 dnl -------------------------------------------------
2596 dnl Verify if ioctl with the FIONBIO command is
2597 dnl available, can be compiled, and seems to work. If
2598 dnl all of these are true, then HAVE_IOCTL_FIONBIO
2599 dnl will be defined.
2601 AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [
2603 tst_compi_ioctl_fionbio="unknown"
2604 tst_allow_ioctl_fionbio="unknown"
2606 if test "$ac_cv_func_ioctl" = "yes"; then
2607 AC_MSG_CHECKING([if ioctl FIONBIO is compilable])
2610 $curl_includes_stropts
2613 if(0 != ioctl(0, FIONBIO, &flags))
2617 AC_MSG_RESULT([yes])
2618 tst_compi_ioctl_fionbio="yes"
2621 tst_compi_ioctl_fionbio="no"
2625 if test "$tst_compi_ioctl_fionbio" = "yes"; then
2626 AC_MSG_CHECKING([if ioctl FIONBIO usage allowed])
2627 if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then
2628 AC_MSG_RESULT([yes])
2629 tst_allow_ioctl_fionbio="yes"
2632 tst_allow_ioctl_fionbio="no"
2636 AC_MSG_CHECKING([if ioctl FIONBIO might be used])
2637 if test "$tst_compi_ioctl_fionbio" = "yes" &&
2638 test "$tst_allow_ioctl_fionbio" = "yes"; then
2639 AC_MSG_RESULT([yes])
2640 AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1,
2641 [Define to 1 if you have a working ioctl FIONBIO function.])
2642 ac_cv_func_ioctl_fionbio="yes"
2645 ac_cv_func_ioctl_fionbio="no"
2650 dnl CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
2651 dnl -------------------------------------------------
2652 dnl Verify if ioctl with the SIOCGIFADDR command is
2653 dnl available, can be compiled, and seems to work. If
2654 dnl all of these are true, then HAVE_IOCTL_SIOCGIFADDR
2655 dnl will be defined.
2657 AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [
2659 tst_compi_ioctl_siocgifaddr="unknown"
2660 tst_allow_ioctl_siocgifaddr="unknown"
2662 if test "$ac_cv_func_ioctl" = "yes"; then
2663 AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable])
2666 $curl_includes_stropts
2668 if(0 != ioctl(0, SIOCGIFADDR, 0))
2672 AC_MSG_RESULT([yes])
2673 tst_compi_ioctl_siocgifaddr="yes"
2676 tst_compi_ioctl_siocgifaddr="no"
2680 if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then
2681 AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed])
2682 if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then
2683 AC_MSG_RESULT([yes])
2684 tst_allow_ioctl_siocgifaddr="yes"
2687 tst_allow_ioctl_siocgifaddr="no"
2691 AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used])
2692 if test "$tst_compi_ioctl_siocgifaddr" = "yes" &&
2693 test "$tst_allow_ioctl_siocgifaddr" = "yes"; then
2694 AC_MSG_RESULT([yes])
2695 AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1,
2696 [Define to 1 if you have a working ioctl SIOCGIFADDR function.])
2697 ac_cv_func_ioctl_siocgifaddr="yes"
2700 ac_cv_func_ioctl_siocgifaddr="no"
2705 dnl CURL_CHECK_FUNC_IOCTLSOCKET
2706 dnl -------------------------------------------------
2707 dnl Verify if ioctlsocket is available, prototyped, and
2708 dnl can be compiled. If all of these are true, and
2709 dnl usage has not been previously disallowed with
2710 dnl shell variable curl_disallow_ioctlsocket, then
2711 dnl HAVE_IOCTLSOCKET will be defined.
2713 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [
2714 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2716 tst_links_ioctlsocket="unknown"
2717 tst_proto_ioctlsocket="unknown"
2718 tst_compi_ioctlsocket="unknown"
2719 tst_allow_ioctlsocket="unknown"
2721 AC_MSG_CHECKING([if ioctlsocket can be linked])
2724 $curl_includes_winsock2
2726 if(0 != ioctlsocket(0, 0, 0))
2730 AC_MSG_RESULT([yes])
2731 tst_links_ioctlsocket="yes"
2734 tst_links_ioctlsocket="no"
2737 if test "$tst_links_ioctlsocket" = "yes"; then
2738 AC_MSG_CHECKING([if ioctlsocket is prototyped])
2739 AC_EGREP_CPP([ioctlsocket],[
2740 $curl_includes_winsock2
2742 AC_MSG_RESULT([yes])
2743 tst_proto_ioctlsocket="yes"
2746 tst_proto_ioctlsocket="no"
2750 if test "$tst_proto_ioctlsocket" = "yes"; then
2751 AC_MSG_CHECKING([if ioctlsocket is compilable])
2754 $curl_includes_winsock2
2756 if(0 != ioctlsocket(0, 0, 0))
2760 AC_MSG_RESULT([yes])
2761 tst_compi_ioctlsocket="yes"
2764 tst_compi_ioctlsocket="no"
2768 if test "$tst_compi_ioctlsocket" = "yes"; then
2769 AC_MSG_CHECKING([if ioctlsocket usage allowed])
2770 if test "x$curl_disallow_ioctlsocket" != "xyes"; then
2771 AC_MSG_RESULT([yes])
2772 tst_allow_ioctlsocket="yes"
2775 tst_allow_ioctlsocket="no"
2779 AC_MSG_CHECKING([if ioctlsocket might be used])
2780 if test "$tst_links_ioctlsocket" = "yes" &&
2781 test "$tst_proto_ioctlsocket" = "yes" &&
2782 test "$tst_compi_ioctlsocket" = "yes" &&
2783 test "$tst_allow_ioctlsocket" = "yes"; then
2784 AC_MSG_RESULT([yes])
2785 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1,
2786 [Define to 1 if you have the ioctlsocket function.])
2787 ac_cv_func_ioctlsocket="yes"
2788 CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
2791 ac_cv_func_ioctlsocket="no"
2796 dnl CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
2797 dnl -------------------------------------------------
2798 dnl Verify if ioctlsocket with the FIONBIO command is
2799 dnl available, can be compiled, and seems to work. If
2800 dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO
2801 dnl will be defined.
2803 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [
2805 tst_compi_ioctlsocket_fionbio="unknown"
2806 tst_allow_ioctlsocket_fionbio="unknown"
2808 if test "$ac_cv_func_ioctlsocket" = "yes"; then
2809 AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable])
2812 $curl_includes_winsock2
2815 if(0 != ioctlsocket(0, FIONBIO, &flags))
2819 AC_MSG_RESULT([yes])
2820 tst_compi_ioctlsocket_fionbio="yes"
2823 tst_compi_ioctlsocket_fionbio="no"
2827 if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then
2828 AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed])
2829 if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then
2830 AC_MSG_RESULT([yes])
2831 tst_allow_ioctlsocket_fionbio="yes"
2834 tst_allow_ioctlsocket_fionbio="no"
2838 AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used])
2839 if test "$tst_compi_ioctlsocket_fionbio" = "yes" &&
2840 test "$tst_allow_ioctlsocket_fionbio" = "yes"; then
2841 AC_MSG_RESULT([yes])
2842 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1,
2843 [Define to 1 if you have a working ioctlsocket FIONBIO function.])
2844 ac_cv_func_ioctlsocket_fionbio="yes"
2847 ac_cv_func_ioctlsocket_fionbio="no"
2852 dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
2853 dnl -------------------------------------------------
2854 dnl Verify if IoctlSocket is available, prototyped, and
2855 dnl can be compiled. If all of these are true, and
2856 dnl usage has not been previously disallowed with
2857 dnl shell variable curl_disallow_ioctlsocket_camel,
2858 dnl then HAVE_IOCTLSOCKET_CAMEL will be defined.
2860 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
2861 AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
2863 tst_links_ioctlsocket_camel="unknown"
2864 tst_proto_ioctlsocket_camel="unknown"
2865 tst_compi_ioctlsocket_camel="unknown"
2866 tst_allow_ioctlsocket_camel="unknown"
2868 AC_MSG_CHECKING([if IoctlSocket can be linked])
2870 AC_LANG_FUNC_LINK_TRY([IoctlSocket])
2872 AC_MSG_RESULT([yes])
2873 tst_links_ioctlsocket_camel="yes"
2876 tst_links_ioctlsocket_camel="no"
2879 if test "$tst_links_ioctlsocket_camel" = "yes"; then
2880 AC_MSG_CHECKING([if IoctlSocket is prototyped])
2881 AC_EGREP_CPP([IoctlSocket],[
2882 $curl_includes_stropts
2884 AC_MSG_RESULT([yes])
2885 tst_proto_ioctlsocket_camel="yes"
2888 tst_proto_ioctlsocket_camel="no"
2892 if test "$tst_proto_ioctlsocket_camel" = "yes"; then
2893 AC_MSG_CHECKING([if IoctlSocket is compilable])
2896 $curl_includes_stropts
2898 if(0 != IoctlSocket(0, 0, 0))
2902 AC_MSG_RESULT([yes])
2903 tst_compi_ioctlsocket_camel="yes"
2906 tst_compi_ioctlsocket_camel="no"
2910 if test "$tst_compi_ioctlsocket_camel" = "yes"; then
2911 AC_MSG_CHECKING([if IoctlSocket usage allowed])
2912 if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then
2913 AC_MSG_RESULT([yes])
2914 tst_allow_ioctlsocket_camel="yes"
2917 tst_allow_ioctlsocket_camel="no"
2921 AC_MSG_CHECKING([if IoctlSocket might be used])
2922 if test "$tst_links_ioctlsocket_camel" = "yes" &&
2923 test "$tst_proto_ioctlsocket_camel" = "yes" &&
2924 test "$tst_compi_ioctlsocket_camel" = "yes" &&
2925 test "$tst_allow_ioctlsocket_camel" = "yes"; then
2926 AC_MSG_RESULT([yes])
2927 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1,
2928 [Define to 1 if you have the IoctlSocket camel case function.])
2929 ac_cv_func_ioctlsocket_camel="yes"
2930 CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
2933 ac_cv_func_ioctlsocket_camel="no"
2938 dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
2939 dnl -------------------------------------------------
2940 dnl Verify if IoctlSocket with FIONBIO command is available,
2941 dnl can be compiled, and seems to work. If all of these are
2942 dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined.
2944 AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [
2946 tst_compi_ioctlsocket_camel_fionbio="unknown"
2947 tst_allow_ioctlsocket_camel_fionbio="unknown"
2949 if test "$ac_cv_func_ioctlsocket_camel" = "yes"; then
2950 AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable])
2953 $curl_includes_stropts
2956 if(0 != ioctlsocket(0, FIONBIO, &flags))
2960 AC_MSG_RESULT([yes])
2961 tst_compi_ioctlsocket_camel_fionbio="yes"
2964 tst_compi_ioctlsocket_camel_fionbio="no"
2968 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then
2969 AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed])
2970 if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then
2971 AC_MSG_RESULT([yes])
2972 tst_allow_ioctlsocket_camel_fionbio="yes"
2975 tst_allow_ioctlsocket_camel_fionbio="no"
2979 AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used])
2980 if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" &&
2981 test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then
2982 AC_MSG_RESULT([yes])
2983 AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1,
2984 [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.])
2985 ac_cv_func_ioctlsocket_camel_fionbio="yes"
2988 ac_cv_func_ioctlsocket_camel_fionbio="no"
2993 dnl CURL_CHECK_FUNC_LOCALTIME_R
2994 dnl -------------------------------------------------
2995 dnl Verify if localtime_r is available, prototyped, can
2996 dnl be compiled and seems to work. If all of these are
2997 dnl true, and usage has not been previously disallowed
2998 dnl with shell variable curl_disallow_localtime_r, then
2999 dnl HAVE_LOCALTIME_R will be defined.
3001 AC_DEFUN([CURL_CHECK_FUNC_LOCALTIME_R], [
3002 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3003 AC_REQUIRE([CURL_INCLUDES_TIME])dnl
3005 tst_links_localtime_r="unknown"
3006 tst_proto_localtime_r="unknown"
3007 tst_compi_localtime_r="unknown"
3008 tst_works_localtime_r="unknown"
3009 tst_allow_localtime_r="unknown"
3011 AC_MSG_CHECKING([if localtime_r can be linked])
3013 AC_LANG_FUNC_LINK_TRY([localtime_r])
3015 AC_MSG_RESULT([yes])
3016 tst_links_localtime_r="yes"
3019 tst_links_localtime_r="no"
3022 if test "$tst_links_localtime_r" = "yes"; then
3023 AC_MSG_CHECKING([if localtime_r is prototyped])
3024 AC_EGREP_CPP([localtime_r],[
3027 AC_MSG_RESULT([yes])
3028 tst_proto_localtime_r="yes"
3031 tst_proto_localtime_r="no"
3035 if test "$tst_proto_localtime_r" = "yes"; then
3036 AC_MSG_CHECKING([if localtime_r is compilable])
3041 if(0 != localtime_r(0, 0))
3045 AC_MSG_RESULT([yes])
3046 tst_compi_localtime_r="yes"
3049 tst_compi_localtime_r="no"
3053 dnl only do runtime verification when not cross-compiling
3054 if test "x$cross_compiling" != "xyes" &&
3055 test "$tst_compi_localtime_r" = "yes"; then
3056 AC_MSG_CHECKING([if localtime_r seems to work])
3059 $curl_includes_stdlib
3062 time_t clock = 1170352587;
3065 tmp = localtime_r(&clock, &result);
3072 AC_MSG_RESULT([yes])
3073 tst_works_localtime_r="yes"
3076 tst_works_localtime_r="no"
3080 if test "$tst_compi_localtime_r" = "yes" &&
3081 test "$tst_works_localtime_r" != "no"; then
3082 AC_MSG_CHECKING([if localtime_r usage allowed])
3083 if test "x$curl_disallow_localtime_r" != "xyes"; then
3084 AC_MSG_RESULT([yes])
3085 tst_allow_localtime_r="yes"
3088 tst_allow_localtime_r="no"
3092 AC_MSG_CHECKING([if localtime_r might be used])
3093 if test "$tst_links_localtime_r" = "yes" &&
3094 test "$tst_proto_localtime_r" = "yes" &&
3095 test "$tst_compi_localtime_r" = "yes" &&
3096 test "$tst_allow_localtime_r" = "yes" &&
3097 test "$tst_works_localtime_r" != "no"; then
3098 AC_MSG_RESULT([yes])
3099 AC_DEFINE_UNQUOTED(HAVE_LOCALTIME_R, 1,
3100 [Define to 1 if you have a working localtime_r function.])
3101 ac_cv_func_localtime_r="yes"
3104 ac_cv_func_localtime_r="no"
3109 dnl CURL_CHECK_FUNC_SETSOCKOPT
3110 dnl -------------------------------------------------
3111 dnl Verify if setsockopt is available, prototyped, and
3112 dnl can be compiled. If all of these are true, and
3113 dnl usage has not been previously disallowed with
3114 dnl shell variable curl_disallow_setsockopt, then
3115 dnl HAVE_SETSOCKOPT will be defined.
3117 AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT], [
3118 AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
3119 AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
3121 tst_links_setsockopt="unknown"
3122 tst_proto_setsockopt="unknown"
3123 tst_compi_setsockopt="unknown"
3124 tst_allow_setsockopt="unknown"
3126 AC_MSG_CHECKING([if setsockopt can be linked])
3129 $curl_includes_winsock2
3130 $curl_includes_sys_socket
3132 if(0 != setsockopt(0, 0, 0, 0, 0))
3136 AC_MSG_RESULT([yes])
3137 tst_links_setsockopt="yes"
3140 tst_links_setsockopt="no"
3143 if test "$tst_links_setsockopt" = "yes"; then
3144 AC_MSG_CHECKING([if setsockopt is prototyped])
3145 AC_EGREP_CPP([setsockopt],[
3146 $curl_includes_winsock2
3147 $curl_includes_sys_socket
3149 AC_MSG_RESULT([yes])
3150 tst_proto_setsockopt="yes"
3153 tst_proto_setsockopt="no"
3157 if test "$tst_proto_setsockopt" = "yes"; then
3158 AC_MSG_CHECKING([if setsockopt is compilable])
3161 $curl_includes_winsock2
3162 $curl_includes_sys_socket
3164 if(0 != setsockopt(0, 0, 0, 0, 0))
3168 AC_MSG_RESULT([yes])
3169 tst_compi_setsockopt="yes"
3172 tst_compi_setsockopt="no"
3176 if test "$tst_compi_setsockopt" = "yes"; then
3177 AC_MSG_CHECKING([if setsockopt usage allowed])
3178 if test "x$curl_disallow_setsockopt" != "xyes"; then
3179 AC_MSG_RESULT([yes])
3180 tst_allow_setsockopt="yes"
3183 tst_allow_setsockopt="no"
3187 AC_MSG_CHECKING([if setsockopt might be used])
3188 if test "$tst_links_setsockopt" = "yes" &&
3189 test "$tst_proto_setsockopt" = "yes" &&
3190 test "$tst_compi_setsockopt" = "yes" &&
3191 test "$tst_allow_setsockopt" = "yes"; then
3192 AC_MSG_RESULT([yes])
3193 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT, 1,
3194 [Define to 1 if you have the setsockopt function.])
3195 ac_cv_func_setsockopt="yes"
3196 CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
3199 ac_cv_func_setsockopt="no"
3204 dnl CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
3205 dnl -------------------------------------------------
3206 dnl Verify if setsockopt with the SO_NONBLOCK command is
3207 dnl available, can be compiled, and seems to work. If
3208 dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK
3209 dnl will be defined.
3211 AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [
3213 tst_compi_setsockopt_so_nonblock="unknown"
3214 tst_allow_setsockopt_so_nonblock="unknown"
3216 if test "$ac_cv_func_setsockopt" = "yes"; then
3217 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable])
3220 $curl_includes_winsock2
3221 $curl_includes_sys_socket
3223 if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
3227 AC_MSG_RESULT([yes])
3228 tst_compi_setsockopt_so_nonblock="yes"
3231 tst_compi_setsockopt_so_nonblock="no"
3235 if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then
3236 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed])
3237 if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then
3238 AC_MSG_RESULT([yes])
3239 tst_allow_setsockopt_so_nonblock="yes"
3242 tst_allow_setsockopt_so_nonblock="no"
3246 AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used])
3247 if test "$tst_compi_setsockopt_so_nonblock" = "yes" &&
3248 test "$tst_allow_setsockopt_so_nonblock" = "yes"; then
3249 AC_MSG_RESULT([yes])
3250 AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1,
3251 [Define to 1 if you have a working setsockopt SO_NONBLOCK function.])
3252 ac_cv_func_setsockopt_so_nonblock="yes"
3255 ac_cv_func_setsockopt_so_nonblock="no"
3260 dnl CURL_CHECK_FUNC_SIGACTION
3261 dnl -------------------------------------------------
3262 dnl Verify if sigaction is available, prototyped, and
3263 dnl can be compiled. If all of these are true, and
3264 dnl usage has not been previously disallowed with
3265 dnl shell variable curl_disallow_sigaction, then
3266 dnl HAVE_SIGACTION will be defined.
3268 AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [
3269 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
3271 tst_links_sigaction="unknown"
3272 tst_proto_sigaction="unknown"
3273 tst_compi_sigaction="unknown"
3274 tst_allow_sigaction="unknown"
3276 AC_MSG_CHECKING([if sigaction can be linked])
3278 AC_LANG_FUNC_LINK_TRY([sigaction])
3280 AC_MSG_RESULT([yes])
3281 tst_links_sigaction="yes"
3284 tst_links_sigaction="no"
3287 if test "$tst_links_sigaction" = "yes"; then
3288 AC_MSG_CHECKING([if sigaction is prototyped])
3289 AC_EGREP_CPP([sigaction],[
3290 $curl_includes_signal
3292 AC_MSG_RESULT([yes])
3293 tst_proto_sigaction="yes"
3296 tst_proto_sigaction="no"
3300 if test "$tst_proto_sigaction" = "yes"; then
3301 AC_MSG_CHECKING([if sigaction is compilable])
3304 $curl_includes_signal
3306 if(0 != sigaction(0, 0, 0))
3310 AC_MSG_RESULT([yes])
3311 tst_compi_sigaction="yes"
3314 tst_compi_sigaction="no"
3318 if test "$tst_compi_sigaction" = "yes"; then
3319 AC_MSG_CHECKING([if sigaction usage allowed])
3320 if test "x$curl_disallow_sigaction" != "xyes"; then
3321 AC_MSG_RESULT([yes])
3322 tst_allow_sigaction="yes"
3325 tst_allow_sigaction="no"
3329 AC_MSG_CHECKING([if sigaction might be used])
3330 if test "$tst_links_sigaction" = "yes" &&
3331 test "$tst_proto_sigaction" = "yes" &&
3332 test "$tst_compi_sigaction" = "yes" &&
3333 test "$tst_allow_sigaction" = "yes"; then
3334 AC_MSG_RESULT([yes])
3335 AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1,
3336 [Define to 1 if you have the sigaction function.])
3337 ac_cv_func_sigaction="yes"
3340 ac_cv_func_sigaction="no"
3345 dnl CURL_CHECK_FUNC_SIGINTERRUPT
3346 dnl -------------------------------------------------
3347 dnl Verify if siginterrupt is available, prototyped, and
3348 dnl can be compiled. If all of these are true, and
3349 dnl usage has not been previously disallowed with
3350 dnl shell variable curl_disallow_siginterrupt, then
3351 dnl HAVE_SIGINTERRUPT will be defined.
3353 AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [
3354 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
3356 tst_links_siginterrupt="unknown"
3357 tst_proto_siginterrupt="unknown"
3358 tst_compi_siginterrupt="unknown"
3359 tst_allow_siginterrupt="unknown"
3361 AC_MSG_CHECKING([if siginterrupt can be linked])
3363 AC_LANG_FUNC_LINK_TRY([siginterrupt])
3365 AC_MSG_RESULT([yes])
3366 tst_links_siginterrupt="yes"
3369 tst_links_siginterrupt="no"
3372 if test "$tst_links_siginterrupt" = "yes"; then
3373 AC_MSG_CHECKING([if siginterrupt is prototyped])
3374 AC_EGREP_CPP([siginterrupt],[
3375 $curl_includes_signal
3377 AC_MSG_RESULT([yes])
3378 tst_proto_siginterrupt="yes"
3381 tst_proto_siginterrupt="no"
3385 if test "$tst_proto_siginterrupt" = "yes"; then
3386 AC_MSG_CHECKING([if siginterrupt is compilable])
3389 $curl_includes_signal
3391 if(0 != siginterrupt(0, 0))
3395 AC_MSG_RESULT([yes])
3396 tst_compi_siginterrupt="yes"
3399 tst_compi_siginterrupt="no"
3403 if test "$tst_compi_siginterrupt" = "yes"; then
3404 AC_MSG_CHECKING([if siginterrupt usage allowed])
3405 if test "x$curl_disallow_siginterrupt" != "xyes"; then
3406 AC_MSG_RESULT([yes])
3407 tst_allow_siginterrupt="yes"
3410 tst_allow_siginterrupt="no"
3414 AC_MSG_CHECKING([if siginterrupt might be used])
3415 if test "$tst_links_siginterrupt" = "yes" &&
3416 test "$tst_proto_siginterrupt" = "yes" &&
3417 test "$tst_compi_siginterrupt" = "yes" &&
3418 test "$tst_allow_siginterrupt" = "yes"; then
3419 AC_MSG_RESULT([yes])
3420 AC_DEFINE_UNQUOTED(HAVE_SIGINTERRUPT, 1,
3421 [Define to 1 if you have the siginterrupt function.])
3422 ac_cv_func_siginterrupt="yes"
3425 ac_cv_func_siginterrupt="no"
3430 dnl CURL_CHECK_FUNC_SIGNAL
3431 dnl -------------------------------------------------
3432 dnl Verify if signal is available, prototyped, and
3433 dnl can be compiled. If all of these are true, and
3434 dnl usage has not been previously disallowed with
3435 dnl shell variable curl_disallow_signal, then
3436 dnl HAVE_SIGNAL will be defined.
3438 AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [
3439 AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
3441 tst_links_signal="unknown"
3442 tst_proto_signal="unknown"
3443 tst_compi_signal="unknown"
3444 tst_allow_signal="unknown"
3446 AC_MSG_CHECKING([if signal can be linked])
3448 AC_LANG_FUNC_LINK_TRY([signal])
3450 AC_MSG_RESULT([yes])
3451 tst_links_signal="yes"
3454 tst_links_signal="no"
3457 if test "$tst_links_signal" = "yes"; then
3458 AC_MSG_CHECKING([if signal is prototyped])
3459 AC_EGREP_CPP([signal],[
3460 $curl_includes_signal
3462 AC_MSG_RESULT([yes])
3463 tst_proto_signal="yes"
3466 tst_proto_signal="no"
3470 if test "$tst_proto_signal" = "yes"; then
3471 AC_MSG_CHECKING([if signal is compilable])
3474 $curl_includes_signal
3476 if(0 != signal(0, 0))
3480 AC_MSG_RESULT([yes])
3481 tst_compi_signal="yes"
3484 tst_compi_signal="no"
3488 if test "$tst_compi_signal" = "yes"; then
3489 AC_MSG_CHECKING([if signal usage allowed])
3490 if test "x$curl_disallow_signal" != "xyes"; then
3491 AC_MSG_RESULT([yes])
3492 tst_allow_signal="yes"
3495 tst_allow_signal="no"
3499 AC_MSG_CHECKING([if signal might be used])
3500 if test "$tst_links_signal" = "yes" &&
3501 test "$tst_proto_signal" = "yes" &&
3502 test "$tst_compi_signal" = "yes" &&
3503 test "$tst_allow_signal" = "yes"; then
3504 AC_MSG_RESULT([yes])
3505 AC_DEFINE_UNQUOTED(HAVE_SIGNAL, 1,
3506 [Define to 1 if you have the signal function.])
3507 ac_cv_func_signal="yes"
3510 ac_cv_func_signal="no"
3515 dnl CURL_CHECK_FUNC_SIGSETJMP
3516 dnl -------------------------------------------------
3517 dnl Verify if sigsetjmp is available, prototyped, and
3518 dnl can be compiled. If all of these are true, and
3519 dnl usage has not been previously disallowed with
3520 dnl shell variable curl_disallow_sigsetjmp, then
3521 dnl HAVE_SIGSETJMP will be defined.
3523 AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [
3524 AC_REQUIRE([CURL_INCLUDES_SETJMP])dnl
3526 tst_links_sigsetjmp="unknown"
3527 tst_macro_sigsetjmp="unknown"
3528 tst_proto_sigsetjmp="unknown"
3529 tst_compi_sigsetjmp="unknown"
3530 tst_allow_sigsetjmp="unknown"
3532 AC_MSG_CHECKING([if sigsetjmp can be linked])
3534 AC_LANG_FUNC_LINK_TRY([sigsetjmp])
3536 AC_MSG_RESULT([yes])
3537 tst_links_sigsetjmp="yes"
3540 tst_links_sigsetjmp="no"
3543 if test "$tst_links_sigsetjmp" = "no"; then
3544 AC_MSG_CHECKING([if sigsetjmp seems a macro])
3547 $curl_includes_setjmp
3550 if(0 != sigsetjmp(env, 0))
3554 AC_MSG_RESULT([yes])
3555 tst_macro_sigsetjmp="yes"
3558 tst_macro_sigsetjmp="no"
3562 if test "$tst_links_sigsetjmp" = "yes"; then
3563 AC_MSG_CHECKING([if sigsetjmp is prototyped])
3564 AC_EGREP_CPP([sigsetjmp],[
3565 $curl_includes_setjmp
3567 AC_MSG_RESULT([yes])
3568 tst_proto_sigsetjmp="yes"
3571 tst_proto_sigsetjmp="no"
3575 if test "$tst_proto_sigsetjmp" = "yes" ||
3576 test "$tst_macro_sigsetjmp" = "yes"; then
3577 AC_MSG_CHECKING([if sigsetjmp is compilable])
3580 $curl_includes_setjmp
3583 if(0 != sigsetjmp(env, 0))
3587 AC_MSG_RESULT([yes])
3588 tst_compi_sigsetjmp="yes"
3591 tst_compi_sigsetjmp="no"
3595 if test "$tst_compi_sigsetjmp" = "yes"; then
3596 AC_MSG_CHECKING([if sigsetjmp usage allowed])
3597 if test "x$curl_disallow_sigsetjmp" != "xyes"; then
3598 AC_MSG_RESULT([yes])
3599 tst_allow_sigsetjmp="yes"
3602 tst_allow_sigsetjmp="no"
3606 AC_MSG_CHECKING([if sigsetjmp might be used])
3607 if (test "$tst_proto_sigsetjmp" = "yes" ||
3608 test "$tst_macro_sigsetjmp" = "yes") &&
3609 test "$tst_compi_sigsetjmp" = "yes" &&
3610 test "$tst_allow_sigsetjmp" = "yes"; then
3611 AC_MSG_RESULT([yes])
3612 AC_DEFINE_UNQUOTED(HAVE_SIGSETJMP, 1,
3613 [Define to 1 if you have the sigsetjmp function or macro.])
3614 ac_cv_func_sigsetjmp="yes"
3617 ac_cv_func_sigsetjmp="no"
3622 dnl CURL_CHECK_FUNC_STRCASECMP
3623 dnl -------------------------------------------------
3624 dnl Verify if strcasecmp is available, prototyped, and
3625 dnl can be compiled. If all of these are true, and
3626 dnl usage has not been previously disallowed with
3627 dnl shell variable curl_disallow_strcasecmp, then
3628 dnl HAVE_STRCASECMP will be defined.
3630 AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
3631 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3633 tst_links_strcasecmp="unknown"
3634 tst_proto_strcasecmp="unknown"
3635 tst_compi_strcasecmp="unknown"
3636 tst_allow_strcasecmp="unknown"
3638 AC_MSG_CHECKING([if strcasecmp can be linked])
3640 AC_LANG_FUNC_LINK_TRY([strcasecmp])
3642 AC_MSG_RESULT([yes])
3643 tst_links_strcasecmp="yes"
3646 tst_links_strcasecmp="no"
3649 if test "$tst_links_strcasecmp" = "yes"; then
3650 AC_MSG_CHECKING([if strcasecmp is prototyped])
3651 AC_EGREP_CPP([strcasecmp],[
3652 $curl_includes_string
3654 AC_MSG_RESULT([yes])
3655 tst_proto_strcasecmp="yes"
3658 tst_proto_strcasecmp="no"
3662 if test "$tst_proto_strcasecmp" = "yes"; then
3663 AC_MSG_CHECKING([if strcasecmp is compilable])
3666 $curl_includes_string
3668 if(0 != strcasecmp(0, 0))
3672 AC_MSG_RESULT([yes])
3673 tst_compi_strcasecmp="yes"
3676 tst_compi_strcasecmp="no"
3680 if test "$tst_compi_strcasecmp" = "yes"; then
3681 AC_MSG_CHECKING([if strcasecmp usage allowed])
3682 if test "x$curl_disallow_strcasecmp" != "xyes"; then
3683 AC_MSG_RESULT([yes])
3684 tst_allow_strcasecmp="yes"
3687 tst_allow_strcasecmp="no"
3691 AC_MSG_CHECKING([if strcasecmp might be used])
3692 if test "$tst_links_strcasecmp" = "yes" &&
3693 test "$tst_proto_strcasecmp" = "yes" &&
3694 test "$tst_compi_strcasecmp" = "yes" &&
3695 test "$tst_allow_strcasecmp" = "yes"; then
3696 AC_MSG_RESULT([yes])
3697 AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
3698 [Define to 1 if you have the strcasecmp function.])
3699 ac_cv_func_strcasecmp="yes"
3702 ac_cv_func_strcasecmp="no"
3707 dnl CURL_CHECK_FUNC_STRCASESTR
3708 dnl -------------------------------------------------
3709 dnl Verify if strcasestr is available, prototyped, and
3710 dnl can be compiled. If all of these are true, and
3711 dnl usage has not been previously disallowed with
3712 dnl shell variable curl_disallow_strcasestr, then
3713 dnl HAVE_STRCASESTR will be defined.
3715 AC_DEFUN([CURL_CHECK_FUNC_STRCASESTR], [
3716 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3718 tst_links_strcasestr="unknown"
3719 tst_proto_strcasestr="unknown"
3720 tst_compi_strcasestr="unknown"
3721 tst_allow_strcasestr="unknown"
3723 AC_MSG_CHECKING([if strcasestr can be linked])
3725 AC_LANG_FUNC_LINK_TRY([strcasestr])
3727 AC_MSG_RESULT([yes])
3728 tst_links_strcasestr="yes"
3731 tst_links_strcasestr="no"
3734 if test "$tst_links_strcasestr" = "yes"; then
3735 AC_MSG_CHECKING([if strcasestr is prototyped])
3736 AC_EGREP_CPP([strcasestr],[
3737 $curl_includes_string
3739 AC_MSG_RESULT([yes])
3740 tst_proto_strcasestr="yes"
3743 tst_proto_strcasestr="no"
3747 if test "$tst_proto_strcasestr" = "yes"; then
3748 AC_MSG_CHECKING([if strcasestr is compilable])
3751 $curl_includes_string
3753 if(0 != strcasestr(0, 0))
3757 AC_MSG_RESULT([yes])
3758 tst_compi_strcasestr="yes"
3761 tst_compi_strcasestr="no"
3765 if test "$tst_compi_strcasestr" = "yes"; then
3766 AC_MSG_CHECKING([if strcasestr usage allowed])
3767 if test "x$curl_disallow_strcasestr" != "xyes"; then
3768 AC_MSG_RESULT([yes])
3769 tst_allow_strcasestr="yes"
3772 tst_allow_strcasestr="no"
3776 AC_MSG_CHECKING([if strcasestr might be used])
3777 if test "$tst_links_strcasestr" = "yes" &&
3778 test "$tst_proto_strcasestr" = "yes" &&
3779 test "$tst_compi_strcasestr" = "yes" &&
3780 test "$tst_allow_strcasestr" = "yes"; then
3781 AC_MSG_RESULT([yes])
3782 AC_DEFINE_UNQUOTED(HAVE_STRCASESTR, 1,
3783 [Define to 1 if you have the strcasestr function.])
3784 ac_cv_func_strcasestr="yes"
3787 ac_cv_func_strcasestr="no"
3792 dnl CURL_CHECK_FUNC_STRCMPI
3793 dnl -------------------------------------------------
3794 dnl Verify if strcmpi is available, prototyped, and
3795 dnl can be compiled. If all of these are true, and
3796 dnl usage has not been previously disallowed with
3797 dnl shell variable curl_disallow_strcmpi, then
3798 dnl HAVE_STRCMPI will be defined.
3800 AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
3801 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3803 tst_links_strcmpi="unknown"
3804 tst_proto_strcmpi="unknown"
3805 tst_compi_strcmpi="unknown"
3806 tst_allow_strcmpi="unknown"
3808 AC_MSG_CHECKING([if strcmpi can be linked])
3810 AC_LANG_FUNC_LINK_TRY([strcmpi])
3812 AC_MSG_RESULT([yes])
3813 tst_links_strcmpi="yes"
3816 tst_links_strcmpi="no"
3819 if test "$tst_links_strcmpi" = "yes"; then
3820 AC_MSG_CHECKING([if strcmpi is prototyped])
3821 AC_EGREP_CPP([strcmpi],[
3822 $curl_includes_string
3824 AC_MSG_RESULT([yes])
3825 tst_proto_strcmpi="yes"
3828 tst_proto_strcmpi="no"
3832 if test "$tst_proto_strcmpi" = "yes"; then
3833 AC_MSG_CHECKING([if strcmpi is compilable])
3836 $curl_includes_string
3838 if(0 != strcmpi(0, 0))
3842 AC_MSG_RESULT([yes])
3843 tst_compi_strcmpi="yes"
3846 tst_compi_strcmpi="no"
3850 if test "$tst_compi_strcmpi" = "yes"; then
3851 AC_MSG_CHECKING([if strcmpi usage allowed])
3852 if test "x$curl_disallow_strcmpi" != "xyes"; then
3853 AC_MSG_RESULT([yes])
3854 tst_allow_strcmpi="yes"
3857 tst_allow_strcmpi="no"
3861 AC_MSG_CHECKING([if strcmpi might be used])
3862 if test "$tst_links_strcmpi" = "yes" &&
3863 test "$tst_proto_strcmpi" = "yes" &&
3864 test "$tst_compi_strcmpi" = "yes" &&
3865 test "$tst_allow_strcmpi" = "yes"; then
3866 AC_MSG_RESULT([yes])
3867 AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
3868 [Define to 1 if you have the strcmpi function.])
3869 ac_cv_func_strcmpi="yes"
3872 ac_cv_func_strcmpi="no"
3877 dnl CURL_CHECK_FUNC_STRDUP
3878 dnl -------------------------------------------------
3879 dnl Verify if strdup is available, prototyped, and
3880 dnl can be compiled. If all of these are true, and
3881 dnl usage has not been previously disallowed with
3882 dnl shell variable curl_disallow_strdup, then
3883 dnl HAVE_STRDUP will be defined.
3885 AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [
3886 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3888 tst_links_strdup="unknown"
3889 tst_proto_strdup="unknown"
3890 tst_compi_strdup="unknown"
3891 tst_allow_strdup="unknown"
3893 AC_MSG_CHECKING([if strdup can be linked])
3895 AC_LANG_FUNC_LINK_TRY([strdup])
3897 AC_MSG_RESULT([yes])
3898 tst_links_strdup="yes"
3901 tst_links_strdup="no"
3904 if test "$tst_links_strdup" = "yes"; then
3905 AC_MSG_CHECKING([if strdup is prototyped])
3906 AC_EGREP_CPP([strdup],[
3907 $curl_includes_string
3909 AC_MSG_RESULT([yes])
3910 tst_proto_strdup="yes"
3913 tst_proto_strdup="no"
3917 if test "$tst_proto_strdup" = "yes"; then
3918 AC_MSG_CHECKING([if strdup is compilable])
3921 $curl_includes_string
3927 AC_MSG_RESULT([yes])
3928 tst_compi_strdup="yes"
3931 tst_compi_strdup="no"
3935 if test "$tst_compi_strdup" = "yes"; then
3936 AC_MSG_CHECKING([if strdup usage allowed])
3937 if test "x$curl_disallow_strdup" != "xyes"; then
3938 AC_MSG_RESULT([yes])
3939 tst_allow_strdup="yes"
3942 tst_allow_strdup="no"
3946 AC_MSG_CHECKING([if strdup might be used])
3947 if test "$tst_links_strdup" = "yes" &&
3948 test "$tst_proto_strdup" = "yes" &&
3949 test "$tst_compi_strdup" = "yes" &&
3950 test "$tst_allow_strdup" = "yes"; then
3951 AC_MSG_RESULT([yes])
3952 AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
3953 [Define to 1 if you have the strdup function.])
3954 ac_cv_func_strdup="yes"
3957 ac_cv_func_strdup="no"
3962 dnl CURL_CHECK_FUNC_STRERROR_R
3963 dnl -------------------------------------------------
3964 dnl Verify if strerror_r is available, prototyped, can be compiled and
3965 dnl seems to work. If all of these are true, and usage has not been
3966 dnl previously disallowed with shell variable curl_disallow_strerror_r,
3967 dnl then HAVE_STRERROR_R and STRERROR_R_TYPE_ARG3 will be defined, as
3968 dnl well as one of HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R.
3970 dnl glibc-style strerror_r:
3972 dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize);
3974 dnl glibc-style strerror_r returns a pointer to the the error string,
3975 dnl and might use the provided workbuf as a scratch area if needed. A
3976 dnl quick test on a few systems shows that it's usually not used at all.
3978 dnl POSIX-style strerror_r:
3980 dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize);
3982 dnl POSIX-style strerror_r returns 0 upon successful completion and the
3983 dnl error string in the provided resultbuf.
3986 AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
3987 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
3988 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
3990 tst_links_strerror_r="unknown"
3991 tst_proto_strerror_r="unknown"
3992 tst_compi_strerror_r="unknown"
3993 tst_glibc_strerror_r="unknown"
3994 tst_posix_strerror_r="unknown"
3995 tst_allow_strerror_r="unknown"
3996 tst_works_glibc_strerror_r="unknown"
3997 tst_works_posix_strerror_r="unknown"
3998 tst_glibc_strerror_r_type_arg3="unknown"
3999 tst_posix_strerror_r_type_arg3="unknown"
4001 AC_MSG_CHECKING([if strerror_r can be linked])
4003 AC_LANG_FUNC_LINK_TRY([strerror_r])
4005 AC_MSG_RESULT([yes])
4006 tst_links_strerror_r="yes"
4009 tst_links_strerror_r="no"
4012 if test "$tst_links_strerror_r" = "yes"; then
4013 AC_MSG_CHECKING([if strerror_r is prototyped])
4014 AC_EGREP_CPP([strerror_r],[
4015 $curl_includes_string
4017 AC_MSG_RESULT([yes])
4018 tst_proto_strerror_r="yes"
4021 tst_proto_strerror_r="no"
4025 if test "$tst_proto_strerror_r" = "yes"; then
4026 AC_MSG_CHECKING([if strerror_r is compilable])
4029 $curl_includes_string
4031 if(0 != strerror_r(0, 0, 0))
4035 AC_MSG_RESULT([yes])
4036 tst_compi_strerror_r="yes"
4039 tst_compi_strerror_r="no"
4043 if test "$tst_compi_strerror_r" = "yes"; then
4044 AC_MSG_CHECKING([if strerror_r is glibc like])
4045 tst_glibc_strerror_r_type_arg3="unknown"
4046 for arg3 in 'size_t' 'int' 'unsigned int'; do
4047 if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then
4050 $curl_includes_string
4052 char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
4053 if(0 != strerror_r(0, 0, 0))
4057 tst_glibc_strerror_r_type_arg3="$arg3"
4061 case "$tst_glibc_strerror_r_type_arg3" in
4064 tst_glibc_strerror_r="no"
4067 AC_MSG_RESULT([yes])
4068 tst_glibc_strerror_r="yes"
4073 dnl only do runtime verification when not cross-compiling
4074 if test "x$cross_compiling" != "xyes" &&
4075 test "$tst_glibc_strerror_r" = "yes"; then
4076 AC_MSG_CHECKING([if strerror_r seems to work])
4079 $curl_includes_stdlib
4080 $curl_includes_string
4086 string = strerror_r(EACCES, buffer, sizeof(buffer));
4095 AC_MSG_RESULT([yes])
4096 tst_works_glibc_strerror_r="yes"
4099 tst_works_glibc_strerror_r="no"
4103 if test "$tst_compi_strerror_r" = "yes" &&
4104 test "$tst_works_glibc_strerror_r" != "yes"; then
4105 AC_MSG_CHECKING([if strerror_r is POSIX like])
4106 tst_posix_strerror_r_type_arg3="unknown"
4107 for arg3 in 'size_t' 'int' 'unsigned int'; do
4108 if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then
4111 $curl_includes_string
4113 int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
4114 if(0 != strerror_r(0, 0, 0))
4118 tst_posix_strerror_r_type_arg3="$arg3"
4122 case "$tst_posix_strerror_r_type_arg3" in
4125 tst_posix_strerror_r="no"
4128 AC_MSG_RESULT([yes])
4129 tst_posix_strerror_r="yes"
4134 dnl only do runtime verification when not cross-compiling
4135 if test "x$cross_compiling" != "xyes" &&
4136 test "$tst_posix_strerror_r" = "yes"; then
4137 AC_MSG_CHECKING([if strerror_r seems to work])
4140 $curl_includes_stdlib
4141 $curl_includes_string
4147 error = strerror_r(EACCES, buffer, sizeof(buffer));
4150 if(buffer[0] == '\0')
4156 AC_MSG_RESULT([yes])
4157 tst_works_posix_strerror_r="yes"
4160 tst_works_posix_strerror_r="no"
4164 if test "$tst_works_glibc_strerror_r" = "yes"; then
4165 tst_posix_strerror_r="no"
4167 if test "$tst_works_posix_strerror_r" = "yes"; then
4168 tst_glibc_strerror_r="no"
4170 if test "$tst_glibc_strerror_r" = "yes" &&
4171 test "$tst_works_glibc_strerror_r" != "no" &&
4172 test "$tst_posix_strerror_r" != "yes"; then
4173 tst_allow_strerror_r="check"
4175 if test "$tst_posix_strerror_r" = "yes" &&
4176 test "$tst_works_posix_strerror_r" != "no" &&
4177 test "$tst_glibc_strerror_r" != "yes"; then
4178 tst_allow_strerror_r="check"
4180 if test "$tst_allow_strerror_r" = "check"; then
4181 AC_MSG_CHECKING([if strerror_r usage allowed])
4182 if test "x$curl_disallow_strerror_r" != "xyes"; then
4183 AC_MSG_RESULT([yes])
4184 tst_allow_strerror_r="yes"
4187 tst_allow_strerror_r="no"
4191 AC_MSG_CHECKING([if strerror_r might be used])
4192 if test "$tst_links_strerror_r" = "yes" &&
4193 test "$tst_proto_strerror_r" = "yes" &&
4194 test "$tst_compi_strerror_r" = "yes" &&
4195 test "$tst_allow_strerror_r" = "yes"; then
4196 AC_MSG_RESULT([yes])
4197 if test "$tst_glibc_strerror_r" = "yes"; then
4198 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
4199 [Define to 1 if you have the strerror_r function.])
4200 AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1,
4201 [Define to 1 if you have a working glibc-style strerror_r function.])
4202 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_glibc_strerror_r_type_arg3,
4203 [Define to the type of arg 3 for strerror_r.])
4205 if test "$tst_posix_strerror_r" = "yes"; then
4206 AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
4207 [Define to 1 if you have the strerror_r function.])
4208 AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1,
4209 [Define to 1 if you have a working POSIX-style strerror_r function.])
4210 AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_posix_strerror_r_type_arg3,
4211 [Define to the type of arg 3 for strerror_r.])
4213 ac_cv_func_strerror_r="yes"
4216 ac_cv_func_strerror_r="no"
4219 if test "$tst_compi_strerror_r" = "yes" &&
4220 test "$tst_allow_strerror_r" = "unknown"; then
4221 AC_MSG_WARN([cannot determine strerror_r() style: edit lib/config.h manually.])
4227 dnl CURL_CHECK_FUNC_STRICMP
4228 dnl -------------------------------------------------
4229 dnl Verify if stricmp is available, prototyped, and
4230 dnl can be compiled. If all of these are true, and
4231 dnl usage has not been previously disallowed with
4232 dnl shell variable curl_disallow_stricmp, then
4233 dnl HAVE_STRICMP will be defined.
4235 AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [
4236 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4238 tst_links_stricmp="unknown"
4239 tst_proto_stricmp="unknown"
4240 tst_compi_stricmp="unknown"
4241 tst_allow_stricmp="unknown"
4243 AC_MSG_CHECKING([if stricmp can be linked])
4245 AC_LANG_FUNC_LINK_TRY([stricmp])
4247 AC_MSG_RESULT([yes])
4248 tst_links_stricmp="yes"
4251 tst_links_stricmp="no"
4254 if test "$tst_links_stricmp" = "yes"; then
4255 AC_MSG_CHECKING([if stricmp is prototyped])
4256 AC_EGREP_CPP([stricmp],[
4257 $curl_includes_string
4259 AC_MSG_RESULT([yes])
4260 tst_proto_stricmp="yes"
4263 tst_proto_stricmp="no"
4267 if test "$tst_proto_stricmp" = "yes"; then
4268 AC_MSG_CHECKING([if stricmp is compilable])
4271 $curl_includes_string
4273 if(0 != stricmp(0, 0))
4277 AC_MSG_RESULT([yes])
4278 tst_compi_stricmp="yes"
4281 tst_compi_stricmp="no"
4285 if test "$tst_compi_stricmp" = "yes"; then
4286 AC_MSG_CHECKING([if stricmp usage allowed])
4287 if test "x$curl_disallow_stricmp" != "xyes"; then
4288 AC_MSG_RESULT([yes])
4289 tst_allow_stricmp="yes"
4292 tst_allow_stricmp="no"
4296 AC_MSG_CHECKING([if stricmp might be used])
4297 if test "$tst_links_stricmp" = "yes" &&
4298 test "$tst_proto_stricmp" = "yes" &&
4299 test "$tst_compi_stricmp" = "yes" &&
4300 test "$tst_allow_stricmp" = "yes"; then
4301 AC_MSG_RESULT([yes])
4302 AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
4303 [Define to 1 if you have the stricmp function.])
4304 ac_cv_func_stricmp="yes"
4307 ac_cv_func_stricmp="no"
4312 dnl CURL_CHECK_FUNC_STRLCAT
4313 dnl -------------------------------------------------
4314 dnl Verify if strlcat is available, prototyped, and
4315 dnl can be compiled. If all of these are true, and
4316 dnl usage has not been previously disallowed with
4317 dnl shell variable curl_disallow_strlcat, then
4318 dnl HAVE_STRLCAT will be defined.
4320 AC_DEFUN([CURL_CHECK_FUNC_STRLCAT], [
4321 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4323 tst_links_strlcat="unknown"
4324 tst_proto_strlcat="unknown"
4325 tst_compi_strlcat="unknown"
4326 tst_allow_strlcat="unknown"
4328 AC_MSG_CHECKING([if strlcat can be linked])
4330 AC_LANG_FUNC_LINK_TRY([strlcat])
4332 AC_MSG_RESULT([yes])
4333 tst_links_strlcat="yes"
4336 tst_links_strlcat="no"
4339 if test "$tst_links_strlcat" = "yes"; then
4340 AC_MSG_CHECKING([if strlcat is prototyped])
4341 AC_EGREP_CPP([strlcat],[
4342 $curl_includes_string
4344 AC_MSG_RESULT([yes])
4345 tst_proto_strlcat="yes"
4348 tst_proto_strlcat="no"
4352 if test "$tst_proto_strlcat" = "yes"; then
4353 AC_MSG_CHECKING([if strlcat is compilable])
4356 $curl_includes_string
4358 if(0 != strlcat(0, 0, 0))
4362 AC_MSG_RESULT([yes])
4363 tst_compi_strlcat="yes"
4366 tst_compi_strlcat="no"
4370 if test "$tst_compi_strlcat" = "yes"; then
4371 AC_MSG_CHECKING([if strlcat usage allowed])
4372 if test "x$curl_disallow_strlcat" != "xyes"; then
4373 AC_MSG_RESULT([yes])
4374 tst_allow_strlcat="yes"
4377 tst_allow_strlcat="no"
4381 AC_MSG_CHECKING([if strlcat might be used])
4382 if test "$tst_links_strlcat" = "yes" &&
4383 test "$tst_proto_strlcat" = "yes" &&
4384 test "$tst_compi_strlcat" = "yes" &&
4385 test "$tst_allow_strlcat" = "yes"; then
4386 AC_MSG_RESULT([yes])
4387 AC_DEFINE_UNQUOTED(HAVE_STRLCAT, 1,
4388 [Define to 1 if you have the strlcat function.])
4389 ac_cv_func_strlcat="yes"
4392 ac_cv_func_strlcat="no"
4397 dnl CURL_CHECK_FUNC_STRNCASECMP
4398 dnl -------------------------------------------------
4399 dnl Verify if strncasecmp is available, prototyped, and
4400 dnl can be compiled. If all of these are true, and
4401 dnl usage has not been previously disallowed with
4402 dnl shell variable curl_disallow_strncasecmp, then
4403 dnl HAVE_STRNCASECMP will be defined.
4405 AC_DEFUN([CURL_CHECK_FUNC_STRNCASECMP], [
4406 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4408 tst_links_strncasecmp="unknown"
4409 tst_proto_strncasecmp="unknown"
4410 tst_compi_strncasecmp="unknown"
4411 tst_allow_strncasecmp="unknown"
4413 AC_MSG_CHECKING([if strncasecmp can be linked])
4415 AC_LANG_FUNC_LINK_TRY([strncasecmp])
4417 AC_MSG_RESULT([yes])
4418 tst_links_strncasecmp="yes"
4421 tst_links_strncasecmp="no"
4424 if test "$tst_links_strncasecmp" = "yes"; then
4425 AC_MSG_CHECKING([if strncasecmp is prototyped])
4426 AC_EGREP_CPP([strncasecmp],[
4427 $curl_includes_string
4429 AC_MSG_RESULT([yes])
4430 tst_proto_strncasecmp="yes"
4433 tst_proto_strncasecmp="no"
4437 if test "$tst_proto_strncasecmp" = "yes"; then
4438 AC_MSG_CHECKING([if strncasecmp is compilable])
4441 $curl_includes_string
4443 if(0 != strncasecmp(0, 0, 0))
4447 AC_MSG_RESULT([yes])
4448 tst_compi_strncasecmp="yes"
4451 tst_compi_strncasecmp="no"
4455 if test "$tst_compi_strncasecmp" = "yes"; then
4456 AC_MSG_CHECKING([if strncasecmp usage allowed])
4457 if test "x$curl_disallow_strncasecmp" != "xyes"; then
4458 AC_MSG_RESULT([yes])
4459 tst_allow_strncasecmp="yes"
4462 tst_allow_strncasecmp="no"
4466 AC_MSG_CHECKING([if strncasecmp might be used])
4467 if test "$tst_links_strncasecmp" = "yes" &&
4468 test "$tst_proto_strncasecmp" = "yes" &&
4469 test "$tst_compi_strncasecmp" = "yes" &&
4470 test "$tst_allow_strncasecmp" = "yes"; then
4471 AC_MSG_RESULT([yes])
4472 AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1,
4473 [Define to 1 if you have the strncasecmp function.])
4474 ac_cv_func_strncasecmp="yes"
4477 ac_cv_func_strncasecmp="no"
4482 dnl CURL_CHECK_FUNC_STRNCMPI
4483 dnl -------------------------------------------------
4484 dnl Verify if strncmpi is available, prototyped, and
4485 dnl can be compiled. If all of these are true, and
4486 dnl usage has not been previously disallowed with
4487 dnl shell variable curl_disallow_strncmpi, then
4488 dnl HAVE_STRNCMPI will be defined.
4490 AC_DEFUN([CURL_CHECK_FUNC_STRNCMPI], [
4491 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4493 tst_links_strncmpi="unknown"
4494 tst_proto_strncmpi="unknown"
4495 tst_compi_strncmpi="unknown"
4496 tst_allow_strncmpi="unknown"
4498 AC_MSG_CHECKING([if strncmpi can be linked])
4500 AC_LANG_FUNC_LINK_TRY([strncmpi])
4502 AC_MSG_RESULT([yes])
4503 tst_links_strncmpi="yes"
4506 tst_links_strncmpi="no"
4509 if test "$tst_links_strncmpi" = "yes"; then
4510 AC_MSG_CHECKING([if strncmpi is prototyped])
4511 AC_EGREP_CPP([strncmpi],[
4512 $curl_includes_string
4514 AC_MSG_RESULT([yes])
4515 tst_proto_strncmpi="yes"
4518 tst_proto_strncmpi="no"
4522 if test "$tst_proto_strncmpi" = "yes"; then
4523 AC_MSG_CHECKING([if strncmpi is compilable])
4526 $curl_includes_string
4528 if(0 != strncmpi(0, 0))
4532 AC_MSG_RESULT([yes])
4533 tst_compi_strncmpi="yes"
4536 tst_compi_strncmpi="no"
4540 if test "$tst_compi_strncmpi" = "yes"; then
4541 AC_MSG_CHECKING([if strncmpi usage allowed])
4542 if test "x$curl_disallow_strncmpi" != "xyes"; then
4543 AC_MSG_RESULT([yes])
4544 tst_allow_strncmpi="yes"
4547 tst_allow_strncmpi="no"
4551 AC_MSG_CHECKING([if strncmpi might be used])
4552 if test "$tst_links_strncmpi" = "yes" &&
4553 test "$tst_proto_strncmpi" = "yes" &&
4554 test "$tst_compi_strncmpi" = "yes" &&
4555 test "$tst_allow_strncmpi" = "yes"; then
4556 AC_MSG_RESULT([yes])
4557 AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1,
4558 [Define to 1 if you have the strncmpi function.])
4559 ac_cv_func_strncmpi="yes"
4562 ac_cv_func_strncmpi="no"
4567 dnl CURL_CHECK_FUNC_STRNICMP
4568 dnl -------------------------------------------------
4569 dnl Verify if strnicmp is available, prototyped, and
4570 dnl can be compiled. If all of these are true, and
4571 dnl usage has not been previously disallowed with
4572 dnl shell variable curl_disallow_strnicmp, then
4573 dnl HAVE_STRNICMP will be defined.
4575 AC_DEFUN([CURL_CHECK_FUNC_STRNICMP], [
4576 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4578 tst_links_strnicmp="unknown"
4579 tst_proto_strnicmp="unknown"
4580 tst_compi_strnicmp="unknown"
4581 tst_allow_strnicmp="unknown"
4583 AC_MSG_CHECKING([if strnicmp can be linked])
4585 AC_LANG_FUNC_LINK_TRY([strnicmp])
4587 AC_MSG_RESULT([yes])
4588 tst_links_strnicmp="yes"
4591 tst_links_strnicmp="no"
4594 if test "$tst_links_strnicmp" = "yes"; then
4595 AC_MSG_CHECKING([if strnicmp is prototyped])
4596 AC_EGREP_CPP([strnicmp],[
4597 $curl_includes_string
4599 AC_MSG_RESULT([yes])
4600 tst_proto_strnicmp="yes"
4603 tst_proto_strnicmp="no"
4607 if test "$tst_proto_strnicmp" = "yes"; then
4608 AC_MSG_CHECKING([if strnicmp is compilable])
4611 $curl_includes_string
4613 if(0 != strnicmp(0, 0))
4617 AC_MSG_RESULT([yes])
4618 tst_compi_strnicmp="yes"
4621 tst_compi_strnicmp="no"
4625 if test "$tst_compi_strnicmp" = "yes"; then
4626 AC_MSG_CHECKING([if strnicmp usage allowed])
4627 if test "x$curl_disallow_strnicmp" != "xyes"; then
4628 AC_MSG_RESULT([yes])
4629 tst_allow_strnicmp="yes"
4632 tst_allow_strnicmp="no"
4636 AC_MSG_CHECKING([if strnicmp might be used])
4637 if test "$tst_links_strnicmp" = "yes" &&
4638 test "$tst_proto_strnicmp" = "yes" &&
4639 test "$tst_compi_strnicmp" = "yes" &&
4640 test "$tst_allow_strnicmp" = "yes"; then
4641 AC_MSG_RESULT([yes])
4642 AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1,
4643 [Define to 1 if you have the strnicmp function.])
4644 ac_cv_func_strnicmp="yes"
4647 ac_cv_func_strnicmp="no"
4652 dnl CURL_CHECK_FUNC_STRSTR
4653 dnl -------------------------------------------------
4654 dnl Verify if strstr is available, prototyped, and
4655 dnl can be compiled. If all of these are true, and
4656 dnl usage has not been previously disallowed with
4657 dnl shell variable curl_disallow_strstr, then
4658 dnl HAVE_STRSTR will be defined.
4660 AC_DEFUN([CURL_CHECK_FUNC_STRSTR], [
4661 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4663 tst_links_strstr="unknown"
4664 tst_proto_strstr="unknown"
4665 tst_compi_strstr="unknown"
4666 tst_allow_strstr="unknown"
4668 AC_MSG_CHECKING([if strstr can be linked])
4670 AC_LANG_FUNC_LINK_TRY([strstr])
4672 AC_MSG_RESULT([yes])
4673 tst_links_strstr="yes"
4676 tst_links_strstr="no"
4679 if test "$tst_links_strstr" = "yes"; then
4680 AC_MSG_CHECKING([if strstr is prototyped])
4681 AC_EGREP_CPP([strstr],[
4682 $curl_includes_string
4684 AC_MSG_RESULT([yes])
4685 tst_proto_strstr="yes"
4688 tst_proto_strstr="no"
4692 if test "$tst_proto_strstr" = "yes"; then
4693 AC_MSG_CHECKING([if strstr is compilable])
4696 $curl_includes_string
4698 if(0 != strstr(0, 0))
4702 AC_MSG_RESULT([yes])
4703 tst_compi_strstr="yes"
4706 tst_compi_strstr="no"
4710 if test "$tst_compi_strstr" = "yes"; then
4711 AC_MSG_CHECKING([if strstr usage allowed])
4712 if test "x$curl_disallow_strstr" != "xyes"; then
4713 AC_MSG_RESULT([yes])
4714 tst_allow_strstr="yes"
4717 tst_allow_strstr="no"
4721 AC_MSG_CHECKING([if strstr might be used])
4722 if test "$tst_links_strstr" = "yes" &&
4723 test "$tst_proto_strstr" = "yes" &&
4724 test "$tst_compi_strstr" = "yes" &&
4725 test "$tst_allow_strstr" = "yes"; then
4726 AC_MSG_RESULT([yes])
4727 AC_DEFINE_UNQUOTED(HAVE_STRSTR, 1,
4728 [Define to 1 if you have the strstr function.])
4729 ac_cv_func_strstr="yes"
4732 ac_cv_func_strstr="no"
4737 dnl CURL_CHECK_FUNC_STRTOK_R
4738 dnl -------------------------------------------------
4739 dnl Verify if strtok_r is available, prototyped, and
4740 dnl can be compiled. If all of these are true, and
4741 dnl usage has not been previously disallowed with
4742 dnl shell variable curl_disallow_strtok_r, then
4743 dnl HAVE_STRTOK_R will be defined.
4745 AC_DEFUN([CURL_CHECK_FUNC_STRTOK_R], [
4746 AC_REQUIRE([CURL_INCLUDES_STRING])dnl
4748 tst_links_strtok_r="unknown"
4749 tst_proto_strtok_r="unknown"
4750 tst_compi_strtok_r="unknown"
4751 tst_allow_strtok_r="unknown"
4753 AC_MSG_CHECKING([if strtok_r can be linked])
4755 AC_LANG_FUNC_LINK_TRY([strtok_r])
4757 AC_MSG_RESULT([yes])
4758 tst_links_strtok_r="yes"
4761 tst_links_strtok_r="no"
4764 if test "$tst_links_strtok_r" = "yes"; then
4765 AC_MSG_CHECKING([if strtok_r is prototyped])
4766 AC_EGREP_CPP([strtok_r],[
4767 $curl_includes_string
4769 AC_MSG_RESULT([yes])
4770 tst_proto_strtok_r="yes"
4773 tst_proto_strtok_r="no"
4777 if test "$tst_proto_strtok_r" = "yes"; then
4778 AC_MSG_CHECKING([if strtok_r is compilable])
4781 $curl_includes_string
4783 if(0 != strtok_r(0, 0, 0))
4787 AC_MSG_RESULT([yes])
4788 tst_compi_strtok_r="yes"
4791 tst_compi_strtok_r="no"
4795 if test "$tst_compi_strtok_r" = "yes"; then
4796 AC_MSG_CHECKING([if strtok_r usage allowed])
4797 if test "x$curl_disallow_strtok_r" != "xyes"; then
4798 AC_MSG_RESULT([yes])
4799 tst_allow_strtok_r="yes"
4802 tst_allow_strtok_r="no"
4806 AC_MSG_CHECKING([if strtok_r might be used])
4807 if test "$tst_links_strtok_r" = "yes" &&
4808 test "$tst_proto_strtok_r" = "yes" &&
4809 test "$tst_compi_strtok_r" = "yes" &&
4810 test "$tst_allow_strtok_r" = "yes"; then
4811 AC_MSG_RESULT([yes])
4812 AC_DEFINE_UNQUOTED(HAVE_STRTOK_R, 1,
4813 [Define to 1 if you have the strtok_r function.])
4814 ac_cv_func_strtok_r="yes"
4817 ac_cv_func_strtok_r="no"
4822 dnl CURL_CHECK_FUNC_STRTOLL
4823 dnl -------------------------------------------------
4824 dnl Verify if strtoll is available, prototyped, and
4825 dnl can be compiled. If all of these are true, and
4826 dnl usage has not been previously disallowed with
4827 dnl shell variable curl_disallow_strtoll, then
4828 dnl HAVE_STRTOLL will be defined.
4830 AC_DEFUN([CURL_CHECK_FUNC_STRTOLL], [
4831 AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
4833 tst_links_strtoll="unknown"
4834 tst_proto_strtoll="unknown"
4835 tst_compi_strtoll="unknown"
4836 tst_allow_strtoll="unknown"
4838 AC_MSG_CHECKING([if strtoll can be linked])
4840 AC_LANG_FUNC_LINK_TRY([strtoll])
4842 AC_MSG_RESULT([yes])
4843 tst_links_strtoll="yes"
4846 tst_links_strtoll="no"
4849 if test "$tst_links_strtoll" = "yes"; then
4850 AC_MSG_CHECKING([if strtoll is prototyped])
4851 AC_EGREP_CPP([strtoll],[
4852 $curl_includes_stdlib
4854 AC_MSG_RESULT([yes])
4855 tst_proto_strtoll="yes"
4858 tst_proto_strtoll="no"
4862 if test "$tst_proto_strtoll" = "yes"; then
4863 AC_MSG_CHECKING([if strtoll is compilable])
4866 $curl_includes_stdlib
4868 if(0 != strtoll(0, 0, 0))
4872 AC_MSG_RESULT([yes])
4873 tst_compi_strtoll="yes"
4876 tst_compi_strtoll="no"
4880 if test "$tst_compi_strtoll" = "yes"; then
4881 AC_MSG_CHECKING([if strtoll usage allowed])
4882 if test "x$curl_disallow_strtoll" != "xyes"; then
4883 AC_MSG_RESULT([yes])
4884 tst_allow_strtoll="yes"
4887 tst_allow_strtoll="no"
4891 AC_MSG_CHECKING([if strtoll might be used])
4892 if test "$tst_links_strtoll" = "yes" &&
4893 test "$tst_proto_strtoll" = "yes" &&
4894 test "$tst_compi_strtoll" = "yes" &&
4895 test "$tst_allow_strtoll" = "yes"; then
4896 AC_MSG_RESULT([yes])
4897 AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
4898 [Define to 1 if you have the strtoll function.])
4899 ac_cv_func_strtoll="yes"
4902 ac_cv_func_strtoll="no"
4907 dnl CURL_CHECK_FUNC_WRITEV
4908 dnl -------------------------------------------------
4909 dnl Verify if writev is available, prototyped, and
4910 dnl can be compiled. If all of these are true, and
4911 dnl usage has not been previously disallowed with
4912 dnl shell variable curl_disallow_writev, then
4913 dnl HAVE_WRITEV will be defined.
4915 AC_DEFUN([CURL_CHECK_FUNC_WRITEV], [
4916 AC_REQUIRE([CURL_INCLUDES_SYS_UIO])dnl
4918 tst_links_writev="unknown"
4919 tst_proto_writev="unknown"
4920 tst_compi_writev="unknown"
4921 tst_allow_writev="unknown"
4923 AC_MSG_CHECKING([if writev can be linked])
4925 AC_LANG_FUNC_LINK_TRY([writev])
4927 AC_MSG_RESULT([yes])
4928 tst_links_writev="yes"
4931 tst_links_writev="no"
4934 if test "$tst_links_writev" = "yes"; then
4935 AC_MSG_CHECKING([if writev is prototyped])
4936 AC_EGREP_CPP([writev],[
4937 $curl_includes_sys_uio
4939 AC_MSG_RESULT([yes])
4940 tst_proto_writev="yes"
4943 tst_proto_writev="no"
4947 if test "$tst_proto_writev" = "yes"; then
4948 AC_MSG_CHECKING([if writev is compilable])
4951 $curl_includes_sys_uio
4953 if(0 != writev(0, 0, 0))
4957 AC_MSG_RESULT([yes])
4958 tst_compi_writev="yes"
4961 tst_compi_writev="no"
4965 if test "$tst_compi_writev" = "yes"; then
4966 AC_MSG_CHECKING([if writev usage allowed])
4967 if test "x$curl_disallow_writev" != "xyes"; then
4968 AC_MSG_RESULT([yes])
4969 tst_allow_writev="yes"
4972 tst_allow_writev="no"
4976 AC_MSG_CHECKING([if writev might be used])
4977 if test "$tst_links_writev" = "yes" &&
4978 test "$tst_proto_writev" = "yes" &&
4979 test "$tst_compi_writev" = "yes" &&
4980 test "$tst_allow_writev" = "yes"; then
4981 AC_MSG_RESULT([yes])
4982 AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1,
4983 [Define to 1 if you have the writev function.])
4984 ac_cv_func_writev="yes"
4987 ac_cv_func_writev="no"